Skip to content

Commit 0c27b74

Browse files
committed
Fix search links
Signed-off-by: Ben Brandt <benjamin.j.brandt@gmail.com>
1 parent ba70f59 commit 0c27b74

2 files changed

Lines changed: 24 additions & 4 deletions

File tree

docs/protocol/schema.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ The client should disconnect, if it doesn't support this version.
109109

110110
</ResponseField>
111111

112+
<a id="session-cancel"></a>
112113
### <span class="font-mono">session/cancel</span>
113114

114115
Cancels ongoing operations for a session.
@@ -142,6 +143,7 @@ See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/promp
142143
The ID of the session to cancel operations for.
143144
</ResponseField>
144145

146+
<a id="session-load"></a>
145147
### <span class="font-mono">session/load</span>
146148

147149
Loads an existing session to resume a previous conversation.
@@ -193,6 +195,7 @@ See protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/s
193195
The ID of the session to load.
194196
</ResponseField>
195197

198+
<a id="session-new"></a>
196199
### <span class="font-mono">session/new</span>
197200

198201
Creates a new conversation session with the agent.
@@ -254,6 +257,7 @@ Used in all subsequent requests for this conversation.
254257

255258
</ResponseField>
256259

260+
<a id="session-prompt"></a>
257261
### <span class="font-mono">session/prompt</span>
258262

259263
Processes a user prompt within a session.
@@ -327,6 +331,7 @@ Clients are typically code editors (IDEs, text editors) that provide the interfa
327331
between users and AI agents. They manage the environment, handle user interactions,
328332
and control access to resources.
329333

334+
<a id="fs-read_text_file"></a>
330335
### <span class="font-mono">fs/read_text_file</span>
331336

332337
Reads content from a text file in the client's file system.
@@ -365,6 +370,7 @@ Only available if the client supports the `fs.readTextFile` capability.
365370
The session ID for this request.
366371
</ResponseField>
367372

373+
<a id="fs-write_text_file"></a>
368374
### <span class="font-mono">fs/write_text_file</span>
369375

370376
Writes content to a text file in the client's file system.
@@ -398,6 +404,7 @@ Only available if the client supports the `fs.writeTextFile` capability.
398404
The session ID for this request.
399405
</ResponseField>
400406

407+
<a id="session-request_permission"></a>
401408
### <span class="font-mono">session/request_permission</span>
402409

403410
Requests permission from the user for a tool call operation.
@@ -468,6 +475,7 @@ Response to a permission request.
468475
The user's decision on the permission request.
469476
</ResponseField>
470477

478+
<a id="session-update"></a>
471479
### <span class="font-mono">session/update</span>
472480

473481
Handles session update notifications from the agent.

rust/markdown_generator.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,18 @@ impl MarkdownGenerator {
9999
docs: &str,
100100
mut method_types: Vec<(String, Value)>,
101101
) {
102+
if method.contains('/') {
103+
writeln!(
104+
&mut self.output,
105+
"<a id=\"{}\"></a>",
106+
Self::anchor_text(method).replace("/", "-")
107+
)
108+
.unwrap();
109+
}
102110
writeln!(
103111
&mut self.output,
104112
"### <span class=\"font-mono\">{}</span>",
105-
method
113+
method,
106114
)
107115
.unwrap();
108116
writeln!(&mut self.output).unwrap();
@@ -121,7 +129,7 @@ impl MarkdownGenerator {
121129
&mut self.output,
122130
"{} <span class=\"font-mono\">{}</span>",
123131
"#".repeat(headline_level),
124-
name
132+
name,
125133
)
126134
.unwrap();
127135
writeln!(&mut self.output).unwrap();
@@ -449,7 +457,7 @@ impl MarkdownGenerator {
449457
let type_name = ref_val.strip_prefix("#/$defs/").unwrap_or(ref_val);
450458
return format!(
451459
"<a href=\"#{}\">{}</a>",
452-
type_name.to_lowercase(),
460+
Self::anchor_text(type_name),
453461
type_name
454462
);
455463
}
@@ -536,7 +544,7 @@ impl MarkdownGenerator {
536544
let type_name = ref_val.strip_prefix("#/$defs/").unwrap_or(ref_val);
537545
return Some(format!(
538546
"<a href=\"#{}\">{}</a>",
539-
type_name.to_lowercase(),
547+
Self::anchor_text(type_name),
540548
type_name
541549
));
542550
}
@@ -577,6 +585,10 @@ impl MarkdownGenerator {
577585
let desc = Self::escape_mdx(&desc);
578586
Some(desc)
579587
}
588+
589+
fn anchor_text(title: &str) -> String {
590+
title.to_lowercase()
591+
}
580592
}
581593

582594
struct SideDocs {

0 commit comments

Comments
 (0)