@zaip-ai/cli 4.7.0 → 4.8.0

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.
Files changed (83) hide show
  1. package/dist/services/adapters.d.ts +1 -1
  2. package/dist/services/adapters.js +1 -1
  3. package/dist/services/codex-hook-activation.d.ts.map +1 -1
  4. package/dist/services/codex-hook-activation.js +12 -0
  5. package/dist/services/codex-hook-activation.js.map +1 -1
  6. package/dist/services/codex-pre-tool-hook-template.js +1 -1
  7. package/dist/services/codex-pre-tool-hook-template.test.js +36 -0
  8. package/dist/services/codex-pre-tool-hook-template.test.js.map +1 -1
  9. package/dist/services/global-codex-config-migration-rollback.test.d.ts +2 -0
  10. package/dist/services/global-codex-config-migration-rollback.test.d.ts.map +1 -0
  11. package/dist/services/global-codex-config-migration-rollback.test.js +88 -0
  12. package/dist/services/global-codex-config-migration-rollback.test.js.map +1 -0
  13. package/dist/services/global-codex-config-migration.test.js +69 -82
  14. package/dist/services/global-codex-config-migration.test.js.map +1 -1
  15. package/dist/services/global-codex-config-transaction.test.js +5 -1
  16. package/dist/services/global-codex-config-transaction.test.js.map +1 -1
  17. package/dist/services/global-codex-config.d.ts.map +1 -1
  18. package/dist/services/global-codex-config.js +32 -53
  19. package/dist/services/global-codex-config.js.map +1 -1
  20. package/dist/services/global-codex-toml.d.ts +9 -0
  21. package/dist/services/global-codex-toml.d.ts.map +1 -0
  22. package/dist/services/global-codex-toml.js +53 -0
  23. package/dist/services/global-codex-toml.js.map +1 -0
  24. package/dist/services/logger.js +1 -1
  25. package/dist/services/logger.js.map +1 -1
  26. package/dist/services/logger.test.js +2 -2
  27. package/dist/services/logger.test.js.map +1 -1
  28. package/package.json +1 -1
  29. package/templates/.agents/config/agents/discovery.json +1 -1
  30. package/templates/.agents/dashboard/.zaip-managed.json +38 -38
  31. package/templates/.agents/dashboard/apps/frontend/dist/assets/{CostCalculationGuidePage-OUjdwEcM.js → CostCalculationGuidePage-BW7Vy1cp.js} +1 -1
  32. package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-Cei1ChjE.js → DashboardHelpDialog-BN8KQPrr.js} +2 -2
  33. package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-_woNCrTT.js → PricingSettingsDialog-Prcs-ydy.js} +1 -1
  34. package/templates/.agents/dashboard/apps/frontend/dist/assets/{ProjectSettingsPage-B2_7MVOP.js → ProjectSettingsPage-HqGUImIG.js} +1 -1
  35. package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-C_jCsSZe.js → TraceabilityWorkspace-CNpmQMO4.js} +1 -1
  36. package/templates/.agents/dashboard/apps/frontend/dist/assets/{cost-monitor-C8zQDBT7.js → cost-monitor-Co2Jiuzh.js} +1 -1
  37. package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-iMPXot7Y.js → icons-vendor-DOhy6D2-.js} +1 -1
  38. package/templates/.agents/dashboard/apps/frontend/dist/assets/{index-DiCwz0sr.js → index-DX65Ufuu.js} +2 -2
  39. package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-721Re3Ss.js → react-vendor-CkPC-yMz.js} +1 -1
  40. package/templates/.agents/dashboard/apps/frontend/dist/assets/{traceability-BjdTkWS0.js → traceability-BEdGoIDm.js} +1 -1
  41. package/templates/.agents/dashboard/apps/frontend/dist/index.html +5 -5
  42. package/templates/.agents/dashboard/apps/frontend/package.json +1 -1
  43. package/templates/.agents/dashboard/modules/cost-monitor/package.json +1 -1
  44. package/templates/.agents/dashboard/modules/operations/package.json +1 -1
  45. package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.macro-metrics.test.ts +2 -1
  46. package/templates/.agents/dashboard/modules/operations/src/react/overview-duration-hint.ts +1 -3
  47. package/templates/.agents/dashboard/modules/traceability/package.json +1 -1
  48. package/templates/.agents/dashboard/packages/branding/package.json +1 -1
  49. package/templates/.agents/dashboard/packages/contracts/package.json +1 -1
  50. package/templates/.agents/dashboard/packages/data-export/package.json +1 -1
  51. package/templates/.agents/dashboard/packages/local-runtime/package.json +1 -1
  52. package/templates/.agents/dashboard/packages/ui/package.json +1 -1
  53. package/templates/.agents/dashboard/tests/e2e/package.json +1 -1
  54. package/templates/.agents/design/.zaip-managed.json +3 -3
  55. package/templates/.agents/design/apps/catalog/package.json +1 -1
  56. package/templates/.agents/design/packages/local-runtime/package.json +1 -1
  57. package/templates/.agents/requirements/autonomous-assurance.md +1 -1
  58. package/templates/.agents/requirements/cloud-hostinger-autonomy.md +1 -1
  59. package/templates/.agents/requirements/comparative-audit.md +1 -1
  60. package/templates/.agents/requirements/context-engine.md +1 -1
  61. package/templates/.agents/requirements/cost-observability.md +1 -1
  62. package/templates/.agents/requirements/dashboard-launch.md +1 -1
  63. package/templates/.agents/requirements/data-export.md +1 -1
  64. package/templates/.agents/requirements/design-system.md +1 -1
  65. package/templates/.agents/requirements/execution-engine.md +1 -1
  66. package/templates/.agents/requirements/kanban-dashboard.md +1 -1
  67. package/templates/.agents/requirements/model-orchestration.md +1 -1
  68. package/templates/.agents/requirements/public-distribution.md +11 -9
  69. package/templates/.agents/requirements/software-architecture.md +1 -1
  70. package/templates/.agents/requirements/strategic-improvements.md +1 -1
  71. package/templates/.agents/requirements/work-lifecycle.md +1 -1
  72. package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
  73. package/templates/.agents/runtime/VERSION +1 -1
  74. package/templates/.agents/runtime/bin/zaip.mjs +18 -6
  75. package/templates/.agents/runtime/checksums.sha256 +5 -5
  76. package/templates/.agents/runtime/manifest.json +1 -1
  77. package/templates/.agents/runtime/provenance.json +4 -4
  78. package/templates/.agents/runtime/sbom.cdx.json +1 -1
  79. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract.mjs +11 -2
  80. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract.test.mjs +26 -0
  81. package/templates/.agents/zaip-aios/VERSION +1 -1
  82. package/templates/.agents/zaip-aios/guides/14-troubleshooting.md +1 -1
  83. package/templates/template-manifest.json +70 -70
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-Bh1tDfsg.js";import{C as t,E as n,S as r,c as i,d as a,f as o,l as s,m as c,p as l,s as u,u as d,w as f,x as p}from"./cost-monitor-C8zQDBT7.js";import{a as m,c as h,d as g,f as _,i as v,l as y,m as b,n as x,o as S,p as C,r as w,s as T,t as E,u as D}from"./icons-vendor-iMPXot7Y.js";var O=e(n(),1),k=f();function A({ariaLabel:e,closeLabel:t,document:n,onClose:r}){return(0,k.jsxs)(`section`,{"aria-label":e,"aria-modal":`true`,className:`trace-document`,role:`dialog`,children:[(0,k.jsxs)(`header`,{children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`small`,{children:n.path}),(0,k.jsx)(`h2`,{children:n.title})]}),(0,k.jsx)(`button`,{"aria-label":t,className:`trace-close-button`,onClick:r,type:`button`,children:(0,k.jsx)(u,{"aria-hidden":`true`,size:20,strokeWidth:2})})]}),(0,k.jsx)(`pre`,{children:n.content})]})}function j({stage:e,stageRecord:t,documents:n,stageCopy:r,stageArtifacts:i,copy:a,onBack:o,onOpenDocument:s,onStageChange:u}){let d=[`definition`,`planning`,`execution`,`decisions`,`verification`,`evidence`],f=d.indexOf(e),p=d[f-1],h=d[f+1],g=n.filter(e=>e.kind===`evidence`).length,_=new Set(n.map(e=>e.kind)).size,v=new Map;for(let e of n)v.set(e.kind,[...v.get(e.kind)??[],e]);let y=t?.last_recorded_at??a.pending;return(0,k.jsxs)(`section`,{className:`trace-stage-detail`,children:[(0,k.jsx)(`header`,{children:(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`p`,{children:r[e].label}),(0,k.jsx)(`h3`,{children:i[e]}),(0,k.jsx)(`small`,{children:y})]})}),(0,k.jsxs)(`div`,{className:`trace-stage-metrics`,children:[(0,k.jsxs)(`article`,{children:[(0,k.jsx)(`span`,{children:a.documents}),(0,k.jsx)(`strong`,{children:n.length})]}),(0,k.jsxs)(`article`,{children:[(0,k.jsx)(`span`,{children:a.types}),(0,k.jsx)(`strong`,{children:_})]}),(0,k.jsxs)(`article`,{children:[(0,k.jsx)(`span`,{children:a.evidenceMetric}),(0,k.jsx)(`strong`,{children:g})]})]}),(0,k.jsx)(`div`,{className:`trace-stage-documents`,children:n.length===0?(0,k.jsx)(`p`,{className:`trace-stage-empty`,children:a.empty}):[...v].map(([e,t])=>(0,k.jsxs)(`section`,{className:`trace-document-group`,children:[(0,k.jsxs)(`h4`,{children:[e,` `,(0,k.jsx)(`small`,{children:t.length})]}),t.map(e=>(0,k.jsxs)(`button`,{onClick:()=>s(e),type:`button`,children:[(0,k.jsx)(`strong`,{children:e.title}),(0,k.jsx)(`small`,{children:e.path})]},e.id))]},e))}),(0,k.jsxs)(`nav`,{"aria-label":a.navigation,className:`trace-stage-navigation`,children:[(0,k.jsxs)(`button`,{className:`trace-navigation-action trace-navigation-previous`,disabled:f===0,onClick:()=>u(d[f-1]),type:`button`,children:[(0,k.jsx)(c,{"aria-hidden":`true`,size:18,strokeWidth:1.9}),(0,k.jsxs)(`span`,{children:[(0,k.jsx)(`small`,{children:a.previous}),(0,k.jsx)(`strong`,{children:p?r[p].label.split(` (`)[0]:`—`})]})]}),(0,k.jsxs)(`div`,{className:`trace-navigation-center`,children:[(0,k.jsx)(`div`,{"aria-hidden":`true`,className:`trace-navigation-progress`,children:d.map((t,n)=>(0,k.jsx)(`span`,{"data-active":t===e,"data-passed":n<f},t))}),(0,k.jsxs)(`small`,{children:[f+1,` `,a.of,` `,d.length]}),(0,k.jsxs)(`button`,{className:`trace-all-stages-button`,onClick:o,type:`button`,children:[(0,k.jsx)(m,{"aria-hidden":`true`,size:15,strokeWidth:1.9}),a.back]})]}),(0,k.jsxs)(`button`,{className:`trace-navigation-action trace-navigation-next`,disabled:f===d.length-1,onClick:()=>u(d[f+1]),type:`button`,children:[(0,k.jsxs)(`span`,{children:[(0,k.jsx)(`small`,{children:a.next}),(0,k.jsx)(`strong`,{children:h?r[h].label.split(` (`)[0]:`—`})]}),(0,k.jsx)(l,{"aria-hidden":`true`,size:18,strokeWidth:1.9})]})]})]})}function M({ariaLabel:e,children:t,closeLabel:n,onClose:r}){return(0,O.useEffect)(()=>{let e=e=>{e.key===`Escape`&&r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r]),(0,k.jsxs)(`div`,{className:`trace-stage-dialog-backdrop`,role:`presentation`,children:[(0,k.jsx)(`button`,{"aria-label":n,className:`trace-stage-dialog-backdrop-dismiss`,onClick:r,type:`button`}),(0,k.jsxs)(`section`,{"aria-label":e,"aria-modal":`true`,className:`trace-stage-dialog`,role:`dialog`,children:[(0,k.jsx)(`button`,{"aria-label":n,className:`trace-stage-dialog-close`,onClick:r,type:`button`,children:(0,k.jsx)(u,{"aria-hidden":`true`,size:22})}),t]})]})}var N=[`definition`,`planning`,`execution`,`decisions`,`verification`,`evidence`],P=[`task`,`change`,`spec`,`prd`],F=[`coverage`,`documents`,`evidence`,`links`],I={"pt-BR":{lite:`Leve`,standard:`Padrão`,critical:`Crítico`},"en-US":{lite:`Lite`,standard:`Standard`,critical:`Critical`}},L={definition:D,planning:d,execution:w,decisions:S,verification:x,evidence:h},R={definition:`PRD · Requisitos`,planning:`SPEC · Change`,execution:`Tarefas · DAG · Runs · arquivos`,decisions:`Decisões do planejamento e da execução`,verification:`Testes · revisões · evals · checks`,evidence:`Evidências · resultados · rastreabilidade`},z={definition:`PRD · Requirements`,planning:`SPEC · Change`,execution:`Tasks · DAG · Runs · files`,decisions:`Planning and execution decisions`,verification:`Tests · reviews · evals · checks`,evidence:`Evidence · results · traceability`};function B(e,t){return[{label:`Task`,value:e.task_id,onOpen:void 0},{label:`Change`,value:e.change_id,onOpen:t.onOpenChange},{label:`SPEC`,value:e.spec_id,onOpen:t.onOpenSpec},{label:`PRD`,value:e.prd_id,onOpen:t.onOpenPrd}]}var V={definition:{label:`Definição (PRD + Requisitos)`,description:`Objetivo, contexto e critérios que definem o trabalho.`},planning:{label:`Planejamento (SPEC + Change)`,description:`Escopo, solução e mudanças previstas antes da execução.`},execution:{label:`Execução (Tarefas ou DAG)`,description:`Tarefas, dependências da DAG, Runs e arquivos produzidos.`},decisions:{label:`Decisões (Plano e Execução)`,description:`Decisões humanas e da IA tomadas no planejamento e na execução.`},verification:{label:`Verificação (Testes + Revisões)`,description:`Testes, revisões, evals e checks comparam o resultado aos Critérios de Aceite.`},evidence:{label:`Evidências (Resultados + Rastreabilidade)`,description:`Provas reproduzíveis vinculadas às Tasks, Changes, Runs e Critérios de Aceite.`}},H={definition:{label:`Definition (PRD + Requirements)`,description:`Objective, context, and criteria that define the work.`},planning:{label:`Planning (SPEC + Change)`,description:`Scope, solution, and changes planned before execution.`},execution:{label:`Execution (Tasks or DAG)`,description:`Tasks, DAG dependencies, Runs, and produced files.`},decisions:{label:`Decisions (Plan and Execution)`,description:`Human and AI decisions made during planning and execution.`},verification:{label:`Verification (Tests + Reviews)`,description:`Tests, reviews, evals, and checks compare results with acceptance criteria.`},evidence:{label:`Evidence (Results + Traceability)`,description:`Reproducible proof linked to Tasks, Changes, Runs, and acceptance criteria.`}},U={"pt-BR":{aria:`Rastreabilidade da task`,coverage:`etapas rastreadas`,evidence:`evidências`,close:`Fechar`,empty:`Nenhum documento relacionado.`,closeDocument:`Fechar documento`,back:`Voltar às etapas`,previous:`Anterior`,next:`Próxima`,documents:`Documentos`,types:`Tipos`,evidenceMetric:`Evidências`,taskFirst:`Task-first`,specDriven:`Spec-driven`,copyId:`Copiar ID`,copied:`ID copiado`,unlinked:`Não vinculado`,recorded:`Registrada em`,pending:`Pendente`,missingTimestamp:`Sem data/hora`,tests:`testes registrados`,time:`Tempo`,tokens:`Tokens`,cost:`Custo`,measuredRuns:`Runs medidas`,items:`itens`,navigation:`Navegação entre etapas`,of:`de`,stageDetails:`Detalhes da etapa`,document:`Documento`},"en-US":{aria:`Task traceability`,coverage:`tracked stages`,evidence:`evidence items`,close:`Close`,empty:`No related document.`,closeDocument:`Close document`,back:`Back to stages`,previous:`Previous`,next:`Next`,documents:`Documents`,types:`Types`,evidenceMetric:`Evidence`,taskFirst:`Task-first`,specDriven:`Spec-driven`,copyId:`Copy ID`,copied:`ID copied`,unlinked:`Not linked`,recorded:`Recorded at`,pending:`Pending`,missingTimestamp:`Missing date/time`,tests:`recorded tests`,time:`Time`,tokens:`Tokens`,cost:`Cost`,measuredRuns:`measured Runs`,items:`items`,navigation:`Stage navigation`,of:`of`,stageDetails:`Stage details`,document:`Document`}};function W({taskId:e,locale:t=`pt-BR`}){let n=t===`pt-BR`;return(0,k.jsx)(`div`,{className:`trace-backdrop`,children:(0,k.jsxs)(`section`,{"aria-busy":`true`,"aria-label":n?`Carregando rastreabilidade`:`Loading traceability`,"aria-live":`polite`,className:`trace-panel trace-loading-panel`,role:`dialog`,children:[(0,k.jsxs)(`header`,{className:`trace-panel-header`,children:[(0,k.jsxs)(`div`,{className:`trace-heading`,children:[(0,k.jsx)(`span`,{className:`trace-heading-icon trace-loading-icon`,"aria-hidden":`true`,children:(0,k.jsx)(s,{size:22,strokeWidth:1.8})}),(0,k.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,k.jsx)(`h2`,{children:n?`Carregando rastreabilidade`:`Loading traceability`}),(0,k.jsx)(`p`,{children:e})]})]}),(0,k.jsxs)(`span`,{className:`trace-loading-status`,children:[(0,k.jsx)(s,{"aria-hidden":`true`,size:15,strokeWidth:2}),n?`Preparando trace`:`Preparing trace`]})]}),(0,k.jsx)(`div`,{className:`trace-loading-identifiers`,"aria-hidden":`true`,children:P.map(e=>(0,k.jsx)(`span`,{},e))}),(0,k.jsx)(`div`,{className:`trace-loading-metrics`,"aria-hidden":`true`,children:F.map(e=>(0,k.jsx)(`span`,{},e))}),(0,k.jsx)(`div`,{className:`trace-loading-stages`,"aria-hidden":`true`,children:N.map(e=>(0,k.jsx)(`span`,{},e))})]})})}function G({trace:e,locale:t=`pt-BR`,onClose:n,onOpenChange:r,onOpenPrd:s,onOpenSpec:c,embedded:d=!1}){let[f,p]=(0,O.useState)(null),[m,h]=(0,O.useState)(null),[S,w]=(0,O.useState)(!1),D=U[t],P=t===`en-US`?H:V,F=t===`en-US`?z:R,W=(0,O.useMemo)(()=>new Map(N.map(t=>[t,e.documents.filter(e=>e.stage===t)])),[e.documents]),G=(0,O.useMemo)(()=>new Map(e.stages.map(e=>[e.stage,e])),[e.stages]),q=Math.round(e.coverage.stages_with_timestamps/e.coverage.total_stages*100),X=[e.task_id,e.change_id,e.spec_id,e.prd_id].filter(Boolean).length,Z=B(e,{onOpenChange:r,onOpenPrd:s,onOpenSpec:c}),Q=J(e.task_created_at,t),$=Y(e.task_created_at,t),ee=async()=>{try{await navigator.clipboard.writeText(e.task_id),w(!0),window.setTimeout(()=>w(!1),2e3)}catch{w(!1)}};return(0,k.jsxs)(`div`,{className:d?`trace-embedded`:`trace-backdrop`,children:[(0,k.jsxs)(`section`,{"aria-label":D.aria,"aria-modal":d?void 0:`true`,className:`trace-panel`,role:`dialog`,children:[(0,k.jsxs)(`header`,{className:`trace-panel-header`,children:[(0,k.jsxs)(`div`,{className:`trace-heading`,children:[(0,k.jsx)(`span`,{className:`trace-heading-icon`,"aria-hidden":`true`,children:(0,k.jsx)(i,{size:22,strokeWidth:1.8})}),(0,k.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,k.jsx)(`div`,{className:`trace-heading-title`,children:(0,k.jsxs)(`h2`,{children:[(0,k.jsx)(`span`,{className:`trace-title-prefix`,children:`Trace:`}),` `,e.task_title||e.task_id]})}),(0,k.jsx)(`p`,{children:t===`pt-BR`?`Visão completa do ciclo de desenvolvimento`:`Complete development lifecycle view`})]})]}),(0,k.jsxs)(`div`,{className:`trace-header-actions`,children:[(0,k.jsx)(K,{copy:D,locale:t,usage:e.usage}),d?null:(0,k.jsx)(`button`,{className:`trace-close-button`,"aria-label":D.close,onClick:n,type:`button`,children:(0,k.jsx)(u,{"aria-hidden":`true`,size:20,strokeWidth:2})})]})]}),(0,k.jsxs)(`section`,{className:`trace-task-summary`,"aria-label":t===`pt-BR`?`Resumo da tarefa`:`Task summary`,children:[(0,k.jsxs)(`article`,{children:[(0,k.jsx)(C,{"aria-hidden":`true`,size:17,strokeWidth:1.8}),(0,k.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,k.jsx)(`span`,{children:t===`pt-BR`?`Criada em`:`Created at`}),(0,k.jsx)(`strong`,{children:Q})]})]}),(0,k.jsxs)(`article`,{children:[(0,k.jsx)(a,{"aria-hidden":`true`,size:17,strokeWidth:1.8}),(0,k.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,k.jsx)(`span`,{children:t===`pt-BR`?`Desde a criação`:`Since creation`}),(0,k.jsx)(`strong`,{children:$})]})]}),(0,k.jsxs)(`article`,{className:`trace-task-progress`,children:[(0,k.jsx)(g,{"aria-hidden":`true`,size:17,strokeWidth:1.8}),(0,k.jsxs)(`div`,{className:`trace-task-summary-content trace-task-progress-content`,children:[(0,k.jsx)(`span`,{children:t===`pt-BR`?`Progresso`:`Progress`}),(0,k.jsxs)(`strong`,{children:[e.task_progress,`%`]}),(0,k.jsx)(`progress`,{max:100,value:e.task_progress})]})]}),(0,k.jsxs)(`article`,{className:`trace-task-classification`,children:[(0,k.jsx)(b,{"aria-hidden":`true`,size:17,strokeWidth:1.8}),(0,k.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,k.jsx)(`span`,{children:t===`pt-BR`?`Classificação`:`Classification`}),(0,k.jsxs)(`div`,{className:`trace-task-badges`,children:[(0,k.jsxs)(`span`,{className:`trace-mode-badge`,children:[(0,k.jsx)(E,{"aria-hidden":`true`,size:12,strokeWidth:2}),e.spec_id===null?D.taskFirst:D.specDriven]}),e.task_risk?(0,k.jsxs)(`span`,{className:`trace-risk-badge`,"data-risk":e.task_risk,children:[(0,k.jsx)(x,{"aria-hidden":`true`,size:12,strokeWidth:2}),I[t][e.task_risk]]}):null]})]})]})]}),(0,k.jsx)(`section`,{className:`trace-overview trace-lineage`,"aria-label":t===`pt-BR`?`Identificadores vinculados`:`Linked identifiers`,children:Z.map(({label:e,value:n,onOpen:r})=>{let i=n!==null&&r!==void 0,a=e===`Task`&&n!==null,o=(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`trace-identifier-content`,children:[(0,k.jsxs)(`span`,{children:[(0,k.jsx)(v,{"aria-hidden":`true`,size:11,strokeWidth:2}),e]}),(0,k.jsx)(`strong`,{title:n??D.unlinked,children:n??D.unlinked})]}),a?(0,k.jsx)(`button`,{"aria-label":S?t===`pt-BR`?`ID da tarefa copiado`:`Task ID copied`:t===`pt-BR`?`Copiar ID da tarefa`:`Copy task ID`,className:`trace-identifier-copy`,onClick:()=>void ee(),title:S?t===`pt-BR`?`Copiado`:`Copied`:void 0,type:`button`,children:S?(0,k.jsx)(_,{"aria-hidden":`true`,size:15}):(0,k.jsx)(y,{"aria-hidden":`true`,size:15})}):null,i?(0,k.jsx)(l,{"aria-hidden":`true`,size:15,strokeWidth:1.9}):null]});return(0,k.jsx)(`article`,{"data-empty":n===null,"data-linked":n!==null,"data-navigable":i,children:i?(0,k.jsx)(`button`,{"aria-label":`${t===`pt-BR`?`Abrir`:`Open`} ${e}: ${n}`,className:`trace-identifier-navigation`,onClick:()=>r(n),type:`button`,children:o}):(0,k.jsx)(`div`,{className:`trace-identifier-static`,children:o})},e)})}),(0,k.jsxs)(`section`,{className:`trace-metrics`,"aria-label":t===`pt-BR`?`Resumo da rastreabilidade`:`Traceability summary`,children:[(0,k.jsxs)(`article`,{children:[(0,k.jsx)(`span`,{className:`trace-metric-icon`,children:(0,k.jsx)(i,{"aria-hidden":`true`,size:18})}),(0,k.jsxs)(`div`,{children:[(0,k.jsxs)(`strong`,{children:[q,`%`]}),(0,k.jsx)(`span`,{children:D.coverage})]}),(0,k.jsxs)(`small`,{children:[e.coverage.stages_with_timestamps,` `,D.of,` `,e.coverage.total_stages]})]}),(0,k.jsxs)(`article`,{children:[(0,k.jsx)(`span`,{className:`trace-metric-icon`,children:(0,k.jsx)(T,{"aria-hidden":`true`,size:18})}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`strong`,{children:e.documents.length}),(0,k.jsx)(`span`,{children:D.documents})]}),(0,k.jsx)(`small`,{children:t===`pt-BR`?`no ciclo completo`:`in the full lifecycle`})]}),(0,k.jsxs)(`article`,{children:[(0,k.jsx)(`span`,{className:`trace-metric-icon`,children:(0,k.jsx)(b,{"aria-hidden":`true`,size:18})}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`strong`,{children:e.coverage.evidence_count}),(0,k.jsx)(`span`,{children:D.evidenceMetric})]}),(0,k.jsxs)(`small`,{children:[e.coverage.test_count,` `,D.tests]})]}),(0,k.jsxs)(`article`,{children:[(0,k.jsx)(`span`,{className:`trace-metric-icon`,children:(0,k.jsx)(v,{"aria-hidden":`true`,size:18})}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`strong`,{children:X}),(0,k.jsx)(`span`,{children:t===`pt-BR`?`Vínculos`:`Links`})]}),(0,k.jsx)(`small`,{children:`Task · Change · SPEC · PRD`})]})]}),(0,k.jsx)(`div`,{className:`trace-stage-menu`,children:N.map((e,n)=>{let r=L[e],i=(W.get(e)??[]).length;return(0,k.jsxs)(`button`,{className:`trace-stage-menu-button`,"data-stage":e,onClick:()=>h(e),type:`button`,children:[(0,k.jsx)(`span`,{className:`trace-stage-number`,children:String(n+1).padStart(2,`0`)}),(0,k.jsx)(r,{className:`trace-stage-icon`,"aria-hidden":`true`,size:22,strokeWidth:1.8}),(0,k.jsx)(`strong`,{children:P[e].label}),(0,k.jsx)(`em`,{children:P[e].description}),(0,k.jsxs)(`span`,{className:`trace-stage-action`,children:[(0,k.jsxs)(`small`,{children:[(0,k.jsx)(o,{"aria-hidden":`true`,size:13}),` `,i,` `,D.items]}),(0,k.jsxs)(`span`,{children:[t===`pt-BR`?`Ver etapa`:`View stage`,(0,k.jsx)(l,{"aria-hidden":`true`,size:13,strokeWidth:2})]})]})]},e)})})]}),m?(0,k.jsx)(M,{ariaLabel:D.stageDetails,closeLabel:t===`pt-BR`?`Fechar detalhes da etapa`:`Close stage details`,onClose:()=>h(null),children:(0,k.jsx)(j,{copy:D,documents:W.get(m)??[],locale:t,onBack:()=>h(null),onOpenDocument:p,onStageChange:h,stage:m,stageArtifacts:F,stageRecord:G.get(m),stageCopy:P})}):null,f?(0,k.jsx)(A,{ariaLabel:`${D.document} ${f.title}`,closeLabel:D.closeDocument,document:f,onClose:()=>p(null)}):null]})}function K({usage:e,locale:t,copy:n}){let i=[{label:n.time,metric:e.duration_ms,value:q(e.duration_ms.value,t)},{label:n.tokens,metric:e.total_tokens,value:e.total_tokens.value===null?`—`:p(e.total_tokens.value,t)},{label:n.cost,metric:e.cost,value:e.cost.value===null||e.cost.currency===null?`—`:r(e.cost.value,e.cost.currency,t)}];return(0,k.jsx)(`section`,{"aria-label":t===`pt-BR`?`Uso agregado da Task`:`Aggregated Task usage`,children:(0,k.jsx)(`dl`,{className:`trace-usage-strip`,children:i.map(({label:t,metric:r,value:i})=>{let a=Math.round(r.coverage_ratio*100),o=`${r.known_runs}/${e.run_count} ${n.measuredRuns} · ${a}%`;return(0,k.jsxs)(`div`,{title:o,children:[(0,k.jsxs)(`dt`,{children:[t,(0,k.jsx)(`span`,{"aria-hidden":`true`,className:`trace-usage-coverage`,"data-complete":r.unknown_runs===0}),(0,k.jsx)(`span`,{className:`trace-usage-sr-only`,children:o})]}),(0,k.jsx)(`dd`,{children:i})]},t)})})})}function q(e,n){return e===null?`—`:t(e,n)}function J(e,t){if(e===null)return`—`;let n=new Date(e);return Number.isNaN(n.getTime())?`—`:new Intl.DateTimeFormat(t,{dateStyle:`short`,timeStyle:`short`}).format(n)}function Y(e,t){if(e===null)return`—`;let n=Date.parse(e);if(!Number.isFinite(n))return`—`;let r=Math.max(0,Date.now()-n),i=Math.max(1,Math.round(r/6e4)),a;if(i<60)a=`${i}m`;else{let e=Math.round(i/60);if(e<24)a=`${e}h`;else{let n=Math.round(e/24);if(n<7)a=`${n}d`;else{let e=Math.round(n/7);a=t===`pt-BR`?`${e}sem`:`${e}w`}}}return t===`pt-BR`?`Há ${a}`:`${a} ago`}export{G as n,W as t};
1
+ import{n as e}from"./rolldown-runtime-Bh1tDfsg.js";import{C as t,E as n,S as r,c as i,d as a,f as o,l as s,m as c,p as l,s as u,u as d,w as f,x as p}from"./cost-monitor-Co2Jiuzh.js";import{a as m,c as h,d as g,f as _,i as v,l as y,m as b,n as x,o as S,p as C,r as w,s as T,t as E,u as D}from"./icons-vendor-DOhy6D2-.js";var O=e(n(),1),k=f();function A({ariaLabel:e,closeLabel:t,document:n,onClose:r}){return(0,k.jsxs)(`section`,{"aria-label":e,"aria-modal":`true`,className:`trace-document`,role:`dialog`,children:[(0,k.jsxs)(`header`,{children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`small`,{children:n.path}),(0,k.jsx)(`h2`,{children:n.title})]}),(0,k.jsx)(`button`,{"aria-label":t,className:`trace-close-button`,onClick:r,type:`button`,children:(0,k.jsx)(u,{"aria-hidden":`true`,size:20,strokeWidth:2})})]}),(0,k.jsx)(`pre`,{children:n.content})]})}function j({stage:e,stageRecord:t,documents:n,stageCopy:r,stageArtifacts:i,copy:a,onBack:o,onOpenDocument:s,onStageChange:u}){let d=[`definition`,`planning`,`execution`,`decisions`,`verification`,`evidence`],f=d.indexOf(e),p=d[f-1],h=d[f+1],g=n.filter(e=>e.kind===`evidence`).length,_=new Set(n.map(e=>e.kind)).size,v=new Map;for(let e of n)v.set(e.kind,[...v.get(e.kind)??[],e]);let y=t?.last_recorded_at??a.pending;return(0,k.jsxs)(`section`,{className:`trace-stage-detail`,children:[(0,k.jsx)(`header`,{children:(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`p`,{children:r[e].label}),(0,k.jsx)(`h3`,{children:i[e]}),(0,k.jsx)(`small`,{children:y})]})}),(0,k.jsxs)(`div`,{className:`trace-stage-metrics`,children:[(0,k.jsxs)(`article`,{children:[(0,k.jsx)(`span`,{children:a.documents}),(0,k.jsx)(`strong`,{children:n.length})]}),(0,k.jsxs)(`article`,{children:[(0,k.jsx)(`span`,{children:a.types}),(0,k.jsx)(`strong`,{children:_})]}),(0,k.jsxs)(`article`,{children:[(0,k.jsx)(`span`,{children:a.evidenceMetric}),(0,k.jsx)(`strong`,{children:g})]})]}),(0,k.jsx)(`div`,{className:`trace-stage-documents`,children:n.length===0?(0,k.jsx)(`p`,{className:`trace-stage-empty`,children:a.empty}):[...v].map(([e,t])=>(0,k.jsxs)(`section`,{className:`trace-document-group`,children:[(0,k.jsxs)(`h4`,{children:[e,` `,(0,k.jsx)(`small`,{children:t.length})]}),t.map(e=>(0,k.jsxs)(`button`,{onClick:()=>s(e),type:`button`,children:[(0,k.jsx)(`strong`,{children:e.title}),(0,k.jsx)(`small`,{children:e.path})]},e.id))]},e))}),(0,k.jsxs)(`nav`,{"aria-label":a.navigation,className:`trace-stage-navigation`,children:[(0,k.jsxs)(`button`,{className:`trace-navigation-action trace-navigation-previous`,disabled:f===0,onClick:()=>u(d[f-1]),type:`button`,children:[(0,k.jsx)(c,{"aria-hidden":`true`,size:18,strokeWidth:1.9}),(0,k.jsxs)(`span`,{children:[(0,k.jsx)(`small`,{children:a.previous}),(0,k.jsx)(`strong`,{children:p?r[p].label.split(` (`)[0]:`—`})]})]}),(0,k.jsxs)(`div`,{className:`trace-navigation-center`,children:[(0,k.jsx)(`div`,{"aria-hidden":`true`,className:`trace-navigation-progress`,children:d.map((t,n)=>(0,k.jsx)(`span`,{"data-active":t===e,"data-passed":n<f},t))}),(0,k.jsxs)(`small`,{children:[f+1,` `,a.of,` `,d.length]}),(0,k.jsxs)(`button`,{className:`trace-all-stages-button`,onClick:o,type:`button`,children:[(0,k.jsx)(m,{"aria-hidden":`true`,size:15,strokeWidth:1.9}),a.back]})]}),(0,k.jsxs)(`button`,{className:`trace-navigation-action trace-navigation-next`,disabled:f===d.length-1,onClick:()=>u(d[f+1]),type:`button`,children:[(0,k.jsxs)(`span`,{children:[(0,k.jsx)(`small`,{children:a.next}),(0,k.jsx)(`strong`,{children:h?r[h].label.split(` (`)[0]:`—`})]}),(0,k.jsx)(l,{"aria-hidden":`true`,size:18,strokeWidth:1.9})]})]})]})}function M({ariaLabel:e,children:t,closeLabel:n,onClose:r}){return(0,O.useEffect)(()=>{let e=e=>{e.key===`Escape`&&r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r]),(0,k.jsxs)(`div`,{className:`trace-stage-dialog-backdrop`,role:`presentation`,children:[(0,k.jsx)(`button`,{"aria-label":n,className:`trace-stage-dialog-backdrop-dismiss`,onClick:r,type:`button`}),(0,k.jsxs)(`section`,{"aria-label":e,"aria-modal":`true`,className:`trace-stage-dialog`,role:`dialog`,children:[(0,k.jsx)(`button`,{"aria-label":n,className:`trace-stage-dialog-close`,onClick:r,type:`button`,children:(0,k.jsx)(u,{"aria-hidden":`true`,size:22})}),t]})]})}var N=[`definition`,`planning`,`execution`,`decisions`,`verification`,`evidence`],P=[`task`,`change`,`spec`,`prd`],F=[`coverage`,`documents`,`evidence`,`links`],I={"pt-BR":{lite:`Leve`,standard:`Padrão`,critical:`Crítico`},"en-US":{lite:`Lite`,standard:`Standard`,critical:`Critical`}},L={definition:D,planning:d,execution:w,decisions:S,verification:x,evidence:h},R={definition:`PRD · Requisitos`,planning:`SPEC · Change`,execution:`Tarefas · DAG · Runs · arquivos`,decisions:`Decisões do planejamento e da execução`,verification:`Testes · revisões · evals · checks`,evidence:`Evidências · resultados · rastreabilidade`},z={definition:`PRD · Requirements`,planning:`SPEC · Change`,execution:`Tasks · DAG · Runs · files`,decisions:`Planning and execution decisions`,verification:`Tests · reviews · evals · checks`,evidence:`Evidence · results · traceability`};function B(e,t){return[{label:`Task`,value:e.task_id,onOpen:void 0},{label:`Change`,value:e.change_id,onOpen:t.onOpenChange},{label:`SPEC`,value:e.spec_id,onOpen:t.onOpenSpec},{label:`PRD`,value:e.prd_id,onOpen:t.onOpenPrd}]}var V={definition:{label:`Definição (PRD + Requisitos)`,description:`Objetivo, contexto e critérios que definem o trabalho.`},planning:{label:`Planejamento (SPEC + Change)`,description:`Escopo, solução e mudanças previstas antes da execução.`},execution:{label:`Execução (Tarefas ou DAG)`,description:`Tarefas, dependências da DAG, Runs e arquivos produzidos.`},decisions:{label:`Decisões (Plano e Execução)`,description:`Decisões humanas e da IA tomadas no planejamento e na execução.`},verification:{label:`Verificação (Testes + Revisões)`,description:`Testes, revisões, evals e checks comparam o resultado aos Critérios de Aceite.`},evidence:{label:`Evidências (Resultados + Rastreabilidade)`,description:`Provas reproduzíveis vinculadas às Tasks, Changes, Runs e Critérios de Aceite.`}},H={definition:{label:`Definition (PRD + Requirements)`,description:`Objective, context, and criteria that define the work.`},planning:{label:`Planning (SPEC + Change)`,description:`Scope, solution, and changes planned before execution.`},execution:{label:`Execution (Tasks or DAG)`,description:`Tasks, DAG dependencies, Runs, and produced files.`},decisions:{label:`Decisions (Plan and Execution)`,description:`Human and AI decisions made during planning and execution.`},verification:{label:`Verification (Tests + Reviews)`,description:`Tests, reviews, evals, and checks compare results with acceptance criteria.`},evidence:{label:`Evidence (Results + Traceability)`,description:`Reproducible proof linked to Tasks, Changes, Runs, and acceptance criteria.`}},U={"pt-BR":{aria:`Rastreabilidade da task`,coverage:`etapas rastreadas`,evidence:`evidências`,close:`Fechar`,empty:`Nenhum documento relacionado.`,closeDocument:`Fechar documento`,back:`Voltar às etapas`,previous:`Anterior`,next:`Próxima`,documents:`Documentos`,types:`Tipos`,evidenceMetric:`Evidências`,taskFirst:`Task-first`,specDriven:`Spec-driven`,copyId:`Copiar ID`,copied:`ID copiado`,unlinked:`Não vinculado`,recorded:`Registrada em`,pending:`Pendente`,missingTimestamp:`Sem data/hora`,tests:`testes registrados`,time:`Tempo`,tokens:`Tokens`,cost:`Custo`,measuredRuns:`Runs medidas`,items:`itens`,navigation:`Navegação entre etapas`,of:`de`,stageDetails:`Detalhes da etapa`,document:`Documento`},"en-US":{aria:`Task traceability`,coverage:`tracked stages`,evidence:`evidence items`,close:`Close`,empty:`No related document.`,closeDocument:`Close document`,back:`Back to stages`,previous:`Previous`,next:`Next`,documents:`Documents`,types:`Types`,evidenceMetric:`Evidence`,taskFirst:`Task-first`,specDriven:`Spec-driven`,copyId:`Copy ID`,copied:`ID copied`,unlinked:`Not linked`,recorded:`Recorded at`,pending:`Pending`,missingTimestamp:`Missing date/time`,tests:`recorded tests`,time:`Time`,tokens:`Tokens`,cost:`Cost`,measuredRuns:`measured Runs`,items:`items`,navigation:`Stage navigation`,of:`of`,stageDetails:`Stage details`,document:`Document`}};function W({taskId:e,locale:t=`pt-BR`}){let n=t===`pt-BR`;return(0,k.jsx)(`div`,{className:`trace-backdrop`,children:(0,k.jsxs)(`section`,{"aria-busy":`true`,"aria-label":n?`Carregando rastreabilidade`:`Loading traceability`,"aria-live":`polite`,className:`trace-panel trace-loading-panel`,role:`dialog`,children:[(0,k.jsxs)(`header`,{className:`trace-panel-header`,children:[(0,k.jsxs)(`div`,{className:`trace-heading`,children:[(0,k.jsx)(`span`,{className:`trace-heading-icon trace-loading-icon`,"aria-hidden":`true`,children:(0,k.jsx)(s,{size:22,strokeWidth:1.8})}),(0,k.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,k.jsx)(`h2`,{children:n?`Carregando rastreabilidade`:`Loading traceability`}),(0,k.jsx)(`p`,{children:e})]})]}),(0,k.jsxs)(`span`,{className:`trace-loading-status`,children:[(0,k.jsx)(s,{"aria-hidden":`true`,size:15,strokeWidth:2}),n?`Preparando trace`:`Preparing trace`]})]}),(0,k.jsx)(`div`,{className:`trace-loading-identifiers`,"aria-hidden":`true`,children:P.map(e=>(0,k.jsx)(`span`,{},e))}),(0,k.jsx)(`div`,{className:`trace-loading-metrics`,"aria-hidden":`true`,children:F.map(e=>(0,k.jsx)(`span`,{},e))}),(0,k.jsx)(`div`,{className:`trace-loading-stages`,"aria-hidden":`true`,children:N.map(e=>(0,k.jsx)(`span`,{},e))})]})})}function G({trace:e,locale:t=`pt-BR`,onClose:n,onOpenChange:r,onOpenPrd:s,onOpenSpec:c,embedded:d=!1}){let[f,p]=(0,O.useState)(null),[m,h]=(0,O.useState)(null),[S,w]=(0,O.useState)(!1),D=U[t],P=t===`en-US`?H:V,F=t===`en-US`?z:R,W=(0,O.useMemo)(()=>new Map(N.map(t=>[t,e.documents.filter(e=>e.stage===t)])),[e.documents]),G=(0,O.useMemo)(()=>new Map(e.stages.map(e=>[e.stage,e])),[e.stages]),q=Math.round(e.coverage.stages_with_timestamps/e.coverage.total_stages*100),X=[e.task_id,e.change_id,e.spec_id,e.prd_id].filter(Boolean).length,Z=B(e,{onOpenChange:r,onOpenPrd:s,onOpenSpec:c}),Q=J(e.task_created_at,t),$=Y(e.task_created_at,t),ee=async()=>{try{await navigator.clipboard.writeText(e.task_id),w(!0),window.setTimeout(()=>w(!1),2e3)}catch{w(!1)}};return(0,k.jsxs)(`div`,{className:d?`trace-embedded`:`trace-backdrop`,children:[(0,k.jsxs)(`section`,{"aria-label":D.aria,"aria-modal":d?void 0:`true`,className:`trace-panel`,role:`dialog`,children:[(0,k.jsxs)(`header`,{className:`trace-panel-header`,children:[(0,k.jsxs)(`div`,{className:`trace-heading`,children:[(0,k.jsx)(`span`,{className:`trace-heading-icon`,"aria-hidden":`true`,children:(0,k.jsx)(i,{size:22,strokeWidth:1.8})}),(0,k.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,k.jsx)(`div`,{className:`trace-heading-title`,children:(0,k.jsxs)(`h2`,{children:[(0,k.jsx)(`span`,{className:`trace-title-prefix`,children:`Trace:`}),` `,e.task_title||e.task_id]})}),(0,k.jsx)(`p`,{children:t===`pt-BR`?`Visão completa do ciclo de desenvolvimento`:`Complete development lifecycle view`})]})]}),(0,k.jsxs)(`div`,{className:`trace-header-actions`,children:[(0,k.jsx)(K,{copy:D,locale:t,usage:e.usage}),d?null:(0,k.jsx)(`button`,{className:`trace-close-button`,"aria-label":D.close,onClick:n,type:`button`,children:(0,k.jsx)(u,{"aria-hidden":`true`,size:20,strokeWidth:2})})]})]}),(0,k.jsxs)(`section`,{className:`trace-task-summary`,"aria-label":t===`pt-BR`?`Resumo da tarefa`:`Task summary`,children:[(0,k.jsxs)(`article`,{children:[(0,k.jsx)(C,{"aria-hidden":`true`,size:17,strokeWidth:1.8}),(0,k.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,k.jsx)(`span`,{children:t===`pt-BR`?`Criada em`:`Created at`}),(0,k.jsx)(`strong`,{children:Q})]})]}),(0,k.jsxs)(`article`,{children:[(0,k.jsx)(a,{"aria-hidden":`true`,size:17,strokeWidth:1.8}),(0,k.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,k.jsx)(`span`,{children:t===`pt-BR`?`Desde a criação`:`Since creation`}),(0,k.jsx)(`strong`,{children:$})]})]}),(0,k.jsxs)(`article`,{className:`trace-task-progress`,children:[(0,k.jsx)(g,{"aria-hidden":`true`,size:17,strokeWidth:1.8}),(0,k.jsxs)(`div`,{className:`trace-task-summary-content trace-task-progress-content`,children:[(0,k.jsx)(`span`,{children:t===`pt-BR`?`Progresso`:`Progress`}),(0,k.jsxs)(`strong`,{children:[e.task_progress,`%`]}),(0,k.jsx)(`progress`,{max:100,value:e.task_progress})]})]}),(0,k.jsxs)(`article`,{className:`trace-task-classification`,children:[(0,k.jsx)(b,{"aria-hidden":`true`,size:17,strokeWidth:1.8}),(0,k.jsxs)(`div`,{className:`trace-task-summary-content`,children:[(0,k.jsx)(`span`,{children:t===`pt-BR`?`Classificação`:`Classification`}),(0,k.jsxs)(`div`,{className:`trace-task-badges`,children:[(0,k.jsxs)(`span`,{className:`trace-mode-badge`,children:[(0,k.jsx)(E,{"aria-hidden":`true`,size:12,strokeWidth:2}),e.spec_id===null?D.taskFirst:D.specDriven]}),e.task_risk?(0,k.jsxs)(`span`,{className:`trace-risk-badge`,"data-risk":e.task_risk,children:[(0,k.jsx)(x,{"aria-hidden":`true`,size:12,strokeWidth:2}),I[t][e.task_risk]]}):null]})]})]})]}),(0,k.jsx)(`section`,{className:`trace-overview trace-lineage`,"aria-label":t===`pt-BR`?`Identificadores vinculados`:`Linked identifiers`,children:Z.map(({label:e,value:n,onOpen:r})=>{let i=n!==null&&r!==void 0,a=e===`Task`&&n!==null,o=(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`trace-identifier-content`,children:[(0,k.jsxs)(`span`,{children:[(0,k.jsx)(v,{"aria-hidden":`true`,size:11,strokeWidth:2}),e]}),(0,k.jsx)(`strong`,{title:n??D.unlinked,children:n??D.unlinked})]}),a?(0,k.jsx)(`button`,{"aria-label":S?t===`pt-BR`?`ID da tarefa copiado`:`Task ID copied`:t===`pt-BR`?`Copiar ID da tarefa`:`Copy task ID`,className:`trace-identifier-copy`,onClick:()=>void ee(),title:S?t===`pt-BR`?`Copiado`:`Copied`:void 0,type:`button`,children:S?(0,k.jsx)(_,{"aria-hidden":`true`,size:15}):(0,k.jsx)(y,{"aria-hidden":`true`,size:15})}):null,i?(0,k.jsx)(l,{"aria-hidden":`true`,size:15,strokeWidth:1.9}):null]});return(0,k.jsx)(`article`,{"data-empty":n===null,"data-linked":n!==null,"data-navigable":i,children:i?(0,k.jsx)(`button`,{"aria-label":`${t===`pt-BR`?`Abrir`:`Open`} ${e}: ${n}`,className:`trace-identifier-navigation`,onClick:()=>r(n),type:`button`,children:o}):(0,k.jsx)(`div`,{className:`trace-identifier-static`,children:o})},e)})}),(0,k.jsxs)(`section`,{className:`trace-metrics`,"aria-label":t===`pt-BR`?`Resumo da rastreabilidade`:`Traceability summary`,children:[(0,k.jsxs)(`article`,{children:[(0,k.jsx)(`span`,{className:`trace-metric-icon`,children:(0,k.jsx)(i,{"aria-hidden":`true`,size:18})}),(0,k.jsxs)(`div`,{children:[(0,k.jsxs)(`strong`,{children:[q,`%`]}),(0,k.jsx)(`span`,{children:D.coverage})]}),(0,k.jsxs)(`small`,{children:[e.coverage.stages_with_timestamps,` `,D.of,` `,e.coverage.total_stages]})]}),(0,k.jsxs)(`article`,{children:[(0,k.jsx)(`span`,{className:`trace-metric-icon`,children:(0,k.jsx)(T,{"aria-hidden":`true`,size:18})}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`strong`,{children:e.documents.length}),(0,k.jsx)(`span`,{children:D.documents})]}),(0,k.jsx)(`small`,{children:t===`pt-BR`?`no ciclo completo`:`in the full lifecycle`})]}),(0,k.jsxs)(`article`,{children:[(0,k.jsx)(`span`,{className:`trace-metric-icon`,children:(0,k.jsx)(b,{"aria-hidden":`true`,size:18})}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`strong`,{children:e.coverage.evidence_count}),(0,k.jsx)(`span`,{children:D.evidenceMetric})]}),(0,k.jsxs)(`small`,{children:[e.coverage.test_count,` `,D.tests]})]}),(0,k.jsxs)(`article`,{children:[(0,k.jsx)(`span`,{className:`trace-metric-icon`,children:(0,k.jsx)(v,{"aria-hidden":`true`,size:18})}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`strong`,{children:X}),(0,k.jsx)(`span`,{children:t===`pt-BR`?`Vínculos`:`Links`})]}),(0,k.jsx)(`small`,{children:`Task · Change · SPEC · PRD`})]})]}),(0,k.jsx)(`div`,{className:`trace-stage-menu`,children:N.map((e,n)=>{let r=L[e],i=(W.get(e)??[]).length;return(0,k.jsxs)(`button`,{className:`trace-stage-menu-button`,"data-stage":e,onClick:()=>h(e),type:`button`,children:[(0,k.jsx)(`span`,{className:`trace-stage-number`,children:String(n+1).padStart(2,`0`)}),(0,k.jsx)(r,{className:`trace-stage-icon`,"aria-hidden":`true`,size:22,strokeWidth:1.8}),(0,k.jsx)(`strong`,{children:P[e].label}),(0,k.jsx)(`em`,{children:P[e].description}),(0,k.jsxs)(`span`,{className:`trace-stage-action`,children:[(0,k.jsxs)(`small`,{children:[(0,k.jsx)(o,{"aria-hidden":`true`,size:13}),` `,i,` `,D.items]}),(0,k.jsxs)(`span`,{children:[t===`pt-BR`?`Ver etapa`:`View stage`,(0,k.jsx)(l,{"aria-hidden":`true`,size:13,strokeWidth:2})]})]})]},e)})})]}),m?(0,k.jsx)(M,{ariaLabel:D.stageDetails,closeLabel:t===`pt-BR`?`Fechar detalhes da etapa`:`Close stage details`,onClose:()=>h(null),children:(0,k.jsx)(j,{copy:D,documents:W.get(m)??[],locale:t,onBack:()=>h(null),onOpenDocument:p,onStageChange:h,stage:m,stageArtifacts:F,stageRecord:G.get(m),stageCopy:P})}):null,f?(0,k.jsx)(A,{ariaLabel:`${D.document} ${f.title}`,closeLabel:D.closeDocument,document:f,onClose:()=>p(null)}):null]})}function K({usage:e,locale:t,copy:n}){let i=[{label:n.time,metric:e.duration_ms,value:q(e.duration_ms.value,t)},{label:n.tokens,metric:e.total_tokens,value:e.total_tokens.value===null?`—`:p(e.total_tokens.value,t)},{label:n.cost,metric:e.cost,value:e.cost.value===null||e.cost.currency===null?`—`:r(e.cost.value,e.cost.currency,t)}];return(0,k.jsx)(`section`,{"aria-label":t===`pt-BR`?`Uso agregado da Task`:`Aggregated Task usage`,children:(0,k.jsx)(`dl`,{className:`trace-usage-strip`,children:i.map(({label:t,metric:r,value:i})=>{let a=Math.round(r.coverage_ratio*100),o=`${r.known_runs}/${e.run_count} ${n.measuredRuns} · ${a}%`;return(0,k.jsxs)(`div`,{title:o,children:[(0,k.jsxs)(`dt`,{children:[t,(0,k.jsx)(`span`,{"aria-hidden":`true`,className:`trace-usage-coverage`,"data-complete":r.unknown_runs===0}),(0,k.jsx)(`span`,{className:`trace-usage-sr-only`,children:o})]}),(0,k.jsx)(`dd`,{children:i})]},t)})})})}function q(e,n){return e===null?`—`:t(e,n)}function J(e,t){if(e===null)return`—`;let n=new Date(e);return Number.isNaN(n.getTime())?`—`:new Intl.DateTimeFormat(t,{dateStyle:`short`,timeStyle:`short`}).format(n)}function Y(e,t){if(e===null)return`—`;let n=Date.parse(e);if(!Number.isFinite(n))return`—`;let r=Math.max(0,Date.now()-n),i=Math.max(1,Math.round(r/6e4)),a;if(i<60)a=`${i}m`;else{let e=Math.round(i/60);if(e<24)a=`${e}h`;else{let n=Math.round(e/24);if(n<7)a=`${n}d`;else{let e=Math.round(n/7);a=t===`pt-BR`?`${e}sem`:`${e}w`}}}return t===`pt-BR`?`Há ${a}`:`${a} ago`}export{G as n,W as t};
@@ -6,12 +6,12 @@
6
6
  <meta name="color-scheme" content="dark light" />
7
7
  <link rel="icon" type="image/png" href="/icon_zaip.png" />
8
8
  <title>Dashboard Zaip AIOS</title>
9
- <script type="module" crossorigin src="/assets/index-DiCwz0sr.js"></script>
9
+ <script type="module" crossorigin src="/assets/index-DX65Ufuu.js"></script>
10
10
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-Bh1tDfsg.js">
11
- <link rel="modulepreload" crossorigin href="/assets/cost-monitor-C8zQDBT7.js">
12
- <link rel="modulepreload" crossorigin href="/assets/react-vendor-721Re3Ss.js">
13
- <link rel="modulepreload" crossorigin href="/assets/icons-vendor-iMPXot7Y.js">
14
- <link rel="modulepreload" crossorigin href="/assets/traceability-BjdTkWS0.js">
11
+ <link rel="modulepreload" crossorigin href="/assets/cost-monitor-Co2Jiuzh.js">
12
+ <link rel="modulepreload" crossorigin href="/assets/react-vendor-CkPC-yMz.js">
13
+ <link rel="modulepreload" crossorigin href="/assets/icons-vendor-DOhy6D2-.js">
14
+ <link rel="modulepreload" crossorigin href="/assets/traceability-BEdGoIDm.js">
15
15
  <link rel="stylesheet" crossorigin href="/assets/cost-monitor-C2AFYBu_.css">
16
16
  <link rel="stylesheet" crossorigin href="/assets/traceability-DFY7ZDlu.css">
17
17
  <link rel="stylesheet" crossorigin href="/assets/index-DZhppOIk.css">
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/dashboard-frontend",
3
- "version": "4.7.0",
3
+ "version": "4.8.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/dashboard-cost-monitor",
3
- "version": "4.7.0",
3
+ "version": "4.8.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/dashboard-operations",
3
- "version": "4.7.0",
3
+ "version": "4.8.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -51,7 +51,8 @@ describe("macro overview metrics", () => {
51
51
  "Tempo de ciclo de vida (Runs-raiz, todas as fases).",
52
52
  );
53
53
  expect(overviewDurationHint("prds", "en", "")).toBe("Lifecycle time (root Runs, all phases).");
54
- expect(overviewDurationHint("specs", "pt-BR", "")).toContain("sem duplicar filhos");
54
+ expect(overviewDurationHint("specs", "pt-BR", "")).toBe("Tempo observado por SPEC.");
55
+ expect(overviewDurationHint("specs", "en", "")).toBe("Observed time per SPEC.");
55
56
  expect(topPanel).toContain(`<span>{\`#\${index + 1} \${entity.id.slice(-4)}\`}</span>`);
56
57
  expect(`${overview}\n${topPanel}`).not.toContain("operations-top-coverage");
57
58
  expect(`${overview}\n${topPanel}`).not.toContain("duração comprovada");
@@ -5,9 +5,7 @@ export function overviewDurationHint(
5
5
  ) {
6
6
  if (view === "tasks") return taskHint;
7
7
  if (view === "specs")
8
- return locale === "pt-BR"
9
- ? "Tempo decorrido observado das Runs-raiz por SPEC, sem duplicar filhos. SPECs diferentes podem compartilhar intervalos; a soma não é tempo global."
10
- : "Observed root Run elapsed time per SPEC, without counting children twice. SPECs may share intervals; their sum is not global wall time.";
8
+ return locale === "pt-BR" ? "Tempo observado por SPEC." : "Observed time per SPEC.";
11
9
  return locale === "pt-BR"
12
10
  ? "Tempo de ciclo de vida (Runs-raiz, todas as fases)."
13
11
  : "Lifecycle time (root Runs, all phases).";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/dashboard-traceability",
3
- "version": "4.7.0",
3
+ "version": "4.8.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/dashboard-branding",
3
- "version": "4.7.0",
3
+ "version": "4.8.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/dashboard-contracts",
3
- "version": "4.7.0",
3
+ "version": "4.8.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/dashboard-data-export",
3
- "version": "4.7.0",
3
+ "version": "4.8.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/dashboard-local-runtime",
3
- "version": "4.7.0",
3
+ "version": "4.8.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/dashboard-ui",
3
- "version": "4.7.0",
3
+ "version": "4.8.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/dashboard-e2e",
3
- "version": "4.7.0",
3
+ "version": "4.8.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "version": "4.7.0",
3
+ "version": "4.8.0",
4
4
  "files": [
5
5
  {
6
6
  "path": "DESIGN.md",
@@ -276,7 +276,7 @@
276
276
  },
277
277
  {
278
278
  "path": "apps/catalog/package.json",
279
- "sha256": "16b609f2cc84fbca57eac28dbf45969f8969fcac8d3a964a211530a69d76e007"
279
+ "sha256": "042f7b0a8b2fcfae031c268bfc07f41c96957ce3a6724b9ca8f0c8bd5ce4f3ab"
280
280
  },
281
281
  {
282
282
  "path": "apps/catalog/public/logo_novo_azul.png",
@@ -408,7 +408,7 @@
408
408
  },
409
409
  {
410
410
  "path": "packages/local-runtime/package.json",
411
- "sha256": "f42120a471dd8ea2816129960206cc9952360645e4a3cd6d09cbbe891973cde8"
411
+ "sha256": "95c9a31264d488e61280b0f3b6955a9c4c3c96aa388c8c2f9b92dc84092dd920"
412
412
  },
413
413
  {
414
414
  "path": "packages/local-runtime/runtime.mjs",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/design-catalog",
3
- "version": "4.7.0",
3
+ "version": "4.8.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/design-local-runtime",
3
- "version": "4.7.0",
3
+ "version": "4.8.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -6,7 +6,7 @@ title: Garantia adaptativa e execução autônoma
6
6
  status: active
7
7
  version: 3
8
8
  source_change: null
9
- source_release: "4.7.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Garantia adaptativa e execução autônoma
@@ -6,7 +6,7 @@ title: Autonomia delimitada para Cloudflare e Hostinger
6
6
  status: proposed
7
7
  version: 1
8
8
  source_change: null
9
- source_release: "4.7.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Cloudflare e Hostinger (proposta de requisito)
@@ -6,7 +6,7 @@ title: Auditoria comparativa e plano de evolução
6
6
  status: active
7
7
  version: 1
8
8
  source_change: null
9
- source_release: "4.7.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Auditoria comparativa e plano de evolução
@@ -6,7 +6,7 @@ title: Contexto mínimo, seguro e navegável
6
6
  status: active
7
7
  version: 8
8
8
  source_change: null
9
- source_release: "4.7.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Context engine
@@ -6,7 +6,7 @@ title: Tokens, custos e cobertura
6
6
  status: active
7
7
  version: 10
8
8
  source_change: null
9
- source_release: "4.7.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Cost observability
@@ -6,7 +6,7 @@ title: Inicialização e hidratação confiável do dashboard
6
6
  status: active
7
7
  version: 1
8
8
  source_change: null
9
- source_release: "4.7.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Inicialização e hidratação confiável do dashboard
@@ -6,7 +6,7 @@ title: Exportação contextual de dados para Excel
6
6
  status: proposed
7
7
  version: 2
8
8
  source_change: null
9
- source_release: "4.7.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Exportação contextual de dados
@@ -6,7 +6,7 @@ title: Contrato visual e catálogo executável
6
6
  status: active
7
7
  version: 5
8
8
  source_change: null
9
- source_release: "4.7.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Design system
@@ -6,7 +6,7 @@ title: Preparação, materialização e DAG
6
6
  status: active
7
7
  version: 11
8
8
  source_change: null
9
- source_release: "4.7.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Execution engine
@@ -6,7 +6,7 @@ title: Projeções operacionais e analíticas
6
6
  status: active
7
7
  version: 14
8
8
  source_change: null
9
- source_release: "4.7.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Kanban and dashboard
@@ -6,7 +6,7 @@ title: Seleção automática e observável de modelo e effort
6
6
  status: active
7
7
  version: 10
8
8
  source_change: null
9
- source_release: "4.7.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Orquestração de modelos
@@ -4,9 +4,9 @@ id: REQUIREMENTS-PUBLIC-DISTRIBUTION
4
4
  area: public-distribution
5
5
  title: Distribuição pública e ativação
6
6
  status: active
7
- version: 9
7
+ version: 10
8
8
  source_change: null
9
- source_release: "4.7.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Distribuição pública e ativação
@@ -44,15 +44,17 @@ Restrições explícitas prevalecem. No init sem force, catálogo oficial legado
44
44
  ser atualizado e passa a integrar o lock; catálogo personalizado permanece protegido. Discovery
45
45
  gerenciada é uma projeção única, regenerada a partir do catálogo da versão instalada.
46
46
 
47
- ## REQ-DIST-003 — Configuração global portátil do Codex
47
+ ## REQ-DIST-003 — Hooks do Codex restritos ao projeto
48
48
 
49
- O CLI público deve descobrir o diretório inicial do usuário em execução e reconciliar a proteção
50
- global do Codex sem apagar preferências, integrações ou identidades canônicas do usuário e sem
51
- introduzir paths ou identidades locais fixas.
49
+ O CLI público deve instalar a proteção do Codex exclusivamente no projeto em instalação,
50
+ por meio de `.codex/config.toml` e `.codex/hooks`. A migração pode remover hooks globais
51
+ legados comprovadamente pertencentes ao ZAIP após backup recuperável, preservando as demais
52
+ preferências globais, identidades canônicas, integrações e hooks de terceiros. Nenhum caminho
53
+ ou identidade do ambiente de build pode ser fixado no pacote.
52
54
 
53
- - `AC-DIST-003-01`: em uma instalação limpa ou existente, o CLI preserva as configurações globais e identidades canônicas, remove somente aliases `codex_name` obsoletos declarados pelo catálogo instalado e adiciona o hook portátil canônico, sem referência a nome de usuário ou path absoluto do ambiente de build.
54
- - `AC-DIST-003-02`: se a escrita global falhar, o CLI conclui a instalação do projeto sem ocultar a falha, informa o destino exato e o erro, e mantém na documentação os passos de reconciliação manual que preservam a configuração existente.
55
- - `AC-DIST-003-03`: a reconciliação substitui todo hook `PreToolUse` identificado como ZAIP por exatamente um bloco canônico e preserva hooks de terceiros; reexecuções são idempotentes.
55
+ - `AC-DIST-003-01`: em instalação limpa ou atualização, o CLI registra exatamente o hook canônico do ZAIP no `.codex/config.toml` do projeto e instala seu script em `.codex/hooks`; não cria nem atualiza hook global como fallback, não altera preferências ou identidades globais e não embute nome de usuário ou caminho absoluto do ambiente de build.
56
+ - `AC-DIST-003-02`: a migração identifica por assinatura/ownership os registros globais legados de hooks do ZAIP, verifica primeiro os hooks canônicos do projeto, produz e verifica backup recuperável antes de remover somente essas entradas reconhecidas da configuração global, e preserva integralmente hooks de terceiros e as demais configurações globais. Se a verificação local falhar, preserva também o hook global legado e relata a pendência; conteúdo global sem prova de ownership permanece intacto para revisão manual.
57
+ - `AC-DIST-003-03`: a instalação e a migração são idempotentes; falha ao gravar o hook do projeto, verificar o backup ou limpar um legado reconhecido é informada com destino, erro, estado parcial e passos de recuperação, sem declarar proteção concluída nem recorrer a um hook global.
56
58
 
57
59
  ## Verificação
58
60
 
@@ -6,7 +6,7 @@ title: Layout modular e limites de código-fonte
6
6
  status: active
7
7
  version: 5
8
8
  source_change: null
9
- source_release: "4.7.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Software architecture
@@ -6,7 +6,7 @@ title: Melhorias estratégicas de custo, qualidade e resiliência
6
6
  status: active
7
7
  version: 1
8
8
  source_change: null
9
- source_release: "4.7.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Melhorias estratégicas de custo, qualidade e resiliência
@@ -6,7 +6,7 @@ title: Ciclo de vida do trabalho
6
6
  status: active
7
7
  version: 26
8
8
  source_change: null
9
- source_release: "4.7.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Work lifecycle
@@ -6,7 +6,7 @@ title: Evidências, custo por Task e autonomia por SPEC
6
6
  status: active
7
7
  version: 1
8
8
  source_change: null
9
- source_release: "4.7.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Evidências, custo por Task e autonomia por SPEC
@@ -1 +1 @@
1
- 4.7.0
1
+ 4.8.0