/** * Shared types for agent threads and CLI providers. * * These types are consumed by both the gateway (backend) and * the web app (frontend) for the parallel-agents UI. */ export type ProviderId = string; /** * HTTP backend the built-in `jait` provider sends its OpenAI-compatible * /chat/completions requests to. Shared so the gateway's settings validation * and the web app's settings UI can never drift apart on the allowed values. * * - `openai` — OpenAI or any OPENAI_BASE_URL-compatible endpoint * - `openrouter` — OpenRouter's hosted catalogue * - `ollama` — a local Ollama server * - `omniroute` — a local OmniRoute router (default http://localhost:20128/v1) * - `gemini` — Google Gemini's OpenAI-compatible endpoint * - `anthropic` — Anthropic Claude's OpenAI-compatible endpoint * - `grok` — xAI Grok's OpenAI-compatible endpoint * - `perplexity` — Perplexity's OpenAI-compatible endpoint * - `moonshot` — Moonshot AI's OpenAI-compatible endpoint * - `kimi` — Kimi (Moonshot AI) via its OpenAI-compatible endpoint */ export type JaitBackend = "openai" | "openrouter" | "ollama" | "omniroute" | "gemini" | "anthropic" | "grok" | "perplexity" | "moonshot" | "kimi"; export declare const JAIT_BACKENDS: readonly JaitBackend[]; export declare function isJaitBackend(value: unknown): value is JaitBackend; export declare function providerTypeFromId(providerId: ProviderId): ProviderId; export interface ProviderInfo { id: ProviderId; providerType?: ProviderId; name: string; description: string; available: boolean; unavailableReason?: string; modes: RuntimeMode[]; auth?: ProviderAuthInfo; /** * Device the provider actually runs on: `"gateway"` for gateway-hosted * providers, otherwise the connected node's id. Every provider belongs to * exactly one device — clients scope and route by this field instead of * re-deriving device ownership from node capability lists. */ nodeId?: string; /** Human-readable name of {@link nodeId} ("Gateway", "Windows workstation", …). */ nodeName?: string; } export type RuntimeMode = "full-access" | "supervised"; export type ThreadKind = "delivery" | "delegation"; export interface ProviderAuthCapabilities { login: boolean; logout: boolean; deviceCode: boolean; } export interface ProviderAuthInfo extends ProviderAuthCapabilities { authenticated?: boolean | null; detail?: string; username?: string; } export interface ProviderAuthStatus extends ProviderAuthCapabilities { authenticated: boolean | null; detail?: string; username?: string; } export interface ProviderLoginResult { ok: boolean; status: "started" | "completed" | "unsupported" | "error"; providerId: ProviderId; message: string; verificationUri?: string; userCode?: string; rawOutput?: string; requiresCodeInput?: boolean; inputPrompt?: string; } export interface ProviderLogoutResult { ok: boolean; status: "completed" | "unsupported" | "error"; providerId: ProviderId; message: string; rawOutput?: string; } export interface ProviderModelInfo { id: string; name: string; description?: string; isDefault?: boolean; group?: string; /** Model accepts a provider-specific reasoning/thinking effort option. */ reasoningEffortSupported?: boolean; /** Exact effort values advertised by the provider for this model. */ supportedReasoningEfforts?: Array<{ reasoningEffort: string; description?: string; }>; } export interface RemoteProviderStatus { id: ProviderId; providerType?: ProviderId; name?: string; installed: boolean; authenticated: boolean | null; detail?: string; } export interface RemoteProviderInfo { nodeId: string; nodeName: string; platform: string; providers: string[]; availableProviderTypes?: string[]; providerStatuses?: RemoteProviderStatus[]; } /** * Intent classification for the thread router. * Determines what kind of problem-solving approach is needed. */ export type ThreadIntent = "coding" | "debugging" | "research" | "review" | "planning" | "devops" | "data" | "general"; /** * Execution topology — how many threads the router recommends. */ export type ExecutionTopology = "single" | "delegated"; /** * The router's output: a plan for how to execute the thread's task. * Stored on the thread and injected into the agent's context. */ export interface RoutingPlan { /** Classified intent of the task. */ intent: ThreadIntent; /** Why the router chose this plan — shown in UI and given to agent. */ reason: string; /** Suggested skills (by id) that match the task. */ suggestedSkillIds: string[]; /** Whether the task would benefit from helper threads. */ topology: ExecutionTopology; /** Specific sub-tasks for helpers, if topology is "delegated". */ subtasks?: string[]; /** Timestamp of when routing was computed. */ routedAt: string; } export type ThreadStatus = "idle" | "running" | "completed" | "error" | "interrupted"; export interface ThreadInfo { id: string; userId: string | null; sessionId: string | null; title: string; providerId: ProviderId; model: string | null; /** Provider-specific reasoning/thinking effort this thread runs with. */ reasoningEffort: string | null; runtimeMode: RuntimeMode; kind: ThreadKind; skillIds: string[] | null; workingDirectory: string | null; branch: string | null; status: ThreadStatus; providerSessionId: string | null; error: string | null; prUrl: string | null; prNumber: number | null; prTitle: string | null; prBaseBranch: string | null; prState: "creating" | "open" | "closed" | "merged" | null; executionNodeId: string | null; executionNodeName: string | null; routingPlan: RoutingPlan | null; changeFiles: number | null; changeInsertions: number | null; changeDeletions: number | null; createdAt: string; updatedAt: string; completedAt: string | null; } export interface ThreadRegistrySnapshot { serverTime: string; threads: ThreadInfo[]; hasMore?: boolean; } export type AgentThread = ThreadInfo; export type ThreadActivityKind = "tool.start" | "tool.result" | "tool.error" | "tool.approval" | "skill.active" | "message" | "error" | "session" | "activity"; export interface ThreadActivity { id: string; threadId: string; kind: string; summary: string; payload?: unknown; createdAt: string; } export interface CreateThreadRequest { sessionId?: string; title: string; providerId: ProviderId; model?: string; reasoningEffort?: string | null; runtimeMode?: RuntimeMode; kind?: ThreadKind; skillIds?: string[] | null; workingDirectory?: string; branch?: string; prBaseBranch?: string | null; } export interface CreateThreadParams extends CreateThreadRequest { userId?: string; } export interface UpdateThreadRequest { title?: string; model?: string; reasoningEffort?: string | null; runtimeMode?: RuntimeMode; kind?: ThreadKind; skillIds?: string[] | null; workingDirectory?: string; branch?: string; prUrl?: string | null; prNumber?: number | null; prTitle?: string | null; prBaseBranch?: string | null; prState?: "creating" | "open" | "closed" | "merged" | null; } export interface UpdateThreadParams extends Omit { providerId?: ProviderId; workingDirectory?: string | null; branch?: string | null; status?: ThreadStatus; providerSessionId?: string | null; error?: string | null; completedAt?: string | null; executionNodeId?: string | null; executionNodeName?: string | null; routingPlan?: RoutingPlan | null; changeFiles?: number | null; changeInsertions?: number | null; changeDeletions?: number | null; } export type ThreadWsEventType = "thread.created" | "thread.updated" | "thread.deleted" | "thread.status" | "thread.activity"; export interface ThreadWsEvent { type: ThreadWsEventType; threadId: string; data: unknown; } //# sourceMappingURL=thread.d.ts.map