Options class

Options for an Agent SDK query. Mirrors the SDK's Options type.

Only data fields are serialized; see the library docs for the callback and bridge-managed fields that are intentionally excluded.

Constructors

Options({String? model, String? fallbackModel, SystemPrompt? systemPrompt, ToolsConfig? tools, List<String>? allowedTools, List<String>? disallowedTools, Map<String, McpServerConfig>? mcpServers, int? maxTurns, double? maxBudgetUsd, TaskBudget? taskBudget, PermissionMode? permissionMode, String? planModeInstructions, bool? allowDangerouslySkipPermissions, String? permissionPromptToolName, List<SettingSource>? settingSources, SettingsRef? settings, SettingsRef? managedSettings, String? cwd, List<String>? additionalDirectories, bool? continueSession, String? resume, String? sessionId, String? resumeSessionAt, bool? forkSession, bool? persistSession, String? title, Map<String, String>? env, Map<String, String?>? extraArgs, bool? strictMcpConfig, String? agent, Map<String, AgentDefinition>? agents, Skills? skills, List<PluginConfig>? plugins, List<String>? betas, OutputFormat? outputFormat, Map<String, dynamic>? toolConfig, ThinkingConfig? thinking, EffortLevel? effort, int? maxThinkingTokens, bool? includePartialMessages, bool? includeHookEvents, bool? forwardSubagentText, bool? promptSuggestions, bool? agentProgressSummaries, bool? enableFileCheckpointing, Map<String, dynamic>? sandbox, bool? debug, String? debugFile, int? loadTimeoutMs, CanUseTool? canUseTool, void onStderr(String line)?})
Options.fromJson(Map<String, dynamic> json)
Parses Options from its wire JSON (data fields only; callbacks are not transported).
factory

Properties

additionalDirectories → List<String>?
Additional accessible directories.
final
agent → String?
A single named agent to run.
final
agentProgressSummaries → bool?
Whether to emit agent progress summaries.
final
agents → Map<String, AgentDefinition>?
Named sub-agent definitions.
final
allowDangerouslySkipPermissions → bool?
Whether to allow bypassing permissions.
final
allowedTools → List<String>?
Explicitly allowed tool names.
final
betas → List<String>?
API beta flags.
final
canUseTool → CanUseTool?
Tool-approval callback (wired in todo #6; never serialized).
final
continueSession → bool?
Whether to continue the most recent session (continue).
final
cwd → String?
The working directory.
final
debug → bool?
Whether to enable debug logging.
final
debugFile → String?
A file to write debug logs to.
final
disallowedTools → List<String>?
Explicitly disallowed tool names.
final
effort → EffortLevel?
Reasoning effort level.
final
enableFileCheckpointing → bool?
Whether to enable file checkpointing.
final
env → Map<String, String>?
Environment variables for the run.
final
extraArgs → Map<String, String?>?
Extra CLI arguments (values may be null for flags).
final
fallbackModel → String?
A fallback model id.
final
forkSession → bool?
Whether to fork the resumed session.
final
forwardSubagentText → bool?
Whether to forward sub-agent text.
final
hashCode → int
The hash code for this object.
no setterinherited
includeHookEvents → bool?
Whether to emit hook events as messages.
final
includePartialMessages → bool?
Whether to stream partial assistant messages.
final
loadTimeoutMs → int?
SDK load timeout in milliseconds.
final
managedSettings → SettingsRef?
Managed settings (path or inline).
final
maxBudgetUsd → double?
Maximum spend in USD.
final
maxThinkingTokens → int?
Deprecated thinking-token budget (use thinking).
final
maxTurns → int?
Maximum number of agent turns.
final
mcpServers → Map<String, McpServerConfig>?
MCP servers, keyed by name.
final
model → String?
The primary model id.
final
onStderr → void Function(String line)?
Stderr line callback (wired in todo #6; never serialized).
final
outputFormat → OutputFormat?
Structured output format.
final
permissionMode → PermissionMode?
The permission mode.
final
permissionPromptToolName → String?
The name of a tool used to prompt for permissions.
final
persistSession → bool?
Whether to persist the session.
final
planModeInstructions → String?
Extra instructions shown in plan mode.
final
plugins → List<PluginConfig>?
Local plugins to load.
final
promptSuggestions → bool?
Whether to emit prompt suggestions.
final
resume → String?
The session id to resume.
final
resumeSessionAt → String?
A point in a session to resume at.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sandbox → Map<String, dynamic>?
Opaque sandbox settings (SandboxSettings).
final
sessionId → String?
An explicit session id to use.
final
settings → SettingsRef?
User settings (path or inline).
final
settingSources → List<SettingSource>?
Where to load filesystem settings from.
final
skills → Skills?
The skills selection.
final
strictMcpConfig → bool?
Whether to use strict MCP config validation.
final
systemPrompt → SystemPrompt?
The system prompt.
final
taskBudget → TaskBudget?
A structured task budget.
final
thinking → ThinkingConfig?
Extended-thinking configuration.
final
title → String?
A custom session title.
final
toolConfig → Map<String, dynamic>?
Opaque tool configuration.
final
tools → ToolsConfig?
The tool selection.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializes the data fields to wire JSON. Callback fields are omitted (they are dispatched over the reverse RPC, not as data).
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited