@zaip-ai/cli 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/services/agent-adapters.js +1 -1
- package/dist/services/agent-adapters.js.map +1 -1
- package/dist/services/agent-adapters.test.js +2 -1
- package/dist/services/agent-adapters.test.js.map +1 -1
- package/dist/services/codex-pre-tool-hook-template.d.ts.map +1 -1
- package/dist/services/codex-pre-tool-hook-template.js +89 -7
- package/dist/services/codex-pre-tool-hook-template.js.map +1 -1
- package/dist/services/codex-rules.d.ts +1 -1
- package/dist/services/codex-rules.d.ts.map +1 -1
- package/dist/services/codex-rules.js +7 -0
- package/dist/services/codex-rules.js.map +1 -1
- package/dist/services/install-agents-template.d.ts.map +1 -1
- package/dist/services/install-agents-template.js +1 -0
- package/dist/services/install-agents-template.js.map +1 -1
- package/dist/services/runtime-template.test.js +31 -7
- package/dist/services/runtime-template.test.js.map +1 -1
- package/dist/services/template-manifest.d.ts.map +1 -1
- package/dist/services/template-manifest.js +7 -3
- package/dist/services/template-manifest.js.map +1 -1
- package/package.json +1 -1
- package/templates/.agents/config/agents/catalog.yaml +7 -7
- package/templates/.agents/config/clients/codex/agents/zaip-agent-backend.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-frontend.toml +8 -8
- package/templates/.agents/dashboard/.zaip-managed.json +373 -205
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{CostCalculationGuidePage-DxR_pgSV.js → CostCalculationGuidePage-ovxurkIk.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-4jZLTWE_.js → DashboardHelpDialog-BXy6nti1.js} +268 -86
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-CKcsqb-r.js → PricingSettingsDialog-vSvvOHQp.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{ProjectSettingsPage-DmmJD2Th.js → ProjectSettingsPage-zH758vfs.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/TraceabilityWorkspace-CTH2wDs5.js +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-CaKwQP43.css → TraceabilityWorkspace-DvvavDLY.css} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-DKwP1stV.js +68 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-PoJA2PI1.css +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-C0fj2uU9.js → icons-vendor-B_lDDHn1.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-B31GMG5O.css +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-CuMcoUni.js +2 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-BEsJ-FYH.js → react-vendor-B3TJrD4O.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{traceability-B6y6Gw12.js → traceability-7f1j5wx3.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/index.html +7 -7
- package/templates/.agents/dashboard/apps/frontend/playwright.dom.config.ts +32 -0
- package/templates/.agents/dashboard/apps/frontend/src/App.tsx +132 -245
- package/templates/.agents/dashboard/apps/frontend/src/AppOverlays.tsx +0 -21
- package/templates/.agents/dashboard/apps/frontend/src/DashboardAlternateContent.tsx +9 -0
- package/templates/.agents/dashboard/apps/frontend/src/TraceabilityWorkspace.dom.e2e.ts +56 -0
- package/templates/.agents/dashboard/apps/frontend/src/TraceabilityWorkspace.test.ts +18 -1
- package/templates/.agents/dashboard/apps/frontend/src/TraceabilityWorkspace.tsx +75 -8
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-api.test.ts +25 -1
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-api.ts +7 -9
- package/templates/.agents/dashboard/apps/frontend/src/operations-period-render.test.ts +4 -4
- package/templates/.agents/dashboard/apps/frontend/src/overview-status-page.test.ts +1 -1
- package/templates/.agents/dashboard/apps/frontend/src/snapshot-banner-semantics.test.ts +7 -0
- package/templates/.agents/dashboard/apps/frontend/src/snapshot-coherence.test.ts +20 -8
- package/templates/.agents/dashboard/apps/frontend/src/sqlite-page-export.test.ts +32 -0
- package/templates/.agents/dashboard/apps/frontend/src/sqlite-page-export.ts +21 -0
- package/templates/.agents/dashboard/apps/frontend/src/styles.css +19 -0
- package/templates/.agents/dashboard/apps/frontend/src/traceability-task-pagination.test.ts +32 -0
- package/templates/.agents/dashboard/apps/frontend/src/traceability-task-pagination.ts +36 -0
- package/templates/.agents/dashboard/apps/frontend/src/traceability-workspace.css +6 -2
- package/templates/.agents/dashboard/apps/frontend/src/use-app-cost-loaders.test.ts +48 -0
- package/templates/.agents/dashboard/apps/frontend/src/use-app-cost-loaders.ts +31 -27
- package/templates/.agents/dashboard/apps/frontend/src/use-app-trace-documents.ts +7 -1
- package/templates/.agents/dashboard/apps/frontend/src/use-app-work-list-page.test.ts +163 -0
- package/templates/.agents/dashboard/apps/frontend/src/use-app-work-list-page.ts +136 -0
- package/templates/.agents/dashboard/apps/frontend/src/use-operations-detail-export.ts +76 -0
- package/templates/.agents/dashboard/apps/frontend/src/work-list-load-dedup.test.ts +23 -0
- package/templates/.agents/dashboard/apps/frontend/src/work-list-load-dedup.ts +27 -0
- package/templates/.agents/dashboard/apps/frontend/src/work-list-pagination.test.ts +38 -14
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostDeveloperAttributionPanel.tsx +60 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostDeveloperAttributionTable.tsx +191 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostFilters.loading.test.ts +14 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostFilters.run-page.test.ts +18 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostFilters.tsx +18 -3
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorContent.tsx +8 -2
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorLoadErrors.tsx +35 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.test.ts +47 -1
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.tsx +50 -58
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTableLoading.test.ts +132 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTableLoading.tsx +70 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.test.ts +128 -138
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.tsx +17 -67
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-copy.ts +2 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-views.ts +3 -1
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-page-range.ts +35 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/use-compact-cost-page.ts +16 -4
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/use-cost-group-page.test.ts +37 -2
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/use-cost-group-page.ts +44 -8
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/use-cost-run-page.ts +6 -1
- package/templates/.agents/dashboard/modules/operations/src/contracts.ts +20 -3
- package/templates/.agents/dashboard/modules/operations/src/react/DeveloperAttributionPanel.test.ts +54 -0
- package/templates/.agents/dashboard/modules/operations/src/react/DeveloperAttributionPanel.tsx +247 -0
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsMainContent.tsx +39 -13
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.helpers.tsx +107 -2
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.macro-metrics.test.ts +55 -0
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.test.ts +20 -28
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.tsx +162 -165
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverviewTopPanel.tsx +127 -0
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsPage.tsx +13 -46
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsPageOverview.tsx +3 -0
- package/templates/.agents/dashboard/modules/operations/src/react/PagedWorkList.test.tsx +43 -0
- package/templates/.agents/dashboard/modules/operations/src/react/PagedWorkList.tsx +181 -0
- package/templates/.agents/dashboard/modules/operations/src/react/UnifiedWorkList.test.ts +4 -2
- package/templates/.agents/dashboard/modules/operations/src/react/UnifiedWorkList.tsx +13 -0
- package/templates/.agents/dashboard/modules/operations/src/react/developer-identities.test.ts +18 -0
- package/templates/.agents/dashboard/modules/operations/src/react/developer-identities.ts +30 -0
- package/templates/.agents/dashboard/modules/operations/src/react/execution-metrics.ts +1 -0
- package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportAction.test.ts +8 -0
- package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportAction.tsx +3 -0
- package/templates/.agents/dashboard/modules/operations/src/react/export/export-layout.test.ts +14 -5
- package/templates/.agents/dashboard/modules/operations/src/react/index.ts +1 -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-date-filters.css +1 -1
- package/templates/.agents/dashboard/modules/operations/src/react/operations-overview-period-filter.test.ts +21 -11
- package/templates/.agents/dashboard/modules/operations/src/react/operations-overview.css +4 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-page-contract.ts +8 -1
- package/templates/.agents/dashboard/modules/operations/src/react/operations-view-order.test.ts +1 -0
- package/templates/.agents/dashboard/modules/operations/src/react/period-summary.ts +1 -0
- package/templates/.agents/dashboard/modules/operations/src/server/metric-coverage.ts +1 -0
- package/templates/.agents/dashboard/packages/local-runtime/dist/server.cjs +527 -335
- package/templates/.agents/dashboard/packages/local-runtime/dist/sqlite-read-model.cjs +501 -309
- package/templates/.agents/dashboard/packages/local-runtime/gitignore.template +2 -0
- package/templates/.agents/dashboard/packages/local-runtime/scripts/rebuild-sqlite-read-model.mjs +3 -1
- package/templates/.agents/dashboard/packages/local-runtime/scripts/test-sqlite-read-model.mjs +3 -3
- package/templates/.agents/dashboard/packages/local-runtime/scripts/validate-sqlite-read-model.mjs +25 -15
- package/templates/.agents/dashboard/packages/local-runtime/server.mjs +527 -335
- package/templates/.agents/dashboard/packages/local-runtime/src/server-board.test.ts +34 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-board.ts +15 -8
- package/templates/.agents/dashboard/packages/local-runtime/src/server-classification-page.test.ts +87 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-period-macro-metric.test.ts +44 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-period-macro-metric.ts +125 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-reconciliation-refresh.test.ts +66 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-request-authority.test.ts +61 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-request-authority.ts +18 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-run-projections.test.ts +42 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot-refresh.ts +97 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot.test.ts +3 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/server-sqlite-task-trace.ts +91 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server.test-fixtures.ts +36 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server.test.ts +98 -123
- package/templates/.agents/dashboard/packages/local-runtime/src/server.ts +111 -135
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-artifact-counts.ts +28 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-agent-page.test.ts +63 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-agent-page.ts +109 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-aggregates.ts +497 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-fast-page-parity.test-support.ts +65 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-group-page.test.ts +176 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-group-page.ts +119 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-group-projection.ts +41 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-invocation-page.test.ts +16 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-invocation-page.ts +29 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-first-fold-cache.ts +355 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-first-fold-persistence.ts +121 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-first-fold-timing.ts +27 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-operations-projection.ts +15 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-operations-work-list.test.ts +293 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-operations-work-list.ts +371 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-cache.test-support.ts +23 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-first-fold-types.ts +89 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-multi-provider-fixture.ts +227 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-multi-provider.test.ts +691 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-source-fingerprint.ts +81 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model.test.ts +440 -863
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model.ts +1120 -1086
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-snapshot-cache.ts +129 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-snapshot-install.test.ts +26 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-snapshot-install.ts +28 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-snapshot-seed.test.ts +116 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-launch-page.mjs +146 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-launch-page.test.mjs +165 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-refresh.mjs +140 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.mjs +188 -299
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.test.mjs +51 -70
- package/templates/.agents/dashboard/packages/windows-launcher/Program.cs +5 -2
- package/templates/.agents/dashboard/tests/e2e/playwright.config.ts +4 -1
- package/templates/.agents/dashboard/tests/e2e/specs/cost-monitor-loading.spec.ts +142 -0
- package/templates/.agents/dashboard/tests/e2e/specs/cost-monitor-pagination.spec.ts +232 -0
- package/templates/.agents/dashboard/tests/e2e/specs/dashboard-performance-matrix.spec.ts +743 -0
- package/templates/.agents/dashboard/tests/e2e/specs/dashboard.spec.ts +183 -210
- package/templates/.agents/dashboard/zaip-dashboard-windows.exe +0 -0
- package/templates/.agents/requirements/autonomous-assurance.md +6 -6
- 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 +3 -3
- package/templates/.agents/requirements/kanban-dashboard.md +10 -2
- 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 +4 -4
- package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
- package/templates/.agents/rules/dashboard-ui-consistency.md +14 -0
- package/templates/.agents/rules/frontend-lite.md +4 -4
- package/templates/.agents/rules/run-lifecycle-closure.md +4 -4
- package/templates/.agents/runtime/bin/zaip.mjs +1137 -1037
- package/templates/.agents/runtime/checksums.sha256 +2 -2
- package/templates/.agents/runtime/provenance.json +2 -2
- package/templates/.agents/skills/criar-pasta-obsidian/scripts/generate-obsidian-vault.test.mjs +20 -16
- package/templates/.agents/skills/zaip-skill-agent-catalog/SKILL.md +22 -0
- package/templates/.agents/skills/zaip-skill-agent-catalog/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-author-skills/SKILL.md +3 -2
- package/templates/.agents/skills/zaip-skill-author-skills/scripts/audit-skill-catalog.mjs +49 -0
- package/templates/.agents/skills/zaip-skill-author-skills/scripts/author-skill-scripts.test.mjs +27 -0
- package/templates/.agents/skills/zaip-skill-author-skills/scripts/run-skill-tests.mjs +37 -0
- package/templates/.agents/skills/zaip-skill-backend/SKILL.md +1 -0
- package/templates/.agents/skills/zaip-skill-change/SKILL.md +1 -1
- package/templates/.agents/skills/zaip-skill-change/references/observable-evidence.md +83 -0
- package/templates/.agents/skills/zaip-skill-dashboard-diagnostics/SKILL.md +22 -0
- package/templates/.agents/skills/zaip-skill-dashboard-diagnostics/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-execution/SKILL.md +1 -1
- package/templates/.agents/skills/zaip-skill-frontend/SKILL.md +4 -3
- package/templates/.agents/skills/zaip-skill-frontend/agents/openai.yaml +2 -2
- package/templates/.agents/skills/zaip-skill-github-deploy/SKILL.md +10 -10
- package/templates/.agents/skills/zaip-skill-lifecycle-closure/SKILL.md +27 -0
- package/templates/.agents/skills/zaip-skill-lifecycle-closure/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-prd/SKILL.md +4 -0
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-local-telemetry.mjs +72 -22
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-explicit-recovery.mjs +223 -0
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-lib.mjs +42 -1
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-lib.test.mjs +101 -0
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-remeasurement.test.mjs +53 -0
- package/templates/.agents/skills/zaip-skill-release-qualification/SKILL.md +20 -0
- package/templates/.agents/skills/zaip-skill-release-qualification/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-review/SKILL.md +5 -0
- package/templates/.agents/skills/zaip-skill-rules/SKILL.md +1 -1
- package/templates/.agents/skills/zaip-skill-spec/SKILL.md +4 -0
- package/templates/.agents/skills/zaip-skill-sqlite-read-model/SKILL.md +22 -90
- package/templates/.agents/zaip-aios/INDEX.md +57 -32
- package/templates/.agents/zaip-aios/README.md +22 -12
- package/templates/.agents/zaip-aios/guides/02-requirements.md +5 -0
- package/templates/.agents/zaip-aios/guides/06-execucao.md +13 -4
- package/templates/.agents/zaip-aios/guides/07-revisao-e-validacao.md +7 -0
- package/templates/.agents/zaip-aios/guides/10-seguranca.md +23 -0
- package/templates/.agents/zaip-aios/guides/11-observabilidade-e-custos.md +6 -6
- package/templates/.agents/zaip-aios/guides/13-boas-praticas.md +3 -0
- package/templates/.agents/zaip-aios/guides/16-lifecycle-e-reconciliacao.md +12 -3
- package/templates/.agents/zaip-aios/guides/17-como-o-custo-e-calculado.md +5 -5
- package/templates/.agents/zaip-aios/guides/19-assurance-e-autonomia.md +23 -0
- package/templates/.agents/zaip-aios/guides/20-instalacao-detalhada.md +44 -8
- package/templates/.agents/zaip-aios/guides/21-telemetria-monitor-custos.md +8 -14
- package/templates/.agents/zaip-aios/guides/22-fluxos-e-roteamento.md +5 -0
- package/templates/.agents/zaip-aios/guides/23-orquestracao-de-modelos.md +6 -6
- package/templates/.agents/zaip-aios/guides/24-calculo-de-custos-openai.md +8 -8
- package/templates/.agents/zaip-aios/guides/25-fontes-de-precos-openai.md +3 -2
- package/templates/.agents/zaip-aios/guides/26-qualidade-e-release.md +92 -10
- package/templates/.agents/zaip-aios/guides/27-telemetria-git-native.md +8 -3
- package/templates/.agents/zaip-aios/guides/28-lifecycle-completo.md +5 -0
- package/templates/template-manifest.json +555 -170
- package/templates/.agents/dashboard/apps/frontend/dist/assets/TraceabilityWorkspace-BwtitWa_.js +0 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-BZ5WdaMN.css +0 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-N5Csr0RP.js +0 -68
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-C4aIB1PV.js +0 -2
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-DK_enB5Z.css +0 -1
- package/templates/.agents/dashboard/apps/frontend/src/use-idle-cost-prefetch.ts +0 -45
- package/templates/.agents/dashboard/packages/local-runtime/dist/server.cjs.metafile.json +0 -7333
|
@@ -11,6 +11,7 @@ import type { CostMonitorProjection } from "../contracts.js";
|
|
|
11
11
|
import { normalizeCostProvider } from "../provider.js";
|
|
12
12
|
import { aggregateTaskCostRows } from "../task-cost-groups.js";
|
|
13
13
|
import { withTokenBackedCompactDuration } from "./CompactLifecycleCostTable.js";
|
|
14
|
+
import { CostDeveloperAttributionPanel } from "./CostDeveloperAttributionPanel.js";
|
|
14
15
|
import {
|
|
15
16
|
type CostFilterState,
|
|
16
17
|
CostFilters,
|
|
@@ -25,6 +26,7 @@ import {
|
|
|
25
26
|
} from "./CostFilters.js";
|
|
26
27
|
import { CostMonitorContent } from "./CostMonitorContent.js";
|
|
27
28
|
import { ChevronDownIcon, ListFilterIcon, LocaleFlag, SettingsIcon } from "./CostMonitorIcons.js";
|
|
29
|
+
import { CostMonitorLoadErrors } from "./CostMonitorLoadErrors.js";
|
|
28
30
|
import { CostSummary } from "./CostSummary.js";
|
|
29
31
|
import {
|
|
30
32
|
groupRows,
|
|
@@ -48,6 +50,7 @@ import {
|
|
|
48
50
|
import { findRunDetails, selectDimensionalCostRows } from "./cost-monitor-page-helpers.js";
|
|
49
51
|
import { summarizeCostRows } from "./cost-monitor-summary.js";
|
|
50
52
|
import { COST_VIEW_ORDER, type CostView, DEFAULT_COST_VIEW } from "./cost-monitor-views.js";
|
|
53
|
+
import { resolveCompactCostPageRange, resolveCostGroupPageRange } from "./cost-page-range.js";
|
|
51
54
|
import { enrichPeriodCostGroups } from "./period-cost-groups.js";
|
|
52
55
|
import {
|
|
53
56
|
compactReadModelKind,
|
|
@@ -73,6 +76,7 @@ export {
|
|
|
73
76
|
type CostView,
|
|
74
77
|
DEFAULT_COST_VIEW,
|
|
75
78
|
} from "./cost-monitor-views.js";
|
|
79
|
+
export { resolveCompactCostPageRange, resolveCostGroupPageRange } from "./cost-page-range.js";
|
|
76
80
|
|
|
77
81
|
export type { LoadCompactCostPage } from "./use-compact-cost-page.js";
|
|
78
82
|
export type { LoadCostGroupPage } from "./use-cost-group-page.js";
|
|
@@ -111,43 +115,6 @@ export function isServerCostRunPagingEligible(filters: CostFilterState, globalQu
|
|
|
111
115
|
);
|
|
112
116
|
}
|
|
113
117
|
|
|
114
|
-
/**
|
|
115
|
-
* The embedded default view is backed by the App's all-time atomic snapshot.
|
|
116
|
-
* Keep the group pager on that same population until a period, global date, or
|
|
117
|
-
* local Cost filter explicitly narrows it.
|
|
118
|
-
*/
|
|
119
|
-
export function resolveCostGroupPageRange({
|
|
120
|
-
embedded,
|
|
121
|
-
globalDateRange,
|
|
122
|
-
hasLocalCostFilters,
|
|
123
|
-
period,
|
|
124
|
-
runPageRange,
|
|
125
|
-
}: {
|
|
126
|
-
embedded: boolean;
|
|
127
|
-
globalDateRange: { start: string; end: string } | undefined;
|
|
128
|
-
hasLocalCostFilters: boolean;
|
|
129
|
-
period: CostPeriod;
|
|
130
|
-
runPageRange: { from: string; to: string } | undefined;
|
|
131
|
-
}): { from: string; to: string } | undefined {
|
|
132
|
-
if (
|
|
133
|
-
embedded &&
|
|
134
|
-
globalDateRange === undefined &&
|
|
135
|
-
period === defaultCostPeriod &&
|
|
136
|
-
!hasLocalCostFilters
|
|
137
|
-
)
|
|
138
|
-
return undefined;
|
|
139
|
-
return runPageRange;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Compact lifecycle tables share the embedded all-time snapshot contract with
|
|
144
|
-
* the group pager. In particular, the default month control is a display
|
|
145
|
-
* choice on that surface, not a hidden bound for SPEC/PRD rows or XLSX.
|
|
146
|
-
*/
|
|
147
|
-
export function resolveCompactCostPageRange(args: Parameters<typeof resolveCostGroupPageRange>[0]) {
|
|
148
|
-
return resolveCostGroupPageRange(args);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
118
|
export function CostMonitorPage({
|
|
152
119
|
capabilityNavigation,
|
|
153
120
|
data,
|
|
@@ -268,23 +235,33 @@ export function CostMonitorPage({
|
|
|
268
235
|
? candidate
|
|
269
236
|
: null;
|
|
270
237
|
const groupView = costGroupViewName(view);
|
|
238
|
+
// Visual tables are intentionally bounded. Export sources below retain
|
|
239
|
+
// their independent 50/100-row transport batches and always traverse all
|
|
240
|
+
// pages, so this is never an export limit.
|
|
241
|
+
const compactPageLimit = 10;
|
|
242
|
+
const groupPageLimit = 10;
|
|
271
243
|
const groupPageState = useCostGroupPage({
|
|
244
|
+
active: groupView !== null,
|
|
272
245
|
view: groupView ?? "daily",
|
|
273
246
|
...(groupPageRange === undefined ? {} : { range: groupPageRange }),
|
|
274
247
|
globalQuery: globalFilters?.query ?? "",
|
|
275
248
|
filters,
|
|
249
|
+
limit: groupPageLimit,
|
|
276
250
|
...(groupView === null ? {} : { load: loadGroupPage }),
|
|
277
251
|
});
|
|
252
|
+
const displayedGroupPage = groupPageState.page ?? groupPageState.stalePage;
|
|
278
253
|
const {
|
|
279
254
|
compactPageOffset,
|
|
280
255
|
setCompactPageOffset,
|
|
281
256
|
compactPage,
|
|
257
|
+
staleCompactPage,
|
|
282
258
|
compactPageLoading,
|
|
283
259
|
compactPageError,
|
|
284
260
|
retryCompactPage,
|
|
285
261
|
} = useCompactCostPage({
|
|
286
262
|
view,
|
|
287
263
|
load: loadReadModelPage,
|
|
264
|
+
limit: compactPageLimit,
|
|
288
265
|
range: compactPageRange,
|
|
289
266
|
query: globalFilters?.query,
|
|
290
267
|
filters,
|
|
@@ -306,7 +283,11 @@ export function CostMonitorPage({
|
|
|
306
283
|
currency,
|
|
307
284
|
filters,
|
|
308
285
|
globalQuery: globalFilters?.query ?? "",
|
|
309
|
-
|
|
286
|
+
limit: 10,
|
|
287
|
+
// Agent Invocations follows the same effective snapshot as the other
|
|
288
|
+
// remote tables. In the embedded all-time view, the hidden default month
|
|
289
|
+
// must not silently add a date range and bypass the fast all-time page.
|
|
290
|
+
range: groupPageRange,
|
|
310
291
|
refresh: lastUpdatedAt,
|
|
311
292
|
load: loadRunPage,
|
|
312
293
|
});
|
|
@@ -330,9 +311,8 @@ export function CostMonitorPage({
|
|
|
330
311
|
runPageLoading,
|
|
331
312
|
],
|
|
332
313
|
);
|
|
333
|
-
// A global period/filter change
|
|
334
|
-
//
|
|
335
|
-
// surface are aborted, so their normal completion path cannot clear the
|
|
314
|
+
// A global period/filter change unmounts this surface and replaces its atomic snapshot.
|
|
315
|
+
// Requests belonging to the old surface are aborted, so completion cannot clear the
|
|
336
316
|
// host-level loading gate. Always release that gate on unmount; the newly
|
|
337
317
|
// mounted surface will immediately assert its own loading state if needed.
|
|
338
318
|
useEffect(() => () => onLoadingChange?.(false), [onLoadingChange]);
|
|
@@ -512,16 +492,16 @@ export function CostMonitorPage({
|
|
|
512
492
|
: {
|
|
513
493
|
...groups,
|
|
514
494
|
[groupView]:
|
|
515
|
-
|
|
495
|
+
displayedGroupPage === null
|
|
516
496
|
? []
|
|
517
|
-
: groupView === "agents"
|
|
497
|
+
: groupView === "agents" && loadGroupPage === undefined
|
|
518
498
|
? includeConfiguredAgentGroups(
|
|
519
|
-
|
|
499
|
+
displayedGroupPage.rows,
|
|
520
500
|
activeData.configured_agents,
|
|
521
501
|
)
|
|
522
|
-
: [...
|
|
502
|
+
: [...displayedGroupPage.rows],
|
|
523
503
|
},
|
|
524
|
-
[activeData.configured_agents, groups,
|
|
504
|
+
[activeData.configured_agents, displayedGroupPage, groups, groupView, loadGroupPage],
|
|
525
505
|
);
|
|
526
506
|
const overview = useAggregateGroups
|
|
527
507
|
? activeData.overview
|
|
@@ -564,7 +544,7 @@ export function CostMonitorPage({
|
|
|
564
544
|
const compactKind = compactReadModelKind(view);
|
|
565
545
|
const usingCompactPage = compactKind !== null && loadReadModelPage !== undefined;
|
|
566
546
|
const exportRows = useMemo(() => {
|
|
567
|
-
if (usingCompactPage) return compactPage?.rows ?? [];
|
|
547
|
+
if (usingCompactPage) return compactPage?.rows ?? staleCompactPage?.rows ?? [];
|
|
568
548
|
if (view === "executions") return visibleExecutions;
|
|
569
549
|
if (view === "conversations") return groups.conversations;
|
|
570
550
|
if (view === "tasks") return groups.tasks;
|
|
@@ -578,6 +558,7 @@ export function CostMonitorPage({
|
|
|
578
558
|
groups,
|
|
579
559
|
rows,
|
|
580
560
|
usingCompactPage,
|
|
561
|
+
staleCompactPage?.rows,
|
|
581
562
|
view,
|
|
582
563
|
visibleExecutions,
|
|
583
564
|
visiblePrds,
|
|
@@ -637,7 +618,8 @@ export function CostMonitorPage({
|
|
|
637
618
|
const firstPage = await loadRunPage({
|
|
638
619
|
currency,
|
|
639
620
|
filters: effectiveFilters,
|
|
640
|
-
...(
|
|
621
|
+
...(groupPageRange === undefined ? {} : groupPageRange),
|
|
622
|
+
limit: 100,
|
|
641
623
|
offset: 0,
|
|
642
624
|
refresh: lastUpdatedAt,
|
|
643
625
|
});
|
|
@@ -658,7 +640,8 @@ export function CostMonitorPage({
|
|
|
658
640
|
page = await loadRunPage({
|
|
659
641
|
currency,
|
|
660
642
|
filters: effectiveFilters,
|
|
661
|
-
...(
|
|
643
|
+
...(groupPageRange === undefined ? {} : groupPageRange),
|
|
644
|
+
limit: 100,
|
|
662
645
|
offset: nextOffset,
|
|
663
646
|
refresh: lastUpdatedAt,
|
|
664
647
|
});
|
|
@@ -759,13 +742,12 @@ export function CostMonitorPage({
|
|
|
759
742
|
title={dashboardTitle}
|
|
760
743
|
/>
|
|
761
744
|
)}
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
) : null}
|
|
745
|
+
<CostMonitorLoadErrors
|
|
746
|
+
groupError={groupView === null ? null : groupPageState.error}
|
|
747
|
+
locale={locale}
|
|
748
|
+
periodError={periodError}
|
|
749
|
+
retryGroup={groupPageState.retry}
|
|
750
|
+
/>
|
|
769
751
|
{embedded ? null : (
|
|
770
752
|
<>
|
|
771
753
|
<nav aria-label="Navegação do Cost Monitor" className="cost-monitor-nav">
|
|
@@ -951,17 +933,27 @@ export function CostMonitorPage({
|
|
|
951
933
|
{/* CostMonitorContent owns `view === "models" && useAggregateGroups ? (` and `rows={groups.models}`. */}
|
|
952
934
|
<CostMonitorContent
|
|
953
935
|
canonicalDurationTotal={canonicalDurationTotal}
|
|
954
|
-
compactPage={compactPage}
|
|
936
|
+
compactPage={compactPage ?? staleCompactPage}
|
|
955
937
|
compactPageError={compactPageError}
|
|
956
938
|
compactPageLoading={compactPageLoading}
|
|
957
939
|
compactPageOffset={compactPageOffset}
|
|
958
940
|
currency={currency}
|
|
959
941
|
detailError={detailError}
|
|
960
942
|
detailLoading={detailLoading}
|
|
943
|
+
developerPanel={
|
|
944
|
+
view === "developers" ? (
|
|
945
|
+
<CostDeveloperAttributionPanel
|
|
946
|
+
locale={locale}
|
|
947
|
+
{...(runPageRange === undefined
|
|
948
|
+
? {}
|
|
949
|
+
: { from: runPageRange.from, to: runPageRange.to })}
|
|
950
|
+
/>
|
|
951
|
+
) : null
|
|
952
|
+
}
|
|
961
953
|
dimensionalDetailPending={dimensionalDetailPending}
|
|
962
954
|
dimensionalRows={dimensionalRows}
|
|
963
955
|
groups={displayGroups}
|
|
964
|
-
groupPage={groupView === null ? null :
|
|
956
|
+
groupPage={groupView === null ? null : displayedGroupPage}
|
|
965
957
|
groupPageLoading={groupView === null ? false : groupPageState.loading}
|
|
966
958
|
groupPageOffset={groupPageState.offset}
|
|
967
959
|
setGroupPageOffset={groupPageState.setOffset}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import {
|
|
3
|
+
activeCostPeriodData,
|
|
4
|
+
costPeriodDateRange,
|
|
5
|
+
defaultCostPeriod,
|
|
6
|
+
emptyCostFilters,
|
|
7
|
+
loadCostMonitorPeriod,
|
|
8
|
+
shouldFetchCostPeriod,
|
|
9
|
+
} from "./CostFilters.js";
|
|
10
|
+
|
|
11
|
+
describe("period-driven Cost Monitor loading", () => {
|
|
12
|
+
it("drops a stale in-memory Cost period response when refresh replaces its base snapshot", () => {
|
|
13
|
+
const stale = { runs: [{ run_id: "RUN-OBSERVED", duration_ms: 31 * 3_600_000 }] } as never;
|
|
14
|
+
const refreshed = { runs: [{ run_id: "RUN-PROJECTED", duration_ms: 413_659_026 }] } as never;
|
|
15
|
+
expect(activeCostPeriodData(refreshed, stale, stale)).toBe(refreshed);
|
|
16
|
+
expect(activeCostPeriodData(refreshed, refreshed, refreshed)).toBe(refreshed);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("does not issue a second Cost request after an embedded default atomic snapshot", () => {
|
|
20
|
+
const filters = {
|
|
21
|
+
query: "",
|
|
22
|
+
provider: "",
|
|
23
|
+
phase: "",
|
|
24
|
+
origin: "",
|
|
25
|
+
workType: "",
|
|
26
|
+
agent: "",
|
|
27
|
+
model: "",
|
|
28
|
+
status: "",
|
|
29
|
+
priority: "",
|
|
30
|
+
risk: "",
|
|
31
|
+
};
|
|
32
|
+
expect(shouldFetchCostPeriod({ filters, period: "month", snapshotBacked: true })).toBe(false);
|
|
33
|
+
expect(shouldFetchCostPeriod({ filters, period: "all", snapshotBacked: true })).toBe(true);
|
|
34
|
+
expect(shouldFetchCostPeriod({ filters, period: "7", snapshotBacked: true })).toBe(true);
|
|
35
|
+
expect(
|
|
36
|
+
shouldFetchCostPeriod({
|
|
37
|
+
filters: { ...filters, phase: "execution" },
|
|
38
|
+
period: "month",
|
|
39
|
+
snapshotBacked: true,
|
|
40
|
+
}),
|
|
41
|
+
).toBe(true);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it("uses the current month for the default period and keeps All Time explicit", async () => {
|
|
45
|
+
expect(defaultCostPeriod).toBe("month");
|
|
46
|
+
expect(costPeriodDateRange("all", new Date("2026-08-01T03:30:00.000Z"))).toBeUndefined();
|
|
47
|
+
expect(costPeriodDateRange("month", new Date("2026-08-01T03:30:00.000Z"))).toEqual({
|
|
48
|
+
from: "2026-08-01",
|
|
49
|
+
to: "2026-08-01",
|
|
50
|
+
});
|
|
51
|
+
const calls: string[] = [];
|
|
52
|
+
await loadCostMonitorPeriod({
|
|
53
|
+
currency: "BRL",
|
|
54
|
+
fetcher: async (url) => {
|
|
55
|
+
calls.push(String(url));
|
|
56
|
+
return new Response(JSON.stringify({ runs: [] }), { status: 200 });
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
expect(calls).toEqual(["/api/v2/cost-monitor?currency=BRL&scope=summary"]);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it("derives an inclusive current-month range without inspecting materialized Runs", () => {
|
|
63
|
+
expect(costPeriodDateRange("month", new Date("2026-07-26T15:00:00.000Z"))).toEqual({
|
|
64
|
+
from: "2026-07-01",
|
|
65
|
+
to: "2026-07-26",
|
|
66
|
+
});
|
|
67
|
+
expect(costPeriodDateRange("7", new Date("2026-07-26T15:00:00.000Z"))).toEqual({
|
|
68
|
+
from: "2026-07-20",
|
|
69
|
+
to: "2026-07-26",
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it("requests the selected range from the local runtime and forwards cancellation", async () => {
|
|
74
|
+
const calls: Array<{ url: string; signal: AbortSignal | null | undefined }> = [];
|
|
75
|
+
const controller = new AbortController();
|
|
76
|
+
const projection = { runs: [] };
|
|
77
|
+
const loaded = await loadCostMonitorPeriod({
|
|
78
|
+
currency: "BRL",
|
|
79
|
+
from: "2026-07-01",
|
|
80
|
+
to: "2026-07-26",
|
|
81
|
+
filters: {
|
|
82
|
+
query: "TASK-1",
|
|
83
|
+
provider: "openai",
|
|
84
|
+
phase: "execution",
|
|
85
|
+
origin: "spec",
|
|
86
|
+
workType: "rework",
|
|
87
|
+
agent: "zaip-agent-builder",
|
|
88
|
+
model: "gpt-5.6-terra",
|
|
89
|
+
status: "completed",
|
|
90
|
+
priority: "high",
|
|
91
|
+
risk: "standard",
|
|
92
|
+
},
|
|
93
|
+
signal: controller.signal,
|
|
94
|
+
fetcher: async (url, init) => {
|
|
95
|
+
calls.push({ url: String(url), signal: init?.signal });
|
|
96
|
+
return new Response(JSON.stringify(projection), {
|
|
97
|
+
headers: { "content-type": "application/json" },
|
|
98
|
+
status: 200,
|
|
99
|
+
});
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
expect(loaded).toEqual(projection);
|
|
103
|
+
expect(calls).toEqual([
|
|
104
|
+
{
|
|
105
|
+
url:
|
|
106
|
+
"/api/v2/cost-monitor?currency=BRL&scope=summary&from=2026-07-01&to=2026-07-26" +
|
|
107
|
+
"&provider=openai&phase=execution&agent=zaip-agent-builder" +
|
|
108
|
+
"&model=gpt-5.6-terra&status=completed",
|
|
109
|
+
signal: controller.signal,
|
|
110
|
+
},
|
|
111
|
+
]);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it("never leaves period/filter hydration scope-less or on detail", async () => {
|
|
115
|
+
const calls: string[] = [];
|
|
116
|
+
await loadCostMonitorPeriod({
|
|
117
|
+
currency: "USD",
|
|
118
|
+
filters: { ...emptyCostFilters, provider: "openai", model: "gpt-5.6-terra" },
|
|
119
|
+
fetcher: async (url) => {
|
|
120
|
+
calls.push(String(url));
|
|
121
|
+
return new Response(JSON.stringify({ runs: [] }), { status: 200 });
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
const [firstCall] = calls;
|
|
125
|
+
if (firstCall === undefined) {
|
|
126
|
+
throw new Error("Expected a Cost Monitor request.");
|
|
127
|
+
}
|
|
128
|
+
const request = new URL(firstCall, "http://dashboard.local");
|
|
129
|
+
expect(request.searchParams.get("scope")).toBe("summary");
|
|
130
|
+
expect(request.searchParams.get("scope")).not.toBe("detail");
|
|
131
|
+
});
|
|
132
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { CostLocale } from "./cost-monitor-copy.js";
|
|
2
|
+
|
|
3
|
+
/** The bounded Invocation table's server page state. */
|
|
4
|
+
export type CostRunPagination = {
|
|
5
|
+
offset: number;
|
|
6
|
+
limit: number;
|
|
7
|
+
total: number | null;
|
|
8
|
+
has_more: boolean;
|
|
9
|
+
loading: boolean;
|
|
10
|
+
error: string | null;
|
|
11
|
+
onChange: (offset: number) => void;
|
|
12
|
+
onRetry: () => void;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export function CostRunServerPagination({
|
|
16
|
+
locale,
|
|
17
|
+
pagination,
|
|
18
|
+
}: {
|
|
19
|
+
locale: CostLocale;
|
|
20
|
+
pagination: CostRunPagination;
|
|
21
|
+
}) {
|
|
22
|
+
const first = pagination.total === 0 ? 0 : pagination.offset + 1;
|
|
23
|
+
const last =
|
|
24
|
+
pagination.total === null
|
|
25
|
+
? pagination.offset + pagination.limit
|
|
26
|
+
: Math.min(pagination.offset + pagination.limit, pagination.total);
|
|
27
|
+
const previous = Math.max(0, pagination.offset - pagination.limit);
|
|
28
|
+
const next = pagination.offset + pagination.limit;
|
|
29
|
+
return (
|
|
30
|
+
<nav
|
|
31
|
+
aria-label={locale === "pt-BR" ? "Paginação das invocações" : "Invocation pagination"}
|
|
32
|
+
className="ui-table-pagination"
|
|
33
|
+
>
|
|
34
|
+
<button
|
|
35
|
+
disabled={pagination.loading || pagination.offset === 0}
|
|
36
|
+
onClick={() => pagination.onChange(previous)}
|
|
37
|
+
type="button"
|
|
38
|
+
>
|
|
39
|
+
{locale === "pt-BR" ? "Anterior" : "Previous"}
|
|
40
|
+
</button>
|
|
41
|
+
<span aria-live="polite">
|
|
42
|
+
{pagination.loading
|
|
43
|
+
? locale === "pt-BR"
|
|
44
|
+
? "Carregando invocações…"
|
|
45
|
+
: "Loading invocations…"
|
|
46
|
+
: pagination.total === null
|
|
47
|
+
? `${first}–${last}${pagination.has_more ? "+" : ""}`
|
|
48
|
+
: `${first}–${last} ${locale === "pt-BR" ? "de" : "of"} ${pagination.total}`}
|
|
49
|
+
</span>
|
|
50
|
+
<button
|
|
51
|
+
disabled={
|
|
52
|
+
pagination.loading ||
|
|
53
|
+
(!pagination.has_more && (pagination.total === null || next >= pagination.total))
|
|
54
|
+
}
|
|
55
|
+
onClick={() => pagination.onChange(next)}
|
|
56
|
+
type="button"
|
|
57
|
+
>
|
|
58
|
+
{locale === "pt-BR" ? "Próxima" : "Next"}
|
|
59
|
+
</button>
|
|
60
|
+
{pagination.error ? (
|
|
61
|
+
<span role="status">
|
|
62
|
+
{pagination.error}{" "}
|
|
63
|
+
<button onClick={pagination.onRetry} type="button">
|
|
64
|
+
{locale === "pt-BR" ? "Tentar novamente" : "Retry"}
|
|
65
|
+
</button>
|
|
66
|
+
</span>
|
|
67
|
+
) : null}
|
|
68
|
+
</nav>
|
|
69
|
+
);
|
|
70
|
+
}
|