@zaip-ai/cli 4.8.0 → 5.0.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 (195) 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 +152 -190
  40. package/dist/services/codex-pre-tool-hook-template.js.map +1 -1
  41. package/dist/services/codex-pre-tool-hook-template.test.js +63 -75
  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 +77 -100
  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 +59 -15
  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 +37 -10
  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 +7 -24
  62. package/dist/services/runtime-template.test.js.map +1 -1
  63. package/package.json +1 -1
  64. package/templates/.agents/README-ENG.md +49 -7
  65. package/templates/.agents/README.md +41 -10
  66. package/templates/.agents/config/agents/discovery.json +1 -1
  67. package/templates/.agents/dashboard/.zaip-managed.json +125 -73
  68. package/templates/.agents/dashboard/apps/frontend/dist/assets/{CostCalculationGuidePage-BW7Vy1cp.js → CostCalculationGuidePage-w6pjt4OM.js} +1 -1
  69. package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-BN8KQPrr.js → DashboardHelpDialog-DhlntQcR.js} +117 -17
  70. package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-Prcs-ydy.js → PricingSettingsDialog-BHoZT2an.js} +1 -1
  71. package/templates/.agents/dashboard/apps/frontend/dist/assets/{ProjectSettingsPage-HqGUImIG.js → ProjectSettingsPage-IcncIZ9Y.js} +1 -1
  72. package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-CNpmQMO4.js → TraceabilityWorkspace-C6rORjpr.js} +1 -1
  73. package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-uPnOBShc.js +68 -0
  74. package/templates/.agents/dashboard/apps/frontend/dist/assets/{dashboard-localization-CF7B1Hjn.js → dashboard-localization-DWXjEIgc.js} +49 -7
  75. package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-DOhy6D2-.js → icons-vendor-Hc9fp_gs.js} +1 -1
  76. package/templates/.agents/dashboard/apps/frontend/dist/assets/{index-DX65Ufuu.js → index-BqeOEZW5.js} +2 -2
  77. package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-CkPC-yMz.js → react-vendor-C9ta_O10.js} +1 -1
  78. package/templates/.agents/dashboard/apps/frontend/dist/assets/{traceability-BEdGoIDm.js → traceability-IcefoTOv.js} +1 -1
  79. package/templates/.agents/dashboard/apps/frontend/dist/index.html +5 -5
  80. package/templates/.agents/dashboard/apps/frontend/package.json +1 -1
  81. package/templates/.agents/dashboard/modules/cost-monitor/package.json +1 -1
  82. package/templates/.agents/dashboard/modules/cost-monitor/src/contracts.ts +10 -3
  83. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostFilters.run-page.test.ts +5 -1
  84. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostGroupsTable.period-values.test.tsx +2 -2
  85. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables-keeps-legacy-codex-identity-fields-blank.test.ts +5 -5
  86. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.test.ts +36 -43
  87. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-loaders.ts +1 -0
  88. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-table-formatters.ts +6 -4
  89. package/templates/.agents/dashboard/modules/cost-monitor/src/server/aggregate.ts +2 -2
  90. package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-projection.ts +1 -1
  91. package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-summary-projection.ts +11 -25
  92. package/templates/.agents/dashboard/modules/cost-monitor/src/server/cost-summary-defaults.ts +26 -0
  93. package/templates/.agents/dashboard/modules/operations/package.json +1 -1
  94. package/templates/.agents/dashboard/modules/operations/src/contracts.ts +11 -16
  95. package/templates/.agents/dashboard/modules/operations/src/planning-contracts.ts +14 -0
  96. package/templates/.agents/dashboard/modules/operations/src/react/DecisionTable.tsx +65 -0
  97. package/templates/.agents/dashboard/modules/operations/src/react/EntityTables.tsx +5 -71
  98. package/templates/.agents/dashboard/modules/operations/src/react/OperationsPage.tsx +10 -36
  99. package/templates/.agents/dashboard/modules/operations/src/react/operations-overview-period-filter.test.ts +7 -2
  100. package/templates/.agents/dashboard/modules/operations/src/react/use-operations-filter-sync.ts +66 -0
  101. package/templates/.agents/dashboard/modules/traceability/package.json +1 -1
  102. package/templates/.agents/dashboard/packages/branding/package.json +1 -1
  103. package/templates/.agents/dashboard/packages/contracts/package.json +1 -1
  104. package/templates/.agents/dashboard/packages/data-export/package.json +1 -1
  105. package/templates/.agents/dashboard/packages/local-runtime/dist/server.cjs +229 -222
  106. package/templates/.agents/dashboard/packages/local-runtime/dist/sqlite-read-model.cjs +167 -167
  107. package/templates/.agents/dashboard/packages/local-runtime/package.json +3 -3
  108. package/templates/.agents/dashboard/packages/local-runtime/server.mjs +229 -222
  109. package/templates/.agents/dashboard/packages/local-runtime/src/active-capture-failure.test.ts +38 -0
  110. package/templates/.agents/dashboard/packages/local-runtime/src/active-capture-failure.ts +35 -0
  111. package/templates/.agents/dashboard/packages/local-runtime/src/active-codex-telemetry.test.ts +69 -6
  112. package/templates/.agents/dashboard/packages/local-runtime/src/active-codex-telemetry.ts +62 -15
  113. package/templates/.agents/dashboard/packages/local-runtime/src/manifest-runs.ts +8 -2
  114. package/templates/.agents/dashboard/packages/local-runtime/src/server-capture-projection-order.test.ts +118 -0
  115. package/templates/.agents/dashboard/packages/local-runtime/src/server-cost-run-search.test.ts +90 -0
  116. package/templates/.agents/dashboard/packages/local-runtime/src/server-cost-run-search.ts +86 -0
  117. package/templates/.agents/dashboard/packages/local-runtime/src/server-operations-routes.ts +8 -1
  118. package/templates/.agents/dashboard/packages/local-runtime/src/server-projection-loaders.ts +13 -0
  119. package/templates/.agents/dashboard/packages/local-runtime/src/server-projections.ts +30 -74
  120. package/templates/.agents/dashboard/packages/local-runtime/src/server-route-handlers.ts +42 -0
  121. package/templates/.agents/dashboard/packages/local-runtime/src/server-routes.test.ts +60 -0
  122. package/templates/.agents/dashboard/packages/local-runtime/src/server-run-projections.test.ts +12 -2
  123. package/templates/.agents/dashboard/packages/local-runtime/src/server-telemetry-command.test.ts +29 -4
  124. package/templates/.agents/dashboard/packages/local-runtime/src/server-telemetry-refresh.ts +7 -0
  125. package/templates/.agents/dashboard/packages/local-runtime/src/server.test.ts +51 -54
  126. package/templates/.agents/dashboard/packages/local-runtime/src/server.ts +37 -48
  127. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-filter-matrix.test.ts +5 -0
  128. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-invocation-page.test.ts +49 -0
  129. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-invocation-page.ts +44 -1
  130. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-cached-cost-page.ts +11 -10
  131. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-summary.ts +1 -1
  132. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-work-item-index.test.ts +18 -1
  133. package/templates/.agents/dashboard/packages/local-runtime/vitest.config.ts +12 -0
  134. package/templates/.agents/dashboard/packages/ui/package.json +1 -1
  135. package/templates/.agents/dashboard/tests/e2e/package.json +1 -1
  136. package/templates/.agents/dashboard/tests/e2e/specs/cost-monitor-pagination.spec.ts +13 -6
  137. package/templates/.agents/dashboard/tests/e2e/specs/dashboard.spec.ts +1 -1
  138. package/templates/.agents/design/.zaip-managed.json +3 -3
  139. package/templates/.agents/design/apps/catalog/package.json +1 -1
  140. package/templates/.agents/design/packages/local-runtime/package.json +1 -1
  141. package/templates/.agents/requirements/autonomous-assurance.md +39 -3
  142. package/templates/.agents/requirements/cloud-hostinger-autonomy.md +1 -1
  143. package/templates/.agents/requirements/comparative-audit.md +1 -1
  144. package/templates/.agents/requirements/context-engine.md +3 -3
  145. package/templates/.agents/requirements/cost-observability.md +1 -1
  146. package/templates/.agents/requirements/dashboard-launch.md +1 -1
  147. package/templates/.agents/requirements/data-export.md +1 -1
  148. package/templates/.agents/requirements/design-system.md +1 -1
  149. package/templates/.agents/requirements/execution-engine.md +11 -2
  150. package/templates/.agents/requirements/kanban-dashboard.md +1 -1
  151. package/templates/.agents/requirements/model-orchestration.md +1 -1
  152. package/templates/.agents/requirements/public-distribution.md +1 -1
  153. package/templates/.agents/requirements/software-architecture.md +1 -1
  154. package/templates/.agents/requirements/strategic-improvements.md +1 -1
  155. package/templates/.agents/requirements/work-lifecycle.md +2 -1
  156. package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
  157. package/templates/.agents/rules/cloud-hostinger-autonomy.md +1 -1
  158. package/templates/.agents/rules/production-readiness.md +24 -0
  159. package/templates/.agents/rules/run-lifecycle-closure.md +2 -1
  160. package/templates/.agents/rules/security.md +2 -2
  161. package/templates/.agents/rules/workflow.md +4 -3
  162. package/templates/.agents/runtime/VERSION +1 -1
  163. package/templates/.agents/runtime/bin/zaip.mjs +1185 -610
  164. package/templates/.agents/runtime/checksums.sha256 +6 -6
  165. package/templates/.agents/runtime/manifest.json +1 -1
  166. package/templates/.agents/runtime/pnpm-lock.sha256 +1 -1
  167. package/templates/.agents/runtime/provenance.json +5 -5
  168. package/templates/.agents/runtime/sbom.cdx.json +71 -71
  169. package/templates/.agents/skills/zaip-skill-execution/SKILL.md +4 -2
  170. package/templates/.agents/skills/zaip-skill-execution/references/controlled-release-recovery.md +44 -0
  171. package/templates/.agents/skills/zaip-skill-execution/references/runtime-governance.md +1 -1
  172. package/templates/.agents/skills/zaip-skill-github-deploy/SKILL.md +7 -1
  173. package/templates/.agents/skills/zaip-skill-github-deploy/references/release-gate-matrix.md +15 -20
  174. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract.mjs +38 -2
  175. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract.test.mjs +62 -4
  176. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/github-deploy-contract.test.mjs +8 -6
  177. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/guarded-commits.mjs +5 -3
  178. package/templates/.agents/skills/zaip-skill-lifecycle-closure/SKILL.md +7 -0
  179. package/templates/.agents/skills/zaip-skill-maintenance-enter/SKILL.md +23 -0
  180. package/templates/.agents/skills/zaip-skill-maintenance-enter/agents/openai.yaml +4 -0
  181. package/templates/.agents/skills/zaip-skill-maintenance-enter/scripts/maintenance.mjs +213 -0
  182. package/templates/.agents/skills/zaip-skill-maintenance-enter/scripts/maintenance.test.mjs +207 -0
  183. package/templates/.agents/skills/zaip-skill-maintenance-exit/SKILL.md +21 -0
  184. package/templates/.agents/skills/zaip-skill-maintenance-exit/agents/openai.yaml +4 -0
  185. package/templates/.agents/skills/zaip-skill-prd/SKILL.md +6 -0
  186. package/templates/.agents/skills/zaip-skill-release-qualification/SKILL.md +26 -0
  187. package/templates/.agents/skills/zaip-skill-release-qualification/references/local-preparation.md +46 -11
  188. package/templates/.agents/skills/zaip-skill-spec/SKILL.md +9 -0
  189. package/templates/.agents/skills/zaip-skill-testing-strategy/SKILL.md +15 -0
  190. package/templates/.agents/zaip-aios/VERSION +1 -1
  191. package/templates/.agents/zaip-aios/guides/11-observabilidade-e-custos.md +22 -0
  192. package/templates/.agents/zaip-aios/guides/14-troubleshooting.md +1 -1
  193. package/templates/.agents/zaip-aios/guides/26-qualidade-e-release.md +52 -5
  194. package/templates/template-manifest.json +210 -126
  195. package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-Co2Jiuzh.js +0 -68
@@ -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,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,+CAA+C,CAAC;AAEzF,MAAM,KAAK,GAAa,EAAE,CAAC;AAC3B,SAAS,CAAC,KAAK,IAAI,EAAE;IACnB,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC/F,CAAC,CAAC,CAAC;AAEH,EAAE,CAAC,kFAAkF,EAAE,KAAK,IAAI,EAAE;IAChG,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,0BAA0B,CAAC,CAAC,CAAC;IACvE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,MAAM,KAAK,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d.ts","sourceRoot":"","sources":["../../src/services/codex-pre-tool-hook-template.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,QAqpB/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"}