import type { CommandManagedRuntimeRunner } from "@paperclipai/adapter-utils/command-managed-runtime"; import type { ComputerRecord, Ledger, Owner, ProcessClaim, } from "../domain/ledger.js"; export interface ComputerRepository { create(record: ComputerRecord): Promise; get(scope: { companyId: string; environmentId: string; }): Promise; update( scope: { companyId: string; environmentId: string }, fn: (record: ComputerRecord) => T, ): Promise; all(): Promise; runState( scope: { companyId: string }, runId: string, agentId: string, ): Promise<"active" | "terminal" | "missing">; } export interface ComputerBackend { inspect(record: ComputerRecord): Promise<{ state: string; snapshots: boolean; stop: null | { id: string; status: string }; }>; ready(record: ComputerRecord): Promise; claim(record: ComputerRecord): Promise; advance(record: ComputerRecord, owner: Owner): Promise; runner(record: ComputerRecord, options?: { control?: boolean }): Promise; launch( record: ComputerRecord, owner: Owner, input: { command: string; args?: string[]; cwd?: string; env?: Record; }, ): Promise; inspectProcess( record: ComputerRecord, owner: Owner, ): Promise<{ running: boolean; claim: ProcessClaim | null }>; retire(record: ComputerRecord, owner: Owner): Promise; stop(record: ComputerRecord): Promise<{ id: string; status: string }>; stopStatus( record: ComputerRecord, id: string, ): Promise<{ id: string; status: string }>; renew(record: ComputerRecord): Promise; computerTool(): { command: string; args: string[] }; desktop( record: ComputerRecord, ): Promise<{ viewerUrl: string; expiresAt: string }>; ingress( record: ComputerRecord, port: number, path: string, ): Promise<{ url: string; secretHeaders: Record }>; preview(record: ComputerRecord, port: number): Promise<{ url: string }>; remote(record: ComputerRecord, input: Record): Promise; } export type { Ledger };