| |
| import type { MultiAgentOrchestrator } from '@/lib/llm/multi-agent-orchestrator'; |
| import type { VirtualFileSystem } from '@/lib/vfs'; |
| import type { ProviderId } from '@/lib/llm/providers/types'; |
|
|
| |
| export interface ServerOrchestratorContext { |
| apiBaseUrl: string; |
| vfs: VirtualFileSystem; |
| config: ServerGenerationParams; |
| onEvent: (event: string, data: Record<string, unknown>) => void; |
| |
| dirtyPaths: Set<string>; |
| } |
|
|
| |
| export interface ServerGenerationParams { |
| provider: ProviderId; |
| model: string; |
| apiKey: string; |
| providerBaseUrl?: string; |
| temperature?: number; |
| maxTokens?: number; |
| reasoningEnabled?: boolean; |
| compactionEnabled?: boolean; |
| compactionLimit?: number; |
| debugStreamEnabled?: boolean; |
| modelPricing?: Record<string, { prompt: number; completion: number }>; |
| cachedModels?: Array<{ id: string; name: string; context_length?: number }>; |
| } |
|
|
| |
| export interface ServerTask { |
| taskId: string; |
| projectId: string; |
| sessionId: string; |
| workspaceId?: string; |
| status: 'running' | 'paused' | 'stopping' | 'completed' | 'failed' | 'cancelled'; |
| startedAt: number; |
| orchestrator: MultiAgentOrchestrator | null; |
| buildDeferred: boolean; |
| |
| pendingBuildResolve: ((result: BuildResult) => void) | null; |
| |
| prompt?: string; |
| model?: string; |
| projectName?: string; |
| } |
|
|
| export interface BuildResult { |
| success: boolean; |
| errors?: string[]; |
| } |
|
|
| |
| export interface SSEEvent { |
| id: number; |
| event: string; |
| data: Record<string, unknown> & { sourceProjectId: string }; |
| buffered: boolean; |
| } |
|
|
| |
| export interface StartGenerationRequest { |
| projectId: string; |
| prompt: string; |
| model: string; |
| apiKey: string; |
| workspaceId?: string; |
| projectName?: string; |
| providerConfig?: { baseUrl?: string; provider?: ProviderId }; |
| permissionMode?: 'auto' | 'ask' | 'custom'; |
| permissionOverrides?: Record<string, 'ask' | 'allow'>; |
| conversationHistory: unknown[]; |
| executeOptions?: { |
| images?: Array<{ data: string; mediaType: string }>; |
| focusContext?: { domPath: string; snippet: string }; |
| semanticBlocks?: Array<{ name: string; domPath: string; position: string; description: string }>; |
| displayPrompt?: string; |
| }; |
| generationParams: Omit<ServerGenerationParams, 'provider' | 'model' | 'apiKey' | 'providerBaseUrl'>; |
| } |
|
|
| |
| export interface FileFetchRequest { |
| taskId: string; |
| paths: string[]; |
| } |
|
|
| |
| export interface FileFetchResponseItem { |
| path: string; |
| content: string; |
| binary: boolean; |
| } |
|
|