agent-bridge-qwenwork 1.0.30 → 1.0.31

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.
@@ -63,9 +63,6 @@ async function findWindowsExecutable(fileName, configured, run = execFileAsync)
63
63
  let root = (0, node_path_1.dirname)(configuredPath);
64
64
  while (/^(?:app|launcher|doubao_update)$/i.test((0, node_path_1.basename)(root)) || versionDirectory.test((0, node_path_1.basename)(root)))
65
65
  root = (0, node_path_1.dirname)(root);
66
- const updated = (0, node_path_1.join)(root, "Doubao_update", fileName);
67
- if ((0, node_fs_1.existsSync)(updated))
68
- return updated;
69
66
  const latest = await findExecutableInTree(root, fileName, /^/, 3);
70
67
  if (latest)
71
68
  return latest;
@@ -141,11 +138,11 @@ function findChromeExecutable() {
141
138
  async function search(directory, fileName, pattern, depth, insideProduct) {
142
139
  try {
143
140
  const entries = await (0, promises_1.readdir)(directory, { withFileTypes: true });
144
- // 豆包上层文件是启动器,优先查找新版目录或 app 中的实际程序。
141
+ // 豆包更新临时目录可能尚未安装完整,优先使用版本目录或 app 中的客户端。
145
142
  if (insideProduct && depth > 0 && fileName.toLowerCase() === "doubao.exe") {
146
143
  const versions = entries.filter(entry => entry.isDirectory() && (versionDirectory.test(entry.name) || /^(?:app|doubao_update)$/i.test(entry.name)));
147
144
  versions.sort((left, right) => {
148
- const rank = (name) => /^doubao_update$/i.test(name) ? 2 : /^app$/i.test(name) ? 0 : 1;
145
+ const rank = (name) => /^doubao_update$/i.test(name) ? 0 : /^app$/i.test(name) ? 1 : 2;
149
146
  return rank(right.name) - rank(left.name) || right.name.replace(/^\D+/, "").localeCompare(left.name.replace(/^\D+/, ""), "en", { numeric: true });
150
147
  });
151
148
  for (const entry of versions) {
@@ -244,8 +241,10 @@ $ids = @($processes.ProcessId)
244
241
  $roots = @($processes | Where-Object { $ids -notcontains $_.ParentProcessId })
245
242
  ${keepPort === undefined ? "" : `
246
243
  # 保留有效 CDP 所属进程树,只结束同安装路径的其它重复实例。
247
- $owners = @(Get-NetTCPConnection -State Listen -LocalPort ${keepPort} | Select-Object -ExpandProperty OwningProcess -Unique)
248
- if ($owners.Count -ne 1) { throw '无法确认有效 CDP 端口的唯一进程,未清理桌面实例' }
244
+ try { $owners = @(Get-NetTCPConnection -State Listen -LocalPort ${keepPort} | Select-Object -ExpandProperty OwningProcess -Unique) }
245
+ catch { Write-Output '[]'; return }
246
+ # 端口查询可能被系统网络组件隐藏,不能因此中断有效连接或猜测要结束的进程。
247
+ if ($owners.Count -ne 1 -or $owners[0] -eq 0) { Write-Output '[]'; return }
249
248
  $byId = @{}; foreach ($item in $all) { $byId[[int]$item.ProcessId] = $item }
250
249
  $current = $byId[[int]$owners[0]]
251
250
  $keepRoot = $null
@@ -257,7 +256,7 @@ while ($current -and -not $visited.ContainsKey([int]$current.ProcessId)) {
257
256
  if ($parent -and $parent.CreationDate -gt $current.CreationDate) { break }
258
257
  $current = $parent
259
258
  }
260
- if (-not $keepRoot) { throw '无法保留有效 CDP 对应的同用户桌面进程树,未清理桌面实例' }
259
+ if (-not $keepRoot) { Write-Output '[]'; return }
261
260
  $roots = @($roots | Where-Object { $_.ProcessId -ne $keepRoot.ProcessId })
262
261
  `}
263
262
  $terminated = @()
@@ -13,7 +13,7 @@ const session_history_1 = require("./session-history");
13
13
  const ability_1 = require("./ability");
14
14
  exports.qwenworkManifest = {
15
15
  id: "qwenwork",
16
- version: "1.0.30",
16
+ version: "1.0.31",
17
17
  displayName: "千问办公",
18
18
  entry: "dist/index.js",
19
19
  apiVersion: "1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-bridge-qwenwork",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "description": "agent-bridge 的千问办公插件。",
5
5
  "keywords": [
6
6
  "mu-agent-bridge-plugin",
package/plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "qwenwork",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "type": "agent",
5
5
  "displayName": "千问办公",
6
6
  "entry": "dist/src-ts/plugins/qwenwork/index.js",