@zaip-ai/cli 3.3.0 → 3.4.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/dist/services/adapters.d.ts +1 -1
- package/dist/services/adapters.d.ts.map +1 -1
- package/dist/services/adapters.js +4 -3
- package/dist/services/adapters.js.map +1 -1
- package/dist/services/agent-catalog-upgrade.d.ts +3 -0
- package/dist/services/agent-catalog-upgrade.d.ts.map +1 -0
- package/dist/services/agent-catalog-upgrade.js +35 -0
- package/dist/services/agent-catalog-upgrade.js.map +1 -0
- package/dist/services/install-agents-template.d.ts.map +1 -1
- package/dist/services/install-agents-template.js +22 -22
- package/dist/services/install-agents-template.js.map +1 -1
- package/dist/services/install-template-policy.d.ts +3 -0
- package/dist/services/install-template-policy.d.ts.map +1 -0
- package/dist/services/install-template-policy.js +21 -0
- package/dist/services/install-template-policy.js.map +1 -0
- package/dist/services/logger.test.js +12 -2
- package/dist/services/logger.test.js.map +1 -1
- package/dist/services/sqlite-bootstrap.d.ts +1 -0
- package/dist/services/sqlite-bootstrap.d.ts.map +1 -1
- package/dist/services/sqlite-bootstrap.js +10 -1
- package/dist/services/sqlite-bootstrap.js.map +1 -1
- package/package.json +2 -2
- package/templates/.agents/config/agents/discovery.json +1 -1
- package/templates/.agents/dashboard/.zaip-managed.json +260 -116
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{CostCalculationGuidePage-BBFDrn64.js → CostCalculationGuidePage-C5NgEcVh.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-Cd-qo9w7.js → DashboardHelpDialog-CCMVnkkI.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-J7L5m8lk.js → PricingSettingsDialog-CGYcJ5EB.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{ProjectSettingsPage-BpsAFy0g.js → ProjectSettingsPage-DVCPPV75.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-BzVtGLWS.js → TraceabilityWorkspace-CqK3Psfy.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{cost-monitor-PoJA2PI1.css → cost-monitor-BsMfGfQi.css} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-j3aUYH5G.js +68 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-CWzf_RiP.js → icons-vendor-x8xxL9yW.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-Cl5EWx8R.js +2 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-Cwylbh_N.css +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-CtHdbZk3.js → react-vendor-CNOXIJHN.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{traceability-BKrDH2TR.js → traceability-CcpbpT1s.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/index.html +7 -7
- package/templates/.agents/dashboard/apps/frontend/package.json +1 -1
- package/templates/.agents/dashboard/apps/frontend/src/App.tsx +12 -1
- package/templates/.agents/dashboard/apps/frontend/src/WorkspaceStatus.test.tsx +33 -0
- package/templates/.agents/dashboard/apps/frontend/src/WorkspaceStatus.tsx +58 -0
- package/templates/.agents/dashboard/apps/frontend/src/app-work-board-options.ts +41 -0
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-runtime-status.ts +25 -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.ts +5 -1
- package/templates/.agents/dashboard/apps/frontend/src/use-app-work-board.test.ts +140 -0
- package/templates/.agents/dashboard/apps/frontend/src/use-app-work-board.ts +28 -41
- package/templates/.agents/dashboard/apps/frontend/src/use-runtime-status.ts +38 -0
- package/templates/.agents/dashboard/apps/frontend/src/workspace-status.css +33 -0
- package/templates/.agents/dashboard/modules/cost-monitor/package.json +1 -1
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CompactLifecycleCostTable.test.ts +25 -3
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CompactLifecycleCostTable.tsx +17 -19
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostFilters.tsx +13 -167
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostGroupsTable.tsx +2 -9
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.test.ts +8 -8
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.tsx +29 -52
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTableLoading.test.ts +1 -1
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables-keeps-legacy-codex-identity-fields-blank.test.ts +2 -2
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.test.ts +4 -27
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/MacroCostTable.test.ts +2 -2
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/MacroCostTable.tsx +4 -3
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/agent-model-presentation.test.ts +26 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-embedded.css +7 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-loaders.ts +173 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-page-props.ts +47 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-page-selectors.ts +1 -7
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-page-range.ts +3 -9
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-projection.test.ts +44 -83
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-projection.ts +11 -111
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-summary-projection.test.ts +47 -181
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-summary-projection.ts +63 -91
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/cost-monitor-unavailable.test.ts +55 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/cost-summary-duration.test.ts +189 -0
- package/templates/.agents/dashboard/modules/operations/package.json +1 -1
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsEntityFilters.tsx +82 -0
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsPage.tsx +22 -31
- package/templates/.agents/dashboard/modules/operations/src/react/PagedWorkList.test.tsx +13 -1
- package/templates/.agents/dashboard/modules/operations/src/react/PagedWorkList.tsx +16 -3
- package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportAction.test.ts +11 -27
- package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportAction.tsx +44 -193
- package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportColumns.ts +186 -0
- package/templates/.agents/dashboard/modules/operations/src/react/export/excel-agent-participations.test.ts +28 -0
- package/templates/.agents/dashboard/modules/operations/src/react/export/export-layout.test.ts +2 -1
- package/templates/.agents/dashboard/modules/operations/src/react/operations-export-duration.ts +13 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-filter-panel.css +4 -0
- package/templates/.agents/dashboard/modules/operations/src/react/use-operation-filter-feedback.ts +18 -0
- package/templates/.agents/dashboard/modules/operations/src/react/work-board-model.test.ts +11 -0
- package/templates/.agents/dashboard/modules/operations/src/react/work-board-model.ts +10 -2
- package/templates/.agents/dashboard/modules/operations/src/work-board-model.ts +1 -1
- 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 +395 -341
- package/templates/.agents/dashboard/packages/local-runtime/dist/sqlite-read-model.cjs +346 -294
- package/templates/.agents/dashboard/packages/local-runtime/package.json +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/scripts/rebuild-sqlite-read-model.mjs +2 -1
- package/templates/.agents/dashboard/packages/local-runtime/scripts/validate-sqlite-read-model.mjs +4 -2
- package/templates/.agents/dashboard/packages/local-runtime/server.mjs +395 -341
- package/templates/.agents/dashboard/packages/local-runtime/src/active-codex-telemetry.test.ts +95 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/active-codex-telemetry.ts +102 -12
- package/templates/.agents/dashboard/packages/local-runtime/src/server-board.test.ts +75 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/server-costs-routes.ts +10 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-lifecycle-diagnostics.ts +50 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-macro-population.test.ts +165 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-operations-page-filters.ts +65 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-operations-pages.test.ts +111 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-operations-pages.ts +53 -63
- package/templates/.agents/dashboard/packages/local-runtime/src/server-operations-runs-route.ts +19 -5
- package/templates/.agents/dashboard/packages/local-runtime/src/server-period-macro-metric.ts +11 -2
- package/templates/.agents/dashboard/packages/local-runtime/src/server-read-projections.ts +16 -9
- package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot-refresh.test.ts +46 -2
- package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot-synchronization.test.ts +10 -2
- package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot-synchronization.ts +4 -3
- package/templates/.agents/dashboard/packages/local-runtime/src/server.test.ts +43 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/server.ts +46 -11
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-filter-matrix.test.ts +188 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-summary-details.test.ts +85 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-summary-details.ts +147 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-first-fold-cache.ts +64 -54
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-macro-classification.test.ts +172 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-materialize-projections.ts +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-operations-projection.ts +2 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-operations-work-list.test.ts +7 -7
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-operations-work-list.ts +2 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-period-averages.ts +10 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-agent-dimension.ts +18 -82
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-cached-cost-page.ts +169 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-developer.ts +205 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-entity-group.ts +13 -4
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-filtered-dimension.ts +22 -23
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-financial.ts +42 -209
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-model-dimension.ts +18 -4
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-provider-dimension.ts +9 -2
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-summary.ts +76 -83
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-view-page.ts +25 -161
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-canonical.ts +18 -45
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-counts-every-root-execution-day-returns.test.ts +2 -2
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-filesystem.ts +16 -16
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-multi-provider.test.ts +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-rebuild.ts +47 -22
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-schema.ts +3 -2
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model.test.ts +11 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-rebuild-result.ts +15 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-schema-base-views.ts +4 -4
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-schema-dashboard-views.ts +15 -56
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-schema-macro-classification.ts +48 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-summary-cursor.ts +15 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-token-active-allocation.ts +46 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-work-stages.ts +60 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-history.mjs +5 -1
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-launch-claims.test.mjs +7 -1
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-launch-page.mjs +17 -2
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-ownership.mjs +65 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-ownership.test.mjs +72 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-processes.mjs +32 -9
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.mjs +39 -45
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.test.mjs +5 -2
- package/templates/.agents/dashboard/packages/ui/package.json +1 -1
- package/templates/.agents/dashboard/tests/e2e/package.json +1 -1
- package/templates/.agents/dashboard/tests/e2e/specs/dashboard-performance-matrix.spec.ts +1 -18
- package/templates/.agents/dashboard/tests/e2e/specs/export-row-identity.spec.ts +20 -0
- package/templates/.agents/dashboard/tests/e2e/specs/export-row-identity.ts +20 -0
- package/templates/.agents/design/.zaip-managed.json +82 -74
- package/templates/.agents/design/apps/catalog/dist/assets/index-0W0Gj_Gs.css +1 -0
- package/templates/.agents/design/apps/catalog/dist/assets/index-32GZO95T.js +72 -0
- package/templates/.agents/design/apps/catalog/dist/assets/{index-D_lfqoyx.js → index-BP8IxOxt.js} +3 -3
- package/templates/.agents/design/apps/catalog/dist/assets/{index-BOjCcUaU.js → index-QJsgr9Ht.js} +3 -3
- package/templates/.agents/design/apps/catalog/dist/index.html +2 -2
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/CatalogShell-CvaciY0C.js +1 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{Color-6AOWCN3U-Cm-yJJz_.js → Color-6AOWCN3U-DwBV1A1Y.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/Components.stories-3dqK5g3e.js +142 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/DesignSystem.stories-2OCgtT0I.js +1 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{DocsRenderer-JROSPFPF-Belk4jRr.js → DocsRenderer-JROSPFPF-CODg0rSl.js} +4 -4
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/Primitives-BmeKjJW4.js +1 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{WithTooltip-7X4HQR7L-DoPvjkS1.js → WithTooltip-7X4HQR7L-C5MI-3uZ.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/WorkspaceStatus.stories-Tb_iQqVK.js +17 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/WorkspaceStatusSpecimen-CD54pw0-.js +1 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{chunk-DRQKCCAG-B1itKXEN.js → chunk-DRQKCCAG-KSn75jcy.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{chunk-W22LQPXL-C-Eb5SPY.js → chunk-W22LQPXL-C4LS1Thf.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{components-DnyKLwhj.js → components-DV1BRgMY.js} +5 -5
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/formatter-L2YTDE3Q-BU_68im1.js +1 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/iframe-0W0Gj_Gs.css +1 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{iframe-DcXBsFPz.js → iframe-CBbPFx5G.js} +4 -4
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{react-18-CRM89QRf.js → react-18-C9IPGXtb.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/react-CEv2qkJT.js +1 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{syntaxhighlighter-YFXUGROL-B03jQGTF.js → syntaxhighlighter-YFXUGROL-ZgDQjyWI.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{theming-4ZyufAga.js → theming-Cx9-gH6l.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/iframe.html +2 -2
- package/templates/.agents/design/apps/catalog/dist/storybook/index.json +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/sb-addons/a11y-2/manager-bundle.js +3 -3
- package/templates/.agents/design/apps/catalog/dist/storybook/sb-addons/docs-1/manager-bundle.js +4 -4
- package/templates/.agents/design/apps/catalog/dist/storybook/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +60 -60
- package/templates/.agents/design/apps/catalog/package.json +1 -1
- package/templates/.agents/design/apps/catalog/src/components/DashboardFiltersSpecimen.tsx +61 -0
- package/templates/.agents/design/apps/catalog/src/components/Primitives.tsx +24 -0
- package/templates/.agents/design/apps/catalog/src/components/WorkspaceStatusSpecimen.tsx +26 -0
- package/templates/.agents/design/apps/catalog/src/design-contract.test.ts +27 -13
- package/templates/.agents/design/apps/catalog/src/pages/ComponentsPage.tsx +38 -0
- package/templates/.agents/design/apps/catalog/src/pages/DesignSystemPage.tsx +15 -1
- package/templates/.agents/design/apps/catalog/src/stories/Components.stories.tsx +18 -0
- package/templates/.agents/design/apps/catalog/src/stories/DashboardFilters.stories.tsx +7 -0
- package/templates/.agents/design/apps/catalog/src/stories/WorkspaceStatus.stories.tsx +9 -0
- package/templates/.agents/design/apps/catalog/src/styles/components.css +83 -2
- package/templates/.agents/design/apps/catalog/src/styles.css +2 -0
- package/templates/.agents/design/packages/local-runtime/package.json +1 -1
- package/templates/.agents/design/tokens.json +32 -0
- 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 +1 -1
- package/templates/.agents/requirements/public-distribution.md +9 -3
- 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 +1 -0
- package/templates/.agents/rules/workflow.md +1 -1
- package/templates/.agents/runtime/VERSION +1 -1
- package/templates/.agents/runtime/bin/zaip.mjs +25 -24
- 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-execution/SKILL.md +13 -0
- package/templates/.agents/skills/zaip-skill-execution/references/autonomous-continuation.md +17 -0
- package/templates/.agents/skills/zaip-skill-execution/references/correction-cycle.md +2 -2
- package/templates/.agents/skills/zaip-skill-github-deploy/SKILL.md +4 -2
- package/templates/.agents/skills/zaip-skill-github-deploy/references/deployment-workflow.md +4 -2
- package/templates/.agents/skills/zaip-skill-github-deploy/references/release-identity.md +2 -2
- package/templates/.agents/skills/zaip-skill-move-prd/SKILL.md +4 -0
- package/templates/.agents/skills/zaip-skill-move-spec/SKILL.md +4 -0
- package/templates/.agents/skills/zaip-skill-prd/SKILL.md +3 -3
- package/templates/.agents/skills/zaip-skill-release-qualification/SKILL.md +11 -8
- package/templates/.agents/skills/zaip-skill-release-qualification/references/local-preparation.md +13 -12
- package/templates/.agents/skills/zaip-skill-setup/SKILL.md +17 -2
- package/templates/.agents/skills/zaip-skill-setup/agents/openai.yaml +1 -1
- package/templates/.agents/skills/zaip-skill-spec/SKILL.md +2 -2
- package/templates/.agents/zaip-aios/VERSION +1 -1
- package/templates/template-manifest.json +392 -236
- package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor--iPcnZdx.js +0 -68
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-Cmlx8OYH.css +0 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-DfdlGa7c.js +0 -2
- package/templates/.agents/design/apps/catalog/dist/assets/index-BEmIE7WE.css +0 -1
- package/templates/.agents/design/apps/catalog/dist/assets/index-BJV597iq.js +0 -72
- package/templates/.agents/design/apps/catalog/dist/assets/index-B_WhrCZe.js +0 -72
- package/templates/.agents/design/apps/catalog/dist/assets/index-CqqYWY2f.js +0 -9
- package/templates/.agents/design/apps/catalog/dist/assets/index-CqtYXZfV.js +0 -72
- package/templates/.agents/design/apps/catalog/dist/assets/index-D9pj7Jlf.js +0 -9
- package/templates/.agents/design/apps/catalog/dist/assets/index-i_PO2k9R.js +0 -9
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/CatalogShell-Cstn1UwA.js +0 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/Components.stories-D1WopB2L.js +0 -137
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/DesignSystem.stories-DQ9PJ3N3.js +0 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/formatter-L2YTDE3Q-D0OSgxWz.js +0 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/iframe-BEmIE7WE.css +0 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/react-C3tkVMIp.js +0 -1
|
@@ -3,6 +3,15 @@ import { useEffect, useRef, useState } from "react";
|
|
|
3
3
|
import type { CostMonitorProjection } from "../contracts.js";
|
|
4
4
|
import type { CostCurrency, CostLocale } from "./cost-monitor-copy.js";
|
|
5
5
|
|
|
6
|
+
export {
|
|
7
|
+
type CostRunPage,
|
|
8
|
+
loadCostMonitorDetail,
|
|
9
|
+
loadCostMonitorPeriod,
|
|
10
|
+
loadCostMonitorRunPage,
|
|
11
|
+
} from "./cost-monitor-loaders.js";
|
|
12
|
+
|
|
13
|
+
import type { loadCostMonitorPeriod } from "./cost-monitor-loaders.js";
|
|
14
|
+
|
|
6
15
|
export type CostPeriod = "all" | "7" | "30" | "90" | "month";
|
|
7
16
|
/** Cost Monitor opens on the current Sao Paulo month, matching Operations. */
|
|
8
17
|
export const defaultCostPeriod: CostPeriod = "month";
|
|
@@ -21,171 +30,6 @@ export function costPeriodDateRange(
|
|
|
21
30
|
return { from: saoPauloPeriodKey(from.toISOString(), "day") ?? to, to };
|
|
22
31
|
}
|
|
23
32
|
|
|
24
|
-
export async function loadCostMonitorPeriod({
|
|
25
|
-
currency,
|
|
26
|
-
filters,
|
|
27
|
-
from,
|
|
28
|
-
refresh,
|
|
29
|
-
to,
|
|
30
|
-
signal,
|
|
31
|
-
fetcher = fetch,
|
|
32
|
-
}: {
|
|
33
|
-
currency: CostCurrency;
|
|
34
|
-
filters?: CostFilterState;
|
|
35
|
-
from?: string;
|
|
36
|
-
refresh?: string | null;
|
|
37
|
-
to?: string;
|
|
38
|
-
signal?: AbortSignal;
|
|
39
|
-
fetcher?: typeof fetch;
|
|
40
|
-
}): Promise<CostMonitorProjection> {
|
|
41
|
-
const query = new URLSearchParams({ currency });
|
|
42
|
-
// Period and filter changes hydrate aggregate read models only. Entity
|
|
43
|
-
// detail is loaded through its dedicated bounded page route.
|
|
44
|
-
query.set("scope", "summary");
|
|
45
|
-
if (from !== undefined) query.set("from", from);
|
|
46
|
-
if (to !== undefined) query.set("to", to);
|
|
47
|
-
if (filters) {
|
|
48
|
-
const manifestFilters = [
|
|
49
|
-
["provider", filters.provider],
|
|
50
|
-
["phase", filters.phase],
|
|
51
|
-
["agent", filters.agent],
|
|
52
|
-
["model", filters.model],
|
|
53
|
-
["status", filters.status],
|
|
54
|
-
] as const;
|
|
55
|
-
for (const [key, value] of manifestFilters) {
|
|
56
|
-
if (value) query.set(key, value);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
if (refresh) query.set("refresh", refresh);
|
|
60
|
-
const response = await fetcher(`/api/v2/cost-monitor?${query.toString()}`, {
|
|
61
|
-
...(signal === undefined ? {} : { signal }),
|
|
62
|
-
});
|
|
63
|
-
if (!response.ok) {
|
|
64
|
-
const detail = (await response.text()).trim();
|
|
65
|
-
throw new Error(detail || `Cost Monitor period request failed (${response.status})`);
|
|
66
|
-
}
|
|
67
|
-
return (await response.json()) as CostMonitorProjection;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/** Exact dimensional projection, requested only after a dimensional tab opens. */
|
|
71
|
-
export async function loadCostMonitorDetail({
|
|
72
|
-
currency,
|
|
73
|
-
filters,
|
|
74
|
-
from,
|
|
75
|
-
refresh,
|
|
76
|
-
to,
|
|
77
|
-
signal,
|
|
78
|
-
fetcher = fetch,
|
|
79
|
-
}: {
|
|
80
|
-
currency: CostCurrency;
|
|
81
|
-
filters?: CostFilterState;
|
|
82
|
-
from?: string;
|
|
83
|
-
refresh?: string | null;
|
|
84
|
-
to?: string;
|
|
85
|
-
signal?: AbortSignal;
|
|
86
|
-
fetcher?: typeof fetch;
|
|
87
|
-
}): Promise<CostMonitorProjection> {
|
|
88
|
-
const query = costMonitorQuery({
|
|
89
|
-
currency,
|
|
90
|
-
...(filters === undefined ? {} : { filters }),
|
|
91
|
-
...(from === undefined ? {} : { from }),
|
|
92
|
-
...(refresh === undefined ? {} : { refresh }),
|
|
93
|
-
...(to === undefined ? {} : { to }),
|
|
94
|
-
});
|
|
95
|
-
query.set("scope", "detail");
|
|
96
|
-
const response = await fetcher(`/api/v2/cost-monitor?${query.toString()}`, {
|
|
97
|
-
...(signal === undefined ? {} : { signal }),
|
|
98
|
-
});
|
|
99
|
-
if (!response.ok)
|
|
100
|
-
throw new Error(
|
|
101
|
-
(await response.text()).trim() || `Cost Monitor detail request failed (${response.status})`,
|
|
102
|
-
);
|
|
103
|
-
return (await response.json()) as CostMonitorProjection;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export async function loadCostMonitorRunPage({
|
|
107
|
-
currency,
|
|
108
|
-
filters,
|
|
109
|
-
from,
|
|
110
|
-
limit = 10,
|
|
111
|
-
offset,
|
|
112
|
-
refresh,
|
|
113
|
-
to,
|
|
114
|
-
signal,
|
|
115
|
-
fetcher = fetch,
|
|
116
|
-
}: {
|
|
117
|
-
currency: CostCurrency;
|
|
118
|
-
filters?: CostFilterState;
|
|
119
|
-
from?: string;
|
|
120
|
-
limit?: number;
|
|
121
|
-
offset: number;
|
|
122
|
-
refresh?: string | null;
|
|
123
|
-
to?: string;
|
|
124
|
-
signal?: AbortSignal;
|
|
125
|
-
fetcher?: typeof fetch;
|
|
126
|
-
}): Promise<CostRunPage> {
|
|
127
|
-
const query = costMonitorQuery({
|
|
128
|
-
currency,
|
|
129
|
-
...(filters === undefined ? {} : { filters }),
|
|
130
|
-
...(from === undefined ? {} : { from }),
|
|
131
|
-
...(refresh === undefined ? {} : { refresh }),
|
|
132
|
-
...(to === undefined ? {} : { to }),
|
|
133
|
-
});
|
|
134
|
-
query.set("scope", "runs");
|
|
135
|
-
query.set("offset", String(Math.max(0, offset)));
|
|
136
|
-
query.set("limit", String(Math.max(1, limit)));
|
|
137
|
-
const response = await fetcher(`/api/v2/cost-monitor?${query.toString()}`, {
|
|
138
|
-
...(signal === undefined ? {} : { signal }),
|
|
139
|
-
});
|
|
140
|
-
if (!response.ok) {
|
|
141
|
-
const detail = (await response.text()).trim();
|
|
142
|
-
throw new Error(detail || `Cost Monitor run page request failed (${response.status})`);
|
|
143
|
-
}
|
|
144
|
-
const payload = (await response.json()) as Pick<CostMonitorProjection, "runs" | "run_page">;
|
|
145
|
-
return {
|
|
146
|
-
page_only: true,
|
|
147
|
-
runs: payload.runs,
|
|
148
|
-
run_page: payload.run_page ?? { offset, limit, total: null, has_more: false },
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
/** Complete contract for the incremental Run endpoint; it is not a summary projection. */
|
|
153
|
-
export interface CostRunPage {
|
|
154
|
-
page_only: true;
|
|
155
|
-
runs: CostMonitorProjection["runs"];
|
|
156
|
-
run_page: { offset: number; limit: number; total: number | null; has_more: boolean };
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
function costMonitorQuery({
|
|
160
|
-
currency,
|
|
161
|
-
filters,
|
|
162
|
-
from,
|
|
163
|
-
refresh,
|
|
164
|
-
to,
|
|
165
|
-
}: {
|
|
166
|
-
currency: CostCurrency;
|
|
167
|
-
filters?: CostFilterState;
|
|
168
|
-
from?: string;
|
|
169
|
-
refresh?: string | null;
|
|
170
|
-
to?: string;
|
|
171
|
-
}): URLSearchParams {
|
|
172
|
-
const query = new URLSearchParams({ currency });
|
|
173
|
-
if (from !== undefined) query.set("from", from);
|
|
174
|
-
if (to !== undefined) query.set("to", to);
|
|
175
|
-
if (filters) {
|
|
176
|
-
const manifestFilters = [
|
|
177
|
-
["provider", filters.provider],
|
|
178
|
-
["phase", filters.phase],
|
|
179
|
-
["agent", filters.agent],
|
|
180
|
-
["model", filters.model],
|
|
181
|
-
["status", filters.status],
|
|
182
|
-
] as const;
|
|
183
|
-
for (const [key, value] of manifestFilters) if (value) query.set(key, value);
|
|
184
|
-
}
|
|
185
|
-
if (refresh) query.set("refresh", refresh);
|
|
186
|
-
return query;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
33
|
export function useCostMonitorPeriod({
|
|
190
34
|
currency,
|
|
191
35
|
data,
|
|
@@ -219,7 +63,9 @@ export function useCostMonitorPeriod({
|
|
|
219
63
|
loadPeriodRef.current = loadPeriod;
|
|
220
64
|
const requestedRange =
|
|
221
65
|
dateRange === undefined
|
|
222
|
-
?
|
|
66
|
+
? snapshotBacked && period === defaultCostPeriod
|
|
67
|
+
? undefined
|
|
68
|
+
: costPeriodDateRange(period)
|
|
223
69
|
: { from: dateRange.start, to: dateRange.end };
|
|
224
70
|
const requestedFrom = requestedRange?.from;
|
|
225
71
|
const requestedTo = requestedRange?.to;
|
|
@@ -471,7 +317,7 @@ function Select({
|
|
|
471
317
|
return (
|
|
472
318
|
<label>
|
|
473
319
|
<span>{label}</span>
|
|
474
|
-
<select onChange={(event) => onChange(event.target.value)} value={value}>
|
|
320
|
+
<select aria-label={label} onChange={(event) => onChange(event.target.value)} value={value}>
|
|
475
321
|
<option value="">{allLabel}</option>
|
|
476
322
|
{options.map((option) => (
|
|
477
323
|
<option key={option} value={option}>
|
|
@@ -102,16 +102,9 @@ export function CostGroupsTable({
|
|
|
102
102
|
showAgentIdentity || showModelLifecycleDetails ? (value ?? 0) : value,
|
|
103
103
|
locale,
|
|
104
104
|
);
|
|
105
|
-
const displayDuration = (value: DurationCoverage) =>
|
|
106
|
-
(showAgentIdentity || showModelLifecycleDetails) && value.known_sum <= 0
|
|
107
|
-
? "0"
|
|
108
|
-
: formatDurationCoverage(value, locale);
|
|
105
|
+
const displayDuration = (value: DurationCoverage) => formatDurationCoverage(value, locale);
|
|
109
106
|
const displayCurrency = (value: number | null) =>
|
|
110
|
-
formatAuditableCurrency(
|
|
111
|
-
showAgentIdentity || showModelLifecycleDetails ? (value ?? 0) : value,
|
|
112
|
-
currency,
|
|
113
|
-
locale,
|
|
114
|
-
);
|
|
107
|
+
formatAuditableCurrency(value, currency, locale);
|
|
115
108
|
const conversationCount = (row: unknown): number | null =>
|
|
116
109
|
(row as { conversation_count?: number | null }).conversation_count ?? null;
|
|
117
110
|
const pageTotals = {
|
|
@@ -177,7 +177,7 @@ describe("cost monitor navigation", () => {
|
|
|
177
177
|
period: defaultCostPeriod,
|
|
178
178
|
runPageRange: monthRange,
|
|
179
179
|
}),
|
|
180
|
-
).
|
|
180
|
+
).toBeUndefined();
|
|
181
181
|
});
|
|
182
182
|
|
|
183
183
|
it("keeps compact SPEC and PRD pages and their export source on the all-time snapshot", () => {
|
|
@@ -282,7 +282,7 @@ describe("cost monitor navigation", () => {
|
|
|
282
282
|
duration_ms: 619_958_763,
|
|
283
283
|
});
|
|
284
284
|
});
|
|
285
|
-
it("
|
|
285
|
+
it("renders factual compact duration without a visible missing-data count", () => {
|
|
286
286
|
const table = readFileSync(new URL("./CompactLifecycleCostTable.tsx", import.meta.url), "utf8");
|
|
287
287
|
const summary = readFileSync(new URL("./CostSummary.tsx", import.meta.url), "utf8");
|
|
288
288
|
expect(table).toContain("compactLifecycleDurationMs(row)");
|
|
@@ -292,7 +292,7 @@ describe("cost monitor navigation", () => {
|
|
|
292
292
|
expect(summary).not.toContain("formatPercent(");
|
|
293
293
|
});
|
|
294
294
|
|
|
295
|
-
it("
|
|
295
|
+
it("preserves unavailable timing and coverage when a paginated row has only tokens", () => {
|
|
296
296
|
const metric = (known_sum: number, unknown: number) => ({
|
|
297
297
|
known_sum,
|
|
298
298
|
unknown,
|
|
@@ -306,12 +306,12 @@ describe("cost monitor navigation", () => {
|
|
|
306
306
|
cost: metric(0, 1),
|
|
307
307
|
},
|
|
308
308
|
} as never;
|
|
309
|
-
expect(compactLifecycleDurationMs(row)).
|
|
309
|
+
expect(compactLifecycleDurationMs(row)).toBeNull();
|
|
310
310
|
expect(withTokenBackedCompactDuration(row).metrics.duration).toEqual({
|
|
311
|
-
known_sum:
|
|
312
|
-
unknown:
|
|
313
|
-
complete:
|
|
314
|
-
coverage_ratio:
|
|
311
|
+
known_sum: 0,
|
|
312
|
+
unknown: 1,
|
|
313
|
+
complete: false,
|
|
314
|
+
coverage_ratio: 0,
|
|
315
315
|
});
|
|
316
316
|
});
|
|
317
317
|
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type OperationsProjection,
|
|
3
|
-
type RunProjection,
|
|
4
|
-
saoPauloPeriodKey,
|
|
5
|
-
} from "@zaip-ai/dashboard-operations/contracts";
|
|
1
|
+
import { type RunProjection, saoPauloPeriodKey } from "@zaip-ai/dashboard-operations/contracts";
|
|
6
2
|
import { ExcelExportAction } from "@zaip-ai/dashboard-operations/react";
|
|
7
3
|
import { DashboardHeader } from "@zaip-ai/dashboard-ui";
|
|
8
|
-
import {
|
|
4
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
9
5
|
import { includeConfiguredAgentGroups } from "../agent-groups.js";
|
|
10
6
|
import type { CostMonitorProjection } from "../contracts.js";
|
|
11
7
|
import { normalizeCostProvider } from "../provider.js";
|
|
@@ -27,6 +23,7 @@ import { CostMonitorContent } from "./CostMonitorContent.js";
|
|
|
27
23
|
import { CostMonitorLoadErrors } from "./CostMonitorLoadErrors.js";
|
|
28
24
|
import { CostMonitorNavigation, type CostNavigationPopup } from "./CostMonitorNavigation.js";
|
|
29
25
|
import { CostSummary } from "./CostSummary.js";
|
|
26
|
+
import type { CostMonitorPageProps } from "./cost-monitor-page-props.js";
|
|
30
27
|
import {
|
|
31
28
|
groupRows,
|
|
32
29
|
matches,
|
|
@@ -50,12 +47,8 @@ import { summarizeCostRows } from "./cost-monitor-summary.js";
|
|
|
50
47
|
import { COST_VIEW_ORDER, type CostView, DEFAULT_COST_VIEW } from "./cost-monitor-views.js";
|
|
51
48
|
import { resolveCompactCostPageRange, resolveCostGroupPageRange } from "./cost-page-range.js";
|
|
52
49
|
import { enrichPeriodCostGroups } from "./period-cost-groups.js";
|
|
53
|
-
import {
|
|
54
|
-
|
|
55
|
-
type LoadCompactCostPage,
|
|
56
|
-
useCompactCostPage,
|
|
57
|
-
} from "./use-compact-cost-page.js";
|
|
58
|
-
import { type LoadCostGroupPage, useCostGroupPage } from "./use-cost-group-page.js";
|
|
50
|
+
import { compactReadModelKind, useCompactCostPage } from "./use-compact-cost-page.js";
|
|
51
|
+
import { useCostGroupPage } from "./use-cost-group-page.js";
|
|
59
52
|
import { useCostRunPage } from "./use-cost-run-page.js";
|
|
60
53
|
import "./cost-monitor.css";
|
|
61
54
|
import "./cost-monitor-responsive.css";
|
|
@@ -110,38 +103,7 @@ export function CostMonitorPage({
|
|
|
110
103
|
repositoryName,
|
|
111
104
|
currency: controlledCurrency,
|
|
112
105
|
onCurrencyChange,
|
|
113
|
-
}: {
|
|
114
|
-
capabilityNavigation?: ReactNode;
|
|
115
|
-
data: CostMonitorProjection;
|
|
116
|
-
dashboardTitle?: string;
|
|
117
|
-
embedded?: boolean;
|
|
118
|
-
globalFilters?: { query: string; datePreset: string; dateRange?: { start: string; end: string } };
|
|
119
|
-
lastUpdatedAt: string | null;
|
|
120
|
-
locale: CostLocale;
|
|
121
|
-
loading: boolean;
|
|
122
|
-
onLoadingChange?: (loading: boolean) => void;
|
|
123
|
-
onLocaleChange: (locale: CostLocale) => void;
|
|
124
|
-
onOpenTrace: (taskId: string) => void;
|
|
125
|
-
onActiveDataChange?: (data: CostMonitorProjection) => void;
|
|
126
|
-
/**
|
|
127
|
-
* Retained for host compatibility. Cost views must use bounded summary or
|
|
128
|
-
* page routes; activating a tab never requests the historical detail blob.
|
|
129
|
-
*/
|
|
130
|
-
onDetailDataRequest?: () => void;
|
|
131
|
-
onRefresh: () => void;
|
|
132
|
-
loadDetail?: LoadCostMonitorDetail;
|
|
133
|
-
loadRunPage?: LoadCostRunPage;
|
|
134
|
-
loadReadModelPage?: LoadCompactCostPage;
|
|
135
|
-
loadGroupPage?: LoadCostGroupPage;
|
|
136
|
-
loadPeriod?: typeof loadCostMonitorPeriod;
|
|
137
|
-
operations?: Pick<
|
|
138
|
-
OperationsProjection,
|
|
139
|
-
"runs" | "specs" | "tasks" | "executions" | "evidences" | "validations" | "summary"
|
|
140
|
-
>;
|
|
141
|
-
repositoryName?: string;
|
|
142
|
-
currency?: CostCurrency;
|
|
143
|
-
onCurrencyChange?: (currency: CostCurrency) => void;
|
|
144
|
-
}) {
|
|
106
|
+
}: CostMonitorPageProps) {
|
|
145
107
|
const [view, setView] = useState<CostView>(DEFAULT_COST_VIEW);
|
|
146
108
|
const [filters, setFilters] = useState<CostFilterState>(emptyCostFilters);
|
|
147
109
|
const [localCurrency, setLocalCurrency] = useState<CostCurrency>("BRL");
|
|
@@ -168,11 +130,15 @@ export function CostMonitorPage({
|
|
|
168
130
|
const loadDetailRef = useRef(loadDetail);
|
|
169
131
|
loadDetailRef.current = loadDetail;
|
|
170
132
|
const text = costCopy[locale];
|
|
133
|
+
const summaryFilters = useMemo(
|
|
134
|
+
() => ({ ...filters, query: filters.query || globalFilters?.query || "" }),
|
|
135
|
+
[filters, globalFilters?.query],
|
|
136
|
+
);
|
|
171
137
|
const { activeData, periodError, periodLoading } = useCostMonitorPeriod({
|
|
172
138
|
currency,
|
|
173
139
|
data,
|
|
174
140
|
...(globalFilters === undefined ? {} : { dateRange: globalFilters.dateRange }),
|
|
175
|
-
filters,
|
|
141
|
+
filters: summaryFilters,
|
|
176
142
|
lastUpdatedAt,
|
|
177
143
|
loadPeriod,
|
|
178
144
|
period,
|
|
@@ -353,10 +319,10 @@ export function CostMonitorPage({
|
|
|
353
319
|
}, [currency, detailAttempt, filters, lastUpdatedAt, runPageFrom, runPageTo]);
|
|
354
320
|
const pagedRunRows = useMemo(
|
|
355
321
|
() =>
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
[
|
|
322
|
+
// The endpoint filters before pagination, including usage segments.
|
|
323
|
+
// Filtering its page again by a sparse display row loses valid matches.
|
|
324
|
+
runPageData?.runs ?? [],
|
|
325
|
+
[runPageData?.runs],
|
|
360
326
|
);
|
|
361
327
|
const dimensionalRows = useMemo(
|
|
362
328
|
() =>
|
|
@@ -395,8 +361,7 @@ export function CostMonitorPage({
|
|
|
395
361
|
);
|
|
396
362
|
const visiblePrds = periodEntities.prds;
|
|
397
363
|
const visibleSpecs = periodEntities.specs;
|
|
398
|
-
const useAggregateGroups =
|
|
399
|
-
activeData.aggregate_only === true && dimensionalRows.length === 0 && !hasLocalCostFilters;
|
|
364
|
+
const useAggregateGroups = activeData.aggregate_only === true && dimensionalRows.length === 0;
|
|
400
365
|
const groups = useMemo(() => {
|
|
401
366
|
if (useAggregateGroups) return activeData.groups;
|
|
402
367
|
return {
|
|
@@ -730,7 +695,7 @@ export function CostMonitorPage({
|
|
|
730
695
|
<div className="cost-tab-export">
|
|
731
696
|
{" "}
|
|
732
697
|
<ExcelExportAction
|
|
733
|
-
filters={{ ...
|
|
698
|
+
filters={{ ...globalFilters, ...summaryFilters, period }}
|
|
734
699
|
pageSource={
|
|
735
700
|
compactExportSource ??
|
|
736
701
|
agentInvocationExportSource ??
|
|
@@ -743,6 +708,18 @@ export function CostMonitorPage({
|
|
|
743
708
|
</div>
|
|
744
709
|
) : null}
|
|
745
710
|
</div>{" "}
|
|
711
|
+
{embedded && view !== "developers" ? (
|
|
712
|
+
<details className="cost-embedded-filters">
|
|
713
|
+
<summary>{locale === "pt-BR" ? "Filtros de custos" : "Cost filters"}</summary>
|
|
714
|
+
<CostFilters
|
|
715
|
+
available={data.filters_available}
|
|
716
|
+
hideQuery
|
|
717
|
+
locale={locale}
|
|
718
|
+
onChange={setFilters}
|
|
719
|
+
value={filters}
|
|
720
|
+
/>
|
|
721
|
+
</details>
|
|
722
|
+
) : null}
|
|
746
723
|
{/* CostMonitorContent owns `view === "models" && useAggregateGroups ? (` and `rows={groups.models}`. */}{" "}
|
|
747
724
|
<CostMonitorContent
|
|
748
725
|
canonicalDurationTotal={canonicalDurationTotal}
|
|
@@ -105,7 +105,7 @@ describe("period-driven Cost Monitor loading", () => {
|
|
|
105
105
|
url:
|
|
106
106
|
"/api/v2/cost-monitor?currency=BRL&scope=summary&from=2026-07-01&to=2026-07-26" +
|
|
107
107
|
"&provider=openai&phase=execution&agent=zaip-agent-builder" +
|
|
108
|
-
"&model=gpt-5.6-terra&status=completed",
|
|
108
|
+
"&model=gpt-5.6-terra&status=completed&query=TASK-1&priority=high&risk=standard&origin=spec&workType=rework",
|
|
109
109
|
signal: controller.signal,
|
|
110
110
|
},
|
|
111
111
|
]);
|
|
@@ -176,10 +176,10 @@ describe("grouped cost availability", () => {
|
|
|
176
176
|
...model,
|
|
177
177
|
duration: { known_sum: 0, unknown: 1, complete: false, coverage_ratio: 0 },
|
|
178
178
|
}),
|
|
179
|
-
).toBe("
|
|
179
|
+
).toBe("Indisponível");
|
|
180
180
|
expect(
|
|
181
181
|
columns.find((column) => column.key === "cost")?.render?.({ ...model, estimated_brl: null }),
|
|
182
|
-
).
|
|
182
|
+
).toBe("Indisponível");
|
|
183
183
|
expect(
|
|
184
184
|
columns
|
|
185
185
|
.find((column) => column.key === "tokens")
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
import type { CostGroupRow } from "../contracts.js";
|
|
3
3
|
import {
|
|
4
|
-
agentRunModelPresentation,
|
|
5
4
|
type CostDeveloperAttributionRow,
|
|
6
5
|
CostDeveloperAttributionTable,
|
|
7
6
|
CostGroupsTable,
|
|
@@ -27,29 +26,6 @@ import {
|
|
|
27
26
|
runOriginBadge,
|
|
28
27
|
} from "./CostTables.js";
|
|
29
28
|
|
|
30
|
-
describe("Agent Run model presentation", () => {
|
|
31
|
-
it("shows only the effective model and its provider", () => {
|
|
32
|
-
expect(
|
|
33
|
-
agentRunModelPresentation({
|
|
34
|
-
requested_model: "gpt-5.6-terra",
|
|
35
|
-
model: "gpt-5.6-sol",
|
|
36
|
-
provider: "openai",
|
|
37
|
-
}),
|
|
38
|
-
).toEqual({ primary: "gpt-5.6-sol", detail: "openai" });
|
|
39
|
-
});
|
|
40
|
-
it("does not mention an unavailable planned configuration", () => {
|
|
41
|
-
expect(
|
|
42
|
-
agentRunModelPresentation({
|
|
43
|
-
requested_model: "unknown",
|
|
44
|
-
model: "gpt-5.6-sol",
|
|
45
|
-
provider: "openai",
|
|
46
|
-
}),
|
|
47
|
-
).toEqual({
|
|
48
|
-
primary: "gpt-5.6-sol",
|
|
49
|
-
detail: "openai",
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
29
|
describe("period formatting", () => {
|
|
54
30
|
it("renders daily dates and keeps monthly periods numerically sortable", () => {
|
|
55
31
|
expect(formatCostPeriodLabel("2026-07-16", "daily", "pt-BR")).toBe("16/07/2026");
|
|
@@ -456,7 +432,7 @@ describe("grouped cost availability", () => {
|
|
|
456
432
|
expect(columns.find((column) => column.key === "tasks")?.label).toBe("Tarefas");
|
|
457
433
|
expect(table.props.defaultSort).toEqual({ key: "cost", direction: "desc" });
|
|
458
434
|
});
|
|
459
|
-
it("
|
|
435
|
+
it("preserves unavailable Agent duration and cost independently of entity counts", () => {
|
|
460
436
|
const missing: CostGroupRow = {
|
|
461
437
|
...unavailableGroup,
|
|
462
438
|
task_count: null,
|
|
@@ -476,9 +452,10 @@ describe("grouped cost availability", () => {
|
|
|
476
452
|
render?: (row: CostGroupRow) => unknown;
|
|
477
453
|
footer?: unknown;
|
|
478
454
|
}>;
|
|
479
|
-
for (const key of ["tasks", "prds", "specs", "tests", "evidences", "
|
|
455
|
+
for (const key of ["tasks", "prds", "specs", "tests", "evidences", "tokens"]) {
|
|
480
456
|
expect(columns.find((c) => c.key === key)?.render?.(missing)).toBe("0");
|
|
481
457
|
}
|
|
482
|
-
expect(columns.find((c) => c.key === "
|
|
458
|
+
expect(columns.find((c) => c.key === "duration")?.render?.(missing)).toBe("Indisponível");
|
|
459
|
+
expect(columns.find((c) => c.key === "cost")?.render?.(missing)).toBe("Indisponível");
|
|
483
460
|
});
|
|
484
461
|
});
|
|
@@ -32,7 +32,7 @@ describe("macroCostDuration", () => {
|
|
|
32
32
|
expect(operationalMacroDuration({ duration_ms: 2_686_869 } as never)).toBeNull();
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
-
it("accepts factual values and
|
|
35
|
+
it("accepts factual values and leaves time unavailable for a tokenized Run without timing", () => {
|
|
36
36
|
expect(
|
|
37
37
|
macroCostDuration({
|
|
38
38
|
source_duration_ms: null,
|
|
@@ -46,7 +46,7 @@ describe("macroCostDuration", () => {
|
|
|
46
46
|
duration_ms: null,
|
|
47
47
|
usage: { total: { tokens: { total: 4_000_000 } } },
|
|
48
48
|
} as never),
|
|
49
|
-
).
|
|
49
|
+
).toBeNull();
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
it("uses only the root execution analytical duration, never lifecycle elapsed time or a subrun", () => {
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
formatPercent,
|
|
12
12
|
} from "@zaip-ai/dashboard-ui";
|
|
13
13
|
import { useState } from "react";
|
|
14
|
-
import { estimatedDurationMs } from "../duration-estimate.js";
|
|
15
14
|
import { formatDateTime, sortCostValue } from "./CostTables.js";
|
|
16
15
|
import type { CostCurrency, CostLocale } from "./cost-monitor-copy.js";
|
|
17
16
|
|
|
@@ -200,11 +199,13 @@ export function macroCostDuration(
|
|
|
200
199
|
): number | null {
|
|
201
200
|
if (typeof run.source_duration_ms === "number") return run.source_duration_ms;
|
|
202
201
|
if (
|
|
203
|
-
(run.duration_provenance === "
|
|
202
|
+
(run.duration_provenance === "observed" ||
|
|
203
|
+
run.duration_provenance === "legacy_inferred" ||
|
|
204
|
+
run.duration_provenance === "reconciled") &&
|
|
204
205
|
typeof run.duration_ms === "number"
|
|
205
206
|
)
|
|
206
207
|
return run.duration_ms;
|
|
207
|
-
return
|
|
208
|
+
return null;
|
|
208
209
|
}
|
|
209
210
|
|
|
210
211
|
export function macroCoverageProvenanceLabel(
|
package/templates/.agents/dashboard/modules/cost-monitor/src/react/agent-model-presentation.test.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { agentRunModelPresentation } from "./CostTables.js";
|
|
3
|
+
|
|
4
|
+
describe("Agent Run model presentation", () => {
|
|
5
|
+
it("shows only the effective model and its provider", () => {
|
|
6
|
+
expect(
|
|
7
|
+
agentRunModelPresentation({
|
|
8
|
+
requested_model: "gpt-5.6-terra",
|
|
9
|
+
model: "gpt-5.6-sol",
|
|
10
|
+
provider: "openai",
|
|
11
|
+
}),
|
|
12
|
+
).toEqual({ primary: "gpt-5.6-sol", detail: "openai" });
|
|
13
|
+
});
|
|
14
|
+
it("does not mention an unavailable planned configuration", () => {
|
|
15
|
+
expect(
|
|
16
|
+
agentRunModelPresentation({
|
|
17
|
+
requested_model: "unknown",
|
|
18
|
+
model: "gpt-5.6-sol",
|
|
19
|
+
provider: "openai",
|
|
20
|
+
}),
|
|
21
|
+
).toEqual({
|
|
22
|
+
primary: "gpt-5.6-sol",
|
|
23
|
+
detail: "openai",
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
});
|