iteration-fanout-callback-array-param.ts 479 B

12345678
  1. // The THIRD callback parameter of map is the whole iterated array: at runtime
  2. // whole === topics, so whole.join() carries ask#1's artifact into the judge ask.
  3. // Expected: source -> ask#1; ask#1 -> fan-out#1; ask#1 -> ask#2 (MUST);
  4. // fan-out#1 -> ask#2; sink edges from ask#1/fan-out#1/ask#2.
  5. const s = await agent("planner").ask<string>("plan");
  6. const topics = [s];
  7. const outs = topics.map((_t, _i, whole) => agent("judge").ask<string>(whole.join()));
  8. return outs;