@zaip-ai/cli 3.3.0 → 3.5.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 +286 -126
- 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-B9GWkEyN.css → ProjectSettingsPage-CQMhvzvJ.css} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-D46WWIKr.js +3 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-BzVtGLWS.js → TraceabilityWorkspace-BKBpJyLh.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-Bas2TVju.js +2 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-CxrG_wRI.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/ProjectSettingsCard.tsx +5 -0
- package/templates/.agents/dashboard/apps/frontend/src/ProjectSettingsField.tsx +21 -0
- package/templates/.agents/dashboard/apps/frontend/src/ProjectSettingsPage.dom.test.ts +12 -1
- package/templates/.agents/dashboard/apps/frontend/src/ProjectSettingsPage.tsx +16 -28
- package/templates/.agents/dashboard/apps/frontend/src/ProjectStackEditor.tsx +25 -4
- package/templates/.agents/dashboard/apps/frontend/src/WorkspaceStatus.test.tsx +51 -0
- package/templates/.agents/dashboard/apps/frontend/src/WorkspaceStatus.tsx +39 -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/project-settings-copy.ts +13 -4
- package/templates/.agents/dashboard/apps/frontend/src/project-settings-model.ts +25 -1
- package/templates/.agents/dashboard/apps/frontend/src/project-settings-workspace.css +28 -0
- package/templates/.agents/dashboard/apps/frontend/src/project-settings.test.ts +39 -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 +20 -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 +42 -8
- 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/project-settings.test.ts +2 -3
- package/templates/.agents/dashboard/packages/local-runtime/src/project-settings.ts +1 -1
- 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-pricing-provenance.test.ts +39 -0
- 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 +20 -47
- 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 +105 -69
- 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-D1JaPXfV.css +1 -0
- package/templates/.agents/design/apps/catalog/dist/assets/index-D2miO4-O.js +72 -0
- package/templates/.agents/design/apps/catalog/dist/assets/{index-BOjCcUaU.js → index-QJsgr9Ht.js} +3 -3
- package/templates/.agents/design/apps/catalog/dist/assets/{index-CqtYXZfV.js → index-mvD5mwcC.js} +3 -3
- package/templates/.agents/design/apps/catalog/dist/index.html +2 -2
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/CatalogShell-BJ8b4xZr.js +1 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{Color-6AOWCN3U-Cm-yJJz_.js → Color-6AOWCN3U-CQLHzznn.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/Components.stories-kxWwSKin.js +146 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/DashboardFilters.stories-Chm_dXV7.js +9 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/DashboardFiltersSpecimen-9CaCbGIZ.js +1 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/DesignSystem.stories-ED52wFjY.js +1 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{DocsRenderer-JROSPFPF-Belk4jRr.js → DocsRenderer-JROSPFPF-BcLgM80v.js} +4 -4
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/Primitives-DV6Bpudf.js +1 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{WithTooltip-7X4HQR7L-DoPvjkS1.js → WithTooltip-7X4HQR7L-BKNiAz_E.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/WorkspaceStatus.stories-BL19HGOo.js +17 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/WorkspaceStatusSpecimen-DQnSS6s9.js +1 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{chunk-DRQKCCAG-B1itKXEN.js → chunk-DRQKCCAG-DZBcXL-p.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{chunk-W22LQPXL-C-Eb5SPY.js → chunk-W22LQPXL-CF3y2mfo.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{components-DnyKLwhj.js → components-BVjxMRGq.js} +5 -5
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/formatter-L2YTDE3Q-Do9sjqiW.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-CTWGZcEe.js} +4 -4
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{react-18-CRM89QRf.js → react-18-B9_a4mHb.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/react-NrUxok8K.js +1 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{syntaxhighlighter-YFXUGROL-B03jQGTF.js → syntaxhighlighter-YFXUGROL-F_p8E2xc.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{theming-4ZyufAga.js → theming-fbSD9ZLF.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/storybook-core-server-presets-0/common-manager-bundle.js +3 -3
- 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/StackVersionFieldSpecimen.tsx +70 -0
- package/templates/.agents/design/apps/catalog/src/components/WorkspaceStatusSpecimen.tsx +42 -0
- package/templates/.agents/design/apps/catalog/src/design-contract.test.ts +27 -13
- package/templates/.agents/design/apps/catalog/src/pages/ComponentsPage.tsx +52 -0
- package/templates/.agents/design/apps/catalog/src/pages/DesignSystemPage.tsx +15 -1
- package/templates/.agents/design/apps/catalog/src/stories/Components.stories.tsx +32 -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 +12 -0
- package/templates/.agents/design/apps/catalog/src/styles/components.css +84 -3
- package/templates/.agents/design/apps/catalog/src/styles/stack-version-field.css +17 -0
- 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 +2 -2
- package/templates/.agents/runtime/VERSION +1 -1
- package/templates/.agents/runtime/bin/zaip.mjs +27 -26
- 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 +9 -6
- package/templates/.agents/skills/zaip-skill-github-deploy/agents/openai.yaml +1 -1
- package/templates/.agents/skills/zaip-skill-github-deploy/references/deployment-workflow.md +11 -9
- package/templates/.agents/skills/zaip-skill-github-deploy/references/release-identity.md +2 -2
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/consumer-release-preparation.mjs +1 -2
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/consumer-release-preparation.test.mjs +9 -1
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/github-deploy-contract.test.mjs +23 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/preflight.mjs +2 -6
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/preflight.test.mjs +15 -1
- 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 +445 -245
- package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-BpsAFy0g.js +0 -3
- 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-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
|
@@ -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
|
+
});
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import type { CostMonitorProjection } from "../contracts.js";
|
|
2
|
+
import type { CostFilterState } from "./CostFilters.js";
|
|
3
|
+
import type { CostCurrency } from "./cost-monitor-copy.js";
|
|
4
|
+
|
|
5
|
+
export async function loadCostMonitorPeriod({
|
|
6
|
+
currency,
|
|
7
|
+
filters,
|
|
8
|
+
from,
|
|
9
|
+
refresh,
|
|
10
|
+
to,
|
|
11
|
+
signal,
|
|
12
|
+
fetcher = fetch,
|
|
13
|
+
}: {
|
|
14
|
+
currency: CostCurrency;
|
|
15
|
+
filters?: CostFilterState;
|
|
16
|
+
from?: string;
|
|
17
|
+
refresh?: string | null;
|
|
18
|
+
to?: string;
|
|
19
|
+
signal?: AbortSignal;
|
|
20
|
+
fetcher?: typeof fetch;
|
|
21
|
+
}): Promise<CostMonitorProjection> {
|
|
22
|
+
const query = new URLSearchParams({ currency });
|
|
23
|
+
// Period and filter changes hydrate aggregate read models only. Entity
|
|
24
|
+
// detail is loaded through its dedicated bounded page route.
|
|
25
|
+
query.set("scope", "summary");
|
|
26
|
+
if (from !== undefined) query.set("from", from);
|
|
27
|
+
if (to !== undefined) query.set("to", to);
|
|
28
|
+
if (filters) {
|
|
29
|
+
const manifestFilters = [
|
|
30
|
+
["provider", filters.provider],
|
|
31
|
+
["phase", filters.phase],
|
|
32
|
+
["agent", filters.agent],
|
|
33
|
+
["model", filters.model],
|
|
34
|
+
["status", filters.status],
|
|
35
|
+
["query", filters.query],
|
|
36
|
+
["priority", filters.priority],
|
|
37
|
+
["risk", filters.risk],
|
|
38
|
+
["origin", filters.origin],
|
|
39
|
+
["workType", filters.workType],
|
|
40
|
+
] as const;
|
|
41
|
+
for (const [key, value] of manifestFilters) {
|
|
42
|
+
if (value) query.set(key, value);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (refresh) query.set("refresh", refresh);
|
|
46
|
+
const response = await fetcher(`/api/v2/cost-monitor?${query.toString()}`, {
|
|
47
|
+
...(signal === undefined ? {} : { signal }),
|
|
48
|
+
});
|
|
49
|
+
if (!response.ok) {
|
|
50
|
+
const detail = (await response.text()).trim();
|
|
51
|
+
throw new Error(detail || `Cost Monitor period request failed (${response.status})`);
|
|
52
|
+
}
|
|
53
|
+
return (await response.json()) as CostMonitorProjection;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Exact dimensional projection, requested only after a dimensional tab opens. */
|
|
57
|
+
export async function loadCostMonitorDetail({
|
|
58
|
+
currency,
|
|
59
|
+
filters,
|
|
60
|
+
from,
|
|
61
|
+
refresh,
|
|
62
|
+
to,
|
|
63
|
+
signal,
|
|
64
|
+
fetcher = fetch,
|
|
65
|
+
}: {
|
|
66
|
+
currency: CostCurrency;
|
|
67
|
+
filters?: CostFilterState;
|
|
68
|
+
from?: string;
|
|
69
|
+
refresh?: string | null;
|
|
70
|
+
to?: string;
|
|
71
|
+
signal?: AbortSignal;
|
|
72
|
+
fetcher?: typeof fetch;
|
|
73
|
+
}): Promise<CostMonitorProjection> {
|
|
74
|
+
const query = costMonitorQuery({
|
|
75
|
+
currency,
|
|
76
|
+
...(filters === undefined ? {} : { filters }),
|
|
77
|
+
...(from === undefined ? {} : { from }),
|
|
78
|
+
...(refresh === undefined ? {} : { refresh }),
|
|
79
|
+
...(to === undefined ? {} : { to }),
|
|
80
|
+
});
|
|
81
|
+
query.set("scope", "detail");
|
|
82
|
+
const response = await fetcher(`/api/v2/cost-monitor?${query.toString()}`, {
|
|
83
|
+
...(signal === undefined ? {} : { signal }),
|
|
84
|
+
});
|
|
85
|
+
if (!response.ok)
|
|
86
|
+
throw new Error(
|
|
87
|
+
(await response.text()).trim() || `Cost Monitor detail request failed (${response.status})`,
|
|
88
|
+
);
|
|
89
|
+
return (await response.json()) as CostMonitorProjection;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export async function loadCostMonitorRunPage({
|
|
93
|
+
currency,
|
|
94
|
+
filters,
|
|
95
|
+
from,
|
|
96
|
+
limit = 10,
|
|
97
|
+
offset,
|
|
98
|
+
refresh,
|
|
99
|
+
to,
|
|
100
|
+
signal,
|
|
101
|
+
fetcher = fetch,
|
|
102
|
+
}: {
|
|
103
|
+
currency: CostCurrency;
|
|
104
|
+
filters?: CostFilterState;
|
|
105
|
+
from?: string;
|
|
106
|
+
limit?: number;
|
|
107
|
+
offset: number;
|
|
108
|
+
refresh?: string | null;
|
|
109
|
+
to?: string;
|
|
110
|
+
signal?: AbortSignal;
|
|
111
|
+
fetcher?: typeof fetch;
|
|
112
|
+
}): Promise<CostRunPage> {
|
|
113
|
+
const query = costMonitorQuery({
|
|
114
|
+
currency,
|
|
115
|
+
...(filters === undefined ? {} : { filters }),
|
|
116
|
+
...(from === undefined ? {} : { from }),
|
|
117
|
+
...(refresh === undefined ? {} : { refresh }),
|
|
118
|
+
...(to === undefined ? {} : { to }),
|
|
119
|
+
});
|
|
120
|
+
query.set("scope", "runs");
|
|
121
|
+
query.set("offset", String(Math.max(0, offset)));
|
|
122
|
+
query.set("limit", String(Math.max(1, limit)));
|
|
123
|
+
const response = await fetcher(`/api/v2/cost-monitor?${query.toString()}`, {
|
|
124
|
+
...(signal === undefined ? {} : { signal }),
|
|
125
|
+
});
|
|
126
|
+
if (!response.ok) {
|
|
127
|
+
const detail = (await response.text()).trim();
|
|
128
|
+
throw new Error(detail || `Cost Monitor run page request failed (${response.status})`);
|
|
129
|
+
}
|
|
130
|
+
const payload = (await response.json()) as Pick<CostMonitorProjection, "runs" | "run_page">;
|
|
131
|
+
return {
|
|
132
|
+
page_only: true,
|
|
133
|
+
runs: payload.runs,
|
|
134
|
+
run_page: payload.run_page ?? { offset, limit, total: null, has_more: false },
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** Complete contract for the incremental Run endpoint; it is not a summary projection. */
|
|
139
|
+
export interface CostRunPage {
|
|
140
|
+
page_only: true;
|
|
141
|
+
runs: CostMonitorProjection["runs"];
|
|
142
|
+
run_page: { offset: number; limit: number; total: number | null; has_more: boolean };
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function costMonitorQuery({
|
|
146
|
+
currency,
|
|
147
|
+
filters,
|
|
148
|
+
from,
|
|
149
|
+
refresh,
|
|
150
|
+
to,
|
|
151
|
+
}: {
|
|
152
|
+
currency: CostCurrency;
|
|
153
|
+
filters?: CostFilterState;
|
|
154
|
+
from?: string;
|
|
155
|
+
refresh?: string | null;
|
|
156
|
+
to?: string;
|
|
157
|
+
}): URLSearchParams {
|
|
158
|
+
const query = new URLSearchParams({ currency });
|
|
159
|
+
if (from !== undefined) query.set("from", from);
|
|
160
|
+
if (to !== undefined) query.set("to", to);
|
|
161
|
+
if (filters) {
|
|
162
|
+
const manifestFilters = [
|
|
163
|
+
["provider", filters.provider],
|
|
164
|
+
["phase", filters.phase],
|
|
165
|
+
["agent", filters.agent],
|
|
166
|
+
["model", filters.model],
|
|
167
|
+
["status", filters.status],
|
|
168
|
+
] as const;
|
|
169
|
+
for (const [key, value] of manifestFilters) if (value) query.set(key, value);
|
|
170
|
+
}
|
|
171
|
+
if (refresh) query.set("refresh", refresh);
|
|
172
|
+
return query;
|
|
173
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { OperationsProjection } from "@zaip-ai/dashboard-operations/contracts";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import type { CostMonitorProjection } from "../contracts.js";
|
|
4
|
+
import type {
|
|
5
|
+
loadCostMonitorDetail,
|
|
6
|
+
loadCostMonitorPeriod,
|
|
7
|
+
loadCostMonitorRunPage,
|
|
8
|
+
} from "./CostFilters.js";
|
|
9
|
+
import type { CostCurrency, CostLocale } from "./cost-monitor-copy.js";
|
|
10
|
+
import type { LoadCompactCostPage } from "./use-compact-cost-page.js";
|
|
11
|
+
import type { LoadCostGroupPage } from "./use-cost-group-page.js";
|
|
12
|
+
|
|
13
|
+
type LoadCostMonitorDetail = typeof loadCostMonitorDetail;
|
|
14
|
+
type LoadCostRunPage = typeof loadCostMonitorRunPage;
|
|
15
|
+
|
|
16
|
+
export interface CostMonitorPageProps {
|
|
17
|
+
capabilityNavigation?: ReactNode;
|
|
18
|
+
data: CostMonitorProjection;
|
|
19
|
+
dashboardTitle?: string;
|
|
20
|
+
embedded?: boolean;
|
|
21
|
+
globalFilters?: { query: string; datePreset: string; dateRange?: { start: string; end: string } };
|
|
22
|
+
lastUpdatedAt: string | null;
|
|
23
|
+
locale: CostLocale;
|
|
24
|
+
loading: boolean;
|
|
25
|
+
onLoadingChange?: (loading: boolean) => void;
|
|
26
|
+
onLocaleChange: (locale: CostLocale) => void;
|
|
27
|
+
onOpenTrace: (taskId: string) => void;
|
|
28
|
+
onActiveDataChange?: (data: CostMonitorProjection) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Retained for host compatibility. Cost views must use bounded summary or
|
|
31
|
+
* page routes; activating a tab never requests the historical detail blob.
|
|
32
|
+
*/
|
|
33
|
+
onDetailDataRequest?: () => void;
|
|
34
|
+
onRefresh: () => void;
|
|
35
|
+
loadDetail?: LoadCostMonitorDetail;
|
|
36
|
+
loadRunPage?: LoadCostRunPage;
|
|
37
|
+
loadReadModelPage?: LoadCompactCostPage;
|
|
38
|
+
loadGroupPage?: LoadCostGroupPage;
|
|
39
|
+
loadPeriod?: typeof loadCostMonitorPeriod;
|
|
40
|
+
operations?: Pick<
|
|
41
|
+
OperationsProjection,
|
|
42
|
+
"runs" | "specs" | "tasks" | "executions" | "evidences" | "validations" | "summary"
|
|
43
|
+
>;
|
|
44
|
+
repositoryName?: string;
|
|
45
|
+
currency?: CostCurrency;
|
|
46
|
+
onCurrencyChange?: (currency: CostCurrency) => void;
|
|
47
|
+
}
|
package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-page-selectors.ts
CHANGED
|
@@ -39,11 +39,5 @@ export function visibleExecutionRows<T extends { id: string }>(
|
|
|
39
39
|
|
|
40
40
|
/** Only filters represented by the partial Runs endpoint may use page-only data. */
|
|
41
41
|
export function isServerCostRunPagingEligible(filters: CostFilterState, globalQuery = ""): boolean {
|
|
42
|
-
return
|
|
43
|
-
(globalQuery === "" || filters.query === "") &&
|
|
44
|
-
filters.priority === "" &&
|
|
45
|
-
filters.risk === "" &&
|
|
46
|
-
filters.origin === "" &&
|
|
47
|
-
filters.workType === ""
|
|
48
|
-
);
|
|
42
|
+
return globalQuery === "" || filters.query === "";
|
|
49
43
|
}
|
|
@@ -4,12 +4,11 @@ export type CostPageDateRange = { from: string; to: string };
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Embedded pages use the host's all-time atomic snapshot until an explicit
|
|
7
|
-
* period
|
|
7
|
+
* period or date range narrows the population. Metadata never changes dates.
|
|
8
8
|
*/
|
|
9
9
|
export function resolveCostGroupPageRange({
|
|
10
10
|
embedded,
|
|
11
11
|
globalDateRange,
|
|
12
|
-
hasLocalCostFilters,
|
|
13
12
|
period,
|
|
14
13
|
runPageRange,
|
|
15
14
|
}: {
|
|
@@ -19,13 +18,8 @@ export function resolveCostGroupPageRange({
|
|
|
19
18
|
period: CostPeriod;
|
|
20
19
|
runPageRange: CostPageDateRange | undefined;
|
|
21
20
|
}): CostPageDateRange | undefined {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
globalDateRange === undefined &&
|
|
25
|
-
period === defaultCostPeriod &&
|
|
26
|
-
!hasLocalCostFilters
|
|
27
|
-
)
|
|
28
|
-
return undefined;
|
|
21
|
+
// The visible host period owns the range. Metadata filters never change it.
|
|
22
|
+
if (embedded && globalDateRange === undefined && period === defaultCostPeriod) return undefined;
|
|
29
23
|
return runPageRange;
|
|
30
24
|
}
|
|
31
25
|
|