Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2542,6 +2542,18 @@ public sealed record AgentInfo
/// id.</summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public AgentCapabilities? Capabilities { get; init; }

/// <summary>Icons for UI display, such as in an agent picker.</summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<Icon>? Icons { get; init; }

/// <summary>Additional implementation-defined metadata for this agent.
/// MUST NOT contain a credential.
///
/// Clients MAY look for well-known keys here to provide enhanced UI.</summary>
[JsonPropertyName("_meta")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Dictionary<string, JsonElement>? Meta { get; init; }
}

/// <summary>Static capabilities an {@link AgentInfo} advertises. Modelled after MCP
Expand Down
7 changes: 7 additions & 0 deletions clients/go/ahptypes/state.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,13 @@ type AgentInfo struct {
// to gate features (multi-chat, fork) instead of switching on the provider
// id.
Capabilities *AgentCapabilities `json:"capabilities,omitempty"`
// Icons for UI display, such as in an agent picker.
Icons []Icon `json:"icons,omitempty"`
// Additional implementation-defined metadata for this agent.
// MUST NOT contain a credential.
//
// Clients MAY look for well-known keys here to provide enhanced UI.
Meta map[string]json.RawMessage `json:"_meta,omitempty"`
}

// Static capabilities an {@link AgentInfo} advertises. Modelled after MCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1843,7 +1843,19 @@ data class AgentInfo(
* to gate features (multi-chat, fork) instead of switching on the provider
* id.
*/
val capabilities: AgentCapabilities? = null
val capabilities: AgentCapabilities? = null,
/**
* Icons for UI display, such as in an agent picker.
*/
val icons: List<Icon>? = null,
/**
* Additional implementation-defined metadata for this agent.
* MUST NOT contain a credential.
*
* Clients MAY look for well-known keys here to provide enhanced UI.
*/
@SerialName("_meta")
val meta: Map<String, JsonElement>? = null
)

@Serializable
Expand Down
9 changes: 9 additions & 0 deletions clients/rust/crates/ahp-types/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2240,6 +2240,15 @@ pub struct AgentInfo {
/// id.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub capabilities: Option<AgentCapabilities>,
/// Icons for UI display, such as in an agent picker.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub icons: Option<Vec<Icon>>,
/// Additional implementation-defined metadata for this agent.
/// MUST NOT contain a credential.
///
/// Clients MAY look for well-known keys here to provide enhanced UI.
#[serde(rename = "_meta", default, skip_serializing_if = "Option::is_none")]
pub meta: Option<JsonObject>,
}

/// Static capabilities an {@link AgentInfo} advertises. Modelled after MCP
Expand Down
2 changes: 2 additions & 0 deletions clients/rust/crates/ahp/examples/reducers_demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ fn main() {
protected_resources: None,
customizations: None,
capabilities: None,
icons: None,
meta: None,
}],
}),
server_seq: 1,
Expand Down
2 changes: 2 additions & 0 deletions clients/rust/crates/ahp/tests/hosts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ async fn single_constructor_yields_connected_handle() {
protected_resources: None,
customizations: None,
capabilities: None,
icons: None,
meta: None,
};
let state = FakeHostState::new().with_agents(vec![agent.clone()]);
let factory = make_basic_factory(state);
Expand Down
2 changes: 2 additions & 0 deletions clients/rust/crates/ahp/tests/multi_host_state_mirror.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ fn agent(provider: &str) -> AgentInfo {
protected_resources: None,
customizations: None,
capabilities: None,
icons: None,
meta: None,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1833,6 +1833,25 @@ public struct AgentInfo: Codable, Sendable, Equatable {
/// to gate features (multi-chat, fork) instead of switching on the provider
/// id.
public var capabilities: AgentCapabilities?
/// Icons for UI display, such as in an agent picker.
public var icons: [Icon]?
/// Additional implementation-defined metadata for this agent.
/// MUST NOT contain a credential.
///
/// Clients MAY look for well-known keys here to provide enhanced UI.
public var meta: [String: AnyCodable]?

enum CodingKeys: String, CodingKey {
case provider
case displayName
case description
case models
case protectedResources
case customizations
case capabilities
case icons
case meta = "_meta"
}

public init(
provider: String,
Expand All @@ -1841,7 +1860,9 @@ public struct AgentInfo: Codable, Sendable, Equatable {
models: [SessionModelInfo],
protectedResources: [ProtectedResourceMetadata]? = nil,
customizations: [Customization]? = nil,
capabilities: AgentCapabilities? = nil
capabilities: AgentCapabilities? = nil,
icons: [Icon]? = nil,
meta: [String: AnyCodable]? = nil
) {
self.provider = provider
self.displayName = displayName
Expand All @@ -1850,6 +1871,8 @@ public struct AgentInfo: Codable, Sendable, Equatable {
self.protectedResources = protectedResources
self.customizations = customizations
self.capabilities = capabilities
self.icons = icons
self.meta = meta
}
}

Expand Down
6 changes: 6 additions & 0 deletions docs/.changes/20261126-agent-info-icons-migration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "changed",
"message": "Require direct Rust struct literals for `AgentInfo` to initialize `icons: None` and `meta: None` (added for agent icons).",
"targets": ["rust"],
"issues": [636]
}
5 changes: 5 additions & 0 deletions docs/.changes/20261126-agent-info-icons.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "added",
"message": "Add optional `AgentInfo.icons` so clients can show agent icons from root state, and an optional `AgentInfo._meta` that `root/agentsChanged` keeps current, for implementation-defined agent metadata.",
"issues": [636]
}
2 changes: 2 additions & 0 deletions docs/guide/state-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ AgentInfo {
description: string
models: SessionModelInfo[]
customizations?: Customization[] // Open Plugins
icons?: Icon[] // e.g. for an agent picker
_meta?: Record<string, unknown>
}

SessionModelInfo {
Expand Down
2 changes: 1 addition & 1 deletion docs/specification/root-channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ RootState {
}
```

- `agents` — agent backends the server can speak to, including any `protectedResources` they require for authentication. See [Authentication](/specification/authentication).
- `agents` — agent backends the server can speak to, including any `protectedResources` they require for authentication. See [Authentication](/specification/authentication). Each agent can carry [`icons`](/reference/common#icon) for display.
- `activeSessions` — count of non-disposed sessions. Lightweight badge counter.
- `terminals` — lightweight per-terminal metadata for rendering a terminal manager UI without subscribing to every terminal. See [Terminal Channel](/specification/terminal-channel) for the full state.
- `config` — host-level configuration schema and current values.
Expand Down
12 changes: 12 additions & 0 deletions schema/actions.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3511,6 +3511,18 @@
"capabilities": {
"$ref": "#/$defs/AgentCapabilities",
"description": "Static capabilities the agent advertises about itself. Clients use these\nto gate features (multi-chat, fork) instead of switching on the provider\nid."
},
"icons": {
"type": "array",
"items": {
"$ref": "#/$defs/Icon"
},
"description": "Icons for UI display, such as in an agent picker."
},
"_meta": {
"type": "object",
"additionalProperties": {},
"description": "Additional implementation-defined metadata for this agent.\nMUST NOT contain a credential.\n\nClients MAY look for well-known keys here to provide enhanced UI."
}
},
"required": [
Expand Down
12 changes: 12 additions & 0 deletions schema/commands.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2808,6 +2808,18 @@
"capabilities": {
"$ref": "#/$defs/AgentCapabilities",
"description": "Static capabilities the agent advertises about itself. Clients use these\nto gate features (multi-chat, fork) instead of switching on the provider\nid."
},
"icons": {
"type": "array",
"items": {
"$ref": "#/$defs/Icon"
},
"description": "Icons for UI display, such as in an agent picker."
},
"_meta": {
"type": "object",
"additionalProperties": {},
"description": "Additional implementation-defined metadata for this agent.\nMUST NOT contain a credential.\n\nClients MAY look for well-known keys here to provide enhanced UI."
}
},
"required": [
Expand Down
12 changes: 12 additions & 0 deletions schema/errors.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,18 @@
"capabilities": {
"$ref": "#/$defs/AgentCapabilities",
"description": "Static capabilities the agent advertises about itself. Clients use these\nto gate features (multi-chat, fork) instead of switching on the provider\nid."
},
"icons": {
"type": "array",
"items": {
"$ref": "#/$defs/Icon"
},
"description": "Icons for UI display, such as in an agent picker."
},
"_meta": {
"type": "object",
"additionalProperties": {},
"description": "Additional implementation-defined metadata for this agent.\nMUST NOT contain a credential.\n\nClients MAY look for well-known keys here to provide enhanced UI."
}
},
"required": [
Expand Down
12 changes: 12 additions & 0 deletions schema/notifications.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,18 @@
"capabilities": {
"$ref": "#/$defs/AgentCapabilities",
"description": "Static capabilities the agent advertises about itself. Clients use these\nto gate features (multi-chat, fork) instead of switching on the provider\nid."
},
"icons": {
"type": "array",
"items": {
"$ref": "#/$defs/Icon"
},
"description": "Icons for UI display, such as in an agent picker."
},
"_meta": {
"type": "object",
"additionalProperties": {},
"description": "Additional implementation-defined metadata for this agent.\nMUST NOT contain a credential.\n\nClients MAY look for well-known keys here to provide enhanced UI."
}
},
"required": [
Expand Down
12 changes: 12 additions & 0 deletions schema/state.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,18 @@
"capabilities": {
"$ref": "#/$defs/AgentCapabilities",
"description": "Static capabilities the agent advertises about itself. Clients use these\nto gate features (multi-chat, fork) instead of switching on the provider\nid."
},
"icons": {
"type": "array",
"items": {
"$ref": "#/$defs/Icon"
},
"description": "Icons for UI display, such as in an agent picker."
},
"_meta": {
"type": "object",
"additionalProperties": {},
"description": "Additional implementation-defined metadata for this agent.\nMUST NOT contain a credential.\n\nClients MAY look for well-known keys here to provide enhanced UI."
}
},
"required": [
Expand Down
9 changes: 9 additions & 0 deletions types/channels-root/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ export interface AgentInfo {
* id.
*/
capabilities?: AgentCapabilities;
/** Icons for UI display, such as in an agent picker. */
icons?: Icon[];
/**
* Additional implementation-defined metadata for this agent.
* MUST NOT contain a credential.
*
* Clients MAY look for well-known keys here to provide enhanced UI.
*/
_meta?: Record<string, unknown>;
}

/**
Expand Down
76 changes: 76 additions & 0 deletions types/test-cases/round-trips/119-agent-info-icons.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"name": "agent-info-icons",
"group": "A",
"description": "AgentInfo.icons and AgentInfo._meta are optional. One agent carries a light and a dark icon plus metadata, the other has neither. Pins that icons and metadata survive a decode/re-encode cycle in root/agentsChanged and that absent fields stay absent instead of re-encoding as null.",
"type": "StateAction",
"input": {
"type": "root/agentsChanged",
"agents": [
{
"provider": "example",
"displayName": "Example",
"description": "An agent with themed icons.",
"models": [],
"icons": [
{
"src": "https://example.com/icons/example-light.png",
"contentType": "image/png",
"sizes": ["96x96"],
"theme": "light"
},
{
"src": "https://example.com/icons/example-dark.png",
"contentType": "image/png",
"sizes": ["96x96"],
"theme": "dark"
}
],
"_meta": {
"example.com/badge": "beta"
}
},
{
"provider": "plain",
"displayName": "Plain",
"description": "An agent without icons.",
"models": []
}
]
},
"acceptableOutputs": [
{
"type": "root/agentsChanged",
"agents": [
{
"provider": "example",
"displayName": "Example",
"description": "An agent with themed icons.",
"models": [],
"icons": [
{
"src": "https://example.com/icons/example-light.png",
"contentType": "image/png",
"sizes": ["96x96"],
"theme": "light"
},
{
"src": "https://example.com/icons/example-dark.png",
"contentType": "image/png",
"sizes": ["96x96"],
"theme": "dark"
}
],
"_meta": {
"example.com/badge": "beta"
}
},
{
"provider": "plain",
"displayName": "Plain",
"description": "An agent without icons.",
"models": []
}
]
}
]
}