feat(plugin): pass request context to provider fetch

This commit is contained in:
Aiden Cline 2026-05-26 19:15:58 -05:00
commit 0623069210
3 changed files with 98 additions and 20 deletions

View file

@ -79,6 +79,30 @@ export type PluginModule = {
tui?: never
}
export type ExperimentalFetchContext = {
sessionID: string
parentSessionID?: string
agent: {
name: string
mode: string
[key: string]: unknown
}
model: ModelV2
provider: ProviderV2
message: UserMessage
messages: unknown[]
system: string[]
headers: Record<string, string>
tools: string[]
small?: boolean
}
export type ExperimentalFetch = (
input: RequestInfo | URL,
init?: RequestInit,
context?: ExperimentalFetchContext,
) => Promise<Response>
type Rule = {
key: string
op: "eq" | "neq"