MCPcopy
hub / github.com/Kilo-Org/kilocode / make

Function make

packages/kilo-vscode/tests/unit/source-controller.test.ts:19–31  ·  view source on GitHub ↗
(sources: Record<string, DiffSource>, descriptors?: DiffSourceDescriptor[])

Source from the content-addressed store, hash-verified

17}
18
19function make(sources: Record<string, DiffSource>, descriptors?: DiffSourceDescriptor[]) {
20 const posted: unknown[] = []
21 const controller = new SourceController(
22 (id) => {
23 const src = sources[id]
24 if (!src) throw new Error(`no source: ${id}`)
25 return src
26 },
27 () => descriptors ?? Object.values(sources).map((s) => s.descriptor),
28 (m) => posted.push(m),
29 )
30 return { controller, posted }
31}
32
33const byType = (posted: unknown[], type: string) =>
34 posted.filter((m): m is Record<string, unknown> => {

Callers 1

Calls 2

pushMethod · 0.65
valuesMethod · 0.45

Tested by

no test coverage detected