import type { Hooks } from "@opencode-ai/plugin"; import { type RefreshActiveAccountQuotaResult } from "./active-account-quota.js"; import type { CommonSettingsStore } from "./common-settings-store.js"; import { type CopilotRetryContext, type FetchLike } from "./copilot-network-retry.js"; import { type ResolvedModelAccountCandidate } from "./model-account-map.js"; import { type AppendSessionTouchEventInput, type RouteDecisionEvent, type RoutingEvent, type RoutingSnapshot } from "./routing-state.js"; import { handleCompactCommand, handleStopToolCommand } from "./session-control-command.js"; import { handleStatusCommand } from "./status-command.js"; import { type StoreFile, type StoreWriteDebugMeta } from "./store.js"; import { type CopilotAuthState, type CopilotProviderConfig, type OfficialChatHeadersHook, type OfficialCopilotConfig } from "./upstream/copilot-loader-adapter.js"; type CopilotPluginHooks = Hooks; type ChatHeadersHook = (input: { sessionID: string; agent: string; model: { providerID: string; api?: { npm?: string; }; }; provider: { source: string; info: object; options: object; }; message: { id: string; sessionID?: string; }; }, output: { headers: Record; }) => Promise; type CopilotPluginHooksWithChatHeaders = CopilotPluginHooks & { "chat.headers"?: ChatHeadersHook; }; type StatusCommandHandler = typeof handleStatusCommand; type CompactCommandHandler = typeof handleCompactCommand; type StopToolCommandHandler = typeof handleStopToolCommand; type RefreshQuota = (store: StoreFile) => Promise; type CandidateAccountLoads = Record | Map; type TriggerBillingCompensationInput = { fromAccountName: string; toAccountName: string; sessionID: string; modelID?: string; at: number; retryAfterMs?: number; }; export declare function buildPluginHooks(input: { auth: NonNullable; loadStore?: () => Promise; loadStoreSync?: () => StoreFile | undefined; loadCommonSettings?: () => Promise; loadCommonSettingsSync?: () => CommonSettingsStore | undefined; writeStore?: (store: StoreFile, meta?: StoreWriteDebugMeta) => Promise; loadOfficialConfig?: (input: { getAuth: () => Promise; provider?: CopilotProviderConfig; baseFetch?: typeof fetch; version?: string; }) => Promise; finalizeRequestForSelection?: (input: { request: Request | URL | string; init?: RequestInit; getAuth: () => Promise; provider?: CopilotProviderConfig; }) => Promise<{ request: Request | URL | string; init?: RequestInit; } | undefined>; loadOfficialChatHeaders?: (input: { client?: object; directory?: string; }) => Promise; createRetryFetch?: (fetch: FetchLike, ctx?: CopilotRetryContext) => FetchLike; client?: CopilotRetryContext["client"]; project?: { id?: string; name?: string; }; directory?: CopilotRetryContext["directory"]; serverUrl?: CopilotRetryContext["serverUrl"]; clearAccountSwitchContext?: (lastAccountSwitchAt?: number) => Promise; now?: () => number; refreshQuota?: RefreshQuota; handleStatusCommandImpl?: StatusCommandHandler; handleCompactCommandImpl?: CompactCommandHandler; handleStopToolCommandImpl?: StopToolCommandHandler; loadCandidateAccountLoads?: (input: { sessionID: string; modelID?: string; store: StoreFile; candidates: ResolvedModelAccountCandidate[]; }) => Promise; routingStateDirectory?: string; appendSessionTouchEventImpl?: (input: AppendSessionTouchEventInput) => Promise; appendRoutingEventImpl?: (input: { directory: string; event: RoutingEvent; }) => Promise; appendRouteDecisionEventImpl?: (input: { directory: string; event: RouteDecisionEvent; }) => Promise; readRoutingStateImpl?: (directory: string) => Promise; triggerBillingCompensation?: (input: TriggerBillingCompensationInput) => Promise; touchWriteCacheIdleTtlMs?: number; touchWriteCacheMaxEntries?: number; random?: () => number; authLoaderMode?: "copilot" | "none"; enableModelRouting?: boolean; }): CopilotPluginHooksWithChatHeaders; export {};