@ait-co/devtools 0.1.54-beta.0 → 0.1.55
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 +2 -6
- package/README.md +2 -6
- package/dist/mcp/cli.js +11 -18
- package/dist/mcp/cli.js.map +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/server.js.map +1 -1
- package/dist/mock/index.d.ts.map +1 -1
- package/dist/mock/index.js +18 -2
- package/dist/mock/index.js.map +1 -1
- package/dist/panel/index.js +66 -4
- package/dist/panel/index.js.map +1 -1
- package/package.json +17 -19
package/dist/panel/index.js
CHANGED
|
@@ -1108,7 +1108,7 @@ function readGlobalString(key) {
|
|
|
1108
1108
|
}
|
|
1109
1109
|
const TELEMETRY_ENDPOINT = readGlobalString("__TELEMETRY_ENDPOINT__") ?? "https://t.aitc.dev";
|
|
1110
1110
|
function getVersion() {
|
|
1111
|
-
return "0.1.
|
|
1111
|
+
return "0.1.55";
|
|
1112
1112
|
}
|
|
1113
1113
|
let panelVisibleSince = null;
|
|
1114
1114
|
let accumulatedMs = 0;
|
|
@@ -1877,6 +1877,61 @@ function waitForPromptResponse(type) {
|
|
|
1877
1877
|
* 권한 시스템 mock
|
|
1878
1878
|
* 각 디바이스 API (.getPermission, .openPermissionDialog)에 부착된다.
|
|
1879
1879
|
*/
|
|
1880
|
+
/**
|
|
1881
|
+
* web-framework 3.0+ 권한 에러 기반 클래스.
|
|
1882
|
+
* `instanceof PermissionError`로 체크하는 코드와 호환된다.
|
|
1883
|
+
*/
|
|
1884
|
+
var PermissionError = class extends Error {
|
|
1885
|
+
constructor({ methodName, message }) {
|
|
1886
|
+
super(message ?? `${methodName}: permission denied`);
|
|
1887
|
+
this.name = `${methodName}PermissionError`;
|
|
1888
|
+
}
|
|
1889
|
+
};
|
|
1890
|
+
/** openCamera 권한 에러 */
|
|
1891
|
+
var OpenCameraPermissionError = class extends PermissionError {
|
|
1892
|
+
constructor() {
|
|
1893
|
+
super({ methodName: "openCamera" });
|
|
1894
|
+
}
|
|
1895
|
+
};
|
|
1896
|
+
/** fetchAlbumPhotos 권한 에러 */
|
|
1897
|
+
var FetchAlbumPhotosPermissionError = class extends PermissionError {
|
|
1898
|
+
constructor() {
|
|
1899
|
+
super({ methodName: "fetchAlbumPhotos" });
|
|
1900
|
+
}
|
|
1901
|
+
};
|
|
1902
|
+
/** fetchContacts 권한 에러 */
|
|
1903
|
+
var FetchContactsPermissionError = class extends PermissionError {
|
|
1904
|
+
constructor() {
|
|
1905
|
+
super({ methodName: "fetchContacts" });
|
|
1906
|
+
}
|
|
1907
|
+
};
|
|
1908
|
+
/** getCurrentLocation 권한 에러 */
|
|
1909
|
+
var GetCurrentLocationPermissionError = class extends PermissionError {
|
|
1910
|
+
constructor() {
|
|
1911
|
+
super({ methodName: "getCurrentLocation" });
|
|
1912
|
+
}
|
|
1913
|
+
};
|
|
1914
|
+
/** getClipboardText 권한 에러 */
|
|
1915
|
+
var GetClipboardTextPermissionError = class extends PermissionError {
|
|
1916
|
+
constructor() {
|
|
1917
|
+
super({ methodName: "getClipboardText" });
|
|
1918
|
+
}
|
|
1919
|
+
};
|
|
1920
|
+
/** setClipboardText 권한 에러 */
|
|
1921
|
+
var SetClipboardTextPermissionError = class extends PermissionError {
|
|
1922
|
+
constructor() {
|
|
1923
|
+
super({ methodName: "setClipboardText" });
|
|
1924
|
+
}
|
|
1925
|
+
};
|
|
1926
|
+
const permissionErrorMap = {
|
|
1927
|
+
openCamera: OpenCameraPermissionError,
|
|
1928
|
+
fetchAlbumPhotos: FetchAlbumPhotosPermissionError,
|
|
1929
|
+
fetchAlbumItems: FetchAlbumPhotosPermissionError,
|
|
1930
|
+
fetchContacts: FetchContactsPermissionError,
|
|
1931
|
+
getCurrentLocation: GetCurrentLocationPermissionError,
|
|
1932
|
+
getClipboardText: GetClipboardTextPermissionError,
|
|
1933
|
+
setClipboardText: SetClipboardTextPermissionError
|
|
1934
|
+
};
|
|
1880
1935
|
async function getPermission(name) {
|
|
1881
1936
|
return aitState.state.permissions[name];
|
|
1882
1937
|
}
|
|
@@ -1892,9 +1947,16 @@ function withPermission(fn, permissionName) {
|
|
|
1892
1947
|
enhanced.openPermissionDialog = () => openPermissionDialog(permissionName);
|
|
1893
1948
|
return enhanced;
|
|
1894
1949
|
}
|
|
1895
|
-
/**
|
|
1950
|
+
/**
|
|
1951
|
+
* 권한 체크 후 denied면 per-API *PermissionError 서브클래스를 throw한다.
|
|
1952
|
+
* 실 3.0 SDK 동작과 일치 — `instanceof PermissionError` 분기가 mock에서도 동작한다 (#372).
|
|
1953
|
+
*/
|
|
1896
1954
|
function checkPermission(name, fnName) {
|
|
1897
|
-
if (aitState.state.permissions[name] === "denied")
|
|
1955
|
+
if (aitState.state.permissions[name] === "denied") {
|
|
1956
|
+
const ErrorClass = permissionErrorMap[fnName];
|
|
1957
|
+
if (ErrorClass) throw new ErrorClass();
|
|
1958
|
+
throw new PermissionError({ methodName: fnName });
|
|
1959
|
+
}
|
|
1898
1960
|
}
|
|
1899
1961
|
//#endregion
|
|
1900
1962
|
//#region src/mock/device/camera.ts
|
|
@@ -4861,7 +4923,7 @@ function mount() {
|
|
|
4861
4923
|
mockBadge.textContent = aitState.state.panelEditable ? t("panel.editMode.on") : t("panel.editMode.off");
|
|
4862
4924
|
refreshPanel();
|
|
4863
4925
|
});
|
|
4864
|
-
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.
|
|
4926
|
+
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.55`), closeBtn);
|
|
4865
4927
|
const header = h("div", { className: "ait-panel-header" }, h("span", {}, t("panel.title")), headerRight);
|
|
4866
4928
|
tabsEl = h("div", { className: "ait-panel-tabs" });
|
|
4867
4929
|
for (const tab of getTabs()) {
|