67 lines · 1.7 KB · TypeScript
RawDownload
import type { ProviderEvent, ProviderSession } from "@t3tools/contracts"; export type SessionPhase = "disconnected" | "connecting" | "ready" | "running";export type RuntimeMode = "approval-required" | "full-access";export const DEFAULT_RUNTIME_MODE: RuntimeMode = "full-access";export const DEFAULT_THREAD_TERMINAL_HEIGHT = 280;export const DEFAULT_THREAD_TERMINAL_ID = "default"; export interface ThreadTerminalGroup {  id: string;  terminalIds: string[];} export interface ChatImageAttachment {  type: "image";  id: string;  name: string;  mimeType: string;  sizeBytes: number;  previewUrl?: string;} export type ChatAttachment = ChatImageAttachment; export interface ChatMessage {  id: string;  role: "user" | "assistant";  text: string;  attachments?: ChatAttachment[];  createdAt: string;  streaming: boolean;} export interface Project {  id: string;  name: string;  cwd: string;  model: string;  expanded: boolean;} export interface Thread {  id: string;  codexThreadId: string | null;  projectId: string;  title: string;  model: string;  terminalOpen: boolean;  terminalHeight: number;  terminalIds: string[];  runningTerminalIds: string[];  activeTerminalId: string;  terminalGroups: ThreadTerminalGroup[];  activeTerminalGroupId: string;  session: ProviderSession | null;  messages: ChatMessage[];  events: ProviderEvent[];  error: string | null;  createdAt: string;  latestTurnId?: string | undefined;  latestTurnStartedAt?: string | undefined;  latestTurnCompletedAt?: string | undefined;  latestTurnDurationMs?: number | undefined;  lastVisitedAt?: string | undefined;  branch: string | null;  worktreePath: string | null;}