@ait-co/devtools 0.2.1 → 0.2.2
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/dist/mock/index.js +13 -3
- package/dist/mock/index.js.map +1 -1
- package/dist/panel/index.js +14 -4
- package/dist/panel/index.js.map +1 -1
- package/package.json +1 -1
package/dist/panel/index.js
CHANGED
|
@@ -25692,9 +25692,19 @@ function useT() {
|
|
|
25692
25692
|
* 메서드별 마지막 *허용* 호출 시각만 담는 leaf 모듈이다. `state.ts`가 `reset()`에서
|
|
25693
25693
|
* 이걸 비워야 하는데, 로직 본체(`throttle.ts`)는 거꾸로 `state.ts`를 읽는다 —
|
|
25694
25694
|
* 그래서 **의존이 없는 이 파일로 레지스트리를 분리해** 순환 import를 피한다.
|
|
25695
|
+
*
|
|
25696
|
+
* `state.ts`의 `AitStateManager`와 같은 이유로 `globalThis` 싱글턴이어야 한다 (#836):
|
|
25697
|
+
* `tsdown.config.ts`가 mock/panel/unplugin entry를 각각 self-contained로 빌드하므로,
|
|
25698
|
+
* 소비자가 두 entry를 동시에 import하면 이 모듈이 entry당 하나씩 복제된다. Map을
|
|
25699
|
+
* 모듈 지역 변수로 두면 `aitState.reset()`이 비우는 Map(싱글턴을 먼저 생성한 번들의 것)과
|
|
25700
|
+
* `throttleErrorFor`가 읽는 Map(mock 번들의 것)이 갈려, 리셋 직후 첫 호출이 낡은
|
|
25701
|
+
* 타임스탬프 때문에 거부된다 — 이 파일이 막으려던 바로 그 증상이다.
|
|
25695
25702
|
*/
|
|
25696
|
-
|
|
25697
|
-
const
|
|
25703
|
+
const SINGLETON_KEY$1 = "__aitDevtoolsThrottleRegistry__";
|
|
25704
|
+
const globalRef$1 = globalThis;
|
|
25705
|
+
if (!globalRef$1[SINGLETON_KEY$1]) globalRef$1[SINGLETON_KEY$1] = /* @__PURE__ */ new Map();
|
|
25706
|
+
/** 메서드별 마지막 *허용* 호출 시각(ms). 페이지 안의 모든 entry가 공유한다. */
|
|
25707
|
+
const lastAllowedAt = globalRef$1[SINGLETON_KEY$1];
|
|
25698
25708
|
/**
|
|
25699
25709
|
* throttle 레지스트리를 비운다. `aitState.reset()`이 호출한다 — 상태를 되돌렸는데
|
|
25700
25710
|
* 직전 세션의 호출 시각이 남아 있으면 첫 호출이 이유 없이 거부된다.
|
|
@@ -26759,7 +26769,7 @@ Object.assign(_fetchAlbumItemsWithPermission, { isSupported: () => true });
|
|
|
26759
26769
|
*/
|
|
26760
26770
|
function throttleErrorFor(method) {
|
|
26761
26771
|
const dial = aitState.state.failureModes.throttled;
|
|
26762
|
-
if (!dial?.methods
|
|
26772
|
+
if (!dial?.methods?.includes(method)) return void 0;
|
|
26763
26773
|
const now = Date.now();
|
|
26764
26774
|
const prev = lastAllowedAt.get(method);
|
|
26765
26775
|
if (prev !== void 0 && now - prev < dial.intervalMs) return buildNativeError("APP_BRIDGE_THROTTLED");
|
|
@@ -30271,7 +30281,7 @@ function Panel() {
|
|
|
30271
30281
|
color: "#666",
|
|
30272
30282
|
fontWeight: 400
|
|
30273
30283
|
},
|
|
30274
|
-
children: ["v", "0.2.
|
|
30284
|
+
children: ["v", "0.2.2"]
|
|
30275
30285
|
}),
|
|
30276
30286
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
30277
30287
|
type: "button",
|