agent-bridge-qwenwork 1.0.10 → 1.0.11

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.
@@ -26,6 +26,19 @@ async function recoverCdpDraft(evaluate, editorSelector, stopSelector, dataDir =
26
26
  if (!unchanged()) return false;
27
27
  editor.focus();
28
28
  if (!unchanged()) return false;
29
+ // 千问编辑器由 React 管理内部值,优先调用编辑器控制器,避免只清空 DOM。
30
+ let fiber = editor[Object.keys(editor).find(key => key.startsWith('__reactFiber')) ?? ''];
31
+ for (let depth = 0; fiber && depth < 24; depth++, fiber = fiber.return) {
32
+ const controller = fiber.memoizedProps?.ref?.current;
33
+ if (controller && typeof controller.clear === 'function') {
34
+ controller.clear();
35
+ return !editor.innerText.trim();
36
+ }
37
+ if (controller && typeof controller.setValue === 'function') {
38
+ controller.setValue('');
39
+ return !editor.innerText.trim();
40
+ }
41
+ }
29
42
  const selection = window.getSelection();
30
43
  if (!selection) return false;
31
44
  const range = document.createRange();
@@ -11,7 +11,7 @@ const desktop_launch_1 = require("../desktop-launch");
11
11
  const CHAT_HEARTBEAT_INTERVAL_MS = 2 * 60 * 60_000;
12
12
  exports.qwenworkManifest = {
13
13
  id: "qwenwork",
14
- version: "1.0.10",
14
+ version: "1.0.11",
15
15
  displayName: "千问办公",
16
16
  entry: "dist/index.js",
17
17
  apiVersion: "1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-bridge-qwenwork",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
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.10",
3
+ "version": "1.0.11",
4
4
  "type": "agent",
5
5
  "displayName": "千问办公",
6
6
  "entry": "dist/src-ts/plugins/qwenwork/index.js",