import type { Environment, EnvironmentCapabilities, EnvironmentLease, EnvironmentProbeResult } from "@penclipai/shared"; import { api } from "./client"; export const environmentsApi = { list: (companyId: string) => api.get(`/companies/${companyId}/environments`), capabilities: (companyId: string) => api.get(`/companies/${companyId}/environments/capabilities`), lease: (leaseId: string) => api.get(`/environment-leases/${leaseId}`), create: (companyId: string, body: { name: string; description?: string | null; driver: "local" | "ssh" | "sandbox" | "plugin"; config?: Record; metadata?: Record | null; }) => api.post(`/companies/${companyId}/environments`, body), update: (environmentId: string, body: { name?: string; description?: string | null; driver?: "local" | "ssh" | "sandbox" | "plugin"; status?: "active" | "archived"; config?: Record; metadata?: Record | null; }) => api.patch(`/environments/${environmentId}`, body), probe: (environmentId: string) => api.post(`/environments/${environmentId}/probe`, {}), probeConfig: (companyId: string, body: { name?: string; driver: "local" | "ssh" | "sandbox" | "plugin"; description?: string | null; config?: Record; metadata?: Record | null; }) => api.post(`/companies/${companyId}/environments/probe-config`, body), };