MCPcopy Create free account
hub / github.com/Wirasm/kild / resolveModel

Function resolveModel

engine/src/kild/models.ts:8–17  ·  view source on GitHub ↗
(registry: ModelRegistry, pattern: string | undefined)

Source from the content-addressed store, hash-verified

6 * undefined only when no pattern is given (use pi's configured default).
7 */
8export function resolveModel(registry: ModelRegistry, pattern: string | undefined) {
9 if (!pattern) return undefined;
10 const slash = pattern.indexOf('/');
11 const model =
12 slash !== -1
13 ? registry.find(pattern.slice(0, slash), pattern.slice(slash + 1))
14 : registry.getAll().find((m) => m.id === pattern);
15 if (!model) throw new Error(`unknown model: ${pattern}`);
16 return model;
17}
18
19/** Layer an agent's persona prompt onto a user prompt. The coding-agent SDK has no
20 * append-system-prompt knob, so the persona is prepended to the first message. */

Callers 3

runWorkerFunction · 0.90
runInProcessFunction · 0.90
models.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected