From b66fdbb667ec3569d599be91f999a0727ad59bb8 Mon Sep 17 00:00:00 2001 From: Ben Brandt Date: Thu, 2 Jul 2026 21:25:14 +0200 Subject: [PATCH] feat(unstable-v2): tighten v2 field validation --- agent-client-protocol-schema/src/v2/agent.rs | 5 +- agent-client-protocol-schema/src/v2/client.rs | 5 +- .../src/v2/content.rs | 5 +- .../src/v2/elicitation.rs | 13 ++- agent-client-protocol-schema/src/v2/nes.rs | 21 +++- agent-client-protocol-schema/src/v2/plan.rs | 1 + docs/protocol/v2/draft/schema.mdx | 23 +++- docs/protocol/v2/schema.mdx | 7 ++ docs/protocol/v2/tool-calls.mdx | 2 +- schema/v2/schema.json | 13 ++- schema/v2/schema.unstable.json | 103 ++++++++++++------ 11 files changed, 145 insertions(+), 53 deletions(-) diff --git a/agent-client-protocol-schema/src/v2/agent.rs b/agent-client-protocol-schema/src/v2/agent.rs index 9fae85117..b3f318da4 100644 --- a/agent-client-protocol-schema/src/v2/agent.rs +++ b/agent-client-protocol-schema/src/v2/agent.rs @@ -810,6 +810,7 @@ pub struct AuthMethodEnvVar { /// Optional link to a page where the user can obtain their credentials. #[serde_as(deserialize_as = "DefaultOnError")] #[schemars(extend("x-deserialize-default-on-error" = true))] + #[schemars(url)] #[serde(default)] pub link: Option, /// The _meta property is reserved by ACP to allow clients and agents to attach additional @@ -2013,7 +2014,7 @@ pub struct SessionInfo { pub title: Option, /// ISO 8601 timestamp of last activity #[serde_as(deserialize_as = "DefaultOnError")] - #[schemars(extend("x-deserialize-default-on-error" = true))] + #[schemars(extend("x-deserialize-default-on-error" = true, "format" = "date-time"))] #[serde(default)] pub updated_at: Option, /// The _meta property is reserved by ACP to allow clients and agents to attach additional @@ -3612,6 +3613,7 @@ pub struct ProviderCurrentConfig { /// Protocol currently used by this provider. pub api_type: LlmProtocol, /// Base URL currently used by this provider. + #[schemars(url)] pub base_url: String, /// The _meta property is reserved by ACP to allow clients and agents to attach additional /// metadata to their interactions. Implementations MUST NOT make assumptions about values at @@ -3853,6 +3855,7 @@ pub struct SetProviderRequest { /// Protocol type for this provider. pub api_type: LlmProtocol, /// Base URL for requests sent through this provider. + #[schemars(url)] pub base_url: String, /// Full headers map for this provider. /// May include authorization, routing, or other integration-specific headers. diff --git a/agent-client-protocol-schema/src/v2/client.rs b/agent-client-protocol-schema/src/v2/client.rs index 88f6bda20..5e0e16301 100644 --- a/agent-client-protocol-schema/src/v2/client.rs +++ b/agent-client-protocol-schema/src/v2/client.rs @@ -341,7 +341,7 @@ pub struct SessionInfoUpdate { pub title: MaybeUndefined, /// ISO 8601 timestamp of last activity. Set to null to clear. #[serde_as(deserialize_as = "DefaultOnError")] - #[schemars(extend("x-deserialize-default-on-error" = true))] + #[schemars(extend("x-deserialize-default-on-error" = true, "format" = "date-time"))] #[serde(default, skip_serializing_if = "MaybeUndefined::is_undefined")] pub updated_at: MaybeUndefined, /// The _meta property is reserved by ACP to allow clients and agents to attach additional @@ -710,6 +710,7 @@ pub struct Cost { /// Total cumulative cost for session. pub amount: f64, /// ISO 4217 currency code (e.g., "USD", "EUR"). + #[schemars(pattern(r"^[A-Z]{3}$"))] pub currency: String, /// The _meta property is reserved by ACP to allow clients and agents to attach additional /// metadata to their interactions. Implementations MUST NOT make assumptions about values at @@ -1297,6 +1298,8 @@ pub struct RequestPermissionRequest { #[serde(default)] pub subject: Option, /// Available permission options for the user to choose from. + /// Must contain at least one option. + #[schemars(length(min = 1))] pub options: Vec, /// The _meta property is reserved by ACP to allow clients and agents to attach additional /// metadata to their interactions. Implementations MUST NOT make assumptions about values at diff --git a/agent-client-protocol-schema/src/v2/content.rs b/agent-client-protocol-schema/src/v2/content.rs index 44477eb56..01b791fc9 100644 --- a/agent-client-protocol-schema/src/v2/content.rs +++ b/agent-client-protocol-schema/src/v2/content.rs @@ -742,8 +742,10 @@ pub struct Annotations { #[serde(default)] pub audience: Option>, /// Timestamp indicating when the underlying resource was last modified. + /// + /// Must be an ISO 8601 formatted string (e.g., "2025-01-12T15:00:58Z"). #[serde_as(deserialize_as = "DefaultOnError")] - #[schemars(extend("x-deserialize-default-on-error" = true))] + #[schemars(extend("x-deserialize-default-on-error" = true, "format" = "date-time"))] #[serde(default)] pub last_modified: Option, /// Relative importance of this content when clients choose what to surface. @@ -984,6 +986,7 @@ mod tests { assert_eq!(json["properties"]["priority"]["minimum"], 0); assert_eq!(json["properties"]["priority"]["maximum"], 1); + assert_eq!(json["properties"]["lastModified"]["format"], "date-time"); } #[test] diff --git a/agent-client-protocol-schema/src/v2/elicitation.rs b/agent-client-protocol-schema/src/v2/elicitation.rs index 1bfcc3f71..71941e761 100644 --- a/agent-client-protocol-schema/src/v2/elicitation.rs +++ b/agent-client-protocol-schema/src/v2/elicitation.rs @@ -142,6 +142,7 @@ pub struct StringPropertySchema { #[serde(default)] pub max_length: Option, /// Pattern the string must match. + #[schemars(extend("format" = "regex"))] #[serde(default)] pub pattern: Option, /// String format. @@ -153,10 +154,14 @@ pub struct StringPropertySchema { #[serde(default)] pub default: Option, /// Enum values for untitled single-select enums. + /// Must contain at least one value when present. + #[schemars(length(min = 1))] #[serde(default)] #[serde(rename = "enum")] pub enum_values: Option>, /// Titled enum options for titled single-select enums. + /// Must contain at least one option when present. + #[schemars(length(min = 1))] #[serde(default)] #[serde(rename = "oneOf")] pub one_of: Option>, @@ -558,7 +563,8 @@ impl BooleanPropertySchema { #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] #[non_exhaustive] pub struct StringMultiSelectItems { - /// Allowed enum values. + /// Allowed enum values. Must contain at least one value. + #[schemars(length(min = 1))] #[serde(rename = "enum")] pub values: Vec, /// The _meta property is reserved by ACP to allow clients and agents to attach additional @@ -598,7 +604,8 @@ impl StringMultiSelectItems { #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] #[non_exhaustive] pub struct TitledMultiSelectItems { - /// Titled enum options. + /// Titled enum options. Must contain at least one option. + #[schemars(length(min = 1))] #[serde(rename = "anyOf")] pub options: Vec, /// The _meta property is reserved by ACP to allow clients and agents to attach additional @@ -1667,7 +1674,7 @@ pub struct ElicitationUrlMode { /// The unique identifier for this elicitation. pub elicitation_id: ElicitationId, /// The URL to direct the user to. - #[schemars(extend("format" = "uri"))] + #[schemars(url)] pub url: String, } diff --git a/agent-client-protocol-schema/src/v2/nes.rs b/agent-client-protocol-schema/src/v2/nes.rs index 0ad87ea82..57bc59e2d 100644 --- a/agent-client-protocol-schema/src/v2/nes.rs +++ b/agent-client-protocol-schema/src/v2/nes.rs @@ -1028,6 +1028,7 @@ pub struct DidOpenDocumentNotification { /// The session ID for this notification. pub session_id: SessionId, /// The URI of the opened document. + #[schemars(url)] pub uri: String, /// The language identifier of the document (e.g., "rust", "python"). pub language_id: String, @@ -1090,6 +1091,7 @@ pub struct DidChangeDocumentNotification { /// The session ID for this notification. pub session_id: SessionId, /// The URI of the changed document. + #[schemars(url)] pub uri: String, /// The new version number of the document. pub version: i64, @@ -1210,6 +1212,7 @@ pub struct DidCloseDocumentNotification { /// The session ID for this notification. pub session_id: SessionId, /// The URI of the closed document. + #[schemars(url)] pub uri: String, /// The _meta property is reserved by ACP to allow clients and agents to attach additional /// metadata to their interactions. Implementations MUST NOT make assumptions about values at @@ -1257,6 +1260,7 @@ pub struct DidSaveDocumentNotification { /// The session ID for this notification. pub session_id: SessionId, /// The URI of the saved document. + #[schemars(url)] pub uri: String, /// The _meta property is reserved by ACP to allow clients and agents to attach additional /// metadata to their interactions. Implementations MUST NOT make assumptions about values at @@ -1304,6 +1308,7 @@ pub struct DidFocusDocumentNotification { /// The session ID for this notification. pub session_id: SessionId, /// The URI of the focused document. + #[schemars(url)] pub uri: String, /// The version number of the document. pub version: i64, @@ -1368,6 +1373,7 @@ pub struct StartNesRequest { /// The root URI of the workspace. #[serde_as(deserialize_as = "DefaultOnError")] #[schemars(extend("x-deserialize-default-on-error" = true))] + #[schemars(url)] #[serde(default)] pub workspace_uri: Option, /// The workspace folders. @@ -1452,6 +1458,7 @@ impl Default for StartNesRequest { #[non_exhaustive] pub struct WorkspaceFolder { /// The URI of the folder. + #[schemars(url)] pub uri: String, /// The display name of the folder. pub name: String, @@ -1710,6 +1717,7 @@ pub struct SuggestNesRequest { /// The session ID for this request. pub session_id: SessionId, /// The URI of the document to suggest for. + #[schemars(url)] pub uri: String, /// The version number of the document. pub version: i64, @@ -1892,6 +1900,7 @@ impl NesSuggestContext { #[non_exhaustive] pub struct NesRecentFile { /// The URI of the file. + #[schemars(url)] pub uri: String, /// The language identifier. pub language_id: String, @@ -1945,6 +1954,7 @@ impl NesRecentFile { #[non_exhaustive] pub struct NesRelatedSnippet { /// The URI of the file containing the snippets. + #[schemars(url)] pub uri: String, /// The code excerpts. pub excerpts: Vec, @@ -2040,6 +2050,7 @@ impl NesExcerpt { #[non_exhaustive] pub struct NesEditHistoryEntry { /// The URI of the edited file. + #[schemars(url)] pub uri: String, /// A diff representing the edit. pub diff: String, @@ -2088,6 +2099,7 @@ pub struct NesUserAction { /// The kind of action (e.g., "insertChar", "cursorMovement"). pub action: String, /// The URI of the file where the action occurred. + #[schemars(url)] pub uri: String, /// The position where the action occurred. pub position: Position, @@ -2143,6 +2155,7 @@ impl NesUserAction { #[non_exhaustive] pub struct NesOpenFile { /// The URI of the file. + #[schemars(url)] pub uri: String, /// The language identifier. pub language_id: String, @@ -2215,6 +2228,7 @@ impl NesOpenFile { #[non_exhaustive] pub struct NesDiagnostic { /// The URI of the file containing the diagnostic. + #[schemars(url)] pub uri: String, /// The range of the diagnostic. pub range: Range, @@ -2455,8 +2469,10 @@ pub struct NesEditSuggestion { /// Unique identifier for accept/reject tracking. pub suggestion_id: NesSuggestionId, /// The URI of the file to edit. + #[schemars(url)] pub uri: String, - /// The text edits to apply. + /// The text edits to apply. Must contain at least one edit. + #[schemars(length(min = 1))] pub edits: Vec, /// Optional suggested cursor position after applying edits. #[serde_as(deserialize_as = "DefaultOnError")] @@ -2567,6 +2583,7 @@ pub struct NesJumpSuggestion { /// Unique identifier for accept/reject tracking. pub suggestion_id: NesSuggestionId, /// The file to navigate to. + #[schemars(url)] pub uri: String, /// The target position within the file. pub position: Position, @@ -2620,6 +2637,7 @@ pub struct NesRenameSuggestion { /// Unique identifier for accept/reject tracking. pub suggestion_id: NesSuggestionId, /// The file URI containing the symbol. + #[schemars(url)] pub uri: String, /// The position of the symbol to rename. pub position: Position, @@ -2677,6 +2695,7 @@ pub struct NesSearchAndReplaceSuggestion { /// Unique identifier for accept/reject tracking. pub suggestion_id: NesSuggestionId, /// The file URI to search within. + #[schemars(url)] pub uri: String, /// The text or pattern to find. pub search: String, diff --git a/agent-client-protocol-schema/src/v2/plan.rs b/agent-client-protocol-schema/src/v2/plan.rs index 8c6724925..bbbe8a275 100644 --- a/agent-client-protocol-schema/src/v2/plan.rs +++ b/agent-client-protocol-schema/src/v2/plan.rs @@ -280,6 +280,7 @@ pub struct PlanFile { /// The plan ID to update. pub plan_id: PlanId, /// The URI of the file containing the plan. + #[schemars(url)] pub uri: String, /// The _meta property is reserved by ACP to allow clients and agents to attach additional /// metadata to their interactions. Implementations MUST NOT make assumptions about values at diff --git a/docs/protocol/v2/draft/schema.mdx b/docs/protocol/v2/draft/schema.mdx index f1b10c046..36232cb61 100644 --- a/docs/protocol/v2/draft/schema.mdx +++ b/docs/protocol/v2/draft/schema.mdx @@ -1964,6 +1964,7 @@ permission description was provided. PermissionOption[]} required> Available permission options for the user to choose from. +Must contain at least one option. SessionId} required> The session ID for this request. @@ -2272,6 +2273,9 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/d Timestamp indicating when the underlying resource was last modified. + +Must be an ISO 8601 formatted string (e.g., "2025-01-12T15:00:58Z"). + Relative importance of this content when clients choose what to surface. @@ -3203,6 +3207,9 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/d ISO 4217 currency code (e.g., "USD", "EUR"). + + - Pattern: `"^[A-Z]{3}$"` + ## Diff @@ -3683,6 +3690,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/d <>"string"[] | null} > Enum values for untitled single-select enums. +Must contain at least one value when present. StringFormat | null} > String format. @@ -3701,6 +3709,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/d EnumOption[] | null} > Titled enum options for titled single-select enums. +Must contain at least one option when present. Pattern the string must match. @@ -4958,7 +4967,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/d "string"[]} required> - Allowed enum values. + Allowed enum values. Must contain at least one value. The discriminator value. Must be `"string"`. @@ -4998,7 +5007,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/d EnumOption[]} required> - Titled enum options. + Titled enum options. Must contain at least one option. @@ -5369,7 +5378,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/d Optional suggested cursor position after applying edits. NesTextEdit[]} required> - The text edits to apply. + The text edits to apply. Must contain at least one edit. NesSuggestionId} required> Unique identifier for accept/reject tracking. @@ -5821,7 +5830,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/d Optional suggested cursor position after applying edits. NesTextEdit[]} required> - The text edits to apply. + The text edits to apply. Must contain at least one edit. The discriminator value. Must be `"edit"`. @@ -8295,7 +8304,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/d "string"[]} required> - Allowed enum values. + Allowed enum values. Must contain at least one value. ## StringPropertySchema @@ -8325,6 +8334,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/d <>"string"[] | null} > Enum values for untitled single-select enums. +Must contain at least one value when present. StringFormat | null} > String format. @@ -8343,6 +8353,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/d EnumOption[] | null} > Titled enum options for titled single-select enums. +Must contain at least one option when present. Pattern the string must match. @@ -8500,7 +8511,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/d EnumOption[]} required> - Titled enum options. + Titled enum options. Must contain at least one option. ## ToolCallContent diff --git a/docs/protocol/v2/schema.mdx b/docs/protocol/v2/schema.mdx index 312578aa4..a0ceb3df4 100644 --- a/docs/protocol/v2/schema.mdx +++ b/docs/protocol/v2/schema.mdx @@ -725,6 +725,7 @@ permission description was provided. PermissionOption[]} required> Available permission options for the user to choose from. +Must contain at least one option. SessionId} required> The session ID for this request. @@ -1003,6 +1004,9 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/e Timestamp indicating when the underlying resource was last modified. + +Must be an ISO 8601 formatted string (e.g., "2025-01-12T15:00:58Z"). + Relative importance of this content when clients choose what to surface. @@ -1608,6 +1612,9 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/e ISO 4217 currency code (e.g., "USD", "EUR"). + + - Pattern: `"^[A-Z]{3}$"` + ## Diff diff --git a/docs/protocol/v2/tool-calls.mdx b/docs/protocol/v2/tool-calls.mdx index 6ed0205c1..6632d272c 100644 --- a/docs/protocol/v2/tool-calls.mdx +++ b/docs/protocol/v2/tool-calls.mdx @@ -223,7 +223,7 @@ The Agent **MAY** request permission from the user before proceeding with an ope Available [permission options](#permission-options) for the user to choose - from + from. Must contain at least one option. The Client responds with the user's decision: diff --git a/schema/v2/schema.json b/schema/v2/schema.json index 7e76211a0..7995d302f 100644 --- a/schema/v2/schema.json +++ b/schema/v2/schema.json @@ -557,11 +557,12 @@ ] }, "options": { - "description": "Available permission options for the user to choose from.", + "description": "Available permission options for the user to choose from.\nMust contain at least one option.", "type": "array", "items": { "$ref": "#/$defs/PermissionOption" - } + }, + "minItems": 1 }, "_meta": { "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/extensibility)", @@ -1045,8 +1046,9 @@ "x-deserialize-skip-invalid-items": true }, "lastModified": { - "description": "Timestamp indicating when the underlying resource was last modified.", + "description": "Timestamp indicating when the underlying resource was last modified.\n\nMust be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").", "type": ["string", "null"], + "format": "date-time", "x-deserialize-default-on-error": true }, "priority": { @@ -2831,6 +2833,7 @@ "updatedAt": { "description": "ISO 8601 timestamp of last activity", "type": ["string", "null"], + "format": "date-time", "x-deserialize-default-on-error": true }, "_meta": { @@ -4199,6 +4202,7 @@ "updatedAt": { "description": "ISO 8601 timestamp of last activity. Set to null to clear.", "type": ["string", "null"], + "format": "date-time", "x-deserialize-default-on-error": true }, "_meta": { @@ -4220,7 +4224,8 @@ }, "currency": { "description": "ISO 4217 currency code (e.g., \"USD\", \"EUR\").", - "type": "string" + "type": "string", + "pattern": "^[A-Z]{3}$" }, "_meta": { "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/extensibility)", diff --git a/schema/v2/schema.unstable.json b/schema/v2/schema.unstable.json index 1dfd91ee3..0fd208ab2 100644 --- a/schema/v2/schema.unstable.json +++ b/schema/v2/schema.unstable.json @@ -701,11 +701,12 @@ ] }, "options": { - "description": "Available permission options for the user to choose from.", + "description": "Available permission options for the user to choose from.\nMust contain at least one option.", "type": "array", "items": { "$ref": "#/$defs/PermissionOption" - } + }, + "minItems": 1 }, "_meta": { "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", @@ -1189,8 +1190,9 @@ "x-deserialize-skip-invalid-items": true }, "lastModified": { - "description": "Timestamp indicating when the underlying resource was last modified.", + "description": "Timestamp indicating when the underlying resource was last modified.\n\nMust be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").", "type": ["string", "null"], + "format": "date-time", "x-deserialize-default-on-error": true }, "priority": { @@ -2442,7 +2444,8 @@ }, "pattern": { "description": "Pattern the string must match.", - "type": ["string", "null"] + "type": ["string", "null"], + "format": "regex" }, "format": { "description": "String format.", @@ -2461,18 +2464,20 @@ "x-deserialize-default-on-error": true }, "enum": { - "description": "Enum values for untitled single-select enums.", + "description": "Enum values for untitled single-select enums.\nMust contain at least one value when present.", "type": ["array", "null"], "items": { "type": "string" - } + }, + "minItems": 1 }, "oneOf": { - "description": "Titled enum options for titled single-select enums.", + "description": "Titled enum options for titled single-select enums.\nMust contain at least one option when present.", "type": ["array", "null"], "items": { "$ref": "#/$defs/EnumOption" - } + }, + "minItems": 1 }, "_meta": { "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", @@ -2650,11 +2655,12 @@ "type": "object", "properties": { "enum": { - "description": "Allowed enum values.", + "description": "Allowed enum values. Must contain at least one value.", "type": "array", "items": { "type": "string" - } + }, + "minItems": 1 }, "_meta": { "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", @@ -2670,11 +2676,12 @@ "type": "object", "properties": { "anyOf": { - "description": "Titled enum options.", + "description": "Titled enum options. Must contain at least one option.", "type": "array", "items": { "$ref": "#/$defs/EnumOption" - } + }, + "minItems": 1 }, "_meta": { "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", @@ -4189,6 +4196,7 @@ "link": { "description": "Optional link to a page where the user can obtain their credentials.", "type": ["string", "null"], + "format": "uri", "x-deserialize-default-on-error": true }, "_meta": { @@ -4433,7 +4441,8 @@ }, "baseUrl": { "description": "Base URL currently used by this provider.", - "type": "string" + "type": "string", + "format": "uri" }, "_meta": { "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", @@ -4857,6 +4866,7 @@ "updatedAt": { "description": "ISO 8601 timestamp of last activity", "type": ["string", "null"], + "format": "date-time", "x-deserialize-default-on-error": true }, "_meta": { @@ -5268,14 +5278,16 @@ }, "uri": { "description": "The URI of the file to edit.", - "type": "string" + "type": "string", + "format": "uri" }, "edits": { - "description": "The text edits to apply.", + "description": "The text edits to apply. Must contain at least one edit.", "type": "array", "items": { "$ref": "#/$defs/NesTextEdit" - } + }, + "minItems": 1 }, "cursorPosition": { "description": "Optional suggested cursor position after applying edits.", @@ -5312,7 +5324,8 @@ }, "uri": { "description": "The file to navigate to.", - "type": "string" + "type": "string", + "format": "uri" }, "position": { "description": "The target position within the file.", @@ -5345,7 +5358,8 @@ }, "uri": { "description": "The file URI containing the symbol.", - "type": "string" + "type": "string", + "format": "uri" }, "position": { "description": "The position of the symbol to rename.", @@ -5382,7 +5396,8 @@ }, "uri": { "description": "The file URI to search within.", - "type": "string" + "type": "string", + "format": "uri" }, "search": { "description": "The text or pattern to find.", @@ -6668,7 +6683,8 @@ }, "uri": { "description": "The URI of the file containing the plan.", - "type": "string" + "type": "string", + "format": "uri" }, "_meta": { "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", @@ -6903,6 +6919,7 @@ "updatedAt": { "description": "ISO 8601 timestamp of last activity. Set to null to clear.", "type": ["string", "null"], + "format": "date-time", "x-deserialize-default-on-error": true }, "_meta": { @@ -6924,7 +6941,8 @@ }, "currency": { "description": "ISO 4217 currency code (e.g., \"USD\", \"EUR\").", - "type": "string" + "type": "string", + "pattern": "^[A-Z]{3}$" }, "_meta": { "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", @@ -7572,7 +7590,8 @@ }, "baseUrl": { "description": "Base URL for requests sent through this provider.", - "type": "string" + "type": "string", + "format": "uri" }, "headers": { "description": "Full headers map for this provider.\nMay include authorization, routing, or other integration-specific headers.", @@ -8265,6 +8284,7 @@ "workspaceUri": { "description": "The root URI of the workspace.", "type": ["string", "null"], + "format": "uri", "x-deserialize-default-on-error": true }, "workspaceFolders": { @@ -8302,7 +8322,8 @@ "properties": { "uri": { "description": "The URI of the folder.", - "type": "string" + "type": "string", + "format": "uri" }, "name": { "description": "The display name of the folder.", @@ -8356,7 +8377,8 @@ }, "uri": { "description": "The URI of the document to suggest for.", - "type": "string" + "type": "string", + "format": "uri" }, "version": { "description": "The version number of the document.", @@ -8497,7 +8519,8 @@ "properties": { "uri": { "description": "The URI of the file.", - "type": "string" + "type": "string", + "format": "uri" }, "languageId": { "description": "The language identifier.", @@ -8522,7 +8545,8 @@ "properties": { "uri": { "description": "The URI of the file containing the snippets.", - "type": "string" + "type": "string", + "format": "uri" }, "excerpts": { "description": "The code excerpts.", @@ -8575,7 +8599,8 @@ "properties": { "uri": { "description": "The URI of the edited file.", - "type": "string" + "type": "string", + "format": "uri" }, "diff": { "description": "A diff representing the edit.", @@ -8600,7 +8625,8 @@ }, "uri": { "description": "The URI of the file where the action occurred.", - "type": "string" + "type": "string", + "format": "uri" }, "position": { "description": "The position where the action occurred.", @@ -8631,7 +8657,8 @@ "properties": { "uri": { "description": "The URI of the file.", - "type": "string" + "type": "string", + "format": "uri" }, "languageId": { "description": "The language identifier.", @@ -8671,7 +8698,8 @@ "properties": { "uri": { "description": "The URI of the file containing the diagnostic.", - "type": "string" + "type": "string", + "format": "uri" }, "range": { "description": "The range of the diagnostic.", @@ -9317,7 +9345,8 @@ }, "uri": { "description": "The URI of the opened document.", - "type": "string" + "type": "string", + "format": "uri" }, "languageId": { "description": "The language identifier of the document (e.g., \"rust\", \"python\").", @@ -9357,7 +9386,8 @@ }, "uri": { "description": "The URI of the changed document.", - "type": "string" + "type": "string", + "format": "uri" }, "version": { "description": "The new version number of the document.", @@ -9426,7 +9456,8 @@ }, "uri": { "description": "The URI of the closed document.", - "type": "string" + "type": "string", + "format": "uri" }, "_meta": { "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", @@ -9453,7 +9484,8 @@ }, "uri": { "description": "The URI of the saved document.", - "type": "string" + "type": "string", + "format": "uri" }, "_meta": { "description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)", @@ -9480,7 +9512,8 @@ }, "uri": { "description": "The URI of the focused document.", - "type": "string" + "type": "string", + "format": "uri" }, "version": { "description": "The version number of the document.",