Skip to content

Commit 29a2b2e

Browse files
committed
Reference docs from doc comments
1 parent f594139 commit 29a2b2e

6 files changed

Lines changed: 84 additions & 14 deletions

File tree

docs/protocol/schema.mdx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,11 @@ An environment variable to set when launching an MCP server.
10201020

10211021
Request parameters for extension method calls.
10221022

1023+
Used with the `_method` extension point to add custom request-response functionality
1024+
to the protocol while maintaining compatibility.
1025+
1026+
See protocol docs: [Extension Methods](https://agentclientprotocol.com/protocol/extensibility#extension-methods)
1027+
10231028
**Type:** Object
10241029

10251030
**Properties:**
@@ -1039,9 +1044,18 @@ methods with a unique identifier such as domain name.
10391044

10401045
Response from extension method calls.
10411046

1047+
Contains the result of a custom extension method request.
1048+
1049+
See protocol docs: [Extension Methods](https://agentclientprotocol.com/protocol/extensibility#extension-methods)
1050+
10421051
## <span class="font-mono">ExtNotification</span>
10431052

1044-
Extension notification parameters
1053+
Extension notification parameters.
1054+
1055+
Used with the `_notification` extension point to add custom one-way messages
1056+
to the protocol while maintaining compatibility.
1057+
1058+
See protocol docs: [Extension Methods](https://agentclientprotocol.com/protocol/extensibility#extension-methods)
10451059

10461060
**Type:** Object
10471061

rust/agent.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,24 @@ pub trait Agent {
118118
/// See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)
119119
fn cancel(&self, args: CancelNotification) -> impl Future<Output = Result<(), Error>>;
120120

121-
/// Extension method
121+
/// Handles extension method requests from the client.
122122
///
123-
/// Allows the Client to send an arbitrary request that is not part of the ACP spec.
123+
/// Extension methods provide a way to add custom functionality while maintaining
124+
/// protocol compatibility.
125+
///
126+
/// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
124127
fn ext_method(
125128
&self,
126129
method: Arc<str>,
127130
params: serde_json::Value,
128131
) -> impl Future<Output = Result<serde_json::Value, Error>>;
129132

130-
/// Extension notification
133+
/// Handles extension notifications from the client.
134+
///
135+
/// Extension notifications provide a way to send one-way messages for custom functionality
136+
/// while maintaining protocol compatibility.
131137
///
132-
/// Allows the Client to send an arbitrary notification that is not part of the ACP spec.
138+
/// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
133139
fn ext_notification(
134140
&self,
135141
method: Arc<str>,

rust/client.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,26 @@ pub trait Client {
124124
#[cfg(feature = "unstable")]
125125
fn kill_terminal(&self, args: KillTerminalRequest) -> impl Future<Output = Result<(), Error>>;
126126

127-
/// Extension method
127+
/// Handles extension method requests from the agent.
128128
///
129129
/// Allows the Agent to send an arbitrary request that is not part of the ACP spec.
130+
/// Extension methods provide a way to add custom functionality while maintaining
131+
/// protocol compatibility.
132+
///
133+
/// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
130134
fn ext_method(
131135
&self,
132136
method: Arc<str>,
133137
params: serde_json::Value,
134138
) -> impl Future<Output = Result<serde_json::Value, Error>>;
135139

136-
/// Extension notification
140+
/// Handles extension notifications from the agent.
141+
///
142+
/// Allows the Agent to send an arbitrary notification that is not part of the ACP spec.
143+
/// Extension notifications provide a way to send one-way messages for custom functionality
144+
/// while maintaining protocol compatibility.
137145
///
138-
/// Allows the Agent to send an arbitrary notifiation that is not part of the ACP spec.
146+
/// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
139147
fn ext_notification(
140148
&self,
141149
method: Arc<str>,

rust/ext.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ pub const EXT_METHOD_NAME: &str = "_method";
1010
pub const EXT_NOTIFICATION_NAME: &str = "_notification";
1111

1212
/// Request parameters for extension method calls.
13+
///
14+
/// Used with the `_method` extension point to add custom request-response functionality
15+
/// to the protocol while maintaining compatibility.
16+
///
17+
/// See protocol docs: [Extension Methods](https://agentclientprotocol.com/protocol/extensibility#extension-methods)
1318
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
1419
#[schemars(extend("x-method" = "_method"))]
1520
#[serde(rename_all = "camelCase")]
@@ -24,12 +29,21 @@ pub struct ExtMethodRequest {
2429
}
2530

2631
/// Response from extension method calls.
32+
///
33+
/// Contains the result of a custom extension method request.
34+
///
35+
/// See protocol docs: [Extension Methods](https://agentclientprotocol.com/protocol/extensibility#extension-methods)
2736
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
2837
#[schemars(extend("x-method" = "_method"))]
2938
#[serde(transparent)]
3039
pub struct ExtMethodResponse(pub serde_json::Value);
3140

32-
/// Extension notification parameters
41+
/// Extension notification parameters.
42+
///
43+
/// Used with the `_notification` extension point to add custom one-way messages
44+
/// to the protocol while maintaining compatibility.
45+
///
46+
/// See protocol docs: [Extension Methods](https://agentclientprotocol.com/protocol/extensibility#extension-methods)
3347
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
3448
#[schemars(extend("x-method" = "_notification"))]
3549
#[serde(rename_all = "camelCase")]

schema/schema.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@
672672
"type": "object"
673673
},
674674
"ExtMethodRequest": {
675-
"description": "Request parameters for extension method calls.",
675+
"description": "Request parameters for extension method calls.\n\nUsed with the `_method` extension point to add custom request-response functionality\nto the protocol while maintaining compatibility.\n\nSee protocol docs: [Extension Methods](https://agentclientprotocol.com/protocol/extensibility#extension-methods)",
676676
"properties": {
677677
"method": {
678678
"description": "The identifier for the extension method.\n\nTo help avoid conflicts, it's a good practice to prefix extension\nmethods with a unique identifier such as domain name.",
@@ -687,11 +687,11 @@
687687
"x-method": "_method"
688688
},
689689
"ExtMethodResponse": {
690-
"description": "Response from extension method calls.",
690+
"description": "Response from extension method calls.\n\nContains the result of a custom extension method request.\n\nSee protocol docs: [Extension Methods](https://agentclientprotocol.com/protocol/extensibility#extension-methods)",
691691
"x-method": "_method"
692692
},
693693
"ExtNotification": {
694-
"description": "Extension notification parameters",
694+
"description": "Extension notification parameters.\n\nUsed with the `_notification` extension point to add custom one-way messages\nto the protocol while maintaining compatibility.\n\nSee protocol docs: [Extension Methods](https://agentclientprotocol.com/protocol/extensibility#extension-methods)",
695695
"properties": {
696696
"method": {
697697
"description": "The identifier for the extension method.\n\nTo help avoid conflicts, it's a good practice to prefix extension\nmethods with a unique identifier such as domain name.",

typescript/schema.ts

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,11 @@ export interface KillTerminalRequest {
720720
}
721721
/**
722722
* Request parameters for extension method calls.
723+
*
724+
* Used with the `_method` extension point to add custom request-response functionality
725+
* to the protocol while maintaining compatibility.
726+
*
727+
* See protocol docs: [Extension Methods](https://agentclientprotocol.com/protocol/extensibility#extension-methods)
723728
*/
724729
export interface ExtMethodRequest {
725730
/**
@@ -815,6 +820,10 @@ export interface WaitForTerminalExitResponse {
815820
}
816821
/**
817822
* Response from extension method calls.
823+
*
824+
* Contains the result of a custom extension method request.
825+
*
826+
* See protocol docs: [Extension Methods](https://agentclientprotocol.com/protocol/extensibility#extension-methods)
818827
*/
819828
export interface ExtMethodResponse {
820829
[k: string]: unknown;
@@ -851,7 +860,12 @@ export interface CancelNotification {
851860
sessionId: string;
852861
}
853862
/**
854-
* Extension notification parameters
863+
* Extension notification parameters.
864+
*
865+
* Used with the `_notification` extension point to add custom one-way messages
866+
* to the protocol while maintaining compatibility.
867+
*
868+
* See protocol docs: [Extension Methods](https://agentclientprotocol.com/protocol/extensibility#extension-methods)
855869
*/
856870
export interface ExtNotification {
857871
/**
@@ -1114,6 +1128,11 @@ export interface PromptRequest {
11141128
}
11151129
/**
11161130
* Request parameters for extension method calls.
1131+
*
1132+
* Used with the `_method` extension point to add custom request-response functionality
1133+
* to the protocol while maintaining compatibility.
1134+
*
1135+
* See protocol docs: [Extension Methods](https://agentclientprotocol.com/protocol/extensibility#extension-methods)
11171136
*/
11181137
export interface ExtMethodRequest1 {
11191138
/**
@@ -1357,6 +1376,10 @@ export interface PromptResponse {
13571376
}
13581377
/**
13591378
* Response from extension method calls.
1379+
*
1380+
* Contains the result of a custom extension method request.
1381+
*
1382+
* See protocol docs: [Extension Methods](https://agentclientprotocol.com/protocol/extensibility#extension-methods)
13601383
*/
13611384
export interface ExtMethodResponse1 {
13621385
[k: string]: unknown;
@@ -1583,7 +1606,12 @@ export interface UnstructuredCommandInput {
15831606
hint: string;
15841607
}
15851608
/**
1586-
* Extension notification parameters
1609+
* Extension notification parameters.
1610+
*
1611+
* Used with the `_notification` extension point to add custom one-way messages
1612+
* to the protocol while maintaining compatibility.
1613+
*
1614+
* See protocol docs: [Extension Methods](https://agentclientprotocol.com/protocol/extensibility#extension-methods)
15871615
*/
15881616
export interface ExtNotification1 {
15891617
/**

0 commit comments

Comments
 (0)