@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,799 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { createHash, randomBytes } from "node:crypto";
|
|
3
|
+
import { readFile } from "node:fs/promises";
|
|
4
|
+
import { resolve } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { promisify } from "node:util";
|
|
7
|
+
import { serve } from "@hono/node-server";
|
|
8
|
+
import { serveStatic } from "@hono/node-server/serve-static";
|
|
9
|
+
import { loadWorkspaceLayout, WorkspaceFileSystem, type WorkspaceLayout } from "@zaip-ai/core";
|
|
10
|
+
import { fxRateSchema, PricingRepository, pricingCatalogSchema } from "@zaip-ai/costs";
|
|
11
|
+
import { buildCostMonitorProjection } from "@zaip-ai/dashboard-cost-monitor/server";
|
|
12
|
+
import {
|
|
13
|
+
buildOperationsProjection,
|
|
14
|
+
projectExecutionDurations,
|
|
15
|
+
readPrdDetail,
|
|
16
|
+
readSpecDetail,
|
|
17
|
+
readTaskDetail,
|
|
18
|
+
recalculateOperationsRunSummary,
|
|
19
|
+
} from "@zaip-ai/dashboard-operations/server";
|
|
20
|
+
import { buildTaskTrace } from "@zaip-ai/dashboard-traceability/server";
|
|
21
|
+
import { type Context, Hono } from "hono";
|
|
22
|
+
import { getCookie, setCookie } from "hono/cookie";
|
|
23
|
+
import type { ContentfulStatusCode } from "hono/utils/http-status";
|
|
24
|
+
import {
|
|
25
|
+
type AgentAdapterSyncResult,
|
|
26
|
+
AgentCatalogUpdateError,
|
|
27
|
+
persistAgentCatalogUpdate,
|
|
28
|
+
readAgentCatalogSettings,
|
|
29
|
+
} from "./agent-catalog-settings.js";
|
|
30
|
+
import { mergeManifestRuns } from "./manifest-runs.js";
|
|
31
|
+
import { persistProjectSettings, readProjectSettings } from "./project-settings.js";
|
|
32
|
+
import {
|
|
33
|
+
configuredAgentNames,
|
|
34
|
+
invocationSummariesForPeriod,
|
|
35
|
+
queryValues,
|
|
36
|
+
selectedCurrency,
|
|
37
|
+
} from "./server-summary-helpers.js";
|
|
38
|
+
|
|
39
|
+
export { manifestRun, mergeManifestRuns } from "./manifest-runs.js";
|
|
40
|
+
|
|
41
|
+
const API_PREFIX = "/api/v2";
|
|
42
|
+
const HOST = "127.0.0.1";
|
|
43
|
+
const RUNTIME_KIND = "zaip-dashboard-local-runtime";
|
|
44
|
+
const SESSION_COOKIE = "zaip-dashboard-session";
|
|
45
|
+
const DASHBOARD_CONFIG_PATH = ".agents/dashboard/dashboard.config.json";
|
|
46
|
+
const execFileAsync = promisify(execFile);
|
|
47
|
+
const agentPortraitFiles: Record<string, string> = {
|
|
48
|
+
"agent-orchestrator": "1 - Dave - Product Owner.png",
|
|
49
|
+
"agent-builder": "2 - Rafa - Tech Lead.png",
|
|
50
|
+
"agent-task-executor": "3 - Leo - Software Engineer.png",
|
|
51
|
+
"agent-analyst": "4 - Bia - Product Manager.png",
|
|
52
|
+
"agent-finalizer": "5 - Gui - Quality Assurance Lead.png",
|
|
53
|
+
"agent-reviewer": "6 - Nanda - Principal Engineer.png",
|
|
54
|
+
"agent-integrator": "7 - Dani - Integration Engineer.png",
|
|
55
|
+
"agent-auditor": "8 - Ana - Quality Auditor.png",
|
|
56
|
+
"agent-text-summarizer": "9 - Lia - Technical Writer.png",
|
|
57
|
+
"agent-data-analyst": "10 - Gabi - Data Analyst.png",
|
|
58
|
+
"agent-refactoring-specialist": "11 - Tati - Refactoring Specialist.png",
|
|
59
|
+
"agent-frontend": "12 - Doug - Frontend Developer.png",
|
|
60
|
+
"agent-backend": "13 - Will - Backend Developer.png",
|
|
61
|
+
"agent-website-developer": "14 - Jonny - Website Developer.png",
|
|
62
|
+
"agent-designer": "15 - Manu - Product Designer.png",
|
|
63
|
+
"agent-cloud-engineer": "16 - Dan - Cloud Engineer.png",
|
|
64
|
+
"agent-security-auditor": "17 - Luis - Security Auditor.png",
|
|
65
|
+
"agent-marketing-analyst": "18 - Lucia - Marketing Analyst.png",
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
interface ActiveWorkItem {
|
|
69
|
+
kind: string;
|
|
70
|
+
id: string;
|
|
71
|
+
status: string | null;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Pure lifecycle helper retained for callers; it never reads a runtime projection. */
|
|
75
|
+
export function openWorkIds(items: readonly ActiveWorkItem[]): string[] {
|
|
76
|
+
const kinds = new Set(["prd", "spec", "change", "task", "execution"]);
|
|
77
|
+
const statuses = new Set(["active", "executing", "verifying", "running", "paused"]);
|
|
78
|
+
return items
|
|
79
|
+
.filter(
|
|
80
|
+
(item) =>
|
|
81
|
+
kinds.has(item.kind) &&
|
|
82
|
+
(statuses.has(item.status ?? "") || (item.kind === "task" && item.status === "planned")),
|
|
83
|
+
)
|
|
84
|
+
.map((item) => item.id)
|
|
85
|
+
.sort();
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
interface DashboardAppOptions {
|
|
89
|
+
syncAgentAdapters?: () => Promise<AgentAdapterSyncResult>;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
class V2WorkspaceRequiredError extends Error {
|
|
93
|
+
override readonly name = "V2WorkspaceRequiredError";
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function isAllowedOrigin(origin: string): boolean {
|
|
97
|
+
try {
|
|
98
|
+
const parsed = new URL(origin);
|
|
99
|
+
return (
|
|
100
|
+
parsed.protocol === "http:" && (parsed.hostname === HOST || parsed.hostname === "localhost")
|
|
101
|
+
);
|
|
102
|
+
} catch {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function isSafeUiPath(pathname: string): boolean {
|
|
108
|
+
try {
|
|
109
|
+
const decoded = decodeURIComponent(pathname).replaceAll("\\", "/");
|
|
110
|
+
return !decoded.includes("\0") && !decoded.split("/").some((segment) => segment === "..");
|
|
111
|
+
} catch {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function defaultSessionToken(): string {
|
|
117
|
+
return process.env.ZAIP_UI_TOKEN ?? randomBytes(24).toString("base64url");
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function shouldBootstrapBrowserSession(context: Context): boolean {
|
|
121
|
+
if (context.req.method !== "GET" && context.req.method !== "HEAD") return false;
|
|
122
|
+
if (context.req.path !== "/" && context.req.path !== "/index.html") return false;
|
|
123
|
+
|
|
124
|
+
const origin = context.req.header("origin");
|
|
125
|
+
if (origin !== undefined && !isAllowedOrigin(origin)) return false;
|
|
126
|
+
return context.req.header("sec-fetch-site") !== "cross-site";
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
async function dashboardIdentity(
|
|
130
|
+
filesystem: WorkspaceFileSystem,
|
|
131
|
+
workspaceRoot: string,
|
|
132
|
+
): Promise<{ title: string; repository_name: string }> {
|
|
133
|
+
let title = process.env.ZAIP_DASHBOARD_TITLE?.trim() || "Dashboard Zaip AIOS";
|
|
134
|
+
let repositorySetting = "auto";
|
|
135
|
+
try {
|
|
136
|
+
if (await filesystem.exists(DASHBOARD_CONFIG_PATH)) {
|
|
137
|
+
const config = JSON.parse(await filesystem.readText(DASHBOARD_CONFIG_PATH)) as {
|
|
138
|
+
github_repository?: unknown;
|
|
139
|
+
title?: unknown;
|
|
140
|
+
};
|
|
141
|
+
if (typeof config.title === "string" && config.title.trim()) title = config.title.trim();
|
|
142
|
+
if (typeof config.github_repository === "string") {
|
|
143
|
+
repositorySetting = config.github_repository.trim();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
} catch {
|
|
147
|
+
// A configuração visual nunca deve impedir a inicialização do dashboard.
|
|
148
|
+
}
|
|
149
|
+
if (repositorySetting.toLowerCase() !== "auto") {
|
|
150
|
+
return {
|
|
151
|
+
title,
|
|
152
|
+
repository_name: githubRepositoryFromRemote(repositorySetting) ?? "",
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
try {
|
|
156
|
+
const { stdout } = await execFileAsync(
|
|
157
|
+
"git",
|
|
158
|
+
["-C", workspaceRoot, "remote", "get-url", "origin"],
|
|
159
|
+
{ encoding: "utf8", windowsHide: true },
|
|
160
|
+
);
|
|
161
|
+
return { title, repository_name: githubRepositoryFromRemote(stdout) ?? "" };
|
|
162
|
+
} catch {
|
|
163
|
+
// Falha de detecção mantém o badge ausente sem impedir o dashboard.
|
|
164
|
+
}
|
|
165
|
+
return { title, repository_name: "" };
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export function githubRepositoryFromRemote(remote: string): string | null {
|
|
169
|
+
const trimmed = remote.trim();
|
|
170
|
+
const match =
|
|
171
|
+
trimmed.match(/github\.com(?::|\/)([^/\s]+)\/([^/\s]+?)(?:\.git)?$/i) ??
|
|
172
|
+
trimmed.match(/^([^/:\s]+)\/([^/\s]+?)(?:\.git)?$/);
|
|
173
|
+
return match ? `${match[1]}/${match[2]}` : null;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export function dashboardWorkspaceKey(workspaceRoot: string): string {
|
|
177
|
+
return createHash("sha256").update(resolve(workspaceRoot)).digest("hex").slice(0, 16);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export interface ReconciliationItem {
|
|
181
|
+
id: string;
|
|
182
|
+
reason: string | null;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export interface ReconciliationResult {
|
|
186
|
+
reconciled_ids: string[];
|
|
187
|
+
blocked: ReconciliationItem[];
|
|
188
|
+
not_reconciled: ReconciliationItem[];
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
async function reconcileOpenWork(
|
|
192
|
+
filesystem: WorkspaceFileSystem,
|
|
193
|
+
workspaceRoot: string,
|
|
194
|
+
): Promise<ReconciliationResult> {
|
|
195
|
+
if (!(await filesystem.exists(".agents/runtime/bin/zaip.mjs"))) {
|
|
196
|
+
return { reconciled_ids: [], blocked: [], not_reconciled: [] };
|
|
197
|
+
}
|
|
198
|
+
const cliPath = resolve(workspaceRoot, ".agents", "runtime", "bin", "zaip.mjs");
|
|
199
|
+
const { stdout } = await execFileAsync(
|
|
200
|
+
process.execPath,
|
|
201
|
+
[cliPath, "run", "reconcile", "--open", "--json"],
|
|
202
|
+
{ cwd: workspaceRoot, windowsHide: true, timeout: 120_000, maxBuffer: 10 * 1_024 * 1_024 },
|
|
203
|
+
);
|
|
204
|
+
return reconciliationResult(JSON.parse(stdout) as unknown);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export function reconciliationResult(value: unknown): ReconciliationResult {
|
|
208
|
+
const reconciled = new Set<string>();
|
|
209
|
+
const blocked = new Map<string, string | null>();
|
|
210
|
+
const notReconciled = new Map<string, string | null>();
|
|
211
|
+
const remember = (target: Map<string, string | null>, id: unknown, reason: unknown): void => {
|
|
212
|
+
if (typeof id !== "string") return;
|
|
213
|
+
target.set(id, typeof reason === "string" && reason.trim() ? reason : null);
|
|
214
|
+
};
|
|
215
|
+
const records =
|
|
216
|
+
typeof value === "object" && value !== null ? (value as Record<string, unknown>) : {};
|
|
217
|
+
const reconciliations = Array.isArray(records.reconciliations) ? records.reconciliations : [];
|
|
218
|
+
for (const candidate of reconciliations) {
|
|
219
|
+
if (typeof candidate !== "object" || candidate === null) continue;
|
|
220
|
+
const item = candidate as Record<string, unknown>;
|
|
221
|
+
const reason = item.error;
|
|
222
|
+
const entities = ["tasks", "changes", "executions", "specs", "prds"].flatMap((key) =>
|
|
223
|
+
Array.isArray(item[key]) ? item[key] : [],
|
|
224
|
+
);
|
|
225
|
+
for (const entity of entities) {
|
|
226
|
+
if (typeof entity !== "object" || entity === null) continue;
|
|
227
|
+
const record = entity as Record<string, unknown>;
|
|
228
|
+
if (
|
|
229
|
+
item.status === "closed" &&
|
|
230
|
+
record.status === "completed" &&
|
|
231
|
+
typeof record.id === "string"
|
|
232
|
+
) {
|
|
233
|
+
reconciled.add(record.id);
|
|
234
|
+
} else if (record.status === "blocked") {
|
|
235
|
+
remember(blocked, record.id, record.status_reason ?? reason);
|
|
236
|
+
} else if (item.status === "deferred") {
|
|
237
|
+
remember(notReconciled, record.id, reason);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
const orphanedExecutions = Array.isArray(records.orphaned_executions)
|
|
242
|
+
? records.orphaned_executions
|
|
243
|
+
: [];
|
|
244
|
+
orphanedExecutions.forEach((id) => {
|
|
245
|
+
remember(blocked, id, "Execution orphaned after the reconciliation grace period.");
|
|
246
|
+
});
|
|
247
|
+
const errors = Array.isArray(records.reconciliation_errors) ? records.reconciliation_errors : [];
|
|
248
|
+
errors.forEach((candidate) => {
|
|
249
|
+
if (typeof candidate !== "object" || candidate === null) return;
|
|
250
|
+
const item = candidate as Record<string, unknown>;
|
|
251
|
+
remember(notReconciled, item.run_id, item.error);
|
|
252
|
+
});
|
|
253
|
+
const unresolved = Array.isArray(records.unresolved_running_run_ids)
|
|
254
|
+
? records.unresolved_running_run_ids
|
|
255
|
+
: [];
|
|
256
|
+
unresolved.forEach((id) => {
|
|
257
|
+
remember(notReconciled, id, "Invocation is still running.");
|
|
258
|
+
});
|
|
259
|
+
const entries = (items: Map<string, string | null>): ReconciliationItem[] =>
|
|
260
|
+
[...items.entries()]
|
|
261
|
+
.map(([id, reason]) => ({ id, reason }))
|
|
262
|
+
.sort((left, right) => left.id.localeCompare(right.id));
|
|
263
|
+
return {
|
|
264
|
+
reconciled_ids: [...reconciled].sort(),
|
|
265
|
+
blocked: entries(blocked),
|
|
266
|
+
not_reconciled: entries(notReconciled),
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
async function requireV2Layout(filesystem: WorkspaceFileSystem): Promise<WorkspaceLayout> {
|
|
271
|
+
const layout = await loadWorkspaceLayout(filesystem);
|
|
272
|
+
if (layout.version === 1) {
|
|
273
|
+
throw new V2WorkspaceRequiredError("Dashboard API requires a modern ZAIP-AIOS workspace");
|
|
274
|
+
}
|
|
275
|
+
return layout;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
function headOrJson(
|
|
279
|
+
context: Context,
|
|
280
|
+
payload: unknown,
|
|
281
|
+
status: ContentfulStatusCode = 200,
|
|
282
|
+
): Response {
|
|
283
|
+
if (context.req.method === "HEAD") return context.body(null, status);
|
|
284
|
+
return context.json(payload, status);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export function createDashboardApp(
|
|
288
|
+
workspaceRoot = process.env.ZAIP_WORKSPACE ?? process.cwd(),
|
|
289
|
+
sessionToken = defaultSessionToken(),
|
|
290
|
+
uiRoot = resolve(process.env.ZAIP_UI_ROOT ?? "./dist"),
|
|
291
|
+
options: DashboardAppOptions = {},
|
|
292
|
+
): Hono {
|
|
293
|
+
const app = new Hono();
|
|
294
|
+
const filesystem = new WorkspaceFileSystem(workspaceRoot);
|
|
295
|
+
const workspaceKey = dashboardWorkspaceKey(workspaceRoot);
|
|
296
|
+
const syncAgentAdapters = options.syncAgentAdapters ?? (() => runAgentAdapterSync(workspaceRoot));
|
|
297
|
+
let catalogWriteTail = Promise.resolve();
|
|
298
|
+
let snapshotInFlight: Promise<Awaited<ReturnType<typeof dashboardSnapshot>>> | null = null;
|
|
299
|
+
let cachedSnapshot: Awaited<ReturnType<typeof dashboardSnapshot>> | null = null;
|
|
300
|
+
let cachedSnapshotAt = 0;
|
|
301
|
+
let cachedSnapshotKey: string | null = null;
|
|
302
|
+
const readSnapshot = (context: Context) => {
|
|
303
|
+
const key = `${selectedCurrency(context)}:${context.req.query("from") ?? ""}:${context.req.query("to") ?? ""}`;
|
|
304
|
+
if (
|
|
305
|
+
cachedSnapshot !== null &&
|
|
306
|
+
cachedSnapshotKey === key &&
|
|
307
|
+
Date.now() - cachedSnapshotAt < 2_000
|
|
308
|
+
)
|
|
309
|
+
return Promise.resolve(cachedSnapshot);
|
|
310
|
+
if (snapshotInFlight !== null) return snapshotInFlight;
|
|
311
|
+
snapshotInFlight = dashboardSnapshot(filesystem, workspaceRoot, context)
|
|
312
|
+
.then((snapshot) => {
|
|
313
|
+
cachedSnapshot = snapshot;
|
|
314
|
+
cachedSnapshotKey = key;
|
|
315
|
+
cachedSnapshotAt = Date.now();
|
|
316
|
+
return snapshot;
|
|
317
|
+
})
|
|
318
|
+
.finally(() => {
|
|
319
|
+
snapshotInFlight = null;
|
|
320
|
+
});
|
|
321
|
+
return snapshotInFlight;
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
app.use("*", async (context, next) => {
|
|
325
|
+
context.header("Cache-Control", "no-store");
|
|
326
|
+
context.header("X-Content-Type-Options", "nosniff");
|
|
327
|
+
context.header("Referrer-Policy", "no-referrer");
|
|
328
|
+
context.header(
|
|
329
|
+
"Content-Security-Policy",
|
|
330
|
+
"default-src 'self'; script-src 'self'; style-src 'self'; connect-src 'self'; object-src 'none'; frame-ancestors 'none'",
|
|
331
|
+
);
|
|
332
|
+
if (shouldBootstrapBrowserSession(context)) {
|
|
333
|
+
setCookie(context, SESSION_COOKIE, sessionToken, {
|
|
334
|
+
httpOnly: true,
|
|
335
|
+
path: "/",
|
|
336
|
+
sameSite: "Strict",
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
return next();
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
app.use(`${API_PREFIX}/*`, async (context, next) => {
|
|
343
|
+
const settingsWrite =
|
|
344
|
+
context.req.method === "PUT" &&
|
|
345
|
+
(context.req.path === `${API_PREFIX}/pricing` ||
|
|
346
|
+
context.req.path === `${API_PREFIX}/fx-rate` ||
|
|
347
|
+
context.req.path === `${API_PREFIX}/agent-catalog` ||
|
|
348
|
+
context.req.path === `${API_PREFIX}/project-settings`);
|
|
349
|
+
const reconcileWrite =
|
|
350
|
+
context.req.method === "POST" && context.req.path === `${API_PREFIX}/reconcile-open-work`;
|
|
351
|
+
if (
|
|
352
|
+
context.req.method !== "GET" &&
|
|
353
|
+
context.req.method !== "HEAD" &&
|
|
354
|
+
!settingsWrite &&
|
|
355
|
+
!reconcileWrite
|
|
356
|
+
) {
|
|
357
|
+
context.header(
|
|
358
|
+
"Allow",
|
|
359
|
+
context.req.path === `${API_PREFIX}/pricing` ||
|
|
360
|
+
context.req.path === `${API_PREFIX}/fx-rate` ||
|
|
361
|
+
context.req.path === `${API_PREFIX}/agent-catalog` ||
|
|
362
|
+
context.req.path === `${API_PREFIX}/project-settings`
|
|
363
|
+
? "GET, HEAD, PUT"
|
|
364
|
+
: context.req.path === `${API_PREFIX}/reconcile-open-work`
|
|
365
|
+
? "POST"
|
|
366
|
+
: "GET, HEAD",
|
|
367
|
+
);
|
|
368
|
+
return context.json({ error: "Dashboard API is read-only" }, 405);
|
|
369
|
+
}
|
|
370
|
+
if (context.req.path === `${API_PREFIX}/health`) return next();
|
|
371
|
+
|
|
372
|
+
const origin = context.req.header("origin");
|
|
373
|
+
if (origin !== undefined && !isAllowedOrigin(origin)) {
|
|
374
|
+
return context.json({ error: "Origin rejected" }, 403);
|
|
375
|
+
}
|
|
376
|
+
const headerSession = context.req.header("x-zaip-session");
|
|
377
|
+
const cookieSession = getCookie(context, SESSION_COOKIE);
|
|
378
|
+
const portraitToken =
|
|
379
|
+
context.req.method === "GET" &&
|
|
380
|
+
context.req.path.startsWith(`${API_PREFIX}/agent-catalog-assets/`)
|
|
381
|
+
? context.req.query("token")
|
|
382
|
+
: undefined;
|
|
383
|
+
if (
|
|
384
|
+
headerSession !== sessionToken &&
|
|
385
|
+
cookieSession !== sessionToken &&
|
|
386
|
+
portraitToken !== sessionToken
|
|
387
|
+
) {
|
|
388
|
+
return context.json({ error: "Invalid local session" }, 401);
|
|
389
|
+
}
|
|
390
|
+
return next();
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
app.on(["GET", "HEAD"], `${API_PREFIX}/health`, async (context) => {
|
|
394
|
+
try {
|
|
395
|
+
const layout = await requireV2Layout(filesystem);
|
|
396
|
+
return headOrJson(context, {
|
|
397
|
+
kind: RUNTIME_KIND,
|
|
398
|
+
workspaceKey,
|
|
399
|
+
service: "zaip-aios-dashboard",
|
|
400
|
+
status: "ok",
|
|
401
|
+
api_version: 2,
|
|
402
|
+
workspace_layout: layout.version,
|
|
403
|
+
read_only: true,
|
|
404
|
+
});
|
|
405
|
+
} catch (error) {
|
|
406
|
+
return headOrJson(
|
|
407
|
+
context,
|
|
408
|
+
{
|
|
409
|
+
kind: RUNTIME_KIND,
|
|
410
|
+
workspaceKey,
|
|
411
|
+
service: "zaip-aios-dashboard",
|
|
412
|
+
status: "unavailable",
|
|
413
|
+
api_version: 2,
|
|
414
|
+
read_only: true,
|
|
415
|
+
error: error instanceof Error ? error.message : String(error),
|
|
416
|
+
},
|
|
417
|
+
503,
|
|
418
|
+
);
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
app.on(["GET", "HEAD"], `${API_PREFIX}/operations`, async (context) => {
|
|
423
|
+
try {
|
|
424
|
+
const layout = await requireV2Layout(filesystem);
|
|
425
|
+
const { from, to } = projectionPeriodFilter(context);
|
|
426
|
+
const projection = await buildCanonicalOperationsProjection(
|
|
427
|
+
filesystem,
|
|
428
|
+
layout,
|
|
429
|
+
{ from, to },
|
|
430
|
+
context.req.query("scope") === "overview",
|
|
431
|
+
);
|
|
432
|
+
return headOrJson(context, projection);
|
|
433
|
+
} catch (error) {
|
|
434
|
+
if (error instanceof V2WorkspaceRequiredError) throw error;
|
|
435
|
+
return headOrJson(
|
|
436
|
+
context,
|
|
437
|
+
{ error: error instanceof Error ? error.message : String(error) },
|
|
438
|
+
400,
|
|
439
|
+
);
|
|
440
|
+
}
|
|
441
|
+
});
|
|
442
|
+
|
|
443
|
+
app.on(["GET", "HEAD"], `${API_PREFIX}/snapshot`, async (context) => {
|
|
444
|
+
try {
|
|
445
|
+
return headOrJson(context, await readSnapshot(context));
|
|
446
|
+
} catch (error) {
|
|
447
|
+
if (error instanceof V2WorkspaceRequiredError) throw error;
|
|
448
|
+
return headOrJson(
|
|
449
|
+
context,
|
|
450
|
+
{ error: error instanceof Error ? error.message : String(error) },
|
|
451
|
+
400,
|
|
452
|
+
);
|
|
453
|
+
}
|
|
454
|
+
});
|
|
455
|
+
|
|
456
|
+
app.post(`${API_PREFIX}/reconcile-open-work`, async (context) => {
|
|
457
|
+
try {
|
|
458
|
+
await requireV2Layout(filesystem);
|
|
459
|
+
const reconciledIds = await reconcileOpenWork(filesystem, workspaceRoot);
|
|
460
|
+
return context.json({
|
|
461
|
+
...(await dashboardSnapshot(filesystem, workspaceRoot, context)),
|
|
462
|
+
reconciliation: reconciledIds,
|
|
463
|
+
});
|
|
464
|
+
} catch (error) {
|
|
465
|
+
if (error instanceof V2WorkspaceRequiredError) throw error;
|
|
466
|
+
return context.json({ error: error instanceof Error ? error.message : String(error) }, 400);
|
|
467
|
+
}
|
|
468
|
+
});
|
|
469
|
+
|
|
470
|
+
app.on(["GET", "HEAD"], `${API_PREFIX}/cost-monitor`, async (context) => {
|
|
471
|
+
try {
|
|
472
|
+
const layout = await requireV2Layout(filesystem);
|
|
473
|
+
const { from, to } = projectionPeriodFilter(context);
|
|
474
|
+
// Cost and Operations must start from the same manifest-corrected Run
|
|
475
|
+
// population; financial availability is represented on each row, never
|
|
476
|
+
// by dropping lifecycle Runs before the Cost projection.
|
|
477
|
+
const operations = await buildCanonicalOperationsProjection(filesystem, layout, { from, to });
|
|
478
|
+
return headOrJson(
|
|
479
|
+
context,
|
|
480
|
+
await buildManifestFirstCostProjection(filesystem, operations, context),
|
|
481
|
+
);
|
|
482
|
+
} catch (error) {
|
|
483
|
+
if (error instanceof V2WorkspaceRequiredError) throw error;
|
|
484
|
+
return headOrJson(
|
|
485
|
+
context,
|
|
486
|
+
{ error: error instanceof Error ? error.message : String(error) },
|
|
487
|
+
400,
|
|
488
|
+
);
|
|
489
|
+
}
|
|
490
|
+
});
|
|
491
|
+
|
|
492
|
+
app.on(["GET", "HEAD"], `${API_PREFIX}/pricing`, async (context) =>
|
|
493
|
+
headOrJson(
|
|
494
|
+
context,
|
|
495
|
+
pricingCatalogSchema.parse(
|
|
496
|
+
JSON.parse(await filesystem.readText(".agents/config/pricing/models.json")),
|
|
497
|
+
),
|
|
498
|
+
),
|
|
499
|
+
);
|
|
500
|
+
|
|
501
|
+
app.put(`${API_PREFIX}/pricing`, async (context) => {
|
|
502
|
+
const catalog = pricingCatalogSchema.parse({
|
|
503
|
+
...(await context.req.json()),
|
|
504
|
+
updated_at: new Date().toISOString(),
|
|
505
|
+
});
|
|
506
|
+
await filesystem.writeTextAtomic(
|
|
507
|
+
".agents/config/pricing/models.json",
|
|
508
|
+
`${JSON.stringify(catalog, null, 2)}\n`,
|
|
509
|
+
);
|
|
510
|
+
return context.json(catalog);
|
|
511
|
+
});
|
|
512
|
+
|
|
513
|
+
app.on(["GET", "HEAD"], `${API_PREFIX}/fx-rate`, async (context) => {
|
|
514
|
+
const rate = await new PricingRepository(filesystem).readLatestFxRate();
|
|
515
|
+
return headOrJson(context, rate);
|
|
516
|
+
});
|
|
517
|
+
|
|
518
|
+
app.put(`${API_PREFIX}/fx-rate`, async (context) => {
|
|
519
|
+
const input = fxRateSchema.pick({ rate: true }).parse(await context.req.json());
|
|
520
|
+
const rate = await new PricingRepository(filesystem).writeCurrentFxRate(input.rate);
|
|
521
|
+
return context.json(rate);
|
|
522
|
+
});
|
|
523
|
+
|
|
524
|
+
app.on(["GET", "HEAD"], `${API_PREFIX}/agent-catalog`, async (context) => {
|
|
525
|
+
try {
|
|
526
|
+
return headOrJson(context, await readAgentCatalogSettings(filesystem));
|
|
527
|
+
} catch (error) {
|
|
528
|
+
return headOrJson(
|
|
529
|
+
context,
|
|
530
|
+
{ error: error instanceof Error ? error.message : String(error) },
|
|
531
|
+
400,
|
|
532
|
+
);
|
|
533
|
+
}
|
|
534
|
+
});
|
|
535
|
+
|
|
536
|
+
app.get(`${API_PREFIX}/agent-catalog-assets/:agentId`, async (context) => {
|
|
537
|
+
const portrait = agentPortraitFiles[context.req.param("agentId")];
|
|
538
|
+
if (portrait === undefined) return context.json({ error: "Agent portrait not found" }, 404);
|
|
539
|
+
try {
|
|
540
|
+
return context.body(
|
|
541
|
+
await readFile(resolve(workspaceRoot, ".agents/config/src", portrait)),
|
|
542
|
+
200,
|
|
543
|
+
{ "cache-control": "no-store", "content-type": "image/png" },
|
|
544
|
+
);
|
|
545
|
+
} catch (error) {
|
|
546
|
+
if ((error as NodeJS.ErrnoException).code === "ENOENT") {
|
|
547
|
+
return context.json({ error: "Agent portrait not found" }, 404);
|
|
548
|
+
}
|
|
549
|
+
return context.json({ error: "Agent portrait could not be read" }, 500);
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
|
|
553
|
+
app.put(`${API_PREFIX}/agent-catalog`, async (context) => {
|
|
554
|
+
const update = async () => {
|
|
555
|
+
try {
|
|
556
|
+
return context.json(
|
|
557
|
+
await persistAgentCatalogUpdate(filesystem, await context.req.json(), syncAgentAdapters),
|
|
558
|
+
);
|
|
559
|
+
} catch (error) {
|
|
560
|
+
if (error instanceof AgentCatalogUpdateError) {
|
|
561
|
+
return context.json({ error: error.message }, error.status);
|
|
562
|
+
}
|
|
563
|
+
return context.json({ error: "Agent catalog update failed" }, 500);
|
|
564
|
+
}
|
|
565
|
+
};
|
|
566
|
+
const result = catalogWriteTail.then(update, update);
|
|
567
|
+
catalogWriteTail = result.then(
|
|
568
|
+
() => undefined,
|
|
569
|
+
() => undefined,
|
|
570
|
+
);
|
|
571
|
+
return result;
|
|
572
|
+
});
|
|
573
|
+
|
|
574
|
+
app.on(["GET", "HEAD"], `${API_PREFIX}/project-settings`, async (context) => {
|
|
575
|
+
try {
|
|
576
|
+
return headOrJson(context, await readProjectSettings(filesystem));
|
|
577
|
+
} catch (error) {
|
|
578
|
+
return headOrJson(
|
|
579
|
+
context,
|
|
580
|
+
{ error: error instanceof Error ? error.message : String(error) },
|
|
581
|
+
400,
|
|
582
|
+
);
|
|
583
|
+
}
|
|
584
|
+
});
|
|
585
|
+
|
|
586
|
+
app.put(`${API_PREFIX}/project-settings`, async (context) => {
|
|
587
|
+
try {
|
|
588
|
+
return context.json(await persistProjectSettings(filesystem, await context.req.json()));
|
|
589
|
+
} catch (error) {
|
|
590
|
+
return context.json(
|
|
591
|
+
{ error: error instanceof Error ? error.message : "Project settings update failed" },
|
|
592
|
+
400,
|
|
593
|
+
);
|
|
594
|
+
}
|
|
595
|
+
});
|
|
596
|
+
|
|
597
|
+
app.on(["GET", "HEAD"], `${API_PREFIX}/tasks/:id`, async (context) => {
|
|
598
|
+
try {
|
|
599
|
+
const layout = await requireV2Layout(filesystem);
|
|
600
|
+
return headOrJson(context, await readTaskDetail(filesystem, layout, context.req.param("id")));
|
|
601
|
+
} catch (error) {
|
|
602
|
+
if (error instanceof V2WorkspaceRequiredError) throw error;
|
|
603
|
+
return headOrJson(context, { error: "Task not found" }, 404);
|
|
604
|
+
}
|
|
605
|
+
});
|
|
606
|
+
|
|
607
|
+
app.on(["GET", "HEAD"], `${API_PREFIX}/prds/:id`, async (context) => {
|
|
608
|
+
try {
|
|
609
|
+
const layout = await requireV2Layout(filesystem);
|
|
610
|
+
return headOrJson(context, await readPrdDetail(filesystem, layout, context.req.param("id")));
|
|
611
|
+
} catch (error) {
|
|
612
|
+
if (error instanceof V2WorkspaceRequiredError) throw error;
|
|
613
|
+
return headOrJson(context, { error: "PRD not found" }, 404);
|
|
614
|
+
}
|
|
615
|
+
});
|
|
616
|
+
|
|
617
|
+
app.on(["GET", "HEAD"], `${API_PREFIX}/specs/:id`, async (context) => {
|
|
618
|
+
try {
|
|
619
|
+
const layout = await requireV2Layout(filesystem);
|
|
620
|
+
return headOrJson(context, await readSpecDetail(filesystem, layout, context.req.param("id")));
|
|
621
|
+
} catch (error) {
|
|
622
|
+
if (error instanceof V2WorkspaceRequiredError) throw error;
|
|
623
|
+
return headOrJson(context, { error: "SPEC not found" }, 404);
|
|
624
|
+
}
|
|
625
|
+
});
|
|
626
|
+
|
|
627
|
+
app.on(["GET", "HEAD"], `${API_PREFIX}/tasks/:id/trace`, async (context) => {
|
|
628
|
+
try {
|
|
629
|
+
const layout = await requireV2Layout(filesystem);
|
|
630
|
+
return headOrJson(context, await buildTaskTrace(filesystem, layout, context.req.param("id")));
|
|
631
|
+
} catch (error) {
|
|
632
|
+
if (error instanceof V2WorkspaceRequiredError) throw error;
|
|
633
|
+
return headOrJson(context, { error: "Task trace not found" }, 404);
|
|
634
|
+
}
|
|
635
|
+
});
|
|
636
|
+
|
|
637
|
+
app.onError((error, context) => {
|
|
638
|
+
const status = error instanceof V2WorkspaceRequiredError ? 409 : 500;
|
|
639
|
+
return headOrJson(
|
|
640
|
+
context,
|
|
641
|
+
{ error: status === 409 ? error.message : "Dashboard projection failed" },
|
|
642
|
+
status,
|
|
643
|
+
);
|
|
644
|
+
});
|
|
645
|
+
|
|
646
|
+
app.all(`${API_PREFIX}/*`, (context) => headOrJson(context, { error: "Not found" }, 404));
|
|
647
|
+
|
|
648
|
+
app.on(["GET", "HEAD"], "/", serveStatic({ path: `${uiRoot}/index.html` }));
|
|
649
|
+
app.use("/*", async (context, next) => {
|
|
650
|
+
if (!isSafeUiPath(context.req.path)) {
|
|
651
|
+
return context.json({ error: "Invalid dashboard asset path" }, 400);
|
|
652
|
+
}
|
|
653
|
+
return next();
|
|
654
|
+
});
|
|
655
|
+
app.use("/*", serveStatic({ root: uiRoot }));
|
|
656
|
+
app.on(["GET", "HEAD"], "/*", serveStatic({ path: `${uiRoot}/index.html` }));
|
|
657
|
+
return app;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
async function runAgentAdapterSync(workspaceRoot: string): Promise<AgentAdapterSyncResult> {
|
|
661
|
+
const cliPath = resolve(workspaceRoot, ".agents", "runtime", "bin", "zaip.mjs");
|
|
662
|
+
const commandOptions = {
|
|
663
|
+
cwd: workspaceRoot,
|
|
664
|
+
encoding: "utf8" as const,
|
|
665
|
+
windowsHide: true,
|
|
666
|
+
timeout: 120_000,
|
|
667
|
+
maxBuffer: 10 * 1_024 * 1_024,
|
|
668
|
+
};
|
|
669
|
+
await execFileAsync(process.execPath, [cliPath, "adapters", "build", "--json"], commandOptions);
|
|
670
|
+
const { stdout } = await execFileAsync(
|
|
671
|
+
process.execPath,
|
|
672
|
+
[cliPath, "adapters", "check", "--json"],
|
|
673
|
+
commandOptions,
|
|
674
|
+
);
|
|
675
|
+
const result = JSON.parse(stdout) as { valid?: unknown; drifted?: unknown };
|
|
676
|
+
return {
|
|
677
|
+
valid: result.valid === true,
|
|
678
|
+
drifted: Array.isArray(result.drifted)
|
|
679
|
+
? result.drifted.filter((value): value is string => typeof value === "string")
|
|
680
|
+
: [],
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
/** Date-only filters in the dashboard represent complete calendar days. */
|
|
685
|
+
export function projectionPeriodFilter(context: Pick<Context, "req">): {
|
|
686
|
+
from: string | null;
|
|
687
|
+
to: string | null;
|
|
688
|
+
} {
|
|
689
|
+
const from = context.req.query("from") ?? null;
|
|
690
|
+
const to = context.req.query("to") ?? null;
|
|
691
|
+
return {
|
|
692
|
+
from: dateOnlyBoundary(from, "start"),
|
|
693
|
+
to: dateOnlyBoundary(to, "end"),
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
function dateOnlyBoundary(value: string | null, boundary: "start" | "end"): string | null {
|
|
698
|
+
if (value === null || !/^\d{4}-\d{2}-\d{2}$/.test(value)) return value;
|
|
699
|
+
return boundary === "start" ? `${value}T00:00:00.000Z` : `${value}T23:59:59.999Z`;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
async function dashboardSnapshot(
|
|
703
|
+
filesystem: WorkspaceFileSystem,
|
|
704
|
+
workspaceRoot: string,
|
|
705
|
+
context: Context,
|
|
706
|
+
) {
|
|
707
|
+
const layout = await requireV2Layout(filesystem);
|
|
708
|
+
const { from, to } = projectionPeriodFilter(context);
|
|
709
|
+
const operations = await buildCanonicalOperationsProjection(filesystem, layout, { from, to });
|
|
710
|
+
const costs = await buildCurrentCostProjection(filesystem, operations, selectedCurrency(context));
|
|
711
|
+
return {
|
|
712
|
+
operations,
|
|
713
|
+
costs,
|
|
714
|
+
dashboard: await dashboardIdentity(filesystem, workspaceRoot),
|
|
715
|
+
projection: {
|
|
716
|
+
source_latest_at: operations.summary.source_latest_at,
|
|
717
|
+
served_at: new Date().toISOString(),
|
|
718
|
+
},
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* Assemble Operations from the tracked lifecycle records and, when a bounded
|
|
724
|
+
* period was requested, the signed InvocationSummary manifests for that same
|
|
725
|
+
* period. Runtime projections are deliberately not read or cached here.
|
|
726
|
+
*/
|
|
727
|
+
async function buildCanonicalOperationsProjection(
|
|
728
|
+
filesystem: WorkspaceFileSystem,
|
|
729
|
+
layout: WorkspaceLayout,
|
|
730
|
+
filter: { from: string | null; to: string | null },
|
|
731
|
+
overviewOnly = false,
|
|
732
|
+
) {
|
|
733
|
+
const operations = await buildOperationsProjection(filesystem, layout, filter, { overviewOnly });
|
|
734
|
+
if (overviewOnly || filter.from === null || filter.to === null) return operations;
|
|
735
|
+
const summaries = await invocationSummariesForPeriod(filesystem, {
|
|
736
|
+
from: filter.from,
|
|
737
|
+
to: filter.to,
|
|
738
|
+
});
|
|
739
|
+
return summaries.length === 0
|
|
740
|
+
? operations
|
|
741
|
+
: recalculateOperationsRunSummary({
|
|
742
|
+
...operations,
|
|
743
|
+
runs: projectExecutionDurations(mergeManifestRuns(operations.runs, summaries)),
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
async function buildCurrentCostProjection(
|
|
748
|
+
filesystem: WorkspaceFileSystem,
|
|
749
|
+
operations: Awaited<ReturnType<typeof buildCanonicalOperationsProjection>>,
|
|
750
|
+
currency: "BRL" | "USD",
|
|
751
|
+
) {
|
|
752
|
+
const pricing = new PricingRepository(filesystem);
|
|
753
|
+
const [catalog, fxRate] = await Promise.all([
|
|
754
|
+
pricing.readCatalog(),
|
|
755
|
+
currency === "BRL" ? pricing.readLatestFxRate() : Promise.resolve(null),
|
|
756
|
+
]);
|
|
757
|
+
const agentNames = await configuredAgentNames(filesystem);
|
|
758
|
+
return buildCostMonitorProjection(operations, { catalog, fxRate, currency }, agentNames);
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
async function buildManifestFirstCostProjection(
|
|
762
|
+
filesystem: WorkspaceFileSystem,
|
|
763
|
+
operations: Awaited<ReturnType<typeof buildCanonicalOperationsProjection>>,
|
|
764
|
+
context: Context,
|
|
765
|
+
) {
|
|
766
|
+
const from = context.req.query("from") ?? null;
|
|
767
|
+
const to = context.req.query("to") ?? null;
|
|
768
|
+
if (from === null || to === null) {
|
|
769
|
+
return buildCurrentCostProjection(filesystem, operations, selectedCurrency(context));
|
|
770
|
+
}
|
|
771
|
+
const filters = {
|
|
772
|
+
providers: queryValues(context, "provider"),
|
|
773
|
+
models: queryValues(context, "model"),
|
|
774
|
+
zaip_agents: queryValues(context, "agent"),
|
|
775
|
+
phases: queryValues(context, "phase"),
|
|
776
|
+
statuses: queryValues(context, "status"),
|
|
777
|
+
};
|
|
778
|
+
const summaries = await invocationSummariesForPeriod(filesystem, { from, to, filters });
|
|
779
|
+
if (summaries.length === 0)
|
|
780
|
+
return buildCurrentCostProjection(filesystem, operations, selectedCurrency(context));
|
|
781
|
+
const runs = projectExecutionDurations(mergeManifestRuns(operations.runs, summaries));
|
|
782
|
+
return buildCurrentCostProjection(filesystem, { ...operations, runs }, selectedCurrency(context));
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
const sessionToken = defaultSessionToken();
|
|
786
|
+
export const app = createDashboardApp(process.env.ZAIP_WORKSPACE ?? process.cwd(), sessionToken);
|
|
787
|
+
|
|
788
|
+
const isMain = process.argv[1]
|
|
789
|
+
? resolve(process.argv[1]) === fileURLToPath(import.meta.url)
|
|
790
|
+
: false;
|
|
791
|
+
|
|
792
|
+
if (isMain) {
|
|
793
|
+
const port = Number.parseInt(process.env.ZAIP_SERVER_PORT ?? "4317", 10);
|
|
794
|
+
serve({ fetch: app.fetch, hostname: HOST, port }, ({ port: boundPort }) => {
|
|
795
|
+
process.stdout.write(
|
|
796
|
+
`ZAIP-AIOS dashboard API: http://${HOST}:${boundPort}${API_PREFIX}/health\n`,
|
|
797
|
+
);
|
|
798
|
+
});
|
|
799
|
+
}
|