SessionConfig class

Configuration for creating a new session.

Constructors

SessionConfig({String? sessionId, String? clientName, String? model, SystemMessageConfig? systemMessage, InfiniteSessionConfig? infiniteSessions, bool streaming = true, List<Tool> tools = const [], List<String>? availableTools, List<String>? excludedTools, Map<String, McpServerConfig> mcpServers = const {}, List<CustomAgentConfig> customAgents = const [], List<String> skillDirectories = const [], List<String> disabledSkills = const [], SessionHooks? hooks, ProviderConfig? provider, ReasoningEffort? reasoningEffort, AgentMode? mode, List<Attachment> attachments = const [], String? configDir, String? workingDirectory, required PermissionHandler onPermissionRequest, UserInputHandler? onUserInputRequest})
const

Properties

attachments List<Attachment>
Initial attachments.
final
availableTools List<String>?
List of built-in tool names to make available.
final
clientName String?
Client name for User-Agent header.
final
configDir String?
Override config directory location.
final
customAgents List<CustomAgentConfig>
Custom agent configurations.
final
disabledSkills List<String>
Skill names to disable.
final
excludedTools List<String>?
List of built-in tool names to exclude.
final
hashCode int
The hash code for this object.
no setterinherited
hooks SessionHooks?
Lifecycle hooks.
final
infiniteSessions InfiniteSessionConfig?
Infinite session configuration with compaction thresholds.
final
mcpServers Map<String, McpServerConfig>
MCP servers to connect to, keyed by server name.
final
mode AgentMode?
Initial agent mode.
final
model String?
Model ID to use (e.g., "gpt-4", "claude-sonnet-4.5").
final
onPermissionRequest PermissionHandler
Handler for permission requests (required).
final
onUserInputRequest UserInputHandler?
Handler for user input requests.
final
provider ProviderConfig?
BYOK provider configuration.
final
reasoningEffort ReasoningEffort?
Reasoning effort level.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sessionId String?
Optional custom session ID.
final
skillDirectories List<String>
Directories containing skill files.
final
streaming bool
Whether to stream events in real-time.
final
systemMessage SystemMessageConfig?
System message configuration.
final
tools List<Tool>
Custom tools to register with this session.
final
workingDirectory String?
Working directory for tool operations.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts to JSON for the session.create RPC call.
toString() String
A string representation of this object.
inherited

Operators

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