named-callback-map.ts 618 B

12345678910
  1. // Named callback passed to .map. A fan-out candidate like an inline arrow (candidates are
  2. // value-based: docs/analysis.md): `review` is applied per element
  3. // with the fanned-out element, routing world-read#1 into the reviewer ask (exact) and the ask
  4. // result out through the join to the sink; the ordering walk inlines `review` inside the
  5. // `fanout` region and the actor carries `within=fan-out#1`.
  6. const paths = await files.glob("src/**/*.ts");
  7. const review = (p: string) => agent("reviewer").ask<string>(`review ${p}`);
  8. const nodes = paths.map(review);
  9. const results = await Promise.all(nodes);
  10. return results;