@zaip-ai/cli 3.6.0 → 3.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 (122) hide show
  1. package/dist/commands/init.d.ts.map +1 -1
  2. package/dist/commands/init.js +6 -0
  3. package/dist/commands/init.js.map +1 -1
  4. package/dist/services/adapters.d.ts +1 -1
  5. package/dist/services/adapters.d.ts.map +1 -1
  6. package/dist/services/adapters.js +22 -4
  7. package/dist/services/adapters.js.map +1 -1
  8. package/dist/services/adapters.test.js +24 -0
  9. package/dist/services/adapters.test.js.map +1 -1
  10. package/dist/services/codex-conversation-lifecycle-hook.d.ts.map +1 -1
  11. package/dist/services/codex-conversation-lifecycle-hook.js +37 -6
  12. package/dist/services/codex-conversation-lifecycle-hook.js.map +1 -1
  13. package/dist/services/sqlite-bootstrap.d.ts.map +1 -1
  14. package/dist/services/sqlite-bootstrap.js +9 -1
  15. package/dist/services/sqlite-bootstrap.js.map +1 -1
  16. package/package.json +1 -1
  17. package/templates/.agents/README-ENG.md +2 -2
  18. package/templates/.agents/README.md +2 -2
  19. package/templates/.agents/config/agents/catalog.yaml +23 -23
  20. package/templates/.agents/config/agents/discovery.json +2 -2
  21. package/templates/.agents/config/clients/codex/agents/zaip-agent-analyst.toml +2 -2
  22. package/templates/.agents/config/clients/codex/agents/zaip-agent-auditor.toml +2 -2
  23. package/templates/.agents/config/clients/codex/agents/zaip-agent-backend.toml +2 -2
  24. package/templates/.agents/config/clients/codex/agents/zaip-agent-brand-strategist.toml +2 -2
  25. package/templates/.agents/config/clients/codex/agents/zaip-agent-builder.toml +2 -2
  26. package/templates/.agents/config/clients/codex/agents/zaip-agent-cloud-engineer.toml +2 -2
  27. package/templates/.agents/config/clients/codex/agents/zaip-agent-data-analyst.toml +2 -2
  28. package/templates/.agents/config/clients/codex/agents/zaip-agent-designer.toml +2 -2
  29. package/templates/.agents/config/clients/codex/agents/zaip-agent-finalizer.toml +2 -2
  30. package/templates/.agents/config/clients/codex/agents/zaip-agent-frontend.toml +2 -2
  31. package/templates/.agents/config/clients/codex/agents/zaip-agent-general-operations.toml +2 -2
  32. package/templates/.agents/config/clients/codex/agents/zaip-agent-governance-compliance.toml +2 -2
  33. package/templates/.agents/config/clients/codex/agents/zaip-agent-growth-strategist.toml +2 -2
  34. package/templates/.agents/config/clients/codex/agents/zaip-agent-integrator.toml +2 -2
  35. package/templates/.agents/config/clients/codex/agents/zaip-agent-marketing-analyst.toml +2 -2
  36. package/templates/.agents/config/clients/codex/agents/zaip-agent-orchestrator.toml +2 -2
  37. package/templates/.agents/config/clients/codex/agents/zaip-agent-refactoring-specialist.toml +2 -2
  38. package/templates/.agents/config/clients/codex/agents/zaip-agent-reviewer.toml +2 -2
  39. package/templates/.agents/config/clients/codex/agents/zaip-agent-sales-specialist.toml +2 -2
  40. package/templates/.agents/config/clients/codex/agents/zaip-agent-security-auditor.toml +2 -2
  41. package/templates/.agents/config/clients/codex/agents/zaip-agent-task-executor.toml +2 -2
  42. package/templates/.agents/config/clients/codex/agents/zaip-agent-website-developer.toml +2 -2
  43. package/templates/.agents/config/clients/codex/agents/zaip-agent-writer.toml +2 -2
  44. package/templates/.agents/config/clients.yaml +1 -1
  45. package/templates/.agents/config/pricing/models.json +57 -1
  46. package/templates/.agents/config/project.yaml +1 -1
  47. package/templates/.agents/dashboard/.zaip-managed.json +51 -67
  48. package/templates/.agents/dashboard/apps/frontend/dist/assets/{CostCalculationGuidePage-C5NgEcVh.js → CostCalculationGuidePage-D2PL4UOu.js} +1 -1
  49. package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-BDQR0U4a.js → DashboardHelpDialog-CocoP9CA.js} +15 -16
  50. package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-CGYcJ5EB.js → PricingSettingsDialog-D255_hNf.js} +1 -1
  51. package/templates/.agents/dashboard/apps/frontend/dist/assets/{ProjectSettingsPage-OulA4CoX.js → ProjectSettingsPage-0f_x2TzJ.js} +1 -1
  52. package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-BKBpJyLh.js → TraceabilityWorkspace-BTFSLQ69.js} +1 -1
  53. package/templates/.agents/dashboard/apps/frontend/dist/assets/{cost-monitor-j3aUYH5G.js → cost-monitor-zhY2JoLc.js} +1 -1
  54. package/templates/.agents/dashboard/apps/frontend/dist/assets/{dashboard-localization-jvdDfNKs.js → dashboard-localization-058lag33.js} +2 -2
  55. package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-x8xxL9yW.js → icons-vendor-DeFPiN32.js} +1 -1
  56. package/templates/.agents/dashboard/apps/frontend/dist/assets/{index-CqfSgtk9.js → index-Dh95Yodm.js} +2 -2
  57. package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-CNOXIJHN.js → react-vendor-BIWcbEAc.js} +1 -1
  58. package/templates/.agents/dashboard/apps/frontend/dist/assets/{traceability-CcpbpT1s.js → traceability-fZZL0ohD.js} +1 -1
  59. package/templates/.agents/dashboard/apps/frontend/dist/index.html +5 -5
  60. package/templates/.agents/dashboard/apps/frontend/package.json +1 -1
  61. package/templates/.agents/dashboard/modules/cost-monitor/package.json +1 -1
  62. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorContent.tsx +2 -2
  63. package/templates/.agents/dashboard/modules/operations/package.json +1 -1
  64. package/templates/.agents/dashboard/modules/traceability/package.json +1 -1
  65. package/templates/.agents/dashboard/packages/branding/package.json +1 -1
  66. package/templates/.agents/dashboard/packages/contracts/package.json +1 -1
  67. package/templates/.agents/dashboard/packages/data-export/package.json +1 -1
  68. package/templates/.agents/dashboard/packages/local-runtime/dist/server.cjs +169 -169
  69. package/templates/.agents/dashboard/packages/local-runtime/dist/sqlite-read-model.cjs +153 -153
  70. package/templates/.agents/dashboard/packages/local-runtime/package.json +2 -2
  71. package/templates/.agents/dashboard/packages/local-runtime/server.mjs +169 -169
  72. package/templates/.agents/dashboard/packages/local-runtime/src/agent-catalog-settings.test.ts +15 -15
  73. package/templates/.agents/dashboard/packages/local-runtime/src/project-settings.test.ts +2 -2
  74. package/templates/.agents/dashboard/packages/ui/package.json +1 -1
  75. package/templates/.agents/dashboard/tests/e2e/package.json +1 -1
  76. package/templates/.agents/dashboard/tests/e2e/specs/dashboard-performance-matrix.spec.ts +11 -19
  77. package/templates/.agents/dashboard/tests/e2e/specs/performance-matrix-types.ts +15 -0
  78. package/templates/.agents/dashboard/tests/e2e/specs/performance-observability.ts +30 -0
  79. package/templates/.agents/design/.zaip-managed.json +3 -3
  80. package/templates/.agents/design/apps/catalog/package.json +2 -2
  81. package/templates/.agents/design/packages/local-runtime/package.json +1 -1
  82. package/templates/.agents/requirements/autonomous-assurance.md +1 -1
  83. package/templates/.agents/requirements/cloud-hostinger-autonomy.md +1 -1
  84. package/templates/.agents/requirements/comparative-audit.md +1 -1
  85. package/templates/.agents/requirements/context-engine.md +1 -1
  86. package/templates/.agents/requirements/cost-observability.md +1 -1
  87. package/templates/.agents/requirements/dashboard-launch.md +1 -1
  88. package/templates/.agents/requirements/data-export.md +1 -1
  89. package/templates/.agents/requirements/design-system.md +1 -1
  90. package/templates/.agents/requirements/execution-engine.md +1 -1
  91. package/templates/.agents/requirements/kanban-dashboard.md +1 -1
  92. package/templates/.agents/requirements/model-orchestration.md +6 -6
  93. package/templates/.agents/requirements/public-distribution.md +1 -1
  94. package/templates/.agents/requirements/software-architecture.md +1 -1
  95. package/templates/.agents/requirements/strategic-improvements.md +1 -1
  96. package/templates/.agents/requirements/work-lifecycle.md +1 -1
  97. package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
  98. package/templates/.agents/runtime/VERSION +1 -1
  99. package/templates/.agents/runtime/bin/zaip.mjs +56 -56
  100. package/templates/.agents/runtime/checksums.sha256 +6 -6
  101. package/templates/.agents/runtime/manifest.json +1 -1
  102. package/templates/.agents/runtime/pnpm-lock.sha256 +1 -1
  103. package/templates/.agents/runtime/provenance.json +5 -5
  104. package/templates/.agents/runtime/sbom.cdx.json +144 -162
  105. package/templates/.agents/skills/zaip-skill-adapters/SKILL.md +1 -1
  106. package/templates/.agents/skills/zaip-skill-github-deploy/SKILL.md +5 -5
  107. package/templates/.agents/skills/zaip-skill-github-deploy/agents/openai.yaml +2 -2
  108. package/templates/.agents/skills/zaip-skill-github-deploy/references/deployment-workflow.md +5 -3
  109. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/github-deploy-contract.test.mjs +28 -5
  110. package/templates/.agents/skills/zaip-skill-release-qualification/references/local-preparation.md +7 -1
  111. package/templates/.agents/zaip-aios/VERSION +1 -1
  112. package/templates/.agents/zaip-aios/guides/18-catalogo-de-agentes.md +1 -1
  113. package/templates/.agents/zaip-aios/guides/20-instalacao-detalhada.md +1 -1
  114. package/templates/.agents/zaip-aios/guides/23-orquestracao-de-modelos.md +3 -4
  115. package/templates/.agents/zaip-aios/guides/24-calculo-de-custos-openai.md +7 -7
  116. package/templates/template-manifest.json +122 -138
  117. package/templates/.agents/dashboard/apps/frontend/dist/assets/DashboardHelpDialog-CCMVnkkI.js +0 -2938
  118. package/templates/.agents/dashboard/apps/frontend/dist/assets/DashboardHelpDialog-Je5nK-Et.css +0 -1
  119. package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-D46WWIKr.js +0 -3
  120. package/templates/.agents/dashboard/apps/frontend/dist/assets/TraceabilityWorkspace-Ckxk_izu.js +0 -1
  121. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-Bas2TVju.js +0 -2
  122. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-CxrG_wRI.css +0 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "version": "3.6.0",
3
+ "version": "3.8.0",
4
4
  "files": [
5
5
  {
6
6
  "path": "DATA-DICTIONARY.md",
@@ -11,48 +11,32 @@
11
11
  "sha256": "eee8a44da4ec5486635e2f2c8d1e53720fd38f7930ceff6bd3eedb39b055ea5d"
12
12
  },
13
13
  {
14
- "path": "apps/frontend/dist/assets/CostCalculationGuidePage-C5NgEcVh.js",
15
- "sha256": "c4bfb5664f2bd3e90c6f66602f88f1ac453108fad42f630c8084de025dfa6c1f"
14
+ "path": "apps/frontend/dist/assets/CostCalculationGuidePage-D2PL4UOu.js",
15
+ "sha256": "b4c064694b8fdf538329f170c94dc12695153aed4990f91aff5291c4ec7f0a1b"
16
16
  },
17
17
  {
18
- "path": "apps/frontend/dist/assets/DashboardHelpDialog-BDQR0U4a.js",
19
- "sha256": "13a53d6a8a4c85688d8ceba69649008576b5f534364f073135fe96c81290b796"
20
- },
21
- {
22
- "path": "apps/frontend/dist/assets/DashboardHelpDialog-CCMVnkkI.js",
23
- "sha256": "13a53d6a8a4c85688d8ceba69649008576b5f534364f073135fe96c81290b796"
18
+ "path": "apps/frontend/dist/assets/DashboardHelpDialog-CocoP9CA.js",
19
+ "sha256": "c3608f1b6f500d5710ce6d020850dad73a505f06f72a27e7eff00fce940ac890"
24
20
  },
25
21
  {
26
22
  "path": "apps/frontend/dist/assets/DashboardHelpDialog-DRI_XwUf.css",
27
23
  "sha256": "95dbb5c26ad73831f36f2a51d5e08ef5eee7ca85190764a3e63bf1e700fbadf8"
28
24
  },
29
25
  {
30
- "path": "apps/frontend/dist/assets/DashboardHelpDialog-Je5nK-Et.css",
31
- "sha256": "aafa708825ff8417d2de8ce9f45b94c899aa9ae5c5068bf5ce4def13e9c00643"
26
+ "path": "apps/frontend/dist/assets/PricingSettingsDialog-D255_hNf.js",
27
+ "sha256": "e08828f3b0da271c18b6f401acbef5b89877067ed01f98db5278e5ec51e55d27"
32
28
  },
33
29
  {
34
- "path": "apps/frontend/dist/assets/PricingSettingsDialog-CGYcJ5EB.js",
35
- "sha256": "9d8a261bb3cdf7f45d6d95de487114c4170fe5259ed32fd424f74012f9b65d74"
30
+ "path": "apps/frontend/dist/assets/ProjectSettingsPage-0f_x2TzJ.js",
31
+ "sha256": "6f69f6d39ae64c3b4de913d2e36e7443eb8dd10f670eca5b9d35063ab3c986c1"
36
32
  },
37
33
  {
38
34
  "path": "apps/frontend/dist/assets/ProjectSettingsPage-CQMhvzvJ.css",
39
35
  "sha256": "10e875c4e3ab6c252983822e25a85db3d707d903c0fcf39812909fdd1d013f48"
40
36
  },
41
37
  {
42
- "path": "apps/frontend/dist/assets/ProjectSettingsPage-D46WWIKr.js",
43
- "sha256": "1945d9fadeb055c4ed38115fbda65a00e6e80df3b74b9db06de956aa7b2d162a"
44
- },
45
- {
46
- "path": "apps/frontend/dist/assets/ProjectSettingsPage-OulA4CoX.js",
47
- "sha256": "de7b5e6f1dd05a949cc875c6fe6d5a3681bb62f527caa0e4678bd6b76b1d96de"
48
- },
49
- {
50
- "path": "apps/frontend/dist/assets/TraceabilityWorkspace-BKBpJyLh.js",
51
- "sha256": "fdb21d3f592e5baa9bc0e2a73f5a52ae9828a794d07dcdba1ff8436b4636b2b0"
52
- },
53
- {
54
- "path": "apps/frontend/dist/assets/TraceabilityWorkspace-Ckxk_izu.js",
55
- "sha256": "4802444024515df000d9c55d5cef081fd2895371589167721ac88e5cdd5a91fd"
38
+ "path": "apps/frontend/dist/assets/TraceabilityWorkspace-BTFSLQ69.js",
39
+ "sha256": "05dc7670b5117fb27ce1b5f7e57f6fa62858d40665bb0bf6db04cb9128ebd13f"
56
40
  },
57
41
  {
58
42
  "path": "apps/frontend/dist/assets/TraceabilityWorkspace-DvvavDLY.css",
@@ -63,28 +47,20 @@
63
47
  "sha256": "8c954ed440ea424facb46ece2cc419a92ca3e7ad36750c2ceb14c95a8d2a65c4"
64
48
  },
65
49
  {
66
- "path": "apps/frontend/dist/assets/cost-monitor-j3aUYH5G.js",
67
- "sha256": "ae95da39924881d466141d0833147213b166837c178d2bd9093aec78a1932626"
68
- },
69
- {
70
- "path": "apps/frontend/dist/assets/dashboard-localization-jvdDfNKs.js",
71
- "sha256": "94d463fead7641b6adef2383765470f2324ea761040edaa204daaee07516708c"
50
+ "path": "apps/frontend/dist/assets/cost-monitor-zhY2JoLc.js",
51
+ "sha256": "a7ac992b7353788a8ff0f3887f445f48141779859a1eac686da37b0eb75e4c08"
72
52
  },
73
53
  {
74
- "path": "apps/frontend/dist/assets/icons-vendor-x8xxL9yW.js",
75
- "sha256": "12d70f2fbcba71ff76f47f9eff38aa6de57890881f62654545c6d6db8dae1cf7"
54
+ "path": "apps/frontend/dist/assets/dashboard-localization-058lag33.js",
55
+ "sha256": "13aa399c465095cdd344458d64bb6ec222f9f425a89030055595339f10f1f31b"
76
56
  },
77
57
  {
78
- "path": "apps/frontend/dist/assets/index-Bas2TVju.js",
79
- "sha256": "a158426c97697e2fbcaa0b48ba7b9e2521c62e3afcaa3267109cb5cb01b46e44"
58
+ "path": "apps/frontend/dist/assets/icons-vendor-DeFPiN32.js",
59
+ "sha256": "441c39f9febb1f5a1c164aea03bb35c1e13a76a5af768d1cfbf161a7e6183712"
80
60
  },
81
61
  {
82
- "path": "apps/frontend/dist/assets/index-CqfSgtk9.js",
83
- "sha256": "1124cbe112daf81b9ab9175139864664c173ed24288c2ea5c7b998f8f8f3b8af"
84
- },
85
- {
86
- "path": "apps/frontend/dist/assets/index-CxrG_wRI.css",
87
- "sha256": "83e7fcf065b2ae7394de6b1aa543616b5a233c5ccc549190e96dbf3ad848a755"
62
+ "path": "apps/frontend/dist/assets/index-Dh95Yodm.js",
63
+ "sha256": "d6b04511e1985295aee793611464099b0c3f11910750d53dd20ea17ec2a5ebbe"
88
64
  },
89
65
  {
90
66
  "path": "apps/frontend/dist/assets/index-OBJXZOwe.css",
@@ -95,28 +71,28 @@
95
71
  "sha256": "bb6043bda9fc53a111aaea4d6a004559b9ce8a3569691c060d217a7c6aafa0ae"
96
72
  },
97
73
  {
98
- "path": "apps/frontend/dist/assets/react-vendor-CNOXIJHN.js",
99
- "sha256": "56e29da82323f28e28db60f62ec195af824b063fae299db116a13b2bb95aa8b9"
74
+ "path": "apps/frontend/dist/assets/react-vendor-BIWcbEAc.js",
75
+ "sha256": "a5f824566a53da3c9a4fa65f0e7139d4ab9849cf4af86780990be727eb492ce8"
100
76
  },
101
77
  {
102
78
  "path": "apps/frontend/dist/assets/rolldown-runtime-Bh1tDfsg.js",
103
79
  "sha256": "1b13387cb23dc39bf70e31677c21f6db5cad3377b96f286b6ee444496e5bfea7"
104
80
  },
105
- {
106
- "path": "apps/frontend/dist/assets/traceability-CcpbpT1s.js",
107
- "sha256": "b03f1ec94e90b414713e062f66150f7ace41bccdbd7139dd7956d56578fb4897"
108
- },
109
81
  {
110
82
  "path": "apps/frontend/dist/assets/traceability-DFY7ZDlu.css",
111
83
  "sha256": "3134c9eb5bbbdb1e48e1001fe6c4b7fd32840db04d9782587f2c4f6eacc21a64"
112
84
  },
85
+ {
86
+ "path": "apps/frontend/dist/assets/traceability-fZZL0ohD.js",
87
+ "sha256": "ac4c199d4fcfab6b6a7e25809f7a8ed6f98211c8331434c1f56486b5348e70e4"
88
+ },
113
89
  {
114
90
  "path": "apps/frontend/dist/icon_zaip.png",
115
91
  "sha256": "bb116d61da49fd0d66ff096c3db5e7365b8dae951b7f42fb6f68045aa89bac6e"
116
92
  },
117
93
  {
118
94
  "path": "apps/frontend/dist/index.html",
119
- "sha256": "3d4fbc9ccbd72e08705d5193123f4f839ce5052ae7f616464504846cd7d6e00d"
95
+ "sha256": "c1b73b335715e383d1ef69512ff5cd6accd6e6038ae2909e1eb9e370b0099241"
120
96
  },
121
97
  {
122
98
  "path": "apps/frontend/dist/logo_novo_azul.png",
@@ -128,7 +104,7 @@
128
104
  },
129
105
  {
130
106
  "path": "apps/frontend/package.json",
131
- "sha256": "9e2efa54cac237e702742b65e5407b4c6b553313106a43a74aa51ae605221530"
107
+ "sha256": "f661d165d984d52488e30c0d736ccdc8633f4801a654501510d6e76904929871"
132
108
  },
133
109
  {
134
110
  "path": "apps/frontend/playwright.dom.config.ts",
@@ -588,7 +564,7 @@
588
564
  },
589
565
  {
590
566
  "path": "modules/cost-monitor/package.json",
591
- "sha256": "cdeb2f0fc2608dd539bb0d86d2ab104756f772ba24ed28e56c3aa7567f913d62"
567
+ "sha256": "fb1708a72a3b1a4d345dfaa10d4ffb73dea8ec2c39e0186796cacab328e200ef"
592
568
  },
593
569
  {
594
570
  "path": "modules/cost-monitor/src/agent-groups.test.ts",
@@ -680,7 +656,7 @@
680
656
  },
681
657
  {
682
658
  "path": "modules/cost-monitor/src/react/CostMonitorContent.tsx",
683
- "sha256": "dc99a329e6c1b764dd95507fde27647599c9166c9cc3b380450ea01690528ce5"
659
+ "sha256": "ba62cf49ad7a1cefed99aa4c091f2449e25b93d31e062346d6d65a8813199956"
684
660
  },
685
661
  {
686
662
  "path": "modules/cost-monitor/src/react/CostMonitorIcons.tsx",
@@ -976,7 +952,7 @@
976
952
  },
977
953
  {
978
954
  "path": "modules/operations/package.json",
979
- "sha256": "db4a166d930f5deb49ccda61330195cc50e9d157e967264c1b44e4613d6f8726"
955
+ "sha256": "e0459050fb463694e387e7b6cb90d0f97b06b871b940eebae459468139732228"
980
956
  },
981
957
  {
982
958
  "path": "modules/operations/src/contracts.ts",
@@ -1648,7 +1624,7 @@
1648
1624
  },
1649
1625
  {
1650
1626
  "path": "modules/traceability/package.json",
1651
- "sha256": "42e30ba19f0fe21a0907b0273663fe5caa2926c6ccb1f52237a84bc8132a4b33"
1627
+ "sha256": "51d73dad332e85ab9736d1d10381906c9500c47bc067d02e75e7906d49e7267b"
1652
1628
  },
1653
1629
  {
1654
1630
  "path": "modules/traceability/src/contracts.ts",
@@ -1720,7 +1696,7 @@
1720
1696
  },
1721
1697
  {
1722
1698
  "path": "packages/branding/package.json",
1723
- "sha256": "c1bf83ab855623f7be542c5a1234f478d4c893bf908d63942037e5f2f1d43f6b"
1699
+ "sha256": "f5ff02e10e889a24310502a5036dda5a2d08ac6f6b8bb0ff5fecfd17e69f5903"
1724
1700
  },
1725
1701
  {
1726
1702
  "path": "packages/branding/src/index.ts",
@@ -1732,7 +1708,7 @@
1732
1708
  },
1733
1709
  {
1734
1710
  "path": "packages/contracts/package.json",
1735
- "sha256": "4f1cb029433de89c08a28eb40be8160c4eff7274e9964a6a30f4559d0d5fd56c"
1711
+ "sha256": "378c1801cb5f2356d667d78d89cfbd67ea0e70507e59848fd2f6a6b1e7499abe"
1736
1712
  },
1737
1713
  {
1738
1714
  "path": "packages/contracts/src/export.ts",
@@ -1752,7 +1728,7 @@
1752
1728
  },
1753
1729
  {
1754
1730
  "path": "packages/data-export/package.json",
1755
- "sha256": "c567fc641e5480793f43e82bbbf8ad3f02c14c4130a7430533c46852a5a9079a"
1731
+ "sha256": "2d5c1a6dd5b549e435157f1feb060223eebaa0dff641252291d411a67c2f93b7"
1756
1732
  },
1757
1733
  {
1758
1734
  "path": "packages/data-export/src/index.test.ts",
@@ -1776,15 +1752,15 @@
1776
1752
  },
1777
1753
  {
1778
1754
  "path": "packages/local-runtime/dist/server.cjs",
1779
- "sha256": "33722fcddce826fc39b9205ac86565a96a26b68859cc970e16a6ca9440d90ecc"
1755
+ "sha256": "d6f5fa0ee647d3b03fc70127c23e78341ac2a1d8d62c969f3f1e2007d770d338"
1780
1756
  },
1781
1757
  {
1782
1758
  "path": "packages/local-runtime/dist/sqlite-read-model.cjs",
1783
- "sha256": "cc163dadd7e40bc475c4839954eb7badd3adb7e1560f19572f993666d8b550aa"
1759
+ "sha256": "4e14e4371374414a018853a8c2045acea66eb297f49a186203e35edb3fafdee0"
1784
1760
  },
1785
1761
  {
1786
1762
  "path": "packages/local-runtime/package.json",
1787
- "sha256": "6b38188167ab1349909c19b75df692bda0a9dc7fdf86e6ce70fa41cfa7488c94"
1763
+ "sha256": "35f7a126ad0bb6027fbeb4c95b89ee8b58cbde1305d155a3662cba326351a26f"
1788
1764
  },
1789
1765
  {
1790
1766
  "path": "packages/local-runtime/scripts/build-sqlite-dashboard.mjs",
@@ -1820,7 +1796,7 @@
1820
1796
  },
1821
1797
  {
1822
1798
  "path": "packages/local-runtime/server.mjs",
1823
- "sha256": "47a2f79b86260b33569798fda864404153dc4b42159ccf48feda1e274d9cdc3f"
1799
+ "sha256": "2764effe3549b11bd846c123891183dcc6594a6d54eb1fdbfdbcd223ed6b799b"
1824
1800
  },
1825
1801
  {
1826
1802
  "path": "packages/local-runtime/src/active-codex-telemetry.test.ts",
@@ -1836,7 +1812,7 @@
1836
1812
  },
1837
1813
  {
1838
1814
  "path": "packages/local-runtime/src/agent-catalog-settings.test.ts",
1839
- "sha256": "0be3bb59e9345706de53106692c94ed5d17be7675164bb42116fb1aff2bd61f4"
1815
+ "sha256": "3d56c608782c81fbd4a681259886ca101da4552113c7c34a629eba9bca730b15"
1840
1816
  },
1841
1817
  {
1842
1818
  "path": "packages/local-runtime/src/agent-catalog-settings.ts",
@@ -1860,7 +1836,7 @@
1860
1836
  },
1861
1837
  {
1862
1838
  "path": "packages/local-runtime/src/project-settings.test.ts",
1863
- "sha256": "e27c9d00d7b4f163315c790039b3df263feb84efea83ca9d73bea01b3bbc0bbf"
1839
+ "sha256": "000d7ad40154dee23c722bbd4433a262ef71c1be71975e2f3ae406ddd33c5214"
1864
1840
  },
1865
1841
  {
1866
1842
  "path": "packages/local-runtime/src/project-settings.ts",
@@ -2568,7 +2544,7 @@
2568
2544
  },
2569
2545
  {
2570
2546
  "path": "packages/ui/package.json",
2571
- "sha256": "ed15f292f390651c475206b988bceafa3b08a06a073a25ce871d843873416be5"
2547
+ "sha256": "32bd41eb5c7c3bb347b8a6686a3ca1e8001606f158bb9fae815a0da7862d7841"
2572
2548
  },
2573
2549
  {
2574
2550
  "path": "packages/ui/src/DashboardHeader.test.mjs",
@@ -2676,7 +2652,7 @@
2676
2652
  },
2677
2653
  {
2678
2654
  "path": "tests/e2e/package.json",
2679
- "sha256": "01d1a078d5a383a14c69a3ad8e6b41fbc60246740981eb50efa9d6a644e73def"
2655
+ "sha256": "f5948b8e7de14f0ad6dc95c74bf3afe9ce951dcde8f0c6a0b64cb09e7ecbade1"
2680
2656
  },
2681
2657
  {
2682
2658
  "path": "tests/e2e/playwright.config.ts",
@@ -2696,7 +2672,7 @@
2696
2672
  },
2697
2673
  {
2698
2674
  "path": "tests/e2e/specs/dashboard-performance-matrix.spec.ts",
2699
- "sha256": "0ef926f9f5f1e57b071df133faf8af3acddaff2b4803aa153ff895cb3b6baa98"
2675
+ "sha256": "562b72aa354412bc266ccd2667a56289ffb62a0f0609949631875920e2211575"
2700
2676
  },
2701
2677
  {
2702
2678
  "path": "tests/e2e/specs/dashboard.spec.ts",
@@ -2714,6 +2690,14 @@
2714
2690
  "path": "tests/e2e/specs/lease-lifetime.spec.ts",
2715
2691
  "sha256": "188427ed47d940854db8a6c192b0f3767443bdb8504294fd67fcd99fa97bd806"
2716
2692
  },
2693
+ {
2694
+ "path": "tests/e2e/specs/performance-matrix-types.ts",
2695
+ "sha256": "102e27aa1e2552f43f05ecdc44cc7af0a0fe97cfc53d327b5a36288b424b508c"
2696
+ },
2697
+ {
2698
+ "path": "tests/e2e/specs/performance-observability.ts",
2699
+ "sha256": "7d310a0f9b408c17fb4ff866e1c8a2db526aa6a5e1fec322a6bcdacfc6eb645d"
2700
+ },
2717
2701
  {
2718
2702
  "path": "tests/e2e/specs/work-board-hydration.ts",
2719
2703
  "sha256": "8d1ddf92269878f43029dce3aa8af0b990d73880f85366f3556734f1ce6b308b"
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-Bh1tDfsg.js";import{E as t,w as n}from"./cost-monitor-j3aUYH5G.js";var r=e(t(),1),i=n(),a={input:1e5,cache:4e4,output:2e4,reasoning:8e3},o=e=>Math.round(e*1e6)/1e6;function s(e,t,n,r,i){let a=o(Math.max(e.input-e.cache,0)/1e6*t.input*n),s=o(e.cache/1e6*(t.cache??0)*n),c=o(e.output/1e6*t.output*r),l=o(a+s+c);return{usage:e,rates:t,inputMultiplier:n,outputMultiplier:r,inputUsd:a,cacheUsd:s,outputUsd:c,reasoningUsd:0,totalUsd:l,totalBrl:i===null?null:o(l*i)}}function c(e,t){if(t===`standard`)return{input:e.input_per_million_usd,cache:e.cached_input_per_million_usd,output:e.output_per_million_usd};let n=e.priority_input_per_million_usd,r=e.priority_output_per_million_usd;return n==null||r==null?null:{input:n,cache:e.priority_cached_input_per_million_usd??null,output:r}}function l(e,t,n){let r=c(e,t);return r===null?null:s(a,r,1,1,n)}function u(e,t){return e.long_context_threshold_tokens===null?null:s({input:e.long_context_threshold_tokens+5e4,cache:a.cache,output:a.output,reasoning:a.reasoning},c(e,`standard`),e.long_context_input_multiplier,e.long_context_output_multiplier,t)}var d={"pt-BR":{eyebrow:`CONFIGURAÇÕES · TRANSPARÊNCIA`,title:`Como o custo é calculado`,intro:`Do menor grão — uma chamada LLM — até o total: veja quais tokens entram na conta e como modelo, esforço, contexto e velocidade mudam o resultado.`,back:`Voltar ao dashboard`,model:`Modelo usado nos exemplos`,currency:`Moeda`,unavailable:`Indisponível`,millionRate:`por 1 milhão de tokens`,rateTitle:`1. Comece pelas tarifas do modelo`,rateIntro:`O modelo escolhe a tabela de preços. Priority/Fast usa outra tabela quando o catálogo publica essas tarifas.`,standard:`Standard`,priority:`Priority / Fast`,input:`Input`,cache:`Cache`,output:`Output`,reasoning:`Reasoning`,ratio:`Priority ÷ Standard`,included:`Incluído no output (+0)`,noPublishedRate:`Sem tarifa publicada (custo adicional 0)`,conceptsTitle:`2. Entenda cada parte da chamada`,concepts:[[`Chamada LLM`,`É o menor grão do cálculo: uma requisição ao provedor, com um modelo e um tier de serviço.`],[`Input tokens`,`Tudo que entra no modelo: instruções, histórico, contexto, ferramentas e a mensagem atual.`],[`Cache tokens`,`São parte do input, não tokens extras. Primeiro subtraímos o cache do input e depois aplicamos sua tarifa própria.`],[`Output tokens`,`É o total produzido pelo modelo. O custo usa o output total informado pela telemetria.`],[`Reasoning tokens`,`São parte do output. O cálculo atual cobra o output uma vez e mantém reasoningUsd = 0, evitando cobrança dupla.`],[`Modelo e esforço`,`O modelo muda as tarifas. O esforço não tem multiplicador próprio, mas pode gerar mais reasoning, output ou ciclos e aumentar o custo indiretamente.`],[`Multiplicador de contexto`,`Acima do limite do modelo, o multiplicador de input vale também para cache; o multiplicador de output vale para todo o output.`],[`Multiplicador de velocidade`,`É a razão derivada entre o total Priority/Fast e o Standard. Serve para comparar; nunca é multiplicado de novo no total.`]],exampleTitle:`3. Exemplo simples, parcela por parcela`,exampleIntro:`Uma chamada com 100 mil tokens de input, dos quais 40 mil vieram do cache, e 20 mil tokens de output, dos quais 8 mil são reasoning.`,billableInput:`Input faturável`,operation:`Operação`,cost:`Custo`,total:`Total da chamada`,speedMultiplier:`Multiplicador de velocidade derivado`,longTitle:`4. Exemplo com contexto longo`,longIntro:`Para realmente ultrapassar o limite, o exemplo usa o threshold do modelo + 50 mil tokens de input. A conta abaixo continua no tier Standard.`,threshold:`Limite do modelo`,longInput:`Input do exemplo longo`,priorityLong:`Priority/Fast + contexto longo`,priorityLongNote:`Indisponível: sem uma combinação publicada no catálogo, o dashboard não inventa uma tarifa.`,finalNote:`Regra prática: escolha o modelo e o tier, separe input de cache, cobre o output total uma única vez e só então aplique câmbio. Mais esforço só aumenta o custo quando aumenta o uso registrado.`},"en-US":{eyebrow:`SETTINGS · TRANSPARENCY`,title:`How cost is calculated`,intro:`From the smallest grain — one LLM call — to the total: see which tokens enter the calculation and how model, effort, context, and speed affect it.`,back:`Back to dashboard`,model:`Model used in the examples`,currency:`Currency`,unavailable:`Unavailable`,millionRate:`per 1 million tokens`,rateTitle:`1. Start with the model rates`,rateIntro:`The model selects the price table. Priority/Fast uses a different table when the catalog publishes those rates.`,standard:`Standard`,priority:`Priority / Fast`,input:`Input`,cache:`Cache`,output:`Output`,reasoning:`Reasoning`,ratio:`Priority ÷ Standard`,included:`Included in output (+0)`,noPublishedRate:`No published rate (additional cost 0)`,conceptsTitle:`2. Understand each part of the call`,concepts:[[`LLM call`,`The smallest calculation grain: one provider request with one model and one service tier.`],[`Input tokens`,`Everything sent to the model: instructions, history, context, tools, and the current message.`],[`Cache tokens`,`They are part of input, not extra tokens. Cache is subtracted from input first, then its own rate is applied.`],[`Output tokens`,`Everything produced by the model. Cost uses the total output reported by telemetry.`],[`Reasoning tokens`,`They are part of output. Current math charges output once and keeps reasoningUsd = 0, preventing double billing.`],[`Model and effort`,`The model changes rates. Effort has no direct multiplier, but it can produce more reasoning, output, or cycles and indirectly raise cost.`],[`Context multiplier`,`Above the model threshold, the input multiplier also applies to cache; the output multiplier applies to all output.`],[`Speed multiplier`,`It is the derived ratio between Priority/Fast and Standard totals. It is only a comparison and is never multiplied into the total again.`]],exampleTitle:`3. A simple example, component by component`,exampleIntro:`One call with 100 thousand input tokens, including 40 thousand cache tokens, and 20 thousand output tokens, including 8 thousand reasoning tokens.`,billableInput:`Billable input`,operation:`Operation`,cost:`Cost`,total:`Call total`,speedMultiplier:`Derived speed multiplier`,longTitle:`4. Long-context example`,longIntro:`To actually exceed the limit, this example uses the model threshold + 50 thousand input tokens. The calculation remains on Standard tier.`,threshold:`Model threshold`,longInput:`Long-example input`,priorityLong:`Priority/Fast + long context`,priorityLongNote:`Unavailable: without a published combination in the catalog, the dashboard does not invent a rate.`,finalNote:`Rule of thumb: choose model and tier, separate input from cache, charge total output once, then apply FX. Higher effort only raises cost when it raises recorded usage.`}};function f(e,t,n,r){if(t===`BRL`&&n===null)return r;let i=t===`BRL`?e*n:e;return new Intl.NumberFormat(t===`BRL`?`pt-BR`:`en-US`,{style:`currency`,currency:t,minimumFractionDigits:2,maximumFractionDigits:6}).format(i)}function p(e,t,n,r,i){return e==null?i:f(e,t,n,r)}function m(e,t){return new Intl.NumberFormat(t).format(e)}function h({example:e,currency:t,fxRate:n,locale:r,labels:a}){let o=a.unavailable,s=Math.max(e.usage.input-e.usage.cache,0),c=e.inputMultiplier===1?``:` × ${e.inputMultiplier}`,l=e.outputMultiplier===1?``:` × ${e.outputMultiplier}`,u=e.rates.cache??0,d=[{label:a.billableInput,operation:`${m(e.usage.input,r)} − ${m(e.usage.cache,r)} = ${m(s,r)} tokens`,cost:null},{label:a.input,operation:`${m(s,r)} ÷ 1M × ${p(e.rates.input,t,n,o,a.noPublishedRate)}${c}`,cost:e.inputUsd},{label:a.cache,operation:`${m(e.usage.cache,r)} ÷ 1M × ${p(u,t,n,o,a.noPublishedRate)}${c}`,cost:e.cacheUsd},{label:a.output,operation:`${m(e.usage.output,r)} ÷ 1M × ${p(e.rates.output,t,n,o,a.noPublishedRate)}${l}`,cost:e.outputUsd},{label:a.reasoning,operation:`${m(e.usage.reasoning,r)} tokens ⊂ ${a.output} → +0`,cost:e.reasoningUsd}];return(0,i.jsxs)(`div`,{className:`cost-guide-calculation`,children:[(0,i.jsxs)(`div`,{className:`cost-guide-calculation-head`,"aria-hidden":`true`,children:[(0,i.jsx)(`span`,{}),(0,i.jsx)(`span`,{children:a.operation}),(0,i.jsx)(`span`,{children:a.cost})]}),d.map(e=>(0,i.jsxs)(`div`,{className:`cost-guide-calculation-line`,children:[(0,i.jsx)(`strong`,{children:e.label}),(0,i.jsx)(`code`,{children:e.operation}),(0,i.jsx)(`span`,{children:e.cost===null?`—`:f(e.cost,t,n,o)})]},e.label)),(0,i.jsxs)(`div`,{className:`cost-guide-calculation-total`,children:[(0,i.jsx)(`strong`,{children:a.total}),(0,i.jsx)(`span`,{children:f(e.totalUsd,t,n,o)})]})]})}function g({catalog:e,fxRate:t,locale:n,onClose:a}){let o=d[n],[s,c]=(0,r.useState)(e.models[0]?.id??``),[f,g]=(0,r.useState)(`USD`),_=(0,r.useMemo)(()=>e.models.find(e=>e.id===s)??e.models[0]??null,[e.models,s]);if(_===null)return(0,i.jsxs)(`main`,{className:`cost-guide`,children:[(0,i.jsxs)(`button`,{onClick:a,type:`button`,children:[`← `,o.back]}),(0,i.jsx)(`h1`,{children:o.title}),(0,i.jsx)(`p`,{children:o.unavailable})]});let v=t?.rate??null,y=l(_,`standard`,v),b=l(_,`priority`,v),x=u(_,v),S=b!==null&&y.totalUsd>0?b.totalUsd/y.totalUsd:null,C=[{label:o.input,standard:_.input_per_million_usd,priority:_.priority_input_per_million_usd},{label:o.cache,standard:_.cached_input_per_million_usd,priority:_.priority_cached_input_per_million_usd},{label:o.output,standard:_.output_per_million_usd,priority:_.priority_output_per_million_usd}];return(0,i.jsxs)(`main`,{className:`cost-guide`,children:[(0,i.jsxs)(`header`,{children:[(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`small`,{children:o.eyebrow}),(0,i.jsx)(`h1`,{children:o.title}),(0,i.jsx)(`p`,{children:o.intro})]}),(0,i.jsxs)(`button`,{onClick:a,type:`button`,children:[`← `,o.back]})]}),(0,i.jsxs)(`section`,{className:`cost-guide-controls`,"aria-label":o.model,children:[(0,i.jsxs)(`label`,{children:[o.model,(0,i.jsx)(`select`,{value:_.id,onChange:e=>c(e.target.value),children:e.models.map(e=>(0,i.jsx)(`option`,{value:e.id,children:e.id},e.id))})]}),(0,i.jsxs)(`label`,{children:[o.currency,(0,i.jsxs)(`select`,{value:f,onChange:e=>g(e.target.value),children:[(0,i.jsx)(`option`,{value:`USD`,children:`USD`}),(0,i.jsxs)(`option`,{value:`BRL`,children:[`BRL `,v===null?`(${o.unavailable})`:`(1 USD = ${v.toFixed(4)} BRL)`]})]})]})]}),(0,i.jsxs)(`section`,{className:`cost-guide-section`,children:[(0,i.jsxs)(`div`,{className:`cost-guide-section-heading`,children:[(0,i.jsx)(`h2`,{children:o.rateTitle}),(0,i.jsx)(`p`,{children:o.rateIntro})]}),(0,i.jsx)(`div`,{className:`cost-guide-table-wrap`,children:(0,i.jsxs)(`table`,{children:[(0,i.jsxs)(`caption`,{children:[_.id,` · `,o.millionRate]}),(0,i.jsx)(`thead`,{children:(0,i.jsxs)(`tr`,{children:[(0,i.jsx)(`th`,{scope:`col`}),(0,i.jsx)(`th`,{scope:`col`,children:o.standard}),(0,i.jsx)(`th`,{scope:`col`,children:o.priority}),(0,i.jsx)(`th`,{scope:`col`,children:o.ratio})]})}),(0,i.jsxs)(`tbody`,{children:[C.map(e=>(0,i.jsxs)(`tr`,{children:[(0,i.jsx)(`th`,{scope:`row`,children:e.label}),(0,i.jsx)(`td`,{children:p(e.standard,f,v,o.unavailable,o.noPublishedRate)}),(0,i.jsx)(`td`,{children:p(e.priority,f,v,o.unavailable,o.noPublishedRate)}),(0,i.jsx)(`td`,{children:e.standard!==null&&e.standard>0&&e.priority!==null&&e.priority!==void 0?`${(e.priority/e.standard).toFixed(2)}×`:o.unavailable})]},e.label)),(0,i.jsxs)(`tr`,{children:[(0,i.jsx)(`th`,{scope:`row`,children:o.reasoning}),(0,i.jsx)(`td`,{colSpan:3,children:o.included})]})]})]})})]}),(0,i.jsxs)(`section`,{className:`cost-guide-section`,children:[(0,i.jsx)(`div`,{className:`cost-guide-section-heading`,children:(0,i.jsx)(`h2`,{children:o.conceptsTitle})}),(0,i.jsx)(`div`,{className:`cost-guide-blocks`,children:o.concepts.map(([e,t])=>(0,i.jsxs)(`article`,{children:[(0,i.jsx)(`strong`,{children:e}),(0,i.jsx)(`p`,{children:t})]},e))})]}),(0,i.jsxs)(`section`,{className:`cost-guide-section`,children:[(0,i.jsxs)(`div`,{className:`cost-guide-section-heading`,children:[(0,i.jsx)(`h2`,{children:o.exampleTitle}),(0,i.jsx)(`p`,{children:o.exampleIntro})]}),(0,i.jsxs)(`div`,{className:`cost-guide-example-grid`,children:[(0,i.jsxs)(`article`,{className:`cost-guide-example-card`,children:[(0,i.jsx)(`h3`,{children:o.standard}),(0,i.jsx)(h,{example:y,currency:f,fxRate:v,locale:n,labels:o})]}),(0,i.jsxs)(`article`,{className:`cost-guide-example-card`,children:[(0,i.jsx)(`h3`,{children:o.priority}),b===null?(0,i.jsx)(`p`,{className:`cost-guide-unavailable`,children:o.unavailable}):(0,i.jsx)(h,{example:b,currency:f,fxRate:v,locale:n,labels:o})]})]}),(0,i.jsxs)(`div`,{className:`cost-guide-speed`,children:[(0,i.jsx)(`span`,{children:o.speedMultiplier}),(0,i.jsx)(`strong`,{children:S===null?o.unavailable:`${S.toFixed(2)}×`}),(0,i.jsxs)(`code`,{children:[o.priority,` `,o.total,` ÷ `,o.standard,` `,o.total]})]})]}),(0,i.jsxs)(`section`,{className:`cost-guide-section`,children:[(0,i.jsxs)(`div`,{className:`cost-guide-section-heading`,children:[(0,i.jsx)(`h2`,{children:o.longTitle}),(0,i.jsx)(`p`,{children:o.longIntro})]}),(0,i.jsxs)(`div`,{className:`cost-guide-context-summary`,children:[(0,i.jsxs)(`span`,{children:[o.threshold,`:`,` `,(0,i.jsx)(`strong`,{children:_.long_context_threshold_tokens===null?o.unavailable:m(_.long_context_threshold_tokens,n)})]}),(0,i.jsxs)(`span`,{children:[o.longInput,`:`,` `,(0,i.jsx)(`strong`,{children:x===null?o.unavailable:m(x.usage.input,n)})]}),(0,i.jsxs)(`span`,{children:[`Input/cache: `,(0,i.jsxs)(`strong`,{children:[_.long_context_input_multiplier,`×`]})]}),(0,i.jsxs)(`span`,{children:[`Output: `,(0,i.jsxs)(`strong`,{children:[_.long_context_output_multiplier,`×`]})]})]}),x===null?(0,i.jsx)(`p`,{className:`cost-guide-unavailable`,children:o.unavailable}):(0,i.jsx)(h,{example:x,currency:f,fxRate:v,locale:n,labels:o}),(0,i.jsxs)(`div`,{className:`cost-guide-unavailable-combination`,children:[(0,i.jsxs)(`strong`,{children:[o.priorityLong,`: `,o.unavailable]}),(0,i.jsx)(`p`,{children:o.priorityLongNote})]})]}),(0,i.jsx)(`aside`,{className:`cost-guide-final-note`,children:o.finalNote})]})}export{g as CostCalculationGuidePage};
1
+ import{n as e}from"./rolldown-runtime-Bh1tDfsg.js";import{E as t,w as n}from"./cost-monitor-zhY2JoLc.js";var r=e(t(),1),i=n(),a={input:1e5,cache:4e4,output:2e4,reasoning:8e3},o=e=>Math.round(e*1e6)/1e6;function s(e,t,n,r,i){let a=o(Math.max(e.input-e.cache,0)/1e6*t.input*n),s=o(e.cache/1e6*(t.cache??0)*n),c=o(e.output/1e6*t.output*r),l=o(a+s+c);return{usage:e,rates:t,inputMultiplier:n,outputMultiplier:r,inputUsd:a,cacheUsd:s,outputUsd:c,reasoningUsd:0,totalUsd:l,totalBrl:i===null?null:o(l*i)}}function c(e,t){if(t===`standard`)return{input:e.input_per_million_usd,cache:e.cached_input_per_million_usd,output:e.output_per_million_usd};let n=e.priority_input_per_million_usd,r=e.priority_output_per_million_usd;return n==null||r==null?null:{input:n,cache:e.priority_cached_input_per_million_usd??null,output:r}}function l(e,t,n){let r=c(e,t);return r===null?null:s(a,r,1,1,n)}function u(e,t){return e.long_context_threshold_tokens===null?null:s({input:e.long_context_threshold_tokens+5e4,cache:a.cache,output:a.output,reasoning:a.reasoning},c(e,`standard`),e.long_context_input_multiplier,e.long_context_output_multiplier,t)}var d={"pt-BR":{eyebrow:`CONFIGURAÇÕES · TRANSPARÊNCIA`,title:`Como o custo é calculado`,intro:`Do menor grão — uma chamada LLM — até o total: veja quais tokens entram na conta e como modelo, esforço, contexto e velocidade mudam o resultado.`,back:`Voltar ao dashboard`,model:`Modelo usado nos exemplos`,currency:`Moeda`,unavailable:`Indisponível`,millionRate:`por 1 milhão de tokens`,rateTitle:`1. Comece pelas tarifas do modelo`,rateIntro:`O modelo escolhe a tabela de preços. Priority/Fast usa outra tabela quando o catálogo publica essas tarifas.`,standard:`Standard`,priority:`Priority / Fast`,input:`Input`,cache:`Cache`,output:`Output`,reasoning:`Reasoning`,ratio:`Priority ÷ Standard`,included:`Incluído no output (+0)`,noPublishedRate:`Sem tarifa publicada (custo adicional 0)`,conceptsTitle:`2. Entenda cada parte da chamada`,concepts:[[`Chamada LLM`,`É o menor grão do cálculo: uma requisição ao provedor, com um modelo e um tier de serviço.`],[`Input tokens`,`Tudo que entra no modelo: instruções, histórico, contexto, ferramentas e a mensagem atual.`],[`Cache tokens`,`São parte do input, não tokens extras. Primeiro subtraímos o cache do input e depois aplicamos sua tarifa própria.`],[`Output tokens`,`É o total produzido pelo modelo. O custo usa o output total informado pela telemetria.`],[`Reasoning tokens`,`São parte do output. O cálculo atual cobra o output uma vez e mantém reasoningUsd = 0, evitando cobrança dupla.`],[`Modelo e esforço`,`O modelo muda as tarifas. O esforço não tem multiplicador próprio, mas pode gerar mais reasoning, output ou ciclos e aumentar o custo indiretamente.`],[`Multiplicador de contexto`,`Acima do limite do modelo, o multiplicador de input vale também para cache; o multiplicador de output vale para todo o output.`],[`Multiplicador de velocidade`,`É a razão derivada entre o total Priority/Fast e o Standard. Serve para comparar; nunca é multiplicado de novo no total.`]],exampleTitle:`3. Exemplo simples, parcela por parcela`,exampleIntro:`Uma chamada com 100 mil tokens de input, dos quais 40 mil vieram do cache, e 20 mil tokens de output, dos quais 8 mil são reasoning.`,billableInput:`Input faturável`,operation:`Operação`,cost:`Custo`,total:`Total da chamada`,speedMultiplier:`Multiplicador de velocidade derivado`,longTitle:`4. Exemplo com contexto longo`,longIntro:`Para realmente ultrapassar o limite, o exemplo usa o threshold do modelo + 50 mil tokens de input. A conta abaixo continua no tier Standard.`,threshold:`Limite do modelo`,longInput:`Input do exemplo longo`,priorityLong:`Priority/Fast + contexto longo`,priorityLongNote:`Indisponível: sem uma combinação publicada no catálogo, o dashboard não inventa uma tarifa.`,finalNote:`Regra prática: escolha o modelo e o tier, separe input de cache, cobre o output total uma única vez e só então aplique câmbio. Mais esforço só aumenta o custo quando aumenta o uso registrado.`},"en-US":{eyebrow:`SETTINGS · TRANSPARENCY`,title:`How cost is calculated`,intro:`From the smallest grain — one LLM call — to the total: see which tokens enter the calculation and how model, effort, context, and speed affect it.`,back:`Back to dashboard`,model:`Model used in the examples`,currency:`Currency`,unavailable:`Unavailable`,millionRate:`per 1 million tokens`,rateTitle:`1. Start with the model rates`,rateIntro:`The model selects the price table. Priority/Fast uses a different table when the catalog publishes those rates.`,standard:`Standard`,priority:`Priority / Fast`,input:`Input`,cache:`Cache`,output:`Output`,reasoning:`Reasoning`,ratio:`Priority ÷ Standard`,included:`Included in output (+0)`,noPublishedRate:`No published rate (additional cost 0)`,conceptsTitle:`2. Understand each part of the call`,concepts:[[`LLM call`,`The smallest calculation grain: one provider request with one model and one service tier.`],[`Input tokens`,`Everything sent to the model: instructions, history, context, tools, and the current message.`],[`Cache tokens`,`They are part of input, not extra tokens. Cache is subtracted from input first, then its own rate is applied.`],[`Output tokens`,`Everything produced by the model. Cost uses the total output reported by telemetry.`],[`Reasoning tokens`,`They are part of output. Current math charges output once and keeps reasoningUsd = 0, preventing double billing.`],[`Model and effort`,`The model changes rates. Effort has no direct multiplier, but it can produce more reasoning, output, or cycles and indirectly raise cost.`],[`Context multiplier`,`Above the model threshold, the input multiplier also applies to cache; the output multiplier applies to all output.`],[`Speed multiplier`,`It is the derived ratio between Priority/Fast and Standard totals. It is only a comparison and is never multiplied into the total again.`]],exampleTitle:`3. A simple example, component by component`,exampleIntro:`One call with 100 thousand input tokens, including 40 thousand cache tokens, and 20 thousand output tokens, including 8 thousand reasoning tokens.`,billableInput:`Billable input`,operation:`Operation`,cost:`Cost`,total:`Call total`,speedMultiplier:`Derived speed multiplier`,longTitle:`4. Long-context example`,longIntro:`To actually exceed the limit, this example uses the model threshold + 50 thousand input tokens. The calculation remains on Standard tier.`,threshold:`Model threshold`,longInput:`Long-example input`,priorityLong:`Priority/Fast + long context`,priorityLongNote:`Unavailable: without a published combination in the catalog, the dashboard does not invent a rate.`,finalNote:`Rule of thumb: choose model and tier, separate input from cache, charge total output once, then apply FX. Higher effort only raises cost when it raises recorded usage.`}};function f(e,t,n,r){if(t===`BRL`&&n===null)return r;let i=t===`BRL`?e*n:e;return new Intl.NumberFormat(t===`BRL`?`pt-BR`:`en-US`,{style:`currency`,currency:t,minimumFractionDigits:2,maximumFractionDigits:6}).format(i)}function p(e,t,n,r,i){return e==null?i:f(e,t,n,r)}function m(e,t){return new Intl.NumberFormat(t).format(e)}function h({example:e,currency:t,fxRate:n,locale:r,labels:a}){let o=a.unavailable,s=Math.max(e.usage.input-e.usage.cache,0),c=e.inputMultiplier===1?``:` × ${e.inputMultiplier}`,l=e.outputMultiplier===1?``:` × ${e.outputMultiplier}`,u=e.rates.cache??0,d=[{label:a.billableInput,operation:`${m(e.usage.input,r)} − ${m(e.usage.cache,r)} = ${m(s,r)} tokens`,cost:null},{label:a.input,operation:`${m(s,r)} ÷ 1M × ${p(e.rates.input,t,n,o,a.noPublishedRate)}${c}`,cost:e.inputUsd},{label:a.cache,operation:`${m(e.usage.cache,r)} ÷ 1M × ${p(u,t,n,o,a.noPublishedRate)}${c}`,cost:e.cacheUsd},{label:a.output,operation:`${m(e.usage.output,r)} ÷ 1M × ${p(e.rates.output,t,n,o,a.noPublishedRate)}${l}`,cost:e.outputUsd},{label:a.reasoning,operation:`${m(e.usage.reasoning,r)} tokens ⊂ ${a.output} → +0`,cost:e.reasoningUsd}];return(0,i.jsxs)(`div`,{className:`cost-guide-calculation`,children:[(0,i.jsxs)(`div`,{className:`cost-guide-calculation-head`,"aria-hidden":`true`,children:[(0,i.jsx)(`span`,{}),(0,i.jsx)(`span`,{children:a.operation}),(0,i.jsx)(`span`,{children:a.cost})]}),d.map(e=>(0,i.jsxs)(`div`,{className:`cost-guide-calculation-line`,children:[(0,i.jsx)(`strong`,{children:e.label}),(0,i.jsx)(`code`,{children:e.operation}),(0,i.jsx)(`span`,{children:e.cost===null?`—`:f(e.cost,t,n,o)})]},e.label)),(0,i.jsxs)(`div`,{className:`cost-guide-calculation-total`,children:[(0,i.jsx)(`strong`,{children:a.total}),(0,i.jsx)(`span`,{children:f(e.totalUsd,t,n,o)})]})]})}function g({catalog:e,fxRate:t,locale:n,onClose:a}){let o=d[n],[s,c]=(0,r.useState)(e.models[0]?.id??``),[f,g]=(0,r.useState)(`USD`),_=(0,r.useMemo)(()=>e.models.find(e=>e.id===s)??e.models[0]??null,[e.models,s]);if(_===null)return(0,i.jsxs)(`main`,{className:`cost-guide`,children:[(0,i.jsxs)(`button`,{onClick:a,type:`button`,children:[`← `,o.back]}),(0,i.jsx)(`h1`,{children:o.title}),(0,i.jsx)(`p`,{children:o.unavailable})]});let v=t?.rate??null,y=l(_,`standard`,v),b=l(_,`priority`,v),x=u(_,v),S=b!==null&&y.totalUsd>0?b.totalUsd/y.totalUsd:null,C=[{label:o.input,standard:_.input_per_million_usd,priority:_.priority_input_per_million_usd},{label:o.cache,standard:_.cached_input_per_million_usd,priority:_.priority_cached_input_per_million_usd},{label:o.output,standard:_.output_per_million_usd,priority:_.priority_output_per_million_usd}];return(0,i.jsxs)(`main`,{className:`cost-guide`,children:[(0,i.jsxs)(`header`,{children:[(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`small`,{children:o.eyebrow}),(0,i.jsx)(`h1`,{children:o.title}),(0,i.jsx)(`p`,{children:o.intro})]}),(0,i.jsxs)(`button`,{onClick:a,type:`button`,children:[`← `,o.back]})]}),(0,i.jsxs)(`section`,{className:`cost-guide-controls`,"aria-label":o.model,children:[(0,i.jsxs)(`label`,{children:[o.model,(0,i.jsx)(`select`,{value:_.id,onChange:e=>c(e.target.value),children:e.models.map(e=>(0,i.jsx)(`option`,{value:e.id,children:e.id},e.id))})]}),(0,i.jsxs)(`label`,{children:[o.currency,(0,i.jsxs)(`select`,{value:f,onChange:e=>g(e.target.value),children:[(0,i.jsx)(`option`,{value:`USD`,children:`USD`}),(0,i.jsxs)(`option`,{value:`BRL`,children:[`BRL `,v===null?`(${o.unavailable})`:`(1 USD = ${v.toFixed(4)} BRL)`]})]})]})]}),(0,i.jsxs)(`section`,{className:`cost-guide-section`,children:[(0,i.jsxs)(`div`,{className:`cost-guide-section-heading`,children:[(0,i.jsx)(`h2`,{children:o.rateTitle}),(0,i.jsx)(`p`,{children:o.rateIntro})]}),(0,i.jsx)(`div`,{className:`cost-guide-table-wrap`,children:(0,i.jsxs)(`table`,{children:[(0,i.jsxs)(`caption`,{children:[_.id,` · `,o.millionRate]}),(0,i.jsx)(`thead`,{children:(0,i.jsxs)(`tr`,{children:[(0,i.jsx)(`th`,{scope:`col`}),(0,i.jsx)(`th`,{scope:`col`,children:o.standard}),(0,i.jsx)(`th`,{scope:`col`,children:o.priority}),(0,i.jsx)(`th`,{scope:`col`,children:o.ratio})]})}),(0,i.jsxs)(`tbody`,{children:[C.map(e=>(0,i.jsxs)(`tr`,{children:[(0,i.jsx)(`th`,{scope:`row`,children:e.label}),(0,i.jsx)(`td`,{children:p(e.standard,f,v,o.unavailable,o.noPublishedRate)}),(0,i.jsx)(`td`,{children:p(e.priority,f,v,o.unavailable,o.noPublishedRate)}),(0,i.jsx)(`td`,{children:e.standard!==null&&e.standard>0&&e.priority!==null&&e.priority!==void 0?`${(e.priority/e.standard).toFixed(2)}×`:o.unavailable})]},e.label)),(0,i.jsxs)(`tr`,{children:[(0,i.jsx)(`th`,{scope:`row`,children:o.reasoning}),(0,i.jsx)(`td`,{colSpan:3,children:o.included})]})]})]})})]}),(0,i.jsxs)(`section`,{className:`cost-guide-section`,children:[(0,i.jsx)(`div`,{className:`cost-guide-section-heading`,children:(0,i.jsx)(`h2`,{children:o.conceptsTitle})}),(0,i.jsx)(`div`,{className:`cost-guide-blocks`,children:o.concepts.map(([e,t])=>(0,i.jsxs)(`article`,{children:[(0,i.jsx)(`strong`,{children:e}),(0,i.jsx)(`p`,{children:t})]},e))})]}),(0,i.jsxs)(`section`,{className:`cost-guide-section`,children:[(0,i.jsxs)(`div`,{className:`cost-guide-section-heading`,children:[(0,i.jsx)(`h2`,{children:o.exampleTitle}),(0,i.jsx)(`p`,{children:o.exampleIntro})]}),(0,i.jsxs)(`div`,{className:`cost-guide-example-grid`,children:[(0,i.jsxs)(`article`,{className:`cost-guide-example-card`,children:[(0,i.jsx)(`h3`,{children:o.standard}),(0,i.jsx)(h,{example:y,currency:f,fxRate:v,locale:n,labels:o})]}),(0,i.jsxs)(`article`,{className:`cost-guide-example-card`,children:[(0,i.jsx)(`h3`,{children:o.priority}),b===null?(0,i.jsx)(`p`,{className:`cost-guide-unavailable`,children:o.unavailable}):(0,i.jsx)(h,{example:b,currency:f,fxRate:v,locale:n,labels:o})]})]}),(0,i.jsxs)(`div`,{className:`cost-guide-speed`,children:[(0,i.jsx)(`span`,{children:o.speedMultiplier}),(0,i.jsx)(`strong`,{children:S===null?o.unavailable:`${S.toFixed(2)}×`}),(0,i.jsxs)(`code`,{children:[o.priority,` `,o.total,` ÷ `,o.standard,` `,o.total]})]})]}),(0,i.jsxs)(`section`,{className:`cost-guide-section`,children:[(0,i.jsxs)(`div`,{className:`cost-guide-section-heading`,children:[(0,i.jsx)(`h2`,{children:o.longTitle}),(0,i.jsx)(`p`,{children:o.longIntro})]}),(0,i.jsxs)(`div`,{className:`cost-guide-context-summary`,children:[(0,i.jsxs)(`span`,{children:[o.threshold,`:`,` `,(0,i.jsx)(`strong`,{children:_.long_context_threshold_tokens===null?o.unavailable:m(_.long_context_threshold_tokens,n)})]}),(0,i.jsxs)(`span`,{children:[o.longInput,`:`,` `,(0,i.jsx)(`strong`,{children:x===null?o.unavailable:m(x.usage.input,n)})]}),(0,i.jsxs)(`span`,{children:[`Input/cache: `,(0,i.jsxs)(`strong`,{children:[_.long_context_input_multiplier,`×`]})]}),(0,i.jsxs)(`span`,{children:[`Output: `,(0,i.jsxs)(`strong`,{children:[_.long_context_output_multiplier,`×`]})]})]}),x===null?(0,i.jsx)(`p`,{className:`cost-guide-unavailable`,children:o.unavailable}):(0,i.jsx)(h,{example:x,currency:f,fxRate:v,locale:n,labels:o}),(0,i.jsxs)(`div`,{className:`cost-guide-unavailable-combination`,children:[(0,i.jsxs)(`strong`,{children:[o.priorityLong,`: `,o.unavailable]}),(0,i.jsx)(`p`,{children:o.priorityLongNote})]})]}),(0,i.jsx)(`aside`,{className:`cost-guide-final-note`,children:o.finalNote})]})}export{g as CostCalculationGuidePage};