import { K as PromptImageOrderEntry, a as SourceReplyDeliveryMode } from "./get-reply-options.types-DiZecFJG.js";
import { d as ExecElevatedDefaults, i as PromptMode, l as AgentStreamParams, s as AgentInternalEvent, u as ClientToolDefinition } from "./params-JKzFSM4-.js";
import { t as InputProvenance } from "./input-provenance-DgsxhTbk.js";
import { O as ChannelOutboundTargetMode } from "./types.core-D64QB0gm.js";
//#region src/agents/spawned-context.d.ts
type SpawnedRunMetadata = {
  spawnedBy?: string | null;
  groupId?: string | null;
  groupChannel?: string | null;
  groupSpace?: string | null;
  workspaceDir?: string | null;
};
//#endregion
//#region src/agents/command/types.d.ts
/** Image content block for Claude API multimodal messages. */
type ImageContent = {
  type: "image";
  data: string;
  mimeType: string;
};
type AgentCommandResultMetaOverrides = {
  transport?: "embedded";
  fallbackFrom?: "gateway";
  fallbackReason?: "gateway_timeout";
  fallbackSessionId?: string;
  fallbackSessionKey?: string;
};
type AcpTurnSource = "manual_spawn";
type AgentRunContext = {
  messageChannel?: string;
  accountId?: string;
  groupId?: string | null;
  groupChannel?: string | null;
  groupSpace?: string | null;
  currentChannelId?: string;
  currentThreadTs?: string;
  replyToMode?: "off" | "first" | "all" | "batched";
  hasRepliedRef?: {
    value: boolean;
  };
};
type AgentCommandOpts = {
  message: string; /** User-visible transcript body; defaults to message and excludes runtime-only context. */
  transcriptMessage?: string; /** Optional image attachments for multimodal messages. */
  images?: ImageContent[]; /** Original inline/offloaded attachment order for inbound images. */
  imageOrder?: PromptImageOrderEntry[]; /** Optional client-provided tools (OpenResponses hosted tools). */
  clientTools?: ClientToolDefinition[]; /** Agent id override (must exist in config). */
  agentId?: string; /** Per-run provider override. */
  provider?: string; /** Per-run model override. */
  model?: string;
  to?: string;
  sessionId?: string;
  sessionKey?: string;
  thinking?: string;
  thinkingOnce?: string;
  verbose?: string;
  json?: boolean;
  timeout?: string;
  deliver?: boolean; /** Override delivery target (separate from session routing). */
  replyTo?: string; /** Override delivery channel (separate from session routing). */
  replyChannel?: string; /** Override delivery account id (separate from session routing). */
  replyAccountId?: string; /** Override delivery thread/topic id (separate from session routing). */
  threadId?: string | number; /** Message channel context. */
  messageChannel?: string; /** Tool-policy/output surface context. Defaults to messageChannel. */
  messageProvider?: string; /** Delivery channel. */
  channel?: string; /** Account ID for multi-account channel routing. */
  accountId?: string; /** Context for embedded run routing (channel/account/thread). */
  runContext?: AgentRunContext; /** Internal trusted exec approval follow-up elevated defaults. */
  bashElevated?: ExecElevatedDefaults; /** Trusted sender identity bit for command/channel-action auth; defaults true for local CLI calls. */
  senderIsOwner?: boolean; /** Whether this caller is authorized to use provider/model per-run overrides. */
  allowModelOverride?: boolean; /** Optional runtime tool allow-list; when set, only these tools are exposed for this run. */
  toolsAllow?: string[]; /** Group/spawn metadata for subagent policy inheritance and routing context. */
  groupId?: SpawnedRunMetadata["groupId"];
  groupChannel?: SpawnedRunMetadata["groupChannel"];
  groupSpace?: SpawnedRunMetadata["groupSpace"];
  spawnedBy?: SpawnedRunMetadata["spawnedBy"];
  deliveryTargetMode?: ChannelOutboundTargetMode;
  bestEffortDeliver?: boolean;
  abortSignal?: AbortSignal;
  lane?: string;
  runId?: string;
  extraSystemPrompt?: string; /** Bootstrap workspace context injection mode for this run. */
  bootstrapContextMode?: "full" | "lightweight"; /** Run kind hint for bootstrap context behavior. */
  bootstrapContextRunKind?: "default" | "heartbeat" | "cron";
  internalEvents?: AgentInternalEvent[];
  inputProvenance?: InputProvenance; /** Visible source replies must be sent through the message tool when set. */
  sourceReplyDeliveryMode?: SourceReplyDeliveryMode; /** Per-call stream param overrides (best-effort). */
  streamParams?: AgentStreamParams; /** Explicit workspace directory override (for subagents to inherit parent workspace). */
  workspaceDir?: SpawnedRunMetadata["workspaceDir"]; /** Force bundled MCP teardown when a one-shot local run completes. */
  cleanupBundleMcpOnRunEnd?: boolean; /** Force long-lived CLI live session teardown when a one-shot local run completes. */
  cleanupCliLiveSessionOnRunEnd?: boolean; /** Internal local CLI callers can annotate result metadata before JSON/text output. */
  resultMetaOverrides?: AgentCommandResultMetaOverrides; /** Called when the actual run model is selected, including fallback retries. */
  onActiveModelSelected?: (ctx: {
    provider: string;
    model: string;
  }) => void; /** Internal one-shot model probe mode: no tools, no workspace/chat prompt policy. */
  modelRun?: boolean; /** Internal prompt-mode override for trusted local/gateway callsites. */
  promptMode?: PromptMode; /** Internal ACP-ready session turn source. Manual spawn turns bypass only the dispatch gate. */
  acpTurnSource?: AcpTurnSource; /** Internal handoffs can feed the model without writing the synthetic prompt to transcript. */
  suppressPromptPersistence?: boolean;
};
type AgentCommandIngressOpts = Omit<AgentCommandOpts, "senderIsOwner" | "allowModelOverride" | "resultMetaOverrides"> & {
  /** Trusted sender identity bit for command/channel-action auth; defaults false for ingress. */senderIsOwner?: boolean; /** Ingress callsites must always pass explicit model-override authorization state. */
  allowModelOverride: boolean;
};
//#endregion
export { AgentCommandOpts as n, AgentCommandResultMetaOverrides as r, AgentCommandIngressOpts as t };