MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / makeRouter

Function makeRouter

test/warmup.test.ts:5–22  ·  view source on GitHub ↗
(opts: { isLocal: boolean; resolves?: boolean; onComplete?: () => void })

Source from the content-addressed store, hash-verified

3
4// Minimal stubs — we only care about the warm-up decision + that complete() fires for local.
5function makeRouter(opts: { isLocal: boolean; resolves?: boolean; onComplete?: () => void }) {
6 return {
7 resolveModel(_id: string) {
8 if (opts.resolves === false) return null;
9 return {
10 resolvedId: 'test-model',
11 modelInfo: {} as any,
12 provider: {
13 isLocal: opts.isLocal,
14 async *complete(_req: any) {
15 opts.onComplete?.();
16 yield { type: 'text', text: 'x' } as any;
17 },
18 } as any,
19 };
20 },
21 } as any;
22}
23
24const cfg = (model = 'test-model') => ({ defaults: { model } }) as any;
25

Callers 1

warmup.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected