Skip to content
Merged
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
5 changes: 4 additions & 1 deletion agent-client-protocol-schema/src/v2/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
/// The _meta property is reserved by ACP to allow clients and agents to attach additional
Expand Down Expand Up @@ -2013,7 +2014,7 @@ pub struct SessionInfo {
pub title: Option<String>,
/// 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<String>,
/// The _meta property is reserved by ACP to allow clients and agents to attach additional
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
5 changes: 4 additions & 1 deletion agent-client-protocol-schema/src/v2/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
}

impl UpdateSessionNotification {
/// Builds [`SessionNotification`] with the required notification fields set; optional fields start unset or empty.

Check warning on line 69 in agent-client-protocol-schema/src/v2/client.rs

View workflow job for this annotation

GitHub Actions / Build

unresolved link to `SessionNotification`
#[must_use]
pub fn new(session_id: impl Into<SessionId>, update: SessionUpdate) -> Self {
Self {
Expand Down Expand Up @@ -341,7 +341,7 @@
pub title: MaybeUndefined<String>,
/// 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<String>,
/// The _meta property is reserved by ACP to allow clients and agents to attach additional
Expand Down Expand Up @@ -710,6 +710,7 @@
/// 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
Expand Down Expand Up @@ -1297,6 +1298,8 @@
#[serde(default)]
pub subject: Option<RequestPermissionSubject>,
/// Available permission options for the user to choose from.
/// Must contain at least one option.
#[schemars(length(min = 1))]
pub options: Vec<PermissionOption>,
/// 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
Expand Down
5 changes: 4 additions & 1 deletion agent-client-protocol-schema/src/v2/content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,10 @@ pub struct Annotations {
#[serde(default)]
pub audience: Option<Vec<Role>>,
/// 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<String>,
/// Relative importance of this content when clients choose what to surface.
Expand Down Expand Up @@ -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]
Expand Down
13 changes: 10 additions & 3 deletions agent-client-protocol-schema/src/v2/elicitation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ pub struct StringPropertySchema {
#[serde(default)]
pub max_length: Option<u32>,
/// Pattern the string must match.
#[schemars(extend("format" = "regex"))]
#[serde(default)]
pub pattern: Option<String>,
/// String format.
Expand All @@ -153,10 +154,14 @@ pub struct StringPropertySchema {
#[serde(default)]
pub default: Option<String>,
/// 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<Vec<String>>,
/// 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<Vec<EnumOption>>,
Expand Down Expand Up @@ -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<String>,
/// The _meta property is reserved by ACP to allow clients and agents to attach additional
Expand Down Expand Up @@ -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<EnumOption>,
/// The _meta property is reserved by ACP to allow clients and agents to attach additional
Expand Down Expand Up @@ -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,
}

Expand Down
21 changes: 20 additions & 1 deletion agent-client-protocol-schema/src/v2/nes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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<String>,
/// The workspace folders.
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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<NesExcerpt>,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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<NesTextEdit>,
/// Optional suggested cursor position after applying edits.
#[serde_as(deserialize_as = "DefaultOnError")]
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions agent-client-protocol-schema/src/v2/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading