import type { Writable } from "node:stream"; export type Step = { readonly kind: "built_in"; readonly name: string; } | { readonly kind: "command"; readonly command: string; }; export interface StepContext { readonly agentHandle: string; readonly agentDir: string; readonly mcpEndpoint: string; /** Resolved plaintext token. Steps like `claude mcp add` embed it. */ readonly token: string; } export interface StepOpts { /** Where to send the step subprocess's stdout. Defaults to inherit. */ readonly stdout?: Writable; /** Where to send the step subprocess's stderr. Defaults to inherit. */ readonly stderr?: Writable; /** Kill after this many seconds. Defaults to 60. */ readonly timeoutSeconds?: number; } export type StepResult = { readonly ok: true; } | { readonly ok: false; readonly error: string; }; type BuiltInImpl = (ctx: StepContext) => Promise; /** * Registry of built-in steps. Add a new entry here to ship a new built-in; * users opt in by name in their config. Built-ins are globally available * across lifecycle points — naming conventions (e.g. `…-mcp-config` reads * as "writes a config") signal which phase a given built-in belongs in. */ export declare const BUILT_INS: Readonly>; export declare function runStep(step: Step, ctx: StepContext, opts?: StepOpts): Promise; /** * Run a list of steps sequentially. Continues after failures (so a Claude * step failing doesn't prevent a Codex step from running). Returns results * in the same order as input. The optional `onResult` callback fires after * each step completes — useful for live progress reporting. */ export declare function runSteps(steps: readonly Step[], ctx: StepContext, opts?: StepOpts & { readonly onResult?: (step: Step, result: StepResult) => void; }): Promise; /** * Resolve the effective `after_add` step list for an agent. The agent's * field, if present, fully replaces the daemon's defaults — same shape as * `wake_command`. An explicit empty list on the agent ([]) overrides to no * steps; an absent field inherits the daemon defaults. The same resolution * rule will apply to future lifecycle points (after_remove, etc.). */ export declare function effectiveAfterAdd(agentSteps: readonly Step[] | undefined, daemonSteps: readonly Step[]): readonly Step[]; export {}; //# sourceMappingURL=steps.d.ts.map