dsh-chrome-use 0.16.0 → 0.16.1

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # 更新日志
2
2
 
3
+ ## [0.16.1] - 2026-11-26
4
+
5
+ ### 修复
6
+
7
+ - `chrome_claim` 被另一个扩展的 `chrome-extension://` 内嵌 frame 拦住时,错误信息会列出这些 frame 的 URL、frameId、parentFrameId 和扩展 ID,并给出 `chrome://extensions/?id=...` 方便定位;读不到 frame 树时会说明原因。Chromium 只要页面里任意一个 frame 属于别的扩展就拒绝 DevTools attach,不需要整页被接管。
8
+ - Chrome 主动 detach(例如 `target_closed`)不再立刻释放标签页租约:标签页还在、只是调试目标被丢弃或窗口被移动时,原会话保留 ownership,可重新 claim,其他会话仍然拿不到;标签页真的消失或主动 release 时才释放。
9
+ - detach 提示会翻译原因(DevTools 打开了、别的扩展抢占了调试器、用户取消了调试提示、标签页被关闭),标签页由本扩展关闭时还带上关闭方:`idle`、`chat <port>`、`cleanup <port>`、`disconnect <port>`。
10
+ - `chrome_doctor` 在标签页尚未 attach 时不再只报 `TAB_NOT_ATTACHED`:会返回标签页是否存在、是否已被 Chrome discard、能读到的其他扩展 frame 列表和下一步说明。
11
+
12
+ ### 文档
13
+
14
+ - `docs/chrome-session-debugging.md` 补充 frame 诊断、租约保留和 detach 原因说明。
15
+
3
16
  ## [0.16.0] - 2026-11-24
4
17
 
5
18
  ### 新增
@@ -45,11 +45,11 @@
45
45
 
46
46
  `chrome_claim` 和 `chrome_open` 失败时报 `ATTACH_FAILED at <阶段>: tab <id> (<协议>://<域名>) <Chrome 原始原因>`。阶段是 `attach`,或者 `Page.enable` 这类 CDP 域名启用步骤;括号里是插件当时解析到的标签页位置,只保留协议和域名,不含路径和查询串,用来判断这个 id 是否还指向你列出的页面。
47
47
 
48
- - `Cannot access a chrome-extension:// URL of different extension`:Chrome 拒绝调试,因为这个标签页暴露了另一个扩展的 URL。可能是整页由别的扩展接管(PDF 阅读器、替换新标签页的扩展),也可能只是内嵌的扩展页面,不能据此断定页面归属。换一个普通标签页重新打开同一网址只是需要验证的规避方式,不保证有效。
48
+ - `Cannot access a chrome-extension:// URL of different extension`:Chrome 拒绝调试,因为这个标签页暴露了另一个扩展的 URL。可能是整页由别的扩展接管(PDF 阅读器、替换新标签页的扩展),也可能只是内嵌的扩展页面。插件会用 `chrome.webNavigation.getAllFrames` 找出最多 5 个属于其他扩展的 frame,把 `frameId`、`parentFrameId`、URL 和扩展 ID 写进错误,并给出 `chrome://extensions/?id=<id>` 定位地址;按这个地址停用对应扩展后刷新页面再 claim,或改用没装该扩展的 Chrome 配置。如果 Chrome 没暴露 frame 树(例如标签页刚被关闭),错误会说明 frame 列表读不到。`chrome_doctor` 在未 attach 时也会返回同样的 `extensionFrames`,不必先 claim。
49
49
  - `Another debugger is already attached`:这个标签页已被别的调试会话占用。先关掉 DevTools 或另一个扩展的调试会话。
50
50
  未占用标签页有两个检查层级,错误码不同,处理方式一样(先 `chrome_tabs` 确认页面还在,再 `chrome_claim`):
51
51
 
52
- - `TAB_NOT_OWNED: claim the tab first`:Harness 自己的占用表里没有这个标签页——从未 claim,或已经 `chrome_release`。这是“未 claim 或 release 后继续操作”的预期错误码。消息可能带诊断后缀 `(Chrome detached this tab <n>s ago: <reason>)`,`reason` 是 Chrome 给出的解除原因,例如 `target_closed`、`replaced_with_devtools`,也可能是插件自己记录的 `released`。
52
+ - `TAB_NOT_OWNED: claim the tab first`:Harness 自己的占用表里没有这个标签页——从未 claim,或已经 `chrome_release`。这是“未 claim 或 release 后继续操作”的预期错误码。消息可能带诊断后缀 `(Chrome detached this tab <n>s ago: <说明>)`,说明由 Chrome 原因翻译而来:`target_closed` 加标签页已关闭时会写 `the tab was closed by <来源>`,来源可能是 `idle`、`chat <port>`、`cleanup <port>` 或 `disconnect <port>`;标签页还开着时会写 target 被丢弃但 tab 仍在、占用仍保留,重新 claim 即可;`replaced_with_devtools` 会写 DevTools 打开并接管了调试会话,`replaced_with_devtools_extension` 会写另一个扩展 attach 了调试器,`canceled_by_user` 会写用户取消了调试提示。插件自己 release 时写 `released`。
53
53
  - `TAB_NOT_LEASED: claim the tab first`:Harness 认为仍然持有这个标签页,但扩展侧的租约已经丢失,例如重载扩展之后旧连接还留着。看到它同样先确认页面、再重新 claim。
54
54
  - 已经 claim 的页面刷新后使用旧 `ref`,报 `STALE_ELEMENT`;被另一个 Harness 占用的页面报 `TAB_OWNED_BY_ANOTHER_HARNESS`。
55
55
  - 失败的命令不会留下占用,可以直接重新 `chrome_claim`。
@@ -70,11 +70,39 @@ async function applyMode() {
70
70
  controller.foregroundMode = foregroundMode !== false;
71
71
  }
72
72
 
73
- const controller = new BrowserController(chrome, (tabId, reason) => {
73
+ // Closing a tab discards its debugger state without an onDetach callback, so
74
+ // remember which path closed it. A later failure on the same tab can then say
75
+ // whether this extension closed it and where the close came from.
76
+ const recentCloses = new Map();
77
+ const CLOSE_NOTE_MS = 60000;
78
+ function noteClose(tabId, source) {
79
+ recentCloses.delete(tabId);
80
+ recentCloses.set(tabId, { source, at: Date.now() });
81
+ if (recentCloses.size > 100) recentCloses.delete(recentCloses.keys().next().value);
82
+ }
83
+ function closeSourceFor(tabId) {
84
+ const note = recentCloses.get(tabId);
85
+ if (!note) return null;
86
+ if (Date.now() - note.at > CLOSE_NOTE_MS) { recentCloses.delete(tabId); return null; }
87
+ return note.source;
88
+ }
89
+
90
+ const controller = new BrowserController(chrome, (tabId, reason, details = {}) => {
74
91
  const owner = leases.get(tabId)?.client;
75
- leases.release(tabId);
92
+ if (!owner) return;
93
+ // A removed tab can never be reused. Every other detach may only mean Chrome
94
+ // dropped the target of a tab that is still open (discard, window move), so
95
+ // keep the lease and let the same session re-claim instead of handing a live
96
+ // tab to another session mid-task.
97
+ if (details.tabExists === false || reason === 'released') leases.release(tabId, owner);
98
+ const closeSource = closeSourceFor(tabId);
76
99
  if (owner?.connected && owner.socket?.readyState === WebSocket.OPEN) {
77
- owner.socket.send(JSON.stringify({ type: 'detached', tabId, ...(reason ? { reason: String(reason).slice(0, 40) } : {}) }));
100
+ owner.socket.send(JSON.stringify({
101
+ type: 'detached', tabId,
102
+ ...(reason ? { reason: String(reason).slice(0, 40) } : {}),
103
+ ...(details.tabExists === undefined ? {} : { tabExists: details.tabExists }),
104
+ ...(closeSource ? { closeSource } : {}),
105
+ }));
78
106
  }
79
107
  });
80
108
  const idleTabs = createIdleTabs(chrome.storage.session);
@@ -343,6 +371,7 @@ async function sweepIdleTabs() {
343
371
  try {
344
372
  // This close is opt-in through the popup switch, so it does not ask the
345
373
  // page's beforeunload guard. Manual chrome_close still follows its own setting.
374
+ noteClose(tabId, 'idle');
346
375
  await controller.closeTab(tabId, undefined, { force: true, attachIfNeeded: true });
347
376
  clients.get(record.port)?.opened.delete(tabId);
348
377
  await idleTabs.forget(tabId);
@@ -383,6 +412,7 @@ async function drainClient(client, { closeOpened = false } = {}) {
383
412
  const wasOpened = closeOpened && client.opened.has(tabId);
384
413
  if (wasOpened) {
385
414
  // Close before detaching so the beforeunload event is still visible.
415
+ noteClose(tabId, `disconnect ${client.port}`);
386
416
  try { await controller.closeTab(tabId, undefined, { force: forceClose, attachIfNeeded: true }); }
387
417
  catch (error) {
388
418
  const message = String(error?.message ?? error).slice(0, 2000);
@@ -423,6 +453,7 @@ async function drainClient(client, { closeOpened = false } = {}) {
423
453
  if (owner && owner !== client) { client.opened.delete(tabId); continue; }
424
454
  // A detached tab has no dialog listener, so closeTab briefly reattaches
425
455
  // for the forced close; a failure still falls back to plain removal.
456
+ noteClose(tabId, `disconnect ${client.port}`);
426
457
  try { await controller.closeTab(tabId, undefined, { force: forceClose, attachIfNeeded: true }); }
427
458
  catch (error) {
428
459
  const message = String(error?.message ?? error).slice(0, 2000);
@@ -734,6 +765,7 @@ async function cleanupOpenedTabs(client, args, signal) {
734
765
  // Close while the debugger session is still attached so a beforeunload
735
766
  // prompt can be accepted. closeTab removes the tab and drops local state;
736
767
  // the lease is released explicitly below.
768
+ noteClose(tabId, `cleanup ${client.port}`);
737
769
  await controller.closeTab(tabId, signal, { force: forceClose, attachIfNeeded: true });
738
770
  leases.release(tabId, client);
739
771
  client.opened.delete(tabId);
@@ -847,6 +879,7 @@ async function handleCommand(client, message) {
847
879
  const commandArgs = action === 'close' && args.force === undefined
848
880
  ? { ...args, force: await forceCloseBeforeUnload() }
849
881
  : args;
882
+ if (action === 'close' && tabId !== undefined) noteClose(tabId, `chat ${client.port}`);
850
883
  response = { result: action === 'cleanup' ? await cleanupOpenedTabs(client, args, cancellation.signal) : await controller.execute(action, commandArgs, cancellation.signal, options) };
851
884
  if (action === 'close' && tabId !== undefined) { client.opened.delete(tabId); forgetIdleTab(tabId); }
852
885
  } catch (error) {
@@ -25,13 +25,25 @@ export function tabLocation(value) {
25
25
  } catch { return 'unparseable'; }
26
26
  }
27
27
 
28
- export function attachFailure(error, tabId, url, stage = 'attach') {
28
+ // Chrome refuses a tab that exposes another extension's URL, and the usual
29
+ // cause is one injected iframe. Name the frame and the owning extension so the
30
+ // caller does not have to guess which extension to disable.
31
+ export function extensionHint(frames) {
32
+ if (frames === undefined) {
33
+ return '; Chrome blocked debugging because the tab exposes another extension\'s URL, possibly from an embedded frame; the frame list could not be read, so check chrome://extensions and reload the page after disabling the extension';
34
+ }
35
+ if (!frames.length) {
36
+ return '; Chrome blocked debugging because the tab exposes another extension\'s URL, but the frame list no longer shows that frame; it may have navigated away, so reload the page and retry';
37
+ }
38
+ const listed = frames.map(frame => `${frame.url} (frame ${frame.frameId}, parent ${frame.parentFrameId})`).join('; ');
39
+ const ids = [...new Set(frames.map(frame => frame.extensionId).filter(Boolean))];
40
+ const owners = ids.length ? `; extension${ids.length > 1 ? 's' : ''} ${ids.join(', ')}` : '';
41
+ return `; Chrome blocked debugging because an embedded frame belongs to another extension: ${listed}${owners}; open chrome://extensions/?id=${ids[0] ?? ''} and disable it, or claim the tab in a Chrome profile without that extension`;
42
+ }
43
+
44
+ export function attachFailure(error, tabId, url, stage = 'attach', frames) {
29
45
  const reason = clip(error?.message ?? error, 300);
30
- // Chrome refuses a tab that exposes another extension's URL. That can be an
31
- // embedded frame as well as the top-level page, so do not name the owner.
32
- const hint = /chrome-extension:\/\/ URL of different extension/i.test(reason)
33
- ? '; Chrome blocked debugging because the tab exposes another extension\'s URL, which can also come from an embedded frame; open the page in a normal tab and claim that one'
34
- : '';
46
+ const hint = /chrome-extension:\/\/ URL of different extension/i.test(reason) ? extensionHint(frames) : '';
35
47
  return new Error(`ATTACH_FAILED at ${stage}: tab ${tabId} (${tabLocation(url)}) ${reason}${hint}`);
36
48
  }
37
49
 
@@ -202,20 +214,62 @@ export class BrowserController {
202
214
  this.chooserPendingMs = 30000;
203
215
  this.chooserWaitMs = 500;
204
216
  this.attached = new Map();
217
+ // Tabs whose Chrome target vanished while the tab stayed open. Chrome does
218
+ // not announce their later close with another detach, so onRemoved must
219
+ // finish that notification without double-reporting an explicit release.
220
+ this.liveDetached = new Set();
205
221
  // Native Chrome promises outlive our timeouts. Do not attach a new session
206
222
  // while a previous native cleanup can still detach it.
207
223
  this.pendingCleanup = new Map();
208
224
  api.debugger.onDetach.addListener(({ tabId }, reason) => {
209
225
  clearTimeout(this.attached.get(tabId)?.chooserTimer);
210
- if (this.attached.delete(tabId)) detached(tabId, reason);
226
+ if (!this.attached.delete(tabId)) return;
227
+ // Detach is not always a close: Chrome drops the target when it discards a
228
+ // tab or moves it between windows. Tell the owner whether the tab still
229
+ // exists, so a live tab keeps its lease and the same chat can re-claim it.
230
+ const notify = tabExists => {
231
+ if (tabExists) this.liveDetached.add(tabId);
232
+ try { detached(tabId, reason, { tabExists }); } catch {}
233
+ };
234
+ this.api.tabs.get(tabId).then(() => notify(true), () => notify(false));
211
235
  });
212
236
  api.tabs.onRemoved.addListener(tabId => {
213
237
  clearTimeout(this.attached.get(tabId)?.chooserTimer);
214
- if (this.attached.delete(tabId)) detached(tabId, 'target_closed');
238
+ const wasAttached = this.attached.delete(tabId);
239
+ const wasLive = this.liveDetached.delete(tabId);
240
+ // A removed tab can never be reclaimed. Report it when it was attached or
241
+ // when an earlier detach kept its lease for a still-open tab.
242
+ if (!wasAttached && !wasLive) return;
243
+ try { detached(tabId, 'target_closed', { tabExists: false }); } catch {}
215
244
  });
216
245
  api.debugger.onEvent.addListener((target, method, params) => this.event(target, method, params));
217
246
  }
218
247
 
248
+ // Frames are the only reliable way to name the blocker: chrome.debugger
249
+ // targets carry no tabId for iframes. Read them lazily after a failed attach
250
+ // and bound the read so diagnostics never delay the real error for long.
251
+ async extensionFrames(tabId) {
252
+ const getAllFrames = this.api.webNavigation?.getAllFrames;
253
+ if (typeof getAllFrames !== 'function') return undefined;
254
+ let frames;
255
+ try {
256
+ const call = async () => getAllFrames({ tabId });
257
+ frames = await bounded(call(), undefined, 'webNavigation.getAllFrames', 800);
258
+ } catch { return undefined; }
259
+ if (!Array.isArray(frames)) return undefined;
260
+ const own = this.api.runtime?.id;
261
+ const found = [];
262
+ for (const frame of frames) {
263
+ let url;
264
+ try { url = new URL(frame?.url); } catch { continue; }
265
+ if (url.protocol !== 'chrome-extension:') continue;
266
+ if (own && url.host === own) continue;
267
+ found.push({ frameId: frame.frameId, parentFrameId: frame.parentFrameId, url: clip(`${url.protocol}//${url.host}${url.pathname}`, 160), extensionId: url.host });
268
+ if (found.length === 5) break;
269
+ }
270
+ return found;
271
+ }
272
+
219
273
  trackCleanup(tabId, promise) {
220
274
  this.pendingCleanup.set(tabId, promise);
221
275
  promise.then(() => {
@@ -330,9 +384,12 @@ export class BrowserController {
330
384
  try { await bounded(attachment, signal, 'attach'); }
331
385
  catch (error) {
332
386
  this.trackCleanup(tabId, attachment.then(() => this.api.debugger.detach({ tabId }), () => {}));
333
- throw attachFailure(error, tabId, currentUrl, 'attach');
387
+ const blocked = /chrome-extension:\/\/ URL of different extension/i.test(String(error?.message ?? error));
388
+ const frames = blocked && !signal?.aborted ? await this.extensionFrames(tabId) : undefined;
389
+ throw attachFailure(error, tabId, currentUrl, 'attach', frames);
334
390
  }
335
391
  this.attached.set(tabId, { refs: new Map(), revision: 0, logs: [], logSeq: 0, requests: [], dialog: null, chooser: null, chooserTimer: null, loadResolve: null, lastNetworkActivity: Date.now(), networkInFlight: 0, networkRequests: new Map(), mainFrameId: null, actions: [], actionSeq: 0, challenge: null, emulation: null, acceptBeforeUnload: false });
392
+ this.liveDetached.delete(tabId);
336
393
  let stage = 'attach';
337
394
  try {
338
395
  for (const domain of ['Page', 'DOM', 'Accessibility', 'Runtime', 'Network']) {
@@ -838,7 +895,23 @@ export class BrowserController {
838
895
  if (action === 'doctor') {
839
896
  if (tabId === undefined) return { tabId: null, attached: false, note: 'No tab given: this reports host-side checks only.' };
840
897
  const state = this.attached.get(tabId);
841
- if (!state) throw new Error('TAB_NOT_ATTACHED: claim the tab again');
898
+ if (!state) {
899
+ // An unattached tab is exactly when this report is most useful: name
900
+ // the extension frames that can block the next claim instead of only
901
+ // failing the call.
902
+ let tab;
903
+ try { tab = await bounded(this.api.tabs.get(tabId), signal, 'tabs.get'); }
904
+ catch (error) {
905
+ if (signal.aborted) throw error;
906
+ return { tabId, exists: false, attached: false, note: 'This tab no longer exists. Claim another tab; if the page reopened, Chrome gave it a new tab id.' };
907
+ }
908
+ const frames = await this.extensionFrames(tabId);
909
+ return {
910
+ tabId, exists: true, url: clip(tab.url, 4096), title: clip(tab.title, 300), attached: false,
911
+ discarded: Boolean(tab.discarded), extensionFrames: frames ?? null,
912
+ note: 'This tab is not attached to the debugger. Claim it again. Embedded frames owned by another extension block attach; extensionFrames lists them when Chrome exposes the frame tree.',
913
+ };
914
+ }
842
915
  const tab = await bounded(this.api.tabs.get(tabId), signal, 'tabs.get');
843
916
  let page = null;
844
917
  try {
@@ -2,7 +2,7 @@
2
2
  "manifest_version": 3,
3
3
  "name": "dsh-chrome-use",
4
4
  "description": "Let DeepSeek Harness control Chrome tabs, with several agent sessions working in parallel.",
5
- "version": "0.16.0",
5
+ "version": "0.16.1",
6
6
  "minimum_chrome_version": "120",
7
7
  "permissions": [
8
8
  "debugger",
@@ -10,7 +10,8 @@
10
10
  "tabGroups",
11
11
  "storage",
12
12
  "alarms",
13
- "downloads"
13
+ "downloads",
14
+ "webNavigation"
14
15
  ],
15
16
  "background": {
16
17
  "service_worker": "background.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-chrome-use",
3
- "version": "0.16.0",
3
+ "version": "0.16.1",
4
4
  "description": "Control Google Chrome tabs from DeepSeek Harness.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
package/src/bridge.js CHANGED
@@ -20,6 +20,21 @@ const portValue = value => {
20
20
  return Number.isSafeInteger(port) && port >= 1024 && port <= 65535 ? String(port) : undefined;
21
21
  };
22
22
 
23
+ // Chrome reasons are short codes. Explain what each one means for the tab, so a
24
+ // later failure says whether to retry, re-claim, or give up on this tab.
25
+ function describeDetach({ reason, tabExists, closeSource }) {
26
+ if (reason === 'released') return 'this chat released it';
27
+ if (reason === 'target_closed') {
28
+ if (tabExists === false) return `the tab was closed${closeSource ? ` by ${closeSource}` : ' outside this extension'}`;
29
+ if (tabExists === true) return 'Chrome dropped the debug target but the tab is still open (discarded or moved between windows); this chat still holds it, claim it again';
30
+ return 'Chrome closed the debug target';
31
+ }
32
+ if (reason === 'replaced_with_devtools') return 'DevTools opened on this tab and took the debugger session';
33
+ if (reason === 'replaced_with_devtools_extension') return 'another extension attached its debugger to this tab';
34
+ if (reason === 'canceled_by_user') return 'the user canceled the debugging prompt';
35
+ return reason ? `reason ${reason}` : 'the reason is unknown';
36
+ }
37
+
23
38
  export class Bridge {
24
39
  constructor({ port = PORT, auto = false, portCandidates, baseStateDir, stateDir, name, probe = probePort, deadlineMs = DEADLINE_MS, claimWaitMs = CLAIM_WAIT_MS } = {}) {
25
40
  // Optional label the agent side shows in the popup so the user can tell
@@ -264,9 +279,14 @@ export class Bridge {
264
279
  return;
265
280
  }
266
281
  if (message.type === 'detached' && Number.isSafeInteger(message.tabId)) {
267
- this.claims.delete(message.tabId);
282
+ // The extension keeps the lease when the tab still exists (Chrome
283
+ // dropped the target for a discard or a window move). Keep the claim
284
+ // too, so the same chat can inspect and re-claim the tab it still owns.
285
+ if (!(message.tabExists === true && message.reason !== 'released')) this.claims.delete(message.tabId);
268
286
  this.lastDetach.set(message.tabId, {
269
287
  reason: typeof message.reason === 'string' ? message.reason.slice(0, 40) : null,
288
+ ...(typeof message.tabExists === 'boolean' ? { tabExists: message.tabExists } : {}),
289
+ ...(typeof message.closeSource === 'string' ? { closeSource: message.closeSource.slice(0, 80) } : {}),
270
290
  at: Date.now(),
271
291
  });
272
292
  if (this.lastDetach.size > 200) this.lastDetach.delete(this.lastDetach.keys().next().value);
@@ -361,7 +381,7 @@ export class Bridge {
361
381
  const last = this.lastDetach.get(tabId);
362
382
  if (!last || Date.now() - last.at > 60000) return '';
363
383
  const age = Math.max(0, Math.round((Date.now() - last.at) / 1000));
364
- return ` (Chrome detached this tab ${age}s ago${last.reason ? `: ${last.reason}` : ''})`;
384
+ return ` (Chrome detached this tab ${age}s ago: ${describeDetach(last)})`;
365
385
  }
366
386
 
367
387
  rejectWaiters(tabId, error) {
@@ -455,6 +475,12 @@ export class Bridge {
455
475
  acquired = true;
456
476
  }
457
477
  if (action === 'release') this.releaseClaim(args.tabId, owner);
478
+ // A doctor run right after a failure should explain why the tab detached,
479
+ // not just report that it is not attached.
480
+ if (action === 'doctor' && tabId !== undefined) {
481
+ const note = this.lastDetach.get(tabId);
482
+ if (note && Date.now() - note.at <= 60000) result.detach = { ...note };
483
+ }
458
484
  if (action === 'messages') {
459
485
  // Reading consumes the hint; the result already carries the text.
460
486
  const unread = Number.isSafeInteger(result?.unread) && result.unread > 0 ? result.unread : 0;
package/src/client.js CHANGED
@@ -179,7 +179,7 @@ async function checkRelease(current, fetcher = fetch) {
179
179
  } finally { clearTimeout(timer); }
180
180
  }
181
181
 
182
- const packageVersion = "0.16.0";
182
+ const packageVersion = "0.16.1";
183
183
  // Wrapped by scripts/build-client.mjs for the Harness browser module loader.
184
184
  const React = require('react');
185
185
  const { createElement: h, useState, useEffect, useRef } = React;