{
  "version": 3,
  "sources": ["../../src/app/ai/agents/evals2/scenarios/richText/createWordColors.eval.ts"],
  "sourcesContent": ["import type { RichTextNode } from \"document/models/CanvasTree/nodes/RichTextNode.ts\"\nimport { ClassDiscriminator } from \"utils/withClassDiscriminator.ts\"\nimport { agentEvalAsset } from \"../../harness/asset.ts\"\nimport { createEvalExportZipFixture } from \"../../harness/fixture.ts\"\nimport {\n\tblueTextColorPattern,\n\tgetInlineWordTextColors,\n\tgreenTextColorPattern,\n\tmatchesTextColor,\n\tredTextColorPattern,\n} from \"./helpers.ts\"\n\nconst id = \"rich-text-add-word-colors\"\nconst expectedText = \"The colors are Red, Green and Blue\"\n/**\n * Prompt: Create a text node that says \"The colors are Red, Green and Blue\" where the words Red,\n * Green and Blue use their matching text colors: \"#FF0000\", \"#00FF00\", \"#0000FF\".\n */\nconst fixture = createEvalExportZipFixture(id, agentEvalAsset(\"./createWordColors.zip\"), { runtimeTarget: \"cli\" })\n\nevaluation(\n\t\"Rich Text: Create Word Colors\",\n\tfixture,\n\t{ id, maxSteps: 5, stopWhenPassed: true },\n\t({ engine, report, tools }) => {\n\t\ttools.reportReplayChecks(report)\n\n\t\tconst richTextNodes = Array.from(\n\t\t\tengine.tree.query().whereClassName<RichTextNode>(ClassDiscriminator.RichTextNode).iterate(),\n\t\t)\n\t\tconst requestedRichText = richTextNodes.find(node => node.getTextContent() === expectedText)\n\n\t\treport.accuracy.required(\"creates exactly one RichTextNode\", () => {\n\t\t\texpect(richTextNodes).toHaveLength(1)\n\t\t})\n\n\t\treport.functionality.required(\"creates one rich text node with requested copy\", () => {\n\t\t\texpect(requestedRichText).toBeDefined()\n\t\t})\n\n\t\treport.functionality.multi(\n\t\t\t{\n\t\t\t\tred: \"colors Red red\",\n\t\t\t\tgreen: \"colors Green green\",\n\t\t\t\tblue: \"colors Blue blue\",\n\t\t\t},\n\t\t\treportCard => {\n\t\t\t\tif (!requestedRichText) return\n\n\t\t\t\tconst wordTextColors = getInlineWordTextColors(requestedRichText)\n\t\t\t\treportCard.red = matchesTextColor(wordTextColors.get(\"Red\"), redTextColorPattern)\n\t\t\t\treportCard.green = matchesTextColor(wordTextColors.get(\"Green\"), greenTextColorPattern)\n\t\t\t\treportCard.blue = matchesTextColor(wordTextColors.get(\"Blue\"), blueTextColorPattern)\n\t\t\t},\n\t\t)\n\t},\n)\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,IAAM,KAAK;AACX,IAAM,eAAe;AAKrB,IAAM,UAAU,2BAA2B,IAAI,eAAe,wBAAwB,GAAG,EAAE,eAAe,MAAM,CAAC;AAEjH;AAAA,EACC;AAAA,EACA;AAAA,EACA,EAAE,IAAI,UAAU,GAAG,gBAAgB,KAAK;AAAA,EACxC,CAAC,EAAE,QAAQ,QAAQ,MAAM,MAAM;AAC9B,UAAM,mBAAmB,MAAM;AAE/B,UAAM,gBAAgB,MAAM;AAAA,MAC3B,OAAO,KAAK,MAAM,EAAE,gDAA4D,EAAE,QAAQ;AAAA,IAC3F;AACA,UAAM,oBAAoB,cAAc,KAAK,UAAQ,KAAK,eAAe,MAAM,YAAY;AAE3F,WAAO,SAAS,SAAS,oCAAoC,MAAM;AAClE,aAAO,aAAa,EAAE,aAAa,CAAC;AAAA,IACrC,CAAC;AAED,WAAO,cAAc,SAAS,kDAAkD,MAAM;AACrF,aAAO,iBAAiB,EAAE,YAAY;AAAA,IACvC,CAAC;AAED,WAAO,cAAc;AAAA,MACpB;AAAA,QACC,KAAK;AAAA,QACL,OAAO;AAAA,QACP,MAAM;AAAA,MACP;AAAA,MACA,gBAAc;AACb,YAAI,CAAC,kBAAmB;AAExB,cAAM,iBAAiB,wBAAwB,iBAAiB;AAChE,mBAAW,MAAM,iBAAiB,eAAe,IAAI,KAAK,GAAG,mBAAmB;AAChF,mBAAW,QAAQ,iBAAiB,eAAe,IAAI,OAAO,GAAG,qBAAqB;AACtF,mBAAW,OAAO,iBAAiB,eAAe,IAAI,MAAM,GAAG,oBAAoB;AAAA,MACpF;AAAA,IACD;AAAA,EACD;AACD;",
  "names": []
}
