22 lines
469 B
TypeScript
22 lines
469 B
TypeScript
import type { Message, Part } from "@opencode-ai/sdk"
|
|
|
|
interface MessageWithParts {
|
|
info: Message
|
|
parts: Part[]
|
|
}
|
|
|
|
type MessagesTransformHook = {
|
|
"experimental.chat.messages.transform"?: (
|
|
input: Record<string, never>,
|
|
output: { messages: MessageWithParts[] }
|
|
) => Promise<void>
|
|
}
|
|
|
|
export function createThinkingBlockValidatorHook(): MessagesTransformHook {
|
|
return {
|
|
"experimental.chat.messages.transform": async () => {
|
|
return
|
|
},
|
|
}
|
|
}
|