@zaip-ai/cli 2.2.0 → 2.6.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 +23 -9
- package/dist/services/adapters.js.map +1 -1
- package/dist/services/agent-adapters.js +25 -9
- package/dist/services/agent-adapters.js.map +1 -1
- package/dist/services/agent-discovery.d.ts +27 -0
- package/dist/services/agent-discovery.d.ts.map +1 -0
- package/dist/services/agent-discovery.js +73 -0
- package/dist/services/agent-discovery.js.map +1 -0
- package/dist/services/codex-conversation-lifecycle-hook.d.ts.map +1 -1
- package/dist/services/codex-conversation-lifecycle-hook.js +153 -24
- package/dist/services/codex-conversation-lifecycle-hook.js.map +1 -1
- package/dist/services/codex-pre-tool-hook-template.d.ts.map +1 -1
- package/dist/services/codex-pre-tool-hook-template.js +146 -72
- package/dist/services/codex-pre-tool-hook-template.js.map +1 -1
- package/dist/services/codex-rules.d.ts +1 -1
- package/dist/services/codex-rules.d.ts.map +1 -1
- package/dist/services/codex-rules.js +3 -3
- package/dist/services/codex-subagent-hook-template.d.ts +1 -1
- package/dist/services/codex-subagent-hook-template.d.ts.map +1 -1
- package/dist/services/codex-subagent-hook-template.js +117 -66
- package/dist/services/codex-subagent-hook-template.js.map +1 -1
- package/dist/services/install-agents-template.d.ts.map +1 -1
- package/dist/services/install-agents-template.js +56 -6
- package/dist/services/install-agents-template.js.map +1 -1
- package/dist/services/logger.js +1 -1
- package/dist/services/logger.js.map +1 -1
- package/dist/services/logger.test.js +22 -1
- package/dist/services/logger.test.js.map +1 -1
- package/dist/services/runtime-template.test.js +129 -0
- package/dist/services/runtime-template.test.js.map +1 -1
- package/package.json +1 -1
- package/templates/.agents/.env.example +9 -3
- package/templates/.agents/README-ENG.md +30 -5
- package/templates/.agents/README.md +30 -7
- package/templates/.agents/architecture/software-architecture.md +1 -59
- package/templates/.agents/branding/brandbook.md +3 -0
- package/templates/.agents/config/agents/catalog.yaml +22 -10
- package/templates/.agents/config/agents/discovery.json +319 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-backend.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-builder.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-cloud-engineer.toml +11 -8
- package/templates/.agents/config/clients/codex/agents/zaip-agent-designer.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-frontend.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-task-executor.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-website-developer.toml +2 -2
- package/templates/.agents/config/pricing/models.json +9 -5
- package/templates/.agents/config/project.yaml +12 -1
- package/templates/.agents/dashboard/.zaip-managed.json +375 -95
- package/templates/.agents/dashboard/apps/frontend/dist/assets/CostCalculationGuidePage-CGxeQak4.js +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-DaSllaJp.js → DashboardHelpDialog-tzS7YxYB.js} +57 -33
- package/templates/.agents/dashboard/apps/frontend/dist/assets/PricingSettingsDialog-DEbCi1gP.js +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-1L7Qw-Gq.js +3 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-EInWr641.css +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/TraceabilityWorkspace-t1Om0Abw.js +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-B6aZfo5f.js +68 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-TPUT2IUt.js → icons-vendor-DiGC-dsJ.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-DgTmNHN5.js +2 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-Ct48XHGL.js → react-vendor-kPO6yNed.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/rolldown-runtime-Bh1tDfsg.js +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/traceability-DQpKX9c1.js +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/index.html +6 -6
- package/templates/.agents/dashboard/apps/frontend/package.json +1 -1
- package/templates/.agents/dashboard/apps/frontend/src/App.tsx +3 -1264
- package/templates/.agents/dashboard/apps/frontend/src/AppDashboardContent.tsx +363 -0
- package/templates/.agents/dashboard/apps/frontend/src/ProjectSettingsPage.dom.test.ts +99 -0
- package/templates/.agents/dashboard/apps/frontend/src/ProjectSettingsPage.tsx +62 -6
- package/templates/.agents/dashboard/apps/frontend/src/ProjectStackEditor.tsx +3 -1
- package/templates/.agents/dashboard/apps/frontend/src/__tests__/app-composition-support.ts +7 -0
- package/templates/.agents/dashboard/apps/frontend/src/cost-period-refresh.test.ts +9 -7
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-api-settings.ts +151 -0
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-api.ts +28 -153
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-app-shell.tsx +33 -0
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-cost-facts.ts +30 -0
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-project-overview.ts +7 -1
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-retry.ts +17 -0
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-setup-route.ts +29 -0
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-view-actions.ts +66 -0
- package/templates/.agents/dashboard/apps/frontend/src/operations-period-render.test.ts +3 -2
- package/templates/.agents/dashboard/apps/frontend/src/overview-status-page.test.ts +2 -2
- package/templates/.agents/dashboard/apps/frontend/src/project-installation-status.test.ts +48 -0
- package/templates/.agents/dashboard/apps/frontend/src/project-installation-status.ts +29 -0
- package/templates/.agents/dashboard/apps/frontend/src/project-settings-page.css +68 -0
- package/templates/.agents/dashboard/apps/frontend/src/project-settings.test.ts +2 -2
- package/templates/.agents/dashboard/apps/frontend/src/sao-paulo-day-rollover.test.ts +36 -0
- package/templates/.agents/dashboard/apps/frontend/src/sao-paulo-day-rollover.ts +30 -0
- package/templates/.agents/dashboard/apps/frontend/src/snapshot-banner-semantics.test.ts +2 -5
- package/templates/.agents/dashboard/apps/frontend/src/snapshot-coherence.test.ts +30 -19
- package/templates/.agents/dashboard/apps/frontend/src/use-app-effects.ts +9 -1
- package/templates/.agents/dashboard/apps/frontend/src/use-app-trace-task-pagination.ts +77 -0
- package/templates/.agents/dashboard/apps/frontend/src/use-app-work-board.ts +397 -0
- package/templates/.agents/dashboard/apps/frontend/src/use-dashboard-app-model.tsx +782 -0
- package/templates/.agents/dashboard/apps/frontend/src/use-snapshot-notice.tsx +49 -0
- package/templates/.agents/dashboard/modules/cost-monitor/package.json +1 -1
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostDeveloperPanelSlot.tsx +16 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostGroupsTable.tsx +459 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.test.ts +27 -17
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.tsx +62 -186
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorRunDialog.tsx +20 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables-hides-calls-that-have-no-collected.test.ts +80 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables-keeps-legacy-codex-identity-fields-blank.test.ts +455 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.test.ts +18 -525
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.tsx +32 -508
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-export-sources.ts +74 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-page-actions.ts +19 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-page-selectors.ts +49 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-table-formatters.ts +115 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-projection.test-fixtures.ts +2 -0
- package/templates/.agents/dashboard/modules/operations/package.json +1 -1
- package/templates/.agents/dashboard/modules/operations/src/contracts.ts +4 -0
- package/templates/.agents/dashboard/modules/operations/src/react/EntityTableBadges.tsx +34 -0
- package/templates/.agents/dashboard/modules/operations/src/react/EntityTables.tsx +8 -38
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview-keeps-structure-classes-mutually-exclusive.test.ts +243 -0
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.test.ts +27 -275
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.tsx +70 -247
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverviewCharts.tsx +171 -0
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverviewPanels.tsx +64 -0
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsPage.tsx +4 -3
- package/templates/.agents/dashboard/modules/operations/src/react/PrdDocumentDialog.test.tsx +2 -1
- package/templates/.agents/dashboard/modules/operations/src/react/manual-work-priority.test.ts +2 -1
- package/templates/.agents/dashboard/modules/operations/src/react/operations-coverage-toast.test.ts +6 -2
- package/templates/.agents/dashboard/modules/operations/src/react/operations-overview-period-filter.test.ts +6 -14
- package/templates/.agents/dashboard/modules/operations/src/react/operations-overview.status-cards.test.ts +3 -1
- package/templates/.agents/dashboard/modules/operations/src/react/operations-page-contract.ts +2 -0
- package/templates/.agents/dashboard/modules/operations/src/react/overview-metric-format.ts +32 -0
- package/templates/.agents/dashboard/modules/traceability/package.json +1 -1
- package/templates/.agents/dashboard/packages/branding/package.json +1 -1
- package/templates/.agents/dashboard/packages/branding/src/index.ts +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 +1458 -1458
- package/templates/.agents/dashboard/packages/local-runtime/dist/sqlite-read-model.cjs +1425 -1425
- package/templates/.agents/dashboard/packages/local-runtime/package.json +2 -1
- package/templates/.agents/dashboard/packages/local-runtime/scripts/build-sqlite-runtime.mjs +7 -3
- package/templates/.agents/dashboard/packages/local-runtime/server.mjs +1458 -1459
- package/templates/.agents/dashboard/packages/local-runtime/src/active-codex-telemetry.ts +25 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/agent-catalog-settings.test.ts +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/project-settings.test.ts +53 -8
- package/templates/.agents/dashboard/packages/local-runtime/src/project-settings.ts +79 -24
- package/templates/.agents/dashboard/packages/local-runtime/src/projection-refresh-diagnostics.ts +35 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-costs-routes.ts +168 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-dual-reads-manifest-summaries-without-losing.test.ts +344 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-http-contracts.ts +31 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-operations-routes.ts +345 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-read-projections.ts +461 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-reconciliation-refresh.test.ts +78 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-route-context.ts +13 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot-synchronization.test.ts +18 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot-synchronization.ts +19 -3
- package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot.test.ts +22 -21
- package/templates/.agents/dashboard/packages/local-runtime/src/server-sqlite-view-allowlist.test.ts +25 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-trace-routes.ts +64 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-work-reconciliation.test.ts +2 -30
- package/templates/.agents/dashboard/packages/local-runtime/src/server-work-reconciliation.ts +6 -23
- package/templates/.agents/dashboard/packages/local-runtime/src/server.test-fixtures.ts +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/server.test.ts +2 -330
- package/templates/.agents/dashboard/packages/local-runtime/src/server.ts +73 -1060
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-materialize-first-fold.ts +78 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-materialize-projections.ts +561 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-materialize-runs.ts +600 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-metric-contract.test.ts +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-agent-dimension.ts +269 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-context.ts +32 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-entity-group.ts +244 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-filtered-dimension.ts +292 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-financial.ts +547 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-model-dimension.ts +360 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-provider-dimension.ts +169 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-summary.ts +475 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-temporal-dimension.ts +132 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-timing.ts +299 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-view-page.ts +692 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-counts-every-root-execution-day-returns.test.ts +739 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-does-not-convert-delayed-historical-finalizer.test.ts +706 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-filesystem.ts +748 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-first-fold-types.ts +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-keeps-orphan-telemetry-out-kanban-without.test.ts +710 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-marks-token-cost-telemetry-unavailable-when.test.ts +618 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-rebuild.ts +755 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-rebuilds-disposable-snapshot-serves-zaip-records.test.ts +276 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-schema.ts +193 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-types.ts +123 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model.test.ts +1 -2805
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model.ts +17 -6930
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-schema-base-views.ts +385 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-schema-dashboard-views.ts +412 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/work-priority-contract.test.ts +4 -3
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-build.mjs +195 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-lifecycle.test.mjs +2 -7
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-logging.mjs +35 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-navigation.mjs +114 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-paths.mjs +90 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.mjs +89 -418
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.test.mjs +22 -12
- 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/playwright.config.ts +4 -1
- package/templates/.agents/design/.zaip-managed.json +5 -5
- package/templates/.agents/design/DESIGN.md +2 -186
- package/templates/.agents/design/README.md +12 -2
- package/templates/.agents/design/apps/catalog/package.json +1 -1
- package/templates/.agents/design/packages/local-runtime/package.json +1 -1
- package/templates/.agents/growth/strategy.md +3 -0
- package/templates/.agents/marketing/strategy.md +3 -0
- package/templates/.agents/requirements/autonomous-assurance.md +2 -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 +13 -4
- 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 +4 -2
- 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 +3 -3
- package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
- package/templates/.agents/rules/architecture.md +2 -0
- package/templates/.agents/rules/astra-diagnostic.md +1 -1
- package/templates/.agents/rules/autonomy-decision.md +3 -1
- package/templates/.agents/rules/cloud-hostinger-autonomy.md +2 -0
- package/templates/.agents/rules/context.md +2 -1
- package/templates/.agents/rules/core.md +3 -3
- package/templates/.agents/rules/design-system-central-contract.md +17 -0
- package/templates/.agents/rules/evolution.md +3 -1
- package/templates/.agents/rules/frontend-lite.md +3 -1
- package/templates/.agents/rules/local-sqlite-storage.md +2 -2
- package/templates/.agents/rules/meta-mcp.md +3 -1
- package/templates/.agents/rules/model-orchestration.md +1 -1
- package/templates/.agents/rules/run-lifecycle-closure.md +6 -4
- package/templates/.agents/rules/security.md +3 -1
- package/templates/.agents/rules/specialist-routing.md +3 -1
- package/templates/.agents/rules/text-writing-utf8.md +1 -1
- package/templates/.agents/rules/workflow.md +7 -5
- package/templates/.agents/runtime/VERSION +1 -1
- package/templates/.agents/runtime/bin/zaip.mjs +519 -247
- package/templates/.agents/runtime/checksums.sha256 +6 -6
- package/templates/.agents/runtime/manifest.json +1 -1
- package/templates/.agents/runtime/pnpm-lock.sha256 +1 -1
- package/templates/.agents/runtime/provenance.json +5 -5
- package/templates/.agents/runtime/sbom.cdx.json +1 -1
- package/templates/.agents/sales/playbook.md +3 -0
- package/templates/.agents/skills/zaip-aios/SKILL.md +5 -3
- package/templates/.agents/skills/zaip-skill-adapt-stack/SKILL.md +1 -0
- package/templates/.agents/skills/zaip-skill-api-contracts/SKILL.md +14 -0
- package/templates/.agents/skills/zaip-skill-api-contracts/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-application-observability/SKILL.md +15 -0
- package/templates/.agents/skills/zaip-skill-application-observability/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-application-observability/references/signal-design.md +3 -0
- package/templates/.agents/skills/zaip-skill-application-readiness/SKILL.md +15 -0
- package/templates/.agents/skills/zaip-skill-application-readiness/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-application-readiness/references/evidence-matrix.md +3 -0
- package/templates/.agents/skills/zaip-skill-architecture-design/SKILL.md +14 -0
- package/templates/.agents/skills/zaip-skill-architecture-design/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-async-jobs/SKILL.md +14 -0
- package/templates/.agents/skills/zaip-skill-async-jobs/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-auth-tenancy/SKILL.md +15 -0
- package/templates/.agents/skills/zaip-skill-auth-tenancy/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-auth-tenancy/references/data-access-paths.md +9 -0
- package/templates/.agents/skills/zaip-skill-auth-tenancy/references/worker-scenario.md +5 -0
- package/templates/.agents/skills/zaip-skill-auth-tenancy/scripts/worker-contract.test.mjs +27 -0
- package/templates/.agents/skills/zaip-skill-author-skills/SKILL.md +2 -0
- package/templates/.agents/skills/zaip-skill-author-skills/references/engineering-skill-index.md +9 -0
- package/templates/.agents/skills/zaip-skill-author-skills/scripts/audit-skill-catalog.mjs +5 -3
- package/templates/.agents/skills/zaip-skill-author-skills/scripts/author-skill-scripts.test.mjs +27 -0
- package/templates/.agents/skills/zaip-skill-backend/SKILL.md +4 -0
- package/templates/.agents/skills/zaip-skill-backend/references/deployment-environments.md +75 -0
- package/templates/.agents/skills/zaip-skill-backend/references/supabase-migration-contract.md +23 -0
- package/templates/.agents/skills/zaip-skill-brand-governance/SKILL.md +2 -0
- package/templates/.agents/skills/zaip-skill-cache-strategy/SKILL.md +14 -0
- package/templates/.agents/skills/zaip-skill-cache-strategy/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-change/SKILL.md +1 -1
- package/templates/.agents/skills/zaip-skill-cloud-engineering/SKILL.md +7 -0
- package/templates/.agents/skills/zaip-skill-cloudflare-github-deploy/SKILL.md +37 -0
- package/templates/.agents/skills/zaip-skill-cloudflare-github-deploy/agents/openai.yaml +6 -0
- package/templates/.agents/skills/zaip-skill-cloudflare-github-deploy/references/workers-static-assets.md +26 -0
- package/templates/.agents/skills/zaip-skill-cloudflare-github-deploy/references/workflow-templates.md +71 -0
- package/templates/.agents/skills/zaip-skill-cloudflare-github-deploy/scripts/cloudflare-github-deploy-contract.test.mjs +77 -0
- package/templates/.agents/skills/zaip-skill-config/SKILL.md +21 -11
- package/templates/.agents/skills/zaip-skill-config/agents/openai.yaml +2 -2
- package/templates/.agents/skills/zaip-skill-container-runtime/SKILL.md +14 -0
- package/templates/.agents/skills/zaip-skill-container-runtime/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-context/SKILL.md +6 -1
- package/templates/.agents/skills/zaip-skill-context/references/prd-spec-task-handoff.md +10 -0
- package/templates/.agents/skills/zaip-skill-context/references/rule-selection.md +20 -0
- package/templates/.agents/skills/zaip-skill-cqrs/SKILL.md +1 -0
- package/templates/.agents/skills/zaip-skill-cybersecurity/SKILL.md +18 -0
- package/templates/.agents/skills/zaip-skill-cybersecurity/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-cybersecurity/references/audit-contract.md +94 -0
- package/templates/.agents/skills/zaip-skill-cybersecurity/scripts/score-audit.mjs +185 -0
- package/templates/.agents/skills/zaip-skill-cybersecurity/scripts/score-audit.test.mjs +101 -0
- package/templates/.agents/skills/zaip-skill-data-modeling/SKILL.md +14 -0
- package/templates/.agents/skills/zaip-skill-data-modeling/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-database-migrations/SKILL.md +20 -0
- package/templates/.agents/skills/zaip-skill-database-migrations/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-database-migrations/references/manual-mode.md +15 -0
- package/templates/.agents/skills/zaip-skill-database-migrations/references/promotion-example.md +5 -0
- package/templates/.agents/skills/zaip-skill-database-migrations/scripts/export-manual-sql.mjs +145 -0
- package/templates/.agents/skills/zaip-skill-database-migrations/scripts/export-manual-sql.test.mjs +178 -0
- package/templates/.agents/skills/zaip-skill-dependency-upgrade/SKILL.md +14 -0
- package/templates/.agents/skills/zaip-skill-dependency-upgrade/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-deployment-pipeline/SKILL.md +15 -0
- package/templates/.agents/skills/zaip-skill-deployment-pipeline/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-deployment-pipeline/references/runtime-shapes.md +3 -0
- package/templates/.agents/skills/zaip-skill-design-system/SKILL.md +20 -9
- package/templates/.agents/skills/zaip-skill-dev-environment/SKILL.md +14 -0
- package/templates/.agents/skills/zaip-skill-dev-environment/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-dev-environment/references/inventory-contract.md +7 -0
- package/templates/.agents/skills/zaip-skill-dev-environment/scripts/inventory.mjs +77 -0
- package/templates/.agents/skills/zaip-skill-disaster-recovery/SKILL.md +15 -0
- package/templates/.agents/skills/zaip-skill-disaster-recovery/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-disaster-recovery/references/recovery-scope.md +3 -0
- package/templates/.agents/skills/zaip-skill-execution/SKILL.md +3 -3
- package/templates/.agents/skills/zaip-skill-execution/references/correction-cycle.md +7 -0
- package/templates/.agents/skills/zaip-skill-execution/references/runtime-governance.md +1 -5
- package/templates/.agents/skills/zaip-skill-external-integrations/SKILL.md +14 -0
- package/templates/.agents/skills/zaip-skill-external-integrations/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-frontend/SKILL.md +4 -0
- package/templates/.agents/skills/zaip-skill-frontend-componentization/SKILL.md +44 -0
- package/templates/.agents/skills/zaip-skill-frontend-componentization/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-frontend-data-flows/SKILL.md +14 -0
- package/templates/.agents/skills/zaip-skill-frontend-data-flows/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-general-operations/SKILL.md +2 -0
- package/templates/.agents/skills/zaip-skill-github-actions-setup/SKILL.md +36 -0
- package/templates/.agents/skills/zaip-skill-github-actions-setup/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-github-actions-setup/references/cloudflare-pages.md +33 -0
- package/templates/.agents/skills/zaip-skill-github-actions-setup/references/github.md +63 -0
- package/templates/.agents/skills/zaip-skill-github-actions-setup/references/hostinger-vps.md +55 -0
- package/templates/.agents/skills/zaip-skill-github-actions-setup/references/npm.md +30 -0
- package/templates/.agents/skills/zaip-skill-github-actions-setup/scripts/check-skill.mjs +55 -0
- package/templates/.agents/skills/zaip-skill-github-actions-setup/scripts/verify-cloudflare.mjs +61 -0
- package/templates/.agents/skills/zaip-skill-github-actions-setup/scripts/verify-cloudflare.test.mjs +128 -0
- package/templates/.agents/skills/zaip-skill-github-actions-setup/scripts/verify-ssh.integration.test.mjs +106 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/SKILL.md +43 -76
- package/templates/.agents/skills/zaip-skill-github-deploy/references/deployment-workflow.md +131 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/references/github-release-workflow-template.md +31 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/references/release-gate-matrix.md +24 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/references/release-identity.md +44 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/references/release-notes.md +134 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/consumer-release-preparation.mjs +389 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/consumer-release-preparation.test.mjs +134 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/github-deploy-contract.test.mjs +25 -2
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/github-readiness-api.test.mjs +134 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/github-readiness.mjs +98 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/github-readiness.test.mjs +25 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/install-github-readiness-workflow.mjs +159 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/install-github-readiness-workflow.test.mjs +160 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/preflight.mjs +149 -12
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/preflight.test.mjs +64 -5
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/release-notes-coverage.test.mjs +126 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/resolve-release-identity.mjs +78 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/resolve-release-identity.test.mjs +51 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/validate-release-notes.mjs +184 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/validate-release-notes.test.mjs +109 -0
- package/templates/.agents/skills/zaip-skill-growth-strategy-revops/SKILL.md +2 -0
- package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/SKILL.md +18 -10
- package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/agents/openai.yaml +3 -4
- package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/references/aws-cli-terraform.md +62 -0
- package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/references/guia-iniciante-hostinger-vps.md +183 -0
- package/templates/.agents/skills/zaip-skill-marketing/SKILL.md +2 -0
- package/templates/.agents/skills/zaip-skill-module-scaffold/SKILL.md +14 -0
- package/templates/.agents/skills/zaip-skill-module-scaffold/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-module-scaffold/references/scaffold-contract.md +9 -0
- package/templates/.agents/skills/zaip-skill-module-scaffold/scripts/helpers.test.mjs +121 -0
- package/templates/.agents/skills/zaip-skill-module-scaffold/scripts/scaffold.mjs +169 -0
- package/templates/.agents/skills/zaip-skill-move-prd/SKILL.md +1 -1
- package/templates/.agents/skills/zaip-skill-move-spec/SKILL.md +1 -1
- package/templates/.agents/skills/zaip-skill-performance-engineering/SKILL.md +14 -0
- package/templates/.agents/skills/zaip-skill-performance-engineering/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-prd/SKILL.md +1 -1
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-local-telemetry.mjs +1 -0
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-lib.mjs +26 -9
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-lib.test.mjs +39 -13
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-remeasurement.mjs +1 -0
- package/templates/.agents/skills/zaip-skill-refactor-landing-page/SKILL.md +66 -0
- package/templates/.agents/skills/zaip-skill-refactor-landing-page/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-refactor-landing-page/references/behavioral-dry-run.md +23 -0
- package/templates/.agents/skills/zaip-skill-release-qualification/SKILL.md +40 -1
- package/templates/.agents/skills/zaip-skill-release-qualification/references/local-preparation.md +98 -0
- package/templates/.agents/skills/zaip-skill-review/SKILL.md +1 -0
- package/templates/.agents/skills/zaip-skill-rules/SKILL.md +3 -3
- package/templates/.agents/skills/zaip-skill-sales-methodology/SKILL.md +2 -0
- package/templates/.agents/skills/zaip-skill-setup/SKILL.md +19 -21
- package/templates/.agents/skills/zaip-skill-setup/agents/openai.yaml +2 -2
- package/templates/.agents/skills/zaip-skill-spec/SKILL.md +3 -2
- package/templates/.agents/skills/zaip-skill-storage-uploads/SKILL.md +14 -0
- package/templates/.agents/skills/zaip-skill-storage-uploads/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-systematic-debugging/SKILL.md +14 -0
- package/templates/.agents/skills/zaip-skill-systematic-debugging/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-task/SKILL.md +16 -7
- package/templates/.agents/skills/zaip-skill-task/references/commit-policy.md +25 -0
- package/templates/.agents/skills/zaip-skill-test-data/SKILL.md +14 -0
- package/templates/.agents/skills/zaip-skill-test-data/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-test-data/scripts/generate.mjs +72 -0
- package/templates/.agents/skills/zaip-skill-testing-strategy/SKILL.md +15 -0
- package/templates/.agents/skills/zaip-skill-testing-strategy/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-testing-strategy/references/example-map.md +3 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/SKILL.md +8 -0
- package/templates/.agents/zaip-aios/VERSION +1 -1
- package/templates/.agents/zaip-aios/guides/10-seguranca.md +2 -1
- package/templates/.agents/zaip-aios/guides/20-instalacao-detalhada.md +5 -3
- package/templates/scripts/validate-cloud-hostinger-contract.mjs +34 -0
- package/templates/template-manifest.json +955 -211
- package/templates/.agents/branding/.gitkeep +0 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/CostCalculationGuidePage-snUCQYTC.js +0 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/PricingSettingsDialog-BPtVUGgs.js +0 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-3Awyaovx.js +0 -3
- package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-GgzpZ_PY.css +0 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/TraceabilityWorkspace-BCvZFMEf.js +0 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-DbaLbU2q.js +0 -68
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-_MEktQNM.js +0 -2
- package/templates/.agents/dashboard/apps/frontend/dist/assets/rolldown-runtime-D9-fqq9M.js +0 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/traceability-BDe4_Ubl.js +0 -1
- package/templates/.agents/growth/.gitkeep +0 -0
- package/templates/.agents/marketing/.gitkeep +0 -0
- package/templates/.agents/sales/.gitkeep +0 -0
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import { formatRoundedCurrency, formatSummaryMetricValue } from "./overview-metric-format.js";
|
|
2
|
+
|
|
3
|
+
export { formatSummaryMetricValue } from "./overview-metric-format.js";
|
|
4
|
+
|
|
1
5
|
import {
|
|
2
6
|
formatCompactNumber,
|
|
3
7
|
formatCurrency,
|
|
4
|
-
formatDateTime,
|
|
5
8
|
formatDurationMs,
|
|
6
9
|
formatPercent,
|
|
7
10
|
} from "@zaip-ai/dashboard-ui";
|
|
8
|
-
import {
|
|
9
|
-
import type {
|
|
11
|
+
import { useState } from "react";
|
|
12
|
+
import type { OperationsProjection } from "../contracts.js";
|
|
10
13
|
import { allPhaseMetricTotals, executionMetricTotals } from "./execution-metrics.js";
|
|
11
14
|
import { OperationsFilteredStatusDialog as FilteredStatusDialog } from "./OperationsFilteredStatusDialog.js";
|
|
12
15
|
import type { EntityMetric } from "./OperationsOverview.helpers.js";
|
|
@@ -34,6 +37,7 @@ import {
|
|
|
34
37
|
sumKnownOverviewMetric,
|
|
35
38
|
summarizeTopEntityMetrics,
|
|
36
39
|
} from "./OperationsOverview.helpers.js";
|
|
40
|
+
import { OperationsOverviewCharts } from "./OperationsOverviewCharts.js";
|
|
37
41
|
import { OperationsOverviewTopPanel } from "./OperationsOverviewTopPanel.js";
|
|
38
42
|
import type { OperationDatePreset, OperationDateRange } from "./operation-date-range.js";
|
|
39
43
|
import type {
|
|
@@ -43,13 +47,7 @@ import type {
|
|
|
43
47
|
OverviewStatusPage,
|
|
44
48
|
} from "./operations-page-contract.js";
|
|
45
49
|
import { type OperationsLocale, riskLabel } from "./status-labels.js";
|
|
46
|
-
import {
|
|
47
|
-
macroWorkStage,
|
|
48
|
-
taskWorkStage,
|
|
49
|
-
type WorkStage,
|
|
50
|
-
workStageLabel,
|
|
51
|
-
workStages,
|
|
52
|
-
} from "./work-board-model.js";
|
|
50
|
+
import { type WorkStage, workStageLabel, workStages } from "./work-board-model.js";
|
|
53
51
|
import "./operations-overview.css";
|
|
54
52
|
|
|
55
53
|
export {
|
|
@@ -79,36 +77,6 @@ export {
|
|
|
79
77
|
|
|
80
78
|
type OverviewView = "tasks" | "specs" | "prds";
|
|
81
79
|
|
|
82
|
-
function formatRoundedCurrency(
|
|
83
|
-
value: number,
|
|
84
|
-
currency: "BRL" | "USD",
|
|
85
|
-
locale: OperationsLocale,
|
|
86
|
-
): string {
|
|
87
|
-
return new Intl.NumberFormat(locale, {
|
|
88
|
-
style: "currency",
|
|
89
|
-
currency,
|
|
90
|
-
maximumFractionDigits: 0,
|
|
91
|
-
}).format(value);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function formatEntityDuration(value: number | null, locale: OperationsLocale): string {
|
|
95
|
-
if (value !== null) return formatDurationMs(value, locale);
|
|
96
|
-
return locale === "pt-BR" ? "Indisponível" : "Unavailable";
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Keeps missing source facts as null while making a genuinely empty selected
|
|
101
|
-
* population readable as the factual numeric zero in the overview.
|
|
102
|
-
*/
|
|
103
|
-
export function formatSummaryMetricValue(
|
|
104
|
-
value: number | null,
|
|
105
|
-
populationCount: number | null,
|
|
106
|
-
formatKnownValue: (knownValue: number) => string,
|
|
107
|
-
locale: OperationsLocale,
|
|
108
|
-
): string {
|
|
109
|
-
if (value !== null) return formatKnownValue(value);
|
|
110
|
-
return populationCount === 0 ? "0" : formatEntityDuration(null, locale);
|
|
111
|
-
}
|
|
112
80
|
export function OperationsOverview({
|
|
113
81
|
currency,
|
|
114
82
|
data,
|
|
@@ -522,36 +490,44 @@ export function OperationsOverview({
|
|
|
522
490
|
|
|
523
491
|
return (
|
|
524
492
|
<section aria-label={text.overview} className="operations-overview">
|
|
493
|
+
{" "}
|
|
525
494
|
<div className="operations-overview-controls">
|
|
495
|
+
{" "}
|
|
526
496
|
<label className="operations-overview-period">
|
|
527
|
-
|
|
497
|
+
{" "}
|
|
498
|
+
<span>{locale === "pt-BR" ? "Período" : "Period"}</span>{" "}
|
|
528
499
|
<select
|
|
529
500
|
aria-label={locale === "pt-BR" ? "Período" : "Period"}
|
|
530
501
|
onChange={(event) => onDatePresetChange(event.target.value as OperationDatePreset)}
|
|
531
502
|
value={datePreset}
|
|
532
503
|
>
|
|
504
|
+
{" "}
|
|
533
505
|
<option value="today">{locale === "pt-BR" ? "Hoje" : "Today"}</option>
|
|
534
|
-
<option value="yesterday">{locale === "pt-BR" ? "Ontem" : "Yesterday"}</option>
|
|
535
|
-
<option value="this-week">{locale === "pt-BR" ? "Esta Semana" : "This Week"}</option>
|
|
506
|
+
<option value="yesterday">{locale === "pt-BR" ? "Ontem" : "Yesterday"}</option>{" "}
|
|
507
|
+
<option value="this-week">{locale === "pt-BR" ? "Esta Semana" : "This Week"}</option>{" "}
|
|
536
508
|
<option value="last-week">{locale === "pt-BR" ? "Semana Passada" : "Last Week"}</option>
|
|
537
|
-
<option value="this-month">{locale === "pt-BR" ? "Este Mês" : "This Month"}</option>
|
|
538
|
-
<option value="last-month">{locale === "pt-BR" ? "Mês Passado" : "Last Month"}</option>
|
|
509
|
+
<option value="this-month">{locale === "pt-BR" ? "Este Mês" : "This Month"}</option>{" "}
|
|
510
|
+
<option value="last-month">{locale === "pt-BR" ? "Mês Passado" : "Last Month"}</option>{" "}
|
|
539
511
|
<option value="last-3-months">
|
|
512
|
+
{" "}
|
|
540
513
|
{locale === "pt-BR" ? "Últimos 3 meses" : "Last 3 months"}
|
|
541
|
-
</option>
|
|
514
|
+
</option>{" "}
|
|
542
515
|
<option value="last-6-months">
|
|
543
|
-
{
|
|
544
|
-
|
|
516
|
+
{" "}
|
|
517
|
+
{locale === "pt-BR" ? "Últimos 6 meses" : "Last 6 months"}{" "}
|
|
518
|
+
</option>{" "}
|
|
545
519
|
<option value="this-year">{locale === "pt-BR" ? "Este Ano" : "This Year"}</option>
|
|
546
|
-
<option value="last-year">{locale === "pt-BR" ? "Último ano" : "Last year"}</option>
|
|
547
|
-
<option value="all">{locale === "pt-BR" ? "Todo o Período" : "All Time"}</option>
|
|
520
|
+
<option value="last-year">{locale === "pt-BR" ? "Último ano" : "Last year"}</option>{" "}
|
|
521
|
+
<option value="all">{locale === "pt-BR" ? "Todo o Período" : "All Time"}</option>{" "}
|
|
548
522
|
<option disabled value="custom">
|
|
549
|
-
{
|
|
550
|
-
|
|
523
|
+
{" "}
|
|
524
|
+
{locale === "pt-BR" ? "Personalizado" : "Custom"}{" "}
|
|
525
|
+
</option>{" "}
|
|
551
526
|
</select>
|
|
552
|
-
</label>
|
|
553
|
-
</div>
|
|
527
|
+
</label>{" "}
|
|
528
|
+
</div>{" "}
|
|
554
529
|
<div className="operations-kpi-grid">
|
|
530
|
+
{" "}
|
|
555
531
|
<Kpi
|
|
556
532
|
featured={overviewView === "tasks"}
|
|
557
533
|
hint={
|
|
@@ -564,7 +540,7 @@ export function OperationsOverview({
|
|
|
564
540
|
label={text.tasks}
|
|
565
541
|
onSelect={() => selectOverviewView("tasks")}
|
|
566
542
|
value={taskCount === null ? "—" : String(taskCount)}
|
|
567
|
-
/>
|
|
543
|
+
/>{" "}
|
|
568
544
|
<Kpi
|
|
569
545
|
featured={overviewView === "specs"}
|
|
570
546
|
hint={
|
|
@@ -577,7 +553,7 @@ export function OperationsOverview({
|
|
|
577
553
|
label="SPECs"
|
|
578
554
|
onSelect={() => selectOverviewView("specs")}
|
|
579
555
|
value={specCount === null ? "—" : String(specCount)}
|
|
580
|
-
/>
|
|
556
|
+
/>{" "}
|
|
581
557
|
<Kpi
|
|
582
558
|
featured={overviewView === "prds"}
|
|
583
559
|
hint={
|
|
@@ -590,7 +566,7 @@ export function OperationsOverview({
|
|
|
590
566
|
label="PRDs"
|
|
591
567
|
onSelect={() => selectOverviewView("prds")}
|
|
592
568
|
value={prdCount === null ? "—" : String(prdCount)}
|
|
593
|
-
/>
|
|
569
|
+
/>{" "}
|
|
594
570
|
<Kpi
|
|
595
571
|
hint={formatExecutionAverageHint(
|
|
596
572
|
totalDurationMetric ?? 0,
|
|
@@ -611,7 +587,7 @@ export function OperationsOverview({
|
|
|
611
587
|
(value) => formatDurationMs(value, locale),
|
|
612
588
|
locale,
|
|
613
589
|
)}
|
|
614
|
-
/>
|
|
590
|
+
/>{" "}
|
|
615
591
|
<Kpi
|
|
616
592
|
hint={
|
|
617
593
|
tokensPerTask === null || tokensPerHour === null
|
|
@@ -641,7 +617,7 @@ export function OperationsOverview({
|
|
|
641
617
|
(value) => formatCompactNumber(value, locale),
|
|
642
618
|
locale,
|
|
643
619
|
)}
|
|
644
|
-
/>
|
|
620
|
+
/>{" "}
|
|
645
621
|
<Kpi
|
|
646
622
|
hint={
|
|
647
623
|
hourlyCost === null || costPerTask === null
|
|
@@ -671,146 +647,37 @@ export function OperationsOverview({
|
|
|
671
647
|
(value) => formatRoundedCurrency(value, currency, locale),
|
|
672
648
|
locale,
|
|
673
649
|
)}
|
|
674
|
-
/>
|
|
650
|
+
/>{" "}
|
|
675
651
|
</div>
|
|
676
|
-
|
|
677
652
|
<div className="operations-chart-grid">
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
)
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
return item.key !== "unclassified" ? (
|
|
707
|
-
<button
|
|
708
|
-
aria-label={`${item.label}: ${item.count}, ${formatPercent(statusTotal === 0 ? 0 : item.count / statusTotal, locale)}`}
|
|
709
|
-
className="operations-legend-row operations-status-filter"
|
|
710
|
-
key={item.key}
|
|
711
|
-
onClick={() => {
|
|
712
|
-
const stage = item.key as WorkStage;
|
|
713
|
-
setSelectedStatus(stage);
|
|
714
|
-
onLoadStatus?.(
|
|
715
|
-
stage,
|
|
716
|
-
overviewView === "tasks" ? "task" : overviewView === "specs" ? "spec" : "prd",
|
|
717
|
-
0,
|
|
718
|
-
);
|
|
719
|
-
}}
|
|
720
|
-
type="button"
|
|
721
|
-
>
|
|
722
|
-
{content}
|
|
723
|
-
</button>
|
|
724
|
-
) : (
|
|
725
|
-
<div className="operations-legend-row" key={item.key}>
|
|
726
|
-
{content}
|
|
727
|
-
</div>
|
|
728
|
-
);
|
|
729
|
-
})}
|
|
730
|
-
</div>
|
|
731
|
-
</article>
|
|
732
|
-
|
|
733
|
-
<article className="operations-panel operations-panel-risk">
|
|
734
|
-
<PanelHeader hint={copy.classificationHint} title={copy.classificationTitle} />
|
|
735
|
-
<div className="operations-donut-wrap">
|
|
736
|
-
<div
|
|
737
|
-
aria-hidden="true"
|
|
738
|
-
className="operations-donut"
|
|
739
|
-
style={{
|
|
740
|
-
background: donutGradient(classificationStats, Math.max(selectedCount ?? 0, 1)),
|
|
741
|
-
}}
|
|
742
|
-
/>
|
|
743
|
-
<div>
|
|
744
|
-
<strong>{selectedCount ?? "—"}</strong>
|
|
745
|
-
<span>{copy.shortPlural}</span>
|
|
746
|
-
</div>
|
|
747
|
-
</div>
|
|
748
|
-
<div className="operations-legend-grid">
|
|
749
|
-
{classificationStats.map((item) => {
|
|
750
|
-
const content = (
|
|
751
|
-
<>
|
|
752
|
-
<i style={{ background: item.color }} />
|
|
753
|
-
<span>{item.label}</span>
|
|
754
|
-
<span className="operations-legend-value">
|
|
755
|
-
<strong>{item.count}</strong>
|
|
756
|
-
<small>
|
|
757
|
-
{formatPercent(
|
|
758
|
-
selectedCount === null || selectedCount === 0
|
|
759
|
-
? 0
|
|
760
|
-
: item.count / selectedCount,
|
|
761
|
-
locale,
|
|
762
|
-
)}
|
|
763
|
-
</small>
|
|
764
|
-
</span>
|
|
765
|
-
</>
|
|
766
|
-
);
|
|
767
|
-
return item.key !== "unclassified" ? (
|
|
768
|
-
<button
|
|
769
|
-
aria-label={`${item.label}: ${item.count}, ${formatPercent(selectedCount === null || selectedCount === 0 ? 0 : item.count / selectedCount, locale)}`}
|
|
770
|
-
className="operations-legend-row operations-status-filter"
|
|
771
|
-
key={item.key}
|
|
772
|
-
onClick={() => {
|
|
773
|
-
const classification = item.key as OverviewClassification;
|
|
774
|
-
setSelectedClassification(classification);
|
|
775
|
-
onLoadClassificationPage?.(
|
|
776
|
-
overviewView === "tasks" ? "task" : overviewView === "specs" ? "spec" : "prd",
|
|
777
|
-
classification,
|
|
778
|
-
0,
|
|
779
|
-
);
|
|
780
|
-
}}
|
|
781
|
-
type="button"
|
|
782
|
-
>
|
|
783
|
-
{content}
|
|
784
|
-
</button>
|
|
785
|
-
) : (
|
|
786
|
-
<div className="operations-legend-row" key={item.key}>
|
|
787
|
-
{content}
|
|
788
|
-
</div>
|
|
789
|
-
);
|
|
790
|
-
})}
|
|
791
|
-
</div>
|
|
792
|
-
</article>
|
|
793
|
-
|
|
794
|
-
<article
|
|
795
|
-
className={`operations-panel operations-panel-type${locale === "en-US" ? " is-en-us" : ""}`}
|
|
796
|
-
>
|
|
797
|
-
<PanelHeader hint={copy.averageHint} title={copy.averageTitle} />
|
|
798
|
-
<div className="operations-type-summary">
|
|
799
|
-
{metricStats.map(([label, value]) => (
|
|
800
|
-
<div key={label}>
|
|
801
|
-
<span>{label}</span>
|
|
802
|
-
<strong>{value}</strong>
|
|
803
|
-
</div>
|
|
804
|
-
))}
|
|
805
|
-
</div>
|
|
806
|
-
<footer className="operations-latest-task-created">
|
|
807
|
-
<span>{copy.latestLabel}</span>
|
|
808
|
-
<strong>
|
|
809
|
-
{latestCreatedAt === null ? "—" : formatDateTime(latestCreatedAt, locale)}
|
|
810
|
-
</strong>
|
|
811
|
-
</footer>
|
|
812
|
-
</article>
|
|
813
|
-
|
|
653
|
+
{" "}
|
|
654
|
+
<OperationsOverviewCharts
|
|
655
|
+
locale={locale}
|
|
656
|
+
copy={copy}
|
|
657
|
+
text={text}
|
|
658
|
+
statusStats={statusStats}
|
|
659
|
+
statusTotal={statusTotal}
|
|
660
|
+
classificationStats={classificationStats}
|
|
661
|
+
selectedCount={selectedCount}
|
|
662
|
+
metricStats={metricStats}
|
|
663
|
+
latestCreatedAt={latestCreatedAt}
|
|
664
|
+
onStatusSelect={(stage) => {
|
|
665
|
+
setSelectedStatus(stage);
|
|
666
|
+
onLoadStatus?.(
|
|
667
|
+
stage,
|
|
668
|
+
overviewView === "tasks" ? "task" : overviewView === "specs" ? "spec" : "prd",
|
|
669
|
+
0,
|
|
670
|
+
);
|
|
671
|
+
}}
|
|
672
|
+
onClassificationSelect={(classification) => {
|
|
673
|
+
setSelectedClassification(classification);
|
|
674
|
+
onLoadClassificationPage?.(
|
|
675
|
+
overviewView === "tasks" ? "task" : overviewView === "specs" ? "spec" : "prd",
|
|
676
|
+
classification,
|
|
677
|
+
0,
|
|
678
|
+
);
|
|
679
|
+
}}
|
|
680
|
+
/>
|
|
814
681
|
<OperationsOverviewTopPanel
|
|
815
682
|
copy={{ empty: copy.emptyTop, hint: topHint, title: copy.topTitle }}
|
|
816
683
|
currency={currency}
|
|
@@ -822,8 +689,8 @@ export function OperationsOverview({
|
|
|
822
689
|
topCost={topEntitiesCost}
|
|
823
690
|
topEntities={topEntities}
|
|
824
691
|
view={overviewView}
|
|
825
|
-
/>
|
|
826
|
-
</div>
|
|
692
|
+
/>{" "}
|
|
693
|
+
</div>{" "}
|
|
827
694
|
{selectedStatus === null ? null : (
|
|
828
695
|
<FilteredStatusDialog
|
|
829
696
|
eyebrow={
|
|
@@ -865,7 +732,7 @@ export function OperationsOverview({
|
|
|
865
732
|
overviewView === "tasks" ? "task" : overviewView === "specs" ? "spec" : "prd",
|
|
866
733
|
)}
|
|
867
734
|
/>
|
|
868
|
-
)}
|
|
735
|
+
)}{" "}
|
|
869
736
|
{selectedClassification === null ? null : (
|
|
870
737
|
<FilteredStatusDialog
|
|
871
738
|
eyebrow={locale === "pt-BR" ? copy.classificationTitle : "Classification"}
|
|
@@ -907,55 +774,11 @@ export function OperationsOverview({
|
|
|
907
774
|
selectedClassification,
|
|
908
775
|
)}
|
|
909
776
|
/>
|
|
910
|
-
)}
|
|
777
|
+
)}{" "}
|
|
911
778
|
</section>
|
|
912
779
|
);
|
|
913
780
|
}
|
|
914
781
|
|
|
915
|
-
|
|
916
|
-
return (
|
|
917
|
-
<header className="operations-panel-header">
|
|
918
|
-
<div className="operations-panel-header-title">
|
|
919
|
-
<h2>{title}</h2>
|
|
920
|
-
{action}
|
|
921
|
-
</div>
|
|
922
|
-
<small>{hint}</small>
|
|
923
|
-
</header>
|
|
924
|
-
);
|
|
925
|
-
}
|
|
926
|
-
|
|
927
|
-
export function taskStatusDistribution(
|
|
928
|
-
tasks: readonly Parameters<typeof taskWorkStage>[0][],
|
|
929
|
-
locale: OperationsLocale,
|
|
930
|
-
) {
|
|
931
|
-
return workStages.map((stage) => ({
|
|
932
|
-
key: stage,
|
|
933
|
-
label: workStageLabel(stage, locale),
|
|
934
|
-
color: statusColors[stage],
|
|
935
|
-
count: tasks.filter((task) => taskWorkStage(task) === stage).length,
|
|
936
|
-
}));
|
|
937
|
-
}
|
|
782
|
+
import { macroStatusDistribution, taskStatusDistribution } from "./OperationsOverviewPanels.js";
|
|
938
783
|
|
|
939
|
-
export
|
|
940
|
-
macros: readonly MacroProjection[],
|
|
941
|
-
tasks: OperationsProjection["tasks"],
|
|
942
|
-
locale: OperationsLocale,
|
|
943
|
-
) {
|
|
944
|
-
return workStages.map((stage) => ({
|
|
945
|
-
key: stage,
|
|
946
|
-
label: workStageLabel(stage, locale),
|
|
947
|
-
color: statusColors[stage],
|
|
948
|
-
count: macros.filter((macro) => macroWorkStage(macro, tasks) === stage).length,
|
|
949
|
-
}));
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
function donutGradient(rows: readonly { color: string; count: number }[], total: number): string {
|
|
953
|
-
let start = 0;
|
|
954
|
-
const stops = rows.map((row) => {
|
|
955
|
-
const end = start + (row.count / total) * 100;
|
|
956
|
-
const stop = `${row.color} ${start}% ${end}%`;
|
|
957
|
-
start = end;
|
|
958
|
-
return stop;
|
|
959
|
-
});
|
|
960
|
-
return start === 0 ? "rgba(36, 52, 72, 0.86)" : `conic-gradient(${stops.join(", ")})`;
|
|
961
|
-
}
|
|
784
|
+
export { macroStatusDistribution, taskStatusDistribution } from "./OperationsOverviewPanels.js";
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { formatDateTime, formatPercent } from "@zaip-ai/dashboard-ui";
|
|
2
|
+
import type { overviewCopy, overviewText } from "./OperationsOverview.helpers.js";
|
|
3
|
+
import { donutGradient, PanelHeader } from "./OperationsOverviewPanels.js";
|
|
4
|
+
import type { OverviewClassification } from "./operations-page-contract.js";
|
|
5
|
+
import type { OperationsLocale } from "./status-labels.js";
|
|
6
|
+
import type { WorkStage } from "./work-board-model.js";
|
|
7
|
+
export function OperationsOverviewCharts({
|
|
8
|
+
locale,
|
|
9
|
+
copy,
|
|
10
|
+
text,
|
|
11
|
+
statusStats,
|
|
12
|
+
statusTotal,
|
|
13
|
+
classificationStats,
|
|
14
|
+
selectedCount,
|
|
15
|
+
metricStats,
|
|
16
|
+
latestCreatedAt,
|
|
17
|
+
onStatusSelect,
|
|
18
|
+
onClassificationSelect,
|
|
19
|
+
}: {
|
|
20
|
+
locale: OperationsLocale;
|
|
21
|
+
copy: ReturnType<typeof overviewCopy>;
|
|
22
|
+
text: ReturnType<typeof overviewText>;
|
|
23
|
+
statusStats: Array<{ key: string; label: string; color: string; count: number }>;
|
|
24
|
+
statusTotal: number;
|
|
25
|
+
classificationStats: Array<{ key: string; label: string; color: string; count: number }>;
|
|
26
|
+
selectedCount: number | null;
|
|
27
|
+
metricStats: readonly (readonly string[])[];
|
|
28
|
+
latestCreatedAt: string | null;
|
|
29
|
+
onStatusSelect: (stage: WorkStage) => void;
|
|
30
|
+
onClassificationSelect: (classification: OverviewClassification) => void;
|
|
31
|
+
}) {
|
|
32
|
+
return (
|
|
33
|
+
<>
|
|
34
|
+
<article className="operations-panel operations-panel-wide">
|
|
35
|
+
{" "}
|
|
36
|
+
<PanelHeader hint={text.statusHint} title={copy.statusTitle} />{" "}
|
|
37
|
+
<div aria-hidden="true" className="operations-stacked-bar">
|
|
38
|
+
{" "}
|
|
39
|
+
{statusStats.map((item) => (
|
|
40
|
+
<i
|
|
41
|
+
key={item.key}
|
|
42
|
+
style={{
|
|
43
|
+
background: item.color,
|
|
44
|
+
flexGrow: item.count,
|
|
45
|
+
display: item.count === 0 ? "none" : undefined,
|
|
46
|
+
}}
|
|
47
|
+
/>
|
|
48
|
+
))}{" "}
|
|
49
|
+
</div>{" "}
|
|
50
|
+
<div className="operations-legend-grid">
|
|
51
|
+
{" "}
|
|
52
|
+
{statusStats.map((item) => {
|
|
53
|
+
const content = (
|
|
54
|
+
<>
|
|
55
|
+
{" "}
|
|
56
|
+
<i style={{ background: item.color }} />
|
|
57
|
+
<span>{item.label}</span>{" "}
|
|
58
|
+
<span className="operations-legend-value">
|
|
59
|
+
{" "}
|
|
60
|
+
<strong>{item.count}</strong>{" "}
|
|
61
|
+
<small>
|
|
62
|
+
{" "}
|
|
63
|
+
{formatPercent(statusTotal === 0 ? 0 : item.count / statusTotal, locale)}{" "}
|
|
64
|
+
</small>{" "}
|
|
65
|
+
</span>{" "}
|
|
66
|
+
</>
|
|
67
|
+
);
|
|
68
|
+
return item.key !== "unclassified" ? (
|
|
69
|
+
<button
|
|
70
|
+
aria-label={`${item.label}: ${item.count}, ${formatPercent(statusTotal === 0 ? 0 : item.count / statusTotal, locale)}`}
|
|
71
|
+
className="operations-legend-row operations-status-filter"
|
|
72
|
+
key={item.key}
|
|
73
|
+
onClick={() => onStatusSelect(item.key as WorkStage)}
|
|
74
|
+
type="button"
|
|
75
|
+
>
|
|
76
|
+
{" "}
|
|
77
|
+
{content}{" "}
|
|
78
|
+
</button>
|
|
79
|
+
) : (
|
|
80
|
+
<div className="operations-legend-row" key={item.key}>
|
|
81
|
+
{" "}
|
|
82
|
+
{content}{" "}
|
|
83
|
+
</div>
|
|
84
|
+
);
|
|
85
|
+
})}{" "}
|
|
86
|
+
</div>
|
|
87
|
+
</article>
|
|
88
|
+
<article className="operations-panel operations-panel-risk">
|
|
89
|
+
{" "}
|
|
90
|
+
<PanelHeader hint={copy.classificationHint} title={copy.classificationTitle} />{" "}
|
|
91
|
+
<div className="operations-donut-wrap">
|
|
92
|
+
{" "}
|
|
93
|
+
<div
|
|
94
|
+
aria-hidden="true"
|
|
95
|
+
className="operations-donut"
|
|
96
|
+
style={{
|
|
97
|
+
background: donutGradient(classificationStats, Math.max(selectedCount ?? 0, 1)),
|
|
98
|
+
}}
|
|
99
|
+
/>{" "}
|
|
100
|
+
<div>
|
|
101
|
+
{" "}
|
|
102
|
+
<strong>{selectedCount ?? "—"}</strong> <span>{copy.shortPlural}</span>{" "}
|
|
103
|
+
</div>{" "}
|
|
104
|
+
</div>{" "}
|
|
105
|
+
<div className="operations-legend-grid">
|
|
106
|
+
{" "}
|
|
107
|
+
{classificationStats.map((item) => {
|
|
108
|
+
const content = (
|
|
109
|
+
<>
|
|
110
|
+
{" "}
|
|
111
|
+
<i style={{ background: item.color }} /> <span>{item.label}</span>{" "}
|
|
112
|
+
<span className="operations-legend-value">
|
|
113
|
+
{" "}
|
|
114
|
+
<strong>{item.count}</strong>{" "}
|
|
115
|
+
<small>
|
|
116
|
+
{" "}
|
|
117
|
+
{formatPercent(
|
|
118
|
+
selectedCount === null || selectedCount === 0
|
|
119
|
+
? 0
|
|
120
|
+
: item.count / selectedCount,
|
|
121
|
+
locale,
|
|
122
|
+
)}{" "}
|
|
123
|
+
</small>{" "}
|
|
124
|
+
</span>{" "}
|
|
125
|
+
</>
|
|
126
|
+
);
|
|
127
|
+
return item.key !== "unclassified" ? (
|
|
128
|
+
<button
|
|
129
|
+
aria-label={`${item.label}: ${item.count}, ${formatPercent(selectedCount === null || selectedCount === 0 ? 0 : item.count / selectedCount, locale)}`}
|
|
130
|
+
className="operations-legend-row operations-status-filter"
|
|
131
|
+
key={item.key}
|
|
132
|
+
onClick={() => onClassificationSelect(item.key as OverviewClassification)}
|
|
133
|
+
type="button"
|
|
134
|
+
>
|
|
135
|
+
{" "}
|
|
136
|
+
{content}{" "}
|
|
137
|
+
</button>
|
|
138
|
+
) : (
|
|
139
|
+
<div className="operations-legend-row" key={item.key}>
|
|
140
|
+
{" "}
|
|
141
|
+
{content}{" "}
|
|
142
|
+
</div>
|
|
143
|
+
);
|
|
144
|
+
})}{" "}
|
|
145
|
+
</div>{" "}
|
|
146
|
+
</article>
|
|
147
|
+
<article
|
|
148
|
+
className={`operations-panel operations-panel-type${locale === "en-US" ? " is-en-us" : ""}`}
|
|
149
|
+
>
|
|
150
|
+
{" "}
|
|
151
|
+
<PanelHeader hint={copy.averageHint} title={copy.averageTitle} />{" "}
|
|
152
|
+
<div className="operations-type-summary">
|
|
153
|
+
{" "}
|
|
154
|
+
{metricStats.map(([label, value]) => (
|
|
155
|
+
<div key={label}>
|
|
156
|
+
<span>{label}</span> <strong>{value}</strong>{" "}
|
|
157
|
+
</div>
|
|
158
|
+
))}{" "}
|
|
159
|
+
</div>{" "}
|
|
160
|
+
<footer className="operations-latest-task-created">
|
|
161
|
+
{" "}
|
|
162
|
+
<span>{copy.latestLabel}</span>{" "}
|
|
163
|
+
<strong>
|
|
164
|
+
{" "}
|
|
165
|
+
{latestCreatedAt === null ? "—" : formatDateTime(latestCreatedAt, locale)}{" "}
|
|
166
|
+
</strong>{" "}
|
|
167
|
+
</footer>{" "}
|
|
168
|
+
</article>
|
|
169
|
+
</>
|
|
170
|
+
);
|
|
171
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { MacroProjection, OperationsProjection } from "../contracts.js";
|
|
3
|
+
import { statusColors } from "./OperationsOverview.helpers.js";
|
|
4
|
+
import type { OperationsLocale } from "./status-labels.js";
|
|
5
|
+
import { macroWorkStage, taskWorkStage, workStageLabel, workStages } from "./work-board-model.js";
|
|
6
|
+
|
|
7
|
+
export function PanelHeader({
|
|
8
|
+
title,
|
|
9
|
+
hint,
|
|
10
|
+
action,
|
|
11
|
+
}: {
|
|
12
|
+
title: string;
|
|
13
|
+
hint: string;
|
|
14
|
+
action?: ReactNode;
|
|
15
|
+
}) {
|
|
16
|
+
return (
|
|
17
|
+
<header className="operations-panel-header">
|
|
18
|
+
<div className="operations-panel-header-title">
|
|
19
|
+
<h2>{title}</h2>
|
|
20
|
+
{action}
|
|
21
|
+
</div>
|
|
22
|
+
<small>{hint}</small>
|
|
23
|
+
</header>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function taskStatusDistribution(
|
|
28
|
+
tasks: readonly Parameters<typeof taskWorkStage>[0][],
|
|
29
|
+
locale: OperationsLocale,
|
|
30
|
+
) {
|
|
31
|
+
return workStages.map((stage) => ({
|
|
32
|
+
key: stage,
|
|
33
|
+
label: workStageLabel(stage, locale),
|
|
34
|
+
color: statusColors[stage],
|
|
35
|
+
count: tasks.filter((task) => taskWorkStage(task) === stage).length,
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function macroStatusDistribution(
|
|
40
|
+
macros: readonly MacroProjection[],
|
|
41
|
+
tasks: OperationsProjection["tasks"],
|
|
42
|
+
locale: OperationsLocale,
|
|
43
|
+
) {
|
|
44
|
+
return workStages.map((stage) => ({
|
|
45
|
+
key: stage,
|
|
46
|
+
label: workStageLabel(stage, locale),
|
|
47
|
+
color: statusColors[stage],
|
|
48
|
+
count: macros.filter((macro) => macroWorkStage(macro, tasks) === stage).length,
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function donutGradient(
|
|
53
|
+
rows: readonly { color: string; count: number }[],
|
|
54
|
+
total: number,
|
|
55
|
+
): string {
|
|
56
|
+
let start = 0;
|
|
57
|
+
const stops = rows.map((row) => {
|
|
58
|
+
const end = start + (row.count / total) * 100;
|
|
59
|
+
const stop = `${row.color} ${start}% ${end}%`;
|
|
60
|
+
start = end;
|
|
61
|
+
return stop;
|
|
62
|
+
});
|
|
63
|
+
return start === 0 ? "rgba(36, 52, 72, 0.86)" : `conic-gradient(${stops.join(", ")})`;
|
|
64
|
+
}
|