@zaip-ai/cli 3.7.0 → 4.0.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.
- package/README.md +5 -5
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +6 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/services/adapters.d.ts +1 -1
- package/dist/services/adapters.d.ts.map +1 -1
- package/dist/services/adapters.js +22 -4
- package/dist/services/adapters.js.map +1 -1
- package/dist/services/adapters.test.js +24 -0
- package/dist/services/adapters.test.js.map +1 -1
- package/dist/services/agent-adapters.js +1 -1
- package/dist/services/agent-adapters.js.map +1 -1
- package/dist/services/backup-gitignore.d.ts +9 -0
- package/dist/services/backup-gitignore.d.ts.map +1 -0
- package/dist/services/backup-gitignore.js +66 -0
- package/dist/services/backup-gitignore.js.map +1 -0
- package/dist/services/backup-gitignore.test.d.ts +2 -0
- package/dist/services/backup-gitignore.test.d.ts.map +1 -0
- package/dist/services/backup-gitignore.test.js +27 -0
- package/dist/services/backup-gitignore.test.js.map +1 -0
- package/dist/services/codex-conversation-lifecycle-hook.d.ts.map +1 -1
- package/dist/services/codex-conversation-lifecycle-hook.js +15 -7
- package/dist/services/codex-conversation-lifecycle-hook.js.map +1 -1
- package/dist/services/install-agents-template.d.ts.map +1 -1
- package/dist/services/install-agents-template.js +43 -127
- package/dist/services/install-agents-template.js.map +1 -1
- package/dist/services/install-template-policy.d.ts.map +1 -1
- package/dist/services/install-template-policy.js +2 -0
- package/dist/services/install-template-policy.js.map +1 -1
- package/dist/services/legacy-records-migration.d.ts +15 -0
- package/dist/services/legacy-records-migration.d.ts.map +1 -0
- package/dist/services/legacy-records-migration.js +109 -0
- package/dist/services/legacy-records-migration.js.map +1 -0
- package/dist/services/local-state-migration.d.ts +8 -1
- package/dist/services/local-state-migration.d.ts.map +1 -1
- package/dist/services/local-state-migration.js +67 -32
- package/dist/services/local-state-migration.js.map +1 -1
- package/dist/services/logger.d.ts.map +1 -1
- package/dist/services/logger.js +2 -0
- package/dist/services/logger.js.map +1 -1
- package/dist/services/project-model-migration.d.ts +3 -0
- package/dist/services/project-model-migration.d.ts.map +1 -0
- package/dist/services/project-model-migration.js +163 -0
- package/dist/services/project-model-migration.js.map +1 -0
- package/dist/services/project-model-migration.test.d.ts +2 -0
- package/dist/services/project-model-migration.test.d.ts.map +1 -0
- package/dist/services/project-model-migration.test.js +62 -0
- package/dist/services/project-model-migration.test.js.map +1 -0
- package/dist/services/sqlite-bootstrap.d.ts.map +1 -1
- package/dist/services/sqlite-bootstrap.js +9 -1
- package/dist/services/sqlite-bootstrap.js.map +1 -1
- 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/dist/services/transactional-files.d.ts +1 -0
- package/dist/services/transactional-files.d.ts.map +1 -1
- package/dist/services/transactional-files.js +3 -0
- package/dist/services/transactional-files.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/templates/.agents/README-ENG.md +90 -34
- package/templates/.agents/README.md +59 -32
- package/templates/.agents/config/agents/catalog.yaml +23 -23
- package/templates/.agents/config/agents/discovery.json +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-analyst.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-auditor.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-backend.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-brand-strategist.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-builder.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-cloud-engineer.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-data-analyst.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-designer.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-finalizer.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-frontend.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-general-operations.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-governance-compliance.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-growth-strategist.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-integrator.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-marketing-analyst.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-orchestrator.toml +3 -3
- package/templates/.agents/config/clients/codex/agents/zaip-agent-refactoring-specialist.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-reviewer.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-sales-specialist.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-security-auditor.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-task-executor.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-website-developer.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-writer.toml +2 -2
- package/templates/.agents/config/clients.yaml +1 -1
- package/templates/.agents/config/pricing/models.json +57 -1
- package/templates/.agents/config/project.yaml +21 -7
- package/templates/.agents/dashboard/.zaip-managed.json +195 -115
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{CostCalculationGuidePage-C5NgEcVh.js → CostCalculationGuidePage-f4ZGJRg3.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-BDQR0U4a.js → DashboardHelpDialog-DlN5EMmD.js} +249 -136
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-CGYcJ5EB.js → PricingSettingsDialog-v9zGRTlk.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-BRdoeTWk.js +3 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-Ckxk_izu.js → TraceabilityWorkspace-B_5u4Xnp.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{cost-monitor-BsMfGfQi.css → cost-monitor-C2AFYBu_.css} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-D7PrDZy9.js +68 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{dashboard-localization-jvdDfNKs.js → dashboard-localization-CF7B1Hjn.js} +90 -34
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-x8xxL9yW.js → icons-vendor-Cv3WBFIF.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-C4rLXrz_.js +2 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-CNOXIJHN.js → react-vendor-mHgsmxb6.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{traceability-CcpbpT1s.js → traceability-B0CPyEVq.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/index.html +6 -6
- package/templates/.agents/dashboard/apps/frontend/package.json +1 -1
- package/templates/.agents/dashboard/apps/frontend/src/AppDashboardContent.tsx +11 -1
- package/templates/.agents/dashboard/apps/frontend/src/AppLoadingBoundary.tsx +3 -2
- package/templates/.agents/dashboard/apps/frontend/src/AppLoadingPanels.tsx +1 -1
- package/templates/.agents/dashboard/apps/frontend/src/AppOverlays.tsx +1 -1
- package/templates/.agents/dashboard/apps/frontend/src/ProjectSettingsPage.tsx +9 -13
- package/templates/.agents/dashboard/apps/frontend/src/cost-monitor-population.test.tsx +4 -2
- package/templates/.agents/dashboard/apps/frontend/src/cost-period-refresh.test.ts +9 -5
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-api-settings.ts +3 -2
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-api.test.ts +2 -2
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-identity.test.ts +3 -3
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-identity.ts +1 -1
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-localization.test.ts +2 -1
- package/templates/.agents/dashboard/apps/frontend/src/operations-period-render.test.ts +40 -3
- package/templates/.agents/dashboard/apps/frontend/src/project-settings-model.ts +12 -1
- package/templates/.agents/dashboard/apps/frontend/src/project-settings.test.ts +19 -0
- package/templates/.agents/dashboard/apps/frontend/src/snapshot-coherence.test.ts +1 -1
- package/templates/.agents/dashboard/apps/frontend/src/use-app-cost-loaders.test.ts +3 -1
- package/templates/.agents/dashboard/apps/frontend/src/use-dashboard-app-model.tsx +14 -23
- package/templates/.agents/dashboard/modules/cost-monitor/package.json +1 -1
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CompactLifecycleCostTable.test.ts +3 -3
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CompactLifecycleCostTable.tsx +2 -3
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostDeveloperAttributionTable.tsx +2 -6
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostGroupsTable.period-values.test.tsx +66 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostGroupsTable.tsx +29 -34
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorContent.tsx +2 -2
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.embedded.test.ts +11 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.tsx +1 -13
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostPeriodAverageCards.test.tsx +23 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostPeriodAverageCards.tsx +2 -1
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTableDisplay.ts +6 -11
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables-keeps-legacy-codex-identity-fields-blank.test.ts +6 -6
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.test.ts +10 -12
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-group-page-totals.ts +23 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-group-period-values.tsx +34 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-embedded.css +0 -7
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-table-formatters.ts +4 -9
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-table-presentation.ts +2 -3
- package/templates/.agents/dashboard/modules/operations/package.json +1 -1
- package/templates/.agents/dashboard/modules/operations/src/react/DeveloperAttributionPanel.tsx +2 -12
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.helpers.tsx +2 -2
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.test.ts +1 -6
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.tsx +34 -36
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverviewCharts.tsx +12 -3
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverviewTopPanel.tsx +12 -14
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsPage.tsx +4 -4
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsPageOverview.tsx +23 -4
- package/templates/.agents/dashboard/modules/operations/src/react/OverviewCostKpi.tsx +30 -2
- package/templates/.agents/dashboard/modules/operations/src/react/TaskDetailsDialog.tsx +2 -13
- package/templates/.agents/dashboard/modules/operations/src/react/UnifiedWorkBoard.priority.test.ts +8 -1
- package/templates/.agents/dashboard/modules/operations/src/react/UnifiedWorkBoard.tsx +8 -16
- package/templates/.agents/dashboard/modules/operations/src/react/WorkColumnState.tsx +34 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operation-duration.test.ts +1 -1
- package/templates/.agents/dashboard/modules/operations/src/react/operation-duration.ts +1 -1
- package/templates/.agents/dashboard/modules/operations/src/react/operations-average-unmeasured.test.ts +10 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-content-visibility.ts +3 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-coverage-toast.test.ts +4 -3
- package/templates/.agents/dashboard/modules/operations/src/react/operations-overview-period-filter.test.ts +12 -1
- package/templates/.agents/dashboard/modules/operations/src/react/operations-page-contract.ts +1 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-skeleton.css +80 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations.css +2 -11
- package/templates/.agents/dashboard/modules/operations/src/react/overview-cost-card.test.tsx +36 -0
- package/templates/.agents/dashboard/modules/operations/src/react/overview-metric-format.test.ts +11 -0
- package/templates/.agents/dashboard/modules/operations/src/react/overview-metric-format.ts +28 -3
- package/templates/.agents/dashboard/modules/operations/src/react/overview-metric-stats.ts +44 -0
- package/templates/.agents/dashboard/modules/operations/src/react/work-card-label.ts +5 -0
- package/templates/.agents/dashboard/modules/operations/src/react/work-column-state.ts +11 -0
- package/templates/.agents/dashboard/modules/operations/src/react/work-item-filter.ts +13 -0
- package/templates/.agents/dashboard/modules/traceability/package.json +1 -1
- package/templates/.agents/dashboard/packages/branding/package.json +1 -1
- package/templates/.agents/dashboard/packages/contracts/package.json +1 -1
- package/templates/.agents/dashboard/packages/data-export/package.json +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/dist/server.cjs +173 -173
- package/templates/.agents/dashboard/packages/local-runtime/dist/sqlite-read-model.cjs +120 -120
- package/templates/.agents/dashboard/packages/local-runtime/package.json +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/server.mjs +173 -173
- package/templates/.agents/dashboard/packages/local-runtime/src/active-codex-telemetry.test.ts +31 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/active-codex-telemetry.ts +74 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/agent-catalog-settings.test.ts +15 -15
- package/templates/.agents/dashboard/packages/local-runtime/src/project-settings.test.ts +2 -2
- package/templates/.agents/dashboard/packages/local-runtime/src/project-settings.ts +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/server-identity.test.ts +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot-synchronization.test.ts +25 -3
- package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot-synchronization.ts +51 -16
- package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot.test.ts +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/server-ui-security.ts +37 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-workspace.ts +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/server.ts +11 -33
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-rebuild.ts +12 -13
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-source-fingerprint.test.ts +71 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-source-fingerprint.ts +141 -25
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-worktree-sources.test.ts +60 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-rebuild-fingerprint-options.ts +13 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-launch-page.mjs +26 -2
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-launch-page.test.mjs +5 -0
- package/templates/.agents/dashboard/packages/ui/package.json +1 -1
- package/templates/.agents/dashboard/packages/ui/src/DashboardHeader.test.mjs +5 -0
- package/templates/.agents/dashboard/packages/ui/src/DashboardHeader.tsx +4 -4
- package/templates/.agents/dashboard/tests/e2e/package.json +1 -1
- package/templates/.agents/dashboard/tests/e2e/playwright.config.ts +4 -0
- package/templates/.agents/dashboard/tests/e2e/specs/dashboard-performance-matrix.spec.ts +15 -23
- package/templates/.agents/dashboard/tests/e2e/specs/dashboard.spec.ts +1 -1
- package/templates/.agents/dashboard/tests/e2e/specs/performance-matrix-types.ts +15 -0
- package/templates/.agents/dashboard/tests/e2e/specs/performance-observability.ts +30 -0
- package/templates/.agents/dashboard/tests/e2e/specs/performance-work-row-identity.ts +6 -0
- package/templates/.agents/design/.zaip-managed.json +13 -9
- package/templates/.agents/design/apps/catalog/dist/assets/index-DkpQYoyC.js +72 -0
- package/templates/.agents/design/apps/catalog/dist/index.html +1 -1
- package/templates/.agents/design/apps/catalog/package.json +1 -1
- package/templates/.agents/design/apps/catalog/src/components/CostPopulationSpecimen.test.tsx +8 -4
- package/templates/.agents/design/apps/catalog/src/components/CostPopulationSpecimen.tsx +10 -3
- package/templates/.agents/design/apps/catalog/src/components/DashboardFiltersSpecimen.tsx +0 -15
- package/templates/.agents/design/apps/catalog/src/pages/ComponentsPage.tsx +3 -3
- package/templates/.agents/design/apps/catalog/src/stories/DashboardFilters.stories.tsx +0 -1
- package/templates/.agents/design/packages/local-runtime/package.json +1 -1
- package/templates/.agents/requirements/autonomous-assurance.md +1 -1
- package/templates/.agents/requirements/cloud-hostinger-autonomy.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 +6 -6
- 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/rules/autonomy-decision.md +2 -2
- package/templates/.agents/rules/workflow.md +1 -1
- package/templates/.agents/runtime/VERSION +1 -1
- package/templates/.agents/runtime/bin/zaip.mjs +73 -64
- package/templates/.agents/runtime/checksums.sha256 +5 -5
- package/templates/.agents/runtime/manifest.json +1 -1
- package/templates/.agents/runtime/provenance.json +4 -4
- package/templates/.agents/runtime/sbom.cdx.json +1 -1
- package/templates/.agents/skills/zaip-skill-adapters/SKILL.md +1 -1
- package/templates/.agents/skills/zaip-skill-executar-fila-pronta/SKILL.md +7 -7
- package/templates/.agents/skills/zaip-skill-executar-fila-pronta/scripts/ready-queue-fence.mjs +32 -7
- package/templates/.agents/skills/zaip-skill-executar-fila-pronta/scripts/ready-queue-fence.test.mjs +134 -1
- package/templates/.agents/skills/zaip-skill-executar-fila-pronta/scripts/ready-queue-lease.mjs +57 -0
- package/templates/.agents/skills/zaip-skill-executar-fila-pronta/scripts/scheduled-ready-queue-contract.test.mjs +9 -6
- package/templates/.agents/skills/zaip-skill-execution/SKILL.md +1 -1
- package/templates/.agents/skills/zaip-skill-execution/references/runtime-governance.md +2 -2
- package/templates/.agents/skills/zaip-skill-github-deploy/SKILL.md +5 -5
- package/templates/.agents/skills/zaip-skill-github-deploy/agents/openai.yaml +2 -2
- package/templates/.agents/skills/zaip-skill-github-deploy/references/deployment-workflow.md +5 -3
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/github-deploy-contract.test.mjs +40 -5
- package/templates/.agents/skills/zaip-skill-instalar-agendamento/SKILL.md +2 -2
- package/templates/.agents/skills/zaip-skill-release-qualification/SKILL.md +6 -0
- package/templates/.agents/skills/zaip-skill-release-qualification/references/local-preparation.md +54 -6
- package/templates/.agents/zaip-aios/README.md +4 -4
- package/templates/.agents/zaip-aios/VERSION +1 -1
- package/templates/.agents/zaip-aios/guides/01-primeiros-passos.md +4 -3
- package/templates/.agents/zaip-aios/guides/03-tasks.md +5 -4
- package/templates/.agents/zaip-aios/guides/04-specs.md +4 -1
- package/templates/.agents/zaip-aios/guides/05-prds.md +7 -3
- package/templates/.agents/zaip-aios/guides/06-execucao.md +9 -4
- package/templates/.agents/zaip-aios/guides/09-agentes-e-squads.md +9 -5
- package/templates/.agents/zaip-aios/guides/11-observabilidade-e-custos.md +10 -2
- package/templates/.agents/zaip-aios/guides/12-instalacao-e-upgrade.md +10 -5
- package/templates/.agents/zaip-aios/guides/13-boas-praticas.md +12 -1
- package/templates/.agents/zaip-aios/guides/14-troubleshooting.md +3 -1
- package/templates/.agents/zaip-aios/guides/16-lifecycle-e-reconciliacao.md +12 -7
- package/templates/.agents/zaip-aios/guides/17-como-o-custo-e-calculado.md +1 -1
- package/templates/.agents/zaip-aios/guides/18-catalogo-de-agentes.md +5 -1
- package/templates/.agents/zaip-aios/guides/19-assurance-e-autonomia.md +19 -15
- package/templates/.agents/zaip-aios/guides/20-instalacao-detalhada.md +13 -9
- package/templates/.agents/zaip-aios/guides/21-telemetria-monitor-custos.md +4 -3
- package/templates/.agents/zaip-aios/guides/22-fluxos-e-roteamento.md +9 -7
- package/templates/.agents/zaip-aios/guides/23-orquestracao-de-modelos.md +40 -25
- package/templates/.agents/zaip-aios/guides/24-calculo-de-custos-openai.md +8 -8
- package/templates/.agents/zaip-aios/guides/26-qualidade-e-release.md +14 -5
- package/templates/.agents/zaip-aios/guides/27-telemetria-git-native.md +6 -0
- package/templates/.agents/zaip-aios/guides/28-lifecycle-completo.md +129 -11
- package/templates/template-manifest.json +310 -218
- package/templates/tsconfig.base.json +22 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-OulA4CoX.js +0 -3
- package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-j3aUYH5G.js +0 -68
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-CqfSgtk9.js +0 -2
|
@@ -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-D7PrDZy9.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};
|