@zaip-ai/cli 4.9.0 → 5.1.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 (213) hide show
  1. package/dist/services/adapter-hook-sources.d.ts +3 -0
  2. package/dist/services/adapter-hook-sources.d.ts.map +1 -1
  3. package/dist/services/adapter-hook-sources.js +3 -0
  4. package/dist/services/adapter-hook-sources.js.map +1 -1
  5. package/dist/services/adapters.d.ts +1 -1
  6. package/dist/services/adapters.d.ts.map +1 -1
  7. package/dist/services/adapters.js +5 -2
  8. package/dist/services/adapters.js.map +1 -1
  9. package/dist/services/adapters.test.js +1 -1
  10. package/dist/services/adapters.test.js.map +1 -1
  11. package/dist/services/codex-conversation-lifecycle-hook.d.ts.map +1 -1
  12. package/dist/services/codex-conversation-lifecycle-hook.js +16 -6
  13. package/dist/services/codex-conversation-lifecycle-hook.js.map +1 -1
  14. package/dist/services/codex-hook-activation.d.ts +1 -1
  15. package/dist/services/codex-hook-activation.d.ts.map +1 -1
  16. package/dist/services/codex-hook-activation.js +116 -10
  17. package/dist/services/codex-hook-activation.js.map +1 -1
  18. package/dist/services/codex-pre-tool-cli-capture-template.d.ts +2 -0
  19. package/dist/services/codex-pre-tool-cli-capture-template.d.ts.map +1 -0
  20. package/dist/services/codex-pre-tool-cli-capture-template.js +104 -0
  21. package/dist/services/codex-pre-tool-cli-capture-template.js.map +1 -0
  22. package/dist/services/codex-pre-tool-cloud-template.d.ts +2 -0
  23. package/dist/services/codex-pre-tool-cloud-template.d.ts.map +1 -0
  24. package/dist/services/codex-pre-tool-cloud-template.js +190 -0
  25. package/dist/services/codex-pre-tool-cloud-template.js.map +1 -0
  26. package/dist/services/codex-pre-tool-dependencies.test-support.d.ts +2 -0
  27. package/dist/services/codex-pre-tool-dependencies.test-support.d.ts.map +1 -0
  28. package/dist/services/codex-pre-tool-dependencies.test-support.js +9 -0
  29. package/dist/services/codex-pre-tool-dependencies.test-support.js.map +1 -0
  30. package/dist/services/codex-pre-tool-hook-fixture.test-support.d.ts +5 -0
  31. package/dist/services/codex-pre-tool-hook-fixture.test-support.d.ts.map +1 -0
  32. package/dist/services/codex-pre-tool-hook-fixture.test-support.js +19 -0
  33. package/dist/services/codex-pre-tool-hook-fixture.test-support.js.map +1 -0
  34. package/dist/services/codex-pre-tool-hook-template-bootstrap.test.d.ts +2 -0
  35. package/dist/services/codex-pre-tool-hook-template-bootstrap.test.d.ts.map +1 -0
  36. package/dist/services/codex-pre-tool-hook-template-bootstrap.test.js +107 -0
  37. package/dist/services/codex-pre-tool-hook-template-bootstrap.test.js.map +1 -0
  38. package/dist/services/codex-pre-tool-hook-template.d.ts.map +1 -1
  39. package/dist/services/codex-pre-tool-hook-template.js +96 -210
  40. package/dist/services/codex-pre-tool-hook-template.js.map +1 -1
  41. package/dist/services/codex-pre-tool-hook-template.test.js +32 -80
  42. package/dist/services/codex-pre-tool-hook-template.test.js.map +1 -1
  43. package/dist/services/codex-pre-tool-host-context-template.d.ts +2 -0
  44. package/dist/services/codex-pre-tool-host-context-template.d.ts.map +1 -0
  45. package/dist/services/codex-pre-tool-host-context-template.js +139 -0
  46. package/dist/services/codex-pre-tool-host-context-template.js.map +1 -0
  47. package/dist/services/codex-pre-tool-support-template.d.ts.map +1 -1
  48. package/dist/services/codex-pre-tool-support-template.js +61 -101
  49. package/dist/services/codex-pre-tool-support-template.js.map +1 -1
  50. package/dist/services/codex-subagent-hook-template.d.ts +1 -1
  51. package/dist/services/codex-subagent-hook-template.d.ts.map +1 -1
  52. package/dist/services/codex-subagent-hook-template.js +13 -2
  53. package/dist/services/codex-subagent-hook-template.js.map +1 -1
  54. package/dist/services/codex-validation-runtime-template.d.ts.map +1 -1
  55. package/dist/services/codex-validation-runtime-template.js +10 -4
  56. package/dist/services/codex-validation-runtime-template.js.map +1 -1
  57. package/dist/services/runtime-template-test-support.d.ts +1 -0
  58. package/dist/services/runtime-template-test-support.d.ts.map +1 -1
  59. package/dist/services/runtime-template-test-support.js +23 -2
  60. package/dist/services/runtime-template-test-support.js.map +1 -1
  61. package/dist/services/runtime-template.test.js +4 -23
  62. package/dist/services/runtime-template.test.js.map +1 -1
  63. package/package.json +1 -1
  64. package/templates/.agents/README-ENG.md +58 -7
  65. package/templates/.agents/README.md +46 -10
  66. package/templates/.agents/config/agents/discovery.json +1 -1
  67. package/templates/.agents/dashboard/.zaip-managed.json +174 -86
  68. package/templates/.agents/dashboard/apps/frontend/dist/assets/{CostCalculationGuidePage-BW7Vy1cp.js → CostCalculationGuidePage-uR-asJv_.js} +1 -1
  69. package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-Cp_hEVd8.js → DashboardHelpDialog-CngnpoLL.js} +87 -13
  70. package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-Prcs-ydy.js → PricingSettingsDialog-Bszw3ekd.js} +1 -1
  71. package/templates/.agents/dashboard/apps/frontend/dist/assets/{ProjectSettingsPage-Cu40wAFF.js → ProjectSettingsPage-IJ1znG4w.js} +1 -1
  72. package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-Bh3YBd3C.js → TraceabilityWorkspace-CsBpHqq_.js} +1 -1
  73. package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-B0Jwz_rk.js +68 -0
  74. package/templates/.agents/dashboard/apps/frontend/dist/assets/{dashboard-localization-CF7B1Hjn.js → dashboard-localization-D41g5rdo.js} +58 -7
  75. package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-DOhy6D2-.js → icons-vendor-CjGGux6h.js} +1 -1
  76. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-Bedlm0f7.js +2 -0
  77. package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-CkPC-yMz.js → react-vendor-B9jZSAKf.js} +1 -1
  78. package/templates/.agents/dashboard/apps/frontend/dist/assets/{traceability-BEdGoIDm.js → traceability-DFpwb0TN.js} +1 -1
  79. package/templates/.agents/dashboard/apps/frontend/dist/index.html +5 -5
  80. package/templates/.agents/dashboard/apps/frontend/package.json +2 -2
  81. package/templates/.agents/dashboard/apps/frontend/src/AppDashboardContent.tsx +3 -0
  82. package/templates/.agents/dashboard/apps/frontend/src/AppOverlays.tsx +16 -7
  83. package/templates/.agents/dashboard/apps/frontend/src/__tests__/app-composition-support.ts +1 -0
  84. package/templates/.agents/dashboard/apps/frontend/src/cost-period-refresh.test.ts +1 -1
  85. package/templates/.agents/dashboard/apps/frontend/src/operations-period-render.test.ts +2 -0
  86. package/templates/.agents/dashboard/apps/frontend/src/use-app-trace-documents.navigation.test.tsx +125 -0
  87. package/templates/.agents/dashboard/apps/frontend/src/use-app-trace-documents.ts +67 -9
  88. package/templates/.agents/dashboard/apps/frontend/src/use-dashboard-app-model.tsx +15 -15
  89. package/templates/.agents/dashboard/apps/frontend/src/use-dashboard-locale.ts +18 -0
  90. package/templates/.agents/dashboard/modules/cost-monitor/package.json +1 -1
  91. package/templates/.agents/dashboard/modules/cost-monitor/src/contracts.ts +10 -3
  92. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostFilters.run-page.test.ts +5 -1
  93. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostGroupsTable.period-values.test.tsx +2 -2
  94. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables-keeps-legacy-codex-identity-fields-blank.test.ts +5 -5
  95. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.test.ts +36 -43
  96. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-loaders.ts +1 -0
  97. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-table-formatters.ts +6 -4
  98. package/templates/.agents/dashboard/modules/cost-monitor/src/server/aggregate.ts +2 -2
  99. package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-projection.ts +1 -1
  100. package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-summary-projection.ts +11 -25
  101. package/templates/.agents/dashboard/modules/cost-monitor/src/server/cost-summary-defaults.ts +26 -0
  102. package/templates/.agents/dashboard/modules/operations/package.json +1 -1
  103. package/templates/.agents/dashboard/modules/operations/src/contracts.ts +11 -16
  104. package/templates/.agents/dashboard/modules/operations/src/planning-contracts.ts +14 -0
  105. package/templates/.agents/dashboard/modules/operations/src/react/DecisionTable.tsx +65 -0
  106. package/templates/.agents/dashboard/modules/operations/src/react/EntityTables.tsx +5 -71
  107. package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.tsx +4 -39
  108. package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverviewTopPanel.navigation.test.tsx +150 -0
  109. package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverviewTopPanel.tsx +7 -3
  110. package/templates/.agents/dashboard/modules/operations/src/react/OperationsPage.tsx +14 -43
  111. package/templates/.agents/dashboard/modules/operations/src/react/OperationsPageOverview.tsx +3 -0
  112. package/templates/.agents/dashboard/modules/operations/src/react/operations-overview-contract.ts +51 -0
  113. package/templates/.agents/dashboard/modules/operations/src/react/operations-overview-period-filter.test.ts +12 -3
  114. package/templates/.agents/dashboard/modules/operations/src/react/operations-page-contract.ts +1 -0
  115. package/templates/.agents/dashboard/modules/operations/src/react/use-operations-default-range.ts +16 -0
  116. package/templates/.agents/dashboard/modules/operations/src/react/use-operations-filter-sync.ts +66 -0
  117. package/templates/.agents/dashboard/modules/traceability/package.json +1 -1
  118. package/templates/.agents/dashboard/packages/branding/package.json +1 -1
  119. package/templates/.agents/dashboard/packages/contracts/package.json +1 -1
  120. package/templates/.agents/dashboard/packages/data-export/package.json +1 -1
  121. package/templates/.agents/dashboard/packages/local-runtime/dashboard-build-fingerprint.mjs +87 -0
  122. package/templates/.agents/dashboard/packages/local-runtime/dashboard-build-fingerprint.test.mjs +48 -0
  123. package/templates/.agents/dashboard/packages/local-runtime/dist/server.cjs +193 -191
  124. package/templates/.agents/dashboard/packages/local-runtime/dist/sqlite-read-model.cjs +169 -169
  125. package/templates/.agents/dashboard/packages/local-runtime/package.json +1 -1
  126. package/templates/.agents/dashboard/packages/local-runtime/scripts/build-frontend.mjs +29 -0
  127. package/templates/.agents/dashboard/packages/local-runtime/scripts/build-sqlite-runtime.mjs +5 -0
  128. package/templates/.agents/dashboard/packages/local-runtime/server.mjs +193 -191
  129. package/templates/.agents/dashboard/packages/local-runtime/src/active-capture-failure.test.ts +38 -0
  130. package/templates/.agents/dashboard/packages/local-runtime/src/active-capture-failure.ts +35 -0
  131. package/templates/.agents/dashboard/packages/local-runtime/src/active-codex-telemetry.test.ts +53 -2
  132. package/templates/.agents/dashboard/packages/local-runtime/src/active-codex-telemetry.ts +18 -1
  133. package/templates/.agents/dashboard/packages/local-runtime/src/manifest-runs.ts +8 -2
  134. package/templates/.agents/dashboard/packages/local-runtime/src/server-capture-projection-order.test.ts +118 -0
  135. package/templates/.agents/dashboard/packages/local-runtime/src/server-cost-run-search.test.ts +90 -0
  136. package/templates/.agents/dashboard/packages/local-runtime/src/server-cost-run-search.ts +86 -0
  137. package/templates/.agents/dashboard/packages/local-runtime/src/server-operations-routes.ts +8 -1
  138. package/templates/.agents/dashboard/packages/local-runtime/src/server-projection-loaders.ts +13 -0
  139. package/templates/.agents/dashboard/packages/local-runtime/src/server-projections.ts +30 -74
  140. package/templates/.agents/dashboard/packages/local-runtime/src/server-route-handlers.ts +42 -0
  141. package/templates/.agents/dashboard/packages/local-runtime/src/server-routes.test.ts +60 -0
  142. package/templates/.agents/dashboard/packages/local-runtime/src/server-run-projections.test.ts +12 -2
  143. package/templates/.agents/dashboard/packages/local-runtime/src/server-telemetry-command.test.ts +29 -4
  144. package/templates/.agents/dashboard/packages/local-runtime/src/server-telemetry-refresh.ts +7 -0
  145. package/templates/.agents/dashboard/packages/local-runtime/src/server.test.ts +51 -54
  146. package/templates/.agents/dashboard/packages/local-runtime/src/server.ts +28 -45
  147. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-filter-matrix.test.ts +5 -0
  148. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-invocation-page.test.ts +49 -0
  149. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-invocation-page.ts +44 -1
  150. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-cached-cost-page.ts +11 -10
  151. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-summary.ts +1 -1
  152. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-work-item-index.test.ts +18 -1
  153. package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-build.mjs +12 -5
  154. package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-paths.mjs +8 -0
  155. package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.test.mjs +1 -0
  156. package/templates/.agents/dashboard/packages/ui/package.json +1 -1
  157. package/templates/.agents/dashboard/tests/e2e/package.json +1 -1
  158. package/templates/.agents/dashboard/tests/e2e/qualify-top-five-trace.mjs +53 -0
  159. package/templates/.agents/dashboard/tests/e2e/verify-top-five-served.mjs +78 -0
  160. package/templates/.agents/design/.zaip-managed.json +14 -6
  161. package/templates/.agents/design/apps/catalog/dist/assets/index-BGxXxXTo.js +72 -0
  162. package/templates/.agents/design/apps/catalog/dist/index.html +1 -1
  163. package/templates/.agents/design/apps/catalog/package.json +1 -1
  164. package/templates/.agents/design/apps/catalog/src/components/TopEntitiesSpecimen.tsx +45 -0
  165. package/templates/.agents/design/apps/catalog/src/pages/ComponentsPage.tsx +3 -1
  166. package/templates/.agents/design/apps/catalog/src/stories/Components.stories.tsx +2 -0
  167. package/templates/.agents/design/packages/local-runtime/package.json +1 -1
  168. package/templates/.agents/requirements/autonomous-assurance.md +11 -2
  169. package/templates/.agents/requirements/cloud-hostinger-autonomy.md +1 -1
  170. package/templates/.agents/requirements/comparative-audit.md +1 -1
  171. package/templates/.agents/requirements/context-engine.md +1 -1
  172. package/templates/.agents/requirements/cost-observability.md +1 -1
  173. package/templates/.agents/requirements/dashboard-launch.md +1 -1
  174. package/templates/.agents/requirements/data-export.md +1 -1
  175. package/templates/.agents/requirements/design-system.md +1 -1
  176. package/templates/.agents/requirements/execution-engine.md +1 -1
  177. package/templates/.agents/requirements/kanban-dashboard.md +1 -1
  178. package/templates/.agents/requirements/model-orchestration.md +1 -1
  179. package/templates/.agents/requirements/public-distribution.md +1 -1
  180. package/templates/.agents/requirements/software-architecture.md +1 -1
  181. package/templates/.agents/requirements/strategic-improvements.md +1 -1
  182. package/templates/.agents/requirements/work-lifecycle.md +2 -1
  183. package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
  184. package/templates/.agents/rules/run-lifecycle-closure.md +2 -1
  185. package/templates/.agents/rules/workflow.md +1 -0
  186. package/templates/.agents/runtime/VERSION +1 -1
  187. package/templates/.agents/runtime/bin/zaip.mjs +1178 -764
  188. package/templates/.agents/runtime/checksums.sha256 +6 -6
  189. package/templates/.agents/runtime/manifest.json +1 -1
  190. package/templates/.agents/runtime/pnpm-lock.sha256 +1 -1
  191. package/templates/.agents/runtime/provenance.json +5 -5
  192. package/templates/.agents/runtime/sbom.cdx.json +59 -59
  193. package/templates/.agents/skills/zaip-skill-execution/SKILL.md +1 -1
  194. package/templates/.agents/skills/zaip-skill-execution/references/controlled-release-recovery.md +14 -0
  195. package/templates/.agents/skills/zaip-skill-execution/references/runtime-governance.md +1 -1
  196. package/templates/.agents/skills/zaip-skill-github-deploy/SKILL.md +5 -1
  197. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract-cli.test.mjs +53 -0
  198. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract.mjs +12 -0
  199. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract.test.mjs +26 -32
  200. package/templates/.agents/skills/zaip-skill-maintenance-enter/SKILL.md +23 -0
  201. package/templates/.agents/skills/zaip-skill-maintenance-enter/agents/openai.yaml +4 -0
  202. package/templates/.agents/skills/zaip-skill-maintenance-enter/scripts/maintenance.mjs +213 -0
  203. package/templates/.agents/skills/zaip-skill-maintenance-enter/scripts/maintenance.test.mjs +207 -0
  204. package/templates/.agents/skills/zaip-skill-maintenance-exit/SKILL.md +21 -0
  205. package/templates/.agents/skills/zaip-skill-maintenance-exit/agents/openai.yaml +4 -0
  206. package/templates/.agents/skills/zaip-skill-release-qualification/SKILL.md +2 -0
  207. package/templates/.agents/skills/zaip-skill-release-qualification/references/local-preparation.md +37 -8
  208. package/templates/.agents/zaip-aios/VERSION +1 -1
  209. package/templates/.agents/zaip-aios/guides/10-seguranca.md +2 -2
  210. package/templates/.agents/zaip-aios/guides/26-qualidade-e-release.md +38 -0
  211. package/templates/template-manifest.json +259 -135
  212. package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-Co2Jiuzh.js +0 -68
  213. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-qVSJnJ0_.js +0 -2
@@ -0,0 +1,190 @@
1
+ export const CODEX_PRE_TOOL_CLOUD_HOOK = String.raw `import { readFile } from "node:fs/promises";
2
+ import { resolve } from "node:path";
3
+
4
+ export function createCloudValidators({ tokenizeLiteralCommand, deny, repositoryRoot, isWithinRepository, cloudRunnerScript, cloudContractPath, cloudOperationProviders }) {
5
+ function optionMap(tokens) {
6
+ if (tokens.length % 2 !== 0) return null;
7
+ const values = new Map();
8
+ for (let index = 0; index < tokens.length; index += 2) {
9
+ const key = tokens[index];
10
+ const value = tokens[index + 1];
11
+ if (!key.startsWith("--") || value.startsWith("--") || values.has(key)) return null;
12
+ values.set(key, value);
13
+ }
14
+ return values;
15
+ }
16
+
17
+ function requireExactOptions(options, allowed, required) {
18
+ if ([...options.keys()].some((key) => !allowed.has(key))) return false;
19
+ return [...required].every((key) => typeof options.get(key) === "string" && options.get(key).length > 0);
20
+ }
21
+
22
+ function isStringArray(value) {
23
+ return Array.isArray(value) && value.every((item) => typeof item === "string" && item.length > 0);
24
+ }
25
+
26
+ async function readCloudContract(options) {
27
+ if (options.get("--contract") !== cloudContractPath) {
28
+ deny("Cloud runner must use the canonical autonomous-cloud contract path.");
29
+ }
30
+ const absolute = resolve(repositoryRoot, cloudContractPath);
31
+ if (!isWithinRepository(absolute)) deny("Cloud runner contract escapes the repository boundary.");
32
+ let contract;
33
+ try {
34
+ contract = JSON.parse(await readFile(absolute, "utf8"));
35
+ } catch {
36
+ deny("Cloud runner contract is absent or malformed.");
37
+ }
38
+ if (
39
+ contract === null ||
40
+ typeof contract !== "object" ||
41
+ contract.version !== 1 ||
42
+ contract.profile !== "autonomous-cloud" ||
43
+ contract.cloudflare === null ||
44
+ typeof contract.cloudflare !== "object" ||
45
+ contract.hostinger === null ||
46
+ typeof contract.hostinger !== "object"
47
+ ) {
48
+ deny("Cloud runner contract has no valid autonomous-cloud profile.");
49
+ }
50
+ return contract;
51
+ }
52
+
53
+ function cloudflareTargetMatches(contract, options, operation) {
54
+ const cloudflare = contract.cloudflare;
55
+ const record = options.get("--dns-record");
56
+ const managed = isStringArray(cloudflare.dns_records) && cloudflare.dns_records.includes(record);
57
+ const direct = cloudflare.direct_dns_records !== null && typeof cloudflare.direct_dns_records === "object" && Object.hasOwn(cloudflare.direct_dns_records, record);
58
+ return (
59
+ typeof cloudflare.account_id === "string" &&
60
+ typeof cloudflare.zone_id === "string" &&
61
+ isStringArray(cloudflare.allowed_operations) &&
62
+ cloudflare.account_id === options.get("--account-id") &&
63
+ cloudflare.zone_id === options.get("--zone-id") &&
64
+ cloudflare.allowed_operations.includes(operation) &&
65
+ (operation === "cloudflare:dns:read" ? managed || direct : direct && !managed)
66
+ );
67
+ }
68
+
69
+ function hostingerTargetMatches(contract, options, operation) {
70
+ const hostinger = contract.hostinger;
71
+ const role = options.get("--vps-role");
72
+ if (
73
+ typeof hostinger.account_id !== "string" ||
74
+ !isStringArray(hostinger.allowed_operations) ||
75
+ hostinger.account_id !== options.get("--account-id") ||
76
+ !hostinger.allowed_operations.includes(operation) ||
77
+ (role !== "edge" && role !== "application") ||
78
+ hostinger.vps === null ||
79
+ typeof hostinger.vps !== "object"
80
+ ) {
81
+ return false;
82
+ }
83
+ const target = hostinger.vps[role];
84
+ if (target === null || typeof target !== "object") return false;
85
+
86
+ if (typeof target.id !== "string" || target.id !== options.get("--vps-id")) return false;
87
+ if (operation.startsWith("hostinger:ssh:")) {
88
+ return typeof target.host_key_sha256 === "string" && target.host_key_sha256 === options.get("--host-key-sha256");
89
+ }
90
+ return true;
91
+ }
92
+
93
+ function terraformTargetMatches(contract, options, operation) {
94
+ const terraform = contract.terraform;
95
+ if (
96
+ terraform === null ||
97
+ typeof terraform !== "object" ||
98
+ !isStringArray(terraform.allowed_operations) ||
99
+ !terraform.allowed_operations.includes(operation)
100
+ ) return false;
101
+ if (operation === "terraform:plan") return terraform.working_directory === options.get("--terraform-directory");
102
+ if (operation === "terraform:apply") {
103
+ const plan = terraform.plan;
104
+ return plan !== null && typeof plan === "object" && typeof plan.path === "string" && typeof plan.sha256 === "string" && typeof plan.policy_result_sha256 === "string" && plan.path === options.get("--plan-path") && plan.sha256 === options.get("--plan-sha256") && plan.policy_result_sha256 === options.get("--policy-result-sha256");
105
+ }
106
+ return terraform.import_targets !== null && typeof terraform.import_targets === "object" && terraform.import_targets[options.get("--resource-address")] === options.get("--resource-id");
107
+ }
108
+
109
+ function validateDirectCloudProviderMutation(command) {
110
+ const tokens = tokenizeLiteralCommand(command);
111
+ if (/^(?:node|node\.exe)$/i.test(tokens?.[0] ?? "") && tokens?.[1] === cloudRunnerScript) return;
112
+ if (/\bterraform(?:\.exe)?\s+(?:apply|destroy|import)\b/i.test(command)) deny("Direct Terraform mutation is blocked; use the contract-bound cloud runner.");
113
+ const provider = /^(?:wrangler|cloudflare|hostinger)(?:\.exe|\.cmd|\.js|\.mjs)?$/i;
114
+ const wrapperProvider = /^(?:wrangler|cloudflare|hostinger)(?:\.exe|\.cmd|\.js|\.mjs|@[A-Za-z0-9][A-Za-z0-9._-]*)?$/i;
115
+ const base = (token) => token?.split(/[\\/]/).at(-1) ?? "";
116
+ if (tokens === null) {
117
+ // Complex shell syntax stays fail-closed; literal arguments are inspected as tokens below.
118
+ if (/\b(?:wrangler|cloudflare|hostinger)(?:\.exe)?\b/i.test(command)) deny("Direct Cloudflare or Hostinger commands are blocked; use the contract-bound cloud runner.");
119
+ return;
120
+ }
121
+ let index = 0;
122
+ const launcher = base(tokens[0]);
123
+ if (/^(?:npx|pnpm|npm|yarn|bunx)(?:\.cmd|\.exe)?$/i.test(launcher)) {
124
+ // Package-manager options can move the executable. Inspect exact provider
125
+ // tokens across this recognized wrapper; paths and document names remain inert.
126
+ if (tokens.slice(1).some((token) => wrapperProvider.test(token))) deny("Direct Cloudflare or Hostinger commands are blocked; use the contract-bound cloud runner.");
127
+ index = 1;
128
+ if (/^npx(?:\.cmd|\.exe)?$/i.test(launcher) && /^(?:--yes|-y)$/.test(tokens[index] ?? "")) index += 1;
129
+ if (/^pnpm(?:\.cmd|\.exe)?$/i.test(launcher) && /^(?:--filter|--dir)$/.test(tokens[index] ?? "") && tokens[index + 1]) index += 2;
130
+ if (/^(?:exec|dlx)$/.test(tokens[index] ?? "")) index += 1;
131
+ if (tokens[index] === "--") index += 1;
132
+ if (/^(?:exec|dlx)$/.test(tokens[index] ?? "")) index += 1;
133
+ } else if (/^(?:node|node\.exe)$/i.test(launcher)) index = 1;
134
+ else if (/^(?:powershell|pwsh|cmd|bash|sh)(?:\.exe)?$/i.test(launcher)) {
135
+ if (/\b(?:wrangler|cloudflare|hostinger)(?:\.exe)?\b/i.test(command)) deny("Direct Cloudflare or Hostinger commands are blocked; use the contract-bound cloud runner.");
136
+ return;
137
+ }
138
+ if (provider.test(base(tokens[index]))) deny("Direct Cloudflare or Hostinger commands are blocked; use the contract-bound cloud runner.");
139
+ }
140
+
141
+ async function validateCloudRunner(command) {
142
+ const tokens = tokenizeLiteralCommand(command);
143
+ if (tokens === null || tokens.length < 2 || !/^(?:node|node\.exe)$/i.test(tokens[0]) || tokens[1] !== cloudRunnerScript) {
144
+ return false;
145
+ }
146
+ const options = optionMap(tokens.slice(2));
147
+ if (options === null) deny("Cloud runner requires literal, named arguments.");
148
+ const operation = options.get("--operation");
149
+ if (operation === "contract:derive") {
150
+ if (!requireExactOptions(options, new Set(["--operation", "--credentials-source"]), new Set(["--operation", "--credentials-source"]))) {
151
+ deny("Cloud contract derivation has unrecognized arguments.");
152
+ }
153
+ if (options.get("--credentials-source") !== "root") {
154
+ deny("Cloud contract derivation requires the selected root credential source.");
155
+ }
156
+ return true;
157
+ }
158
+ const provider = cloudOperationProviders.get(operation);
159
+ if (provider === undefined) deny("Cloud runner operation is unrecognized or destructive.");
160
+ const common = new Set(["--contract", "--operation", "--provider", "--account-id", "--credentials-source", "--zone-id", "--dns-record", "--vps-role", "--vps-id", "--host-key-sha256", "--terraform-directory", "--plan-path", "--plan-sha256", "--policy-result-sha256", "--resource-address", "--resource-id"]);
161
+ const baseRequired = provider === "terraform"
162
+ ? new Set(["--contract", "--operation", "--credentials-source"])
163
+ : new Set(["--contract", "--operation", "--provider", "--account-id", "--credentials-source"]);
164
+ if (!requireExactOptions(options, common, baseRequired)) {
165
+ deny("Cloud runner invocation has unrecognized arguments.");
166
+ }
167
+ if ((provider !== "terraform" && options.get("--provider") !== provider) || !["root", "agents"].includes(options.get("--credentials-source"))) {
168
+ deny("Cloud runner provider or credential source is outside the approved contract.");
169
+ }
170
+ const contract = await readCloudContract(options);
171
+ const valid = provider === "cloudflare"
172
+ ? requireExactOptions(options, common, new Set(["--contract", "--operation", "--provider", "--account-id", "--credentials-source", "--zone-id", "--dns-record"])) && cloudflareTargetMatches(contract, options, operation)
173
+ : provider === "hostinger"
174
+ ? requireExactOptions(options, common, new Set(["--contract", "--operation", "--provider", "--account-id", "--credentials-source", "--vps-role"])) && hostingerTargetMatches(contract, options, operation)
175
+ : requireExactOptions(
176
+ options,
177
+ common,
178
+ operation === "terraform:plan"
179
+ ? new Set(["--contract", "--operation", "--credentials-source", "--terraform-directory"])
180
+ : operation === "terraform:apply"
181
+ ? new Set(["--contract", "--operation", "--credentials-source", "--plan-path", "--plan-sha256", "--policy-result-sha256"])
182
+ : new Set(["--contract", "--operation", "--credentials-source", "--resource-address", "--resource-id"]),
183
+ ) && terraformTargetMatches(contract, options, operation);
184
+ if (!valid) deny("Cloud runner target, operation, or host identity is outside the approved contract.");
185
+ return true;
186
+ }
187
+ return { validateCloudRunner, validateDirectCloudProviderMutation };
188
+ }
189
+ `;
190
+ //# sourceMappingURL=codex-pre-tool-cloud-template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-pre-tool-cloud-template.js","sourceRoot":"","sources":["../../src/services/codex-pre-tool-cloud-template.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4LlD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function writePreToolDependencies(write: (file: string, content: string) => Promise<void>): Promise<void>;
2
+ //# sourceMappingURL=codex-pre-tool-dependencies.test-support.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-pre-tool-dependencies.test-support.d.ts","sourceRoot":"","sources":["../../src/services/codex-pre-tool-dependencies.test-support.ts"],"names":[],"mappings":"AAIA,wBAAsB,wBAAwB,CAC5C,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GACtD,OAAO,CAAC,IAAI,CAAC,CAIf"}
@@ -0,0 +1,9 @@
1
+ import { CODEX_PRE_TOOL_CLOUD_HOOK } from "./codex-pre-tool-cloud-template.js";
2
+ import { CODEX_PRE_TOOL_HOST_CONTEXT_HOOK } from "./codex-pre-tool-host-context-template.js";
3
+ import { CODEX_PRE_TOOL_CLI_CAPTURE_HOOK } from "./codex-pre-tool-cli-capture-template.js";
4
+ export async function writePreToolDependencies(write) {
5
+ await write("zaip-pre-tool-cloud.mjs", CODEX_PRE_TOOL_CLOUD_HOOK);
6
+ await write("zaip-pre-tool-host-context.mjs", CODEX_PRE_TOOL_HOST_CONTEXT_HOOK);
7
+ await write("zaip-pre-tool-cli-capture.mjs", CODEX_PRE_TOOL_CLI_CAPTURE_HOOK);
8
+ }
9
+ //# sourceMappingURL=codex-pre-tool-dependencies.test-support.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-pre-tool-dependencies.test-support.js","sourceRoot":"","sources":["../../src/services/codex-pre-tool-dependencies.test-support.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAC;AAE3F,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,KAAuD;IAEvD,MAAM,KAAK,CAAC,yBAAyB,EAAE,yBAAyB,CAAC,CAAC;IAClE,MAAM,KAAK,CAAC,gCAAgC,EAAE,gCAAgC,CAAC,CAAC;IAChF,MAAM,KAAK,CAAC,+BAA+B,EAAE,+BAA+B,CAAC,CAAC;AAChF,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare function installPreToolHook(root: string): Promise<{
2
+ hooks: string;
3
+ hookPath: string;
4
+ }>;
5
+ //# sourceMappingURL=codex-pre-tool-hook-fixture.test-support.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-pre-tool-hook-fixture.test-support.d.ts","sourceRoot":"","sources":["../../src/services/codex-pre-tool-hook-fixture.test-support.ts"],"names":[],"mappings":"AAQA,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM;;;GAUpD"}
@@ -0,0 +1,19 @@
1
+ import { mkdir, writeFile } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+ import { CODEX_HOOK_ACTIVATION } from "./codex-hook-activation.js";
4
+ import { CODEX_NATIVE_TOOL_AUTHORITY_HOOK } from "./codex-native-tool-authority-template.js";
5
+ import { writePreToolDependencies } from "./codex-pre-tool-dependencies.test-support.js";
6
+ import { CODEX_PRE_TOOL_HOOK } from "./codex-pre-tool-hook-template.js";
7
+ import { CODEX_PRE_TOOL_SUPPORT_HOOK } from "./codex-pre-tool-support-template.js";
8
+ export async function installPreToolHook(root) {
9
+ const hooks = join(root, ".codex", "hooks");
10
+ await mkdir(hooks, { recursive: true });
11
+ const hookPath = join(hooks, "zaip-pre-tool-use.mjs");
12
+ await writeFile(hookPath, CODEX_PRE_TOOL_HOOK);
13
+ await writeFile(join(hooks, "zaip-hook-activation.mjs"), CODEX_HOOK_ACTIVATION);
14
+ await writeFile(join(hooks, "zaip-pre-tool-support.mjs"), CODEX_PRE_TOOL_SUPPORT_HOOK);
15
+ await writePreToolDependencies((file, content) => writeFile(join(hooks, file), content));
16
+ await writeFile(join(hooks, "zaip-native-tool-authority.mjs"), CODEX_NATIVE_TOOL_AUTHORITY_HOOK);
17
+ return { hooks, hookPath };
18
+ }
19
+ //# sourceMappingURL=codex-pre-tool-hook-fixture.test-support.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-pre-tool-hook-fixture.test-support.js","sourceRoot":"","sources":["../../src/services/codex-pre-tool-hook-fixture.test-support.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,EAAE,wBAAwB,EAAE,MAAM,+CAA+C,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAEnF,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAAY;IACnD,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC5C,MAAM,KAAK,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACxC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE,uBAAuB,CAAC,CAAC;IACtD,MAAM,SAAS,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC;IAC/C,MAAM,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,0BAA0B,CAAC,EAAE,qBAAqB,CAAC,CAAC;IAChF,MAAM,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,2BAA2B,CAAC,EAAE,2BAA2B,CAAC,CAAC;IACvF,MAAM,wBAAwB,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IACzF,MAAM,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,gCAAgC,CAAC,EAAE,gCAAgC,CAAC,CAAC;IACjG,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAC7B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=codex-pre-tool-hook-template-bootstrap.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-pre-tool-hook-template-bootstrap.test.d.ts","sourceRoot":"","sources":["../../src/services/codex-pre-tool-hook-template-bootstrap.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,107 @@
1
+ import { spawnSync } from "node:child_process";
2
+ import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
3
+ import { homedir, tmpdir } from "node:os";
4
+ import { join } from "node:path";
5
+ import { afterEach, expect, it } from "vitest";
6
+ import { CODEX_HOOK_ACTIVATION } from "./codex-hook-activation.js";
7
+ import { CODEX_NATIVE_TOOL_AUTHORITY_HOOK } from "./codex-native-tool-authority-template.js";
8
+ import { CODEX_PRE_TOOL_HOOK } from "./codex-pre-tool-hook-template.js";
9
+ import { CODEX_PRE_TOOL_SUPPORT_HOOK } from "./codex-pre-tool-support-template.js";
10
+ import { writePreToolDependencies } from "./codex-pre-tool-dependencies.test-support.js";
11
+ const roots = [];
12
+ afterEach(async () => {
13
+ await Promise.all(roots.splice(0).map((root) => rm(root, { recursive: true, force: true })));
14
+ });
15
+ it("allows explicit acceptance arguments before Task capture without allowing writes", async () => {
16
+ const root = await mkdtemp(join(tmpdir(), "zaip-cli-bootstrap-hook-"));
17
+ roots.push(root);
18
+ await mkdir(join(root, ".agents", "config"), { recursive: true });
19
+ await writeFile(join(root, ".agents", "config", "project.yaml"), "zaip:\n enabled: true\ntracking:\n enabled: false\n");
20
+ const hooks = join(root, ".codex", "hooks");
21
+ await mkdir(hooks, { recursive: true });
22
+ await writeFile(join(hooks, "zaip-pre-tool-use.mjs"), CODEX_PRE_TOOL_HOOK);
23
+ await writeFile(join(hooks, "zaip-hook-activation.mjs"), CODEX_HOOK_ACTIVATION);
24
+ await writeFile(join(hooks, "zaip-pre-tool-support.mjs"), CODEX_PRE_TOOL_SUPPORT_HOOK);
25
+ await writePreToolDependencies((file, content) => writeFile(join(hooks, file), content));
26
+ await writeFile(join(hooks, "zaip-native-tool-authority.mjs"), CODEX_NATIVE_TOOL_AUTHORITY_HOOK);
27
+ const invoke = (cmd) => spawnSync(process.execPath, [join(hooks, "zaip-pre-tool-use.mjs")], {
28
+ cwd: root,
29
+ encoding: "utf8",
30
+ windowsHide: true,
31
+ env: { ...process.env, CODEX_THREAD_ID: "bootstrap-thread", CODEX_TURN_ID: "bootstrap-turn" },
32
+ input: JSON.stringify({
33
+ cwd: root,
34
+ session_id: "bootstrap-thread",
35
+ turn_id: "bootstrap-turn",
36
+ tool_use_id: "bootstrap-tool",
37
+ tool_name: "exec_command",
38
+ tool_input: { cmd },
39
+ }),
40
+ });
41
+ const result = invoke("node .agents/runtime/bin/zaip.mjs conversation start --intent new-work --acceptance AC-WORK-001-09 --json");
42
+ expect(result.status, result.stderr).toBe(0);
43
+ const output = JSON.parse(result.stdout).hookSpecificOutput;
44
+ expect(output.permissionDecision, result.stdout).toBe("allow");
45
+ expect(output.updatedInput.cmd).toContain("--codex-hook-id=");
46
+ for (const cmd of [
47
+ "ac src/a.ts payload",
48
+ "AC src/a.ts payload",
49
+ "(Set-Content -LiteralPath src/a.ts -Value code)",
50
+ "Write-Output (Set-Content -LiteralPath src/a.ts -Value code)",
51
+ "env cp src/a.ts src/b.ts",
52
+ "exec cp src/a.ts src/b.ts",
53
+ "FOO=1 cp src/a.ts src/b.ts",
54
+ "unknown-wrapper ac src/a.ts payload",
55
+ ".\\echo.cmd ac src/a.ts payload",
56
+ ".\\node.cmd .agents/runtime/bin/zaip.mjs conversation start --acceptance AC-WORK-001-09",
57
+ "echo.cmd ac src/a.ts payload",
58
+ "node.cmd .agents/runtime/bin/zaip.mjs conversation start --acceptance AC-WORK-001-09",
59
+ "node scripts/unknown.mjs --acceptance AC-WORK-001-09",
60
+ "command ac src/a.ts payload",
61
+ ".\\sed.exe -i s/a/b/ src/a.ts",
62
+ ".\\sed.exe -f script.sed src/input.ts",
63
+ "git apply patch.diff",
64
+ "node scripts/read.mjs --acceptance AC-WORK-001-09; ac src/a.ts payload",
65
+ "node scripts/read.mjs > src/a.ts",
66
+ ]) {
67
+ const blocked = invoke(cmd);
68
+ expect(blocked.status, blocked.stderr).toBe(0);
69
+ expect(JSON.parse(blocked.stdout).hookSpecificOutput.permissionDecision).toBe("deny");
70
+ }
71
+ });
72
+ it("denies a configured project when the activation module is missing", async () => {
73
+ const root = await mkdtemp(join(tmpdir(), "zaip-cli-missing-activation-"));
74
+ roots.push(root);
75
+ await mkdir(join(root, ".agents", "config"), { recursive: true });
76
+ await writeFile(join(root, ".agents", "config", "project.yaml"), "zaip:\n enabled: true\n");
77
+ const hooks = join(root, ".codex", "hooks");
78
+ await mkdir(hooks, { recursive: true });
79
+ await writeFile(join(hooks, "zaip-pre-tool-use.mjs"), CODEX_PRE_TOOL_HOOK);
80
+ await writeFile(join(hooks, "zaip-pre-tool-support.mjs"), CODEX_PRE_TOOL_SUPPORT_HOOK);
81
+ await writePreToolDependencies((file, content) => writeFile(join(hooks, file), content));
82
+ await writeFile(join(hooks, "zaip-native-tool-authority.mjs"), CODEX_NATIVE_TOOL_AUTHORITY_HOOK);
83
+ const invoke = () => spawnSync(process.execPath, [join(hooks, "zaip-pre-tool-use.mjs")], {
84
+ cwd: root,
85
+ encoding: "utf8",
86
+ windowsHide: true,
87
+ input: JSON.stringify({
88
+ cwd: root,
89
+ tool_name: "apply_patch",
90
+ tool_input: { command: "*** Begin Patch\n*** Add File: src/code.ts\n+ok\n*** End Patch" },
91
+ }),
92
+ });
93
+ const result = invoke();
94
+ expect(result.status, result.stderr).toBe(0);
95
+ expect(JSON.parse(result.stdout).hookSpecificOutput).toMatchObject({
96
+ permissionDecision: "deny",
97
+ permissionDecisionReason: expect.stringContaining("activation module is unavailable"),
98
+ });
99
+ const config = join(root, ".agents", "config", "project.yaml");
100
+ await writeFile(config, "zaip:\n enabled: false\n");
101
+ expect(invoke().stdout).toBe("{}\n");
102
+ await writeFile(config, 'zaip:\n enabled: "false"\n');
103
+ expect(JSON.parse(invoke().stdout).hookSpecificOutput.permissionDecision).toBe("deny");
104
+ await rm(config);
105
+ expect(invoke().stdout).toBe("{}\n");
106
+ });
107
+ //# sourceMappingURL=codex-pre-tool-hook-template-bootstrap.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-pre-tool-hook-template-bootstrap.test.js","sourceRoot":"","sources":["../../src/services/codex-pre-tool-hook-template-bootstrap.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,KA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AE,EAAE,OAAO,EAAE,gEAAgE,EAAE;SAC1F,CAAC;KACH,CAAC,CAAC;IACL,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7C,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,kBAAkB,CAAC,CAAC,aAAa,CAAC;QACjE,kBAAkB,EAAE,MAAM;QAC1B,wBAAwB,EAAE,MAAM,CAAC,gBAAgB,CAAC,kCAAkC,CAAC;KACtF,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;IAC/D,MAAM,SAAS,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAC;IACrD,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACrC,MAAM,SAAS,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAC;IACvD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvF,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC;IACjB,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"codex-pre-tool-hook-template.d.ts","sourceRoot":"","sources":["../../src/services/codex-pre-tool-hook-template.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,QAiuB/B,CAAC"}
1
+ {"version":3,"file":"codex-pre-tool-hook-template.d.ts","sourceRoot":"","sources":["../../src/services/codex-pre-tool-hook-template.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,QA+mB/B,CAAC"}