Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions src/acp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ export class AgentSideConnection {
const result = await agent.unstable_setSessionModel(validatedParams);
return result ?? {};
}
case schema.AGENT_METHODS.session_set_config_option: {
if (!agent.unstable_setSessionConfigOption) {
throw RequestError.methodNotFound(method);
}
const validatedParams =
validate.zSetSessionConfigOptionRequest.parse(params);
return agent.unstable_setSessionConfigOption(validatedParams);
}
default:
if (agent.extMethod) {
return agent.extMethod(method, params as Record<string, unknown>);
Expand Down Expand Up @@ -718,6 +726,27 @@ export class ClientSideConnection implements Agent {
);
}

/**
* **UNSTABLE**
*
* This capability is not part of the spec yet, and may be removed or changed at any point.
*
* Set a configuration option for a given session.
*
* The response contains the full set of configuration options and their current values,
* as changing one option may affect the available values or state of other options.
*
* @experimental
*/
async unstable_setSessionConfigOption(
params: schema.SetSessionConfigOptionRequest,
): Promise<schema.SetSessionConfigOptionResponse> {
return await this.#connection.sendRequest(
schema.AGENT_METHODS.session_set_config_option,
params,
);
}

/**
* Authenticates the client using the specified authentication method.
*
Expand Down Expand Up @@ -1522,6 +1551,21 @@ export interface Agent {
unstable_setSessionModel?(
params: schema.SetSessionModelRequest,
): Promise<schema.SetSessionModelResponse | void>;
/**
* **UNSTABLE**
*
* This capability is not part of the spec yet, and may be removed or changed at any point.
*
* Set a configuration option for a given session.
*
* The response contains the full set of configuration options and their current values,
* as changing one option may affect the available values or state of other options.
*
* @experimental
*/
unstable_setSessionConfigOption?(
params: schema.SetSessionConfigOptionRequest,
): Promise<schema.SetSessionConfigOptionResponse>;
/**
* Authenticates the client using the specified authentication method.
*
Expand Down