/** * Shared runtime context for HTTP server and CLI — backed by SQLite. */ import { AgentComms, ApprovalQueue, AuditRepository, AuthService, UsersAdminService, RbacPolicyService, LlmGateway, ProjectService, ProjectOpsService, CronJobService, SettingsRepository, EmailService, AiTaskService, FleetService, Scheduler, runProtectionProbes, HostBrowseService, type Allowlist, type HostBrowseLiveTicketStore, type HostExecutor, type ProtectionState, type TerminalTicketStore, type VncSessionTicketStore, type YskConfig, type YskDatabase } from 'ysk-server-core'; export interface AppContext { db: YskDatabase; auth: AuthService; usersAdmin: UsersAdminService; rbac: RbacPolicyService; allowlist: Allowlist; approvals: ApprovalQueue; agents: AgentComms; fleet: FleetService; llm: LlmGateway; protection: ProtectionState; host: HostExecutor; projects: ProjectService; projectOps: ProjectOpsService; cron: CronJobService; email: EmailService; ai: AiTaskService; audit: AuditRepository; settings: SettingsRepository; scheduler: Scheduler; /** rolling request counter for rate detection */ requestHits: number[]; /** Hits in the last 60s (trims the rolling buffer). */ requestHitsLastMinute(): number; version: string; startedAt: string; config?: YskConfig; configPath?: string; dataDir: string; /** Packaged Web UI root (null if not built) */ webRoot?: string; /** One-time tickets for browser terminal WebSocket */ terminalTickets: TerminalTicketStore; /** One-time tickets for browser VNC (RFB) WebSocket proxy */ vncSessionTickets: VncSessionTicketStore; /** Host-mediated proxy browser (privacy egress) */ hostBrowse: HostBrowseService; /** One-time tickets for host-browse live screencast WS */ hostBrowseLiveTickets: HostBrowseLiveTicketStore; /** Rebuild LLM gateway from settings (after settings.llm update) */ reloadLlm: () => void; /** Run protection probes and apply resulting mode */ runAutoProtection: () => ReturnType; stopScheduler: () => void; } export interface CreateAppContextOptions { version: string; config?: YskConfig; configPath?: string; adminPassword?: string; /** Override data dir (tests) */ dataDir?: string; /** Override db path (tests) */ dbPath?: string; executeEnabled?: boolean; /** Override web static root */ webRoot?: string; } export declare function createAppContext(versionOrOpts: string | CreateAppContextOptions): AppContext; export declare function applyProtection(ctx: AppContext, state: ProtectionState): void; export declare function closeAppContext(ctx: AppContext): void; //# sourceMappingURL=app-context.d.ts.map