dsh-univer-office 0.3.1 → 0.3.3

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 (49) hide show
  1. package/README.md +6 -4
  2. package/README.zh-CN.md +6 -4
  3. package/artifacts/gateway.cjs +2 -2
  4. package/artifacts/unit-content-worker.mjs +20 -3
  5. package/artifacts/viewer/assets/{ca-ES-CV7LIf91.js → ca-ES-BuZHwmgN.js} +1 -1
  6. package/artifacts/viewer/assets/{ca-ES-CCK3I7KL.js → ca-ES-C8FC0KQt.js} +1 -1
  7. package/artifacts/viewer/assets/{de-DE-BdOJIK6R.js → de-DE-BYVBQVeX.js} +1 -1
  8. package/artifacts/viewer/assets/{de-DE-DLW0Q9w5.js → de-DE-oPIVBsgs.js} +1 -1
  9. package/artifacts/viewer/assets/{en-US-B8LrRGWX.js → en-US-B2ui2NFE.js} +1 -1
  10. package/artifacts/viewer/assets/{en-US-LOu6aHT4.js → en-US-Bi3nkhsT.js} +1 -1
  11. package/artifacts/viewer/assets/{es-ES-CK1kp3UG.js → es-ES-AfDqHp81.js} +1 -1
  12. package/artifacts/viewer/assets/{es-ES-PYsiuUwi.js → es-ES-BJq7h21m.js} +1 -1
  13. package/artifacts/viewer/assets/{fr-FR-Umtz75pM.js → fr-FR-DRjcQXV9.js} +1 -1
  14. package/artifacts/viewer/assets/{fr-FR-DdezJ02E.js → fr-FR-YtajVsaR.js} +1 -1
  15. package/artifacts/viewer/assets/{id-ID-KwYarXKw.js → id-ID-CRYUFsPL.js} +1 -1
  16. package/artifacts/viewer/assets/{id-ID-DYG7Riq6.js → id-ID-DeLtb36Y.js} +1 -1
  17. package/artifacts/viewer/assets/{index-n9CgoFIM.js → index-CBMgC75g.js} +3 -3
  18. package/artifacts/viewer/assets/{it-IT-CKghBDAN.js → it-IT-Di0mh9Em.js} +1 -1
  19. package/artifacts/viewer/assets/{it-IT-CEO7YzEb.js → it-IT-RZBq5Mt_.js} +1 -1
  20. package/artifacts/viewer/assets/{ja-JP-CVTC10HQ.js → ja-JP-Cc78HxHK.js} +1 -1
  21. package/artifacts/viewer/assets/{ja-JP-CgAP0Zu-.js → ja-JP-D271qE4p.js} +1 -1
  22. package/artifacts/viewer/assets/{ko-KR-C_Zlm_02.js → ko-KR-BQ8ZC34b.js} +1 -1
  23. package/artifacts/viewer/assets/{ko-KR-N4Ryt3PW.js → ko-KR-TDpbk-Z5.js} +1 -1
  24. package/artifacts/viewer/assets/{pl-PL-CURunPH9.js → pl-PL-CrcdBY5q.js} +1 -1
  25. package/artifacts/viewer/assets/{pl-PL-Ci1Ocqak.js → pl-PL-Cz9EZaZ0.js} +1 -1
  26. package/artifacts/viewer/assets/{pt-BR-DHmJ2Iq9.js → pt-BR-Bjgl5Ywd.js} +1 -1
  27. package/artifacts/viewer/assets/{pt-BR-4qVm6Tyo.js → pt-BR-XavSA421.js} +1 -1
  28. package/artifacts/viewer/assets/{ru-RU-Bq61f2NL.js → ru-RU-BTQ4yjOE.js} +1 -1
  29. package/artifacts/viewer/assets/{ru-RU-Cs0zC1N-.js → ru-RU-C7ny0bSt.js} +1 -1
  30. package/artifacts/viewer/assets/sheet-comparison-view-DzcmfKHW.js +2 -0
  31. package/artifacts/viewer/assets/{sk-SK-sGmasE_r.js → sk-SK-BZ6ZKw-o.js} +1 -1
  32. package/artifacts/viewer/assets/{sk-SK-ql3vkIaR.js → sk-SK-aSTLlciM.js} +1 -1
  33. package/artifacts/viewer/assets/{vi-VN-2UKDRQP-.js → vi-VN-CYqzxJYl.js} +1 -1
  34. package/artifacts/viewer/assets/{vi-VN-Ws1C_yur.js → vi-VN-CtiW0Gcd.js} +1 -1
  35. package/artifacts/viewer/assets/{zh-CN-B0jGkRud.js → zh-CN-CFXGE5zV.js} +1 -1
  36. package/artifacts/viewer/assets/{zh-CN-CTEfNzg7.js → zh-CN-DD5IcW-a.js} +1 -1
  37. package/artifacts/viewer/assets/{zh-HK-BBwNFX0Q.js → zh-HK-D9EffOM9.js} +1 -1
  38. package/artifacts/viewer/assets/{zh-HK-CLENOTF4.js → zh-HK-DlSkDKFl.js} +1 -1
  39. package/artifacts/viewer/assets/{zh-TW-D6cpbHFD.js → zh-TW-B08jdBNO.js} +1 -1
  40. package/artifacts/viewer/assets/{zh-TW-Dzzpiote.js → zh-TW-BbJdRD0o.js} +1 -1
  41. package/artifacts/viewer/index.html +1 -1
  42. package/docs/architecture.md +17 -4
  43. package/lib/build-info.json +2 -2
  44. package/lib/client.js +702 -344
  45. package/lib/index.js +40 -15
  46. package/package.json +25 -23
  47. package/skills/univer-doc/SKILL.md +2 -0
  48. package/artifacts/viewer/assets/sheet-comparison-view-NPYyWMpk.js +0 -2
  49. package/scripts/telemetry-entry.mjs +0 -28
package/README.md CHANGED
@@ -134,7 +134,7 @@ Create a monthly expense spreadsheet with dates, categories, amounts, a total, a
134
134
  ### 3. Review it in the conversation
135
135
 
136
136
  - Changes appear in a live, movable preview window while the agent works.
137
- - Review cards remain in the conversation and can be folded or opened fullscreen later.
137
+ - Review cards remain in the conversation and can be folded or opened fullscreen later. Fullscreen escapes conversation layout constraints, preserves the card's space without reloading the Viewer, and supports Esc to exit.
138
138
  - Continue editing, approve, or discard changes from the Univer page embedded in the card.
139
139
 
140
140
  ## How it works
@@ -156,7 +156,7 @@ DSH selects these tools automatically; you normally do not need to call them man
156
156
  | `univer_status` | View the content and draft status of a file |
157
157
  | `univer_worktree` | Create, submit, revise, approve, or discard an isolated draft |
158
158
  | `univer_unit` | Add or remove Sheet, Doc, Slide, Base, or Board content |
159
- | `univer_import` | Import an Office file into a `.univer` file |
159
+ | `univer_import` | Import an Office file into a `.univer` file; docx keeps its page setup by default, `docType` selects traditional (default) or modern |
160
160
  | `univer_inspect` | Read document structure or a selected Sheet range |
161
161
  | `univer_execute` | Read or edit content through the Univer API |
162
162
  | `univer_export` | Export Sheet, Doc, Slide, or Base content |
@@ -169,8 +169,9 @@ DSH selects these tools automatically; you normally do not need to call them man
169
169
 
170
170
  ## Preview and review experience
171
171
 
172
- - **Live Univer window** — changes open automatically in a window you can drag, resize, fold, or maximize. Disable automatic opening under **Settings → Plugins → Plugin configuration → Univer Office** without removing conversation review cards.
173
- - **Conversation review cards** — each edited `.univer` file has its own full preview card, while deleted temporary files leave no stale cards behind.
172
+ - **On-demand preview from the file tree** — click a `.univer` file in the DSH file tree and it opens in the right sidebar, alongside the built-in previews for `.docx`, `.xlsx`, and `.pptx`. No agent operation is involved: this is the entry point that still works when automatic live previews are off. Version navigation and worktree review are handled inside the Viewer. Opening a file without a specific target defaults to the first active worktree when trunk has no documents. It registers on DSH's own right sidebar; when the `dsh-better-sidebar` plugin is installed instead, it is registered as one of that plugin's file viewers, because that plugin takes over file addresses.
173
+ - **Live Univer window** — changes open automatically in a window you can drag, resize, fold, or maximize. Disable automatic opening in the plugin's settings — the **dsh-univer-office** detail page under the sidebar **Plugins** page (or **Settings → Plugins → Plugin configuration** on DSH releases before 0.1.6-alpha.2) — without removing conversation review cards or the file-tree preview above.
174
+ - **Conversation review cards** — each edited `.univer` file has its own full preview card, while deleted temporary files leave no stale cards behind. Turn them off with **Show review cards in the conversation** in the plugin's settings for a more compact conversation; the file-tree preview and the live window are controlled by their own switches.
174
175
  - **Pinned worktree comparison** — use **Compare** in a draft or submitted worktree to compare it with trunk or another active worktree. Both sides are pinned when the comparison opens, changed entities can be navigated, and a refresh control appears if either side advances.
175
176
  - **Responsive review Header** — View/Compare stays centered when space permits; controls share a compact row and wrap in order as the window narrows. The title shows the selected document name; long names truncate, and merge-status messages remain visible.
176
177
  - **Historical review** — drafts, submitted changes, approvals, and discarded results remain in the conversation, with older cards collapsed by default.
@@ -182,6 +183,7 @@ DSH selects these tools automatically; you normally do not need to call them man
182
183
  ## Requirements and current limits
183
184
 
184
185
  - DeepSeek Harness and Node.js `>=22.19.0`.
186
+ - The file-tree preview needs no extra plugin: it registers a tab type on DSH's right sidebar and claims `dsh-resource://file/**` addresses ending in `.univer`. While `dsh-better-sidebar` (`^0.19.0`) is installed it takes over file addresses at the same priority with a broader pattern, so the preview is registered as one of its file viewers instead — both shapes are covered, and only one ever applies.
185
187
  - Screenshots, PDF printing, Slide layout checks, and SVG text measurement need a local Chromium-family browser. Chrome/Chromium and Microsoft Edge are detected automatically; set the `browserExecutablePath` option or the `UNIVER_RENDER_BROWSER` environment variable to point at a specific executable (for example Edge on Windows).
186
188
  - Slide master pages, layout pages, and speaker notes are outside the current editing scope.
187
189
  - Board mind maps, tables, ink, advanced editing, and file export are not yet supported.
package/README.zh-CN.md CHANGED
@@ -134,7 +134,7 @@ DSH 启动成功后,在已有的 DeepSeek Harness 浏览器页面按 **Cmd+R /
134
134
  ### 3. 在会话中审阅
135
135
 
136
136
  - Agent 工作时,修改会显示在可移动的实时预览窗口中。
137
- - 审阅卡片会保留在会话里,之后仍可折叠或全屏打开。
137
+ - 审阅卡片会保留在会话里,之后仍可折叠或全屏打开。全屏不受对话容器的布局限制,原位置保留卡片占位,切换时不重新加载 Viewer,按 Esc 可退出。
138
138
  - 继续修改、确认或放弃都可直接在卡片内的 Univer 页面完成。
139
139
 
140
140
  ## 工作方式
@@ -156,7 +156,7 @@ DSH 会自动选择这些工具,日常使用不需要手动调用。
156
156
  | `univer_status` | 查看文件内容与草稿状态 |
157
157
  | `univer_worktree` | 创建、提交、继续修改、确认或放弃隔离草稿 |
158
158
  | `univer_unit` | 添加或删除 Sheet、Doc、Slide、多维表格或 Board 内容 |
159
- | `univer_import` | 把 Office 文件导入 `.univer` 文件 |
159
+ | `univer_import` | 把 Office 文件导入 `.univer` 文件;docx 默认保留页面设置,`docType` 可选 traditional(默认)或 modern |
160
160
  | `univer_inspect` | 读取文档结构或指定 Sheet 范围 |
161
161
  | `univer_execute` | 通过 Univer API 读取或编辑内容 |
162
162
  | `univer_export` | 导出 Sheet、Doc、Slide 或多维表格内容 |
@@ -169,8 +169,9 @@ DSH 会自动选择这些工具,日常使用不需要手动调用。
169
169
 
170
170
  ## 预览与审阅体验
171
171
 
172
- - **实时 Univer 窗口**:修改默认自动显示在可拖动、缩放、折叠和全屏的窗口中;可在“设置 → 插件 → 插件配置 → Univer Office”关闭自动打开,不影响会话审阅卡片。
173
- - **会话审阅卡片**:每个修改过的 `.univer` 文件都有独立的完整预览卡片;已删除的临时文件不会留下无效卡片。
172
+ - **文件树按需预览**:在 DSH 文件树中点击 `.univer` 文件即可在右侧栏打开预览,与 `.docx`、`.xlsx`、`.pptx` 的内置预览一致。整个过程不需要 Agent 执行任何操作,因此在关闭自动实时预览后依然可用。版本切换与 worktree 审阅统一在 Viewer 内完成。打开文件时若未指定目标,且主线没有文档,则默认进入第一个活跃 worktree。该入口直接注册在 DSH 自带的右侧栏上;若安装了 `dsh-better-sidebar`,由于该插件会接管文件地址,预览会改为注册成它的文件预览器。
173
+ - **实时 Univer 窗口**:修改默认自动显示在可拖动、缩放、折叠和全屏的窗口中;可在插件设置中关闭自动打开(侧边栏“插件”页面中的 **dsh-univer-office** 详情页;0.1.6-alpha.2 之前的 DSH 版本在“设置 → 插件 → 插件配置”),不影响会话审阅卡片和上面的文件树预览。
174
+ - **会话审阅卡片**:每个修改过的 `.univer` 文件都有独立的完整预览卡片;已删除的临时文件不会留下无效卡片。可在插件设置中关闭「在会话中显示审阅卡片」让会话更紧凑——文件树预览与实时窗口由各自的开关独立控制。
174
175
  - **固定版本的 worktree 比较**:在草稿或已提交 worktree 中选择“比较”,可与主线或另一个活跃 worktree 对照。打开比较时会固定两侧版本,可逐项定位变更;任一侧继续更新后会显示刷新入口。
175
176
  - **响应式审阅 Header**:空间充足时“查看 / 对比”居中,窗口变窄后控件紧凑排列并按顺序换行;标题显示当前文档名,超长名称截断,合并状态提示保持可见。
176
177
  - **历史审阅**:草稿、已提交修改、确认和放弃结果都会保留在会话中,历史卡片默认折叠。
@@ -182,6 +183,7 @@ DSH 会自动选择这些工具,日常使用不需要手动调用。
182
183
  ## 要求与限制
183
184
 
184
185
  - DeepSeek Harness,以及 Node.js `>=22.19.0`。
186
+ - 文件树预览不需要额外插件:它在 DSH 自带右侧栏注册一个 tab 类型,认领以 `.univer` 结尾的 `dsh-resource://file/**` 地址。安装 `dsh-better-sidebar`(`^0.19.0`)期间,该插件会以同档位、更宽的模式接管文件地址,因此预览改为注册成它的文件预览器——两种宿主形态都覆盖,且任一时刻只有一条生效。
185
187
  - 截图、PDF 打印、Slide 布局检查和 SVG 文字度量需要本机 Chromium 系浏览器。Chrome/Chromium 与 Microsoft Edge 会被自动探测;也可以通过 `browserExecutablePath` 配置项或 `UNIVER_RENDER_BROWSER` 环境变量指定浏览器可执行文件路径(例如 Windows 上的 Edge)。
186
188
  - Slide 的母版、版式页和演讲者备注不在当前编辑范围内。
187
189
  - Board 的思维导图、表格、墨迹和高级编辑,以及 Board 文件导出尚未开放。
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/artifacts/gateway.cjs
3
- size: 59804174 bytes
4
- sha256: 5c97faa4571aea7d520d9ec2fa39747f1eb25c0af1cc4ac28c39d9beae8d5748
3
+ size: 59804423 bytes
4
+ sha256: 22cfbd864959a225c93f02c2c693363e12f446623b5076ccf549a40377785ebb
@@ -329011,6 +329011,7 @@ import process3 from "node:process";
329011
329011
  import { Buffer as NodeBuffer } from "node:buffer";
329012
329012
  var ExchangeFormat = /* @__PURE__ */ ((ExchangeFormat2) => (ExchangeFormat2.XLS = "xls", ExchangeFormat2.XLSX = "xlsx", ExchangeFormat2.CSV = "csv", ExchangeFormat2.TSV = "tsv", ExchangeFormat2.DOC = "doc", ExchangeFormat2.DOCX = "docx", ExchangeFormat2.PPT = "ppt", ExchangeFormat2.PPTX = "pptx", ExchangeFormat2))(ExchangeFormat || {});
329013
329013
  var FormulaCalculationMode = /* @__PURE__ */ ((FormulaCalculationMode2) => (FormulaCalculationMode2.FORCED = "forced", FormulaCalculationMode2.WHEN_EMPTY = "when_empty", FormulaCalculationMode2.NO = "no", FormulaCalculationMode2))(FormulaCalculationMode || {});
329014
+ var DocxCompatibilityMode = /* @__PURE__ */ ((DocxCompatibilityMode2) => (DocxCompatibilityMode2.TRADITIONAL = "traditional", DocxCompatibilityMode2.MODERN = "modern", DocxCompatibilityMode2))(DocxCompatibilityMode || {});
329014
329015
  var ExchangeErrorCode = /* @__PURE__ */ ((ExchangeErrorCode2) => (ExchangeErrorCode2.INVALID_ARGUMENT = "INVALID_ARGUMENT", ExchangeErrorCode2.UNSUPPORTED_FORMAT = "UNSUPPORTED_FORMAT", ExchangeErrorCode2.INVALID_FILE = "INVALID_FILE", ExchangeErrorCode2.INCOMPLETE_SNAPSHOT = "INCOMPLETE_SNAPSHOT", ExchangeErrorCode2.IO_ERROR = "IO_ERROR", ExchangeErrorCode2.NATIVE_LOAD_FAILED = "NATIVE_LOAD_FAILED", ExchangeErrorCode2.CONVERSION_FAILED = "CONVERSION_FAILED", ExchangeErrorCode2))(ExchangeErrorCode || {});
329015
329016
  var ExchangeError = class extends Error {
329016
329017
  constructor(code, message, options) {
@@ -329628,7 +329629,7 @@ async function main() {
329628
329629
  if (request.operation === "import") {
329629
329630
  return await importOfficeFile(
329630
329631
  request.sourcePath,
329631
- importOptions(request.sourcePath, request.unitType)
329632
+ importOptions(request.sourcePath, request.unitType, request.docType)
329632
329633
  );
329633
329634
  }
329634
329635
  const urls = gatewayUrls(request);
@@ -329839,9 +329840,14 @@ function sheetLikeFormat(extension, kind) {
329839
329840
  `${kind} Units must be exported to .xlsx, .csv, or .tsv files`
329840
329841
  );
329841
329842
  }
329842
- function importOptions(sourcePath, type3) {
329843
+ function importOptions(sourcePath, type3, docType) {
329843
329844
  return {
329844
329845
  type: type3,
329846
+ // Traditional mode keeps the source section geometry; modern mode rewrites
329847
+ // page setup to a canned pageless layout and loses it.
329848
+ ...type3 === UniverType.UNIVER_DOC ? {
329849
+ compatibilityMode: docType === "modern" ? DocxCompatibilityMode.MODERN : DocxCompatibilityMode.TRADITIONAL
329850
+ } : {},
329845
329851
  ...type3 === UniverType.UNIVER_SHEET && extname2(sourcePath).toLowerCase() === ".xlsx" ? { formulaCalculation: FormulaCalculationMode.FORCED } : {}
329846
329852
  };
329847
329853
  }
@@ -329861,7 +329867,13 @@ function parseRequest(value) {
329861
329867
  const sourcePath = requiredString(request.sourcePath, "sourcePath");
329862
329868
  if (!isAbsolute(sourcePath)) invalidRequest("sourcePath must be absolute");
329863
329869
  const unitType = requiredImportUnitType(request.unitType);
329864
- return { operation: "import", sourcePath, unitType };
329870
+ const docType = optionalImportDocType(request.docType);
329871
+ return {
329872
+ operation: "import",
329873
+ sourcePath,
329874
+ unitType,
329875
+ ...docType === void 0 ? {} : { docType }
329876
+ };
329865
329877
  }
329866
329878
  const base = {
329867
329879
  gatewayOrigin: requiredHttpOrigin(request.gatewayOrigin),
@@ -329899,6 +329911,11 @@ function requiredImportUnitType(value) {
329899
329911
  }
329900
329912
  return value;
329901
329913
  }
329914
+ function optionalImportDocType(value) {
329915
+ if (value === void 0 || value === null) return void 0;
329916
+ if (value === "traditional" || value === "modern") return value;
329917
+ invalidRequest("import docType must be traditional or modern");
329918
+ }
329902
329919
  function requiredInspectionQuery(value) {
329903
329920
  if (!isRecord4(value)) invalidRequest("query must be an object");
329904
329921
  if (value.kind === "workbook" || value.kind === "presentation" || value.kind === "document" || value.kind === "base" || value.kind === "board") {