INNER CODE UNIT · TypeScript

ContainerManager

open-gitagent/clawless · src/container.ts:18

export class ContainerManager {
  private wc: WebContainer | null = null;
  private shellProcess: WebContainerProcess | null = null;
  private shellWriter: WritableStreamDefaultWriter<string> | null = null;
  private _status: ContainerStatus = 'booting';
  private onStatusChange?: (s: ContainerStatus) => void;

  // Stored after configureEnv() so startShell() can inject them directly
  private apiEnvVars: Record<string, string> = {};
  private serverUrls = new Map<number, string>();
  private serverListeners: Array<(port: number, url: string) => void> = [];
  private fileChangeListeners: Array<(path: string) => void> = [];
  private audit: AuditLog | null = null;
  private policy: PolicyEngine | null = null;
  private activeProcessCount = 0;
  private outputLineBuf = '';
  private outputFlushTimer: ReturnType<typeof setTimeout> | null = null;
  private gitService: GitService | null = null;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…