/** * Coder Workspace Orchestrator * * High-level lifecycle orchestration for Coder workspaces. * Combines CoderClient (API primitives) with shared setup utilities * to manage the full create/resume/stop/delete lifecycle. * * Used by both the self-hosted CoderProvider and the sudocode-hub server. * * @see s-9uap - sudopod-coder-sdk specification * @see s-6q31 - Self-Hosted Coder Provider spec */ import type { CreateOptions, Workspace, ListWorkspacesOptions } from '../provider/types.js'; export interface CoderOrchestratorConfig { baseUrl: string; token: string; } /** * High-level workspace lifecycle orchestrator for Coder. * * Encapsulates the full create/resume flow: * - API calls (via CoderClient) * - Remote execution (via ExecFn) * - Setup (installSudocode, applySetupConfig, setupTailscale) * - Manifest management (buildManifest, writeManifest, readManifest) * - Service management (startServices) * * Both CoderProvider (CLI) and the Hub server delegate to this class. */ export declare class CoderOrchestrator { private client; private exec; private baseUrl; private contextPromise?; constructor(config: CoderOrchestratorConfig); private resolveContext; create(options: CreateOptions): Promise; resume(workspaceId?: string): Promise; stop(workspaceId: string): Promise; delete(workspaceId: string): Promise; get(workspaceId: string): Promise; list(filters?: ListWorkspacesOptions): Promise; /** * Read manifest and apply all runtime config on resume. * * Envbuilder workspaces rebuild the container on stop/start, so system-level * installs (Node.js, tailscale, sudocode) are lost. The manifest and tailscale * state persist on the /workspaces volume. This method: * 1. Reinstalls Node.js + sudocode if missing * 2. Reconnects Tailscale (re-installing the binary if needed) * 3. Restarts services */ private applyManifestOnResume; /** * Apply runtime from a workspace manifest. * Simpler than Codespaces — no port forwarding, no keepalive needed. * Coder handles port forwarding via its web UI and activity tracking at the template level. */ private applyManifestRuntime; /** * Discover a workspace's Tailscale node in Headscale by hostname. * Polls with retry because the node may take a few seconds to appear * after `tailscale up` completes. */ private discoverTailscaleNode; /** * Enrich a Workspace with Tailscale connection info from the manifest. */ private enrichWithTailscale; private buildRichParameters; private mapError; } //# sourceMappingURL=orchestrator.d.ts.map