From eab177f5e7ae91bdd7679867b43f77a479aefb74 Mon Sep 17 00:00:00 2001 From: Joel Hooks Date: Mon, 22 Dec 2025 20:19:14 -0800 Subject: feat(plugin): allow compaction hook to replace prompt entirely (#5907) --- packages/plugin/src/index.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'packages/plugin/src') diff --git a/packages/plugin/src/index.ts b/packages/plugin/src/index.ts index 487e6ed3e..fbc0e710c 100644 --- a/packages/plugin/src/index.ts +++ b/packages/plugin/src/index.ts @@ -192,10 +192,16 @@ export interface Hooks { }, ) => Promise /** - * Called before session compaction starts. Allows plugins to append - * additional context to the compaction prompt. + * Called before session compaction starts. Allows plugins to customize + * the compaction prompt. + * + * - `context`: Additional context strings appended to the default prompt + * - `prompt`: If set, replaces the default compaction prompt entirely */ - "experimental.session.compacting"?: (input: { sessionID: string }, output: { context: string[] }) => Promise + "experimental.session.compacting"?: ( + input: { sessionID: string }, + output: { context: string[]; prompt?: string }, + ) => Promise "experimental.text.complete"?: ( input: { sessionID: string; messageID: string; partID: string }, output: { text: string }, -- cgit v1.2.3