Skip to main content
The schema module exports important constants for working with the Agent Client Protocol.

Protocol Version

PROTOCOL_VERSION

The current version of the Agent Client Protocol.
Use this constant when initializing a connection:

Method Name Constants

The SDK exports constants for all protocol method names. These ensure type safety and prevent typos when working with method names directly.

AGENT_METHODS

Method names for requests sent to agents (client-to-agent).

Usage Example

Method Descriptions

  • authenticate: Authenticate with the agent
  • initialize: Initialize the connection
  • session_cancel: Cancel ongoing session operations
  • session_fork: Fork an existing session (UNSTABLE)
  • session_list: List available sessions (UNSTABLE)
  • session_load: Load an existing session
  • session_new: Create a new session
  • session_prompt: Send a prompt to the session
  • session_resume: Resume a stopped session (UNSTABLE)
  • session_set_config_option: Update a configuration option
  • session_set_mode: Change the session mode
  • session_set_model: Change the session model (UNSTABLE)
  • session_stop: Stop a running session (UNSTABLE)

CLIENT_METHODS

Method names for requests sent to clients (agent-to-client).

Usage Example

Method Descriptions

File System Methods:
  • fs_read_text_file: Read a text file from the file system
  • fs_write_text_file: Write a text file to the file system
Session Methods:
  • session_request_permission: Request user permission for an operation
  • session_update: Stream session updates (notification)
Terminal Methods:
  • terminal_create: Create a new terminal
  • terminal_kill: Kill a terminal process
  • terminal_output: Get terminal output
  • terminal_release: Release a terminal
  • terminal_wait_for_exit: Wait for terminal to exit

Type Safety

All method constant objects are defined with as const to ensure type safety:

Working with Custom Methods

While the protocol defines standard methods, you can also use custom extension methods:
Custom methods should be prefixed with x- to avoid conflicts with future protocol additions.

Notification Methods

Some methods are notifications (one-way messages) rather than requests:
Notifications:
  • Don’t expect a response
  • Don’t have a request ID
  • Are used for streaming updates

Method Naming Convention

The protocol uses a consistent naming pattern:
  • Method names use lowercase with slashes: noun/verb
  • Constants use underscores: noun_verb
  • TypeScript types use PascalCase: VerbNounRequest/VerbNounResponse
Examples: