@ait-co/devtools 0.1.22 → 0.1.24

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.
@@ -1050,7 +1050,7 @@ function readGlobalString(key) {
1050
1050
  }
1051
1051
  const TELEMETRY_ENDPOINT = readGlobalString("__TELEMETRY_ENDPOINT__") ?? "https://t.aitc.dev";
1052
1052
  function getVersion() {
1053
- return "0.1.22";
1053
+ return "0.1.24";
1054
1054
  }
1055
1055
  let panelVisibleSince = null;
1056
1056
  let accumulatedMs = 0;
@@ -3274,7 +3274,7 @@ const NONE_PRESET = {
3274
3274
  };
3275
3275
  /**
3276
3276
  * Device presets (2026). CSS viewport 크기는 실제 기기의 `window.innerWidth/innerHeight`.
3277
- * iPhone 17 시리즈는 2025-09 출시. iPhone Air는 2026-04 기준 미출시 추정(`(est)` 라벨).
3277
+ * iPhone 17 시리즈는 2025-09 출시. iPhone Air는 2026-04 출시.
3278
3278
  * Galaxy S26 시리즈는 2026-03-11 출시 — viewport 값은 phone-simulator.com에서 보고된
3279
3279
  * 측정치를 사용. safe area는 토스 호스트 환경 실측 필요 — S25 값으로 잠정.
3280
3280
  *
@@ -3315,7 +3315,7 @@ const VIEWPORT_PRESETS = [
3315
3315
  },
3316
3316
  {
3317
3317
  id: "iphone-air",
3318
- label: "iPhone Air (est)",
3318
+ label: "iPhone Air",
3319
3319
  width: 420,
3320
3320
  height: 912,
3321
3321
  dpr: 3,
@@ -3529,7 +3529,7 @@ function removeNavBarElement() {
3529
3529
  * 우측 `⋯` + 구분선 + `×`.
3530
3530
  * - `game`: 투명 배경, 게임 캔버스를 가리지 않도록 우측 `⋯` + 구분선 + `×`만.
3531
3531
  *
3532
- * `env(safe-area-inset-top)`에는 이 높이가 포함되지 않으므로 (공식 SDK 확인),
3532
+ * `env(safe-area-inset-top)`에는 이 높이가 포함되지 않으므로 (SDK 동작 확인),
3533
3533
  * 오버레이는 preset.safeAreaTop만큼 아래로 내려서 그린다.
3534
3534
  *
3535
3535
  * 뒤로가기 버튼은 `__ait:backEvent`를 트리거하고, X 버튼은 `closeView()`를 호출한다.
@@ -3980,6 +3980,21 @@ function createTabRenderers(refreshPanel) {
3980
3980
  * import 하면 자동으로 페이지에 DevTools 패널을 마운트한다.
3981
3981
  * 외부 의존성 없이 vanilla DOM으로 구현.
3982
3982
  */
3983
+ /** MCP endpoint registered by the unplugin when `mcp: true` is set */
3984
+ const MCP_STATE_PATH = "/api/ait-devtools/state";
3985
+ /**
3986
+ * Push a state snapshot to the Vite dev-server MCP endpoint.
3987
+ * No-ops silently when the endpoint is not available (e.g., mcp option not set,
3988
+ * or running in production). Fire-and-forget — never throws.
3989
+ */
3990
+ function pushStateToMcpEndpoint(state) {
3991
+ if (typeof fetch === "undefined") return;
3992
+ fetch(MCP_STATE_PATH, {
3993
+ method: "POST",
3994
+ headers: { "Content-Type": "application/json" },
3995
+ body: JSON.stringify(state)
3996
+ }).catch(() => {});
3997
+ }
3983
3998
  function makeDraggable(el, onClickOnly) {
3984
3999
  let isDragging = false;
3985
4000
  let startX = 0, startY = 0;
@@ -4167,7 +4182,7 @@ function mount() {
4167
4182
  mockBadge.textContent = aitState.state.panelEditable ? t("panel.editMode.on") : t("panel.editMode.off");
4168
4183
  refreshPanel();
4169
4184
  });
4170
- const headerRight = h("span", { style: "display:flex;align-items:center;gap:6px" }, mockBadge, h("span", { style: "font-size:11px;color:#666;font-weight:400" }, `v0.1.22`), closeBtn);
4185
+ const headerRight = h("span", { style: "display:flex;align-items:center;gap:6px" }, mockBadge, h("span", { style: "font-size:11px;color:#666;font-weight:400" }, `v0.1.24`), closeBtn);
4171
4186
  const header = h("div", { className: "ait-panel-header" }, h("span", {}, t("panel.title")), headerRight);
4172
4187
  tabsEl = h("div", { className: "ait-panel-tabs" });
4173
4188
  for (const tab of getTabs()) {
@@ -4213,6 +4228,7 @@ function mount() {
4213
4228
  } catch (err) {
4214
4229
  console.error("[@ait-co/devtools] Error in subscribe callback:", err);
4215
4230
  }
4231
+ pushStateToMcpEndpoint(aitState.state);
4216
4232
  });
4217
4233
  panelSwitchTabHandler = (e) => {
4218
4234
  currentTab = e.detail.tab;