Skip to content

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 Glue currently serves over glue acp: initialize, session/new, session/close, session/prompt, session/cancel, session/update, session/request_permission, and session/usage_summary, 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 ​

ValueDescription
endTurn
maxTokens
maxTurnRequests
refusal
cancelled

ToolCallKind ​

ValueDescription
read
edit
execute
search
fetch
other

ToolCallStatus ​

ValueDescription
pending
inProgress
completed
failed

Classes ​

abstract AcpMethod ​

Properties ​

PropertyTypeDescription
initializeconst
sessionNewconst
sessionCloseconst
sessionPromptconst
sessionCancelconst
sessionUpdateconst
sessionRequestPermissionconst
sessionUsageSummaryconst

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 ​

PropertyTypeDescription
protocolVersionint
clientCapabilitiesMap&lt;String, Object?&gt;?
clientInfoClientInfo?

ClientInfo ​

Constructor ​

dart
const ClientInfo({required this.name, this.title, this.version})
dart
factory ClientInfo.fromJson(Map<String, Object?> json)

Properties ​

PropertyTypeDescription
nameString
titleString?
versionString?

InitializeResult ​

Constructor ​

dart
const InitializeResult({
    required this.protocolVersion,
    required this.agentInfo,
    this.agentCapabilities = const {},
    this.authMethods = const [],
  })

Properties ​

PropertyTypeDescription
protocolVersionint
agentInfoAgentInfo
agentCapabilitiesMap&lt;String, Object?&gt;
authMethodsList&lt;AuthMethod&gt;

AuthMethod ​

Constructor ​

dart
const AuthMethod({
    required this.id,
    required this.name,
    required this.description,
    required this.type,
    this.args = const [],
    this.env = const {},
  })

Properties ​

PropertyTypeDescription
idString
nameString
descriptionString
typeString
argsList&lt;String&gt;
envMap&lt;String, String&gt;

AgentInfo ​

Constructor ​

dart
const AgentInfo({required this.name, this.title, this.version})

Properties ​

PropertyTypeDescription
nameString
titleString?
versionString?

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 ​

PropertyTypeDescription
cwdString
mcpServersList&lt;Map&lt;String, Object?&gt;&gt;

SessionNewResult ​

Constructor ​

dart
const SessionNewResult({required this.sessionId})

Properties ​

PropertyTypeDescription
sessionIdString

SessionCloseParams ​

Constructor ​

dart
const SessionCloseParams({required this.sessionId})
dart
factory SessionCloseParams.fromJson(Map<String, Object?> json)
dart
SessionCloseParams(sessionId: json['sessionId'] as String)

Properties ​

PropertyTypeDescription
sessionIdString

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 ​

PropertyTypeDescription
sessionIdString
promptList&lt;AcpContentBlock&gt;
textString getConvenience: returns the concatenated text of all [AcpTextBlock]s in the prompt. Image/audio/resource blocks are ignored — see [imageBlocks] for those.
imageBlocksList&lt;AcpImageBlock&gt; getImage blocks the client attached to the prompt. Empty when text-only.
textString getConvenience: returns the concatenated text of all [AcpTextBlock]s in the prompt. Image/audio/resource blocks are ignored — see [imageBlocks] for those.
imageBlocksList&lt;AcpImageBlock&gt; getImage blocks the client attached to the prompt. Empty when text-only.

SessionPromptResult ​

Constructor ​

dart
const SessionPromptResult({required this.stopReason})

Properties ​

PropertyTypeDescription
stopReasonStopReason

SessionCancelParams ​

Constructor ​

dart
const SessionCancelParams({required this.sessionId})
dart
factory SessionCancelParams.fromJson(Map<String, Object?> json)
dart
SessionCancelParams(sessionId: json['sessionId'] as String)

Properties ​

PropertyTypeDescription
sessionIdString

sealed SessionUpdate ​

All session/update payloads. The sessionUpdate field is the discriminator on the wire.

Constructor ​

dart
const SessionUpdate()

Properties ​

PropertyTypeDescription
kindString get
kindString get

AgentMessageChunkUpdate ​

Constructor ​

dart
const AgentMessageChunkUpdate(this.text)

Properties ​

PropertyTypeDescription
textString
kindString get
kindString get

AgentThoughtChunkUpdate ​

Constructor ​

dart
const AgentThoughtChunkUpdate(this.text)

Properties ​

PropertyTypeDescription
textString
kindString get
kindString get

ToolCallUpdate ​

Constructor ​

dart
const ToolCallUpdate({
    required this.toolCallId,
    required this.title,
    required this.kind_,
    required this.status,
    this.rawInput,
  })

Properties ​

PropertyTypeDescription
toolCallIdString
titleString
kind_ToolCallKind
statusToolCallStatus
rawInputMap&lt;String, Object?&gt;?
kindString get
kindString get

ToolCallStatusUpdate ​

Constructor ​

dart
const ToolCallStatusUpdate({
    required this.toolCallId,
    required this.status,
    this.content = const [],
  })

Properties ​

PropertyTypeDescription
toolCallIdString
statusToolCallStatus
contentList&lt;AcpToolCallContent&gt;
kindString get
kindString get

SessionUpdateNotification ​

Full payload for a session/update notification.

Constructor ​

dart
const SessionUpdateNotification({
    required this.sessionId,
    required this.update,
  })

Properties ​

PropertyTypeDescription
sessionIdString
updateSessionUpdate

RequestPermissionParams ​

Constructor ​

dart
const RequestPermissionParams({
    required this.sessionId,
    required this.toolCallId,
    required this.title,
    required this.kind_,
    required this.options,
  })

Properties ​

PropertyTypeDescription
sessionIdString
toolCallIdString
titleString
kind_ToolCallKind
optionsList&lt;PermissionOption&gt;

PermissionOption ​

Constructor ​

dart
const PermissionOption({
    required this.optionId,
    required this.label,
    this.description,
  })

Properties ​

PropertyTypeDescription
optionIdString
labelString
descriptionString?

RequestPermissionResult ​

Constructor ​

dart
const RequestPermissionResult({required this.outcome})
dart
factory RequestPermissionResult.fromJson(Map<String, Object?> json)

Properties ​

PropertyTypeDescription
outcomePermissionOutcome

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 ​

PropertyTypeDescription
optionIdString

Released under the MIT License.