MCPcopy Create free account
hub / github.com/apache/maka / resolveApplyPatchProfile

Function resolveApplyPatchProfile

packages/runtime/src/apply-patch-profile.ts:20–33  ·  view source on GitHub ↗
(
  runtime: ApplyPatchProfileRuntime,
  modelId: string,
)

Source from the content-addressed store, hash-verified

18
19/** Resolve the exact provider/model/wire contract; unknown combinations fail closed. */
20export 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. */
36export function routeApplyPatchTools(

Callers 2

resolveModelRuntimeFunction · 0.85

Calls 3

trimMethod · 0.45

Tested by

no test coverage detected