| import type { ChildProcess } from 'child_process' |
| import { z } from 'zod/v4' |
| import { lazySchema } from '../utils/lazySchema.js' |
|
|
| export const connectResponseSchema = lazySchema(() => |
| z.object({ |
| session_id: z.string(), |
| ws_url: z.string(), |
| work_dir: z.string().optional(), |
| }), |
| ) |
|
|
| export type ServerConfig = { |
| port: number |
| host: string |
| authToken: string |
| unix?: string |
| |
| idleTimeoutMs?: number |
| |
| maxSessions?: number |
| |
| workspace?: string |
| } |
|
|
| export type SessionState = |
| | 'starting' |
| | 'running' |
| | 'detached' |
| | 'stopping' |
| | 'stopped' |
|
|
| export type SessionInfo = { |
| id: string |
| status: SessionState |
| createdAt: number |
| workDir: string |
| process: ChildProcess | null |
| sessionKey?: string |
| } |
|
|
| |
| |
| |
| |
| export type SessionIndexEntry = { |
| |
| sessionId: string |
| |
| transcriptSessionId: string |
| cwd: string |
| permissionMode?: string |
| createdAt: number |
| lastActiveAt: number |
| } |
|
|
| export type SessionIndex = Record<string, SessionIndexEntry> |
|
|