@@ -541,14 +541,90 @@ pub(crate) const TERMINAL_KILL_METHOD_NAME: &str = "terminal/kill";
541541#[ serde( untagged) ]
542542#[ schemars( extend( "x-docs-ignore" = true ) ) ]
543543pub enum AgentRequest {
544+ /// Writes content to a text file in the client's file system.
545+ ///
546+ /// Only available if the client advertises the `fs.writeTextFile` capability.
547+ /// Allows the agent to create or modify files within the client's environment.
548+ ///
549+ /// See protocol docs: [Client](https://agentclientprotocol.com/protocol/overview#client)
544550 WriteTextFileRequest ( WriteTextFileRequest ) ,
551+ /// Reads content from a text file in the client's file system.
552+ ///
553+ /// Only available if the client advertises the `fs.readTextFile` capability.
554+ /// Allows the agent to access file contents within the client's environment.
555+ ///
556+ /// See protocol docs: [Client](https://agentclientprotocol.com/protocol/overview#client)
545557 ReadTextFileRequest ( ReadTextFileRequest ) ,
558+ /// Requests permission from the user for a tool call operation.
559+ ///
560+ /// Called by the agent when it needs user authorization before executing
561+ /// a potentially sensitive operation. The client should present the options
562+ /// to the user and return their decision.
563+ ///
564+ /// If the client cancels the prompt turn via `session/cancel`, it MUST
565+ /// respond to this request with `RequestPermissionOutcome::Cancelled`.
566+ ///
567+ /// See protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/tool-calls#requesting-permission)
546568 RequestPermissionRequest ( RequestPermissionRequest ) ,
569+ /// Executes a command in a new terminal
570+ ///
571+ /// Only available if the `terminal` Client capability is set to `true`.
572+ ///
573+ /// Returns a `TerminalId` that can be used with other terminal methods
574+ /// to get the current output, wait for exit, and kill the command.
575+ ///
576+ /// The `TerminalId` can also be used to embed the terminal in a tool call
577+ /// by using the `ToolCallContent::Terminal` variant.
578+ ///
579+ /// The Agent is responsible for releasing the terminal by using the `terminal/release`
580+ /// method.
581+ ///
582+ /// See protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)
547583 CreateTerminalRequest ( CreateTerminalRequest ) ,
584+ /// Gets the terminal output and exit status
585+ ///
586+ /// Returns the current content in the terminal without waiting for the command to exit.
587+ /// If the command has already exited, the exit status is included.
588+ ///
589+ /// See protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)
548590 TerminalOutputRequest ( TerminalOutputRequest ) ,
591+ /// Releases a terminal
592+ ///
593+ /// The command is killed if it hasn't exited yet. Use `terminal/wait_for_exit`
594+ /// to wait for the command to exit before releasing the terminal.
595+ ///
596+ /// After release, the `TerminalId` can no longer be used with other `terminal/*` methods,
597+ /// but tool calls that already contain it, continue to display its output.
598+ ///
599+ /// The `terminal/kill` method can be used to terminate the command without releasing
600+ /// the terminal, allowing the Agent to call `terminal/output` and other methods.
601+ ///
602+ /// See protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)
549603 ReleaseTerminalRequest ( ReleaseTerminalRequest ) ,
604+ /// Waits for the terminal command to exit and return its exit status
605+ ///
606+ /// See protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)
550607 WaitForTerminalExitRequest ( WaitForTerminalExitRequest ) ,
608+ /// Kills the terminal command without releasing the terminal
609+ ///
610+ /// While `terminal/release` will also kill the command, this method will keep
611+ /// the `TerminalId` valid so it can be used with other methods.
612+ ///
613+ /// This method can be helpful when implementing command timeouts which terminate
614+ /// the command as soon as elapsed, and then get the final output so it can be sent
615+ /// to the model.
616+ ///
617+ /// Note: `terminal/release` when `TerminalId` is no longer needed.
618+ ///
619+ /// See protocol docs: [Terminals](https://agentclientprotocol.com/protocol/terminals)
551620 KillTerminalCommandRequest ( KillTerminalCommandRequest ) ,
621+ /// Handles extension method requests from the agent.
622+ ///
623+ /// Allows the Agent to send an arbitrary request that is not part of the ACP spec.
624+ /// Extension methods provide a way to add custom functionality while maintaining
625+ /// protocol compatibility.
626+ ///
627+ /// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
552628 ExtMethodRequest ( ExtRequest ) ,
553629}
554630
@@ -584,6 +660,24 @@ pub enum ClientResponse {
584660#[ allow( clippy:: large_enum_variant) ]
585661#[ schemars( extend( "x-docs-ignore" = true ) ) ]
586662pub enum AgentNotification {
663+ /// Handles session update notifications from the agent.
664+ ///
665+ /// This is a notification endpoint (no response expected) that receives
666+ /// real-time updates about session progress, including message chunks,
667+ /// tool calls, and execution plans.
668+ ///
669+ /// Note: Clients SHOULD continue accepting tool call updates even after
670+ /// sending a `session/cancel` notification, as the agent may send final
671+ /// updates before responding with the cancelled stop reason.
672+ ///
673+ /// See protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)
587674 SessionNotification ( SessionNotification ) ,
675+ /// Handles extension notifications from the agent.
676+ ///
677+ /// Allows the Agent to send an arbitrary notification that is not part of the ACP spec.
678+ /// Extension notifications provide a way to send one-way messages for custom functionality
679+ /// while maintaining protocol compatibility.
680+ ///
681+ /// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
588682 ExtNotification ( ExtNotification ) ,
589683}
0 commit comments