( runtime: ApplyPatchProfileRuntime, modelId: string, )
| 18 | |
| 19 | /** Resolve the exact provider/model/wire contract; unknown combinations fail closed. */ |
| 20 | export function resolveApplyPatchProfile( |
| 21 | runtime: ApplyPatchProfileRuntime, |
| 22 | modelId: string, |
| 23 | ): ApplyPatchProfile | null { |
| 24 | if (runtime.wire !== 'openai-responses' || !runtime.applyPatchProtocol) return null; |
| 25 | const id = modelId.trim().toLowerCase(); |
| 26 | if (runtime.applyPatchProtocol === 'openai-structured' && openAiModelSupportsApplyPatch(id)) { |
| 27 | return { kind: 'openai-structured' }; |
| 28 | } |
| 29 | if (runtime.applyPatchProtocol === 'codex-v4a-freeform' && deepSeekModelSupportsResponses(id)) { |
| 30 | return { kind: 'codex-v4a-freeform' }; |
| 31 | } |
| 32 | return null; |
| 33 | } |
| 34 | |
| 35 | /** Project one verified profile into an exclusive model-facing editing surface. */ |
| 36 | export function routeApplyPatchTools( |
no test coverage detected