import { Services } from "@distilled.cloud/hetzner";
import * as Effect from "effect/Effect";
import type * as rolldown from "rolldown";
import * as Bundle from "../Bundle/Bundle.ts";
import type { ResourceBinding } from "../Resource.ts";
import { createHostRuntimeContext, type HostRuntimeContext } from "../Server/Process.ts";
import type { ServiceBinding } from "./MountVolume.ts";
import { type SshClient } from "./Ssh.ts";
export type HetznerHostRuntimeContext = HostRuntimeContext;
declare const VolumeAttachTimeout_base: new = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
readonly _tag: "Hetzner.VolumeAttachTimeout";
} & Readonly;
declare class VolumeAttachTimeout extends VolumeAttachTimeout_base<{
volumeId: number;
serverId: number;
}> {
}
export declare const createHetznerHostRuntimeContext: typeof createHostRuntimeContext;
export interface HostedProgramProps {
main: string;
handler?: string;
port?: number;
env?: Record;
isExternal?: boolean;
build?: Bundle.BundleConfig;
}
export declare const renderEnvFile: (env: Record) => string;
export declare const collectBindingState: (bindings: ResourceBinding[]) => {
env: Record;
volumes: {
volumeId: number;
path: string;
}[];
};
export declare const createHetznerHostedSupport: ({ stackName, stage, virtualEntryPlugin, }: {
stackName: string;
stage: string;
virtualEntryPlugin: (content: (importPath: string) => string) => rolldown.Plugin;
}) => {
alchemyEnv: {
ALCHEMY_STACK_NAME: string;
ALCHEMY_STAGE: string;
ALCHEMY_PHASE: string;
};
bundleProgram: (_id: string, props: HostedProgramProps) => Effect.Effect<{
archive: Buffer;
hash: string;
}, Bundle.BundleError | import("effect/PlatformError").PlatformError, import("effect/FileSystem").FileSystem | import("effect/Path").Path>;
attachAndMount: (input: {
ssh: SshClient;
serverId: number;
volumes: Array<{
volumeId: number;
path: string;
}>;
}) => Effect.Effect;
deployUnit: (input: {
ssh: SshClient;
unitName: string;
archive: Uint8Array;
env: Record;
}) => Effect.Effect;
removeUnit: (input: {
ssh: SshClient;
unitName: string;
}) => Effect.Effect;
waitForSsh: (ssh: SshClient) => Effect.Effect;
openSshClient: (input: {
host: string;
privateKey: string;
user?: string;
}) => Effect.Effect<{
exec: (command: string) => Effect.Effect<{
code: number;
stdout: string;
stderr: string;
}, import("./Ssh.ts").SshError, import("effect/unstable/process/ChildProcessSpawner").ChildProcessSpawner | import("effect/Scope").Scope>;
scp: (local: string | Uint8Array, remote: string) => Effect.Effect;
close: Effect.Effect;
}, import("effect/PlatformError").PlatformError, import("effect/unstable/process/ChildProcessSpawner").ChildProcessSpawner | import("effect/FileSystem").FileSystem | import("effect/Path").Path | import("effect/Scope").Scope>;
};
export {};
//# sourceMappingURL=hosted.d.ts.map