INNER CODE UNIT · TypeScript

formatConsultationEvent

HoangNguyen0403/agent-skills-standard · mcp/src/tools/index.ts:29

function formatConsultationEvent(event: LoadEvent): string {
  const observations: string[] = [];
  if (event.discovered?.length) {
    observations.push(`discovered ${event.discovered.join(", ")}`);
  }
  const dedupedSkills = new Set(event.dedupedSkills ?? []);
  const returnedBodies = event.loaded.filter((id) => !dedupedSkills.has(id));
  if (returnedBodies.length) {
    observations.push(`body returned ${returnedBodies.join(", ")}`);
  }
  if (dedupedSkills.size) {
    observations.push(
      `stub returned; body omitted ${Array.from(dedupedSkills).join(", ")}`,
    );
  }
  if (event.loadedGuides?.length) {
    observations.push(`guide body returned ${event.loadedGuides.join(", ")}`);
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…