@ait-co/devtools 0.1.21 → 0.1.23
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/README.en.md +115 -5
- package/README.md +125 -5
- package/dist/in-app/index.d.ts +136 -0
- package/dist/in-app/index.d.ts.map +1 -0
- package/dist/in-app/index.js +163 -0
- package/dist/in-app/index.js.map +1 -0
- package/dist/mcp/cli.d.ts +20 -0
- package/dist/mcp/cli.d.ts.map +1 -0
- package/dist/mcp/cli.js +930 -0
- package/dist/mcp/cli.js.map +1 -0
- package/dist/mcp/server.d.ts +79 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +285 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/panel/index.d.ts.map +1 -1
- package/dist/panel/index.js +20 -4
- package/dist/panel/index.js.map +1 -1
- package/dist/unplugin/index.cjs +64 -20
- package/dist/unplugin/index.cjs.map +1 -1
- package/dist/unplugin/index.d.cts +11 -0
- package/dist/unplugin/index.d.cts.map +1 -1
- package/dist/unplugin/index.d.ts +11 -0
- package/dist/unplugin/index.d.ts.map +1 -1
- package/dist/unplugin/index.js +64 -20
- package/dist/unplugin/index.js.map +1 -1
- package/package.json +23 -2
package/dist/panel/index.js
CHANGED
|
@@ -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.
|
|
1053
|
+
return "0.1.23";
|
|
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
|
|
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
|
|
3318
|
+
label: "iPhone Air",
|
|
3319
3319
|
width: 420,
|
|
3320
3320
|
height: 912,
|
|
3321
3321
|
dpr: 3,
|
|
@@ -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.
|
|
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.23`), 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;
|