dsh-univer-office 0.3.0 → 0.3.2

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.
@@ -25,7 +25,7 @@ DSH WebServer 上由本插件注册三个路由:
25
25
  | --- | --- | --- |
26
26
  | `/univer-viewer` | HTTP prefix | Viewer 文档与静态资源,原样转发到 Gateway 同路径 |
27
27
  | `/uf` | HTTP prefix | Gateway 领域 API(snapshot/changeset/upload/authz 等),逐请求校验范围后转发 |
28
- | `/univer-viewer/ws` | 精确路径 upgrade | WebSocket 隧道:`?target=/uf/...` 携带真实上游路径 |
28
+ | `/univer-viewer/ws` | 精确路径 upgrade | WebSocket 隧道:`?target=/uf/...` 携带真实上游路径,外层其余 query 参数(端点协议,如 comb 握手的 `sessionTicket`)逐字转发上游 |
29
29
 
30
30
  DSH WebServer 的 upgrade 注册只支持精确路径,而 Gateway 的 WS 端点路径是动态的
31
31
  (`/uf/<key>[/worktrees/<id>]/universer-api/comb/connect` 与 `/uf/<key>[/worktrees/<id>]/events`),
@@ -1,5 +1,5 @@
1
1
  {
2
- "commit": "ed46cd6e433ce1f80de2d9c692a49f71613afefb",
2
+ "commit": "952e6223ce4986a17214f4b3acd0215273712699",
3
3
  "telemetryEndpoint": "https://univer.ai/api/telemetry/cli",
4
- "version": "0.3.0"
4
+ "version": "0.3.2"
5
5
  }
package/lib/index.js CHANGED
@@ -9572,13 +9572,20 @@ async function resolveBrowserExecutablePath2(configured) {
9572
9572
  if (process.platform !== "win32") return void 0;
9573
9573
  const resolved = await C5({ env: process.env });
9574
9574
  if (resolved.status !== "missing") return void 0;
9575
- const programFiles = process.env.ProgramFiles ?? "C:\\Program Files";
9576
- const programFilesX86 = process.env["ProgramFiles(x86)"] ?? "C:\\Program Files (x86)";
9577
- const edgeCandidates = [
9575
+ return edgeBrowserCandidatePaths(process.env).find((candidate) => existsSync(candidate));
9576
+ }
9577
+ function edgeBrowserCandidatePaths(env) {
9578
+ const programFiles = env.ProgramFiles ?? "C:\\Program Files";
9579
+ const programFilesX86 = env["ProgramFiles(x86)"] ?? "C:\\Program Files (x86)";
9580
+ const candidates = [
9578
9581
  join3(programFilesX86, "Microsoft", "Edge", "Application", "msedge.exe"),
9579
9582
  join3(programFiles, "Microsoft", "Edge", "Application", "msedge.exe")
9580
9583
  ];
9581
- return edgeCandidates.find((candidate) => existsSync(candidate));
9584
+ const localAppData = env.LOCALAPPDATA?.trim();
9585
+ if (localAppData !== void 0 && localAppData.length > 0) {
9586
+ candidates.push(join3(localAppData, "Microsoft", "Edge", "Application", "msedge.exe"));
9587
+ }
9588
+ return candidates;
9582
9589
  }
9583
9590
  function captureInput(source, target, signal) {
9584
9591
  const common = signal === void 0 ? source : { ...source, signal };
@@ -12980,6 +12987,11 @@ connection: close\r
12980
12987
  const bridgeTunnel = (req, socket, head, target, resolveOrigin, sessionIds) => {
12981
12988
  void (async () => {
12982
12989
  const upstreamUrl = new URL(target, rewriteLoopback(await resolveOrigin()));
12990
+ for (const [name7, value] of new URL(req.url ?? "/", "http://localhost").searchParams) {
12991
+ if (name7 !== "target") {
12992
+ upstreamUrl.searchParams.set(name7, value);
12993
+ }
12994
+ }
12983
12995
  wss.handleUpgrade(req, socket, head, (client) => {
12984
12996
  const pending = [];
12985
12997
  let closed = false;
@@ -13007,17 +13019,18 @@ connection: close\r
13007
13019
  }
13008
13020
  };
13009
13021
  bridges.add(close);
13010
- client.on("message", (data) => {
13011
- if (upstream.readyState === import_websocket.default.OPEN) upstream.send(data);
13012
- else if (upstream.readyState === import_websocket.default.CONNECTING) pending.push(toBuffer(data));
13022
+ client.on("message", (data, binary) => {
13023
+ if (upstream.readyState === import_websocket.default.OPEN) upstream.send(data, { binary });
13024
+ else if (upstream.readyState === import_websocket.default.CONNECTING)
13025
+ pending.push({ data: toBuffer(data), binary });
13013
13026
  });
13014
13027
  client.on("close", close);
13015
13028
  client.on("error", close);
13016
13029
  upstream.on("open", () => {
13017
- for (const frame of pending.splice(0)) upstream.send(frame);
13030
+ for (const frame of pending.splice(0)) upstream.send(frame.data, { binary: frame.binary });
13018
13031
  });
13019
- upstream.on("message", (data) => {
13020
- client.send(data);
13032
+ upstream.on("message", (data, binary) => {
13033
+ client.send(data, { binary });
13021
13034
  });
13022
13035
  upstream.on("close", close);
13023
13036
  upstream.on("error", close);
@@ -13217,6 +13230,7 @@ export {
13217
13230
  captureTelemetry,
13218
13231
  createUniverRouter,
13219
13232
  createViewerProxy,
13233
+ edgeBrowserCandidatePaths,
13220
13234
  name6 as name,
13221
13235
  parseTelemetryState,
13222
13236
  resolveConfig,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-univer-office",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "DSH × Univer integration with a bundled collaboration Gateway and Viewer: inline previews, live floating Worktree windows, and session-end review actions in DeepSeek Harness.",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -63,7 +63,6 @@
63
63
  }
64
64
  },
65
65
  "scripts": {
66
- "prepare": "pnpm run build && simple-git-hooks",
67
66
  "uninstall": "node scripts/telemetry-entry.mjs uninstall",
68
67
  "build": "pnpm run build:lib && pnpm run build:worker && pnpm run build:gateway && pnpm run build:render && pnpm run build:viewer",
69
68
  "build:lib": "node scripts/build.mjs lib",
@@ -85,14 +84,15 @@
85
84
  "test:skills": "node test/skills-smoke.mjs",
86
85
  "test:telemetry": "node test/telemetry-smoke.mjs",
87
86
  "test": "pnpm run build && pnpm run test:host && pnpm run test:integration && pnpm run test:client && pnpm run test:comparison && pnpm run test:skills && pnpm run test:telemetry",
88
- "verify:public-dependencies": "node scripts/verify-public-runtime-dependencies.mjs",
89
- "prepublishOnly": "pnpm run build && pnpm run test"
87
+ "verify:public-dependencies": "node scripts/verify-public-runtime-dependencies.mjs"
90
88
  },
91
89
  "dependencies": {
92
90
  "@puppeteer/browsers": "^3.2.0",
93
91
  "@univerjs-pro/cli-assets": "0.1.0",
94
92
  "libsql": "^0.5.29",
95
- "puppeteer-core": "^25.7.0"
93
+ "puppeteer-core": "^25.7.0",
94
+ "@univerjs-pro/engine-formula-rust-binding": "1.0.0-insiders.20260910-22fe9c7",
95
+ "@univerjs-pro/exchange-node-binding": "0.1.2"
96
96
  },
97
97
  "peerDependencies": {
98
98
  "@deepseek-ai/cordis": "^4.0.2",
@@ -1,28 +0,0 @@
1
- // Package uninstall lifecycle entry. It must never fail or slow removal: if the
2
- // bundled telemetry entry is missing (fresh checkout before a build, scripts
3
- // disabled) it exits silently, and otherwise the send runs in a detached child
4
- // process. The published package intentionally declares no postinstall script
5
- // because DSH profiles reject unapproved dependency build scripts.
6
- import { spawn } from 'node:child_process'
7
- import { existsSync } from 'node:fs'
8
- import { dirname, join, resolve } from 'node:path'
9
- import { fileURLToPath } from 'node:url'
10
-
11
- const command = process.argv[2]
12
- const eventByCommand = {
13
- uninstall: 'dsh_plugin_uninstall_hook'
14
- }
15
- const event = command === undefined ? undefined : eventByCommand[command]
16
- const entry = join(
17
- resolve(dirname(fileURLToPath(import.meta.url)), '..'),
18
- 'lib',
19
- 'telemetry-entry.js'
20
- )
21
-
22
- if (event !== undefined && existsSync(entry)) {
23
- spawn(process.execPath, [entry, 'capture', event], {
24
- detached: true,
25
- stdio: 'ignore',
26
- windowsHide: true
27
- }).unref()
28
- }