Overview
The Client interface defines the interface that ACP-compliant clients must implement. Clients are typically code editors (IDEs, text editors) that provide the interface between users and AI agents. They manage the environment, handle user interactions, and control access to resources.Type Definition
Required Methods
requestPermission
session/cancel, it MUST respond to this request with RequestPermissionOutcome::Cancelled.
RequestPermissionRequest
required
The permission request parameters
RequestPermissionResponse
The user’s permission decision
sessionUpdate
session/cancel notification, as the agent may send final updates before responding with the cancelled stop reason.
SessionNotification
required
The session notification parameters containing updates about session progress
Promise<void>
A promise that resolves when the notification has been processed
Optional Methods
writeTextFile
fs.writeTextFile capability. Allows the agent to create or modify files within the client’s environment.
WriteTextFileRequest
required
The file write request parameters
WriteTextFileResponse
An empty object on success
readTextFile
fs.readTextFile capability. Allows the agent to access file contents within the client’s environment.
ReadTextFileRequest
required
The file read request parameters
ReadTextFileResponse
The file contents
createTerminal
terminal capability is set to true.
The Agent must call releaseTerminal when done with the terminal to free resources.
CreateTerminalRequest
required
The terminal creation parameters
CreateTerminalResponse
The terminal ID
terminalOutput
TerminalOutputRequest
required
The terminal output request parameters
TerminalOutputResponse
The current terminal output and exit status (if available)
releaseTerminal
ReleaseTerminalRequest
required
The release terminal request parameters
ReleaseTerminalResponse | void
An empty object on success, or void
waitForTerminalExit
WaitForTerminalExitRequest
required
The wait for exit request parameters
WaitForTerminalExitResponse
The exit status of the terminal command
killTerminal
releaseTerminal also kills the command, this method keeps the terminal ID valid so it can be used with other methods.
Useful for implementing command timeouts that terminate the command and then retrieve the final output.
Note: Call releaseTerminal when the terminal is no longer needed.
KillTerminalRequest
required
The kill terminal request parameters
KillTerminalResponse | void
An empty object on success, or void
extMethod
string
required
The extension method name
Record<string, unknown>
required
The extension method parameters
Record<string, unknown>
The extension method response
extNotification
string
required
The extension notification name
Record<string, unknown>
required
The extension notification parameters
Promise<void>
A promise that resolves when the notification has been processed