report-and-log.js 536 B

12345678910111213
  1. const scout = __host.createActor("actor#1", "scout");
  2. __host.log("scanning");
  3. const paths = await __host.worldRead("world-read#1", "glob", ["src/**/*.ts"]);
  4. __host.report("report#1", { phase: "scanned", total: paths.length });
  5. const findings = [];
  6. for (const path of paths) {
  7. const note = await __host.ask("ask#1", scout, `review ${path}`);
  8. __host.report("report#2", { path, note });
  9. findings.push({ path, note });
  10. }
  11. __host.log("done");
  12. __host.report("report#3", { phase: "done", total: findings.length });
  13. return findings;