fix(types): Desktop type safety hardening (TYPE-01)
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

- Unify ConnectionState: kernel-types.ts now canonical source
  with 'handshaking', gateway-types.ts re-exports
- PromptTemplateInfo source/status → union literals
- PromptVariable.type → union literal
- CreateRoleRequest id/permissions → optional
- PropertyPanel: replace 13 as any with typed accessor pattern
- chatStore: window cast via as unknown as Record
This commit is contained in:
iven
2026-04-05 01:30:29 +08:00
parent 36168d6978
commit 3b0ab1a7b7
6 changed files with 32 additions and 26 deletions

View File

@@ -90,7 +90,7 @@ export interface ZclawStreamEvent {
}
// === Connection State ===
export type ConnectionState = 'disconnected' | 'connecting' | 'handshaking' | 'connected' | 'reconnecting';
// Re-export from kernel-types to maintain single source of truth
export type { ConnectionState } from './kernel-types';
export type EventCallback = (payload: unknown) => void;

View File

@@ -7,7 +7,7 @@
// === Connection & Status Types ===
export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting';
export type ConnectionState = 'disconnected' | 'connecting' | 'handshaking' | 'connected' | 'reconnecting';
export interface KernelStatus {
initialized: boolean;

View File

@@ -188,9 +188,9 @@ export interface PromptTemplateInfo {
name: string;
category: string;
description: string | null;
source: string;
source: 'builtin' | 'custom';
current_version: number;
status: string;
status: 'active' | 'deprecated' | 'archived';
created_at: string;
updated_at: string;
}
@@ -211,7 +211,7 @@ export interface PromptVersionInfo {
/** Prompt variable definition */
export interface PromptVariable {
name: string;
type: string;
type: 'string' | 'number' | 'select' | 'boolean';
default_value?: string;
description?: string;
required?: boolean;
@@ -432,10 +432,10 @@ export interface RoleInfo {
/** Create role request */
export interface CreateRoleRequest {
id: string;
id?: string;
name: string;
description?: string;
permissions: string[];
permissions?: string[];
}
/** Update role request */