@zaip-ai/cli 1.3.5 → 1.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +7 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/services/install-agents-template.d.ts.map +1 -1
- package/dist/services/install-agents-template.js +18 -2
- package/dist/services/install-agents-template.js.map +1 -1
- package/dist/services/sqlite-bootstrap.d.ts +29 -0
- package/dist/services/sqlite-bootstrap.d.ts.map +1 -0
- package/dist/services/sqlite-bootstrap.js +141 -0
- package/dist/services/sqlite-bootstrap.js.map +1 -0
- package/dist/services/template-manifest.d.ts.map +1 -1
- package/dist/services/template-manifest.js +2 -0
- package/dist/services/template-manifest.js.map +1 -1
- package/package.json +2 -2
- package/templates/.agents/architecture/.gitkeep +0 -0
- package/templates/.agents/branding/.gitkeep +0 -0
- package/templates/.agents/dashboard/.zaip-managed.json +51 -39
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{CostCalculationGuidePage-D1mpyYwh.js → CostCalculationGuidePage-DwVZOmMV.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-CKO47D5s.js → DashboardHelpDialog--czwAlcH.js} +723 -723
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-BuSlCbyZ.js → PricingSettingsDialog-CyjMXkm8.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{ProjectSettingsPage-CUHFkAhZ.js → ProjectSettingsPage-B_Oj6Dlf.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-BmASq2gW.js → TraceabilityWorkspace-CAqYVin1.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{cost-monitor-Csj6LiAt.js → cost-monitor-C09KmlSw.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-VyTTl_ph.js → icons-vendor-DXBOtWNI.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-CblPpexd.js +2 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-CTC6vtln.js → react-vendor-DaNXQPyk.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{traceability-9Mtvbwrg.js → traceability-I4AKqVDX.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/index.html +5 -5
- package/templates/.agents/dashboard/apps/frontend/src/App.tsx +17 -8
- package/templates/.agents/dashboard/apps/frontend/src/cost-period-refresh.test.ts +8 -3
- package/templates/.agents/dashboard/apps/frontend/src/operations-period.test.ts +19 -1
- package/templates/.agents/dashboard/apps/frontend/src/operations-period.ts +8 -0
- package/templates/.agents/dashboard/apps/frontend/src/snapshot-coherence.test.ts +7 -4
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsFilteredStatusDialog.tsx +131 -0
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.tsx +2 -133
- package/templates/.agents/dashboard/modules/operations/src/react/operations-overview.status-cards.test.ts +13 -7
- package/templates/.agents/dashboard/packages/local-runtime/src/server.test.ts +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-prerequisites.mjs +40 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-prerequisites.test.mjs +46 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.mjs +33 -26
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.test.mjs +5 -8
- package/templates/.agents/dashboard/tests/e2e/specs/cost-monitor-loading.spec.ts +4 -6
- package/templates/.agents/dashboard/tests/e2e/specs/cost-monitor-period-transition.spec.ts +37 -17
- package/templates/.agents/dashboard/tests/e2e/specs/dashboard-performance-matrix.spec.ts +5 -3
- package/templates/.agents/dashboard/tests/e2e/specs/dashboard.spec.ts +12 -5
- package/templates/.agents/growth/.gitkeep +0 -0
- package/templates/.agents/marketing/.gitkeep +0 -0
- package/templates/.agents/requirements/autonomous-assurance.md +1 -1
- package/templates/.agents/requirements/comparative-audit.md +1 -1
- package/templates/.agents/requirements/context-engine.md +1 -1
- package/templates/.agents/requirements/cost-observability.md +1 -1
- package/templates/.agents/requirements/dashboard-launch.md +1 -1
- package/templates/.agents/requirements/data-export.md +1 -1
- package/templates/.agents/requirements/design-system.md +1 -1
- package/templates/.agents/requirements/execution-engine.md +1 -1
- package/templates/.agents/requirements/kanban-dashboard.md +1 -1
- package/templates/.agents/requirements/model-orchestration.md +1 -1
- package/templates/.agents/requirements/public-distribution.md +1 -1
- package/templates/.agents/requirements/software-architecture.md +1 -1
- package/templates/.agents/requirements/strategic-improvements.md +1 -1
- package/templates/.agents/requirements/work-lifecycle.md +1 -1
- package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
- package/templates/.agents/sales/.gitkeep +0 -0
- package/templates/README.md +722 -0
- package/templates/template-manifest.json +84 -85
- package/templates/.agents/architecture/software-architecture.md +0 -131
- package/templates/.agents/branding/brandbook.docx +0 -0
- package/templates/.agents/branding/brandbook.md +0 -60
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-DIwDvCu5.js +0 -2
- package/templates/.agents/growth/estrategia-bootstrap-90-dias.md +0 -169
- package/templates/.agents/growth/strategy.md +0 -27
- package/templates/.agents/marketing/estrategia-marketing-zaip-90-dias.md +0 -197
- package/templates/.agents/marketing/strategy.md +0 -29
- package/templates/.agents/sales/playbook.md +0 -32
- package/templates/.agents/sales/roteiro-comercial-zaip.md +0 -252
|
@@ -11,40 +11,40 @@
|
|
|
11
11
|
"sha256": "3143012996b26937008ab04579aac89917acfb5e52a7071c0326a3000b73fb9f"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
"path": "apps/frontend/dist/assets/CostCalculationGuidePage-
|
|
15
|
-
"sha256": "
|
|
14
|
+
"path": "apps/frontend/dist/assets/CostCalculationGuidePage-DwVZOmMV.js",
|
|
15
|
+
"sha256": "f23b037ea7fc6f2637a23fcb26ce98947bf0c010afc210d18b576eb69c823433"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
|
-
"path": "apps/frontend/dist/assets/DashboardHelpDialog
|
|
19
|
-
"sha256": "
|
|
18
|
+
"path": "apps/frontend/dist/assets/DashboardHelpDialog--czwAlcH.js",
|
|
19
|
+
"sha256": "4c7db60a41c42384e9b69a4967e4b98e1027c52368c0f5eef8512fc449526dd5"
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"path": "apps/frontend/dist/assets/DashboardHelpDialog-Je5nK-Et.css",
|
|
23
23
|
"sha256": "aafa708825ff8417d2de8ce9f45b94c899aa9ae5c5068bf5ce4def13e9c00643"
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
|
-
"path": "apps/frontend/dist/assets/PricingSettingsDialog-
|
|
27
|
-
"sha256": "
|
|
26
|
+
"path": "apps/frontend/dist/assets/PricingSettingsDialog-CyjMXkm8.js",
|
|
27
|
+
"sha256": "513303fc87731bdd588162d98a4b15d679df779602f61f022f739e2c031e8dfa"
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
|
-
"path": "apps/frontend/dist/assets/ProjectSettingsPage-
|
|
31
|
-
"sha256": "
|
|
30
|
+
"path": "apps/frontend/dist/assets/ProjectSettingsPage-B_Oj6Dlf.js",
|
|
31
|
+
"sha256": "a39c63f65b3c93196f78abef17032281872d951322f4e15e120cfdcc9b420d27"
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
|
-
"path": "apps/frontend/dist/assets/ProjectSettingsPage-
|
|
35
|
-
"sha256": "
|
|
34
|
+
"path": "apps/frontend/dist/assets/ProjectSettingsPage-BomxqCBU.css",
|
|
35
|
+
"sha256": "36b1e5da18839d94f78280b5b9e6a4d7b07f2fb8bae757e9496f9ab51ef42e1f"
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
|
-
"path": "apps/frontend/dist/assets/TraceabilityWorkspace-
|
|
39
|
-
"sha256": "
|
|
38
|
+
"path": "apps/frontend/dist/assets/TraceabilityWorkspace-CAqYVin1.js",
|
|
39
|
+
"sha256": "5f9559e34e723a1c61e0ec689d770c7bd80332a2f754365e722206c8d92e018f"
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
"path": "apps/frontend/dist/assets/TraceabilityWorkspace-DvvavDLY.css",
|
|
43
43
|
"sha256": "2dc93c190042edd2f5c585aab941bcaa5506aa1a8b5f26afa6e99996ce957e35"
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
|
-
"path": "apps/frontend/dist/assets/cost-monitor-
|
|
47
|
-
"sha256": "
|
|
46
|
+
"path": "apps/frontend/dist/assets/cost-monitor-C09KmlSw.js",
|
|
47
|
+
"sha256": "8cbf8833e15baa3535f0d418a28be610c13a694536a126e3c8512e63a6f942e5"
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
"path": "apps/frontend/dist/assets/cost-monitor-PoJA2PI1.css",
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
"sha256": "8cc193dc078b845250b86e2eb5b406bf3a521c2582099f8a60e7b111b417d7e4"
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
|
-
"path": "apps/frontend/dist/assets/icons-vendor-
|
|
59
|
-
"sha256": "
|
|
58
|
+
"path": "apps/frontend/dist/assets/icons-vendor-DXBOtWNI.js",
|
|
59
|
+
"sha256": "85e0d82ec83ee57fd8a3d32cbf29d0e6c2dc8a987734f733437788c7f3e2e1dc"
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
|
-
"path": "apps/frontend/dist/assets/index-
|
|
63
|
-
"sha256": "
|
|
62
|
+
"path": "apps/frontend/dist/assets/index-CblPpexd.js",
|
|
63
|
+
"sha256": "8962739e3b7478cf27771f0d1b0a1c17f07c5ccda90008f793214f37521a5e70"
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
"path": "apps/frontend/dist/assets/index-hPPfVGQv.css",
|
|
@@ -71,28 +71,28 @@
|
|
|
71
71
|
"sha256": "bb6043bda9fc53a111aaea4d6a004559b9ce8a3569691c060d217a7c6aafa0ae"
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
|
-
"path": "apps/frontend/dist/assets/react-vendor-
|
|
75
|
-
"sha256": "
|
|
74
|
+
"path": "apps/frontend/dist/assets/react-vendor-DaNXQPyk.js",
|
|
75
|
+
"sha256": "5be8694a659fe3cefd1609a104ae32eeb6a715ebf62fd2eefd13e034ac71efd1"
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
"path": "apps/frontend/dist/assets/rolldown-runtime-D9-fqq9M.js",
|
|
79
79
|
"sha256": "a2b9cf4b963756dc2cae1ebdd1c0e51ef5780dd5bf64a55b90e21679c2b2434f"
|
|
80
80
|
},
|
|
81
|
-
{
|
|
82
|
-
"path": "apps/frontend/dist/assets/traceability-9Mtvbwrg.js",
|
|
83
|
-
"sha256": "855fca326df285a74532ea5bbfb8d61a3bbf849bd5987715177db1bb23be214e"
|
|
84
|
-
},
|
|
85
81
|
{
|
|
86
82
|
"path": "apps/frontend/dist/assets/traceability-DFY7ZDlu.css",
|
|
87
83
|
"sha256": "3134c9eb5bbbdb1e48e1001fe6c4b7fd32840db04d9782587f2c4f6eacc21a64"
|
|
88
84
|
},
|
|
85
|
+
{
|
|
86
|
+
"path": "apps/frontend/dist/assets/traceability-I4AKqVDX.js",
|
|
87
|
+
"sha256": "a695779b354ebc033f3c6f3b5c03d3993e7b55717ba8bb545436553ceb815824"
|
|
88
|
+
},
|
|
89
89
|
{
|
|
90
90
|
"path": "apps/frontend/dist/icon_zaip.png",
|
|
91
91
|
"sha256": "bb116d61da49fd0d66ff096c3db5e7365b8dae951b7f42fb6f68045aa89bac6e"
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
94
|
"path": "apps/frontend/dist/index.html",
|
|
95
|
-
"sha256": "
|
|
95
|
+
"sha256": "34ba95a4f02e4f3b1594d2de59493e59ed4992d53f2c786b928643c2d6349d65"
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
98
|
"path": "apps/frontend/dist/logo_novo_azul.png",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
122
|
"path": "apps/frontend/src/App.tsx",
|
|
123
|
-
"sha256": "
|
|
123
|
+
"sha256": "5d25e366b21b059909ff495e449895f401b1625f03980cf982d80643de48df42"
|
|
124
124
|
},
|
|
125
125
|
{
|
|
126
126
|
"path": "apps/frontend/src/AppLoadingBoundary.tsx",
|
|
@@ -204,7 +204,7 @@
|
|
|
204
204
|
},
|
|
205
205
|
{
|
|
206
206
|
"path": "apps/frontend/src/cost-period-refresh.test.ts",
|
|
207
|
-
"sha256": "
|
|
207
|
+
"sha256": "59d14d1ab70d90e4a6adb4eff1786e2572d2fa18b94b8142d490b69d4676debb"
|
|
208
208
|
},
|
|
209
209
|
{
|
|
210
210
|
"path": "apps/frontend/src/dashboard-api.test.ts",
|
|
@@ -264,11 +264,11 @@
|
|
|
264
264
|
},
|
|
265
265
|
{
|
|
266
266
|
"path": "apps/frontend/src/operations-period.test.ts",
|
|
267
|
-
"sha256": "
|
|
267
|
+
"sha256": "9f4d2b4df493ec5e6a310221df4f9acca78e0e0646f9b3ee54ffd30086c60d45"
|
|
268
268
|
},
|
|
269
269
|
{
|
|
270
270
|
"path": "apps/frontend/src/operations-period.ts",
|
|
271
|
-
"sha256": "
|
|
271
|
+
"sha256": "3507604b3a4b8231d0a84a64d61df3291f6b1d42620342cc2c216c90f8f9b8bf"
|
|
272
272
|
},
|
|
273
273
|
{
|
|
274
274
|
"path": "apps/frontend/src/overview-status-page.test.ts",
|
|
@@ -300,7 +300,7 @@
|
|
|
300
300
|
},
|
|
301
301
|
{
|
|
302
302
|
"path": "apps/frontend/src/snapshot-coherence.test.ts",
|
|
303
|
-
"sha256": "
|
|
303
|
+
"sha256": "3003dbf6474016ae15c47604e2d69dc893660eb4d3426c6812276ec2aeac5b87"
|
|
304
304
|
},
|
|
305
305
|
{
|
|
306
306
|
"path": "apps/frontend/src/snapshot-coherence.ts",
|
|
@@ -778,6 +778,10 @@
|
|
|
778
778
|
"path": "modules/operations/src/react/OperationDateFilters.tsx",
|
|
779
779
|
"sha256": "b65dc7a9aba20ea35a9c226e5fc53ba2d95cfaa3a100cb719c0fc8013c5b9b31"
|
|
780
780
|
},
|
|
781
|
+
{
|
|
782
|
+
"path": "modules/operations/src/react/OperationsFilteredStatusDialog.tsx",
|
|
783
|
+
"sha256": "6881f58366632c2dc4bab1b13cec348a31a0ce31e9741cdd90c544b25c3695ce"
|
|
784
|
+
},
|
|
781
785
|
{
|
|
782
786
|
"path": "modules/operations/src/react/OperationsIcons.tsx",
|
|
783
787
|
"sha256": "0672428aba9c5720e59f59e499e3ef00603dd538fd080449bb3992ce01e6fa96"
|
|
@@ -800,7 +804,7 @@
|
|
|
800
804
|
},
|
|
801
805
|
{
|
|
802
806
|
"path": "modules/operations/src/react/OperationsOverview.tsx",
|
|
803
|
-
"sha256": "
|
|
807
|
+
"sha256": "864f5df7f377f0e9fba319c6d79f566b5285b17fc71c67466128a9b4a46ffe33"
|
|
804
808
|
},
|
|
805
809
|
{
|
|
806
810
|
"path": "modules/operations/src/react/OperationsOverviewTopPanel.tsx",
|
|
@@ -1048,7 +1052,7 @@
|
|
|
1048
1052
|
},
|
|
1049
1053
|
{
|
|
1050
1054
|
"path": "modules/operations/src/react/operations-overview.status-cards.test.ts",
|
|
1051
|
-
"sha256": "
|
|
1055
|
+
"sha256": "9e6df562cec6146256d71311e3a6df2411f018ed5ea7a8009ef82ee6eabfc4ee"
|
|
1052
1056
|
},
|
|
1053
1057
|
{
|
|
1054
1058
|
"path": "modules/operations/src/react/operations-page-contract.ts",
|
|
@@ -1652,7 +1656,7 @@
|
|
|
1652
1656
|
},
|
|
1653
1657
|
{
|
|
1654
1658
|
"path": "packages/local-runtime/src/server.test.ts",
|
|
1655
|
-
"sha256": "
|
|
1659
|
+
"sha256": "491e10db3aadb62df4b47bbe07851e5a3f726cb820f3488e0a33588bd38189cc"
|
|
1656
1660
|
},
|
|
1657
1661
|
{
|
|
1658
1662
|
"path": "packages/local-runtime/src/server.ts",
|
|
@@ -1822,6 +1826,14 @@
|
|
|
1822
1826
|
"path": "packages/local-runtime/start-dashboard-lifecycle.test.mjs",
|
|
1823
1827
|
"sha256": "4446c89a7d0674e8cc8eefec57c95d1354b5a89eb9fb2310e4b73790ca6efdf8"
|
|
1824
1828
|
},
|
|
1829
|
+
{
|
|
1830
|
+
"path": "packages/local-runtime/start-dashboard-prerequisites.mjs",
|
|
1831
|
+
"sha256": "d4d8db08332fd72409899a1db02191ed1b5a6cfcb1edb4f3b307b465ec761227"
|
|
1832
|
+
},
|
|
1833
|
+
{
|
|
1834
|
+
"path": "packages/local-runtime/start-dashboard-prerequisites.test.mjs",
|
|
1835
|
+
"sha256": "09b45d72d4940849fa64c94ea5e82928a4f1dc0073d57f38cbb30ac6b997467b"
|
|
1836
|
+
},
|
|
1825
1837
|
{
|
|
1826
1838
|
"path": "packages/local-runtime/start-dashboard-processes.mjs",
|
|
1827
1839
|
"sha256": "ea296acaf7786e019e2de9e88c5b9e6c4fa5a94a662b498195936600470beda1"
|
|
@@ -1832,11 +1844,11 @@
|
|
|
1832
1844
|
},
|
|
1833
1845
|
{
|
|
1834
1846
|
"path": "packages/local-runtime/start-dashboard.mjs",
|
|
1835
|
-
"sha256": "
|
|
1847
|
+
"sha256": "82eb5996a3833770b1cbb4660b498f7fb1b4ffb54222ee5fe87fc14bce441767"
|
|
1836
1848
|
},
|
|
1837
1849
|
{
|
|
1838
1850
|
"path": "packages/local-runtime/start-dashboard.test.mjs",
|
|
1839
|
-
"sha256": "
|
|
1851
|
+
"sha256": "7d78cb000f734c7669ff68edd0c977780028c291a3bfe099392b73d3c575cf99"
|
|
1840
1852
|
},
|
|
1841
1853
|
{
|
|
1842
1854
|
"path": "packages/local-runtime/tsconfig.json",
|
|
@@ -1932,7 +1944,7 @@
|
|
|
1932
1944
|
},
|
|
1933
1945
|
{
|
|
1934
1946
|
"path": "tests/e2e/specs/cost-monitor-loading.spec.ts",
|
|
1935
|
-
"sha256": "
|
|
1947
|
+
"sha256": "a5413ed22b6b8e76b585d77d10b353682bab8f0cb4b82ee211f82a740af017d1"
|
|
1936
1948
|
},
|
|
1937
1949
|
{
|
|
1938
1950
|
"path": "tests/e2e/specs/cost-monitor-pagination.spec.ts",
|
|
@@ -1940,15 +1952,15 @@
|
|
|
1940
1952
|
},
|
|
1941
1953
|
{
|
|
1942
1954
|
"path": "tests/e2e/specs/cost-monitor-period-transition.spec.ts",
|
|
1943
|
-
"sha256": "
|
|
1955
|
+
"sha256": "a0eb272ec3954737610d02900b5881d471224f7d8cd805a441a1a32d7821c066"
|
|
1944
1956
|
},
|
|
1945
1957
|
{
|
|
1946
1958
|
"path": "tests/e2e/specs/dashboard-performance-matrix.spec.ts",
|
|
1947
|
-
"sha256": "
|
|
1959
|
+
"sha256": "ad614c1da5b726cb376171ac8fb53e85487c09fe547cd0bcf14b4ffbea723f55"
|
|
1948
1960
|
},
|
|
1949
1961
|
{
|
|
1950
1962
|
"path": "tests/e2e/specs/dashboard.spec.ts",
|
|
1951
|
-
"sha256": "
|
|
1963
|
+
"sha256": "d7e88fd42e032a42d835b32e7885652814e29a160b935d8b9a73580a103fe516"
|
|
1952
1964
|
},
|
|
1953
1965
|
{
|
|
1954
1966
|
"path": "tests/e2e/tsconfig.json",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as e,b as t}from"./cost-monitor-Csj6LiAt.js";var n=e(),r=t(),i={input:1e5,cache:4e4,output:2e4,reasoning:8e3},a=e=>Math.round(e*1e6)/1e6;function o(e,t,n,r,i){let o=a(Math.max(e.input-e.cache,0)/1e6*t.input*n),s=a(e.cache/1e6*(t.cache??0)*n),c=a(e.output/1e6*t.output*r),l=a(o+s+c);return{usage:e,rates:t,inputMultiplier:n,outputMultiplier:r,inputUsd:o,cacheUsd:s,outputUsd:c,reasoningUsd:0,totalUsd:l,totalBrl:i===null?null:a(l*i)}}function s(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 c(e,t,n){let r=s(e,t);return r===null?null:o(i,r,1,1,n)}function l(e,t){return e.long_context_threshold_tokens===null?null:o({input:e.long_context_threshold_tokens+5e4,cache:i.cache,output:i.output,reasoning:i.reasoning},s(e,`standard`),e.long_context_input_multiplier,e.long_context_output_multiplier,t)}var u={"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 d(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 f(e,t,n,r,i){return e==null?i:d(e,t,n,r)}function p(e,t){return new Intl.NumberFormat(t).format(e)}function m({example:e,currency:t,fxRate:n,locale:i,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,m=[{label:a.billableInput,operation:`${p(e.usage.input,i)} − ${p(e.usage.cache,i)} = ${p(s,i)} tokens`,cost:null},{label:a.input,operation:`${p(s,i)} ÷ 1M × ${f(e.rates.input,t,n,o,a.noPublishedRate)}${c}`,cost:e.inputUsd},{label:a.cache,operation:`${p(e.usage.cache,i)} ÷ 1M × ${f(u,t,n,o,a.noPublishedRate)}${c}`,cost:e.cacheUsd},{label:a.output,operation:`${p(e.usage.output,i)} ÷ 1M × ${f(e.rates.output,t,n,o,a.noPublishedRate)}${l}`,cost:e.outputUsd},{label:a.reasoning,operation:`${p(e.usage.reasoning,i)} tokens ⊂ ${a.output} → +0`,cost:e.reasoningUsd}];return(0,r.jsxs)(`div`,{className:`cost-guide-calculation`,children:[(0,r.jsxs)(`div`,{className:`cost-guide-calculation-head`,"aria-hidden":`true`,children:[(0,r.jsx)(`span`,{}),(0,r.jsx)(`span`,{children:a.operation}),(0,r.jsx)(`span`,{children:a.cost})]}),m.map(e=>(0,r.jsxs)(`div`,{className:`cost-guide-calculation-line`,children:[(0,r.jsx)(`strong`,{children:e.label}),(0,r.jsx)(`code`,{children:e.operation}),(0,r.jsx)(`span`,{children:e.cost===null?`—`:d(e.cost,t,n,o)})]},e.label)),(0,r.jsxs)(`div`,{className:`cost-guide-calculation-total`,children:[(0,r.jsx)(`strong`,{children:a.total}),(0,r.jsx)(`span`,{children:d(e.totalUsd,t,n,o)})]})]})}function h({catalog:e,fxRate:t,locale:i,onClose:a}){let o=u[i],[s,d]=(0,n.useState)(e.models[0]?.id??``),[h,g]=(0,n.useState)(`USD`),_=(0,n.useMemo)(()=>e.models.find(e=>e.id===s)??e.models[0]??null,[e.models,s]);if(_===null)return(0,r.jsxs)(`main`,{className:`cost-guide`,children:[(0,r.jsxs)(`button`,{onClick:a,type:`button`,children:[`← `,o.back]}),(0,r.jsx)(`h1`,{children:o.title}),(0,r.jsx)(`p`,{children:o.unavailable})]});let v=t?.rate??null,y=c(_,`standard`,v),b=c(_,`priority`,v),x=l(_,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,r.jsxs)(`main`,{className:`cost-guide`,children:[(0,r.jsxs)(`header`,{children:[(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`small`,{children:o.eyebrow}),(0,r.jsx)(`h1`,{children:o.title}),(0,r.jsx)(`p`,{children:o.intro})]}),(0,r.jsxs)(`button`,{onClick:a,type:`button`,children:[`← `,o.back]})]}),(0,r.jsxs)(`section`,{className:`cost-guide-controls`,"aria-label":o.model,children:[(0,r.jsxs)(`label`,{children:[o.model,(0,r.jsx)(`select`,{value:_.id,onChange:e=>d(e.target.value),children:e.models.map(e=>(0,r.jsx)(`option`,{value:e.id,children:e.id},e.id))})]}),(0,r.jsxs)(`label`,{children:[o.currency,(0,r.jsxs)(`select`,{value:h,onChange:e=>g(e.target.value),children:[(0,r.jsx)(`option`,{value:`USD`,children:`USD`}),(0,r.jsxs)(`option`,{value:`BRL`,children:[`BRL `,v===null?`(${o.unavailable})`:`(1 USD = ${v.toFixed(4)} BRL)`]})]})]})]}),(0,r.jsxs)(`section`,{className:`cost-guide-section`,children:[(0,r.jsxs)(`div`,{className:`cost-guide-section-heading`,children:[(0,r.jsx)(`h2`,{children:o.rateTitle}),(0,r.jsx)(`p`,{children:o.rateIntro})]}),(0,r.jsx)(`div`,{className:`cost-guide-table-wrap`,children:(0,r.jsxs)(`table`,{children:[(0,r.jsxs)(`caption`,{children:[_.id,` · `,o.millionRate]}),(0,r.jsx)(`thead`,{children:(0,r.jsxs)(`tr`,{children:[(0,r.jsx)(`th`,{scope:`col`}),(0,r.jsx)(`th`,{scope:`col`,children:o.standard}),(0,r.jsx)(`th`,{scope:`col`,children:o.priority}),(0,r.jsx)(`th`,{scope:`col`,children:o.ratio})]})}),(0,r.jsxs)(`tbody`,{children:[C.map(e=>(0,r.jsxs)(`tr`,{children:[(0,r.jsx)(`th`,{scope:`row`,children:e.label}),(0,r.jsx)(`td`,{children:f(e.standard,h,v,o.unavailable,o.noPublishedRate)}),(0,r.jsx)(`td`,{children:f(e.priority,h,v,o.unavailable,o.noPublishedRate)}),(0,r.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,r.jsxs)(`tr`,{children:[(0,r.jsx)(`th`,{scope:`row`,children:o.reasoning}),(0,r.jsx)(`td`,{colSpan:3,children:o.included})]})]})]})})]}),(0,r.jsxs)(`section`,{className:`cost-guide-section`,children:[(0,r.jsx)(`div`,{className:`cost-guide-section-heading`,children:(0,r.jsx)(`h2`,{children:o.conceptsTitle})}),(0,r.jsx)(`div`,{className:`cost-guide-blocks`,children:o.concepts.map(([e,t])=>(0,r.jsxs)(`article`,{children:[(0,r.jsx)(`strong`,{children:e}),(0,r.jsx)(`p`,{children:t})]},e))})]}),(0,r.jsxs)(`section`,{className:`cost-guide-section`,children:[(0,r.jsxs)(`div`,{className:`cost-guide-section-heading`,children:[(0,r.jsx)(`h2`,{children:o.exampleTitle}),(0,r.jsx)(`p`,{children:o.exampleIntro})]}),(0,r.jsxs)(`div`,{className:`cost-guide-example-grid`,children:[(0,r.jsxs)(`article`,{className:`cost-guide-example-card`,children:[(0,r.jsx)(`h3`,{children:o.standard}),(0,r.jsx)(m,{example:y,currency:h,fxRate:v,locale:i,labels:o})]}),(0,r.jsxs)(`article`,{className:`cost-guide-example-card`,children:[(0,r.jsx)(`h3`,{children:o.priority}),b===null?(0,r.jsx)(`p`,{className:`cost-guide-unavailable`,children:o.unavailable}):(0,r.jsx)(m,{example:b,currency:h,fxRate:v,locale:i,labels:o})]})]}),(0,r.jsxs)(`div`,{className:`cost-guide-speed`,children:[(0,r.jsx)(`span`,{children:o.speedMultiplier}),(0,r.jsx)(`strong`,{children:S===null?o.unavailable:`${S.toFixed(2)}×`}),(0,r.jsxs)(`code`,{children:[o.priority,` `,o.total,` ÷ `,o.standard,` `,o.total]})]})]}),(0,r.jsxs)(`section`,{className:`cost-guide-section`,children:[(0,r.jsxs)(`div`,{className:`cost-guide-section-heading`,children:[(0,r.jsx)(`h2`,{children:o.longTitle}),(0,r.jsx)(`p`,{children:o.longIntro})]}),(0,r.jsxs)(`div`,{className:`cost-guide-context-summary`,children:[(0,r.jsxs)(`span`,{children:[o.threshold,`:`,` `,(0,r.jsx)(`strong`,{children:_.long_context_threshold_tokens===null?o.unavailable:p(_.long_context_threshold_tokens,i)})]}),(0,r.jsxs)(`span`,{children:[o.longInput,`:`,` `,(0,r.jsx)(`strong`,{children:x===null?o.unavailable:p(x.usage.input,i)})]}),(0,r.jsxs)(`span`,{children:[`Input/cache: `,(0,r.jsxs)(`strong`,{children:[_.long_context_input_multiplier,`×`]})]}),(0,r.jsxs)(`span`,{children:[`Output: `,(0,r.jsxs)(`strong`,{children:[_.long_context_output_multiplier,`×`]})]})]}),x===null?(0,r.jsx)(`p`,{className:`cost-guide-unavailable`,children:o.unavailable}):(0,r.jsx)(m,{example:x,currency:h,fxRate:v,locale:i,labels:o}),(0,r.jsxs)(`div`,{className:`cost-guide-unavailable-combination`,children:[(0,r.jsxs)(`strong`,{children:[o.priorityLong,`: `,o.unavailable]}),(0,r.jsx)(`p`,{children:o.priorityLongNote})]})]}),(0,r.jsx)(`aside`,{className:`cost-guide-final-note`,children:o.finalNote})]})}export{h as CostCalculationGuidePage};
|
|
1
|
+
import{S as e,b as t}from"./cost-monitor-C09KmlSw.js";var n=e(),r=t(),i={input:1e5,cache:4e4,output:2e4,reasoning:8e3},a=e=>Math.round(e*1e6)/1e6;function o(e,t,n,r,i){let o=a(Math.max(e.input-e.cache,0)/1e6*t.input*n),s=a(e.cache/1e6*(t.cache??0)*n),c=a(e.output/1e6*t.output*r),l=a(o+s+c);return{usage:e,rates:t,inputMultiplier:n,outputMultiplier:r,inputUsd:o,cacheUsd:s,outputUsd:c,reasoningUsd:0,totalUsd:l,totalBrl:i===null?null:a(l*i)}}function s(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 c(e,t,n){let r=s(e,t);return r===null?null:o(i,r,1,1,n)}function l(e,t){return e.long_context_threshold_tokens===null?null:o({input:e.long_context_threshold_tokens+5e4,cache:i.cache,output:i.output,reasoning:i.reasoning},s(e,`standard`),e.long_context_input_multiplier,e.long_context_output_multiplier,t)}var u={"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 d(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 f(e,t,n,r,i){return e==null?i:d(e,t,n,r)}function p(e,t){return new Intl.NumberFormat(t).format(e)}function m({example:e,currency:t,fxRate:n,locale:i,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,m=[{label:a.billableInput,operation:`${p(e.usage.input,i)} − ${p(e.usage.cache,i)} = ${p(s,i)} tokens`,cost:null},{label:a.input,operation:`${p(s,i)} ÷ 1M × ${f(e.rates.input,t,n,o,a.noPublishedRate)}${c}`,cost:e.inputUsd},{label:a.cache,operation:`${p(e.usage.cache,i)} ÷ 1M × ${f(u,t,n,o,a.noPublishedRate)}${c}`,cost:e.cacheUsd},{label:a.output,operation:`${p(e.usage.output,i)} ÷ 1M × ${f(e.rates.output,t,n,o,a.noPublishedRate)}${l}`,cost:e.outputUsd},{label:a.reasoning,operation:`${p(e.usage.reasoning,i)} tokens ⊂ ${a.output} → +0`,cost:e.reasoningUsd}];return(0,r.jsxs)(`div`,{className:`cost-guide-calculation`,children:[(0,r.jsxs)(`div`,{className:`cost-guide-calculation-head`,"aria-hidden":`true`,children:[(0,r.jsx)(`span`,{}),(0,r.jsx)(`span`,{children:a.operation}),(0,r.jsx)(`span`,{children:a.cost})]}),m.map(e=>(0,r.jsxs)(`div`,{className:`cost-guide-calculation-line`,children:[(0,r.jsx)(`strong`,{children:e.label}),(0,r.jsx)(`code`,{children:e.operation}),(0,r.jsx)(`span`,{children:e.cost===null?`—`:d(e.cost,t,n,o)})]},e.label)),(0,r.jsxs)(`div`,{className:`cost-guide-calculation-total`,children:[(0,r.jsx)(`strong`,{children:a.total}),(0,r.jsx)(`span`,{children:d(e.totalUsd,t,n,o)})]})]})}function h({catalog:e,fxRate:t,locale:i,onClose:a}){let o=u[i],[s,d]=(0,n.useState)(e.models[0]?.id??``),[h,g]=(0,n.useState)(`USD`),_=(0,n.useMemo)(()=>e.models.find(e=>e.id===s)??e.models[0]??null,[e.models,s]);if(_===null)return(0,r.jsxs)(`main`,{className:`cost-guide`,children:[(0,r.jsxs)(`button`,{onClick:a,type:`button`,children:[`← `,o.back]}),(0,r.jsx)(`h1`,{children:o.title}),(0,r.jsx)(`p`,{children:o.unavailable})]});let v=t?.rate??null,y=c(_,`standard`,v),b=c(_,`priority`,v),x=l(_,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,r.jsxs)(`main`,{className:`cost-guide`,children:[(0,r.jsxs)(`header`,{children:[(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`small`,{children:o.eyebrow}),(0,r.jsx)(`h1`,{children:o.title}),(0,r.jsx)(`p`,{children:o.intro})]}),(0,r.jsxs)(`button`,{onClick:a,type:`button`,children:[`← `,o.back]})]}),(0,r.jsxs)(`section`,{className:`cost-guide-controls`,"aria-label":o.model,children:[(0,r.jsxs)(`label`,{children:[o.model,(0,r.jsx)(`select`,{value:_.id,onChange:e=>d(e.target.value),children:e.models.map(e=>(0,r.jsx)(`option`,{value:e.id,children:e.id},e.id))})]}),(0,r.jsxs)(`label`,{children:[o.currency,(0,r.jsxs)(`select`,{value:h,onChange:e=>g(e.target.value),children:[(0,r.jsx)(`option`,{value:`USD`,children:`USD`}),(0,r.jsxs)(`option`,{value:`BRL`,children:[`BRL `,v===null?`(${o.unavailable})`:`(1 USD = ${v.toFixed(4)} BRL)`]})]})]})]}),(0,r.jsxs)(`section`,{className:`cost-guide-section`,children:[(0,r.jsxs)(`div`,{className:`cost-guide-section-heading`,children:[(0,r.jsx)(`h2`,{children:o.rateTitle}),(0,r.jsx)(`p`,{children:o.rateIntro})]}),(0,r.jsx)(`div`,{className:`cost-guide-table-wrap`,children:(0,r.jsxs)(`table`,{children:[(0,r.jsxs)(`caption`,{children:[_.id,` · `,o.millionRate]}),(0,r.jsx)(`thead`,{children:(0,r.jsxs)(`tr`,{children:[(0,r.jsx)(`th`,{scope:`col`}),(0,r.jsx)(`th`,{scope:`col`,children:o.standard}),(0,r.jsx)(`th`,{scope:`col`,children:o.priority}),(0,r.jsx)(`th`,{scope:`col`,children:o.ratio})]})}),(0,r.jsxs)(`tbody`,{children:[C.map(e=>(0,r.jsxs)(`tr`,{children:[(0,r.jsx)(`th`,{scope:`row`,children:e.label}),(0,r.jsx)(`td`,{children:f(e.standard,h,v,o.unavailable,o.noPublishedRate)}),(0,r.jsx)(`td`,{children:f(e.priority,h,v,o.unavailable,o.noPublishedRate)}),(0,r.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,r.jsxs)(`tr`,{children:[(0,r.jsx)(`th`,{scope:`row`,children:o.reasoning}),(0,r.jsx)(`td`,{colSpan:3,children:o.included})]})]})]})})]}),(0,r.jsxs)(`section`,{className:`cost-guide-section`,children:[(0,r.jsx)(`div`,{className:`cost-guide-section-heading`,children:(0,r.jsx)(`h2`,{children:o.conceptsTitle})}),(0,r.jsx)(`div`,{className:`cost-guide-blocks`,children:o.concepts.map(([e,t])=>(0,r.jsxs)(`article`,{children:[(0,r.jsx)(`strong`,{children:e}),(0,r.jsx)(`p`,{children:t})]},e))})]}),(0,r.jsxs)(`section`,{className:`cost-guide-section`,children:[(0,r.jsxs)(`div`,{className:`cost-guide-section-heading`,children:[(0,r.jsx)(`h2`,{children:o.exampleTitle}),(0,r.jsx)(`p`,{children:o.exampleIntro})]}),(0,r.jsxs)(`div`,{className:`cost-guide-example-grid`,children:[(0,r.jsxs)(`article`,{className:`cost-guide-example-card`,children:[(0,r.jsx)(`h3`,{children:o.standard}),(0,r.jsx)(m,{example:y,currency:h,fxRate:v,locale:i,labels:o})]}),(0,r.jsxs)(`article`,{className:`cost-guide-example-card`,children:[(0,r.jsx)(`h3`,{children:o.priority}),b===null?(0,r.jsx)(`p`,{className:`cost-guide-unavailable`,children:o.unavailable}):(0,r.jsx)(m,{example:b,currency:h,fxRate:v,locale:i,labels:o})]})]}),(0,r.jsxs)(`div`,{className:`cost-guide-speed`,children:[(0,r.jsx)(`span`,{children:o.speedMultiplier}),(0,r.jsx)(`strong`,{children:S===null?o.unavailable:`${S.toFixed(2)}×`}),(0,r.jsxs)(`code`,{children:[o.priority,` `,o.total,` ÷ `,o.standard,` `,o.total]})]})]}),(0,r.jsxs)(`section`,{className:`cost-guide-section`,children:[(0,r.jsxs)(`div`,{className:`cost-guide-section-heading`,children:[(0,r.jsx)(`h2`,{children:o.longTitle}),(0,r.jsx)(`p`,{children:o.longIntro})]}),(0,r.jsxs)(`div`,{className:`cost-guide-context-summary`,children:[(0,r.jsxs)(`span`,{children:[o.threshold,`:`,` `,(0,r.jsx)(`strong`,{children:_.long_context_threshold_tokens===null?o.unavailable:p(_.long_context_threshold_tokens,i)})]}),(0,r.jsxs)(`span`,{children:[o.longInput,`:`,` `,(0,r.jsx)(`strong`,{children:x===null?o.unavailable:p(x.usage.input,i)})]}),(0,r.jsxs)(`span`,{children:[`Input/cache: `,(0,r.jsxs)(`strong`,{children:[_.long_context_input_multiplier,`×`]})]}),(0,r.jsxs)(`span`,{children:[`Output: `,(0,r.jsxs)(`strong`,{children:[_.long_context_output_multiplier,`×`]})]})]}),x===null?(0,r.jsx)(`p`,{className:`cost-guide-unavailable`,children:o.unavailable}):(0,r.jsx)(m,{example:x,currency:h,fxRate:v,locale:i,labels:o}),(0,r.jsxs)(`div`,{className:`cost-guide-unavailable-combination`,children:[(0,r.jsxs)(`strong`,{children:[o.priorityLong,`: `,o.unavailable]}),(0,r.jsx)(`p`,{children:o.priorityLongNote})]})]}),(0,r.jsx)(`aside`,{className:`cost-guide-final-note`,children:o.finalNote})]})}export{h as CostCalculationGuidePage};
|