- Copy @ant/model-provider package (Gemini/Grok/OpenAI converters) - Add sideQueryViaGemini adapter for third-party provider routing - Update prompts/claude/messages to clarify SearchExtraTools/ExecuteExtraTool - Fix paste detection threshold for non-bracketed-paste terminals - Strengthen Plan mode: mandatory FileRead, Explore agent guidance, exit attachment - Add missing packages/tsconfig.json Upstream commits:7b52054f,e33b17bd,a05242ce,b67e9f9dBuild: 562 files, bun test: 3328 pass / 4 fail (pre-existing)
28 lines
655 B
TypeScript
28 lines
655 B
TypeScript
import type { ModelProviderHooks } from './types.js'
|
|
|
|
let registeredHooks: ModelProviderHooks | null = null
|
|
|
|
/**
|
|
* Register hooks from the main project.
|
|
* Call this during application initialization.
|
|
*/
|
|
export function registerHooks(hooks: ModelProviderHooks): void {
|
|
registeredHooks = hooks
|
|
}
|
|
|
|
/**
|
|
* Get registered hooks.
|
|
* Throws if hooks not registered (fail-fast).
|
|
*/
|
|
export function getHooks(): ModelProviderHooks {
|
|
if (!registeredHooks) {
|
|
throw new Error(
|
|
'ModelProvider hooks not registered. ' +
|
|
'Call registerHooks() during app initialization.',
|
|
)
|
|
}
|
|
return registeredHooks
|
|
}
|
|
|
|
export type { ModelProviderHooks }
|