mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-30 21:49:53 +00:00
feat(plugin): allow compaction hook to replace prompt entirely (#5907)
This commit is contained in:
parent
279dc04b3c
commit
eab177f5e7
3 changed files with 42 additions and 9 deletions
|
|
@ -192,10 +192,16 @@ export interface Hooks {
|
|||
},
|
||||
) => Promise<void>
|
||||
/**
|
||||
* 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<void>
|
||||
"experimental.session.compacting"?: (
|
||||
input: { sessionID: string },
|
||||
output: { context: string[]; prompt?: string },
|
||||
) => Promise<void>
|
||||
"experimental.text.complete"?: (
|
||||
input: { sessionID: string; messageID: string; partID: string },
|
||||
output: { text: string },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue