Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
with:
token: ${{ steps.generate-token.outputs.token }}
release-type: node
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
outputs:
release_created: ${{ steps.release.outputs.release_created }}
publish:
Expand Down
43 changes: 43 additions & 0 deletions src/acp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ export class AgentSideConnection {
const validatedParams = validate.zForkSessionRequest.parse(params);
return agent.forkSession(validatedParams);
}
case schema.AGENT_METHODS.session_resume: {
if (!agent.resumeSession) {
throw RequestError.methodNotFound(method);
}
const validatedParams = validate.zResumeSessionRequest.parse(params);
return agent.resumeSession(validatedParams);
}
case schema.AGENT_METHODS.session_set_mode: {
if (!agent.setSessionMode) {
throw RequestError.methodNotFound(method);
Expand Down Expand Up @@ -631,6 +638,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.
*
* Resumes an existing session without returning previous messages.
*
* This method is only available if the agent advertises the `session.resume` capability.
*
* The agent should resume the session context, allowing the conversation to continue
* without replaying the message history (unlike `session/load`).
*/
async resumeSession(
params: schema.ResumeSessionRequest,
): Promise<schema.ResumeSessionResponse> {
return await this.#connection.sendRequest(
schema.AGENT_METHODS.session_resume,
params,
);
}

/**
* Sets the operational mode for a session.
*
Expand Down Expand Up @@ -1416,6 +1444,21 @@ export interface Agent {
forkSession?(
params: schema.ForkSessionRequest,
): Promise<schema.ForkSessionResponse>;
/**
* **UNSTABLE**
*
* This capability is not part of the spec yet, and may be removed or changed at any point.
*
* Resumes an existing session without returning previous messages.
*
* This method is only available if the agent advertises the `session.resume` capability.
*
* The agent should resume the session context, allowing the conversation to continue
* without replaying the message history (unlike `session/load`).
*/
resumeSession?(
params: schema.ResumeSessionRequest,
): Promise<schema.ResumeSessionResponse>;
/**
* Sets the operational mode for a session.
*
Expand Down