array-from-mapper.ts 469 B

1234567
  1. // Array.from(xs, mapper): a per-element callback per the registry (`each`, iterated = arg 0,
  2. // callback = arg 1), so a fan-out candidate exactly like `xs.map(mapper)`: world-read#1 routes
  3. // into the reviewer ask through the fan-out, and the mapper body is a `fanout` region.
  4. const paths = await files.glob("src/**/*.ts");
  5. const nodes = Array.from(paths, (p) => agent("reviewer").ask<string>(`review ${p}`));
  6. const results = await Promise.all(nodes);
  7. return results;