diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index be82e9a..01fdb9a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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: diff --git a/src/acp.ts b/src/acp.ts index a9ff39e..915e08d 100644 --- a/src/acp.ts +++ b/src/acp.ts @@ -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); @@ -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 { + return await this.#connection.sendRequest( + schema.AGENT_METHODS.session_resume, + params, + ); + } + /** * Sets the operational mode for a session. * @@ -1416,6 +1444,21 @@ export interface Agent { forkSession?( params: schema.ForkSessionRequest, ): Promise; + /** + * **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; /** * Sets the operational mode for a session. *