> ## Documentation Index
> Fetch the complete documentation index at: https://smithers-feat-claude-workflow-mirror.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# <ApprovalGate>

> Conditional approval; pauses for human when `when` is true, else auto-approves.

```ts theme={null}
import { ApprovalGate } from "smithers-orchestrator";

type ApprovalGateProps = {
  id: string;
  output: OutputTarget; // z.ZodObject<z.ZodRawShape> | { $inferSelect: Record<string, unknown> } | string
  request: { title: string; summary?: string; metadata?: Record<string, unknown> };
  when: boolean; // true => require human; false => auto-approve immediately
  onDeny?: "fail" | "continue" | "skip"; // if omitted, denial fails the task
  skipIf?: boolean;
  timeoutMs?: number;
  heartbeatTimeoutMs?: number;
  heartbeatTimeout?: number;
  retries?: number;
  retryPolicy?: { backoff?: "fixed" | "linear" | "exponential"; initialDelayMs?: number };
  continueOnFail?: boolean;
};
```

```tsx theme={null}
const risk = ctx.output(outputs.riskScore, { nodeId: "risk" });

<Workflow name="deploy-pipeline">
  <Sequence>
    <Task id="risk" output={outputs.riskScore} agent={riskAgent}>
      Assess deploy risk.
    </Task>
    <ApprovalGate
      id="deploy-approval"
      output={outputs.deployDecision}
      when={risk.level === "high"}
      request={{
        title: "Approve high-risk deploy?",
        summary: `Risk score: ${risk.score}/100`,
      }}
      onDeny="fail"
    />
    <Task id="deploy" output={outputs.deploy}>
      {{ deployed: true }}
    </Task>
  </Sequence>
</Workflow>
```

## Notes

* Auto-approve emits a valid `ApprovalDecision` (`{ approved: true, note: "auto-approved", ... }`); downstream branching stays uniform.
* `onDeny` applies only to the human path; auto-approve always succeeds.

## Source

The `<ApprovalGate>` implementation and the files it imports, straight from the package source. This section is generated; edit the source, not this block.

<CodeGroup>
  ```js ApprovalGate.js theme={null}
  // @smithers-type-exports-begin
  /** @typedef {import("./ApprovalGateProps.ts").ApprovalGateProps} ApprovalGateProps */
  // @smithers-type-exports-end

  import React from "react";
  import { Branch } from "./Branch.js";
  import { Approval } from "./Approval.js";
  import { Task } from "./Task.js";
  /**
   * Conditional approval gate. Requires human approval only when `when` is true;
   * otherwise auto-approves with a static `{ approved: true }` decision.
   *
   * Composes Branch + Approval + Task internally.
   * @param {ApprovalGateProps} props
   */
  export function ApprovalGate(props) {
      if (props.skipIf)
          return null;
      return React.createElement(Branch, {
          if: props.when,
          then: React.createElement(Approval, {
              id: props.id,
              output: props.output,
              request: props.request,
              onDeny: props.onDeny,
              timeoutMs: props.timeoutMs,
              heartbeatTimeoutMs: props.heartbeatTimeoutMs,
              heartbeatTimeout: props.heartbeatTimeout,
              retries: props.retries,
              retryPolicy: props.retryPolicy,
              continueOnFail: props.continueOnFail,
          }),
          else: React.createElement(Task, {
              id: props.id,
              output: props.output,
              label: `${props.request.title} (auto-approved)`,
              children: {
                  approved: true,
                  note: "auto-approved",
                  decidedBy: null,
                  decidedAt: null,
              },
          }),
      });
  }
  ```

  ```js Branch.js theme={null}
  import React from "react";
  import { SmithersError } from "@smithers-orchestrator/errors/SmithersError";
  /** @typedef {import("./BranchProps.ts").BranchProps} BranchProps */

  /**
   * @param {BranchProps} props
   */
  export function Branch(props) {
      // <Branch> resolves its subtree from the `then`/`else` props; any JSX children
      // would be silently dropped, removing those tasks from the graph with no
      // feedback. Fail fast instead. (Checked before skipIf so a stray-children
      // mistake still surfaces even on a skipped branch.)
      if (props.children !== undefined && props.children !== null) {
          throw new SmithersError("INVALID_INPUT", `<Branch> does not take children. Use the "then" and "else" props instead, e.g. ` +
              `<Branch if={cond} then={<Task .../>} else={<Task .../>} />. ` +
              `Children passed to <Branch> are silently ignored and would drop those tasks from the graph.`);
      }
      if (props.skipIf)
          return null;
      const chosen = props.if ? props.then : (props.else ?? null);
      // The branch is resolved to `chosen` at render time, so the host element
      // carries no props of its own (align with the sanitizing structural components).
      return React.createElement("smithers:branch", {}, chosen);
  }
  ```

  ```js Approval.js theme={null}
  // @smithers-type-exports-begin
  /** @typedef {import("./ApprovalDecision.ts").ApprovalDecision} ApprovalDecision */
  /** @typedef {import("./ApprovalRanking.ts").ApprovalRanking} ApprovalRanking */
  /** @typedef {import("./ApprovalRequest.ts").ApprovalRequest} ApprovalRequest */
  /** @typedef {import("./ApprovalSelection.ts").ApprovalSelection} ApprovalSelection */
  // @smithers-type-exports-end

  import React from "react";
  import { z } from "zod";
  import { SmithersContext } from "@smithers-orchestrator/react-reconciler/context";
  import { getTaskRuntime } from "@smithers-orchestrator/driver/task-runtime";
  import { SmithersDb } from "@smithers-orchestrator/db/adapter";
  import { SmithersError } from "@smithers-orchestrator/errors/SmithersError";
  /** @typedef {import("./ApprovalAutoApprove.ts").ApprovalAutoApprove} ApprovalAutoApprove */
  /** @typedef {import("./ApprovalMode.ts").ApprovalMode} ApprovalMode */
  /** @typedef {import("./ApprovalOption.ts").ApprovalOption} ApprovalOption */
  /**
   * @template Row, Output
   * @typedef {import("./ApprovalProps.ts").ApprovalProps<Row, Output>} ApprovalProps
   */

  export const approvalDecisionSchema = z.object({
      approved: z.boolean(),
      // `note` is omitted entirely when no note was provided, so the default
      // decision schema must accept an absent key (optional) as well as the
      // legacy null/string shapes.
      note: z.string().nullable().optional(),
      decidedBy: z.string().nullable(),
      decidedAt: z.string().datetime().nullable(),
  });
  export const approvalSelectionSchema = z.object({
      selected: z.string(),
      notes: z.string().nullable(),
  });
  export const approvalRankingSchema = z.object({
      ranked: z.array(z.string()),
      notes: z.string().nullable(),
  });
  /**
   * @param {unknown} value
   * @returns {value is import("zod").ZodObject<import("zod").ZodRawShape>}
   */
  function isZodObject(value) {
      return Boolean(value && typeof value === "object" && "shape" in value);
  }
  /**
   * @template T
   * @param {unknown} value
   * @returns {T | null}
   */
  function parseJson(value) {
      if (typeof value !== "string" || value.length === 0) {
          return null;
      }
      try {
          return JSON.parse(value);
      }
      catch {
          return null;
      }
  }
  /**
   * @param {ApprovalMode} mode
   * @returns {import("zod").ZodObject<import("zod").ZodRawShape>}
   */
  function defaultSchemaForMode(mode) {
      switch (mode) {
          case "select":
              return approvalSelectionSchema;
          case "rank":
              return approvalRankingSchema;
          default:
              return approvalDecisionSchema;
      }
  }
  /**
   * @param {{ status?: string | null; note?: string | null; decidedBy?: string | null; decidedAtMs?: number | null } | undefined | null} approval
   * @param {import("zod").ZodObject<import("zod").ZodRawShape>} outputSchema
   * @returns {Record<string, unknown>}
   */
  function buildDecisionPayload(approval, outputSchema) {
      const base = {
          approved: approval?.status === "approved",
          decidedBy: approval?.decidedBy ?? null,
          decidedAt: approval?.decidedAtMs != null ? new Date(approval.decidedAtMs).toISOString() : null,
      };
      if (typeof approval?.note === "string") {
          return { ...base, note: approval.note };
      }
      if (outputSchema.safeParse(base).success) {
          return base;
      }
      return { ...base, note: null };
  }
  /**
   * @param {ApprovalMode | undefined} mode
   * @returns {"select" | "rank" | "decision"}
   */
  function normalizeMode(mode) {
      switch (mode) {
          case "select":
              return "select";
          case "rank":
              return "rank";
          default:
              return "decision";
      }
  }
  /**
   * @param {ApprovalOption[] | undefined} options
   * @returns {ApprovalOption[] | undefined}
   */
  function normalizeOptions(options) {
      return options?.map((option) => ({
          key: option.key,
          label: option.label,
          ...(option.summary ? { summary: option.summary } : {}),
          ...(option.metadata ? { metadata: option.metadata } : {}),
      }));
  }
  /**
   * @param {ApprovalAutoApprove[keyof ApprovalAutoApprove]} callback
   * @param {import("@smithers-orchestrator/driver").SmithersCtx<unknown> | null} ctx
   * @returns {boolean | undefined}
   */
  function evaluateBooleanCallback(callback, ctx) {
      if (typeof callback !== "function") {
          return undefined;
      }
      return Boolean(/** @type {(ctx: import("@smithers-orchestrator/driver").SmithersCtx<unknown> | null) => boolean} */ (callback)(ctx));
  }
  /**
   * @template Row
   * @param {ApprovalProps<Row>} props
   * @returns {React.ReactElement | null}
   */
  export function Approval(props) {
      if (props.skipIf)
          return null;
      const smithersContext = props.smithersContext ?? SmithersContext;
      const ctx = React.useContext(smithersContext);
      const mode = props.mode ?? "approve";
      const approvalMode = normalizeMode(mode);
      const options = normalizeOptions(props.options);
      const outputSchema = props.outputSchema ??
          (isZodObject(props.output) ? props.output : defaultSchemaForMode(mode));
      if ((mode === "select" || mode === "rank") && (!options || options.length === 0)) {
          throw new SmithersError("APPROVAL_OPTIONS_REQUIRED", `Approval ${props.id} requires options when mode="${mode}".`);
      }
      const conditionMet = props.autoApprove
          ? evaluateBooleanCallback(props.autoApprove.condition, ctx)
          : undefined;
      const revertOnMet = props.autoApprove
          ? evaluateBooleanCallback(props.autoApprove.revertOn, ctx)
          : undefined;
      const autoApprove = props.autoApprove
          ? {
              ...(typeof props.autoApprove.after === "number" ? { after: props.autoApprove.after } : {}),
              audit: props.autoApprove.audit !== false,
              ...(conditionMet !== undefined ? { conditionMet } : {}),
              ...(revertOnMet !== undefined ? { revertOnMet } : {}),
          }
          : undefined;
      const requestMeta = {
          ...(props.request.summary ? { requestSummary: props.request.summary } : {}),
          ...(options ? { approvalOptions: options } : {}),
          ...(props.allowedScopes?.length ? { approvalAllowedScopes: props.allowedScopes } : {}),
          ...(props.allowedUsers?.length ? { approvalAllowedUsers: props.allowedUsers } : {}),
          ...(autoApprove ? { approvalAutoApprove: autoApprove } : {}),
          ...props.request.metadata,
          ...props.meta,
      };
      /**
     * @returns {Promise<Row>}
     */
      const computeDecision = async () => {
          const runtime = getTaskRuntime();
          if (!runtime) {
              throw new SmithersError("APPROVAL_OUTSIDE_TASK", "Approval decisions can only be resolved while a Smithers task is executing.");
          }
          const adapter = new SmithersDb(runtime.db);
          const approval = await adapter.getApproval(runtime.runId, props.id, runtime.iteration);
          const decision = parseJson(approval?.decisionJson);
          if (approvalMode === "select") {
              return {
                  selected: typeof decision?.selected === "string" ? decision.selected : "",
                  notes: typeof decision?.notes === "string"
                      ? decision.notes
                      : approval?.note ?? null,
              };
          }
          if (approvalMode === "rank") {
              return {
                  ranked: Array.isArray(decision?.ranked)
                      ? decision.ranked.filter((value) => typeof value === "string")
                      : [],
                  notes: typeof decision?.notes === "string"
                      ? decision.notes
                      : approval?.note ?? null,
              };
          }
          return buildDecisionPayload(approval, outputSchema);
      };
      return React.createElement("smithers:task", {
          id: props.id,
          key: props.key,
          output: props.output,
          outputSchema,
          dependsOn: props.dependsOn,
          needs: props.needs,
          needsApproval: true,
          waitAsync: props.async === true,
          approvalMode,
          approvalOnDeny: props.onDeny,
          approvalOptions: options,
          approvalAllowedScopes: props.allowedScopes,
          approvalAllowedUsers: props.allowedUsers,
          approvalAutoApprove: autoApprove,
          timeoutMs: props.timeoutMs,
          heartbeatTimeoutMs: props.heartbeatTimeoutMs,
          heartbeatTimeout: props.heartbeatTimeout,
          retries: props.retries,
          retryPolicy: props.retryPolicy,
          continueOnFail: props.continueOnFail,
          cache: props.cache,
          label: props.label ?? props.request.title,
          meta: Object.keys(requestMeta).length > 0 ? requestMeta : undefined,
          __smithersKind: "compute",
          __smithersComputeFn: computeDecision,
      });
  }
  ```

  ```js Task.js theme={null}
  // @smithers-type-exports-begin
  /**
   * @template D
   * @typedef {import("./InferDeps.ts").InferDeps<D>} InferDeps
   */
  /** @typedef {import("./OutputTarget.ts").OutputTarget} OutputTarget */
  // @smithers-type-exports-end

  import React from "react";
  import { renderToStaticMarkup } from "react-dom/server";
  import { markdownComponents } from "../markdownComponents.js";
  import { zodSchemaToJsonExample } from "../zod-to-example.js";
  import { SmithersError } from "@smithers-orchestrator/errors/SmithersError";
  import { SmithersContext } from "@smithers-orchestrator/react-reconciler/context";
  import { AspectContext } from "../aspects/AspectContext.js";
  import { AntigravityAgent } from "@smithers-orchestrator/agents/AntigravityAgent";
  import { ClaudeCodeAgent } from "@smithers-orchestrator/agents/ClaudeCodeAgent";
  import { GeminiAgent } from "@smithers-orchestrator/agents/GeminiAgent";
  import { PiAgent } from "@smithers-orchestrator/agents/PiAgent";
  /** @typedef {import("@smithers-orchestrator/agents/AgentLike").AgentLike} AgentLike */
  /** @typedef {import("./DepsSpec.ts").DepsSpec} DepsSpec */
  /**
   * @template Row, Output, D
   * @typedef {import("./TaskProps.ts").TaskProps<Row, Output, D>} TaskProps
   */

  /**
   * Render a prompt React node to plain markdown text.
   *
   * If the prompt is a React element (e.g. a compiled MDX component), we inject
   * `markdownComponents` via the standard MDX `components` prop so that
   * renderToStaticMarkup outputs clean markdown instead of HTML.
   * No HTML tag stripping or entity decoding needed.
   * @param {unknown} prompt
   * @returns {string}
   */
  export function renderPromptToText(prompt) {
      if (prompt == null)
          return "";
      if (typeof prompt === "string")
          return prompt;
      if (typeof prompt === "number")
          return String(prompt);
      try {
          let element;
          if (React.isValidElement(prompt)) {
              // Inject markdown components into the element so MDX components
              // render fragments instead of HTML tags.
              element = React.cloneElement(prompt, {
                  components: markdownComponents,
              });
          }
          else {
              element = React.createElement(React.Fragment, null, prompt);
          }
          return renderToStaticMarkup(element)
              .replace(/\n{3,}/g, "\n\n")
              .trim();
      }
      catch (err) {
          const result = String(prompt ?? "");
          if (result === "[object Object]") {
              throw new SmithersError("MDX_PRELOAD_INACTIVE", `MDX prompt could not be rendered — the prompt resolved to [object Object] instead of a React component.\n\n` +
                  `This usually means the MDX preload is not active. Common causes:\n` +
                  `  • bunfig.toml uses [run] preload instead of top-level preload (the [run] section doesn't apply to dynamic imports)\n` +
                  `  • bunfig.toml is not in the current working directory\n` +
                  `  • mdxPlugin() is not registered in the preload script\n` +
                  `  • The MDX file is imported without a default import (use: import MyPrompt from "./prompt.mdx")\n\n` +
                  `Original error: ${err instanceof Error ? err.message : String(err)}`);
          }
          return result;
      }
  }
  /**
   * @param {unknown} value
   * @returns {value is import("zod").ZodObject<import("zod").ZodRawShape>}
   */
  function isZodObject(value) {
      return Boolean(value && typeof value === "object" && "shape" in value);
  }
  /**
   * @param {DepsSpec | undefined} deps
   * @param {Record<string, string> | undefined} needs
   * @returns {string[] | undefined}
   */
  function deriveDepNodeIds(deps, needs) {
      if (!deps)
          return undefined;
      const ids = new Set();
      for (const key of Object.keys(deps)) {
          const nodeId = needs?.[key] ?? key;
          if (nodeId)
              ids.add(nodeId);
      }
      return ids.size > 0 ? [...ids] : undefined;
  }
  /**
   * @param {string[] | undefined} dependsOn
   * @param {string[] | undefined} depNodeIds
   * @returns {string[] | undefined}
   */
  function mergeDependsOn(dependsOn, depNodeIds) {
      const merged = new Set();
      for (const id of dependsOn ?? [])
          merged.add(id);
      for (const id of depNodeIds ?? [])
          merged.add(id);
      return merged.size > 0 ? [...merged] : undefined;
  }
  /**
   * @param {any} ctx
   * @param {DepsSpec | undefined} deps
   * @param {Record<string, string> | undefined} needs
   * @returns {Record<string, unknown> | null}
   */
  function resolveDeps(ctx, deps, needs) {
      if (!deps)
          return Object.create(null);
      const keys = Object.keys(deps);
      if (keys.length === 0)
          return Object.create(null);
      const resolved = Object.create(null);
      for (const key of keys) {
          const target = deps[key];
          const nodeId = needs?.[key] ?? key;
          const value = ctx.outputMaybe(target, { nodeId });
          if (value === undefined)
              return null;
          resolved[key] = value;
      }
      return resolved;
  }
  /**
   * @param {AgentLike} agent
   * @param {string[] | undefined} allowTools
   * @returns {AgentLike}
   */
  function applyCliToolAllowlist(agent, allowTools) {
      if (!allowTools) {
          return agent;
      }
      if (agent instanceof ClaudeCodeAgent) {
          const opts = { ...agent.opts };
          if (allowTools.length === 0) {
              return new ClaudeCodeAgent({
                  ...opts,
                  allowedTools: [],
                  tools: "",
              });
          }
          return new ClaudeCodeAgent({
              ...opts,
              allowedTools: [...allowTools],
          });
      }
      if (agent instanceof PiAgent) {
          const opts = { ...agent.opts };
          if (allowTools.length === 0) {
              return new PiAgent({
                  ...opts,
                  tools: [],
                  noTools: true,
              });
          }
          return new PiAgent({
              ...opts,
              tools: [...allowTools],
              noTools: false,
          });
      }
      if (agent instanceof GeminiAgent) {
          const opts = { ...agent.opts };
          return new GeminiAgent({
              ...opts,
              allowedTools: [...allowTools],
          });
      }
      if (agent instanceof AntigravityAgent) {
          const opts = { ...agent.opts };
          return new AntigravityAgent({
              ...opts,
              allowedTools: [...allowTools],
          });
      }
      return agent;
  }
  /**
   * @param {unknown} ctx
   * @param {string[] | undefined} allowTools
   * @returns {string[] | undefined}
   */
  function resolveCliToolAllowlist(ctx, allowTools) {
      if (allowTools !== undefined) {
          return allowTools;
      }
      const cliAgentToolsDefault = ctx && typeof ctx === "object"
          ? ctx.__smithersRuntime?.cliAgentToolsDefault
          : undefined;
      return cliAgentToolsDefault === "explicit-only" ? [] : undefined;
  }
  /**
   * @template Row, Output, D
   * @param {TaskProps<Row, Output, D>} props
   * @returns {React.ReactElement | null}
   */
  export function Task(props) {
      const { children, agent, fallbackAgent, deps, ...rest } = props;
      const taskContext = props.smithersContext ?? SmithersContext;
      const ctx = React.useContext(taskContext);
      const aspectCtx = React.useContext(AspectContext);
      const depNodeIds = deriveDepNodeIds(deps, rest.needs);
      if (deps && !ctx) {
          throw new SmithersError("CONTEXT_OUTSIDE_WORKFLOW", "Task deps require a workflow context. Build the workflow with createSmithers().");
      }
      const resolvedDeps = deps ? resolveDeps(ctx, deps, rest.needs) : undefined;
      if (deps && resolvedDeps == null) {
          // Deps not yet available — component defers until upstream tasks complete.
          // This is normal reactive behavior; the task will re-render once deps are
          // ready. Record the deferral so the engine can distinguish a transient wait
          // from a permanent one: a deferral that survives to quiescence means a
          // dependency that can never resolve (e.g. a deps key that maps to a node id
          // no task produces), which would otherwise be a silent skip.
          ctx?.recordDeferredDep?.(props.id, depNodeIds ?? []);
          return null;
      }
      // Build aspect metadata to attach to the task element so the engine can
      // enforce budgets and track metrics at execution time.
      const aspectMeta = aspectCtx ? buildAspectMeta(aspectCtx) : undefined;
      const agentChain = Array.isArray(agent)
          ? fallbackAgent
              ? [...agent, fallbackAgent]
              : agent
          : agent && fallbackAgent
              ? [agent, fallbackAgent]
              : agent;
      const effectiveAllowTools = resolveCliToolAllowlist(ctx, rest.allowTools);
      const restrictedAgentChain = Array.isArray(agentChain)
          ? agentChain.map((entry) => applyCliToolAllowlist(entry, effectiveAllowTools))
          : agentChain
              ? applyCliToolAllowlist(agentChain, effectiveAllowTools)
              : agentChain;
      const nextDependsOn = mergeDependsOn(rest.dependsOn, depNodeIds);
      const childValue = typeof children === "function" && (agent || deps)
          ? children(resolvedDeps ?? Object.create(null))
          : children;
      if (agent) {
          // Auto-inject `schema` prop into React element children when output is a ZodObject
          let childElement = childValue;
          const schemaForInjection = props.outputSchema ??
              (isZodObject(props.output) ? props.output : undefined);
          if (React.isValidElement(childValue) && schemaForInjection) {
              childElement = React.cloneElement(childValue, {
                  schema: zodSchemaToJsonExample(schemaForInjection),
              });
          }
          const prompt = renderPromptToText(childElement);
          return React.createElement("smithers:task", {
              ...rest,
              dependsOn: nextDependsOn,
              waitAsync: rest.async === true,
              agent: restrictedAgentChain,
              __smithersKind: "agent",
              ...aspectMeta,
          }, prompt);
      }
      if (typeof children === "function" && !deps) {
          const nextProps = {
              ...rest,
              dependsOn: nextDependsOn,
              waitAsync: rest.async === true,
              __smithersKind: "compute",
              __smithersComputeFn: children,
              ...aspectMeta,
          };
          return React.createElement("smithers:task", nextProps, null);
      }
      const nextProps = {
          ...rest,
          dependsOn: nextDependsOn,
          waitAsync: rest.async === true,
          __smithersKind: "static",
          __smithersPayload: childValue,
          __payload: childValue,
          ...aspectMeta,
      };
      return React.createElement("smithers:task", nextProps, null);
  }
  /**
   * Build the __aspects metadata object from the current AspectContext.
   * This is attached to the smithers:task element props so the engine can read
   * budgets and tracking config at execution time.
   * @param {{
   *     tokenBudget?: unknown;
   *     latencySlo?: unknown;
   *     tracking?: unknown;
   *     accumulator?: unknown;
   * }} aspectCtx
   * @returns {{ __aspects: Record<string, unknown> }}
   */
  function buildAspectMeta(aspectCtx) {
      return {
          __aspects: {
              tokenBudget: aspectCtx.tokenBudget,
              latencySlo: aspectCtx.latencySlo,
              tracking: aspectCtx.tracking,
              accumulator: aspectCtx.accumulator,
          },
      };
  }
  ```

  ```ts ApprovalGateProps.ts theme={null}
  import type { ApprovalRequest } from "./ApprovalRequest.ts";
  import type { RetryPolicy } from "@smithers-orchestrator/scheduler/RetryPolicy";
  import type { OutputTarget } from "./OutputTarget.ts";

  export type ApprovalGateProps = {
  	id: string;
  	/** Where to persist the approval decision. */
  	output: OutputTarget;
  	/** Human-facing approval request. */
  	request: ApprovalRequest;
  	/** When `true`, approval is required. When `false`, auto-approves. */
  	when: boolean;
  	/** Behavior after denial. */
  	onDeny?: "fail" | "continue" | "skip";
  	skipIf?: boolean;
  	timeoutMs?: number;
  	heartbeatTimeoutMs?: number;
  	heartbeatTimeout?: number;
  	retries?: number;
  	retryPolicy?: RetryPolicy;
  	continueOnFail?: boolean;
  };
  ```
</CodeGroup>
