refactor(providers): add family replay and tool hooks

This commit is contained in:
Vincent Koc
2026-04-04 19:27:36 +09:00
parent 4e099689c0
commit 39d2a719c9
20 changed files with 273 additions and 85 deletions

View File

@@ -158,3 +158,20 @@ export function inspectGeminiToolSchemas(
return [{ toolName: tool.name, toolIndex, violations }];
});
}
export type ProviderToolCompatFamily = "gemini";
export function buildProviderToolCompatFamilyHooks(family: ProviderToolCompatFamily): {
normalizeToolSchemas: (ctx: ProviderNormalizeToolSchemasContext) => AnyAgentTool[];
inspectToolSchemas: (
ctx: ProviderNormalizeToolSchemasContext,
) => ProviderToolSchemaDiagnostic[];
} {
switch (family) {
case "gemini":
return {
normalizeToolSchemas: normalizeGeminiToolSchemas,
inspectToolSchemas: inspectGeminiToolSchemas,
};
}
}