// Container management API client // Extends RPC client with container-specific methods import { rpcClient } from './rpc-client' export interface ContainerStatus { id: string name: string state: 'created' | 'running' | 'stopped' | 'exited' | 'paused' | 'unknown' image: string created: string ports: string[] } export interface ContainerAppInfo { id: string name: string version: string status: ContainerStatus health: 'healthy' | 'unhealthy' | 'unknown' | 'starting' } export const containerClient = { /** * Install a container app from a manifest file */ async installApp(manifestPath: string): Promise { return rpcClient.call({ method: 'container-install', params: { manifest_path: manifestPath }, }) }, /** * Start a container */ async startContainer(appId: string): Promise { return rpcClient.call({ method: 'container-start', params: { app_id: appId }, }) }, /** * Stop a container */ async stopContainer(appId: string): Promise { return rpcClient.call({ method: 'container-stop', params: { app_id: appId }, }) }, /** * Remove a container */ async removeContainer(appId: string): Promise { return rpcClient.call({ method: 'container-remove', params: { app_id: appId }, }) }, /** * Get container status */ async getContainerStatus(appId: string): Promise { return rpcClient.call({ method: 'container-status', params: { app_id: appId }, }) }, /** * Get container logs */ async getContainerLogs(appId: string, lines: number = 100): Promise { return rpcClient.call({ method: 'container-logs', params: { app_id: appId, lines }, }) }, /** * List all containers */ async listContainers(): Promise { return rpcClient.call({ method: 'container-list', params: {}, }) }, /** * Get health status for all containers */ async getHealthStatus(): Promise> { return rpcClient.call>({ method: 'container-health', params: {}, }) }, }