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

Function toWorkItems

src/orchestration/partition.ts:167–180  ·  view source on GitHub ↗
(
  ids: string[],
  weights?: number[],
  groups?: string[],
)

Source from the content-addressed store, hash-verified

165 * Mismatched-length arrays are tolerated (missing entries fall back to defaults).
166 */
167export function toWorkItems(
168 ids: string[],
169 weights?: number[],
170 groups?: string[],
171): WorkItem<string>[] {
172 return ids.map((id, i) => {
173 const item: WorkItem<string> = { id, payload: id };
174 const w = weights?.[i];
175 if (typeof w === 'number') item.weight = w;
176 const g = groups?.[i];
177 if (typeof g === 'string' && g.length > 0) item.coupledKey = g;
178 return item;
179 });
180}

Callers 2

partition.test.tsFile · 0.85
executeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected