{"version":3,"file":"types.cjs","names":["Data"],"sources":["../../src/infra/types.ts"],"sourcesContent":["import { Data } from \"effect\";\nimport type { AppOrchestrator } from \"../service-descriptor\";\nimport type { RuntimeConfig } from \"../types\";\n\nexport interface CliPorts {\n  host?: number;\n  api?: number;\n  auth?: number;\n  ui?: number;\n  uiSsr?: number;\n  pluginsStart?: number;\n  plugins?: Record<string, { api?: number; ui?: number }>;\n}\n\nexport interface ResolvedPorts {\n  host?: number;\n  api?: number;\n  auth?: number;\n  ui?: number;\n  uiSsr?: number;\n  plugins: Record<string, { api?: number; ui?: number }>;\n  postgres: Record<string, number>;\n  redis: Record<string, number>;\n}\n\nexport interface RuntimeLaunchSpec {\n  port?: number;\n  hostUrl?: string;\n  corsOrigin?: string;\n  trustedOrigins?: string[];\n  env: Record<string, string>;\n  runtimeConfig: RuntimeConfig;\n}\n\nexport interface ClaimRecord {\n  resourceKey: string;\n  pid: number;\n  configDir: string;\n  ports: Record<string, number>;\n  startedAt: number;\n}\n\nexport interface InfraPlan {\n  workspaceKey: string;\n  cliPorts: CliPorts;\n  resolvedPorts: ResolvedPorts;\n  runtimeConfig: RuntimeConfig;\n  launch: RuntimeLaunchSpec;\n  description: string;\n  serviceDescriptors: Map<string, ServiceDescriptorPlan>;\n  envGenerated: Record<string, string>;\n  composeModel: ComposeModelPlan;\n  claims: ClaimRecord[];\n  orchestrator: AppOrchestrator;\n}\n\nexport interface ServiceDescriptorPlan {\n  key: string;\n  source: \"local\" | \"remote\";\n  url: string;\n  port?: number;\n  localPath?: string;\n}\n\nexport interface ComposeModelPlan {\n  databases: DatabasePlan[];\n  redis: RedisPlan[];\n}\n\nexport interface DatabasePlan {\n  secret: string;\n  slug: string;\n  port: number;\n  dbName: string;\n  containerName: string;\n  volumeName: string;\n  url: string;\n}\n\nexport interface RedisPlan {\n  secret: string;\n  slug: string;\n  port: number;\n  containerName: string;\n  volumeName: string;\n  url: string;\n}\n\nexport type InfraPhase =\n  | \"resolve-config\"\n  | \"allocate-services\"\n  | \"allocate-databases\"\n  | \"claim\"\n  | \"materialize-env\"\n  | \"materialize-compose\"\n  | \"launch\";\n\nexport class InfraError extends Data.TaggedError(\"InfraError\")<{\n  phase: InfraPhase;\n  message: string;\n  cause?: unknown;\n}> {}\n\nexport interface InfraInput {\n  configDir: string;\n  bosConfig: RuntimeConfig;\n  cli: {\n    port?: number;\n    apiPort?: number;\n    authPort?: number;\n    uiPort?: number;\n    pluginPortStart?: number;\n    plugins?: Record<string, { api?: number; ui?: number }>;\n    ssr?: boolean;\n    proxy?: boolean;\n    hostSource?: \"local\" | \"remote\";\n    uiSource?: \"local\" | \"remote\";\n    apiSource?: \"local\" | \"remote\";\n    authSource?: \"local\" | \"remote\";\n    interactive?: boolean;\n  };\n}\n"],"mappings":";;;;AAiGA,IAAa,aAAb,cAAgCA,YAAK,YAAY,aAAa,CAI3D"}