@zaip-ai/cli 6.3.0 → 7.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1282) hide show
  1. package/README.md +13 -11
  2. package/dist/commands/init.d.ts +1 -0
  3. package/dist/commands/init.d.ts.map +1 -1
  4. package/dist/commands/init.js +18 -5
  5. package/dist/commands/init.js.map +1 -1
  6. package/dist/index.js +1 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/services/adapter-codex-config.d.ts +3 -0
  9. package/dist/services/adapter-codex-config.d.ts.map +1 -0
  10. package/dist/services/adapter-codex-config.js +119 -0
  11. package/dist/services/adapter-codex-config.js.map +1 -0
  12. package/dist/services/adapter-config-overlay.d.ts +8 -0
  13. package/dist/services/adapter-config-overlay.d.ts.map +1 -0
  14. package/dist/services/adapter-config-overlay.js +17 -0
  15. package/dist/services/adapter-config-overlay.js.map +1 -0
  16. package/dist/services/adapters.d.ts +3 -2
  17. package/dist/services/adapters.d.ts.map +1 -1
  18. package/dist/services/adapters.js +34 -143
  19. package/dist/services/adapters.js.map +1 -1
  20. package/dist/services/adapters.test.js +12 -0
  21. package/dist/services/adapters.test.js.map +1 -1
  22. package/dist/services/agent-adapters.d.ts +2 -98
  23. package/dist/services/agent-adapters.d.ts.map +1 -1
  24. package/dist/services/agent-adapters.js +30 -29
  25. package/dist/services/agent-adapters.js.map +1 -1
  26. package/dist/services/agent-adapters.test.js +4 -2
  27. package/dist/services/agent-adapters.test.js.map +1 -1
  28. package/dist/services/agent-guidance-types.d.ts +98 -0
  29. package/dist/services/agent-guidance-types.d.ts.map +1 -0
  30. package/dist/services/agent-guidance-types.js +4 -0
  31. package/dist/services/agent-guidance-types.js.map +1 -0
  32. package/dist/services/catalog-toml.d.ts +4 -0
  33. package/dist/services/catalog-toml.d.ts.map +1 -0
  34. package/dist/services/catalog-toml.js +10 -0
  35. package/dist/services/catalog-toml.js.map +1 -0
  36. package/dist/services/catalog-write-scope.d.ts +4 -0
  37. package/dist/services/catalog-write-scope.d.ts.map +1 -0
  38. package/dist/services/catalog-write-scope.js +18 -0
  39. package/dist/services/catalog-write-scope.js.map +1 -0
  40. package/dist/services/claude-settings-overlay.d.ts +4 -0
  41. package/dist/services/claude-settings-overlay.d.ts.map +1 -0
  42. package/dist/services/claude-settings-overlay.js +58 -0
  43. package/dist/services/claude-settings-overlay.js.map +1 -0
  44. package/dist/services/client-selection.d.ts +17 -0
  45. package/dist/services/client-selection.d.ts.map +1 -0
  46. package/dist/services/client-selection.js +67 -0
  47. package/dist/services/client-selection.js.map +1 -0
  48. package/dist/services/codex-conversation-lifecycle-hook.d.ts.map +1 -1
  49. package/dist/services/codex-conversation-lifecycle-hook.js +20 -9
  50. package/dist/services/codex-conversation-lifecycle-hook.js.map +1 -1
  51. package/dist/services/codex-git-publication-template.d.ts +2 -0
  52. package/dist/services/codex-git-publication-template.d.ts.map +1 -0
  53. package/dist/services/codex-git-publication-template.js +120 -0
  54. package/dist/services/codex-git-publication-template.js.map +1 -0
  55. package/dist/services/codex-github-setup-template.d.ts +3 -0
  56. package/dist/services/codex-github-setup-template.d.ts.map +1 -0
  57. package/dist/services/codex-github-setup-template.js +176 -0
  58. package/dist/services/codex-github-setup-template.js.map +1 -0
  59. package/dist/services/codex-hook-activation.d.ts +1 -1
  60. package/dist/services/codex-hook-activation.d.ts.map +1 -1
  61. package/dist/services/codex-hook-activation.js +55 -10
  62. package/dist/services/codex-hook-activation.js.map +1 -1
  63. package/dist/services/codex-host-diagnostic.d.ts +10 -0
  64. package/dist/services/codex-host-diagnostic.d.ts.map +1 -0
  65. package/dist/services/codex-host-diagnostic.js +5 -0
  66. package/dist/services/codex-host-diagnostic.js.map +1 -0
  67. package/dist/services/codex-host-diagnostic.test.d.ts +2 -0
  68. package/dist/services/codex-host-diagnostic.test.d.ts.map +1 -0
  69. package/dist/services/codex-host-diagnostic.test.js +24 -0
  70. package/dist/services/codex-host-diagnostic.test.js.map +1 -0
  71. package/dist/services/codex-literal-read-sequence-template.d.ts.map +1 -1
  72. package/dist/services/codex-literal-read-sequence-template.js +97 -6
  73. package/dist/services/codex-literal-read-sequence-template.js.map +1 -1
  74. package/dist/services/codex-native-authority-policy-template.d.ts +2 -0
  75. package/dist/services/codex-native-authority-policy-template.d.ts.map +1 -0
  76. package/dist/services/codex-native-authority-policy-template.js +132 -0
  77. package/dist/services/codex-native-authority-policy-template.js.map +1 -0
  78. package/dist/services/codex-native-tool-authority-template.d.ts.map +1 -1
  79. package/dist/services/codex-native-tool-authority-template.js +147 -145
  80. package/dist/services/codex-native-tool-authority-template.js.map +1 -1
  81. package/dist/services/codex-node-options-template.d.ts +3 -0
  82. package/dist/services/codex-node-options-template.d.ts.map +1 -0
  83. package/dist/services/codex-node-options-template.js +30 -0
  84. package/dist/services/codex-node-options-template.js.map +1 -0
  85. package/dist/services/codex-pre-tool-cli-capture-template.d.ts.map +1 -1
  86. package/dist/services/codex-pre-tool-cli-capture-template.js +214 -10
  87. package/dist/services/codex-pre-tool-cli-capture-template.js.map +1 -1
  88. package/dist/services/codex-pre-tool-cloud-template.d.ts.map +1 -1
  89. package/dist/services/codex-pre-tool-cloud-template.js +149 -12
  90. package/dist/services/codex-pre-tool-cloud-template.js.map +1 -1
  91. package/dist/services/codex-pre-tool-dependencies.test-support.d.ts.map +1 -1
  92. package/dist/services/codex-pre-tool-dependencies.test-support.js +12 -0
  93. package/dist/services/codex-pre-tool-dependencies.test-support.js.map +1 -1
  94. package/dist/services/codex-pre-tool-hook-template.d.ts.map +1 -1
  95. package/dist/services/codex-pre-tool-hook-template.js +53 -138
  96. package/dist/services/codex-pre-tool-hook-template.js.map +1 -1
  97. package/dist/services/codex-pre-tool-hook-template.test.js +13 -7
  98. package/dist/services/codex-pre-tool-hook-template.test.js.map +1 -1
  99. package/dist/services/codex-pre-tool-host-context-template.d.ts.map +1 -1
  100. package/dist/services/codex-pre-tool-host-context-template.js +23 -0
  101. package/dist/services/codex-pre-tool-host-context-template.js.map +1 -1
  102. package/dist/services/codex-pre-tool-policy-template.d.ts.map +1 -1
  103. package/dist/services/codex-pre-tool-policy-template.js +5 -3
  104. package/dist/services/codex-pre-tool-policy-template.js.map +1 -1
  105. package/dist/services/codex-pre-tool-release-review-template.d.ts.map +1 -1
  106. package/dist/services/codex-pre-tool-release-review-template.js +161 -2
  107. package/dist/services/codex-pre-tool-release-review-template.js.map +1 -1
  108. package/dist/services/codex-pre-tool-support-template.d.ts.map +1 -1
  109. package/dist/services/codex-pre-tool-support-template.js +88 -129
  110. package/dist/services/codex-pre-tool-support-template.js.map +1 -1
  111. package/dist/services/codex-release-publication-template.d.ts +2 -0
  112. package/dist/services/codex-release-publication-template.d.ts.map +1 -0
  113. package/dist/services/codex-release-publication-template.js +127 -0
  114. package/dist/services/codex-release-publication-template.js.map +1 -0
  115. package/dist/services/codex-repository-profile-template.d.ts +2 -0
  116. package/dist/services/codex-repository-profile-template.d.ts.map +1 -0
  117. package/dist/services/codex-repository-profile-template.js +84 -0
  118. package/dist/services/codex-repository-profile-template.js.map +1 -0
  119. package/dist/services/codex-rules.d.ts +1 -1
  120. package/dist/services/codex-rules.d.ts.map +1 -1
  121. package/dist/services/codex-rules.js +2 -2
  122. package/dist/services/codex-storage-handoff-template.d.ts +2 -0
  123. package/dist/services/codex-storage-handoff-template.d.ts.map +1 -0
  124. package/dist/services/codex-storage-handoff-template.js +18 -0
  125. package/dist/services/codex-storage-handoff-template.js.map +1 -0
  126. package/dist/services/codex-subagent-hook-template.d.ts +1 -1
  127. package/dist/services/codex-subagent-hook-template.d.ts.map +1 -1
  128. package/dist/services/codex-subagent-hook-template.js +7 -6
  129. package/dist/services/codex-subagent-hook-template.js.map +1 -1
  130. package/dist/services/codex-task-delivery-authority-template.d.ts +3 -0
  131. package/dist/services/codex-task-delivery-authority-template.d.ts.map +1 -0
  132. package/dist/services/codex-task-delivery-authority-template.js +244 -0
  133. package/dist/services/codex-task-delivery-authority-template.js.map +1 -0
  134. package/dist/services/codex-validation-runtime-template.js +1 -1
  135. package/dist/services/codex-windows-hook-command.js +2 -2
  136. package/dist/services/codex-windows-hook-command.js.map +1 -1
  137. package/dist/services/developer-identity-fixture.d.ts.map +1 -1
  138. package/dist/services/developer-identity-fixture.js +3 -2
  139. package/dist/services/developer-identity-fixture.js.map +1 -1
  140. package/dist/services/doctor.d.ts.map +1 -1
  141. package/dist/services/doctor.js +5 -1
  142. package/dist/services/doctor.js.map +1 -1
  143. package/dist/services/github-setup-status.d.ts +6 -3
  144. package/dist/services/github-setup-status.d.ts.map +1 -1
  145. package/dist/services/github-setup-status.js +9 -5
  146. package/dist/services/github-setup-status.js.map +1 -1
  147. package/dist/services/github-setup-status.test.js +69 -3
  148. package/dist/services/github-setup-status.test.js.map +1 -1
  149. package/dist/services/global-codex-config.d.ts.map +1 -1
  150. package/dist/services/global-codex-config.js +3 -0
  151. package/dist/services/global-codex-config.js.map +1 -1
  152. package/dist/services/global-codex-project-trust.d.ts +17 -0
  153. package/dist/services/global-codex-project-trust.d.ts.map +1 -0
  154. package/dist/services/global-codex-project-trust.js +221 -0
  155. package/dist/services/global-codex-project-trust.js.map +1 -0
  156. package/dist/services/global-codex-project-trust.test.d.ts +2 -0
  157. package/dist/services/global-codex-project-trust.test.d.ts.map +1 -0
  158. package/dist/services/global-codex-project-trust.test.js +219 -0
  159. package/dist/services/global-codex-project-trust.test.js.map +1 -0
  160. package/dist/services/install-agents-template.d.ts.map +1 -1
  161. package/dist/services/install-agents-template.js +97 -192
  162. package/dist/services/install-agents-template.js.map +1 -1
  163. package/dist/services/install-client-selection.d.ts +6 -0
  164. package/dist/services/install-client-selection.d.ts.map +1 -0
  165. package/dist/services/install-client-selection.js +24 -0
  166. package/dist/services/install-client-selection.js.map +1 -0
  167. package/dist/services/install-result.d.ts +6 -0
  168. package/dist/services/install-result.d.ts.map +1 -0
  169. package/dist/services/install-result.js +14 -0
  170. package/dist/services/install-result.js.map +1 -0
  171. package/dist/services/install-storage-boundary.d.ts +6 -0
  172. package/dist/services/install-storage-boundary.d.ts.map +1 -0
  173. package/dist/services/install-storage-boundary.js +173 -0
  174. package/dist/services/install-storage-boundary.js.map +1 -0
  175. package/dist/services/install-storage-boundary.test.d.ts +2 -0
  176. package/dist/services/install-storage-boundary.test.d.ts.map +1 -0
  177. package/dist/services/install-storage-boundary.test.js +110 -0
  178. package/dist/services/install-storage-boundary.test.js.map +1 -0
  179. package/dist/services/install-target-windows.test.d.ts +2 -0
  180. package/dist/services/install-target-windows.test.d.ts.map +1 -0
  181. package/dist/services/install-target-windows.test.js +39 -0
  182. package/dist/services/install-target-windows.test.js.map +1 -0
  183. package/dist/services/install-target.d.ts +6 -0
  184. package/dist/services/install-target.d.ts.map +1 -0
  185. package/dist/services/install-target.js +89 -0
  186. package/dist/services/install-target.js.map +1 -0
  187. package/dist/services/install-target.test.d.ts +2 -0
  188. package/dist/services/install-target.test.d.ts.map +1 -0
  189. package/dist/services/install-target.test.js +47 -0
  190. package/dist/services/install-target.test.js.map +1 -0
  191. package/dist/services/install-template-backup.d.ts +3 -0
  192. package/dist/services/install-template-backup.d.ts.map +1 -0
  193. package/dist/services/install-template-backup.js +46 -0
  194. package/dist/services/install-template-backup.js.map +1 -0
  195. package/dist/services/install-template-lock.d.ts +2 -0
  196. package/dist/services/install-template-lock.d.ts.map +1 -0
  197. package/dist/services/install-template-lock.js +32 -0
  198. package/dist/services/install-template-lock.js.map +1 -0
  199. package/dist/services/install-template-policy.d.ts +16 -0
  200. package/dist/services/install-template-policy.d.ts.map +1 -1
  201. package/dist/services/install-template-policy.js +73 -1
  202. package/dist/services/install-template-policy.js.map +1 -1
  203. package/dist/services/install-template-render.d.ts +11 -0
  204. package/dist/services/install-template-render.d.ts.map +1 -0
  205. package/dist/services/install-template-render.js +53 -0
  206. package/dist/services/install-template-render.js.map +1 -0
  207. package/dist/services/install-template-rule-files.d.ts +3 -0
  208. package/dist/services/install-template-rule-files.d.ts.map +1 -0
  209. package/dist/services/install-template-rule-files.js +24 -0
  210. package/dist/services/install-template-rule-files.js.map +1 -0
  211. package/dist/services/logger.d.ts.map +1 -1
  212. package/dist/services/logger.js +37 -10
  213. package/dist/services/logger.js.map +1 -1
  214. package/dist/services/logger.test.js +65 -16
  215. package/dist/services/logger.test.js.map +1 -1
  216. package/dist/services/project-config-upgrade.d.ts +3 -0
  217. package/dist/services/project-config-upgrade.d.ts.map +1 -0
  218. package/dist/services/project-config-upgrade.js +58 -0
  219. package/dist/services/project-config-upgrade.js.map +1 -0
  220. package/dist/services/runtime-template-deploy-policy.test.d.ts +2 -0
  221. package/dist/services/runtime-template-deploy-policy.test.d.ts.map +1 -0
  222. package/dist/services/runtime-template-deploy-policy.test.js +26 -0
  223. package/dist/services/runtime-template-deploy-policy.test.js.map +1 -0
  224. package/dist/services/runtime-template-test-support.d.ts +14 -0
  225. package/dist/services/runtime-template-test-support.d.ts.map +1 -1
  226. package/dist/services/runtime-template-test-support.js +18 -0
  227. package/dist/services/runtime-template-test-support.js.map +1 -1
  228. package/dist/services/runtime-template.test.js +14 -63
  229. package/dist/services/runtime-template.test.js.map +1 -1
  230. package/dist/services/sqlite-bootstrap.js +2 -2
  231. package/dist/services/sqlite-bootstrap.js.map +1 -1
  232. package/dist/services/stack-node.js +2 -2
  233. package/dist/services/stack-node.js.map +1 -1
  234. package/dist/services/stack-terraform.d.ts.map +1 -1
  235. package/dist/services/stack-terraform.js +5 -5
  236. package/dist/services/stack-terraform.js.map +1 -1
  237. package/dist/services/template-packed-path.test.d.ts +2 -0
  238. package/dist/services/template-packed-path.test.d.ts.map +1 -0
  239. package/dist/services/template-packed-path.test.js +30 -0
  240. package/dist/services/template-packed-path.test.js.map +1 -0
  241. package/dist/types.d.ts +8 -0
  242. package/dist/types.d.ts.map +1 -1
  243. package/package.json +2 -1
  244. package/templates/.agents/README-ENG.md +3 -1
  245. package/templates/.agents/README.md +3 -1
  246. package/templates/.agents/architecture/software-architecture.md +7 -1
  247. package/templates/.agents/config/agents/catalog.yaml +25 -12
  248. package/templates/.agents/config/agents/discovery.json +2 -2
  249. package/templates/.agents/config/autonomous-cloud-inputs.json +3 -3
  250. package/templates/.agents/config/clients/codex/agents/zaip-agent-analyst.toml +4 -2
  251. package/templates/.agents/config/clients/codex/agents/zaip-agent-auditor.toml +1 -1
  252. package/templates/.agents/config/clients/codex/agents/zaip-agent-backend.toml +6 -4
  253. package/templates/.agents/config/clients/codex/agents/zaip-agent-brand-strategist.toml +3 -1
  254. package/templates/.agents/config/clients/codex/agents/zaip-agent-builder.toml +6 -4
  255. package/templates/.agents/config/clients/codex/agents/zaip-agent-cloud-engineer.toml +5 -3
  256. package/templates/.agents/config/clients/codex/agents/zaip-agent-data-analyst.toml +3 -1
  257. package/templates/.agents/config/clients/codex/agents/zaip-agent-designer.toml +7 -4
  258. package/templates/.agents/config/clients/codex/agents/zaip-agent-finalizer.toml +1 -1
  259. package/templates/.agents/config/clients/codex/agents/zaip-agent-frontend.toml +9 -6
  260. package/templates/.agents/config/clients/codex/agents/zaip-agent-general-operations.toml +3 -1
  261. package/templates/.agents/config/clients/codex/agents/zaip-agent-governance-compliance.toml +3 -1
  262. package/templates/.agents/config/clients/codex/agents/zaip-agent-growth-strategist.toml +3 -1
  263. package/templates/.agents/config/clients/codex/agents/zaip-agent-integrator.toml +1 -1
  264. package/templates/.agents/config/clients/codex/agents/zaip-agent-marketing-analyst.toml +5 -3
  265. package/templates/.agents/config/clients/codex/agents/zaip-agent-orchestrator.toml +4 -4
  266. package/templates/.agents/config/clients/codex/agents/zaip-agent-refactoring-specialist.toml +3 -1
  267. package/templates/.agents/config/clients/codex/agents/zaip-agent-reviewer.toml +3 -3
  268. package/templates/.agents/config/clients/codex/agents/zaip-agent-sales-specialist.toml +3 -1
  269. package/templates/.agents/config/clients/codex/agents/zaip-agent-security-auditor.toml +1 -1
  270. package/templates/.agents/config/clients/codex/agents/zaip-agent-task-executor.toml +6 -3
  271. package/templates/.agents/config/clients/codex/agents/zaip-agent-website-developer.toml +7 -4
  272. package/templates/.agents/config/clients/codex/agents/zaip-agent-writer.toml +3 -1
  273. package/templates/.agents/config/project.yaml +7 -2
  274. package/templates/.agents/dashboard/.zaip-managed.json +326 -146
  275. package/templates/.agents/dashboard/apps/frontend/dist/assets/CostCalculationGuidePage-DZ2mnR6k.js +1 -0
  276. package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-BQOQCvcJ.js → DashboardHelpDialog-DnxpHJSo.js} +20 -10
  277. package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-CGET1J8Q.js → PricingSettingsDialog-DsFTUwhL.js} +1 -1
  278. package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-86kLUrXm.js +3 -0
  279. package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-Bw6xnXUN.js → TraceabilityWorkspace-BZ1rH1vl.js} +1 -1
  280. package/templates/.agents/dashboard/apps/frontend/dist/assets/{cost-monitor-C2AFYBu_.css → cost-monitor-BESDS3aE.css} +1 -1
  281. package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-YfoKMzCQ.js +59 -0
  282. package/templates/.agents/dashboard/apps/frontend/dist/assets/{dashboard-localization-BZf8HWmm.js → dashboard-localization-BVBhiAAS.js} +3 -1
  283. package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-CjGGux6h.js → icons-vendor-DSdQAua1.js} +1 -1
  284. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-4cl5FQBn.css +1 -0
  285. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-C4uiRYHu.js +2 -0
  286. package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-B9jZSAKf.js → react-vendor-rGvJzdn5.js} +1 -1
  287. package/templates/.agents/dashboard/apps/frontend/dist/assets/{traceability-DFY7ZDlu.css → traceability-s5SzQnzt.css} +1 -1
  288. package/templates/.agents/dashboard/apps/frontend/dist/assets/traceability-vQx9R6BQ.js +1 -0
  289. package/templates/.agents/dashboard/apps/frontend/dist/index.html +9 -8
  290. package/templates/.agents/dashboard/apps/frontend/e2e/release-delivery-fixture.mjs +117 -0
  291. package/templates/.agents/dashboard/apps/frontend/e2e/release-delivery-lab.mjs +246 -0
  292. package/templates/.agents/dashboard/apps/frontend/e2e/release-delivery-receipt.mjs +65 -0
  293. package/templates/.agents/dashboard/apps/frontend/index.html +1 -0
  294. package/templates/.agents/dashboard/apps/frontend/package.json +1 -1
  295. package/templates/.agents/dashboard/apps/frontend/playwright.dom.config.ts +2 -2
  296. package/templates/.agents/dashboard/apps/frontend/src/AppLoadingPanels.tsx +10 -7
  297. package/templates/.agents/dashboard/apps/frontend/src/AppOverlays.tsx +22 -19
  298. package/templates/.agents/dashboard/apps/frontend/src/CostCalculationGuidePage.tsx +16 -117
  299. package/templates/.agents/dashboard/apps/frontend/src/CostCharts.percentages.test.tsx +75 -0
  300. package/templates/.agents/dashboard/apps/frontend/src/CostTelemetryGuide.tsx +36 -0
  301. package/templates/.agents/dashboard/apps/frontend/src/DashboardToast.tsx +9 -0
  302. package/templates/.agents/dashboard/apps/frontend/src/ProjectSettingsPage.dom.test.ts +1 -1
  303. package/templates/.agents/dashboard/apps/frontend/src/ProjectStackEditor.tsx +1 -0
  304. package/templates/.agents/dashboard/apps/frontend/src/ReconciliationFeedback.dom.test.ts +1 -1
  305. package/templates/.agents/dashboard/apps/frontend/src/ReconciliationFeedback.tsx +22 -19
  306. package/templates/.agents/dashboard/apps/frontend/src/TraceabilityWorkspace.dom.e2e.ts +5 -2
  307. package/templates/.agents/dashboard/apps/frontend/src/WorkspaceStatus.dom.test.ts +86 -0
  308. package/templates/.agents/dashboard/apps/frontend/src/WorkspaceStatus.test.tsx +44 -0
  309. package/templates/.agents/dashboard/apps/frontend/src/WorkspaceStatus.tsx +37 -12
  310. package/templates/.agents/dashboard/apps/frontend/src/cost-guide-calculations.ts +118 -0
  311. package/templates/.agents/dashboard/apps/frontend/src/dashboard-api-sqlite-view.ts +3 -0
  312. package/templates/.agents/dashboard/apps/frontend/src/dashboard-api.ts +15 -31
  313. package/templates/.agents/dashboard/apps/frontend/src/dashboard-http-transport.ts +30 -0
  314. package/templates/.agents/dashboard/apps/frontend/src/dashboard-runtime-status.ts +8 -1
  315. package/templates/.agents/dashboard/apps/frontend/src/main.tsx +1 -0
  316. package/templates/.agents/dashboard/apps/frontend/src/project-settings-model.ts +2 -0
  317. package/templates/.agents/dashboard/apps/frontend/src/project-settings.test.ts +17 -0
  318. package/templates/.agents/dashboard/apps/frontend/src/release-delivery.test.tsx +78 -0
  319. package/templates/.agents/dashboard/apps/frontend/src/snapshot-coherence.test.ts +0 -20
  320. package/templates/.agents/dashboard/apps/frontend/src/snapshot-observer.test.ts +112 -0
  321. package/templates/.agents/dashboard/apps/frontend/src/snapshot-observer.ts +147 -0
  322. package/templates/.agents/dashboard/apps/frontend/src/sqlite-compact-cost-adapter.ts +100 -0
  323. package/templates/.agents/dashboard/apps/frontend/src/sqlite-page-export.test.ts +20 -0
  324. package/templates/.agents/dashboard/apps/frontend/src/sqlite-page-export.ts +15 -0
  325. package/templates/.agents/dashboard/apps/frontend/src/styles-pricing.css +265 -0
  326. package/templates/.agents/dashboard/apps/frontend/src/styles.css +21 -265
  327. package/templates/.agents/dashboard/apps/frontend/src/use-app-cost-loaders.test.ts +35 -0
  328. package/templates/.agents/dashboard/apps/frontend/src/use-app-cost-loaders.ts +11 -87
  329. package/templates/.agents/dashboard/apps/frontend/src/use-app-effects.ts +26 -199
  330. package/templates/.agents/dashboard/apps/frontend/src/use-app-trace-documents.navigation.test.tsx +1 -1
  331. package/templates/.agents/dashboard/apps/frontend/src/use-app-work-board.test.ts +65 -0
  332. package/templates/.agents/dashboard/apps/frontend/src/use-app-work-board.ts +17 -1
  333. package/templates/.agents/dashboard/apps/frontend/src/use-dashboard-app-model.tsx +2 -2
  334. package/templates/.agents/dashboard/apps/frontend/src/use-operations-detail-export.ts +10 -0
  335. package/templates/.agents/dashboard/apps/frontend/src/use-runtime-status.dom.test.ts +108 -0
  336. package/templates/.agents/dashboard/apps/frontend/src/use-runtime-status.ts +18 -8
  337. package/templates/.agents/dashboard/apps/frontend/src/workspace-status.css +42 -0
  338. package/templates/.agents/dashboard/apps/frontend/vite.config.ts +1 -1
  339. package/templates/.agents/dashboard/modules/cost-monitor/package.json +1 -1
  340. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CompactLifecycleCostTable.test.ts +11 -10
  341. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CompactLifecycleCostTable.tsx +39 -15
  342. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostCharts.test.ts +27 -0
  343. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostCharts.tsx +89 -83
  344. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostGroupsTable.tsx +14 -24
  345. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.test.ts +1 -27
  346. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.tsx +12 -63
  347. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.availability.test.ts +60 -0
  348. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.test.ts +1 -15
  349. package/templates/.agents/dashboard/modules/cost-monitor/src/react/compact-cost-export-source.ts +85 -0
  350. package/templates/.agents/dashboard/modules/cost-monitor/src/react/compact-cost-page-range.test.ts +34 -0
  351. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-chart-presentation.ts +74 -0
  352. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-charts.css +117 -0
  353. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-group-table-totals.ts +29 -0
  354. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-export-sources.ts +19 -0
  355. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-page-state.ts +27 -0
  356. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor.css +6 -117
  357. package/templates/.agents/dashboard/modules/cost-monitor/src/react/use-cost-group-page.ts +3 -1
  358. package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-summary-projection.ts +9 -32
  359. package/templates/.agents/dashboard/modules/cost-monitor/src/server/cost-summary-metrics.ts +33 -0
  360. package/templates/.agents/dashboard/modules/operations/package.json +1 -1
  361. package/templates/.agents/dashboard/modules/operations/src/react/OperationsLocaleMenu.tsx +58 -0
  362. package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverviewTopPanel.navigation.test.tsx +1 -1
  363. package/templates/.agents/dashboard/modules/operations/src/react/OperationsPage.tsx +16 -47
  364. package/templates/.agents/dashboard/modules/operations/src/react/UnifiedWorkBoard.navigation.test.ts +1 -1
  365. package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportAction.test.ts +4 -100
  366. package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportAction.tsx +25 -89
  367. package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportColumns.ts +1 -0
  368. package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportDuration.test.ts +105 -0
  369. package/templates/.agents/dashboard/modules/operations/src/react/export/export-duration-rows.ts +91 -0
  370. package/templates/.agents/dashboard/modules/operations/src/react/operations-page-contract.ts +4 -0
  371. package/templates/.agents/dashboard/modules/traceability/package.json +1 -1
  372. package/templates/.agents/dashboard/modules/traceability/src/contracts.ts +11 -0
  373. package/templates/.agents/dashboard/modules/traceability/src/react/ReleaseDeliveryPanel.tsx +60 -0
  374. package/templates/.agents/dashboard/modules/traceability/src/react/TaskTracePanel.tsx +9 -57
  375. package/templates/.agents/dashboard/modules/traceability/src/react/release-delivery-panel.css +26 -0
  376. package/templates/.agents/dashboard/modules/traceability/src/react/trace-date-format.ts +33 -0
  377. package/templates/.agents/dashboard/modules/traceability/src/react/trace-stage-labels.ts +28 -0
  378. package/templates/.agents/dashboard/packages/branding/package.json +1 -1
  379. package/templates/.agents/dashboard/packages/contracts/package.json +2 -2
  380. package/templates/.agents/dashboard/packages/contracts/src/export.ts +2 -0
  381. package/templates/.agents/dashboard/packages/data-export/package.json +1 -1
  382. package/templates/.agents/dashboard/packages/data-export/src/index.test.ts +30 -0
  383. package/templates/.agents/dashboard/packages/data-export/src/index.ts +10 -0
  384. package/templates/.agents/dashboard/packages/data-export/src/ooxml-stream.ts +50 -3
  385. package/templates/.agents/dashboard/packages/local-runtime/DIAGNOSTICS.md +2 -1
  386. package/templates/.agents/dashboard/packages/local-runtime/dashboard-build-fingerprint.mjs +1 -1
  387. package/templates/.agents/dashboard/packages/local-runtime/dashboard-diagnostics.mjs +4 -2
  388. package/templates/.agents/dashboard/packages/local-runtime/dashboard-diagnostics.test.mjs +1 -1
  389. package/templates/.agents/dashboard/packages/local-runtime/dist/server.cjs +310 -264
  390. package/templates/.agents/dashboard/packages/local-runtime/dist/sqlite-read-model.cjs +266 -222
  391. package/templates/.agents/dashboard/packages/local-runtime/package.json +3 -3
  392. package/templates/.agents/dashboard/packages/local-runtime/scripts/verify-dashboard-executable-startup.mjs +4 -1
  393. package/templates/.agents/dashboard/packages/local-runtime/scripts/verify-dashboard-reconciliation-executable.mjs +4 -4
  394. package/templates/.agents/dashboard/packages/local-runtime/server.mjs +310 -264
  395. package/templates/.agents/dashboard/packages/local-runtime/src/active-codex-telemetry.test.ts +51 -0
  396. package/templates/.agents/dashboard/packages/local-runtime/src/active-codex-telemetry.ts +15 -1
  397. package/templates/.agents/dashboard/packages/local-runtime/src/dashboard-diagnostics.test.ts +1 -1
  398. package/templates/.agents/dashboard/packages/local-runtime/src/project-settings.ts +3 -40
  399. package/templates/.agents/dashboard/packages/local-runtime/src/project-stack-labels.ts +40 -0
  400. package/templates/.agents/dashboard/packages/local-runtime/src/retained-worktree-capture.ts +81 -0
  401. package/templates/.agents/dashboard/packages/local-runtime/src/server-board.ts +11 -2
  402. package/templates/.agents/dashboard/packages/local-runtime/src/server-hono-security.test.ts +40 -0
  403. package/templates/.agents/dashboard/packages/local-runtime/src/server-operations-routes.ts +33 -14
  404. package/templates/.agents/dashboard/packages/local-runtime/src/server-project-settings-routes.test.ts +83 -0
  405. package/templates/.agents/dashboard/packages/local-runtime/src/server-project-settings-routes.ts +41 -0
  406. package/templates/.agents/dashboard/packages/local-runtime/src/server-projections.ts +3 -19
  407. package/templates/.agents/dashboard/packages/local-runtime/src/server-reconciliation-diagnostics.test.ts +2 -2
  408. package/templates/.agents/dashboard/packages/local-runtime/src/server-reconciliation-refresh.test.ts +61 -0
  409. package/templates/.agents/dashboard/packages/local-runtime/src/server-reconciliation-route.ts +2 -2
  410. package/templates/.agents/dashboard/packages/local-runtime/src/server-release-receipt.ts +71 -0
  411. package/templates/.agents/dashboard/packages/local-runtime/src/server-run-range.ts +18 -0
  412. package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot-refresh.ts +3 -36
  413. package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot-worker-receipt.ts +38 -0
  414. package/templates/.agents/dashboard/packages/local-runtime/src/server-trace-release-delivery.ts +120 -0
  415. package/templates/.agents/dashboard/packages/local-runtime/src/server-trace-routes.ts +5 -4
  416. package/templates/.agents/dashboard/packages/local-runtime/src/server-work-priority-route.ts +18 -0
  417. package/templates/.agents/dashboard/packages/local-runtime/src/server-workspace.ts +1 -0
  418. package/templates/.agents/dashboard/packages/local-runtime/src/server.ts +6 -32
  419. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-summary-rollup.ts +47 -0
  420. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-financial-consistency.test.ts +133 -0
  421. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-financial-entity-page.ts +159 -0
  422. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-incremental-refresh.test.ts +12 -2
  423. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-operations-work-list.ts +17 -0
  424. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-operation-pages.ts +71 -0
  425. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-summary.ts +5 -40
  426. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-temporal-dimension.ts +29 -7
  427. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-view-page.ts +7 -55
  428. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-counts-every-root-execution-day-returns.test.ts +16 -24
  429. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-counts-fixture.test-support.ts +27 -5
  430. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-filesystem.ts +20 -37
  431. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-keeps-orphan-telemetry-out-kanban-without.test.ts +9 -9
  432. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-marks-token-cost-telemetry-unavailable-when.test.ts +3 -3
  433. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-multi-provider.test.ts +14 -20
  434. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-rebuilds-disposable-snapshot-serves-zaip-records.test.ts +11 -1
  435. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-schema.ts +1 -1
  436. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-work-financial-summary.ts +38 -0
  437. package/templates/.agents/dashboard/packages/local-runtime/src/telemetry-reconciliation.integration.test.ts +223 -0
  438. package/templates/.agents/dashboard/packages/local-runtime/src/work-priority-contract.test.ts +5 -5
  439. package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-launch-page.test.mjs +59 -3
  440. package/templates/.agents/dashboard/packages/ui/package.json +1 -1
  441. package/templates/.agents/dashboard/packages/windows-launcher/Program.cs +1 -1
  442. package/templates/.agents/dashboard/packages/windows-launcher/build-dashboard-launcher.ps1 +1 -1
  443. package/templates/.agents/dashboard/stack-dependencies.json +3 -3
  444. package/templates/.agents/dashboard/tests/e2e/package.json +1 -1
  445. package/templates/.agents/dashboard/tests/e2e/playwright.config.ts +1 -0
  446. package/templates/.agents/dashboard/tests/e2e/specs/dashboard.spec.ts +11 -15
  447. package/templates/.agents/dashboard/tests/e2e/specs/work-board-hydration.ts +40 -11
  448. package/templates/.agents/dashboard/zaip-dashboard-windows.exe +0 -0
  449. package/templates/.agents/design/.zaip-managed.json +498 -54
  450. package/templates/.agents/design/apps/catalog/dist/assets/index-BH6Fxbj0.css +1 -0
  451. package/templates/.agents/design/apps/catalog/dist/assets/index-BK0aBll9.css +1 -0
  452. package/templates/.agents/design/apps/catalog/dist/assets/index-Bzhb1wb_.js +76 -0
  453. package/templates/.agents/design/apps/catalog/dist/assets/index-CB-MTaWq.js +76 -0
  454. package/templates/.agents/design/apps/catalog/dist/assets/index-CIqfUcy8.js +76 -0
  455. package/templates/.agents/design/apps/catalog/dist/assets/index-Ccq-NOLA.js +76 -0
  456. package/templates/.agents/design/apps/catalog/dist/assets/index-Ch2eyD9C.js +76 -0
  457. package/templates/.agents/design/apps/catalog/dist/assets/index-Cy64ytQr.js +67 -0
  458. package/templates/.agents/design/apps/catalog/dist/assets/index-DfxEbFlq.js +76 -0
  459. package/templates/.agents/design/apps/catalog/dist/assets/index-Dqt6mTvD.js +76 -0
  460. package/templates/.agents/design/apps/catalog/dist/assets/index-rz8gOc0a.js +76 -0
  461. package/templates/.agents/design/apps/catalog/dist/index.html +2 -2
  462. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{CatalogShell-BJ8b4xZr.js → CatalogShell-D2YyQQrT.js} +1 -1
  463. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{Color-6AOWCN3U-CQLHzznn.js → Color-6AOWCN3U-BmCuNXMg.js} +1 -1
  464. package/templates/.agents/design/apps/catalog/dist/storybook/assets/Components.stories-DF9KC_gA.js +158 -0
  465. package/templates/.agents/design/apps/catalog/dist/storybook/assets/DashboardFilters.stories-D17Q1egS.js +5 -0
  466. package/templates/.agents/design/apps/catalog/dist/storybook/assets/DashboardFiltersSpecimen-CEBrLT2k.js +1 -0
  467. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{DesignSystem.stories-ED52wFjY.js → DesignSystem.stories-BibuRt_c.js} +1 -1
  468. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{DocsRenderer-JROSPFPF-BcLgM80v.js → DocsRenderer-JROSPFPF-GkfL8_gG.js} +4 -4
  469. package/templates/.agents/design/apps/catalog/dist/storybook/assets/Maker.stories-Dv9Keun_.js +13 -0
  470. package/templates/.agents/design/apps/catalog/dist/storybook/assets/MakerSpecimen-DGwAKRi9.css +1 -0
  471. package/templates/.agents/design/apps/catalog/dist/storybook/assets/MakerSpecimen-mkkuFOp_.js +5 -0
  472. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{Primitives-DV6Bpudf.js → Primitives-n1UqmNvo.js} +1 -1
  473. package/templates/.agents/design/apps/catalog/dist/storybook/assets/ReconciliationSpecimen-BJnfyyG3.js +1 -0
  474. package/templates/.agents/design/apps/catalog/dist/storybook/assets/ReconciliationSpecimen.stories-CH-GF9Rk.js +13 -0
  475. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{WithTooltip-7X4HQR7L-BKNiAz_E.js → WithTooltip-7X4HQR7L-BPXo6OoG.js} +1 -1
  476. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{WorkspaceStatus.stories-BL19HGOo.js → WorkspaceStatus.stories-Cie1f_yU.js} +1 -1
  477. package/templates/.agents/design/apps/catalog/dist/storybook/assets/WorkspaceStatusSpecimen-GcYWBBSp.js +1 -0
  478. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{chunk-DRQKCCAG-DZBcXL-p.js → chunk-DRQKCCAG-Cn4_bvJJ.js} +1 -1
  479. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{chunk-W22LQPXL-CF3y2mfo.js → chunk-W22LQPXL-CQrULeB4.js} +1 -1
  480. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{components-BVjxMRGq.js → components-uiaDZHE7.js} +5 -5
  481. package/templates/.agents/design/apps/catalog/dist/storybook/assets/formatter-L2YTDE3Q-DfjRffT7.js +1 -0
  482. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{iframe-CTWGZcEe.js → iframe-BgEb-d5o.js} +4 -4
  483. package/templates/.agents/design/apps/catalog/dist/storybook/assets/iframe-D1JaPXfV.css +1 -0
  484. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{react-18-B9_a4mHb.js → react-18-BZ-Ne01c.js} +1 -1
  485. package/templates/.agents/design/apps/catalog/dist/storybook/assets/react-CwpjKEyW.js +1 -0
  486. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{syntaxhighlighter-YFXUGROL-F_p8E2xc.js → syntaxhighlighter-YFXUGROL-BvuP8St2.js} +1 -1
  487. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{theming-fbSD9ZLF.js → theming-BGScn6Yf.js} +1 -1
  488. package/templates/.agents/design/apps/catalog/dist/storybook/iframe.html +2 -2
  489. package/templates/.agents/design/apps/catalog/dist/storybook/index.json +1 -1
  490. package/templates/.agents/design/apps/catalog/dist/storybook/sb-addons/a11y-2/manager-bundle.js +3 -3
  491. package/templates/.agents/design/apps/catalog/dist/storybook/sb-addons/docs-1/manager-bundle.js +4 -4
  492. package/templates/.agents/design/apps/catalog/dist/storybook/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +3 -3
  493. package/templates/.agents/design/apps/catalog/package.json +2 -2
  494. package/templates/.agents/design/apps/catalog/src/components/WorkspaceStatusSpecimen.tsx +32 -1
  495. package/templates/.agents/design/apps/catalog/src/pages/ComponentsPage.tsx +14 -3
  496. package/templates/.agents/design/apps/catalog/src/specimens/MAKER-HANDOFF.md +134 -0
  497. package/templates/.agents/design/apps/catalog/src/specimens/MakerSpecimen.test.tsx +143 -0
  498. package/templates/.agents/design/apps/catalog/src/specimens/MakerSpecimen.tsx +132 -0
  499. package/templates/.agents/design/apps/catalog/src/specimens/maker-fixtures.d.ts +15 -0
  500. package/templates/.agents/design/apps/catalog/src/specimens/maker-fixtures.js +86 -0
  501. package/templates/.agents/design/apps/catalog/src/specimens/maker-native.d.ts +1 -0
  502. package/templates/.agents/design/apps/catalog/src/specimens/maker-native.js +332 -0
  503. package/templates/.agents/design/apps/catalog/src/stories/Maker.stories.tsx +24 -0
  504. package/templates/.agents/design/apps/catalog/src/stories/WorkspaceStatus.stories.tsx +1 -0
  505. package/templates/.agents/design/apps/catalog/src/styles/maker-specimen.css +285 -0
  506. package/templates/.agents/design/design-system-maker/API.md +468 -0
  507. package/templates/.agents/design/design-system-maker/NOTICE.md +13 -0
  508. package/templates/.agents/design/design-system-maker/README.md +138 -0
  509. package/templates/.agents/design/design-system-maker/SOURCE-PROVENANCE.json +62 -0
  510. package/templates/.agents/design/design-system-maker/build.json +539 -0
  511. package/templates/.agents/design/design-system-maker/frontend/ADAPTATION.md +351 -0
  512. package/templates/.agents/design/design-system-maker/frontend/MAKER-REPAIR-HANDOFF.md +134 -0
  513. package/templates/.agents/design/design-system-maker/frontend/advanced/examples.js +30 -0
  514. package/templates/.agents/design/design-system-maker/frontend/advanced/index.html +75 -0
  515. package/templates/.agents/design/design-system-maker/frontend/advanced/index.js +30 -0
  516. package/templates/.agents/design/design-system-maker/frontend/catalog/filters.js +132 -0
  517. package/templates/.agents/design/design-system-maker/frontend/catalog/index.html +17 -0
  518. package/templates/.agents/design/design-system-maker/frontend/catalog/index.js +82 -0
  519. package/templates/.agents/design/design-system-maker/frontend/generate.html +74 -0
  520. package/templates/.agents/design/design-system-maker/frontend/generate.js +226 -0
  521. package/templates/.agents/design/design-system-maker/frontend/shared/api.js +112 -0
  522. package/templates/.agents/design/design-system-maker/frontend/shared/components.js +200 -0
  523. package/templates/.agents/design/design-system-maker/frontend/shared/diagnostic-view.js +218 -0
  524. package/templates/.agents/design/design-system-maker/frontend/shared/extraction-state.js +38 -0
  525. package/templates/.agents/design/design-system-maker/frontend/shared/failure-view.js +54 -0
  526. package/templates/.agents/design/design-system-maker/frontend/shared/frontend-scenarios-2.test.mjs +138 -0
  527. package/templates/.agents/design/design-system-maker/frontend/shared/frontend.test.mjs +357 -0
  528. package/templates/.agents/design/design-system-maker/frontend/shared/job-view.js +81 -0
  529. package/templates/.agents/design/design-system-maker/frontend/shared/model-hydration.js +26 -0
  530. package/templates/.agents/design/design-system-maker/frontend/shared/model.js +103 -0
  531. package/templates/.agents/design/design-system-maker/frontend/shared/palette-evidence.js +106 -0
  532. package/templates/.agents/design/design-system-maker/frontend/shared/palette-evidence.test.mjs +210 -0
  533. package/templates/.agents/design/design-system-maker/frontend/shared/palette-view.js +149 -0
  534. package/templates/.agents/design/design-system-maker/frontend/shared/preview.test.mjs +263 -0
  535. package/templates/.agents/design/design-system-maker/frontend/shared/report-view.js +267 -0
  536. package/templates/.agents/design/design-system-maker/frontend/shared/reprocess-dialog.js +192 -0
  537. package/templates/.agents/design/design-system-maker/frontend/shared/specimens.js +231 -0
  538. package/templates/.agents/design/design-system-maker/frontend/shared/viewer-actions.js +78 -0
  539. package/templates/.agents/design/design-system-maker/frontend/shared/viewer-detail.js +121 -0
  540. package/templates/.agents/design/design-system-maker/frontend/shared/viewer-summary.js +91 -0
  541. package/templates/.agents/design/design-system-maker/frontend/shared/visual-model.js +255 -0
  542. package/templates/.agents/design/design-system-maker/frontend/styles/advanced.css +128 -0
  543. package/templates/.agents/design/design-system-maker/frontend/styles/base.css +318 -0
  544. package/templates/.agents/design/design-system-maker/frontend/styles/catalog-filters.css +114 -0
  545. package/templates/.agents/design/design-system-maker/frontend/styles/diagnostic.css +298 -0
  546. package/templates/.agents/design/design-system-maker/frontend/styles/layout.css +320 -0
  547. package/templates/.agents/design/design-system-maker/frontend/styles/maker.css +7 -0
  548. package/templates/.agents/design/design-system-maker/frontend/styles/report.css +173 -0
  549. package/templates/.agents/design/design-system-maker/frontend/styles/reprocess-dialog.css +34 -0
  550. package/templates/.agents/design/design-system-maker/frontend/styles/specimen-foundations.css +363 -0
  551. package/templates/.agents/design/design-system-maker/frontend/styles/specimens.css +59 -0
  552. package/templates/.agents/design/design-system-maker/frontend/styles/viewer-summary.css +308 -0
  553. package/templates/.agents/design/design-system-maker/frontend/viewer/diagnostic.html +3 -0
  554. package/templates/.agents/design/design-system-maker/frontend/viewer/index.html +8 -0
  555. package/templates/.agents/design/design-system-maker/frontend/viewer/index.js +233 -0
  556. package/templates/.agents/design/design-system-maker/frontend/viewer/preview.html +3 -0
  557. package/templates/.agents/design/design-system-maker/frontend/viewer/specimen.js +88 -0
  558. package/templates/.agents/design/design-system-maker/launcher/Program.cs +117 -0
  559. package/templates/.agents/design/design-system-maker/runtime/chat-cli.mjs +27 -0
  560. package/templates/.agents/design/design-system-maker/runtime/chat-client.mjs +170 -0
  561. package/templates/.agents/design/design-system-maker/runtime/chat-contract.mjs +13 -0
  562. package/templates/.agents/design/design-system-maker/runtime/collection.mjs +269 -0
  563. package/templates/.agents/design/design-system-maker/runtime/contracts.mjs +383 -0
  564. package/templates/.agents/design/design-system-maker/runtime/design-codes.mjs +46 -0
  565. package/templates/.agents/design/design-system-maker/runtime/design-compose.mjs +118 -0
  566. package/templates/.agents/design/design-system-maker/runtime/design-markdown.mjs +154 -0
  567. package/templates/.agents/design/design-system-maker/runtime/import.mjs +137 -0
  568. package/templates/.agents/design/design-system-maker/runtime/io.mjs +121 -0
  569. package/templates/.agents/design/design-system-maker/runtime/job-progress.mjs +50 -0
  570. package/templates/.agents/design/design-system-maker/runtime/json-tokens.mjs +88 -0
  571. package/templates/.agents/design/design-system-maker/runtime/launch-identity.mjs +100 -0
  572. package/templates/.agents/design/design-system-maker/runtime/launch-protocol.mjs +88 -0
  573. package/templates/.agents/design/design-system-maker/runtime/launch-server.mjs +51 -0
  574. package/templates/.agents/design/design-system-maker/runtime/launch.mjs +107 -0
  575. package/templates/.agents/design/design-system-maker/runtime/local-actions.mjs +184 -0
  576. package/templates/.agents/design/design-system-maker/runtime/local-artifacts.mjs +228 -0
  577. package/templates/.agents/design/design-system-maker/runtime/local-request.mjs +100 -0
  578. package/templates/.agents/design/design-system-maker/runtime/lock.mjs +23 -0
  579. package/templates/.agents/design/design-system-maker/runtime/presentation.mjs +107 -0
  580. package/templates/.agents/design/design-system-maker/runtime/repository-source.mjs +200 -0
  581. package/templates/.agents/design/design-system-maker/runtime/reprocess-mode.mjs +17 -0
  582. package/templates/.agents/design/design-system-maker/runtime/request-contracts.mjs +121 -0
  583. package/templates/.agents/design/design-system-maker/runtime/serve.mjs +53 -0
  584. package/templates/.agents/design/design-system-maker/runtime/server.mjs +363 -0
  585. package/templates/.agents/design/design-system-maker/runtime/service-actions.mjs +59 -0
  586. package/templates/.agents/design/design-system-maker/runtime/service-host.mjs +32 -0
  587. package/templates/.agents/design/design-system-maker/runtime/service-projections.mjs +87 -0
  588. package/templates/.agents/design/design-system-maker/runtime/service.mjs +393 -0
  589. package/templates/.agents/design/design-system-maker/runtime/stop.mjs +38 -0
  590. package/templates/.agents/design/design-system-maker/runtime/trash.mjs +95 -0
  591. package/templates/.agents/design/design-system-maker/zaip-design-system-maker.exe +0 -0
  592. package/templates/.agents/design/packages/local-runtime/package.json +1 -1
  593. package/templates/.agents/requirements/autonomous-assurance.md +1 -1
  594. package/templates/.agents/requirements/cloud-hostinger-autonomy.md +9 -7
  595. package/templates/.agents/requirements/comparative-audit.md +1 -1
  596. package/templates/.agents/requirements/context-engine.md +1 -1
  597. package/templates/.agents/requirements/cost-observability.md +3 -3
  598. package/templates/.agents/requirements/dashboard-launch.md +1 -1
  599. package/templates/.agents/requirements/data-export.md +1 -1
  600. package/templates/.agents/requirements/design-system.md +1 -1
  601. package/templates/.agents/requirements/execution-engine.md +1 -1
  602. package/templates/.agents/requirements/kanban-dashboard.md +3 -3
  603. package/templates/.agents/requirements/landing-page-forms.md +39 -0
  604. package/templates/.agents/requirements/model-orchestration.md +1 -1
  605. package/templates/.agents/requirements/public-distribution.md +4 -4
  606. package/templates/.agents/requirements/site-performance.md +41 -0
  607. package/templates/.agents/requirements/software-architecture.md +1 -1
  608. package/templates/.agents/requirements/strategic-improvements.md +1 -1
  609. package/templates/.agents/requirements/work-lifecycle.md +1 -1
  610. package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
  611. package/templates/.agents/rules/autonomy-decision.md +4 -1
  612. package/templates/.agents/rules/cloud-hostinger-autonomy.md +4 -1
  613. package/templates/.agents/rules/core.md +5 -2
  614. package/templates/.agents/rules/framework-maintenance.md +34 -0
  615. package/templates/.agents/rules/frontend-lite.md +2 -1
  616. package/templates/.agents/rules/github-deploy-auth.md +18 -0
  617. package/templates/.agents/rules/infisical-secrets.md +20 -0
  618. package/templates/.agents/rules/landing-page-forms.md +28 -0
  619. package/templates/.agents/rules/lead-measurement.md +20 -0
  620. package/templates/.agents/rules/local-sqlite-storage.md +2 -2
  621. package/templates/.agents/rules/local-state-storage.md +15 -0
  622. package/templates/.agents/rules/production-readiness.md +1 -1
  623. package/templates/.agents/rules/quality-assurance.md +36 -0
  624. package/templates/.agents/rules/repository-responsibility.md +38 -0
  625. package/templates/.agents/rules/security.md +1 -1
  626. package/templates/.agents/rules/site-performance.md +29 -0
  627. package/templates/.agents/rules/website-quality.md +31 -0
  628. package/templates/.agents/rules/workflow.md +1 -1
  629. package/templates/.agents/runtime/VERSION +1 -1
  630. package/templates/.agents/runtime/bin/historical-catalog-b6b6516200bdb412c92063e887ccef329d7c5193b5610cba5346e97c71301394.mjs +318 -0
  631. package/templates/.agents/runtime/bin/zaip.mjs +2262 -768
  632. package/templates/.agents/runtime/checksums.sha256 +7 -6
  633. package/templates/.agents/runtime/manifest.json +2 -1
  634. package/templates/.agents/runtime/pnpm-lock.sha256 +1 -1
  635. package/templates/.agents/runtime/provenance.json +5 -5
  636. package/templates/.agents/runtime/sbom.cdx.json +7 -7
  637. package/templates/.agents/skills/criar-pasta-obsidian/SKILL.md +2 -2
  638. package/templates/.agents/skills/criar-pasta-obsidian/scripts/generate-obsidian-vault.mjs +7 -24
  639. package/templates/.agents/skills/criar-pasta-obsidian/scripts/generate-obsidian-vault.test.mjs +4 -2
  640. package/templates/.agents/skills/criar-pasta-obsidian/scripts/obsidian-format.mjs +20 -0
  641. package/templates/.agents/skills/zaip-skill-adapters/SKILL.md +6 -0
  642. package/templates/.agents/skills/zaip-skill-application-observability/references/lead-measurement.md +52 -0
  643. package/templates/.agents/skills/zaip-skill-architecture-design/SKILL.md +3 -1
  644. package/templates/.agents/skills/zaip-skill-auth-tenancy/references/lead-measurement.md +42 -0
  645. package/templates/.agents/skills/zaip-skill-author-skills/SKILL.md +1 -1
  646. package/templates/.agents/skills/zaip-skill-author-skills/references/engineering-skill-index.md +4 -0
  647. package/templates/.agents/skills/zaip-skill-author-skills/scripts/audit-skill-catalog.mjs +3 -0
  648. package/templates/.agents/skills/zaip-skill-author-skills/scripts/run-skill-tests.mjs +37 -7
  649. package/templates/.agents/skills/zaip-skill-author-skills/scripts/skill-test-plan.mjs +79 -0
  650. package/templates/.agents/skills/zaip-skill-author-skills/scripts/skill-test-plan.test.mjs +47 -0
  651. package/templates/.agents/skills/zaip-skill-backend/SKILL.md +2 -0
  652. package/templates/.agents/skills/zaip-skill-backend/references/deployment-environments.md +2 -2
  653. package/templates/.agents/skills/zaip-skill-change/references/observable-evidence.md +3 -3
  654. package/templates/.agents/skills/zaip-skill-cloud-engineering/SKILL.md +2 -0
  655. package/templates/.agents/skills/zaip-skill-cloudflare-access-setup/SKILL.md +16 -0
  656. package/templates/.agents/skills/zaip-skill-cloudflare-access-setup/agents/openai.yaml +4 -0
  657. package/templates/.agents/skills/zaip-skill-cloudflare-access-setup/references/account-token.md +90 -0
  658. package/templates/.agents/skills/zaip-skill-cloudflare-access-setup/scripts/preview-access.mjs +91 -0
  659. package/templates/.agents/skills/zaip-skill-cloudflare-access-setup/scripts/preview-access.test.mjs +44 -0
  660. package/templates/.agents/skills/zaip-skill-cloudflare-github-deploy/SKILL.md +4 -2
  661. package/templates/.agents/skills/zaip-skill-cloudflare-github-deploy/references/workers-static-assets.md +1 -1
  662. package/templates/.agents/skills/zaip-skill-cloudflare-github-deploy/references/workflow-templates.md +5 -5
  663. package/templates/.agents/skills/zaip-skill-cloudflare-github-deploy/scripts/cloudflare-github-deploy-contract.test.mjs +24 -5
  664. package/templates/.agents/skills/zaip-skill-config/SKILL.md +33 -8
  665. package/templates/.agents/skills/zaip-skill-config/agents/openai.yaml +2 -2
  666. package/templates/.agents/skills/zaip-skill-config/references/repository-profiles.md +83 -0
  667. package/templates/.agents/skills/zaip-skill-dashboard-sqlite/SKILL.md +2 -2
  668. package/templates/.agents/skills/zaip-skill-data-modeling/references/lead-measurement.md +37 -0
  669. package/templates/.agents/skills/zaip-skill-database-migrations/references/lead-measurement.md +35 -0
  670. package/templates/.agents/skills/zaip-skill-decisions/SKILL.md +1 -0
  671. package/templates/.agents/skills/zaip-skill-deployment-pipeline/SKILL.md +11 -0
  672. package/templates/.agents/skills/zaip-skill-design-maker/SKILL.md +28 -0
  673. package/templates/.agents/skills/zaip-skill-design-maker/agents/openai.yaml +4 -0
  674. package/templates/.agents/skills/zaip-skill-design-maker/references/chat-contract.md +46 -0
  675. package/templates/.agents/skills/zaip-skill-design-maker/references/compose.md +20 -0
  676. package/templates/.agents/skills/zaip-skill-design-maker/references/markdown.md +26 -0
  677. package/templates/.agents/skills/zaip-skill-design-maker/references/repository.md +24 -0
  678. package/templates/.agents/skills/zaip-skill-design-maker/references/url.md +24 -0
  679. package/templates/.agents/skills/zaip-skill-design-redesign/SKILL.md +41 -0
  680. package/templates/.agents/skills/zaip-skill-design-redesign/agents/openai.yaml +6 -0
  681. package/templates/.agents/skills/zaip-skill-design-reproduction/SKILL.md +47 -0
  682. package/templates/.agents/skills/zaip-skill-design-reproduction/agents/openai.yaml +6 -0
  683. package/templates/.agents/skills/zaip-skill-design-system/SKILL.md +6 -0
  684. package/templates/.agents/skills/zaip-skill-design-url-extraction/SKILL.md +50 -0
  685. package/templates/.agents/skills/zaip-skill-design-url-extraction/agents/openai.yaml +6 -0
  686. package/templates/.agents/skills/zaip-skill-design-url-extraction/references/capture-example.json +11 -0
  687. package/templates/.agents/skills/zaip-skill-design-url-extraction/references/runtime-workflow.md +127 -0
  688. package/templates/.agents/skills/zaip-skill-executar-fila-pronta/SKILL.md +3 -1
  689. package/templates/.agents/skills/zaip-skill-executar-fila-pronta/scripts/ready-queue-fence.mjs +2 -1
  690. package/templates/.agents/skills/zaip-skill-executar-fila-pronta/scripts/ready-queue-lease.mjs +3 -1
  691. package/templates/.agents/skills/zaip-skill-executar-fila-pronta/scripts/ready-queue-storage.mjs +40 -0
  692. package/templates/.agents/skills/zaip-skill-executar-fila-pronta/scripts/ready-queue-storage.test.mjs +87 -0
  693. package/templates/.agents/skills/zaip-skill-executar-fila-pronta/scripts/scheduled-ready-queue-contract.test.mjs +1 -1
  694. package/templates/.agents/skills/zaip-skill-execution/SKILL.md +11 -3
  695. package/templates/.agents/skills/zaip-skill-execution/references/autonomous-continuation.md +2 -0
  696. package/templates/.agents/skills/zaip-skill-execution/references/controlled-release-recovery.md +10 -4
  697. package/templates/.agents/skills/zaip-skill-execution/references/conversation-promotion.md +38 -0
  698. package/templates/.agents/skills/zaip-skill-execution/references/runtime-governance.md +3 -1
  699. package/templates/.agents/skills/zaip-skill-external-integrations/SKILL.md +2 -0
  700. package/templates/.agents/skills/zaip-skill-external-integrations/references/kommo.md +71 -0
  701. package/templates/.agents/skills/zaip-skill-figma-setup/SKILL.md +42 -0
  702. package/templates/.agents/skills/zaip-skill-figma-setup/agents/openai.yaml +6 -0
  703. package/templates/.agents/skills/zaip-skill-figma-setup/references/capability-contract.json +40 -0
  704. package/templates/.agents/skills/zaip-skill-figma-setup/references/figma-connection.md +60 -0
  705. package/templates/.agents/skills/zaip-skill-figma-setup/references/figma-handoff.md +71 -0
  706. package/templates/.agents/skills/zaip-skill-frontend/SKILL.md +30 -1
  707. package/templates/.agents/skills/zaip-skill-frontend-data-flows/SKILL.md +3 -0
  708. package/templates/.agents/skills/zaip-skill-github-deploy/SKILL.md +38 -5
  709. package/templates/.agents/skills/zaip-skill-github-deploy/references/authentication.md +15 -0
  710. package/templates/.agents/skills/zaip-skill-github-deploy/references/authorization.md +35 -0
  711. package/templates/.agents/skills/zaip-skill-github-deploy/references/deployment-workflow.md +21 -3
  712. package/templates/.agents/skills/zaip-skill-github-deploy/references/literal-read-sequence.md +28 -0
  713. package/templates/.agents/skills/zaip-skill-github-deploy/references/release-identity.md +4 -2
  714. package/templates/.agents/skills/zaip-skill-github-deploy/references/release-notes.md +4 -4
  715. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/application-content.mjs +82 -0
  716. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/application-content.test.mjs +184 -0
  717. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/consumer-publication-authority.mjs +63 -0
  718. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/consumer-release-preparation.mjs +42 -36
  719. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/consumer-release-preparation.test.mjs +4 -5
  720. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-auth.mjs +400 -0
  721. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-auth.test.mjs +192 -0
  722. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-constraints.test.mjs +159 -0
  723. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract-cli.test.mjs +32 -24
  724. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract-range.test-support.mjs +51 -0
  725. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract.mjs +248 -281
  726. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract.test.mjs +63 -56
  727. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-idempotent-intent.test.mjs +169 -0
  728. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-publication-intent.test.mjs +112 -5
  729. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deployment-next-release.mjs +57 -0
  730. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deployment-request-conditions.test.mjs +117 -0
  731. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deployment-request-continuation.test.mjs +44 -0
  732. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deployment-request-preservation.test.mjs +58 -0
  733. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deployment-request.mjs +306 -0
  734. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/git-command.mjs +11 -0
  735. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/git-config-paths.mjs +10 -0
  736. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/git-destination.mjs +21 -0
  737. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/git-push-target.mjs +62 -0
  738. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/git-push-target.test.mjs +78 -0
  739. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/github-deploy-contract.test.mjs +4 -2
  740. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/guarded-commits.mjs +132 -42
  741. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/preflight-options.mjs +50 -0
  742. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/preflight-worktree.test.mjs +52 -0
  743. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/preflight.mjs +70 -119
  744. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/preflight.test.mjs +11 -1
  745. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/project-restrictions.mjs +201 -0
  746. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/project-restrictions.test.mjs +154 -0
  747. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-authority-callbacks.test.mjs +46 -0
  748. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-conditions.mjs +193 -0
  749. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-intent.mjs +79 -0
  750. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-plan-binding.mjs +78 -0
  751. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-plan-refusal.mjs +30 -0
  752. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-project-policy.mjs +39 -0
  753. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-2457VC25.mjs +2 -0
  754. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-25VZXDBX.mjs +2 -0
  755. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-2JXOAZ2R.mjs +2 -0
  756. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-2OZK443Y.mjs +2 -0
  757. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-3BDTL55L.mjs +2 -0
  758. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-3MG57Y6I.mjs +2 -0
  759. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-3MQAJ6XX.mjs +2 -0
  760. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-3TUUBJPP.mjs +2 -0
  761. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-45Z34LBQ.mjs +140 -0
  762. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-4GJE2IXL.mjs +2 -0
  763. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-4HLOIRQU.mjs +2 -0
  764. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-55PSJJ75.mjs +2 -0
  765. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-5OTFTK2Y.mjs +2 -0
  766. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-7OFWNBZN.mjs +2 -0
  767. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-7R2IP55E.mjs +2 -0
  768. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-A35CQWF4.mjs +2 -0
  769. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-BC2LX3QU.mjs +2 -0
  770. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-C2Z26E6U.mjs +2 -0
  771. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-CHJGU2RU.mjs +2 -0
  772. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-CJ5ZQF6M.mjs +11 -0
  773. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-D4LGE7UI.mjs +2 -0
  774. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-D5OUJS46.mjs +2 -0
  775. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-D6RZM5OT.mjs +2 -0
  776. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-DOK2R3GV.mjs +2 -0
  777. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-EAHVOUKK.mjs +2 -0
  778. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-EQTZ3Y7R.mjs +2 -0
  779. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-FMNUSV2P.mjs +139 -0
  780. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-FZUNFGZV.mjs +2 -0
  781. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-GGBPBQ6D.mjs +2 -0
  782. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-HFDX2GP6.mjs +2 -0
  783. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-HZ2NRMAG.mjs +2 -0
  784. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-IJKPDKXC.mjs +2 -0
  785. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-JEOOTEUX.mjs +2 -0
  786. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-JF3E72HZ.mjs +2 -0
  787. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-KRHOCS3C.mjs +2 -0
  788. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-LG5MJS2A.mjs +2 -0
  789. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-LWS3QVJO.mjs +24 -0
  790. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-ML4PMB7C.mjs +2 -0
  791. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-MSCWMPU5.mjs +63 -0
  792. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-NORNV3B2.mjs +2 -0
  793. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-PBU2HSKP.mjs +2 -0
  794. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-PG6LGVVW.mjs +2 -0
  795. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-PGYGDY3J.mjs +2 -0
  796. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-QFUQW6LE.mjs +2 -0
  797. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-QI32NI7M.mjs +2 -0
  798. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-R4HD7XOO.mjs +2 -0
  799. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-REHSM3G2.mjs +2 -0
  800. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-S22YDVTM.mjs +2 -0
  801. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-S5P4ZNUQ.mjs +2 -0
  802. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-SCK2RF6V.mjs +2 -0
  803. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-SWFLYM3O.mjs +2 -0
  804. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-TA7RY5MY.mjs +2 -0
  805. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-TM5WG7GR.mjs +2 -0
  806. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-TMVJHK37.mjs +2 -0
  807. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-TPDQAH7C.mjs +2 -0
  808. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-U2KO7ULM.mjs +2 -0
  809. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-U3ISMYJU.mjs +2 -0
  810. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-UKSDAS73.mjs +2 -0
  811. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-UNTPHSZO.mjs +2 -0
  812. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-V4MIRRUB.mjs +2 -0
  813. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-WNXOXX3Z.mjs +2 -0
  814. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-WQGTDRK7.mjs +2 -0
  815. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-WZJIRYT6.mjs +2 -0
  816. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-XED4KYQL.mjs +2 -0
  817. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-XEXCFKHI.mjs +2 -0
  818. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-XJJFARY4.mjs +2 -0
  819. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-XQOFL3K3.mjs +2 -0
  820. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-YAWUSDPM.mjs +2 -0
  821. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-YEUY7TMM.mjs +2 -0
  822. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-Z5X23XXT.mjs +2 -0
  823. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/chunks/chunk-Z7H2BHYQ.mjs +2 -0
  824. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/lifecycle-records.mjs +2 -0
  825. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ar.mjs +2 -0
  826. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-az.mjs +2 -0
  827. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-be.mjs +2 -0
  828. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-bg.mjs +2 -0
  829. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-bn.mjs +2 -0
  830. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ca.mjs +2 -0
  831. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ckb.mjs +2 -0
  832. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-cs.mjs +2 -0
  833. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-da.mjs +2 -0
  834. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-de.mjs +2 -0
  835. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-el.mjs +2 -0
  836. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-en.mjs +2 -0
  837. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-eo.mjs +2 -0
  838. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-es.mjs +2 -0
  839. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-fa.mjs +2 -0
  840. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-fi.mjs +2 -0
  841. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-fr-CA.mjs +2 -0
  842. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-fr.mjs +2 -0
  843. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-gu.mjs +2 -0
  844. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-he.mjs +2 -0
  845. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-hi.mjs +2 -0
  846. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-hr.mjs +2 -0
  847. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-hu.mjs +2 -0
  848. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-hy.mjs +2 -0
  849. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-id.mjs +2 -0
  850. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-is.mjs +2 -0
  851. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-it.mjs +2 -0
  852. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ja.mjs +2 -0
  853. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ka.mjs +2 -0
  854. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-kh.mjs +2 -0
  855. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-km.mjs +2 -0
  856. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-kn.mjs +2 -0
  857. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ko.mjs +2 -0
  858. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-lt.mjs +2 -0
  859. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-mk.mjs +2 -0
  860. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ms.mjs +2 -0
  861. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ne.mjs +2 -0
  862. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-nl.mjs +2 -0
  863. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-nn.mjs +2 -0
  864. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-no.mjs +2 -0
  865. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ota.mjs +2 -0
  866. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-pl.mjs +2 -0
  867. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ps.mjs +2 -0
  868. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-pt-BR.mjs +2 -0
  869. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-pt.mjs +2 -0
  870. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ro.mjs +2 -0
  871. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ru.mjs +2 -0
  872. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-sk.mjs +2 -0
  873. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-sl.mjs +2 -0
  874. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-sv.mjs +2 -0
  875. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ta.mjs +2 -0
  876. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-tg.mjs +2 -0
  877. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-th.mjs +2 -0
  878. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-tk.mjs +2 -0
  879. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-tr.mjs +2 -0
  880. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ua.mjs +2 -0
  881. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-uk.mjs +2 -0
  882. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-ur.mjs +2 -0
  883. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-uz.mjs +2 -0
  884. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-vi.mjs +2 -0
  885. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-yo.mjs +2 -0
  886. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-zh-CN.mjs +2 -0
  887. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/locale-zh-TW.mjs +2 -0
  888. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/manifest.json +566 -0
  889. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/native-authority.mjs +2 -0
  890. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/proof.mjs +2 -0
  891. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/run-records.mjs +2 -0
  892. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/yaml-runtime.mjs +2 -0
  893. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-runtime/zod-runtime.mjs +2 -0
  894. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof-schema.mjs +2 -0
  895. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/publication-proof.test.mjs +79 -0
  896. package/templates/.agents/skills/zaip-skill-github-setup/SKILL.md +14 -11
  897. package/templates/.agents/skills/zaip-skill-github-setup/references/bounded-setup.md +42 -0
  898. package/templates/.agents/skills/zaip-skill-github-setup/scripts/setup.mjs +365 -0
  899. package/templates/.agents/skills/zaip-skill-github-setup-ssh-folder/SKILL.md +13 -3
  900. package/templates/.agents/skills/zaip-skill-github-setup-ssh-folder/references/operational-procedure.md +4 -4
  901. package/templates/.agents/skills/zaip-skill-google-ads-conversions/SKILL.md +18 -0
  902. package/templates/.agents/skills/zaip-skill-google-ads-conversions/agents/openai.yaml +4 -0
  903. package/templates/.agents/skills/zaip-skill-google-ads-conversions/references/implementation.md +61 -0
  904. package/templates/.agents/skills/zaip-skill-google-analytics/SKILL.md +24 -0
  905. package/templates/.agents/skills/zaip-skill-google-analytics/agents/openai.yaml +4 -0
  906. package/templates/.agents/skills/zaip-skill-google-analytics/references/implementation.md +64 -0
  907. package/templates/.agents/skills/zaip-skill-google-tag-manager/SKILL.md +24 -0
  908. package/templates/.agents/skills/zaip-skill-google-tag-manager/agents/openai.yaml +4 -0
  909. package/templates/.agents/skills/zaip-skill-google-tag-manager/references/implementation.md +71 -0
  910. package/templates/.agents/skills/zaip-skill-google-tag-manager/references/operator-checklist.md +51 -0
  911. package/templates/.agents/skills/zaip-skill-google-tag-manager/references/operator-fixtures.json +93 -0
  912. package/templates/.agents/skills/zaip-skill-google-tag-manager/scripts/check-runbook-links.mjs +103 -0
  913. package/templates/.agents/skills/zaip-skill-google-tag-manager/scripts/google-runbooks.test.mjs +247 -0
  914. package/templates/.agents/skills/zaip-skill-google-tag-manager/scripts/operator-model.mjs +221 -0
  915. package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/SKILL.md +8 -2
  916. package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/references/autonomous-cloud-inputs.example.json +3 -3
  917. package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/references/autonomous-runner.md +4 -2
  918. package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/references/cloudflare-agent-setup.md +23 -0
  919. package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/references/cloudflare-dns.md +36 -0
  920. package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/references/guia-iniciante-hostinger-vps.md +4 -4
  921. package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/references/operational-contract.md +3 -3
  922. package/templates/.agents/skills/zaip-skill-hostinger-cloudflare-terraform/references/vps-onboarding.md +97 -0
  923. package/templates/.agents/skills/zaip-skill-image-optimization/SKILL.md +31 -0
  924. package/templates/.agents/skills/zaip-skill-image-optimization/agents/openai.yaml +4 -0
  925. package/templates/.agents/skills/zaip-skill-image-optimization/references/adapters.md +36 -0
  926. package/templates/.agents/skills/zaip-skill-image-optimization/references/pipeline.md +35 -0
  927. package/templates/.agents/skills/zaip-skill-image-optimization/scripts/images.mjs +370 -0
  928. package/templates/.agents/skills/zaip-skill-image-optimization/scripts/images.test.mjs +385 -0
  929. package/templates/.agents/skills/zaip-skill-infisical/SKILL.md +20 -0
  930. package/templates/.agents/skills/zaip-skill-infisical/agents/openai.yaml +4 -0
  931. package/templates/.agents/skills/zaip-skill-infisical/assets/compose.yaml +62 -0
  932. package/templates/.agents/skills/zaip-skill-infisical/assets/terraform/infisical.tf +57 -0
  933. package/templates/.agents/skills/zaip-skill-infisical/references/credential-workflow.md +88 -0
  934. package/templates/.agents/skills/zaip-skill-infisical/references/first-initialization.md +51 -0
  935. package/templates/.agents/skills/zaip-skill-infisical/references/security-and-edition.md +19 -0
  936. package/templates/.agents/skills/zaip-skill-infisical/references/self-hosting.md +71 -0
  937. package/templates/.agents/skills/zaip-skill-infisical/references/terraform.md +54 -0
  938. package/templates/.agents/skills/zaip-skill-infisical/scripts/prepare-self-host.mjs +92 -0
  939. package/templates/.agents/skills/zaip-skill-infisical/scripts/prepare-self-host.test.mjs +69 -0
  940. package/templates/.agents/skills/zaip-skill-infisical/scripts/preview-terraform.mjs +70 -0
  941. package/templates/.agents/skills/zaip-skill-infisical/scripts/preview-terraform.test.mjs +51 -0
  942. package/templates/.agents/skills/zaip-skill-infisical/scripts/terraform-plan-integration.test.mjs +83 -0
  943. package/templates/.agents/skills/zaip-skill-landing-page-forms/SKILL.md +37 -0
  944. package/templates/.agents/skills/zaip-skill-landing-page-forms/agents/openai.yaml +4 -0
  945. package/templates/.agents/skills/zaip-skill-landing-page-forms/references/accessibility.md +29 -0
  946. package/templates/.agents/skills/zaip-skill-landing-page-forms/references/contact-then-qualification.example.json +83 -0
  947. package/templates/.agents/skills/zaip-skill-landing-page-forms/references/contracts.md +70 -0
  948. package/templates/.agents/skills/zaip-skill-landing-page-forms/references/examples.md +21 -0
  949. package/templates/.agents/skills/zaip-skill-landing-page-forms/references/journey.md +30 -0
  950. package/templates/.agents/skills/zaip-skill-landing-page-forms/references/multistep.example.json +84 -0
  951. package/templates/.agents/skills/zaip-skill-landing-page-forms/references/single-screen.example.json +76 -0
  952. package/templates/.agents/skills/zaip-skill-landing-page-forms/references/verification.md +24 -0
  953. package/templates/.agents/skills/zaip-skill-landing-page-forms/scripts/validate-plan.mjs +306 -0
  954. package/templates/.agents/skills/zaip-skill-landing-page-forms/scripts/validate-plan.test.mjs +183 -0
  955. package/templates/.agents/skills/zaip-skill-lead-measurement/SKILL.md +32 -0
  956. package/templates/.agents/skills/zaip-skill-lead-measurement/agents/openai.yaml +4 -0
  957. package/templates/.agents/skills/zaip-skill-lead-measurement/references/architecture.md +51 -0
  958. package/templates/.agents/skills/zaip-skill-lead-measurement/references/authority.md +49 -0
  959. package/templates/.agents/skills/zaip-skill-lead-measurement/references/bant-contract.md +36 -0
  960. package/templates/.agents/skills/zaip-skill-lead-measurement/references/consent-contract.md +48 -0
  961. package/templates/.agents/skills/zaip-skill-lead-measurement/references/delivery-contract.md +65 -0
  962. package/templates/.agents/skills/zaip-skill-lead-measurement/references/event-contract.md +47 -0
  963. package/templates/.agents/skills/zaip-skill-lead-measurement/references/examples/escola.json +180 -0
  964. package/templates/.agents/skills/zaip-skill-lead-measurement/references/examples/moradigna-regression.json +158 -0
  965. package/templates/.agents/skills/zaip-skill-lead-measurement/references/examples/solar.json +165 -0
  966. package/templates/.agents/skills/zaip-skill-lead-measurement/references/identity-contract.md +53 -0
  967. package/templates/.agents/skills/zaip-skill-lead-measurement/references/implementation-plan.md +60 -0
  968. package/templates/.agents/skills/zaip-skill-lead-measurement/references/kommo-contract.md +83 -0
  969. package/templates/.agents/skills/zaip-skill-lead-measurement/references/meta-mapping.md +28 -0
  970. package/templates/.agents/skills/zaip-skill-lead-measurement/references/migration.md +65 -0
  971. package/templates/.agents/skills/zaip-skill-lead-measurement/references/operations.md +125 -0
  972. package/templates/.agents/skills/zaip-skill-lead-measurement/references/persistence-reference.md +65 -0
  973. package/templates/.agents/skills/zaip-skill-lead-measurement/references/questionnaire-v2.schema.json +136 -0
  974. package/templates/.agents/skills/zaip-skill-lead-measurement/references/synthetic-config.json +24 -0
  975. package/templates/.agents/skills/zaip-skill-lead-measurement/references/synthetic-event.json +19 -0
  976. package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/check-questionnaire.mjs +314 -0
  977. package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/check-questionnaire.test.mjs +338 -0
  978. package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/consent-cases-core.mjs +144 -0
  979. package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/consent-cases-privacy.mjs +183 -0
  980. package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/consent-fixtures.mjs +60 -0
  981. package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/consent-rollback-support.mjs +114 -0
  982. package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/consent.mjs +222 -0
  983. package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/consent.test.mjs +294 -0
  984. package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/delivery-ledger.mjs +179 -0
  985. package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/delivery-v2-case-fixtures.mjs +118 -0
  986. package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/delivery-v2-cases.mjs +6 -0
  987. package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/delivery-v2-contract-cases.mjs +218 -0
  988. package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/delivery-v2-contract.mjs +182 -0
  989. package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/delivery-v2-proof-support.mjs +104 -0
  990. package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/delivery-v2-proof.mjs +272 -0
  991. package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/delivery-v2-state-cases.mjs +248 -0
  992. package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/delivery-v2.mjs +234 -0
  993. package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/lead-measurement.mjs +277 -0
  994. package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/lead-measurement.test.mjs +288 -0
  995. package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/questionnaire-ast-cases.mjs +127 -0
  996. package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/questionnaire-test-support.mjs +25 -0
  997. package/templates/.agents/skills/zaip-skill-lead-measurement/scripts/questionnaire-validation.mjs +155 -0
  998. package/templates/.agents/skills/zaip-skill-lifecycle-closure/SKILL.md +30 -2
  999. package/templates/.agents/skills/zaip-skill-lifecycle-closure/references/empty-usage-lock.md +56 -0
  1000. package/templates/.agents/skills/zaip-skill-lifecycle-closure/references/late-finalization.md +158 -0
  1001. package/templates/.agents/skills/zaip-skill-lifecycle-closure/references/local-catalog-closure.md +37 -0
  1002. package/templates/.agents/skills/zaip-skill-lifecycle-closure/references/post-publication-task-first.md +1 -1
  1003. package/templates/.agents/skills/zaip-skill-lifecycle-closure/scripts/empty-lock-native.cs +113 -0
  1004. package/templates/.agents/skills/zaip-skill-lifecycle-closure/scripts/empty-lock-native.ps1 +9 -0
  1005. package/templates/.agents/skills/zaip-skill-lifecycle-closure/scripts/recover-empty-usage-lock.mjs +194 -0
  1006. package/templates/.agents/skills/zaip-skill-local-credentials/SKILL.md +27 -0
  1007. package/templates/.agents/skills/zaip-skill-maintenance-enter/SKILL.md +8 -6
  1008. package/templates/.agents/skills/zaip-skill-maintenance-enter/scripts/maintenance.mjs +4 -4
  1009. package/templates/.agents/skills/zaip-skill-maintenance-enter/scripts/maintenance.test.mjs +2 -2
  1010. package/templates/.agents/skills/zaip-skill-maintenance-exit/SKILL.md +3 -3
  1011. package/templates/.agents/skills/zaip-skill-marketing/SKILL.md +11 -0
  1012. package/templates/.agents/skills/zaip-skill-marketing/references/search-content.md +17 -0
  1013. package/templates/.agents/skills/zaip-skill-meta-conversions/SKILL.md +23 -0
  1014. package/templates/.agents/skills/zaip-skill-meta-conversions/agents/openai.yaml +4 -0
  1015. package/templates/.agents/skills/zaip-skill-meta-conversions/references/implementation.md +88 -0
  1016. package/templates/.agents/skills/zaip-skill-meta-conversions/references/synthetic-meta.json +27 -0
  1017. package/templates/.agents/skills/zaip-skill-meta-conversions/scripts/check-meta-links.mjs +88 -0
  1018. package/templates/.agents/skills/zaip-skill-meta-conversions/scripts/meta-model.mjs +369 -0
  1019. package/templates/.agents/skills/zaip-skill-meta-conversions/scripts/meta-model.test.mjs +394 -0
  1020. package/templates/.agents/skills/zaip-skill-performance-engineering/SKILL.md +26 -1
  1021. package/templates/.agents/skills/zaip-skill-performance-engineering/references/astro-islands.md +41 -0
  1022. package/templates/.agents/skills/zaip-skill-performance-engineering/references/controlled-runner.md +38 -0
  1023. package/templates/.agents/skills/zaip-skill-performance-engineering/references/google-diagnostics.md +46 -0
  1024. package/templates/.agents/skills/zaip-skill-performance-engineering/references/report-contract.md +99 -0
  1025. package/templates/.agents/skills/zaip-skill-performance-engineering/references/site-budgets.json +25 -0
  1026. package/templates/.agents/skills/zaip-skill-performance-engineering/references/site-performance.md +83 -0
  1027. package/templates/.agents/skills/zaip-skill-performance-engineering/references/third-party-performance.md +57 -0
  1028. package/templates/.agents/skills/zaip-skill-performance-engineering/scripts/assess-reports.mjs +42 -0
  1029. package/templates/.agents/skills/zaip-skill-performance-engineering/scripts/capture-site.mjs +155 -0
  1030. package/templates/.agents/skills/zaip-skill-performance-engineering/scripts/local-preview.mjs +84 -0
  1031. package/templates/.agents/skills/zaip-skill-performance-engineering/scripts/performance-report.mjs +142 -0
  1032. package/templates/.agents/skills/zaip-skill-performance-engineering/scripts/performance-report.test.mjs +122 -0
  1033. package/templates/.agents/skills/zaip-skill-performance-engineering/scripts/report-fixtures.test-support.mjs +51 -0
  1034. package/templates/.agents/skills/zaip-skill-performance-engineering/scripts/report-import.mjs +209 -0
  1035. package/templates/.agents/skills/zaip-skill-performance-engineering/scripts/report-import.test.mjs +164 -0
  1036. package/templates/.agents/skills/zaip-skill-performance-engineering/scripts/run-lighthouse.mjs +151 -0
  1037. package/templates/.agents/skills/zaip-skill-performance-engineering/scripts/series-gate.mjs +225 -0
  1038. package/templates/.agents/skills/zaip-skill-performance-engineering/scripts/series-gate.test.mjs +143 -0
  1039. package/templates/.agents/skills/zaip-skill-qa/SKILL.md +54 -0
  1040. package/templates/.agents/skills/zaip-skill-qa/agents/openai.yaml +4 -0
  1041. package/templates/.agents/skills/zaip-skill-qa/references/host-protocol.md +125 -0
  1042. package/templates/.agents/skills/zaip-skill-qa/references/landing-page-forms.md +23 -0
  1043. package/templates/.agents/skills/zaip-skill-qa/references/proof-adapters.md +92 -0
  1044. package/templates/.agents/skills/zaip-skill-qa/references/scenarios.md +73 -0
  1045. package/templates/.agents/skills/zaip-skill-qa/references/seo-geo.md +33 -0
  1046. package/templates/.agents/skills/zaip-skill-qa/references/site-performance.md +20 -0
  1047. package/templates/.agents/skills/zaip-skill-qa/scripts/observe-dashboard-ui.mjs +152 -0
  1048. package/templates/.agents/skills/zaip-skill-qa/scripts/observe-dashboard-ui.test.mjs +65 -0
  1049. package/templates/.agents/skills/zaip-skill-qa/scripts/qa-contract.test.mjs +203 -0
  1050. package/templates/.agents/skills/zaip-skill-qa/scripts/run-behavior-tests.mjs +369 -0
  1051. package/templates/.agents/skills/zaip-skill-qa/scripts/run-behavior-tests.test.mjs +168 -0
  1052. package/templates/.agents/skills/zaip-skill-reconcile-telemetry/SKILL.md +33 -0
  1053. package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-local-telemetry.mjs +42 -62
  1054. package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-native-window.mjs +115 -0
  1055. package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-native-window.test.mjs +123 -0
  1056. package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-optional-timing.test.mjs +34 -0
  1057. package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-reviewed-pairs-fixture.mjs +130 -0
  1058. package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-deduplicate-apply.mjs +106 -0
  1059. package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-lib.mjs +22 -45
  1060. package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-lib.test.mjs +0 -24
  1061. package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-remeasurement.mjs +73 -9
  1062. package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-reviewed-order.mjs +48 -0
  1063. package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-reviewed-pairs.mjs +255 -0
  1064. package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-reviewed-pairs.test.mjs +329 -0
  1065. package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-token-snapshots.mjs +49 -0
  1066. package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-token-snapshots.test.mjs +33 -0
  1067. package/templates/.agents/skills/zaip-skill-refactor-landing-page/SKILL.md +6 -0
  1068. package/templates/.agents/skills/zaip-skill-release-qualification/SKILL.md +19 -1
  1069. package/templates/.agents/skills/zaip-skill-release-qualification/references/frozen-task-recovery.md +47 -0
  1070. package/templates/.agents/skills/zaip-skill-release-qualification/references/local-catalog.md +136 -0
  1071. package/templates/.agents/skills/zaip-skill-release-qualification/references/local-preparation.md +7 -5
  1072. package/templates/.agents/skills/zaip-skill-release-qualification/references/remote-validation.md +147 -0
  1073. package/templates/.agents/skills/zaip-skill-sales-methodology/SKILL.md +1 -0
  1074. package/templates/.agents/skills/zaip-skill-sales-methodology/references/bant-discovery.md +28 -0
  1075. package/templates/.agents/skills/zaip-skill-screenshot-intake/SKILL.md +40 -0
  1076. package/templates/.agents/skills/zaip-skill-screenshot-intake/agents/openai.yaml +6 -0
  1077. package/templates/.agents/skills/zaip-skill-screenshot-intake/references/request-example.json +36 -0
  1078. package/templates/.agents/skills/zaip-skill-screenshot-intake/references/runtime-workflow.md +110 -0
  1079. package/templates/.agents/skills/zaip-skill-search-observability/SKILL.md +27 -0
  1080. package/templates/.agents/skills/zaip-skill-search-observability/agents/openai.yaml +4 -0
  1081. package/templates/.agents/skills/zaip-skill-search-observability/references/report-template.md +32 -0
  1082. package/templates/.agents/skills/zaip-skill-search-observability/references/workflow.md +56 -0
  1083. package/templates/.agents/skills/zaip-skill-search-observability/scripts/search-report.mjs +139 -0
  1084. package/templates/.agents/skills/zaip-skill-search-observability/scripts/search-report.test.mjs +72 -0
  1085. package/templates/.agents/skills/zaip-skill-setup/SKILL.md +51 -44
  1086. package/templates/.agents/skills/zaip-skill-setup/agents/openai.yaml +1 -1
  1087. package/templates/.agents/skills/zaip-skill-setup/references/basic-onboarding.md +41 -0
  1088. package/templates/.agents/skills/zaip-skill-setup/references/codex-activation.md +40 -0
  1089. package/templates/.agents/skills/zaip-skill-setup/scripts/onboarding-contract.test.mjs +41 -0
  1090. package/templates/.agents/skills/zaip-skill-spec/SKILL.md +1 -0
  1091. package/templates/.agents/skills/zaip-skill-sqlite-read-model/SKILL.md +4 -3
  1092. package/templates/.agents/skills/zaip-skill-task/SKILL.md +1 -0
  1093. package/templates/.agents/skills/zaip-skill-task/references/commit-policy.md +1 -1
  1094. package/templates/.agents/skills/zaip-skill-testing-strategy/SKILL.md +18 -0
  1095. package/templates/.agents/skills/zaip-skill-testing-strategy/references/frontend-impact.md +81 -0
  1096. package/templates/.agents/skills/zaip-skill-testing-strategy/references/verification-adoption.md +31 -0
  1097. package/templates/.agents/skills/zaip-skill-testing-strategy/scripts/validation-plan.mjs +168 -0
  1098. package/templates/.agents/skills/zaip-skill-testing-strategy/scripts/validation-plan.test.mjs +146 -0
  1099. package/templates/.agents/skills/zaip-skill-tool-setup/scripts/tool-state.mjs +1 -1
  1100. package/templates/.agents/skills/zaip-skill-use-connectors/SKILL.md +8 -0
  1101. package/templates/.agents/skills/zaip-skill-use-connectors/scripts/select-connector.mjs +73 -0
  1102. package/templates/.agents/skills/zaip-skill-use-connectors/scripts/select-connector.test.mjs +85 -0
  1103. package/templates/.agents/skills/zaip-skill-visual-report/SKILL.md +41 -0
  1104. package/templates/.agents/skills/zaip-skill-visual-report/agents/openai.yaml +6 -0
  1105. package/templates/.agents/skills/zaip-skill-visual-report/references/fidelity-proof.md +56 -0
  1106. package/templates/.agents/skills/zaip-skill-visual-report/references/intake-state.md +64 -0
  1107. package/templates/.agents/skills/zaip-skill-visual-report/references/source-contract.md +79 -0
  1108. package/templates/.agents/skills/zaip-skill-visual-report/references/synthesis-template.md +67 -0
  1109. package/templates/.agents/skills/zaip-skill-visual-report/references/visual-contract.json +40 -0
  1110. package/templates/.agents/skills/zaip-skill-website-readiness/SKILL.md +73 -17
  1111. package/templates/.agents/skills/zaip-skill-website-readiness/agents/openai.yaml +2 -2
  1112. package/templates/.agents/skills/zaip-skill-website-readiness/references/capability-checklist.md +8 -4
  1113. package/templates/.agents/skills/zaip-skill-website-readiness/references/change-discovery.md +22 -0
  1114. package/templates/.agents/skills/zaip-skill-website-readiness/references/content-and-agents.md +25 -0
  1115. package/templates/.agents/skills/zaip-skill-website-readiness/references/crawler-policy.md +35 -0
  1116. package/templates/.agents/skills/zaip-skill-website-readiness/references/schema-matrix.md +23 -0
  1117. package/templates/.agents/skills/zaip-skill-website-readiness/references/search-evidence.md +36 -0
  1118. package/templates/.agents/skills/zaip-skill-website-readiness/references/site-quality.example.json +14 -0
  1119. package/templates/.agents/skills/zaip-skill-website-readiness/references/site-quality.md +109 -0
  1120. package/templates/.agents/skills/zaip-skill-website-readiness/references/site-validation.md +60 -0
  1121. package/templates/.agents/skills/zaip-skill-website-readiness/references/sources.md +37 -0
  1122. package/templates/.agents/skills/zaip-skill-website-readiness/references/visual-preservation.md +84 -0
  1123. package/templates/.agents/skills/zaip-skill-website-readiness/scripts/agent-content.mjs +116 -0
  1124. package/templates/.agents/skills/zaip-skill-website-readiness/scripts/agent-content.test.mjs +83 -0
  1125. package/templates/.agents/skills/zaip-skill-website-readiness/scripts/audit-site.mjs +136 -0
  1126. package/templates/.agents/skills/zaip-skill-website-readiness/scripts/html-facts.mjs +56 -0
  1127. package/templates/.agents/skills/zaip-skill-website-readiness/scripts/index-directives.mjs +29 -0
  1128. package/templates/.agents/skills/zaip-skill-website-readiness/scripts/quality-plan.mjs +62 -0
  1129. package/templates/.agents/skills/zaip-skill-website-readiness/scripts/robots-policy.mjs +63 -0
  1130. package/templates/.agents/skills/zaip-skill-website-readiness/scripts/search-policy.test.mjs +183 -0
  1131. package/templates/.agents/skills/zaip-skill-website-readiness/scripts/site-audit.mjs +243 -0
  1132. package/templates/.agents/skills/zaip-skill-website-readiness/scripts/site-audit.test.mjs +287 -0
  1133. package/templates/.agents/skills/zaip-skill-website-readiness/scripts/sitemap-policy.mjs +111 -0
  1134. package/templates/.agents/skills/zaip-skill-website-readiness/scripts/verify-site-design.mjs +130 -0
  1135. package/templates/.agents/skills/zaip-skill-website-readiness/scripts/visual-preservation.mjs +160 -0
  1136. package/templates/.agents/skills/zaip-skill-worktree-recovery/SKILL.md +70 -0
  1137. package/templates/.agents/skills/zaip-skill-worktree-recovery/agents/openai.yaml +4 -0
  1138. package/templates/.agents/skills/zaip-skill-worktree-recovery/references/complete-preservation.md +70 -0
  1139. package/templates/.agents/skills/zaip-skill-worktree-recovery/references/default-policy.md +53 -0
  1140. package/templates/.agents/skills/zaip-skill-worktree-recovery/references/lifecycle-roots.md +106 -0
  1141. package/templates/.agents/skills/zaip-skill-worktree-recovery/references/metadata-overlay.md +45 -0
  1142. package/templates/.agents/skills/zaip-skill-worktree-recovery/references/procedure.md +49 -0
  1143. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/complete-preservation.mjs +252 -0
  1144. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-local-archive.mjs +162 -0
  1145. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-local-git.mjs +111 -0
  1146. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-acl.ps1 +37 -0
  1147. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-activate.ps1 +66 -0
  1148. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-alias.mjs +202 -0
  1149. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-batches.mjs +88 -0
  1150. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-copy-session.mjs +84 -0
  1151. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-cutover.mjs +350 -0
  1152. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-files.mjs +109 -0
  1153. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-generation-posix.mjs +194 -0
  1154. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-generation.mjs +173 -0
  1155. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-journal.mjs +88 -0
  1156. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-layout.mjs +102 -0
  1157. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-lock.mjs +106 -0
  1158. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-migration.mjs +234 -0
  1159. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-observation-tail.mjs +148 -0
  1160. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-permissions.mjs +52 -0
  1161. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-plan.mjs +143 -0
  1162. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-preparation.mjs +110 -0
  1163. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-process-start.ps1 +7 -0
  1164. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-quiescence.ps1 +11 -0
  1165. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-receipt-lease.mjs +67 -0
  1166. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-reuse.mjs +68 -0
  1167. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/durable-state-telemetry-version.mjs +187 -0
  1168. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/git-process.mjs +85 -0
  1169. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/metadata-overlay.mjs +302 -0
  1170. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/metadata-secrets.mjs +44 -0
  1171. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/migrate-durable-state.mjs +49 -0
  1172. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/recovery.mjs +247 -0
  1173. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/retention-marker.mjs +44 -0
  1174. package/templates/.agents/skills/zaip-skill-worktree-recovery/scripts/worktree-proof.mjs +148 -0
  1175. package/templates/.agents/tools/api/kommo-crm/README.md +13 -9
  1176. package/templates/.agents/tools/cloud-onboarding-architecture.mjs +273 -0
  1177. package/templates/.agents/tools/cloud-onboarding-bootstrap.test.mjs +176 -0
  1178. package/templates/.agents/tools/cloud-onboarding-configure.mjs +146 -0
  1179. package/templates/.agents/tools/cloud-onboarding-credentials.mjs +279 -0
  1180. package/templates/.agents/tools/cloud-onboarding-files.mjs +190 -0
  1181. package/templates/.agents/tools/cloud-onboarding-files.test.mjs +72 -0
  1182. package/templates/.agents/tools/cloud-onboarding-generation.mjs +161 -0
  1183. package/templates/.agents/tools/cloud-onboarding-generation.test.mjs +129 -0
  1184. package/templates/.agents/tools/cloud-onboarding-policy.mjs +196 -0
  1185. package/templates/.agents/tools/cloud-onboarding-provider.mjs +228 -0
  1186. package/templates/.agents/tools/cloud-onboarding-provider.test.mjs +144 -0
  1187. package/templates/.agents/tools/cloud-onboarding-recovery.test.mjs +306 -0
  1188. package/templates/.agents/tools/cloud-onboarding-ssh.mjs +223 -0
  1189. package/templates/.agents/tools/cloud-onboarding-terraform.mjs +80 -0
  1190. package/templates/.agents/tools/cloud-onboarding-test-fixture.mjs +184 -0
  1191. package/templates/.agents/tools/cloud-onboarding-test-fixtures.mjs +117 -0
  1192. package/templates/.agents/tools/cloud-onboarding.mjs +196 -0
  1193. package/templates/.agents/tools/cloud-onboarding.ssh.integration.test.mjs +391 -0
  1194. package/templates/.agents/tools/cloud-onboarding.test.mjs +237 -0
  1195. package/templates/.agents/tools/cloud-runner-arguments.mjs +37 -0
  1196. package/templates/.agents/tools/cloud-runner-dns.mjs +234 -11
  1197. package/templates/.agents/tools/cloud-runner-dns.test.mjs +256 -0
  1198. package/templates/.agents/tools/cloud-runner-process.mjs +61 -0
  1199. package/templates/.agents/tools/cloud-runner-process.test.mjs +43 -0
  1200. package/templates/.agents/tools/cloud-runner.integration.test.mjs +19 -3
  1201. package/templates/.agents/tools/cloud-runner.mjs +49 -169
  1202. package/templates/.agents/tools/cloud-runner.test.mjs +7 -42
  1203. package/templates/.agents/tools/historical-local-archive.mjs +89 -0
  1204. package/templates/.agents/tools/infisical-bootstrap-windows.test.mjs +12 -0
  1205. package/templates/.agents/tools/infisical-bootstrap.mjs +240 -0
  1206. package/templates/.agents/tools/infisical-bootstrap.test-support.mjs +39 -0
  1207. package/templates/.agents/tools/infisical-bootstrap.test.mjs +193 -0
  1208. package/templates/.agents/tools/infisical-policy.mjs +134 -0
  1209. package/templates/.agents/tools/infisical-runner.mjs +349 -0
  1210. package/templates/.agents/tools/infisical-runner.test.mjs +266 -0
  1211. package/templates/.agents/tools/mcp/infra/cloudflare/README.md +3 -17
  1212. package/templates/.agents/tools/mcp/infra/cloudflare/manifest.yaml +6 -10
  1213. package/templates/.agents/tools/repository-cloud-boundary.test.mjs +41 -0
  1214. package/templates/.agents/tools/repository-policy.mjs +257 -0
  1215. package/templates/.agents/tools/repository-profile.mjs +116 -0
  1216. package/templates/.agents/tools/repository-profile.test.mjs +67 -0
  1217. package/templates/.agents/tools/secret-inventory.mjs +150 -0
  1218. package/templates/.agents/tools/secret-inventory.test.mjs +60 -0
  1219. package/templates/.agents/tools/visual-intake/cli.mjs +72 -0
  1220. package/templates/.agents/tools/visual-intake/fs.mjs +137 -0
  1221. package/templates/.agents/tools/visual-intake/lock.mjs +98 -0
  1222. package/templates/.agents/tools/visual-intake/report.mjs +69 -0
  1223. package/templates/.agents/tools/visual-intake/runtime.mjs +330 -0
  1224. package/templates/.agents/tools/visual-intake/schema.mjs +235 -0
  1225. package/templates/.agents/tools/visual-intake/transaction.mjs +206 -0
  1226. package/templates/.agents/tools/visual-url/browser-cdp.mjs +167 -0
  1227. package/templates/.agents/tools/visual-url/browser-page-evidence.mjs +111 -0
  1228. package/templates/.agents/tools/visual-url/browser-proxy.mjs +194 -0
  1229. package/templates/.agents/tools/visual-url/browser-rendered-sample.mjs +312 -0
  1230. package/templates/.agents/tools/visual-url/browser-source.mjs +398 -0
  1231. package/templates/.agents/tools/visual-url/capture.mjs +119 -0
  1232. package/templates/.agents/tools/visual-url/captured-visual.mjs +301 -0
  1233. package/templates/.agents/tools/visual-url/cli.mjs +29 -0
  1234. package/templates/.agents/tools/visual-url/color-candidates.mjs +161 -0
  1235. package/templates/.agents/tools/visual-url/colors.mjs +98 -0
  1236. package/templates/.agents/tools/visual-url/contrast.mjs +40 -0
  1237. package/templates/.agents/tools/visual-url/css-sample.mjs +109 -0
  1238. package/templates/.agents/tools/visual-url/design-lint.mjs +83 -0
  1239. package/templates/.agents/tools/visual-url/design-score.mjs +217 -0
  1240. package/templates/.agents/tools/visual-url/failure.mjs +56 -0
  1241. package/templates/.agents/tools/visual-url/files.mjs +176 -0
  1242. package/templates/.agents/tools/visual-url/generated-tokens.mjs +369 -0
  1243. package/templates/.agents/tools/visual-url/handoff.mjs +85 -0
  1244. package/templates/.agents/tools/visual-url/icon.mjs +110 -0
  1245. package/templates/.agents/tools/visual-url/local-source.mjs +63 -0
  1246. package/templates/.agents/tools/visual-url/parser.mjs +288 -0
  1247. package/templates/.agents/tools/visual-url/policy.mjs +201 -0
  1248. package/templates/.agents/tools/visual-url/proposal-markdown.mjs +39 -0
  1249. package/templates/.agents/tools/visual-url/proposal.mjs +388 -0
  1250. package/templates/.agents/tools/visual-url/report.mjs +305 -0
  1251. package/templates/.agents/tools/visual-url/runtime.mjs +218 -0
  1252. package/templates/.agents/tools/visual-url/safe-visual-value.mjs +49 -0
  1253. package/templates/.agents/tools/visual-url/transport.mjs +187 -0
  1254. package/templates/.agents/tools/visual-url/visual-model.mjs +393 -0
  1255. package/templates/.agents/zaip-aios/VERSION +1 -1
  1256. package/templates/.agents/zaip-aios/guides/06-execucao.md +1 -1
  1257. package/templates/.agents/zaip-aios/guides/16-lifecycle-e-reconciliacao.md +1 -1
  1258. package/templates/.agents/zaip-aios/guides/19-assurance-e-autonomia.md +2 -2
  1259. package/templates/.agents/zaip-aios/guides/20-instalacao-detalhada.md +60 -18
  1260. package/templates/.agents/zaip-aios/guides/26-qualidade-e-release.md +8 -0
  1261. package/templates/.agents/zaip-aios/guides/27-telemetria-git-native.md +2 -2
  1262. package/templates/.agents/zaip-aios/guides/28-lifecycle-completo.md +2 -2
  1263. package/templates/infra/terraform/README.md +2 -0
  1264. package/templates/infra/terraform/infisical.tf +57 -0
  1265. package/templates/infra/terraform/terraform.tfvars.example +5 -0
  1266. package/templates/infra/terraform/variables.tf +1 -1
  1267. package/templates/scripts/validate-cloud-hostinger-contract.mjs +4 -1
  1268. package/templates/template-manifest.json +3905 -1127
  1269. package/templates/.agents/architecture/hostinger-cloudflare-terraform.md +0 -90
  1270. package/templates/.agents/dashboard/apps/frontend/dist/assets/CostCalculationGuidePage-uR-asJv_.js +0 -1
  1271. package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-1gE8RHel.js +0 -3
  1272. package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-B0Jwz_rk.js +0 -68
  1273. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-DZhppOIk.css +0 -1
  1274. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-DtLrd13g.js +0 -2
  1275. package/templates/.agents/dashboard/apps/frontend/dist/assets/traceability-DFpwb0TN.js +0 -1
  1276. package/templates/.agents/design/apps/catalog/dist/storybook/assets/Components.stories-kxWwSKin.js +0 -146
  1277. package/templates/.agents/design/apps/catalog/dist/storybook/assets/DashboardFilters.stories-Chm_dXV7.js +0 -9
  1278. package/templates/.agents/design/apps/catalog/dist/storybook/assets/DashboardFiltersSpecimen-9CaCbGIZ.js +0 -1
  1279. package/templates/.agents/design/apps/catalog/dist/storybook/assets/WorkspaceStatusSpecimen-DQnSS6s9.js +0 -1
  1280. package/templates/.agents/design/apps/catalog/dist/storybook/assets/formatter-L2YTDE3Q-Do9sjqiW.js +0 -1
  1281. package/templates/.agents/design/apps/catalog/dist/storybook/assets/iframe-0W0Gj_Gs.css +0 -1
  1282. package/templates/.agents/design/apps/catalog/dist/storybook/assets/react-NrUxok8K.js +0 -1
@@ -0,0 +1,127 @@
1
+ // Exact reviewed builder release interface; the runner still authenticates every effect.
2
+ export const CODEX_RELEASE_PUBLICATION = String.raw `function reviewedStageInputsPublisher(script, tokens) {
3
+ if (script !== "scripts/local-release-preparation.mjs" || tokens[2] !== "stage-inputs") return null;
4
+ const allowed = new Set(["--sha", "--version", "--profile", "--candidate-date", "--authorization-run", "--mode", "--package-version", "--condition-task", "--condition-validation", "--condition-run"]), values = new Map();
5
+ for (let index = 3; index < tokens.length; index++) {
6
+ const flag = tokens[index], value = tokens[++index];
7
+ if (!allowed.has(flag) || values.has(flag) || !value || value.startsWith("--") || /[\x00\r\n]/.test(value) || value.length > 256) deny("Unreviewed stage-inputs publication arguments.");
8
+ values.set(flag, value);
9
+ }
10
+ if (!/^[a-f0-9]{40}$/.test(values.get("--sha") ?? "") || !/^RUN-[A-Z0-9-]+$/.test(values.get("--authorization-run") ?? "") ||
11
+ !/^[1-9]\d*\.(?:0|[1-9]\d*)$/.test(values.get("--version") ?? "") || values.get("--profile") !== "essential" || !/^\d{8}$/.test(values.get("--candidate-date") ?? "")) deny("Stage-inputs requires an exact source Run, candidate and reviewed essential interface.");
12
+ const conditions = ["--condition-task", "--condition-validation", "--condition-run"];
13
+ if (conditions.some(flag => values.has(flag)) && (!conditions.every(flag => values.has(flag)) || !/^TASK-[A-Z0-9-]+$/.test(values.get("--condition-task")) || !/^TEST-[A-Z0-9-]+$/.test(values.get("--condition-validation")) || !/^RUN-[A-Z0-9-]+$/.test(values.get("--condition-run")))) deny("Stage-inputs requires all exact condition locators together.");
14
+ if (values.has("--mode") && !["standard", "patch"].includes(values.get("--mode")) || values.has("--package-version") && !/^\d+\.\d+\.\d+$/.test(values.get("--package-version"))) deny("Unreviewed stage-inputs version mode.");
15
+ return { script, values };
16
+ }
17
+ function reviewedLocalCatalogPublisher(script, tokens) {
18
+ const closure = script === "scripts/local-catalog-closure.mjs";
19
+ if (!closure && script !== "scripts/local-catalog-publication.mjs") return null;
20
+ const action = tokens[2], write = action === (closure ? "push" : "publish");
21
+ if (!write && action !== "verify") deny("Invalid local catalog publication action.");
22
+ const required = ["--repository", "--authorization-run", "--plan-file", "--request-file", "--artifacts", "--receipt", "--notes-file",
23
+ ...(closure ? ["--closure-sha", "--published-sha", "--metadata-paths", "--version"] : ["--sha"]),
24
+ ...(write ? ["--expected-remote-sha", ...(closure ? [] : ["--inventory-file", "--from", "--evidence"])] : [])];
25
+ const allowed = new Set([...required, ...(write ? ["--worktree-recovery"] : [])]), values = new Map();
26
+ for (let i = 3; i < tokens.length; i += 2) {
27
+ const flag = tokens[i], value = tokens[i + 1];
28
+ if (!allowed.has(flag) || values.has(flag) || !value || value.startsWith("-") || value.length > 32767 || /[\x00-\x1f]/.test(value)) deny("Unreviewed local catalog publication arguments.");
29
+ values.set(flag, value);
30
+ }
31
+ if (!required.every(flag => values.has(flag)) || values.get("--repository") !== "." || !/^RUN-[A-Z0-9-]+$/.test(values.get("--authorization-run")))
32
+ deny("Local catalog publication requires exact repository, source Run and reviewed inputs.");
33
+ for (const [flag, value] of values) if ((flag === "--sha" || flag.endsWith("-sha")) && !/^[a-f0-9]{40}$/.test(value)) deny("Local catalog publication requires immutable Git SHAs.");
34
+ const source = values.get(closure ? "--published-sha" : "--sha"), directory = values.get("--artifacts");
35
+ const prefix = ".agents/private/state/release-qualifications/" + source + "/";
36
+ if (!directory.startsWith(prefix) || !/^[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}\/artifacts$/.test(directory.slice(prefix.length)) ||
37
+ values.get("--receipt") !== directory + "/qualification-receipt.json") deny("Local catalog publication requires the exact candidate's signed artifacts.");
38
+ const safePath = path => /^[A-Za-z0-9_./-]+$/.test(path) && path.split("/").every(part => part && part !== "." && part !== "..");
39
+ const suffixes = {"--plan-file": ".json", "--request-file": ".txt", "--notes-file": ".md", "--inventory-file": ".json"};
40
+ for (const [flag, suffix] of Object.entries(suffixes)) if (values.has(flag)) {
41
+ const path = values.get(flag);
42
+ if (!path.startsWith(".local/") || !safePath(path) || !path.endsWith(suffix)) deny("Local catalog publication requires literal project-local metadata.");
43
+ }
44
+ if (values.has("--worktree-recovery") && !/^\.agents\/private\/state\/backup-worktrees\/[A-Za-z0-9_-]+\/receipt\.json$/.test(values.get("--worktree-recovery"))) deny("Invalid worktree preservation locator.");
45
+ if (closure) {
46
+ const paths = values.get("--metadata-paths").split(",");
47
+ if (!/^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/.test(values.get("--version")) || (write && values.get("--expected-remote-sha") !== source) ||
48
+ new Set(paths).size !== paths.length || !paths.every(path => safePath(path) && (path.startsWith(".agents/records/") || path === ".agents/config/release-cycle.json")))
49
+ deny("Closure requires the exact published preimage and literal reviewed metadata inventory.");
50
+ } else if (write && (!/^v(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/.test(values.get("--from")) || !/^EVD-[A-Z0-9-]+(?:,EVD-[A-Z0-9-]+)*$/.test(values.get("--evidence"))))
51
+ deny("Local catalog publication requires the preceding release tag and exact Evidence IDs.");
52
+ return { script, values, localCatalog: true };
53
+ }
54
+ function reviewedClosurePublisher(script, tokens) {
55
+ if (script !== "scripts/local-release-deploy.mjs" || tokens[2] !== "push-closure") return null;
56
+ const allowed = new Set(["--repository", "--authorization-run", "--expected-repository", "--branch", "--version", "--mode", "--package-version", "--published-sha", "--closure-sha", "--expected-remote-sha", "--publisher-recovery-sha", "--publisher-recovery-ci-run-id", "--metadata-paths", "--metadata-paths-file", "--receipt", "--tarball", "--policy", "--trust-store", "--notes-file", "--output-dir", "--request-file", "--plan-file"]), values = new Map();
57
+ for (let index = 3; index < tokens.length; index++) {
58
+ const flag = tokens[index], value = tokens[++index];
59
+ if (!allowed.has(flag) || values.has(flag) || !value || value.startsWith("--") || value.length > 4096 || /[\x00\r\n]/.test(value)) deny("Unreviewed closure publication arguments.");
60
+ values.set(flag, value);
61
+ }
62
+ if (values.get("--repository") !== "." || values.get("--expected-repository") !== "zaip-ai/zaip-aios" || values.get("--branch") !== "main" ||
63
+ !/^RUN-[A-Z0-9-]+$/.test(values.get("--authorization-run") ?? "") || !/^[1-9]\d*\.(?:0|[1-9]\d*)$/.test(values.get("--version") ?? "") ||
64
+ ["--published-sha", "--closure-sha", "--expected-remote-sha"].some(flag => !/^[a-f0-9]{40}$/.test(values.get(flag) ?? "")) || values.has("--metadata-paths") === values.has("--metadata-paths-file")) deny("Closure publication requires exact current authority, child candidate, published parent and main destination.");
65
+ const directory = values.get("--output-dir")?.replaceAll("\\", "/");
66
+ for (const flag of ["--request-file", "--plan-file"]) {
67
+ const path = values.get(flag);
68
+ if (!path || !/^\.local\/[A-Za-z0-9_./-]+\.(?:json|txt|md)$/.test(path) || path.split("/").includes("..") || flag === "--plan-file" && !path.endsWith(".json")) deny("Closure publication requires new repository-local child request and plan locators.");
69
+ }
70
+ if (!directory || !/^(?:[A-Za-z]:\/|\/)/.test(directory) || directory.split("/").includes("..") || /[\x00-\x1f*?{}\[\]$%<>]/.test(directory)) deny("Closure publication requires the protected published candidate directory.");
71
+ for (const flag of ["--receipt", "--tarball", "--notes-file", ...(values.has("--metadata-paths-file") ? ["--metadata-paths-file"] : [])]) {
72
+ const path = values.get(flag)?.replaceAll("\\", "/");
73
+ if (!path || !path.startsWith(directory + "/") || path.split("/").includes("..")) deny("Closure metadata escaped the published candidate directory.");
74
+ }
75
+ if (!["--policy", "--trust-store"].every(flag => values.has(flag)) || values.has("--metadata-paths") && (!/^[A-Za-z0-9_./-]+(?:,[A-Za-z0-9_./-]+)*$/.test(values.get("--metadata-paths")) || values.get("--metadata-paths").split(",").some(path => path.startsWith("/") || path.split(/[\\/]/).includes("..")))) deny("Closure verification inputs are incomplete or unreviewed.");
76
+ if (values.has("--mode") && !["standard", "patch"].includes(values.get("--mode")) || values.has("--package-version") && !/^\d+\.\d+\.\d+$/.test(values.get("--package-version"))) deny("Unreviewed closure version mode.");
77
+ if (values.has("--publisher-recovery-sha") && !/^[a-f0-9]{40}$/.test(values.get("--publisher-recovery-sha")) || values.has("--publisher-recovery-ci-run-id") && !/^[1-9]\d*$/.test(values.get("--publisher-recovery-ci-run-id"))) deny("Unreviewed closure recovery identity.");
78
+ return { script, values };
79
+ }
80
+ function reviewedConsumerPublisher(script, tokens) {
81
+ if (script !== ".agents/skills/zaip-skill-github-deploy/scripts/consumer-release-preparation.mjs") return null;
82
+ if (tokens[2] !== "guarded-push") return null;
83
+ const flags = new Set(["--repository", "--authorization-run", "--sha", "--branch", "--scope", "--remote", "--remote-url", "--github-version", "--policy", "--trust-store", "--private-key", "--key-id", "--output-dir", "--commands-json", "--request-file", "--plan-file"]);
84
+ const values = new Map();
85
+ for (let index = 3; index < tokens.length; index++) {
86
+ const flag = tokens[index], value = tokens[++index];
87
+ if (!flags.has(flag) || values.has(flag) || !value || value.startsWith("--") || value.length > 65536 || /[\x00\r\n]/.test(value)) deny("Unreviewed consumer publication arguments.");
88
+ values.set(flag, value);
89
+ }
90
+ if (values.get("--repository") !== "." || !/^RUN-[A-Z0-9-]+$/.test(values.get("--authorization-run") ?? "") || !/^[a-f0-9]{40}$/.test(values.get("--sha") ?? "") ||
91
+ (values.has("--remote") && values.get("--remote") !== "origin") || !/^[A-Za-z0-9][A-Za-z0-9._/-]*$/.test(values.get("--branch") ?? "") || values.get("--branch").includes("..")) deny("Consumer publication requires exact source, candidate and destination.");
92
+ for (const flag of ["--request-file", "--plan-file", "--policy", "--trust-store", "--private-key", "--output-dir"]) {
93
+ const path = values.get(flag);
94
+ if (!path || !/^\.local\/[A-Za-z0-9_./-]+$/.test(path) || path.split("/").includes("..")) deny("Consumer publication requires repository-local literal metadata and qualification paths.");
95
+ }
96
+ for (const flag of ["--remote-url", "--github-version", "--key-id", "--commands-json"]) if (!values.has(flag)) deny("Consumer qualification inputs are incomplete.");
97
+ return { script, values };
98
+ }
99
+ function reviewedFrameworkPublisher(script, tokens) {
100
+ if (script !== "scripts/local-release-deploy.mjs") return null;
101
+ if (tokens[2] === "push-closure") return reviewedClosurePublisher(script, tokens);
102
+ if (tokens[2] === "runtime-preflight") return null;
103
+ const booleanFlags = new Set(["--initial", "--dry-run", "--offline-dry-run", "--draft-only", "--resume-remote"]);
104
+ const flags = new Set(["--repository", "--authorization-run", "--expected-repository", "--sha", "--branch", "--output-dir", "--policy", "--key-id", "--channel", "--version", "--expires-at", "--notes-file", "--inventory-file", "--from", "--profile", "--mode", "--package-version", "--private-key", "--trust-store", ...booleanFlags]);
105
+ const values = new Map();
106
+ for (let index = 2; index < tokens.length; index++) {
107
+ const flag = tokens[index];
108
+ if (!flags.has(flag) || values.has(flag)) deny("Unreviewed framework publication arguments.");
109
+ if (booleanFlags.has(flag)) { values.set(flag, true); continue; }
110
+ const value = tokens[++index];
111
+ if (!value || value.startsWith("--") || value.length > 4096 || /[\x00\r\n]/.test(value)) deny("Missing framework publication value.");
112
+ values.set(flag, value);
113
+ }
114
+ if (values.get("--repository") !== "." || values.get("--expected-repository") !== "zaip-ai/zaip-aios" || values.get("--branch") !== "main" || values.get("--channel") !== "latest" ||
115
+ !/^RUN-[A-Z0-9-]+$/.test(values.get("--authorization-run") ?? "") || !/^[a-f0-9]{40}$/.test(values.get("--sha") ?? "")) deny("Framework publication requires exact source Run, candidate and main destination.");
116
+ for (const flag of ["--output-dir", "--policy", "--key-id", "--version", "--expires-at", "--notes-file", "--inventory-file"]) if (!values.has(flag)) deny("Incomplete framework publication contract.");
117
+ const directory = values.get("--output-dir").replaceAll("\\", "/");
118
+ if (!/^(?:[A-Za-z]:\/|\/)/.test(directory) || directory.split("/").includes("..") || /[\x00-\x1f*?{}\[\]$%<>]/.test(directory)) deny("Framework publication requires the exact protected candidate directory.");
119
+ for (const flag of ["--notes-file", "--inventory-file"]) {
120
+ const path = values.get(flag).replaceAll("\\", "/");
121
+ if (!path.startsWith(directory + "/") || path.split("/").includes("..") || !/\.(?:json|md|txt)$/.test(path)) deny("Framework publication metadata escaped the candidate directory.");
122
+ }
123
+ if (values.has("--offline-dry-run") && !values.has("--dry-run")) deny("Offline release validation requires dry run.");
124
+ return { script, values };
125
+ }
126
+ `;
127
+ //# sourceMappingURL=codex-release-publication-template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-release-publication-template.js","sourceRoot":"","sources":["../../src/services/codex-release-publication-template.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4HlD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const CODEX_REPOSITORY_PROFILE: string;
2
+ //# sourceMappingURL=codex-repository-profile-template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-repository-profile-template.d.ts","sourceRoot":"","sources":["../../src/services/codex-repository-profile-template.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,QAkFpC,CAAC"}
@@ -0,0 +1,84 @@
1
+ export const CODEX_REPOSITORY_PROFILE = String.raw `import { lstat, realpath } from "node:fs/promises";
2
+ import { dirname, isAbsolute, relative, resolve } from "node:path";
3
+ import { pathToFileURL } from "node:url";
4
+
5
+ // This boundary narrows existing authority; it never grants a command or writer.
6
+ export async function enforceRepositoryProfile({ installedRoot, repositoryRoot, event, tokenizeLiteralCommand, shellSyntax, patchPaths, isLiteralReadSequence, deny }) {
7
+ const policyPath = resolve(installedRoot, ".agents/config/repository-policy.json");
8
+ try { await lstat(policyPath); } catch (error) { if (error.code === "ENOENT") return false; throw error; }
9
+ const modulePath = resolve(installedRoot, ".agents/tools/repository-policy.mjs");
10
+ for (let path = modulePath; path !== dirname(installedRoot); path = dirname(path)) {
11
+ const info = await lstat(path);
12
+ if (info.isSymbolicLink()) throw Error("repository_profile_linked_runtime");
13
+ if (path === installedRoot) break;
14
+ }
15
+ const { loadRepositoryPolicy, assertRepositoryWrite, assertRepositoryOperation } = await import(pathToFileURL(modulePath).href);
16
+ const policy = await loadRepositoryPolicy(installedRoot);
17
+ const identity = path => process.platform === "win32" ? path.toLowerCase() : path;
18
+ if (identity(await realpath(repositoryRoot)) !== identity(await realpath(installedRoot)))
19
+ deny("Repository profile cannot be escaped through another checkout; configure and operate that repository in its own context.");
20
+ const input = event.tool_input ?? {};
21
+ const command = input.cmd ?? input.command ?? input.patch;
22
+ const cwd = input.workdir ?? event.cwd ?? repositoryRoot;
23
+ const local = relative(repositoryRoot, resolve(cwd));
24
+ if (local === ".." || local.startsWith("..\\") || local.startsWith("../") || isAbsolute(local))
25
+ deny("Repository profile rejects an external working directory.");
26
+ const write = path => assertRepositoryWrite(policy, repositoryRoot, relative(repositoryRoot, resolve(cwd, path)).replaceAll("\\", "/"));
27
+ if (event.tool_name === "apply_patch") {
28
+ const paths = patchPaths(command, repositoryRoot);
29
+ if (!paths.length) deny("Repository profile requires explicit patch paths.");
30
+ for (const path of paths) await assertRepositoryWrite(policy, repositoryRoot, path);
31
+ return false;
32
+ }
33
+ if (["Write", "Edit"].includes(event.tool_name)) {
34
+ await write(input.file_path ?? input.path ?? command);
35
+ return false;
36
+ }
37
+ if (typeof command !== "string") deny("Repository profile requires a supported literal tool invocation.");
38
+ // A configured boundary also applies to general; absence preserves legacy command policy.
39
+ const tokens = tokenizeLiteralCommand(command);
40
+ if (!tokens || Object.values(shellSyntax(command)).some(Boolean))
41
+ deny("Restricted repository profiles reject compound, inline and indirect shell execution.");
42
+ const executable = (tokens[0] ?? "").toLowerCase();
43
+ if (isLiteralReadSequence(command)) return false;
44
+ const node = /^(?:node|node\.exe)$/.test(executable);
45
+ if (node && identity(await realpath(cwd)) !== identity(await realpath(repositoryRoot)))
46
+ deny("Canonical runners must execute from the repository root.");
47
+ if (node && tokens[1] === ".agents/tools/repository-profile.mjs") {
48
+ if (!["show", "configure"].includes(tokens[2])) deny("Unsupported repository profile setup action.");
49
+ if (tokens.includes("--apply")) deny("An installed repository policy cannot be replaced by agent authority. Prepare a preview; the human applies it from their own terminal.");
50
+ return false;
51
+ }
52
+ // The CLI enforces graph, writer and scoped paths. No inline source executes here.
53
+ if (node && tokens[1] === ".agents/runtime/bin/zaip.mjs") {
54
+ if (["enable", "disable", "adapters", "setup", "generate", "validation", "execution"].includes(tokens[2]))
55
+ deny("This operation requires a reviewed repository-specific execution boundary.");
56
+ if (["conversation", "run", "subagent", "change", "decision", "evidence", "context", "doctor", "status", "version", "hook", "manifest"].includes(tokens[2])) return false;
57
+ if (tokens[2] === "task" && ["workspace", "show", "list", "amend-scopes"].includes(tokens[3])) return false;
58
+ deny("Repository profile rejects this unclassified CLI operation.");
59
+ }
60
+ if (node && tokens[1] === ".agents/tools/cloud-runner.mjs") {
61
+ assertRepositoryOperation(policy, "infra");
62
+ // Existing cloud guard and runner still validate the exact operation and contract.
63
+ return false;
64
+ }
65
+ if (node && tokens[1] === ".agents/skills/zaip-skill-maintenance-enter/scripts/maintenance.mjs") {
66
+ if (tokens.length === 3 && ["enter", "exit", "status"].includes(tokens[2])) return false;
67
+ deny("Repository profile requires the local maintenance transition without root overrides.");
68
+ }
69
+ if (["set-content", "add-content"].includes(executable)) {
70
+ const options = new Map();
71
+ for (let index = 1; index < tokens.length; index += 2) {
72
+ const flag = tokens[index]?.toLowerCase(), value = tokens[index + 1];
73
+ if (!["-literalpath", "-value", "-encoding"].includes(flag) || value === undefined || options.has(flag))
74
+ deny("Repository profile requires a single literal file write.");
75
+ options.set(flag, value);
76
+ }
77
+ if (!options.has("-literalpath") || !options.has("-value")) deny("Repository profile requires an explicit write target.");
78
+ await write(options.get("-literalpath"));
79
+ return false;
80
+ }
81
+ deny("Repository profile " + policy.profile + " rejects unclassified execution, remote shells and container source edits. Use a scoped runner or hand off to the owning repository.");
82
+ }
83
+ `;
84
+ //# sourceMappingURL=codex-repository-profile-template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-repository-profile-template.js","sourceRoot":"","sources":["../../src/services/codex-repository-profile-template.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkFjD,CAAC"}
@@ -1,3 +1,3 @@
1
- export declare const CODEX_GITHUB_DEPLOY_RULES = "# GitHub-only publication commands that may cross the workspace sandbox without prompting.\n# Only an explicit deploy request activates the ZAIP deploy skill. Its bounded flow may reconcile\n# the branch resolved fresh from project.yaml deploy.branch and form evidenced functional commits\n# with explicit pathspecs. The validation fallback is beta; production defaults to main and is human-promoted.\n\nprefix_rule(\n pattern = [\"node\", \".agents/skills/zaip-skill-github-deploy/scripts/preflight.mjs\"],\n decision = \"allow\",\n justification = \"Run the sanitized, repository-owned folder-scoped SSH preflight.\",\n match = [\"node .agents/skills/zaip-skill-github-deploy/scripts/preflight.mjs --repository . --remote origin\"],\n not_match = [\"node scripts/other.mjs\"],\n)\n\nprefix_rule(\n pattern = [\"git\", \"fetch\"],\n decision = \"allow\",\n justification = \"Fetch the configured GitHub remote once before checking the configured deploy branch.\",\n match = [\"git fetch origin\"],\n not_match = [\"git pull origin\"],\n)\n\nprefix_rule(\n pattern = [\"git\", \"add\", \"--\"],\n decision = \"allow\",\n justification = \"Stage only an evidenced functional group with explicit pathspecs during an authorized deploy.\",\n match = [\"git add -- README.md\", \"git add -- packages/core/src/example.ts\"],\n not_match = [\"git add -A\", \"git add --all\", \"git add .\", \"git add -u\"],\n)\n\nprefix_rule(\n pattern = [\"git\", \"commit\", \"-m\"],\n decision = \"allow\",\n justification = \"Create an evidenced functional commit without rewriting history during an authorized deploy.\",\n match = ['git commit -m \"[CODEX] Atualizar contrato de deploy\"'],\n not_match = [\"git commit --amend -m repair\", \"git commit --no-verify -m repair\"],\n)\n\nprefix_rule(\n pattern = [\"git\", \"stash\", \"push\", \"--include-untracked\"],\n decision = \"allow\",\n justification = \"Preserve the selected deploy diff without dropping history.\",\n match = [\"git stash push --include-untracked -m deploy-preserve\"],\n not_match = [\"git stash drop\"],\n)\n\nprefix_rule(\n pattern = [\"git\", \"stash\", \"apply\"],\n decision = \"allow\",\n justification = \"Reapply the preserved selected deploy diff.\",\n match = [\"git stash apply\"],\n not_match = [\"git stash drop\"],\n)\n\nprefix_rule(\n pattern = [\"git\", \"push\"],\n decision = \"allow\",\n justification = \"Publish only deploy.branch with an explicit refspec after ZAIP preflight.\",\n match = [\"git push origin HEAD:refs/heads/beta\"],\n not_match = [\"git pull\", \"ssh -i key git@github.com\"],\n)\n\nprefix_rule(\n pattern = [\"git\", \"ls-remote\"],\n decision = \"allow\",\n justification = \"Verify GitHub connectivity and the exact remote branch hash.\",\n match = [\"git ls-remote origin refs/heads/beta\"],\n not_match = [\"git remote set-url origin git@github.com:other/repo.git\"],\n)\n\nprefix_rule(\n pattern = [\"gh\", \"auth\", \"status\"],\n decision = \"allow\",\n justification = \"Inspect GitHub CLI authentication without changing credentials.\",\n match = [\"gh auth status\"],\n not_match = [\"gh auth login\"],\n)\n\nprefix_rule(\n pattern = [\"gh\", \"run\", [\"list\", \"view\", \"watch\"]],\n decision = \"allow\",\n justification = \"Observe GitHub Actions checks for the just-pushed commit.\",\n match = [\"gh run list\", \"gh run view 123\", \"gh run watch 123\"],\n not_match = [\"gh run cancel 123\", \"gh run delete 123\"],\n)\n\nprefix_rule(\n pattern = [\"gh\", \"pr\", [\"view\", \"checks\"]],\n decision = \"allow\",\n justification = \"Read pull-request metadata and required checks for the current repository.\",\n match = [\"gh pr view\", \"gh pr checks\"],\n not_match = [\"gh pr create\", \"gh pr merge\"],\n)\n";
1
+ export declare const CODEX_GITHUB_DEPLOY_RULES = "# GitHub-only publication commands that may cross the workspace sandbox without prompting.\n# Only an explicit deploy request activates the ZAIP deploy skill. Its bounded flow may reconcile\n# the branch resolved fresh from project.yaml deploy.branch and form evidenced functional commits\n# with explicit pathspecs. The validation fallback is beta; production defaults to main and is human-promoted.\n\nprefix_rule(\n pattern = [\"node\", \".agents/skills/zaip-skill-github-deploy/scripts/preflight.mjs\"],\n decision = \"allow\",\n justification = \"Run the sanitized, repository-owned folder-scoped SSH preflight.\",\n match = [\"node .agents/skills/zaip-skill-github-deploy/scripts/preflight.mjs --repository . --remote origin\"],\n not_match = [\"node scripts/other.mjs\"],\n)\n\nprefix_rule(\n pattern = [\"git\", \"fetch\"],\n decision = \"allow\",\n justification = \"Fetch the configured GitHub remote once before checking the configured deploy branch.\",\n match = [\"git fetch origin\"],\n not_match = [\"git pull origin\"],\n)\n\nprefix_rule(\n pattern = [\"git\", \"add\", \"--\"],\n decision = \"allow\",\n justification = \"Stage only an evidenced functional group with explicit pathspecs during an authorized deploy.\",\n match = [\"git add -- README.md\", \"git add -- packages/core/src/example.ts\"],\n not_match = [\"git add -A\", \"git add --all\", \"git add .\", \"git add -u\"],\n)\n\nprefix_rule(\n pattern = [\"git\", \"commit\", \"-m\"],\n decision = \"allow\",\n justification = \"Create an evidenced functional commit without rewriting history during an authorized deploy.\",\n match = ['git commit -m \"[CODEX] Atualizar contrato de deploy\"'],\n not_match = [\"git commit --amend -m repair\", \"git commit --no-verify -m repair\"],\n)\n\nprefix_rule(\n pattern = [\"git\", \"stash\", \"push\", \"--include-untracked\"],\n decision = \"allow\",\n justification = \"Preserve the selected deploy diff without dropping history.\",\n match = [\"git stash push --include-untracked -m deploy-preserve\"],\n not_match = [\"git stash drop\"],\n)\n\nprefix_rule(\n pattern = [\"git\", \"stash\", \"apply\"],\n decision = \"allow\",\n justification = \"Reapply the preserved selected deploy diff.\",\n match = [\"git stash apply\"],\n not_match = [\"git stash drop\"],\n)\n\nprefix_rule(\n pattern = [\"git\", \"push\"],\n decision = \"forbidden\",\n justification = \"Direct push has no candidate-bound publication contract; use the reviewed publisher.\",\n match = [\"git push origin HEAD:refs/heads/beta\"],\n not_match = [\"git pull\", \"ssh -i key git@github.com\"],\n)\n\nprefix_rule(\n pattern = [\"git\", \"ls-remote\"],\n decision = \"allow\",\n justification = \"Verify GitHub connectivity and the exact remote branch hash.\",\n match = [\"git ls-remote origin refs/heads/beta\"],\n not_match = [\"git remote set-url origin git@github.com:other/repo.git\"],\n)\n\nprefix_rule(\n pattern = [\"gh\", \"auth\", \"status\"],\n decision = \"allow\",\n justification = \"Inspect GitHub CLI authentication without changing credentials.\",\n match = [\"gh auth status\"],\n not_match = [\"gh auth login\"],\n)\n\nprefix_rule(\n pattern = [\"gh\", \"run\", [\"list\", \"view\", \"watch\"]],\n decision = \"allow\",\n justification = \"Observe GitHub Actions checks for the just-pushed commit.\",\n match = [\"gh run list\", \"gh run view 123\", \"gh run watch 123\"],\n not_match = [\"gh run cancel 123\", \"gh run delete 123\"],\n)\n\nprefix_rule(\n pattern = [\"gh\", \"pr\", [\"view\", \"checks\"]],\n decision = \"allow\",\n justification = \"Read pull-request metadata and required checks for the current repository.\",\n match = [\"gh pr view\", \"gh pr checks\"],\n not_match = [\"gh pr create\", \"gh pr merge\"],\n)\n";
2
2
  export declare const CODEX_SECURITY_RULES = "# Fail-closed defense in depth for commands that must never prompt or execute.\n# Native permission profiles, repository instructions, and these forbidden rules form the active boundary.\n\nprefix_rule(\n pattern = [\"git\", [\"clean\", \"reset\", \"restore\"]],\n decision = \"forbidden\",\n justification = \"Use non-destructive Git inspection and an explicit file-level patch instead.\",\n match = [\"git reset --hard\", \"git clean -fd\", \"git restore README.md\"],\n)\n\nprefix_rule(\n pattern = [\"git\", [\"-c\", \"--config\", \"--config-env\", \"--git-dir\", \"--work-tree\", \"--namespace\"]],\n decision = \"forbidden\",\n justification = \"Git configuration and repository-routing overrides can bypass the managed safety hook.\",\n match = [\"git -c core.hooksPath=/tmp/empty commit -m bypass\", \"git --config core.hooksPath=/tmp/empty commit -m bypass\"],\n)\n\nprefix_rule(\n pattern = [[\"reg\", \"reg.exe\", \"schtasks\", \"schtasks.exe\", \"sc\", \"sc.exe\", \"diskpart\", \"format\", \"bcdedit\", \"fsutil\", \"takeown\", \"icacls\"]],\n decision = \"forbidden\",\n justification = \"Operating-system persistence, disk, service, ownership, and ACL changes are outside repository scope.\",\n match = [\"reg add HKCU\\Software\\Example\", \"schtasks /create /tn example\", \"diskpart\"],\n)\n\nprefix_rule(\n pattern = [[\"runas\", \"sudo\", \"gsudo\"]],\n decision = \"forbidden\",\n justification = \"Privilege escalation is never allowed from ZAIP repository work.\",\n match = [\"runas /user:Administrator cmd\", \"sudo rm -rf /\"],\n)\n\nprefix_rule(\n pattern = [[\"winget\", \"choco\", \"scoop\"]],\n decision = \"forbidden\",\n justification = \"System package management is outside repository scope; use project-local dependencies.\",\n match = [\"winget install Git.Git\", \"choco upgrade nodejs\", \"scoop install jq\"],\n)\n\nprefix_rule(\n pattern = [[\"ssh\", \"scp\", \"sftp\", \"rsync\", \"ftp\", \"telnet\", \"nc\", \"ncat\"]],\n decision = \"forbidden\",\n justification = \"Use the repository-owned GitHub deploy preflight and Git commands instead of direct remote clients.\",\n match = [\"ssh host\", \"scp file host:/tmp\", \"nc -l 4444\"],\n)\n";
3
3
  //# sourceMappingURL=codex-rules.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codex-rules.d.ts","sourceRoot":"","sources":["../../src/services/codex-rules.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,4zHA4FrC,CAAC;AAEF,eAAO,MAAM,oBAAoB,otEA4ChC,CAAC"}
1
+ {"version":3,"file":"codex-rules.d.ts","sourceRoot":"","sources":["../../src/services/codex-rules.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,20HA4FrC,CAAC;AAEF,eAAO,MAAM,oBAAoB,otEA4ChC,CAAC"}
@@ -53,8 +53,8 @@ prefix_rule(
53
53
 
54
54
  prefix_rule(
55
55
  pattern = ["git", "push"],
56
- decision = "allow",
57
- justification = "Publish only deploy.branch with an explicit refspec after ZAIP preflight.",
56
+ decision = "forbidden",
57
+ justification = "Direct push has no candidate-bound publication contract; use the reviewed publisher.",
58
58
  match = ["git push origin HEAD:refs/heads/beta"],
59
59
  not_match = ["git pull", "ssh -i key git@github.com"],
60
60
  )
@@ -0,0 +1,2 @@
1
+ export declare const CODEX_STORAGE_HANDOFF_REVIEW: string;
2
+ //# sourceMappingURL=codex-storage-handoff-template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-storage-handoff-template.d.ts","sourceRoot":"","sources":["../../src/services/codex-storage-handoff-template.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,QAgBxC,CAAC"}
@@ -0,0 +1,18 @@
1
+ export const CODEX_STORAGE_HANDOFF_REVIEW = String.raw `export function isStorageHandoffCommand(tokens) {
2
+ if (!tokens || tokens[1] !== ".agents/private/state/storage-cutover/runtime/zaip.mjs" ||
3
+ tokens[2] !== "task" || tokens[3] !== "storage-handoff" || !/^TASK-[A-Z0-9-]+$/.test(tokens[4] ?? "")) return false;
4
+ const flags = new Set(), values = new Map();
5
+ for (let i = 5; i < tokens.length; i++) {
6
+ const flag = tokens[i];
7
+ if (flags.has(flag)) return false;
8
+ flags.add(flag);
9
+ if (["--inspect", "--apply", "--json"].includes(flag)) continue;
10
+ if (!["--run", "--generation"].includes(flag) || !tokens[i + 1] || tokens[i + 1].startsWith("--")) return false;
11
+ values.set(flag, tokens[++i]);
12
+ }
13
+ if (!/^RUN-[A-Z0-9-]+$/.test(values.get("--run") ?? "") || flags.has("--inspect") === flags.has("--apply")) return false;
14
+ return flags.has("--inspect") ? !flags.has("--generation")
15
+ : /^\.agents\/private\/state\/storage-cutover\/generations\/[a-f0-9]{64}\.json$/.test(values.get("--generation") ?? "");
16
+ }
17
+ `;
18
+ //# sourceMappingURL=codex-storage-handoff-template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-storage-handoff-template.js","sourceRoot":"","sources":["../../src/services/codex-storage-handoff-template.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;CAgBrD,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const CODEX_SUBAGENT_LIFECYCLE_HOOK = "import { existsSync, realpathSync } from \"node:fs\";\nimport { promises as fs } from \"node:fs\";\nimport { execFileSync, spawn } from \"node:child_process\";\nimport { createHash, randomUUID } from \"node:crypto\";\nimport { dirname, isAbsolute, relative, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst hookPath = fileURLToPath(import.meta.url);\nconst activation = await import(\"./zaip-hook-activation.mjs\").catch(() => null);\nconst installedRoot = resolve(dirname(hookPath), \"..\", \"..\");\nlet repositoryRoot = installedRoot;\nlet diagnosticPath = resolve(\n repositoryRoot,\n \".local\",\n \"hooks\",\n \"subagent-lifecycle.ndjson\",\n);\nlet pendingRoot = resolve(repositoryRoot, \".local\", \"hooks\", \"subagent-pending\");\n\nfunction inside(path, root) {\n const scoped = relative(root, resolve(path));\n return scoped === \"\" || (!scoped.startsWith(\"..\") && !isAbsolute(scoped));\n}\nfunction selectRoot(cwd) {\n if (typeof cwd !== \"string\") return false;\n try {\n if (realpathSync(cwd).toLowerCase() !== resolve(cwd).toLowerCase()) return false;\n let nestedGit = false;\n if (inside(cwd, installedRoot)) {\n for (let cursor = resolve(cwd); cursor.toLowerCase() !== installedRoot.toLowerCase(); cursor = dirname(cursor)) {\n if (existsSync(resolve(cursor, \".git\"))) { nestedGit = true; break; }\n }\n }\n if (!inside(cwd, installedRoot) || nestedGit) {\n const git = (root, ...args) => execFileSync(\"git\", [\"-C\", root, ...args], {\n encoding: \"utf8\", windowsHide: true, timeout: 5000,\n }).trim();\n if (realpathSync(git(installedRoot, \"rev-parse\", \"--show-toplevel\")).toLowerCase() !== installedRoot.toLowerCase()) return false;\n const registered = git(installedRoot, \"worktree\", \"list\", \"--porcelain\", \"-z\")\n .split(\"\\0\").filter(line => line.startsWith(\"worktree \")).map(line => resolve(line.slice(9)).toLowerCase());\n const candidate = realpathSync(git(cwd, \"rev-parse\", \"--show-toplevel\"));\n if (!registered.includes(candidate.toLowerCase()) || !inside(cwd, candidate)) return false;\n const common = root => realpathSync(git(root, \"rev-parse\", \"--path-format=absolute\", \"--git-common-dir\")).toLowerCase();\n if (common(installedRoot) !== common(candidate)) return false;\n repositoryRoot = candidate;\n }\n diagnosticPath = resolve(repositoryRoot, \".local\", \"hooks\", \"subagent-lifecycle.ndjson\");\n pendingRoot = resolve(repositoryRoot, \".local\", \"hooks\", \"subagent-pending\");\n return true;\n } catch { return false; }\n}\n\nif (process.argv[2] === \"--capture-runner\") {\n if (!selectRoot(process.cwd())) process.exit(0);\n if (!(await activation?.hookPolicies?.(repositoryRoot))?.governance) process.exit(0);\n await runCaptureRunner(process.argv[3]);\n process.exit(0);\n}\nif (process.argv[2] === \"--replay-pending\") {\n if (!selectRoot(process.cwd())) process.exit(0);\n const policy = await activation?.hookPolicies?.(repositoryRoot);\n if (policy?.tracking) activation?.replayHookObservations?.(repositoryRoot);\n if (!policy?.governance) { process.stdout.write(JSON.stringify({ attempted: 0, deferred: 0, pending: 0, disabled: true })); process.exit(0); }\n const files = (await fs.readdir(pendingRoot).catch(() => []))\n .filter((name) => /^[a-f0-9]{64}\\.json$/.test(name)).sort();\n const cursorPath = resolve(pendingRoot, \".replay-cursor\");\n const cursor = await fs.readFile(cursorPath, \"utf8\").then(JSON.parse).catch(() => null);\n const start = (files.indexOf(cursor?.last) + 1) % (files.length || 1);\n const selected = [...files.slice(start), ...files.slice(0, start)].slice(0, 256);\n let attempted = 0, deferred = 0, pending = 0;\n let lastAttempted = null;\n for (const file of selected) {\n const path = resolve(pendingRoot, file);\n const receipt = await fs.readFile(path, \"utf8\").then(JSON.parse).catch(() => null);\n if (receipt?.state !== \"pending\" || !Array.isArray(receipt.capture_arguments)) continue;\n if (attempted < 3) {\n attempted++; lastAttempted = file;\n if (await replayPendingReceipt(path) === \"deferred\") deferred++;\n }\n if ((await fs.readFile(path, \"utf8\").then(JSON.parse).catch(() => null))?.state === \"pending\") pending++;\n }\n if (selected.length) await atomicSave(cursorPath, { last: lastAttempted ?? selected.at(-1) });\n process.stdout.write(JSON.stringify({ attempted, deferred, pending, uninspected: files.length - selected.length }));\n process.exit(0);\n}\n\nlet raw = \"\";\nfor await (const chunk of process.stdin) raw += chunk;\n\ntry {\n const event = JSON.parse(raw);\n const cwd = text(event.cwd);\n if (cwd === null || !selectRoot(cwd)) process.exit(0);\n const policy = await activation?.hookPolicies?.(repositoryRoot) ?? { governance: false, tracking: false, diagnostic: \"policy_module_unavailable\" };\n activation?.recordPolicyDiagnostic?.(repositoryRoot, policy);\n if (policy.tracking) activation?.recordHookObservation?.(repositoryRoot, event, policy.governance);\n if (policy.tracking && event.hook_event_name === \"SubagentStop\") activation?.replayHookObservations?.(repositoryRoot);\n if (!policy.governance) { process.stdout.write(JSON.stringify({})); process.exit(0); }\n const eventName = text(event.hook_event_name);\n activation?.recordActivation(repositoryRoot, event);\n const lifecycleEvent =\n eventName === \"SubagentStart\" ? \"start\" : eventName === \"SubagentStop\" ? \"stop\" : null;\n const session = text(event.session_id);\n const turn = text(event.turn_id);\n const agentId = text(event.agent_id);\n const agentType = text(event.agent_type);\n const model = text(event.model);\n const reasoningEffort = reasoningEffortValue(\n event.model_reasoning_effort ?? event.reasoning_effort,\n );\n const parentAgentId = text(event.parent_agent_id ?? event.parent_id);\n const parentRunId = text(event.parent_run_id ?? event.root_run_id);\n const status = terminalStatus(event.status);\n const required = [lifecycleEvent, session, turn, agentId, agentType];\n if (lifecycleEvent === null) {\n await diagnostic(\"ignored_unrecognized_event\", { eventName });\n process.exit(0);\n }\n const terminalFallback =\n lifecycleEvent === \"stop\" &&\n status !== null &&\n agentId !== null &&\n parentAgentId !== null &&\n parentRunId !== null &&\n (session === null || turn === null);\n if (\n (!terminalFallback && required.some((value) => value === null)) ||\n (lifecycleEvent === \"start\" && model === null) ||\n (lifecycleEvent === \"stop\" && status === null)\n ) {\n await fs.mkdir(pendingRoot, { recursive: true });\n const identity = JSON.stringify({ eventName, session, turn, agentId, agentType, parentAgentId, parentRunId });\n const pending = resolve(pendingRoot, createHash(\"sha256\").update(identity).digest(\"hex\") + \".json\");\n await atomicSave(pending, { schema_version: 1, state: \"pending\", last_error: \"incomplete_host_metadata\", identity: JSON.parse(identity), recovery: \"Capture observed native metadata manually; never infer completed status.\" });\n await diagnostic(\"ignored_incomplete_event\", {\n eventName,\n session,\n turn,\n agentId,\n agentType,\n missing_model: lifecycleEvent === \"start\" && model === null,\n });\n process.exit(0);\n }\n const candidates = [\n resolve(repositoryRoot, \".agents\", \"runtime\", \"bin\", \"zaip.mjs\"),\n resolve(repositoryRoot, \"packages\", \"cli\", \"dist\", \"index.js\"),\n ];\n const cli = candidates.find(existsSync);\n if (cli === undefined) {\n await diagnostic(\"cli_not_found\", { eventName, candidates });\n process.exit(0);\n }\n const captureArguments = terminalFallback\n ? [\n \"subagent\",\n \"capture-terminal\",\n \"--parent-agent-id\",\n parentAgentId,\n \"--parent-run-id\",\n parentRunId,\n \"--agent-id\",\n agentId,\n \"--agent-type\",\n agentType,\n \"--status\",\n status,\n \"--json\",\n ]\n : [\n \"subagent\",\n \"capture\",\n \"--event\",\n lifecycleEvent,\n \"--session\",\n session,\n \"--turn\",\n turn,\n \"--agent-id\",\n agentId,\n \"--agent-type\",\n agentType,\n ...(model === null ? [] : [\"--model\", model]),\n ...(reasoningEffort === null ? [] : [\"--reasoning-effort\", reasoningEffort]),\n ...(parentAgentId === null ? [] : [\"--parent-agent-id\", parentAgentId]),\n ...(lifecycleEvent !== \"stop\" || status === null ? [] : [\"--status\", status]),\n \"--json\",\n ];\n const pending = await persistPending(cli, captureArguments);\n const receipt = await fs.readFile(pending, \"utf8\").then(JSON.parse);\n if (receipt.state !== \"acknowledged\") {\n const runner = spawn(\n process.execPath,\n [hookPath, \"--capture-runner\", pending],\n {\n cwd: repositoryRoot,\n detached: true,\n windowsHide: true,\n stdio: \"ignore\",\n },\n );\n runner.once(\"error\", (error) =>\n diagnostic(\"runner_spawn_failed\", { eventName, error: error.message }),\n );\n runner.unref();\n }\n if (lifecycleEvent === \"start\") {\n process.stdout.write(JSON.stringify({\n hookSpecificOutput: {\n hookEventName: \"SubagentStart\",\n additionalContext:\n \"ZAIP Codex delegation policy: a Sub-Run is only a native collaboration subagent. Do not use create_thread or fork_thread as a Sub-Run, fallback, retry, or delegation proof; those create independent chats and require an explicit user request. If native delegation is unavailable, report the limitation rather than create an independent chat. A catalog name, task_name, title, or prompt is not native ancestry. Before retrying the same bounded dispatch, await or reuse its pending native child; capture only ancestry observed from native host spawn/terminal results or SubagentStart/SubagentStop events, and work only as a cataloged zaip-agent-NOME identity. Delegation is recursive; do not use default, worker, explorer, or ad-hoc agent types.\",\n },\n }));\n } else {\n // Codex expects one JSON object on stdout for SubagentStop as well.\n process.stdout.write(JSON.stringify({}));\n }\n} catch (error) {\n await diagnostic(\"hook_exception\", {\n error: error instanceof Error ? error.message : String(error),\n });\n}\n\nasync function atomicSave(path, value) {\n const temporary = path + \".tmp-\" + randomUUID();\n const delays = [25, 50, 75, 100, 150, 225, 300, 400, 500];\n try {\n await fs.writeFile(temporary, JSON.stringify(value), { flag: \"wx\", mode: 0o600 });\n for (let retry = 0; ; retry++) {\n try { await fs.rename(temporary, path); return; }\n catch (error) {\n if (![\"EPERM\", \"EACCES\", \"EBUSY\"].includes(error.code) || retry >= delays.length) throw error;\n await new Promise(done => setTimeout(done, delays[retry]));\n }\n }\n } finally {\n await fs.unlink(temporary).catch(() => {});\n }\n}\n\nasync function replayPendingReceipt(path) {\n const deadline = Date.now() + 2000;\n for (;;) {\n if (await runCaptureRunner(path, true) !== \"lease_busy\") return \"attempted\";\n if (Date.now() >= deadline) {\n await persistDiagnostic(\"replay_deferred_active_lease\", { receipt: path });\n return \"deferred\";\n }\n await new Promise(done => setTimeout(done, 50));\n }\n}\n\nasync function runCaptureRunner(receiptPath, replay = false) {\n if (typeof receiptPath !== \"string\" || dirname(resolve(receiptPath)) !== pendingRoot) return;\n const lockPath = receiptPath + \".lock\";\n let lease;\n try {\n lease = await fs.open(lockPath, \"wx\");\n await lease.writeFile(JSON.stringify({ pid: process.pid }));\n } catch (error) {\n if (error.code !== \"EEXIST\") return;\n const owner = await fs.readFile(lockPath, \"utf8\").then(JSON.parse).catch(() => null);\n if (!Number.isSafeInteger(owner?.pid) || owner.pid <= 0) return \"lease_busy\";\n try { process.kill(owner.pid, 0); return \"lease_busy\"; } catch (failure) { if (failure.code !== \"ESRCH\") return \"lease_busy\"; }\n // Serialize stale lock recovery so two recovering workers cannot remove a new lease.\n let recovery;\n try { recovery = await fs.open(lockPath + \".recover\", \"wx\"); } catch { return \"lease_busy\"; }\n try {\n const current = await fs.readFile(lockPath, \"utf8\").then(JSON.parse).catch(() => null);\n if (current?.pid !== owner.pid) return \"lease_busy\";\n await fs.unlink(lockPath);\n lease = await fs.open(lockPath, \"wx\");\n await lease.writeFile(JSON.stringify({ pid: process.pid }));\n } finally { await recovery.close(); await fs.unlink(lockPath + \".recover\").catch(() => {}); }\n if (!lease) return \"lease_busy\";\n }\n try {\n const receipt = await fs.readFile(receiptPath, \"utf8\").then(JSON.parse);\n if (receipt.schema_version !== 1 || receipt.state === \"acknowledged\" || (!replay && receipt.attempts >= 3)) return;\n const cli = receipt.cli, args = receipt.capture_arguments;\n const allowedCli = [resolve(repositoryRoot, \".agents/runtime/bin/zaip.mjs\"), resolve(repositoryRoot, \"packages/cli/dist/index.js\")];\n if (!allowedCli.includes(cli) || !Array.isArray(args) || !args.every(x => typeof x === \"string\") || args[0] !== \"subagent\" || ![\"capture\", \"capture-terminal\"].includes(args[1])) return;\n const digest = createHash(\"sha256\").update(JSON.stringify({ cli, arguments: args })).digest(\"hex\");\n if (resolve(pendingRoot, digest + \".json\") !== resolve(receiptPath)) return;\n const value = flag => args[args.indexOf(flag) + 1];\n const stop = args[1] === \"capture-terminal\" || value(\"--event\") === \"stop\";\n if (stop && ![\"completed\", \"failed\", \"cancelled\"].includes(value(\"--status\"))) return;\n for (let retry = 0; retry < 3; retry++) {\n receipt.attempts = (receipt.attempts ?? 0) + 1;\n receipt.updated_at = new Date().toISOString();\n await atomicSave(receiptPath, receipt);\n const outcome = await capture(cli, args);\n let result;\n try { result = JSON.parse(outcome.stdout); } catch { result = null; }\n const runId = result?.run?.run_id ?? result?.run?.id;\n const status = result?.status ?? result?.run?.status;\n if (outcome.code === 0 && result?.captured === true && typeof runId === \"string\" && runId.startsWith(\"RUN-\") && (!stop || status === value(\"--status\"))) {\n receipt.state = \"acknowledged\";\n receipt.run_id = runId;\n receipt.acknowledged_at = new Date().toISOString();\n delete receipt.last_error;\n await atomicSave(receiptPath, receipt);\n return;\n }\n receipt.last_error = outcome.error ?? (outcome.code === 0 ? \"capture_not_confirmed\" : \"capture_exit_nonzero\");\n await atomicSave(receiptPath, receipt);\n if (retry < 2) await new Promise(done => setTimeout(done, 250 * (retry + 1)));\n }\n await persistDiagnostic(\"capture_pending\", { receipt: receiptPath, attempts: receipt.attempts, error: receipt.last_error });\n } catch (error) {\n await persistDiagnostic(\"runner_exception\", { error: error instanceof Error ? error.message : String(error) });\n } finally {\n await lease?.close();\n await fs.unlink(lockPath).catch(() => {});\n }\n}\n\nasync function capture(cli, args) {\n const policy = await activation?.hookPolicies?.(repositoryRoot);\n const child = spawn(process.execPath, [cli, ...args], { cwd: repositoryRoot, windowsHide: true,\n env: { ...process.env, ZAIP_HOOK_TRACKING_ENABLED: policy?.tracking ? \"true\" : \"false\" }, stdio: [\"ignore\", \"pipe\", \"pipe\"] });\n let stdout = \"\", overflow = false;\n child.stdout.on(\"data\", chunk => { stdout += String(chunk); if (stdout.length > 262144) { overflow = true; stdout = \"\"; child.kill(); } });\n child.stderr.resume();\n return await new Promise(done => {\n let settled = false;\n const finish = result => { if (settled) return; settled = true; clearTimeout(timer); done({ ...result, stdout: overflow ? \"\" : stdout }); };\n const timer = setTimeout(() => { child.kill(); finish({ error: \"capture_timeout\" }); }, 15000);\n child.once(\"error\", () => finish({ error: \"capture_spawn_failed\" }));\n child.once(\"close\", code => finish({ code }));\n });\n}\n\nasync function persistPending(cli, captureArguments) {\n const identity = JSON.stringify({ cli, arguments: captureArguments });\n const digest = createHash(\"sha256\").update(identity).digest(\"hex\");\n const path = resolve(pendingRoot, digest + \".json\");\n await fs.mkdir(pendingRoot, { recursive: true });\n const receipt = { schema_version: 1, state: \"pending\", cli, capture_arguments: captureArguments, attempts: 0, created_at: new Date().toISOString() };\n // Publish a complete immutable initial receipt without overwriting another worker's acknowledgement.\n const temporary = path + \".tmp-\" + randomUUID();\n await fs.writeFile(temporary, JSON.stringify(receipt), { flag: \"wx\", mode: 0o600 });\n try { await fs.link(temporary, path); } catch (error) { if (error.code !== \"EEXIST\") throw error; }\n finally { await fs.unlink(temporary); }\n return path;\n}\n\nasync function persistDiagnostic(code, detail) {\n const line = `${JSON.stringify({\n source: \"zaip-subagent-lifecycle-runner\",\n code,\n occurred_at: new Date().toISOString(),\n detail,\n })}\\n`;\n await fs.mkdir(dirname(diagnosticPath), { recursive: true });\n const size = await fs.stat(diagnosticPath).then((entry) => entry.size).catch(() => 0);\n if (size + Buffer.byteLength(line) > 262_144) {\n await fs.writeFile(diagnosticPath, \"\", \"utf8\");\n }\n await fs.appendFile(diagnosticPath, line, \"utf8\");\n}\n\nasync function diagnostic(code, detail) {\n await persistDiagnostic(code, detail);\n process.stderr.write(\n `${JSON.stringify({ source: \"zaip-subagent-lifecycle\", code, detail })}\\n`,\n );\n}\n\nfunction text(value) {\n if (typeof value !== \"string\") return null;\n const normalized = value.trim();\n return normalized.length > 0 && normalized.length <= 200 ? normalized : null;\n}\n\nfunction reasoningEffortValue(value) {\n const normalized = text(value);\n return [\"low\", \"medium\", \"high\", \"xhigh\"].includes(normalized) ? normalized : null;\n}\n\nfunction terminalStatus(value) {\n const normalized = text(value);\n return [\"completed\", \"failed\", \"cancelled\"].includes(normalized) ? normalized : null;\n}\n";
1
+ export declare const CODEX_SUBAGENT_LIFECYCLE_HOOK = "import { existsSync, realpathSync } from \"node:fs\";\nimport { promises as fs } from \"node:fs\";\nimport { execFileSync, spawn } from \"node:child_process\";\nimport { createHash, randomUUID } from \"node:crypto\";\nimport { dirname, isAbsolute, relative, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst hookPath = fileURLToPath(import.meta.url);\nconst activation = await import(\"./zaip-hook-activation.mjs\").catch(() => null);\nconst installedRoot = resolve(dirname(hookPath), \"..\", \"..\");\nlet repositoryRoot = installedRoot;\nlet diagnosticPath = resolve(\n repositoryRoot,\n \".agents/private/state\",\n \"hooks\",\n \"subagent-lifecycle.ndjson\",\n);\nlet pendingRoot = resolve(repositoryRoot, \".agents/private/state\", \"hooks\", \"subagent-pending\");\n\nfunction inside(path, root) {\n const scoped = relative(root, resolve(path));\n return scoped === \"\" || (!scoped.startsWith(\"..\") && !isAbsolute(scoped));\n}\nfunction selectRoot(cwd) {\n if (typeof cwd !== \"string\") return false;\n try {\n if (realpathSync(cwd).toLowerCase() !== resolve(cwd).toLowerCase()) return false;\n let nestedGit = false;\n if (inside(cwd, installedRoot)) {\n for (let cursor = resolve(cwd); cursor.toLowerCase() !== installedRoot.toLowerCase(); cursor = dirname(cursor)) {\n if (existsSync(resolve(cursor, \".git\"))) { nestedGit = true; break; }\n }\n }\n if (!inside(cwd, installedRoot) || nestedGit) {\n const git = (root, ...args) => execFileSync(\"git\", [\"-C\", root, ...args], {\n encoding: \"utf8\", windowsHide: true, timeout: 5000,\n }).trim();\n if (realpathSync(git(installedRoot, \"rev-parse\", \"--show-toplevel\")).toLowerCase() !== installedRoot.toLowerCase()) return false;\n const registered = git(installedRoot, \"worktree\", \"list\", \"--porcelain\", \"-z\")\n .split(\"\\0\").filter(line => line.startsWith(\"worktree \")).map(line => resolve(line.slice(9)).toLowerCase());\n const candidate = realpathSync(git(cwd, \"rev-parse\", \"--show-toplevel\"));\n if (!registered.includes(candidate.toLowerCase()) || !inside(cwd, candidate)) return false;\n const common = root => realpathSync(git(root, \"rev-parse\", \"--path-format=absolute\", \"--git-common-dir\")).toLowerCase();\n if (common(installedRoot) !== common(candidate)) return false;\n repositoryRoot = candidate;\n }\n diagnosticPath = resolve(repositoryRoot, \".agents/private/state\", \"hooks\", \"subagent-lifecycle.ndjson\");\n pendingRoot = resolve(repositoryRoot, \".agents/private/state\", \"hooks\", \"subagent-pending\");\n return true;\n } catch { return false; }\n}\n\nif (process.argv[2] === \"--capture-runner\") {\n if (!selectRoot(process.cwd())) process.exit(0);\n if (!(await activation?.hookPolicies?.(repositoryRoot))?.governance) process.exit(0);\n await runCaptureRunner(process.argv[3]);\n process.exit(0);\n}\nif (process.argv[2] === \"--replay-pending\") {\n if (!selectRoot(process.cwd())) process.exit(0);\n const policy = await activation?.hookPolicies?.(repositoryRoot);\n if (policy?.tracking) activation?.replayHookObservations?.(repositoryRoot);\n if (!policy?.governance) { process.stdout.write(JSON.stringify({ attempted: 0, deferred: 0, pending: 0, disabled: true })); process.exit(0); }\n const files = (await fs.readdir(pendingRoot).catch(() => []))\n .filter((name) => /^[a-f0-9]{64}\\.json$/.test(name)).sort();\n const cursorPath = resolve(pendingRoot, \".replay-cursor\");\n const cursor = await fs.readFile(cursorPath, \"utf8\").then(JSON.parse).catch(() => null);\n const start = (files.indexOf(cursor?.last) + 1) % (files.length || 1);\n const selected = [...files.slice(start), ...files.slice(0, start)].slice(0, 256);\n let attempted = 0, deferred = 0, pending = 0;\n let lastAttempted = null;\n for (const file of selected) {\n const path = resolve(pendingRoot, file);\n const receipt = await fs.readFile(path, \"utf8\").then(JSON.parse).catch(() => null);\n if (receipt?.state !== \"pending\" || !Array.isArray(receipt.capture_arguments)) continue;\n if (attempted < 3) {\n attempted++; lastAttempted = file;\n if (await replayPendingReceipt(path) === \"deferred\") deferred++;\n }\n if ((await fs.readFile(path, \"utf8\").then(JSON.parse).catch(() => null))?.state === \"pending\") pending++;\n }\n if (selected.length) await atomicSave(cursorPath, { last: lastAttempted ?? selected.at(-1) });\n process.stdout.write(JSON.stringify({ attempted, deferred, pending, uninspected: files.length - selected.length }));\n process.exit(0);\n}\n\nlet raw = \"\";\nfor await (const chunk of process.stdin) raw += chunk;\n\ntry {\n const event = JSON.parse(raw);\n activation?.recordLifecycleIngress?.(installedRoot, event, await activation?.hookPolicies?.(installedRoot));\n const cwd = activation?.canonicalHookCwd?.(event.cwd);\n if (!cwd || !selectRoot(cwd)) { process.stdout.write(JSON.stringify({})); process.exit(0); }\n const policy = await activation?.hookPolicies?.(repositoryRoot) ?? { governance: false, tracking: false, diagnostic: \"policy_module_unavailable\" };\n activation?.recordPolicyDiagnostic?.(repositoryRoot, policy);\n if (policy.tracking) activation?.recordHookObservation?.(repositoryRoot, event, policy.governance);\n if (policy.tracking && event.hook_event_name === \"SubagentStop\") activation?.replayHookObservations?.(repositoryRoot);\n if (!policy.governance) { process.stdout.write(JSON.stringify({})); process.exit(0); }\n const eventName = text(event.hook_event_name);\n activation?.recordActivation(repositoryRoot, event);\n const lifecycleEvent =\n eventName === \"SubagentStart\" ? \"start\" : eventName === \"SubagentStop\" ? \"stop\" : null;\n const session = text(event.session_id);\n const turn = text(event.turn_id);\n const agentId = text(event.agent_id);\n const agentType = text(event.agent_type);\n const model = text(event.model);\n const reasoningEffort = reasoningEffortValue(\n event.model_reasoning_effort ?? event.reasoning_effort,\n );\n const parentAgentId = text(event.parent_agent_id ?? event.parent_id);\n const parentRunId = text(event.parent_run_id ?? event.root_run_id);\n const status = terminalStatus(event.status);\n const required = [lifecycleEvent, session, turn, agentId, agentType];\n if (lifecycleEvent === null) {\n await diagnostic(\"ignored_unrecognized_event\", { eventName });\n process.exit(0);\n }\n const terminalFallback =\n lifecycleEvent === \"stop\" &&\n status !== null &&\n agentId !== null &&\n parentAgentId !== null &&\n parentRunId !== null &&\n (session === null || turn === null);\n if (\n (!terminalFallback && required.some((value) => value === null)) ||\n (lifecycleEvent === \"start\" && model === null) ||\n (lifecycleEvent === \"stop\" && status === null)\n ) {\n await fs.mkdir(pendingRoot, { recursive: true });\n const identity = JSON.stringify({ eventName, session, turn, agentId, agentType, parentAgentId, parentRunId });\n const pending = resolve(pendingRoot, createHash(\"sha256\").update(identity).digest(\"hex\") + \".json\");\n await atomicSave(pending, { schema_version: 1, state: \"pending\", last_error: \"incomplete_host_metadata\", identity: JSON.parse(identity), recovery: \"Capture observed native metadata manually; never infer completed status.\" });\n await diagnostic(\"ignored_incomplete_event\", {\n eventName,\n session,\n turn,\n agentId,\n agentType,\n missing_model: lifecycleEvent === \"start\" && model === null,\n });\n process.exit(0);\n }\n const candidates = [\n resolve(repositoryRoot, \".agents\", \"runtime\", \"bin\", \"zaip.mjs\"),\n resolve(repositoryRoot, \"packages\", \"cli\", \"dist\", \"index.js\"),\n ];\n const cli = candidates.find(existsSync);\n if (cli === undefined) {\n await diagnostic(\"cli_not_found\", { eventName, candidates });\n process.exit(0);\n }\n const captureArguments = terminalFallback\n ? [\n \"subagent\",\n \"capture-terminal\",\n \"--parent-agent-id\",\n parentAgentId,\n \"--parent-run-id\",\n parentRunId,\n \"--agent-id\",\n agentId,\n \"--agent-type\",\n agentType,\n \"--status\",\n status,\n \"--json\",\n ]\n : [\n \"subagent\",\n \"capture\",\n \"--event\",\n lifecycleEvent,\n \"--session\",\n session,\n \"--turn\",\n turn,\n \"--agent-id\",\n agentId,\n \"--agent-type\",\n agentType,\n ...(model === null ? [] : [\"--model\", model]),\n ...(reasoningEffort === null ? [] : [\"--reasoning-effort\", reasoningEffort]),\n ...(parentAgentId === null ? [] : [\"--parent-agent-id\", parentAgentId]),\n ...(lifecycleEvent !== \"stop\" || status === null ? [] : [\"--status\", status]),\n \"--json\",\n ];\n const pending = await persistPending(cli, captureArguments);\n const receipt = await fs.readFile(pending, \"utf8\").then(JSON.parse);\n if (receipt.state !== \"acknowledged\") {\n const runner = spawn(\n process.execPath,\n [hookPath, \"--capture-runner\", pending],\n {\n cwd: repositoryRoot,\n detached: true,\n windowsHide: true,\n stdio: \"ignore\",\n },\n );\n runner.once(\"error\", (error) =>\n diagnostic(\"runner_spawn_failed\", { eventName, error: error.message }),\n );\n runner.unref();\n }\n if (lifecycleEvent === \"start\") {\n process.stdout.write(JSON.stringify({\n hookSpecificOutput: {\n hookEventName: \"SubagentStart\",\n additionalContext:\n \"ZAIP Codex delegation policy: a Sub-Run is only a native collaboration subagent. Do not use create_thread or fork_thread as a Sub-Run, fallback, retry, or delegation proof; those create independent chats and require an explicit user request. If native delegation is unavailable, report the limitation rather than create an independent chat. A catalog name, task_name, title, or prompt is not native ancestry. Before retrying the same bounded dispatch, await or reuse its pending native child; capture only ancestry observed from native host spawn/terminal results or SubagentStart/SubagentStop events, and work only as a cataloged zaip-agent-NOME identity. Delegation is recursive; do not use default, worker, explorer, or ad-hoc agent types.\",\n },\n }));\n } else {\n // Codex expects one JSON object on stdout for SubagentStop as well.\n process.stdout.write(JSON.stringify({}));\n }\n} catch (error) {\n await diagnostic(\"hook_exception\", {\n error: error instanceof Error ? error.message : String(error),\n });\n}\n\nasync function atomicSave(path, value) {\n const temporary = path + \".tmp-\" + randomUUID();\n const delays = [25, 50, 75, 100, 150, 225, 300, 400, 500];\n try {\n await fs.writeFile(temporary, JSON.stringify(value), { flag: \"wx\", mode: 0o600 });\n for (let retry = 0; ; retry++) {\n try { await fs.rename(temporary, path); return; }\n catch (error) {\n if (![\"EPERM\", \"EACCES\", \"EBUSY\"].includes(error.code) || retry >= delays.length) throw error;\n await new Promise(done => setTimeout(done, delays[retry]));\n }\n }\n } finally {\n await fs.unlink(temporary).catch(() => {});\n }\n}\n\nasync function replayPendingReceipt(path) {\n const deadline = Date.now() + 2000;\n for (;;) {\n if (await runCaptureRunner(path, true) !== \"lease_busy\") return \"attempted\";\n if (Date.now() >= deadline) {\n await persistDiagnostic(\"replay_deferred_active_lease\", { receipt: path });\n return \"deferred\";\n }\n await new Promise(done => setTimeout(done, 50));\n }\n}\n\nasync function runCaptureRunner(receiptPath, replay = false) {\n if (typeof receiptPath !== \"string\" || dirname(resolve(receiptPath)) !== pendingRoot) return;\n const lockPath = receiptPath + \".lock\";\n let lease;\n try {\n lease = await fs.open(lockPath, \"wx\");\n await lease.writeFile(JSON.stringify({ pid: process.pid }));\n } catch (error) {\n if (error.code !== \"EEXIST\") return;\n const owner = await fs.readFile(lockPath, \"utf8\").then(JSON.parse).catch(() => null);\n if (!Number.isSafeInteger(owner?.pid) || owner.pid <= 0) return \"lease_busy\";\n try { process.kill(owner.pid, 0); return \"lease_busy\"; } catch (failure) { if (failure.code !== \"ESRCH\") return \"lease_busy\"; }\n // Serialize stale lock recovery so two recovering workers cannot remove a new lease.\n let recovery;\n try { recovery = await fs.open(lockPath + \".recover\", \"wx\"); } catch { return \"lease_busy\"; }\n try {\n const current = await fs.readFile(lockPath, \"utf8\").then(JSON.parse).catch(() => null);\n if (current?.pid !== owner.pid) return \"lease_busy\";\n await fs.unlink(lockPath);\n lease = await fs.open(lockPath, \"wx\");\n await lease.writeFile(JSON.stringify({ pid: process.pid }));\n } finally { await recovery.close(); await fs.unlink(lockPath + \".recover\").catch(() => {}); }\n if (!lease) return \"lease_busy\";\n }\n try {\n const receipt = await fs.readFile(receiptPath, \"utf8\").then(JSON.parse);\n if (receipt.schema_version !== 1 || receipt.state === \"acknowledged\" || (!replay && receipt.attempts >= 3)) return;\n const cli = receipt.cli, args = receipt.capture_arguments;\n const allowedCli = [resolve(repositoryRoot, \".agents/runtime/bin/zaip.mjs\"), resolve(repositoryRoot, \"packages/cli/dist/index.js\")];\n if (!allowedCli.includes(cli) || !Array.isArray(args) || !args.every(x => typeof x === \"string\") || args[0] !== \"subagent\" || ![\"capture\", \"capture-terminal\"].includes(args[1])) return;\n const digest = createHash(\"sha256\").update(JSON.stringify({ cli, arguments: args })).digest(\"hex\");\n if (resolve(pendingRoot, digest + \".json\") !== resolve(receiptPath)) return;\n const value = flag => args[args.indexOf(flag) + 1];\n const stop = args[1] === \"capture-terminal\" || value(\"--event\") === \"stop\";\n if (stop && ![\"completed\", \"failed\", \"cancelled\"].includes(value(\"--status\"))) return;\n for (let retry = 0; retry < 3; retry++) {\n receipt.attempts = (receipt.attempts ?? 0) + 1;\n receipt.updated_at = new Date().toISOString();\n await atomicSave(receiptPath, receipt);\n const outcome = await capture(cli, args);\n let result;\n try { result = JSON.parse(outcome.stdout); } catch { result = null; }\n const runId = result?.run?.run_id ?? result?.run?.id;\n const status = result?.status ?? result?.run?.status;\n if (outcome.code === 0 && result?.captured === true && typeof runId === \"string\" && runId.startsWith(\"RUN-\") && (!stop || status === value(\"--status\"))) {\n receipt.state = \"acknowledged\";\n receipt.run_id = runId;\n receipt.acknowledged_at = new Date().toISOString();\n delete receipt.last_error;\n await atomicSave(receiptPath, receipt);\n return;\n }\n receipt.last_error = outcome.error ?? (outcome.code === 0 ? \"capture_not_confirmed\" : \"capture_exit_nonzero\");\n await atomicSave(receiptPath, receipt);\n if (retry < 2) await new Promise(done => setTimeout(done, 250 * (retry + 1)));\n }\n await persistDiagnostic(\"capture_pending\", { receipt: receiptPath, attempts: receipt.attempts, error: receipt.last_error });\n } catch (error) {\n await persistDiagnostic(\"runner_exception\", { error: error instanceof Error ? error.message : String(error) });\n } finally {\n await lease?.close();\n await fs.unlink(lockPath).catch(() => {});\n }\n}\n\nasync function capture(cli, args) {\n const policy = await activation?.hookPolicies?.(repositoryRoot);\n const child = spawn(process.execPath, [cli, ...args], { cwd: repositoryRoot, windowsHide: true,\n env: { ...process.env, ZAIP_HOOK_TRACKING_ENABLED: policy?.tracking ? \"true\" : \"false\" }, stdio: [\"ignore\", \"pipe\", \"pipe\"] });\n let stdout = \"\", overflow = false;\n child.stdout.on(\"data\", chunk => { stdout += String(chunk); if (stdout.length > 262144) { overflow = true; stdout = \"\"; child.kill(); } });\n child.stderr.resume();\n return await new Promise(done => {\n let settled = false;\n const finish = result => { if (settled) return; settled = true; clearTimeout(timer); done({ ...result, stdout: overflow ? \"\" : stdout }); };\n const timer = setTimeout(() => { child.kill(); finish({ error: \"capture_timeout\" }); }, 15000);\n child.once(\"error\", () => finish({ error: \"capture_spawn_failed\" }));\n child.once(\"close\", code => finish({ code }));\n });\n}\n\nasync function persistPending(cli, captureArguments) {\n const identity = JSON.stringify({ cli, arguments: captureArguments });\n const digest = createHash(\"sha256\").update(identity).digest(\"hex\");\n const path = resolve(pendingRoot, digest + \".json\");\n await fs.mkdir(pendingRoot, { recursive: true });\n const receipt = { schema_version: 1, state: \"pending\", cli, capture_arguments: captureArguments, attempts: 0, created_at: new Date().toISOString() };\n // Publish a complete immutable initial receipt without overwriting another worker's acknowledgement.\n const temporary = path + \".tmp-\" + randomUUID();\n await fs.writeFile(temporary, JSON.stringify(receipt), { flag: \"wx\", mode: 0o600 });\n try { await fs.link(temporary, path); } catch (error) { if (error.code !== \"EEXIST\") throw error; }\n finally { await fs.unlink(temporary); }\n return path;\n}\n\nasync function persistDiagnostic(code, detail) {\n const line = `${JSON.stringify({\n source: \"zaip-subagent-lifecycle-runner\",\n code,\n occurred_at: new Date().toISOString(),\n detail,\n })}\\n`;\n await fs.mkdir(dirname(diagnosticPath), { recursive: true });\n const size = await fs.stat(diagnosticPath).then((entry) => entry.size).catch(() => 0);\n if (size + Buffer.byteLength(line) > 262_144) {\n await fs.writeFile(diagnosticPath, \"\", \"utf8\");\n }\n await fs.appendFile(diagnosticPath, line, \"utf8\");\n}\n\nasync function diagnostic(code, detail) {\n await persistDiagnostic(code, detail);\n process.stderr.write(\n `${JSON.stringify({ source: \"zaip-subagent-lifecycle\", code, detail })}\\n`,\n );\n}\n\nfunction text(value) {\n if (typeof value !== \"string\") return null;\n const normalized = value.trim();\n return normalized.length > 0 && normalized.length <= 200 ? normalized : null;\n}\n\nfunction reasoningEffortValue(value) {\n const normalized = text(value);\n return [\"low\", \"medium\", \"high\", \"xhigh\"].includes(normalized) ? normalized : null;\n}\n\nfunction terminalStatus(value) {\n const normalized = text(value);\n return [\"completed\", \"failed\", \"cancelled\"].includes(normalized) ? normalized : null;\n}\n";
2
2
  //# sourceMappingURL=codex-subagent-hook-template.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codex-subagent-hook-template.d.ts","sourceRoot":"","sources":["../../src/services/codex-subagent-hook-template.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,i1kBAiYzC,CAAC"}
1
+ {"version":3,"file":"codex-subagent-hook-template.d.ts","sourceRoot":"","sources":["../../src/services/codex-subagent-hook-template.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,6jlBAkYzC,CAAC"}
@@ -11,11 +11,11 @@ const installedRoot = resolve(dirname(hookPath), "..", "..");
11
11
  let repositoryRoot = installedRoot;
12
12
  let diagnosticPath = resolve(
13
13
  repositoryRoot,
14
- ".local",
14
+ ".agents/private/state",
15
15
  "hooks",
16
16
  "subagent-lifecycle.ndjson",
17
17
  );
18
- let pendingRoot = resolve(repositoryRoot, ".local", "hooks", "subagent-pending");
18
+ let pendingRoot = resolve(repositoryRoot, ".agents/private/state", "hooks", "subagent-pending");
19
19
 
20
20
  function inside(path, root) {
21
21
  const scoped = relative(root, resolve(path));
@@ -44,8 +44,8 @@ function selectRoot(cwd) {
44
44
  if (common(installedRoot) !== common(candidate)) return false;
45
45
  repositoryRoot = candidate;
46
46
  }
47
- diagnosticPath = resolve(repositoryRoot, ".local", "hooks", "subagent-lifecycle.ndjson");
48
- pendingRoot = resolve(repositoryRoot, ".local", "hooks", "subagent-pending");
47
+ diagnosticPath = resolve(repositoryRoot, ".agents/private/state", "hooks", "subagent-lifecycle.ndjson");
48
+ pendingRoot = resolve(repositoryRoot, ".agents/private/state", "hooks", "subagent-pending");
49
49
  return true;
50
50
  } catch { return false; }
51
51
  }
@@ -89,8 +89,9 @@ for await (const chunk of process.stdin) raw += chunk;
89
89
 
90
90
  try {
91
91
  const event = JSON.parse(raw);
92
- const cwd = text(event.cwd);
93
- if (cwd === null || !selectRoot(cwd)) process.exit(0);
92
+ activation?.recordLifecycleIngress?.(installedRoot, event, await activation?.hookPolicies?.(installedRoot));
93
+ const cwd = activation?.canonicalHookCwd?.(event.cwd);
94
+ if (!cwd || !selectRoot(cwd)) { process.stdout.write(JSON.stringify({})); process.exit(0); }
94
95
  const policy = await activation?.hookPolicies?.(repositoryRoot) ?? { governance: false, tracking: false, diagnostic: "policy_module_unavailable" };
95
96
  activation?.recordPolicyDiagnostic?.(repositoryRoot, policy);
96
97
  if (policy.tracking) activation?.recordHookObservation?.(repositoryRoot, event, policy.governance);
@@ -1 +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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiY5C,CAAC"}
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkY5C,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** A draft continuation keeps its immutable capture phase after canonical execution. */
2
+ export declare const CODEX_TASK_DELIVERY_AUTHORITY_SUPPORT: string;
3
+ //# sourceMappingURL=codex-task-delivery-authority-template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-task-delivery-authority-template.d.ts","sourceRoot":"","sources":["../../src/services/codex-task-delivery-authority-template.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,eAAO,MAAM,qCAAqC,QAiPjD,CAAC"}