Skip to content

Commit 7072d3f

Browse files
authored
refactor: Mark experimental session methods as unstable (#46)
Rename forkSession, resumeSession, and setSessionModel to use the unstable_ prefix to better communicate their experimental status.
1 parent 000eac0 commit 7072d3f

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

src/acp.ts

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,18 @@ export class AgentSideConnection {
6565
return agent.loadSession(validatedParams);
6666
}
6767
case schema.AGENT_METHODS.session_fork: {
68-
if (!agent.forkSession) {
68+
if (!agent.unstable_forkSession) {
6969
throw RequestError.methodNotFound(method);
7070
}
7171
const validatedParams = validate.zForkSessionRequest.parse(params);
72-
return agent.forkSession(validatedParams);
72+
return agent.unstable_forkSession(validatedParams);
7373
}
7474
case schema.AGENT_METHODS.session_resume: {
75-
if (!agent.resumeSession) {
75+
if (!agent.unstable_resumeSession) {
7676
throw RequestError.methodNotFound(method);
7777
}
7878
const validatedParams = validate.zResumeSessionRequest.parse(params);
79-
return agent.resumeSession(validatedParams);
79+
return agent.unstable_resumeSession(validatedParams);
8080
}
8181
case schema.AGENT_METHODS.session_set_mode: {
8282
if (!agent.setSessionMode) {
@@ -96,12 +96,12 @@ export class AgentSideConnection {
9696
return agent.prompt(validatedParams);
9797
}
9898
case schema.AGENT_METHODS.session_set_model: {
99-
if (!agent.setSessionModel) {
99+
if (!agent.unstable_setSessionModel) {
100100
throw RequestError.methodNotFound(method);
101101
}
102102
const validatedParams =
103103
validate.zSetSessionModelRequest.parse(params);
104-
const result = await agent.setSessionModel(validatedParams);
104+
const result = await agent.unstable_setSessionModel(validatedParams);
105105
return result ?? {};
106106
}
107107
default:
@@ -628,8 +628,10 @@ export class ClientSideConnection implements Agent {
628628
* operations like generating summaries without affecting the original session's history.
629629
*
630630
* This method is only available if the agent advertises the `session.fork` capability.
631+
*
632+
* @experimental
631633
*/
632-
async forkSession(
634+
async unstable_forkSession(
633635
params: schema.ForkSessionRequest,
634636
): Promise<schema.ForkSessionResponse> {
635637
return await this.#connection.sendRequest(
@@ -649,8 +651,10 @@ export class ClientSideConnection implements Agent {
649651
*
650652
* The agent should resume the session context, allowing the conversation to continue
651653
* without replaying the message history (unlike `session/load`).
654+
*
655+
* @experimental
652656
*/
653-
async resumeSession(
657+
async unstable_resumeSession(
654658
params: schema.ResumeSessionRequest,
655659
): Promise<schema.ResumeSessionResponse> {
656660
return await this.#connection.sendRequest(
@@ -694,7 +698,7 @@ export class ClientSideConnection implements Agent {
694698
*
695699
* @experimental
696700
*/
697-
async setSessionModel(
701+
async unstable_setSessionModel(
698702
params: schema.SetSessionModelRequest,
699703
): Promise<schema.SetSessionModelResponse> {
700704
return (
@@ -1440,8 +1444,10 @@ export interface Agent {
14401444
* operations like generating summaries without affecting the original session's history.
14411445
*
14421446
* This method is only available if the agent advertises the `session.fork` capability.
1447+
*
1448+
* @experimental
14431449
*/
1444-
forkSession?(
1450+
unstable_forkSession?(
14451451
params: schema.ForkSessionRequest,
14461452
): Promise<schema.ForkSessionResponse>;
14471453
/**
@@ -1455,8 +1461,10 @@ export interface Agent {
14551461
*
14561462
* The agent should resume the session context, allowing the conversation to continue
14571463
* without replaying the message history (unlike `session/load`).
1464+
*
1465+
* @experimental
14581466
*/
1459-
resumeSession?(
1467+
unstable_resumeSession?(
14601468
params: schema.ResumeSessionRequest,
14611469
): Promise<schema.ResumeSessionResponse>;
14621470
/**
@@ -1486,7 +1494,7 @@ export interface Agent {
14861494
*
14871495
* @experimental
14881496
*/
1489-
setSessionModel?(
1497+
unstable_setSessionModel?(
14901498
params: schema.SetSessionModelRequest,
14911499
): Promise<schema.SetSessionModelResponse | void>;
14921500
/**

0 commit comments

Comments
 (0)