import Docker from 'dockerode'; /** * Settings usable by any resource in the infrastructure. Port of agno's * InfraSettings. A workspace declares one (e.g. in `infra/settings.ts`) and * exports it; the loader picks it up by brand. */ interface InfraSettingsOptions { infraName: string; infraRoot: string; infraRepo?: string | null; defaultEnv?: string | null; defaultInfra?: string | null; imageRepo?: string; imageName?: string | null; buildImages?: boolean; pushImages?: boolean; skipImageCache?: boolean; forcePullImages?: boolean; testEnv?: string; testKey?: string | null; devEnv?: string; devKey?: string | null; stgEnv?: string; stgKey?: string | null; prdEnv?: string; prdKey?: string | null; continueOnCreateFailure?: boolean; continueOnDeleteFailure?: boolean; continueOnPatchFailure?: boolean; useCache?: boolean; awsRegion?: string | null; awsProfile?: string | null; awsSubnetIds?: string[]; awsPublicSubnets?: string[]; awsPrivateSubnets?: string[]; awsSecurityGroupIds?: string[]; } declare class InfraSettings { infraName: string; infraRoot: string; infraRepo: string | null; defaultEnv: string | null; defaultInfra: string | null; imageRepo: string; imageName: string | null; buildImages: boolean; pushImages: boolean; skipImageCache: boolean; forcePullImages: boolean; testEnv: string; testKey: string | null; devEnv: string; devKey: string | null; stgEnv: string; stgKey: string | null; prdEnv: string; prdKey: string | null; continueOnCreateFailure: boolean; continueOnDeleteFailure: boolean; continueOnPatchFailure: boolean; useCache: boolean; awsRegion: string | null; awsProfile: string | null; awsSubnetIds: string[]; awsPublicSubnets: string[]; awsPrivateSubnets: string[]; awsSecurityGroupIds: string[]; constructor(opts: InfraSettingsOptions); get __infraKind(): "settings"; private validateAndSetKeys; private validateAndSetSubnetIds; } declare function isInfraSettings(o: unknown): o is InfraSettings; /** * Options accepted by {@link InfraBase} (and inherited by every resource/app). * Mirrors agno's InfraBase fields, camelCased for the TS public API. */ interface InfraBaseOptions { name?: string | null; group?: string | null; env?: string | null; infra?: string | null; enabled?: boolean; skipCreate?: boolean; skipRead?: boolean; skipUpdate?: boolean; skipDelete?: boolean; recreateOnUpdate?: boolean; useCache?: boolean; force?: boolean | null; waitForCreate?: boolean; waitForUpdate?: boolean; waitForDelete?: boolean; waiterDelay?: number; waiterMaxAttempts?: number; envVars?: Record | null; envFile?: string | null; secretsFile?: string | null; debugMode?: boolean; saveOutput?: boolean; inputDir?: string | null; outputDir?: string | null; dependsOn?: unknown[] | null; infraSettings?: InfraSettings | null; } /** Base class for all InfraResource, InfraApp and InfraResources objects. */ declare class InfraBase { name: string | null; group: string | null; env: string | null; infra: string | null; enabled: boolean; skipCreate: boolean; skipRead: boolean; skipUpdate: boolean; skipDelete: boolean; recreateOnUpdate: boolean; useCache: boolean; force: boolean | null; waitForCreate: boolean; waitForUpdate: boolean; waitForDelete: boolean; waiterDelay: number; waiterMaxAttempts: number; envVars: Record | null; envFile: string | null; secretsFile: string | null; debugMode: boolean; saveOutput: boolean; inputDir: string | null; outputDir: string | null; dependsOn: unknown[] | null; infraSettings: InfraSettings | null; protected cachedInfraDir: string | null; protected cachedEnvFileData: Record | null; protected cachedSecretFileData: Record | null; constructor(opts?: InfraBaseOptions); /** Stable brand checked across the CLI/workspace bundle boundary. */ get __isIxoraInfra(): true; getGroupName(): string | null; get infraRoot(): string | null; get infraName(): string | null; get infraDir(): string | null; setInfraSettings(infraSettings?: InfraSettings | null): void; getEnvFileData(): Record | null; getSecretFileData(): Record | null; getSecretFromFile(secretName: string): unknown; /** Returns an InfraResources object for this resource. Overridden by apps. */ getInfraResources(): unknown; } interface InfraResourceOptions extends InfraBaseOptions { name: string; resourceType?: string | null; resourceTypeList?: string[] | null; } /** Base class for infrastructure resources. Port of agno's InfraResource. */ declare class InfraResource extends InfraBase { name: string; resourceType: string | null; resourceTypeList: string[] | null; activeResource: unknown; resourceCreated: boolean; resourceUpdated: boolean; resourceDeleted: boolean; constructor(opts: InfraResourceOptions); get __isIxoraInfra(): true; get __infraKind(): "resource"; read(_client: unknown): Promise; isActive(_client: unknown): Promise; create(_client: unknown): Promise; update(_client: unknown): Promise; delete(_client: unknown): Promise; getResourceName(): string; getResourceType(): string; getResourceTypeList(): string[]; /** Stable identity used for dedup (replaces agno's __hash__/__eq__). */ resourceKey(): string; private resolveIoDir; getInputFilePath(): string | null; getOutputFilePath(): string | null; saveOutputFile(): boolean; readResourceFromFile(): Record | null; deleteOutputFile(): boolean; matchesFilters(groupFilter?: string | null, nameFilter?: string | null, typeFilter?: string | null): boolean; shouldCreate(groupFilter?: string | null, nameFilter?: string | null, typeFilter?: string | null): boolean; shouldDelete(groupFilter?: string | null, nameFilter?: string | null, typeFilter?: string | null): boolean; shouldUpdate(groupFilter?: string | null, nameFilter?: string | null, typeFilter?: string | null): boolean; } declare function isInfraResource(o: unknown): o is InfraResource; /** Result of a resource lifecycle op: `[completed, total]`. */ type ResourceCount = [number, number]; interface CreateResourcesOptions { groupFilter?: string | null; nameFilter?: string | null; typeFilter?: string | null; dryRun?: boolean; autoConfirm?: boolean; force?: boolean | null; pull?: boolean | null; } interface InfraResourcesOptions extends InfraBaseOptions { apps?: unknown[] | null; resources?: unknown[] | null; } /** * A group of InfraResource and InfraApp objects managed together. Backends * (Docker) subclass this and implement the lifecycle methods. Port of agno's * InfraResources. */ declare class InfraResources extends InfraBase { apps: unknown[] | null; resources: unknown[] | null; constructor(opts?: InfraResourcesOptions); get __infraKind(): "resources"; createResources(_opts?: CreateResourcesOptions): Promise; deleteResources(_opts?: Omit): Promise; updateResources(_opts?: CreateResourcesOptions): Promise; } declare function isInfraResources(o: unknown): o is InfraResources; /** Context passed when building containers. Port of agno's ContainerContext. */ interface ContainerContext { /** Infra name. */ infraName: string; /** Path to the infra directory inside the container. */ infraRoot: string; /** Path to the infra parent directory inside the container. */ infraParent: string; /** Path to requirements.txt relative to infraRoot. */ requirementsFile?: string | null; } interface InfraAppOptions extends InfraBaseOptions { name: string; image?: { name: string; tag?: string | null; } | null; imageStr?: string | null; imageName?: string | null; imageTag?: string | null; entrypoint?: string | string[] | null; command?: string | string[] | null; installRequirements?: boolean; requirementsFile?: string; setPythonPath?: boolean; pythonPath?: string | null; addPythonPaths?: string[] | null; openPort?: boolean; portNumber?: number; containerPort?: number | null; containerPortName?: string; hostPort?: number | null; resources?: InfraResource[] | null; printEnvOnLoad?: boolean; } /** Base class for infrastructure apps. Port of agno's InfraApp. */ declare class InfraApp extends InfraBase { name: string; image: { name: string; tag?: string | null; } | null; imageStr: string | null; imageName: string | null; imageTag: string | null; entrypoint: string | string[] | null; command: string | string[] | null; installRequirements: boolean; requirementsFile: string; setPythonPath: boolean; pythonPath: string | null; addPythonPaths: string[] | null; openPort: boolean; portNumber: number; containerPort: number | null; containerPortName: string; hostPort: number | null; resources: InfraResource[] | null; printEnvOnLoad: boolean; containerEnv: Record | null; containerContext: ContainerContext | null; protected cachedResources: InfraResource[] | null; constructor(opts: InfraAppOptions); get __infraKind(): "app"; getAppName(): string; getImageStr(): string; /** Overridden by backend apps (e.g. DockerApp) to produce resources. */ buildResources(_buildContext: unknown): InfraResource[] | null; getDependencies(): InfraResource[] | null; addAppPropertiesToResources(resources: InfraResource[]): InfraResource[]; getResources(buildContext: unknown): InfraResource[]; matchesFilters(groupFilter?: string | null): boolean; shouldCreate(groupFilter?: string | null): boolean; shouldDelete(groupFilter?: string | null): boolean; shouldUpdate(groupFilter?: string | null): boolean; } declare function isInfraApp(o: unknown): o is InfraApp; /** Starter templates for `ixora workspace create` — IBM i AgentOS templates. */ declare const InfraStarterTemplate: { readonly ibmi_agentos_docker: "ibmi-agentos-docker"; readonly ibmi_agentos_openshift: "ibmi-agentos-openshift"; }; type InfraStarterTemplate = (typeof InfraStarterTemplate)[keyof typeof InfraStarterTemplate]; declare const INFRA_STARTER_TEMPLATES: InfraStarterTemplate[]; declare function isInfraStarterTemplate(value: string): value is InfraStarterTemplate; /** * Lazily creates and holds a single dockerode client. Port of agno's * DockerApiClient (which wraps docker-py). With no base URL, dockerode reads * DOCKER_HOST or falls back to the default local socket. */ declare class DockerApiClient { baseUrl: string | null; timeout: number; private _apiClient; constructor(opts?: { baseUrl?: string | null; timeout?: number; }); createApiClient(): Docker; get apiClient(): Docker; } /** Context passed when building Docker resources. Port of DockerBuildContext. */ interface DockerBuildContext { /** Docker network name to attach containers to. */ network: string; } interface DockerResourceOptions extends InfraResourceOptions { id?: string | null; shortId?: string | null; attrs?: Record | null; pull?: boolean | null; } /** Base class for Docker resources. Port of agno's DockerResource. */ declare class DockerResource extends InfraResource { id: string | null; shortId: string | null; attrs: Record | null; pull: boolean | null; protected dockerClient: DockerApiClient | null; constructor(opts: DockerResourceOptions); getDockerClient(): DockerApiClient; protected _read(_client: DockerApiClient): Promise; protected _create(_client: DockerApiClient): Promise; protected _update(_client: DockerApiClient): Promise; protected _delete(_client: DockerApiClient): Promise; read(dockerClient?: DockerApiClient): Promise; isActive(dockerClient: DockerApiClient): Promise; create(dockerClient?: DockerApiClient): Promise; protected postCreate(_client: DockerApiClient): Promise; update(dockerClient?: DockerApiClient): Promise; protected postUpdate(_client: DockerApiClient): Promise; delete(dockerClient?: DockerApiClient): Promise; protected postDelete(_client: DockerApiClient): Promise; } interface DockerImageOptions extends DockerResourceOptions { name: string; tag?: string | null; path?: string | null; dockerfile?: string | null; pushImage?: boolean; useBuildx?: boolean; rm?: boolean; skipDockerCache?: boolean; buildargs?: Record | null; labels?: Record | null; target?: string | null; networkMode?: string | null; platform?: string | null; platforms?: string[] | null; } /** A Docker image. Port of agno's DockerImage (buildx is the default build path). */ declare class DockerImage extends DockerResource { tag: string | null; path: string | null; dockerfile: string | null; pushImage: boolean; useBuildx: boolean; rm: boolean; skipDockerCache: boolean; buildargs: Record | null; labels: Record | null; target: string | null; networkMode: string | null; platform: string | null; platforms: string[] | null; constructor(opts: DockerImageOptions); getImageStr(): string; private buildx; private dockerodeBuild; private buildImage; protected _read(client: DockerApiClient): Promise; protected _create(client: DockerApiClient): Promise; protected _update(client: DockerApiClient): Promise; protected _delete(client: DockerApiClient): Promise; create(dockerClient?: DockerApiClient): Promise; } interface DockerAppOptions extends InfraAppOptions { infraDirContainerPath?: string; mountInfraDir?: boolean; createVolume?: boolean; volumeDir?: string | null; volumeName?: string | null; volumeContainerPath?: string; mountResources?: boolean; resourcesDir?: string; resourcesDirContainerPath?: string; mountConfig?: boolean; containerName?: string | null; containerLabels?: Record | null; containerDetach?: boolean; containerAutoRemove?: boolean; containerRemove?: boolean; containerUser?: string | number | null; containerStdinOpen?: boolean; containerStdout?: boolean | null; containerStderr?: boolean | null; containerTty?: boolean; containerHealthcheck?: Record | null; containerHostname?: string | null; containerPlatform?: string | null; containerWorkingDir?: string | null; containerRestartPolicy?: { Name: string; MaximumRetryCount?: number; } | null; containerVolumes?: Record | null; containerPorts?: Record | null; } /** Base class for Docker apps. Port of agno's DockerApp. */ declare class DockerApp extends InfraApp { infraDirContainerPath: string; mountInfraDir: boolean; createVolume: boolean; volumeDir: string | null; volumeName: string | null; volumeContainerPath: string; mountResources: boolean; resourcesDir: string; resourcesDirContainerPath: string; mountConfig: boolean; containerName: string | null; containerLabels: Record | null; containerDetach: boolean; containerAutoRemove: boolean; containerRemove: boolean; containerUser: string | number | null; containerStdinOpen: boolean; containerStdout: boolean | null; containerStderr: boolean | null; containerTty: boolean; containerHealthcheck: Record | null; containerHostname: string | null; containerPlatform: string | null; containerWorkingDir: string | null; containerRestartPolicy: { Name: string; MaximumRetryCount?: number; } | null; containerVolumes: Record | null; containerPorts: Record | null; constructor(opts: DockerAppOptions); getContainerName(): string; getContainerContext(): ContainerContext; getContainerEnv(containerContext: ContainerContext): Record; getContainerVolumes(containerContext: ContainerContext): Record; getContainerPorts(): Record; getContainerCommand(): string[] | null; buildResources(buildContext: DockerBuildContext): InfraResource[]; getInfraResources(): DockerResources; } interface DockerResourcesOptions extends InfraResourcesOptions { env?: string; infra?: string; network?: string; baseUrl?: string | null; apps?: DockerApp[] | null; resources?: DockerResource[] | null; } /** A group of Docker resources/apps managed together. Port of DockerResources. */ declare class DockerResources extends InfraResources { env: string; infra: string; network: string; baseUrl: string | null; apps: DockerApp[] | null; resources: DockerResource[] | null; private _apiClient; constructor(opts?: DockerResourcesOptions); get dockerClient(): DockerApiClient; private buildContext; /** Collect the resources to act on from `resources` + `apps` (shared by all ops). */ private collectResources; private dedupe; /** Order deps before the resource (create/update). */ private depsBefore; /** Order resource before its (reversed) deps (delete). */ private depsAfterReversed; private printList; createResources(opts?: CreateResourcesOptions): Promise; deleteResources(opts?: Omit): Promise; updateResources(opts?: CreateResourcesOptions): Promise; } interface DockerNetworkOptions extends DockerResourceOptions { driver?: string | null; options?: Record | null; internal?: boolean | null; labels?: Record | null; enableIpv6?: boolean | null; attachable?: boolean | null; scope?: string | null; ingress?: boolean | null; } /** A Docker network. Port of agno's DockerNetwork (not deleted/updated by default). */ declare class DockerNetwork extends DockerResource { driver: string | null; options: Record | null; internal: boolean | null; labels: Record | null; enableIpv6: boolean | null; attachable: boolean | null; scope: string | null; ingress: boolean | null; constructor(opts: DockerNetworkOptions); protected _create(client: DockerApiClient): Promise; protected _read(client: DockerApiClient): Promise; protected _delete(client: DockerApiClient): Promise; } interface DockerVolumeOptions extends DockerResourceOptions { driver?: string | null; driverOpts?: Record | null; labels?: Record | null; } /** A Docker volume. Port of agno's DockerVolume. */ declare class DockerVolume extends DockerResource { driver: string | null; driverOpts: Record | null; labels: Record | null; constructor(opts: DockerVolumeOptions); protected _create(client: DockerApiClient): Promise; protected _read(client: DockerApiClient): Promise; protected _delete(client: DockerApiClient): Promise; } type EnvInput = Record | string[]; type PortsInput = Record; type VolumesInput = Record | string[]; interface DockerContainerOptions extends DockerResourceOptions { name: string; image?: string | null; command?: string | string[] | null; entrypoint?: string | string[] | null; autoRemove?: boolean; detach?: boolean; remove?: boolean | null; restartPolicy?: { Name: string; MaximumRetryCount?: number; } | null; environment?: EnvInput | null; healthcheck?: Record | null; hostname?: string | null; labels?: Record | null; network?: string | null; networkMode?: string | null; platform?: string | null; ports?: PortsInput | null; stdinOpen?: boolean | null; stdout?: boolean | null; stderr?: boolean | null; tty?: boolean | null; volumes?: VolumesInput | null; workingDir?: string | null; user?: string | number | null; devices?: string[] | null; } /** A Docker container. Port of agno's DockerContainer. */ declare class DockerContainer extends DockerResource { image: string | null; command: string | string[] | null; entrypoint: string | string[] | null; autoRemove: boolean; detach: boolean; remove: boolean | null; restartPolicy: { Name: string; MaximumRetryCount?: number; } | null; environment: EnvInput | null; healthcheck: Record | null; hostname: string | null; labels: Record | null; network: string | null; networkMode: string | null; platform: string | null; ports: PortsInput | null; stdinOpen: boolean | null; stdout: boolean | null; stderr: boolean | null; tty: boolean | null; volumes: VolumesInput | null; workingDir: string | null; user: string | number | null; devices: string[] | null; containerStatus: string | null; constructor(opts: DockerContainerOptions); private buildCreateOptions; private pullImage; private runContainer; protected _read(client: DockerApiClient): Promise; protected _create(client: DockerApiClient): Promise; protected _update(client: DockerApiClient): Promise; protected _delete(client: DockerApiClient): Promise; isActive(client: DockerApiClient): Promise; create(dockerClient?: DockerApiClient): Promise; } /** * A resource filter in the form `ENV:INFRA:GROUP:NAME:TYPE`. Any empty segment * (or omitted trailing segment) becomes `null`. Direct port of agno's * `parse_resource_filter`. */ interface ParsedResourceFilter { env: string | null; infra: string | null; group: string | null; name: string | null; type: string | null; } declare function parseResourceFilter(resourceFilter: string): ParsedResourceFilter; export { type ContainerContext, type CreateResourcesOptions, DockerApiClient, DockerApp, type DockerAppOptions, type DockerBuildContext, DockerContainer, type DockerContainerOptions, DockerImage, type DockerImageOptions, DockerNetwork, type DockerNetworkOptions, DockerResource, type DockerResourceOptions, DockerResources, type DockerResourcesOptions, DockerVolume, type DockerVolumeOptions, INFRA_STARTER_TEMPLATES, InfraApp, type InfraAppOptions, InfraBase, type InfraBaseOptions, InfraResource, type InfraResourceOptions, InfraResources, type InfraResourcesOptions, InfraSettings, type InfraSettingsOptions, InfraStarterTemplate, type ParsedResourceFilter, type ResourceCount, isInfraApp, isInfraResource, isInfraResources, isInfraSettings, isInfraStarterTemplate, parseResourceFilter };