From 3b40c3754c2bb7e5f53fe317f2d1b759d2046c86 Mon Sep 17 00:00:00 2001 From: QQ Date: Sat, 14 Nov 2026 14:32:17 +0800 Subject: [PATCH] Import apps/vscode/src/types.ts --- apps/vscode/src/types.ts | 81 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 apps/vscode/src/types.ts diff --git a/apps/vscode/src/types.ts b/apps/vscode/src/types.ts new file mode 100644 index 0000000..a6af505 --- /dev/null +++ b/apps/vscode/src/types.ts @@ -0,0 +1,81 @@ +export interface DeviceIdentity { + deviceId: string + name: string + platform: 'vscode' + publicKey: string + privateKey: string +} + +export interface Credentials { + serverUrl: string + deviceId: string + account: string + accessToken: string + accessTokenExpiresAt: number + refreshToken: string + refreshTokenExpiresAt: number +} + +export interface RemoteHost { + deviceId: string + name: string + platform: string + identityKey: string + membershipId: string + online: boolean + lastSeenAt?: number + clientVersion?: string + harnessVersion?: string +} + +export interface RemoteSession { + sessionId: string + updatedAt: number + running: boolean + blank: boolean + title?: string + cwd?: string + parentSessionId?: string + projections?: { values?: Record } +} + +export interface RemoteWorkspace { + workspaceId: string + path: string + title: string + sessionIds: string[] +} + +export interface HistoryEntry { + event: { type: string; data?: unknown; seq?: number } + view?: { for: 'call' | 'result'; view: unknown } +} + +export interface ChatMessage { + role: 'user' | 'assistant' | 'tool' + text: string + toolCallId?: string + toolState?: 'running' | 'completed' | 'failed' + toolKind?: string + toolCard?: string + toolDetail?: string +} + +export interface DirectoryEntry { name: string; path: string; hidden: boolean } +export interface DirectoryListing { + path: string + home: string + crumbs: DirectoryEntry[] + entries: DirectoryEntry[] + truncated: boolean +} + +export interface ModelSelection { provider: string; model: string; reasoningEffort?: string } +export interface SessionModels { + current: ModelSelection + routable: boolean + groups: Array<{ id: string; name: string; models: Array<{ id: string; name: string; description?: string; reasoning?: { efforts: Array<{ id: string; name: string; description?: string }> } }> }> +} +export interface MuxFrame { rpcId: string; payload: Record } +export interface PendingApproval { frameRpcId: string; sessionId: string; approvalId: string; toolName: string; reason?: string } +export interface HostDescriptor { version: string; cwd: string; provider?: string; model?: string; attachedSessions: number; canOpenPath: boolean }