house-lights 1.9.0 → 1.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "house-lights",
3
- "version": "1.9.0",
3
+ "version": "1.9.2",
4
4
  "description": "The command behind the house-lights skills: draw a lesson or a pitch, play an incident drill, map a way of working or a customer journey, compare Copilot Studio agents — one offline HTML file each.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -134,7 +134,7 @@ a.cl-get { color: var(--ink); text-decoration: none; font-weight: 600; }
134
134
  <body>
135
135
  <div class="cl" id="app"></div>
136
136
  <script type="application/json" id="cast">{{CAST}}</script>
137
- <script>(()=>{var ve="https://github.com/microsoft/skills-for-copilot-studio/blob/main/patterns",ee=[{id:"orchestrator-variables",name:"Orchestrator-Generated Variables",sign:"an OnRecognizedIntent topic with an AutomaticTaskInput that has shouldPromptUser: false"},{id:"rai-error-handling",name:"RAI Error Handling",sign:"the OnError topic reads System.Error.SubCode"},{id:"knowledge-hold-message",name:"Knowledge Hold Message",sign:"an OnKnowledgeRequested topic that sends a message"},{id:"prevent-tool-call-leaks",name:"Prevent Tool Call Leaks",sign:"an OnGeneratedResponse topic that sets System.ContinueResponse"},{id:"dynamic-topic-redirect",name:"Dynamic Topic Redirect",sign:"a BeginDialog whose dialog is a =Switch( expression"},{id:"channel-aware-behavior",name:"Channel-Aware Behavior",sign:"a condition or SetVariable that reads System.Activity.ChannelId (not a tool input)"},{id:"date-context",name:"Date Context",sign:"the instructions use Today() or Now()"},{id:"line-breaks-in-messages",name:"Line Breaks in Messages",sign:"<br /> inside a SendActivity or Question"},{id:"conversation-history-variable",name:"Conversation History Variable"},{id:"chain-of-thought-logging",name:"Chain of Thought Logging"},{id:"deterministic-mcp-calls",name:"Deterministic MCP Calls"},{id:"prevent-child-agent-responses",name:"Prevent Child Agent Responses"},{id:"jit-glossary",name:"JIT Glossary"},{id:"jit-user-context",name:"JIT User Context"},{id:"teams-production-hardening",name:"Teams Production Hardening"}];var G={conversation:{en:"A. Conversation",pt:"A. Conversa"},integrations:{en:"B. Integrations",pt:"B. Integra\xE7\xF5es"},knowledge:{en:"C. Knowledge",pt:"C. Conhecimento"},orchestration:{en:"D. Orchestrator",pt:"D. Orquestrador"},governance:{en:"E. Governance",pt:"E. Governan\xE7a"},text:{en:"F. Text",pt:"F. Texto"},microsoft:{en:"Microsoft patterns",pt:"Padr\xF5es Microsoft"},declared:{en:"Declared",pt:"Declarado"}},Ce={"trigger:OnConversationStart":{dim:"conversation",en:"Greeting",pt:"Boas-vindas"},"trigger:OnUnknownIntent":{dim:"conversation",en:"Fallback (when it does not understand)",pt:"Fallback (quando n\xE3o entende)"},"trigger:OnEscalate":{dim:"conversation",en:"Escalation to a person",pt:"Escalonamento para humano",lacks:{en:["does not escalate to a person","do not escalate to a person"],pt:["n\xE3o escala para humano","n\xE3o escalam para humano"]}},"trigger:OnError":{dim:"conversation",en:"Error handling",pt:"Tratamento de erro",lacks:{en:["does not handle errors","do not handle errors"],pt:["n\xE3o trata erro","n\xE3o tratam erro"]}},"trigger:OnRecognizedIntent":{dim:"conversation",en:"A topic of its own, by intent",pt:"T\xF3pico pr\xF3prio, por inten\xE7\xE3o"},"trigger:OnRedirect":{dim:"orchestration",en:"Takes a call from the orchestrator",pt:"Recebe chamada do orquestrador",lacks:{en:["takes no call from the orchestrator","take no call from the orchestrator"],pt:["n\xE3o recebe chamada do orquestrador","n\xE3o recebem chamada do orquestrador"]}},"trigger:OnSelectIntent":{dim:"conversation",en:"Disambiguation (\xABdid you mean\u2026\xBB)",pt:"Desambigua\xE7\xE3o (\xABvoc\xEA quis dizer\u2026\xBB)"},"trigger:OnSignIn":{dim:"conversation",en:"Sign-in",pt:"Login"},"trigger:OnGeneratedResponse":{dim:"conversation",en:"Reviews the generated answer",pt:"Revisa a resposta gerada"},"trigger:OnKnowledgeRequested":{dim:"knowledge",en:"Before searching knowledge",pt:"Antes de buscar no conhecimento"},"trigger:OnToolSelected":{dim:"orchestration",en:"Child chosen as a tool",pt:"Filho escolhido como ferramenta"},"trigger:OnActivity":{dim:"conversation",en:"On every message",pt:"Em toda mensagem"},"setting:generative=on":{dim:"conversation",en:"Generative orchestration on",pt:"Orquestra\xE7\xE3o generativa ligada"},"setting:generative=off":{dim:"conversation",en:"Generative orchestration off",pt:"Orquestra\xE7\xE3o generativa desligada"},"setting:model-knowledge=on":{dim:"governance",en:"The model's general knowledge on",pt:"Conhecimento geral do modelo ligado"},"setting:model-knowledge=off":{dim:"governance",en:"The model's general knowledge off",pt:"Conhecimento geral do modelo desligado"},"setting:semantic-search=on":{dim:"knowledge",en:"Semantic search on",pt:"Busca sem\xE2ntica ligada"},"setting:semantic-search=off":{dim:"knowledge",en:"Semantic search off",pt:"Busca sem\xE2ntica desligada"},"setting:web-browsing=on":{dim:"knowledge",en:"Web browsing on",pt:"Navega\xE7\xE3o na web ligada"},"setting:web-browsing=off":{dim:"knowledge",en:"Web browsing off",pt:"Navega\xE7\xE3o na web desligada"},"setting:connectable":{dim:"orchestration",en:"Can be called by an orchestrator",pt:"Pode ser chamado por um orquestrador"},"called-with:history":{dim:"orchestration",en:"Receives the conversation history",pt:"Recebe o hist\xF3rico da conversa",lacks:{en:["does not receive the conversation history from the orchestrator","do not receive the conversation history from the orchestrator"],pt:["n\xE3o recebe o hist\xF3rico da conversa do orquestrador","n\xE3o recebem o hist\xF3rico da conversa do orquestrador"]}},"routing:described":{dim:"orchestration",en:"Has a routing description",pt:"Tem descri\xE7\xE3o de roteamento",lacks:{en:["has no routing description","have no routing description"],pt:["n\xE3o tem descri\xE7\xE3o de roteamento","n\xE3o t\xEAm descri\xE7\xE3o de roteamento"]}},"flow-returns":{dim:"integrations",en:"The flow returns an answer",pt:"O fluxo devolve uma resposta",lacks:{en:["has a flow that returns nothing","have a flow that returns nothing"],pt:["tem fluxo que n\xE3o devolve nada","t\xEAm fluxo que n\xE3o devolve nada"]}},"flow-uses:child-flow":{dim:"integrations",en:"The flow calls another flow",pt:"O fluxo chama outro fluxo"},"topics:with-model-description":{dim:"conversation",en:"Topics described for the model",pt:"T\xF3picos descritos para o modelo"},"instructions:present":{dim:"governance",en:"Has instructions",pt:"Tem instru\xE7\xF5es",lacks:{en:["has no instructions","have no instructions"],pt:["n\xE3o tem instru\xE7\xF5es","n\xE3o t\xEAm instru\xE7\xF5es"]}},"node:LogCustomTelemetryEvent":{dim:"governance",en:"Logs telemetry",pt:"Registra telemetria",lacks:{en:["logs no telemetry","log no telemetry"],pt:["n\xE3o registra telemetria","n\xE3o registram telemetria"]}},"node:CSATQuestion":{dim:"governance",en:"Asks for satisfaction (CSAT)",pt:"Pergunta a satisfa\xE7\xE3o (CSAT)",lacks:{en:["does not ask for satisfaction","do not ask for satisfaction"],pt:["n\xE3o pergunta a satisfa\xE7\xE3o","n\xE3o perguntam a satisfa\xE7\xE3o"]}},"node:SearchAndSummarizeContent":{dim:"knowledge",en:"Generative answers from knowledge",pt:"Respostas generativas sobre o conhecimento"},"node:SearchKnowledgeSources":{dim:"knowledge",en:"Searches the knowledge sources",pt:"Busca nas fontes de conhecimento"},"yaml-only:triggerCondition":{dim:"knowledge",en:"Search condition only in YAML (the editor may erase it)",pt:"Condi\xE7\xE3o de busca s\xF3 no YAML (a tela pode apagar)"},"knowledge:SharePointSearchSource":{dim:"knowledge",en:"Knowledge in SharePoint",pt:"Conhecimento no SharePoint"},"declared:kpi":{dim:"declared",en:"KPI declared",pt:"KPI declarado",lacks:{en:["has no KPI declared","have no KPI declared"],pt:["n\xE3o tem KPI declarado","n\xE3o t\xEAm KPI declarado"]}},"eval:run":{dim:"governance",en:"Passed through an evaluation",pt:"Passou por uma avalia\xE7\xE3o",lacks:{en:["has no evaluation","have no evaluation"],pt:["n\xE3o tem avalia\xE7\xE3o","n\xE3o t\xEAm avalia\xE7\xE3o"]}},"declared:team":{dim:"declared",en:"Team declared",pt:"Equipe declarada",lacks:{en:["has no team declared","have no team declared"],pt:["n\xE3o tem equipe declarada","n\xE3o t\xEAm equipe declarada"]}},"declared:owner":{dim:"declared",en:"Owner declared",pt:"Respons\xE1vel declarado",lacks:{en:["has no owner declared","have no owner declared"],pt:["n\xE3o tem respons\xE1vel declarado","n\xE3o t\xEAm respons\xE1vel declarado"]}}},ze=Object.fromEntries(ee.map(e=>[e.id,e.name])),Be=[["called-with:input:","orchestration","Receives <value> from the orchestrator","Recebe <valor> do orquestrador"],["flow-uses:http:","integrations","Flow calls","Fluxo chama"],["flow-uses:connector:","integrations","Flow uses the connector","Fluxo usa o conector"],["flow-uses:operation:","integrations","Flow uses the operation","Fluxo usa a opera\xE7\xE3o"],["orphan:topic:","governance","Topic nobody calls","T\xF3pico que ningu\xE9m chama"],["orphan:action:","governance","Tool nobody can choose","Ferramenta que ningu\xE9m escolhe"],["orphan:variable:","governance","Variable nobody uses","Vari\xE1vel que ningu\xE9m usa"],["orphan:flow:","governance","Flow nobody calls","Fluxo que ningu\xE9m chama"],["disabled:node:","governance","Switched-off node","N\xF3 desligado"],["telemetry:event:","governance","Logs the event","Registra o evento"],["telemetry:field:","governance","The event carries the field (<event>/<field>)","O evento leva o campo (<evento>/<campo>)"],["disabled:","governance","Switched off","Desligado"],["reaches:","conversation","A topic leads to it (part of trigger:<value>)","Um t\xF3pico leva a ele (parte de trigger:<valor>)"],["calls:topic:","conversation","Calls the topic (one not found)","Chama o t\xF3pico (n\xE3o encontrado)"],["trigger:","conversation","Trigger","Gatilho"],["setting:","conversation","Setting","Configura\xE7\xE3o"],["connector:","integrations","Connector","Conector"],["operation:","integrations","Operation","Opera\xE7\xE3o"],["connref:","integrations","Connection reference","Refer\xEAncia de conex\xE3o"],["mcp:","integrations","MCP server","Servidor MCP"],["flow:","integrations","Flow","Fluxo"],["knowledge:","knowledge","Knowledge","Conhecimento"],["node:","governance","Node","N\xF3"],["calls:","orchestration","Calls","Chama"],["child:","orchestration","Child","Filho"],["var-in:","orchestration","Receives from the orchestrator","Recebe do orquestrador"],["var:","orchestration","Global variable","Vari\xE1vel global"],["model:","governance","Model","Modelo"],["auth:","governance","Sign-in","Login"],["ms:","microsoft","Microsoft pattern:","Padr\xE3o Microsoft:"],["text:","text","Text:","Texto:"],["declared:","declared","Declared:","Declarado:"]],Pe=e=>Be.find(([n])=>e.startsWith(n));function _(e){return e.startsWith("reaches:")?_(`trigger:${e.slice(8)}`):Ce[e]?.dim??Pe(e)?.[1]??"governance"}var je=80;function ke(e){if(e.startsWith("reaches:"))return`trigger:${e.slice(8)}`;if(e.startsWith("telemetry:event:"))return"node:LogCustomTelemetryEvent";if(e.startsWith("telemetry:field:"))return`telemetry:event:${e.slice(16,e.lastIndexOf("/"))}`}var L=(e,n)=>e.split("{agent}").join(n==="pt"?"\u2039nome\u203A":"\u2039name\u203A"),Ke=e=>({form:e.slice(16,e.lastIndexOf("/")),field:e.slice(e.lastIndexOf("/")+1)}),Re=(e,n)=>n?.[e]??e;function R(e,n,a){let r=Ce[e];if(r)return r[n];if(e.startsWith("text:block:")){let c=e.endsWith("~variant"),m=c?e.slice(0,-8):e,h=a?.[m]??m.slice(11);return c?`${h} (${n==="pt"?"varia\xE7\xE3o":"variation"})`:h}if(e.startsWith("text:link-domain:"))return`${n==="pt"?"Link para":"Link to"} ${e.slice(17)}`;if(e==="text:email")return n==="pt"?"Cita um e-mail":"Mentions an e-mail";if(e.startsWith("text:")){let[c,m]=[e.slice(5).split("=")[0],e.includes("=")?e.slice(e.indexOf("=")+1):void 0],h=a?.[`text:${c}`]??c;return m===void 0?h:`${h} = ${m}`}if(e.startsWith("reaches:")){let c=R(`trigger:${e.slice(8)}`,n);return n==="pt"?`Um t\xF3pico leva a \xAB${c}\xBB`:`A topic leads to \xAB${c}\xBB`}if(e.startsWith("called-with:input:"))return n==="pt"?`Recebe \xAB${e.slice(18)}\xBB do orquestrador`:`Receives \xAB${e.slice(18)}\xBB from the orchestrator`;if(e.startsWith("telemetry:event:"))return n==="pt"?`Registra o evento \xAB${L(e.slice(16),n)}\xBB`:`Logs the event \xAB${L(e.slice(16),n)}\xBB`;if(e.startsWith("telemetry:field:")){let{form:c,field:m}=Ke(e),h=L(c,n);return n==="pt"?`\xAB${h}\xBB leva \xAB${m}\xBB`:`\xAB${h}\xBB carries \xAB${m}\xBB`}let t=/^knowledge:count=(\d+)$/.exec(e);if(t){let c=Number(t[1]);return n==="pt"?`${c} ${c===1?"fonte":"fontes"} de conhecimento`:`${c} knowledge ${c===1?"source":"sources"}`}let s=Pe(e);if(!s)return e;let l=e.slice(s[0].length);if(s[0]==="ms:"&&(l=ze[l]??l),s[0]==="auth:"&&l==="None")return n==="pt"?"Sem login":"No sign-in";if(e.startsWith("setting:moderation="))return n==="pt"?`Modera\xE7\xE3o de conte\xFAdo: ${e.slice(19)}`:`Content moderation: ${e.slice(19)}`;if(["connector:","connref:","mcp:","calls:","flow:","flow-uses:connector:","orphan:flow:"].includes(s[0])&&(l=Re(l,a)),s[0]==="disabled:"&&(l=l.replace(":"," ")),s[0]==="operation:"||s[0]==="flow-uses:operation:"){let[c,m]=[l.slice(0,l.indexOf("/")),l.slice(l.indexOf("/")+1)];l=`${Re(c,a)} \xB7 ${m}`}return`${s[n==="pt"?3:2]} ${l}`}var Ye={specialist:{en:["specialist","specialists"],pt:["especialista","especialistas"]},orchestrator:{en:["orchestrator","orchestrators"],pt:["orquestrador","orquestradores"]}},we=(e,n,a)=>Ye[e][n][a===1?0:1],te={en:{summary:"Summary",matrix:"Matrix",patterns:"Patterns",text:"Text",off:"Off pattern",gaps:"Gaps",conflicts:"Conflicts",agents:"Cast",evidence:"Evidence",declared:"Declared",unknown:"Not understood",routing:"Routing",unused:"Unused",telemetry:"Telemetry",written:"As written",form:"Form",fields:"Fields",fired:e=>`Fired (${e} days)`,notRead:"not read",caller:"Caller",called:"Called",history:"History",inputs:"Inputs",routingText:"Routing description",chars:"Characters",notInFolder:"not in the folder",what:"What",how:"How",thing:{topic:"topic",action:"tool",variable:"variable",flow:"flow",node:"node",knowledge:"knowledge source"},orphan:"nobody uses it",disabled:"switched off",dimension:"Dimension",fact:"Fact",key:"Key",agent:"Who",name:"Name",role:"Role",scope:"Scope",share:"Share",have:"Who has it",lack:"Who lacks it",decision:"Decision",why:"Why",missing:"Missing",accepted:"Accepted pattern",rule:"Rule",says:"Says",notMet:"Who does not meet it",value:"Value",source:"Source",inYaml:"In the YAML",file:"File",line:"Line",facts:"Facts",alone:"Only it has",children:"Children",kind:"Kind",types:"Types",id:"Id",label:"Label",body:"Text",variant:"Variation",official:"Official",type:"type",yes:"yes",no:"no",accept:"accepted",reject:"rejected",platform:"platform",specialist:"specialist",orchestrator:"orchestrator",staff:"Staff",pdi:"Development plan",situation_:"Situation",manager:"Manager",teamCol:"Team",ownerCol:"Owner",hired:"Hired",publishedCol:"Published",items:"Plan items",item:"Item",group:"Group",situation:{hiring:"being hired",noOwner:"no owner",neverPublished:"never published",noEval:"no evaluation",pdi:"in a plan",ok:"in good standing"},pdiGroup:{contradictions:"contradiction",contract:"contract",off:"off pattern",rules:"rule",text:"text",telemetry:"telemetry",cleanup:"cleanup"},title:"The cast, compared",look:"To look at",nothing:"Nothing to look at",privacy:"This file holds the client\u2019s data: keep it in the client\u2019s environment.",count:{agents:"In the cast",orchestrators:"Orchestrators",specialists:"Specialists",patterns:"Patterns",off:"Off a pattern",gaps:"Rules not met",conflicts:"Conflicts",solos:"Only one has it",unused:"Unused or switched off"},why_:{yaml:"YAML that does not read",empty:"empty",kind:"a kind Copilot Studio does not have",file:"not a Copilot Studio file",json:"JSON that does not read",flow:"a flow in a shape the analysis does not know",telemetry:"a telemetry event whose name is a formula"}},pt:{summary:"Resumo",matrix:"Matriz",patterns:"Padr\xF5es",text:"Texto",off:"Fora do padr\xE3o",gaps:"Lacunas",conflicts:"Conflitos",agents:"Elenco",evidence:"Evid\xEAncias",declared:"Declarado",unknown:"N\xE3o entendeu",routing:"Roteamento",unused:"Sem uso",telemetry:"Telemetria",written:"Como est\xE1 escrito",form:"Forma",fields:"Campos",fired:e=>`Disparou (${e} dias)`,notRead:"n\xE3o lido",caller:"Quem chama",called:"Chamado",history:"Hist\xF3rico",inputs:"Entradas",routingText:"Descri\xE7\xE3o de roteamento",chars:"Caracteres",notInFolder:"n\xE3o est\xE1 na pasta",what:"O qu\xEA",how:"Como",thing:{topic:"t\xF3pico",action:"ferramenta",variable:"vari\xE1vel",flow:"fluxo",node:"n\xF3",knowledge:"fonte de conhecimento"},orphan:"ningu\xE9m usa",disabled:"desligado",dimension:"Dimens\xE3o",fact:"Fato",key:"Chave",agent:"Quem",name:"Nome",role:"Papel",scope:"Escopo",share:"Quantos",have:"Quem tem",lack:"Quem falta",decision:"Decis\xE3o",why:"Por qu\xEA",missing:"Falta",accepted:"Padr\xE3o aceito",rule:"Regra",says:"Diz",notMet:"Quem n\xE3o cumpre",value:"Valor",source:"Fonte",inYaml:"No YAML",file:"Arquivo",line:"Linha",facts:"Fatos",alone:"S\xF3 ele tem",children:"Filhos",kind:"Kind",types:"Tipos",id:"Id",label:"R\xF3tulo",body:"Texto",variant:"Varia\xE7\xE3o",official:"Oficial",type:"tipo",yes:"sim",no:"n\xE3o",accept:"aceito",reject:"rejeitado",platform:"plataforma",specialist:"especialista",orchestrator:"orquestrador",staff:"Quadro de pessoal",pdi:"PDI",situation_:"Situa\xE7\xE3o",manager:"Gestor",teamCol:"Equipe",ownerCol:"Respons\xE1vel",hired:"Admiss\xE3o",publishedCol:"Publica\xE7\xE3o",items:"Itens de PDI",item:"Item",group:"Grupo",situation:{hiring:"em admiss\xE3o",noOwner:"sem respons\xE1vel",neverPublished:"nunca publicado",noEval:"sem avalia\xE7\xE3o",pdi:"em PDI",ok:"em dia"},pdiGroup:{contradictions:"contradi\xE7\xE3o",contract:"contrato",off:"fora do padr\xE3o",rules:"regra",text:"texto",telemetry:"telemetria",cleanup:"limpeza"},title:"Elenco comparado",look:"Para olhar",nothing:"Nada para olhar",privacy:"Este arquivo tem dados do cliente: deixe-o no ambiente dele.",count:{agents:"No elenco",orchestrators:"Orquestradores",specialists:"Especialistas",patterns:"Padr\xF5es",off:"Fora do padr\xE3o",gaps:"Regras n\xE3o cumpridas",conflicts:"Conflitos",solos:"S\xF3 um tem",unused:"Sem uso ou desligado"},why_:{yaml:"YAML que n\xE3o se l\xEA",empty:"vazio",kind:"um kind que o Copilot Studio n\xE3o tem",file:"n\xE3o \xE9 arquivo do Copilot Studio",json:"JSON que n\xE3o se l\xEA",flow:"um fluxo num formato que a an\xE1lise n\xE3o conhece",telemetry:"um evento de telemetria com o nome em f\xF3rmula"}}};var Fe=[{key:"contradictions",en:"Contradictions",pt:"Contradi\xE7\xF5es",keys:["conflict","contradiction"]},{key:"contract",en:"Contract and telemetry",pt:"Contrato e telemetria",keys:["spelling","contract","flow","telemetry"]},{key:"off",en:"Off pattern",pt:"Fora do padr\xE3o",keys:["off","values","twice","type"]},{key:"rules",en:"Rules",pt:"Regras",keys:["gap"]},{key:"solo",en:"Only one has it",pt:"S\xF3 um tem",keys:["solo"],folded:!0},{key:"unused",en:"Unused",pt:"Sem uso",keys:["unused"],folded:!0},{key:"unknown",en:"Not understood",pt:"N\xE3o entendeu",keys:["unknown","unmatched"]}],Mt=Fe.flatMap(e=>e.keys);function ne(e){return Fe.map(n=>({key:n.key,en:n.en,pt:n.pt,folded:!!n.folded,looks:e.flatMap((a,r)=>n.keys.includes(a.key)?[{look:a,at:r}]:[])})).filter(n=>n.looks.length)}function oe(e){let n=t=>e.offPattern.some(s=>s.key===t.key||s.partOf===t.key),a=t=>t.share===1&&!t.decision&&!n(t),r=e.patterns.filter(t=>!t.partOf);return{look:r.filter(t=>!a(t)),everyone:r.filter(a)}}var Ne=new TextEncoder,be=e=>e.replace(/[&<>"]/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[n]).replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g,""),Q=e=>e<26?String.fromCharCode(65+e):Q(Math.floor(e/26)-1)+String.fromCharCode(65+e%26),Qe=e=>e.replace(/[:\\/?*[\]]/g," ").slice(0,31)||"Sheet";function Xe(e){let n=[{}],a=d=>JSON.stringify([d.bold??!1,d.fill??"",d.color??"",d.center??!1,d.wrap??!1]),r=new Map([[a({}),0]]);for(let d of e)for(let p of d.rows)for(let k of p){if(typeof k!="object")continue;let{v:j,...P}=k,W=a(P);r.has(W)||(r.set(W,n.length),n.push(P))}let t=new Map([["|",0]]),s=new Map([["",0]]),l=d=>{let p=`${d.bold?"b":""}|${d.color??""}`;return t.has(p)||t.set(p,t.size),t.get(p)},c=d=>d.fill?(s.has(d.fill)||s.set(d.fill,s.size+1),s.get(d.fill)):0,m=n.map(d=>{let p=d.center||d.wrap?`<alignment${d.center?' horizontal="center"':""}${d.wrap?' wrapText="1"':""} vertical="top"/>`:'<alignment vertical="top"/>';return`<xf numFmtId="0" fontId="${l(d)}" fillId="${c(d)}" borderId="${d.fill||d.bold?1:0}" xfId="0" applyFont="1" applyFill="1" applyBorder="1" applyAlignment="1">${p}</xf>`}),h=[...t.keys()].map(d=>{let[p,k]=d.split("|");return`<font>${p?"<b/>":""}<sz val="11"/>${k?`<color rgb="FF${k}"/>`:""}<name val="Calibri"/><family val="2"/></font>`}),f=['<fill><patternFill patternType="none"/></fill>','<fill><patternFill patternType="gray125"/></fill>',...[...s.keys()].filter(Boolean).map(d=>`<fill><patternFill patternType="solid"><fgColor rgb="FF${d}"/><bgColor indexed="64"/></patternFill></fill>`)];return{xml:`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
137
+ <script>(()=>{var ve="https://github.com/microsoft/skills-for-copilot-studio/blob/main/patterns",ee=[{id:"orchestrator-variables",name:"Orchestrator-Generated Variables",sign:"an OnRecognizedIntent topic with an AutomaticTaskInput that has shouldPromptUser: false"},{id:"rai-error-handling",name:"RAI Error Handling",sign:"the OnError topic reads System.Error.SubCode"},{id:"knowledge-hold-message",name:"Knowledge Hold Message",sign:"an OnKnowledgeRequested topic that sends a message"},{id:"prevent-tool-call-leaks",name:"Prevent Tool Call Leaks",sign:"an OnGeneratedResponse topic that sets System.ContinueResponse"},{id:"dynamic-topic-redirect",name:"Dynamic Topic Redirect",sign:"a BeginDialog whose dialog is a =Switch( expression"},{id:"channel-aware-behavior",name:"Channel-Aware Behavior",sign:"a condition or SetVariable that reads System.Activity.ChannelId (not a tool input)"},{id:"date-context",name:"Date Context",sign:"the instructions use Today() or Now()"},{id:"line-breaks-in-messages",name:"Line Breaks in Messages",sign:"<br /> inside a SendActivity or Question"},{id:"conversation-history-variable",name:"Conversation History Variable"},{id:"chain-of-thought-logging",name:"Chain of Thought Logging"},{id:"deterministic-mcp-calls",name:"Deterministic MCP Calls"},{id:"prevent-child-agent-responses",name:"Prevent Child Agent Responses"},{id:"jit-glossary",name:"JIT Glossary"},{id:"jit-user-context",name:"JIT User Context"},{id:"teams-production-hardening",name:"Teams Production Hardening"}];var G={conversation:{en:"A. Conversation",pt:"A. Conversa"},integrations:{en:"B. Integrations",pt:"B. Integra\xE7\xF5es"},knowledge:{en:"C. Knowledge",pt:"C. Conhecimento"},orchestration:{en:"D. Orchestrator",pt:"D. Orquestrador"},governance:{en:"E. Governance",pt:"E. Governan\xE7a"},text:{en:"F. Text",pt:"F. Texto"},microsoft:{en:"Microsoft patterns",pt:"Padr\xF5es Microsoft"},declared:{en:"Declared",pt:"Declarado"}},ke={"trigger:OnConversationStart":{dim:"conversation",en:"Greeting",pt:"Boas-vindas"},"trigger:OnUnknownIntent":{dim:"conversation",en:"Fallback (when it does not understand)",pt:"Fallback (quando n\xE3o entende)"},"trigger:OnEscalate":{dim:"conversation",en:"Escalation to a person",pt:"Escalonamento para humano",lacks:{en:["does not escalate to a person","do not escalate to a person"],pt:["n\xE3o escala para humano","n\xE3o escalam para humano"]}},"trigger:OnError":{dim:"conversation",en:"Error handling",pt:"Tratamento de erro",lacks:{en:["does not handle errors","do not handle errors"],pt:["n\xE3o trata erro","n\xE3o tratam erro"]}},"trigger:OnRecognizedIntent":{dim:"conversation",en:"A topic of its own, by intent",pt:"T\xF3pico pr\xF3prio, por inten\xE7\xE3o"},"trigger:OnRedirect":{dim:"orchestration",phrase:!0,en:"Takes a call from the orchestrator",pt:"Recebe chamada do orquestrador",lacks:{en:["takes no call from the orchestrator","take no call from the orchestrator"],pt:["n\xE3o recebe chamada do orquestrador","n\xE3o recebem chamada do orquestrador"]}},"trigger:OnSelectIntent":{dim:"conversation",en:"Disambiguation (\xABdid you mean\u2026\xBB)",pt:"Desambigua\xE7\xE3o (\xABvoc\xEA quis dizer\u2026\xBB)"},"trigger:OnSignIn":{dim:"conversation",en:"Sign-in",pt:"Login"},"trigger:OnGeneratedResponse":{dim:"conversation",phrase:!0,en:"Reviews the generated answer",pt:"Revisa a resposta gerada"},"trigger:OnKnowledgeRequested":{dim:"knowledge",en:"Before searching knowledge",pt:"Antes de buscar no conhecimento"},"trigger:OnToolSelected":{dim:"orchestration",en:"Child chosen as a tool",pt:"Filho escolhido como ferramenta"},"trigger:OnActivity":{dim:"conversation",en:"On every message",pt:"Em toda mensagem"},"setting:generative=on":{dim:"conversation",en:"Generative orchestration on",pt:"Orquestra\xE7\xE3o generativa ligada"},"setting:generative=off":{dim:"conversation",en:"Generative orchestration off",pt:"Orquestra\xE7\xE3o generativa desligada"},"setting:model-knowledge=on":{dim:"governance",en:"The model's general knowledge on",pt:"Conhecimento geral do modelo ligado"},"setting:model-knowledge=off":{dim:"governance",en:"The model's general knowledge off",pt:"Conhecimento geral do modelo desligado"},"setting:semantic-search=on":{dim:"knowledge",en:"Semantic search on",pt:"Busca sem\xE2ntica ligada"},"setting:semantic-search=off":{dim:"knowledge",en:"Semantic search off",pt:"Busca sem\xE2ntica desligada"},"setting:web-browsing=on":{dim:"knowledge",en:"Web browsing on",pt:"Navega\xE7\xE3o na web ligada"},"setting:web-browsing=off":{dim:"knowledge",en:"Web browsing off",pt:"Navega\xE7\xE3o na web desligada"},"setting:connectable":{dim:"orchestration",phrase:!0,en:"Can be called by an orchestrator",pt:"Pode ser chamado por um orquestrador"},"called-with:history":{dim:"orchestration",phrase:!0,en:"Receives the conversation history",pt:"Recebe o hist\xF3rico da conversa",lacks:{en:["does not receive the conversation history from the orchestrator","do not receive the conversation history from the orchestrator"],pt:["n\xE3o recebe o hist\xF3rico da conversa do orquestrador","n\xE3o recebem o hist\xF3rico da conversa do orquestrador"]}},"routing:described":{dim:"orchestration",phrase:!0,en:"Has a routing description",pt:"Tem descri\xE7\xE3o de roteamento",lacks:{en:["has no routing description","have no routing description"],pt:["n\xE3o tem descri\xE7\xE3o de roteamento","n\xE3o t\xEAm descri\xE7\xE3o de roteamento"]}},"flow-returns":{dim:"integrations",phrase:!0,en:"The flow returns an answer",pt:"O fluxo devolve uma resposta",lacks:{en:["has a flow that returns nothing","have a flow that returns nothing"],pt:["tem fluxo que n\xE3o devolve nada","t\xEAm fluxo que n\xE3o devolve nada"]}},"flow-uses:child-flow":{dim:"integrations",phrase:!0,en:"The flow calls another flow",pt:"O fluxo chama outro fluxo"},"topics:with-model-description":{dim:"conversation",en:"Topics described for the model",pt:"T\xF3picos descritos para o modelo"},"instructions:present":{dim:"governance",phrase:!0,en:"Has instructions",pt:"Tem instru\xE7\xF5es",lacks:{en:["has no instructions","have no instructions"],pt:["n\xE3o tem instru\xE7\xF5es","n\xE3o t\xEAm instru\xE7\xF5es"]}},"node:LogCustomTelemetryEvent":{dim:"governance",phrase:!0,en:"Logs telemetry",pt:"Registra telemetria",lacks:{en:["logs no telemetry","log no telemetry"],pt:["n\xE3o registra telemetria","n\xE3o registram telemetria"]}},"node:CSATQuestion":{dim:"governance",phrase:!0,en:"Asks for satisfaction (CSAT)",pt:"Pergunta a satisfa\xE7\xE3o (CSAT)",lacks:{en:["does not ask for satisfaction","do not ask for satisfaction"],pt:["n\xE3o pergunta a satisfa\xE7\xE3o","n\xE3o perguntam a satisfa\xE7\xE3o"]}},"node:SearchAndSummarizeContent":{dim:"knowledge",en:"Generative answers from knowledge",pt:"Respostas generativas sobre o conhecimento"},"node:SearchKnowledgeSources":{dim:"knowledge",phrase:!0,en:"Searches the knowledge sources",pt:"Busca nas fontes de conhecimento"},"yaml-only:triggerCondition":{dim:"knowledge",en:"Search condition only in YAML (the editor may erase it)",pt:"Condi\xE7\xE3o de busca s\xF3 no YAML (a tela pode apagar)"},"knowledge:SharePointSearchSource":{dim:"knowledge",en:"Knowledge in SharePoint",pt:"Conhecimento no SharePoint"},"declared:kpi":{dim:"declared",en:"KPI declared",pt:"KPI declarado",lacks:{en:["has no KPI declared","have no KPI declared"],pt:["n\xE3o tem KPI declarado","n\xE3o t\xEAm KPI declarado"]}},"eval:run":{dim:"governance",phrase:!0,en:"Passed through an evaluation",pt:"Passou por uma avalia\xE7\xE3o",lacks:{en:["has no evaluation","have no evaluation"],pt:["n\xE3o tem avalia\xE7\xE3o","n\xE3o t\xEAm avalia\xE7\xE3o"]}},"declared:team":{dim:"declared",en:"Team declared",pt:"Equipe declarada",lacks:{en:["has no team declared","have no team declared"],pt:["n\xE3o tem equipe declarada","n\xE3o t\xEAm equipe declarada"]}},"declared:owner":{dim:"declared",en:"Owner declared",pt:"Respons\xE1vel declarado",lacks:{en:["has no owner declared","have no owner declared"],pt:["n\xE3o tem respons\xE1vel declarado","n\xE3o t\xEAm respons\xE1vel declarado"]}}},Be=Object.fromEntries(ee.map(e=>[e.id,e.name])),Ke=[["called-with:input:","orchestration","Receives <value> from the orchestrator","Recebe <valor> do orquestrador"],["flow-uses:http:","integrations","Flow calls","Fluxo chama"],["flow-uses:connector:","integrations","Flow uses the connector","Fluxo usa o conector"],["flow-uses:operation:","integrations","Flow uses the operation","Fluxo usa a opera\xE7\xE3o"],["orphan:topic:","governance","Topic nobody calls","T\xF3pico que ningu\xE9m chama"],["orphan:action:","governance","Tool nobody can choose","Ferramenta que ningu\xE9m escolhe"],["orphan:variable:","governance","Variable nobody uses","Vari\xE1vel que ningu\xE9m usa"],["orphan:flow:","governance","Flow nobody calls","Fluxo que ningu\xE9m chama"],["disabled:node:","governance","Switched-off node","N\xF3 desligado"],["telemetry:event:","governance","Logs the event","Registra o evento"],["telemetry:field:","governance","The event carries the field (<event>/<field>)","O evento leva o campo (<evento>/<campo>)"],["disabled:","governance","Switched off","Desligado"],["reaches:","conversation","A topic leads to it (part of trigger:<value>)","Um t\xF3pico leva a ele (parte de trigger:<valor>)"],["calls:topic:","conversation","Calls the topic (one not found)","Chama o t\xF3pico (n\xE3o encontrado)"],["trigger:","conversation","Trigger","Gatilho"],["setting:","conversation","Setting","Configura\xE7\xE3o"],["connector:","integrations","Connector","Conector"],["operation:","integrations","Operation","Opera\xE7\xE3o"],["connref:","integrations","Connection reference","Refer\xEAncia de conex\xE3o"],["mcp:","integrations","MCP server","Servidor MCP"],["flow:","integrations","Flow","Fluxo"],["knowledge:","knowledge","Knowledge","Conhecimento"],["node:","governance","Node","N\xF3"],["calls:","orchestration","Calls","Chama"],["child:","orchestration","Child","Filho"],["var-in:","orchestration","Receives from the orchestrator","Recebe do orquestrador"],["var:","orchestration","Global variable","Vari\xE1vel global"],["model:","governance","Model","Modelo"],["auth:","governance","Sign-in","Login"],["ms:","microsoft","Microsoft pattern:","Padr\xE3o Microsoft:"],["text:","text","Text:","Texto:"],["declared:","declared","Declared:","Declarado:"]],Pe=e=>Ke.find(([n])=>e.startsWith(n));function _(e){return e.startsWith("reaches:")?_(`trigger:${e.slice(8)}`):ke[e]?.dim??Pe(e)?.[1]??"governance"}var je=80;function we(e){if(e.startsWith("reaches:"))return`trigger:${e.slice(8)}`;if(e.startsWith("telemetry:event:"))return"node:LogCustomTelemetryEvent";if(e.startsWith("telemetry:field:"))return`telemetry:event:${e.slice(16,e.lastIndexOf("/"))}`}var E=(e,n)=>e.split("{agent}").join(n==="pt"?"\u2039nome\u203A":"\u2039name\u203A"),Ye=e=>({form:e.slice(16,e.lastIndexOf("/")),field:e.slice(e.lastIndexOf("/")+1)}),Qe={shared_commondataserviceforapps:"Microsoft Dataverse",shared_sharepointonline:"SharePoint",shared_office365:"Office 365 Outlook",shared_office365users:"Office 365 Users",shared_teams:"Microsoft Teams",shared_approvals:"Approvals",shared_onedriveforbusiness:"OneDrive for Business",shared_excelonlinebusiness:"Excel Online (Business)",shared_sql:"SQL Server",shared_azureblob:"Azure Blob Storage",shared_planner:"Planner",shared_outlook:"Outlook.com",shared_webcontents:"HTTP with Microsoft Entra ID",shared_servicenow:"ServiceNow",shared_salesforce:"Salesforce"},Ce=(e,n)=>n?.[e]??Qe[e]??e,Xe=["called-with:input:","telemetry:event:","telemetry:field:","flow-uses:","var-in:","reaches:"],Ne=e=>!!ke[e]?.phrase||Xe.some(n=>e.startsWith(n));function T(e,n,a){let r=ke[e];if(r)return r[n];if(e.startsWith("text:block:")){let c=e.endsWith("~variant"),m=c?e.slice(0,-8):e,h=a?.[m]??m.slice(11);return c?`${h} (${n==="pt"?"varia\xE7\xE3o":"variation"})`:h}if(e.startsWith("text:link-domain:"))return`${n==="pt"?"Link para":"Link to"} ${e.slice(17)}`;if(e==="text:email")return n==="pt"?"Cita um e-mail":"Mentions an e-mail";if(e.startsWith("text:")){let[c,m]=[e.slice(5).split("=")[0],e.includes("=")?e.slice(e.indexOf("=")+1):void 0],h=a?.[`text:${c}`]??c;return m===void 0?h:`${h} = ${m}`}if(e.startsWith("reaches:")){let c=T(`trigger:${e.slice(8)}`,n);return n==="pt"?`Um t\xF3pico leva a \xAB${c}\xBB`:`A topic leads to \xAB${c}\xBB`}if(e.startsWith("called-with:input:"))return n==="pt"?`Recebe \xAB${e.slice(18)}\xBB do orquestrador`:`Receives \xAB${e.slice(18)}\xBB from the orchestrator`;if(e.startsWith("telemetry:event:"))return n==="pt"?`Registra o evento \xAB${E(e.slice(16),n)}\xBB`:`Logs the event \xAB${E(e.slice(16),n)}\xBB`;if(e.startsWith("telemetry:field:")){let{form:c,field:m}=Ye(e),h=E(c,n);return n==="pt"?`\xAB${h}\xBB leva \xAB${m}\xBB`:`\xAB${h}\xBB carries \xAB${m}\xBB`}let t=/^knowledge:count=(\d+)$/.exec(e);if(t){let c=Number(t[1]);return n==="pt"?`${c} ${c===1?"fonte":"fontes"} de conhecimento`:`${c} knowledge ${c===1?"source":"sources"}`}let s=Pe(e);if(!s)return e;let l=e.slice(s[0].length);if(s[0]==="ms:"&&(l=Be[l]??l),s[0]==="auth:"&&l==="None")return n==="pt"?"Sem login":"No sign-in";if(e.startsWith("setting:moderation="))return n==="pt"?`Modera\xE7\xE3o de conte\xFAdo: ${e.slice(19)}`:`Content moderation: ${e.slice(19)}`;if(["connector:","connref:","mcp:","calls:","flow:","flow-uses:connector:","orphan:flow:"].includes(s[0])&&(l=Ce(l,a)),s[0]==="disabled:"&&(l=l.replace(":"," ")),s[0]==="operation:"||s[0]==="flow-uses:operation:"){let[c,m]=[l.slice(0,l.indexOf("/")),l.slice(l.indexOf("/")+1)];l=`${Ce(c,a)} \xB7 ${m}`}return`${s[n==="pt"?3:2]} ${l}`}var Je={specialist:{en:["specialist","specialists"],pt:["especialista","especialistas"]},orchestrator:{en:["orchestrator","orchestrators"],pt:["orquestrador","orquestradores"]}},be=(e,n,a)=>Je[e][n][a===1?0:1],te={en:{summary:"Summary",matrix:"Matrix",patterns:"Patterns",text:"Text",off:"Off pattern",gaps:"Gaps",conflicts:"Conflicts",agents:"Cast",evidence:"Evidence",declared:"Declared",unknown:"Not understood",routing:"Routing",unused:"Unused",telemetry:"Telemetry",written:"As written",form:"Form",fields:"Fields",fired:e=>`Fired (${e} days)`,notRead:"not read",caller:"Caller",called:"Called",history:"History",inputs:"Inputs",routingText:"Routing description",chars:"Characters",notInFolder:"not in the folder",what:"What",how:"How",thing:{topic:"topic",action:"tool",variable:"variable",flow:"flow",node:"node",knowledge:"knowledge source"},orphan:"nobody uses it",disabled:"switched off",dimension:"Dimension",fact:"Fact",key:"Key",agent:"Who",name:"Name",role:"Role",scope:"Scope",share:"Share",have:"Who has it",lack:"Who lacks it",decision:"Decision",why:"Why",missing:"Missing",accepted:"Accepted pattern",rule:"Rule",says:"Says",notMet:"Who does not meet it",value:"Value",source:"Source",inYaml:"In the YAML",file:"File",line:"Line",facts:"Facts",alone:"Only it has",children:"Children",kind:"Kind",types:"Types",id:"Id",label:"Label",body:"Text",variant:"Variation",official:"Official",type:"type",yes:"yes",no:"no",accept:"accepted",reject:"rejected",platform:"platform",specialist:"specialist",orchestrator:"orchestrator",staff:"Staff",pdi:"Development plan",situation_:"Situation",manager:"Manager",teamCol:"Team",ownerCol:"Owner",hired:"Hired",publishedCol:"Published",items:"Plan items",item:"Item",group:"Group",situation:{hiring:"being hired",noOwner:"no owner",neverPublished:"never published",noEval:"no evaluation",pdi:"in a plan",ok:"in good standing"},pdiGroup:{contradictions:"contradiction",contract:"contract",off:"off pattern",rules:"rule",text:"text",telemetry:"telemetry",cleanup:"cleanup"},title:"The cast, compared",look:"To look at",nothing:"Nothing to look at",privacy:"This file holds the client\u2019s data: keep it in the client\u2019s environment.",count:{agents:"In the cast",orchestrators:"Orchestrators",specialists:"Specialists",patterns:"Patterns",off:"Off a pattern",gaps:"Rules not met",conflicts:"Conflicts",solos:"Only one has it",unused:"Unused or switched off"},why_:{yaml:"YAML that does not read",empty:"empty",kind:"a kind Copilot Studio does not have",file:"not a Copilot Studio file",json:"JSON that does not read",flow:"a flow in a shape the analysis does not know",telemetry:"a telemetry event whose name is a formula"}},pt:{summary:"Resumo",matrix:"Matriz",patterns:"Padr\xF5es",text:"Texto",off:"Fora do padr\xE3o",gaps:"Lacunas",conflicts:"Conflitos",agents:"Elenco",evidence:"Evid\xEAncias",declared:"Declarado",unknown:"N\xE3o entendeu",routing:"Roteamento",unused:"Sem uso",telemetry:"Telemetria",written:"Como est\xE1 escrito",form:"Forma",fields:"Campos",fired:e=>`Disparou (${e} dias)`,notRead:"n\xE3o lido",caller:"Quem chama",called:"Chamado",history:"Hist\xF3rico",inputs:"Entradas",routingText:"Descri\xE7\xE3o de roteamento",chars:"Caracteres",notInFolder:"n\xE3o est\xE1 na pasta",what:"O qu\xEA",how:"Como",thing:{topic:"t\xF3pico",action:"ferramenta",variable:"vari\xE1vel",flow:"fluxo",node:"n\xF3",knowledge:"fonte de conhecimento"},orphan:"ningu\xE9m usa",disabled:"desligado",dimension:"Dimens\xE3o",fact:"Fato",key:"Chave",agent:"Quem",name:"Nome",role:"Papel",scope:"Escopo",share:"Quantos",have:"Quem tem",lack:"Quem falta",decision:"Decis\xE3o",why:"Por qu\xEA",missing:"Falta",accepted:"Padr\xE3o aceito",rule:"Regra",says:"Diz",notMet:"Quem n\xE3o cumpre",value:"Valor",source:"Fonte",inYaml:"No YAML",file:"Arquivo",line:"Linha",facts:"Fatos",alone:"S\xF3 ele tem",children:"Filhos",kind:"Kind",types:"Tipos",id:"Id",label:"R\xF3tulo",body:"Texto",variant:"Varia\xE7\xE3o",official:"Oficial",type:"tipo",yes:"sim",no:"n\xE3o",accept:"aceito",reject:"rejeitado",platform:"plataforma",specialist:"especialista",orchestrator:"orquestrador",staff:"Quadro de pessoal",pdi:"PDI",situation_:"Situa\xE7\xE3o",manager:"Gestor",teamCol:"Equipe",ownerCol:"Respons\xE1vel",hired:"Admiss\xE3o",publishedCol:"Publica\xE7\xE3o",items:"Itens de PDI",item:"Item",group:"Grupo",situation:{hiring:"em admiss\xE3o",noOwner:"sem respons\xE1vel",neverPublished:"nunca publicado",noEval:"sem avalia\xE7\xE3o",pdi:"em PDI",ok:"em dia"},pdiGroup:{contradictions:"contradi\xE7\xE3o",contract:"contrato",off:"fora do padr\xE3o",rules:"regra",text:"texto",telemetry:"telemetria",cleanup:"limpeza"},title:"Elenco comparado",look:"Para olhar",nothing:"Nada para olhar",privacy:"Este arquivo tem dados do cliente: deixe-o no ambiente dele.",count:{agents:"No elenco",orchestrators:"Orquestradores",specialists:"Especialistas",patterns:"Padr\xF5es",off:"Fora do padr\xE3o",gaps:"Regras n\xE3o cumpridas",conflicts:"Conflitos",solos:"S\xF3 um tem",unused:"Sem uso ou desligado"},why_:{yaml:"YAML que n\xE3o se l\xEA",empty:"vazio",kind:"um kind que o Copilot Studio n\xE3o tem",file:"n\xE3o \xE9 arquivo do Copilot Studio",json:"JSON que n\xE3o se l\xEA",flow:"um fluxo num formato que a an\xE1lise n\xE3o conhece",telemetry:"um evento de telemetria com o nome em f\xF3rmula"}}};var Fe=[{key:"contradictions",en:"Contradictions",pt:"Contradi\xE7\xF5es",keys:["conflict","contradiction"]},{key:"contract",en:"Contract and telemetry",pt:"Contrato e telemetria",keys:["spelling","contract","flow","telemetry"]},{key:"off",en:"Off pattern",pt:"Fora do padr\xE3o",keys:["off","values","twice","type"]},{key:"rules",en:"Rules",pt:"Regras",keys:["gap"]},{key:"solo",en:"Only one has it",pt:"S\xF3 um tem",keys:["solo"],folded:!0},{key:"unused",en:"Unused",pt:"Sem uso",keys:["unused"],folded:!0},{key:"unknown",en:"Not understood",pt:"N\xE3o entendeu",keys:["unknown","unmatched"]}],Wt=Fe.flatMap(e=>e.keys);function ne(e){return Fe.map(n=>({key:n.key,en:n.en,pt:n.pt,folded:!!n.folded,looks:e.flatMap((a,r)=>n.keys.includes(a.key)?[{look:a,at:r}]:[])})).filter(n=>n.looks.length)}function oe(e){let n=t=>e.offPattern.some(s=>s.key===t.key||s.partOf===t.key),a=t=>t.share===1&&!t.decision&&!n(t),r=e.patterns.filter(t=>!t.partOf);return{look:r.filter(t=>!a(t)),everyone:r.filter(a)}}var Ie=new TextEncoder,xe=e=>e.replace(/[&<>"]/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[n]).replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g,""),Q=e=>e<26?String.fromCharCode(65+e):Q(Math.floor(e/26)-1)+String.fromCharCode(65+e%26),Ze=e=>e.replace(/[:\\/?*[\]]/g," ").slice(0,31)||"Sheet";function et(e){let n=[{}],a=d=>JSON.stringify([d.bold??!1,d.fill??"",d.color??"",d.center??!1,d.wrap??!1]),r=new Map([[a({}),0]]);for(let d of e)for(let p of d.rows)for(let k of p){if(typeof k!="object")continue;let{v:j,...P}=k,W=a(P);r.has(W)||(r.set(W,n.length),n.push(P))}let t=new Map([["|",0]]),s=new Map([["",0]]),l=d=>{let p=`${d.bold?"b":""}|${d.color??""}`;return t.has(p)||t.set(p,t.size),t.get(p)},c=d=>d.fill?(s.has(d.fill)||s.set(d.fill,s.size+1),s.get(d.fill)):0,m=n.map(d=>{let p=d.center||d.wrap?`<alignment${d.center?' horizontal="center"':""}${d.wrap?' wrapText="1"':""} vertical="top"/>`:'<alignment vertical="top"/>';return`<xf numFmtId="0" fontId="${l(d)}" fillId="${c(d)}" borderId="${d.fill||d.bold?1:0}" xfId="0" applyFont="1" applyFill="1" applyBorder="1" applyAlignment="1">${p}</xf>`}),h=[...t.keys()].map(d=>{let[p,k]=d.split("|");return`<font>${p?"<b/>":""}<sz val="11"/>${k?`<color rgb="FF${k}"/>`:""}<name val="Calibri"/><family val="2"/></font>`}),f=['<fill><patternFill patternType="none"/></fill>','<fill><patternFill patternType="gray125"/></fill>',...[...s.keys()].filter(Boolean).map(d=>`<fill><patternFill patternType="solid"><fgColor rgb="FF${d}"/><bgColor indexed="64"/></patternFill></fill>`)];return{xml:`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
138
138
  <styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
139
139
  <fonts count="${h.length}">${h.join("")}</fonts>
140
140
  <fills count="${f.length}">${f.join("")}</fills>
@@ -142,43 +142,43 @@ a.cl-get { color: var(--ink); text-decoration: none; font-weight: 600; }
142
142
  <cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>
143
143
  <cellXfs count="${m.length}">${m.join("")}</cellXfs>
144
144
  <cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>
145
- </styleSheet>`,styleOf:d=>typeof d=="object"?r.get(a((({v:p,...k})=>k)(d)))??0:0}}function Je(e,n){let a=Math.max(e.columns.length,...e.rows.map(m=>m.length),1),r=e.rows.map((m,h)=>{let f=m.map((b,d)=>{let p=`${Q(d)}${h+1}`,k=typeof b=="object"?b.v:b,j=n(b),P=j?` s="${j}"`:"";return k===""||k===void 0||k===null?j?`<c r="${p}"${P}/>`:"":typeof k=="number"?`<c r="${p}"${P}><v>${k}</v></c>`:`<c r="${p}"${P} t="inlineStr"><is><t xml:space="preserve">${be(String(k))}</t></is></c>`}).join("");return`<row r="${h+1}">${f}</row>`}),t=`${Q(a-1)}${Math.max(1,e.rows.length)}`,s=e.header?'<pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/><selection pane="bottomLeft" activeCell="A2" sqref="A2"/>':"",l=e.columns.length?`<cols>${e.columns.map((m,h)=>`<col min="${h+1}" max="${h+1}" width="${m.width}" customWidth="1"/>`).join("")}</cols>`:"",c=e.header&&e.rows.length>1?`<autoFilter ref="A1:${Q(Math.max(0,e.columns.length-1))}${e.rows.length}"/>`:"";return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
145
+ </styleSheet>`,styleOf:d=>typeof d=="object"?r.get(a((({v:p,...k})=>k)(d)))??0:0}}function tt(e,n){let a=Math.max(e.columns.length,...e.rows.map(m=>m.length),1),r=e.rows.map((m,h)=>{let f=m.map((b,d)=>{let p=`${Q(d)}${h+1}`,k=typeof b=="object"?b.v:b,j=n(b),P=j?` s="${j}"`:"";return k===""||k===void 0||k===null?j?`<c r="${p}"${P}/>`:"":typeof k=="number"?`<c r="${p}"${P}><v>${k}</v></c>`:`<c r="${p}"${P} t="inlineStr"><is><t xml:space="preserve">${xe(String(k))}</t></is></c>`}).join("");return`<row r="${h+1}">${f}</row>`}),t=`${Q(a-1)}${Math.max(1,e.rows.length)}`,s=e.header?'<pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/><selection pane="bottomLeft" activeCell="A2" sqref="A2"/>':"",l=e.columns.length?`<cols>${e.columns.map((m,h)=>`<col min="${h+1}" max="${h+1}" width="${m.width}" customWidth="1"/>`).join("")}</cols>`:"",c=e.header&&e.rows.length>1?`<autoFilter ref="A1:${Q(Math.max(0,e.columns.length-1))}${e.rows.length}"/>`:"";return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
146
146
  <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
147
147
  <dimension ref="A1:${t}"/><sheetViews><sheetView workbookViewId="0">${s}</sheetView></sheetViews><sheetFormatPr defaultRowHeight="15"/>${l}<sheetData>${r.join("")}</sheetData>${c}
148
- </worksheet>`}function Ie(e){let{xml:n,styleOf:a}=Xe(e),r=e.map(l=>Qe(l.name)),t=e.map((l,c)=>l.header&&l.rows.length>1?`<definedName name="_xlnm._FilterDatabase" localSheetId="${c}" hidden="1">'${be(r[c]).replace(/'/g,"''")}'!$A$1:$${Q(Math.max(0,l.columns.length-1))}$${l.rows.length}</definedName>`:"").join(""),s=[["[Content_Types].xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
148
+ </worksheet>`}function Ee(e){let{xml:n,styleOf:a}=et(e),r=e.map(l=>Ze(l.name)),t=e.map((l,c)=>l.header&&l.rows.length>1?`<definedName name="_xlnm._FilterDatabase" localSheetId="${c}" hidden="1">'${xe(r[c]).replace(/'/g,"''")}'!$A$1:$${Q(Math.max(0,l.columns.length-1))}$${l.rows.length}</definedName>`:"").join(""),s=[["[Content_Types].xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
149
149
  <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>${e.map((l,c)=>`<Override PartName="/xl/worksheets/sheet${c+1}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>`).join("")}</Types>`],["_rels/.rels",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
150
150
  <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>`],["xl/workbook.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
151
- <workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><bookViews><workbookView/></bookViews><sheets>${r.map((l,c)=>`<sheet name="${be(l)}" sheetId="${c+1}" r:id="rId${c+1}"/>`).join("")}</sheets>${t?`<definedNames>${t}</definedNames>`:""}</workbook>`],["xl/_rels/workbook.xml.rels",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
152
- <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">${e.map((l,c)=>`<Relationship Id="rId${c+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet${c+1}.xml"/>`).join("")}<Relationship Id="rId${e.length+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>`],["xl/styles.xml",n],...e.map((l,c)=>[`xl/worksheets/sheet${c+1}.xml`,Je(l,a)])];return tt(s.map(([l,c])=>[l,Ne.encode(c)]))}var Ze=(()=>{let e=new Uint32Array(256);for(let n=0;n<256;n++){let a=n;for(let r=0;r<8;r++)a=a&1?3988292384^a>>>1:a>>>1;e[n]=a>>>0}return e})();function et(e){let n=4294967295;for(let a=0;a<e.length;a++)n=Ze[(n^e[a])&255]^n>>>8;return(n^4294967295)>>>0}function tt(e){let n=[],a=[],r=0;for(let[h,f]of e){let b=Ne.encode(h),d=et(f),p=new DataView(new ArrayBuffer(30));p.setUint32(0,67324752,!0),p.setUint16(4,20,!0),p.setUint16(6,2048,!0),p.setUint16(8,0,!0),p.setUint32(14,d,!0),p.setUint32(18,f.length,!0),p.setUint32(22,f.length,!0),p.setUint16(26,b.length,!0),n.push(new Uint8Array(p.buffer),b,f);let k=new DataView(new ArrayBuffer(46));k.setUint32(0,33639248,!0),k.setUint16(4,20,!0),k.setUint16(6,20,!0),k.setUint16(8,2048,!0),k.setUint32(16,d,!0),k.setUint32(20,f.length,!0),k.setUint32(24,f.length,!0),k.setUint16(28,b.length,!0),k.setUint32(42,r,!0),a.push(new Uint8Array(k.buffer),b),r+=30+b.length+f.length}let t=a.reduce((h,f)=>h+f.length,0),s=new DataView(new ArrayBuffer(22));s.setUint32(0,101010256,!0),s.setUint16(8,e.length,!0),s.setUint16(10,e.length,!0),s.setUint32(12,t,!0),s.setUint32(16,r,!0);let l=[...n,...a,new Uint8Array(s.buffer)],c=new Uint8Array(l.reduce((h,f)=>h+f.length,0)),m=0;for(let h of l)c.set(h,m),m+=h.length;return c}var Le=["contradictions","contract","off","rules","text","telemetry","cleanup"],nt=e=>e.key==="spelling"||e.key==="telemetry"||!!e.fact?.startsWith("telemetry:")||e.fact==="node:LogCustomTelemetryEvent";function ot(e){if(e.key==="conflict"||e.key==="contradiction")return"contradictions";if(nt(e))return"telemetry";if(e.key==="contract"||e.key==="flow"||e.key==="off"&&e.fact?.startsWith("called-with:"))return"contract";if(e.key==="off")return"off";if(e.key==="gap")return"rules";if(e.key==="twice")return"text";if(e.key==="unused")return"cleanup"}var se=e=>/«([^»]*)»/.exec(e)?.[1]??"";function st(e,n,a){let r=s=>R(e.fact??"",s,a.names),t=e.fact??"";if(t==="trigger:OnEscalate")return{en:"Learn to hand over to a person",pt:"Aprender a encaminhar para uma pessoa"};if(e.key==="contradiction")return{en:`Remove \xAB${r("en")}\xBB`,pt:`Tirar \xAB${r("pt")}\xBB`};if(e.key==="contract"&&t.startsWith("calls:")){let s=se(e.en);return{en:`Bring \xAB${s}\xBB into the folder, or remove the call`,pt:`Trazer \xAB${s}\xBB para a pasta, ou tirar a chamada`}}if(t==="routing:described")return{en:"Write the routing description: what it solves",pt:"Escrever a descri\xE7\xE3o de roteamento: o que ele resolve"};if(e.key==="flow"){let s=se(e.en);return{en:`Make the flow \xAB${s}\xBB return its result`,pt:`Fazer o fluxo \xAB${s}\xBB devolver o resultado`}}if(e.key==="spelling")return{en:`Name the event like the others: \xAB${L(t.slice(16),"en")}\xBB`,pt:`Chamar o evento como os outros: \xAB${L(t.slice(16),"pt")}\xBB`};if(e.key==="telemetry"&&!t)return{en:"Connect the telemetry to Application Insights",pt:"Ligar a telemetria ao Application Insights"};if(e.key==="telemetry"){let s=se(e.en);return{en:`Check that the event \xAB${s}\xBB fires`,pt:`Conferir se o evento \xAB${s}\xBB dispara`}}if(t.startsWith("telemetry:field:")){let[s,l]=t.slice(16).split("/");return{en:`Log \xAB${l}\xBB in the event \xAB${L(s,"en")}\xBB`,pt:`Registrar \xAB${l}\xBB no evento \xAB${L(s,"pt")}\xBB`}}if(t==="node:LogCustomTelemetryEvent")return{en:"Log telemetry",pt:"Registrar telemetria"};if(t.startsWith("text:block:")&&a.offPattern.some(s=>s.agent===n&&s.key===t&&s.variant))return{en:`Align the official block \xAB${r("en")}\xBB`,pt:`Alinhar o bloco oficial \xAB${r("pt")}\xBB`};if(t.startsWith("text:block:"))return{en:`Use the official block \xAB${r("en")}\xBB`,pt:`Usar o bloco oficial \xAB${r("pt")}\xBB`};if(t==="declared:kpi")return{en:"Declare a goal (KPI)",pt:"Declarar uma meta (KPI)"};if(e.key==="twice")return{en:`Settle on one \xAB${r("en")}\xBB`,pt:`Escolher um s\xF3 \xAB${r("pt")}\xBB`};if(e.key==="unused"){let s=a.unused.find(f=>f.agent===n&&f.key===t);if(s?.how==="disabled"&&t.startsWith("disabled:node:")){let f=(s.sources[0]?.file??"").replace(/(\.topic)?\.mcs\.ya?ml$/,"");return{en:`Remove the switched-off node in \xAB${f}\xBB`,pt:`Remover o n\xF3 desligado em \xAB${f}\xBB`}}let l=t.split(":")[1],c=s?.name??se(e.en);if(l==="variable")return{en:`Remove the variable \xAB${c}\xBB`,pt:`Remover a vari\xE1vel \xAB${c}\xBB`};let h={flow:{en:"the flow",pt:"o fluxo"},topic:{en:"the topic",pt:"o t\xF3pico"},action:{en:"the tool",pt:"a ferramenta"},knowledge:{en:"the knowledge source",pt:"a fonte de conhecimento"}}[l]??{en:"",pt:""};return{en:`Remove or switch on ${h.en} \xAB${c}\xBB`.replace(" "," "),pt:`Remover ou ligar ${h.pt} \xAB${c}\xBB`.replace(" "," ")}}return e.key==="conflict"?{en:`Check \xAB${r("en")}\xBB against what was declared`,pt:`Conferir \xAB${r("pt")}\xBB com o declarado`}:{en:`Have \xAB${r("en")}\xBB`,pt:`Ter \xAB${r("pt")}\xBB`}}function ae(e,n){let a=[];for(let t of e){let s=ot(t);if(s)for(let l of t.agents){let c=a.filter(m=>m.agent===l);if(!(t.fact&&c.some(m=>m.keys.includes(t.fact)))){if(t.fact?.startsWith("called-with:")){let m=c.find(d=>d.keys.some(p=>p.startsWith("called-with:"))),h=m??{agent:l,group:s,keys:[],en:"",pt:"",why:{en:"",pt:""}};m||a.push(h),h.keys.push(t.fact);let f=h.keys.map(d=>d==="called-with:history"?{en:"the conversation history",pt:"o hist\xF3rico da conversa"}:{en:`\xAB${d.slice(18)}\xBB`,pt:`\xAB${d.slice(18)}\xBB`}),b=d=>f.map(p=>p[d]).join(d==="pt"?" e ":" and ");h.en=`Receive ${b("en")} from the orchestrator`,h.pt=`Receber do gestor ${b("pt")}`,h.why={en:`${h.why.en} ${t.en}`.trim(),pt:`${h.why.pt} ${t.pt}`.trim()};continue}a.push({agent:l,group:s,keys:t.fact?[t.fact]:[],...st(t,l,n),why:{en:t.en,pt:t.pt}})}}}let r=[...new Set(n.agents.map(t=>t.id))];return a.sort((t,s)=>r.indexOf(t.agent)-r.indexOf(s.agent)||Le.indexOf(t.group)-Le.indexOf(s.group))}function at(e){let n=new Map,a=/^(connector|operation|mcp|flow-uses):/;for(let t of Object.keys(e.typeNames)){let s=e.agents.filter(c=>c.role==="specialist"&&(e.types[c.id]??[]).includes(t));if(s.length<2)continue;let l=[...new Set(s.flatMap(c=>Object.keys(c.facts).filter(m=>a.test(m))))].sort();for(let c of l){let m=s.filter(b=>c in b.facts);if(m.length!==1)continue;let h=`${m[0].id} ${c}`,f=n.get(h)??{agent:m[0].id,key:c,types:[]};f.types.push(t),n.set(h,f)}}return[...n.values()].filter(t=>!(t.key.startsWith("operation:")&&n.has(`${t.agent} connector:${t.key.slice(10,t.key.indexOf("/"))}`))).map(t=>{let s=t.types.map(m=>e.typeNames[m]??m),l=m=>R(t.key,m,e.names),c=m=>s.map(h=>`\xAB${h}\xBB`).join(m==="pt"?" e ":" and ");return{agent:t.agent,types:t.types,typeNames:s,key:t.key,en:`\xAB${l("en")}\xBB \u2014 only it has this in ${s.length>1?"the types":"the type"} ${c("en")}: does the post need it?`,pt:`\xAB${l("pt")}\xBB \u2014 s\xF3 ele tem ${s.length>1?"nos tipos":"no tipo"} ${c("pt")}: o cargo precisa?`}})}var rt={"trigger:OnEscalate":{en:"Hands over to a person (escalation)",pt:"Sabe encaminhar para uma pessoa (escalonamento)"},"called-with:history":{en:"Gets the conversation history from the orchestrator",pt:"Recebe do gestor o hist\xF3rico da conversa"},"node:LogCustomTelemetryEvent":{en:"Logs its own errors (telemetry)",pt:"Registra os pr\xF3prios erros (telemetria)"},"declared:kpi":{en:"Has a goal (KPI)",pt:"Tem uma meta (KPI)"},"declared:owner":{en:"Has an owner",pt:"Tem um respons\xE1vel"},"declared:team":{en:"Has a team",pt:"Tem uma equipe"}},Ee=(e,n,a={})=>rt[e]?.[n]??(n==="pt"?`Tem \xAB${R(e,n,a)}\xBB`:`Has \xAB${R(e,n,a)}\xBB`);var it=["owner","environment","created-on","last-published"],lt=e=>/^\s*([^\n]*?[.!?])(\s|$)/.exec(e)?.[1].trim()??e.split(`
153
- `)[0].trim(),ct=e=>{let n=e.split(`
154
- `),a=n.findIndex(t=>/^\s*([-*•]|\d+[.)])\s+/.test(t));if(a<0)return[];let r=[];for(let t of n.slice(a)){let s=/^\s*(?:[-*•]|\d+[.)])\s+(.*)$/.exec(t);if(!s)break;r.push(s[1].trim())}return r.slice(0,5)};function Ae(e,n,a,r,t,s,l){let c=i=>e.agents.find(w=>w.id===i)?.displayName??i,m=(i,w)=>{let O=r.declared.find(T=>T.agent===i&&T.key===w);return O&&{value:O.value,source:O.source}},h=r.declared.some(i=>it.includes(i.key)),f=r.declared.some(i=>i.key==="team"||i.key==="kpi"),b=at(e),d=[...ae(n,e),...b.flatMap(i=>{let w=r.decisions.find(T=>T.key===i.key&&T.status==="rejected"&&i.types.some(A=>T.scope===`type:${A}`)),O=w?e.typeNames[w.scope.slice(5)]??w.scope.slice(5):"";return w?[{agent:i.agent,group:"cleanup",keys:[i.key],en:`Remove the access \xAB${R(i.key,"en",e.names)}\xBB`,pt:`Tirar o acesso \xAB${R(i.key,"pt",e.names)}\xBB`,why:{en:`The team decided the post \xAB${O}\xBB does not need it.`,pt:`O time decidiu que o cargo \xAB${O}\xBB n\xE3o precisa.`}}]:[]})],p=e.contract.missing.map(i=>({id:i.calls,name:i.name??i.calls,caller:i.caller})),k=e.agents.map(i=>m(i.id,"environment")?.value).filter(i=>!!i),j=[...new Set(k)].sort((i,w)=>k.filter(O=>O===w).length-k.filter(O=>O===i).length)[0],P=i=>{let w=[],O=m(i,"environment")?.value;return O&&j&&O!==j&&w.push("hiring"),h&&!m(i,"owner")&&w.push("noOwner"),h&&m(i,"created-on")&&!m(i,"last-published")&&w.push("neverPublished"),l&&!l.some(T=>T.agent===i)&&w.push("noEval"),w.push(d.some(T=>T.agent===i&&T.group!=="cleanup")?"pdi":"ok"),w},W=i=>({id:i,name:c(i),situation:P(i)}),D=e.agents.map(i=>i.id),M=i=>i.map(w=>({id:w,name:c(w)})),fe=p.map(i=>({id:i.id,name:i.name})),ue=[{key:"cast",people:M(D)},{key:"hiring",people:[...fe,...M(D.filter(i=>P(i).includes("hiring")))]},...h?[{key:"noOwner",people:M(D.filter(i=>P(i).includes("noOwner")))},{key:"neverPublished",people:M(D.filter(i=>P(i).includes("neverPublished")))}]:[],...l?[{key:"noEval",people:M(D.filter(i=>P(i).includes("noEval")))}]:[],{key:"pdi",people:M(D.filter(i=>P(i).includes("pdi")))},{key:"ok",people:M(D.filter(i=>P(i).includes("ok")))}],X=e.agents.filter(i=>i.role==="orchestrator").map(i=>W(i.id)),H=e.agents.filter(i=>i.role==="specialist"),J=[...new Set(H.flatMap(i=>e.types[i.id]??[]))],he=[...J.map(i=>({id:i,name:e.typeNames[i]??i,people:H.filter(w=>(e.types[w.id]??[]).includes(i)).map(w=>W(w.id))})),...H.some(i=>!(e.types[i.id]??[]).length)?[{id:"",name:"",people:H.filter(i=>!(e.types[i.id]??[]).length).map(i=>W(i.id))}]:[]],Y=(i,w)=>({key:i,en:Ee(i,"en",e.names),pt:Ee(i,"pt",e.names),proposal:w}),V=(i,w,O)=>{let T=e.patterns.filter(x=>!x.partOf&&(x.scope===i||i!=="platform"&&x.scope==="platform")),A=T.filter(x=>x.decision?.status==="accepted"),o=new Set(e.offPattern.map(x=>x.key)),y=A.length?A.map(x=>Y(x.key,!1)):T.filter(x=>o.has(x.key)).map(x=>Y(x.key,!0)),S=t.filter(x=>x.has&&(!x.role||x.role===O)&&!y.some(q=>q.key===x.has)).map(x=>Y(x.has,!1));return{scope:i,name:w,requirements:[...y,...S]}},ge=[V("specialist",{en:"Specialist",pt:"Especialista"},"specialist"),...J.map(i=>V(`type:${i}`,{en:`Specialist \xB7 ${e.typeNames[i]??i}`,pt:`Especialista \xB7 ${e.typeNames[i]??i}`},"specialist")),...X.length?[V("orchestrator",{en:"Orchestrator",pt:"Orquestrador"},"orchestrator")]:[]],ye=e.agents.map(i=>{let O=a.find($=>$.id===i.id)?.texts.find($=>$.source==="instructions")?.text??"",T=Object.keys(i.facts),A=$=>({en:R($,"en",e.names),pt:R($,"pt",e.names)}),o=T.filter($=>/^(operation|mcp|flow-uses|knowledge):/.test($)&&!$.startsWith("knowledge:count")).map(A),y=T.filter($=>$.startsWith("text:")&&!$.endsWith("~variant")).map(A),S=e.contract.routes.find($=>$.agent===i.id)?.caller,x=e.telemetry.events.filter($=>$.agent===i.id),q=s&&{days:s.days,starts:s.rows.filter($=>$.agent===i.id&&$.event==="TopicStart").reduce(($,$e)=>$+$e.count,0),errors:x.reduce(($,$e)=>$+($e.fired??0),0),notFired:e.telemetry.notFired.filter($=>$.agent===i.id).map($=>$.name),silent:e.telemetry.silent.includes(i.id)},He=[...new Set(["YAML",...s?[s.file]:[],...(l??[]).filter($=>$.agent===i.id).map($=>$.file),...r.declared.filter($=>$.agent===i.id).map($=>$.source.split(" \u203A ")[0])])],Te=d.filter($=>$.agent===i.id);return{id:i.id,name:c(i.id),role:i.role==="orchestrator"?"orchestrator":"specialist",types:(e.types[i.id]??[]).map($=>e.typeNames[$]??$),...O?{title:lt(O)}:{},...S?{manager:c(S)}:{},...m(i.id,"team")?{team:m(i.id,"team")}:{},...m(i.id,"owner")?{owner:m(i.id,"owner")}:{},...m(i.id,"created-on")?{created:m(i.id,"created-on")}:{},...m(i.id,"last-published")?{published:m(i.id,"last-published")}:{},...i.schemaName?{schemaName:i.schemaName}:{},...m(i.id,"environment")?{environment:m(i.id,"environment")}:{},summary:ct(O),tools:o,conduct:y,...m(i.id,"kpi")?{goal:m(i.id,"kpi")}:{},...q?{performance:q}:{},...l?{certifications:l.filter($=>$.agent===i.id)}:{},access:b.filter($=>$.agent===i.id),pdi:Te,sources:He,seal:Te.some($=>$.group!=="cleanup")?"pdi":"ok"}}),Z=[...h?[]:["inventory"],...f?[]:["team"],...s?[]:["telemetry"]];return{...e.name?{name:e.name}:{},staff:ue,missing:Z,org:{orchestrators:X,types:he,ghosts:p},posts:ge,resumes:ye}}var Me=e=>Ie(e),dt={bold:!0,fill:"E8EEF7"},pt={v:"\u25CF",fill:"DDF3E6",center:!0},mt={v:"\xD7",fill:"FFD5CC",center:!0,bold:!0},ft={v:"\u25D0",fill:"FFF3C4",center:!0},ut={v:"\u2248",fill:"FFF6DC",center:!0,bold:!0},De=Object.keys(G);function qe(e,n,a,r="en"){let t=te[r],s=(o,y,S)=>({key:o,name:t[o],header:!0,columns:y.map(([x,q])=>({title:x,width:q})),rows:[y.map(([x])=>({v:x,...dt})),...S]}),l=o=>t[e.roles[o]],c=o=>o.startsWith("type:")?`${t.type}:${e.typeNames[o.slice(5)]??o.slice(5)}`:t[o],m=o=>(e.types[o]??[]).map(y=>e.typeNames[y]??y).join(" \xB7 "),h=o=>R(o,r,e.names),f=[...e.agents].sort((o,y)=>o.role===y.role?o.id.localeCompare(y.id):o.role==="orchestrator"?-1:1),b=[...new Set([...f.flatMap(o=>Object.keys(o.facts)),...e.patterns.map(o=>o.key)])].filter(o=>!o.endsWith("~variant")).sort((o,y)=>De.indexOf(_(o))-De.indexOf(_(y))||o.localeCompare(y)),d=new Set(e.offPattern.map(o=>`${o.agent} ${o.key}`)),p=o=>e.agents.filter(y=>y.role===o).length,k={key:"summary",name:t.summary,header:!1,columns:[{title:"",width:28},{title:"",width:100}],rows:[[{v:e.name??t.title,bold:!0},""],[{v:t.privacy,color:"B42318"},""],[t.count.agents,e.agents.length],[t.count.orchestrators,p("orchestrator")],[t.count.specialists,p("specialist")],[t.count.patterns,e.patterns.length],[t.count.off,new Set(e.offPattern.map(o=>o.agent)).size],[t.count.gaps,e.gaps.length],[t.count.conflicts,e.conflicts.length],[t.count.solos,n.filter(o=>o.key==="solo").length],[t.count.unused,e.unused.length],["",""],[{v:n.length?t.look:t.nothing,bold:!0},""],...ne(n).flatMap(o=>[[{v:`${o[r]} \xB7 ${o.looks.length}`,bold:!0},""],...o.looks.map(({look:y})=>["",{v:y[r],wrap:!0}])])]},j=s("matrix",[[t.dimension,18],[t.fact,40],[t.key,34],...f.map(o=>[o.id,14])],b.map(o=>[G[_(o)][r],h(o),o,...f.map(y=>o in y.facts?o.startsWith("declared:")?ft:pt:`${o}~variant`in y.facts?ut:d.has(`${y.id} ${o}`)?mt:"")])),{look:P,everyone:W}=oe(e),D=s("patterns",[[t.key,34],[t.fact,40],[t.scope,14],[t.role,14],[t.share,10],[t.have,50],[t.lack,40],[t.decision,12],[t.why,50]],[...P,...W].map(o=>{let y=e.offPattern.filter(S=>S.key===o.key).map(S=>S.agent);return[o.key,h(o.key),c(o.scope),t[o.role],`${Math.round(o.share*100)}%`,o.agents.join(", "),y.join(", "),o.decision?t[o.decision.status==="accepted"?"accept":"reject"]:"",o.decision?.why??""]})),M=s("off",[[t.agent,24],[t.role,14],[t.missing,44],[t.key,34],[t.scope,14],[t.accepted,14]],e.offPattern.map(o=>[o.agent,l(o.agent),h(o.key),o.key,c(o.scope),e.patterns.find(y=>y.key===o.key)?.decision?.status==="accepted"?t.yes:""])),fe=s("gaps",[[t.rule,16],[t.says,50],[t.role,14],[t.notMet,60]],e.gaps.map(o=>[o.rule.id,o.rule.says,o.rule.role?t[o.rule.role]:"",o.agents.join(", ")])),ue=s("conflicts",[[t.agent,24],[t.fact,40],[t.key,34],[t.declared,20],[t.source,40],[t.inYaml,12]],e.conflicts.map(o=>[o.agent,h(o.key),o.key,o.declared,o.source,o.observed?t.yes:t.no])),X=s("agents",[[t.agent,24],[t.name,32],[t.role,14],[t.types,24],[t.facts,8],[t.off,44],[t.alone,44],[t.children,24],[t.unknown,12]],f.map(o=>[o.id,o.displayName??"",t[o.role],m(o.id),Object.keys(o.facts).length,e.offPattern.filter(y=>y.agent===o.id).map(y=>h(y.key)).join("; "),e.solos.filter(y=>y.agents[0]===o.id).map(y=>h(y.key)).join("; "),o.children.map(y=>y.name).join(", "),e.unknown.filter(y=>y.agent===o.id).length||""])),H=s("evidence",[[t.agent,30],[t.fact,40],[t.key,34],[t.file,50],[t.line,8]],f.flatMap(o=>[{who:o.id,facts:o.facts},...o.children.map(y=>({who:`${o.id} \u203A ${y.name}`,facts:y.facts}))]).flatMap(({who:o,facts:y})=>Object.entries(y).sort(([S],[x])=>S.localeCompare(x)).flatMap(([S,x])=>x.map(q=>[o,h(S),S,q.file,q.line??""])))),J=s("declared",[[t.agent,24],[t.key,34],[t.value,40],[t.source,40]],a.declared.map(o=>[o.agent,o.key,o.value,o.source])),he=s("text",[[t.id,28],[t.label,36],[t.body,70],[t.have,50],[t.variant,40],[t.official,10]],e.blocks.map(o=>[o.id,o.official??o.label,{v:o.text,wrap:!0},Object.keys(o.holders).sort().join(", "),Object.entries(o.variants).sort(([y],[S])=>y.localeCompare(S)).map(([y,S])=>`${y} (${Math.round(S.similarity*100)}%)`).join(", "),o.official?t.yes:""])),Y=s("routing",[[t.caller,24],[t.called,30],[t.history,10],[t.inputs,30],[t.routingText,70],[t.chars,10],[t.file,44]],e.contract.routes.map(o=>[o.caller,o.agent??`${o.name??o.calls} (${t.notInFolder})`,o.history?t.yes:t.no,o.inputs.join(", "),{v:o.description,wrap:!0},o.description.length,`${o.file}${o.line?`:${o.line}`:""}`])),V=e.telemetry.days,ge=s("telemetry",[[t.agent,24],[t.written,30],[t.form,28],[t.fields,50],[t.file,44],...V?[[t.fired(V),16]]:[]],e.telemetry.events.map(o=>[o.agent,o.name,L(o.as,r),o.fields?o.fields.join(", "):t.notRead,`${o.file}${o.line?`:${o.line}`:""}`,...V?[o.fired===void 0||e.telemetry.silent.includes(o.agent)?"\u2014":o.fired===0?{v:0,color:"B42318",bold:!0}:o.fired]:[]])),ye=s("unused",[[t.agent,24],[t.what,16],[t.name,30],[t.how,14],[t.file,50]],e.unused.flatMap(o=>o.sources.map(y=>[o.agent,t.thing[o.what]??o.what,e.names[o.name]??o.name,t[o.how],`${y.file}${y.line?`:${y.line}`:""}`]))),Z=Ae(e,n,[],a,[]),i=o=>Z.staff.filter(y=>y.key!=="cast"&&y.people.some(S=>S.id===o)).map(y=>t.situation[y.key]).join(", "),w=ae(n,e),O=s("staff",[[t.agent,24],[t.name,32],[t.situation_,34],[t.manager,24],[t.teamCol,22],[t.ownerCol,30],[t.hired,14],[t.publishedCol,14],[t.items,10]],Z.resumes.map(o=>[o.id,o.name,i(o.id),o.manager??"",o.team?.value??"",o.owner?.value??"",o.created?.value??"",o.published?.value??"",w.filter(y=>y.agent===o.id).length||""])),T=s("pdi",[[t.agent,24],[t.item,60],[t.why,70],[t.key,40],[t.group,18]],w.map(o=>[o.agent,o[r],{v:o.why[r],wrap:!0},o.keys.join(", "),t.pdiGroup[o.group]])),A=[k,j,D,...e.blocks.length?[he]:[],...e.contract.routes.length?[Y]:[],...e.telemetry.events.length?[ge]:[],M,fe,ue,...e.unused.length?[ye]:[],X,O,...w.length?[T]:[],H,J];return e.unknown.length&&A.push(s("unknown",[[t.agent,24],[t.file,50],[t.why,40],[t.kind,24]],e.unknown.map(o=>[o.agent,o.file,t.why_[o.why],o.kind??""]))),A}var ht={en:{map:"Map",patterns:"Patterns",cast:"Cast",microsoft:"Microsoft",unknown:e=>`What the analysis did not understand (${e})`,matrix:"Who has what",candidates:"Patterns to decide",everyone:e=>`Everybody already does it (${e})`,all:"All",role:"Role",focus:"Focus",legend:"\u25CF has it (click for the file) \xB7 \xD7 off a pattern of its role or type \xB7 \u2248 a variation of the block \xB7 \u25D0 declared by people",pattern:"pattern",type:"Type",noType:"no type",alsoIn:"also in",official:"official block",variation:"Variation",alike:"alike",text:"The text",types:"Types",of:(e,n,a)=>`${e} of ${n} ${a}`,who:"Who has it",lacks:"Off it",none:"nobody",decision:"Decision",toDecide:"to decide \u2014 in the workbook or the cast file",alone:"Only one has it: innovation or debt?",orchestratorDoes:"Only the orchestrator does it",sign:"How cast-list knows",follows:"Who follows it",declaredOnly:"only declared",nothingUnknown:"Everything was understood.",facts:"Facts",off:"Off a pattern",solo:"Only it has",children:"Children",close:"Close \u2715",foot:"The facts come from the YAML files; nothing was made up.",summary:(e,n,a,r,t)=>`${e} in the cast \xB7 ${n} patterns \xB7 ${a} off a pattern \xB7 ${r} only one has \xB7 threshold ${t}% of each role`,excel:"\u2B07 Excel",yaml:"\u2B07 cast.yaml",png:"\u2B07 PNG",playbill:"The cast\u2019s HR \u2192",plot:"Stage \u2192",name:"Name",said:"declared",unused:e=>`Unused (${e})`,nothingUnused:"Everything is used, nothing is switched off.",flows:"Flows",returnsNothing:"returns nothing",otherFlow:"another flow",telemetry:"Telemetry",times:(e,n)=>`${e} ${e===1?"time":"times"} in ${n} days`,notFired:"did not fire",noLine:"no line in the telemetry",routing:"Routing",called:"Called",history:"History",inputs:"Inputs",description:"Description",notInFolder:"not in the folder",chars:e=>`${e} characters`},pt:{map:"Mapa",patterns:"Padr\xF5es",cast:"Elenco",microsoft:"Microsoft",unknown:e=>`O que a an\xE1lise n\xE3o entendeu (${e})`,matrix:"Quem tem o qu\xEA",candidates:"Padr\xF5es para decidir",everyone:e=>`Todos j\xE1 fazem (${e})`,all:"Todos",role:"Papel",focus:"Foco",legend:"\u25CF tem (clique para ver o arquivo) \xB7 \xD7 fora de um padr\xE3o do seu papel ou tipo \xB7 \u2248 tem uma varia\xE7\xE3o do bloco \xB7 \u25D0 declarado por pessoas",pattern:"padr\xE3o",type:"Tipo",noType:"sem tipo",alsoIn:"tamb\xE9m em",official:"bloco oficial",variation:"Varia\xE7\xE3o",alike:"parecido",text:"O texto",types:"Tipos",of:(e,n,a)=>`${e} de ${n} ${a}`,who:"Quem tem",lacks:"Fora",none:"ningu\xE9m",decision:"Decis\xE3o",toDecide:"a decidir \u2014 na planilha ou no cast.yaml",alone:"S\xF3 um tem: inova\xE7\xE3o ou d\xEDvida?",orchestratorDoes:"S\xF3 o orquestrador faz",sign:"Como a cast-list sabe",follows:"Quem segue",declaredOnly:"s\xF3 declarado",nothingUnknown:"Tudo foi entendido.",facts:"Fatos",off:"Fora do padr\xE3o",solo:"S\xF3 ele tem",children:"Filhos",close:"Fechar \u2715",foot:"Os fatos v\xEAm dos arquivos YAML; nada foi inventado.",summary:(e,n,a,r,t)=>`${e} no elenco \xB7 ${n} padr\xF5es \xB7 ${a} fora do padr\xE3o \xB7 ${r} s\xF3 um tem \xB7 limite ${t}% de cada papel`,excel:"\u2B07 Excel",yaml:"\u2B07 cast.yaml",png:"\u2B07 PNG",playbill:"RH do elenco \u2192",plot:"Palco \u2192",name:"Nome",said:"declarado",unused:e=>`Sem uso (${e})`,nothingUnused:"Tudo \xE9 usado, nada est\xE1 desligado.",flows:"Fluxos",returnsNothing:"n\xE3o devolve nada",otherFlow:"outro fluxo",telemetry:"Telemetria",times:(e,n)=>`${e} ${e===1?"vez":"vezes"} em ${n} dias`,notFired:"n\xE3o disparou",noLine:"nenhuma linha na telemetria",routing:"Roteamento",called:"Chamado",history:"Hist\xF3rico",inputs:"Entradas",description:"Descri\xE7\xE3o",notInFolder:"n\xE3o est\xE1 na pasta",chars:e=>`${e} caracteres`}},C=JSON.parse(document.getElementById("cast").textContent),{result:v,lang:N,looks:K}=C,u=ht[N],F=te[N],me=qe(v,K,C.cast,N);document.documentElement.lang=N==="pt"?"pt-BR":"en";document.title=v.name??C.id;var g=e=>String(e??"").replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n]),U=e=>g(R(e,N,v.names)),re=[...v.agents].sort((e,n)=>e.role===n.role?e.id.localeCompare(n.id):e.role==="orchestrator"?-1:1),xe=e=>v.patterns.find(n=>n.key===e),Ue=e=>[...new Set(v.offPattern.filter(n=>n.key===e||n.partOf===e).map(n=>n.agent))],We=e=>e.startsWith("type:")?v.typeNames[e.slice(5)]??e.slice(5):F[e],_e=e=>e.startsWith("type:")?"type":e,ce=Object.keys(v.typeNames),gt=e=>e.startsWith("text:block:")?v.blocks.find(n=>`text:block:${n.id}`===e):void 0,Oe=e=>{let n=xe(e);if(!n)return"";let a=n.decision?`<span class="cl-badge ${n.decision.status}">${g(F[n.decision.status==="accepted"?"accept":"reject"])}</span>`:"";return`${n.official?`<span class="cl-badge official">${u.official}</span>`:""}<span class="cl-badge ${_e(n.scope)}">${u.pattern} \xB7 ${g(We(n.scope))}</span>${a}`},E="map",I,z="all",ie,B,de=document.getElementById("app"),Ve=ne(K),le=new Set(Ve.filter(e=>!e.folded).map(e=>e.key));function Ge(){let e=[["map",u.map],["patterns",u.patterns],["cast",u.cast],["microsoft",u.microsoft],["unused",u.unused(v.unused.length)],["unknown",u.unknown(v.unknown.length)]],n=new Set(v.offPattern.map(a=>a.agent)).size;de.innerHTML=`<div class="cl-wrap">
155
- <header><h1 class="cl-title">${g(v.name??C.id)}</h1><p class="cl-sub">${u.summary(v.agents.length,v.patterns.length,n,K.filter(a=>a.key==="solo").length,Math.round(C.threshold*100))}</p><p class="cl-private">${g(F.privacy)}</p></header>
156
- <div class="cl-bar" role="tablist">${e.map(([a,r])=>`<button class="cl-tab" role="tab" aria-selected="${a===E}" data-tab="${a}">${g(r)}</button>`).join("")}
157
- <span class="cl-space"></span>${C.plot?`<a class="cl-get" href="${g(C.plot)}">${g(u.plot)}</a>`:""}${C.playbill?`<a class="cl-get" href="${g(C.playbill)}">${g(u.playbill)}</a>`:""}<button class="cl-get" data-get="xlsx">${u.excel}</button><button class="cl-get" data-get="yaml">${u.yaml}</button>${E==="map"?`<button class="cl-get" data-get="png">${u.png}</button>`:""}</div>
158
- ${E==="map"?yt():E==="patterns"?Se(me.find(a=>a.key==="patterns")):E==="cast"?bt():E==="microsoft"?Rt():E==="unused"?Tt():Ct()}
151
+ <workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><bookViews><workbookView/></bookViews><sheets>${r.map((l,c)=>`<sheet name="${xe(l)}" sheetId="${c+1}" r:id="rId${c+1}"/>`).join("")}</sheets>${t?`<definedNames>${t}</definedNames>`:""}</workbook>`],["xl/_rels/workbook.xml.rels",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
152
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">${e.map((l,c)=>`<Relationship Id="rId${c+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet${c+1}.xml"/>`).join("")}<Relationship Id="rId${e.length+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>`],["xl/styles.xml",n],...e.map((l,c)=>[`xl/worksheets/sheet${c+1}.xml`,tt(l,a)])];return st(s.map(([l,c])=>[l,Ie.encode(c)]))}var nt=(()=>{let e=new Uint32Array(256);for(let n=0;n<256;n++){let a=n;for(let r=0;r<8;r++)a=a&1?3988292384^a>>>1:a>>>1;e[n]=a>>>0}return e})();function ot(e){let n=4294967295;for(let a=0;a<e.length;a++)n=nt[(n^e[a])&255]^n>>>8;return(n^4294967295)>>>0}function st(e){let n=[],a=[],r=0;for(let[h,f]of e){let b=Ie.encode(h),d=ot(f),p=new DataView(new ArrayBuffer(30));p.setUint32(0,67324752,!0),p.setUint16(4,20,!0),p.setUint16(6,2048,!0),p.setUint16(8,0,!0),p.setUint32(14,d,!0),p.setUint32(18,f.length,!0),p.setUint32(22,f.length,!0),p.setUint16(26,b.length,!0),n.push(new Uint8Array(p.buffer),b,f);let k=new DataView(new ArrayBuffer(46));k.setUint32(0,33639248,!0),k.setUint16(4,20,!0),k.setUint16(6,20,!0),k.setUint16(8,2048,!0),k.setUint32(16,d,!0),k.setUint32(20,f.length,!0),k.setUint32(24,f.length,!0),k.setUint16(28,b.length,!0),k.setUint32(42,r,!0),a.push(new Uint8Array(k.buffer),b),r+=30+b.length+f.length}let t=a.reduce((h,f)=>h+f.length,0),s=new DataView(new ArrayBuffer(22));s.setUint32(0,101010256,!0),s.setUint16(8,e.length,!0),s.setUint16(10,e.length,!0),s.setUint32(12,t,!0),s.setUint32(16,r,!0);let l=[...n,...a,new Uint8Array(s.buffer)],c=new Uint8Array(l.reduce((h,f)=>h+f.length,0)),m=0;for(let h of l)c.set(h,m),m+=h.length;return c}var Le=["contradictions","contract","off","rules","text","telemetry","cleanup"],at=e=>e.key==="spelling"||e.key==="telemetry"||!!e.fact?.startsWith("telemetry:")||e.fact==="node:LogCustomTelemetryEvent";function rt(e){if(e.key==="conflict"||e.key==="contradiction")return"contradictions";if(at(e))return"telemetry";if(e.key==="contract"||e.key==="flow"||e.key==="off"&&e.fact?.startsWith("called-with:"))return"contract";if(e.key==="off")return"off";if(e.key==="gap")return"rules";if(e.key==="twice")return"text";if(e.key==="unused")return"cleanup"}var se=e=>/«([^»]*)»/.exec(e)?.[1]??"";function it(e,n,a){let r=s=>T(e.fact??"",s,a.names),t=e.fact??"";if(t==="trigger:OnEscalate")return{en:"Learn to hand over to a person",pt:"Aprender a encaminhar para uma pessoa"};if(e.key==="contradiction")return{en:`Remove \xAB${r("en")}\xBB`,pt:`Tirar \xAB${r("pt")}\xBB`};if(e.key==="contract"&&t.startsWith("calls:")){let s=se(e.en);return{en:`Bring \xAB${s}\xBB into the folder, or remove the call`,pt:`Trazer \xAB${s}\xBB para a pasta, ou tirar a chamada`}}if(t==="routing:described")return{en:"Write the routing description: what it solves",pt:"Escrever a descri\xE7\xE3o de roteamento: o que ele resolve"};if(e.key==="flow"){let s=se(e.en);return{en:`Make the flow \xAB${s}\xBB return its result`,pt:`Fazer o fluxo \xAB${s}\xBB devolver o resultado`}}if(e.key==="spelling")return{en:`Name the event like the others: \xAB${E(t.slice(16),"en")}\xBB`,pt:`Chamar o evento como os outros: \xAB${E(t.slice(16),"pt")}\xBB`};if(e.key==="telemetry"&&!t)return{en:"Connect the telemetry to Application Insights",pt:"Ligar a telemetria ao Application Insights"};if(e.key==="telemetry"){let s=se(e.en);return{en:`Check that the event \xAB${s}\xBB fires`,pt:`Conferir se o evento \xAB${s}\xBB dispara`}}if(t.startsWith("telemetry:field:")){let[s,l]=t.slice(16).split("/");return{en:`Log \xAB${l}\xBB in the event \xAB${E(s,"en")}\xBB`,pt:`Registrar \xAB${l}\xBB no evento \xAB${E(s,"pt")}\xBB`}}if(t==="node:LogCustomTelemetryEvent")return{en:"Log telemetry",pt:"Registrar telemetria"};if(t.startsWith("text:block:")&&a.offPattern.some(s=>s.agent===n&&s.key===t&&s.variant))return{en:`Align the official block \xAB${r("en")}\xBB`,pt:`Alinhar o bloco oficial \xAB${r("pt")}\xBB`};if(t.startsWith("text:block:"))return{en:`Use the official block \xAB${r("en")}\xBB`,pt:`Usar o bloco oficial \xAB${r("pt")}\xBB`};if(t==="declared:kpi")return{en:"Declare a goal (KPI)",pt:"Declarar uma meta (KPI)"};if(e.key==="twice")return{en:`Settle on one \xAB${r("en")}\xBB`,pt:`Escolher um s\xF3 \xAB${r("pt")}\xBB`};if(e.key==="unused"){let s=a.unused.find(f=>f.agent===n&&f.key===t);if(s?.how==="disabled"&&t.startsWith("disabled:node:")){let f=(s.sources[0]?.file??"").replace(/(\.topic)?\.mcs\.ya?ml$/,"");return{en:`Remove the switched-off node in \xAB${f}\xBB`,pt:`Remover o n\xF3 desligado em \xAB${f}\xBB`}}let l=t.split(":")[1],c=s?.name??se(e.en);if(l==="variable")return{en:`Remove the variable \xAB${c}\xBB`,pt:`Remover a vari\xE1vel \xAB${c}\xBB`};let h={flow:{en:"the flow",pt:"o fluxo"},topic:{en:"the topic",pt:"o t\xF3pico"},action:{en:"the tool",pt:"a ferramenta"},knowledge:{en:"the knowledge source",pt:"a fonte de conhecimento"}}[l]??{en:"",pt:""};return{en:`Remove or switch on ${h.en} \xAB${c}\xBB`.replace(" "," "),pt:`Remover ou ligar ${h.pt} \xAB${c}\xBB`.replace(" "," ")}}return e.key==="conflict"?{en:`Check \xAB${r("en")}\xBB against what was declared`,pt:`Conferir \xAB${r("pt")}\xBB com o declarado`}:{en:`Have \xAB${r("en")}\xBB`,pt:`Ter \xAB${r("pt")}\xBB`}}function ae(e,n){let a=[];for(let t of e){let s=rt(t);if(s)for(let l of t.agents){let c=a.filter(m=>m.agent===l);if(!(t.fact&&c.some(m=>m.keys.includes(t.fact)))){if(t.fact?.startsWith("called-with:")){let m=c.find(d=>d.keys.some(p=>p.startsWith("called-with:"))),h=m??{agent:l,group:s,keys:[],en:"",pt:"",why:{en:"",pt:""}};m||a.push(h),h.keys.push(t.fact);let f=h.keys.map(d=>d==="called-with:history"?{en:"the conversation history",pt:"o hist\xF3rico da conversa"}:{en:`\xAB${d.slice(18)}\xBB`,pt:`\xAB${d.slice(18)}\xBB`}),b=d=>f.map(p=>p[d]).join(d==="pt"?" e ":" and ");h.en=`Receive ${b("en")} from the orchestrator`,h.pt=`Receber do gestor ${b("pt")}`,h.why={en:`${h.why.en} ${t.en}`.trim(),pt:`${h.why.pt} ${t.pt}`.trim()};continue}a.push({agent:l,group:s,keys:t.fact?[t.fact]:[],...it(t,l,n),why:{en:t.en,pt:t.pt}})}}}let r=[...new Set(n.agents.map(t=>t.id))];return a.sort((t,s)=>r.indexOf(t.agent)-r.indexOf(s.agent)||Le.indexOf(t.group)-Le.indexOf(s.group))}function lt(e){let n=new Map,a=/^(connector|operation|mcp|flow-uses):/;for(let t of Object.keys(e.typeNames)){let s=e.agents.filter(c=>c.role==="specialist"&&(e.types[c.id]??[]).includes(t));if(s.length<2)continue;let l=[...new Set(s.flatMap(c=>Object.keys(c.facts).filter(m=>a.test(m))))].sort();for(let c of l){let m=s.filter(b=>c in b.facts);if(m.length!==1)continue;let h=`${m[0].id} ${c}`,f=n.get(h)??{agent:m[0].id,key:c,types:[]};f.types.push(t),n.set(h,f)}}return[...n.values()].filter(t=>!(t.key.startsWith("operation:")&&n.has(`${t.agent} connector:${t.key.slice(10,t.key.indexOf("/"))}`))).map(t=>{let s=t.types.map(m=>e.typeNames[m]??m),l=m=>T(t.key,m,e.names),c=m=>s.map(h=>`\xAB${h}\xBB`).join(m==="pt"?" e ":" and ");return{agent:t.agent,types:t.types,typeNames:s,key:t.key,en:`\xAB${l("en")}\xBB \u2014 only it has this in ${s.length>1?"the types":"the type"} ${c("en")}: does the post need it?`,pt:`\xAB${l("pt")}\xBB \u2014 s\xF3 ele tem ${s.length>1?"nos tipos":"no tipo"} ${c("pt")}: o cargo precisa?`}})}var ct={"trigger:OnEscalate":{en:"Hands over to a person (escalation)",pt:"Sabe encaminhar para uma pessoa (escalonamento)"},"called-with:history":{en:"Gets the conversation history from the orchestrator",pt:"Recebe do gestor o hist\xF3rico da conversa"},"node:LogCustomTelemetryEvent":{en:"Logs its own errors (telemetry)",pt:"Registra os pr\xF3prios erros (telemetria)"},"declared:kpi":{en:"Has a goal (KPI)",pt:"Tem uma meta (KPI)"},"declared:owner":{en:"Has an owner",pt:"Tem um respons\xE1vel"},"declared:team":{en:"Has a team",pt:"Tem uma equipe"}},Ae=(e,n,a={})=>ct[e]?.[n]??(Ne(e)?T(e,n,a):n==="pt"?`Tem \xAB${T(e,n,a)}\xBB`:`Has \xAB${T(e,n,a)}\xBB`);var dt=["owner","environment","created-on","last-published"],pt=e=>/^\s*([^\n]*?[.!?])(\s|$)/.exec(e)?.[1].trim()??e.split(`
153
+ `)[0].trim(),mt=e=>{let n=e.split(`
154
+ `),a=n.findIndex(t=>/^\s*([-*•]|\d+[.)])\s+/.test(t));if(a<0)return[];let r=[];for(let t of n.slice(a)){let s=/^\s*(?:[-*•]|\d+[.)])\s+(.*)$/.exec(t);if(!s)break;r.push(s[1].trim())}return r.slice(0,5)};function De(e,n,a,r,t,s,l){let c=i=>e.agents.find(w=>w.id===i)?.displayName??i,m=(i,w)=>{let S=r.declared.find(R=>R.agent===i&&R.key===w);return S&&{value:S.value,source:S.source}},h=r.declared.some(i=>dt.includes(i.key)),f=r.declared.some(i=>i.key==="team"||i.key==="kpi"),b=lt(e),d=[...ae(n,e),...b.flatMap(i=>{let w=r.decisions.find(R=>R.key===i.key&&R.status==="rejected"&&i.types.some(A=>R.scope===`type:${A}`)),S=w?e.typeNames[w.scope.slice(5)]??w.scope.slice(5):"";return w?[{agent:i.agent,group:"cleanup",keys:[i.key],en:`Remove the access \xAB${T(i.key,"en",e.names)}\xBB`,pt:`Tirar o acesso \xAB${T(i.key,"pt",e.names)}\xBB`,why:{en:`The team decided the post \xAB${S}\xBB does not need it.`,pt:`O time decidiu que o cargo \xAB${S}\xBB n\xE3o precisa.`}}]:[]})],p=e.contract.missing.map(i=>({id:i.calls,name:i.name??i.calls,caller:i.caller})),k=e.agents.map(i=>m(i.id,"environment")?.value).filter(i=>!!i),j=[...new Set(k)].sort((i,w)=>k.filter(S=>S===w).length-k.filter(S=>S===i).length)[0],P=i=>{let w=[],S=m(i,"environment")?.value;return S&&j&&S!==j&&w.push("hiring"),h&&!m(i,"owner")&&w.push("noOwner"),h&&m(i,"created-on")&&!m(i,"last-published")&&w.push("neverPublished"),l&&!l.some(R=>R.agent===i)&&w.push("noEval"),w.push(d.some(R=>R.agent===i&&R.group!=="cleanup")?"pdi":"ok"),w},W=i=>({id:i,name:c(i),situation:P(i)}),D=e.agents.map(i=>i.id),M=i=>i.map(w=>({id:w,name:c(w)})),fe=p.map(i=>({id:i.id,name:i.name})),ue=[{key:"cast",people:M(D)},{key:"hiring",people:[...fe,...M(D.filter(i=>P(i).includes("hiring")))]},...h?[{key:"noOwner",people:M(D.filter(i=>P(i).includes("noOwner")))},{key:"neverPublished",people:M(D.filter(i=>P(i).includes("neverPublished")))}]:[],...l?[{key:"noEval",people:M(D.filter(i=>P(i).includes("noEval")))}]:[],{key:"pdi",people:M(D.filter(i=>P(i).includes("pdi")))},{key:"ok",people:M(D.filter(i=>P(i).includes("ok")))}],X=e.agents.filter(i=>i.role==="orchestrator").map(i=>W(i.id)),H=e.agents.filter(i=>i.role==="specialist"),J=[...new Set(H.flatMap(i=>e.types[i.id]??[]))],he=[...J.map(i=>({id:i,name:e.typeNames[i]??i,people:H.filter(w=>(e.types[w.id]??[])[0]===i).map(w=>({...W(w.id),...(e.types[w.id]??[]).length>1?{alsoIn:(e.types[w.id]??[]).slice(1).map(S=>e.typeNames[S]??S)}:{}}))})).filter(i=>i.people.length),...H.some(i=>!(e.types[i.id]??[]).length)?[{id:"",name:"",people:H.filter(i=>!(e.types[i.id]??[]).length).map(i=>W(i.id))}]:[]],Y=(i,w)=>({key:i,en:Ae(i,"en",e.names),pt:Ae(i,"pt",e.names),proposal:w}),V=(i,w,S)=>{let R=e.patterns.filter(x=>!x.partOf&&(x.scope===i||i!=="platform"&&x.scope==="platform")),A=R.filter(x=>x.decision?.status==="accepted"),o=new Set(e.offPattern.map(x=>x.key)),y=A.length?A.map(x=>Y(x.key,!1)):R.filter(x=>o.has(x.key)).map(x=>Y(x.key,!0)),O=t.filter(x=>x.has&&(!x.role||x.role===S)&&!y.some(q=>q.key===x.has)).map(x=>Y(x.has,!1));return{scope:i,name:w,requirements:[...y,...O]}},ge=[V("specialist",{en:"Specialist",pt:"Especialista"},"specialist"),...J.map(i=>V(`type:${i}`,{en:`Specialist \xB7 ${e.typeNames[i]??i}`,pt:`Especialista \xB7 ${e.typeNames[i]??i}`},"specialist")),...X.length?[V("orchestrator",{en:"Orchestrator",pt:"Orquestrador"},"orchestrator")]:[]],ye=e.agents.map(i=>{let S=a.find($=>$.id===i.id)?.texts.find($=>$.source==="instructions")?.text??"",R=Object.keys(i.facts),A=$=>({en:T($,"en",e.names),pt:T($,"pt",e.names)}),o=R.filter($=>/^(operation|mcp|flow-uses|knowledge):/.test($)&&!$.startsWith("knowledge:count")).map(A),y=R.filter($=>$.startsWith("text:")&&!$.endsWith("~variant")).map(A),O=e.contract.routes.find($=>$.agent===i.id)?.caller,x=e.telemetry.events.filter($=>$.agent===i.id),q=s&&{days:s.days,starts:s.rows.filter($=>$.agent===i.id&&$.event==="TopicStart").reduce(($,$e)=>$+$e.count,0),errors:x.reduce(($,$e)=>$+($e.fired??0),0),notFired:e.telemetry.notFired.filter($=>$.agent===i.id).map($=>$.name),silent:e.telemetry.silent.includes(i.id)},ze=[...new Set(["YAML",...s?[s.file]:[],...(l??[]).filter($=>$.agent===i.id).map($=>$.file),...r.declared.filter($=>$.agent===i.id).map($=>$.source.split(" \u203A ")[0])])],Re=d.filter($=>$.agent===i.id);return{id:i.id,name:c(i.id),role:i.role==="orchestrator"?"orchestrator":"specialist",types:(e.types[i.id]??[]).map($=>e.typeNames[$]??$),...S?{title:pt(S)}:{},...O?{manager:c(O)}:{},...m(i.id,"team")?{team:m(i.id,"team")}:{},...m(i.id,"owner")?{owner:m(i.id,"owner")}:{},...m(i.id,"created-on")?{created:m(i.id,"created-on")}:{},...m(i.id,"last-published")?{published:m(i.id,"last-published")}:{},...i.schemaName?{schemaName:i.schemaName}:{},...m(i.id,"environment")?{environment:m(i.id,"environment")}:{},summary:mt(S),tools:o,conduct:y,...m(i.id,"kpi")?{goal:m(i.id,"kpi")}:{},...q?{performance:q}:{},...l?{certifications:l.filter($=>$.agent===i.id)}:{},access:b.filter($=>$.agent===i.id),pdi:Re,sources:ze,seal:Re.some($=>$.group!=="cleanup")?"pdi":"ok"}}),Z=[...h?[]:["inventory"],...f?[]:["team"],...s?[]:["telemetry"]];return{...e.name?{name:e.name}:{},staff:ue,missing:Z,org:{orchestrators:X,types:he,ghosts:p},posts:ge,resumes:ye}}var qe=e=>Ee(e),ft={bold:!0,fill:"E8EEF7"},ut={v:"\u25CF",fill:"DDF3E6",center:!0},ht={v:"\xD7",fill:"FFD5CC",center:!0,bold:!0},gt={v:"\u25D0",fill:"FFF3C4",center:!0},yt={v:"\u2248",fill:"FFF6DC",center:!0,bold:!0},Me=Object.keys(G);function Ue(e,n,a,r="en"){let t=te[r],s=(o,y,O)=>({key:o,name:t[o],header:!0,columns:y.map(([x,q])=>({title:x,width:q})),rows:[y.map(([x])=>({v:x,...ft})),...O]}),l=o=>t[e.roles[o]],c=o=>o.startsWith("type:")?`${t.type}:${e.typeNames[o.slice(5)]??o.slice(5)}`:t[o],m=o=>(e.types[o]??[]).map(y=>e.typeNames[y]??y).join(" \xB7 "),h=o=>T(o,r,e.names),f=[...e.agents].sort((o,y)=>o.role===y.role?o.id.localeCompare(y.id):o.role==="orchestrator"?-1:1),b=[...new Set([...f.flatMap(o=>Object.keys(o.facts)),...e.patterns.map(o=>o.key)])].filter(o=>!o.endsWith("~variant")).sort((o,y)=>Me.indexOf(_(o))-Me.indexOf(_(y))||o.localeCompare(y)),d=new Set(e.offPattern.map(o=>`${o.agent} ${o.key}`)),p=o=>e.agents.filter(y=>y.role===o).length,k={key:"summary",name:t.summary,header:!1,columns:[{title:"",width:28},{title:"",width:100}],rows:[[{v:e.name??t.title,bold:!0},""],[{v:t.privacy,color:"B42318"},""],[t.count.agents,e.agents.length],[t.count.orchestrators,p("orchestrator")],[t.count.specialists,p("specialist")],[t.count.patterns,e.patterns.length],[t.count.off,new Set(e.offPattern.map(o=>o.agent)).size],[t.count.gaps,e.gaps.length],[t.count.conflicts,e.conflicts.length],[t.count.solos,n.filter(o=>o.key==="solo").length],[t.count.unused,e.unused.length],["",""],[{v:n.length?t.look:t.nothing,bold:!0},""],...ne(n).flatMap(o=>[[{v:`${o[r]} \xB7 ${o.looks.length}`,bold:!0},""],...o.looks.map(({look:y})=>["",{v:y[r],wrap:!0}])])]},j=s("matrix",[[t.dimension,18],[t.fact,40],[t.key,34],...f.map(o=>[o.id,14])],b.map(o=>[G[_(o)][r],h(o),o,...f.map(y=>o in y.facts?o.startsWith("declared:")?gt:ut:`${o}~variant`in y.facts?yt:d.has(`${y.id} ${o}`)?ht:"")])),{look:P,everyone:W}=oe(e),D=s("patterns",[[t.key,34],[t.fact,40],[t.scope,14],[t.role,14],[t.share,10],[t.have,50],[t.lack,40],[t.decision,12],[t.why,50]],[...P,...W].map(o=>{let y=e.offPattern.filter(O=>O.key===o.key).map(O=>O.agent);return[o.key,h(o.key),c(o.scope),t[o.role],`${Math.round(o.share*100)}%`,o.agents.join(", "),y.join(", "),o.decision?t[o.decision.status==="accepted"?"accept":"reject"]:"",o.decision?.why??""]})),M=s("off",[[t.agent,24],[t.role,14],[t.missing,44],[t.key,34],[t.scope,14],[t.accepted,14]],e.offPattern.map(o=>[o.agent,l(o.agent),h(o.key),o.key,c(o.scope),e.patterns.find(y=>y.key===o.key)?.decision?.status==="accepted"?t.yes:""])),fe=s("gaps",[[t.rule,16],[t.says,50],[t.role,14],[t.notMet,60]],e.gaps.map(o=>[o.rule.id,o.rule.says,o.rule.role?t[o.rule.role]:"",o.agents.join(", ")])),ue=s("conflicts",[[t.agent,24],[t.fact,40],[t.key,34],[t.declared,20],[t.source,40],[t.inYaml,12]],e.conflicts.map(o=>[o.agent,h(o.key),o.key,o.declared,o.source,o.observed?t.yes:t.no])),X=s("agents",[[t.agent,24],[t.name,32],[t.role,14],[t.types,24],[t.facts,8],[t.off,44],[t.alone,44],[t.children,24],[t.unknown,12]],f.map(o=>[o.id,o.displayName??"",t[o.role],m(o.id),Object.keys(o.facts).length,e.offPattern.filter(y=>y.agent===o.id).map(y=>h(y.key)).join("; "),e.solos.filter(y=>y.agents[0]===o.id).map(y=>h(y.key)).join("; "),o.children.map(y=>y.name).join(", "),e.unknown.filter(y=>y.agent===o.id).length||""])),H=s("evidence",[[t.agent,30],[t.fact,40],[t.key,34],[t.file,50],[t.line,8]],f.flatMap(o=>[{who:o.id,facts:o.facts},...o.children.map(y=>({who:`${o.id} \u203A ${y.name}`,facts:y.facts}))]).flatMap(({who:o,facts:y})=>Object.entries(y).sort(([O],[x])=>O.localeCompare(x)).flatMap(([O,x])=>x.map(q=>[o,h(O),O,q.file,q.line??""])))),J=s("declared",[[t.agent,24],[t.key,34],[t.value,40],[t.source,40]],a.declared.map(o=>[o.agent,o.key,o.value,o.source])),he=s("text",[[t.id,28],[t.label,36],[t.body,70],[t.have,50],[t.variant,40],[t.official,10]],e.blocks.map(o=>[o.id,o.official??o.label,{v:o.text,wrap:!0},Object.keys(o.holders).sort().join(", "),Object.entries(o.variants).sort(([y],[O])=>y.localeCompare(O)).map(([y,O])=>`${y} (${Math.round(O.similarity*100)}%)`).join(", "),o.official?t.yes:""])),Y=s("routing",[[t.caller,24],[t.called,30],[t.history,10],[t.inputs,30],[t.routingText,70],[t.chars,10],[t.file,44]],e.contract.routes.map(o=>[o.caller,o.agent??`${o.name??o.calls} (${t.notInFolder})`,o.history?t.yes:t.no,o.inputs.join(", "),{v:o.description,wrap:!0},o.description.length,`${o.file}${o.line?`:${o.line}`:""}`])),V=e.telemetry.days,ge=s("telemetry",[[t.agent,24],[t.written,30],[t.form,28],[t.fields,50],[t.file,44],...V?[[t.fired(V),16]]:[]],e.telemetry.events.map(o=>[o.agent,o.name,E(o.as,r),o.fields?o.fields.join(", "):t.notRead,`${o.file}${o.line?`:${o.line}`:""}`,...V?[o.fired===void 0||e.telemetry.silent.includes(o.agent)?"\u2014":o.fired===0?{v:0,color:"B42318",bold:!0}:o.fired]:[]])),ye=s("unused",[[t.agent,24],[t.what,16],[t.name,30],[t.how,14],[t.file,50]],e.unused.flatMap(o=>o.sources.map(y=>[o.agent,t.thing[o.what]??o.what,e.names[o.name]??o.name,t[o.how],`${y.file}${y.line?`:${y.line}`:""}`]))),Z=De(e,n,[],a,[]),i=o=>Z.staff.filter(y=>y.key!=="cast"&&y.people.some(O=>O.id===o)).map(y=>t.situation[y.key]).join(", "),w=ae(n,e),S=s("staff",[[t.agent,24],[t.name,32],[t.situation_,34],[t.manager,24],[t.teamCol,22],[t.ownerCol,30],[t.hired,14],[t.publishedCol,14],[t.items,10]],Z.resumes.map(o=>[o.id,o.name,i(o.id),o.manager??"",o.team?.value??"",o.owner?.value??"",o.created?.value??"",o.published?.value??"",w.filter(y=>y.agent===o.id).length||""])),R=s("pdi",[[t.agent,24],[t.item,60],[t.why,70],[t.key,40],[t.group,18]],w.map(o=>[o.agent,o[r],{v:o.why[r],wrap:!0},o.keys.join(", "),t.pdiGroup[o.group]])),A=[k,j,D,...e.blocks.length?[he]:[],...e.contract.routes.length?[Y]:[],...e.telemetry.events.length?[ge]:[],M,fe,ue,...e.unused.length?[ye]:[],X,S,...w.length?[R]:[],H,J];return e.unknown.length&&A.push(s("unknown",[[t.agent,24],[t.file,50],[t.why,40],[t.kind,24]],e.unknown.map(o=>[o.agent,o.file,t.why_[o.why],o.kind??""]))),A}var $t={en:{map:"Map",patterns:"Patterns",cast:"Cast",microsoft:"Microsoft",unknown:e=>`What the analysis did not understand (${e})`,matrix:"Who has what",candidates:"Patterns to decide",everyone:e=>`Everybody already does it (${e})`,all:"All",role:"Role",focus:"Focus",legend:"\u25CF has it (click for the file) \xB7 \xD7 off a pattern of its role or type \xB7 \u2248 a variation of the block \xB7 \u25D0 declared by people",pattern:"pattern",type:"Type",noType:"no type",alsoIn:"also in",official:"official block",variation:"Variation",alike:"alike",text:"The text",types:"Types",of:(e,n,a)=>`${e} of ${n} ${a}`,who:"Who has it",lacks:"Off it",none:"nobody",decision:"Decision",toDecide:"to decide \u2014 in the workbook or the cast file",alone:"Only one has it: innovation or debt?",orchestratorDoes:"Only the orchestrator does it",sign:"How cast-list knows",follows:"Who follows it",declaredOnly:"only declared",nothingUnknown:"Everything was understood.",facts:"Facts",off:"Off a pattern",solo:"Only it has",children:"Children",close:"Close \u2715",foot:"The facts come from the YAML files; nothing was made up.",summary:(e,n,a,r,t)=>`${e} in the cast \xB7 ${n} patterns \xB7 ${a} off a pattern \xB7 ${r} only one has \xB7 threshold ${t}% of each role`,excel:"\u2B07 Excel",yaml:"\u2B07 cast.yaml",png:"\u2B07 PNG",playbill:"The cast\u2019s HR \u2192",plot:"Stage \u2192",name:"Name",said:"declared",unused:e=>`Unused (${e})`,nothingUnused:"Everything is used, nothing is switched off.",flows:"Flows",returnsNothing:"returns nothing",otherFlow:"another flow",telemetry:"Telemetry",times:(e,n)=>`${e} ${e===1?"time":"times"} in ${n} days`,notFired:"did not fire",noLine:"no line in the telemetry",routing:"Routing",called:"Called",history:"History",inputs:"Inputs",description:"Description",notInFolder:"not in the folder",chars:e=>`${e} characters`},pt:{map:"Mapa",patterns:"Padr\xF5es",cast:"Elenco",microsoft:"Microsoft",unknown:e=>`O que a an\xE1lise n\xE3o entendeu (${e})`,matrix:"Quem tem o qu\xEA",candidates:"Padr\xF5es para decidir",everyone:e=>`Todos j\xE1 fazem (${e})`,all:"Todos",role:"Papel",focus:"Foco",legend:"\u25CF tem (clique para ver o arquivo) \xB7 \xD7 fora de um padr\xE3o do seu papel ou tipo \xB7 \u2248 tem uma varia\xE7\xE3o do bloco \xB7 \u25D0 declarado por pessoas",pattern:"padr\xE3o",type:"Tipo",noType:"sem tipo",alsoIn:"tamb\xE9m em",official:"bloco oficial",variation:"Varia\xE7\xE3o",alike:"parecido",text:"O texto",types:"Tipos",of:(e,n,a)=>`${e} de ${n} ${a}`,who:"Quem tem",lacks:"Fora",none:"ningu\xE9m",decision:"Decis\xE3o",toDecide:"a decidir \u2014 na planilha ou no cast.yaml",alone:"S\xF3 um tem: inova\xE7\xE3o ou d\xEDvida?",orchestratorDoes:"S\xF3 o orquestrador faz",sign:"Como a cast-list sabe",follows:"Quem segue",declaredOnly:"s\xF3 declarado",nothingUnknown:"Tudo foi entendido.",facts:"Fatos",off:"Fora do padr\xE3o",solo:"S\xF3 ele tem",children:"Filhos",close:"Fechar \u2715",foot:"Os fatos v\xEAm dos arquivos YAML; nada foi inventado.",summary:(e,n,a,r,t)=>`${e} no elenco \xB7 ${n} padr\xF5es \xB7 ${a} fora do padr\xE3o \xB7 ${r} s\xF3 um tem \xB7 limite ${t}% de cada papel`,excel:"\u2B07 Excel",yaml:"\u2B07 cast.yaml",png:"\u2B07 PNG",playbill:"RH do elenco \u2192",plot:"Palco \u2192",name:"Nome",said:"declarado",unused:e=>`Sem uso (${e})`,nothingUnused:"Tudo \xE9 usado, nada est\xE1 desligado.",flows:"Fluxos",returnsNothing:"n\xE3o devolve nada",otherFlow:"outro fluxo",telemetry:"Telemetria",times:(e,n)=>`${e} ${e===1?"vez":"vezes"} em ${n} dias`,notFired:"n\xE3o disparou",noLine:"nenhuma linha na telemetria",routing:"Roteamento",called:"Chamado",history:"Hist\xF3rico",inputs:"Entradas",description:"Descri\xE7\xE3o",notInFolder:"n\xE3o est\xE1 na pasta",chars:e=>`${e} caracteres`}},C=JSON.parse(document.getElementById("cast").textContent),{result:v,lang:F,looks:K}=C,u=$t[F],N=te[F],me=Ue(v,K,C.cast,F);document.documentElement.lang=F==="pt"?"pt-BR":"en";document.title=v.name??C.id;var g=e=>String(e??"").replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n]),U=e=>g(T(e,F,v.names)),re=[...v.agents].sort((e,n)=>e.role===n.role?e.id.localeCompare(n.id):e.role==="orchestrator"?-1:1),Se=e=>v.patterns.find(n=>n.key===e),We=e=>[...new Set(v.offPattern.filter(n=>n.key===e||n.partOf===e).map(n=>n.agent))],_e=e=>e.startsWith("type:")?v.typeNames[e.slice(5)]??e.slice(5):N[e],Ve=e=>e.startsWith("type:")?"type":e,ce=Object.keys(v.typeNames),vt=e=>e.startsWith("text:block:")?v.blocks.find(n=>`text:block:${n.id}`===e):void 0,Oe=e=>{let n=Se(e);if(!n)return"";let a=n.decision?`<span class="cl-badge ${n.decision.status}">${g(N[n.decision.status==="accepted"?"accept":"reject"])}</span>`:"";return`${n.official?`<span class="cl-badge official">${u.official}</span>`:""}<span class="cl-badge ${Ve(n.scope)}">${u.pattern} \xB7 ${g(_e(n.scope))}</span>${a}`},L="map",I,z="all",ie,B,de=document.getElementById("app"),Ge=ne(K),le=new Set(Ge.filter(e=>!e.folded).map(e=>e.key));function He(){let e=[["map",u.map],["patterns",u.patterns],["cast",u.cast],["microsoft",u.microsoft],["unused",u.unused(v.unused.length)],["unknown",u.unknown(v.unknown.length)]],n=new Set(v.offPattern.map(a=>a.agent)).size;de.innerHTML=`<div class="cl-wrap">
155
+ <header><h1 class="cl-title">${g(v.name??C.id)}</h1><p class="cl-sub">${u.summary(v.agents.length,v.patterns.length,n,K.filter(a=>a.key==="solo").length,Math.round(C.threshold*100))}</p><p class="cl-private">${g(N.privacy)}</p></header>
156
+ <div class="cl-bar" role="tablist">${e.map(([a,r])=>`<button class="cl-tab" role="tab" aria-selected="${a===L}" data-tab="${a}">${g(r)}</button>`).join("")}
157
+ <span class="cl-space"></span>${C.plot?`<a class="cl-get" href="${g(C.plot)}">${g(u.plot)}</a>`:""}${C.playbill?`<a class="cl-get" href="${g(C.playbill)}">${g(u.playbill)}</a>`:""}<button class="cl-get" data-get="xlsx">${u.excel}</button><button class="cl-get" data-get="yaml">${u.yaml}</button>${L==="map"?`<button class="cl-get" data-get="png">${u.png}</button>`:""}</div>
158
+ ${L==="map"?kt():L==="patterns"?Te(me.find(a=>a.key==="patterns")):L==="cast"?Ot():L==="microsoft"?jt():L==="unused"?Pt():Nt()}
159
159
  <p class="cl-foot">${u.foot}</p>
160
- </div>`}function yt(){let e=a=>{let r=le.has(a.key),t=r?`<ul id="cl-group-${a.key}">${a.looks.map(({look:s,at:l})=>`<li><button data-look="${l}">${g(s[N])}</button></li>`).join("")}</ul>`:"";return`<div class="cl-group"><button class="cl-group-head" data-group="${a.key}" aria-expanded="${r}" aria-controls="cl-group-${a.key}"><span class="cl-caret">${r?"\u25BE":"\u25B8"}</span>${g(a[N])} <span class="cl-count">${a.looks.length}</span></button>${t}</div>`};return`${K.length?`<section class="cl-look"><h2>${g(F.look)} \xB7 ${K.length}</h2>${Ve.map(e).join("")}</section>`:""}<div class="cl-body${I?" with-detail":""}"><div class="cl-wrap" style="gap:16px">${vt()}${kt()}</div>${I?`<aside class="cl-card cl-detail" aria-live="polite">${wt()}</aside>`:""}</div>`}function $t(){let e=t=>z==="all"||t.role===z;if(!ce.length)return[{id:"",name:"",cols:re.filter(e).map(t=>({a:t,also:[]}))}];let n=t=>v.types[t]??[],a=re.filter(t=>t.role==="specialist"&&e(t));return[{id:"orchestrator",name:F.orchestrator,cols:re.filter(t=>t.role==="orchestrator"&&e(t)).map(t=>({a:t,also:[]}))},...ce.map(t=>({id:t,name:v.typeNames[t],cols:a.filter(s=>n(s.id).includes(t)).map(s=>({a:s,also:n(s.id).filter(l=>l!==t).map(l=>v.typeNames[l]??l)}))})),{id:"-",name:u.noType,cols:a.filter(t=>!n(t.id).length).map(t=>({a:t,also:[]}))}].filter(t=>t.cols.length&&(!B||t.id===B))}function vt(){let e=$t(),n=e.flatMap(f=>f.cols),a=C.focusAreas.find(f=>f.id===ie),r=[...new Set([...v.agents.flatMap(f=>Object.keys(f.facts)),...v.patterns.map(f=>f.key)])].filter(f=>!f.endsWith("~variant")&&(!a||a.facts.includes(f))),t=new Set(v.offPattern.map(f=>`${f.agent} ${f.key}`)),s=(f,b,d,p)=>`<button class="cl-chip" ${f}="${g(b)}" aria-pressed="${d}">${g(p)}</button>`,l=`<div class="cl-filters">${u.role}: ${s("data-role","all",z==="all",u.all)}${s("data-role","specialist",z==="specialist",F.specialist)}${s("data-role","orchestrator",z==="orchestrator",F.orchestrator)}
160
+ </div>`}function kt(){let e=a=>{let r=le.has(a.key),t=r?`<ul id="cl-group-${a.key}">${a.looks.map(({look:s,at:l})=>`<li><button data-look="${l}">${g(s[F])}</button></li>`).join("")}</ul>`:"";return`<div class="cl-group"><button class="cl-group-head" data-group="${a.key}" aria-expanded="${r}" aria-controls="cl-group-${a.key}"><span class="cl-caret">${r?"\u25BE":"\u25B8"}</span>${g(a[F])} <span class="cl-count">${a.looks.length}</span></button>${t}</div>`};return`${K.length?`<section class="cl-look"><h2>${g(N.look)} \xB7 ${K.length}</h2>${Ge.map(e).join("")}</section>`:""}<div class="cl-body${I?" with-detail":""}"><div class="cl-wrap" style="gap:16px">${bt()}${xt()}</div>${I?`<aside class="cl-card cl-detail" aria-live="polite">${St()}</aside>`:""}</div>`}function wt(){let e=t=>z==="all"||t.role===z;if(!ce.length)return[{id:"",name:"",cols:re.filter(e).map(t=>({a:t,also:[]}))}];let n=t=>v.types[t]??[],a=re.filter(t=>t.role==="specialist"&&e(t));return[{id:"orchestrator",name:N.orchestrator,cols:re.filter(t=>t.role==="orchestrator"&&e(t)).map(t=>({a:t,also:[]}))},...ce.map(t=>({id:t,name:v.typeNames[t],cols:a.filter(s=>n(s.id).includes(t)).map(s=>({a:s,also:n(s.id).filter(l=>l!==t).map(l=>v.typeNames[l]??l)}))})),{id:"-",name:u.noType,cols:a.filter(t=>!n(t.id).length).map(t=>({a:t,also:[]}))}].filter(t=>t.cols.length&&(!B||t.id===B))}function bt(){let e=wt(),n=e.flatMap(f=>f.cols),a=C.focusAreas.find(f=>f.id===ie),r=[...new Set([...v.agents.flatMap(f=>Object.keys(f.facts)),...v.patterns.map(f=>f.key)])].filter(f=>!f.endsWith("~variant")&&(!a||a.facts.includes(f))),t=new Set(v.offPattern.map(f=>`${f.agent} ${f.key}`)),s=(f,b,d,p)=>`<button class="cl-chip" ${f}="${g(b)}" aria-pressed="${d}">${g(p)}</button>`,l=`<div class="cl-filters">${u.role}: ${s("data-role","all",z==="all",u.all)}${s("data-role","specialist",z==="specialist",N.specialist)}${s("data-role","orchestrator",z==="orchestrator",N.orchestrator)}
161
161
  ${ce.length?`<span style="margin-left:10px">${u.type}:</span> ${s("data-type","",!B,u.all)}${ce.map(f=>s("data-type",f,B===f,v.typeNames[f])).join("")}${s("data-type","-",B==="-",u.noType)}`:""}
162
- ${C.focusAreas.length?`<span style="margin-left:10px">${u.focus}:</span> ${s("data-focus","",!ie,u.all)}${C.focusAreas.map(f=>s("data-focus",f.id,ie===f.id,f.name)).join("")}`:""}</div>`,c="";for(let f of Object.keys(G)){let b=p=>ke(p)?`${R(ke(p),N,v.names)}${R(p,N,v.names)}`:R(p,N,v.names),d=r.filter(p=>_(p)===f).sort((p,k)=>b(p).localeCompare(b(k)));d.length&&(c+=`<tr class="cl-dim"><td colspan="${n.length+1}">${g(G[f][N])}</td></tr>`,c+=d.map(p=>`<tr><th scope="row" style="text-align:left;font-weight:400"><button class="cl-fact${I?.key===p&&!I.agent?" picked":""}" data-key="${g(p)}">${U(p)}</button>${Oe(p)}</th>${n.map(({a:k})=>{let j=p in k.facts?p.startsWith("declared:")?["said","\u25D0"]:["has","\u25CF"]:`${p}~variant`in k.facts?["var","\u2248"]:t.has(`${k.id} ${p}`)?["off","\xD7"]:void 0;return`<td class="cl-mark${j?` ${j[0]}`:""}">${j?`<button data-key="${g(p)}" data-agent="${g(k.id)}" aria-label="${g(k.id)}: ${U(p)}">${j[1]}</button>`:""}</td>`}).join("")}</tr>`).join(""))}let m=e.some(f=>f.name)?`<tr class="cl-groups"><th></th>${e.map(f=>`<th colspan="${f.cols.length}" class="${f.id==="orchestrator"?"":"typed"}">${g(f.name)}</th>`).join("")}</tr>`:"",h=n.map(({a:f,also:b})=>`<th scope="col">${g(f.id)}<small>${g(b.length?`${u.alsoIn} ${b.join(", ")}`:F[f.role])}</small></th>`).join("");return`<section class="cl-card"><h2>${u.matrix}</h2>${l}<div class="cl-scroll"><table class="cl-matrix"><thead>${m}<tr><th></th>${h}</tr></thead><tbody>${c}</tbody></table></div><p class="cl-legend">${u.legend}</p></section>`}function kt(){let{look:e,everyone:n}=oe(v),a=r=>{let t=xe(r),s=v.agents.filter(c=>c.role===t.role).length,l=Ue(r);return`<button class="cl-pattern${I?.key===r?" picked":""}" data-pattern="${g(r)}"><b>${U(r)}</b><span>${Oe(r)} ${u.of(t.agents.filter(c=>v.roles[c]===t.role).length,s,we(t.role,N,s))}</span>
163
- ${l.length?`<span class="cl-lack">${u.lacks}: ${g(l.join(", "))}</span>`:""}<span>${u.decision}: ${t.decision?`${g(F[t.decision.status==="accepted"?"accept":"reject"])}${t.decision.why?` \u2014 ${g(t.decision.why)}`:""}`:`<i>${u.toDecide}</i>`}</span></button>`};return`<section class="cl-card"><h2>${u.candidates}</h2>${e.length?`<div class="cl-cards">${e.map(r=>a(r.key)).join("")}</div>`:'<p class="cl-empty">\u2014</p>'}
164
- ${n.length?`<details class="cl-everyone"><summary>${u.everyone(n.length)}</summary><ul>${n.map(r=>`<li><button class="cl-fact" data-pattern="${g(r.key)}">${U(r.key)}</button> <span class="cl-badge ${_e(r.scope)}">${g(We(r.scope))}</span></li>`).join("")}</ul></details>`:""}</section>`}function wt(){let{key:e,agent:n}=I,a=xe(e),t=v.agents.filter(d=>e in d.facts&&(!n||d.id===n)).map(d=>`<li><b>${g(d.id)}</b>${d.facts[e].map(p=>`<div class="cl-file">${g(p.file)}${p.line?`:${p.line}`:""}</div>`).join("")}</li>`).join(""),s=Ue(e).filter(d=>!n||d===n),l=v.solos.some(d=>d.key===e),c=v.orchestratorDoes.some(d=>d.key===e),m=gt(e),h=d=>d.map(p=>p.op==="same"?g(p.text):`<span class="cl-${p.op}">${g(p.text)}</span>`).join(" "),f=m?Object.entries(m.variants).filter(([d])=>!n||d===n):[],b=m?`<div><b>${u.text}</b><pre class="cl-text">${g(m.text)}</pre></div>
165
- ${f.map(([d,p])=>`<div class="cl-variant"><b>${g(d)}</b> <span class="cl-file">${g(p.source.file)}${p.source.line?`:${p.source.line}`:""} \xB7 ${Math.round(p.similarity*100)}% ${u.alike}</span><div class="cl-diff">${h(p.diff)}</div></div>`).join("")}`:"";return`<button class="cl-close" data-close="1">${u.close}</button><span class="cl-kicker">${g(G[_(e)][N])}</span><h3>${U(e)}</h3><code>${g(e)}</code>
166
- ${a?`<div>${Oe(e)}</div><div>${u.decision}: ${a.decision?`${g(F[a.decision.status==="accepted"?"accept":"reject"])}${a.decision.why?` \u2014 ${g(a.decision.why)}`:""}`:`<i>${u.toDecide}</i>`}</div>`:""}
162
+ ${C.focusAreas.length?`<span style="margin-left:10px">${u.focus}:</span> ${s("data-focus","",!ie,u.all)}${C.focusAreas.map(f=>s("data-focus",f.id,ie===f.id,f.name)).join("")}`:""}</div>`,c="";for(let f of Object.keys(G)){let b=p=>we(p)?`${T(we(p),F,v.names)}${T(p,F,v.names)}`:T(p,F,v.names),d=r.filter(p=>_(p)===f).sort((p,k)=>b(p).localeCompare(b(k)));d.length&&(c+=`<tr class="cl-dim"><td colspan="${n.length+1}">${g(G[f][F])}</td></tr>`,c+=d.map(p=>`<tr><th scope="row" style="text-align:left;font-weight:400"><button class="cl-fact${I?.key===p&&!I.agent?" picked":""}" data-key="${g(p)}">${U(p)}</button>${Oe(p)}</th>${n.map(({a:k})=>{let j=p in k.facts?p.startsWith("declared:")?["said","\u25D0"]:["has","\u25CF"]:`${p}~variant`in k.facts?["var","\u2248"]:t.has(`${k.id} ${p}`)?["off","\xD7"]:void 0;return`<td class="cl-mark${j?` ${j[0]}`:""}">${j?`<button data-key="${g(p)}" data-agent="${g(k.id)}" aria-label="${g(k.id)}: ${U(p)}">${j[1]}</button>`:""}</td>`}).join("")}</tr>`).join(""))}let m=e.some(f=>f.name)?`<tr class="cl-groups"><th></th>${e.map(f=>`<th colspan="${f.cols.length}" class="${f.id==="orchestrator"?"":"typed"}">${g(f.name)}</th>`).join("")}</tr>`:"",h=n.map(({a:f,also:b})=>`<th scope="col">${g(f.id)}<small>${g(b.length?`${u.alsoIn} ${b.join(", ")}`:N[f.role])}</small></th>`).join("");return`<section class="cl-card"><h2>${u.matrix}</h2>${l}<div class="cl-scroll"><table class="cl-matrix"><thead>${m}<tr><th></th>${h}</tr></thead><tbody>${c}</tbody></table></div><p class="cl-legend">${u.legend}</p></section>`}function xt(){let{look:e,everyone:n}=oe(v),a=r=>{let t=Se(r),s=v.agents.filter(c=>c.role===t.role).length,l=We(r);return`<button class="cl-pattern${I?.key===r?" picked":""}" data-pattern="${g(r)}"><b>${U(r)}</b><span>${Oe(r)} ${u.of(t.agents.filter(c=>v.roles[c]===t.role).length,s,be(t.role,F,s))}</span>
163
+ ${l.length?`<span class="cl-lack">${u.lacks}: ${g(l.join(", "))}</span>`:""}<span>${u.decision}: ${t.decision?`${g(N[t.decision.status==="accepted"?"accept":"reject"])}${t.decision.why?` \u2014 ${g(t.decision.why)}`:""}`:`<i>${u.toDecide}</i>`}</span></button>`};return`<section class="cl-card"><h2>${u.candidates}</h2>${e.length?`<div class="cl-cards">${e.map(r=>a(r.key)).join("")}</div>`:'<p class="cl-empty">\u2014</p>'}
164
+ ${n.length?`<details class="cl-everyone"><summary>${u.everyone(n.length)}</summary><ul>${n.map(r=>`<li><button class="cl-fact" data-pattern="${g(r.key)}">${U(r.key)}</button> <span class="cl-badge ${Ve(r.scope)}">${g(_e(r.scope))}</span></li>`).join("")}</ul></details>`:""}</section>`}function St(){let{key:e,agent:n}=I,a=Se(e),t=v.agents.filter(d=>e in d.facts&&(!n||d.id===n)).map(d=>`<li><b>${g(d.id)}</b>${d.facts[e].map(p=>`<div class="cl-file">${g(p.file)}${p.line?`:${p.line}`:""}</div>`).join("")}</li>`).join(""),s=We(e).filter(d=>!n||d===n),l=v.solos.some(d=>d.key===e),c=v.orchestratorDoes.some(d=>d.key===e),m=vt(e),h=d=>d.map(p=>p.op==="same"?g(p.text):`<span class="cl-${p.op}">${g(p.text)}</span>`).join(" "),f=m?Object.entries(m.variants).filter(([d])=>!n||d===n):[],b=m?`<div><b>${u.text}</b><pre class="cl-text">${g(m.text)}</pre></div>
165
+ ${f.map(([d,p])=>`<div class="cl-variant"><b>${g(d)}</b> <span class="cl-file">${g(p.source.file)}${p.source.line?`:${p.source.line}`:""} \xB7 ${Math.round(p.similarity*100)}% ${u.alike}</span><div class="cl-diff">${h(p.diff)}</div></div>`).join("")}`:"";return`<button class="cl-close" data-close="1">${u.close}</button><span class="cl-kicker">${g(G[_(e)][F])}</span><h3>${U(e)}</h3><code>${g(e)}</code>
166
+ ${a?`<div>${Oe(e)}</div><div>${u.decision}: ${a.decision?`${g(N[a.decision.status==="accepted"?"accept":"reject"])}${a.decision.why?` \u2014 ${g(a.decision.why)}`:""}`:`<i>${u.toDecide}</i>`}</div>`:""}
167
167
  ${l?`<div>${u.alone}</div>`:c?`<div>${u.orchestratorDoes}</div>`:""}
168
168
  ${b}
169
169
  <div><b>${u.who}</b>${t?`<ul>${t}</ul>`:` \u2014 ${u.none}`}</div>
170
170
  ${v.patterns.filter(d=>d.partOf===e).map(d=>{let p=v.offPattern.filter(k=>k.key===d.key).map(k=>k.agent);return`<div><b>${U(d.key)}</b> \u2014 ${p.length?`<span style="color:var(--off)">${u.lacks}: ${g(p.join(", "))}</span>`:`${u.who}: ${d.agents.length}`}</div>`}).join("")}
171
- ${s.length?`<div><b>${u.lacks}</b>: <span style="color:var(--off)">${g(s.join(", "))}</span></div>`:""}`}function bt(){return`<div class="cl-agents">${re.map(e=>{let n=v.offPattern.filter(s=>s.agent===e.id),a=v.solos.filter(s=>s.agents[0]===e.id),r=v.unknown.filter(s=>s.agent===e.id),t=St(e.id);return`<section class="cl-card cl-agent${t?" wide":""}"><span class="cl-kicker">${g(F[e.role])}</span><h3>${g(e.id)}</h3>${e.displayName?`<code>${g(e.displayName)}</code>`:""}<dl>
171
+ ${s.length?`<div><b>${u.lacks}</b>: <span style="color:var(--off)">${g(s.join(", "))}</span></div>`:""}`}function Ot(){return`<div class="cl-agents">${re.map(e=>{let n=v.offPattern.filter(s=>s.agent===e.id),a=v.solos.filter(s=>s.agents[0]===e.id),r=v.unknown.filter(s=>s.agent===e.id),t=Ct(e.id);return`<section class="cl-card cl-agent${t?" wide":""}"><span class="cl-kicker">${g(N[e.role])}</span><h3>${g(e.id)}</h3>${e.displayName?`<code>${g(e.displayName)}</code>`:""}<dl>
172
172
  ${(v.types[e.id]??[]).length?`<dt>${u.types}</dt><dd>${g(v.types[e.id].map(s=>v.typeNames[s]??s).join(" \xB7 "))}</dd>`:""}
173
173
  <dt>${u.facts}</dt><dd>${Object.keys(e.facts).length}</dd>
174
174
  ${n.length?`<dt>${u.off}</dt><dd class="cl-lack">${n.map(s=>U(s.key)).join("<br>")}</dd>`:""}
175
175
  ${a.length?`<dt>${u.solo}</dt><dd>${a.map(s=>U(s.key)).join("<br>")}</dd>`:""}
176
- ${xt(e.id,e.displayName??e.id)}
177
- ${Ot(e.id)}
176
+ ${Tt(e.id,e.displayName??e.id)}
177
+ ${Rt(e.id)}
178
178
  ${e.children.length?`<dt>${u.children}</dt><dd>${e.children.map(s=>`${g(s.name)} <span class="cl-sub">(${Object.keys(s.facts).map(U).join(", ")})</span>`).join("<br>")}</dd>`:""}
179
- ${r.length?`<dt>${g(F.unknown)}</dt><dd>${r.map(s=>g(s.file)).join("<br>")}</dd>`:""}</dl>${t}</section>`}).join("")}</div>`}function xt(e,n){let a=v.flows.filter(s=>s.agent===e&&s.called);if(!a.length)return"";let r=s=>s==="child-flow"?u.otherFlow:s.startsWith("http:")?s.slice(5):s.startsWith("connector:")?v.names[s.slice(10)]??s.slice(10):void 0,t=s=>{let l=s.uses.map(r).filter(c=>!!c);return`<div class="cl-chain">${[n,s.name,...l.length?[l.join(", ")]:[]].map(g).join(' <span aria-hidden="true">\u2192</span> ')}${s.returns?"":` <span class="cl-silent">\u2014 ${u.returnsNothing}</span>`}</div>`};return`<dt>${u.flows}</dt><dd>${a.map(t).join("")}</dd>`}function Ot(e){let n=v.telemetry.events.filter(s=>s.agent===e),a=v.telemetry.days,r=v.telemetry.silent.includes(e);if(!n.length&&!r)return"";let t=s=>`<div class="cl-event"><code>${g(s.name)}</code>${!a||r?"":s.fired?` <span class="cl-sub">\u2014 ${g(u.times(s.fired,a))}</span>`:` <span class="cl-silent">\u2014 ${u.notFired}</span>`}</div>`;return`<dt>${u.telemetry}</dt><dd class="cl-events">${n.map(t).join("")}${r?`<div class="cl-silent">${u.noLine}</div>`:""}</dd>`}function St(e){let n=v.contract.routes.filter(r=>r.caller===e);if(!n.length)return"";let a=n.map(r=>{let t=r.description.length<je;return`<tr><td>${r.agent?g(r.agent):`<span class="cl-silent">${g(r.name??r.calls)} \u2014 ${u.notInFolder}</span>`}</td>
180
- <td${r.history?"":' class="cl-silent"'}>${r.history?F.yes:F.no}</td><td>${r.inputs.length?g(r.inputs.join(", ")):'<span class="cl-silent">\u2014</span>'}</td>
181
- <td${t?' class="cl-silent"':""} title="${g(r.description)}">${g(u.chars(r.description.length))}</td></tr>`}).join("");return`<div class="cl-route"><h4>${u.routing}</h4><table class="cl-routing"><thead><tr><th>${u.called}</th><th>${u.history}</th><th>${u.inputs}</th><th>${u.description}</th></tr></thead><tbody>${a}</tbody></table></div>`}function Tt(){let e=me.find(n=>n.key==="unused");return e?Se(e):`<section class="cl-card"><p class="cl-empty">${u.nothingUnused}</p></section>`}function Rt(){let e=ee.map(n=>{let a=v.agents.filter(r=>`ms:${n.id}`in r.facts||`declared:ms:${n.id}`in r.facts).map(r=>r.id);return`<tr><td><a href="${ve}/${n.id}.md" target="_blank" rel="noopener">${g(n.name)}</a></td><td>${g(n.sign??u.declaredOnly)}</td><td>${a.length?g(a.join(", ")):`<span class="cl-sub">${u.none}</span>`}</td></tr>`}).join("");return`<section class="cl-card cl-table"><table><thead><tr><th>${u.microsoft}</th><th>${u.sign}</th><th>${u.follows}</th></tr></thead><tbody>${e}</tbody></table></section>`}function Ct(){let e=me.find(n=>n.key==="unknown");return e?Se(e):`<section class="cl-card"><p class="cl-empty">${u.nothingUnknown}</p></section>`}function Se(e){let n=(t,s)=>{let l=typeof t=="object"&&t?t:{v:t},c=s?"th":"td";return`<${c}${l.fill&&!s?` style="background:#${l.fill};color:#1d2330"`:""}>${g(l.v)}</${c}>`},[a,...r]=e.rows;return`<section class="cl-card cl-table" role="tabpanel"><table><thead><tr>${a.map(t=>n(t,!0)).join("")}</tr></thead><tbody>${r.map(t=>`<tr>${t.map(s=>n(s,!1)).join("")}</tr>`).join("")}</tbody></table></section>`}function pe(e,n){let a=document.createElement("a");a.href=URL.createObjectURL(e),a.download=n,a.click(),setTimeout(()=>URL.revokeObjectURL(a.href),1e3)}async function Pt(){let e=de.querySelector(".cl-matrix"),[n,a]=[e.scrollWidth+32,e.scrollHeight+32],r=new XMLSerializer().serializeToString(e).replace(/ picked/g,""),t=`<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${a}"><foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" class="cl light" style="min-height:0;padding:16px;background:#fff;width:${n}px"><style>/* The cast map: tokens on .cl (not :root) so the PNG, drawn apart, carries them too. */
179
+ ${r.length?`<dt>${g(N.unknown)}</dt><dd>${r.map(s=>g(s.file)).join("<br>")}</dd>`:""}</dl>${t}</section>`}).join("")}</div>`}function Tt(e,n){let a=v.flows.filter(s=>s.agent===e&&s.called);if(!a.length)return"";let r=s=>s==="child-flow"?u.otherFlow:s.startsWith("http:")?s.slice(5):s.startsWith("connector:")?v.names[s.slice(10)]??s.slice(10):void 0,t=s=>{let l=s.uses.map(r).filter(c=>!!c);return`<div class="cl-chain">${[n,s.name,...l.length?[l.join(", ")]:[]].map(g).join(' <span aria-hidden="true">\u2192</span> ')}${s.returns?"":` <span class="cl-silent">\u2014 ${u.returnsNothing}</span>`}</div>`};return`<dt>${u.flows}</dt><dd>${a.map(t).join("")}</dd>`}function Rt(e){let n=v.telemetry.events.filter(s=>s.agent===e),a=v.telemetry.days,r=v.telemetry.silent.includes(e);if(!n.length&&!r)return"";let t=s=>`<div class="cl-event"><code>${g(s.name)}</code>${!a||r?"":s.fired?` <span class="cl-sub">\u2014 ${g(u.times(s.fired,a))}</span>`:` <span class="cl-silent">\u2014 ${u.notFired}</span>`}</div>`;return`<dt>${u.telemetry}</dt><dd class="cl-events">${n.map(t).join("")}${r?`<div class="cl-silent">${u.noLine}</div>`:""}</dd>`}function Ct(e){let n=v.contract.routes.filter(r=>r.caller===e);if(!n.length)return"";let a=n.map(r=>{let t=r.description.length<je;return`<tr><td>${r.agent?g(r.agent):`<span class="cl-silent">${g(r.name??r.calls)} \u2014 ${u.notInFolder}</span>`}</td>
180
+ <td${r.history?"":' class="cl-silent"'}>${r.history?N.yes:N.no}</td><td>${r.inputs.length?g(r.inputs.join(", ")):'<span class="cl-silent">\u2014</span>'}</td>
181
+ <td${t?' class="cl-silent"':""} title="${g(r.description)}">${g(u.chars(r.description.length))}</td></tr>`}).join("");return`<div class="cl-route"><h4>${u.routing}</h4><table class="cl-routing"><thead><tr><th>${u.called}</th><th>${u.history}</th><th>${u.inputs}</th><th>${u.description}</th></tr></thead><tbody>${a}</tbody></table></div>`}function Pt(){let e=me.find(n=>n.key==="unused");return e?Te(e):`<section class="cl-card"><p class="cl-empty">${u.nothingUnused}</p></section>`}function jt(){let e=ee.map(n=>{let a=v.agents.filter(r=>`ms:${n.id}`in r.facts||`declared:ms:${n.id}`in r.facts).map(r=>r.id);return`<tr><td><a href="${ve}/${n.id}.md" target="_blank" rel="noopener">${g(n.name)}</a></td><td>${g(n.sign??u.declaredOnly)}</td><td>${a.length?g(a.join(", ")):`<span class="cl-sub">${u.none}</span>`}</td></tr>`}).join("");return`<section class="cl-card cl-table"><table><thead><tr><th>${u.microsoft}</th><th>${u.sign}</th><th>${u.follows}</th></tr></thead><tbody>${e}</tbody></table></section>`}function Nt(){let e=me.find(n=>n.key==="unknown");return e?Te(e):`<section class="cl-card"><p class="cl-empty">${u.nothingUnknown}</p></section>`}function Te(e){let n=(t,s)=>{let l=typeof t=="object"&&t?t:{v:t},c=s?"th":"td";return`<${c}${l.fill&&!s?` style="background:#${l.fill};color:#1d2330"`:""}>${g(l.v)}</${c}>`},[a,...r]=e.rows;return`<section class="cl-card cl-table" role="tabpanel"><table><thead><tr>${a.map(t=>n(t,!0)).join("")}</tr></thead><tbody>${r.map(t=>`<tr>${t.map(s=>n(s,!1)).join("")}</tr>`).join("")}</tbody></table></section>`}function pe(e,n){let a=document.createElement("a");a.href=URL.createObjectURL(e),a.download=n,a.click(),setTimeout(()=>URL.revokeObjectURL(a.href),1e3)}async function Ft(){let e=de.querySelector(".cl-matrix"),[n,a]=[e.scrollWidth+32,e.scrollHeight+32],r=new XMLSerializer().serializeToString(e).replace(/ picked/g,""),t=`<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${a}"><foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" class="cl light" style="min-height:0;padding:16px;background:#fff;width:${n}px"><style>/* The cast map: tokens on .cl (not :root) so the PNG, drawn apart, carries them too. */
182
182
  .cl {
183
183
  --bg: #f6f6f3; --card: #ffffff; --ink: #1d2330; --muted: #5f6878; --line: #e2e4e8; --soft: #f3f4f1;
184
184
  --has: #2e7d55; --off: #c8442c; --off-bg: #fde8e3; --said: #b7791f;
@@ -301,7 +301,7 @@ body { margin: 0; }
301
301
  .cl-route { overflow-x: auto; }
302
302
  .cl-route h4 { margin: 6px 0 4px; font-size: 13px; color: var(--muted); }
303
303
  a.cl-get { color: var(--ink); text-decoration: none; font-weight: 600; }
304
- </style>${r}</div></foreignObject></svg>`;try{let s=new Image;s.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`,await s.decode();let l=document.createElement("canvas");l.width=n*2,l.height=a*2;let c=l.getContext("2d");c.scale(2,2),c.drawImage(s,0,0);let m=await new Promise(h=>l.toBlob(h,"image/png"));if(!m)throw new Error("no PNG");pe(m,`${C.id}.png`)}catch{pe(new Blob([t],{type:"image/svg+xml"}),`${C.id}.svg`)}}de.addEventListener("click",e=>{let n=e.target.closest("button");if(!n)return;let a=n.dataset;if(a.tab)E=a.tab;else if(a.role)z=a.role;else if(a.focus!==void 0)ie=a.focus||void 0;else if(a.type!==void 0)B=a.type||void 0;else if(a.key)I={key:a.key,...a.agent?{agent:a.agent}:{}};else if(a.pattern)I={key:a.pattern};else if(a.close)I=void 0;else if(a.group)le.has(a.group)?le.delete(a.group):le.add(a.group);else if(a.look){let r=K[Number(a.look)];E="map",r.fact&&(I={key:r.fact,...r.agents.length===1?{agent:r.agents[0]}:{}}),(r.key==="off"||r.key==="gap"||r.key==="conflict")&&(I=r.fact?{key:r.fact}:I),r.key==="unknown"&&(E="unknown"),r.key==="unused"&&(E="unused")}else{if(a.get==="xlsx")return pe(new Blob([Me(me)],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),`${C.id}.xlsx`);if(a.get==="yaml")return pe(new Blob([C.castYaml],{type:"text/yaml"}),`${C.id}.cast.yaml`);if(a.get==="png")return void Pt()}Ge(),(a.key||a.pattern||a.look)&&de.querySelector(".cl-detail")?.scrollIntoView({block:"nearest"})});Ge();})();
304
+ </style>${r}</div></foreignObject></svg>`;try{let s=new Image;s.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`,await s.decode();let l=document.createElement("canvas");l.width=n*2,l.height=a*2;let c=l.getContext("2d");c.scale(2,2),c.drawImage(s,0,0);let m=await new Promise(h=>l.toBlob(h,"image/png"));if(!m)throw new Error("no PNG");pe(m,`${C.id}.png`)}catch{pe(new Blob([t],{type:"image/svg+xml"}),`${C.id}.svg`)}}de.addEventListener("click",e=>{let n=e.target.closest("button");if(!n)return;let a=n.dataset;if(a.tab)L=a.tab;else if(a.role)z=a.role;else if(a.focus!==void 0)ie=a.focus||void 0;else if(a.type!==void 0)B=a.type||void 0;else if(a.key)I={key:a.key,...a.agent?{agent:a.agent}:{}};else if(a.pattern)I={key:a.pattern};else if(a.close)I=void 0;else if(a.group)le.has(a.group)?le.delete(a.group):le.add(a.group);else if(a.look){let r=K[Number(a.look)];L="map",r.fact&&(I={key:r.fact,...r.agents.length===1?{agent:r.agents[0]}:{}}),(r.key==="off"||r.key==="gap"||r.key==="conflict")&&(I=r.fact?{key:r.fact}:I),r.key==="unknown"&&(L="unknown"),r.key==="unused"&&(L="unused")}else{if(a.get==="xlsx")return pe(new Blob([qe(me)],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),`${C.id}.xlsx`);if(a.get==="yaml")return pe(new Blob([C.castYaml],{type:"text/yaml"}),`${C.id}.cast.yaml`);if(a.get==="png")return void Ft()}He(),(a.key||a.pattern||a.look)&&de.querySelector(".cl-detail")?.scrollIntoView({block:"nearest"})});He();})();
305
305
  </script>
306
306
  </body>
307
307
  </html>