import * as T from '../../../base/lib/types'; import { SubContainer } from '../util/SubContainer'; import { Drop } from '../util'; import { DaemonCommandType } from './Daemons'; /** * Low-level controller for a single running process inside a subcontainer (or as a JS function). * * Manages the child process lifecycle: spawning, waiting, and signal-based termination. * Used internally by {@link Daemon} to manage individual command executions. * * @typeParam Manifest - The service manifest type * @typeParam C - The subcontainer type, or `null` for JS-only commands */ export declare class CommandController | null> extends Drop { readonly runningAnswer: Promise; private state; private readonly subcontainer; private process; readonly sigtermTimeout: number; private constructor(); /** * Factory method to create a new CommandController. * * Returns a curried async function: `(effects, subcontainer, exec) => CommandController`. * If the exec spec has an `fn` property, runs the function; otherwise spawns a shell command * in the subcontainer. */ static of | null>(): (effects: T.Effects, subcontainer: C, exec: DaemonCommandType) => Promise>; /** * Wait for the command to finish. Optionally terminate after a timeout. * @param options.timeout - Milliseconds to wait before terminating. Defaults to no timeout. */ wait({ timeout }?: { timeout?: number | undefined; }): Promise; /** * Terminate the running command by sending a signal. * * Sends the specified signal (default: SIGTERM), then escalates to SIGKILL * after the timeout expires. Destroys the subcontainer after the process exits. * * @param options.signal - The signal to send (default: SIGTERM) * @param options.timeout - Milliseconds before escalating to SIGKILL */ term({ signal, timeout }?: { signal?: NodeJS.Signals | undefined; timeout?: number | undefined; }): Promise; onDrop(): void; }