fix(frontend): initializeStores dedup + retryAllMessages guard + as any cleanup

- index.ts: add _storesInitialized guard to prevent triple initialization
- offlineStore.ts: add isRetrying mutex for retryAllMessages concurrency
- PropertyPanel.tsx: replace 13x (data as any) with typed d accessor
- chatStore.ts: replace window as any with Record<string, unknown>
- kernel-*.ts: replace prototype as any with Record<string, unknown>
- gateway-heartbeat.ts: delete dead code (9 as any, zero imports)
This commit is contained in:
iven
2026-04-05 01:06:48 +08:00
parent 13a40dbbf5
commit 82842c4258
12 changed files with 45 additions and 143 deletions

View File

@@ -354,8 +354,10 @@ if (import.meta.hot) {
// Dev-only: Expose stores to window for E2E testing
if (import.meta.env.DEV && typeof window !== 'undefined') {
(window as any).__ZCLAW_STORES__ = (window as any).__ZCLAW_STORES__ || {};
(window as any).__ZCLAW_STORES__.chat = useChatStore;
(window as any).__ZCLAW_STORES__.message = useMessageStore;
(window as any).__ZCLAW_STORES__.stream = useStreamStore;
const w = window as Record<string, unknown>;
w.__ZCLAW_STORES__ = (w.__ZCLAW_STORES__ as Record<string, unknown>) || {};
const stores = w.__ZCLAW_STORES__ as Record<string, unknown>;
stores.chat = useChatStore;
stores.message = useMessageStore;
stores.stream = useStreamStore;
}