fix(types): restore CI compatibility for plugin hooks and tool context
This commit is contained in:
+11
-1
@@ -2,7 +2,17 @@ import type { Plugin, ToolDefinition } from "@opencode-ai/plugin"
|
||||
|
||||
export type PluginContext = Parameters<Plugin>[0]
|
||||
export type PluginInstance = Awaited<ReturnType<Plugin>>
|
||||
export type PluginInterface = Omit<PluginInstance, "experimental.session.compacting">
|
||||
|
||||
type ChatHeadersHook = PluginInstance extends { "chat.headers"?: infer T }
|
||||
? T
|
||||
: (input: unknown, output: unknown) => Promise<void>
|
||||
|
||||
export type PluginInterface = Omit<
|
||||
PluginInstance,
|
||||
"experimental.session.compacting" | "chat.headers"
|
||||
> & {
|
||||
"chat.headers"?: ChatHeadersHook
|
||||
}
|
||||
|
||||
export type ToolsRecord = Record<string, ToolDefinition>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user