@zaip-ai/cli 3.2.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. package/dist/services/adapters.d.ts +1 -1
  2. package/dist/services/adapters.d.ts.map +1 -1
  3. package/dist/services/adapters.js +5 -3
  4. package/dist/services/adapters.js.map +1 -1
  5. package/dist/services/agent-catalog-upgrade.d.ts +3 -0
  6. package/dist/services/agent-catalog-upgrade.d.ts.map +1 -0
  7. package/dist/services/agent-catalog-upgrade.js +35 -0
  8. package/dist/services/agent-catalog-upgrade.js.map +1 -0
  9. package/dist/services/install-agents-template.d.ts.map +1 -1
  10. package/dist/services/install-agents-template.js +22 -22
  11. package/dist/services/install-agents-template.js.map +1 -1
  12. package/dist/services/install-template-policy.d.ts +3 -0
  13. package/dist/services/install-template-policy.d.ts.map +1 -0
  14. package/dist/services/install-template-policy.js +21 -0
  15. package/dist/services/install-template-policy.js.map +1 -0
  16. package/dist/services/logger.js +24 -8
  17. package/dist/services/logger.js.map +1 -1
  18. package/dist/services/logger.test.js +33 -6
  19. package/dist/services/logger.test.js.map +1 -1
  20. package/dist/services/sqlite-bootstrap.d.ts +1 -0
  21. package/dist/services/sqlite-bootstrap.d.ts.map +1 -1
  22. package/dist/services/sqlite-bootstrap.js +10 -1
  23. package/dist/services/sqlite-bootstrap.js.map +1 -1
  24. package/package.json +2 -2
  25. package/templates/.agents/README-ENG.md +2 -1
  26. package/templates/.agents/README.md +2 -1
  27. package/templates/.agents/config/agents/catalog.yaml +1 -0
  28. package/templates/.agents/config/agents/discovery.json +2 -2
  29. package/templates/.agents/config/clients/codex/agents/zaip-agent-builder.toml +2 -2
  30. package/templates/.agents/dashboard/.zaip-managed.json +278 -126
  31. package/templates/.agents/dashboard/apps/frontend/dist/assets/{CostCalculationGuidePage-CEDZjl4V.js → CostCalculationGuidePage-C5NgEcVh.js} +1 -1
  32. package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-BzaUTZDx.js → DashboardHelpDialog-CCMVnkkI.js} +4 -3
  33. package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-21cCJik-.js → PricingSettingsDialog-CGYcJ5EB.js} +1 -1
  34. package/templates/.agents/dashboard/apps/frontend/dist/assets/{ProjectSettingsPage-BAvLPAee.js → ProjectSettingsPage-DVCPPV75.js} +1 -1
  35. package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-wqW52uCx.js → TraceabilityWorkspace-CqK3Psfy.js} +1 -1
  36. package/templates/.agents/dashboard/apps/frontend/dist/assets/{cost-monitor-PoJA2PI1.css → cost-monitor-BsMfGfQi.css} +1 -1
  37. package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-j3aUYH5G.js +68 -0
  38. package/templates/.agents/dashboard/apps/frontend/dist/assets/{dashboard-localization-BkAm8-h4.js → dashboard-localization-jvdDfNKs.js} +2 -1
  39. package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-DEmo6Tn2.js → icons-vendor-x8xxL9yW.js} +1 -1
  40. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-Cl5EWx8R.js +2 -0
  41. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-Cwylbh_N.css +1 -0
  42. package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-CadYsm83.js → react-vendor-CNOXIJHN.js} +1 -1
  43. package/templates/.agents/dashboard/apps/frontend/dist/assets/{traceability-BzKK8kK3.js → traceability-CcpbpT1s.js} +1 -1
  44. package/templates/.agents/dashboard/apps/frontend/dist/index.html +7 -7
  45. package/templates/.agents/dashboard/apps/frontend/package.json +1 -1
  46. package/templates/.agents/dashboard/apps/frontend/src/App.tsx +12 -1
  47. package/templates/.agents/dashboard/apps/frontend/src/WorkspaceStatus.test.tsx +33 -0
  48. package/templates/.agents/dashboard/apps/frontend/src/WorkspaceStatus.tsx +58 -0
  49. package/templates/.agents/dashboard/apps/frontend/src/app-work-board-options.ts +41 -0
  50. package/templates/.agents/dashboard/apps/frontend/src/dashboard-runtime-status.ts +25 -0
  51. package/templates/.agents/dashboard/apps/frontend/src/snapshot-coherence.test.ts +1 -1
  52. package/templates/.agents/dashboard/apps/frontend/src/use-app-cost-loaders.ts +5 -1
  53. package/templates/.agents/dashboard/apps/frontend/src/use-app-work-board.test.ts +140 -0
  54. package/templates/.agents/dashboard/apps/frontend/src/use-app-work-board.ts +28 -41
  55. package/templates/.agents/dashboard/apps/frontend/src/use-runtime-status.ts +38 -0
  56. package/templates/.agents/dashboard/apps/frontend/src/workspace-status.css +33 -0
  57. package/templates/.agents/dashboard/modules/cost-monitor/package.json +1 -1
  58. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CompactLifecycleCostTable.test.ts +25 -3
  59. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CompactLifecycleCostTable.tsx +17 -19
  60. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostFilters.tsx +13 -167
  61. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostGroupsTable.tsx +2 -9
  62. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.test.ts +8 -8
  63. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.tsx +29 -52
  64. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTableLoading.test.ts +1 -1
  65. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables-keeps-legacy-codex-identity-fields-blank.test.ts +2 -2
  66. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.test.ts +4 -27
  67. package/templates/.agents/dashboard/modules/cost-monitor/src/react/MacroCostTable.test.ts +2 -2
  68. package/templates/.agents/dashboard/modules/cost-monitor/src/react/MacroCostTable.tsx +4 -3
  69. package/templates/.agents/dashboard/modules/cost-monitor/src/react/agent-model-presentation.test.ts +26 -0
  70. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-embedded.css +7 -0
  71. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-loaders.ts +173 -0
  72. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-page-props.ts +47 -0
  73. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-page-selectors.ts +1 -7
  74. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-page-range.ts +3 -9
  75. package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-projection.test.ts +44 -83
  76. package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-projection.ts +11 -111
  77. package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-summary-projection.test.ts +47 -181
  78. package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-summary-projection.ts +63 -91
  79. package/templates/.agents/dashboard/modules/cost-monitor/src/server/cost-monitor-unavailable.test.ts +55 -0
  80. package/templates/.agents/dashboard/modules/cost-monitor/src/server/cost-summary-duration.test.ts +189 -0
  81. package/templates/.agents/dashboard/modules/operations/package.json +1 -1
  82. package/templates/.agents/dashboard/modules/operations/src/react/OperationsEntityFilters.tsx +82 -0
  83. package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.helpers.tsx +4 -1
  84. package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.test.ts +5 -0
  85. package/templates/.agents/dashboard/modules/operations/src/react/OperationsPage.tsx +22 -31
  86. package/templates/.agents/dashboard/modules/operations/src/react/PagedWorkList.test.tsx +13 -1
  87. package/templates/.agents/dashboard/modules/operations/src/react/PagedWorkList.tsx +16 -3
  88. package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportAction.test.ts +11 -27
  89. package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportAction.tsx +44 -193
  90. package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportColumns.ts +186 -0
  91. package/templates/.agents/dashboard/modules/operations/src/react/export/excel-agent-participations.test.ts +28 -0
  92. package/templates/.agents/dashboard/modules/operations/src/react/export/export-layout.test.ts +2 -1
  93. package/templates/.agents/dashboard/modules/operations/src/react/export/xlsx-runtime-e2e.test.ts +55 -31
  94. package/templates/.agents/dashboard/modules/operations/src/react/operations-export-duration.ts +13 -0
  95. package/templates/.agents/dashboard/modules/operations/src/react/operations-filter-panel.css +4 -0
  96. package/templates/.agents/dashboard/modules/operations/src/react/use-operation-filter-feedback.ts +18 -0
  97. package/templates/.agents/dashboard/modules/operations/src/react/work-board-model.test.ts +11 -0
  98. package/templates/.agents/dashboard/modules/operations/src/react/work-board-model.ts +10 -2
  99. package/templates/.agents/dashboard/modules/operations/src/work-board-model.ts +1 -1
  100. package/templates/.agents/dashboard/modules/traceability/package.json +1 -1
  101. package/templates/.agents/dashboard/packages/branding/package.json +1 -1
  102. package/templates/.agents/dashboard/packages/contracts/package.json +1 -1
  103. package/templates/.agents/dashboard/packages/data-export/package.json +1 -1
  104. package/templates/.agents/dashboard/packages/local-runtime/dist/server.cjs +406 -332
  105. package/templates/.agents/dashboard/packages/local-runtime/dist/sqlite-read-model.cjs +352 -280
  106. package/templates/.agents/dashboard/packages/local-runtime/package.json +1 -1
  107. package/templates/.agents/dashboard/packages/local-runtime/scripts/rebuild-sqlite-read-model.mjs +2 -1
  108. package/templates/.agents/dashboard/packages/local-runtime/scripts/validate-sqlite-read-model.mjs +4 -2
  109. package/templates/.agents/dashboard/packages/local-runtime/server.mjs +406 -332
  110. package/templates/.agents/dashboard/packages/local-runtime/src/active-codex-telemetry.test.ts +95 -0
  111. package/templates/.agents/dashboard/packages/local-runtime/src/active-codex-telemetry.ts +102 -12
  112. package/templates/.agents/dashboard/packages/local-runtime/src/server-board.test.ts +75 -1
  113. package/templates/.agents/dashboard/packages/local-runtime/src/server-costs-routes.ts +10 -0
  114. package/templates/.agents/dashboard/packages/local-runtime/src/server-lifecycle-diagnostics.ts +50 -0
  115. package/templates/.agents/dashboard/packages/local-runtime/src/server-macro-population.test.ts +165 -0
  116. package/templates/.agents/dashboard/packages/local-runtime/src/server-operations-page-filters.ts +65 -0
  117. package/templates/.agents/dashboard/packages/local-runtime/src/server-operations-pages.test.ts +111 -0
  118. package/templates/.agents/dashboard/packages/local-runtime/src/server-operations-pages.ts +53 -63
  119. package/templates/.agents/dashboard/packages/local-runtime/src/server-operations-runs-route.ts +19 -5
  120. package/templates/.agents/dashboard/packages/local-runtime/src/server-period-macro-metric.test.ts +19 -0
  121. package/templates/.agents/dashboard/packages/local-runtime/src/server-period-macro-metric.ts +11 -2
  122. package/templates/.agents/dashboard/packages/local-runtime/src/server-read-projections.ts +19 -12
  123. package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot-refresh.test.ts +46 -2
  124. package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot-synchronization.test.ts +10 -2
  125. package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot-synchronization.ts +4 -3
  126. package/templates/.agents/dashboard/packages/local-runtime/src/server.test.ts +43 -1
  127. package/templates/.agents/dashboard/packages/local-runtime/src/server.ts +46 -11
  128. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-filter-matrix.test.ts +188 -0
  129. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-summary-details.test.ts +85 -0
  130. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-summary-details.ts +147 -0
  131. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-first-fold-cache.test.ts +94 -0
  132. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-first-fold-cache.ts +96 -55
  133. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-force-canonical.test.ts +58 -3
  134. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-macro-classification.test.ts +172 -0
  135. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-materialize-projections.ts +1 -1
  136. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-operations-projection.ts +4 -1
  137. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-operations-work-list.test.ts +7 -7
  138. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-operations-work-list.ts +2 -1
  139. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-period-averages.ts +10 -1
  140. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-agent-dimension.ts +18 -82
  141. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-cached-cost-page.ts +169 -0
  142. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-developer.ts +205 -0
  143. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-entity-group.ts +13 -4
  144. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-filtered-dimension.ts +22 -23
  145. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-financial.ts +42 -209
  146. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-model-dimension.ts +18 -4
  147. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-provider-dimension.ts +9 -2
  148. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-summary.ts +76 -83
  149. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-view-page.ts +25 -161
  150. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-canonical.ts +18 -45
  151. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-counts-every-root-execution-day-returns.test.ts +15 -2
  152. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-filesystem.ts +16 -16
  153. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-keeps-orphan-telemetry-out-kanban-without.test.ts +2 -1
  154. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-multi-provider.test.ts +1 -1
  155. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-rebuild.ts +47 -22
  156. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-schema.ts +16 -2
  157. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model.test.ts +13 -1
  158. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-rebuild-result.ts +15 -0
  159. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-schema-base-views.ts +4 -4
  160. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-schema-dashboard-views.ts +19 -42
  161. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-schema-macro-classification.ts +48 -0
  162. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-summary-cursor.ts +15 -0
  163. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-token-active-allocation.ts +46 -0
  164. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-work-stages.ts +60 -0
  165. package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-history.mjs +5 -1
  166. package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-launch-claims.test.mjs +7 -1
  167. package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-launch-page.mjs +17 -2
  168. package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-ownership.mjs +65 -0
  169. package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-ownership.test.mjs +72 -0
  170. package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-processes.mjs +32 -9
  171. package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.mjs +39 -45
  172. package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.test.mjs +5 -2
  173. package/templates/.agents/dashboard/packages/ui/package.json +1 -1
  174. package/templates/.agents/dashboard/scripts/qualify-macro-overview.mjs +50 -0
  175. package/templates/.agents/dashboard/tests/e2e/package.json +1 -1
  176. package/templates/.agents/dashboard/tests/e2e/specs/dashboard-performance-matrix.spec.ts +1 -18
  177. package/templates/.agents/dashboard/tests/e2e/specs/export-row-identity.spec.ts +20 -0
  178. package/templates/.agents/dashboard/tests/e2e/specs/export-row-identity.ts +20 -0
  179. package/templates/.agents/design/.zaip-managed.json +82 -74
  180. package/templates/.agents/design/apps/catalog/dist/assets/index-0W0Gj_Gs.css +1 -0
  181. package/templates/.agents/design/apps/catalog/dist/assets/index-32GZO95T.js +72 -0
  182. package/templates/.agents/design/apps/catalog/dist/assets/{index-D_lfqoyx.js → index-BP8IxOxt.js} +3 -3
  183. package/templates/.agents/design/apps/catalog/dist/assets/{index-BOjCcUaU.js → index-QJsgr9Ht.js} +3 -3
  184. package/templates/.agents/design/apps/catalog/dist/index.html +2 -2
  185. package/templates/.agents/design/apps/catalog/dist/storybook/assets/CatalogShell-CvaciY0C.js +1 -0
  186. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{Color-6AOWCN3U-Cm-yJJz_.js → Color-6AOWCN3U-DwBV1A1Y.js} +1 -1
  187. package/templates/.agents/design/apps/catalog/dist/storybook/assets/Components.stories-3dqK5g3e.js +142 -0
  188. package/templates/.agents/design/apps/catalog/dist/storybook/assets/DesignSystem.stories-2OCgtT0I.js +1 -0
  189. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{DocsRenderer-JROSPFPF-Belk4jRr.js → DocsRenderer-JROSPFPF-CODg0rSl.js} +4 -4
  190. package/templates/.agents/design/apps/catalog/dist/storybook/assets/Primitives-BmeKjJW4.js +1 -0
  191. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{WithTooltip-7X4HQR7L-DoPvjkS1.js → WithTooltip-7X4HQR7L-C5MI-3uZ.js} +1 -1
  192. package/templates/.agents/design/apps/catalog/dist/storybook/assets/WorkspaceStatus.stories-Tb_iQqVK.js +17 -0
  193. package/templates/.agents/design/apps/catalog/dist/storybook/assets/WorkspaceStatusSpecimen-CD54pw0-.js +1 -0
  194. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{chunk-DRQKCCAG-B1itKXEN.js → chunk-DRQKCCAG-KSn75jcy.js} +1 -1
  195. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{chunk-W22LQPXL-C-Eb5SPY.js → chunk-W22LQPXL-C4LS1Thf.js} +1 -1
  196. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{components-DnyKLwhj.js → components-DV1BRgMY.js} +5 -5
  197. package/templates/.agents/design/apps/catalog/dist/storybook/assets/formatter-L2YTDE3Q-BU_68im1.js +1 -0
  198. package/templates/.agents/design/apps/catalog/dist/storybook/assets/iframe-0W0Gj_Gs.css +1 -0
  199. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{iframe-DcXBsFPz.js → iframe-CBbPFx5G.js} +4 -4
  200. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{react-18-CRM89QRf.js → react-18-C9IPGXtb.js} +1 -1
  201. package/templates/.agents/design/apps/catalog/dist/storybook/assets/react-CEv2qkJT.js +1 -0
  202. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{syntaxhighlighter-YFXUGROL-B03jQGTF.js → syntaxhighlighter-YFXUGROL-ZgDQjyWI.js} +1 -1
  203. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{theming-4ZyufAga.js → theming-Cx9-gH6l.js} +1 -1
  204. package/templates/.agents/design/apps/catalog/dist/storybook/iframe.html +2 -2
  205. package/templates/.agents/design/apps/catalog/dist/storybook/index.json +1 -1
  206. package/templates/.agents/design/apps/catalog/dist/storybook/sb-addons/a11y-2/manager-bundle.js +3 -3
  207. package/templates/.agents/design/apps/catalog/dist/storybook/sb-addons/docs-1/manager-bundle.js +4 -4
  208. package/templates/.agents/design/apps/catalog/dist/storybook/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +60 -60
  209. package/templates/.agents/design/apps/catalog/package.json +1 -1
  210. package/templates/.agents/design/apps/catalog/src/components/DashboardFiltersSpecimen.tsx +61 -0
  211. package/templates/.agents/design/apps/catalog/src/components/Primitives.tsx +24 -0
  212. package/templates/.agents/design/apps/catalog/src/components/WorkspaceStatusSpecimen.tsx +26 -0
  213. package/templates/.agents/design/apps/catalog/src/design-contract.test.ts +27 -13
  214. package/templates/.agents/design/apps/catalog/src/pages/ComponentsPage.tsx +38 -0
  215. package/templates/.agents/design/apps/catalog/src/pages/DesignSystemPage.tsx +15 -1
  216. package/templates/.agents/design/apps/catalog/src/stories/Components.stories.tsx +18 -0
  217. package/templates/.agents/design/apps/catalog/src/stories/DashboardFilters.stories.tsx +7 -0
  218. package/templates/.agents/design/apps/catalog/src/stories/WorkspaceStatus.stories.tsx +9 -0
  219. package/templates/.agents/design/apps/catalog/src/styles/components.css +83 -2
  220. package/templates/.agents/design/apps/catalog/src/styles.css +2 -0
  221. package/templates/.agents/design/packages/local-runtime/package.json +1 -1
  222. package/templates/.agents/design/tokens.json +32 -0
  223. package/templates/.agents/requirements/autonomous-assurance.md +1 -1
  224. package/templates/.agents/requirements/cloud-hostinger-autonomy.md +1 -1
  225. package/templates/.agents/requirements/comparative-audit.md +1 -1
  226. package/templates/.agents/requirements/context-engine.md +1 -1
  227. package/templates/.agents/requirements/cost-observability.md +1 -1
  228. package/templates/.agents/requirements/dashboard-launch.md +1 -1
  229. package/templates/.agents/requirements/data-export.md +1 -1
  230. package/templates/.agents/requirements/design-system.md +1 -1
  231. package/templates/.agents/requirements/execution-engine.md +1 -1
  232. package/templates/.agents/requirements/kanban-dashboard.md +1 -1
  233. package/templates/.agents/requirements/model-orchestration.md +1 -1
  234. package/templates/.agents/requirements/public-distribution.md +18 -4
  235. package/templates/.agents/requirements/software-architecture.md +1 -1
  236. package/templates/.agents/requirements/strategic-improvements.md +1 -1
  237. package/templates/.agents/requirements/work-lifecycle.md +1 -1
  238. package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
  239. package/templates/.agents/rules/autonomy-decision.md +1 -0
  240. package/templates/.agents/rules/workflow.md +1 -1
  241. package/templates/.agents/runtime/VERSION +1 -1
  242. package/templates/.agents/runtime/bin/zaip.mjs +28 -26
  243. package/templates/.agents/runtime/checksums.sha256 +5 -5
  244. package/templates/.agents/runtime/manifest.json +1 -1
  245. package/templates/.agents/runtime/provenance.json +4 -4
  246. package/templates/.agents/runtime/sbom.cdx.json +1 -1
  247. package/templates/.agents/skills/zaip-aios/SKILL.md +0 -1
  248. package/templates/.agents/skills/zaip-skill-author-skills/scripts/audit-skill-catalog.mjs +1 -0
  249. package/templates/.agents/skills/zaip-skill-config/SKILL.md +1 -1
  250. package/templates/.agents/skills/zaip-skill-execution/SKILL.md +13 -0
  251. package/templates/.agents/skills/zaip-skill-execution/references/autonomous-continuation.md +17 -0
  252. package/templates/.agents/skills/zaip-skill-execution/references/correction-cycle.md +2 -2
  253. package/templates/.agents/skills/zaip-skill-github-deploy/SKILL.md +4 -2
  254. package/templates/.agents/skills/zaip-skill-github-deploy/references/deployment-workflow.md +4 -2
  255. package/templates/.agents/skills/zaip-skill-github-deploy/references/release-identity.md +2 -2
  256. package/templates/.agents/skills/zaip-skill-github-setup/SKILL.md +2 -2
  257. package/templates/.agents/skills/zaip-skill-move-prd/SKILL.md +4 -0
  258. package/templates/.agents/skills/zaip-skill-move-spec/SKILL.md +4 -0
  259. package/templates/.agents/skills/zaip-skill-prd/SKILL.md +3 -3
  260. package/templates/.agents/skills/zaip-skill-release-qualification/SKILL.md +15 -8
  261. package/templates/.agents/skills/zaip-skill-release-qualification/references/local-preparation.md +13 -12
  262. package/templates/.agents/skills/zaip-skill-setup/SKILL.md +50 -13
  263. package/templates/.agents/skills/zaip-skill-setup/agents/openai.yaml +2 -2
  264. package/templates/.agents/skills/zaip-skill-spec/SKILL.md +2 -2
  265. package/templates/.agents/skills/zaip-skill-update-version-doc/SKILL.md +39 -0
  266. package/templates/.agents/skills/zaip-skill-update-version-doc/agents/openai.yaml +4 -0
  267. package/templates/.agents/skills/zaip-skill-update-version-doc/scripts/update-version-doc.mjs +21 -0
  268. package/templates/.agents/skills/zaip-skill-update-version-doc/scripts/update-version-doc.test.mjs +32 -0
  269. package/templates/.agents/zaip-aios/README.md +2 -1
  270. package/templates/.agents/zaip-aios/VERSION +1 -1
  271. package/templates/.agents/zaip-aios/guides/20-instalacao-detalhada.md +7 -3
  272. package/templates/template-manifest.json +436 -256
  273. package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-06__WZco.js +0 -68
  274. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-Cmlx8OYH.css +0 -1
  275. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-DqZKJS8y.js +0 -2
  276. package/templates/.agents/design/apps/catalog/dist/assets/index-BEmIE7WE.css +0 -1
  277. package/templates/.agents/design/apps/catalog/dist/assets/index-BJV597iq.js +0 -72
  278. package/templates/.agents/design/apps/catalog/dist/assets/index-B_WhrCZe.js +0 -72
  279. package/templates/.agents/design/apps/catalog/dist/assets/index-CqqYWY2f.js +0 -9
  280. package/templates/.agents/design/apps/catalog/dist/assets/index-CqtYXZfV.js +0 -72
  281. package/templates/.agents/design/apps/catalog/dist/assets/index-D9pj7Jlf.js +0 -9
  282. package/templates/.agents/design/apps/catalog/dist/assets/index-i_PO2k9R.js +0 -9
  283. package/templates/.agents/design/apps/catalog/dist/storybook/assets/CatalogShell-Cstn1UwA.js +0 -1
  284. package/templates/.agents/design/apps/catalog/dist/storybook/assets/Components.stories-D1WopB2L.js +0 -137
  285. package/templates/.agents/design/apps/catalog/dist/storybook/assets/DesignSystem.stories-DQ9PJ3N3.js +0 -1
  286. package/templates/.agents/design/apps/catalog/dist/storybook/assets/formatter-L2YTDE3Q-D0OSgxWz.js +0 -1
  287. package/templates/.agents/design/apps/catalog/dist/storybook/assets/iframe-BEmIE7WE.css +0 -1
  288. package/templates/.agents/design/apps/catalog/dist/storybook/assets/react-C3tkVMIp.js +0 -1
@@ -5,6 +5,38 @@ import { formatDeveloperIdentities } from "../developer-identities.js";
5
5
  import { ExportProgressToast, ExportSuccessToast } from "./ExportProgressToast.js";
6
6
  import { ExportController, type ExportState } from "./export-session.js";
7
7
 
8
+ export {
9
+ AGENT_INVOCATION_EXPORT_COLUMNS,
10
+ CHANGE_EXPORT_COLUMNS,
11
+ COMPACT_LIFECYCLE_EXPORT_COLUMNS,
12
+ CONVERSATION_EXPORT_COLUMNS,
13
+ COST_AGENT_EXPORT_COLUMNS,
14
+ COST_GROUP_EXPORT_COLUMNS,
15
+ DECISION_EXPORT_COLUMNS,
16
+ DEVELOPER_EXPORT_COLUMNS,
17
+ EXECUTION_EXPORT_COLUMNS,
18
+ KANBAN_EXPORT_COLUMNS,
19
+ MODEL_COST_GROUP_EXPORT_COLUMNS,
20
+ PERIOD_EXPORT_COLUMNS,
21
+ WORK_EXPORT_COLUMNS,
22
+ } from "./ExcelExportColumns.js";
23
+
24
+ import {
25
+ AGENT_INVOCATION_EXPORT_COLUMNS,
26
+ CHANGE_EXPORT_COLUMNS,
27
+ COMPACT_LIFECYCLE_EXPORT_COLUMNS,
28
+ CONVERSATION_EXPORT_COLUMNS,
29
+ COST_AGENT_EXPORT_COLUMNS,
30
+ COST_GROUP_EXPORT_COLUMNS,
31
+ DECISION_EXPORT_COLUMNS,
32
+ DEVELOPER_EXPORT_COLUMNS,
33
+ EXECUTION_EXPORT_COLUMNS,
34
+ KANBAN_EXPORT_COLUMNS,
35
+ MODEL_COST_GROUP_EXPORT_COLUMNS,
36
+ PERIOD_EXPORT_COLUMNS,
37
+ WORK_EXPORT_COLUMNS,
38
+ } from "./ExcelExportColumns.js";
39
+
8
40
  export type ExcelExportInput = {
9
41
  view: string;
10
42
  filters: Readonly<Record<string, unknown>>;
@@ -22,193 +54,6 @@ export type PreparedExportPageSource = {
22
54
  };
23
55
  export const EXPORT_SUCCESS_TOAST_MS = 4_000;
24
56
 
25
- export const PERIOD_EXPORT_COLUMNS = [
26
- "key",
27
- "prds",
28
- "specs",
29
- "tasks",
30
- "conversations",
31
- "runs",
32
- "tests",
33
- "evidences",
34
- "tokens",
35
- "cost",
36
- "duration_hours",
37
- ] as const;
38
-
39
- // Work views contain PRDs, SPECs, and Tasks. Export the common, user-facing
40
- // fields instead of the union of their internal lifecycle projections. The
41
- // latter produces columns that are empty for an entire view (or nearly every
42
- // row), which makes the workbook much harder to use.
43
- export const WORK_EXPORT_COLUMNS = [
44
- "type",
45
- "id",
46
- "title",
47
- "status",
48
- "risk",
49
- "developers",
50
- "occurred_at",
51
- "duration_hours",
52
- "tokens",
53
- "cost_brl",
54
- ] as const;
55
-
56
- // Execution rows are entities, not period summaries. Keep their schema
57
- // aligned with the Execution table so the workbook never inherits the empty
58
- // PRD/SPEC/period columns shown by a different tab.
59
- export const EXECUTION_EXPORT_COLUMNS = [
60
- "id",
61
- "kind",
62
- "status",
63
- "origin",
64
- "task_id",
65
- "conversation_id",
66
- "created_at",
67
- "finished_at",
68
- "duration_hours",
69
- "tokens",
70
- "cost_brl",
71
- "invocations",
72
- ] as const;
73
-
74
- export const AGENT_INVOCATION_EXPORT_COLUMNS = [
75
- "run_id",
76
- "execution_id",
77
- "conversation_id",
78
- "task_id",
79
- "origin",
80
- "run_role",
81
- "run_purpose",
82
- "phase",
83
- "status",
84
- "agent",
85
- "provider",
86
- "model",
87
- "reasoning_effort",
88
- "started_at",
89
- "finished_at",
90
- "duration_hours",
91
- "input_tokens",
92
- "cached_input_tokens",
93
- "output_tokens",
94
- "reasoning_tokens",
95
- "total_tokens",
96
- "estimated_usd",
97
- "estimated_brl",
98
- ] as const;
99
-
100
- export const COMPACT_LIFECYCLE_EXPORT_COLUMNS = [
101
- "id",
102
- "title",
103
- "status",
104
- "occurred_at",
105
- "invocations",
106
- "duration_hours",
107
- "tokens",
108
- "cost_brl",
109
- ] as const;
110
-
111
- export const COST_GROUP_EXPORT_COLUMNS = [
112
- "key",
113
- "label",
114
- "invocations",
115
- "tasks",
116
- "tokens",
117
- "cost_usd",
118
- "cost_brl",
119
- "duration_hours",
120
- ] as const;
121
-
122
- /** Agent exports count Task participation, including repeated Tasks across agents. */
123
- export const COST_AGENT_EXPORT_COLUMNS = [
124
- "Persona",
125
- "Cargo",
126
- "Zaip Agentes",
127
- "PRDs",
128
- "SPECs",
129
- "Tarefas",
130
- "Runs",
131
- "Testes",
132
- "Evidências",
133
- "Tempo",
134
- "Tokens",
135
- "Custos",
136
- ] as const;
137
-
138
- /** The model audit mirrors its table: entity links precede financial facts. */
139
- export const MODEL_COST_GROUP_EXPORT_COLUMNS = [
140
- "model",
141
- "prds",
142
- "specs",
143
- "tasks",
144
- "conversations",
145
- "runs",
146
- "tests",
147
- "evidences",
148
- "duration_hours",
149
- "tokens",
150
- "costs",
151
- ] as const;
152
-
153
- // Cost Monitor developer attribution is a factual aggregate with coverage
154
- // counters. Keep the workbook schema aligned with that table and retain null
155
- // facts instead of allowing them to be inferred as zero by a spreadsheet.
156
- export const DEVELOPER_EXPORT_COLUMNS = [
157
- "account_id",
158
- "login_snapshot",
159
- "prd_count",
160
- "spec_count",
161
- "task_count",
162
- "run_count",
163
- "test_count",
164
- "evidence_count",
165
- "total_duration_hours",
166
- "total_tokens",
167
- "total_cost_brl",
168
- "duration_covered_runs",
169
- "token_covered_runs",
170
- "brl_covered_runs",
171
- ] as const;
172
-
173
- export const CONVERSATION_EXPORT_COLUMNS = [
174
- "conversation_id",
175
- "status",
176
- "risk",
177
- "started_at",
178
- "finished_at",
179
- "model",
180
- "reasoning_effort",
181
- "invocations",
182
- "duration_hours",
183
- "tokens",
184
- "cost_brl",
185
- ] as const;
186
-
187
- export const CHANGE_EXPORT_COLUMNS = [
188
- "id",
189
- "title",
190
- "status",
191
- "risk",
192
- "source_type",
193
- "source_id",
194
- "requirement_ids_json",
195
- "acceptance_ids_json",
196
- "task_ids_json",
197
- "occurred_at",
198
- ] as const;
199
-
200
- export const DECISION_EXPORT_COLUMNS = [
201
- "id",
202
- "title",
203
- "origin",
204
- "scope_type",
205
- "scope_id",
206
- "occurred_at",
207
- ] as const;
208
-
209
- /** @deprecated Use WORK_EXPORT_COLUMNS for Kanban and Work List exports. */
210
- export const KANBAN_EXPORT_COLUMNS = WORK_EXPORT_COLUMNS;
211
-
212
57
  export async function* exportPageSourceRows(
213
58
  pageSource: PreparedExportPageSource,
214
59
  mapRows: (
@@ -253,7 +98,7 @@ export function exportWorkRows(
253
98
  numberValue(row.duration_ms) ??
254
99
  numberValue(telemetry?.duration_ms) ??
255
100
  numberValue(row.total_duration) ??
256
- numberValue(metricDuration?.known_sum);
101
+ exportKnownMetric(metricDuration);
257
102
  return {
258
103
  type: row.kind ?? row.entity_kind,
259
104
  id: row.id,
@@ -269,13 +114,13 @@ export function exportWorkRows(
269
114
  numberValue(row.total_tokens) ??
270
115
  numberValue(telemetry?.tokens) ??
271
116
  numberValue(tokenUsage?.total) ??
272
- numberValue(metricTokens?.known_sum),
117
+ exportKnownMetric(metricTokens),
273
118
  cost_brl:
274
119
  numberValue(row.cost_brl) ??
275
120
  numberValue(row.total_cost_brl) ??
276
121
  numberValue(telemetry?.cost_brl) ??
277
122
  numberValue(costUsage?.brl) ??
278
- numberValue(metricCost?.known_sum),
123
+ exportKnownMetric(metricCost),
279
124
  };
280
125
  });
281
126
  }
@@ -346,6 +191,11 @@ export function exportAgentInvocationRows(
346
191
  });
347
192
  }
348
193
 
194
+ function exportKnownMetric(metric: Record<string, unknown> | null): number | null {
195
+ if (metric?.complete === false && metric.coverage_ratio === 0) return null;
196
+ return numberValue(metric?.known_sum);
197
+ }
198
+
349
199
  export function exportCompactLifecycleRows(
350
200
  rows: readonly Record<string, unknown>[],
351
201
  ): Record<string, unknown>[] {
@@ -354,7 +204,8 @@ export function exportCompactLifecycleRows(
354
204
  const duration = asRecord(metrics?.duration);
355
205
  const tokens = asRecord(metrics?.total_tokens);
356
206
  const cost = asRecord(metrics?.cost);
357
- const durationMs = numberValue(duration?.known_sum) ?? numberValue(row.total_duration);
207
+ const durationMs =
208
+ duration === null ? numberValue(row.total_duration) : exportKnownMetric(duration);
358
209
  return {
359
210
  id: row.id ?? null,
360
211
  title: row.title ?? null,
@@ -362,8 +213,8 @@ export function exportCompactLifecycleRows(
362
213
  occurred_at: row.occurred_at ?? null,
363
214
  invocations: numberValue(row.run_count) ?? numberValue(row.invocation_count),
364
215
  duration_hours: durationMs === null ? null : durationMs / 3_600_000,
365
- tokens: numberValue(tokens?.known_sum) ?? numberValue(row.total_tokens),
366
- cost_brl: numberValue(cost?.known_sum) ?? numberValue(row.total_cost_brl),
216
+ tokens: tokens === null ? numberValue(row.total_tokens) : exportKnownMetric(tokens),
217
+ cost_brl: cost === null ? numberValue(row.total_cost_brl) : exportKnownMetric(cost),
367
218
  };
368
219
  });
369
220
  }
@@ -0,0 +1,186 @@
1
+ export const PERIOD_EXPORT_COLUMNS = [
2
+ "key",
3
+ "prds",
4
+ "specs",
5
+ "tasks",
6
+ "conversations",
7
+ "runs",
8
+ "tests",
9
+ "evidences",
10
+ "tokens",
11
+ "cost",
12
+ "duration_hours",
13
+ ] as const;
14
+
15
+ // Work views contain PRDs, SPECs, and Tasks. Export the common, user-facing
16
+ // fields instead of the union of their internal lifecycle projections. The
17
+ // latter produces columns that are empty for an entire view (or nearly every
18
+ // row), which makes the workbook much harder to use.
19
+ export const WORK_EXPORT_COLUMNS = [
20
+ "type",
21
+ "id",
22
+ "title",
23
+ "status",
24
+ "risk",
25
+ "developers",
26
+ "occurred_at",
27
+ "duration_hours",
28
+ "tokens",
29
+ "cost_brl",
30
+ ] as const;
31
+
32
+ // Execution rows are entities, not period summaries. Keep their schema
33
+ // aligned with the Execution table so the workbook never inherits the empty
34
+ // PRD/SPEC/period columns shown by a different tab.
35
+ export const EXECUTION_EXPORT_COLUMNS = [
36
+ "id",
37
+ "kind",
38
+ "status",
39
+ "origin",
40
+ "task_id",
41
+ "conversation_id",
42
+ "created_at",
43
+ "finished_at",
44
+ "duration_hours",
45
+ "tokens",
46
+ "cost_brl",
47
+ "invocations",
48
+ ] as const;
49
+
50
+ export const AGENT_INVOCATION_EXPORT_COLUMNS = [
51
+ "run_id",
52
+ "execution_id",
53
+ "conversation_id",
54
+ "task_id",
55
+ "origin",
56
+ "run_role",
57
+ "run_purpose",
58
+ "phase",
59
+ "status",
60
+ "agent",
61
+ "provider",
62
+ "model",
63
+ "reasoning_effort",
64
+ "started_at",
65
+ "finished_at",
66
+ "duration_hours",
67
+ "input_tokens",
68
+ "cached_input_tokens",
69
+ "output_tokens",
70
+ "reasoning_tokens",
71
+ "total_tokens",
72
+ "estimated_usd",
73
+ "estimated_brl",
74
+ ] as const;
75
+
76
+ export const COMPACT_LIFECYCLE_EXPORT_COLUMNS = [
77
+ "id",
78
+ "title",
79
+ "status",
80
+ "occurred_at",
81
+ "invocations",
82
+ "duration_hours",
83
+ "tokens",
84
+ "cost_brl",
85
+ ] as const;
86
+
87
+ export const COST_GROUP_EXPORT_COLUMNS = [
88
+ "key",
89
+ "label",
90
+ "invocations",
91
+ "tasks",
92
+ "tokens",
93
+ "cost_usd",
94
+ "cost_brl",
95
+ "duration_hours",
96
+ ] as const;
97
+
98
+ /** Agent exports count Task participation, including repeated Tasks across agents. */
99
+ export const COST_AGENT_EXPORT_COLUMNS = [
100
+ "Persona",
101
+ "Cargo",
102
+ "Zaip Agentes",
103
+ "PRDs",
104
+ "SPECs",
105
+ "Tarefas",
106
+ "Runs",
107
+ "Testes",
108
+ "Evidências",
109
+ "Tempo",
110
+ "Tokens",
111
+ "Custos",
112
+ ] as const;
113
+
114
+ /** The model audit mirrors its table: entity links precede financial facts. */
115
+ export const MODEL_COST_GROUP_EXPORT_COLUMNS = [
116
+ "model",
117
+ "prds",
118
+ "specs",
119
+ "tasks",
120
+ "conversations",
121
+ "runs",
122
+ "tests",
123
+ "evidences",
124
+ "duration_hours",
125
+ "tokens",
126
+ "costs",
127
+ ] as const;
128
+
129
+ // Cost Monitor developer attribution is a factual aggregate with coverage
130
+ // counters. Keep the workbook schema aligned with that table and retain null
131
+ // facts instead of allowing them to be inferred as zero by a spreadsheet.
132
+ export const DEVELOPER_EXPORT_COLUMNS = [
133
+ "account_id",
134
+ "login_snapshot",
135
+ "prd_count",
136
+ "spec_count",
137
+ "task_count",
138
+ "run_count",
139
+ "test_count",
140
+ "evidence_count",
141
+ "total_duration_hours",
142
+ "total_tokens",
143
+ "total_cost_brl",
144
+ "duration_covered_runs",
145
+ "token_covered_runs",
146
+ "brl_covered_runs",
147
+ ] as const;
148
+
149
+ export const CONVERSATION_EXPORT_COLUMNS = [
150
+ "conversation_id",
151
+ "status",
152
+ "risk",
153
+ "started_at",
154
+ "finished_at",
155
+ "model",
156
+ "reasoning_effort",
157
+ "invocations",
158
+ "duration_hours",
159
+ "tokens",
160
+ "cost_brl",
161
+ ] as const;
162
+
163
+ export const CHANGE_EXPORT_COLUMNS = [
164
+ "id",
165
+ "title",
166
+ "status",
167
+ "risk",
168
+ "source_type",
169
+ "source_id",
170
+ "requirement_ids_json",
171
+ "acceptance_ids_json",
172
+ "task_ids_json",
173
+ "occurred_at",
174
+ ] as const;
175
+
176
+ export const DECISION_EXPORT_COLUMNS = [
177
+ "id",
178
+ "title",
179
+ "origin",
180
+ "scope_type",
181
+ "scope_id",
182
+ "occurred_at",
183
+ ] as const;
184
+
185
+ /** @deprecated Use WORK_EXPORT_COLUMNS for Kanban and Work List exports. */
186
+ export const KANBAN_EXPORT_COLUMNS = WORK_EXPORT_COLUMNS;
@@ -0,0 +1,28 @@
1
+ import { expect, it } from "vitest";
2
+ import { COST_AGENT_EXPORT_COLUMNS, exportCostAgentRows } from "./ExcelExportAction.js";
3
+
4
+ it("exports Agent tasks as participations and fills every missing numeric cell with zero", () => {
5
+ expect(COST_AGENT_EXPORT_COLUMNS).toEqual([
6
+ "Persona",
7
+ "Cargo",
8
+ "Zaip Agentes",
9
+ "PRDs",
10
+ "SPECs",
11
+ "Tarefas",
12
+ "Runs",
13
+ "Testes",
14
+ "Evidências",
15
+ "Tempo",
16
+ "Tokens",
17
+ "Custos",
18
+ ]);
19
+ const rows = exportCostAgentRows([
20
+ { key: "dave", task_count: 2 },
21
+ { key: "leo", task_count: 2 },
22
+ {},
23
+ ]);
24
+ expect(rows[0]?.Tarefas).toBe(2);
25
+ expect(rows[1]?.Tarefas).toBe(2);
26
+ for (const key of COST_AGENT_EXPORT_COLUMNS.slice(3)) expect(rows[2]?.[key]).toBe(0);
27
+ expect(rows[0]).not.toHaveProperty("tasks_created");
28
+ });
@@ -1,5 +1,6 @@
1
1
  import { readFileSync } from "node:fs";
2
2
  import { describe, expect, it } from "vitest";
3
+ import { WORK_EXPORT_COLUMNS } from "./ExcelExportAction.js";
3
4
 
4
5
  const operationsPage = readFileSync(new URL("../OperationsPage.tsx", import.meta.url), "utf8");
5
6
  const operationsNavigation = readFileSync(
@@ -50,7 +51,7 @@ describe("Excel export layout", () => {
50
51
  });
51
52
 
52
53
  it("exports factual developer identities with the work-list rows", () => {
53
- expect(action).toContain('"developers"');
54
+ expect(WORK_EXPORT_COLUMNS).toContain("developers");
54
55
  expect(action).toContain("formatDeveloperIdentities(row.developers)");
55
56
  });
56
57
 
@@ -1,7 +1,5 @@
1
- import { readdirSync } from "node:fs";
2
- import { mkdir, readFile, stat, writeFile } from "node:fs/promises";
3
- import { tmpdir } from "node:os";
4
- import { join } from "node:path";
1
+ import { mkdir, readFile, writeFile } from "node:fs/promises";
2
+ import { join, resolve } from "node:path";
5
3
  import { describe, expect, it } from "vitest";
6
4
  // `exceljs` exposes this Node-specific entrypoint without a declaration file.
7
5
  // The runtime export test needs the Node loader rather than ExcelJS's browser build.
@@ -176,46 +174,61 @@ const cases: readonly Case[] = [
176
174
  ];
177
175
 
178
176
  describe.skipIf(!enabled)("runtime XLSX exports", () => {
179
- it("writes and reopens every eligible XLSX with rows and no wholly empty column", async () => {
180
- const root = join(tmpdir(), "zaip-aios");
181
- const sessionPaths = await Promise.all(
182
- readdirSync(root)
183
- .filter((name) => name.startsWith("dashboard-sqlite-"))
184
- .map(async (name) => {
185
- const path = join(root, name, "dashboard-sqlite-session.json");
186
- return { path, modified: (await stat(path).catch(() => null))?.mtimeMs ?? 0 };
187
- }),
188
- );
189
- const sessionPath = sessionPaths.sort((left, right) => right.modified - left.modified)[0]?.path;
190
- expect(sessionPath).toBeDefined();
191
- const session = JSON.parse(await readFile(sessionPath!, "utf8")) as {
177
+ it("reopens served exports and preserves headers, every row and unavailable cells", async () => {
178
+ // An explicit isolated session prevents attaching to a user's unrelated dashboard.
179
+ const sessionPath = process.env.ZAIP_E2E_XLSX_SESSION;
180
+ if (!sessionPath) throw new Error("ZAIP_E2E_XLSX_SESSION must name the isolated session");
181
+ const session = JSON.parse(await readFile(sessionPath, "utf8")) as {
192
182
  port: number;
193
183
  token: string;
184
+ proofTaskId: string;
194
185
  };
195
- const output = join(process.cwd(), "..", "..", "..", "..", ".local", "dashboard-export-e2e");
186
+ expect(Number.isInteger(session.port) && session.port > 0 && session.port < 65536).toBe(true);
187
+ expect(session.proofTaskId).toMatch(/^TASK-/);
188
+ const output = resolve(process.env.ZAIP_E2E_XLSX_OUTPUT ?? ".local/dashboard-export-e2e");
196
189
  await mkdir(output, { recursive: true });
197
- for (const item of cases) {
190
+ const report: { name: string; rows: number; pages: number; unavailableCells: number }[] = [];
191
+ const filtered = {
192
+ ...cases.find((item) => item.name === "operations-work-list")!,
193
+ name: "operations-work-list-filtered",
194
+ query: session.proofTaskId,
195
+ };
196
+ for (const item of [...cases, filtered]) {
198
197
  const source: Row[] = [];
198
+ let pages = 0;
199
+ const filters = "query" in item ? { query: String(item.query) } : {};
199
200
  for (let offset = 0; ; ) {
201
+ const query = new URLSearchParams({
202
+ view: item.view,
203
+ offset: String(offset),
204
+ limit: "1",
205
+ ...filters,
206
+ });
200
207
  const response = await fetch(
201
- `http://127.0.0.1:${session.port}/api/v2/sqlite-views?view=${item.view}&offset=${offset}&limit=100`,
202
- { headers: { "x-zaip-session": session.token } },
208
+ `http://127.0.0.1:${session.port}/api/v2/sqlite-views?${query}`,
209
+ { headers: { "x-zaip-session": session.token }, signal: AbortSignal.timeout(30_000) },
203
210
  );
204
211
  expect(response.ok, item.view).toBe(true);
205
212
  const page = (await response.json()) as { rows: Row[]; total_count: number };
206
213
  source.push(...page.rows);
214
+ pages += 1;
207
215
  offset += page.rows.length;
208
216
  if (offset >= page.total_count) break;
209
217
  expect(page.rows.length, `${item.view} pagination`).toBeGreaterThan(0);
210
218
  }
211
219
  const rows = item.map(source);
220
+ if (item.name === "operations-work-list") {
221
+ expect(rows.length).toBeGreaterThanOrEqual(2);
222
+ expect(pages).toBeGreaterThan(1);
223
+ }
224
+ if (item.name === filtered.name) expect(rows).toHaveLength(1);
212
225
  const chunks: Uint8Array[] = [];
213
226
  await exportSnapshotToXlsxParts({
214
227
  snapshot: createExportSnapshot({
215
228
  id: item.name,
216
229
  createdAt: new Date().toISOString(),
217
230
  view: item.name,
218
- filters: {},
231
+ filters,
219
232
  totalRows: rows.length,
220
233
  pages: async function* () {
221
234
  yield rows;
@@ -234,15 +247,26 @@ describe.skipIf(!enabled)("runtime XLSX exports", () => {
234
247
  await writeFile(path, Buffer.concat(chunks.map((chunk) => Buffer.from(chunk))));
235
248
  const workbook = new ExcelJS.Workbook();
236
249
  await workbook.xlsx.load(await readFile(path));
237
- expect(workbook.worksheets[0]?.rowCount, item.name).toBe(rows.length + 1);
238
- const empty = item.headers.filter(
239
- (header) =>
240
- rows.length > 0 &&
241
- rows.every(
242
- (row) => row[header] === null || row[header] === undefined || row[header] === "",
243
- ),
244
- );
245
- expect(empty, `${item.name} columns`).toEqual([]);
250
+ const sheet = workbook.worksheets[0];
251
+ expect(sheet?.rowCount, item.name).toBe(rows.length + 1);
252
+ expect(sheet.getRow(1).values.slice(1), item.name).toEqual(item.headers);
253
+ let unavailableCells = 0;
254
+ for (const [index, row] of rows.entries()) {
255
+ for (const [column, header] of item.headers.entries()) {
256
+ const value = row[header];
257
+ if (value === null || value === undefined) unavailableCells += 1;
258
+ const expected = typeof value === "number" ? value : String(value ?? "");
259
+ expect(
260
+ sheet.getCell(index + 2, column + 1).value ?? "",
261
+ `${item.name}:${index}:${header}`,
262
+ ).toEqual(expected);
263
+ }
264
+ }
265
+ report.push({ name: item.name, rows: rows.length, pages, unavailableCells });
246
266
  }
267
+ await writeFile(
268
+ join(output, "report.json"),
269
+ JSON.stringify({ passed: true, views: report }, null, 2),
270
+ );
247
271
  }, 120_000);
248
272
  });
@@ -0,0 +1,13 @@
1
+ import { applyFactualPeriodDurations } from "./PeriodSummaryTable.js";
2
+ import type { PeriodGranularity, PeriodSummaryRow } from "./period-summary.js";
3
+
4
+ /** Applies shared duration facts only to the period exports that own them. */
5
+ export function factualDurationRowsForExport(
6
+ granularity: PeriodGranularity,
7
+ rows: readonly PeriodSummaryRow[],
8
+ factualRows?: readonly { key: string; duration_ms: number | null }[],
9
+ ): PeriodSummaryRow[] {
10
+ return granularity === "month" || granularity === "year"
11
+ ? applyFactualPeriodDurations(rows, factualRows)
12
+ : [...rows];
13
+ }
@@ -185,3 +185,7 @@
185
185
  transform: rotate(360deg);
186
186
  }
187
187
  }
188
+ .operations-entity-filters {
189
+ display: grid;
190
+ gap: 12px;
191
+ }
@@ -0,0 +1,18 @@
1
+ import { useCallback, useEffect, useRef, useState } from "react";
2
+
3
+ export function useOperationFilterFeedback() {
4
+ const [filterLoading, setFilterLoading] = useState(false);
5
+ const filterLoadingTimer = useRef<number | null>(null);
6
+ const showFilterLoading = useCallback(() => {
7
+ setFilterLoading(true);
8
+ if (filterLoadingTimer.current !== null) window.clearTimeout(filterLoadingTimer.current);
9
+ filterLoadingTimer.current = window.setTimeout(() => setFilterLoading(false), 220);
10
+ }, []);
11
+ useEffect(
12
+ () => () => {
13
+ if (filterLoadingTimer.current !== null) window.clearTimeout(filterLoadingTimer.current);
14
+ },
15
+ [],
16
+ );
17
+ return { filterLoading, showFilterLoading };
18
+ }