@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
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { OperationsProjection } from "@zaip-ai/dashboard-operations/contracts";
|
|
2
|
+
import type { Dispatch, RefObject, SetStateAction } from "react";
|
|
3
|
+
import type {
|
|
4
|
+
BoardStageState,
|
|
5
|
+
OverviewClassificationPages,
|
|
6
|
+
OverviewStatusPages,
|
|
7
|
+
} from "./AppWorkBoard.js";
|
|
8
|
+
import type {
|
|
9
|
+
DashboardApiClient,
|
|
10
|
+
OperationsBoardPage,
|
|
11
|
+
OperationsPageFilters,
|
|
12
|
+
WorkBoardStage,
|
|
13
|
+
} from "./dashboard-api.js";
|
|
14
|
+
import type { OperationsPeriodState } from "./operations-period.js";
|
|
15
|
+
|
|
16
|
+
type StateSetter<T> = Dispatch<SetStateAction<T>>;
|
|
17
|
+
|
|
18
|
+
export interface AppWorkBoardOptions {
|
|
19
|
+
api: DashboardApiClient;
|
|
20
|
+
boardAbortControllersRef: RefObject<Map<WorkBoardStage, AbortController>>;
|
|
21
|
+
boardFilterKeyRef: RefObject<string>;
|
|
22
|
+
boardFiltersRef: RefObject<OperationsPageFilters>;
|
|
23
|
+
boardInFlightRef: RefObject<Set<WorkBoardStage>>;
|
|
24
|
+
boardInitialPageRef: RefObject<Set<WorkBoardStage>>;
|
|
25
|
+
boardLoadedRef: RefObject<Partial<Record<WorkBoardStage, number>>>;
|
|
26
|
+
boardRequestVersionRef: RefObject<number>;
|
|
27
|
+
dashboardView: "operations" | "cost-monitor" | "traceability" | null;
|
|
28
|
+
operations: OperationsProjection | null;
|
|
29
|
+
operationsPeriod: OperationsPeriodState;
|
|
30
|
+
operationsPeriodRef: RefObject<OperationsPeriodState>;
|
|
31
|
+
overviewStatusInFlightRef: RefObject<Set<string>>;
|
|
32
|
+
quickOverviewMetricsRef: RefObject<OperationsProjection["summary"]["overview_metrics"]>;
|
|
33
|
+
setBoardKindTotals: StateSetter<
|
|
34
|
+
Partial<Record<WorkBoardStage, OperationsBoardPage["totals_by_kind"]>>
|
|
35
|
+
>;
|
|
36
|
+
setBoardStates: StateSetter<Partial<Record<WorkBoardStage, BoardStageState>>>;
|
|
37
|
+
setBoardTotals: StateSetter<Partial<Record<WorkBoardStage, number>>>;
|
|
38
|
+
setOperations: StateSetter<OperationsProjection | null>;
|
|
39
|
+
setOverviewClassificationPages: StateSetter<OverviewClassificationPages>;
|
|
40
|
+
setOverviewStatusPages: StateSetter<OverviewStatusPages>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface DashboardRuntimeStatus {
|
|
2
|
+
workspace: string;
|
|
3
|
+
workspace_name: string;
|
|
4
|
+
workspaceKey: string;
|
|
5
|
+
status: "ok" | "degraded";
|
|
6
|
+
lifecycle_manifest_state: "initialized" | "missing" | "invalid";
|
|
7
|
+
active_capture_failure?: { code: string } | null;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export async function readDashboardRuntimeStatus(
|
|
11
|
+
signal: AbortSignal,
|
|
12
|
+
): Promise<DashboardRuntimeStatus> {
|
|
13
|
+
const response = await fetch("/api/v2/health", { cache: "no-store", signal });
|
|
14
|
+
const value = await response.json();
|
|
15
|
+
// A degraded response is useful diagnostic data, including HTTP 503.
|
|
16
|
+
if (
|
|
17
|
+
value?.kind !== "zaip-dashboard-sqlite-runtime" ||
|
|
18
|
+
typeof value.workspace !== "string" ||
|
|
19
|
+
typeof value.workspace_name !== "string" ||
|
|
20
|
+
!["initialized", "missing", "invalid"].includes(value.lifecycle_manifest_state)
|
|
21
|
+
) {
|
|
22
|
+
throw new Error("Identidade do Dashboard indisponível");
|
|
23
|
+
}
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
@@ -334,8 +334,8 @@ describe("atomic Cost snapshot loading", () => {
|
|
|
334
334
|
expect(boardHydration).toContain(
|
|
335
335
|
"await Promise.all(batch.map((stage) => loadMoreBoard(stage)))",
|
|
336
336
|
);
|
|
337
|
-
expect(boardHydration).toContain("window.requestIdleCallback(() => void hydrateBoard())");
|
|
338
337
|
expect(boardHydration).toContain("window.setTimeout(() => void hydrateBoard(), 0)");
|
|
338
|
+
expect(boardHydration).not.toContain("window.requestIdleCallback");
|
|
339
339
|
expect(boardHydration).toContain("!boardInitialPageRef.current.has(stage)");
|
|
340
340
|
expect(boardHydration).toContain("boardInitialPageRef.current.add(stage)");
|
|
341
341
|
expect(boardHydration).toContain("!boardInFlightRef.current.has(stage)");
|
|
@@ -134,6 +134,10 @@ export async function loadSqliteCostRunPage(api: DashboardApiClient, request: Co
|
|
|
134
134
|
...(filters?.agent ? { agent: filters.agent } : {}),
|
|
135
135
|
...(filters?.phase ? { phase: filters.phase } : {}),
|
|
136
136
|
...(filters?.status ? { status: filters.status } : {}),
|
|
137
|
+
...(filters?.priority ? { priority: filters.priority } : {}),
|
|
138
|
+
...(filters?.risk ? { risk: filters.risk } : {}),
|
|
139
|
+
...(filters?.origin ? { origin: filters.origin } : {}),
|
|
140
|
+
...(filters?.workType ? { workType: filters.workType } : {}),
|
|
137
141
|
},
|
|
138
142
|
signal,
|
|
139
143
|
);
|
|
@@ -360,7 +364,7 @@ export function useAppCostLoaders(api: DashboardApiClient) {
|
|
|
360
364
|
{
|
|
361
365
|
offset,
|
|
362
366
|
limit,
|
|
363
|
-
...(query
|
|
367
|
+
...(filters.query || query ? { query: filters.query || query } : {}),
|
|
364
368
|
...(filters.provider ? { provider: filters.provider } : {}),
|
|
365
369
|
...(filters.model ? { model: filters.model } : {}),
|
|
366
370
|
...(filters.agent ? { agent: filters.agent } : {}),
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
2
|
+
import type { OperationsProjection } from "@zaip-ai/dashboard-operations/contracts";
|
|
3
|
+
import type { DashboardApiClient, OperationsPageFilters, WorkBoardStage } from "./dashboard-api.js";
|
|
4
|
+
import type { OperationsPeriodState } from "./operations-period.js";
|
|
5
|
+
import { useAppWorkBoard } from "./use-app-work-board.js";
|
|
6
|
+
|
|
7
|
+
const effects = vi.hoisted(() => [] as Array<() => void | (() => void)>);
|
|
8
|
+
|
|
9
|
+
// Exercise the hook's actual request and reset logic while retaining direct
|
|
10
|
+
// control of the deferred effect callback that races with a filter reset.
|
|
11
|
+
vi.mock("react", async (importOriginal) => ({
|
|
12
|
+
...(await importOriginal<typeof import("react")>()),
|
|
13
|
+
useCallback: <T>(callback: T) => callback,
|
|
14
|
+
useEffect: (effect: () => void | (() => void)) => effects.push(effect),
|
|
15
|
+
}));
|
|
16
|
+
|
|
17
|
+
const filters: OperationsPageFilters = {
|
|
18
|
+
query: "",
|
|
19
|
+
status: "",
|
|
20
|
+
risk: "",
|
|
21
|
+
origin: "",
|
|
22
|
+
kind: "",
|
|
23
|
+
};
|
|
24
|
+
const operationsPeriod: OperationsPeriodState = {
|
|
25
|
+
preset: "all",
|
|
26
|
+
range: { start: "2026-08-01", end: "2026-08-31" },
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
function boardPage(stage: WorkBoardStage) {
|
|
30
|
+
return {
|
|
31
|
+
stage,
|
|
32
|
+
offset: 0,
|
|
33
|
+
total: 0,
|
|
34
|
+
totals_by_kind: { all: 0, task: 0, "standalone-task": 0, prd: 0, spec: 0 },
|
|
35
|
+
prds: [],
|
|
36
|
+
specs: [],
|
|
37
|
+
tasks: [],
|
|
38
|
+
changes: [],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function setup() {
|
|
43
|
+
const operationsBoard = vi.fn<DashboardApiClient["operationsBoard"]>(async (_period, stage) =>
|
|
44
|
+
boardPage(stage),
|
|
45
|
+
);
|
|
46
|
+
const api = { operationsBoard } as unknown as DashboardApiClient;
|
|
47
|
+
let operations = {
|
|
48
|
+
prds: [],
|
|
49
|
+
specs: [],
|
|
50
|
+
tasks: [],
|
|
51
|
+
changes: [],
|
|
52
|
+
summary: {},
|
|
53
|
+
} as unknown as OperationsProjection;
|
|
54
|
+
const boardInitialPageRef = { current: new Set<WorkBoardStage>() };
|
|
55
|
+
const boardRequestVersionRef = { current: 0 };
|
|
56
|
+
const setOperations = (
|
|
57
|
+
update:
|
|
58
|
+
| OperationsProjection
|
|
59
|
+
| null
|
|
60
|
+
| ((current: OperationsProjection | null) => OperationsProjection | null),
|
|
61
|
+
) => {
|
|
62
|
+
operations = (
|
|
63
|
+
typeof update === "function" ? update(operations) : update
|
|
64
|
+
) as OperationsProjection;
|
|
65
|
+
};
|
|
66
|
+
const render = () =>
|
|
67
|
+
useAppWorkBoard({
|
|
68
|
+
api,
|
|
69
|
+
boardAbortControllersRef: { current: new Map() },
|
|
70
|
+
boardFilterKeyRef: { current: "||||" },
|
|
71
|
+
boardFiltersRef: { current: filters },
|
|
72
|
+
boardInFlightRef: { current: new Set() },
|
|
73
|
+
boardInitialPageRef,
|
|
74
|
+
boardLoadedRef: { current: {} },
|
|
75
|
+
boardRequestVersionRef,
|
|
76
|
+
dashboardView: "operations",
|
|
77
|
+
operations,
|
|
78
|
+
operationsPeriod,
|
|
79
|
+
operationsPeriodRef: { current: operationsPeriod },
|
|
80
|
+
overviewStatusInFlightRef: { current: new Set() },
|
|
81
|
+
quickOverviewMetricsRef: { current: undefined },
|
|
82
|
+
setBoardKindTotals: vi.fn() as never,
|
|
83
|
+
setBoardStates: vi.fn() as never,
|
|
84
|
+
setBoardTotals: vi.fn() as never,
|
|
85
|
+
setOperations,
|
|
86
|
+
setOverviewClassificationPages: vi.fn() as never,
|
|
87
|
+
setOverviewStatusPages: vi.fn() as never,
|
|
88
|
+
});
|
|
89
|
+
return { boardInitialPageRef, operationsBoard, render };
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
beforeEach(() => {
|
|
93
|
+
effects.length = 0;
|
|
94
|
+
vi.useFakeTimers();
|
|
95
|
+
vi.stubGlobal("window", { setTimeout, clearTimeout, requestIdleCallback: undefined });
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
afterEach(() => {
|
|
99
|
+
vi.unstubAllGlobals();
|
|
100
|
+
vi.useRealTimers();
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
describe("work board hydration generation", () => {
|
|
104
|
+
it("hydrates the visible board when requestIdleCallback never runs", async () => {
|
|
105
|
+
const requestIdleCallback = vi.fn(() => 1);
|
|
106
|
+
vi.stubGlobal("window", {
|
|
107
|
+
setTimeout,
|
|
108
|
+
clearTimeout,
|
|
109
|
+
requestIdleCallback,
|
|
110
|
+
cancelIdleCallback: vi.fn(),
|
|
111
|
+
});
|
|
112
|
+
const { boardInitialPageRef, operationsBoard, render } = setup();
|
|
113
|
+
render();
|
|
114
|
+
const effect = effects[0];
|
|
115
|
+
if (effect === undefined) throw new Error("expected visible board hydration effect");
|
|
116
|
+
const cleanup = effect();
|
|
117
|
+
|
|
118
|
+
await vi.runAllTimersAsync();
|
|
119
|
+
|
|
120
|
+
expect(requestIdleCallback).not.toHaveBeenCalled();
|
|
121
|
+
expect(operationsBoard).toHaveBeenCalledTimes(9);
|
|
122
|
+
expect(boardInitialPageRef.current.size).toBe(9);
|
|
123
|
+
cleanup?.();
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it("does not let an older scheduled callback consume the reset board generation", async () => {
|
|
127
|
+
const { boardInitialPageRef, operationsBoard, render } = setup();
|
|
128
|
+
const board = render();
|
|
129
|
+
const staleEffect = effects[0];
|
|
130
|
+
if (staleEffect === undefined) throw new Error("expected initial board hydration effect");
|
|
131
|
+
const cleanup = staleEffect();
|
|
132
|
+
|
|
133
|
+
board.loadFilteredBoard({ ...filters, kind: "task" });
|
|
134
|
+
await vi.advanceTimersByTimeAsync(0);
|
|
135
|
+
|
|
136
|
+
expect(operationsBoard).not.toHaveBeenCalled();
|
|
137
|
+
expect(boardInitialPageRef.current).toEqual(new Set());
|
|
138
|
+
cleanup?.();
|
|
139
|
+
});
|
|
140
|
+
});
|
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { type Dispatch, type RefObject, type SetStateAction, useCallback, useEffect } from "react";
|
|
1
|
+
import { useCallback, useEffect } from "react";
|
|
3
2
|
import { isAbortError, mergeBoardPages } from "./AppRequestGuards.js";
|
|
4
3
|
import {
|
|
5
|
-
type BoardStageState,
|
|
6
4
|
initialWorkBoardStages,
|
|
7
5
|
type OverviewClassification,
|
|
8
|
-
type OverviewClassificationPages,
|
|
9
6
|
type OverviewStatusKind,
|
|
10
|
-
type OverviewStatusPages,
|
|
11
7
|
overviewClassificationPageKey,
|
|
12
8
|
overviewStatusPageKey,
|
|
13
9
|
} from "./AppWorkBoard.js";
|
|
10
|
+
import type { AppWorkBoardOptions } from "./app-work-board-options.js";
|
|
14
11
|
import type {
|
|
15
|
-
DashboardApiClient,
|
|
16
12
|
OperationsBoardPage,
|
|
17
13
|
OperationsPageFilters,
|
|
18
14
|
WorkBoardStage,
|
|
19
15
|
} from "./dashboard-api.js";
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
type StateSetter<T> = Dispatch<SetStateAction<T>>;
|
|
16
|
+
import { requestPeriodForOperations } from "./operations-period.js";
|
|
23
17
|
|
|
24
18
|
export function useAppWorkBoard({
|
|
25
19
|
api,
|
|
@@ -42,30 +36,7 @@ export function useAppWorkBoard({
|
|
|
42
36
|
setOperations,
|
|
43
37
|
setOverviewClassificationPages,
|
|
44
38
|
setOverviewStatusPages,
|
|
45
|
-
}: {
|
|
46
|
-
api: DashboardApiClient;
|
|
47
|
-
boardAbortControllersRef: RefObject<Map<WorkBoardStage, AbortController>>;
|
|
48
|
-
boardFilterKeyRef: RefObject<string>;
|
|
49
|
-
boardFiltersRef: RefObject<OperationsPageFilters>;
|
|
50
|
-
boardInFlightRef: RefObject<Set<WorkBoardStage>>;
|
|
51
|
-
boardInitialPageRef: RefObject<Set<WorkBoardStage>>;
|
|
52
|
-
boardLoadedRef: RefObject<Partial<Record<WorkBoardStage, number>>>;
|
|
53
|
-
boardRequestVersionRef: RefObject<number>;
|
|
54
|
-
dashboardView: "operations" | "cost-monitor" | "traceability" | null;
|
|
55
|
-
operations: OperationsProjection | null;
|
|
56
|
-
operationsPeriod: OperationsPeriodState;
|
|
57
|
-
operationsPeriodRef: RefObject<OperationsPeriodState>;
|
|
58
|
-
overviewStatusInFlightRef: RefObject<Set<string>>;
|
|
59
|
-
quickOverviewMetricsRef: RefObject<OperationsProjection["summary"]["overview_metrics"]>;
|
|
60
|
-
setBoardKindTotals: StateSetter<
|
|
61
|
-
Partial<Record<WorkBoardStage, OperationsBoardPage["totals_by_kind"]>>
|
|
62
|
-
>;
|
|
63
|
-
setBoardStates: StateSetter<Partial<Record<WorkBoardStage, BoardStageState>>>;
|
|
64
|
-
setBoardTotals: StateSetter<Partial<Record<WorkBoardStage, number>>>;
|
|
65
|
-
setOperations: StateSetter<OperationsProjection | null>;
|
|
66
|
-
setOverviewClassificationPages: StateSetter<OverviewClassificationPages>;
|
|
67
|
-
setOverviewStatusPages: StateSetter<OverviewStatusPages>;
|
|
68
|
-
}) {
|
|
39
|
+
}: AppWorkBoardOptions) {
|
|
69
40
|
const resetBoard = useCallback(() => {
|
|
70
41
|
boardRequestVersionRef.current += 1;
|
|
71
42
|
for (const controller of boardAbortControllersRef.current.values()) controller.abort();
|
|
@@ -365,26 +336,42 @@ export function useAppWorkBoard({
|
|
|
365
336
|
useEffect(() => {
|
|
366
337
|
if (dashboardView !== "operations" || operations === null) return;
|
|
367
338
|
let cancelled = false;
|
|
339
|
+
// resetBoard invalidates an older filter generation before React has had
|
|
340
|
+
// a chance to run this effect's cleanup. Do not let that older idle
|
|
341
|
+
// callback mark stages as initialized: its responses are rejected by
|
|
342
|
+
// loadMoreBoard, and the new generation would otherwise never hydrate.
|
|
343
|
+
const hydrationRequestVersion = boardRequestVersionRef.current;
|
|
344
|
+
const isCurrentHydration = () =>
|
|
345
|
+
!cancelled && hydrationRequestVersion === boardRequestVersionRef.current;
|
|
368
346
|
const hydrateBoard = async () => {
|
|
347
|
+
if (!isCurrentHydration()) return;
|
|
369
348
|
const pending = initialWorkBoardStages.filter(
|
|
370
349
|
(stage) => !boardInitialPageRef.current.has(stage) && !boardInFlightRef.current.has(stage),
|
|
371
350
|
);
|
|
372
|
-
for (let offset = 0; offset < pending.length &&
|
|
351
|
+
for (let offset = 0; offset < pending.length && isCurrentHydration(); offset += 3) {
|
|
373
352
|
const batch = pending.slice(offset, offset + 3);
|
|
353
|
+
if (!isCurrentHydration()) return;
|
|
374
354
|
for (const stage of batch) boardInitialPageRef.current.add(stage);
|
|
375
355
|
await Promise.all(batch.map((stage) => loadMoreBoard(stage)));
|
|
376
356
|
}
|
|
377
357
|
};
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
358
|
+
// This board is the visible Operations surface. requestIdleCallback has
|
|
359
|
+
// no delivery deadline and can remain deferred during rapid interaction,
|
|
360
|
+
// leaving every cleared column empty despite a current API population.
|
|
361
|
+
// Schedule it after the current paint instead, with a cancellable timer.
|
|
362
|
+
const timer = window.setTimeout(() => void hydrateBoard(), 0);
|
|
382
363
|
return () => {
|
|
383
364
|
cancelled = true;
|
|
384
|
-
|
|
385
|
-
else window.clearTimeout(idle.id);
|
|
365
|
+
window.clearTimeout(timer);
|
|
386
366
|
};
|
|
387
|
-
}, [
|
|
367
|
+
}, [
|
|
368
|
+
boardInFlightRef,
|
|
369
|
+
boardInitialPageRef,
|
|
370
|
+
boardRequestVersionRef,
|
|
371
|
+
dashboardView,
|
|
372
|
+
loadMoreBoard,
|
|
373
|
+
operations,
|
|
374
|
+
]);
|
|
388
375
|
|
|
389
376
|
return {
|
|
390
377
|
boardExportSource,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import {
|
|
3
|
+
type DashboardRuntimeStatus,
|
|
4
|
+
readDashboardRuntimeStatus,
|
|
5
|
+
} from "./dashboard-runtime-status.js";
|
|
6
|
+
|
|
7
|
+
export function useRuntimeStatus() {
|
|
8
|
+
const [status, setStatus] = useState<DashboardRuntimeStatus | null>(null);
|
|
9
|
+
const [unavailable, setUnavailable] = useState(false);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
let disposed = false;
|
|
12
|
+
let timer: ReturnType<typeof setTimeout>;
|
|
13
|
+
let controller: AbortController;
|
|
14
|
+
async function poll() {
|
|
15
|
+
controller = new AbortController();
|
|
16
|
+
const timeout = setTimeout(() => controller.abort(), 4000);
|
|
17
|
+
try {
|
|
18
|
+
const next = await readDashboardRuntimeStatus(controller.signal);
|
|
19
|
+
if (!disposed) {
|
|
20
|
+
setStatus(next);
|
|
21
|
+
setUnavailable(false);
|
|
22
|
+
}
|
|
23
|
+
} catch {
|
|
24
|
+
if (!disposed) setUnavailable(true);
|
|
25
|
+
} finally {
|
|
26
|
+
clearTimeout(timeout);
|
|
27
|
+
if (!disposed) timer = setTimeout(poll, 5000);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
void poll();
|
|
31
|
+
return () => {
|
|
32
|
+
disposed = true;
|
|
33
|
+
clearTimeout(timer);
|
|
34
|
+
controller?.abort();
|
|
35
|
+
};
|
|
36
|
+
}, []);
|
|
37
|
+
return { status, unavailable };
|
|
38
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.workspace-status {
|
|
2
|
+
position: sticky;
|
|
3
|
+
top: 0;
|
|
4
|
+
z-index: 61;
|
|
5
|
+
padding: 8px 24px;
|
|
6
|
+
background: var(--surface-muted, #111827);
|
|
7
|
+
color: var(--text, #f1f5f9);
|
|
8
|
+
border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.12));
|
|
9
|
+
font-size: 12px;
|
|
10
|
+
}
|
|
11
|
+
.dashboard-header {
|
|
12
|
+
top: var(--dashboard-workspace-height, 0px);
|
|
13
|
+
}
|
|
14
|
+
.workspace-status__identity {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-wrap: wrap;
|
|
17
|
+
gap: 4px 16px;
|
|
18
|
+
align-items: baseline;
|
|
19
|
+
}
|
|
20
|
+
.workspace-status__identity span {
|
|
21
|
+
overflow-wrap: anywhere;
|
|
22
|
+
min-width: 0;
|
|
23
|
+
}
|
|
24
|
+
.workspace-status__warning {
|
|
25
|
+
margin: 8px 0;
|
|
26
|
+
color: var(--error-text, #fecaca);
|
|
27
|
+
}
|
|
28
|
+
.workspace-status__warning p {
|
|
29
|
+
margin: 4px 0;
|
|
30
|
+
}
|
|
31
|
+
.workspace-status code {
|
|
32
|
+
overflow-wrap: anywhere;
|
|
33
|
+
}
|
package/templates/.agents/dashboard/modules/cost-monitor/src/react/CompactLifecycleCostTable.test.ts
CHANGED
|
@@ -44,7 +44,9 @@ describe("CompactLifecycleCostTable filtered subtotal", () => {
|
|
|
44
44
|
},
|
|
45
45
|
});
|
|
46
46
|
const [table] = view.props.children as readonly {
|
|
47
|
-
props: {
|
|
47
|
+
props: {
|
|
48
|
+
columns: Array<{ key: string; footer?: unknown; render?: (row: unknown) => unknown }>;
|
|
49
|
+
};
|
|
48
50
|
}[];
|
|
49
51
|
expect(table).toBeDefined();
|
|
50
52
|
const footer = (key: string) =>
|
|
@@ -56,9 +58,29 @@ describe("CompactLifecycleCostTable filtered subtotal", () => {
|
|
|
56
58
|
expect(footer("tokens")).toBe("540");
|
|
57
59
|
expect(footer("cost")).toContain("R$");
|
|
58
60
|
expect(footer("cost")).not.toContain("US$");
|
|
61
|
+
const unknownRow = {
|
|
62
|
+
metrics: { duration: unavailable, total_tokens: known(15), cost: unavailable },
|
|
63
|
+
};
|
|
64
|
+
const render = (key: string) =>
|
|
65
|
+
table!.props.columns.find((column) => column.key === key)?.render?.(unknownRow);
|
|
66
|
+
expect(render("duration")).toBe("Indisponível");
|
|
67
|
+
expect(render("cost")).toBe("Indisponível");
|
|
68
|
+
expect(render("tokens")).toBe("15");
|
|
69
|
+
const partialRow = {
|
|
70
|
+
metrics: {
|
|
71
|
+
duration: { ...unavailable, known_sum: 1000, coverage_ratio: 0.5 },
|
|
72
|
+
cost: { ...unavailable, coverage_ratio: 0.5 },
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
expect(
|
|
76
|
+
table!.props.columns.find((column) => column.key === "duration")?.render?.(partialRow),
|
|
77
|
+
).toBe("1 seg (parcial)");
|
|
78
|
+
expect(table!.props.columns.find((column) => column.key === "cost")?.render?.(partialRow)).toBe(
|
|
79
|
+
"0 (parcial)",
|
|
80
|
+
);
|
|
59
81
|
});
|
|
60
82
|
|
|
61
|
-
it("
|
|
83
|
+
it("distinguishes unavailable duration from observed zero subtotals", () => {
|
|
62
84
|
const view = CompactLifecycleCostTable({
|
|
63
85
|
locale: "pt-BR",
|
|
64
86
|
rows: [],
|
|
@@ -91,7 +113,7 @@ describe("CompactLifecycleCostTable filtered subtotal", () => {
|
|
|
91
113
|
table!.props.columns.find((column) => column.key === key)?.footer;
|
|
92
114
|
expect(footer("runs")).toBe("0");
|
|
93
115
|
expect(footer("tokens")).toBe("0");
|
|
94
|
-
expect(footer("duration")).toBe("
|
|
116
|
+
expect(footer("duration")).toBe("Indisponível");
|
|
95
117
|
});
|
|
96
118
|
|
|
97
119
|
it("does not render a subtotal row when all lifecycle metrics are unavailable", () => {
|
package/templates/.agents/dashboard/modules/cost-monitor/src/react/CompactLifecycleCostTable.tsx
CHANGED
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
formatCurrency,
|
|
5
5
|
formatDurationMs,
|
|
6
6
|
} from "@zaip-ai/dashboard-ui";
|
|
7
|
-
import { estimatedDurationMs } from "../duration-estimate.js";
|
|
8
7
|
import type { CostLocale } from "./cost-monitor-copy.js";
|
|
9
8
|
import { formatDateTime } from "./cost-table-presentation.js";
|
|
10
9
|
|
|
@@ -83,17 +82,23 @@ export function CompactLifecycleCostTable({
|
|
|
83
82
|
onOpenTrace?: (id: string) => void;
|
|
84
83
|
}) {
|
|
85
84
|
const metric = (value: KnownMetric, format: (known: number) => string) => {
|
|
86
|
-
|
|
85
|
+
if (value.known_sum === 0 && !value.complete && value.coverage_ratio === 0)
|
|
86
|
+
return locale === "pt-BR" ? "Indisponível" : "Unavailable";
|
|
87
|
+
const formatted = format(value.known_sum ?? 0);
|
|
88
|
+
return value.complete
|
|
89
|
+
? formatted
|
|
90
|
+
: `${formatted} (${locale === "pt-BR" ? "parcial" : "partial"})`;
|
|
87
91
|
};
|
|
88
92
|
const durationMetric = (row: CompactLifecycleCostRow) => {
|
|
89
|
-
const value = row.metrics.duration;
|
|
90
93
|
const effective = compactLifecycleDurationMs(row);
|
|
91
|
-
if (effective === null
|
|
92
|
-
return
|
|
94
|
+
if (effective === null) return locale === "pt-BR" ? "Indisponível" : "Unavailable";
|
|
95
|
+
return metric(row.metrics.duration, (value) =>
|
|
96
|
+
value === 0 ? "0" : formatDurationMs(value, locale),
|
|
97
|
+
);
|
|
93
98
|
};
|
|
94
99
|
const subtotalMetric = (value: KnownMetric, format: (known: number) => string) => {
|
|
95
100
|
if (subtotal === null) return undefined;
|
|
96
|
-
return
|
|
101
|
+
return metric(value, format);
|
|
97
102
|
};
|
|
98
103
|
const subtotalMetricUnavailable = (value: KnownMetric) =>
|
|
99
104
|
value.unknown > 0 && value.known_sum === 0;
|
|
@@ -210,24 +215,17 @@ export function CompactLifecycleCostTable({
|
|
|
210
215
|
}
|
|
211
216
|
|
|
212
217
|
export function compactLifecycleDurationMs(row: CompactLifecycleCostRow): number | null {
|
|
213
|
-
|
|
218
|
+
const duration = row.metrics.duration;
|
|
219
|
+
return duration.known_sum === 0 && !duration.complete && duration.coverage_ratio === 0
|
|
220
|
+
? null
|
|
221
|
+
: duration.known_sum;
|
|
214
222
|
}
|
|
215
223
|
|
|
216
224
|
export function withTokenBackedCompactDuration(
|
|
217
225
|
row: CompactLifecycleCostRow,
|
|
218
226
|
): CompactLifecycleCostRow {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
if (tokenTotal <= 0 || duration.known_sum > 0) return row;
|
|
222
|
-
const durationMs = estimatedDurationMs(tokenTotal);
|
|
223
|
-
if (durationMs === null || durationMs <= 0) return row;
|
|
224
|
-
return {
|
|
225
|
-
...row,
|
|
226
|
-
metrics: {
|
|
227
|
-
...row.metrics,
|
|
228
|
-
duration: { known_sum: durationMs, unknown: 0, complete: true, coverage_ratio: 1 },
|
|
229
|
-
},
|
|
230
|
-
};
|
|
227
|
+
// Compatibility export: token volume does not establish observed elapsed time.
|
|
228
|
+
return row;
|
|
231
229
|
}
|
|
232
230
|
|
|
233
231
|
function CompactLifecyclePagination({
|