@zaip-ai/cli 1.0.4 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/services/adapter-hook-sources.d.ts +3 -0
- package/dist/services/adapter-hook-sources.d.ts.map +1 -0
- package/dist/services/adapter-hook-sources.js +3 -0
- package/dist/services/adapter-hook-sources.js.map +1 -0
- package/dist/services/adapters.d.ts.map +1 -1
- package/dist/services/adapters.js +76 -601
- package/dist/services/adapters.js.map +1 -1
- package/dist/services/adapters.test.js +41 -0
- package/dist/services/adapters.test.js.map +1 -1
- package/dist/services/agent-adapters.d.ts +7 -0
- package/dist/services/agent-adapters.d.ts.map +1 -1
- package/dist/services/agent-adapters.js +81 -13
- package/dist/services/agent-adapters.js.map +1 -1
- package/dist/services/agent-adapters.test.js +56 -7
- package/dist/services/agent-adapters.test.js.map +1 -1
- package/dist/services/claude-settings-template.d.ts +2 -0
- package/dist/services/claude-settings-template.d.ts.map +1 -0
- package/dist/services/claude-settings-template.js +8 -0
- package/dist/services/claude-settings-template.js.map +1 -0
- package/dist/services/codex-config-template.d.ts +3 -0
- package/dist/services/codex-config-template.d.ts.map +1 -0
- package/dist/services/codex-config-template.js +98 -0
- package/dist/services/codex-config-template.js.map +1 -0
- package/dist/services/codex-pre-tool-hook-template.d.ts +2 -0
- package/dist/services/codex-pre-tool-hook-template.d.ts.map +1 -0
- package/dist/services/codex-pre-tool-hook-template.js +472 -0
- package/dist/services/codex-pre-tool-hook-template.js.map +1 -0
- 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 +22 -13
- package/dist/services/codex-rules.js.map +1 -1
- package/dist/services/codex-subagent-hook-template.d.ts +2 -0
- package/dist/services/codex-subagent-hook-template.d.ts.map +1 -0
- package/dist/services/codex-subagent-hook-template.js +250 -0
- package/dist/services/codex-subagent-hook-template.js.map +1 -0
- package/dist/services/doctor.d.ts.map +1 -1
- package/dist/services/doctor.js +8 -35
- package/dist/services/doctor.js.map +1 -1
- package/dist/services/global-codex-config.d.ts +12 -6
- package/dist/services/global-codex-config.d.ts.map +1 -1
- package/dist/services/global-codex-config.js +72 -53
- package/dist/services/global-codex-config.js.map +1 -1
- package/dist/services/global-codex-config.test.js +35 -84
- package/dist/services/global-codex-config.test.js.map +1 -1
- package/dist/services/install-agents-template.d.ts.map +1 -1
- package/dist/services/install-agents-template.js +55 -19
- package/dist/services/install-agents-template.js.map +1 -1
- package/dist/services/local-state-migration.d.ts +19 -0
- package/dist/services/local-state-migration.d.ts.map +1 -0
- package/dist/services/local-state-migration.js +122 -0
- package/dist/services/local-state-migration.js.map +1 -0
- package/dist/services/logger.d.ts.map +1 -1
- package/dist/services/logger.js +4 -6
- package/dist/services/logger.js.map +1 -1
- package/dist/services/logger.test.js +36 -3
- package/dist/services/logger.test.js.map +1 -1
- package/dist/services/runtime-template.test.js +22 -18
- package/dist/services/runtime-template.test.js.map +1 -1
- package/dist/services/template-manifest.d.ts +1 -0
- package/dist/services/template-manifest.d.ts.map +1 -1
- package/dist/services/template-manifest.js +31 -11
- package/dist/services/template-manifest.js.map +1 -1
- package/dist/services/transactional-files.d.ts.map +1 -1
- package/dist/services/transactional-files.js +84 -27
- package/dist/services/transactional-files.js.map +1 -1
- package/dist/types.d.ts +2 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/templates/.agents/config/agents/catalog.yaml +1081 -145
- package/templates/.agents/config/clients/codex/agents/zaip-agent-analyst.toml +30 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-auditor.toml +30 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-backend.toml +30 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-builder.toml +31 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-cloud-engineer.toml +30 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-data-analyst.toml +30 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-designer.toml +31 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-finalizer.toml +31 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-frontend.toml +31 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-integrator.toml +30 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-marketing-analyst.toml +30 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-orchestrator.toml +37 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-refactoring-specialist.toml +35 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-reviewer.toml +30 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-security-auditor.toml +30 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-task-executor.toml +31 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-website-developer.toml +30 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-writer.toml +32 -0
- package/templates/.agents/config/clients.yaml +152 -0
- package/templates/{.zaip-aios → .agents/config}/pricing/models.json +4 -13
- package/templates/.agents/config/project.yaml +24 -1
- package/templates/.agents/dashboard/.zaip-managed.json +1140 -12
- package/templates/.agents/dashboard/README.md +23 -4
- package/templates/.agents/dashboard/apps/frontend/dist/assets/AgentCatalogSettingsPage-CLYIi7Vo.js +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/AgentCatalogSettingsPage-DTDNVQGX.css +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/DashboardHelpDialog-Cv-JcoxP.js +1320 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/DashboardHelpDialog-Je5nK-Et.css +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/PricingSettingsDialog-CzEggcRb.js +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-05YKn6Z4.js +3 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-YO3yqtgV.css +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/dashboard-localization-C98LGC-Q.js +231 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-8AzCnl3a.js +77 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-DdBYQ_8D.css +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/index.html +2 -2
- package/templates/{.zaip-aios/dashboard/apps/frontend/dist → .agents/dashboard/apps/frontend}/index.html +1 -2
- package/templates/.agents/dashboard/apps/frontend/package.json +22 -0
- package/templates/.agents/dashboard/apps/frontend/src/AgentCatalogSettingsPage.tsx +617 -0
- package/templates/.agents/dashboard/apps/frontend/src/App.tsx +766 -0
- package/templates/.agents/dashboard/apps/frontend/src/AppLoadingPanels.tsx +134 -0
- package/templates/.agents/dashboard/apps/frontend/src/DashboardCapabilityNav.tsx +117 -0
- package/templates/.agents/dashboard/apps/frontend/src/DashboardHelpDialog.tsx +242 -0
- package/templates/.agents/dashboard/apps/frontend/src/PricingSettingsDialog.tsx +295 -0
- package/templates/.agents/dashboard/apps/frontend/src/ProjectSettingsPage.tsx +719 -0
- package/templates/.agents/dashboard/apps/frontend/src/TraceabilityWorkspace.tsx +72 -0
- package/templates/.agents/dashboard/apps/frontend/src/agent-catalog-settings-page.css +660 -0
- package/templates/.agents/dashboard/apps/frontend/src/agent-catalog-settings.test.ts +249 -0
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-api.test.ts +31 -0
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-api.ts +374 -0
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-capability-nav.css +81 -0
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-help-dialog.css +202 -0
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-localization.test.ts +72 -0
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-localization.ts +361 -0
- package/templates/.agents/dashboard/apps/frontend/src/loading-feedback.css +42 -0
- package/templates/{.zaip-aios/design/apps/catalog → .agents/dashboard/apps/frontend}/src/main.tsx +5 -1
- package/templates/.agents/dashboard/apps/frontend/src/operations-period.test.ts +18 -0
- package/templates/.agents/dashboard/apps/frontend/src/operations-period.ts +22 -0
- package/templates/.agents/dashboard/apps/frontend/src/pricing-settings-dialog.css +309 -0
- package/templates/.agents/dashboard/apps/frontend/src/project-settings-model.ts +129 -0
- package/templates/.agents/dashboard/apps/frontend/src/project-settings-page.css +335 -0
- package/templates/.agents/dashboard/apps/frontend/src/project-settings.test.ts +57 -0
- package/templates/.agents/dashboard/apps/frontend/src/snapshot-coherence.test.ts +79 -0
- package/templates/.agents/dashboard/apps/frontend/src/snapshot-coherence.ts +17 -0
- package/templates/.agents/dashboard/apps/frontend/src/styles.css +761 -0
- package/templates/.agents/dashboard/apps/frontend/src/traceability-workspace.css +70 -0
- package/templates/{.zaip-aios/design/apps/catalog → .agents/dashboard/apps/frontend}/tsconfig.json +1 -7
- package/templates/.agents/dashboard/apps/frontend/vite.config.ts +22 -0
- package/templates/{.zaip-aios/design/apps/catalog → .agents/dashboard/apps/frontend}/vitest.config.ts +3 -1
- package/templates/.agents/dashboard/dashboard.config.json +4 -0
- package/templates/.agents/dashboard/modules/cost-monitor/composition-root.ts +6 -0
- package/templates/.agents/dashboard/modules/cost-monitor/package.json +24 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/agent-groups.test.ts +43 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/agent-groups.ts +40 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/contracts.ts +221 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/provider.test.ts +19 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/provider.ts +5 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostCharts.test.ts +75 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostCharts.tsx +260 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostFilters.tsx +351 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostModelsAuditTable.test.ts +51 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostModelsAuditTable.tsx +327 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorIcons.tsx +50 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.test.ts +251 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.tsx +775 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostPeriodAverageCards.tsx +89 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostSummary.tsx +64 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTableIcons.tsx +9 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.test.ts +708 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.tsx +797 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/MacroCostTable.test.ts +79 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/MacroCostTable.tsx +218 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-duration.ts +17 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-copy.ts +84 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-embedded.css +11 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-layout.test.ts +28 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-responsive.css +123 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-summary.ts +130 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor.css +683 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-run-origin.css +28 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-table-metrics.ts +77 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/index.ts +2 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/period-cost-groups.test.ts +111 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/period-cost-groups.ts +140 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/run-display.ts +10 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/aggregate.test.ts +213 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/aggregate.ts +86 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-pricing.test.ts +132 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-projection-filtering.test.ts +193 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-projection-pricing.test.ts +167 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-projection.test-fixtures.ts +213 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-projection.test.ts +793 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-projection.ts +622 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/index.ts +2 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/run-telemetry.test.ts +36 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/run-telemetry.ts +22 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/task-cost-groups.test.ts +137 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/task-cost-groups.ts +64 -0
- package/templates/.agents/dashboard/modules/cost-monitor/tsconfig.json +10 -0
- package/templates/.agents/dashboard/modules/operations/composition-root.ts +19 -0
- package/templates/.agents/dashboard/modules/operations/package.json +30 -0
- package/templates/.agents/dashboard/modules/operations/src/contracts.ts +409 -0
- package/templates/.agents/dashboard/modules/operations/src/duration-population.test.ts +16 -0
- package/templates/.agents/dashboard/modules/operations/src/duration-population.ts +35 -0
- package/templates/.agents/dashboard/modules/operations/src/react/EntityDetailsDialog.tsx +309 -0
- package/templates/.agents/dashboard/modules/operations/src/react/EntityTables.test.ts +33 -0
- package/templates/.agents/dashboard/modules/operations/src/react/EntityTables.tsx +491 -0
- package/templates/.agents/dashboard/modules/operations/src/react/MacroBoard.test.ts +28 -0
- package/templates/.agents/dashboard/modules/operations/src/react/MacroBoard.tsx +313 -0
- package/templates/.agents/dashboard/modules/operations/src/react/MacroGrid.tsx +61 -0
- package/templates/.agents/dashboard/modules/operations/src/react/MacroPlanningDialog.tsx +427 -0
- package/templates/.agents/dashboard/modules/operations/src/react/OperationDateFilters.test.ts +32 -0
- package/templates/.agents/dashboard/modules/operations/src/react/OperationDateFilters.tsx +124 -0
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsIcons.tsx +58 -0
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.helpers.tsx +412 -0
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.test.ts +498 -0
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.tsx +621 -0
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsPage.tsx +800 -0
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsPageDetails.tsx +113 -0
- package/templates/.agents/dashboard/modules/operations/src/react/PeriodSummaryTable.tsx +248 -0
- package/templates/.agents/dashboard/modules/operations/src/react/PrdDocumentDialog.tsx +235 -0
- package/templates/.agents/dashboard/modules/operations/src/react/TaskBoard.test.ts +141 -0
- package/templates/.agents/dashboard/modules/operations/src/react/TaskBoard.tsx +352 -0
- package/templates/.agents/dashboard/modules/operations/src/react/TaskDetailsDialog.tsx +134 -0
- package/templates/.agents/dashboard/modules/operations/src/react/UnifiedWorkBoard.tsx +502 -0
- package/templates/.agents/dashboard/modules/operations/src/react/UnifiedWorkList.test.ts +48 -0
- package/templates/.agents/dashboard/modules/operations/src/react/UnifiedWorkList.tsx +298 -0
- package/templates/.agents/dashboard/modules/operations/src/react/card-elapsed-time.css +19 -0
- package/templates/.agents/dashboard/modules/operations/src/react/card-elapsed-time.test.ts +47 -0
- package/templates/.agents/dashboard/modules/operations/src/react/card-elapsed-time.ts +66 -0
- package/templates/.agents/dashboard/modules/operations/src/react/card-type-colors.css +35 -0
- package/templates/.agents/dashboard/modules/operations/src/react/conversation-rows.test.ts +50 -0
- package/templates/.agents/dashboard/modules/operations/src/react/conversation-rows.ts +75 -0
- package/templates/.agents/dashboard/modules/operations/src/react/entity-details-dialog.css +76 -0
- package/templates/.agents/dashboard/modules/operations/src/react/execution-metrics.test.ts +170 -0
- package/templates/.agents/dashboard/modules/operations/src/react/execution-metrics.ts +88 -0
- package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportAction.test.ts +32 -0
- package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportAction.tsx +93 -0
- package/templates/.agents/dashboard/modules/operations/src/react/export/ExportProgressToast.tsx +26 -0
- package/templates/.agents/dashboard/modules/operations/src/react/export/export-layout.test.ts +67 -0
- package/templates/.agents/dashboard/modules/operations/src/react/export/export-session.test.ts +208 -0
- package/templates/.agents/dashboard/modules/operations/src/react/export/export-session.ts +194 -0
- package/templates/.agents/dashboard/modules/operations/src/react/export/export.css +31 -0
- package/templates/.agents/dashboard/modules/operations/src/react/format-card-created-at.test.ts +19 -0
- package/templates/.agents/dashboard/modules/operations/src/react/format-card-created-at.ts +19 -0
- package/templates/.agents/dashboard/modules/operations/src/react/format-rounded-duration.test.ts +27 -0
- package/templates/.agents/dashboard/modules/operations/src/react/format-rounded-duration.ts +14 -0
- package/templates/.agents/dashboard/modules/operations/src/react/fullscreen-dialog.test.tsx +113 -0
- package/templates/.agents/dashboard/modules/operations/src/react/index.ts +10 -0
- package/templates/.agents/dashboard/modules/operations/src/react/macro-dialog-data.test.ts +70 -0
- package/templates/.agents/dashboard/modules/operations/src/react/macro-dialog-data.ts +24 -0
- package/templates/.agents/dashboard/modules/operations/src/react/macro-dialog-usage.tsx +83 -0
- package/templates/.agents/dashboard/modules/operations/src/react/macro-planning-dialog-responsive.css +74 -0
- package/templates/.agents/dashboard/modules/operations/src/react/macro-planning-dialog.css +752 -0
- package/templates/.agents/dashboard/modules/operations/src/react/metric-accessibility.test.ts +17 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operation-date-range.test.ts +55 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operation-date-range.ts +135 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operation-duration.test.ts +19 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operation-duration.ts +27 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-date-filters.css +154 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-filter-panel.css +187 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-layout.test.ts +15 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-overview-period-filter.test.ts +69 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-overview.css +588 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-page-filters.ts +51 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-responsive.css +94 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-table-badges.css +57 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-view-order.test.ts +19 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations.css +753 -0
- package/templates/.agents/dashboard/modules/operations/src/react/period-summary.css +12 -0
- package/templates/.agents/dashboard/modules/operations/src/react/period-summary.test.ts +472 -0
- package/templates/.agents/dashboard/modules/operations/src/react/period-summary.ts +237 -0
- package/templates/.agents/dashboard/modules/operations/src/react/popup-localization.test.ts +48 -0
- package/templates/.agents/dashboard/modules/operations/src/react/run-scope.test.ts +29 -0
- package/templates/.agents/dashboard/modules/operations/src/react/run-scope.ts +25 -0
- package/templates/.agents/dashboard/modules/operations/src/react/sort-by-created-at.test.ts +35 -0
- package/templates/.agents/dashboard/modules/operations/src/react/sort-by-created-at.ts +11 -0
- package/templates/.agents/dashboard/modules/operations/src/react/status-labels.ts +36 -0
- package/templates/.agents/dashboard/modules/operations/src/react/table-order.test.ts +34 -0
- package/templates/.agents/dashboard/modules/operations/src/react/table-order.ts +15 -0
- package/templates/.agents/dashboard/modules/operations/src/react/task-origin-badge.css +23 -0
- package/templates/.agents/dashboard/modules/operations/src/react/task-origin.test.ts +46 -0
- package/templates/.agents/dashboard/modules/operations/src/react/task-origin.ts +27 -0
- package/templates/.agents/dashboard/modules/operations/src/react/unified-work-board.css +187 -0
- package/templates/.agents/dashboard/modules/operations/src/react/use-current-time.ts +12 -0
- package/templates/.agents/dashboard/modules/operations/src/react/use-infinite-column.ts +29 -0
- package/templates/.agents/dashboard/modules/operations/src/react/work-board-model.test.ts +247 -0
- package/templates/.agents/dashboard/modules/operations/src/react/work-board-model.ts +179 -0
- package/templates/.agents/dashboard/modules/operations/src/server/build-operations-projection-helpers.ts +43 -0
- package/templates/.agents/dashboard/modules/operations/src/server/build-operations-projection.test.ts +364 -0
- package/templates/.agents/dashboard/modules/operations/src/server/build-operations-projection.ts +787 -0
- package/templates/.agents/dashboard/modules/operations/src/server/canonical-compat.ts +176 -0
- package/templates/.agents/dashboard/modules/operations/src/server/canonical-run-projection.ts +140 -0
- package/templates/.agents/dashboard/modules/operations/src/server/execution-relationship-counts.test.ts +137 -0
- package/templates/.agents/dashboard/modules/operations/src/server/execution-relationship-counts.ts +121 -0
- package/templates/.agents/dashboard/modules/operations/src/server/filter.test.ts +33 -0
- package/templates/.agents/dashboard/modules/operations/src/server/filter.ts +17 -0
- package/templates/.agents/dashboard/modules/operations/src/server/index.ts +2 -0
- package/templates/.agents/dashboard/modules/operations/src/server/internal.ts +8 -0
- package/templates/.agents/dashboard/modules/operations/src/server/macro.ts +68 -0
- package/templates/.agents/dashboard/modules/operations/src/server/metric-coverage.ts +60 -0
- package/templates/.agents/dashboard/modules/operations/src/server/planned-task-previews.test.ts +22 -0
- package/templates/.agents/dashboard/modules/operations/src/server/planned-task-previews.ts +55 -0
- package/templates/.agents/dashboard/modules/operations/src/server/read-task-detail.ts +86 -0
- package/templates/.agents/dashboard/modules/operations/src/server/run-order.test.ts +23 -0
- package/templates/.agents/dashboard/modules/operations/src/server/run-order.ts +11 -0
- package/templates/.agents/dashboard/modules/operations/src/server/runs.test.ts +27 -0
- package/templates/.agents/dashboard/modules/operations/src/server/runs.ts +77 -0
- package/templates/.agents/dashboard/modules/operations/src/server/task-test-counts.test.ts +32 -0
- package/templates/.agents/dashboard/modules/operations/src/server/task-test-counts.ts +49 -0
- package/templates/.agents/dashboard/modules/operations/src/server/usage.test.ts +25 -0
- package/templates/.agents/dashboard/modules/operations/src/server/usage.ts +139 -0
- package/templates/.agents/dashboard/modules/operations/src/work-readiness.ts +26 -0
- package/templates/.agents/dashboard/modules/operations/tsconfig.json +10 -0
- package/templates/.agents/dashboard/modules/traceability/composition-root.ts +7 -0
- package/templates/.agents/dashboard/modules/traceability/golden/golden-view.test.ts +27 -0
- package/templates/.agents/dashboard/modules/traceability/golden/golden-view.ts +57 -0
- package/templates/.agents/dashboard/modules/traceability/golden/index.ts +1 -0
- package/templates/.agents/dashboard/modules/traceability/package.json +26 -0
- package/templates/.agents/dashboard/modules/traceability/src/contracts.ts +76 -0
- package/templates/.agents/dashboard/modules/traceability/src/react/TaskTracePanel.test.ts +80 -0
- package/templates/.agents/dashboard/modules/traceability/src/react/TaskTracePanel.tsx +681 -0
- package/templates/.agents/dashboard/modules/traceability/src/react/TraceDocumentDialog.tsx +34 -0
- package/templates/.agents/dashboard/modules/traceability/src/react/TraceStageDetail.tsx +129 -0
- package/templates/.agents/dashboard/modules/traceability/src/react/TraceStageDialog.tsx +49 -0
- package/templates/.agents/dashboard/modules/traceability/src/react/index.ts +1 -0
- package/templates/.agents/dashboard/modules/traceability/src/react/traceability-embedded.css +9 -0
- package/templates/.agents/dashboard/modules/traceability/src/react/traceability-navigation.css +122 -0
- package/templates/.agents/dashboard/modules/traceability/src/react/traceability-stage-detail.css +175 -0
- package/templates/.agents/dashboard/modules/traceability/src/react/traceability-stage-dialog.css +127 -0
- package/templates/.agents/dashboard/modules/traceability/src/react/traceability-usage.css +120 -0
- package/templates/.agents/dashboard/modules/traceability/src/react/traceability.css +727 -0
- package/templates/.agents/dashboard/modules/traceability/src/server/build-task-trace.test.ts +311 -0
- package/templates/.agents/dashboard/modules/traceability/src/server/build-task-trace.ts +421 -0
- package/templates/.agents/dashboard/modules/traceability/src/server/index.ts +1 -0
- package/templates/.agents/dashboard/modules/traceability/tsconfig.json +10 -0
- package/templates/.agents/dashboard/packages/branding/package.json +14 -0
- package/templates/.agents/dashboard/packages/branding/src/index.ts +10 -0
- package/templates/.agents/dashboard/packages/branding/tsconfig.json +7 -0
- package/templates/.agents/dashboard/packages/contracts/package.json +17 -0
- package/templates/.agents/dashboard/packages/contracts/src/export.ts +29 -0
- package/templates/.agents/dashboard/packages/contracts/src/index.ts +155 -0
- package/templates/.agents/dashboard/packages/contracts/src/period-counts.test.ts +48 -0
- package/templates/.agents/dashboard/packages/contracts/tsconfig.json +7 -0
- package/templates/.agents/dashboard/packages/data-export/package.json +19 -0
- package/templates/.agents/dashboard/packages/data-export/src/index.test.ts +268 -0
- package/templates/.agents/dashboard/packages/data-export/src/index.ts +84 -0
- package/templates/.agents/dashboard/packages/data-export/src/ooxml-stream.test.ts +19 -0
- package/templates/.agents/dashboard/packages/data-export/src/ooxml-stream.ts +260 -0
- package/templates/.agents/dashboard/packages/local-runtime/package.json +31 -0
- package/templates/.agents/dashboard/packages/local-runtime/server.mjs +68 -46
- package/templates/.agents/dashboard/packages/local-runtime/src/agent-catalog-settings.test.ts +224 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/agent-catalog-settings.ts +320 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/export/index.ts +7 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/manifest-runs.ts +204 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/project-settings.test.ts +92 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/project-settings.ts +32 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/runtime.mjs +222 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-settings.test.ts +217 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot.test.ts +526 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-summary-helpers.ts +73 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server.test-fixtures.ts +147 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server.test.ts +580 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server.ts +799 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/start-dashboard.mjs +81 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.mjs +85 -33
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.test.mjs +378 -0
- package/templates/.agents/dashboard/packages/local-runtime/tsconfig.json +8 -0
- package/templates/.agents/dashboard/packages/ui/package.json +18 -0
- package/templates/.agents/dashboard/packages/ui/src/DashboardHeader.test.mjs +20 -0
- package/templates/.agents/dashboard/packages/ui/src/DashboardHeader.tsx +273 -0
- package/templates/.agents/dashboard/packages/ui/src/DataTable.test.tsx +61 -0
- package/templates/.agents/dashboard/packages/ui/src/DataTable.tsx +292 -0
- package/templates/.agents/dashboard/packages/ui/src/PeriodAverageCards.test.tsx +27 -0
- package/templates/.agents/dashboard/packages/ui/src/PeriodAverageCards.tsx +27 -0
- package/templates/.agents/dashboard/packages/ui/src/format.test.ts +54 -0
- package/templates/.agents/dashboard/packages/ui/src/format.ts +81 -0
- package/templates/.agents/dashboard/packages/ui/src/index.ts +6 -0
- package/templates/.agents/dashboard/packages/ui/src/period-average-cards.css +64 -0
- package/templates/.agents/dashboard/packages/ui/src/ui.css +451 -0
- package/templates/.agents/dashboard/packages/ui/tsconfig.json +10 -0
- package/templates/.agents/dashboard/packages/windows-launcher/Program.cs +214 -0
- package/templates/.agents/dashboard/packages/windows-launcher/ZaipDashboardLauncher.csproj +11 -0
- package/templates/.agents/dashboard/packages/windows-launcher/build-dashboard-launcher.ps1 +142 -0
- package/templates/.agents/dashboard/packages/windows-launcher/zaip-dashboard.cmd +4 -0
- package/templates/.agents/dashboard/tests/e2e/package.json +18 -0
- package/templates/.agents/dashboard/tests/e2e/playwright.config.ts +33 -0
- package/templates/.agents/dashboard/tests/e2e/specs/dashboard.spec.ts +531 -0
- package/templates/.agents/dashboard/tests/e2e/tsconfig.json +9 -0
- package/templates/.agents/dashboard/zaip-dashboard.exe +0 -0
- package/templates/{.zaip-aios → .agents}/design/.zaip-managed.json +62 -50
- package/templates/.agents/design/DESIGN.md +7 -0
- package/templates/.agents/design/apps/catalog/dist/assets/index-BEmIE7WE.css +1 -0
- package/templates/{.zaip-aios/design/apps/catalog/dist/assets/index-Bvwc3Bgw.js → .agents/design/apps/catalog/dist/assets/index-CqqYWY2f.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/assets/{index-Bvwc3Bgw.js → index-D9pj7Jlf.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/index.html +2 -2
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/CatalogShell-BWY-80s4.js +1 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{Color-6AOWCN3U-D8qyAXo4.js → Color-6AOWCN3U-B-kAgAjB.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/Components.stories-Be2mDUQj.js +27 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/DesignSystem.stories-DRx9blDs.js +1 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{DocsRenderer-JROSPFPF-LmiVo77Q.js → DocsRenderer-JROSPFPF-BVN7xHtv.js} +4 -4
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{WithTooltip-7X4HQR7L-CTMWAwDe.js → WithTooltip-7X4HQR7L-CDHtKYkz.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{chunk-DRQKCCAG-DUhJxxRU.js → chunk-DRQKCCAG-D6AsDkMK.js} +1 -1
- package/templates/{.zaip-aios/design/apps/catalog/dist/storybook/assets/chunk-W22LQPXL-9RCn9-l7.js → .agents/design/apps/catalog/dist/storybook/assets/chunk-W22LQPXL-B4m5uloN.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{components-BX1OfYUi.js → components-CN8YyTUg.js} +5 -5
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/formatter-L2YTDE3Q-EwuTh8Zk.js +1 -0
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/{iframe-LMhZM1ce.js → iframe-9yZfIsdT.js} +3 -3
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/iframe-BEmIE7WE.css +1 -0
- package/templates/{.zaip-aios/design/apps/catalog/dist/storybook/assets/react-18-jAz3avmR.js → .agents/design/apps/catalog/dist/storybook/assets/react-18-BoCSnq6H.js} +1 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/react-DyL61NPT.js +1 -0
- package/templates/{.zaip-aios/design/apps/catalog/dist/storybook/assets/syntaxhighlighter-YFXUGROL-DV8X2acD.js → .agents/design/apps/catalog/dist/storybook/assets/syntaxhighlighter-YFXUGROL-Bnn_nMwJ.js} +1 -1
- package/templates/{.zaip-aios/design/apps/catalog/dist/storybook/assets/theming-CHbHkcNi.js → .agents/design/apps/catalog/dist/storybook/assets/theming-DS_ue2sb.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/src/components/Primitives.tsx +168 -2
- package/templates/.agents/design/apps/catalog/src/components/dialog-focus.test.ts +42 -0
- package/templates/.agents/design/apps/catalog/src/components/dialog-focus.ts +38 -0
- package/templates/.agents/design/apps/catalog/src/design-contract.test.ts +37 -8
- package/templates/.agents/design/apps/catalog/src/pages/ComponentsPage.tsx +89 -28
- package/templates/.agents/design/apps/catalog/src/stories/Components.stories.tsx +54 -0
- package/templates/.agents/design/apps/catalog/src/styles/components.css +204 -3
- package/templates/.agents/design/apps/catalog/src/styles/design-system.css +2 -0
- package/templates/.agents/design/apps/catalog/src/styles.css +5 -0
- package/templates/.agents/design/tokens.json +9 -1
- package/templates/.agents/requirements/autonomous-assurance.md +9 -10
- package/templates/.agents/requirements/comparative-audit.md +22 -0
- package/templates/.agents/requirements/context-engine.md +5 -5
- package/templates/.agents/requirements/cost-observability.md +3 -2
- package/templates/.agents/requirements/data-export.md +57 -0
- package/templates/.agents/requirements/design-system.md +2 -2
- package/templates/.agents/requirements/execution-engine.md +8 -6
- package/templates/.agents/requirements/kanban-dashboard.md +3 -3
- package/templates/.agents/requirements/model-orchestration.md +11 -11
- package/templates/.agents/requirements/public-distribution.md +4 -4
- package/templates/.agents/requirements/software-architecture.md +4 -4
- package/templates/.agents/requirements/strategic-improvements.md +24 -0
- package/templates/.agents/requirements/work-lifecycle.md +20 -10
- package/templates/.agents/requirements/zaip-strategic-95.md +20 -0
- package/templates/.agents/rules/{zaip/architecture.md → architecture.md} +1 -1
- package/templates/{.zaip-aios/templates/rules/zaip → .agents/rules}/context.md +3 -3
- package/templates/.agents/rules/core.md +21 -0
- package/templates/.agents/rules/{zaip/evolution.md → evolution.md} +1 -1
- package/templates/.agents/rules/frontend-lite.md +18 -0
- package/templates/{.zaip-aios/templates/rules/zaip → .agents/rules}/model-orchestration.md +1 -1
- package/templates/.agents/rules/run-lifecycle-closure.md +24 -0
- package/templates/{.zaip-aios/templates/rules/zaip → .agents/rules}/security.md +1 -1
- package/templates/.agents/rules/text-writing-utf8.md +12 -0
- package/templates/.agents/rules/workflow.md +25 -0
- package/templates/{.zaip-aios → .agents/runtime}/bin/zaip.mjs +399 -195
- package/templates/.agents/runtime/checksums.sha256 +9 -0
- package/templates/.agents/runtime/manifest.json +16 -0
- package/templates/{.zaip-aios → .agents/runtime}/sbom.cdx.json +532 -10
- package/templates/.agents/skills/criar-pasta-obsidian/SKILL.md +20 -0
- package/templates/.agents/skills/criar-pasta-obsidian/agents/openai.yaml +4 -0
- package/templates/.agents/skills/criar-pasta-obsidian/scripts/generate-obsidian-vault.mjs +414 -0
- package/templates/.agents/skills/criar-pasta-obsidian/scripts/generate-obsidian-vault.test.mjs +144 -0
- package/templates/.agents/skills/zaip-aios/SKILL.md +2 -2
- package/templates/.agents/skills/zaip-aios/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-adapters/SKILL.md +1 -1
- package/templates/.agents/skills/zaip-skill-backend/SKILL.md +10 -0
- package/templates/.agents/skills/zaip-skill-backend/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-cloud-engineering/SKILL.md +10 -0
- package/templates/.agents/skills/zaip-skill-cloud-engineering/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-config/SKILL.md +3 -3
- package/templates/.agents/skills/zaip-skill-data-analyst/SKILL.md +23 -0
- package/templates/.agents/skills/zaip-skill-data-analyst/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-design-system/SKILL.md +50 -0
- package/templates/.agents/skills/zaip-skill-design-system/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-design-system/references/scope.md +21 -0
- package/templates/.agents/skills/zaip-skill-enforce-architecture/SKILL.md +2 -2
- package/templates/.agents/skills/zaip-skill-execution/SKILL.md +11 -8
- package/templates/.agents/skills/zaip-skill-execution/references/prepared-plan.md +2 -0
- package/templates/.agents/skills/zaip-skill-frontend/SKILL.md +10 -0
- package/templates/.agents/skills/zaip-skill-frontend/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/SKILL.md +41 -15
- package/templates/.agents/skills/zaip-skill-github-deploy/agents/openai.yaml +2 -2
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/github-deploy-contract.test.mjs +80 -0
- package/templates/.agents/skills/zaip-skill-github-setup/SKILL.md +1 -1
- package/templates/.agents/skills/zaip-skill-marketing/SKILL.md +10 -0
- package/templates/.agents/skills/zaip-skill-marketing/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-move-prd/SKILL.md +10 -6
- package/templates/.agents/skills/zaip-skill-move-spec/SKILL.md +9 -6
- package/templates/.agents/skills/zaip-skill-observability/SKILL.md +1 -1
- package/templates/.agents/skills/zaip-skill-prd/SKILL.md +27 -11
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/SKILL.md +3 -4
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-local-telemetry.mjs +59 -13
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-lib.mjs +131 -28
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-lib.test.mjs +81 -2
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-remeasurement.mjs +167 -0
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-remeasurement.test.mjs +267 -0
- package/templates/.agents/skills/zaip-skill-refactor-existing-code/SKILL.md +55 -0
- package/templates/.agents/skills/zaip-skill-refactor-existing-code/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-refactor-existing-code/references/refactor-map-contract.md +33 -0
- package/templates/.agents/skills/zaip-skill-refactor-existing-code/references/visual-modes.md +17 -0
- package/templates/.agents/skills/zaip-skill-refactor-existing-code/scripts/inventory-source.mjs +181 -0
- package/templates/.agents/skills/zaip-skill-refactor-existing-code/scripts/refactor-scripts.test.mjs +293 -0
- package/templates/.agents/skills/zaip-skill-refactor-existing-code/scripts/validate-refactor-map.mjs +294 -0
- package/templates/.agents/skills/zaip-skill-requirements/SKILL.md +1 -1
- package/templates/.agents/skills/zaip-skill-review/SKILL.md +1 -1
- package/templates/.agents/skills/zaip-skill-rules/SKILL.md +4 -4
- package/templates/.agents/skills/zaip-skill-setup/SKILL.md +2 -2
- package/templates/.agents/skills/zaip-skill-spec/SKILL.md +10 -10
- package/templates/.agents/skills/zaip-skill-task/SKILL.md +3 -3
- package/templates/.agents/skills/zaip-skill-tool-setup/references/secrets.md +1 -1
- package/templates/.agents/skills/zaip-skill-tool-setup/scripts/tool-state.mjs +1 -1
- package/templates/.agents/skills/zaip-skill-website-readiness/SKILL.md +53 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-website-readiness/references/capability-checklist.md +32 -0
- package/templates/.agents/tools/catalog.yaml +0 -6
- package/templates/.agents/zaip-aios/README.md +1 -1
- package/templates/.agents/zaip-aios/guides/01-primeiros-passos.md +4 -2
- package/templates/.agents/zaip-aios/guides/03-tasks.md +6 -0
- package/templates/.agents/zaip-aios/guides/04-specs.md +7 -3
- package/templates/.agents/zaip-aios/guides/05-prds.md +26 -1
- package/templates/.agents/zaip-aios/guides/06-execucao.md +10 -0
- package/templates/.agents/zaip-aios/guides/08-contexto-e-tokens.md +1 -1
- package/templates/.agents/zaip-aios/guides/11-observabilidade-e-custos.md +2 -0
- package/templates/.agents/zaip-aios/guides/13-boas-praticas.md +3 -0
- package/templates/.agents/zaip-aios/guides/14-troubleshooting.md +3 -1
- package/templates/.agents/zaip-aios/guides/16-lifecycle-e-reconciliacao.md +7 -1
- package/templates/.local/gitignore.template +2 -0
- package/templates/template-manifest.json +1650 -1859
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-_yxs47Hd.css +0 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-ehU9Etwm.js +0 -1207
- package/templates/.agents/design/apps/catalog/dist/assets/index-B4pfFtvJ.css +0 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/Components.stories-DkBtOSHX.js +0 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/DesignSystem.stories-BttERyCr.js +0 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/Primitives-HZpQ6PjX.js +0 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/chunk-W22LQPXL-9RCn9-l7.js +0 -18
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/formatter-L2YTDE3Q-Bu6KfEwW.js +0 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/iframe-B4pfFtvJ.css +0 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/react-18-jAz3avmR.js +0 -9
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/react-DvDPBd6Q.js +0 -1
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/syntaxhighlighter-YFXUGROL-DV8X2acD.js +0 -6
- package/templates/.agents/design/apps/catalog/dist/storybook/assets/theming-CHbHkcNi.js +0 -39
- package/templates/.agents/rules/project/.gitkeep +0 -0
- package/templates/.agents/rules/zaip/context.md +0 -22
- package/templates/.agents/rules/zaip/core.md +0 -24
- package/templates/.agents/rules/zaip/model-orchestration.md +0 -48
- package/templates/.agents/rules/zaip/security.md +0 -20
- package/templates/.agents/rules/zaip/workflow.md +0 -35
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/inspect-local-sqlite.py +0 -52
- package/templates/.agents/tools/mcp/development/sqlite/README.md +0 -20
- package/templates/.agents/tools/mcp/development/sqlite/manifest.yaml +0 -25
- package/templates/.zaip-aios/checksums.sha256 +0 -370
- package/templates/.zaip-aios/dashboard/.zaip-managed.json +0 -46
- package/templates/.zaip-aios/dashboard/README.md +0 -91
- package/templates/.zaip-aios/dashboard/apps/frontend/dist/assets/index-_yxs47Hd.css +0 -1
- package/templates/.zaip-aios/dashboard/apps/frontend/dist/assets/index-ehU9Etwm.js +0 -1207
- package/templates/.zaip-aios/dashboard/apps/frontend/dist/assets/logo_novo_azul-BBx5pA2B.png +0 -0
- package/templates/.zaip-aios/dashboard/packages/local-runtime/server.mjs +0 -199
- package/templates/.zaip-aios/dashboard/packages/local-runtime/start-dashboard.mjs +0 -726
- package/templates/.zaip-aios/dashboard/zaip-dashboard.exe +0 -0
- package/templates/.zaip-aios/design/DESIGN.md +0 -180
- package/templates/.zaip-aios/design/README.md +0 -47
- package/templates/.zaip-aios/design/apps/catalog/.storybook/main.ts +0 -15
- package/templates/.zaip-aios/design/apps/catalog/.storybook/preview.ts +0 -21
- package/templates/.zaip-aios/design/apps/catalog/dist/assets/index-B4pfFtvJ.css +0 -1
- package/templates/.zaip-aios/design/apps/catalog/dist/index.html +0 -14
- package/templates/.zaip-aios/design/apps/catalog/dist/logo_novo_azul.png +0 -0
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/Color-6AOWCN3U-D8qyAXo4.js +0 -1
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/Components.stories-DkBtOSHX.js +0 -1
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/DesignSystem.stories-BttERyCr.js +0 -1
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/DocsRenderer-JROSPFPF-LmiVo77Q.js +0 -46
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/Primitives-HZpQ6PjX.js +0 -1
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/WithTooltip-7X4HQR7L-CTMWAwDe.js +0 -9
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/axe-Bk3eEgJf.js +0 -20
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/chunk-242VQQM5-DB2JSNUA.js +0 -1
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/chunk-DRQKCCAG-DUhJxxRU.js +0 -1
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/chunk-QQBDHPVZ-nYh9QWsm.js +0 -1
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/components-BX1OfYUi.js +0 -243
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/formatter-L2YTDE3Q-Bu6KfEwW.js +0 -1
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/iframe-B4pfFtvJ.css +0 -1
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/iframe-LMhZM1ce.js +0 -1154
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/jsx-runtime-f3rHp9ZU.js +0 -1
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/matchers-JIUQ3HVY-9iRExWZO.js +0 -28
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/preload-helper-BdFrVu1K.js +0 -1
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/react-DvDPBd6Q.js +0 -1
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/favicon-wrapper.svg +0 -46
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/favicon.svg +0 -1
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/iframe.html +0 -710
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/index.html +0 -152
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/index.json +0 -1
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/logo_novo_azul.png +0 -0
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/nunito-sans-bold-italic.woff2 +0 -0
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/nunito-sans-bold.woff2 +0 -0
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/nunito-sans-italic.woff2 +0 -0
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/nunito-sans-regular.woff2 +0 -0
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-addons/a11y-2/manager-bundle.js +0 -57
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-addons/docs-1/manager-bundle.js +0 -18
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +0 -632
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-common-assets/favicon-wrapper.svg +0 -46
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-common-assets/favicon.svg +0 -1
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-manager/globals-runtime.js +0 -78957
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-manager/globals.js +0 -24
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-manager/manager-stores.js +0 -23
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-manager/runtime.js +0 -28253
- package/templates/.zaip-aios/design/apps/catalog/dist/storybook/vite-inject-mocker-entry.js +0 -2
- package/templates/.zaip-aios/design/apps/catalog/index.html +0 -13
- package/templates/.zaip-aios/design/apps/catalog/package.json +0 -32
- package/templates/.zaip-aios/design/apps/catalog/public/logo_novo_azul.png +0 -0
- package/templates/.zaip-aios/design/apps/catalog/src/App.tsx +0 -29
- package/templates/.zaip-aios/design/apps/catalog/src/components/CatalogShell.tsx +0 -78
- package/templates/.zaip-aios/design/apps/catalog/src/components/Primitives.tsx +0 -137
- package/templates/.zaip-aios/design/apps/catalog/src/design-contract.test.ts +0 -33
- package/templates/.zaip-aios/design/apps/catalog/src/pages/ComponentsPage.tsx +0 -83
- package/templates/.zaip-aios/design/apps/catalog/src/pages/DesignSystemPage.tsx +0 -185
- package/templates/.zaip-aios/design/apps/catalog/src/stories/Components.stories.tsx +0 -12
- package/templates/.zaip-aios/design/apps/catalog/src/stories/DesignSystem.stories.tsx +0 -12
- package/templates/.zaip-aios/design/apps/catalog/src/styles/catalog.css +0 -315
- package/templates/.zaip-aios/design/apps/catalog/src/styles/components.css +0 -228
- package/templates/.zaip-aios/design/apps/catalog/src/styles/design-system.css +0 -137
- package/templates/.zaip-aios/design/apps/catalog/src/styles.css +0 -85
- package/templates/.zaip-aios/design/apps/catalog/vite.config.ts +0 -10
- package/templates/.zaip-aios/design/packages/local-runtime/package.json +0 -9
- package/templates/.zaip-aios/design/packages/local-runtime/runtime.mjs +0 -238
- package/templates/.zaip-aios/design/packages/local-runtime/runtime.test.mjs +0 -66
- package/templates/.zaip-aios/design/packages/local-runtime/start-design.mjs +0 -46
- package/templates/.zaip-aios/design/packages/windows-launcher/Program.cs +0 -110
- package/templates/.zaip-aios/design/packages/windows-launcher/build-design-launcher.ps1 +0 -107
- package/templates/.zaip-aios/design/tokens.json +0 -52
- package/templates/.zaip-aios/design/zaip-design.exe +0 -0
- package/templates/.zaip-aios/manifest.json +0 -377
- package/templates/.zaip-aios/profiles/clients.json +0 -506
- package/templates/.zaip-aios/profiles/fixtures/architecture/negative/modules/orders/application/queries/list.query.ts +0 -5
- package/templates/.zaip-aios/profiles/fixtures/architecture/negative/modules/orders/domain/order.ts +0 -3
- package/templates/.zaip-aios/profiles/fixtures/architecture/positive/modules/orders/application/queries/list.query.ts +0 -5
- package/templates/.zaip-aios/profiles/typescript-hono-kysely.json +0 -41
- package/templates/.zaip-aios/templates/config/agents/catalog.yaml +0 -246
- package/templates/.zaip-aios/templates/requirements/.gitkeep +0 -0
- package/templates/.zaip-aios/templates/requirements/autonomous-assurance.md +0 -63
- package/templates/.zaip-aios/templates/requirements/context-engine.md +0 -44
- package/templates/.zaip-aios/templates/requirements/cost-observability.md +0 -39
- package/templates/.zaip-aios/templates/requirements/design-system.md +0 -48
- package/templates/.zaip-aios/templates/requirements/execution-engine.md +0 -60
- package/templates/.zaip-aios/templates/requirements/kanban-dashboard.md +0 -30
- package/templates/.zaip-aios/templates/requirements/model-orchestration.md +0 -58
- package/templates/.zaip-aios/templates/requirements/public-distribution.md +0 -40
- package/templates/.zaip-aios/templates/requirements/software-architecture.md +0 -57
- package/templates/.zaip-aios/templates/requirements/work-lifecycle.md +0 -82
- package/templates/.zaip-aios/templates/rules/project/.gitkeep +0 -0
- package/templates/.zaip-aios/templates/rules/zaip/architecture.md +0 -28
- package/templates/.zaip-aios/templates/rules/zaip/core.md +0 -24
- package/templates/.zaip-aios/templates/rules/zaip/evolution.md +0 -22
- package/templates/.zaip-aios/templates/rules/zaip/workflow.md +0 -35
- package/templates/.zaip-aios/templates/skills/.gitkeep +0 -0
- package/templates/.zaip-aios/templates/skills/zaip-aios/SKILL.md +0 -9
- package/templates/.zaip-aios/templates/skills/zaip-skill-adapt-stack/SKILL.md +0 -11
- package/templates/.zaip-aios/templates/skills/zaip-skill-adapt-stack/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-adapters/SKILL.md +0 -15
- package/templates/.zaip-aios/templates/skills/zaip-skill-adapters/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-api-to-mcp/SKILL.md +0 -19
- package/templates/.zaip-aios/templates/skills/zaip-skill-api-to-mcp/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-api-to-mcp/assets/adapter.example.yaml +0 -26
- package/templates/.zaip-aios/templates/skills/zaip-skill-api-to-mcp/references/security-contract.md +0 -10
- package/templates/.zaip-aios/templates/skills/zaip-skill-api-to-mcp/references/server-layout.md +0 -19
- package/templates/.zaip-aios/templates/skills/zaip-skill-api-to-mcp/scripts/inspect-openapi.mjs +0 -60
- package/templates/.zaip-aios/templates/skills/zaip-skill-api-to-mcp/scripts/scaffold-local-mcp.mjs +0 -47
- package/templates/.zaip-aios/templates/skills/zaip-skill-author-skills/SKILL.md +0 -21
- package/templates/.zaip-aios/templates/skills/zaip-skill-author-skills/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-change/SKILL.md +0 -20
- package/templates/.zaip-aios/templates/skills/zaip-skill-change/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-config/SKILL.md +0 -22
- package/templates/.zaip-aios/templates/skills/zaip-skill-config/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-context/SKILL.md +0 -16
- package/templates/.zaip-aios/templates/skills/zaip-skill-context/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-cqrs/SKILL.md +0 -11
- package/templates/.zaip-aios/templates/skills/zaip-skill-cqrs/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-decisions/SKILL.md +0 -14
- package/templates/.zaip-aios/templates/skills/zaip-skill-decisions/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-enforce-architecture/SKILL.md +0 -14
- package/templates/.zaip-aios/templates/skills/zaip-skill-enforce-architecture/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-eval/SKILL.md +0 -14
- package/templates/.zaip-aios/templates/skills/zaip-skill-eval/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-execution/SKILL.md +0 -36
- package/templates/.zaip-aios/templates/skills/zaip-skill-execution/agents/openai.yaml +0 -6
- package/templates/.zaip-aios/templates/skills/zaip-skill-execution/references/prepared-plan.md +0 -31
- package/templates/.zaip-aios/templates/skills/zaip-skill-frontend-launcher/SKILL.md +0 -29
- package/templates/.zaip-aios/templates/skills/zaip-skill-frontend-launcher/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-frontend-launcher/references/launcher-contract.md +0 -36
- package/templates/.zaip-aios/templates/skills/zaip-skill-github-deploy/SKILL.md +0 -75
- package/templates/.zaip-aios/templates/skills/zaip-skill-github-deploy/agents/openai.yaml +0 -6
- package/templates/.zaip-aios/templates/skills/zaip-skill-github-deploy/scripts/preflight.mjs +0 -256
- package/templates/.zaip-aios/templates/skills/zaip-skill-github-setup/SKILL.md +0 -80
- package/templates/.zaip-aios/templates/skills/zaip-skill-github-setup/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-move-prd/SKILL.md +0 -37
- package/templates/.zaip-aios/templates/skills/zaip-skill-move-prd/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-move-spec/SKILL.md +0 -38
- package/templates/.zaip-aios/templates/skills/zaip-skill-move-spec/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-navigate-work/SKILL.md +0 -16
- package/templates/.zaip-aios/templates/skills/zaip-skill-navigate-work/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-observability/SKILL.md +0 -24
- package/templates/.zaip-aios/templates/skills/zaip-skill-observability/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-openai-docs/SKILL.md +0 -17
- package/templates/.zaip-aios/templates/skills/zaip-skill-openai-docs/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-openai-docs/references/routing.md +0 -11
- package/templates/.zaip-aios/templates/skills/zaip-skill-prd/SKILL.md +0 -44
- package/templates/.zaip-aios/templates/skills/zaip-skill-prd/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-preview/SKILL.md +0 -16
- package/templates/.zaip-aios/templates/skills/zaip-skill-preview/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-reconcile-telemetry/SKILL.md +0 -39
- package/templates/.zaip-aios/templates/skills/zaip-skill-reconcile-telemetry/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-reconcile-telemetry/scripts/inspect-local-sqlite.py +0 -52
- package/templates/.zaip-aios/templates/skills/zaip-skill-reconcile-telemetry/scripts/normalize-run-agents.mjs +0 -63
- package/templates/.zaip-aios/templates/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-local-telemetry.mjs +0 -698
- package/templates/.zaip-aios/templates/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-lib.mjs +0 -361
- package/templates/.zaip-aios/templates/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-lib.test.mjs +0 -187
- package/templates/.zaip-aios/templates/skills/zaip-skill-requirements/SKILL.md +0 -16
- package/templates/.zaip-aios/templates/skills/zaip-skill-requirements/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-review/SKILL.md +0 -18
- package/templates/.zaip-aios/templates/skills/zaip-skill-review/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-rules/SKILL.md +0 -19
- package/templates/.zaip-aios/templates/skills/zaip-skill-rules/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-security/SKILL.md +0 -30
- package/templates/.zaip-aios/templates/skills/zaip-skill-security/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-setup/SKILL.md +0 -25
- package/templates/.zaip-aios/templates/skills/zaip-skill-setup/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-spec/SKILL.md +0 -45
- package/templates/.zaip-aios/templates/skills/zaip-skill-spec/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-task/SKILL.md +0 -41
- package/templates/.zaip-aios/templates/skills/zaip-skill-task/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-text-encoding/SKILL.md +0 -27
- package/templates/.zaip-aios/templates/skills/zaip-skill-text-encoding/agents/openai.yaml +0 -6
- package/templates/.zaip-aios/templates/skills/zaip-skill-tool-setup/SKILL.md +0 -22
- package/templates/.zaip-aios/templates/skills/zaip-skill-tool-setup/agents/openai.yaml +0 -4
- package/templates/.zaip-aios/templates/skills/zaip-skill-tool-setup/references/codex-config.md +0 -24
- package/templates/.zaip-aios/templates/skills/zaip-skill-tool-setup/references/secrets.md +0 -8
- package/templates/.zaip-aios/templates/skills/zaip-skill-tool-setup/scripts/configure-local-mcp.mjs +0 -52
- package/templates/.zaip-aios/templates/skills/zaip-skill-tool-setup/scripts/inspect-tool.mjs +0 -35
- package/templates/.zaip-aios/templates/skills/zaip-skill-tool-setup/scripts/tool-state.mjs +0 -26
- package/templates/.zaip-aios/templates/tools/README.md +0 -9
- package/templates/.zaip-aios/templates/tools/api/asaas/README.md +0 -22
- package/templates/.zaip-aios/templates/tools/api/asaas/manifest.yaml +0 -20
- package/templates/.zaip-aios/templates/tools/api/github/README.md +0 -22
- package/templates/.zaip-aios/templates/tools/api/github/manifest.yaml +0 -20
- package/templates/.zaip-aios/templates/tools/api/google-ads/README.md +0 -23
- package/templates/.zaip-aios/templates/tools/api/google-ads/manifest.yaml +0 -21
- package/templates/.zaip-aios/templates/tools/api/google-analytics/README.md +0 -22
- package/templates/.zaip-aios/templates/tools/api/google-analytics/manifest.yaml +0 -20
- package/templates/.zaip-aios/templates/tools/api/google-search-console/README.md +0 -21
- package/templates/.zaip-aios/templates/tools/api/google-search-console/manifest.yaml +0 -19
- package/templates/.zaip-aios/templates/tools/api/google-tag-manager/README.md +0 -22
- package/templates/.zaip-aios/templates/tools/api/google-tag-manager/manifest.yaml +0 -20
- package/templates/.zaip-aios/templates/tools/api/hubspot/README.md +0 -22
- package/templates/.zaip-aios/templates/tools/api/hubspot/manifest.yaml +0 -20
- package/templates/.zaip-aios/templates/tools/api/instagram-graph/README.md +0 -23
- package/templates/.zaip-aios/templates/tools/api/instagram-graph/manifest.yaml +0 -21
- package/templates/.zaip-aios/templates/tools/api/kommo-crm/README.md +0 -23
- package/templates/.zaip-aios/templates/tools/api/kommo-crm/manifest.yaml +0 -21
- package/templates/.zaip-aios/templates/tools/api/linkedin-ads/README.md +0 -23
- package/templates/.zaip-aios/templates/tools/api/linkedin-ads/manifest.yaml +0 -21
- package/templates/.zaip-aios/templates/tools/api/meta-ads/README.md +0 -23
- package/templates/.zaip-aios/templates/tools/api/meta-ads/manifest.yaml +0 -21
- package/templates/.zaip-aios/templates/tools/api/openai/README.md +0 -22
- package/templates/.zaip-aios/templates/tools/api/openai/manifest.yaml +0 -20
- package/templates/.zaip-aios/templates/tools/api/shopify/README.md +0 -23
- package/templates/.zaip-aios/templates/tools/api/shopify/manifest.yaml +0 -21
- package/templates/.zaip-aios/templates/tools/api/slack/README.md +0 -22
- package/templates/.zaip-aios/templates/tools/api/slack/manifest.yaml +0 -20
- package/templates/.zaip-aios/templates/tools/api/stripe/README.md +0 -22
- package/templates/.zaip-aios/templates/tools/api/stripe/manifest.yaml +0 -20
- package/templates/.zaip-aios/templates/tools/api/tiktok-ads/README.md +0 -23
- package/templates/.zaip-aios/templates/tools/api/tiktok-ads/manifest.yaml +0 -21
- package/templates/.zaip-aios/templates/tools/api/youtube-analytics/README.md +0 -22
- package/templates/.zaip-aios/templates/tools/api/youtube-analytics/manifest.yaml +0 -20
- package/templates/.zaip-aios/templates/tools/catalog.yaml +0 -358
- package/templates/.zaip-aios/templates/tools/mcp/development/browser/README.md +0 -20
- package/templates/.zaip-aios/templates/tools/mcp/development/browser/manifest.yaml +0 -24
- package/templates/.zaip-aios/templates/tools/mcp/development/filesystem/README.md +0 -20
- package/templates/.zaip-aios/templates/tools/mcp/development/filesystem/manifest.yaml +0 -24
- package/templates/.zaip-aios/templates/tools/mcp/development/git/README.md +0 -20
- package/templates/.zaip-aios/templates/tools/mcp/development/git/manifest.yaml +0 -24
- package/templates/.zaip-aios/templates/tools/mcp/development/github/README.md +0 -20
- package/templates/.zaip-aios/templates/tools/mcp/development/github/manifest.yaml +0 -25
- package/templates/.zaip-aios/templates/tools/mcp/development/gitlab/README.md +0 -20
- package/templates/.zaip-aios/templates/tools/mcp/development/gitlab/manifest.yaml +0 -25
- package/templates/.zaip-aios/templates/tools/mcp/development/jira/README.md +0 -21
- package/templates/.zaip-aios/templates/tools/mcp/development/jira/manifest.yaml +0 -26
- package/templates/.zaip-aios/templates/tools/mcp/development/linear/README.md +0 -20
- package/templates/.zaip-aios/templates/tools/mcp/development/linear/manifest.yaml +0 -25
- package/templates/.zaip-aios/templates/tools/mcp/development/notion/README.md +0 -20
- package/templates/.zaip-aios/templates/tools/mcp/development/notion/manifest.yaml +0 -25
- package/templates/.zaip-aios/templates/tools/mcp/development/openai-docs/README.md +0 -15
- package/templates/.zaip-aios/templates/tools/mcp/development/openai-docs/manifest.yaml +0 -21
- package/templates/.zaip-aios/templates/tools/mcp/development/postgresql/README.md +0 -20
- package/templates/.zaip-aios/templates/tools/mcp/development/postgresql/manifest.yaml +0 -25
- package/templates/.zaip-aios/templates/tools/mcp/development/slack/README.md +0 -20
- package/templates/.zaip-aios/templates/tools/mcp/development/slack/manifest.yaml +0 -25
- package/templates/.zaip-aios/templates/tools/mcp/development/sqlite/README.md +0 -20
- package/templates/.zaip-aios/templates/tools/mcp/development/sqlite/manifest.yaml +0 -25
- package/templates/.zaip-aios/templates/tools/mcp/infra/aws/README.md +0 -21
- package/templates/.zaip-aios/templates/tools/mcp/infra/aws/manifest.yaml +0 -26
- package/templates/.zaip-aios/templates/tools/mcp/infra/azure/README.md +0 -20
- package/templates/.zaip-aios/templates/tools/mcp/infra/azure/manifest.yaml +0 -25
- package/templates/.zaip-aios/templates/tools/mcp/infra/cloudflare/README.md +0 -21
- package/templates/.zaip-aios/templates/tools/mcp/infra/cloudflare/manifest.yaml +0 -26
- package/templates/.zaip-aios/templates/tools/mcp/infra/docker/README.md +0 -20
- package/templates/.zaip-aios/templates/tools/mcp/infra/docker/manifest.yaml +0 -24
- package/templates/.zaip-aios/templates/tools/mcp/infra/gcp/README.md +0 -21
- package/templates/.zaip-aios/templates/tools/mcp/infra/gcp/manifest.yaml +0 -26
- package/templates/.zaip-aios/templates/tools/mcp/infra/hostinger/README.md +0 -20
- package/templates/.zaip-aios/templates/tools/mcp/infra/hostinger/manifest.yaml +0 -25
- package/templates/.zaip-aios/templates/tools/mcp/infra/kubernetes/README.md +0 -20
- package/templates/.zaip-aios/templates/tools/mcp/infra/kubernetes/manifest.yaml +0 -25
- package/templates/.zaip-aios/templates/tools/mcp/infra/terraform/README.md +0 -20
- package/templates/.zaip-aios/templates/tools/mcp/infra/terraform/manifest.yaml +0 -24
- package/templates/.zaip-aios/templates/tools/mcp/marketing/google-ads/README.md +0 -21
- package/templates/.zaip-aios/templates/tools/mcp/marketing/google-ads/manifest.yaml +0 -26
- package/templates/.zaip-aios/templates/tools/mcp/marketing/google-analytics/README.md +0 -20
- package/templates/.zaip-aios/templates/tools/mcp/marketing/google-analytics/manifest.yaml +0 -25
- package/templates/.zaip-aios/templates/tools/mcp/marketing/google-search-console/README.md +0 -19
- package/templates/.zaip-aios/templates/tools/mcp/marketing/google-search-console/manifest.yaml +0 -24
- package/templates/.zaip-aios/templates/tools/mcp/marketing/google-tag-manager/README.md +0 -21
- package/templates/.zaip-aios/templates/tools/mcp/marketing/google-tag-manager/manifest.yaml +0 -26
- package/templates/.zaip-aios/templates/tools/mcp/marketing/hubspot/README.md +0 -20
- package/templates/.zaip-aios/templates/tools/mcp/marketing/hubspot/manifest.yaml +0 -25
- package/templates/.zaip-aios/templates/tools/mcp/marketing/instagram-insights/README.md +0 -21
- package/templates/.zaip-aios/templates/tools/mcp/marketing/instagram-insights/manifest.yaml +0 -26
- package/templates/.zaip-aios/templates/tools/mcp/marketing/linkedin-ads/README.md +0 -21
- package/templates/.zaip-aios/templates/tools/mcp/marketing/linkedin-ads/manifest.yaml +0 -26
- package/templates/.zaip-aios/templates/tools/mcp/marketing/mailchimp/README.md +0 -21
- package/templates/.zaip-aios/templates/tools/mcp/marketing/mailchimp/manifest.yaml +0 -26
- package/templates/.zaip-aios/templates/tools/mcp/marketing/meta-ads/README.md +0 -21
- package/templates/.zaip-aios/templates/tools/mcp/marketing/meta-ads/manifest.yaml +0 -26
- package/templates/.zaip-aios/templates/tools/mcp/marketing/semrush/README.md +0 -20
- package/templates/.zaip-aios/templates/tools/mcp/marketing/semrush/manifest.yaml +0 -25
- package/templates/.zaip-aios/templates/tools/mcp/marketing/tiktok-ads/README.md +0 -21
- package/templates/.zaip-aios/templates/tools/mcp/marketing/tiktok-ads/manifest.yaml +0 -26
- package/templates/.zaip-aios/templates/tools/mcp/marketing/youtube-analytics/README.md +0 -21
- package/templates/.zaip-aios/templates/tools/mcp/marketing/youtube-analytics/manifest.yaml +0 -26
- package/templates/.zaip-aios/templates/tools/mcp/observability/cloudwatch/README.md +0 -21
- package/templates/.zaip-aios/templates/tools/mcp/observability/cloudwatch/manifest.yaml +0 -26
- package/templates/.zaip-aios/templates/tools/mcp/observability/datadog/README.md +0 -21
- package/templates/.zaip-aios/templates/tools/mcp/observability/datadog/manifest.yaml +0 -26
- package/templates/.zaip-aios/templates/tools/mcp/observability/elasticsearch/README.md +0 -21
- package/templates/.zaip-aios/templates/tools/mcp/observability/elasticsearch/manifest.yaml +0 -26
- package/templates/.zaip-aios/templates/tools/mcp/observability/grafana/README.md +0 -21
- package/templates/.zaip-aios/templates/tools/mcp/observability/grafana/manifest.yaml +0 -26
- package/templates/.zaip-aios/templates/tools/mcp/observability/kibana/README.md +0 -21
- package/templates/.zaip-aios/templates/tools/mcp/observability/kibana/manifest.yaml +0 -26
- package/templates/.zaip-aios/templates/tools/mcp/observability/loki/README.md +0 -19
- package/templates/.zaip-aios/templates/tools/mcp/observability/loki/manifest.yaml +0 -24
- package/templates/.zaip-aios/templates/tools/mcp/observability/new-relic/README.md +0 -21
- package/templates/.zaip-aios/templates/tools/mcp/observability/new-relic/manifest.yaml +0 -26
- package/templates/.zaip-aios/templates/tools/mcp/observability/opentelemetry/README.md +0 -20
- package/templates/.zaip-aios/templates/tools/mcp/observability/opentelemetry/manifest.yaml +0 -25
- package/templates/.zaip-aios/templates/tools/mcp/observability/prometheus/README.md +0 -19
- package/templates/.zaip-aios/templates/tools/mcp/observability/prometheus/manifest.yaml +0 -24
- package/templates/.zaip-aios/templates/tools/mcp/observability/sentry/README.md +0 -21
- package/templates/.zaip-aios/templates/tools/mcp/observability/sentry/manifest.yaml +0 -26
- package/templates/.zaip-aios/templates/tools/policies/approval-rules.yaml +0 -8
- package/templates/.zaip-aios/templates/tools/policies/financial-limits.yaml +0 -6
- package/templates/.zaip-aios/templates/tools/policies/permissions.yaml +0 -8
- package/templates/.zaip-aios/templates/tools/policies/secret-handling.md +0 -7
- package/templates/.zaip-aios/templates/tools/profiles/business.yaml +0 -8
- package/templates/.zaip-aios/templates/tools/profiles/default.yaml +0 -8
- package/templates/.zaip-aios/templates/tools/profiles/development.yaml +0 -13
- package/templates/.zaip-aios/templates/tools/profiles/infrastructure.yaml +0 -8
- package/templates/.zaip-aios/templates/tools/profiles/marketing.yaml +0 -9
- package/templates/.zaip-aios/templates/tools/profiles/observability.yaml +0 -8
- package/templates/.zaip-aios/templates/tools/runtime/README.md +0 -3
- package/templates/.zaip-aios/templates/tools/runtime/api-mcp-runtime.mjs +0 -217
- package/templates/.zaip-aios/templates/tools/runtime/api-mcp-runtime.test.mjs +0 -56
- package/templates/.zaip-aios/templates/tools/runtime/fixtures/definition.json +0 -17
- package/templates/.zaip-aios/templates/tools/runtime/runner.mjs +0 -16
- package/templates/.zaip-aios/templates/tools/runtime/stdio.test.mjs +0 -32
- package/templates/.zaip-aios/templates/tools/state.example.yaml +0 -8
- package/templates/.zaip-aios/templates/zaip-aios/INDEX.md +0 -26
- package/templates/.zaip-aios/templates/zaip-aios/README.md +0 -13
- package/templates/.zaip-aios/templates/zaip-aios/VERSION +0 -1
- package/templates/.zaip-aios/templates/zaip-aios/guides/01-primeiros-passos.md +0 -10
- package/templates/.zaip-aios/templates/zaip-aios/guides/02-requirements.md +0 -12
- package/templates/.zaip-aios/templates/zaip-aios/guides/03-tasks.md +0 -12
- package/templates/.zaip-aios/templates/zaip-aios/guides/04-specs.md +0 -16
- package/templates/.zaip-aios/templates/zaip-aios/guides/05-prds.md +0 -13
- package/templates/.zaip-aios/templates/zaip-aios/guides/06-execucao.md +0 -13
- package/templates/.zaip-aios/templates/zaip-aios/guides/07-revisao-e-validacao.md +0 -8
- package/templates/.zaip-aios/templates/zaip-aios/guides/08-contexto-e-tokens.md +0 -10
- package/templates/.zaip-aios/templates/zaip-aios/guides/09-agentes-e-squads.md +0 -8
- package/templates/.zaip-aios/templates/zaip-aios/guides/10-seguranca.md +0 -206
- package/templates/.zaip-aios/templates/zaip-aios/guides/11-observabilidade-e-custos.md +0 -10
- package/templates/.zaip-aios/templates/zaip-aios/guides/12-instalacao-e-upgrade.md +0 -10
- package/templates/.zaip-aios/templates/zaip-aios/guides/13-boas-praticas.md +0 -12
- package/templates/.zaip-aios/templates/zaip-aios/guides/14-troubleshooting.md +0 -12
- package/templates/.zaip-aios/templates/zaip-aios/guides/15-tools-e-codex.md +0 -25
- package/templates/.zaip-aios/templates/zaip-aios/guides/16-lifecycle-e-reconciliacao.md +0 -47
- /package/templates/{.zaip-aios → .agents/config}/pricing/fx/2026/07/12/usd-brl.json +0 -0
- /package/templates/{.zaip-aios/dashboard/apps/frontend/dist → .agents/dashboard/apps/frontend/public}/icon_zaip.png +0 -0
- /package/templates/{.zaip-aios/dashboard/apps/frontend/dist → .agents/dashboard/apps/frontend/public}/logo_novo_azul.png +0 -0
- /package/templates/{.zaip-aios → .agents/runtime}/LICENSE +0 -0
- /package/templates/{.zaip-aios → .agents/runtime}/THIRD_PARTY_NOTICES.md +0 -0
- /package/templates/{.zaip-aios → .agents/runtime}/VERSION +0 -0
- /package/templates/{.zaip-aios → .agents/runtime}/migrations/001-layout-v1.json +0 -0
- /package/templates/{.zaip-aios → .agents/runtime}/migrations/002-layout-v2.json +0 -0
- /package/templates/{.zaip-aios → .agents/runtime}/schemas/contracts.schema.json +0 -0
|
@@ -0,0 +1,775 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type OperationsProjection,
|
|
3
|
+
type RunProjection,
|
|
4
|
+
saoPauloPeriodKey,
|
|
5
|
+
} from "@zaip-ai/dashboard-operations/contracts";
|
|
6
|
+
import {
|
|
7
|
+
EntityDetailsDialog,
|
|
8
|
+
ExcelExportAction,
|
|
9
|
+
ExecutionTable,
|
|
10
|
+
} from "@zaip-ai/dashboard-operations/react";
|
|
11
|
+
import { DashboardHeader } from "@zaip-ai/dashboard-ui";
|
|
12
|
+
import { type ReactNode, useEffect, useMemo, useState } from "react";
|
|
13
|
+
import { includeConfiguredAgentGroups } from "../agent-groups.js";
|
|
14
|
+
import {
|
|
15
|
+
aggregateDurationCoverage,
|
|
16
|
+
type CostGroupRow,
|
|
17
|
+
type CostMonitorProjection,
|
|
18
|
+
type CostRunRow,
|
|
19
|
+
sumKnown,
|
|
20
|
+
} from "../contracts.js";
|
|
21
|
+
import { normalizeCostProvider } from "../provider.js";
|
|
22
|
+
import { aggregateTaskCostRows } from "../task-cost-groups.js";
|
|
23
|
+
import { CostCharts } from "./CostCharts.js";
|
|
24
|
+
import {
|
|
25
|
+
type CostFilterState,
|
|
26
|
+
CostFilters,
|
|
27
|
+
type CostPeriod,
|
|
28
|
+
defaultCostPeriod,
|
|
29
|
+
emptyCostFilters,
|
|
30
|
+
loadCostMonitorPeriod,
|
|
31
|
+
useCostMonitorPeriod,
|
|
32
|
+
} from "./CostFilters.js";
|
|
33
|
+
import { ChevronDownIcon, ListFilterIcon, LocaleFlag, SettingsIcon } from "./CostMonitorIcons.js";
|
|
34
|
+
import { CostPeriodAverageCards } from "./CostPeriodAverageCards.js";
|
|
35
|
+
import { CostSummary } from "./CostSummary.js";
|
|
36
|
+
import { CostGroupsTable, CostModelsAuditTable, CostRunsTable } from "./CostTables.js";
|
|
37
|
+
import { durationContributors } from "./cost-duration.js";
|
|
38
|
+
import {
|
|
39
|
+
type CostCurrency,
|
|
40
|
+
type CostLocale,
|
|
41
|
+
costCopy,
|
|
42
|
+
localeCurrency,
|
|
43
|
+
} from "./cost-monitor-copy.js";
|
|
44
|
+
import { applyLegacyPeriodGroups, summarizeCostRows } from "./cost-monitor-summary.js";
|
|
45
|
+
import { MacroCostTable } from "./MacroCostTable.js";
|
|
46
|
+
import { enrichPeriodCostGroups } from "./period-cost-groups.js";
|
|
47
|
+
import "./cost-monitor.css";
|
|
48
|
+
import "./cost-monitor-responsive.css";
|
|
49
|
+
import "./cost-run-origin.css";
|
|
50
|
+
import "./cost-monitor-embedded.css";
|
|
51
|
+
|
|
52
|
+
const zaipLogoUrl = new URL("../../../../../config/src/logo_novo_azul.png", import.meta.url).href;
|
|
53
|
+
|
|
54
|
+
export type CostView =
|
|
55
|
+
| "overview"
|
|
56
|
+
| "agentCalls"
|
|
57
|
+
| "executions"
|
|
58
|
+
| "conversations"
|
|
59
|
+
| "tasks"
|
|
60
|
+
| "prds"
|
|
61
|
+
| "specs"
|
|
62
|
+
| "providers"
|
|
63
|
+
| "agents"
|
|
64
|
+
| "models"
|
|
65
|
+
| "daily"
|
|
66
|
+
| "monthly"
|
|
67
|
+
| "annual";
|
|
68
|
+
export const DEFAULT_COST_VIEW: CostView = "daily";
|
|
69
|
+
export const COST_VIEW_ORDER: readonly CostView[] = [
|
|
70
|
+
"overview",
|
|
71
|
+
"executions",
|
|
72
|
+
"agentCalls",
|
|
73
|
+
"agents",
|
|
74
|
+
"models",
|
|
75
|
+
"providers",
|
|
76
|
+
"tasks",
|
|
77
|
+
"specs",
|
|
78
|
+
"prds",
|
|
79
|
+
"conversations",
|
|
80
|
+
"daily",
|
|
81
|
+
"monthly",
|
|
82
|
+
"annual",
|
|
83
|
+
];
|
|
84
|
+
type AgentCallKind = "all" | "run" | "subrun";
|
|
85
|
+
export function findRunDetails<T extends { id: string }>(
|
|
86
|
+
runs: readonly T[],
|
|
87
|
+
runId: string,
|
|
88
|
+
): T | null {
|
|
89
|
+
return runs.find((run) => run.id === runId) ?? null;
|
|
90
|
+
}
|
|
91
|
+
export function CostMonitorPage({
|
|
92
|
+
capabilityNavigation,
|
|
93
|
+
data,
|
|
94
|
+
dashboardTitle = "Dashboard Zaip AIOS",
|
|
95
|
+
embedded = false,
|
|
96
|
+
globalFilters,
|
|
97
|
+
lastUpdatedAt,
|
|
98
|
+
locale,
|
|
99
|
+
loading,
|
|
100
|
+
onLocaleChange,
|
|
101
|
+
onOpenTrace,
|
|
102
|
+
onActiveDataChange,
|
|
103
|
+
onRefresh,
|
|
104
|
+
loadPeriod = loadCostMonitorPeriod,
|
|
105
|
+
operations,
|
|
106
|
+
repositoryName,
|
|
107
|
+
currency: controlledCurrency,
|
|
108
|
+
onCurrencyChange,
|
|
109
|
+
}: {
|
|
110
|
+
capabilityNavigation?: ReactNode;
|
|
111
|
+
data: CostMonitorProjection;
|
|
112
|
+
dashboardTitle?: string;
|
|
113
|
+
embedded?: boolean;
|
|
114
|
+
globalFilters?: {
|
|
115
|
+
query: string;
|
|
116
|
+
datePreset: string;
|
|
117
|
+
dateRange?: { start: string; end: string };
|
|
118
|
+
};
|
|
119
|
+
lastUpdatedAt: string | null;
|
|
120
|
+
locale: CostLocale;
|
|
121
|
+
loading: boolean;
|
|
122
|
+
onLocaleChange: (locale: CostLocale) => void;
|
|
123
|
+
onOpenTrace: (taskId: string) => void;
|
|
124
|
+
onActiveDataChange?: (data: CostMonitorProjection) => void;
|
|
125
|
+
onRefresh: () => void;
|
|
126
|
+
loadPeriod?: typeof loadCostMonitorPeriod;
|
|
127
|
+
operations?: Pick<OperationsProjection, "runs" | "specs" | "tasks" | "executions">;
|
|
128
|
+
repositoryName?: string;
|
|
129
|
+
currency?: CostCurrency;
|
|
130
|
+
onCurrencyChange?: (currency: CostCurrency) => void;
|
|
131
|
+
}) {
|
|
132
|
+
const [view, setView] = useState<CostView>(DEFAULT_COST_VIEW);
|
|
133
|
+
const [agentCallKind, setAgentCallKind] = useState<AgentCallKind>("all");
|
|
134
|
+
const [filters, setFilters] = useState<CostFilterState>(emptyCostFilters);
|
|
135
|
+
const [localCurrency, setLocalCurrency] = useState<CostCurrency>("BRL");
|
|
136
|
+
const currency = controlledCurrency ?? localCurrency;
|
|
137
|
+
const setCurrency = (next: CostCurrency) => {
|
|
138
|
+
setLocalCurrency(next);
|
|
139
|
+
onCurrencyChange?.(next);
|
|
140
|
+
};
|
|
141
|
+
const [period, setPeriod] = useState<CostPeriod>(defaultCostPeriod);
|
|
142
|
+
const [filtersOpen, setFiltersOpen] = useState(false);
|
|
143
|
+
const [localeOpen, setLocaleOpen] = useState(false);
|
|
144
|
+
const [settingsOpen, setSettingsOpen] = useState(false);
|
|
145
|
+
const [selectedRun, setSelectedRun] = useState<RunProjection | null>(null);
|
|
146
|
+
const text = costCopy[locale];
|
|
147
|
+
const { activeData, periodError, periodLoading } = useCostMonitorPeriod({
|
|
148
|
+
currency,
|
|
149
|
+
data,
|
|
150
|
+
...(globalFilters === undefined ? {} : { dateRange: globalFilters.dateRange }),
|
|
151
|
+
filters,
|
|
152
|
+
lastUpdatedAt,
|
|
153
|
+
loadPeriod,
|
|
154
|
+
period,
|
|
155
|
+
snapshotBacked: embedded,
|
|
156
|
+
});
|
|
157
|
+
const hasLocalCostFilters = Object.values(filters).some((value) => value !== "");
|
|
158
|
+
useEffect(() => {
|
|
159
|
+
if (!hasLocalCostFilters) onActiveDataChange?.(activeData);
|
|
160
|
+
}, [activeData, hasLocalCostFilters, onActiveDataChange]);
|
|
161
|
+
const updatedLabel =
|
|
162
|
+
lastUpdatedAt === null
|
|
163
|
+
? locale === "pt-BR"
|
|
164
|
+
? "Aguardando atualização"
|
|
165
|
+
: "Waiting for refresh"
|
|
166
|
+
: `${locale === "pt-BR" ? "Atualizado" : "Updated"} ${new Intl.DateTimeFormat(locale, { dateStyle: "short", timeStyle: "medium" }).format(new Date(lastUpdatedAt))}`;
|
|
167
|
+
const rows = useMemo(() => {
|
|
168
|
+
return activeData.runs
|
|
169
|
+
.filter((row) => matches(row, filters) && matchesGlobalFilters(row, globalFilters))
|
|
170
|
+
.sort((left, right) => right.started_at.localeCompare(left.started_at));
|
|
171
|
+
}, [activeData.runs, filters, globalFilters]);
|
|
172
|
+
const macroDetails = useMemo(() => {
|
|
173
|
+
if (operations === undefined) return undefined;
|
|
174
|
+
const visibleRunIds = new Set(rows.map((row) => row.run_id));
|
|
175
|
+
return {
|
|
176
|
+
...operations,
|
|
177
|
+
runs: operations.runs.filter((run) => visibleRunIds.has(run.id)),
|
|
178
|
+
};
|
|
179
|
+
}, [operations, rows]);
|
|
180
|
+
const visiblePrds = useMemo(
|
|
181
|
+
() => activeData.prds.filter((prd) => matchesPeriodEntity(prd, globalFilters)),
|
|
182
|
+
[activeData.prds, globalFilters],
|
|
183
|
+
);
|
|
184
|
+
const visibleSpecs = useMemo(
|
|
185
|
+
() => activeData.specs.filter((spec) => matchesPeriodEntity(spec, globalFilters)),
|
|
186
|
+
[activeData.specs, globalFilters],
|
|
187
|
+
);
|
|
188
|
+
const groups = useMemo(() => {
|
|
189
|
+
const legacy =
|
|
190
|
+
!hasLocalCostFilters &&
|
|
191
|
+
(globalFilters === undefined ||
|
|
192
|
+
(globalFilters.query === "" && globalFilters.datePreset === "all"))
|
|
193
|
+
? (activeData.legacy_effort_baseline ?? null)
|
|
194
|
+
: null;
|
|
195
|
+
const periodEntities = {
|
|
196
|
+
prds: activeData.prds.filter((prd) => matchesPeriodEntity(prd, globalFilters)),
|
|
197
|
+
specs: activeData.specs.filter((spec) => matchesPeriodEntity(spec, globalFilters)),
|
|
198
|
+
tasks: (operations?.tasks ?? []).filter((task) => matchesPeriodEntity(task, globalFilters)),
|
|
199
|
+
};
|
|
200
|
+
return {
|
|
201
|
+
conversations: groupRows(
|
|
202
|
+
rows.filter((row) => row.phase === "conversation"),
|
|
203
|
+
(row) => row.conversation_id ?? row.task_title ?? row.run_id,
|
|
204
|
+
undefined,
|
|
205
|
+
"all_invocations",
|
|
206
|
+
),
|
|
207
|
+
tasks: aggregateTaskCostRows(periodEntities.tasks, rows),
|
|
208
|
+
providers: groupRows(
|
|
209
|
+
rows,
|
|
210
|
+
(row) => normalizeCostProvider(row.provider),
|
|
211
|
+
undefined,
|
|
212
|
+
"all_invocations",
|
|
213
|
+
),
|
|
214
|
+
agents: includeConfiguredAgentGroups(
|
|
215
|
+
groupRows(rows, (row) => row.agent_name),
|
|
216
|
+
activeData.configured_agents,
|
|
217
|
+
),
|
|
218
|
+
models: groupRows(rows, (row) => row.model),
|
|
219
|
+
daily: applyLegacyPeriodGroups(
|
|
220
|
+
enrichPeriodCostGroups(
|
|
221
|
+
groupRows(
|
|
222
|
+
rows,
|
|
223
|
+
(row) => saoPauloPeriodKey(row.started_at, "day") ?? row.started_at.slice(0, 10),
|
|
224
|
+
),
|
|
225
|
+
periodEntities,
|
|
226
|
+
"daily",
|
|
227
|
+
),
|
|
228
|
+
rows,
|
|
229
|
+
"day",
|
|
230
|
+
legacy,
|
|
231
|
+
),
|
|
232
|
+
monthly: applyLegacyPeriodGroups(
|
|
233
|
+
enrichPeriodCostGroups(
|
|
234
|
+
groupRows(
|
|
235
|
+
rows,
|
|
236
|
+
(row) => saoPauloPeriodKey(row.started_at, "month") ?? row.started_at.slice(0, 7),
|
|
237
|
+
),
|
|
238
|
+
periodEntities,
|
|
239
|
+
"monthly",
|
|
240
|
+
),
|
|
241
|
+
rows,
|
|
242
|
+
"month",
|
|
243
|
+
legacy,
|
|
244
|
+
),
|
|
245
|
+
annual: applyLegacyPeriodGroups(
|
|
246
|
+
enrichPeriodCostGroups(
|
|
247
|
+
groupRows(
|
|
248
|
+
rows,
|
|
249
|
+
(row) => saoPauloPeriodKey(row.started_at, "year") ?? row.started_at.slice(0, 4),
|
|
250
|
+
),
|
|
251
|
+
periodEntities,
|
|
252
|
+
"annual",
|
|
253
|
+
),
|
|
254
|
+
rows,
|
|
255
|
+
"year",
|
|
256
|
+
legacy,
|
|
257
|
+
),
|
|
258
|
+
};
|
|
259
|
+
}, [
|
|
260
|
+
activeData.configured_agents,
|
|
261
|
+
activeData.prds,
|
|
262
|
+
activeData.specs,
|
|
263
|
+
globalFilters,
|
|
264
|
+
operations?.tasks,
|
|
265
|
+
rows,
|
|
266
|
+
hasLocalCostFilters,
|
|
267
|
+
activeData.legacy_effort_baseline,
|
|
268
|
+
]);
|
|
269
|
+
const overview = summarizeCostRows(rows, activeData.overview);
|
|
270
|
+
const exportRows = useMemo(() => {
|
|
271
|
+
if (view === "executions") return operations?.executions ?? [];
|
|
272
|
+
if (view === "conversations") return groups.conversations;
|
|
273
|
+
if (view === "tasks") return groups.tasks;
|
|
274
|
+
if (view === "prds") return visiblePrds;
|
|
275
|
+
if (view === "specs") return visibleSpecs;
|
|
276
|
+
if (view === "providers" || view === "agents") return groups[view];
|
|
277
|
+
if (view === "daily" || view === "monthly" || view === "annual") return groups[view];
|
|
278
|
+
return view === "agentCalls" && agentCallKind !== "all"
|
|
279
|
+
? rows.filter((row) => row.run_kind === agentCallKind)
|
|
280
|
+
: rows;
|
|
281
|
+
}, [agentCallKind, groups, operations?.executions, rows, view, visiblePrds, visibleSpecs]);
|
|
282
|
+
const changeLocale = (next: CostLocale) => {
|
|
283
|
+
onLocaleChange(next);
|
|
284
|
+
setCurrency(localeCurrency(next));
|
|
285
|
+
};
|
|
286
|
+
const openRunDetails = (runId: string) => {
|
|
287
|
+
const run = findRunDetails(operations?.runs ?? [], runId);
|
|
288
|
+
if (run) setSelectedRun(run);
|
|
289
|
+
};
|
|
290
|
+
const Root = embedded ? "section" : "main";
|
|
291
|
+
return (
|
|
292
|
+
<Root className={embedded ? "cost-page cost-page-embedded" : "cost-page"}>
|
|
293
|
+
{embedded ? null : (
|
|
294
|
+
<DashboardHeader
|
|
295
|
+
filters={
|
|
296
|
+
<CostFilters
|
|
297
|
+
available={data.filters_available}
|
|
298
|
+
hideQuery={embedded}
|
|
299
|
+
locale={locale}
|
|
300
|
+
onChange={setFilters}
|
|
301
|
+
value={filters}
|
|
302
|
+
/>
|
|
303
|
+
}
|
|
304
|
+
filtersActive={Object.values(filters).some(Boolean)}
|
|
305
|
+
lastUpdatedAt={lastUpdatedAt}
|
|
306
|
+
loading={loading || periodLoading}
|
|
307
|
+
locale={locale}
|
|
308
|
+
onLocaleChange={changeLocale}
|
|
309
|
+
onRefresh={onRefresh}
|
|
310
|
+
settings={
|
|
311
|
+
<label>
|
|
312
|
+
<span>{text.currency}</span>
|
|
313
|
+
<select
|
|
314
|
+
onChange={(event) => setCurrency(event.target.value as CostCurrency)}
|
|
315
|
+
value={currency}
|
|
316
|
+
>
|
|
317
|
+
<option value="BRL">BRL · R$</option>
|
|
318
|
+
<option value="USD">USD · $</option>
|
|
319
|
+
</select>
|
|
320
|
+
</label>
|
|
321
|
+
}
|
|
322
|
+
{...(repositoryName === undefined ? {} : { repositoryName })}
|
|
323
|
+
title={dashboardTitle}
|
|
324
|
+
/>
|
|
325
|
+
)}
|
|
326
|
+
{periodError ? (
|
|
327
|
+
<p className="cost-period-error" role="status">
|
|
328
|
+
{locale === "pt-BR"
|
|
329
|
+
? `Não foi possível carregar o período selecionado: ${periodError}`
|
|
330
|
+
: `Could not load the selected period: ${periodError}`}
|
|
331
|
+
</p>
|
|
332
|
+
) : null}
|
|
333
|
+
{embedded ? null : (
|
|
334
|
+
<>
|
|
335
|
+
<nav aria-label="Navegação do Cost Monitor" className="cost-monitor-nav">
|
|
336
|
+
<div className="cost-monitor-brand">
|
|
337
|
+
<strong className="cost-monitor-title">{text.title}</strong>
|
|
338
|
+
<small className="cost-last-updated">{updatedLabel}</small>
|
|
339
|
+
</div>
|
|
340
|
+
<img alt="ZAIP" className="cost-monitor-logo" src={zaipLogoUrl} />
|
|
341
|
+
<div className="cost-nav-actions">
|
|
342
|
+
<button
|
|
343
|
+
aria-label={text.refresh}
|
|
344
|
+
className="cost-nav-icon cost-refresh-action"
|
|
345
|
+
disabled={loading}
|
|
346
|
+
onClick={onRefresh}
|
|
347
|
+
type="button"
|
|
348
|
+
>
|
|
349
|
+
↻
|
|
350
|
+
</button>
|
|
351
|
+
<div className="cost-nav-popup-anchor cost-filter-action">
|
|
352
|
+
<button
|
|
353
|
+
className={filtersOpen ? "cost-nav-button is-active" : "cost-nav-button"}
|
|
354
|
+
onClick={() => {
|
|
355
|
+
setFiltersOpen((open) => !open);
|
|
356
|
+
setLocaleOpen(false);
|
|
357
|
+
setSettingsOpen(false);
|
|
358
|
+
}}
|
|
359
|
+
type="button"
|
|
360
|
+
>
|
|
361
|
+
<ListFilterIcon /> {text.filters}
|
|
362
|
+
</button>
|
|
363
|
+
{filtersOpen ? (
|
|
364
|
+
<div className="cost-nav-popup cost-nav-filter-popup">
|
|
365
|
+
<CostFilters
|
|
366
|
+
available={data.filters_available}
|
|
367
|
+
hideQuery={embedded}
|
|
368
|
+
locale={locale}
|
|
369
|
+
onChange={setFilters}
|
|
370
|
+
value={filters}
|
|
371
|
+
/>
|
|
372
|
+
</div>
|
|
373
|
+
) : null}
|
|
374
|
+
</div>
|
|
375
|
+
<div className="cost-nav-popup-anchor cost-locale-action">
|
|
376
|
+
<button
|
|
377
|
+
className={localeOpen ? "cost-nav-button is-active" : "cost-nav-button"}
|
|
378
|
+
onClick={() => {
|
|
379
|
+
setLocaleOpen((open) => !open);
|
|
380
|
+
setFiltersOpen(false);
|
|
381
|
+
setSettingsOpen(false);
|
|
382
|
+
}}
|
|
383
|
+
type="button"
|
|
384
|
+
>
|
|
385
|
+
<LocaleFlag locale={locale} />
|
|
386
|
+
{locale === "pt-BR" ? "PT-BR" : "EN-US"}
|
|
387
|
+
<ChevronDownIcon />
|
|
388
|
+
</button>
|
|
389
|
+
{localeOpen ? (
|
|
390
|
+
<div className="cost-nav-popup cost-nav-locale-popup">
|
|
391
|
+
<button onClick={() => changeLocale("pt-BR")} type="button">
|
|
392
|
+
<LocaleFlag locale="pt-BR" /> Português do Brasil{" "}
|
|
393
|
+
{locale === "pt-BR" ? "✓" : ""}
|
|
394
|
+
</button>
|
|
395
|
+
<button onClick={() => changeLocale("en-US")} type="button">
|
|
396
|
+
<LocaleFlag locale="en-US" /> English {locale === "en-US" ? "✓" : ""}
|
|
397
|
+
</button>
|
|
398
|
+
</div>
|
|
399
|
+
) : null}
|
|
400
|
+
</div>
|
|
401
|
+
<div className="cost-nav-popup-anchor cost-settings-action">
|
|
402
|
+
<button
|
|
403
|
+
aria-label={text.settings}
|
|
404
|
+
className={settingsOpen ? "cost-nav-icon is-active" : "cost-nav-icon"}
|
|
405
|
+
onClick={() => {
|
|
406
|
+
setSettingsOpen((open) => !open);
|
|
407
|
+
setFiltersOpen(false);
|
|
408
|
+
setLocaleOpen(false);
|
|
409
|
+
}}
|
|
410
|
+
type="button"
|
|
411
|
+
>
|
|
412
|
+
<SettingsIcon />
|
|
413
|
+
</button>
|
|
414
|
+
{settingsOpen ? (
|
|
415
|
+
<div className="cost-nav-popup cost-nav-settings-popup">
|
|
416
|
+
<div className="cost-mobile-settings">
|
|
417
|
+
<small className="cost-mobile-updated">{updatedLabel}</small>
|
|
418
|
+
<button disabled={loading} onClick={onRefresh} type="button">
|
|
419
|
+
↻{" "}
|
|
420
|
+
{loading
|
|
421
|
+
? locale === "pt-BR"
|
|
422
|
+
? "Atualizando…"
|
|
423
|
+
: "Refreshing…"
|
|
424
|
+
: text.refresh}
|
|
425
|
+
</button>
|
|
426
|
+
<label>
|
|
427
|
+
<span>{locale === "pt-BR" ? "Idioma" : "Language"}</span>
|
|
428
|
+
<select
|
|
429
|
+
onChange={(event) => changeLocale(event.target.value as CostLocale)}
|
|
430
|
+
value={locale}
|
|
431
|
+
>
|
|
432
|
+
<option value="pt-BR">Português do Brasil</option>
|
|
433
|
+
<option value="en-US">English</option>
|
|
434
|
+
</select>
|
|
435
|
+
</label>
|
|
436
|
+
<div className="cost-mobile-filters">
|
|
437
|
+
<strong>{text.filters}</strong>
|
|
438
|
+
<CostFilters
|
|
439
|
+
available={data.filters_available}
|
|
440
|
+
hideQuery={embedded}
|
|
441
|
+
locale={locale}
|
|
442
|
+
onChange={setFilters}
|
|
443
|
+
value={filters}
|
|
444
|
+
/>
|
|
445
|
+
</div>
|
|
446
|
+
</div>
|
|
447
|
+
<label>
|
|
448
|
+
<span>{text.currency}</span>
|
|
449
|
+
<select
|
|
450
|
+
onChange={(event) => setCurrency(event.target.value as CostCurrency)}
|
|
451
|
+
value={currency}
|
|
452
|
+
>
|
|
453
|
+
<option value="BRL">BRL · R$</option>
|
|
454
|
+
<option value="USD">USD · $</option>
|
|
455
|
+
</select>
|
|
456
|
+
</label>
|
|
457
|
+
</div>
|
|
458
|
+
) : null}
|
|
459
|
+
</div>
|
|
460
|
+
</div>
|
|
461
|
+
</nav>
|
|
462
|
+
<header className="cost-hero">
|
|
463
|
+
<p className="cost-hero-description">{text.subtitle}</p>
|
|
464
|
+
<label className="cost-period">
|
|
465
|
+
<span>{text.period}</span>
|
|
466
|
+
<select
|
|
467
|
+
onChange={(event) => setPeriod(event.target.value as CostPeriod)}
|
|
468
|
+
value={period}
|
|
469
|
+
>
|
|
470
|
+
<option value="all">{text.allTime}</option>
|
|
471
|
+
<option value="7">{text.last7}</option>
|
|
472
|
+
<option value="30">{text.last30}</option>
|
|
473
|
+
<option value="90">{text.last90}</option>
|
|
474
|
+
<option value="month">{text.thisMonth}</option>
|
|
475
|
+
</select>
|
|
476
|
+
</label>
|
|
477
|
+
</header>
|
|
478
|
+
</>
|
|
479
|
+
)}
|
|
480
|
+
{embedded ? null : (
|
|
481
|
+
<>
|
|
482
|
+
<CostSummary currency={currency} locale={locale} overview={overview} />
|
|
483
|
+
<div className="cost-coverage-note">
|
|
484
|
+
<span>.agents/records/lifecycle + telemetry manifests</span>
|
|
485
|
+
<strong>
|
|
486
|
+
{overview.coverage.tokens}/{overview.coverage.events} eventos com tokens ·{" "}
|
|
487
|
+
{overview.coverage.brl}/{overview.coverage.events} com custo
|
|
488
|
+
</strong>
|
|
489
|
+
</div>
|
|
490
|
+
{capabilityNavigation}
|
|
491
|
+
</>
|
|
492
|
+
)}
|
|
493
|
+
<nav aria-label="Visões de custo" className="cost-tabs">
|
|
494
|
+
{COST_VIEW_ORDER.map((key) => (
|
|
495
|
+
<button
|
|
496
|
+
className={view === key ? "is-active" : undefined}
|
|
497
|
+
key={key}
|
|
498
|
+
onClick={() => setView(key)}
|
|
499
|
+
type="button"
|
|
500
|
+
>
|
|
501
|
+
{text.tabs[key]}
|
|
502
|
+
</button>
|
|
503
|
+
))}
|
|
504
|
+
<ExcelExportAction
|
|
505
|
+
filters={{ ...filters, ...globalFilters, period, agentCallKind }}
|
|
506
|
+
rows={exportRows as unknown as readonly Record<string, unknown>[]}
|
|
507
|
+
view={`cost-${view}`}
|
|
508
|
+
/>
|
|
509
|
+
</nav>
|
|
510
|
+
<section
|
|
511
|
+
className={`cost-content cost-content-${view} ${view === "overview" ? "cost-content-overview" : ""}`}
|
|
512
|
+
>
|
|
513
|
+
{view === "overview" ? (
|
|
514
|
+
<CostCharts
|
|
515
|
+
currency={currency}
|
|
516
|
+
daily={groups.daily}
|
|
517
|
+
locale={locale}
|
|
518
|
+
models={groups.models}
|
|
519
|
+
rows={rows}
|
|
520
|
+
/>
|
|
521
|
+
) : null}
|
|
522
|
+
{view === "agentCalls" ? (
|
|
523
|
+
<>
|
|
524
|
+
<nav
|
|
525
|
+
aria-label={locale === "pt-BR" ? "Tipo de chamada de agente" : "Agent call type"}
|
|
526
|
+
className="cost-run-kind-toolbar"
|
|
527
|
+
>
|
|
528
|
+
{(["all", "run", "subrun"] as const).map((kind) => (
|
|
529
|
+
<button
|
|
530
|
+
aria-pressed={agentCallKind === kind}
|
|
531
|
+
className={agentCallKind === kind ? "is-active" : undefined}
|
|
532
|
+
key={kind}
|
|
533
|
+
onClick={() => setAgentCallKind(kind)}
|
|
534
|
+
type="button"
|
|
535
|
+
>
|
|
536
|
+
{kind === "all"
|
|
537
|
+
? locale === "pt-BR"
|
|
538
|
+
? "Todos"
|
|
539
|
+
: "All"
|
|
540
|
+
: kind === "run"
|
|
541
|
+
? locale === "pt-BR"
|
|
542
|
+
? "Invocações do orquestrador"
|
|
543
|
+
: "Orchestrator invocations"
|
|
544
|
+
: locale === "pt-BR"
|
|
545
|
+
? "Invocações delegadas"
|
|
546
|
+
: "Delegated invocations"}
|
|
547
|
+
</button>
|
|
548
|
+
))}
|
|
549
|
+
</nav>
|
|
550
|
+
<CostRunsTable
|
|
551
|
+
currency={currency}
|
|
552
|
+
locale={locale}
|
|
553
|
+
onOpenRun={openRunDetails}
|
|
554
|
+
rows={
|
|
555
|
+
agentCallKind === "all"
|
|
556
|
+
? rows
|
|
557
|
+
: rows.filter((row) => row.run_kind === agentCallKind)
|
|
558
|
+
}
|
|
559
|
+
/>
|
|
560
|
+
</>
|
|
561
|
+
) : null}
|
|
562
|
+
{view === "executions" ? (
|
|
563
|
+
<ExecutionTable locale={locale} rows={operations?.executions ?? []} />
|
|
564
|
+
) : null}
|
|
565
|
+
{view === "conversations" ? (
|
|
566
|
+
<CostGroupsTable
|
|
567
|
+
currency={currency}
|
|
568
|
+
labelHeading={locale === "pt-BR" ? "Conversa" : "Conversation"}
|
|
569
|
+
locale={locale}
|
|
570
|
+
rows={groups.conversations}
|
|
571
|
+
/>
|
|
572
|
+
) : null}
|
|
573
|
+
{view === "tasks" ? (
|
|
574
|
+
<CostGroupsTable
|
|
575
|
+
currency={currency}
|
|
576
|
+
dateHeading={locale === "pt-BR" ? "Criada em" : "Created at"}
|
|
577
|
+
labelHeading={locale === "pt-BR" ? "Tarefa" : "Task"}
|
|
578
|
+
locale={locale}
|
|
579
|
+
onOpenTrace={onOpenTrace}
|
|
580
|
+
rows={groups.tasks}
|
|
581
|
+
/>
|
|
582
|
+
) : null}
|
|
583
|
+
{view === "prds" ? (
|
|
584
|
+
<MacroCostTable
|
|
585
|
+
currency={currency}
|
|
586
|
+
locale={locale}
|
|
587
|
+
onOpenTrace={onOpenTrace}
|
|
588
|
+
rows={visiblePrds}
|
|
589
|
+
{...(macroDetails ? { details: macroDetails } : {})}
|
|
590
|
+
/>
|
|
591
|
+
) : null}
|
|
592
|
+
{view === "specs" ? (
|
|
593
|
+
<MacroCostTable
|
|
594
|
+
currency={currency}
|
|
595
|
+
locale={locale}
|
|
596
|
+
onOpenTrace={onOpenTrace}
|
|
597
|
+
rows={visibleSpecs}
|
|
598
|
+
{...(macroDetails ? { details: macroDetails } : {})}
|
|
599
|
+
/>
|
|
600
|
+
) : null}
|
|
601
|
+
{view === "models" ? <CostModelsAuditTable locale={locale} rows={rows} /> : null}
|
|
602
|
+
{(["providers", "agents"] as const).map((key) =>
|
|
603
|
+
view === key ? (
|
|
604
|
+
<CostGroupsTable
|
|
605
|
+
currency={currency}
|
|
606
|
+
key={key}
|
|
607
|
+
labelHeading={
|
|
608
|
+
key === "agents"
|
|
609
|
+
? locale === "pt-BR"
|
|
610
|
+
? "Zaip Agentes"
|
|
611
|
+
: "ZAIP agents"
|
|
612
|
+
: locale === "pt-BR"
|
|
613
|
+
? "Provedor"
|
|
614
|
+
: "Providers"
|
|
615
|
+
}
|
|
616
|
+
locale={locale}
|
|
617
|
+
rows={groups[key]}
|
|
618
|
+
/>
|
|
619
|
+
) : null,
|
|
620
|
+
)}
|
|
621
|
+
{view === "daily" || view === "monthly" || view === "annual" ? (
|
|
622
|
+
<>
|
|
623
|
+
<CostPeriodAverageCards
|
|
624
|
+
currency={currency}
|
|
625
|
+
locale={locale}
|
|
626
|
+
period={view}
|
|
627
|
+
rows={groups[view]}
|
|
628
|
+
/>
|
|
629
|
+
<CostGroupsTable
|
|
630
|
+
currency={currency}
|
|
631
|
+
locale={locale}
|
|
632
|
+
period={view}
|
|
633
|
+
rows={groups[view]}
|
|
634
|
+
showDateTime={false}
|
|
635
|
+
/>
|
|
636
|
+
</>
|
|
637
|
+
) : null}
|
|
638
|
+
</section>
|
|
639
|
+
{selectedRun ? (
|
|
640
|
+
<EntityDetailsDialog
|
|
641
|
+
details={{ kind: "run", row: selectedRun }}
|
|
642
|
+
locale={locale}
|
|
643
|
+
onClose={() => setSelectedRun(null)}
|
|
644
|
+
/>
|
|
645
|
+
) : null}
|
|
646
|
+
</Root>
|
|
647
|
+
);
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
function matches(row: CostRunRow, filter: CostFilterState): boolean {
|
|
651
|
+
const query = filter.query.trim().toLowerCase();
|
|
652
|
+
return (
|
|
653
|
+
(!query ||
|
|
654
|
+
[row.run_id, row.task_title, row.model, row.requested_model, row.agent, row.agent_name].some(
|
|
655
|
+
(value) => value.toLowerCase().includes(query),
|
|
656
|
+
)) &&
|
|
657
|
+
(!filter.provider || normalizeCostProvider(row.provider) === filter.provider) &&
|
|
658
|
+
(!filter.agent || row.agent_name === filter.agent) &&
|
|
659
|
+
(!filter.model || row.model === filter.model) &&
|
|
660
|
+
(!filter.status || row.task_status === filter.status) &&
|
|
661
|
+
(!filter.priority || row.priority === filter.priority) &&
|
|
662
|
+
(!filter.risk || row.risk === filter.risk) &&
|
|
663
|
+
(!filter.phase || row.phase === filter.phase) &&
|
|
664
|
+
(!filter.origin || row.origin === filter.origin) &&
|
|
665
|
+
(!filter.workType || row.work_type === filter.workType)
|
|
666
|
+
);
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
export function matchesGlobalFilters(
|
|
670
|
+
row: CostRunRow,
|
|
671
|
+
filters: { query: string; dateRange?: { start: string; end: string } } | undefined,
|
|
672
|
+
): boolean {
|
|
673
|
+
if (!filters) return true;
|
|
674
|
+
const query = filters.query.trim().toLocaleLowerCase();
|
|
675
|
+
if (filters.dateRange === undefined) {
|
|
676
|
+
return (
|
|
677
|
+
!query ||
|
|
678
|
+
[
|
|
679
|
+
row.run_id,
|
|
680
|
+
row.task_id,
|
|
681
|
+
row.task_title,
|
|
682
|
+
row.provider,
|
|
683
|
+
row.agent,
|
|
684
|
+
row.agent_name,
|
|
685
|
+
row.model,
|
|
686
|
+
row.requested_model,
|
|
687
|
+
row.phase,
|
|
688
|
+
].some((value) => value?.toLocaleLowerCase().includes(query))
|
|
689
|
+
);
|
|
690
|
+
}
|
|
691
|
+
const startedDate = saoPauloPeriodKey(row.started_at, "day") ?? row.started_at.slice(0, 10);
|
|
692
|
+
return (
|
|
693
|
+
startedDate >= filters.dateRange.start &&
|
|
694
|
+
startedDate <= filters.dateRange.end &&
|
|
695
|
+
(!query ||
|
|
696
|
+
[
|
|
697
|
+
row.run_id,
|
|
698
|
+
row.task_id,
|
|
699
|
+
row.task_title,
|
|
700
|
+
row.provider,
|
|
701
|
+
row.agent,
|
|
702
|
+
row.agent_name,
|
|
703
|
+
row.model,
|
|
704
|
+
row.requested_model,
|
|
705
|
+
row.phase,
|
|
706
|
+
].some((value) => value?.toLocaleLowerCase().includes(query)))
|
|
707
|
+
);
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
export function groupRows(
|
|
711
|
+
rows: readonly CostRunRow[],
|
|
712
|
+
select: (row: CostRunRow) => string,
|
|
713
|
+
label: (row: CostRunRow) => string = select,
|
|
714
|
+
durationScope: "root_execution" | "all_execution" | "all_invocations" = "all_invocations",
|
|
715
|
+
): CostGroupRow[] {
|
|
716
|
+
const contributors = durationContributors(rows, durationScope);
|
|
717
|
+
const groups = new Map<string, CostRunRow[]>();
|
|
718
|
+
for (const row of rows) groups.set(select(row), [...(groups.get(select(row)) ?? []), row]);
|
|
719
|
+
return [...groups]
|
|
720
|
+
.map(([key, items]) => ({
|
|
721
|
+
...(() => {
|
|
722
|
+
const duration = aggregateDurationCoverage(
|
|
723
|
+
contributors.filter((candidate) => items.includes(candidate)),
|
|
724
|
+
durationScope === "all_execution" ? "all_execution" : "all_invocations",
|
|
725
|
+
);
|
|
726
|
+
return { duration_ms: duration.complete ? duration.known_sum : null, duration };
|
|
727
|
+
})(),
|
|
728
|
+
key,
|
|
729
|
+
label: label(items[0] as CostRunRow),
|
|
730
|
+
latest_started_at: items.reduce(
|
|
731
|
+
(latest, row) => (row.started_at > latest ? row.started_at : latest),
|
|
732
|
+
items[0]?.started_at ?? "",
|
|
733
|
+
),
|
|
734
|
+
run_count: items.length,
|
|
735
|
+
task_count: new Set(items.flatMap((row) => (row.task_id ? [row.task_id] : []))).size,
|
|
736
|
+
tasksActive: new Set(items.flatMap((row) => (row.task_id ? [row.task_id] : []))).size,
|
|
737
|
+
taskDaysActive: new Set(items.flatMap((row) => (row.task_id ? [row.task_id] : []))).size,
|
|
738
|
+
prd_count: 0,
|
|
739
|
+
spec_count: 0,
|
|
740
|
+
evidence_count: 0,
|
|
741
|
+
test_count: 0,
|
|
742
|
+
event_count: items.reduce((sum, row) => sum + row.event_count, 0),
|
|
743
|
+
total_tokens: sumKnown(items.map((row) => row.total_tokens)),
|
|
744
|
+
estimated_usd: sumKnown(items.map((row) => row.estimated_usd)),
|
|
745
|
+
estimated_brl: sumKnown(items.map((row) => row.estimated_brl)),
|
|
746
|
+
coverage: items.reduce(
|
|
747
|
+
(sum, row) => ({
|
|
748
|
+
events: sum.events + row.coverage.events,
|
|
749
|
+
tokens: sum.tokens + row.coverage.tokens,
|
|
750
|
+
usd: sum.usd + row.coverage.usd,
|
|
751
|
+
brl: sum.brl + row.coverage.brl,
|
|
752
|
+
}),
|
|
753
|
+
{ events: 0, tokens: 0, usd: 0, brl: 0 },
|
|
754
|
+
),
|
|
755
|
+
}))
|
|
756
|
+
.sort((a, b) => b.latest_started_at.localeCompare(a.latest_started_at));
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
export function matchesPeriodEntity(
|
|
760
|
+
entity: { id?: string; title?: string; created_at: string | null },
|
|
761
|
+
filters: { query: string; dateRange?: { start: string; end: string } } | undefined,
|
|
762
|
+
): boolean {
|
|
763
|
+
if (filters === undefined) return true;
|
|
764
|
+
const query = filters.query.trim().toLowerCase();
|
|
765
|
+
if (
|
|
766
|
+
query &&
|
|
767
|
+
![entity.id ?? "", entity.title ?? ""].some((value) => value.toLowerCase().includes(query))
|
|
768
|
+
) {
|
|
769
|
+
return false;
|
|
770
|
+
}
|
|
771
|
+
if (filters.dateRange === undefined) return true;
|
|
772
|
+
if (entity.created_at === null) return false;
|
|
773
|
+
const date = saoPauloPeriodKey(entity.created_at, "day") ?? entity.created_at.slice(0, 10);
|
|
774
|
+
return date >= filters.dateRange.start && date <= filters.dateRange.end;
|
|
775
|
+
}
|