zcode-app-cli 3.8.1-15 → 3.9.2-16

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 (154) hide show
  1. package/bin/zcode.js +109 -47
  2. package/config.example.json +14 -0
  3. package/package.json +2 -2
  4. package/vendor/extraction.json +131 -5
  5. package/vendor/node_modules/@zcode/tui/dist/index.js +52 -4
  6. package/vendor/packages/browser-use-plugin/.zcode-plugin/plugin.json +1 -1
  7. package/vendor/packages/browser-use-plugin/dist/mcp/server.js +12862 -10414
  8. package/vendor/packages/browser-use-plugin/docs/api.json +5 -0
  9. package/vendor/packages/browser-use-plugin/docs/overview.md +3 -0
  10. package/vendor/packages/browser-use-plugin/package.json +1 -1
  11. package/vendor/packages/browser-use-plugin/scripts/browser-client.mjs +63 -7
  12. package/vendor/packages/browser-use-plugin/skills/control-browser/SKILL.md +4 -1
  13. package/vendor/packages/document-skills-plugin/.mcp.json +13 -0
  14. package/vendor/packages/document-skills-plugin/.zcode-plugin/plugin.json +19 -6
  15. package/vendor/packages/document-skills-plugin/package.json +3 -3
  16. package/vendor/packages/document-skills-plugin/skills/docx/SKILL.md +6 -2
  17. package/vendor/packages/document-skills-plugin/skills/docx/env_setup/env_check.sh +0 -0
  18. package/vendor/packages/document-skills-plugin/skills/docx/env_setup/setup_mac_linux.sh +0 -0
  19. package/vendor/packages/document-skills-plugin/skills/docx/setup.sh +0 -0
  20. package/vendor/packages/document-skills-plugin/skills/pdf/SKILL.md +39 -20
  21. package/vendor/packages/document-skills-plugin/skills/pdf/briefs/academic.md +39 -47
  22. package/vendor/packages/document-skills-plugin/skills/pdf/briefs/creative.md +11 -3
  23. package/vendor/packages/document-skills-plugin/skills/pdf/briefs/poster.md +3 -0
  24. package/vendor/packages/document-skills-plugin/skills/pdf/briefs/process.md +3 -0
  25. package/vendor/packages/document-skills-plugin/skills/pdf/briefs/report.md +41 -62
  26. package/vendor/packages/document-skills-plugin/skills/pdf/env_setup/env_check.sh +23 -15
  27. package/vendor/packages/document-skills-plugin/skills/pdf/env_setup/setup.md +37 -19
  28. package/vendor/packages/document-skills-plugin/skills/pdf/env_setup/setup_mac_linux.sh +0 -0
  29. package/vendor/packages/document-skills-plugin/skills/pdf/env_setup/setup_windows.ps1 +17 -19
  30. package/vendor/packages/document-skills-plugin/skills/pdf/scripts/cover_render.py +487 -0
  31. package/vendor/packages/document-skills-plugin/skills/pdf/scripts/html2poster.js +43 -11
  32. package/vendor/packages/document-skills-plugin/skills/pdf/scripts/pdf.py +145 -50
  33. package/vendor/packages/document-skills-plugin/skills/pdf/scripts/setup.sh +23 -21
  34. package/vendor/packages/document-skills-plugin/skills/pdf/typesetting/cover-backgrounds.md +1 -1
  35. package/vendor/packages/document-skills-plugin/skills/pdf/typesetting/cover.md +139 -1347
  36. package/vendor/packages/document-skills-plugin/skills/pptx/LICENSE.txt +13 -0
  37. package/vendor/packages/document-skills-plugin/skills/pptx/SKILL.md +149 -180
  38. package/vendor/packages/document-skills-plugin/skills/xlsx/SKILL.md +6 -2
  39. package/vendor/packages/document-skills-plugin/skills/xlsx/env_setup/env_check.sh +0 -0
  40. package/vendor/packages/document-skills-plugin/skills/xlsx/env_setup/setup_mac_linux.sh +0 -0
  41. package/vendor/packages/document-skills-plugin/skills/xlsx/setup.sh +0 -0
  42. package/vendor/packages/zcode-cua-plugin/.zcode-plugin/plugin.json +19 -0
  43. package/vendor/packages/zcode-cua-plugin/dist/mcp/server.js +68048 -0
  44. package/vendor/packages/zcode-cua-plugin/node_modules/@img/colour/color.cjs +1596 -0
  45. package/vendor/packages/zcode-cua-plugin/node_modules/@img/colour/index.cjs +1 -0
  46. package/vendor/packages/zcode-cua-plugin/node_modules/@img/colour/package.json +58 -0
  47. package/vendor/packages/zcode-cua-plugin/node_modules/@img/sharp-libvips-linux-x64/lib/glib-2.0/include/glibconfig.h +221 -0
  48. package/vendor/packages/zcode-cua-plugin/node_modules/@img/sharp-libvips-linux-x64/lib/index.js +1 -0
  49. package/vendor/packages/zcode-cua-plugin/node_modules/@img/sharp-libvips-linux-x64/lib/libvips-cpp.so.8.17.3 +0 -0
  50. package/vendor/packages/zcode-cua-plugin/node_modules/@img/sharp-libvips-linux-x64/package.json +42 -0
  51. package/vendor/packages/zcode-cua-plugin/node_modules/@img/sharp-libvips-linux-x64/versions.json +30 -0
  52. package/vendor/packages/zcode-cua-plugin/node_modules/@img/sharp-linux-x64/LICENSE +191 -0
  53. package/vendor/packages/zcode-cua-plugin/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
  54. package/vendor/packages/zcode-cua-plugin/node_modules/@img/sharp-linux-x64/package.json +46 -0
  55. package/vendor/packages/zcode-cua-plugin/node_modules/detect-libc/LICENSE +201 -0
  56. package/vendor/packages/zcode-cua-plugin/node_modules/detect-libc/lib/detect-libc.js +313 -0
  57. package/vendor/packages/zcode-cua-plugin/node_modules/detect-libc/lib/elf.js +39 -0
  58. package/vendor/packages/zcode-cua-plugin/node_modules/detect-libc/lib/filesystem.js +51 -0
  59. package/vendor/packages/zcode-cua-plugin/node_modules/detect-libc/lib/process.js +24 -0
  60. package/vendor/packages/zcode-cua-plugin/node_modules/detect-libc/package.json +44 -0
  61. package/vendor/packages/zcode-cua-plugin/node_modules/semver/LICENSE +15 -0
  62. package/vendor/packages/zcode-cua-plugin/node_modules/semver/bin/semver.js +191 -0
  63. package/vendor/packages/zcode-cua-plugin/node_modules/semver/classes/comparator.js +143 -0
  64. package/vendor/packages/zcode-cua-plugin/node_modules/semver/classes/index.js +7 -0
  65. package/vendor/packages/zcode-cua-plugin/node_modules/semver/classes/range.js +557 -0
  66. package/vendor/packages/zcode-cua-plugin/node_modules/semver/classes/semver.js +333 -0
  67. package/vendor/packages/zcode-cua-plugin/node_modules/semver/functions/clean.js +8 -0
  68. package/vendor/packages/zcode-cua-plugin/node_modules/semver/functions/cmp.js +54 -0
  69. package/vendor/packages/zcode-cua-plugin/node_modules/semver/functions/coerce.js +62 -0
  70. package/vendor/packages/zcode-cua-plugin/node_modules/semver/functions/compare-build.js +9 -0
  71. package/vendor/packages/zcode-cua-plugin/node_modules/semver/functions/compare-loose.js +5 -0
  72. package/vendor/packages/zcode-cua-plugin/node_modules/semver/functions/compare.js +7 -0
  73. package/vendor/packages/zcode-cua-plugin/node_modules/semver/functions/diff.js +60 -0
  74. package/vendor/packages/zcode-cua-plugin/node_modules/semver/functions/eq.js +5 -0
  75. package/vendor/packages/zcode-cua-plugin/node_modules/semver/functions/gt.js +5 -0
  76. package/vendor/packages/zcode-cua-plugin/node_modules/semver/functions/gte.js +5 -0
  77. package/vendor/packages/zcode-cua-plugin/node_modules/semver/functions/inc.js +21 -0
  78. package/vendor/packages/zcode-cua-plugin/node_modules/semver/functions/lt.js +5 -0
  79. package/vendor/packages/zcode-cua-plugin/node_modules/semver/functions/lte.js +5 -0
  80. package/vendor/packages/zcode-cua-plugin/node_modules/semver/functions/major.js +5 -0
  81. package/vendor/packages/zcode-cua-plugin/node_modules/semver/functions/minor.js +5 -0
  82. package/vendor/packages/zcode-cua-plugin/node_modules/semver/functions/neq.js +5 -0
  83. package/vendor/packages/zcode-cua-plugin/node_modules/semver/functions/parse.js +18 -0
  84. package/vendor/packages/zcode-cua-plugin/node_modules/semver/functions/patch.js +5 -0
  85. package/vendor/packages/zcode-cua-plugin/node_modules/semver/functions/prerelease.js +8 -0
  86. package/vendor/packages/zcode-cua-plugin/node_modules/semver/functions/rcompare.js +5 -0
  87. package/vendor/packages/zcode-cua-plugin/node_modules/semver/functions/rsort.js +5 -0
  88. package/vendor/packages/zcode-cua-plugin/node_modules/semver/functions/satisfies.js +12 -0
  89. package/vendor/packages/zcode-cua-plugin/node_modules/semver/functions/sort.js +5 -0
  90. package/vendor/packages/zcode-cua-plugin/node_modules/semver/functions/valid.js +8 -0
  91. package/vendor/packages/zcode-cua-plugin/node_modules/semver/index.js +91 -0
  92. package/vendor/packages/zcode-cua-plugin/node_modules/semver/internal/constants.js +37 -0
  93. package/vendor/packages/zcode-cua-plugin/node_modules/semver/internal/debug.js +11 -0
  94. package/vendor/packages/zcode-cua-plugin/node_modules/semver/internal/identifiers.js +29 -0
  95. package/vendor/packages/zcode-cua-plugin/node_modules/semver/internal/lrucache.js +42 -0
  96. package/vendor/packages/zcode-cua-plugin/node_modules/semver/internal/parse-options.js +17 -0
  97. package/vendor/packages/zcode-cua-plugin/node_modules/semver/internal/re.js +223 -0
  98. package/vendor/packages/zcode-cua-plugin/node_modules/semver/package.json +78 -0
  99. package/vendor/packages/zcode-cua-plugin/node_modules/semver/preload.js +4 -0
  100. package/vendor/packages/zcode-cua-plugin/node_modules/semver/range.bnf +16 -0
  101. package/vendor/packages/zcode-cua-plugin/node_modules/semver/ranges/gtr.js +6 -0
  102. package/vendor/packages/zcode-cua-plugin/node_modules/semver/ranges/intersects.js +9 -0
  103. package/vendor/packages/zcode-cua-plugin/node_modules/semver/ranges/ltr.js +6 -0
  104. package/vendor/packages/zcode-cua-plugin/node_modules/semver/ranges/max-satisfying.js +27 -0
  105. package/vendor/packages/zcode-cua-plugin/node_modules/semver/ranges/min-satisfying.js +26 -0
  106. package/vendor/packages/zcode-cua-plugin/node_modules/semver/ranges/min-version.js +63 -0
  107. package/vendor/packages/zcode-cua-plugin/node_modules/semver/ranges/outside.js +82 -0
  108. package/vendor/packages/zcode-cua-plugin/node_modules/semver/ranges/simplify.js +49 -0
  109. package/vendor/packages/zcode-cua-plugin/node_modules/semver/ranges/subset.js +249 -0
  110. package/vendor/packages/zcode-cua-plugin/node_modules/semver/ranges/to-comparators.js +10 -0
  111. package/vendor/packages/zcode-cua-plugin/node_modules/semver/ranges/valid.js +13 -0
  112. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/LICENSE +191 -0
  113. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/install/build.js +38 -0
  114. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/install/check.js +14 -0
  115. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/lib/channel.js +177 -0
  116. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/lib/colour.js +195 -0
  117. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/lib/composite.js +212 -0
  118. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/lib/constructor.js +499 -0
  119. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/lib/index.js +16 -0
  120. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/lib/input.js +809 -0
  121. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/lib/is.js +143 -0
  122. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/lib/libvips.js +207 -0
  123. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/lib/operation.js +1016 -0
  124. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/lib/output.js +1666 -0
  125. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/lib/resize.js +595 -0
  126. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/lib/sharp.js +121 -0
  127. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/lib/utility.js +291 -0
  128. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/package.json +202 -0
  129. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/src/binding.gyp +298 -0
  130. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/src/common.cc +1130 -0
  131. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/src/common.h +402 -0
  132. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/src/metadata.cc +346 -0
  133. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/src/metadata.h +90 -0
  134. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/src/operations.cc +499 -0
  135. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/src/operations.h +137 -0
  136. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/src/pipeline.cc +1814 -0
  137. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/src/pipeline.h +408 -0
  138. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/src/sharp.cc +43 -0
  139. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/src/stats.cc +186 -0
  140. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/src/stats.h +62 -0
  141. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/src/utilities.cc +288 -0
  142. package/vendor/packages/zcode-cua-plugin/node_modules/sharp/src/utilities.h +22 -0
  143. package/vendor/packages/zcode-cua-plugin/package.json +31 -0
  144. package/vendor/packages/zcode-cua-plugin/scripts/build-mcp.mjs +58 -0
  145. package/vendor/packages/zcode-cua-plugin/scripts/bump-zcode-cua-producer.mjs +291 -0
  146. package/vendor/packages/zcode-cua-plugin/scripts/check-cua-baseline.mjs +155 -0
  147. package/vendor/packages/zcode-cua-plugin/scripts/check-version-coherence.mjs +478 -0
  148. package/vendor/packages/zcode-cua-plugin/scripts/sync-cache.mjs +100 -0
  149. package/vendor/packages/zcode-cua-plugin/scripts/sync-skill-from-zcode-cua.mjs +115 -0
  150. package/vendor/packages/zcode-cua-plugin/skills/zcode-computer-use/SKILL.md +172 -0
  151. package/vendor/zcode.cjs +748 -740
  152. package/zcode-runtime.lock.json +3 -3
  153. package/vendor/packages/document-skills-plugin/skills/pptx/assets/font_list.txt +0 -80
  154. package/vendor/packages/document-skills-plugin/skills/pptx/scripts/general_judge.py +0 -529
package/bin/zcode.js CHANGED
@@ -20,6 +20,23 @@ var config_example_default = {
20
20
  "headers": {},
21
21
  "models": {
22
22
  "glm-5.3": { "name": "GLM-5.3" },
23
+ "glm-5.3-flash": {
24
+ "name": "GLM-5.3-Flash",
25
+ "attachment": true,
26
+ "supportsImages": true,
27
+ "supportsPdf": true,
28
+ "supportsVideo": true,
29
+ "limit": { "context": 1e6 },
30
+ "modalities": {
31
+ "input": [
32
+ "text",
33
+ "image",
34
+ "video",
35
+ "pdf"
36
+ ],
37
+ "output": ["text"]
38
+ }
39
+ },
23
40
  "glm-5.2": { "name": "GLM-5.2" },
24
41
  "glm-5.1": { "name": "GLM-5.1" },
25
42
  "glm-5-turbo": { "name": "GLM-5-Turbo" }
@@ -854,7 +871,7 @@ function managedAction(args) {
854
871
  if ((!action || action.startsWith("-")) && args.includes("--help")) return "help";
855
872
  return action && managedActions.has(action) ? action : void 0;
856
873
  }
857
- function isRecord(value) {
874
+ function isRecord$1(value) {
858
875
  return typeof value === "object" && value !== null && !Array.isArray(value);
859
876
  }
860
877
  function text(value) {
@@ -952,22 +969,22 @@ function writeJson(output, value) {
952
969
  output.write(`${JSON.stringify(value, null, 2)}\n`);
953
970
  }
954
971
  function diagnostics(value) {
955
- if (!isRecord(value) || !Array.isArray(value.diagnostics)) return [];
972
+ if (!isRecord$1(value) || !Array.isArray(value.diagnostics)) return [];
956
973
  return value.diagnostics.flatMap((entry) => {
957
- if (!isRecord(entry)) return [];
974
+ if (!isRecord$1(entry)) return [];
958
975
  const message = text(entry.message);
959
976
  return message ? [`${printable(text(entry.severity) ?? "warning")}: ${printable(message)}`] : [];
960
977
  });
961
978
  }
962
979
  function hasErrorDiagnostics(value) {
963
- return isRecord(value) && Array.isArray(value.diagnostics) && value.diagnostics.some((entry) => isRecord(entry) && entry.severity === "error");
980
+ return isRecord$1(value) && Array.isArray(value.diagnostics) && value.diagnostics.some((entry) => isRecord$1(entry) && entry.severity === "error");
964
981
  }
965
982
  function resultFailed(value) {
966
- return hasErrorDiagnostics(value) || isRecord(value) && value.ok === false;
983
+ return hasErrorDiagnostics(value) || isRecord$1(value) && value.ok === false;
967
984
  }
968
985
  function listSection(output, title, values, format) {
969
986
  output.write(`${title}:\n`);
970
- const items = Array.isArray(values) ? values.filter(isRecord) : [];
987
+ const items = Array.isArray(values) ? values.filter(isRecord$1) : [];
971
988
  if (items.length === 0) {
972
989
  output.write(" (none)\n");
973
990
  return;
@@ -975,7 +992,7 @@ function listSection(output, title, values, format) {
975
992
  for (const item of items) output.write(` - ${format(item)}\n`);
976
993
  }
977
994
  function renderOverview(output, result, marketplacesOnly = false) {
978
- const overview = isRecord(result) ? result : {};
995
+ const overview = isRecord$1(result) ? result : {};
979
996
  listSection(output, "Marketplaces", overview.marketplaces, (item) => {
980
997
  const count = typeof item.pluginCount === "number" ? ` (${item.pluginCount} plugins)` : "";
981
998
  return `${printable(item.id)}${count}${item.isOfficial === true ? " [official]" : ""}`;
@@ -990,23 +1007,23 @@ function renderOverview(output, result, marketplacesOnly = false) {
990
1007
  for (const diagnostic of diagnostics(overview)) output.write(`Diagnostic: ${diagnostic}\n`);
991
1008
  }
992
1009
  function componentSummary(result) {
993
- if (!isRecord(result) || !Array.isArray(result.components)) return [];
1010
+ if (!isRecord$1(result) || !Array.isArray(result.components)) return [];
994
1011
  return result.components.flatMap((component) => {
995
- if (!isRecord(component) || !text(component.kind) || !Array.isArray(component.items)) return [];
996
- const names = component.items.flatMap((item) => isRecord(item) && text(item.name) ? [printable(item.name)] : []);
1012
+ if (!isRecord$1(component) || !text(component.kind) || !Array.isArray(component.items)) return [];
1013
+ const names = component.items.flatMap((item) => isRecord$1(item) && text(item.name) ? [printable(item.name)] : []);
997
1014
  return names.length > 0 ? [`${printable(component.kind)}: ${names.join(", ")}`] : [];
998
1015
  });
999
1016
  }
1000
1017
  function renderInstallPreview(output, coordinate, description, plan) {
1001
1018
  output.write(`Plugin: ${coordinate.pluginName}@${coordinate.marketplace}\n`);
1002
- if (isRecord(description) && isRecord(description.metadata)) {
1019
+ if (isRecord$1(description) && isRecord$1(description.metadata)) {
1003
1020
  const metadata = description.metadata;
1004
1021
  const details = [text(metadata.version) && `v${printable(metadata.version)}`, text(metadata.author) && printable(metadata.author)].filter(Boolean);
1005
1022
  if (details.length > 0) output.write(`Metadata: ${details.join(" | ")}\n`);
1006
1023
  }
1007
1024
  const components = componentSummary(description);
1008
1025
  output.write(`Components: ${components.length > 0 ? components.join("; ") : "none declared"}\n`);
1009
- if (isRecord(plan) && Array.isArray(plan.dependencyClosure)) {
1026
+ if (isRecord$1(plan) && Array.isArray(plan.dependencyClosure)) {
1010
1027
  const closure = plan.dependencyClosure.map(printable);
1011
1028
  output.write(`Dependencies: ${closure.length > 0 ? closure.join(", ") : "none"}\n`);
1012
1029
  }
@@ -1015,10 +1032,10 @@ function renderInstallPreview(output, coordinate, description, plan) {
1015
1032
  function renderMutation(output, result, labels, changesApply = true) {
1016
1033
  const failed = resultFailed(result);
1017
1034
  output.write(`${failed ? labels.failure : labels.success}\n`);
1018
- if (isRecord(result)) {
1019
- const installed = Array.isArray(result.installedPlugins) ? result.installedPlugins.filter(isRecord) : [];
1035
+ if (isRecord$1(result)) {
1036
+ const installed = Array.isArray(result.installedPlugins) ? result.installedPlugins.filter(isRecord$1) : [];
1020
1037
  for (const plugin of installed) output.write(` - ${printable(plugin.id)}\n`);
1021
- if (isRecord(result.marketplace)) output.write(` - ${printable(result.marketplace.id)}\n`);
1038
+ if (isRecord$1(result.marketplace)) output.write(` - ${printable(result.marketplace.id)}\n`);
1022
1039
  if (text(result.pluginId)) output.write(` - ${printable(result.pluginId)}\n`);
1023
1040
  }
1024
1041
  for (const diagnostic of diagnostics(result)) output.write(`Diagnostic: ${diagnostic}\n`);
@@ -1039,7 +1056,7 @@ async function defaultConfirm(question, input, output, signal) {
1039
1056
  }
1040
1057
  async function readOptionsFile(path) {
1041
1058
  const parsed = JSON.parse(await readFile(path, "utf8"));
1042
- if (!isRecord(parsed)) throw new Error("Plugin options file must contain a JSON object.");
1059
+ if (!isRecord$1(parsed)) throw new Error("Plugin options file must contain a JSON object.");
1043
1060
  return parsed;
1044
1061
  }
1045
1062
  async function runPluginCommand(args, options) {
@@ -1271,12 +1288,40 @@ async function runPluginCommand(args, options) {
1271
1288
  }
1272
1289
  }
1273
1290
  //#endregion
1291
+ //#region src/runtime-capabilities.ts
1292
+ function isRecord(value) {
1293
+ return typeof value === "object" && value !== null && !Array.isArray(value);
1294
+ }
1295
+ function parseRuntimeCapabilities(value) {
1296
+ if (!isRecord(value) || value.schemaVersion !== 1 || !isRecord(value.cli)) return void 0;
1297
+ const rawOptions = value.cli.globalOptions;
1298
+ if (!isRecord(rawOptions)) return void 0;
1299
+ const globalOptions = {};
1300
+ for (const [name, rawOption] of Object.entries(rawOptions)) {
1301
+ if (!name || name.startsWith("-") || !isRecord(rawOption)) return void 0;
1302
+ if (rawOption.type !== "boolean" && rawOption.type !== "string") return void 0;
1303
+ if (rawOption.multiple !== void 0 && typeof rawOption.multiple !== "boolean") return void 0;
1304
+ globalOptions[name] = {
1305
+ type: rawOption.type,
1306
+ ...rawOption.multiple === true ? { multiple: true } : {}
1307
+ };
1308
+ }
1309
+ return {
1310
+ schemaVersion: 1,
1311
+ cli: { globalOptions }
1312
+ };
1313
+ }
1314
+ function capabilitiesFromExtractionMetadata(value) {
1315
+ return isRecord(value) ? parseRuntimeCapabilities(value.runtimeCapabilities) : void 0;
1316
+ }
1317
+ //#endregion
1274
1318
  //#region src/launcher.ts
1275
1319
  const packageRoot = join(dirname(fileURLToPath(import.meta.url)), "..");
1276
1320
  const packageManifestPath = join(packageRoot, "package.json");
1277
1321
  const extractionMetadataPath = join(packageRoot, "vendor", "extraction.json");
1278
1322
  const runtimePath = join(packageRoot, "vendor", "zcode.cjs");
1279
1323
  const launcherPath = join(packageRoot, "bin", "zcode.js");
1324
+ const defaultZCodeBaseUrl = "https://zcode.z.ai";
1280
1325
  const defaultModelRetryMaxRetries = "5";
1281
1326
  const defaultBrowserUseArgument = "--browser-use=headless";
1282
1327
  const tuiRuntimeLogLimitBytes = 2 * 1024 * 1024;
@@ -1285,34 +1330,37 @@ const versionArguments = /* @__PURE__ */ new Set([
1285
1330
  "--version",
1286
1331
  "-v"
1287
1332
  ]);
1288
- const runtimeBooleanOptions = /* @__PURE__ */ new Set([
1289
- "--allow-main-worktree-yolo",
1290
- "--continue",
1291
- "--force",
1292
- "--force-mcs",
1293
- "--json",
1294
- "--no-browser",
1295
- "--no-color",
1296
- "--stdio",
1297
- "--target-replace",
1298
- "--verbose"
1299
- ]);
1300
- const runtimeValueOptions = /* @__PURE__ */ new Set([
1301
- "--allowed-tools",
1302
- "--attach",
1303
- "--browser-executable",
1304
- "--cwd",
1305
- "--locale",
1306
- "--max-turns",
1307
- "--mode",
1308
- "--permission-mode",
1309
- "--resume",
1310
- "--settings"
1311
- ]);
1312
1333
  const runtimeVariadicOptions = /* @__PURE__ */ new Set(["--disallowedTools", "--disallowed-tools"]);
1334
+ const fallbackRuntimeOptionTypes = {
1335
+ attach: "string",
1336
+ "browser-executable": "string",
1337
+ "browser-use": "string",
1338
+ continue: "boolean",
1339
+ cwd: "string",
1340
+ force: "boolean",
1341
+ "force-mcs": "boolean",
1342
+ help: "boolean",
1343
+ json: "boolean",
1344
+ locale: "string",
1345
+ mode: "string",
1346
+ "no-browser": "boolean",
1347
+ "no-color": "boolean",
1348
+ "output-format": "string",
1349
+ prompt: "string",
1350
+ resume: "string",
1351
+ stdio: "boolean",
1352
+ surface: "string",
1353
+ target: "string",
1354
+ "target-replace": "boolean",
1355
+ verbose: "boolean",
1356
+ version: "boolean"
1357
+ };
1313
1358
  function resolveModelRetryMaxRetries(env) {
1314
1359
  return env.ZCODE_MODEL_RETRY_MAX_RETRIES?.trim() || defaultModelRetryMaxRetries;
1315
1360
  }
1361
+ function resolveZCodeBaseUrl(env) {
1362
+ return env.ZCODE_BASE_URL?.trim() || defaultZCodeBaseUrl;
1363
+ }
1316
1364
  function resolveNodeExecutable() {
1317
1365
  return process.env.ZCODE_NODE?.trim() || process.execPath;
1318
1366
  }
@@ -1327,6 +1375,15 @@ function readJsonVersion(path, key) {
1327
1375
  return;
1328
1376
  }
1329
1377
  }
1378
+ function readRuntimeCliOptionTypes(metadataPath = extractionMetadataPath) {
1379
+ try {
1380
+ const capabilities = capabilitiesFromExtractionMetadata(JSON.parse(readFileSync(metadataPath, "utf8")));
1381
+ if (!capabilities) return fallbackRuntimeOptionTypes;
1382
+ return Object.fromEntries(Object.entries(capabilities.cli.globalOptions).map(([name, option]) => [name, option.type]));
1383
+ } catch {
1384
+ return fallbackRuntimeOptionTypes;
1385
+ }
1386
+ }
1330
1387
  function readDistributionVersion(manifestPath = packageManifestPath) {
1331
1388
  return readJsonVersion(manifestPath, "version");
1332
1389
  }
@@ -1357,12 +1414,13 @@ function longOptionName(argument) {
1357
1414
  const separator = argument.indexOf("=");
1358
1415
  return separator < 0 ? argument : argument.slice(0, separator);
1359
1416
  }
1360
- function inspectRuntimeInvocation(args) {
1417
+ function inspectRuntimeInvocation(args, runtimeOptionTypes) {
1361
1418
  let agentInvocation = false;
1362
1419
  let command;
1363
1420
  let explicitBrowserUse = false;
1364
1421
  let invalid = false;
1365
1422
  let passthrough = false;
1423
+ let presentationSurface = false;
1366
1424
  for (let index = 0; index < args.length; index += 1) {
1367
1425
  const argument = args[index];
1368
1426
  if (argument === "--") {
@@ -1401,12 +1459,14 @@ function inspectRuntimeInvocation(args) {
1401
1459
  }
1402
1460
  continue;
1403
1461
  }
1404
- if (runtimeValueOptions.has(option)) {
1462
+ const runtimeOptionType = runtimeOptionTypes[option.slice(2)];
1463
+ if (runtimeOptionType === "string") {
1464
+ presentationSurface ||= option === "--surface";
1405
1465
  if (!inlineValue) if (index + 1 >= args.length || args[index + 1].startsWith("-")) invalid = true;
1406
1466
  else index += 1;
1407
1467
  continue;
1408
1468
  }
1409
- if (runtimeBooleanOptions.has(option) && !inlineValue) continue;
1469
+ if (runtimeOptionType === "boolean" && !inlineValue) continue;
1410
1470
  invalid = true;
1411
1471
  continue;
1412
1472
  }
@@ -1427,6 +1487,7 @@ function inspectRuntimeInvocation(args) {
1427
1487
  }
1428
1488
  command ??= argument;
1429
1489
  }
1490
+ if (presentationSurface && !agentInvocation && command !== "app-server" && command !== "agent-server") invalid = true;
1430
1491
  return {
1431
1492
  agentInvocation,
1432
1493
  command,
@@ -1435,13 +1496,13 @@ function inspectRuntimeInvocation(args) {
1435
1496
  passthrough
1436
1497
  };
1437
1498
  }
1438
- function withDefaultBrowserUse(args) {
1439
- const invocation = inspectRuntimeInvocation(args);
1499
+ function withDefaultBrowserUse(args, runtimeOptionTypes = readRuntimeCliOptionTypes()) {
1500
+ const invocation = inspectRuntimeInvocation(args, runtimeOptionTypes);
1440
1501
  if (invocation.explicitBrowserUse || invocation.passthrough || invocation.invalid || !invocation.agentInvocation && invocation.command !== void 0 && invocation.command !== "tui") return args;
1441
1502
  return [defaultBrowserUseArgument, ...args];
1442
1503
  }
1443
- function isTuiRuntimeInvocation(args) {
1444
- const invocation = inspectRuntimeInvocation(args);
1504
+ function isTuiRuntimeInvocation(args, runtimeOptionTypes = readRuntimeCliOptionTypes()) {
1505
+ const invocation = inspectRuntimeInvocation(args, runtimeOptionTypes);
1445
1506
  return !invocation.agentInvocation && !invocation.invalid && !invocation.passthrough && (invocation.command === void 0 || invocation.command === "tui");
1446
1507
  }
1447
1508
  function firstRunSetupEnv(setupPending, args) {
@@ -1458,6 +1519,7 @@ function runtimeEnvironment(extra = {}) {
1458
1519
  };
1459
1520
  const merged = {
1460
1521
  ...inherited,
1522
+ ZCODE_BASE_URL: resolveZCodeBaseUrl(inherited),
1461
1523
  ZCODE_MODEL_RETRY_MAX_RETRIES: resolveModelRetryMaxRetries(inherited),
1462
1524
  ZCODE_APP_CLI_EXECUTABLE: process.execPath,
1463
1525
  ZCODE_APP_CLI_ENTRY: launcherPath,
@@ -12,6 +12,20 @@
12
12
  "glm-5.3": {
13
13
  "name": "GLM-5.3"
14
14
  },
15
+ "glm-5.3-flash": {
16
+ "name": "GLM-5.3-Flash",
17
+ "attachment": true,
18
+ "supportsImages": true,
19
+ "supportsPdf": true,
20
+ "supportsVideo": true,
21
+ "limit": {
22
+ "context": 1000000
23
+ },
24
+ "modalities": {
25
+ "input": ["text", "image", "video", "pdf"],
26
+ "output": ["text"]
27
+ }
28
+ },
15
29
  "glm-5.2": {
16
30
  "name": "GLM-5.2"
17
31
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zcode-app-cli",
3
- "version": "3.8.1-15",
3
+ "version": "3.9.2-16",
4
4
  "description": "Unofficial terminal client for the ZCode agent runtime",
5
5
  "keywords": [
6
6
  "agent",
@@ -49,7 +49,7 @@
49
49
  "sync:local": "bun run build && bun scripts/sync-runtime.ts --app /Applications/ZCode.app",
50
50
  "check": "bun run build && bun scripts/check-runtime.ts",
51
51
  "check:oauth-callback": "bun scripts/smoke-oauth-callback.ts",
52
- "check:tui": "bun scripts/smoke-tui.ts && bun scripts/smoke-tui-features.ts && bun scripts/smoke-tui-clear.ts && bun scripts/smoke-tui-pressure.ts && bun scripts/smoke-tui-widths.ts",
52
+ "check:tui": "bun scripts/smoke-tui.ts && bun scripts/smoke-tui-features.ts && bun scripts/smoke-tui-clear.ts && bun scripts/smoke-tui-session-title.ts && bun scripts/smoke-tui-pressure.ts && bun scripts/smoke-tui-widths.ts",
53
53
  "test": "bun test",
54
54
  "typecheck": "tsc --noEmit",
55
55
  "verify:tui-perf": "bun scripts/verify-tui-perf.ts",
@@ -1,9 +1,135 @@
1
1
  {
2
- "appVersion": "3.8.1",
3
- "cliVersion": "0.16.3",
4
- "extractedAt": "2026-08-21T16:52:03.094Z",
5
- "sha512": "iewB8VqMNFByReFlWdbbbec5h05aldHhMC1/3rwELvz9lCcBkRHW7iF5K2hYsVVceh/Ii9ipTSdPeIG8tbNH5A==",
6
- "source": "https://cdn-zcode.z.ai/zcode/electron/releases/3.8.1/linux-x64/ZCode-3.8.1-linux-x64.deb",
2
+ "appVersion": "3.9.2",
3
+ "cliVersion": "0.16.5",
4
+ "extractedAt": "2026-08-27T01:24:40.417Z",
5
+ "sha512": "WYe2n1emUfKQYb3RKBxwUzoyjtd/HsFfx8DoSSBclkhz0ojl3el5VyZ9FP2B0XY7kZa/O8dcETU761+P+v2kfg==",
6
+ "source": "https://cdn-zcode.z.ai/zcode/electron/releases/3.9.2/linux-x64/ZCode-3.9.2-linux-x64.deb",
7
+ "runtimeCapabilities": {
8
+ "schemaVersion": 1,
9
+ "cli": {
10
+ "globalOptions": {
11
+ "help": {
12
+ "type": "boolean"
13
+ },
14
+ "json": {
15
+ "type": "boolean"
16
+ },
17
+ "output-format": {
18
+ "type": "string"
19
+ },
20
+ "no-color": {
21
+ "type": "boolean"
22
+ },
23
+ "no-browser": {
24
+ "type": "boolean"
25
+ },
26
+ "browser-use": {
27
+ "type": "string"
28
+ },
29
+ "browser-executable": {
30
+ "type": "string"
31
+ },
32
+ "prompt": {
33
+ "type": "string"
34
+ },
35
+ "attach": {
36
+ "type": "string",
37
+ "multiple": true
38
+ },
39
+ "cwd": {
40
+ "type": "string"
41
+ },
42
+ "locale": {
43
+ "type": "string"
44
+ },
45
+ "resume": {
46
+ "type": "string"
47
+ },
48
+ "target": {
49
+ "type": "string"
50
+ },
51
+ "target-replace": {
52
+ "type": "boolean"
53
+ },
54
+ "continue": {
55
+ "type": "boolean"
56
+ },
57
+ "force": {
58
+ "type": "boolean"
59
+ },
60
+ "force-mcs": {
61
+ "type": "boolean"
62
+ },
63
+ "mode": {
64
+ "type": "string"
65
+ },
66
+ "verbose": {
67
+ "type": "boolean"
68
+ },
69
+ "version": {
70
+ "type": "boolean"
71
+ },
72
+ "stdio": {
73
+ "type": "boolean"
74
+ },
75
+ "surface": {
76
+ "type": "string"
77
+ }
78
+ }
79
+ }
80
+ },
81
+ "runtimePatches": [
82
+ {
83
+ "id": "tui-bridge",
84
+ "requirement": "required",
85
+ "status": "applied"
86
+ },
87
+ {
88
+ "id": "goal-failure-pause",
89
+ "requirement": "optional",
90
+ "status": "applied"
91
+ },
92
+ {
93
+ "id": "terminal-tool-projection",
94
+ "requirement": "optional",
95
+ "status": "applied"
96
+ },
97
+ {
98
+ "id": "detached-agent-lifecycle",
99
+ "requirement": "optional",
100
+ "status": "applied"
101
+ },
102
+ {
103
+ "id": "agent-auto-background",
104
+ "requirement": "optional",
105
+ "status": "applied"
106
+ },
107
+ {
108
+ "id": "http-no-content",
109
+ "requirement": "required",
110
+ "status": "applied"
111
+ },
112
+ {
113
+ "id": "oauth-http-errors",
114
+ "requirement": "optional",
115
+ "status": "applied"
116
+ },
117
+ {
118
+ "id": "desktop-oauth",
119
+ "requirement": "required",
120
+ "status": "applied"
121
+ },
122
+ {
123
+ "id": "login-model-defaults",
124
+ "requirement": "required",
125
+ "status": "applied"
126
+ },
127
+ {
128
+ "id": "cli-help-contract",
129
+ "requirement": "required",
130
+ "status": "applied"
131
+ }
132
+ ],
7
133
  "tui": {
8
134
  "implementation": "@zcode/tui",
9
135
  "foundation": "@earendil-works/pi-tui"
@@ -22,6 +22,23 @@ var config_example_default = {
22
22
  "headers": {},
23
23
  "models": {
24
24
  "glm-5.3": { "name": "GLM-5.3" },
25
+ "glm-5.3-flash": {
26
+ "name": "GLM-5.3-Flash",
27
+ "attachment": true,
28
+ "supportsImages": true,
29
+ "supportsPdf": true,
30
+ "supportsVideo": true,
31
+ "limit": { "context": 1e6 },
32
+ "modalities": {
33
+ "input": [
34
+ "text",
35
+ "image",
36
+ "video",
37
+ "pdf"
38
+ ],
39
+ "output": ["text"]
40
+ }
41
+ },
25
42
  "glm-5.2": { "name": "GLM-5.2" },
26
43
  "glm-5.1": { "name": "GLM-5.1" },
27
44
  "glm-5-turbo": { "name": "GLM-5-Turbo" }
@@ -162788,6 +162805,33 @@ function normalizeRuntimeProjection(value) {
162788
162805
  } : void 0
162789
162806
  };
162790
162807
  }
162808
+ /** Enrich the stable local projection from persisted messages, without runtime internals. */
162809
+ function mergeProjectionContextCache(projection, messages) {
162810
+ const usage = projection?.contextUsage;
162811
+ if (!projection || !usage) return projection;
162812
+ const trend = extractContextCacheTrend(messages);
162813
+ if (trend.wholeTree.requests === 0) return projection;
162814
+ const latest = trend.turns.findLast((turn) => turn.inputTokens !== void 0);
162815
+ const summary = trend.wholeTree;
162816
+ return {
162817
+ ...projection,
162818
+ contextUsage: {
162819
+ ...usage,
162820
+ cache: {
162821
+ ...usage.cache,
162822
+ inputTokens: latest?.inputTokens ?? usage.cache?.inputTokens,
162823
+ cacheReadTokens: latest?.cacheReadTokens ?? usage.cache?.cacheReadTokens,
162824
+ cacheWriteTokens: latest?.cacheWriteTokens ?? usage.cache?.cacheWriteTokens,
162825
+ latestHitRate: latest?.hitRate ?? usage.cache?.latestHitRate,
162826
+ hitRate: summary.hitRate ?? usage.cache?.hitRate,
162827
+ hitRateRequestCount: summary.requests,
162828
+ totalInputTokens: summary.inputTokens,
162829
+ totalCacheReadTokens: summary.cacheReadTokens,
162830
+ totalCacheWriteTokens: summary.cacheWriteTokens
162831
+ }
162832
+ }
162833
+ };
162834
+ }
162791
162835
  function isActiveRuntimeTool(tool) {
162792
162836
  return tool.status === "pending" || tool.status === "running";
162793
162837
  }
@@ -162974,7 +163018,7 @@ function sessionTitleFromFirstMessage(message) {
162974
163018
  if (!normalized) return null;
162975
163019
  const characters = Array.from(normalized);
162976
163020
  if (characters.length <= 50) return normalized;
162977
- return `${characters.slice(0, 50).join("")}…`;
163021
+ return `${characters.slice(0, 49).join("")}…`;
162978
163022
  }
162979
163023
  function emitSessionTerminalTitle(stream, title) {
162980
163024
  if (!stream?.isTTY) return;
@@ -166129,7 +166173,6 @@ var ZCodeTui = class {
166129
166173
  finishPrimaryTurnSubmission(turnEpoch, abortController, unfinishedToolState) {
166130
166174
  this.activeSubmissions = Math.max(0, this.activeSubmissions - 1);
166131
166175
  if (this.activeTurnEpoch !== turnEpoch) return void 0;
166132
- this.refreshSessionTerminalTitle();
166133
166176
  const turnFinishState = abortController.signal.aborted ? "cancelled" : unfinishedToolState;
166134
166177
  const recoveryReason = turnFinishState === "cancelled" ? "turn_cancelled" : turnFinishState === "failed" ? "turn_failed" : "turn_ended";
166135
166178
  const targetTurnId = this.activeTurnId;
@@ -169005,14 +169048,19 @@ var ZCodeTui = class {
169005
169048
  try {
169006
169049
  do {
169007
169050
  this.runtimeRefreshPending = false;
169008
- const [projectionResult, todosResult] = await Promise.allSettled([this.options.readRuntimeProjection?.(), this.options.readTodos?.()]);
169051
+ const [projectionResult, todosResult, contextMessagesResult] = await Promise.allSettled([
169052
+ this.options.readRuntimeProjection?.(),
169053
+ this.options.readTodos?.(),
169054
+ this.options.readRuntimeProjection && this.options.loadSessionContextMessages ? this.options.loadSessionContextMessages() : Promise.resolve(void 0)
169055
+ ]);
169009
169056
  const next = {
169010
169057
  projection: this.runtimeProjection,
169011
169058
  todos: this.todos,
169012
169059
  todoGroups: this.todoGroups
169013
169060
  };
169014
169061
  if (projectionResult.status === "fulfilled" && projectionResult.value !== void 0) {
169015
- next.projection = normalizeRuntimeProjection(projectionResult.value) ?? next.projection;
169062
+ const projection = normalizeRuntimeProjection(projectionResult.value);
169063
+ next.projection = contextMessagesResult.status === "fulfilled" && contextMessagesResult.value !== void 0 ? mergeProjectionContextCache(projection, contextMessagesResult.value) ?? next.projection : projection ?? next.projection;
169016
169064
  if (isRecord(projectionResult.value) && Array.isArray(projectionResult.value.todoGroups)) next.todoGroups = normalizeTodoGroups(projectionResult.value);
169017
169065
  }
169018
169066
  if (todosResult.status === "fulfilled" && todosResult.value !== void 0) next.todos = normalizeTodos(todosResult.value);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browser-use",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Built-in browser automation runtime and guidance for Desktop IAB and explicitly enabled CLI-managed headless CDP: open, navigate, inspect, click, type, screenshot, record workspace WebM videos, and verify web pages and local dev targets.",
5
5
  "author": { "name": "Z.ai" },
6
6
  "license": "MIT",