Messages
Category: Acp
Source: messages.dart
Typed Dart shapes for the subset of the Agent Client Protocol (ACP) that Glue's server implements.
Only the v1 message vocabulary needed to drive a glue serve session: initialize, session/new, session/prompt, session/cancel, session/update, session/request_permission, plus their parameter and response shapes.
See docs/plans/2026-02-27-acp-webui.md and the upstream spec at https://agentclientprotocol.com/.
Enums
StopReason
| Value | Description |
|---|---|
endTurn | |
maxTokens | |
maxTurnRequests | |
refusal | |
cancelled |
ToolCallKind
| Value | Description |
|---|---|
read | |
edit | |
execute | |
search | |
fetch | |
other |
ToolCallStatus
| Value | Description |
|---|---|
pending | |
inProgress | |
completed | |
failed |
Classes
abstract AcpMethod
Properties
| Property | Type | Description |
|---|---|---|
initialize | const | |
sessionNew | const | |
sessionPrompt | const | |
sessionCancel | const | |
sessionUpdate | const | |
sessionRequestPermission | const | |
sessionUsageSummary | const |
InitializeParams
Constructor
dart
const InitializeParams({
required this.protocolVersion,
this.clientCapabilities,
this.clientInfo,
})dart
factory InitializeParams.fromJson(Map<String, Object?> json)dart
InitializeParams(
protocolVersion: (json['protocolVersion'] as num).toInt(),
clientCapabilities: (json['clientCapabilities'] as Map?)
?.cast<String, Object?>(),
clientInfo: json['clientInfo'] is Map
? ClientInfo.fromJson(
(json['clientInfo']! as Map).cast<String, Object?>(),
)
: null,
)Properties
| Property | Type | Description |
|---|---|---|
protocolVersion | int | |
clientCapabilities | Map<String, Object?>? | |
clientInfo | ClientInfo? |
ClientInfo
Constructor
dart
const ClientInfo({required this.name, this.title, this.version})dart
factory ClientInfo.fromJson(Map<String, Object?> json)Properties
| Property | Type | Description |
|---|---|---|
name | String | |
title | String? | |
version | String? |
InitializeResult
Constructor
dart
const InitializeResult({
required this.protocolVersion,
required this.agentInfo,
this.agentCapabilities = const {},
})Properties
| Property | Type | Description |
|---|---|---|
protocolVersion | int | |
agentInfo | AgentInfo | |
agentCapabilities | Map<String, Object?> |
AgentInfo
Constructor
dart
const AgentInfo({required this.name, this.title, this.version})Properties
| Property | Type | Description |
|---|---|---|
name | String | |
title | String? | |
version | String? |
SessionNewParams
Constructor
dart
const SessionNewParams({required this.cwd, this.mcpServers = const []})dart
factory SessionNewParams.fromJson(Map<String, Object?> json)dart
SessionNewParams(
cwd: json['cwd'] as String,
mcpServers: ((json['mcpServers'] as List?) ?? const [])
.whereType<Map<Object?, Object?>>()
.map((e) => e.cast<String, Object?>())
.toList(),
)Properties
| Property | Type | Description |
|---|---|---|
cwd | String | |
mcpServers | List<Map<String, Object?>> |
SessionNewResult
Constructor
dart
const SessionNewResult({required this.sessionId})Properties
| Property | Type | Description |
|---|---|---|
sessionId | String |
SessionPromptParams
Constructor
dart
const SessionPromptParams({required this.sessionId, required this.prompt})dart
factory SessionPromptParams.fromJson(Map<String, Object?> json)dart
SessionPromptParams(
sessionId: json['sessionId'] as String,
prompt: [
for (final block in (json['prompt'] as List?) ?? const [])
if (block is Map<Object?, Object?>)
AcpContentBlock.fromJson(block.cast<String, Object?>()),
],
)Properties
| Property | Type | Description |
|---|---|---|
sessionId | String | |
prompt | List<AcpContentBlock> | |
imageBlocks | List<AcpImageBlock> get | Image blocks the client attached to the prompt. Empty when text-only. |
text | String get | Convenience: returns the concatenated text of all [AcpTextBlock]s in the prompt. Image/audio/resource blocks are ignored — see [imageBlocks] for those. |
imageBlocks | List<AcpImageBlock> get | Image blocks the client attached to the prompt. Empty when text-only. |
SessionPromptResult
Constructor
dart
const SessionPromptResult({required this.stopReason})Properties
| Property | Type | Description |
|---|---|---|
stopReason | StopReason |
SessionCancelParams
Constructor
dart
const SessionCancelParams({required this.sessionId})dart
factory SessionCancelParams.fromJson(Map<String, Object?> json)dart
SessionCancelParams(sessionId: json['sessionId'] as String)Properties
| Property | Type | Description |
|---|---|---|
sessionId | String |
sealed SessionUpdate
All session/update payloads. The sessionUpdate field is the discriminator on the wire.
Constructor
dart
const SessionUpdate()Properties
| Property | Type | Description |
|---|---|---|
kind | String get | |
kind | String get |
AgentMessageChunkUpdate
Constructor
dart
const AgentMessageChunkUpdate(this.text)Properties
| Property | Type | Description |
|---|---|---|
text | String | |
kind | String get | |
kind | String get |
AgentThoughtChunkUpdate
Constructor
dart
const AgentThoughtChunkUpdate(this.text)Properties
| Property | Type | Description |
|---|---|---|
text | String | |
kind | String get | |
kind | String get |
ToolCallUpdate
Constructor
dart
const ToolCallUpdate({
required this.toolCallId,
required this.title,
required this.kind_,
required this.status,
this.rawInput,
})Properties
| Property | Type | Description |
|---|---|---|
toolCallId | String | |
title | String | |
kind_ | ToolCallKind | |
status | ToolCallStatus | |
rawInput | Map<String, Object?>? | |
kind | String get | |
kind | String get |
ToolCallStatusUpdate
Constructor
dart
const ToolCallStatusUpdate({
required this.toolCallId,
required this.status,
this.content = const [],
})Properties
| Property | Type | Description |
|---|---|---|
toolCallId | String | |
status | ToolCallStatus | |
content | List<AcpToolCallContent> | |
kind | String get | |
kind | String get |
SessionUpdateNotification
Full payload for a session/update notification.
Constructor
dart
const SessionUpdateNotification({
required this.sessionId,
required this.update,
})Properties
| Property | Type | Description |
|---|---|---|
sessionId | String | |
update | SessionUpdate |
RequestPermissionParams
Constructor
dart
const RequestPermissionParams({
required this.sessionId,
required this.toolCallId,
required this.title,
required this.kind_,
required this.options,
})Properties
| Property | Type | Description |
|---|---|---|
sessionId | String | |
toolCallId | String | |
title | String | |
kind_ | ToolCallKind | |
options | List<PermissionOption> |
PermissionOption
Constructor
dart
const PermissionOption({
required this.optionId,
required this.label,
this.description,
})Properties
| Property | Type | Description |
|---|---|---|
optionId | String | |
label | String | |
description | String? |
RequestPermissionResult
Constructor
dart
const RequestPermissionResult({required this.outcome})dart
factory RequestPermissionResult.fromJson(Map<String, Object?> json)Properties
| Property | Type | Description |
|---|---|---|
outcome | PermissionOutcome |
sealed PermissionOutcome
Constructor
dart
const PermissionOutcome()dart
factory PermissionOutcome.fromJson(Map<String, Object?> json)PermissionCancelled
Constructor
dart
const PermissionCancelled()PermissionSelected
Constructor
dart
const PermissionSelected(this.optionId)Properties
| Property | Type | Description |
|---|---|---|
optionId | String |