Skip to content
1 min read · 99 words

Type Alias: SandboxOutcome

ts
type SandboxOutcome =
  | {
      kind: "not-found";
      path: string;
    }
  | {
      axis: "read" | "write";
      kind: "denied-by-policy";
      path: string;
    }
  | {
      kind: "gate-declined";
      note?: string;
    }
  | {
      kind: "gate-unavailable";
      reason: "timeout" | "error";
    }
  | {
      bound: "maxTerminalPayloadBytes";
      kind: "over-budget";
      limit: number;
      observedAtLeast: number;
    }
  | {
      atDepth: number;
      bound: "maxDepth";
      kind: "scope-limited";
      shown: number;
    }
  | {
      kind: "not-a-regular-file";
      kind_: string;
      path: string;
    }
  | {
      kind: "is-a-directory";
      path: string;
    }
  | {
      input: string;
      kind: "path-rejected";
      reason: "escape" | "absolute-host" | "home" | "unc" | "device" | "nul";
    }
  | {
      kind: "outside-write-root";
      path: ModelPath;
      writeRoot: ModelWriteRoot;
    }
  | {
      exitCode: number;
      kind: "sandbox-violation";
      violations: readonly string[];
    }
  | {
      exitCode: number;
      kind: "nonzero-exit";
    }
  | {
      kind: "no-matches";
      pattern: string;
      scope: string;
    }
  | {
      kind: "unknown-media";
      mediaId: string;
    }
  | {
      detail: string;
      kind: "invalid-pattern";
      pattern: string;
    }
  | {
      kind: "not-a-directory";
      path: string;
    }
  | {
      detail: string;
      kind: "io-failure";
      path?: string;
    }
  | {
      kind: "aborted";
    }
  | {
      bound: "timeout_seconds";
      kind: "timed-out";
      limitSeconds: number;
    };

Defined in: src/batteries/sandbox/narrator.ts:4

Exhaustive model-facing sandbox outcome.

Union Members

Type Literal

ts
{
  kind: "not-found";
  path: string;
}

Type Literal

ts
{
  axis: "read" | "write";
  kind: "denied-by-policy";
  path: string;
}

Type Literal

ts
{
  kind: "gate-declined";
  note?: string;
}

Type Literal

ts
{
  kind: "gate-unavailable";
  reason: "timeout" | "error";
}

Type Literal

ts
{
  bound: "maxTerminalPayloadBytes";
  kind: "over-budget";
  limit: number;
  observedAtLeast: number;
}

Type Literal

ts
{
  atDepth: number;
  bound: "maxDepth";
  kind: "scope-limited";
  shown: number;
}

Type Literal

ts
{
  kind: "not-a-regular-file";
  kind_: string;
  path: string;
}

Type Literal

ts
{
  kind: "is-a-directory";
  path: string;
}

Type Literal

ts
{
  input: string;
  kind: "path-rejected";
  reason: "escape" | "absolute-host" | "home" | "unc" | "device" | "nul";
}

Type Literal

ts
{
  kind: "outside-write-root";
  path: ModelPath;
  writeRoot: ModelWriteRoot;
}

Model-facing root, conventionally /; NEVER the configured absolute host path.


Type Literal

ts
{
  exitCode: number;
  kind: "sandbox-violation";
  violations: readonly string[];
}

Type Literal

ts
{
  exitCode: number;
  kind: "nonzero-exit";
}

Type Literal

ts
{
  kind: "no-matches";
  pattern: string;
  scope: string;
}

Type Literal

ts
{
  kind: "unknown-media";
  mediaId: string;
}

Type Literal

ts
{
  detail: string;
  kind: "invalid-pattern";
  pattern: string;
}

Type Literal

ts
{
  kind: "not-a-directory";
  path: string;
}

Type Literal

ts
{
  detail: string;
  kind: "io-failure";
  path?: string;
}

Type Literal

ts
{
  kind: "aborted";
}

Type Literal

ts
{
  bound: "timeout_seconds";
  kind: "timed-out";
  limitSeconds: number;
}