Skip to content
Français

LifecycleCommand

import type { LifecycleCommand } from "@elie-laloum/outpost/core";
  • whenOptional
    ChangedCondition | undefined
    Optional condition from changed(); without it the command runs only during initial preparation. Records the pre-command fingerprint after success and checks it before each subsequent sandbox command, dispatch or attachment. workspaceReady remains a single opening phase.
  • executableRequired
    string
    Program run for this preparation hook without implicit shell parsing.
  • argumentsOptional
    readonly string[] | undefined
    Literal arguments of the preparation command; use an explicit shell for pipelines or dependent steps.
  • stdinOptional
    string | undefined
    Initial text sent to the hook standard input before an optional input stream.
  • inputOptional
    Readable | undefined
    Live input stream for the hook, after stdin; not used by the file fingerprint probe.
  • directoryOptional
    string | undefined
    Working directory and base for watched paths: defaults to the host worktree for workspaceReady/hostReady and sandbox.root for sandboxReady.
  • variablesOptional
    Readonly<Record<string, string>> | undefined
    Per-hook environment variables, applied both to the fingerprint probe and the preparation command over the execution environment variables.
  • signalOptional
    AbortSignal | undefined
    Optional hook cancellation signal combined with the lifecycle operation signal. A cancelled warm hook does not save its fingerprint and leaves the sandbox open.
  • deadlineMsOptional
    number | undefined
    Deadline for the fingerprint probe and separately for the hook command, default 600000 ms each. A timeout prevents the requested operation and leaves a warm sandbox available for retry.
  • interactiveOptional
    boolean | undefined
    Run the hook using the execution environment terminal support; the fingerprint probe always runs without a terminal.
  • terminalOptional
    { readonly input?: Readable; readonly output?: Writable; readonly error?: Writable; } | undefined
    Terminal streams connected to the preparation command; the fingerprint probe does not use them.
  • elevatedOptional
    boolean | undefined
    Request elevated execution for both the fingerprint probe and command, subject to the provider capabilities; host execution ignores this option.
  • retainOptional
    number | undefined
    Retained trailing output for the hook command; the fingerprint probe uses its own bounded output.
  • observeOptional
    ((channel: Channel, text: string) => void) | undefined
    Receives preparation-command output chunks, excluding fingerprint-probe output. An exception fails preparation and prevents saving the fingerprint.
export interface LifecycleCommand extends Command {
  readonly when?: ChangedCondition;
}