zcode-app-cli 3.11.2-25 → 3.12.3-26

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 (39) hide show
  1. package/README.md +22 -8
  2. package/bin/zcode.js +194 -111
  3. package/docs/CONFIGURATION.md +387 -0
  4. package/docs/CONFIGURATION.zh-CN.md +324 -0
  5. package/docs/PROVIDER_CONFIG.md +271 -0
  6. package/docs/PROVIDER_CONFIG.zh-CN.md +245 -0
  7. package/package.json +8 -3
  8. package/provider.example.json +151 -0
  9. package/{config.example.json → setting.example.json} +0 -47
  10. package/vendor/cli-config.cjs +161 -0
  11. package/vendor/extraction.json +17 -4
  12. package/vendor/node_modules/@zcode/tui/dist/index.js +436 -1086
  13. package/vendor/packages/browser-use-plugin/dist/mcp/server.js +35543 -34422
  14. package/vendor/packages/document-skills-plugin/.zcode-plugin/plugin.json +2 -2
  15. package/vendor/packages/document-skills-plugin/package.json +4 -4
  16. package/vendor/packages/document-skills-plugin/skills/docx/SKILL.md +34 -0
  17. package/vendor/packages/document-skills-plugin/skills/docx/references/docx-js-advanced.md +9 -0
  18. package/vendor/packages/document-skills-plugin/skills/docx/routes/edit.md +11 -0
  19. package/vendor/packages/document-skills-plugin/skills/docx/routes/format.md +7 -0
  20. package/vendor/packages/document-skills-plugin/skills/docx/routes/read.md +7 -0
  21. package/vendor/packages/document-skills-plugin/skills/pdf/SKILL.md +10 -1
  22. package/vendor/packages/document-skills-plugin/skills/pdf/briefs/process.md +19 -4
  23. package/vendor/packages/document-skills-plugin/skills/pdf/env_setup/env_check.sh +6 -2
  24. package/vendor/packages/document-skills-plugin/skills/pdf/env_setup/setup.md +12 -3
  25. package/vendor/packages/document-skills-plugin/skills/pdf/env_setup/setup_mac_linux.sh +9 -3
  26. package/vendor/packages/document-skills-plugin/skills/pdf/env_setup/setup_windows.ps1 +8 -3
  27. package/vendor/packages/document-skills-plugin/skills/pdf/scripts/pdf.py +30 -6
  28. package/vendor/packages/document-skills-plugin/skills/pdf/scripts/setup.sh +9 -3
  29. package/vendor/packages/document-skills-plugin/skills/pptx/SKILL.md +33 -0
  30. package/vendor/packages/document-skills-plugin/skills/xlsx/env_setup/setup.md +29 -4
  31. package/vendor/packages/document-skills-plugin/skills/xlsx/env_setup/setup_mac_linux.sh +8 -3
  32. package/vendor/packages/document-skills-plugin/skills/xlsx/env_setup/setup_windows.ps1 +8 -3
  33. package/vendor/packages/document-skills-plugin/skills/xlsx/quality/pipeline.md +9 -0
  34. package/vendor/packages/document-skills-plugin/skills/xlsx/setup.sh +8 -3
  35. package/vendor/packages/document-skills-plugin/skills/xlsx/xlsx.py +15 -1
  36. package/vendor/packages/restore-legacy-sessions-plugin/skills/restore-legacy-sessions/scripts/restore-conversation.mjs +13 -8
  37. package/vendor/provider/zcode-builtin.json +6296 -0
  38. package/vendor/zcode.cjs +1159 -840
  39. package/zcode-runtime.lock.json +3 -3
@@ -115,18 +115,23 @@ if [ ${#MISSING_PY[@]} -gt 0 ]; then
115
115
  fi
116
116
  fi
117
117
 
118
- # ── 4. LibreOffice (optional, for format conversion) ──
118
+ # ── 4. LibreOffice (install-on-demand, NOT substitutable) ──
119
119
  echo ""
120
- echo "--- LibreOffice (optional, for CSV/PDF conversion) ---"
120
+ echo "--- LibreOffice (CSV/PDF conversion + formula recalc) ---"
121
121
  if command -v soffice &>/dev/null; then
122
122
  LO_VER=$(soffice --version 2>/dev/null | head -1)
123
123
  ok "libreoffice ($LO_VER)"
124
124
  else
125
- warn "libreoffice not installed (needed only for .xlsx→PDF or .csv→.xlsx conversion)"
125
+ warn "libreoffice not installed — REQUIRED for recalc, .xlsx→PDF, .csv→.xlsx"
126
+ info "You MUST install it. FORBIDDEN: using Excel/WPS/Numbers instead of installing."
127
+ info "A large download is NOT a reason to skip. REQUIRED: explain the necessity to"
128
+ info "the user, say the package is large, THEN install it."
126
129
  case "$OS" in
127
130
  Darwin) info "Install: brew install --cask libreoffice" ;;
128
131
  Linux) info "Install: sudo apt install libreoffice-core (Debian/Ubuntu)" ;;
129
132
  esac
133
+ info "Another program is allowed ONLY after an install attempt has FAILED. Report it."
134
+ info "No install attempt = no substitute program."
130
135
  fi
131
136
 
132
137
  # ── Summary ──
@@ -232,7 +232,21 @@ def _libreoffice_recalc(filename: str, timeout: int = 30) -> Dict[str, Any]:
232
232
  # Locate soffice binary (cross-platform)
233
233
  soffice_bin = _find_soffice()
234
234
  if not soffice_bin:
235
- return {"error": "LibreOffice not found. Install it and ensure soffice is in PATH."}
235
+ return {"error": (
236
+ "LibreOffice not found — you MUST install it, not substitute it. "
237
+ "FORBIDDEN: using Excel / WPS / Numbers / any program already on this machine INSTEAD "
238
+ "of installing LibreOffice. FORBIDDEN: deciding the download is too large to bother "
239
+ "with — being large is NOT a reason to skip it. FORBIDDEN: skipping recalculation. "
240
+ "REQUIRED, in order: (1) explain to the user that LibreOffice is what actually "
241
+ "recalculates the formulas so errors surface; (2) tell them the package is large "
242
+ "(several hundred MB) and may take a while — information for them, not a decision "
243
+ "point for you; (3) install it NOW: macOS 'brew install --cask libreoffice'; "
244
+ "Debian/Ubuntu 'sudo apt install libreoffice-core'; "
245
+ "Windows 'winget install TheDocumentFoundation.LibreOffice'. "
246
+ "ONLY after that install has been attempted AND failed may you use another program — "
247
+ "report the failure and which checks were skipped. "
248
+ "No install attempt = no substitute program."
249
+ )}
236
250
 
237
251
  lo_cmd: List[str] = [
238
252
  soffice_bin, "--headless", "--norestore",
@@ -261,7 +261,9 @@ function buildPartDataList(message, messageId, messageTimestamp) {
261
261
  partDataList.push(buildTextPartData(content, messageTimestamp, completedAt));
262
262
  }
263
263
  for (const [toolIndex, tool] of tools.entries()) {
264
- partDataList.push(buildToolPartData(tool, messageId, toolIndex, messageTimestamp, completedAt));
264
+ partDataList.push(
265
+ buildToolPartData(tool, messageId, toolIndex, messageTimestamp, completedAt),
266
+ );
265
267
  }
266
268
  }
267
269
 
@@ -490,15 +492,15 @@ function writeMessages(cliDb, plan) {
490
492
  }),
491
493
  agent: "zcode-agent",
492
494
  };
493
- // Bugfix: contracts 里 user message 使用 model 对象,assistant message 使用顶层 modelID/providerID。
494
- // 两者不能混写,否则 app-server 的 message-mapper 会把用户消息模型解析成 undefined。
495
+ // Bugfix: 恢复脚本必须写当前消息契约;继续生成旧消息身份字段会迫使正常读取链依赖 legacy codec,
496
+ // 并让新恢复的数据再次成为待迁移数据。
495
497
  const messageData =
496
498
  role === "assistant"
497
499
  ? {
498
500
  ...baseMessageData,
499
501
  content: message.content,
500
- modelID: message.model || plan.model || undefined,
501
- providerID: ZCODE_PROVIDER,
502
+ modelId: message.model || plan.model || "unknown",
503
+ providerId: ZCODE_PROVIDER,
502
504
  mode: plan.mode,
503
505
  path: {
504
506
  cwd: plan.workspacePath,
@@ -534,10 +536,13 @@ function writeMessages(cliDb, plan) {
534
536
  : {
535
537
  ...baseMessageData,
536
538
  content: message.content,
537
- model: {
538
- providerID: ZCODE_PROVIDER,
539
- modelID: message.model || plan.model || "unknown",
539
+ modelSelection: {
540
+ providerId: ZCODE_PROVIDER,
541
+ modelId: message.model || plan.model || "unknown",
540
542
  },
543
+ // 旧 Reader 无条件访问 User.model;显式导入绕过普通 Writer,也必须补最小对象防止回滚打不开正文。
544
+ // 不复制模型身份:当前选择只有 modelSelection,旧版允许模型失效但不能读取抛错。
545
+ model: {},
541
546
  ...(message.characterCount !== undefined
542
547
  ? { characterCount: message.characterCount }
543
548
  : {}),