@ait-co/devtools 0.1.129 → 0.1.131

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 (86) hide show
  1. package/dist/{attach-orchestrator-DvrgUIx7.js → attach-orchestrator-BiaYiNOr.js} +31 -13
  2. package/dist/{attach-orchestrator-DvrgUIx7.js.map → attach-orchestrator-BiaYiNOr.js.map} +1 -1
  3. package/dist/{attach-orchestrator-RhOdO3DS.js → attach-orchestrator-Cjdhir2U.js} +31 -13
  4. package/dist/{attach-orchestrator-RhOdO3DS.js.map → attach-orchestrator-Cjdhir2U.js.map} +1 -1
  5. package/dist/{attach-orchestrator-Bdt5Zdo9.js → attach-orchestrator-ca34r46y.js} +31 -13
  6. package/dist/{attach-orchestrator-Bdt5Zdo9.js.map → attach-orchestrator-ca34r46y.js.map} +1 -1
  7. package/dist/{cell-Ba9lCI3B.js → cell-Bi8MAPA8.js} +11 -7
  8. package/dist/cell-Bi8MAPA8.js.map +1 -0
  9. package/dist/{cell-DA_lcpDI.js → cell-Cw4fVOl2.js} +11 -7
  10. package/dist/cell-Cw4fVOl2.js.map +1 -0
  11. package/dist/{cell-DLRv4iG6.js → cell-rr6gL9AT.js} +11 -7
  12. package/dist/cell-rr6gL9AT.js.map +1 -0
  13. package/dist/{debug-server-Bu3pCG9c.js → debug-server-BSbfnFR5.js} +9 -9
  14. package/dist/debug-server-BSbfnFR5.js.map +1 -0
  15. package/dist/{debug-server-e1qPe0ZB.js → debug-server-CD4zYBq4.js} +4 -4
  16. package/dist/{debug-server-e1qPe0ZB.js.map → debug-server-CD4zYBq4.js.map} +1 -1
  17. package/dist/{debug-server--Y0QZVJS.js → debug-server-qRSRG7YZ.js} +15 -11
  18. package/dist/debug-server-qRSRG7YZ.js.map +1 -0
  19. package/dist/in-app/auto.js +15 -0
  20. package/dist/in-app/auto.js.map +1 -1
  21. package/dist/in-app/index.d.ts +27 -0
  22. package/dist/in-app/index.d.ts.map +1 -1
  23. package/dist/in-app/index.js +15 -0
  24. package/dist/in-app/index.js.map +1 -1
  25. package/dist/mcp/cli.js +143 -35
  26. package/dist/mcp/cli.js.map +1 -1
  27. package/dist/mcp/server.js +1 -1
  28. package/dist/panel/index.js +11 -1
  29. package/dist/panel/index.js.map +1 -1
  30. package/dist/{pool-C0pc7T2p.d.ts → pool-BaSCZALv.d.ts} +9 -1
  31. package/dist/{pool-C0pc7T2p.d.ts.map → pool-BaSCZALv.d.ts.map} +1 -1
  32. package/dist/{qr-http-server-HANhOFwI.js → qr-http-server-BdNGPRoL.js} +76 -6
  33. package/dist/qr-http-server-BdNGPRoL.js.map +1 -0
  34. package/dist/{qr-http-server-CrGohOwC.js → qr-http-server-Bq9zR7-z.js} +76 -6
  35. package/dist/qr-http-server-Bq9zR7-z.js.map +1 -0
  36. package/dist/{qr-http-server-DM2R25jP.cjs → qr-http-server-BxoRp2w7.cjs} +76 -6
  37. package/dist/qr-http-server-BxoRp2w7.cjs.map +1 -0
  38. package/dist/{qr-http-server-Bt_RAxFn.cjs → qr-http-server-CV6TA9ZN.cjs} +76 -6
  39. package/dist/qr-http-server-CV6TA9ZN.cjs.map +1 -0
  40. package/dist/{qr-http-server-s1iW_5VQ.js → qr-http-server-DCbjORFa.js} +76 -6
  41. package/dist/qr-http-server-DCbjORFa.js.map +1 -0
  42. package/dist/{qr-http-server-BH0UFeUn.js → qr-http-server-cKbciY5k.js} +76 -6
  43. package/dist/qr-http-server-cKbciY5k.js.map +1 -0
  44. package/dist/{relay-factory-Ck3vBonr.js → relay-factory-Cloog1jb.js} +33 -13
  45. package/dist/relay-factory-Cloog1jb.js.map +1 -0
  46. package/dist/{relay-worker-Bt0QYKQH.js → relay-worker-CCAHLC4a.js} +9 -5
  47. package/dist/relay-worker-CCAHLC4a.js.map +1 -0
  48. package/dist/test-runner/bin.js +45 -19
  49. package/dist/test-runner/bin.js.map +1 -1
  50. package/dist/test-runner/config.d.ts +15 -9
  51. package/dist/test-runner/config.d.ts.map +1 -1
  52. package/dist/test-runner/config.js +1 -1
  53. package/dist/test-runner/pool.d.ts +1 -1
  54. package/dist/test-runner/pool.js +1 -1
  55. package/dist/test-runner/pool.js.map +1 -1
  56. package/dist/test-runner/relay-factory.d.ts +22 -8
  57. package/dist/test-runner/relay-factory.d.ts.map +1 -1
  58. package/dist/test-runner/relay-factory.js +32 -12
  59. package/dist/test-runner/relay-factory.js.map +1 -1
  60. package/dist/test-runner/relay-worker.js +1 -1
  61. package/dist/{tunnel-DyEV6WwL.cjs → tunnel-B2UCKAc7.cjs} +4 -3
  62. package/dist/{tunnel-DyEV6WwL.cjs.map → tunnel-B2UCKAc7.cjs.map} +1 -1
  63. package/dist/{tunnel-BFwOSwT4.js → tunnel-C-rQ34dM.js} +4 -3
  64. package/dist/{tunnel-BFwOSwT4.js.map → tunnel-C-rQ34dM.js.map} +1 -1
  65. package/dist/unplugin/index.cjs +1 -1
  66. package/dist/unplugin/index.js +1 -1
  67. package/dist/unplugin/tunnel.cjs +3 -2
  68. package/dist/unplugin/tunnel.cjs.map +1 -1
  69. package/dist/unplugin/tunnel.d.cts.map +1 -1
  70. package/dist/unplugin/tunnel.d.ts.map +1 -1
  71. package/dist/unplugin/tunnel.js +3 -2
  72. package/dist/unplugin/tunnel.js.map +1 -1
  73. package/package.json +1 -1
  74. package/dist/cell-Ba9lCI3B.js.map +0 -1
  75. package/dist/cell-DA_lcpDI.js.map +0 -1
  76. package/dist/cell-DLRv4iG6.js.map +0 -1
  77. package/dist/debug-server--Y0QZVJS.js.map +0 -1
  78. package/dist/debug-server-Bu3pCG9c.js.map +0 -1
  79. package/dist/qr-http-server-BH0UFeUn.js.map +0 -1
  80. package/dist/qr-http-server-Bt_RAxFn.cjs.map +0 -1
  81. package/dist/qr-http-server-CrGohOwC.js.map +0 -1
  82. package/dist/qr-http-server-DM2R25jP.cjs.map +0 -1
  83. package/dist/qr-http-server-HANhOFwI.js.map +0 -1
  84. package/dist/qr-http-server-s1iW_5VQ.js.map +0 -1
  85. package/dist/relay-factory-Ck3vBonr.js.map +0 -1
  86. package/dist/relay-worker-Bt0QYKQH.js.map +0 -1
@@ -1625,34 +1625,52 @@ async function renderAndMaybeWait(deps, prep, waitForAttach, callTimeoutMs, conn
1625
1625
  }, null, 2)}\n\n${qr}`);
1626
1626
  }
1627
1627
  /**
1628
- * Builds a self-contained IIFE DOM expression that renders a dismissible
1629
- * "Debugger Connected" badge on the bottom-left of the phone screen.
1628
+ * Builds a self-contained IIFE DOM expression that renders a LIVE
1629
+ * "Debugger Connected" / "Debugger Disconnected" badge on the bottom-left of
1630
+ * the phone screen (#730).
1630
1631
  *
1631
1632
  * **Pure function** — returns a JS expression string; does NOT inject it.
1632
1633
  * Injection is performed by {@link injectDebugIndicator} in `cell.ts`.
1633
1634
  *
1634
1635
  * The expression, when evaluated on the page, does the following:
1635
- * 1. Early-returns if `#__ait_debug_indicator` already exists (idempotent
1636
- * prevents duplicate badges on re-injection after page reload).
1637
- * 2. Appends a fixed-position `<div id="__ait_debug_indicator">` at the
1638
- * bottom-left, accounting for safe-area insets.
1639
- * 3. Attaches a `{ once: true }` `pointerdown` listener that removes the
1640
- * badge on first touch one-tap dismiss.
1636
+ * 1. Idempotent controller a single `window.__ait_indicator` controller
1637
+ * object is created once (keyed on its presence, not on the DOM node).
1638
+ * Re-injection (e.g. explicit disconnect notice from `close()`) UPDATES
1639
+ * the existing badge's state/label in place — it never duplicates the
1640
+ * `<div>` or stacks a second observer.
1641
+ * 2. Renders a fixed-position `<div id="__ait_debug_indicator">` at the
1642
+ * bottom-left, accounting for safe-area insets. Background/text flip
1643
+ * between the attached (red) and disconnected (grey) visuals.
1644
+ * 3. A `pointerdown` listener dismisses (hides) the badge on tap — dismiss
1645
+ * is NON-terminal: a later state transition un-dismisses it, so a
1646
+ * genuine disconnect after a dismissed tap is still visible.
1647
+ * 4. Observes relay-socket lifecycle WITHOUT opening any new connection:
1648
+ * - Preferred path: if the in-app module (`src/in-app/attach.ts`) has
1649
+ * already installed its relay-WS observer (`window.__ait_relay_ws_observed`),
1650
+ * subscribe to the `ait:relay-ws-state` CustomEvent it broadcasts.
1651
+ * - Fallback path: wrap `window.WebSocket` in a `Proxy` and match dials
1652
+ * by PATHNAME SHAPE only (`/target/`) — never by host/wss value — so a
1653
+ * bare CDP-injected badge (no in-app bundle) still reacts to the
1654
+ * chii target socket's own open/close lifecycle.
1641
1655
  *
1642
1656
  * The expression intentionally contains NO relay URLs, wss addresses, TOTP
1643
- * codes, or any other secrets. It is pure DOM UI text only.
1657
+ * codes, or any other secrets. It is pure DOM UI text + enum state only.
1644
1658
  *
1645
1659
  * SECRET-HANDLING: this expression contains no secrets, relay URLs, wss
1646
- * addresses, or TOTP codes whatsoever — DOM label text only.
1660
+ * addresses, or TOTP codes whatsoever — DOM label text + a structural
1661
+ * pathname match (`/target/`) only.
1647
1662
  *
1648
- * @param opts.label - Badge text (default: `'Debugger Connected'`).
1663
+ * @param opts.label - Attached-state badge text (default: `'Debugger Connected'`).
1664
+ * @param opts.disconnectedLabel - Disconnected-state badge text (default: `'Debugger Disconnected'`).
1665
+ * @param opts.state - Initial/forced state for THIS injection call (default: `'attached'`).
1649
1666
  * @returns A JS expression string suitable for `Runtime.evaluate`.
1650
1667
  */
1651
1668
  function buildIndicatorExpression(opts) {
1652
1669
  const label = opts?.label ?? "Debugger Connected";
1653
- return `(() => {if (document.getElementById('__ait_debug_indicator')) return;const el = document.createElement('div');el.id = '__ait_debug_indicator';el.style.cssText = ['position:fixed','left:max(12px,calc(env(safe-area-inset-left,0px) + 8px))','bottom:max(12px,calc(env(safe-area-inset-bottom,0px) + 8px))','z-index:2147483647','background:#e5484d','color:#fff','font:bold 11px/1 system-ui,sans-serif','padding:5px 9px','border-radius:6px','pointer-events:auto','user-select:none',].join(';');el.textContent = ${JSON.stringify(label)};el.addEventListener('pointerdown', () => el.remove(), { once: true });document.body.appendChild(el);})()`;
1670
+ const disconnectedLabel = opts?.disconnectedLabel ?? "Debugger Disconnected";
1671
+ return `(() => {var W = window;function render(c) {if (c.dismissed) { c.el.style.display = 'none'; return; }c.el.style.display = 'block';var up = c.state !== 'disconnected';c.el.style.background = up ? '#e5484d' : '#8a8f98';c.el.textContent = up ? ${JSON.stringify(label)} : ${JSON.stringify(disconnectedLabel)};}function setState(c, next) { c.state = next; c.dismissed = false; render(c); }var c = W.__ait_indicator;if (!c) {var el = document.createElement('div');el.id = '__ait_debug_indicator';el.style.cssText = ['position:fixed','left:max(12px,calc(env(safe-area-inset-left,0px) + 8px))','bottom:max(12px,calc(env(safe-area-inset-bottom,0px) + 8px))','z-index:2147483647','color:#fff','font:bold 11px/1 system-ui,sans-serif','padding:5px 9px','border-radius:6px','pointer-events:auto','user-select:none',].join(';');document.body.appendChild(el);c = { el: el, state: 'attached', dismissed: false };el.addEventListener('pointerdown', function () { c.dismissed = true; render(c); }, { passive: true });W.__ait_indicator = c;if (W.__ait_relay_ws_observed) {W.addEventListener('ait:relay-ws-state', function (e) {setState(c, e.detail && e.detail.state === 'open' ? 'attached' : 'disconnected');});} else {try {var Native = W.WebSocket;W.WebSocket = new Proxy(Native, {construct: function (t, a) {var ws = Reflect.construct(t, a);try {var u = new URL(String(a[0]), location.href);if (/\\/target\\//.test(u.pathname)) {ws.addEventListener('open', function () { setState(c, 'attached'); });ws.addEventListener('close', function () { setState(c, 'disconnected'); });ws.addEventListener('error', function () { setState(c, 'disconnected'); });}} catch (_) {}return ws;},});} catch (_) {}}}setState(c, ${JSON.stringify(opts?.state ?? "attached")});})()`;
1654
1672
  }
1655
1673
  //#endregion
1656
1674
  export { RELAY_SANDBOX_STALE_PAGE_MS, START_ATTACH_REMINT_THRESHOLD_MS, START_ATTACH_SEGMENT_MS, startTunnelHealthProbe as a, buildIndicatorExpression, extractDeploymentId, startQuickTunnel as i, isSandboxPageFresh, mintAttachUrl, makeTunnelStatus as n, prepareAttach, printAttachBanner as r, renderAndMaybeWait, generateAttachToken as t };
1657
1675
 
1658
- //# sourceMappingURL=attach-orchestrator-DvrgUIx7.js.map
1676
+ //# sourceMappingURL=attach-orchestrator-BiaYiNOr.js.map