@ait-co/devtools 0.1.81 → 0.1.85

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 (76) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +1 -1
  3. package/dist/{chii-relay-DSVG4Ui1.js → chii-relay-BASitNMw.js} +1 -1
  4. package/dist/{chii-relay-DSVG4Ui1.js.map → chii-relay-BASitNMw.js.map} +1 -1
  5. package/dist/{chii-relay-BcnVJBqm.cjs → chii-relay-BzUf0LH3.cjs} +1 -1
  6. package/dist/{chii-relay-BcnVJBqm.cjs.map → chii-relay-BzUf0LH3.cjs.map} +1 -1
  7. package/dist/{deeplink-B-94XmWA.js → deeplink-BpO9qc-D.js} +5 -3
  8. package/dist/{deeplink-BLU2_hg6.cjs.map → deeplink-BpO9qc-D.js.map} +1 -1
  9. package/dist/{deeplink-CYqDwVYs.js → deeplink-D1HXJ2YG.js} +5 -3
  10. package/dist/{deeplink-CU6opogq.cjs.map → deeplink-D1HXJ2YG.js.map} +1 -1
  11. package/dist/{deeplink-BLU2_hg6.cjs → deeplink-DCScMYcp.cjs} +5 -3
  12. package/dist/deeplink-DCScMYcp.cjs.map +1 -0
  13. package/dist/{deeplink-CU6opogq.cjs → deeplink-DDOe0FQl.cjs} +5 -3
  14. package/dist/deeplink-DDOe0FQl.cjs.map +1 -0
  15. package/dist/{devtools-opener-Bp671YXu.cjs → devtools-opener-BDY0w3_0.cjs} +11 -5
  16. package/dist/devtools-opener-BDY0w3_0.cjs.map +1 -0
  17. package/dist/{devtools-opener-D84kZFtR.js → devtools-opener-BTl5A6Cd.js} +11 -5
  18. package/dist/devtools-opener-BTl5A6Cd.js.map +1 -0
  19. package/dist/{devtools-opener-BbUXBzgA.js → devtools-opener-XpwL3fZ9.js} +22 -6
  20. package/dist/devtools-opener-XpwL3fZ9.js.map +1 -0
  21. package/dist/{devtools-opener-h6A-UjzC.cjs → devtools-opener-mDgeg_MX.cjs} +11 -5
  22. package/dist/devtools-opener-mDgeg_MX.cjs.map +1 -0
  23. package/dist/machine-state-Chg_6SPq.js +188 -0
  24. package/dist/machine-state-Chg_6SPq.js.map +1 -0
  25. package/dist/machine-state-DOUweFsJ.cjs +216 -0
  26. package/dist/machine-state-DOUweFsJ.cjs.map +1 -0
  27. package/dist/mcp/cli.js +112 -54
  28. package/dist/mcp/cli.js.map +1 -1
  29. package/dist/mcp/server.d.ts.map +1 -1
  30. package/dist/mcp/server.js +6 -10
  31. package/dist/mcp/server.js.map +1 -1
  32. package/dist/panel/index.js +109 -8
  33. package/dist/panel/index.js.map +1 -1
  34. package/dist/{qr-http-server-DJ5K3Odk.js → qr-http-server-Buorblrx.js} +73 -23
  35. package/dist/qr-http-server-Buorblrx.js.map +1 -0
  36. package/dist/{qr-http-server-Dkx2-pKF.cjs → qr-http-server-BvAtX9Lc.cjs} +73 -23
  37. package/dist/qr-http-server-BvAtX9Lc.cjs.map +1 -0
  38. package/dist/{qr-http-server-DkOFfZsR.js → qr-http-server-BxjrJr9t.js} +73 -23
  39. package/dist/qr-http-server-BxjrJr9t.js.map +1 -0
  40. package/dist/{qr-http-server-MIUHaiYw.cjs → qr-http-server-CAUyOrCm.cjs} +73 -23
  41. package/dist/qr-http-server-CAUyOrCm.cjs.map +1 -0
  42. package/dist/{relay-secret-store-CsCOfpWt.cjs → relay-secret-store-B5WAozDv.cjs} +2 -2
  43. package/dist/{relay-secret-store-CsCOfpWt.cjs.map → relay-secret-store-B5WAozDv.cjs.map} +1 -1
  44. package/dist/{relay-secret-store-6pPzLkUO.js → relay-secret-store-BvNWdSjV.js} +2 -2
  45. package/dist/{relay-secret-store-6pPzLkUO.js.map → relay-secret-store-BvNWdSjV.js.map} +1 -1
  46. package/dist/{relay-url-store-DH8-VUFc.js → relay-url-store-1CXVqNDL.js} +2 -2
  47. package/dist/{relay-url-store-DH8-VUFc.js.map → relay-url-store-1CXVqNDL.js.map} +1 -1
  48. package/dist/{relay-url-store-BiEK9BN1.cjs → relay-url-store-D2lX9POP.cjs} +2 -2
  49. package/dist/{relay-url-store-BiEK9BN1.cjs.map → relay-url-store-D2lX9POP.cjs.map} +1 -1
  50. package/dist/{totp-DYdP9N3o.js → totp-CauHjkdE.js} +1 -1
  51. package/dist/{totp-DYdP9N3o.js.map → totp-CauHjkdE.js.map} +1 -1
  52. package/dist/{totp-CNw0w89F.cjs → totp-D9fjaVak.cjs} +1 -1
  53. package/dist/{totp-CNw0w89F.cjs.map → totp-D9fjaVak.cjs.map} +1 -1
  54. package/dist/{tunnel-C-AFdAVL.cjs → tunnel-CfT31xho.cjs} +6 -6
  55. package/dist/{tunnel-C-AFdAVL.cjs.map → tunnel-CfT31xho.cjs.map} +1 -1
  56. package/dist/{tunnel-BTlq1mmH.js → tunnel-DPwJBn1u.js} +6 -6
  57. package/dist/{tunnel-BTlq1mmH.js.map → tunnel-DPwJBn1u.js.map} +1 -1
  58. package/dist/unplugin/index.cjs +90 -5
  59. package/dist/unplugin/index.cjs.map +1 -1
  60. package/dist/unplugin/index.d.cts.map +1 -1
  61. package/dist/unplugin/index.d.ts.map +1 -1
  62. package/dist/unplugin/index.js +90 -5
  63. package/dist/unplugin/index.js.map +1 -1
  64. package/dist/unplugin/tunnel.cjs +4 -4
  65. package/dist/unplugin/tunnel.js +4 -4
  66. package/package.json +1 -1
  67. package/dist/deeplink-B-94XmWA.js.map +0 -1
  68. package/dist/deeplink-CYqDwVYs.js.map +0 -1
  69. package/dist/devtools-opener-BbUXBzgA.js.map +0 -1
  70. package/dist/devtools-opener-Bp671YXu.cjs.map +0 -1
  71. package/dist/devtools-opener-D84kZFtR.js.map +0 -1
  72. package/dist/devtools-opener-h6A-UjzC.cjs.map +0 -1
  73. package/dist/qr-http-server-DJ5K3Odk.js.map +0 -1
  74. package/dist/qr-http-server-DkOFfZsR.js.map +0 -1
  75. package/dist/qr-http-server-Dkx2-pKF.cjs.map +0 -1
  76. package/dist/qr-http-server-MIUHaiYw.cjs.map +0 -1
@@ -25379,8 +25379,8 @@ const en = {
25379
25379
  "dashboard.url.copy": "Copy",
25380
25380
  "dashboard.url.copied": "Copied",
25381
25381
  "dashboard.inspector.section": "Inspector",
25382
- "dashboard.inspector.open": "Open inspector",
25383
- "dashboard.inspector.waiting": "Inspector URL pending appears after a page attaches",
25382
+ "dashboard.inspector.open": "Open DevTools",
25383
+ "dashboard.inspector.waiting": "Attach a page to enable the \"Open DevTools\" button",
25384
25384
  "inspector.error.noTarget": "No page attached. Attach a device and try again.",
25385
25385
  "inspector.error.relayDown": "Relay is not active. Start a relay session first.",
25386
25386
  "attach.title": "AIT Debug Session — QR Scan",
@@ -25617,8 +25617,8 @@ const ko = {
25617
25617
  "dashboard.url.copy": "복사",
25618
25618
  "dashboard.url.copied": "복사됨",
25619
25619
  "dashboard.inspector.section": "인스펙터",
25620
- "dashboard.inspector.open": "인스펙터 열기",
25621
- "dashboard.inspector.waiting": "인스펙터 URL 대기 (페이지 attach 표시됩니다)",
25620
+ "dashboard.inspector.open": "디버그 열기",
25621
+ "dashboard.inspector.waiting": "페이지를 attach하면 \"디버그 열기\" 버튼이 표시됩니다",
25622
25622
  "inspector.error.noTarget": "연결된 페이지가 없습니다. 기기를 attach한 후 다시 시도하세요.",
25623
25623
  "inspector.error.relayDown": "relay가 활성화되지 않았습니다. start_debug로 relay를 기동하세요.",
25624
25624
  "attach.title": "AIT 디버그 세션 — QR 스캔",
@@ -26484,6 +26484,71 @@ async function sendTier0Ping(version) {
26484
26484
  * Usage: import { telemetry } from './telemetry/index.js' (from panel code).
26485
26485
  */
26486
26486
  /**
26487
+ * The dev server consent endpoint path. Must match the path registered in
26488
+ * the unplugin (`TELEMETRY_CONSENT_PATH`).
26489
+ */
26490
+ const MACHINE_CONSENT_ENDPOINT$1 = "/api/ait-devtools/telemetry-consent";
26491
+ /**
26492
+ * Whether we have already attempted to sync with the machine-level state.
26493
+ * We sync once at init time to avoid repeated network calls.
26494
+ */
26495
+ let machineSyncDone = false;
26496
+ /**
26497
+ * Reads the machine-level consent state from the dev server endpoint.
26498
+ * Returns `null` when not in a dev-server context (fetch fails, 503, non-JSON).
26499
+ *
26500
+ * BROWSER-ONLY. Runs inside the panel (browser context).
26501
+ */
26502
+ async function fetchMachineConsent() {
26503
+ try {
26504
+ const res = await fetch(MACHINE_CONSENT_ENDPOINT$1, {
26505
+ method: "GET",
26506
+ headers: { Accept: "application/json" }
26507
+ });
26508
+ if (!res.ok) return null;
26509
+ const data = await res.json();
26510
+ if (data.consent !== "granted" && data.consent !== "denied" && data.consent !== "undecided") return null;
26511
+ return {
26512
+ consent: data.consent,
26513
+ anon_id: typeof data.anon_id === "string" ? data.anon_id : null,
26514
+ policy_version: typeof data.policy_version === "string" ? data.policy_version : ""
26515
+ };
26516
+ } catch {
26517
+ return null;
26518
+ }
26519
+ }
26520
+ /**
26521
+ * Posts a consent decision to the dev server so it is persisted to the
26522
+ * machine-level file. Fire-and-forget — failures are silently ignored.
26523
+ */
26524
+ function postMachineConsent$1(consent, policyVersion) {
26525
+ fetch(MACHINE_CONSENT_ENDPOINT$1, {
26526
+ method: "POST",
26527
+ headers: { "Content-Type": "application/json" },
26528
+ body: JSON.stringify({
26529
+ consent,
26530
+ policy_version: policyVersion
26531
+ })
26532
+ }).catch(() => {});
26533
+ }
26534
+ /**
26535
+ * Applies the machine-level consent to the browser localStorage so all
26536
+ * subsequent reads from `state.ts` (which are locked to localStorage) reflect
26537
+ * the machine decision.
26538
+ *
26539
+ * Only writes when the machine state is a definitive decision (granted/denied)
26540
+ * and the policy version is current — avoids clobbering a more recent local
26541
+ * decision with a stale machine file.
26542
+ */
26543
+ function applyMachineConsentToLocalStorage(machineState) {
26544
+ if (machineState.consent === "undecided") return;
26545
+ if (machineState.policy_version !== "2026-05-18") return;
26546
+ setConsentViaToggle(machineState.consent === "granted");
26547
+ if (machineState.anon_id) try {
26548
+ if (!localStorage.getItem("__ait_telemetry:anon_id")) localStorage.setItem("__ait_telemetry:anon_id", machineState.anon_id);
26549
+ } catch {}
26550
+ }
26551
+ /**
26487
26552
  * Telemetry ingest endpoint.
26488
26553
  * Overridable at build time via define (e.g., for e2e / local dev).
26489
26554
  * Do NOT expose this as a public env-var surface.
@@ -26494,7 +26559,7 @@ function readGlobalString(key) {
26494
26559
  }
26495
26560
  const TELEMETRY_ENDPOINT = readGlobalString("__TELEMETRY_ENDPOINT__") ?? "https://t.aitc.dev";
26496
26561
  function getVersion() {
26497
- return "0.1.81";
26562
+ return "0.1.85";
26498
26563
  }
26499
26564
  let panelVisibleSince = null;
26500
26565
  let accumulatedMs = 0;
@@ -26518,12 +26583,33 @@ function wirePagehide() {
26518
26583
  }
26519
26584
  /**
26520
26585
  * Call once after panel mounts.
26521
- * Handles: Tier 0 ping, consent check, optional toast, panel_mount event, pagehide wiring.
26586
+ * Handles: Tier 0 ping, consent check (machine overlay first, localStorage
26587
+ * fallback), optional toast, panel_mount event, pagehide wiring.
26588
+ *
26589
+ * Machine-level overlay (#542): when the dev server is running, we fetch the
26590
+ * machine-level consent once and apply it to localStorage. This prevents the
26591
+ * toast from re-appearing when the origin rotates (quick-tunnel host or port
26592
+ * changes). On non-dev-server surfaces (GitHub Pages, static fixture) the
26593
+ * fetch fails silently and we fall through to the existing localStorage path.
26522
26594
  */
26523
26595
  function init() {
26524
26596
  if (typeof window === "undefined" || typeof document === "undefined") return;
26525
26597
  wirePagehide();
26526
26598
  sendTier0Ping(getVersion());
26599
+ if (!machineSyncDone) {
26600
+ machineSyncDone = true;
26601
+ fetchMachineConsent().then((machineState) => {
26602
+ if (machineState) applyMachineConsentToLocalStorage(machineState);
26603
+ runConsentFlow();
26604
+ });
26605
+ } else runConsentFlow();
26606
+ }
26607
+ /**
26608
+ * Core consent flow — reads localStorage (which may have already been
26609
+ * patched by `applyMachineConsentToLocalStorage`) and shows the toast or
26610
+ * fires `panel_mount` accordingly.
26611
+ */
26612
+ function runConsentFlow() {
26527
26613
  if (resolveEffectiveConsent() === "granted") {
26528
26614
  getOrCreateAnonId();
26529
26615
  send("panel_mount", getVersion());
@@ -26535,10 +26621,12 @@ function init() {
26535
26621
  onAccept: () => {
26536
26622
  acceptConsent();
26537
26623
  getOrCreateAnonId();
26624
+ postMachineConsent$1("granted", CURRENT_POLICY_VERSION);
26538
26625
  send("panel_mount", getVersion());
26539
26626
  },
26540
26627
  onDeny: () => {
26541
26628
  denyConsent();
26629
+ postMachineConsent$1("denied", CURRENT_POLICY_VERSION);
26542
26630
  }
26543
26631
  });
26544
26632
  };
@@ -28165,6 +28253,17 @@ function renderAnalyticsTab() {
28165
28253
  }
28166
28254
  //#endregion
28167
28255
  //#region src/panel/tabs/environment.ts
28256
+ const MACHINE_CONSENT_ENDPOINT = "/api/ait-devtools/telemetry-consent";
28257
+ function postMachineConsent(consent) {
28258
+ fetch(MACHINE_CONSENT_ENDPOINT, {
28259
+ method: "POST",
28260
+ headers: { "Content-Type": "application/json" },
28261
+ body: JSON.stringify({
28262
+ consent,
28263
+ policy_version: CURRENT_POLICY_VERSION
28264
+ })
28265
+ }).catch(() => {});
28266
+ }
28168
28267
  function renderEnvironmentTab() {
28169
28268
  const s = aitState.state;
28170
28269
  const disabled = !s.panelEditable;
@@ -28232,7 +28331,9 @@ function buildTelemetrySection() {
28232
28331
  style: "font-size:11px"
28233
28332
  }, isGranted ? t("env.telemetry.turnOff") : t("env.telemetry.turnOn"));
28234
28333
  toggleBtn.addEventListener("click", () => {
28235
- setConsentViaToggle(!isGranted);
28334
+ const newConsent = !isGranted;
28335
+ setConsentViaToggle(newConsent);
28336
+ postMachineConsent(newConsent ? "granted" : "denied");
28236
28337
  window.dispatchEvent(new CustomEvent("__ait:panel-switch-tab", { detail: { tab: "env" } }));
28237
28338
  });
28238
28339
  const statusRow = h("div", { className: "ait-row" }, h("label", {}, t("env.telemetry.row")), h("span", { style: "display:flex;align-items:center;gap:8px" }, statusLabel, toggleBtn));
@@ -30745,7 +30846,7 @@ function Panel() {
30745
30846
  color: "#666",
30746
30847
  fontWeight: 400
30747
30848
  },
30748
- children: ["v", "0.1.81"]
30849
+ children: ["v", "0.1.85"]
30749
30850
  }),
30750
30851
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
30751
30852
  type: "button",