@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.
Files changed (887) hide show
  1. package/README.md +4 -2
  2. package/dist/services/adapter-hook-sources.d.ts +3 -0
  3. package/dist/services/adapter-hook-sources.d.ts.map +1 -0
  4. package/dist/services/adapter-hook-sources.js +3 -0
  5. package/dist/services/adapter-hook-sources.js.map +1 -0
  6. package/dist/services/adapters.d.ts.map +1 -1
  7. package/dist/services/adapters.js +76 -601
  8. package/dist/services/adapters.js.map +1 -1
  9. package/dist/services/adapters.test.js +41 -0
  10. package/dist/services/adapters.test.js.map +1 -1
  11. package/dist/services/agent-adapters.d.ts +7 -0
  12. package/dist/services/agent-adapters.d.ts.map +1 -1
  13. package/dist/services/agent-adapters.js +81 -13
  14. package/dist/services/agent-adapters.js.map +1 -1
  15. package/dist/services/agent-adapters.test.js +56 -7
  16. package/dist/services/agent-adapters.test.js.map +1 -1
  17. package/dist/services/claude-settings-template.d.ts +2 -0
  18. package/dist/services/claude-settings-template.d.ts.map +1 -0
  19. package/dist/services/claude-settings-template.js +8 -0
  20. package/dist/services/claude-settings-template.js.map +1 -0
  21. package/dist/services/codex-config-template.d.ts +3 -0
  22. package/dist/services/codex-config-template.d.ts.map +1 -0
  23. package/dist/services/codex-config-template.js +98 -0
  24. package/dist/services/codex-config-template.js.map +1 -0
  25. package/dist/services/codex-pre-tool-hook-template.d.ts +2 -0
  26. package/dist/services/codex-pre-tool-hook-template.d.ts.map +1 -0
  27. package/dist/services/codex-pre-tool-hook-template.js +472 -0
  28. package/dist/services/codex-pre-tool-hook-template.js.map +1 -0
  29. package/dist/services/codex-rules.d.ts +1 -1
  30. package/dist/services/codex-rules.d.ts.map +1 -1
  31. package/dist/services/codex-rules.js +22 -13
  32. package/dist/services/codex-rules.js.map +1 -1
  33. package/dist/services/codex-subagent-hook-template.d.ts +2 -0
  34. package/dist/services/codex-subagent-hook-template.d.ts.map +1 -0
  35. package/dist/services/codex-subagent-hook-template.js +250 -0
  36. package/dist/services/codex-subagent-hook-template.js.map +1 -0
  37. package/dist/services/doctor.d.ts.map +1 -1
  38. package/dist/services/doctor.js +8 -35
  39. package/dist/services/doctor.js.map +1 -1
  40. package/dist/services/global-codex-config.d.ts +12 -6
  41. package/dist/services/global-codex-config.d.ts.map +1 -1
  42. package/dist/services/global-codex-config.js +72 -53
  43. package/dist/services/global-codex-config.js.map +1 -1
  44. package/dist/services/global-codex-config.test.js +35 -84
  45. package/dist/services/global-codex-config.test.js.map +1 -1
  46. package/dist/services/install-agents-template.d.ts.map +1 -1
  47. package/dist/services/install-agents-template.js +55 -19
  48. package/dist/services/install-agents-template.js.map +1 -1
  49. package/dist/services/local-state-migration.d.ts +19 -0
  50. package/dist/services/local-state-migration.d.ts.map +1 -0
  51. package/dist/services/local-state-migration.js +122 -0
  52. package/dist/services/local-state-migration.js.map +1 -0
  53. package/dist/services/logger.d.ts.map +1 -1
  54. package/dist/services/logger.js +4 -6
  55. package/dist/services/logger.js.map +1 -1
  56. package/dist/services/logger.test.js +36 -3
  57. package/dist/services/logger.test.js.map +1 -1
  58. package/dist/services/runtime-template.test.js +22 -18
  59. package/dist/services/runtime-template.test.js.map +1 -1
  60. package/dist/services/template-manifest.d.ts +1 -0
  61. package/dist/services/template-manifest.d.ts.map +1 -1
  62. package/dist/services/template-manifest.js +31 -11
  63. package/dist/services/template-manifest.js.map +1 -1
  64. package/dist/services/transactional-files.d.ts.map +1 -1
  65. package/dist/services/transactional-files.js +84 -27
  66. package/dist/services/transactional-files.js.map +1 -1
  67. package/dist/types.d.ts +2 -1
  68. package/dist/types.d.ts.map +1 -1
  69. package/package.json +2 -2
  70. package/templates/.agents/config/agents/catalog.yaml +1081 -145
  71. package/templates/.agents/config/clients/codex/agents/zaip-agent-analyst.toml +30 -0
  72. package/templates/.agents/config/clients/codex/agents/zaip-agent-auditor.toml +30 -0
  73. package/templates/.agents/config/clients/codex/agents/zaip-agent-backend.toml +30 -0
  74. package/templates/.agents/config/clients/codex/agents/zaip-agent-builder.toml +31 -0
  75. package/templates/.agents/config/clients/codex/agents/zaip-agent-cloud-engineer.toml +30 -0
  76. package/templates/.agents/config/clients/codex/agents/zaip-agent-data-analyst.toml +30 -0
  77. package/templates/.agents/config/clients/codex/agents/zaip-agent-designer.toml +31 -0
  78. package/templates/.agents/config/clients/codex/agents/zaip-agent-finalizer.toml +31 -0
  79. package/templates/.agents/config/clients/codex/agents/zaip-agent-frontend.toml +31 -0
  80. package/templates/.agents/config/clients/codex/agents/zaip-agent-integrator.toml +30 -0
  81. package/templates/.agents/config/clients/codex/agents/zaip-agent-marketing-analyst.toml +30 -0
  82. package/templates/.agents/config/clients/codex/agents/zaip-agent-orchestrator.toml +37 -0
  83. package/templates/.agents/config/clients/codex/agents/zaip-agent-refactoring-specialist.toml +35 -0
  84. package/templates/.agents/config/clients/codex/agents/zaip-agent-reviewer.toml +30 -0
  85. package/templates/.agents/config/clients/codex/agents/zaip-agent-security-auditor.toml +30 -0
  86. package/templates/.agents/config/clients/codex/agents/zaip-agent-task-executor.toml +31 -0
  87. package/templates/.agents/config/clients/codex/agents/zaip-agent-website-developer.toml +30 -0
  88. package/templates/.agents/config/clients/codex/agents/zaip-agent-writer.toml +32 -0
  89. package/templates/.agents/config/clients.yaml +152 -0
  90. package/templates/{.zaip-aios → .agents/config}/pricing/models.json +4 -13
  91. package/templates/.agents/config/project.yaml +24 -1
  92. package/templates/.agents/dashboard/.zaip-managed.json +1140 -12
  93. package/templates/.agents/dashboard/README.md +23 -4
  94. package/templates/.agents/dashboard/apps/frontend/dist/assets/AgentCatalogSettingsPage-CLYIi7Vo.js +1 -0
  95. package/templates/.agents/dashboard/apps/frontend/dist/assets/AgentCatalogSettingsPage-DTDNVQGX.css +1 -0
  96. package/templates/.agents/dashboard/apps/frontend/dist/assets/DashboardHelpDialog-Cv-JcoxP.js +1320 -0
  97. package/templates/.agents/dashboard/apps/frontend/dist/assets/DashboardHelpDialog-Je5nK-Et.css +1 -0
  98. package/templates/.agents/dashboard/apps/frontend/dist/assets/PricingSettingsDialog-CzEggcRb.js +1 -0
  99. package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-05YKn6Z4.js +3 -0
  100. package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-YO3yqtgV.css +1 -0
  101. package/templates/.agents/dashboard/apps/frontend/dist/assets/dashboard-localization-C98LGC-Q.js +231 -0
  102. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-8AzCnl3a.js +77 -0
  103. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-DdBYQ_8D.css +1 -0
  104. package/templates/.agents/dashboard/apps/frontend/dist/index.html +2 -2
  105. package/templates/{.zaip-aios/dashboard/apps/frontend/dist → .agents/dashboard/apps/frontend}/index.html +1 -2
  106. package/templates/.agents/dashboard/apps/frontend/package.json +22 -0
  107. package/templates/.agents/dashboard/apps/frontend/src/AgentCatalogSettingsPage.tsx +617 -0
  108. package/templates/.agents/dashboard/apps/frontend/src/App.tsx +766 -0
  109. package/templates/.agents/dashboard/apps/frontend/src/AppLoadingPanels.tsx +134 -0
  110. package/templates/.agents/dashboard/apps/frontend/src/DashboardCapabilityNav.tsx +117 -0
  111. package/templates/.agents/dashboard/apps/frontend/src/DashboardHelpDialog.tsx +242 -0
  112. package/templates/.agents/dashboard/apps/frontend/src/PricingSettingsDialog.tsx +295 -0
  113. package/templates/.agents/dashboard/apps/frontend/src/ProjectSettingsPage.tsx +719 -0
  114. package/templates/.agents/dashboard/apps/frontend/src/TraceabilityWorkspace.tsx +72 -0
  115. package/templates/.agents/dashboard/apps/frontend/src/agent-catalog-settings-page.css +660 -0
  116. package/templates/.agents/dashboard/apps/frontend/src/agent-catalog-settings.test.ts +249 -0
  117. package/templates/.agents/dashboard/apps/frontend/src/dashboard-api.test.ts +31 -0
  118. package/templates/.agents/dashboard/apps/frontend/src/dashboard-api.ts +374 -0
  119. package/templates/.agents/dashboard/apps/frontend/src/dashboard-capability-nav.css +81 -0
  120. package/templates/.agents/dashboard/apps/frontend/src/dashboard-help-dialog.css +202 -0
  121. package/templates/.agents/dashboard/apps/frontend/src/dashboard-localization.test.ts +72 -0
  122. package/templates/.agents/dashboard/apps/frontend/src/dashboard-localization.ts +361 -0
  123. package/templates/.agents/dashboard/apps/frontend/src/loading-feedback.css +42 -0
  124. package/templates/{.zaip-aios/design/apps/catalog → .agents/dashboard/apps/frontend}/src/main.tsx +5 -1
  125. package/templates/.agents/dashboard/apps/frontend/src/operations-period.test.ts +18 -0
  126. package/templates/.agents/dashboard/apps/frontend/src/operations-period.ts +22 -0
  127. package/templates/.agents/dashboard/apps/frontend/src/pricing-settings-dialog.css +309 -0
  128. package/templates/.agents/dashboard/apps/frontend/src/project-settings-model.ts +129 -0
  129. package/templates/.agents/dashboard/apps/frontend/src/project-settings-page.css +335 -0
  130. package/templates/.agents/dashboard/apps/frontend/src/project-settings.test.ts +57 -0
  131. package/templates/.agents/dashboard/apps/frontend/src/snapshot-coherence.test.ts +79 -0
  132. package/templates/.agents/dashboard/apps/frontend/src/snapshot-coherence.ts +17 -0
  133. package/templates/.agents/dashboard/apps/frontend/src/styles.css +761 -0
  134. package/templates/.agents/dashboard/apps/frontend/src/traceability-workspace.css +70 -0
  135. package/templates/{.zaip-aios/design/apps/catalog → .agents/dashboard/apps/frontend}/tsconfig.json +1 -7
  136. package/templates/.agents/dashboard/apps/frontend/vite.config.ts +22 -0
  137. package/templates/{.zaip-aios/design/apps/catalog → .agents/dashboard/apps/frontend}/vitest.config.ts +3 -1
  138. package/templates/.agents/dashboard/dashboard.config.json +4 -0
  139. package/templates/.agents/dashboard/modules/cost-monitor/composition-root.ts +6 -0
  140. package/templates/.agents/dashboard/modules/cost-monitor/package.json +24 -0
  141. package/templates/.agents/dashboard/modules/cost-monitor/src/agent-groups.test.ts +43 -0
  142. package/templates/.agents/dashboard/modules/cost-monitor/src/agent-groups.ts +40 -0
  143. package/templates/.agents/dashboard/modules/cost-monitor/src/contracts.ts +221 -0
  144. package/templates/.agents/dashboard/modules/cost-monitor/src/provider.test.ts +19 -0
  145. package/templates/.agents/dashboard/modules/cost-monitor/src/provider.ts +5 -0
  146. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostCharts.test.ts +75 -0
  147. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostCharts.tsx +260 -0
  148. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostFilters.tsx +351 -0
  149. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostModelsAuditTable.test.ts +51 -0
  150. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostModelsAuditTable.tsx +327 -0
  151. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorIcons.tsx +50 -0
  152. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.test.ts +251 -0
  153. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.tsx +775 -0
  154. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostPeriodAverageCards.tsx +89 -0
  155. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostSummary.tsx +64 -0
  156. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTableIcons.tsx +9 -0
  157. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.test.ts +708 -0
  158. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.tsx +797 -0
  159. package/templates/.agents/dashboard/modules/cost-monitor/src/react/MacroCostTable.test.ts +79 -0
  160. package/templates/.agents/dashboard/modules/cost-monitor/src/react/MacroCostTable.tsx +218 -0
  161. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-duration.ts +17 -0
  162. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-copy.ts +84 -0
  163. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-embedded.css +11 -0
  164. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-layout.test.ts +28 -0
  165. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-responsive.css +123 -0
  166. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-summary.ts +130 -0
  167. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor.css +683 -0
  168. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-run-origin.css +28 -0
  169. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-table-metrics.ts +77 -0
  170. package/templates/.agents/dashboard/modules/cost-monitor/src/react/index.ts +2 -0
  171. package/templates/.agents/dashboard/modules/cost-monitor/src/react/period-cost-groups.test.ts +111 -0
  172. package/templates/.agents/dashboard/modules/cost-monitor/src/react/period-cost-groups.ts +140 -0
  173. package/templates/.agents/dashboard/modules/cost-monitor/src/run-display.ts +10 -0
  174. package/templates/.agents/dashboard/modules/cost-monitor/src/server/aggregate.test.ts +213 -0
  175. package/templates/.agents/dashboard/modules/cost-monitor/src/server/aggregate.ts +86 -0
  176. package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-pricing.test.ts +132 -0
  177. package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-projection-filtering.test.ts +193 -0
  178. package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-projection-pricing.test.ts +167 -0
  179. package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-projection.test-fixtures.ts +213 -0
  180. package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-projection.test.ts +793 -0
  181. package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-projection.ts +622 -0
  182. package/templates/.agents/dashboard/modules/cost-monitor/src/server/index.ts +2 -0
  183. package/templates/.agents/dashboard/modules/cost-monitor/src/server/run-telemetry.test.ts +36 -0
  184. package/templates/.agents/dashboard/modules/cost-monitor/src/server/run-telemetry.ts +22 -0
  185. package/templates/.agents/dashboard/modules/cost-monitor/src/task-cost-groups.test.ts +137 -0
  186. package/templates/.agents/dashboard/modules/cost-monitor/src/task-cost-groups.ts +64 -0
  187. package/templates/.agents/dashboard/modules/cost-monitor/tsconfig.json +10 -0
  188. package/templates/.agents/dashboard/modules/operations/composition-root.ts +19 -0
  189. package/templates/.agents/dashboard/modules/operations/package.json +30 -0
  190. package/templates/.agents/dashboard/modules/operations/src/contracts.ts +409 -0
  191. package/templates/.agents/dashboard/modules/operations/src/duration-population.test.ts +16 -0
  192. package/templates/.agents/dashboard/modules/operations/src/duration-population.ts +35 -0
  193. package/templates/.agents/dashboard/modules/operations/src/react/EntityDetailsDialog.tsx +309 -0
  194. package/templates/.agents/dashboard/modules/operations/src/react/EntityTables.test.ts +33 -0
  195. package/templates/.agents/dashboard/modules/operations/src/react/EntityTables.tsx +491 -0
  196. package/templates/.agents/dashboard/modules/operations/src/react/MacroBoard.test.ts +28 -0
  197. package/templates/.agents/dashboard/modules/operations/src/react/MacroBoard.tsx +313 -0
  198. package/templates/.agents/dashboard/modules/operations/src/react/MacroGrid.tsx +61 -0
  199. package/templates/.agents/dashboard/modules/operations/src/react/MacroPlanningDialog.tsx +427 -0
  200. package/templates/.agents/dashboard/modules/operations/src/react/OperationDateFilters.test.ts +32 -0
  201. package/templates/.agents/dashboard/modules/operations/src/react/OperationDateFilters.tsx +124 -0
  202. package/templates/.agents/dashboard/modules/operations/src/react/OperationsIcons.tsx +58 -0
  203. package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.helpers.tsx +412 -0
  204. package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.test.ts +498 -0
  205. package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.tsx +621 -0
  206. package/templates/.agents/dashboard/modules/operations/src/react/OperationsPage.tsx +800 -0
  207. package/templates/.agents/dashboard/modules/operations/src/react/OperationsPageDetails.tsx +113 -0
  208. package/templates/.agents/dashboard/modules/operations/src/react/PeriodSummaryTable.tsx +248 -0
  209. package/templates/.agents/dashboard/modules/operations/src/react/PrdDocumentDialog.tsx +235 -0
  210. package/templates/.agents/dashboard/modules/operations/src/react/TaskBoard.test.ts +141 -0
  211. package/templates/.agents/dashboard/modules/operations/src/react/TaskBoard.tsx +352 -0
  212. package/templates/.agents/dashboard/modules/operations/src/react/TaskDetailsDialog.tsx +134 -0
  213. package/templates/.agents/dashboard/modules/operations/src/react/UnifiedWorkBoard.tsx +502 -0
  214. package/templates/.agents/dashboard/modules/operations/src/react/UnifiedWorkList.test.ts +48 -0
  215. package/templates/.agents/dashboard/modules/operations/src/react/UnifiedWorkList.tsx +298 -0
  216. package/templates/.agents/dashboard/modules/operations/src/react/card-elapsed-time.css +19 -0
  217. package/templates/.agents/dashboard/modules/operations/src/react/card-elapsed-time.test.ts +47 -0
  218. package/templates/.agents/dashboard/modules/operations/src/react/card-elapsed-time.ts +66 -0
  219. package/templates/.agents/dashboard/modules/operations/src/react/card-type-colors.css +35 -0
  220. package/templates/.agents/dashboard/modules/operations/src/react/conversation-rows.test.ts +50 -0
  221. package/templates/.agents/dashboard/modules/operations/src/react/conversation-rows.ts +75 -0
  222. package/templates/.agents/dashboard/modules/operations/src/react/entity-details-dialog.css +76 -0
  223. package/templates/.agents/dashboard/modules/operations/src/react/execution-metrics.test.ts +170 -0
  224. package/templates/.agents/dashboard/modules/operations/src/react/execution-metrics.ts +88 -0
  225. package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportAction.test.ts +32 -0
  226. package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportAction.tsx +93 -0
  227. package/templates/.agents/dashboard/modules/operations/src/react/export/ExportProgressToast.tsx +26 -0
  228. package/templates/.agents/dashboard/modules/operations/src/react/export/export-layout.test.ts +67 -0
  229. package/templates/.agents/dashboard/modules/operations/src/react/export/export-session.test.ts +208 -0
  230. package/templates/.agents/dashboard/modules/operations/src/react/export/export-session.ts +194 -0
  231. package/templates/.agents/dashboard/modules/operations/src/react/export/export.css +31 -0
  232. package/templates/.agents/dashboard/modules/operations/src/react/format-card-created-at.test.ts +19 -0
  233. package/templates/.agents/dashboard/modules/operations/src/react/format-card-created-at.ts +19 -0
  234. package/templates/.agents/dashboard/modules/operations/src/react/format-rounded-duration.test.ts +27 -0
  235. package/templates/.agents/dashboard/modules/operations/src/react/format-rounded-duration.ts +14 -0
  236. package/templates/.agents/dashboard/modules/operations/src/react/fullscreen-dialog.test.tsx +113 -0
  237. package/templates/.agents/dashboard/modules/operations/src/react/index.ts +10 -0
  238. package/templates/.agents/dashboard/modules/operations/src/react/macro-dialog-data.test.ts +70 -0
  239. package/templates/.agents/dashboard/modules/operations/src/react/macro-dialog-data.ts +24 -0
  240. package/templates/.agents/dashboard/modules/operations/src/react/macro-dialog-usage.tsx +83 -0
  241. package/templates/.agents/dashboard/modules/operations/src/react/macro-planning-dialog-responsive.css +74 -0
  242. package/templates/.agents/dashboard/modules/operations/src/react/macro-planning-dialog.css +752 -0
  243. package/templates/.agents/dashboard/modules/operations/src/react/metric-accessibility.test.ts +17 -0
  244. package/templates/.agents/dashboard/modules/operations/src/react/operation-date-range.test.ts +55 -0
  245. package/templates/.agents/dashboard/modules/operations/src/react/operation-date-range.ts +135 -0
  246. package/templates/.agents/dashboard/modules/operations/src/react/operation-duration.test.ts +19 -0
  247. package/templates/.agents/dashboard/modules/operations/src/react/operation-duration.ts +27 -0
  248. package/templates/.agents/dashboard/modules/operations/src/react/operations-date-filters.css +154 -0
  249. package/templates/.agents/dashboard/modules/operations/src/react/operations-filter-panel.css +187 -0
  250. package/templates/.agents/dashboard/modules/operations/src/react/operations-layout.test.ts +15 -0
  251. package/templates/.agents/dashboard/modules/operations/src/react/operations-overview-period-filter.test.ts +69 -0
  252. package/templates/.agents/dashboard/modules/operations/src/react/operations-overview.css +588 -0
  253. package/templates/.agents/dashboard/modules/operations/src/react/operations-page-filters.ts +51 -0
  254. package/templates/.agents/dashboard/modules/operations/src/react/operations-responsive.css +94 -0
  255. package/templates/.agents/dashboard/modules/operations/src/react/operations-table-badges.css +57 -0
  256. package/templates/.agents/dashboard/modules/operations/src/react/operations-view-order.test.ts +19 -0
  257. package/templates/.agents/dashboard/modules/operations/src/react/operations.css +753 -0
  258. package/templates/.agents/dashboard/modules/operations/src/react/period-summary.css +12 -0
  259. package/templates/.agents/dashboard/modules/operations/src/react/period-summary.test.ts +472 -0
  260. package/templates/.agents/dashboard/modules/operations/src/react/period-summary.ts +237 -0
  261. package/templates/.agents/dashboard/modules/operations/src/react/popup-localization.test.ts +48 -0
  262. package/templates/.agents/dashboard/modules/operations/src/react/run-scope.test.ts +29 -0
  263. package/templates/.agents/dashboard/modules/operations/src/react/run-scope.ts +25 -0
  264. package/templates/.agents/dashboard/modules/operations/src/react/sort-by-created-at.test.ts +35 -0
  265. package/templates/.agents/dashboard/modules/operations/src/react/sort-by-created-at.ts +11 -0
  266. package/templates/.agents/dashboard/modules/operations/src/react/status-labels.ts +36 -0
  267. package/templates/.agents/dashboard/modules/operations/src/react/table-order.test.ts +34 -0
  268. package/templates/.agents/dashboard/modules/operations/src/react/table-order.ts +15 -0
  269. package/templates/.agents/dashboard/modules/operations/src/react/task-origin-badge.css +23 -0
  270. package/templates/.agents/dashboard/modules/operations/src/react/task-origin.test.ts +46 -0
  271. package/templates/.agents/dashboard/modules/operations/src/react/task-origin.ts +27 -0
  272. package/templates/.agents/dashboard/modules/operations/src/react/unified-work-board.css +187 -0
  273. package/templates/.agents/dashboard/modules/operations/src/react/use-current-time.ts +12 -0
  274. package/templates/.agents/dashboard/modules/operations/src/react/use-infinite-column.ts +29 -0
  275. package/templates/.agents/dashboard/modules/operations/src/react/work-board-model.test.ts +247 -0
  276. package/templates/.agents/dashboard/modules/operations/src/react/work-board-model.ts +179 -0
  277. package/templates/.agents/dashboard/modules/operations/src/server/build-operations-projection-helpers.ts +43 -0
  278. package/templates/.agents/dashboard/modules/operations/src/server/build-operations-projection.test.ts +364 -0
  279. package/templates/.agents/dashboard/modules/operations/src/server/build-operations-projection.ts +787 -0
  280. package/templates/.agents/dashboard/modules/operations/src/server/canonical-compat.ts +176 -0
  281. package/templates/.agents/dashboard/modules/operations/src/server/canonical-run-projection.ts +140 -0
  282. package/templates/.agents/dashboard/modules/operations/src/server/execution-relationship-counts.test.ts +137 -0
  283. package/templates/.agents/dashboard/modules/operations/src/server/execution-relationship-counts.ts +121 -0
  284. package/templates/.agents/dashboard/modules/operations/src/server/filter.test.ts +33 -0
  285. package/templates/.agents/dashboard/modules/operations/src/server/filter.ts +17 -0
  286. package/templates/.agents/dashboard/modules/operations/src/server/index.ts +2 -0
  287. package/templates/.agents/dashboard/modules/operations/src/server/internal.ts +8 -0
  288. package/templates/.agents/dashboard/modules/operations/src/server/macro.ts +68 -0
  289. package/templates/.agents/dashboard/modules/operations/src/server/metric-coverage.ts +60 -0
  290. package/templates/.agents/dashboard/modules/operations/src/server/planned-task-previews.test.ts +22 -0
  291. package/templates/.agents/dashboard/modules/operations/src/server/planned-task-previews.ts +55 -0
  292. package/templates/.agents/dashboard/modules/operations/src/server/read-task-detail.ts +86 -0
  293. package/templates/.agents/dashboard/modules/operations/src/server/run-order.test.ts +23 -0
  294. package/templates/.agents/dashboard/modules/operations/src/server/run-order.ts +11 -0
  295. package/templates/.agents/dashboard/modules/operations/src/server/runs.test.ts +27 -0
  296. package/templates/.agents/dashboard/modules/operations/src/server/runs.ts +77 -0
  297. package/templates/.agents/dashboard/modules/operations/src/server/task-test-counts.test.ts +32 -0
  298. package/templates/.agents/dashboard/modules/operations/src/server/task-test-counts.ts +49 -0
  299. package/templates/.agents/dashboard/modules/operations/src/server/usage.test.ts +25 -0
  300. package/templates/.agents/dashboard/modules/operations/src/server/usage.ts +139 -0
  301. package/templates/.agents/dashboard/modules/operations/src/work-readiness.ts +26 -0
  302. package/templates/.agents/dashboard/modules/operations/tsconfig.json +10 -0
  303. package/templates/.agents/dashboard/modules/traceability/composition-root.ts +7 -0
  304. package/templates/.agents/dashboard/modules/traceability/golden/golden-view.test.ts +27 -0
  305. package/templates/.agents/dashboard/modules/traceability/golden/golden-view.ts +57 -0
  306. package/templates/.agents/dashboard/modules/traceability/golden/index.ts +1 -0
  307. package/templates/.agents/dashboard/modules/traceability/package.json +26 -0
  308. package/templates/.agents/dashboard/modules/traceability/src/contracts.ts +76 -0
  309. package/templates/.agents/dashboard/modules/traceability/src/react/TaskTracePanel.test.ts +80 -0
  310. package/templates/.agents/dashboard/modules/traceability/src/react/TaskTracePanel.tsx +681 -0
  311. package/templates/.agents/dashboard/modules/traceability/src/react/TraceDocumentDialog.tsx +34 -0
  312. package/templates/.agents/dashboard/modules/traceability/src/react/TraceStageDetail.tsx +129 -0
  313. package/templates/.agents/dashboard/modules/traceability/src/react/TraceStageDialog.tsx +49 -0
  314. package/templates/.agents/dashboard/modules/traceability/src/react/index.ts +1 -0
  315. package/templates/.agents/dashboard/modules/traceability/src/react/traceability-embedded.css +9 -0
  316. package/templates/.agents/dashboard/modules/traceability/src/react/traceability-navigation.css +122 -0
  317. package/templates/.agents/dashboard/modules/traceability/src/react/traceability-stage-detail.css +175 -0
  318. package/templates/.agents/dashboard/modules/traceability/src/react/traceability-stage-dialog.css +127 -0
  319. package/templates/.agents/dashboard/modules/traceability/src/react/traceability-usage.css +120 -0
  320. package/templates/.agents/dashboard/modules/traceability/src/react/traceability.css +727 -0
  321. package/templates/.agents/dashboard/modules/traceability/src/server/build-task-trace.test.ts +311 -0
  322. package/templates/.agents/dashboard/modules/traceability/src/server/build-task-trace.ts +421 -0
  323. package/templates/.agents/dashboard/modules/traceability/src/server/index.ts +1 -0
  324. package/templates/.agents/dashboard/modules/traceability/tsconfig.json +10 -0
  325. package/templates/.agents/dashboard/packages/branding/package.json +14 -0
  326. package/templates/.agents/dashboard/packages/branding/src/index.ts +10 -0
  327. package/templates/.agents/dashboard/packages/branding/tsconfig.json +7 -0
  328. package/templates/.agents/dashboard/packages/contracts/package.json +17 -0
  329. package/templates/.agents/dashboard/packages/contracts/src/export.ts +29 -0
  330. package/templates/.agents/dashboard/packages/contracts/src/index.ts +155 -0
  331. package/templates/.agents/dashboard/packages/contracts/src/period-counts.test.ts +48 -0
  332. package/templates/.agents/dashboard/packages/contracts/tsconfig.json +7 -0
  333. package/templates/.agents/dashboard/packages/data-export/package.json +19 -0
  334. package/templates/.agents/dashboard/packages/data-export/src/index.test.ts +268 -0
  335. package/templates/.agents/dashboard/packages/data-export/src/index.ts +84 -0
  336. package/templates/.agents/dashboard/packages/data-export/src/ooxml-stream.test.ts +19 -0
  337. package/templates/.agents/dashboard/packages/data-export/src/ooxml-stream.ts +260 -0
  338. package/templates/.agents/dashboard/packages/local-runtime/package.json +31 -0
  339. package/templates/.agents/dashboard/packages/local-runtime/server.mjs +68 -46
  340. package/templates/.agents/dashboard/packages/local-runtime/src/agent-catalog-settings.test.ts +224 -0
  341. package/templates/.agents/dashboard/packages/local-runtime/src/agent-catalog-settings.ts +320 -0
  342. package/templates/.agents/dashboard/packages/local-runtime/src/export/index.ts +7 -0
  343. package/templates/.agents/dashboard/packages/local-runtime/src/manifest-runs.ts +204 -0
  344. package/templates/.agents/dashboard/packages/local-runtime/src/project-settings.test.ts +92 -0
  345. package/templates/.agents/dashboard/packages/local-runtime/src/project-settings.ts +32 -0
  346. package/templates/.agents/dashboard/packages/local-runtime/src/runtime.mjs +222 -0
  347. package/templates/.agents/dashboard/packages/local-runtime/src/server-settings.test.ts +217 -0
  348. package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot.test.ts +526 -0
  349. package/templates/.agents/dashboard/packages/local-runtime/src/server-summary-helpers.ts +73 -0
  350. package/templates/.agents/dashboard/packages/local-runtime/src/server.test-fixtures.ts +147 -0
  351. package/templates/.agents/dashboard/packages/local-runtime/src/server.test.ts +580 -0
  352. package/templates/.agents/dashboard/packages/local-runtime/src/server.ts +799 -0
  353. package/templates/.agents/dashboard/packages/local-runtime/src/start-dashboard.mjs +81 -0
  354. package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.mjs +85 -33
  355. package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.test.mjs +378 -0
  356. package/templates/.agents/dashboard/packages/local-runtime/tsconfig.json +8 -0
  357. package/templates/.agents/dashboard/packages/ui/package.json +18 -0
  358. package/templates/.agents/dashboard/packages/ui/src/DashboardHeader.test.mjs +20 -0
  359. package/templates/.agents/dashboard/packages/ui/src/DashboardHeader.tsx +273 -0
  360. package/templates/.agents/dashboard/packages/ui/src/DataTable.test.tsx +61 -0
  361. package/templates/.agents/dashboard/packages/ui/src/DataTable.tsx +292 -0
  362. package/templates/.agents/dashboard/packages/ui/src/PeriodAverageCards.test.tsx +27 -0
  363. package/templates/.agents/dashboard/packages/ui/src/PeriodAverageCards.tsx +27 -0
  364. package/templates/.agents/dashboard/packages/ui/src/format.test.ts +54 -0
  365. package/templates/.agents/dashboard/packages/ui/src/format.ts +81 -0
  366. package/templates/.agents/dashboard/packages/ui/src/index.ts +6 -0
  367. package/templates/.agents/dashboard/packages/ui/src/period-average-cards.css +64 -0
  368. package/templates/.agents/dashboard/packages/ui/src/ui.css +451 -0
  369. package/templates/.agents/dashboard/packages/ui/tsconfig.json +10 -0
  370. package/templates/.agents/dashboard/packages/windows-launcher/Program.cs +214 -0
  371. package/templates/.agents/dashboard/packages/windows-launcher/ZaipDashboardLauncher.csproj +11 -0
  372. package/templates/.agents/dashboard/packages/windows-launcher/build-dashboard-launcher.ps1 +142 -0
  373. package/templates/.agents/dashboard/packages/windows-launcher/zaip-dashboard.cmd +4 -0
  374. package/templates/.agents/dashboard/tests/e2e/package.json +18 -0
  375. package/templates/.agents/dashboard/tests/e2e/playwright.config.ts +33 -0
  376. package/templates/.agents/dashboard/tests/e2e/specs/dashboard.spec.ts +531 -0
  377. package/templates/.agents/dashboard/tests/e2e/tsconfig.json +9 -0
  378. package/templates/.agents/dashboard/zaip-dashboard.exe +0 -0
  379. package/templates/{.zaip-aios → .agents}/design/.zaip-managed.json +62 -50
  380. package/templates/.agents/design/DESIGN.md +7 -0
  381. package/templates/.agents/design/apps/catalog/dist/assets/index-BEmIE7WE.css +1 -0
  382. package/templates/{.zaip-aios/design/apps/catalog/dist/assets/index-Bvwc3Bgw.js → .agents/design/apps/catalog/dist/assets/index-CqqYWY2f.js} +1 -1
  383. package/templates/.agents/design/apps/catalog/dist/assets/{index-Bvwc3Bgw.js → index-D9pj7Jlf.js} +1 -1
  384. package/templates/.agents/design/apps/catalog/dist/index.html +2 -2
  385. package/templates/.agents/design/apps/catalog/dist/storybook/assets/CatalogShell-BWY-80s4.js +1 -0
  386. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{Color-6AOWCN3U-D8qyAXo4.js → Color-6AOWCN3U-B-kAgAjB.js} +1 -1
  387. package/templates/.agents/design/apps/catalog/dist/storybook/assets/Components.stories-Be2mDUQj.js +27 -0
  388. package/templates/.agents/design/apps/catalog/dist/storybook/assets/DesignSystem.stories-DRx9blDs.js +1 -0
  389. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{DocsRenderer-JROSPFPF-LmiVo77Q.js → DocsRenderer-JROSPFPF-BVN7xHtv.js} +4 -4
  390. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{WithTooltip-7X4HQR7L-CTMWAwDe.js → WithTooltip-7X4HQR7L-CDHtKYkz.js} +1 -1
  391. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{chunk-DRQKCCAG-DUhJxxRU.js → chunk-DRQKCCAG-D6AsDkMK.js} +1 -1
  392. 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
  393. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{components-BX1OfYUi.js → components-CN8YyTUg.js} +5 -5
  394. package/templates/.agents/design/apps/catalog/dist/storybook/assets/formatter-L2YTDE3Q-EwuTh8Zk.js +1 -0
  395. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{iframe-LMhZM1ce.js → iframe-9yZfIsdT.js} +3 -3
  396. package/templates/.agents/design/apps/catalog/dist/storybook/assets/iframe-BEmIE7WE.css +1 -0
  397. 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
  398. package/templates/.agents/design/apps/catalog/dist/storybook/assets/react-DyL61NPT.js +1 -0
  399. 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
  400. 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
  401. package/templates/.agents/design/apps/catalog/dist/storybook/iframe.html +2 -2
  402. package/templates/.agents/design/apps/catalog/dist/storybook/index.json +1 -1
  403. package/templates/.agents/design/apps/catalog/src/components/Primitives.tsx +168 -2
  404. package/templates/.agents/design/apps/catalog/src/components/dialog-focus.test.ts +42 -0
  405. package/templates/.agents/design/apps/catalog/src/components/dialog-focus.ts +38 -0
  406. package/templates/.agents/design/apps/catalog/src/design-contract.test.ts +37 -8
  407. package/templates/.agents/design/apps/catalog/src/pages/ComponentsPage.tsx +89 -28
  408. package/templates/.agents/design/apps/catalog/src/stories/Components.stories.tsx +54 -0
  409. package/templates/.agents/design/apps/catalog/src/styles/components.css +204 -3
  410. package/templates/.agents/design/apps/catalog/src/styles/design-system.css +2 -0
  411. package/templates/.agents/design/apps/catalog/src/styles.css +5 -0
  412. package/templates/.agents/design/tokens.json +9 -1
  413. package/templates/.agents/requirements/autonomous-assurance.md +9 -10
  414. package/templates/.agents/requirements/comparative-audit.md +22 -0
  415. package/templates/.agents/requirements/context-engine.md +5 -5
  416. package/templates/.agents/requirements/cost-observability.md +3 -2
  417. package/templates/.agents/requirements/data-export.md +57 -0
  418. package/templates/.agents/requirements/design-system.md +2 -2
  419. package/templates/.agents/requirements/execution-engine.md +8 -6
  420. package/templates/.agents/requirements/kanban-dashboard.md +3 -3
  421. package/templates/.agents/requirements/model-orchestration.md +11 -11
  422. package/templates/.agents/requirements/public-distribution.md +4 -4
  423. package/templates/.agents/requirements/software-architecture.md +4 -4
  424. package/templates/.agents/requirements/strategic-improvements.md +24 -0
  425. package/templates/.agents/requirements/work-lifecycle.md +20 -10
  426. package/templates/.agents/requirements/zaip-strategic-95.md +20 -0
  427. package/templates/.agents/rules/{zaip/architecture.md → architecture.md} +1 -1
  428. package/templates/{.zaip-aios/templates/rules/zaip → .agents/rules}/context.md +3 -3
  429. package/templates/.agents/rules/core.md +21 -0
  430. package/templates/.agents/rules/{zaip/evolution.md → evolution.md} +1 -1
  431. package/templates/.agents/rules/frontend-lite.md +18 -0
  432. package/templates/{.zaip-aios/templates/rules/zaip → .agents/rules}/model-orchestration.md +1 -1
  433. package/templates/.agents/rules/run-lifecycle-closure.md +24 -0
  434. package/templates/{.zaip-aios/templates/rules/zaip → .agents/rules}/security.md +1 -1
  435. package/templates/.agents/rules/text-writing-utf8.md +12 -0
  436. package/templates/.agents/rules/workflow.md +25 -0
  437. package/templates/{.zaip-aios → .agents/runtime}/bin/zaip.mjs +399 -195
  438. package/templates/.agents/runtime/checksums.sha256 +9 -0
  439. package/templates/.agents/runtime/manifest.json +16 -0
  440. package/templates/{.zaip-aios → .agents/runtime}/sbom.cdx.json +532 -10
  441. package/templates/.agents/skills/criar-pasta-obsidian/SKILL.md +20 -0
  442. package/templates/.agents/skills/criar-pasta-obsidian/agents/openai.yaml +4 -0
  443. package/templates/.agents/skills/criar-pasta-obsidian/scripts/generate-obsidian-vault.mjs +414 -0
  444. package/templates/.agents/skills/criar-pasta-obsidian/scripts/generate-obsidian-vault.test.mjs +144 -0
  445. package/templates/.agents/skills/zaip-aios/SKILL.md +2 -2
  446. package/templates/.agents/skills/zaip-aios/agents/openai.yaml +4 -0
  447. package/templates/.agents/skills/zaip-skill-adapters/SKILL.md +1 -1
  448. package/templates/.agents/skills/zaip-skill-backend/SKILL.md +10 -0
  449. package/templates/.agents/skills/zaip-skill-backend/agents/openai.yaml +4 -0
  450. package/templates/.agents/skills/zaip-skill-cloud-engineering/SKILL.md +10 -0
  451. package/templates/.agents/skills/zaip-skill-cloud-engineering/agents/openai.yaml +4 -0
  452. package/templates/.agents/skills/zaip-skill-config/SKILL.md +3 -3
  453. package/templates/.agents/skills/zaip-skill-data-analyst/SKILL.md +23 -0
  454. package/templates/.agents/skills/zaip-skill-data-analyst/agents/openai.yaml +4 -0
  455. package/templates/.agents/skills/zaip-skill-design-system/SKILL.md +50 -0
  456. package/templates/.agents/skills/zaip-skill-design-system/agents/openai.yaml +4 -0
  457. package/templates/.agents/skills/zaip-skill-design-system/references/scope.md +21 -0
  458. package/templates/.agents/skills/zaip-skill-enforce-architecture/SKILL.md +2 -2
  459. package/templates/.agents/skills/zaip-skill-execution/SKILL.md +11 -8
  460. package/templates/.agents/skills/zaip-skill-execution/references/prepared-plan.md +2 -0
  461. package/templates/.agents/skills/zaip-skill-frontend/SKILL.md +10 -0
  462. package/templates/.agents/skills/zaip-skill-frontend/agents/openai.yaml +4 -0
  463. package/templates/.agents/skills/zaip-skill-github-deploy/SKILL.md +41 -15
  464. package/templates/.agents/skills/zaip-skill-github-deploy/agents/openai.yaml +2 -2
  465. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/github-deploy-contract.test.mjs +80 -0
  466. package/templates/.agents/skills/zaip-skill-github-setup/SKILL.md +1 -1
  467. package/templates/.agents/skills/zaip-skill-marketing/SKILL.md +10 -0
  468. package/templates/.agents/skills/zaip-skill-marketing/agents/openai.yaml +4 -0
  469. package/templates/.agents/skills/zaip-skill-move-prd/SKILL.md +10 -6
  470. package/templates/.agents/skills/zaip-skill-move-spec/SKILL.md +9 -6
  471. package/templates/.agents/skills/zaip-skill-observability/SKILL.md +1 -1
  472. package/templates/.agents/skills/zaip-skill-prd/SKILL.md +27 -11
  473. package/templates/.agents/skills/zaip-skill-reconcile-telemetry/SKILL.md +3 -4
  474. package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-local-telemetry.mjs +59 -13
  475. package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-lib.mjs +131 -28
  476. package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-lib.test.mjs +81 -2
  477. package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-remeasurement.mjs +167 -0
  478. package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-remeasurement.test.mjs +267 -0
  479. package/templates/.agents/skills/zaip-skill-refactor-existing-code/SKILL.md +55 -0
  480. package/templates/.agents/skills/zaip-skill-refactor-existing-code/agents/openai.yaml +4 -0
  481. package/templates/.agents/skills/zaip-skill-refactor-existing-code/references/refactor-map-contract.md +33 -0
  482. package/templates/.agents/skills/zaip-skill-refactor-existing-code/references/visual-modes.md +17 -0
  483. package/templates/.agents/skills/zaip-skill-refactor-existing-code/scripts/inventory-source.mjs +181 -0
  484. package/templates/.agents/skills/zaip-skill-refactor-existing-code/scripts/refactor-scripts.test.mjs +293 -0
  485. package/templates/.agents/skills/zaip-skill-refactor-existing-code/scripts/validate-refactor-map.mjs +294 -0
  486. package/templates/.agents/skills/zaip-skill-requirements/SKILL.md +1 -1
  487. package/templates/.agents/skills/zaip-skill-review/SKILL.md +1 -1
  488. package/templates/.agents/skills/zaip-skill-rules/SKILL.md +4 -4
  489. package/templates/.agents/skills/zaip-skill-setup/SKILL.md +2 -2
  490. package/templates/.agents/skills/zaip-skill-spec/SKILL.md +10 -10
  491. package/templates/.agents/skills/zaip-skill-task/SKILL.md +3 -3
  492. package/templates/.agents/skills/zaip-skill-tool-setup/references/secrets.md +1 -1
  493. package/templates/.agents/skills/zaip-skill-tool-setup/scripts/tool-state.mjs +1 -1
  494. package/templates/.agents/skills/zaip-skill-website-readiness/SKILL.md +53 -0
  495. package/templates/.agents/skills/zaip-skill-website-readiness/agents/openai.yaml +4 -0
  496. package/templates/.agents/skills/zaip-skill-website-readiness/references/capability-checklist.md +32 -0
  497. package/templates/.agents/tools/catalog.yaml +0 -6
  498. package/templates/.agents/zaip-aios/README.md +1 -1
  499. package/templates/.agents/zaip-aios/guides/01-primeiros-passos.md +4 -2
  500. package/templates/.agents/zaip-aios/guides/03-tasks.md +6 -0
  501. package/templates/.agents/zaip-aios/guides/04-specs.md +7 -3
  502. package/templates/.agents/zaip-aios/guides/05-prds.md +26 -1
  503. package/templates/.agents/zaip-aios/guides/06-execucao.md +10 -0
  504. package/templates/.agents/zaip-aios/guides/08-contexto-e-tokens.md +1 -1
  505. package/templates/.agents/zaip-aios/guides/11-observabilidade-e-custos.md +2 -0
  506. package/templates/.agents/zaip-aios/guides/13-boas-praticas.md +3 -0
  507. package/templates/.agents/zaip-aios/guides/14-troubleshooting.md +3 -1
  508. package/templates/.agents/zaip-aios/guides/16-lifecycle-e-reconciliacao.md +7 -1
  509. package/templates/.local/gitignore.template +2 -0
  510. package/templates/template-manifest.json +1650 -1859
  511. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-_yxs47Hd.css +0 -1
  512. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-ehU9Etwm.js +0 -1207
  513. package/templates/.agents/design/apps/catalog/dist/assets/index-B4pfFtvJ.css +0 -1
  514. package/templates/.agents/design/apps/catalog/dist/storybook/assets/Components.stories-DkBtOSHX.js +0 -1
  515. package/templates/.agents/design/apps/catalog/dist/storybook/assets/DesignSystem.stories-BttERyCr.js +0 -1
  516. package/templates/.agents/design/apps/catalog/dist/storybook/assets/Primitives-HZpQ6PjX.js +0 -1
  517. package/templates/.agents/design/apps/catalog/dist/storybook/assets/chunk-W22LQPXL-9RCn9-l7.js +0 -18
  518. package/templates/.agents/design/apps/catalog/dist/storybook/assets/formatter-L2YTDE3Q-Bu6KfEwW.js +0 -1
  519. package/templates/.agents/design/apps/catalog/dist/storybook/assets/iframe-B4pfFtvJ.css +0 -1
  520. package/templates/.agents/design/apps/catalog/dist/storybook/assets/react-18-jAz3avmR.js +0 -9
  521. package/templates/.agents/design/apps/catalog/dist/storybook/assets/react-DvDPBd6Q.js +0 -1
  522. package/templates/.agents/design/apps/catalog/dist/storybook/assets/syntaxhighlighter-YFXUGROL-DV8X2acD.js +0 -6
  523. package/templates/.agents/design/apps/catalog/dist/storybook/assets/theming-CHbHkcNi.js +0 -39
  524. package/templates/.agents/rules/project/.gitkeep +0 -0
  525. package/templates/.agents/rules/zaip/context.md +0 -22
  526. package/templates/.agents/rules/zaip/core.md +0 -24
  527. package/templates/.agents/rules/zaip/model-orchestration.md +0 -48
  528. package/templates/.agents/rules/zaip/security.md +0 -20
  529. package/templates/.agents/rules/zaip/workflow.md +0 -35
  530. package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/inspect-local-sqlite.py +0 -52
  531. package/templates/.agents/tools/mcp/development/sqlite/README.md +0 -20
  532. package/templates/.agents/tools/mcp/development/sqlite/manifest.yaml +0 -25
  533. package/templates/.zaip-aios/checksums.sha256 +0 -370
  534. package/templates/.zaip-aios/dashboard/.zaip-managed.json +0 -46
  535. package/templates/.zaip-aios/dashboard/README.md +0 -91
  536. package/templates/.zaip-aios/dashboard/apps/frontend/dist/assets/index-_yxs47Hd.css +0 -1
  537. package/templates/.zaip-aios/dashboard/apps/frontend/dist/assets/index-ehU9Etwm.js +0 -1207
  538. package/templates/.zaip-aios/dashboard/apps/frontend/dist/assets/logo_novo_azul-BBx5pA2B.png +0 -0
  539. package/templates/.zaip-aios/dashboard/packages/local-runtime/server.mjs +0 -199
  540. package/templates/.zaip-aios/dashboard/packages/local-runtime/start-dashboard.mjs +0 -726
  541. package/templates/.zaip-aios/dashboard/zaip-dashboard.exe +0 -0
  542. package/templates/.zaip-aios/design/DESIGN.md +0 -180
  543. package/templates/.zaip-aios/design/README.md +0 -47
  544. package/templates/.zaip-aios/design/apps/catalog/.storybook/main.ts +0 -15
  545. package/templates/.zaip-aios/design/apps/catalog/.storybook/preview.ts +0 -21
  546. package/templates/.zaip-aios/design/apps/catalog/dist/assets/index-B4pfFtvJ.css +0 -1
  547. package/templates/.zaip-aios/design/apps/catalog/dist/index.html +0 -14
  548. package/templates/.zaip-aios/design/apps/catalog/dist/logo_novo_azul.png +0 -0
  549. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/Color-6AOWCN3U-D8qyAXo4.js +0 -1
  550. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/Components.stories-DkBtOSHX.js +0 -1
  551. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/DesignSystem.stories-BttERyCr.js +0 -1
  552. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/DocsRenderer-JROSPFPF-LmiVo77Q.js +0 -46
  553. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/Primitives-HZpQ6PjX.js +0 -1
  554. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/WithTooltip-7X4HQR7L-CTMWAwDe.js +0 -9
  555. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/axe-Bk3eEgJf.js +0 -20
  556. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/chunk-242VQQM5-DB2JSNUA.js +0 -1
  557. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/chunk-DRQKCCAG-DUhJxxRU.js +0 -1
  558. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/chunk-QQBDHPVZ-nYh9QWsm.js +0 -1
  559. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/components-BX1OfYUi.js +0 -243
  560. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/formatter-L2YTDE3Q-Bu6KfEwW.js +0 -1
  561. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/iframe-B4pfFtvJ.css +0 -1
  562. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/iframe-LMhZM1ce.js +0 -1154
  563. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/jsx-runtime-f3rHp9ZU.js +0 -1
  564. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/matchers-JIUQ3HVY-9iRExWZO.js +0 -28
  565. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/preload-helper-BdFrVu1K.js +0 -1
  566. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/assets/react-DvDPBd6Q.js +0 -1
  567. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/favicon-wrapper.svg +0 -46
  568. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/favicon.svg +0 -1
  569. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/iframe.html +0 -710
  570. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/index.html +0 -152
  571. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/index.json +0 -1
  572. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/logo_novo_azul.png +0 -0
  573. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/nunito-sans-bold-italic.woff2 +0 -0
  574. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/nunito-sans-bold.woff2 +0 -0
  575. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/nunito-sans-italic.woff2 +0 -0
  576. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/nunito-sans-regular.woff2 +0 -0
  577. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-addons/a11y-2/manager-bundle.js +0 -57
  578. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-addons/docs-1/manager-bundle.js +0 -18
  579. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +0 -632
  580. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-common-assets/favicon-wrapper.svg +0 -46
  581. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-common-assets/favicon.svg +0 -1
  582. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  583. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  584. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  585. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  586. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-manager/globals-runtime.js +0 -78957
  587. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-manager/globals.js +0 -24
  588. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-manager/manager-stores.js +0 -23
  589. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/sb-manager/runtime.js +0 -28253
  590. package/templates/.zaip-aios/design/apps/catalog/dist/storybook/vite-inject-mocker-entry.js +0 -2
  591. package/templates/.zaip-aios/design/apps/catalog/index.html +0 -13
  592. package/templates/.zaip-aios/design/apps/catalog/package.json +0 -32
  593. package/templates/.zaip-aios/design/apps/catalog/public/logo_novo_azul.png +0 -0
  594. package/templates/.zaip-aios/design/apps/catalog/src/App.tsx +0 -29
  595. package/templates/.zaip-aios/design/apps/catalog/src/components/CatalogShell.tsx +0 -78
  596. package/templates/.zaip-aios/design/apps/catalog/src/components/Primitives.tsx +0 -137
  597. package/templates/.zaip-aios/design/apps/catalog/src/design-contract.test.ts +0 -33
  598. package/templates/.zaip-aios/design/apps/catalog/src/pages/ComponentsPage.tsx +0 -83
  599. package/templates/.zaip-aios/design/apps/catalog/src/pages/DesignSystemPage.tsx +0 -185
  600. package/templates/.zaip-aios/design/apps/catalog/src/stories/Components.stories.tsx +0 -12
  601. package/templates/.zaip-aios/design/apps/catalog/src/stories/DesignSystem.stories.tsx +0 -12
  602. package/templates/.zaip-aios/design/apps/catalog/src/styles/catalog.css +0 -315
  603. package/templates/.zaip-aios/design/apps/catalog/src/styles/components.css +0 -228
  604. package/templates/.zaip-aios/design/apps/catalog/src/styles/design-system.css +0 -137
  605. package/templates/.zaip-aios/design/apps/catalog/src/styles.css +0 -85
  606. package/templates/.zaip-aios/design/apps/catalog/vite.config.ts +0 -10
  607. package/templates/.zaip-aios/design/packages/local-runtime/package.json +0 -9
  608. package/templates/.zaip-aios/design/packages/local-runtime/runtime.mjs +0 -238
  609. package/templates/.zaip-aios/design/packages/local-runtime/runtime.test.mjs +0 -66
  610. package/templates/.zaip-aios/design/packages/local-runtime/start-design.mjs +0 -46
  611. package/templates/.zaip-aios/design/packages/windows-launcher/Program.cs +0 -110
  612. package/templates/.zaip-aios/design/packages/windows-launcher/build-design-launcher.ps1 +0 -107
  613. package/templates/.zaip-aios/design/tokens.json +0 -52
  614. package/templates/.zaip-aios/design/zaip-design.exe +0 -0
  615. package/templates/.zaip-aios/manifest.json +0 -377
  616. package/templates/.zaip-aios/profiles/clients.json +0 -506
  617. package/templates/.zaip-aios/profiles/fixtures/architecture/negative/modules/orders/application/queries/list.query.ts +0 -5
  618. package/templates/.zaip-aios/profiles/fixtures/architecture/negative/modules/orders/domain/order.ts +0 -3
  619. package/templates/.zaip-aios/profiles/fixtures/architecture/positive/modules/orders/application/queries/list.query.ts +0 -5
  620. package/templates/.zaip-aios/profiles/typescript-hono-kysely.json +0 -41
  621. package/templates/.zaip-aios/templates/config/agents/catalog.yaml +0 -246
  622. package/templates/.zaip-aios/templates/requirements/.gitkeep +0 -0
  623. package/templates/.zaip-aios/templates/requirements/autonomous-assurance.md +0 -63
  624. package/templates/.zaip-aios/templates/requirements/context-engine.md +0 -44
  625. package/templates/.zaip-aios/templates/requirements/cost-observability.md +0 -39
  626. package/templates/.zaip-aios/templates/requirements/design-system.md +0 -48
  627. package/templates/.zaip-aios/templates/requirements/execution-engine.md +0 -60
  628. package/templates/.zaip-aios/templates/requirements/kanban-dashboard.md +0 -30
  629. package/templates/.zaip-aios/templates/requirements/model-orchestration.md +0 -58
  630. package/templates/.zaip-aios/templates/requirements/public-distribution.md +0 -40
  631. package/templates/.zaip-aios/templates/requirements/software-architecture.md +0 -57
  632. package/templates/.zaip-aios/templates/requirements/work-lifecycle.md +0 -82
  633. package/templates/.zaip-aios/templates/rules/project/.gitkeep +0 -0
  634. package/templates/.zaip-aios/templates/rules/zaip/architecture.md +0 -28
  635. package/templates/.zaip-aios/templates/rules/zaip/core.md +0 -24
  636. package/templates/.zaip-aios/templates/rules/zaip/evolution.md +0 -22
  637. package/templates/.zaip-aios/templates/rules/zaip/workflow.md +0 -35
  638. package/templates/.zaip-aios/templates/skills/.gitkeep +0 -0
  639. package/templates/.zaip-aios/templates/skills/zaip-aios/SKILL.md +0 -9
  640. package/templates/.zaip-aios/templates/skills/zaip-skill-adapt-stack/SKILL.md +0 -11
  641. package/templates/.zaip-aios/templates/skills/zaip-skill-adapt-stack/agents/openai.yaml +0 -4
  642. package/templates/.zaip-aios/templates/skills/zaip-skill-adapters/SKILL.md +0 -15
  643. package/templates/.zaip-aios/templates/skills/zaip-skill-adapters/agents/openai.yaml +0 -4
  644. package/templates/.zaip-aios/templates/skills/zaip-skill-api-to-mcp/SKILL.md +0 -19
  645. package/templates/.zaip-aios/templates/skills/zaip-skill-api-to-mcp/agents/openai.yaml +0 -4
  646. package/templates/.zaip-aios/templates/skills/zaip-skill-api-to-mcp/assets/adapter.example.yaml +0 -26
  647. package/templates/.zaip-aios/templates/skills/zaip-skill-api-to-mcp/references/security-contract.md +0 -10
  648. package/templates/.zaip-aios/templates/skills/zaip-skill-api-to-mcp/references/server-layout.md +0 -19
  649. package/templates/.zaip-aios/templates/skills/zaip-skill-api-to-mcp/scripts/inspect-openapi.mjs +0 -60
  650. package/templates/.zaip-aios/templates/skills/zaip-skill-api-to-mcp/scripts/scaffold-local-mcp.mjs +0 -47
  651. package/templates/.zaip-aios/templates/skills/zaip-skill-author-skills/SKILL.md +0 -21
  652. package/templates/.zaip-aios/templates/skills/zaip-skill-author-skills/agents/openai.yaml +0 -4
  653. package/templates/.zaip-aios/templates/skills/zaip-skill-change/SKILL.md +0 -20
  654. package/templates/.zaip-aios/templates/skills/zaip-skill-change/agents/openai.yaml +0 -4
  655. package/templates/.zaip-aios/templates/skills/zaip-skill-config/SKILL.md +0 -22
  656. package/templates/.zaip-aios/templates/skills/zaip-skill-config/agents/openai.yaml +0 -4
  657. package/templates/.zaip-aios/templates/skills/zaip-skill-context/SKILL.md +0 -16
  658. package/templates/.zaip-aios/templates/skills/zaip-skill-context/agents/openai.yaml +0 -4
  659. package/templates/.zaip-aios/templates/skills/zaip-skill-cqrs/SKILL.md +0 -11
  660. package/templates/.zaip-aios/templates/skills/zaip-skill-cqrs/agents/openai.yaml +0 -4
  661. package/templates/.zaip-aios/templates/skills/zaip-skill-decisions/SKILL.md +0 -14
  662. package/templates/.zaip-aios/templates/skills/zaip-skill-decisions/agents/openai.yaml +0 -4
  663. package/templates/.zaip-aios/templates/skills/zaip-skill-enforce-architecture/SKILL.md +0 -14
  664. package/templates/.zaip-aios/templates/skills/zaip-skill-enforce-architecture/agents/openai.yaml +0 -4
  665. package/templates/.zaip-aios/templates/skills/zaip-skill-eval/SKILL.md +0 -14
  666. package/templates/.zaip-aios/templates/skills/zaip-skill-eval/agents/openai.yaml +0 -4
  667. package/templates/.zaip-aios/templates/skills/zaip-skill-execution/SKILL.md +0 -36
  668. package/templates/.zaip-aios/templates/skills/zaip-skill-execution/agents/openai.yaml +0 -6
  669. package/templates/.zaip-aios/templates/skills/zaip-skill-execution/references/prepared-plan.md +0 -31
  670. package/templates/.zaip-aios/templates/skills/zaip-skill-frontend-launcher/SKILL.md +0 -29
  671. package/templates/.zaip-aios/templates/skills/zaip-skill-frontend-launcher/agents/openai.yaml +0 -4
  672. package/templates/.zaip-aios/templates/skills/zaip-skill-frontend-launcher/references/launcher-contract.md +0 -36
  673. package/templates/.zaip-aios/templates/skills/zaip-skill-github-deploy/SKILL.md +0 -75
  674. package/templates/.zaip-aios/templates/skills/zaip-skill-github-deploy/agents/openai.yaml +0 -6
  675. package/templates/.zaip-aios/templates/skills/zaip-skill-github-deploy/scripts/preflight.mjs +0 -256
  676. package/templates/.zaip-aios/templates/skills/zaip-skill-github-setup/SKILL.md +0 -80
  677. package/templates/.zaip-aios/templates/skills/zaip-skill-github-setup/agents/openai.yaml +0 -4
  678. package/templates/.zaip-aios/templates/skills/zaip-skill-move-prd/SKILL.md +0 -37
  679. package/templates/.zaip-aios/templates/skills/zaip-skill-move-prd/agents/openai.yaml +0 -4
  680. package/templates/.zaip-aios/templates/skills/zaip-skill-move-spec/SKILL.md +0 -38
  681. package/templates/.zaip-aios/templates/skills/zaip-skill-move-spec/agents/openai.yaml +0 -4
  682. package/templates/.zaip-aios/templates/skills/zaip-skill-navigate-work/SKILL.md +0 -16
  683. package/templates/.zaip-aios/templates/skills/zaip-skill-navigate-work/agents/openai.yaml +0 -4
  684. package/templates/.zaip-aios/templates/skills/zaip-skill-observability/SKILL.md +0 -24
  685. package/templates/.zaip-aios/templates/skills/zaip-skill-observability/agents/openai.yaml +0 -4
  686. package/templates/.zaip-aios/templates/skills/zaip-skill-openai-docs/SKILL.md +0 -17
  687. package/templates/.zaip-aios/templates/skills/zaip-skill-openai-docs/agents/openai.yaml +0 -4
  688. package/templates/.zaip-aios/templates/skills/zaip-skill-openai-docs/references/routing.md +0 -11
  689. package/templates/.zaip-aios/templates/skills/zaip-skill-prd/SKILL.md +0 -44
  690. package/templates/.zaip-aios/templates/skills/zaip-skill-prd/agents/openai.yaml +0 -4
  691. package/templates/.zaip-aios/templates/skills/zaip-skill-preview/SKILL.md +0 -16
  692. package/templates/.zaip-aios/templates/skills/zaip-skill-preview/agents/openai.yaml +0 -4
  693. package/templates/.zaip-aios/templates/skills/zaip-skill-reconcile-telemetry/SKILL.md +0 -39
  694. package/templates/.zaip-aios/templates/skills/zaip-skill-reconcile-telemetry/agents/openai.yaml +0 -4
  695. package/templates/.zaip-aios/templates/skills/zaip-skill-reconcile-telemetry/scripts/inspect-local-sqlite.py +0 -52
  696. package/templates/.zaip-aios/templates/skills/zaip-skill-reconcile-telemetry/scripts/normalize-run-agents.mjs +0 -63
  697. package/templates/.zaip-aios/templates/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-local-telemetry.mjs +0 -698
  698. package/templates/.zaip-aios/templates/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-lib.mjs +0 -361
  699. package/templates/.zaip-aios/templates/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-lib.test.mjs +0 -187
  700. package/templates/.zaip-aios/templates/skills/zaip-skill-requirements/SKILL.md +0 -16
  701. package/templates/.zaip-aios/templates/skills/zaip-skill-requirements/agents/openai.yaml +0 -4
  702. package/templates/.zaip-aios/templates/skills/zaip-skill-review/SKILL.md +0 -18
  703. package/templates/.zaip-aios/templates/skills/zaip-skill-review/agents/openai.yaml +0 -4
  704. package/templates/.zaip-aios/templates/skills/zaip-skill-rules/SKILL.md +0 -19
  705. package/templates/.zaip-aios/templates/skills/zaip-skill-rules/agents/openai.yaml +0 -4
  706. package/templates/.zaip-aios/templates/skills/zaip-skill-security/SKILL.md +0 -30
  707. package/templates/.zaip-aios/templates/skills/zaip-skill-security/agents/openai.yaml +0 -4
  708. package/templates/.zaip-aios/templates/skills/zaip-skill-setup/SKILL.md +0 -25
  709. package/templates/.zaip-aios/templates/skills/zaip-skill-setup/agents/openai.yaml +0 -4
  710. package/templates/.zaip-aios/templates/skills/zaip-skill-spec/SKILL.md +0 -45
  711. package/templates/.zaip-aios/templates/skills/zaip-skill-spec/agents/openai.yaml +0 -4
  712. package/templates/.zaip-aios/templates/skills/zaip-skill-task/SKILL.md +0 -41
  713. package/templates/.zaip-aios/templates/skills/zaip-skill-task/agents/openai.yaml +0 -4
  714. package/templates/.zaip-aios/templates/skills/zaip-skill-text-encoding/SKILL.md +0 -27
  715. package/templates/.zaip-aios/templates/skills/zaip-skill-text-encoding/agents/openai.yaml +0 -6
  716. package/templates/.zaip-aios/templates/skills/zaip-skill-tool-setup/SKILL.md +0 -22
  717. package/templates/.zaip-aios/templates/skills/zaip-skill-tool-setup/agents/openai.yaml +0 -4
  718. package/templates/.zaip-aios/templates/skills/zaip-skill-tool-setup/references/codex-config.md +0 -24
  719. package/templates/.zaip-aios/templates/skills/zaip-skill-tool-setup/references/secrets.md +0 -8
  720. package/templates/.zaip-aios/templates/skills/zaip-skill-tool-setup/scripts/configure-local-mcp.mjs +0 -52
  721. package/templates/.zaip-aios/templates/skills/zaip-skill-tool-setup/scripts/inspect-tool.mjs +0 -35
  722. package/templates/.zaip-aios/templates/skills/zaip-skill-tool-setup/scripts/tool-state.mjs +0 -26
  723. package/templates/.zaip-aios/templates/tools/README.md +0 -9
  724. package/templates/.zaip-aios/templates/tools/api/asaas/README.md +0 -22
  725. package/templates/.zaip-aios/templates/tools/api/asaas/manifest.yaml +0 -20
  726. package/templates/.zaip-aios/templates/tools/api/github/README.md +0 -22
  727. package/templates/.zaip-aios/templates/tools/api/github/manifest.yaml +0 -20
  728. package/templates/.zaip-aios/templates/tools/api/google-ads/README.md +0 -23
  729. package/templates/.zaip-aios/templates/tools/api/google-ads/manifest.yaml +0 -21
  730. package/templates/.zaip-aios/templates/tools/api/google-analytics/README.md +0 -22
  731. package/templates/.zaip-aios/templates/tools/api/google-analytics/manifest.yaml +0 -20
  732. package/templates/.zaip-aios/templates/tools/api/google-search-console/README.md +0 -21
  733. package/templates/.zaip-aios/templates/tools/api/google-search-console/manifest.yaml +0 -19
  734. package/templates/.zaip-aios/templates/tools/api/google-tag-manager/README.md +0 -22
  735. package/templates/.zaip-aios/templates/tools/api/google-tag-manager/manifest.yaml +0 -20
  736. package/templates/.zaip-aios/templates/tools/api/hubspot/README.md +0 -22
  737. package/templates/.zaip-aios/templates/tools/api/hubspot/manifest.yaml +0 -20
  738. package/templates/.zaip-aios/templates/tools/api/instagram-graph/README.md +0 -23
  739. package/templates/.zaip-aios/templates/tools/api/instagram-graph/manifest.yaml +0 -21
  740. package/templates/.zaip-aios/templates/tools/api/kommo-crm/README.md +0 -23
  741. package/templates/.zaip-aios/templates/tools/api/kommo-crm/manifest.yaml +0 -21
  742. package/templates/.zaip-aios/templates/tools/api/linkedin-ads/README.md +0 -23
  743. package/templates/.zaip-aios/templates/tools/api/linkedin-ads/manifest.yaml +0 -21
  744. package/templates/.zaip-aios/templates/tools/api/meta-ads/README.md +0 -23
  745. package/templates/.zaip-aios/templates/tools/api/meta-ads/manifest.yaml +0 -21
  746. package/templates/.zaip-aios/templates/tools/api/openai/README.md +0 -22
  747. package/templates/.zaip-aios/templates/tools/api/openai/manifest.yaml +0 -20
  748. package/templates/.zaip-aios/templates/tools/api/shopify/README.md +0 -23
  749. package/templates/.zaip-aios/templates/tools/api/shopify/manifest.yaml +0 -21
  750. package/templates/.zaip-aios/templates/tools/api/slack/README.md +0 -22
  751. package/templates/.zaip-aios/templates/tools/api/slack/manifest.yaml +0 -20
  752. package/templates/.zaip-aios/templates/tools/api/stripe/README.md +0 -22
  753. package/templates/.zaip-aios/templates/tools/api/stripe/manifest.yaml +0 -20
  754. package/templates/.zaip-aios/templates/tools/api/tiktok-ads/README.md +0 -23
  755. package/templates/.zaip-aios/templates/tools/api/tiktok-ads/manifest.yaml +0 -21
  756. package/templates/.zaip-aios/templates/tools/api/youtube-analytics/README.md +0 -22
  757. package/templates/.zaip-aios/templates/tools/api/youtube-analytics/manifest.yaml +0 -20
  758. package/templates/.zaip-aios/templates/tools/catalog.yaml +0 -358
  759. package/templates/.zaip-aios/templates/tools/mcp/development/browser/README.md +0 -20
  760. package/templates/.zaip-aios/templates/tools/mcp/development/browser/manifest.yaml +0 -24
  761. package/templates/.zaip-aios/templates/tools/mcp/development/filesystem/README.md +0 -20
  762. package/templates/.zaip-aios/templates/tools/mcp/development/filesystem/manifest.yaml +0 -24
  763. package/templates/.zaip-aios/templates/tools/mcp/development/git/README.md +0 -20
  764. package/templates/.zaip-aios/templates/tools/mcp/development/git/manifest.yaml +0 -24
  765. package/templates/.zaip-aios/templates/tools/mcp/development/github/README.md +0 -20
  766. package/templates/.zaip-aios/templates/tools/mcp/development/github/manifest.yaml +0 -25
  767. package/templates/.zaip-aios/templates/tools/mcp/development/gitlab/README.md +0 -20
  768. package/templates/.zaip-aios/templates/tools/mcp/development/gitlab/manifest.yaml +0 -25
  769. package/templates/.zaip-aios/templates/tools/mcp/development/jira/README.md +0 -21
  770. package/templates/.zaip-aios/templates/tools/mcp/development/jira/manifest.yaml +0 -26
  771. package/templates/.zaip-aios/templates/tools/mcp/development/linear/README.md +0 -20
  772. package/templates/.zaip-aios/templates/tools/mcp/development/linear/manifest.yaml +0 -25
  773. package/templates/.zaip-aios/templates/tools/mcp/development/notion/README.md +0 -20
  774. package/templates/.zaip-aios/templates/tools/mcp/development/notion/manifest.yaml +0 -25
  775. package/templates/.zaip-aios/templates/tools/mcp/development/openai-docs/README.md +0 -15
  776. package/templates/.zaip-aios/templates/tools/mcp/development/openai-docs/manifest.yaml +0 -21
  777. package/templates/.zaip-aios/templates/tools/mcp/development/postgresql/README.md +0 -20
  778. package/templates/.zaip-aios/templates/tools/mcp/development/postgresql/manifest.yaml +0 -25
  779. package/templates/.zaip-aios/templates/tools/mcp/development/slack/README.md +0 -20
  780. package/templates/.zaip-aios/templates/tools/mcp/development/slack/manifest.yaml +0 -25
  781. package/templates/.zaip-aios/templates/tools/mcp/development/sqlite/README.md +0 -20
  782. package/templates/.zaip-aios/templates/tools/mcp/development/sqlite/manifest.yaml +0 -25
  783. package/templates/.zaip-aios/templates/tools/mcp/infra/aws/README.md +0 -21
  784. package/templates/.zaip-aios/templates/tools/mcp/infra/aws/manifest.yaml +0 -26
  785. package/templates/.zaip-aios/templates/tools/mcp/infra/azure/README.md +0 -20
  786. package/templates/.zaip-aios/templates/tools/mcp/infra/azure/manifest.yaml +0 -25
  787. package/templates/.zaip-aios/templates/tools/mcp/infra/cloudflare/README.md +0 -21
  788. package/templates/.zaip-aios/templates/tools/mcp/infra/cloudflare/manifest.yaml +0 -26
  789. package/templates/.zaip-aios/templates/tools/mcp/infra/docker/README.md +0 -20
  790. package/templates/.zaip-aios/templates/tools/mcp/infra/docker/manifest.yaml +0 -24
  791. package/templates/.zaip-aios/templates/tools/mcp/infra/gcp/README.md +0 -21
  792. package/templates/.zaip-aios/templates/tools/mcp/infra/gcp/manifest.yaml +0 -26
  793. package/templates/.zaip-aios/templates/tools/mcp/infra/hostinger/README.md +0 -20
  794. package/templates/.zaip-aios/templates/tools/mcp/infra/hostinger/manifest.yaml +0 -25
  795. package/templates/.zaip-aios/templates/tools/mcp/infra/kubernetes/README.md +0 -20
  796. package/templates/.zaip-aios/templates/tools/mcp/infra/kubernetes/manifest.yaml +0 -25
  797. package/templates/.zaip-aios/templates/tools/mcp/infra/terraform/README.md +0 -20
  798. package/templates/.zaip-aios/templates/tools/mcp/infra/terraform/manifest.yaml +0 -24
  799. package/templates/.zaip-aios/templates/tools/mcp/marketing/google-ads/README.md +0 -21
  800. package/templates/.zaip-aios/templates/tools/mcp/marketing/google-ads/manifest.yaml +0 -26
  801. package/templates/.zaip-aios/templates/tools/mcp/marketing/google-analytics/README.md +0 -20
  802. package/templates/.zaip-aios/templates/tools/mcp/marketing/google-analytics/manifest.yaml +0 -25
  803. package/templates/.zaip-aios/templates/tools/mcp/marketing/google-search-console/README.md +0 -19
  804. package/templates/.zaip-aios/templates/tools/mcp/marketing/google-search-console/manifest.yaml +0 -24
  805. package/templates/.zaip-aios/templates/tools/mcp/marketing/google-tag-manager/README.md +0 -21
  806. package/templates/.zaip-aios/templates/tools/mcp/marketing/google-tag-manager/manifest.yaml +0 -26
  807. package/templates/.zaip-aios/templates/tools/mcp/marketing/hubspot/README.md +0 -20
  808. package/templates/.zaip-aios/templates/tools/mcp/marketing/hubspot/manifest.yaml +0 -25
  809. package/templates/.zaip-aios/templates/tools/mcp/marketing/instagram-insights/README.md +0 -21
  810. package/templates/.zaip-aios/templates/tools/mcp/marketing/instagram-insights/manifest.yaml +0 -26
  811. package/templates/.zaip-aios/templates/tools/mcp/marketing/linkedin-ads/README.md +0 -21
  812. package/templates/.zaip-aios/templates/tools/mcp/marketing/linkedin-ads/manifest.yaml +0 -26
  813. package/templates/.zaip-aios/templates/tools/mcp/marketing/mailchimp/README.md +0 -21
  814. package/templates/.zaip-aios/templates/tools/mcp/marketing/mailchimp/manifest.yaml +0 -26
  815. package/templates/.zaip-aios/templates/tools/mcp/marketing/meta-ads/README.md +0 -21
  816. package/templates/.zaip-aios/templates/tools/mcp/marketing/meta-ads/manifest.yaml +0 -26
  817. package/templates/.zaip-aios/templates/tools/mcp/marketing/semrush/README.md +0 -20
  818. package/templates/.zaip-aios/templates/tools/mcp/marketing/semrush/manifest.yaml +0 -25
  819. package/templates/.zaip-aios/templates/tools/mcp/marketing/tiktok-ads/README.md +0 -21
  820. package/templates/.zaip-aios/templates/tools/mcp/marketing/tiktok-ads/manifest.yaml +0 -26
  821. package/templates/.zaip-aios/templates/tools/mcp/marketing/youtube-analytics/README.md +0 -21
  822. package/templates/.zaip-aios/templates/tools/mcp/marketing/youtube-analytics/manifest.yaml +0 -26
  823. package/templates/.zaip-aios/templates/tools/mcp/observability/cloudwatch/README.md +0 -21
  824. package/templates/.zaip-aios/templates/tools/mcp/observability/cloudwatch/manifest.yaml +0 -26
  825. package/templates/.zaip-aios/templates/tools/mcp/observability/datadog/README.md +0 -21
  826. package/templates/.zaip-aios/templates/tools/mcp/observability/datadog/manifest.yaml +0 -26
  827. package/templates/.zaip-aios/templates/tools/mcp/observability/elasticsearch/README.md +0 -21
  828. package/templates/.zaip-aios/templates/tools/mcp/observability/elasticsearch/manifest.yaml +0 -26
  829. package/templates/.zaip-aios/templates/tools/mcp/observability/grafana/README.md +0 -21
  830. package/templates/.zaip-aios/templates/tools/mcp/observability/grafana/manifest.yaml +0 -26
  831. package/templates/.zaip-aios/templates/tools/mcp/observability/kibana/README.md +0 -21
  832. package/templates/.zaip-aios/templates/tools/mcp/observability/kibana/manifest.yaml +0 -26
  833. package/templates/.zaip-aios/templates/tools/mcp/observability/loki/README.md +0 -19
  834. package/templates/.zaip-aios/templates/tools/mcp/observability/loki/manifest.yaml +0 -24
  835. package/templates/.zaip-aios/templates/tools/mcp/observability/new-relic/README.md +0 -21
  836. package/templates/.zaip-aios/templates/tools/mcp/observability/new-relic/manifest.yaml +0 -26
  837. package/templates/.zaip-aios/templates/tools/mcp/observability/opentelemetry/README.md +0 -20
  838. package/templates/.zaip-aios/templates/tools/mcp/observability/opentelemetry/manifest.yaml +0 -25
  839. package/templates/.zaip-aios/templates/tools/mcp/observability/prometheus/README.md +0 -19
  840. package/templates/.zaip-aios/templates/tools/mcp/observability/prometheus/manifest.yaml +0 -24
  841. package/templates/.zaip-aios/templates/tools/mcp/observability/sentry/README.md +0 -21
  842. package/templates/.zaip-aios/templates/tools/mcp/observability/sentry/manifest.yaml +0 -26
  843. package/templates/.zaip-aios/templates/tools/policies/approval-rules.yaml +0 -8
  844. package/templates/.zaip-aios/templates/tools/policies/financial-limits.yaml +0 -6
  845. package/templates/.zaip-aios/templates/tools/policies/permissions.yaml +0 -8
  846. package/templates/.zaip-aios/templates/tools/policies/secret-handling.md +0 -7
  847. package/templates/.zaip-aios/templates/tools/profiles/business.yaml +0 -8
  848. package/templates/.zaip-aios/templates/tools/profiles/default.yaml +0 -8
  849. package/templates/.zaip-aios/templates/tools/profiles/development.yaml +0 -13
  850. package/templates/.zaip-aios/templates/tools/profiles/infrastructure.yaml +0 -8
  851. package/templates/.zaip-aios/templates/tools/profiles/marketing.yaml +0 -9
  852. package/templates/.zaip-aios/templates/tools/profiles/observability.yaml +0 -8
  853. package/templates/.zaip-aios/templates/tools/runtime/README.md +0 -3
  854. package/templates/.zaip-aios/templates/tools/runtime/api-mcp-runtime.mjs +0 -217
  855. package/templates/.zaip-aios/templates/tools/runtime/api-mcp-runtime.test.mjs +0 -56
  856. package/templates/.zaip-aios/templates/tools/runtime/fixtures/definition.json +0 -17
  857. package/templates/.zaip-aios/templates/tools/runtime/runner.mjs +0 -16
  858. package/templates/.zaip-aios/templates/tools/runtime/stdio.test.mjs +0 -32
  859. package/templates/.zaip-aios/templates/tools/state.example.yaml +0 -8
  860. package/templates/.zaip-aios/templates/zaip-aios/INDEX.md +0 -26
  861. package/templates/.zaip-aios/templates/zaip-aios/README.md +0 -13
  862. package/templates/.zaip-aios/templates/zaip-aios/VERSION +0 -1
  863. package/templates/.zaip-aios/templates/zaip-aios/guides/01-primeiros-passos.md +0 -10
  864. package/templates/.zaip-aios/templates/zaip-aios/guides/02-requirements.md +0 -12
  865. package/templates/.zaip-aios/templates/zaip-aios/guides/03-tasks.md +0 -12
  866. package/templates/.zaip-aios/templates/zaip-aios/guides/04-specs.md +0 -16
  867. package/templates/.zaip-aios/templates/zaip-aios/guides/05-prds.md +0 -13
  868. package/templates/.zaip-aios/templates/zaip-aios/guides/06-execucao.md +0 -13
  869. package/templates/.zaip-aios/templates/zaip-aios/guides/07-revisao-e-validacao.md +0 -8
  870. package/templates/.zaip-aios/templates/zaip-aios/guides/08-contexto-e-tokens.md +0 -10
  871. package/templates/.zaip-aios/templates/zaip-aios/guides/09-agentes-e-squads.md +0 -8
  872. package/templates/.zaip-aios/templates/zaip-aios/guides/10-seguranca.md +0 -206
  873. package/templates/.zaip-aios/templates/zaip-aios/guides/11-observabilidade-e-custos.md +0 -10
  874. package/templates/.zaip-aios/templates/zaip-aios/guides/12-instalacao-e-upgrade.md +0 -10
  875. package/templates/.zaip-aios/templates/zaip-aios/guides/13-boas-praticas.md +0 -12
  876. package/templates/.zaip-aios/templates/zaip-aios/guides/14-troubleshooting.md +0 -12
  877. package/templates/.zaip-aios/templates/zaip-aios/guides/15-tools-e-codex.md +0 -25
  878. package/templates/.zaip-aios/templates/zaip-aios/guides/16-lifecycle-e-reconciliacao.md +0 -47
  879. /package/templates/{.zaip-aios → .agents/config}/pricing/fx/2026/07/12/usd-brl.json +0 -0
  880. /package/templates/{.zaip-aios/dashboard/apps/frontend/dist → .agents/dashboard/apps/frontend/public}/icon_zaip.png +0 -0
  881. /package/templates/{.zaip-aios/dashboard/apps/frontend/dist → .agents/dashboard/apps/frontend/public}/logo_novo_azul.png +0 -0
  882. /package/templates/{.zaip-aios → .agents/runtime}/LICENSE +0 -0
  883. /package/templates/{.zaip-aios → .agents/runtime}/THIRD_PARTY_NOTICES.md +0 -0
  884. /package/templates/{.zaip-aios → .agents/runtime}/VERSION +0 -0
  885. /package/templates/{.zaip-aios → .agents/runtime}/migrations/001-layout-v1.json +0 -0
  886. /package/templates/{.zaip-aios → .agents/runtime}/migrations/002-layout-v2.json +0 -0
  887. /package/templates/{.zaip-aios → .agents/runtime}/schemas/contracts.schema.json +0 -0
@@ -0,0 +1,250 @@
1
+ export const CODEX_SUBAGENT_LIFECYCLE_HOOK = `import { existsSync } from "node:fs";
2
+ import { promises as fs } from "node:fs";
3
+ import { spawn } from "node:child_process";
4
+ import { dirname, relative, resolve } from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+
7
+ const hookPath = fileURLToPath(import.meta.url);
8
+ const repositoryRoot = resolve(dirname(hookPath), "..", "..");
9
+ const diagnosticPath = resolve(
10
+ repositoryRoot,
11
+ ".agents",
12
+ "local",
13
+ "hooks",
14
+ "subagent-lifecycle.ndjson",
15
+ );
16
+
17
+ if (process.argv[2] === "--capture-runner") {
18
+ await runCaptureRunner(process.argv[3], process.argv.slice(4));
19
+ process.exit(0);
20
+ }
21
+
22
+ let raw = "";
23
+ for await (const chunk of process.stdin) raw += chunk;
24
+
25
+ try {
26
+ const event = JSON.parse(raw);
27
+ const cwd = text(event.cwd);
28
+ const scoped = cwd === null ? ".." : relative(repositoryRoot, resolve(cwd));
29
+ if (cwd === null || scoped.startsWith("..")) process.exit(0);
30
+ const eventName = text(event.hook_event_name);
31
+ const lifecycleEvent =
32
+ eventName === "SubagentStart" ? "start" : eventName === "SubagentStop" ? "stop" : null;
33
+ const session = text(event.session_id);
34
+ const turn = text(event.turn_id);
35
+ const agentId = text(event.agent_id);
36
+ const agentType = text(event.agent_type);
37
+ const model = text(event.model);
38
+ const reasoningEffort = reasoningEffortValue(
39
+ event.model_reasoning_effort ?? event.reasoning_effort,
40
+ );
41
+ const parentAgentId = text(event.parent_agent_id ?? event.parent_id);
42
+ const status = terminalStatus(event.status);
43
+ const required = [lifecycleEvent, session, turn, agentId, agentType];
44
+ if (lifecycleEvent === null) {
45
+ await diagnostic("ignored_unrecognized_event", { eventName });
46
+ process.exit(0);
47
+ }
48
+ const terminalFallback =
49
+ lifecycleEvent === "stop" &&
50
+ status !== null &&
51
+ agentId !== null &&
52
+ agentType === "zaip-agent-finalizer" &&
53
+ parentAgentId !== null &&
54
+ (session === null || turn === null);
55
+ if (
56
+ (!terminalFallback && required.some((value) => value === null)) ||
57
+ (lifecycleEvent === "start" && model === null)
58
+ ) {
59
+ await diagnostic("ignored_incomplete_event", {
60
+ eventName,
61
+ session,
62
+ turn,
63
+ agentId,
64
+ agentType,
65
+ missing_model: lifecycleEvent === "start" && model === null,
66
+ });
67
+ process.exit(0);
68
+ }
69
+ const candidates = [
70
+ resolve(repositoryRoot, "packages", "cli", "dist", "index.js"),
71
+ resolve(repositoryRoot, ".agents", "runtime", "bin", "zaip.mjs"),
72
+ ];
73
+ const cli = candidates.find(existsSync);
74
+ if (cli === undefined) {
75
+ await diagnostic("cli_not_found", { eventName, candidates });
76
+ process.exit(0);
77
+ }
78
+ const captureArguments = terminalFallback
79
+ ? [
80
+ "subagent",
81
+ "capture-terminal",
82
+ "--parent-agent-id",
83
+ parentAgentId,
84
+ "--agent-id",
85
+ agentId,
86
+ "--agent-type",
87
+ agentType,
88
+ "--status",
89
+ status,
90
+ "--json",
91
+ ]
92
+ : [
93
+ "subagent",
94
+ "capture",
95
+ "--event",
96
+ lifecycleEvent,
97
+ "--session",
98
+ session,
99
+ "--turn",
100
+ turn,
101
+ "--agent-id",
102
+ agentId,
103
+ "--agent-type",
104
+ agentType,
105
+ ...(model === null ? [] : ["--model", model]),
106
+ ...(reasoningEffort === null ? [] : ["--reasoning-effort", reasoningEffort]),
107
+ ...(parentAgentId === null ? [] : ["--parent-agent-id", parentAgentId]),
108
+ ...(lifecycleEvent !== "stop" || status === null ? [] : ["--status", status]),
109
+ "--json",
110
+ ];
111
+ const runner = spawn(
112
+ process.execPath,
113
+ [hookPath, "--capture-runner", cli, ...captureArguments],
114
+ {
115
+ cwd: repositoryRoot,
116
+ detached: true,
117
+ windowsHide: true,
118
+ stdio: "ignore",
119
+ },
120
+ );
121
+ runner.once("error", (error) =>
122
+ diagnostic("runner_spawn_failed", { eventName, error: error.message }),
123
+ );
124
+ runner.unref();
125
+ if (lifecycleEvent === "start") {
126
+ process.stdout.write(JSON.stringify({
127
+ hookSpecificOutput: {
128
+ hookEventName: "SubagentStart",
129
+ additionalContext:
130
+ "ZAIP delegation policy: work only as a cataloged zaip-agent-NOME identity. Delegation is recursive; do not use default, worker, explorer, or ad-hoc agent types.",
131
+ },
132
+ }));
133
+ }
134
+ } catch (error) {
135
+ await diagnostic("hook_exception", {
136
+ error: error instanceof Error ? error.message : String(error),
137
+ });
138
+ }
139
+
140
+ async function runCaptureRunner(cli, captureArguments) {
141
+ try {
142
+ if (typeof cli !== "string" || cli.length === 0) {
143
+ await persistDiagnostic("runner_invalid_cli", {});
144
+ return;
145
+ }
146
+ const child = spawn(process.execPath, [cli, ...captureArguments], {
147
+ cwd: repositoryRoot,
148
+ windowsHide: true,
149
+ stdio: ["ignore", "pipe", "pipe"],
150
+ });
151
+ let stdout = "";
152
+ let stderr = "";
153
+ child.stdout?.on("data", (chunk) => {
154
+ stdout = boundedText(stdout, chunk);
155
+ });
156
+ child.stderr?.on("data", (chunk) => {
157
+ stderr = boundedText(stderr, chunk);
158
+ });
159
+ const outcome = await new Promise((resolveOutcome) => {
160
+ let settled = false;
161
+ const finish = (value) => {
162
+ if (settled) return;
163
+ settled = true;
164
+ clearTimeout(timeout);
165
+ resolveOutcome(value);
166
+ };
167
+ const timeout = setTimeout(() => {
168
+ child.kill();
169
+ finish({ kind: "timeout" });
170
+ }, 120_000);
171
+ child.once("error", (error) => finish({ kind: "error", error: error.message }));
172
+ child.once("close", (code, signal) => finish({ kind: "close", code, signal }));
173
+ });
174
+ if (outcome.kind === "timeout") {
175
+ await persistDiagnostic("capture_timeout", { captureArguments: safeIdentity(captureArguments) });
176
+ } else if (outcome.kind === "error") {
177
+ await persistDiagnostic("capture_spawn_failed", { error: outcome.error });
178
+ } else if (outcome.code !== 0) {
179
+ await persistDiagnostic("capture_exit_nonzero", {
180
+ code: outcome.code,
181
+ signal: outcome.signal,
182
+ stderr,
183
+ stdout,
184
+ captureArguments: safeIdentity(captureArguments),
185
+ });
186
+ }
187
+ } catch (error) {
188
+ await persistDiagnostic("runner_exception", {
189
+ error: error instanceof Error ? error.message : String(error),
190
+ });
191
+ }
192
+ }
193
+
194
+ function safeIdentity(arguments_) {
195
+ const value = (flag) => {
196
+ const index = arguments_.indexOf(flag);
197
+ return index < 0 ? null : text(arguments_[index + 1]);
198
+ };
199
+ return {
200
+ event: value("--event"),
201
+ session: value("--session"),
202
+ turn: value("--turn"),
203
+ agent_id: value("--agent-id"),
204
+ agent_type: value("--agent-type"),
205
+ };
206
+ }
207
+
208
+ function boundedText(current, chunk) {
209
+ return (current + String(chunk)).slice(-8_192);
210
+ }
211
+
212
+ async function persistDiagnostic(code, detail) {
213
+ const line = \`\${JSON.stringify({
214
+ source: "zaip-subagent-lifecycle-runner",
215
+ code,
216
+ occurred_at: new Date().toISOString(),
217
+ detail,
218
+ })}\\n\`;
219
+ await fs.mkdir(dirname(diagnosticPath), { recursive: true });
220
+ const size = await fs.stat(diagnosticPath).then((entry) => entry.size).catch(() => 0);
221
+ if (size + Buffer.byteLength(line) > 262_144) {
222
+ await fs.writeFile(diagnosticPath, "", "utf8");
223
+ }
224
+ await fs.appendFile(diagnosticPath, line, "utf8");
225
+ }
226
+
227
+ async function diagnostic(code, detail) {
228
+ await persistDiagnostic(code, detail);
229
+ process.stderr.write(
230
+ \`\${JSON.stringify({ source: "zaip-subagent-lifecycle", code, detail })}\\n\`,
231
+ );
232
+ }
233
+
234
+ function text(value) {
235
+ if (typeof value !== "string") return null;
236
+ const normalized = value.trim();
237
+ return normalized.length > 0 && normalized.length <= 200 ? normalized : null;
238
+ }
239
+
240
+ function reasoningEffortValue(value) {
241
+ const normalized = text(value);
242
+ return ["low", "medium", "high", "xhigh"].includes(normalized) ? normalized : null;
243
+ }
244
+
245
+ function terminalStatus(value) {
246
+ const normalized = text(value);
247
+ return ["completed", "failed", "cancelled"].includes(normalized) ? normalized : null;
248
+ }
249
+ `;
250
+ //# sourceMappingURL=codex-subagent-hook-template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-subagent-hook-template.js","sourceRoot":"","sources":["../../src/services/codex-subagent-hook-template.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,6BAA6B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwP5C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/services/doctor.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAC;CACpC;AAsCD,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAmH5E"}
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/services/doctor.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAC;CACpC;AAsCD,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAuF5E"}
@@ -6,7 +6,7 @@ import { sha256 } from "./template-manifest.js";
6
6
  const REQUIRED = [
7
7
  ".agents/config/project.yaml",
8
8
  ".agents/config/framework.lock.yaml",
9
- ...["core", "workflow", "architecture", "security", "context"].map((name) => `.agents/rules/zaip/${name}.md`),
9
+ ...["core", "workflow", "architecture", "security", "context"].map((name) => `.agents/rules/${name}.md`),
10
10
  ...[
11
11
  "work-lifecycle",
12
12
  "execution-engine",
@@ -30,11 +30,11 @@ const REQUIRED_DESIGN = [
30
30
  ".agents/design/apps/catalog/dist/storybook/index.html",
31
31
  ];
32
32
  const REQUIRED_RUNTIME = [
33
- ".zaip-aios/bin/zaip.mjs",
34
- ".zaip-aios/checksums.sha256",
35
- ".zaip-aios/manifest.json",
36
- ".zaip-aios/sbom.cdx.json",
37
- ".zaip-aios/VERSION",
33
+ ".agents/runtime/bin/zaip.mjs",
34
+ ".agents/runtime/checksums.sha256",
35
+ ".agents/runtime/manifest.json",
36
+ ".agents/runtime/sbom.cdx.json",
37
+ ".agents/runtime/VERSION",
38
38
  ];
39
39
  export async function doctorProject(directory) {
40
40
  const project = await findProjectRoot(directory);
@@ -87,41 +87,14 @@ export async function doctorProject(directory) {
87
87
  }
88
88
  const ids = new Map();
89
89
  for (const path of await filesUnder(project.root, ".agents/rules")) {
90
- const isZaip = path.startsWith(".agents/rules/zaip/");
91
- const isProject = path.startsWith(".agents/rules/project/");
92
- if (/^\.agents\/rules\/[^/]+$/.test(path) || (!isZaip && !isProject)) {
90
+ if (!/^\.agents\/rules\/(?:project\/)?[^/]+\.md$/.test(path)) {
93
91
  findings.push({
94
92
  severity: "error",
95
93
  path,
96
- message: "Rules must live under .agents/rules/zaip or .agents/rules/project",
94
+ message: "Rules must live under .agents/rules or .agents/rules/project as Markdown files",
97
95
  });
98
96
  continue;
99
97
  }
100
- if ((isZaip && !path.endsWith(".md")) ||
101
- (isProject && !path.endsWith(".md") && path !== ".agents/rules/project/.gitkeep")) {
102
- findings.push({
103
- severity: "error",
104
- path,
105
- message: "Rule namespaces accept Markdown Rules and the project .gitkeep marker only",
106
- });
107
- continue;
108
- }
109
- if (isZaip && !managed.has(path)) {
110
- findings.push({
111
- severity: "error",
112
- path,
113
- message: "ZAIP Rule must be managed by framework.lock.yaml",
114
- });
115
- }
116
- if (isProject && path.endsWith(".md") && managed.has(path)) {
117
- findings.push({
118
- severity: "error",
119
- path,
120
- message: "Project Rule must not be managed by framework.lock.yaml",
121
- });
122
- }
123
- if (!path.endsWith(".md"))
124
- continue;
125
98
  const content = await textOrNull(project.root, path);
126
99
  const id = /^id:\s*(RULE-[A-Z0-9-]+)\s*$/m.exec(content ?? "")?.[1];
127
100
  if (id === undefined) {
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/services/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAchD,MAAM,QAAQ,GAAG;IACf,6BAA6B;IAC7B,oCAAo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kdir, rename, rm, writeFile } from "node:fs/promises";
1
+ import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
2
2
  export interface GlobalCodexConfigResult {
3
3
  path: string;
4
4
  sourcePath: string;
5
5
  installed: boolean;
6
6
  agentFilesInstalled: number;
7
+ removedRegistrations: number;
7
8
  error: string | null;
8
9
  }
9
- export interface GlobalCodexAgentFile {
10
- name: string;
11
- content: string;
12
- }
13
10
  export interface GlobalCodexConfigFileSystem {
14
11
  mkdir: typeof mkdir;
12
+ readFile: typeof readFile;
15
13
  rename: typeof rename;
16
14
  rm: typeof rm;
17
15
  writeFile: typeof writeFile;
18
16
  }
19
- export declare function installGlobalCodexConfig(content: string, codexHome?: string, sourcePath?: string, filesystem?: GlobalCodexConfigFileSystem, agentFiles?: readonly GlobalCodexAgentFile[]): Promise<GlobalCodexConfigResult>;
17
+ /**
18
+ * Removes legacy global ZAIP registrations without copying a project configuration
19
+ * to the user profile. The project catalog is the sole source for agent profiles.
20
+ */
21
+ export declare function reconcileGlobalCodexConfig(codexHome?: string, sourcePath?: string, filesystem?: GlobalCodexConfigFileSystem): Promise<GlobalCodexConfigResult>;
22
+ export declare function stripLegacyRegistrations(config: string): {
23
+ content: string;
24
+ removedRegistrations: number;
25
+ };
20
26
  //# sourceMappingURL=global-codex-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"global-codex-config.d.ts","sourceRoot":"","sources":["../../src/services/global-codex-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAIhE,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAA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AE,MAAM,GAAG;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CASA"}
@@ -1,46 +1,35 @@
1
- import { mkdir, rename, rm, writeFile } from "node:fs/promises";
1
+ import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
2
2
  import { homedir } from "node:os";
3
3
  import { dirname, join } from "node:path";
4
- const nodeFileSystem = { mkdir, rename, rm, writeFile };
5
- export async function installGlobalCodexConfig(content, codexHome = process.env.CODEX_HOME ?? join(homedir(), ".codex"), sourcePath = "<project>/.codex/config.toml", filesystem = nodeFileSystem, agentFiles = []) {
4
+ const nodeFileSystem = { mkdir, readFile, rename, rm, writeFile };
5
+ const TOML_TABLE = /^\[(?:[^\]]|\][^\]])+\](?:\r?\n|$)/;
6
+ const LEGACY_ZAIP_AGENT_TABLE = /^\[agents\."zaip-agent-[^"]+"\](?:\r?\n|$)/;
7
+ /**
8
+ * Removes legacy global ZAIP registrations without copying a project configuration
9
+ * to the user profile. The project catalog is the sole source for agent profiles.
10
+ */
11
+ export async function reconcileGlobalCodexConfig(codexHome = process.env.CODEX_HOME ?? join(homedir(), ".codex"), sourcePath = "<project>/.agents/config/agents/catalog.yaml", filesystem = nodeFileSystem) {
6
12
  const path = join(codexHome, "config.toml");
7
13
  const temporary = `${path}.zaip-tmp-${process.pid}`;
8
14
  const backup = `${path}.zaip-backup-${process.pid}`;
9
- let previousConfigMoved = false;
10
15
  try {
11
- await filesystem.mkdir(dirname(path), { recursive: true });
12
- for (const [index, agent] of agentFiles.entries()) {
13
- if (!/^[a-z0-9][a-z0-9-]*\.toml$/.test(agent.name)) {
14
- throw new Error(`Invalid global Codex agent filename: ${agent.name}`);
15
- }
16
- await replaceGlobalAgentFile(join(codexHome, "agents", agent.name), agent.content, index, filesystem);
17
- }
18
- await filesystem.rm(temporary, { force: true });
19
- await filesystem.rm(backup, { force: true });
20
- await filesystem.writeFile(temporary, content, { encoding: "utf8", flag: "wx" });
21
- try {
22
- await filesystem.rename(path, backup);
23
- previousConfigMoved = true;
24
- }
25
- catch (error) {
26
- if (!isMissingFile(error))
27
- throw error;
28
- }
29
- try {
30
- await filesystem.rename(temporary, path);
31
- }
32
- catch (error) {
33
- if (previousConfigMoved)
34
- await filesystem.rename(backup, path);
16
+ const current = await filesystem.readFile(path, "utf8").catch((error) => {
17
+ if (isMissingFile(error))
18
+ return null;
35
19
  throw error;
20
+ });
21
+ const { content, removedRegistrations } = current === null
22
+ ? { content: null, removedRegistrations: 0 }
23
+ : stripLegacyRegistrations(current);
24
+ if (content !== null && content !== current) {
25
+ await replaceConfig(path, content, temporary, backup, filesystem);
36
26
  }
37
- if (previousConfigMoved)
38
- await filesystem.rm(backup, { force: true });
39
27
  return {
40
28
  path,
41
29
  sourcePath,
42
30
  installed: true,
43
- agentFilesInstalled: agentFiles.length,
31
+ agentFilesInstalled: 0,
32
+ removedRegistrations,
44
33
  error: null,
45
34
  };
46
35
  }
@@ -51,42 +40,72 @@ export async function installGlobalCodexConfig(content, codexHome = process.env.
51
40
  sourcePath,
52
41
  installed: false,
53
42
  agentFilesInstalled: 0,
43
+ removedRegistrations: 0,
54
44
  error: error instanceof Error ? error.message : String(error),
55
45
  };
56
46
  }
57
47
  }
58
- async function replaceGlobalAgentFile(path, content, index, filesystem) {
59
- const temporary = `${path}.zaip-tmp-${process.pid}-${index}`;
60
- const backup = `${path}.zaip-backup-${process.pid}-${index}`;
61
- let previousMoved = false;
48
+ export function stripLegacyRegistrations(config) {
49
+ const spans = legacyAgentTableSpans(config);
50
+ return {
51
+ content: spans.reduceRight((remaining, span) => remaining.slice(0, span.start) + remaining.slice(span.end), config),
52
+ removedRegistrations: spans.length,
53
+ };
54
+ }
55
+ function legacyAgentTableSpans(config) {
56
+ const tables = [];
57
+ let offset = 0;
58
+ let inMultilineBasic = false;
59
+ let inMultilineLiteral = false;
60
+ for (const line of config.matchAll(/.*(?:\r?\n|$)/g)) {
61
+ const text = line[0];
62
+ if (text.length === 0)
63
+ continue;
64
+ if (!inMultilineBasic && !inMultilineLiteral && TOML_TABLE.test(text)) {
65
+ tables.push({ start: offset, legacy: LEGACY_ZAIP_AGENT_TABLE.test(text) });
66
+ }
67
+ if (!inMultilineLiteral && hasUnescapedTripleQuote(text, '"""')) {
68
+ inMultilineBasic = !inMultilineBasic;
69
+ }
70
+ if (!inMultilineBasic && hasUnescapedTripleQuote(text, "'''")) {
71
+ inMultilineLiteral = !inMultilineLiteral;
72
+ }
73
+ offset += text.length;
74
+ }
75
+ return tables.flatMap((table, index) => table.legacy ? [{ start: table.start, end: tables[index + 1]?.start ?? config.length }] : []);
76
+ }
77
+ function hasUnescapedTripleQuote(line, quote) {
78
+ let occurrences = 0;
79
+ for (let index = line.indexOf(quote); index >= 0; index = line.indexOf(quote, index + 3)) {
80
+ if (quote === "'''" || line[index - 1] !== "\\")
81
+ occurrences += 1;
82
+ }
83
+ return occurrences % 2 === 1;
84
+ }
85
+ async function replaceConfig(path, content, temporary, backup, filesystem) {
86
+ let previousConfigMoved = false;
62
87
  await filesystem.mkdir(dirname(path), { recursive: true });
63
88
  await filesystem.rm(temporary, { force: true });
64
89
  await filesystem.rm(backup, { force: true });
65
90
  await filesystem.writeFile(temporary, content, { encoding: "utf8", flag: "wx" });
66
91
  try {
67
- try {
68
- await filesystem.rename(path, backup);
69
- previousMoved = true;
70
- }
71
- catch (error) {
72
- if (!isMissingFile(error))
73
- throw error;
74
- }
75
- try {
76
- await filesystem.rename(temporary, path);
77
- }
78
- catch (error) {
79
- if (previousMoved)
80
- await filesystem.rename(backup, path);
92
+ await filesystem.rename(path, backup);
93
+ previousConfigMoved = true;
94
+ }
95
+ catch (error) {
96
+ if (!isMissingFile(error))
81
97
  throw error;
82
- }
83
- if (previousMoved)
84
- await filesystem.rm(backup, { force: true });
98
+ }
99
+ try {
100
+ await filesystem.rename(temporary, path);
85
101
  }
86
102
  catch (error) {
87
- await filesystem.rm(temporary, { force: true }).catch(() => undefined);
103
+ if (previousConfigMoved)
104
+ await filesystem.rename(backup, path);
88
105
  throw error;
89
106
  }
107
+ if (previousConfigMoved)
108
+ await filesystem.rm(backup, { force: true });
90
109
  }
91
110
  function isMissingFile(error) {
92
111
  return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
@@ -1 +1 @@
1
- {"version":3,"file":"global-codex-config.js","sourceRoot":"","sources":["../../src/services/global-codex-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAsB1C,MAAM,cAAc,GAAgC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC;AAErF,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,OAAe,EACf,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,EAC/D,UAAU,GAAG,8BAA8B,EAC3C,UAAU,GAAgC,cAAc,EACxD,UAAU,GAAoC,EAAE;IAEhD,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAC5C,MAAM,SAAS,GAAG,GAAG,IAAI,aAAa,OAAO,CAAC,GAAG,EAAE,CAAC;IACpD,MAAM,MAAM,GAAG,GAAG,IAAI,gBAAgB,OAAO,CAAC,GAAG,EAAE,CAAC;IACpD,IAAI,mBAAmB,GAAG,KAAK,CAAC;IAChC,IAAI,CAAC;QACH,MAAM,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3D,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,UAAU,CAAC,OAAO,EAAE,EAAE,C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