Skip to content

Commit 1becb48

Browse files
committed
Remove unstable cfg for terminal methods
1 parent d258269 commit 1becb48

5 files changed

Lines changed: 4 additions & 79 deletions

File tree

rust/acp.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -261,23 +261,18 @@ impl Side for ClientSide {
261261
FS_READ_TEXT_FILE_METHOD_NAME => serde_json::from_str(params.get())
262262
.map(AgentRequest::ReadTextFileRequest)
263263
.map_err(Into::into),
264-
#[cfg(feature = "unstable")]
265264
TERMINAL_CREATE_METHOD_NAME => serde_json::from_str(params.get())
266265
.map(AgentRequest::CreateTerminalRequest)
267266
.map_err(Into::into),
268-
#[cfg(feature = "unstable")]
269267
TERMINAL_OUTPUT_METHOD_NAME => serde_json::from_str(params.get())
270268
.map(AgentRequest::TerminalOutputRequest)
271269
.map_err(Into::into),
272-
#[cfg(feature = "unstable")]
273270
TERMINAL_KILL_METHOD_NAME => serde_json::from_str(params.get())
274271
.map(AgentRequest::KillTerminalRequest)
275272
.map_err(Into::into),
276-
#[cfg(feature = "unstable")]
277273
TERMINAL_RELEASE_METHOD_NAME => serde_json::from_str(params.get())
278274
.map(AgentRequest::ReleaseTerminalRequest)
279275
.map_err(Into::into),
280-
#[cfg(feature = "unstable")]
281276
TERMINAL_WAIT_FOR_EXIT_METHOD_NAME => serde_json::from_str(params.get())
282277
.map(AgentRequest::WaitForTerminalExitRequest)
283278
.map_err(Into::into),
@@ -315,27 +310,22 @@ impl<T: Client> MessageHandler<ClientSide> for T {
315310
let response = self.read_text_file(args).await?;
316311
Ok(ClientResponse::ReadTextFileResponse(response))
317312
}
318-
#[cfg(feature = "unstable")]
319313
AgentRequest::CreateTerminalRequest(args) => {
320314
let response = self.create_terminal(args).await?;
321315
Ok(ClientResponse::CreateTerminalResponse(response))
322316
}
323-
#[cfg(feature = "unstable")]
324317
AgentRequest::TerminalOutputRequest(args) => {
325318
let response = self.terminal_output(args).await?;
326319
Ok(ClientResponse::TerminalOutputResponse(response))
327320
}
328-
#[cfg(feature = "unstable")]
329321
AgentRequest::ReleaseTerminalRequest(args) => {
330322
self.release_terminal(args).await?;
331323
Ok(ClientResponse::ReleaseTerminalResponse)
332324
}
333-
#[cfg(feature = "unstable")]
334325
AgentRequest::WaitForTerminalExitRequest(args) => {
335326
let response = self.wait_for_terminal_exit(args).await?;
336327
Ok(ClientResponse::WaitForTerminalExitResponse(response))
337328
}
338-
#[cfg(feature = "unstable")]
339329
AgentRequest::KillTerminalRequest(args) => {
340330
self.kill_terminal(args).await?;
341331
Ok(ClientResponse::KillTerminalResponse)
@@ -444,7 +434,6 @@ impl Client for AgentSideConnection {
444434
.await
445435
}
446436

447-
#[cfg(feature = "unstable")]
448437
async fn create_terminal(
449438
&self,
450439
arguments: CreateTerminalRequest,
@@ -457,7 +446,6 @@ impl Client for AgentSideConnection {
457446
.await
458447
}
459448

460-
#[cfg(feature = "unstable")]
461449
async fn terminal_output(
462450
&self,
463451
arguments: TerminalOutputRequest,
@@ -470,7 +458,6 @@ impl Client for AgentSideConnection {
470458
.await
471459
}
472460

473-
#[cfg(feature = "unstable")]
474461
async fn release_terminal(&self, arguments: ReleaseTerminalRequest) -> Result<(), Error> {
475462
self.conn
476463
.request(
@@ -480,7 +467,6 @@ impl Client for AgentSideConnection {
480467
.await
481468
}
482469

483-
#[cfg(feature = "unstable")]
484470
async fn wait_for_terminal_exit(
485471
&self,
486472
arguments: WaitForTerminalExitRequest,
@@ -493,7 +479,6 @@ impl Client for AgentSideConnection {
493479
.await
494480
}
495481

496-
#[cfg(feature = "unstable")]
497482
async fn kill_terminal(&self, arguments: KillTerminalRequest) -> Result<(), Error> {
498483
self.conn
499484
.request(

rust/client.rs

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ pub trait Client {
7777
/// **UNSTABLE**
7878
///
7979
/// This method is not part of the spec, and may be removed or changed at any point.
80-
#[doc(hidden)]
81-
#[cfg(feature = "unstable")]
8280
fn create_terminal(
8381
&self,
8482
args: CreateTerminalRequest,
@@ -87,8 +85,6 @@ pub trait Client {
8785
/// **UNSTABLE**
8886
///
8987
/// This method is not part of the spec, and may be removed or changed at any point.
90-
#[doc(hidden)]
91-
#[cfg(feature = "unstable")]
9288
fn terminal_output(
9389
&self,
9490
args: TerminalOutputRequest,
@@ -97,8 +93,6 @@ pub trait Client {
9793
/// **UNSTABLE**
9894
///
9995
/// This method is not part of the spec, and may be removed or changed at any point.
100-
#[doc(hidden)]
101-
#[cfg(feature = "unstable")]
10296
fn release_terminal(
10397
&self,
10498
args: ReleaseTerminalRequest,
@@ -107,8 +101,6 @@ pub trait Client {
107101
/// **UNSTABLE**
108102
///
109103
/// This method is not part of the spec, and may be removed or changed at any point.
110-
#[doc(hidden)]
111-
#[cfg(feature = "unstable")]
112104
fn wait_for_terminal_exit(
113105
&self,
114106
args: WaitForTerminalExitRequest,
@@ -117,8 +109,6 @@ pub trait Client {
117109
/// **UNSTABLE**
118110
///
119111
/// This method is not part of the spec, and may be removed or changed at any point.
120-
#[doc(hidden)]
121-
#[cfg(feature = "unstable")]
122112
fn kill_terminal(&self, args: KillTerminalRequest) -> impl Future<Output = Result<(), Error>>;
123113
}
124114

@@ -336,7 +326,6 @@ pub struct ReadTextFileResponse {
336326

337327
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq, Hash)]
338328
#[serde(transparent)]
339-
#[cfg(feature = "unstable")]
340329
pub struct TerminalId(pub Arc<str>);
341330

342331
#[cfg(feature = "unstable")]
@@ -347,9 +336,7 @@ impl std::fmt::Display for TerminalId {
347336
}
348337

349338
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
350-
#[schemars(extend("x-docs-ignore" = true))]
351339
#[serde(rename_all = "camelCase")]
352-
#[cfg(feature = "unstable")]
353340
pub struct CreateTerminalRequest {
354341
pub session_id: SessionId,
355342
pub command: String,
@@ -364,72 +351,56 @@ pub struct CreateTerminalRequest {
364351
}
365352

366353
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
367-
#[schemars(extend("x-docs-ignore" = true))]
368354
#[serde(rename_all = "camelCase")]
369-
#[cfg(feature = "unstable")]
370355
pub struct CreateTerminalResponse {
371356
pub terminal_id: TerminalId,
372357
}
373358

374359
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
375-
#[schemars(extend("x-docs-ignore" = true))]
376360
#[serde(rename_all = "camelCase")]
377-
#[cfg(feature = "unstable")]
378361
pub struct TerminalOutputRequest {
379362
pub session_id: SessionId,
380363
pub terminal_id: TerminalId,
381364
}
382365

383366
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
384-
#[schemars(extend("x-docs-ignore" = true))]
385367
#[serde(rename_all = "camelCase")]
386-
#[cfg(feature = "unstable")]
387368
pub struct TerminalOutputResponse {
388369
pub output: String,
389370
pub truncated: bool,
390371
pub exit_status: Option<TerminalExitStatus>,
391372
}
392373

393374
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
394-
#[schemars(extend("x-docs-ignore" = true))]
395375
#[serde(rename_all = "camelCase")]
396-
#[cfg(feature = "unstable")]
397376
pub struct ReleaseTerminalRequest {
398377
pub session_id: SessionId,
399378
pub terminal_id: TerminalId,
400379
}
401380

402381
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
403-
#[schemars(extend("x-docs-ignore" = true))]
404382
#[serde(rename_all = "camelCase")]
405-
#[cfg(feature = "unstable")]
406383
pub struct KillTerminalRequest {
407384
pub session_id: SessionId,
408385
pub terminal_id: TerminalId,
409386
}
410387

411388
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
412-
#[schemars(extend("x-docs-ignore" = true))]
413389
#[serde(rename_all = "camelCase")]
414-
#[cfg(feature = "unstable")]
415390
pub struct WaitForTerminalExitRequest {
416391
pub session_id: SessionId,
417392
pub terminal_id: TerminalId,
418393
}
419394

420395
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
421-
#[schemars(extend("x-docs-ignore" = true))]
422396
#[serde(rename_all = "camelCase")]
423-
#[cfg(feature = "unstable")]
424397
pub struct WaitForTerminalExitResponse {
425398
#[serde(flatten)]
426399
pub exit_status: TerminalExitStatus,
427400
}
428401

429402
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
430-
#[schemars(extend("x-docs-ignore" = true))]
431403
#[serde(rename_all = "camelCase")]
432-
#[cfg(feature = "unstable")]
433404
pub struct TerminalExitStatus {
434405
pub exit_code: Option<u32>,
435406
pub signal: Option<String>,
@@ -489,19 +460,14 @@ pub struct ClientMethodNames {
489460
/// Method for reading text files.
490461
pub fs_read_text_file: &'static str,
491462
/// Method for creating new terminals.
492-
#[cfg(feature = "unstable")]
493463
pub terminal_create: &'static str,
494464
/// Method for getting terminals output.
495-
#[cfg(feature = "unstable")]
496465
pub terminal_output: &'static str,
497466
/// Method for releasing a terminal.
498-
#[cfg(feature = "unstable")]
499467
pub terminal_release: &'static str,
500468
/// Method for waiting for a terminal to finish.
501-
#[cfg(feature = "unstable")]
502469
pub terminal_wait_for_exit: &'static str,
503470
/// Method for killing a terminal.
504-
#[cfg(feature = "unstable")]
505471
pub terminal_kill: &'static str,
506472
}
507473

@@ -511,15 +477,10 @@ pub const CLIENT_METHOD_NAMES: ClientMethodNames = ClientMethodNames {
511477
session_request_permission: SESSION_REQUEST_PERMISSION_METHOD_NAME,
512478
fs_write_text_file: FS_WRITE_TEXT_FILE_METHOD_NAME,
513479
fs_read_text_file: FS_READ_TEXT_FILE_METHOD_NAME,
514-
#[cfg(feature = "unstable")]
515480
terminal_create: TERMINAL_CREATE_METHOD_NAME,
516-
#[cfg(feature = "unstable")]
517481
terminal_output: TERMINAL_OUTPUT_METHOD_NAME,
518-
#[cfg(feature = "unstable")]
519482
terminal_release: TERMINAL_RELEASE_METHOD_NAME,
520-
#[cfg(feature = "unstable")]
521483
terminal_wait_for_exit: TERMINAL_WAIT_FOR_EXIT_METHOD_NAME,
522-
#[cfg(feature = "unstable")]
523484
terminal_kill: TERMINAL_KILL_METHOD_NAME,
524485
};
525486

@@ -532,19 +493,14 @@ pub(crate) const FS_WRITE_TEXT_FILE_METHOD_NAME: &str = "fs/write_text_file";
532493
/// Method name for reading text files.
533494
pub(crate) const FS_READ_TEXT_FILE_METHOD_NAME: &str = "fs/read_text_file";
534495
/// Method name for creating a new terminal.
535-
#[cfg(feature = "unstable")]
536496
pub(crate) const TERMINAL_CREATE_METHOD_NAME: &str = "terminal/create";
537497
/// Method for getting terminals output.
538-
#[cfg(feature = "unstable")]
539498
pub(crate) const TERMINAL_OUTPUT_METHOD_NAME: &str = "terminal/output";
540499
/// Method for releasing a terminal.
541-
#[cfg(feature = "unstable")]
542500
pub(crate) const TERMINAL_RELEASE_METHOD_NAME: &str = "terminal/release";
543501
/// Method for waiting for a terminal to finish.
544-
#[cfg(feature = "unstable")]
545502
pub(crate) const TERMINAL_WAIT_FOR_EXIT_METHOD_NAME: &str = "terminal/wait_for_exit";
546503
/// Method for killing a terminal.
547-
#[cfg(feature = "unstable")]
548504
pub(crate) const TERMINAL_KILL_METHOD_NAME: &str = "terminal/kill";
549505

550506
/// All possible requests that an agent can send to a client.
@@ -560,15 +516,10 @@ pub enum AgentRequest {
560516
WriteTextFileRequest(WriteTextFileRequest),
561517
ReadTextFileRequest(ReadTextFileRequest),
562518
RequestPermissionRequest(RequestPermissionRequest),
563-
#[cfg(feature = "unstable")]
564519
CreateTerminalRequest(CreateTerminalRequest),
565-
#[cfg(feature = "unstable")]
566520
TerminalOutputRequest(TerminalOutputRequest),
567-
#[cfg(feature = "unstable")]
568521
ReleaseTerminalRequest(ReleaseTerminalRequest),
569-
#[cfg(feature = "unstable")]
570522
WaitForTerminalExitRequest(WaitForTerminalExitRequest),
571-
#[cfg(feature = "unstable")]
572523
KillTerminalRequest(KillTerminalRequest),
573524
}
574525

@@ -585,15 +536,10 @@ pub enum ClientResponse {
585536
WriteTextFileResponse,
586537
ReadTextFileResponse(ReadTextFileResponse),
587538
RequestPermissionResponse(RequestPermissionResponse),
588-
#[cfg(feature = "unstable")]
589539
CreateTerminalResponse(CreateTerminalResponse),
590-
#[cfg(feature = "unstable")]
591540
TerminalOutputResponse(TerminalOutputResponse),
592-
#[cfg(feature = "unstable")]
593541
ReleaseTerminalResponse,
594-
#[cfg(feature = "unstable")]
595542
WaitForTerminalExitResponse(WaitForTerminalExitResponse),
596-
#[cfg(feature = "unstable")]
597543
KillTerminalResponse,
598544
}
599545

rust/example_client.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,39 +40,34 @@ impl acp::Client for ExampleClient {
4040
Err(acp::Error::method_not_found())
4141
}
4242

43-
#[cfg(feature = "unstable")]
4443
async fn create_terminal(
4544
&self,
4645
_args: acp::CreateTerminalRequest,
4746
) -> Result<acp::CreateTerminalResponse, acp::Error> {
4847
Err(acp::Error::method_not_found())
4948
}
5049

51-
#[cfg(feature = "unstable")]
5250
async fn terminal_output(
5351
&self,
5452
_args: acp::TerminalOutputRequest,
5553
) -> anyhow::Result<acp::TerminalOutputResponse, acp::Error> {
5654
Err(acp::Error::method_not_found())
5755
}
5856

59-
#[cfg(feature = "unstable")]
6057
async fn release_terminal(
6158
&self,
6259
_args: acp::ReleaseTerminalRequest,
6360
) -> anyhow::Result<(), acp::Error> {
6461
Err(acp::Error::method_not_found())
6562
}
6663

67-
#[cfg(feature = "unstable")]
6864
async fn wait_for_terminal_exit(
6965
&self,
7066
_args: acp::WaitForTerminalExitRequest,
7167
) -> anyhow::Result<acp::WaitForTerminalExitResponse, acp::Error> {
7268
Err(acp::Error::method_not_found())
7369
}
7470

75-
#[cfg(feature = "unstable")]
7671
async fn kill_terminal(
7772
&self,
7873
_args: acp::KillTerminalRequest,

rust/rpc_tests.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,28 +68,28 @@ impl Client for TestClient {
6868
Ok(())
6969
}
7070

71-
#[cfg(feature = "unstable")]
7271
async fn create_terminal(
7372
&self,
7473
_args: CreateTerminalRequest,
7574
) -> Result<CreateTerminalResponse, Error> {
7675
unimplemented!()
7776
}
7877

79-
#[cfg(feature = "unstable")]
8078
async fn terminal_output(
8179
&self,
8280
_args: TerminalOutputRequest,
8381
) -> Result<TerminalOutputResponse, Error> {
8482
unimplemented!()
8583
}
8684

87-
#[cfg(feature = "unstable")]
85+
async fn kill_terminal(&self, _args: KillTerminalRequest) -> Result<(), Error> {
86+
unimplemented!()
87+
}
88+
8889
async fn release_terminal(&self, _args: ReleaseTerminalRequest) -> Result<(), Error> {
8990
unimplemented!()
9091
}
9192

92-
#[cfg(feature = "unstable")]
9393
async fn wait_for_terminal_exit(
9494
&self,
9595
_args: WaitForTerminalExitRequest,

rust/tool_call.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ pub enum ToolCallContent {
281281
diff: Diff,
282282
},
283283
#[serde(rename_all = "camelCase")]
284-
#[cfg(feature = "unstable")]
285284
Terminal { terminal_id: crate::TerminalId },
286285
}
287286

0 commit comments

Comments
 (0)