import type { IncomingMessage, ServerResponse } from "http"; import type { WebSocket } from "ws"; import type { AgentClient } from "../../agent/agent-client"; import type { AgentConfig } from "../../agent/agent-config"; import type { ConversationWriter } from "../../agent/conversation-writer"; import type { ClaudeFlagValues, FlagDefinition } from "../../claude-flags"; import type { ConversationCache } from "../../conversation-cache"; import type { CacheMetadataRepository } from "../../db/repositories/cacheMetadata.repository"; import type { ConversationsRepository } from "../../db/repositories/conversations.repository"; import type { DevicesRepository } from "../../db/repositories/devices.repository"; import type { ManagedSessionsRepository } from "../../db/repositories/managed-sessions.repository"; import type { ProjectsRepository } from "../../db/repositories/projects.repository"; import type { PushRepository } from "../../db/repositories/push.repository"; import type { SessionsRepository } from "../../db/repositories/sessions.repository"; import type { RuntimeStore } from "../../db/runtime-store"; import type { E2eeContext } from "../../e2ee/context"; import type { FeatureFlagDefinition, FeatureFlagId, FeatureFlagSource, ResolvedFeatureFlags } from "../../feature-flags"; import type { LiveSessionManager } from "../../live-session-manager"; import type { CacheIntegrityMonitor } from "../../services/cache-integrity/cacheIntegrityMonitor"; import type { HostPressureMonitor } from "../../services/host-pressure/hostPressure"; import type { ExpoPushSender } from "../../services/push/expoPushSender"; import type { Principal } from "../../services/security/capabilities"; import type { ReconcileVerdict } from "../../services/sessions/reconcileSessions"; import type { SessionStore } from "../../session-store"; import type { WSHub } from "../../ws-hub"; export type ApiDeps = { apiKey: string; localNoAuth: boolean; logMenubarRequests: boolean; rotateApiKey: () => { newKey: string; persisted: boolean; }; claudeFlagsConfig: () => { registry: readonly FlagDefinition[]; values: ClaudeFlagValues; extraArgs: string | null; persisted: boolean; }; setClaudeFlagsConfig: (values: ClaudeFlagValues, extraArgs: string | undefined) => { values: ClaudeFlagValues; extraArgs: string | null; persisted: boolean; }; featureFlagsConfig: () => { registry: readonly FeatureFlagDefinition[]; values: ResolvedFeatureFlags; sources: Record; }; publicUrl: string | null; browseRoot: string | null; browserCors: string | undefined; ptyManager: LiveSessionManager; sessionStore: SessionStore; wsHub: WSHub; cache: () => ConversationCache | null; isExcludedSubagent?: (id: string) => Promise; cacheMonitor: () => CacheIntegrityMonitor | null; hostPressureMonitor: () => HostPressureMonitor | null; /** Push registration + delivery state (C7). Null when the cache DB is unavailable. */ pushRepo: () => PushRepository | null; /** * Whether Live Activity push is actually running on this server — the same * fact the boot log reports as `live_activity.enabled`. Asked of the server * rather than re-derived from the environment, because APNs credentials alone * do not enable it: the sender is only wired when the token store opened too. */ liveActivityPushEnabled: () => boolean; /** * Whether "your turn" notifications over Expo's relay are wired — true once the * token store opened, since that transport needs no credential of its own. */ expoPushEnabled: () => boolean; /** The Expo sender, for the test-push endpoint. Null while notifications are unwired. */ expoPushSender: () => ExpoPushSender | null; /** Paired-device registry (C5). Null when the cache DB is unavailable. */ devicesRepo: () => DevicesRepository | null; projectsRepo: () => ProjectsRepository | null; conversationsRepo: () => ConversationsRepository | null; sessionsRepo: () => SessionsRepository | null; cacheMetadataRepo: () => CacheMetadataRepository | null; /** Authoritative session registry (~/.threadbase/runtime.db). Null when it failed to open. */ runtimeStore: () => RuntimeStore | null; /** Rows of that registry. Null when it failed to open. */ managedSessionsRepo: () => ManagedSessionsRepository | null; /** This boot's reconcile verdicts, by session id. Empty before it has run. */ sessionVerdicts: () => Map; ptyAttachedIds: () => Set; handleListSessions: (url: URL, res: ServerResponse) => Promise; handleSessionsCount: (res: ServerResponse) => void; handleGetRecentSessions: (url: URL, res: ServerResponse) => void; handleGetSessionNames: (res: ServerResponse) => void; handleGetSession: (sessionId: string, res: ServerResponse) => Promise; handleGetOutput: (sessionId: string, res: ServerResponse) => void; handleSendInput: (sessionId: string, req: IncomingMessage, res: ServerResponse) => Promise; handleRawKey: (sessionId: string, req: IncomingMessage, res: ServerResponse) => Promise; handleSendAnswer: (sessionId: string, req: IncomingMessage, res: ServerResponse) => Promise; handlePromptAnswer: (sessionId: string, req: IncomingMessage, res: ServerResponse) => Promise; handlePermissionAnswer: (sessionId: string, req: IncomingMessage, res: ServerResponse) => Promise; handleCancel: (sessionId: string, res: ServerResponse) => void; handleStopSession: (sessionId: string, res: ServerResponse, opts?: { when?: "now" | "idle"; ignoreWatchers?: boolean; delete?: boolean; }) => Promise; handleKillSession: (sessionId: string, res: ServerResponse, opts?: { delete?: boolean; }) => Promise; handleSetSessionName: (sessionId: string, req: IncomingMessage, res: ServerResponse) => Promise; handleSetSessionModel: (sessionId: string, req: IncomingMessage, res: ServerResponse) => Promise; handleSetSessionEffort: (sessionId: string, req: IncomingMessage, res: ServerResponse) => Promise; handleUploadFile: (sessionId: string, req: IncomingMessage, res: ServerResponse) => Promise; handleAdopt: (sessionId: string, res: ServerResponse) => Promise; handleFork: (sessionId: string, req: IncomingMessage, res: ServerResponse) => Promise; handleResume: (req: IncomingMessage, res: ServerResponse) => Promise; handleStartSession: (req: IncomingMessage, res: ServerResponse) => Promise; handleListConversations: (url: URL, res: ServerResponse) => Promise; handleConversationsCount: (url: URL, res: ServerResponse) => Promise; handleGetConversation: (id: string, url: URL, res: ServerResponse, ifNoneMatch?: string) => Promise; handleSearch: (url: URL, res: ServerResponse) => Promise; handleSearchTarget: (id: string, req: IncomingMessage, res: ServerResponse) => Promise; handleListProjects: (url: URL, res: ServerResponse) => void; handleGetPopularProjects: (url: URL, res: ServerResponse) => void; handleGetProjectSummaries: (url: URL, res: ServerResponse) => void; handlePairStart: (res: ServerResponse) => void; handlePairExchange: (req: IncomingMessage, res: ServerResponse) => Promise; handleBrowse: (url: URL, res: ServerResponse) => Promise; handleMkdir: (req: IncomingMessage, res: ServerResponse) => Promise; /** * `context` is present only for a socket that presented a valid ticket. Its * absence is the legacy plaintext path, which must keep working (§8, dual * paths). */ handleWsOpen: (ws: WebSocket, context?: E2eeContext) => void; handleWsMessage: (ws: WebSocket, raw: unknown, principal: Principal | null) => void; handleWsClose: (ws: WebSocket) => void; agentClient: AgentClient | null; conversationWriter: ConversationWriter | null; agentConfig: AgentConfig; }; //# sourceMappingURL=api-deps.d.ts.map