infra-kit 0.1.128 → 0.1.129

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 (762) hide show
  1. package/dist/chunk-2PZRQHWF.js +2 -0
  2. package/dist/chunk-2PZRQHWF.js.map +7 -0
  3. package/dist/chunk-6RRAK2QO.js +5 -0
  4. package/dist/chunk-6RRAK2QO.js.map +7 -0
  5. package/dist/chunk-IX2A34UU.js +2 -0
  6. package/dist/chunk-IX2A34UU.js.map +7 -0
  7. package/dist/chunk-V5IDN7ZM.js +162 -0
  8. package/dist/chunk-V5IDN7ZM.js.map +7 -0
  9. package/dist/{chunk-YSBF5C7C.js → chunk-Z6KTUVIC.js} +2 -2
  10. package/dist/chunk-Z6KTUVIC.js.map +7 -0
  11. package/dist/cli.js +4 -4
  12. package/dist/cli.js.map +3 -3
  13. package/dist/dev-server.js +15 -10
  14. package/dist/dev-server.js.map +4 -4
  15. package/dist/entry/index.d.ts +1 -1
  16. package/dist/entry/vite.d.ts +2 -0
  17. package/dist/index.js +1 -1
  18. package/dist/lib/package-config/package-config-schema.d.ts +35 -0
  19. package/dist/lib/package-config/package-config.d.ts +28 -0
  20. package/dist/lib/release-slug/release-slug.d.ts +19 -0
  21. package/dist/lib/vite/vite.d.ts +135 -0
  22. package/dist/mcp.js +1 -1
  23. package/dist/mcp.js.map +1 -1
  24. package/dist/vite.js +2 -0
  25. package/dist/vite.js.map +7 -0
  26. package/package.json +10 -2
  27. package/.eslintcache +0 -1
  28. package/.omc/state/agent-replay-036daa78-5fee-4c7d-9b44-53584acb0d87.jsonl +0 -26
  29. package/.omc/state/agent-replay-0a58307d-2a37-4c69-851c-83a646502d62.jsonl +0 -1
  30. package/.omc/state/agent-replay-0a65ec83-9de7-458d-9d0f-e56e1a26c68e.jsonl +0 -2
  31. package/.omc/state/agent-replay-0d1515ce-4ebe-4ce8-a865-2897f68de168.jsonl +0 -1
  32. package/.omc/state/agent-replay-11c41aa0-51fa-49e1-a1dc-26dcd6ac26cc.jsonl +0 -16
  33. package/.omc/state/agent-replay-127837d3-a000-4656-9453-2324ab353723.jsonl +0 -5
  34. package/.omc/state/agent-replay-15c409af-24fa-4026-88d3-a82dd1e68b87.jsonl +0 -11
  35. package/.omc/state/agent-replay-1b6ffc57-2d9b-4af4-b603-f1cef7e01b0a.jsonl +0 -17
  36. package/.omc/state/agent-replay-1fcfe0ec-7567-41c3-9bfd-501e99e86819.jsonl +0 -19
  37. package/.omc/state/agent-replay-2ac0dcd0-01f7-41a8-a8c9-f2195599817b.jsonl +0 -5
  38. package/.omc/state/agent-replay-2ccbd177-0d5d-4d4a-ab94-a22464786221.jsonl +0 -1
  39. package/.omc/state/agent-replay-36d91435-50b4-442f-9f4e-3cc68d776236.jsonl +0 -2
  40. package/.omc/state/agent-replay-38382db5-3088-4b5a-aff7-2561a60827c7.jsonl +0 -17
  41. package/.omc/state/agent-replay-4cf1c186-81b2-497c-b002-d7f84e7839f3.jsonl +0 -9
  42. package/.omc/state/agent-replay-50c36be9-a3a2-42b9-9c85-5a06d3e22f6a.jsonl +0 -5
  43. package/.omc/state/agent-replay-5c4ab554-64f1-42ae-83e3-21e0237e955c.jsonl +0 -11
  44. package/.omc/state/agent-replay-6be1264f-8069-4412-8119-86118ed1943e.jsonl +0 -3
  45. package/.omc/state/agent-replay-707b4784-2117-4b19-ae68-68a031f0d76d.jsonl +0 -2
  46. package/.omc/state/agent-replay-74afa912-1443-4011-b4f2-db9f055cdd9f.jsonl +0 -3
  47. package/.omc/state/agent-replay-8198b3e5-fad6-4ee0-9c59-ef773ad89af4.jsonl +0 -1
  48. package/.omc/state/agent-replay-8cd7652a-b8b5-49cf-9b1f-bee8e5972458.jsonl +0 -3
  49. package/.omc/state/agent-replay-8dd0ad2f-3a90-4158-b9de-ec8e19a7c983.jsonl +0 -3
  50. package/.omc/state/agent-replay-9bea518f-a9ee-4d14-bb53-a936ebaf647c.jsonl +0 -7
  51. package/.omc/state/agent-replay-a60ac2ec-afbd-449f-a540-6df287392fc2.jsonl +0 -1
  52. package/.omc/state/agent-replay-afc6290b-40d3-4bef-b3b6-14484c034ab9.jsonl +0 -14
  53. package/.omc/state/agent-replay-b52d89fb-0e24-4901-bc66-27e3c1697126.jsonl +0 -2
  54. package/.omc/state/agent-replay-be37e426-6fc8-47f4-8178-221c8494551c.jsonl +0 -3
  55. package/.omc/state/agent-replay-c967c819-3d1c-447b-ab48-56a8448ef9f8.jsonl +0 -2
  56. package/.omc/state/agent-replay-d02e6565-5168-40c8-8629-de219a29fa43.jsonl +0 -2
  57. package/.omc/state/agent-replay-d367c3be-9c2a-48e7-bcea-b45861af568c.jsonl +0 -2
  58. package/.omc/state/agent-replay-d5aae73c-340d-4aa2-9fe0-1bf2d79b69dc.jsonl +0 -10
  59. package/.omc/state/agent-replay-e947a3c6-989d-4a60-91dd-6b0ddd827b2d.jsonl +0 -3
  60. package/.omc/state/agent-replay-eb44055b-c2fa-4e66-b491-a1d9b44f51c7.jsonl +0 -1
  61. package/.omc/state/agent-replay-f2846d8f-974c-486c-b16f-4bdaa28ca45f.jsonl +0 -2
  62. package/.omc/state/agent-replay-f581a1ae-0ee4-48a3-96f3-ce31a0633bb0.jsonl +0 -1
  63. package/.omc/state/agent-replay-f99d8dad-81d1-4987-8183-62edf0843d0c.jsonl +0 -2
  64. package/.omc/state/agent-replay-fe1057b4-9a25-4e8e-8c3f-3e11652ee697.jsonl +0 -5
  65. package/.omc/state/idle-notif-cooldown.json +0 -3
  66. package/.omc/state/last-tool-error.json +0 -7
  67. package/.omc/state/mission-state.json +0 -53
  68. package/.omc/state/sessions/036daa78-5fee-4c7d-9b44-53584acb0d87/last-tool-error-state.json +0 -7
  69. package/.omc/state/sessions/036daa78-5fee-4c7d-9b44-53584acb0d87/mission-state.json +0 -129
  70. package/.omc/state/sessions/036daa78-5fee-4c7d-9b44-53584acb0d87/pre-tool-advisory-throttle.json +0 -34
  71. package/.omc/state/sessions/036daa78-5fee-4c7d-9b44-53584acb0d87/ralph-state.json +0 -13
  72. package/.omc/state/sessions/036daa78-5fee-4c7d-9b44-53584acb0d87/ralplan-state.json +0 -11
  73. package/.omc/state/sessions/036daa78-5fee-4c7d-9b44-53584acb0d87/subagent-tracking-state.json +0 -80
  74. package/.omc/state/sessions/036daa78-5fee-4c7d-9b44-53584acb0d87/ultrawork-state.json +0 -11
  75. package/.omc/state/sessions/0a58307d-2a37-4c69-851c-83a646502d62/pre-tool-advisory-throttle.json +0 -18
  76. package/.omc/state/sessions/0a58307d-2a37-4c69-851c-83a646502d62/subagent-tracking-state.json +0 -7
  77. package/.omc/state/sessions/0a65ec83-9de7-458d-9d0f-e56e1a26c68e/pre-tool-advisory-throttle.json +0 -18
  78. package/.omc/state/sessions/0a65ec83-9de7-458d-9d0f-e56e1a26c68e/skill-active-state.json +0 -15
  79. package/.omc/state/sessions/0d1515ce-4ebe-4ce8-a865-2897f68de168/pre-tool-advisory-throttle.json +0 -10
  80. package/.omc/state/sessions/11c41aa0-51fa-49e1-a1dc-26dcd6ac26cc/last-tool-error-state.json +0 -7
  81. package/.omc/state/sessions/11c41aa0-51fa-49e1-a1dc-26dcd6ac26cc/mission-state.json +0 -117
  82. package/.omc/state/sessions/11c41aa0-51fa-49e1-a1dc-26dcd6ac26cc/pre-tool-advisory-throttle.json +0 -42
  83. package/.omc/state/sessions/11c41aa0-51fa-49e1-a1dc-26dcd6ac26cc/subagent-tracking-state.json +0 -53
  84. package/.omc/state/sessions/127837d3-a000-4656-9453-2324ab353723/mission-state.json +0 -61
  85. package/.omc/state/sessions/127837d3-a000-4656-9453-2324ab353723/pre-tool-advisory-throttle.json +0 -22
  86. package/.omc/state/sessions/127837d3-a000-4656-9453-2324ab353723/skill-active-state.json +0 -15
  87. package/.omc/state/sessions/127837d3-a000-4656-9453-2324ab353723/subagent-tracking-state.json +0 -26
  88. package/.omc/state/sessions/15c409af-24fa-4026-88d3-a82dd1e68b87/last-tool-error-state.json +0 -7
  89. package/.omc/state/sessions/15c409af-24fa-4026-88d3-a82dd1e68b87/mission-state.json +0 -89
  90. package/.omc/state/sessions/15c409af-24fa-4026-88d3-a82dd1e68b87/pre-tool-advisory-throttle.json +0 -34
  91. package/.omc/state/sessions/15c409af-24fa-4026-88d3-a82dd1e68b87/ralph-state.json +0 -13
  92. package/.omc/state/sessions/15c409af-24fa-4026-88d3-a82dd1e68b87/skill-active-state.json +0 -15
  93. package/.omc/state/sessions/15c409af-24fa-4026-88d3-a82dd1e68b87/subagent-tracking-state.json +0 -44
  94. package/.omc/state/sessions/15c409af-24fa-4026-88d3-a82dd1e68b87/ultrawork-state.json +0 -11
  95. package/.omc/state/sessions/1b6ffc57-2d9b-4af4-b603-f1cef7e01b0a/last-tool-error-state.json +0 -7
  96. package/.omc/state/sessions/1b6ffc57-2d9b-4af4-b603-f1cef7e01b0a/mission-state.json +0 -139
  97. package/.omc/state/sessions/1b6ffc57-2d9b-4af4-b603-f1cef7e01b0a/pre-tool-advisory-throttle.json +0 -50
  98. package/.omc/state/sessions/1b6ffc57-2d9b-4af4-b603-f1cef7e01b0a/ralplan-state.json +0 -11
  99. package/.omc/state/sessions/1b6ffc57-2d9b-4af4-b603-f1cef7e01b0a/subagent-tracking-state.json +0 -90
  100. package/.omc/state/sessions/1fcfe0ec-7567-41c3-9bfd-501e99e86819/last-tool-error-state.json +0 -7
  101. package/.omc/state/sessions/1fcfe0ec-7567-41c3-9bfd-501e99e86819/mission-state.json +0 -109
  102. package/.omc/state/sessions/1fcfe0ec-7567-41c3-9bfd-501e99e86819/pre-tool-advisory-throttle.json +0 -42
  103. package/.omc/state/sessions/1fcfe0ec-7567-41c3-9bfd-501e99e86819/ralph-state.json +0 -13
  104. package/.omc/state/sessions/1fcfe0ec-7567-41c3-9bfd-501e99e86819/skill-active-state.json +0 -15
  105. package/.omc/state/sessions/1fcfe0ec-7567-41c3-9bfd-501e99e86819/subagent-tracking-state.json +0 -62
  106. package/.omc/state/sessions/1fcfe0ec-7567-41c3-9bfd-501e99e86819/ultrawork-state.json +0 -11
  107. package/.omc/state/sessions/23d0ff82-17e5-428b-8743-38f7979bb6f3/last-tool-error-state.json +0 -7
  108. package/.omc/state/sessions/23d0ff82-17e5-428b-8743-38f7979bb6f3/pre-tool-advisory-throttle.json +0 -18
  109. package/.omc/state/sessions/2ac0dcd0-01f7-41a8-a8c9-f2195599817b/last-tool-error-state.json +0 -7
  110. package/.omc/state/sessions/2ac0dcd0-01f7-41a8-a8c9-f2195599817b/mission-state.json +0 -79
  111. package/.omc/state/sessions/2ac0dcd0-01f7-41a8-a8c9-f2195599817b/pre-tool-advisory-throttle.json +0 -10
  112. package/.omc/state/sessions/2ac0dcd0-01f7-41a8-a8c9-f2195599817b/skill-active-state.json +0 -15
  113. package/.omc/state/sessions/2ac0dcd0-01f7-41a8-a8c9-f2195599817b/subagent-tracking-state.json +0 -26
  114. package/.omc/state/sessions/2ccbd177-0d5d-4d4a-ab94-a22464786221/pre-tool-advisory-throttle.json +0 -18
  115. package/.omc/state/sessions/2ccbd177-0d5d-4d4a-ab94-a22464786221/subagent-tracking-state.json +0 -17
  116. package/.omc/state/sessions/36d91435-50b4-442f-9f4e-3cc68d776236/pre-tool-advisory-throttle.json +0 -18
  117. package/.omc/state/sessions/36d91435-50b4-442f-9f4e-3cc68d776236/subagent-tracking-state.json +0 -17
  118. package/.omc/state/sessions/38382db5-3088-4b5a-aff7-2561a60827c7/last-tool-error-state.json +0 -7
  119. package/.omc/state/sessions/38382db5-3088-4b5a-aff7-2561a60827c7/mission-state.json +0 -145
  120. package/.omc/state/sessions/38382db5-3088-4b5a-aff7-2561a60827c7/pre-tool-advisory-throttle.json +0 -38
  121. package/.omc/state/sessions/38382db5-3088-4b5a-aff7-2561a60827c7/ralplan-state.json +0 -11
  122. package/.omc/state/sessions/38382db5-3088-4b5a-aff7-2561a60827c7/subagent-tracking-state.json +0 -98
  123. package/.omc/state/sessions/3a844fbd-ace8-4af1-8516-33d611839886/pre-tool-advisory-throttle.json +0 -18
  124. package/.omc/state/sessions/41336850-028c-476b-be1a-2164e1e46cac/last-tool-error-state.json +0 -7
  125. package/.omc/state/sessions/41336850-028c-476b-be1a-2164e1e46cac/pre-tool-advisory-throttle.json +0 -18
  126. package/.omc/state/sessions/4cf1c186-81b2-497c-b002-d7f84e7839f3/last-tool-error-state.json +0 -7
  127. package/.omc/state/sessions/4cf1c186-81b2-497c-b002-d7f84e7839f3/pre-tool-advisory-throttle.json +0 -18
  128. package/.omc/state/sessions/4cf1c186-81b2-497c-b002-d7f84e7839f3/subagent-tracking-state.json +0 -7
  129. package/.omc/state/sessions/50c36be9-a3a2-42b9-9c85-5a06d3e22f6a/mission-state.json +0 -61
  130. package/.omc/state/sessions/50c36be9-a3a2-42b9-9c85-5a06d3e22f6a/pre-tool-advisory-throttle.json +0 -22
  131. package/.omc/state/sessions/50c36be9-a3a2-42b9-9c85-5a06d3e22f6a/skill-active-state.json +0 -15
  132. package/.omc/state/sessions/50c36be9-a3a2-42b9-9c85-5a06d3e22f6a/subagent-tracking-state.json +0 -26
  133. package/.omc/state/sessions/560ea519-574a-4713-b134-5bf6cfaf3c33/pre-tool-advisory-throttle.json +0 -18
  134. package/.omc/state/sessions/5c4ab554-64f1-42ae-83e3-21e0237e955c/mission-state.json +0 -117
  135. package/.omc/state/sessions/5c4ab554-64f1-42ae-83e3-21e0237e955c/pre-tool-advisory-throttle.json +0 -18
  136. package/.omc/state/sessions/5c4ab554-64f1-42ae-83e3-21e0237e955c/subagent-tracking-state.json +0 -17
  137. package/.omc/state/sessions/6be1264f-8069-4412-8119-86118ed1943e/last-tool-error-state.json +0 -7
  138. package/.omc/state/sessions/6be1264f-8069-4412-8119-86118ed1943e/mission-state.json +0 -53
  139. package/.omc/state/sessions/6be1264f-8069-4412-8119-86118ed1943e/pre-tool-advisory-throttle.json +0 -22
  140. package/.omc/state/sessions/6be1264f-8069-4412-8119-86118ed1943e/skill-active-state.json +0 -15
  141. package/.omc/state/sessions/6be1264f-8069-4412-8119-86118ed1943e/subagent-tracking-state.json +0 -17
  142. package/.omc/state/sessions/707b4784-2117-4b19-ae68-68a031f0d76d/pre-tool-advisory-throttle.json +0 -18
  143. package/.omc/state/sessions/707b4784-2117-4b19-ae68-68a031f0d76d/subagent-tracking-state.json +0 -17
  144. package/.omc/state/sessions/74afa912-1443-4011-b4f2-db9f055cdd9f/pre-tool-advisory-throttle.json +0 -18
  145. package/.omc/state/sessions/74afa912-1443-4011-b4f2-db9f055cdd9f/skill-active-state.json +0 -15
  146. package/.omc/state/sessions/74afa912-1443-4011-b4f2-db9f055cdd9f/subagent-tracking-state.json +0 -17
  147. package/.omc/state/sessions/7772f972-4ec1-4287-bf42-a92c14cf3ffc/pre-tool-advisory-throttle.json +0 -10
  148. package/.omc/state/sessions/8198b3e5-fad6-4ee0-9c59-ef773ad89af4/pre-tool-advisory-throttle.json +0 -14
  149. package/.omc/state/sessions/8198b3e5-fad6-4ee0-9c59-ef773ad89af4/subagent-tracking-state.json +0 -17
  150. package/.omc/state/sessions/8cd7652a-b8b5-49cf-9b1f-bee8e5972458/pre-tool-advisory-throttle.json +0 -18
  151. package/.omc/state/sessions/8cd7652a-b8b5-49cf-9b1f-bee8e5972458/ralplan-state.json +0 -11
  152. package/.omc/state/sessions/8cd7652a-b8b5-49cf-9b1f-bee8e5972458/subagent-tracking-state.json +0 -35
  153. package/.omc/state/sessions/8dd0ad2f-3a90-4158-b9de-ec8e19a7c983/pre-tool-advisory-throttle.json +0 -14
  154. package/.omc/state/sessions/8dd0ad2f-3a90-4158-b9de-ec8e19a7c983/ralph-state.json +0 -13
  155. package/.omc/state/sessions/8dd0ad2f-3a90-4158-b9de-ec8e19a7c983/subagent-tracking-state.json +0 -17
  156. package/.omc/state/sessions/8dd0ad2f-3a90-4158-b9de-ec8e19a7c983/ultrawork-state.json +0 -11
  157. package/.omc/state/sessions/9bea518f-a9ee-4d14-bb53-a936ebaf647c/last-tool-error-state.json +0 -7
  158. package/.omc/state/sessions/9bea518f-a9ee-4d14-bb53-a936ebaf647c/mission-state.json +0 -79
  159. package/.omc/state/sessions/9bea518f-a9ee-4d14-bb53-a936ebaf647c/pre-tool-advisory-throttle.json +0 -22
  160. package/.omc/state/sessions/9bea518f-a9ee-4d14-bb53-a936ebaf647c/progress.txt +0 -7
  161. package/.omc/state/sessions/9bea518f-a9ee-4d14-bb53-a936ebaf647c/skill-active-state.json +0 -15
  162. package/.omc/state/sessions/9bea518f-a9ee-4d14-bb53-a936ebaf647c/subagent-tracking-state.json +0 -26
  163. package/.omc/state/sessions/a60ac2ec-afbd-449f-a540-6df287392fc2/pre-tool-advisory-throttle.json +0 -18
  164. package/.omc/state/sessions/a60ac2ec-afbd-449f-a540-6df287392fc2/subagent-tracking-state.json +0 -7
  165. package/.omc/state/sessions/afc6290b-40d3-4bef-b3b6-14484c034ab9/last-tool-error-state.json +0 -7
  166. package/.omc/state/sessions/afc6290b-40d3-4bef-b3b6-14484c034ab9/mission-state.json +0 -89
  167. package/.omc/state/sessions/afc6290b-40d3-4bef-b3b6-14484c034ab9/pre-tool-advisory-throttle.json +0 -34
  168. package/.omc/state/sessions/afc6290b-40d3-4bef-b3b6-14484c034ab9/ralph-state.json +0 -13
  169. package/.omc/state/sessions/afc6290b-40d3-4bef-b3b6-14484c034ab9/skill-active-state.json +0 -15
  170. package/.omc/state/sessions/afc6290b-40d3-4bef-b3b6-14484c034ab9/subagent-tracking-state.json +0 -35
  171. package/.omc/state/sessions/afc6290b-40d3-4bef-b3b6-14484c034ab9/ultrawork-state.json +0 -11
  172. package/.omc/state/sessions/b52d89fb-0e24-4901-bc66-27e3c1697126/pre-tool-advisory-throttle.json +0 -14
  173. package/.omc/state/sessions/b52d89fb-0e24-4901-bc66-27e3c1697126/subagent-tracking-state.json +0 -17
  174. package/.omc/state/sessions/c513ef38-cc3e-4a29-9c4c-1e0137245dd5/pre-tool-advisory-throttle.json +0 -18
  175. package/.omc/state/sessions/c967c819-3d1c-447b-ab48-56a8448ef9f8/pre-tool-advisory-throttle.json +0 -10
  176. package/.omc/state/sessions/c967c819-3d1c-447b-ab48-56a8448ef9f8/subagent-tracking-state.json +0 -7
  177. package/.omc/state/sessions/d02e6565-5168-40c8-8629-de219a29fa43/last-tool-error-state.json +0 -7
  178. package/.omc/state/sessions/d02e6565-5168-40c8-8629-de219a29fa43/mission-state.json +0 -53
  179. package/.omc/state/sessions/d02e6565-5168-40c8-8629-de219a29fa43/pre-tool-advisory-throttle.json +0 -18
  180. package/.omc/state/sessions/d02e6565-5168-40c8-8629-de219a29fa43/subagent-tracking-state.json +0 -17
  181. package/.omc/state/sessions/d5aae73c-340d-4aa2-9fe0-1bf2d79b69dc/last-tool-error-state.json +0 -7
  182. package/.omc/state/sessions/d5aae73c-340d-4aa2-9fe0-1bf2d79b69dc/mission-state.json +0 -103
  183. package/.omc/state/sessions/d5aae73c-340d-4aa2-9fe0-1bf2d79b69dc/pre-tool-advisory-throttle.json +0 -30
  184. package/.omc/state/sessions/d5aae73c-340d-4aa2-9fe0-1bf2d79b69dc/ralph-state.json +0 -13
  185. package/.omc/state/sessions/d5aae73c-340d-4aa2-9fe0-1bf2d79b69dc/subagent-tracking-state.json +0 -62
  186. package/.omc/state/sessions/d5aae73c-340d-4aa2-9fe0-1bf2d79b69dc/ultrawork-state.json +0 -11
  187. package/.omc/state/sessions/e947a3c6-989d-4a60-91dd-6b0ddd827b2d/last-tool-error-state.json +0 -7
  188. package/.omc/state/sessions/e947a3c6-989d-4a60-91dd-6b0ddd827b2d/pre-tool-advisory-throttle.json +0 -10
  189. package/.omc/state/sessions/e947a3c6-989d-4a60-91dd-6b0ddd827b2d/subagent-tracking-state.json +0 -26
  190. package/.omc/state/sessions/eb44055b-c2fa-4e66-b491-a1d9b44f51c7/last-tool-error-state.json +0 -7
  191. package/.omc/state/sessions/eb44055b-c2fa-4e66-b491-a1d9b44f51c7/pre-tool-advisory-throttle.json +0 -18
  192. package/.omc/state/sessions/eb44055b-c2fa-4e66-b491-a1d9b44f51c7/subagent-tracking-state.json +0 -17
  193. package/.omc/state/sessions/ed3e2cfb-a666-4bb1-bcc1-569d5d0b837a/pre-tool-advisory-throttle.json +0 -18
  194. package/.omc/state/sessions/f581a1ae-0ee4-48a3-96f3-ce31a0633bb0/pre-tool-advisory-throttle.json +0 -18
  195. package/.omc/state/sessions/f581a1ae-0ee4-48a3-96f3-ce31a0633bb0/subagent-tracking-state.json +0 -17
  196. package/.omc/state/sessions/f99d8dad-81d1-4987-8183-62edf0843d0c/pre-tool-advisory-throttle.json +0 -14
  197. package/.omc/state/sessions/f99d8dad-81d1-4987-8183-62edf0843d0c/ralph-state.json +0 -13
  198. package/.omc/state/sessions/f99d8dad-81d1-4987-8183-62edf0843d0c/ultrawork-state.json +0 -11
  199. package/.omc/state/sessions/f9c17a0e-2dd8-4f7d-badf-631f266c5d4c/pre-tool-advisory-throttle.json +0 -10
  200. package/.omc/state/sessions/fe1057b4-9a25-4e8e-8c3f-3e11652ee697/last-tool-error-state.json +0 -7
  201. package/.omc/state/sessions/fe1057b4-9a25-4e8e-8c3f-3e11652ee697/mission-state.json +0 -61
  202. package/.omc/state/sessions/fe1057b4-9a25-4e8e-8c3f-3e11652ee697/prd.json +0 -22
  203. package/.omc/state/sessions/fe1057b4-9a25-4e8e-8c3f-3e11652ee697/pre-tool-advisory-throttle.json +0 -22
  204. package/.omc/state/sessions/fe1057b4-9a25-4e8e-8c3f-3e11652ee697/progress.txt +0 -22
  205. package/.omc/state/sessions/fe1057b4-9a25-4e8e-8c3f-3e11652ee697/skill-active-state.json +0 -15
  206. package/.omc/state/sessions/fe1057b4-9a25-4e8e-8c3f-3e11652ee697/subagent-tracking-state.json +0 -26
  207. package/.omc/state/subagent-tracking.json +0 -17
  208. package/.turbo/turbo-build.log +0 -7
  209. package/.turbo/turbo-check.log +0 -14
  210. package/.turbo/turbo-eslint-check.log +0 -2
  211. package/.turbo/turbo-eslint-fix.log +0 -1
  212. package/.turbo/turbo-infra-kit-check.log +0 -14
  213. package/.turbo/turbo-prettier-check.log +0 -1
  214. package/.turbo/turbo-prettier-fix.log +0 -1
  215. package/.turbo/turbo-test.log +0 -406
  216. package/.turbo/turbo-ts-check.log +0 -1
  217. package/.turbo/turbo-validate.log +0 -14
  218. package/coverage/base.css +0 -224
  219. package/coverage/block-navigation.js +0 -87
  220. package/coverage/cli/index.html +0 -116
  221. package/coverage/cli/package.json.html +0 -283
  222. package/coverage/cli/src/commands/audit/audit.ts.html +0 -616
  223. package/coverage/cli/src/commands/audit/index.html +0 -131
  224. package/coverage/cli/src/commands/audit/index.ts.html +0 -88
  225. package/coverage/cli/src/commands/doctor/doctor.ts.html +0 -1654
  226. package/coverage/cli/src/commands/doctor/index.html +0 -131
  227. package/coverage/cli/src/commands/doctor/index.ts.html +0 -88
  228. package/coverage/cli/src/commands/env-clear/env-clear.ts.html +0 -370
  229. package/coverage/cli/src/commands/env-clear/index.html +0 -131
  230. package/coverage/cli/src/commands/env-clear/index.ts.html +0 -88
  231. package/coverage/cli/src/commands/env-list/env-list.ts.html +0 -229
  232. package/coverage/cli/src/commands/env-list/index.html +0 -131
  233. package/coverage/cli/src/commands/env-list/index.ts.html +0 -88
  234. package/coverage/cli/src/commands/env-load/env-load.ts.html +0 -1201
  235. package/coverage/cli/src/commands/env-load/index.html +0 -131
  236. package/coverage/cli/src/commands/env-load/index.ts.html +0 -91
  237. package/coverage/cli/src/commands/env-status/env-status.ts.html +0 -409
  238. package/coverage/cli/src/commands/env-status/index.html +0 -131
  239. package/coverage/cli/src/commands/env-status/index.ts.html +0 -88
  240. package/coverage/cli/src/commands/gh-merge-dev/gh-merge-dev.ts.html +0 -694
  241. package/coverage/cli/src/commands/gh-merge-dev/index.html +0 -131
  242. package/coverage/cli/src/commands/gh-merge-dev/index.ts.html +0 -88
  243. package/coverage/cli/src/commands/gh-release-deliver/gh-release-deliver.ts.html +0 -1495
  244. package/coverage/cli/src/commands/gh-release-deliver/index.html +0 -131
  245. package/coverage/cli/src/commands/gh-release-deliver/index.ts.html +0 -88
  246. package/coverage/cli/src/commands/gh-release-deploy-all/gh-release-deploy-all.ts.html +0 -706
  247. package/coverage/cli/src/commands/gh-release-deploy-all/index.html +0 -131
  248. package/coverage/cli/src/commands/gh-release-deploy-all/index.ts.html +0 -88
  249. package/coverage/cli/src/commands/gh-release-deploy-selected/gh-release-deploy-selected.ts.html +0 -994
  250. package/coverage/cli/src/commands/gh-release-deploy-selected/index.html +0 -131
  251. package/coverage/cli/src/commands/gh-release-deploy-selected/index.ts.html +0 -88
  252. package/coverage/cli/src/commands/gh-release-list/gh-release-list.ts.html +0 -355
  253. package/coverage/cli/src/commands/gh-release-list/index.html +0 -131
  254. package/coverage/cli/src/commands/gh-release-list/index.ts.html +0 -88
  255. package/coverage/cli/src/commands/init/agent-files.ts.html +0 -742
  256. package/coverage/cli/src/commands/init/index.html +0 -146
  257. package/coverage/cli/src/commands/init/init.ts.html +0 -1159
  258. package/coverage/cli/src/commands/init/migrate-config.ts.html +0 -1219
  259. package/coverage/cli/src/commands/release-create/index.html +0 -131
  260. package/coverage/cli/src/commands/release-create/index.ts.html +0 -88
  261. package/coverage/cli/src/commands/release-create/release-create.ts.html +0 -1426
  262. package/coverage/cli/src/commands/release-desc-edit/index.html +0 -131
  263. package/coverage/cli/src/commands/release-desc-edit/index.ts.html +0 -88
  264. package/coverage/cli/src/commands/release-desc-edit/release-desc-edit.ts.html +0 -766
  265. package/coverage/cli/src/commands/vendor-check/index.html +0 -131
  266. package/coverage/cli/src/commands/vendor-check/index.ts.html +0 -88
  267. package/coverage/cli/src/commands/vendor-check/vendor-check.ts.html +0 -466
  268. package/coverage/cli/src/commands/vendor-config/index.html +0 -116
  269. package/coverage/cli/src/commands/vendor-config/vendor-config.ts.html +0 -571
  270. package/coverage/cli/src/commands/vendor-diff/index.html +0 -131
  271. package/coverage/cli/src/commands/vendor-diff/index.ts.html +0 -88
  272. package/coverage/cli/src/commands/vendor-diff/vendor-diff.ts.html +0 -316
  273. package/coverage/cli/src/commands/vendor-manifest/index.html +0 -131
  274. package/coverage/cli/src/commands/vendor-manifest/index.ts.html +0 -88
  275. package/coverage/cli/src/commands/vendor-manifest/vendor-manifest.ts.html +0 -265
  276. package/coverage/cli/src/commands/vendor-sync/index.html +0 -131
  277. package/coverage/cli/src/commands/vendor-sync/index.ts.html +0 -88
  278. package/coverage/cli/src/commands/vendor-sync/vendor-sync.ts.html +0 -355
  279. package/coverage/cli/src/commands/version/index.html +0 -131
  280. package/coverage/cli/src/commands/version/index.ts.html +0 -88
  281. package/coverage/cli/src/commands/version/version.ts.html +0 -184
  282. package/coverage/cli/src/commands/worktrees-add/index.html +0 -131
  283. package/coverage/cli/src/commands/worktrees-add/index.ts.html +0 -88
  284. package/coverage/cli/src/commands/worktrees-add/worktrees-add.ts.html +0 -1183
  285. package/coverage/cli/src/commands/worktrees-list/index.html +0 -131
  286. package/coverage/cli/src/commands/worktrees-list/index.ts.html +0 -88
  287. package/coverage/cli/src/commands/worktrees-list/worktrees-list.ts.html +0 -400
  288. package/coverage/cli/src/commands/worktrees-reload/index.html +0 -131
  289. package/coverage/cli/src/commands/worktrees-reload/index.ts.html +0 -88
  290. package/coverage/cli/src/commands/worktrees-reload/worktrees-reload.ts.html +0 -775
  291. package/coverage/cli/src/commands/worktrees-remove/index.html +0 -131
  292. package/coverage/cli/src/commands/worktrees-remove/index.ts.html +0 -88
  293. package/coverage/cli/src/commands/worktrees-remove/worktrees-remove.ts.html +0 -682
  294. package/coverage/cli/src/commands/worktrees-sync/index.html +0 -131
  295. package/coverage/cli/src/commands/worktrees-sync/index.ts.html +0 -88
  296. package/coverage/cli/src/commands/worktrees-sync/worktrees-sync.ts.html +0 -679
  297. package/coverage/cli/src/dev/__tests__/fixtures.ts.html +0 -787
  298. package/coverage/cli/src/dev/__tests__/index.html +0 -116
  299. package/coverage/cli/src/dev/dev-server.ts.html +0 -1855
  300. package/coverage/cli/src/dev/discovery.ts.html +0 -598
  301. package/coverage/cli/src/dev/index.html +0 -191
  302. package/coverage/cli/src/dev/interfaces.ts.html +0 -223
  303. package/coverage/cli/src/dev/logger.ts.html +0 -1102
  304. package/coverage/cli/src/dev/ports.ts.html +0 -430
  305. package/coverage/cli/src/dev/serverless-local-run.ts.html +0 -916
  306. package/coverage/cli/src/entry/dev-server.ts.html +0 -409
  307. package/coverage/cli/src/entry/index.html +0 -116
  308. package/coverage/cli/src/index.html +0 -116
  309. package/coverage/cli/src/integrations/cmux/canonicalize-cmux-title.ts.html +0 -178
  310. package/coverage/cli/src/integrations/cmux/close-workspace-by-title.ts.html +0 -262
  311. package/coverage/cli/src/integrations/cmux/index.html +0 -191
  312. package/coverage/cli/src/integrations/cmux/index.ts.html +0 -100
  313. package/coverage/cli/src/integrations/cmux/list-workspace-titles.ts.html +0 -226
  314. package/coverage/cli/src/integrations/cmux/open-workspace-with-layout.ts.html +0 -325
  315. package/coverage/cli/src/integrations/cmux/workspace-title.ts.html +0 -154
  316. package/coverage/cli/src/integrations/cursor/add-folders-to-workspace.ts.html +0 -337
  317. package/coverage/cli/src/integrations/cursor/index.html +0 -206
  318. package/coverage/cli/src/integrations/cursor/index.ts.html +0 -103
  319. package/coverage/cli/src/integrations/cursor/launch-cursor.ts.html +0 -121
  320. package/coverage/cli/src/integrations/cursor/open-cursor-workspace.ts.html +0 -277
  321. package/coverage/cli/src/integrations/cursor/reconcile-workspace-folders.ts.html +0 -355
  322. package/coverage/cli/src/integrations/cursor/remove-folders-from-workspace.ts.html +0 -364
  323. package/coverage/cli/src/integrations/cursor/resolve-workspace-path.ts.html +0 -124
  324. package/coverage/cli/src/integrations/doppler/doppler-cli-auth.ts.html +0 -178
  325. package/coverage/cli/src/integrations/doppler/doppler-errors.ts.html +0 -349
  326. package/coverage/cli/src/integrations/doppler/doppler-project.ts.html +0 -355
  327. package/coverage/cli/src/integrations/doppler/index.html +0 -161
  328. package/coverage/cli/src/integrations/doppler/index.ts.html +0 -97
  329. package/coverage/cli/src/integrations/gh/gh-cli-auth/gh-cli-auth.ts.html +0 -172
  330. package/coverage/cli/src/integrations/gh/gh-cli-auth/index.html +0 -131
  331. package/coverage/cli/src/integrations/gh/gh-cli-auth/index.ts.html +0 -88
  332. package/coverage/cli/src/integrations/gh/gh-release-prs/gh-release-prs.ts.html +0 -703
  333. package/coverage/cli/src/integrations/gh/gh-release-prs/index.html +0 -131
  334. package/coverage/cli/src/integrations/gh/gh-release-prs/index.ts.html +0 -91
  335. package/coverage/cli/src/integrations/gh/index.html +0 -116
  336. package/coverage/cli/src/integrations/gh/index.ts.html +0 -94
  337. package/coverage/cli/src/integrations/ide/add-ide-worktree-folders.ts.html +0 -316
  338. package/coverage/cli/src/integrations/ide/index.html +0 -191
  339. package/coverage/cli/src/integrations/ide/index.ts.html +0 -103
  340. package/coverage/cli/src/integrations/ide/open-ide-workspace.ts.html +0 -238
  341. package/coverage/cli/src/integrations/ide/provider-label.ts.html +0 -157
  342. package/coverage/cli/src/integrations/ide/remove-ide-worktree-folders.ts.html +0 -520
  343. package/coverage/cli/src/integrations/ide/types.ts.html +0 -208
  344. package/coverage/cli/src/integrations/jira/api.ts.html +0 -1060
  345. package/coverage/cli/src/integrations/jira/index.html +0 -131
  346. package/coverage/cli/src/integrations/jira/index.ts.html +0 -142
  347. package/coverage/cli/src/integrations/zed/add-folders-to-zed-workspace.ts.html +0 -175
  348. package/coverage/cli/src/integrations/zed/index.html +0 -161
  349. package/coverage/cli/src/integrations/zed/index.ts.html +0 -94
  350. package/coverage/cli/src/integrations/zed/open-zed-workspace.ts.html +0 -238
  351. package/coverage/cli/src/integrations/zed/reuse-zed-workspace.ts.html +0 -256
  352. package/coverage/cli/src/lib/assert-never/assert-never.ts.html +0 -130
  353. package/coverage/cli/src/lib/assert-never/index.html +0 -131
  354. package/coverage/cli/src/lib/assert-never/index.ts.html +0 -88
  355. package/coverage/cli/src/lib/command-catalog/command-catalog.ts.html +0 -523
  356. package/coverage/cli/src/lib/command-catalog/index.html +0 -116
  357. package/coverage/cli/src/lib/command-echo/command-echo.ts.html +0 -319
  358. package/coverage/cli/src/lib/command-echo/index.html +0 -131
  359. package/coverage/cli/src/lib/command-echo/index.ts.html +0 -88
  360. package/coverage/cli/src/lib/constants/constants.ts.html +0 -472
  361. package/coverage/cli/src/lib/constants/index.html +0 -131
  362. package/coverage/cli/src/lib/constants/index.ts.html +0 -139
  363. package/coverage/cli/src/lib/env-autoload/env-autoload.ts.html +0 -1111
  364. package/coverage/cli/src/lib/env-autoload/index.html +0 -116
  365. package/coverage/cli/src/lib/errors/format-zx-error.ts.html +0 -247
  366. package/coverage/cli/src/lib/errors/index.html +0 -146
  367. package/coverage/cli/src/lib/errors/is-prompt-cancellation.ts.html +0 -199
  368. package/coverage/cli/src/lib/errors/operation-error.ts.html +0 -325
  369. package/coverage/cli/src/lib/git-guard/git-guard.ts.html +0 -250
  370. package/coverage/cli/src/lib/git-guard/index.html +0 -131
  371. package/coverage/cli/src/lib/git-guard/index.ts.html +0 -91
  372. package/coverage/cli/src/lib/git-utils/git-utils.ts.html +0 -622
  373. package/coverage/cli/src/lib/git-utils/index.html +0 -131
  374. package/coverage/cli/src/lib/git-utils/index.ts.html +0 -115
  375. package/coverage/cli/src/lib/infra-kit-config/index.html +0 -131
  376. package/coverage/cli/src/lib/infra-kit-config/index.ts.html +0 -142
  377. package/coverage/cli/src/lib/infra-kit-config/infra-kit-config.ts.html +0 -1447
  378. package/coverage/cli/src/lib/json-output/index.html +0 -116
  379. package/coverage/cli/src/lib/json-output/json-output.ts.html +0 -226
  380. package/coverage/cli/src/lib/logger/index.html +0 -116
  381. package/coverage/cli/src/lib/logger/index.ts.html +0 -205
  382. package/coverage/cli/src/lib/managed-block/index.html +0 -131
  383. package/coverage/cli/src/lib/managed-block/index.ts.html +0 -109
  384. package/coverage/cli/src/lib/managed-block/managed-block.ts.html +0 -520
  385. package/coverage/cli/src/lib/package-config/index.html +0 -146
  386. package/coverage/cli/src/lib/package-config/index.ts.html +0 -94
  387. package/coverage/cli/src/lib/package-config/package-config-schema.ts.html +0 -142
  388. package/coverage/cli/src/lib/package-config/package-config.ts.html +0 -376
  389. package/coverage/cli/src/lib/package-validator/checks/config-check.ts.html +0 -175
  390. package/coverage/cli/src/lib/package-validator/checks/files-check.ts.html +0 -172
  391. package/coverage/cli/src/lib/package-validator/checks/index.html +0 -176
  392. package/coverage/cli/src/lib/package-validator/checks/index.ts.html +0 -97
  393. package/coverage/cli/src/lib/package-validator/checks/scripts-check.ts.html +0 -154
  394. package/coverage/cli/src/lib/package-validator/checks/turbo-check.ts.html +0 -226
  395. package/coverage/cli/src/lib/package-validator/fs-utils.ts.html +0 -139
  396. package/coverage/cli/src/lib/package-validator/index.html +0 -146
  397. package/coverage/cli/src/lib/package-validator/index.ts.html +0 -94
  398. package/coverage/cli/src/lib/package-validator/loader/config-loader.ts.html +0 -316
  399. package/coverage/cli/src/lib/package-validator/loader/index.html +0 -146
  400. package/coverage/cli/src/lib/package-validator/loader/index.ts.html +0 -91
  401. package/coverage/cli/src/lib/package-validator/loader/package-discovery.ts.html +0 -379
  402. package/coverage/cli/src/lib/package-validator/package-validator.ts.html +0 -229
  403. package/coverage/cli/src/lib/path-display/index.html +0 -131
  404. package/coverage/cli/src/lib/path-display/index.ts.html +0 -88
  405. package/coverage/cli/src/lib/path-display/path-display.ts.html +0 -211
  406. package/coverage/cli/src/lib/release-id/index.html +0 -131
  407. package/coverage/cli/src/lib/release-id/index.ts.html +0 -130
  408. package/coverage/cli/src/lib/release-id/release-id.ts.html +0 -859
  409. package/coverage/cli/src/lib/release-utils/index.html +0 -131
  410. package/coverage/cli/src/lib/release-utils/index.ts.html +0 -130
  411. package/coverage/cli/src/lib/release-utils/release-utils.ts.html +0 -778
  412. package/coverage/cli/src/lib/render/index.html +0 -116
  413. package/coverage/cli/src/lib/render/render.ts.html +0 -157
  414. package/coverage/cli/src/lib/vendor/__tests__/index.html +0 -116
  415. package/coverage/cli/src/lib/vendor/__tests__/zx-mock.ts.html +0 -181
  416. package/coverage/cli/src/lib/vendor/config-schema.ts.html +0 -319
  417. package/coverage/cli/src/lib/vendor/config.ts.html +0 -259
  418. package/coverage/cli/src/lib/vendor/factory-config-schema.ts.html +0 -190
  419. package/coverage/cli/src/lib/vendor/factory-config.ts.html +0 -358
  420. package/coverage/cli/src/lib/vendor/hash.ts.html +0 -133
  421. package/coverage/cli/src/lib/vendor/index.html +0 -251
  422. package/coverage/cli/src/lib/vendor/index.ts.html +0 -154
  423. package/coverage/cli/src/lib/vendor/manifest.ts.html +0 -538
  424. package/coverage/cli/src/lib/vendor/skip-sets.ts.html +0 -229
  425. package/coverage/cli/src/lib/vendor/sync-ops.ts.html +0 -955
  426. package/coverage/cli/src/lib/vendor/walk.ts.html +0 -253
  427. package/coverage/cli/src/lib/version-utils/index.html +0 -161
  428. package/coverage/cli/src/lib/version-utils/index.ts.html +0 -139
  429. package/coverage/cli/src/lib/version-utils/load-existing-versions.ts.html +0 -343
  430. package/coverage/cli/src/lib/version-utils/next-version.ts.html +0 -934
  431. package/coverage/cli/src/lib/version-utils/version-utils.ts.html +0 -178
  432. package/coverage/cli/src/lib/worktrees/index.html +0 -131
  433. package/coverage/cli/src/lib/worktrees/index.ts.html +0 -88
  434. package/coverage/cli/src/lib/worktrees/remove-worktrees.ts.html +0 -283
  435. package/coverage/cli/src/tui/boot.tsx.html +0 -265
  436. package/coverage/cli/src/tui/index.html +0 -116
  437. package/coverage/cli/src/tui/screens/command-palette.tsx.html +0 -562
  438. package/coverage/cli/src/tui/screens/index.html +0 -116
  439. package/coverage/cli/src/types.ts.html +0 -283
  440. package/coverage/clover.xml +0 -4488
  441. package/coverage/coverage-final.json +0 -156
  442. package/coverage/favicon.png +0 -0
  443. package/coverage/index.html +0 -1076
  444. package/coverage/prettify.css +0 -1
  445. package/coverage/prettify.js +0 -2
  446. package/coverage/sort-arrow-sprite.png +0 -0
  447. package/coverage/sorter.js +0 -210
  448. package/dist/chunk-DB6CTNBS.js +0 -3
  449. package/dist/chunk-DB6CTNBS.js.map +0 -7
  450. package/dist/chunk-QBHCWAAG.js +0 -164
  451. package/dist/chunk-QBHCWAAG.js.map +0 -7
  452. package/dist/chunk-YSBF5C7C.js.map +0 -7
  453. package/eslint.config.js +0 -35
  454. package/infra-kit.config.ts +0 -5
  455. package/scripts/build.js +0 -75
  456. package/src/.omc/state/agent-replay-2ac0dcd0-01f7-41a8-a8c9-f2195599817b.jsonl +0 -5
  457. package/src/.omc/state/agent-replay-2ccbd177-0d5d-4d4a-ab94-a22464786221.jsonl +0 -2
  458. package/src/.omc/state/agent-replay-707b4784-2117-4b19-ae68-68a031f0d76d.jsonl +0 -2
  459. package/src/.omc/state/agent-replay-8dd0ad2f-3a90-4158-b9de-ec8e19a7c983.jsonl +0 -11
  460. package/src/.omc/state/agent-replay-c513ef38-cc3e-4a29-9c4c-1e0137245dd5.jsonl +0 -4
  461. package/src/.omc/state/agent-replay-ed3e2cfb-a666-4bb1-bcc1-569d5d0b837a.jsonl +0 -2
  462. package/src/.omc/state/idle-notif-cooldown.json +0 -3
  463. package/src/.omc/state/sessions/0a58307d-2a37-4c69-851c-83a646502d62/pre-tool-advisory-throttle.json +0 -18
  464. package/src/.omc/state/sessions/2ac0dcd0-01f7-41a8-a8c9-f2195599817b/mission-state.json +0 -79
  465. package/src/.omc/state/sessions/2ac0dcd0-01f7-41a8-a8c9-f2195599817b/pre-tool-advisory-throttle.json +0 -26
  466. package/src/.omc/state/sessions/2ac0dcd0-01f7-41a8-a8c9-f2195599817b/subagent-tracking-state.json +0 -26
  467. package/src/.omc/state/sessions/2ccbd177-0d5d-4d4a-ab94-a22464786221/last-tool-error-state.json +0 -7
  468. package/src/.omc/state/sessions/2ccbd177-0d5d-4d4a-ab94-a22464786221/mission-state.json +0 -53
  469. package/src/.omc/state/sessions/2ccbd177-0d5d-4d4a-ab94-a22464786221/pre-tool-advisory-throttle.json +0 -22
  470. package/src/.omc/state/sessions/2ccbd177-0d5d-4d4a-ab94-a22464786221/subagent-tracking-state.json +0 -17
  471. package/src/.omc/state/sessions/707b4784-2117-4b19-ae68-68a031f0d76d/last-tool-error-state.json +0 -7
  472. package/src/.omc/state/sessions/707b4784-2117-4b19-ae68-68a031f0d76d/mission-state.json +0 -53
  473. package/src/.omc/state/sessions/707b4784-2117-4b19-ae68-68a031f0d76d/pre-tool-advisory-throttle.json +0 -22
  474. package/src/.omc/state/sessions/707b4784-2117-4b19-ae68-68a031f0d76d/subagent-tracking-state.json +0 -17
  475. package/src/.omc/state/sessions/8dd0ad2f-3a90-4158-b9de-ec8e19a7c983/mission-state.json +0 -79
  476. package/src/.omc/state/sessions/8dd0ad2f-3a90-4158-b9de-ec8e19a7c983/pre-tool-advisory-throttle.json +0 -22
  477. package/src/.omc/state/sessions/8dd0ad2f-3a90-4158-b9de-ec8e19a7c983/ralph-state.json +0 -13
  478. package/src/.omc/state/sessions/8dd0ad2f-3a90-4158-b9de-ec8e19a7c983/subagent-tracking-state.json +0 -26
  479. package/src/.omc/state/sessions/8dd0ad2f-3a90-4158-b9de-ec8e19a7c983/ultrawork-state.json +0 -11
  480. package/src/.omc/state/sessions/c513ef38-cc3e-4a29-9c4c-1e0137245dd5/mission-state.json +0 -79
  481. package/src/.omc/state/sessions/c513ef38-cc3e-4a29-9c4c-1e0137245dd5/pre-tool-advisory-throttle.json +0 -22
  482. package/src/.omc/state/sessions/c513ef38-cc3e-4a29-9c4c-1e0137245dd5/subagent-tracking-state.json +0 -26
  483. package/src/.omc/state/sessions/ed3e2cfb-a666-4bb1-bcc1-569d5d0b837a/pre-tool-advisory-throttle.json +0 -18
  484. package/src/.omc/state/sessions/ed3e2cfb-a666-4bb1-bcc1-569d5d0b837a/ralph-state.json +0 -13
  485. package/src/.omc/state/sessions/ed3e2cfb-a666-4bb1-bcc1-569d5d0b837a/ultrawork-state.json +0 -11
  486. package/src/.omc/state/sessions/f99d8dad-81d1-4987-8183-62edf0843d0c/pre-tool-advisory-throttle.json +0 -14
  487. package/src/commands/.omc/state/sessions/afc6290b-40d3-4bef-b3b6-14484c034ab9/pre-tool-advisory-throttle.json +0 -14
  488. package/src/commands/.omc/state/sessions/c967c819-3d1c-447b-ab48-56a8448ef9f8/pre-tool-advisory-throttle.json +0 -18
  489. package/src/commands/.omc/state/sessions/f09f401f-56c6-42cd-97be-c742c1956468/pre-tool-advisory-throttle.json +0 -14
  490. package/src/commands/audit/.omc/state/agent-replay-f9c17a0e-2dd8-4f7d-badf-631f266c5d4c.jsonl +0 -4
  491. package/src/commands/audit/.omc/state/sessions/f9c17a0e-2dd8-4f7d-badf-631f266c5d4c/mission-state.json +0 -79
  492. package/src/commands/audit/.omc/state/sessions/f9c17a0e-2dd8-4f7d-badf-631f266c5d4c/pre-tool-advisory-throttle.json +0 -22
  493. package/src/commands/audit/.omc/state/sessions/f9c17a0e-2dd8-4f7d-badf-631f266c5d4c/subagent-tracking-state.json +0 -26
  494. package/src/commands/audit/__tests__/audit.test.ts +0 -59
  495. package/src/commands/audit/audit.ts +0 -177
  496. package/src/commands/audit/index.ts +0 -1
  497. package/src/commands/config/.omc/state/sessions/41336850-028c-476b-be1a-2164e1e46cac/last-tool-error-state.json +0 -7
  498. package/src/commands/config/.omc/state/sessions/41336850-028c-476b-be1a-2164e1e46cac/pre-tool-advisory-throttle.json +0 -18
  499. package/src/commands/config/config.ts +0 -137
  500. package/src/commands/config/index.ts +0 -1
  501. package/src/commands/doctor/.omc/state/sessions/8dd0ad2f-3a90-4158-b9de-ec8e19a7c983/pre-tool-advisory-throttle.json +0 -14
  502. package/src/commands/doctor/__tests__/agent-files.test.ts +0 -88
  503. package/src/commands/doctor/__tests__/check-ide-installed.test.ts +0 -142
  504. package/src/commands/doctor/__tests__/check-legacy-user-global-config.test.ts +0 -110
  505. package/src/commands/doctor/doctor.ts +0 -576
  506. package/src/commands/doctor/index.ts +0 -1
  507. package/src/commands/env-autoload/env-autoload.ts +0 -24
  508. package/src/commands/env-autoload/index.ts +0 -1
  509. package/src/commands/env-clear/__tests__/env-clear.test.ts +0 -27
  510. package/src/commands/env-clear/env-clear.ts +0 -136
  511. package/src/commands/env-clear/index.ts +0 -1
  512. package/src/commands/env-list/env-list.ts +0 -48
  513. package/src/commands/env-list/index.ts +0 -1
  514. package/src/commands/env-load/__tests__/env-load.test.ts +0 -200
  515. package/src/commands/env-load/env-load.ts +0 -394
  516. package/src/commands/env-load/index.ts +0 -2
  517. package/src/commands/env-status/__tests__/env-status.test.ts +0 -78
  518. package/src/commands/env-status/env-status.ts +0 -108
  519. package/src/commands/env-status/index.ts +0 -1
  520. package/src/commands/gh-merge-dev/gh-merge-dev.ts +0 -203
  521. package/src/commands/gh-merge-dev/index.ts +0 -1
  522. package/src/commands/gh-release-deliver/gh-release-deliver.ts +0 -470
  523. package/src/commands/gh-release-deliver/index.ts +0 -1
  524. package/src/commands/gh-release-deploy-all/gh-release-deploy-all.ts +0 -207
  525. package/src/commands/gh-release-deploy-all/index.ts +0 -1
  526. package/src/commands/gh-release-deploy-selected/gh-release-deploy-selected.ts +0 -303
  527. package/src/commands/gh-release-deploy-selected/index.ts +0 -1
  528. package/src/commands/gh-release-list/gh-release-list.ts +0 -90
  529. package/src/commands/gh-release-list/index.ts +0 -1
  530. package/src/commands/init/.omc/state/sessions/8dd0ad2f-3a90-4158-b9de-ec8e19a7c983/pre-tool-advisory-throttle.json +0 -18
  531. package/src/commands/init/__tests__/agent-files.test.ts +0 -265
  532. package/src/commands/init/__tests__/migrate-config.test.ts +0 -422
  533. package/src/commands/init/__tests__/migrate-factory-config.test.ts +0 -93
  534. package/src/commands/init/__tests__/seed-user-global-config.test.ts +0 -64
  535. package/src/commands/init/__tests__/shell-body.test.ts +0 -131
  536. package/src/commands/init/agent-files.ts +0 -219
  537. package/src/commands/init/index.ts +0 -8
  538. package/src/commands/init/init.ts +0 -440
  539. package/src/commands/init/migrate-config.ts +0 -378
  540. package/src/commands/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  541. package/src/commands/release-create/__tests__/release-create.test.ts +0 -92
  542. package/src/commands/release-create/index.ts +0 -1
  543. package/src/commands/release-create/release-create.ts +0 -447
  544. package/src/commands/release-desc-edit/index.ts +0 -1
  545. package/src/commands/release-desc-edit/release-desc-edit.ts +0 -227
  546. package/src/commands/vendor-check/__tests__/runtime-isolation.test.ts +0 -71
  547. package/src/commands/vendor-check/__tests__/vendor-check.test.ts +0 -87
  548. package/src/commands/vendor-check/index.ts +0 -1
  549. package/src/commands/vendor-check/vendor-check.ts +0 -127
  550. package/src/commands/vendor-config/__tests__/vendor-config.test.ts +0 -103
  551. package/src/commands/vendor-config/index.ts +0 -1
  552. package/src/commands/vendor-config/vendor-config.ts +0 -162
  553. package/src/commands/vendor-diff/__tests__/vendor-diff.test.ts +0 -74
  554. package/src/commands/vendor-diff/index.ts +0 -1
  555. package/src/commands/vendor-diff/vendor-diff.ts +0 -77
  556. package/src/commands/vendor-manifest/index.ts +0 -1
  557. package/src/commands/vendor-manifest/vendor-manifest.ts +0 -60
  558. package/src/commands/vendor-sync/__tests__/vendor-write.test.ts +0 -86
  559. package/src/commands/vendor-sync/index.ts +0 -1
  560. package/src/commands/vendor-sync/vendor-sync.ts +0 -90
  561. package/src/commands/version/index.ts +0 -1
  562. package/src/commands/version/version.ts +0 -33
  563. package/src/commands/worktrees-add/index.ts +0 -1
  564. package/src/commands/worktrees-add/worktrees-add.ts +0 -366
  565. package/src/commands/worktrees-list/index.ts +0 -1
  566. package/src/commands/worktrees-list/worktrees-list.ts +0 -105
  567. package/src/commands/worktrees-reload/__tests__/reload-cmux.test.ts +0 -119
  568. package/src/commands/worktrees-reload/index.ts +0 -1
  569. package/src/commands/worktrees-reload/worktrees-reload.ts +0 -230
  570. package/src/commands/worktrees-remove/index.ts +0 -1
  571. package/src/commands/worktrees-remove/worktrees-remove.ts +0 -199
  572. package/src/commands/worktrees-sync/index.ts +0 -1
  573. package/src/commands/worktrees-sync/worktrees-sync.ts +0 -198
  574. package/src/dev/__tests__/dev-server-options.test.ts +0 -57
  575. package/src/dev/__tests__/dev-server.test.ts +0 -420
  576. package/src/dev/__tests__/discovery.test.ts +0 -181
  577. package/src/dev/__tests__/fixtures.ts +0 -257
  578. package/src/dev/__tests__/ports.test.ts +0 -98
  579. package/src/dev/__tests__/serverless-local-run.test.ts +0 -533
  580. package/src/dev/dev-server.ts +0 -796
  581. package/src/dev/discovery.ts +0 -229
  582. package/src/dev/interfaces.ts +0 -11
  583. package/src/dev/managed-child.ts +0 -73
  584. package/src/dev/ports.ts +0 -100
  585. package/src/dev/serverless-local-run.ts +0 -329
  586. package/src/dev/turbo-watch.ts +0 -62
  587. package/src/dev/ui-dev.ts +0 -62
  588. package/src/entry/cli.ts +0 -630
  589. package/src/entry/dev-server.ts +0 -103
  590. package/src/entry/index.ts +0 -11
  591. package/src/entry/mcp.ts +0 -43
  592. package/src/integrations/cmux/__tests__/canonicalize-cmux-title.test.ts +0 -56
  593. package/src/integrations/cmux/__tests__/close-workspace-by-title.test.ts +0 -63
  594. package/src/integrations/cmux/__tests__/list-workspace-titles.test.ts +0 -65
  595. package/src/integrations/cmux/__tests__/open-workspace-with-layout.test.ts +0 -127
  596. package/src/integrations/cmux/canonicalize-cmux-title.ts +0 -31
  597. package/src/integrations/cmux/close-workspace-by-title.ts +0 -59
  598. package/src/integrations/cmux/index.ts +0 -5
  599. package/src/integrations/cmux/list-workspace-titles.ts +0 -47
  600. package/src/integrations/cmux/open-workspace-with-layout.ts +0 -80
  601. package/src/integrations/cmux/workspace-title.ts +0 -23
  602. package/src/integrations/cursor/.omc/state/agent-replay-f99d8dad-81d1-4987-8183-62edf0843d0c.jsonl +0 -2
  603. package/src/integrations/cursor/.omc/state/idle-notif-cooldown.json +0 -3
  604. package/src/integrations/cursor/.omc/state/sessions/f99d8dad-81d1-4987-8183-62edf0843d0c/pre-tool-advisory-throttle.json +0 -18
  605. package/src/integrations/cursor/.omc/state/sessions/f99d8dad-81d1-4987-8183-62edf0843d0c/subagent-tracking-state.json +0 -17
  606. package/src/integrations/cursor/add-folders-to-workspace.ts +0 -84
  607. package/src/integrations/cursor/index.ts +0 -6
  608. package/src/integrations/cursor/launch-cursor.ts +0 -12
  609. package/src/integrations/cursor/open-cursor-workspace.ts +0 -64
  610. package/src/integrations/cursor/reconcile-workspace-folders.ts +0 -90
  611. package/src/integrations/cursor/remove-folders-from-workspace.ts +0 -93
  612. package/src/integrations/cursor/resolve-workspace-path.ts +0 -13
  613. package/src/integrations/doppler/__tests__/doppler-errors.test.ts +0 -76
  614. package/src/integrations/doppler/doppler-cli-auth.ts +0 -31
  615. package/src/integrations/doppler/doppler-errors.ts +0 -88
  616. package/src/integrations/doppler/doppler-project.ts +0 -90
  617. package/src/integrations/doppler/index.ts +0 -4
  618. package/src/integrations/gh/gh-cli-auth/gh-cli-auth.ts +0 -29
  619. package/src/integrations/gh/gh-cli-auth/index.ts +0 -1
  620. package/src/integrations/gh/gh-release-prs/.omc/state/sessions/c6ed6186-1aac-48e0-aa2a-edc6da8e0410/pre-tool-advisory-throttle.json +0 -10
  621. package/src/integrations/gh/gh-release-prs/__tests__/gh-release-prs.test.ts +0 -198
  622. package/src/integrations/gh/gh-release-prs/gh-release-prs.ts +0 -206
  623. package/src/integrations/gh/gh-release-prs/index.ts +0 -2
  624. package/src/integrations/gh/index.ts +0 -3
  625. package/src/integrations/ide/__tests__/ide-facade.test.ts +0 -289
  626. package/src/integrations/ide/add-ide-worktree-folders.ts +0 -77
  627. package/src/integrations/ide/index.ts +0 -6
  628. package/src/integrations/ide/open-ide-workspace.ts +0 -51
  629. package/src/integrations/ide/provider-label.ts +0 -24
  630. package/src/integrations/ide/remove-ide-worktree-folders.ts +0 -145
  631. package/src/integrations/ide/types.ts +0 -41
  632. package/src/integrations/jira/api.ts +0 -325
  633. package/src/integrations/jira/index.ts +0 -19
  634. package/src/integrations/jira/types.ts +0 -85
  635. package/src/integrations/linear/.gitkeep +0 -0
  636. package/src/integrations/zed/__tests__/open-zed-workspace.test.ts +0 -69
  637. package/src/integrations/zed/__tests__/reuse-zed-workspace.test.ts +0 -86
  638. package/src/integrations/zed/add-folders-to-zed-workspace.ts +0 -30
  639. package/src/integrations/zed/index.ts +0 -3
  640. package/src/integrations/zed/open-zed-workspace.ts +0 -51
  641. package/src/integrations/zed/reuse-zed-workspace.ts +0 -57
  642. package/src/lib/.omc/state/sessions/f9c17a0e-2dd8-4f7d-badf-631f266c5d4c/pre-tool-advisory-throttle.json +0 -18
  643. package/src/lib/assert-never/assert-never.ts +0 -15
  644. package/src/lib/assert-never/index.ts +0 -1
  645. package/src/lib/command-catalog/__tests__/__snapshots__/command-catalog.test.ts.snap +0 -213
  646. package/src/lib/command-catalog/__tests__/command-catalog.test.ts +0 -193
  647. package/src/lib/command-catalog/command-catalog.ts +0 -146
  648. package/src/lib/command-catalog/index.ts +0 -2
  649. package/src/lib/command-echo/__tests__/command-echo.test.ts +0 -127
  650. package/src/lib/command-echo/command-echo.ts +0 -78
  651. package/src/lib/command-echo/index.ts +0 -1
  652. package/src/lib/constants/__tests__/constants.test.ts +0 -182
  653. package/src/lib/constants/constants.ts +0 -167
  654. package/src/lib/constants/index.ts +0 -22
  655. package/src/lib/env-autoload/__tests__/env-autoload.test.ts +0 -327
  656. package/src/lib/env-autoload/env-autoload.ts +0 -373
  657. package/src/lib/env-autoload/index.ts +0 -9
  658. package/src/lib/error-handlers/index.ts +0 -36
  659. package/src/lib/errors/__tests__/is-prompt-cancellation.test.ts +0 -48
  660. package/src/lib/errors/__tests__/operation-error.test.ts +0 -62
  661. package/src/lib/errors/format-zx-error.ts +0 -54
  662. package/src/lib/errors/is-prompt-cancellation.ts +0 -38
  663. package/src/lib/errors/operation-error.ts +0 -80
  664. package/src/lib/git-guard/__tests__/git-guard.test.ts +0 -92
  665. package/src/lib/git-guard/git-guard.ts +0 -55
  666. package/src/lib/git-guard/index.ts +0 -2
  667. package/src/lib/git-utils/__tests__/git-primitives.test.ts +0 -217
  668. package/src/lib/git-utils/__tests__/git-utils.test.ts +0 -49
  669. package/src/lib/git-utils/git-utils.ts +0 -179
  670. package/src/lib/git-utils/index.ts +0 -10
  671. package/src/lib/infra-kit-config/.omc/state/sessions/8dd0ad2f-3a90-4158-b9de-ec8e19a7c983/pre-tool-advisory-throttle.json +0 -18
  672. package/src/lib/infra-kit-config/__tests__/env-autoload-schema.test.ts +0 -71
  673. package/src/lib/infra-kit-config/__tests__/infra-kit-config.test.ts +0 -504
  674. package/src/lib/infra-kit-config/index.ts +0 -19
  675. package/src/lib/infra-kit-config/infra-kit-config.ts +0 -454
  676. package/src/lib/json-output/__tests__/json-output.test.ts +0 -139
  677. package/src/lib/json-output/index.ts +0 -1
  678. package/src/lib/json-output/json-output.ts +0 -47
  679. package/src/lib/logger/index.ts +0 -40
  680. package/src/lib/managed-block/__tests__/managed-block.test.ts +0 -121
  681. package/src/lib/managed-block/index.ts +0 -8
  682. package/src/lib/managed-block/managed-block.ts +0 -145
  683. package/src/lib/package-config/.omc/state/sessions/dde22a92-a0e9-4948-905d-25c9a812ab35/last-tool-error-state.json +0 -7
  684. package/src/lib/package-config/.omc/state/sessions/dde22a92-a0e9-4948-905d-25c9a812ab35/pre-tool-advisory-throttle.json +0 -10
  685. package/src/lib/package-config/__tests__/package-config.test.ts +0 -95
  686. package/src/lib/package-config/index.ts +0 -3
  687. package/src/lib/package-config/package-config-schema.ts +0 -19
  688. package/src/lib/package-config/package-config.ts +0 -97
  689. package/src/lib/package-validator/.omc/state/sessions/f9c17a0e-2dd8-4f7d-badf-631f266c5d4c/pre-tool-advisory-throttle.json +0 -10
  690. package/src/lib/package-validator/__tests__/package-validator.test.ts +0 -270
  691. package/src/lib/package-validator/checks/__tests__/checks.test.ts +0 -130
  692. package/src/lib/package-validator/checks/config-check.ts +0 -30
  693. package/src/lib/package-validator/checks/files-check.ts +0 -29
  694. package/src/lib/package-validator/checks/index.ts +0 -4
  695. package/src/lib/package-validator/checks/scripts-check.ts +0 -23
  696. package/src/lib/package-validator/checks/turbo-check.ts +0 -47
  697. package/src/lib/package-validator/fs-utils.ts +0 -18
  698. package/src/lib/package-validator/index.ts +0 -3
  699. package/src/lib/package-validator/loader/config-loader.ts +0 -77
  700. package/src/lib/package-validator/loader/index.ts +0 -2
  701. package/src/lib/package-validator/loader/package-discovery.ts +0 -98
  702. package/src/lib/package-validator/package-validator.ts +0 -48
  703. package/src/lib/package-validator/types.ts +0 -15
  704. package/src/lib/path-display/index.ts +0 -1
  705. package/src/lib/path-display/path-display.ts +0 -42
  706. package/src/lib/release-id/__tests__/release-id.test.ts +0 -359
  707. package/src/lib/release-id/__tests__/versioned-regression.test.ts +0 -69
  708. package/src/lib/release-id/index.ts +0 -15
  709. package/src/lib/release-id/release-id.ts +0 -258
  710. package/src/lib/release-utils/__tests__/release-utils.test.ts +0 -122
  711. package/src/lib/release-utils/index.ts +0 -15
  712. package/src/lib/release-utils/release-utils.ts +0 -231
  713. package/src/lib/render/__tests__/render.test.ts +0 -48
  714. package/src/lib/render/index.ts +0 -1
  715. package/src/lib/render/render.ts +0 -24
  716. package/src/lib/tool-handler/index.ts +0 -1
  717. package/src/lib/tool-handler/tool-handler.ts +0 -30
  718. package/src/lib/vendor/.omc/state/sessions/f09f401f-56c6-42cd-97be-c742c1956468/pre-tool-advisory-throttle.json +0 -10
  719. package/src/lib/vendor/__tests__/config-schema.test.ts +0 -31
  720. package/src/lib/vendor/__tests__/config.test.ts +0 -63
  721. package/src/lib/vendor/__tests__/factory-config.test.ts +0 -92
  722. package/src/lib/vendor/__tests__/vendor-lib.test.ts +0 -158
  723. package/src/lib/vendor/__tests__/zx-mock.ts +0 -32
  724. package/src/lib/vendor/config-schema.ts +0 -78
  725. package/src/lib/vendor/config.ts +0 -58
  726. package/src/lib/vendor/factory-config-schema.ts +0 -35
  727. package/src/lib/vendor/factory-config.ts +0 -91
  728. package/src/lib/vendor/hash.ts +0 -16
  729. package/src/lib/vendor/index.ts +0 -23
  730. package/src/lib/vendor/manifest.ts +0 -151
  731. package/src/lib/vendor/skip-sets.ts +0 -48
  732. package/src/lib/vendor/sync-ops.ts +0 -290
  733. package/src/lib/vendor/walk.ts +0 -56
  734. package/src/lib/version-utils/__tests__/load-existing-versions.test.ts +0 -37
  735. package/src/lib/version-utils/__tests__/next-version.test.ts +0 -407
  736. package/src/lib/version-utils/index.ts +0 -18
  737. package/src/lib/version-utils/load-existing-versions.ts +0 -86
  738. package/src/lib/version-utils/next-version.ts +0 -283
  739. package/src/lib/version-utils/version-utils.ts +0 -31
  740. package/src/lib/warm-cache/__tests__/warm-cache.test.ts +0 -164
  741. package/src/lib/warm-cache/index.ts +0 -7
  742. package/src/lib/warm-cache/warm-cache.ts +0 -136
  743. package/src/lib/worktrees/__tests__/remove-worktrees.test.ts +0 -167
  744. package/src/lib/worktrees/index.ts +0 -1
  745. package/src/lib/worktrees/remove-worktrees.ts +0 -66
  746. package/src/mcp/prompts/index.ts +0 -3
  747. package/src/mcp/resources/index.ts +0 -3
  748. package/src/mcp/server.ts +0 -27
  749. package/src/mcp/tools/index.ts +0 -21
  750. package/src/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  751. package/src/sanity.test.tsx +0 -8
  752. package/src/tui/__tests__/boot.test.tsx +0 -61
  753. package/src/tui/__tests__/no-react-boundary.test.ts +0 -51
  754. package/src/tui/boot.tsx +0 -60
  755. package/src/tui/screens/__tests__/command-palette.test.tsx +0 -136
  756. package/src/tui/screens/command-palette.tsx +0 -159
  757. package/src/tui/types.ts +0 -8
  758. package/src/types.ts +0 -66
  759. package/tsconfig.json +0 -46
  760. package/tsconfig.tsbuildinfo +0 -1
  761. package/vitest.config.ts +0 -26
  762. package/vitest.setup.ts +0 -1
@@ -1,327 +0,0 @@
1
- import fs from 'node:fs'
2
- import os from 'node:os'
3
- import path from 'node:path'
4
- import process from 'node:process'
5
- import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
6
-
7
- import { writeEnvLoadFile } from 'src/commands/env-load'
8
- import {
9
- INFRA_KIT_ENV_AUTOLOADED_VAR,
10
- INFRA_KIT_ENV_CLEARED_VAR,
11
- INFRA_KIT_ENV_CONFIG_VAR,
12
- INFRA_KIT_ENV_PROJECT_VAR,
13
- INFRA_KIT_SESSION_VAR,
14
- } from 'src/lib/constants'
15
- import { getInfraKitConfig } from 'src/lib/infra-kit-config'
16
- import { logger } from 'src/lib/logger'
17
-
18
- import { decideAutoLoad, resolveEnvAutoLoad, runEnvAutoLoad } from '../env-autoload'
19
- import type { AutoLoadDecisionInput, AutoLoadEnvSnapshot } from '../env-autoload'
20
-
21
- vi.mock('src/lib/infra-kit-config', () => {
22
- return { getInfraKitConfig: vi.fn() }
23
- })
24
-
25
- vi.mock('src/commands/env-load', () => {
26
- return { writeEnvLoadFile: vi.fn() }
27
- })
28
-
29
- vi.mock('src/lib/logger', () => {
30
- return { logger: { warn: vi.fn(), debug: vi.fn() } }
31
- })
32
-
33
- const baseConfig = {
34
- environments: ['dev', 'prod'],
35
- envManagement: { provider: 'doppler', config: { name: 'my-project' } },
36
- }
37
-
38
- const buildInput = (overrides: Partial<AutoLoadDecisionInput> = {}): AutoLoadDecisionInput => {
39
- return {
40
- trigger: 'cli-invocation',
41
- expectedTrigger: 'cli-invocation',
42
- targetConfig: 'dev',
43
- targetProject: 'my-project',
44
- env: { session: 'sess-1' },
45
- ...overrides,
46
- }
47
- }
48
-
49
- const loadedEnv = (overrides: Partial<AutoLoadEnvSnapshot> = {}): AutoLoadEnvSnapshot => {
50
- return {
51
- session: 'sess-1',
52
- currentConfig: 'dev',
53
- currentProject: 'my-project',
54
- autoLoadedMarker: '1',
55
- ...overrides,
56
- }
57
- }
58
-
59
- describe('decideAutoLoad — trigger gating', () => {
60
- it('loads when the configured trigger matches this callsite', () => {
61
- expect(decideAutoLoad(buildInput({ trigger: 'cli-invocation', expectedTrigger: 'cli-invocation' }))).toBe('load')
62
- expect(decideAutoLoad(buildInput({ trigger: 'shell-startup', expectedTrigger: 'shell-startup' }))).toBe('load')
63
- })
64
-
65
- it('skips when the configured trigger is for the other callsite', () => {
66
- expect(decideAutoLoad(buildInput({ trigger: 'shell-startup', expectedTrigger: 'cli-invocation' }))).toBe('skip')
67
- expect(decideAutoLoad(buildInput({ trigger: 'cli-invocation', expectedTrigger: 'shell-startup' }))).toBe('skip')
68
- })
69
- })
70
-
71
- describe('decideAutoLoad — session + clear guards', () => {
72
- it('skips when no session is set (cache dir is session-scoped)', () => {
73
- expect(decideAutoLoad(buildInput({ env: { session: undefined } }))).toBe('skip')
74
- })
75
-
76
- // Regression M2: a deliberate `env-clear` must keep cli-invocation auto-load
77
- // from immediately re-loading in the same shell.
78
- it('skips when the clear sentinel is set (M2: stay cleared)', () => {
79
- expect(decideAutoLoad(buildInput({ env: { session: 'sess-1', cleared: '1' } }))).toBe('skip')
80
- })
81
- })
82
-
83
- describe('decideAutoLoad — manual-load protection (C1)', () => {
84
- // Regression C1: env loaded WITHOUT our auto marker means a manual `env-load`;
85
- // auto-load must never overwrite it, even when the target config differs.
86
- it('skips a manually-loaded env even when target config differs', () => {
87
- expect(
88
- decideAutoLoad(
89
- buildInput({
90
- targetConfig: 'dev',
91
- env: { session: 'sess-1', currentConfig: 'prod', currentProject: 'my-project', autoLoadedMarker: undefined },
92
- }),
93
- ),
94
- ).toBe('skip')
95
- })
96
- })
97
-
98
- describe('decideAutoLoad — project-aware freshness', () => {
99
- it('skips when our auto-load already matches config AND project', () => {
100
- expect(decideAutoLoad(buildInput({ env: loadedEnv() }))).toBe('skip')
101
- })
102
-
103
- it('loads when the auto-loaded config differs from target', () => {
104
- expect(decideAutoLoad(buildInput({ targetConfig: 'prod', env: loadedEnv({ currentConfig: 'dev' }) }))).toBe('load')
105
- })
106
-
107
- it('loads when the project differs even though the config name matches (worktree leak guard)', () => {
108
- expect(
109
- decideAutoLoad(buildInput({ targetProject: 'other-project', env: loadedEnv({ currentProject: 'my-project' }) })),
110
- ).toBe('load')
111
- })
112
-
113
- it('loads into a clean shell (nothing currently loaded)', () => {
114
- expect(decideAutoLoad(buildInput({ env: { session: 'sess-1' } }))).toBe('load')
115
- })
116
- })
117
-
118
- describe('decideAutoLoad — force (shell-startup warm refresh)', () => {
119
- // Regression for the warm-cache refresh defect: after a WARM source the shell has
120
- // exported the auto-load marker + same config, which the backgrounded refresh
121
- // inherits. Without `force` the refresh self-skips and stale warm secrets persist.
122
- it('forces a fresh load past the same-config no-op skip', () => {
123
- expect(decideAutoLoad(buildInput({ env: loadedEnv() }))).toBe('skip')
124
- expect(decideAutoLoad(buildInput({ env: loadedEnv(), force: true }))).toBe('load')
125
- })
126
-
127
- it('force does NOT override the clear guard', () => {
128
- expect(decideAutoLoad(buildInput({ env: loadedEnv({ cleared: '1' }), force: true }))).toBe('skip')
129
- })
130
-
131
- it('force does NOT override the manual-load guard', () => {
132
- expect(
133
- decideAutoLoad(
134
- buildInput({
135
- env: { session: 'sess-1', currentConfig: 'prod', currentProject: 'my-project', autoLoadedMarker: undefined },
136
- force: true,
137
- }),
138
- ),
139
- ).toBe('skip')
140
- })
141
- })
142
-
143
- describe('resolveEnvAutoLoad', () => {
144
- const ORIGINAL_ENV = { ...process.env }
145
- let cacheRoot: string
146
-
147
- beforeEach(() => {
148
- vi.mocked(getInfraKitConfig).mockReset()
149
- vi.mocked(logger.warn).mockClear()
150
- // Isolate the per-session warn-dedup flag in a fresh cache dir so the warning
151
- // is not suppressed by a flag left over from the dev's real session.
152
- cacheRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'ik-autoload-resolve-'))
153
- process.env.XDG_CACHE_HOME = cacheRoot
154
- process.env[INFRA_KIT_SESSION_VAR] = 'sess-resolve'
155
- })
156
-
157
- afterEach(() => {
158
- process.env = { ...ORIGINAL_ENV }
159
- fs.rmSync(cacheRoot, { recursive: true, force: true })
160
- })
161
-
162
- it('returns null when not inside a project (getInfraKitConfig throws)', async () => {
163
- vi.mocked(getInfraKitConfig).mockRejectedValue(new Error('infra-kit.json not found'))
164
-
165
- expect(await resolveEnvAutoLoad()).toBeNull()
166
- })
167
-
168
- it('returns null when envAutoLoad is absent (feature off)', async () => {
169
- vi.mocked(getInfraKitConfig).mockResolvedValue(baseConfig as never)
170
-
171
- expect(await resolveEnvAutoLoad()).toBeNull()
172
- })
173
-
174
- it('resolves trigger + config + project from one config read', async () => {
175
- vi.mocked(getInfraKitConfig).mockResolvedValue({
176
- ...baseConfig,
177
- envAutoLoad: { trigger: 'cli-invocation', config: 'dev' },
178
- } as never)
179
-
180
- expect(await resolveEnvAutoLoad()).toEqual({ trigger: 'cli-invocation', config: 'dev', project: 'my-project' })
181
- })
182
-
183
- it('warns and disables when config is not one of environments', async () => {
184
- vi.mocked(getInfraKitConfig).mockResolvedValue({
185
- ...baseConfig,
186
- envAutoLoad: { trigger: 'shell-startup', config: 'nope' },
187
- } as never)
188
-
189
- expect(await resolveEnvAutoLoad()).toBeNull()
190
- expect(logger.warn).toHaveBeenCalledOnce()
191
- expect(vi.mocked(logger.warn).mock.calls[0]![0]).toContain('nope')
192
- })
193
-
194
- // Gap 1 regression: the shell-startup callsite discards stderr, so it must NOT
195
- // warn (and must not write the dedup flag that would poison the interactive channel).
196
- it('does NOT warn on bad config when canWarn is false (shell-startup channel)', async () => {
197
- vi.mocked(getInfraKitConfig).mockResolvedValue({
198
- ...baseConfig,
199
- envAutoLoad: { trigger: 'shell-startup', config: 'nope' },
200
- } as never)
201
-
202
- expect(await resolveEnvAutoLoad(false)).toBeNull()
203
- expect(logger.warn).not.toHaveBeenCalled()
204
- })
205
- })
206
-
207
- describe('runEnvAutoLoad', () => {
208
- const ORIGINAL_ENV = { ...process.env }
209
- let cacheRoot: string
210
-
211
- beforeEach(() => {
212
- vi.mocked(getInfraKitConfig).mockReset()
213
- vi.mocked(writeEnvLoadFile).mockReset()
214
- cacheRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'ik-autoload-'))
215
- process.env.XDG_CACHE_HOME = cacheRoot
216
- process.env[INFRA_KIT_SESSION_VAR] = 'sess-run'
217
- delete process.env[INFRA_KIT_ENV_CONFIG_VAR]
218
- delete process.env[INFRA_KIT_ENV_PROJECT_VAR]
219
- delete process.env[INFRA_KIT_ENV_AUTOLOADED_VAR]
220
- delete process.env[INFRA_KIT_ENV_CLEARED_VAR]
221
- })
222
-
223
- afterEach(() => {
224
- process.env = { ...ORIGINAL_ENV }
225
- fs.rmSync(cacheRoot, { recursive: true, force: true })
226
- })
227
-
228
- it('writes an auto-loaded file and returns its path on load', async () => {
229
- vi.mocked(getInfraKitConfig).mockResolvedValue({
230
- ...baseConfig,
231
- envAutoLoad: { trigger: 'shell-startup', config: 'dev' },
232
- } as never)
233
- vi.mocked(writeEnvLoadFile).mockResolvedValue({
234
- filePath: '/cache/env-load.sh',
235
- variableCount: 3,
236
- project: 'my-project',
237
- config: 'dev',
238
- })
239
-
240
- const result = await runEnvAutoLoad({ expectedTrigger: 'shell-startup' })
241
-
242
- expect(result).toBe('/cache/env-load.sh')
243
- expect(writeEnvLoadFile).toHaveBeenCalledWith(expect.objectContaining({ config: 'dev', autoLoaded: true }))
244
- })
245
-
246
- it('returns null without throwing or warning when the write is aborted (beforeWrite returned false)', async () => {
247
- vi.mocked(getInfraKitConfig).mockResolvedValue({
248
- ...baseConfig,
249
- envAutoLoad: { trigger: 'cli-invocation', config: 'dev' },
250
- } as never)
251
- vi.mocked(writeEnvLoadFile).mockResolvedValue(null)
252
-
253
- const result = await runEnvAutoLoad({ expectedTrigger: 'cli-invocation' })
254
-
255
- expect(result).toBeNull()
256
- expect(logger.warn).not.toHaveBeenCalled()
257
- expect(logger.debug).not.toHaveBeenCalled()
258
- })
259
-
260
- it('returns null without fetching when the configured trigger is for the other callsite', async () => {
261
- vi.mocked(getInfraKitConfig).mockResolvedValue({
262
- ...baseConfig,
263
- envAutoLoad: { trigger: 'shell-startup', config: 'dev' },
264
- } as never)
265
-
266
- const result = await runEnvAutoLoad({ expectedTrigger: 'cli-invocation' })
267
-
268
- expect(result).toBeNull()
269
- expect(writeEnvLoadFile).not.toHaveBeenCalled()
270
- })
271
-
272
- it('returns null and never fetches when env is already fresh', async () => {
273
- vi.mocked(getInfraKitConfig).mockResolvedValue({
274
- ...baseConfig,
275
- envAutoLoad: { trigger: 'cli-invocation', config: 'dev' },
276
- } as never)
277
- process.env[INFRA_KIT_ENV_CONFIG_VAR] = 'dev'
278
- process.env[INFRA_KIT_ENV_PROJECT_VAR] = 'my-project'
279
- process.env[INFRA_KIT_ENV_AUTOLOADED_VAR] = '1'
280
-
281
- const result = await runEnvAutoLoad({ expectedTrigger: 'cli-invocation' })
282
-
283
- expect(result).toBeNull()
284
- expect(writeEnvLoadFile).not.toHaveBeenCalled()
285
- })
286
-
287
- it('swallows transient failures to a debug log (shell-startup) and returns null', async () => {
288
- vi.mocked(getInfraKitConfig).mockResolvedValue({
289
- ...baseConfig,
290
- envAutoLoad: { trigger: 'shell-startup', config: 'dev' },
291
- } as never)
292
- vi.mocked(writeEnvLoadFile).mockRejectedValue(new Error('doppler not authenticated'))
293
-
294
- const result = await runEnvAutoLoad({ expectedTrigger: 'shell-startup' })
295
-
296
- expect(result).toBeNull()
297
- expect(logger.debug).toHaveBeenCalled()
298
- expect(logger.warn).not.toHaveBeenCalled()
299
- })
300
-
301
- it('surfaces a transient failure once on the cli-invocation channel', async () => {
302
- vi.mocked(getInfraKitConfig).mockResolvedValue({
303
- ...baseConfig,
304
- envAutoLoad: { trigger: 'cli-invocation', config: 'dev' },
305
- } as never)
306
- vi.mocked(writeEnvLoadFile).mockRejectedValue(new Error('doppler not authenticated'))
307
-
308
- const result = await runEnvAutoLoad({ expectedTrigger: 'cli-invocation' })
309
-
310
- expect(result).toBeNull()
311
- expect(logger.warn).toHaveBeenCalledOnce()
312
- expect(vi.mocked(logger.warn).mock.calls[0]![0]).toContain('failed')
313
- })
314
-
315
- it('backs off: after a failure the next run skips Doppler (writeEnvLoadFile called once)', async () => {
316
- vi.mocked(getInfraKitConfig).mockResolvedValue({
317
- ...baseConfig,
318
- envAutoLoad: { trigger: 'cli-invocation', config: 'dev' },
319
- } as never)
320
- vi.mocked(writeEnvLoadFile).mockRejectedValue(new Error('network down'))
321
-
322
- expect(await runEnvAutoLoad({ expectedTrigger: 'cli-invocation' })).toBeNull()
323
- expect(await runEnvAutoLoad({ expectedTrigger: 'cli-invocation' })).toBeNull()
324
-
325
- expect(writeEnvLoadFile).toHaveBeenCalledOnce()
326
- })
327
- })
@@ -1,373 +0,0 @@
1
- import fs from 'node:fs'
2
- import path from 'node:path'
3
- import process from 'node:process'
4
-
5
- import { writeEnvLoadFile } from 'src/commands/env-load'
6
- import {
7
- ENV_CLEAR_FILE,
8
- ENV_LOAD_FILE,
9
- INFRA_KIT_ENV_AUTOLOADED_VAR,
10
- INFRA_KIT_ENV_CLEARED_VAR,
11
- INFRA_KIT_ENV_CONFIG_VAR,
12
- INFRA_KIT_ENV_PROJECT_VAR,
13
- INFRA_KIT_SESSION_VAR,
14
- getSessionCacheDir,
15
- } from 'src/lib/constants'
16
- import type { EnvAutoLoadConfig } from 'src/lib/infra-kit-config'
17
- import { getInfraKitConfig } from 'src/lib/infra-kit-config'
18
- import { logger } from 'src/lib/logger'
19
-
20
- /** Which moment a concrete callsite represents. Matches the config `trigger`. */
21
- export type AutoLoadTrigger = EnvAutoLoadConfig['trigger']
22
-
23
- /** Per-session flag de-duping the MISCONFIG warning (bad envAutoLoad.config). */
24
- const WARN_MISCONFIG_SENTINEL_FILE = 'autoload-warn-misconfig.flag'
25
- /** Per-session flag de-duping the transient-FAILURE warning (Doppler down/unauth). */
26
- const WARN_FAIL_SENTINEL_FILE = 'autoload-warn-fail.flag'
27
-
28
- /** Per-session marker recording the last auto-load failure (mtime = when). */
29
- const FAIL_SENTINEL_FILE = 'autoload-fail.flag'
30
-
31
- /**
32
- * After a failed auto-load, suppress retries for this long so a down/unauthenticated
33
- * Doppler isn't re-probed on every cli-invocation. A new shell starts a fresh
34
- * session cache dir, so this only throttles within one session.
35
- */
36
- const FAIL_BACKOFF_MS = 30_000
37
-
38
- /** Resolved auto-load inputs: the chosen trigger + the env config and Doppler project to load. */
39
- export interface ResolvedEnvAutoLoad {
40
- trigger: AutoLoadTrigger
41
- config: string
42
- project: string
43
- }
44
-
45
- /**
46
- * Read the resolved + validated env auto-load inputs, or `null` when auto-load
47
- * should not run. Returns `null` (never throws) when:
48
- * - we're not inside an infra-kit project (getInfraKitConfig throws), or config is unreadable;
49
- * - `envAutoLoad` is absent (feature off);
50
- * - `envAutoLoad.config` is not one of `environments` — warns once per session, then disables.
51
- *
52
- * Validation lives here (not in the schema) so a typo only disables this optional
53
- * feature instead of throwing inside the merged-config parse and breaking every command.
54
- * Resolves the Doppler project from the SAME config read (no second getInfraKitConfig),
55
- * so the skip path stays cheap.
56
- *
57
- * `canWarn` gates the misconfig warning: the shell-startup callsite runs backgrounded
58
- * with stderr discarded, so warning there is invisible AND would write the dedup flag,
59
- * poisoning the only channel (cli-invocation / interactive) that can actually surface
60
- * it. So shell-startup passes `false`; interactive callsites pass `true`.
61
- */
62
- export const resolveEnvAutoLoad = async (canWarn = true): Promise<ResolvedEnvAutoLoad | null> => {
63
- let config
64
-
65
- try {
66
- config = await getInfraKitConfig()
67
- } catch {
68
- return null
69
- }
70
-
71
- const autoLoad = config.envAutoLoad
72
-
73
- if (!autoLoad) return null
74
-
75
- if (!config.environments.includes(autoLoad.config)) {
76
- if (canWarn) {
77
- warnOnce(
78
- `infra-kit: envAutoLoad.config "${autoLoad.config}" is not one of environments [${config.environments.join(
79
- ', ',
80
- )}] — env auto-load disabled.`,
81
- WARN_MISCONFIG_SENTINEL_FILE,
82
- )
83
- }
84
-
85
- return null
86
- }
87
-
88
- return {
89
- trigger: autoLoad.trigger,
90
- config: autoLoad.config,
91
- project: config.envManagement.config.name,
92
- }
93
- }
94
-
95
- /** The env-var snapshot the freshness/suppression guards read. */
96
- export interface AutoLoadEnvSnapshot {
97
- session?: string
98
- cleared?: string
99
- currentConfig?: string
100
- currentProject?: string
101
- autoLoadedMarker?: string
102
- }
103
-
104
- export interface AutoLoadDecisionInput {
105
- /** The configured trigger. */
106
- trigger: AutoLoadTrigger
107
- /** Which trigger this callsite represents. */
108
- expectedTrigger: AutoLoadTrigger
109
- targetConfig: string
110
- targetProject: string
111
- env: AutoLoadEnvSnapshot
112
- /**
113
- * Bypass ONLY the "already auto-loaded, same config+project" no-op skip, forcing
114
- * a fresh Doppler fetch. The shell-startup refresh sets this: after a WARM source
115
- * the shell has already exported INFRA_KIT_ENV_AUTOLOADED + the same config, which
116
- * the child process inherits — without `force` the refresh would self-skip and the
117
- * warm (possibly rotated) secrets would never be replaced this session. Does NOT
118
- * relax the clear/manual-load guards.
119
- */
120
- force?: boolean
121
- }
122
-
123
- export type AutoLoadDecision = 'load' | 'skip'
124
-
125
- /**
126
- * Pure decision: should this callsite (auto-)load env right now? Encodes the full
127
- * guard matrix so it is exhaustively unit-testable without Doppler or a shell:
128
- * - the configured trigger must match this callsite;
129
- * - a session must exist (the cache dir is session-scoped);
130
- * - an explicit clear suppresses auto-load (M2);
131
- * - a MANUAL load (config set, no auto marker) is never clobbered (C1);
132
- * - an auto-load already fresh for the same config AND project is a no-op
133
- * (project-aware so two same-named configs across different-repo worktrees
134
- * sharing one session don't leak each other's secrets).
135
- */
136
- export const decideAutoLoad = (input: AutoLoadDecisionInput): AutoLoadDecision => {
137
- const { trigger, expectedTrigger, targetConfig, targetProject, env, force } = input
138
-
139
- if (trigger !== expectedTrigger) return 'skip'
140
-
141
- if (!env.session) return 'skip'
142
-
143
- if (env.cleared) return 'skip'
144
-
145
- // Manual load present (a config is loaded but it wasn't auto-loaded) — leave it.
146
- if (env.currentConfig && !env.autoLoadedMarker) return 'skip'
147
-
148
- // Our own auto-load already matches the target config+project — normally a no-op,
149
- // but `force` (the shell-startup warm refresh) must re-fetch: the shell just warm
150
- // -sourced these same markers, so skipping here would strand stale secrets.
151
- if (!force && env.autoLoadedMarker && env.currentConfig === targetConfig && env.currentProject === targetProject) {
152
- return 'skip'
153
- }
154
-
155
- return 'load'
156
- }
157
-
158
- export interface RunEnvAutoLoadArgs {
159
- expectedTrigger: AutoLoadTrigger
160
- /**
161
- * Canonical (realpath'd) project dir, forwarded to `writeEnvLoadFile` to enable
162
- * the project-scoped WARM cache. Only the shell-startup spawn passes it (via
163
- * `--project-dir`); the cli-invocation trigger omits it, so warm is a
164
- * shell-startup-only optimization.
165
- */
166
- projectDir?: string
167
- /**
168
- * Force a fresh fetch past the "already auto-loaded, same config" no-op skip. The
169
- * shell-startup refresh sets this so a preceding WARM source (which exports the
170
- * same markers the child inherits) is always replaced by fresh secrets. See
171
- * {@link decideAutoLoad}. The cli-invocation trigger leaves it false.
172
- */
173
- force?: boolean
174
- }
175
-
176
- /**
177
- * Resolve config, evaluate the guards, and (if it should) produce env-load.sh with
178
- * the auto-load marker. Returns the written file path, or `null` when auto-load was
179
- * skipped or failed. NEVER throws. Transient failures (Doppler offline / not
180
- * authenticated / network) record a backoff marker so they aren't re-probed on every
181
- * command, and are surfaced once per session on the interactive (cli-invocation)
182
- * channel. No producer-side lock — a rare cold-shell double-fetch is tolerated (the
183
- * second write is atomic and idempotent).
184
- */
185
- export const runEnvAutoLoad = async ({
186
- expectedTrigger,
187
- projectDir,
188
- force,
189
- }: RunEnvAutoLoadArgs): Promise<string | null> => {
190
- // Only the cli-invocation / interactive callsite reaches a TTY; the shell-startup
191
- // spawn discards stderr, so warning there is invisible and would poison the dedup.
192
- const canWarn = expectedTrigger === 'cli-invocation'
193
-
194
- try {
195
- const resolved = await resolveEnvAutoLoad(canWarn)
196
-
197
- if (!resolved) return null
198
-
199
- const decision = decideAutoLoad({
200
- trigger: resolved.trigger,
201
- expectedTrigger,
202
- targetConfig: resolved.config,
203
- targetProject: resolved.project,
204
- env: readAutoLoadEnvSnapshot(),
205
- force,
206
- })
207
-
208
- if (decision === 'skip') return null
209
-
210
- // Disk-level clear signal: a clear that hasn't yet been sourced into this
211
- // process's env still suppresses auto-load (clear file newer than load file).
212
- if (isClearedOnDisk()) return null
213
-
214
- // Back off after a recent failure so a down/unauthenticated Doppler isn't
215
- // re-probed on every command in the same session.
216
- if (recentlyFailed()) return null
217
-
218
- const preWriteMtime = readLoadFileMtime()
219
- const result = await writeEnvLoadFile({
220
- config: resolved.config,
221
- autoLoaded: true,
222
- projectDir,
223
- // Re-check after the slow Doppler download: abort if a clear or a manual load
224
- // landed meanwhile, so a backgrounded auto-load never clobbers a deliberate action.
225
- beforeWrite: () => {
226
- return !isClearedOnDisk() && !manualLoadLandedSince(preWriteMtime)
227
- },
228
- })
229
-
230
- if (!result) return null
231
-
232
- clearFailure()
233
-
234
- return result.filePath
235
- } catch (error) {
236
- const reason = (error as Error).message
237
-
238
- recordFailure()
239
-
240
- // Surface the failure once per session on the interactive channel; stay silent
241
- // (debug only) on the backgrounded shell-startup path.
242
- if (canWarn) {
243
- warnOnce(`infra-kit: env auto-load failed — ${reason} (will retry later)`, WARN_FAIL_SENTINEL_FILE)
244
- } else {
245
- logger.debug(`env auto-load skipped: ${reason}`)
246
- }
247
-
248
- return null
249
- }
250
- }
251
-
252
- /** Snapshot the env vars the guards depend on. */
253
- const readAutoLoadEnvSnapshot = (): AutoLoadEnvSnapshot => {
254
- return {
255
- session: process.env[INFRA_KIT_SESSION_VAR],
256
- cleared: process.env[INFRA_KIT_ENV_CLEARED_VAR],
257
- currentConfig: process.env[INFRA_KIT_ENV_CONFIG_VAR],
258
- currentProject: process.env[INFRA_KIT_ENV_PROJECT_VAR],
259
- autoLoadedMarker: process.env[INFRA_KIT_ENV_AUTOLOADED_VAR],
260
- }
261
- }
262
-
263
- /** mtime of the on-disk env-load.sh, or null if absent/unreadable. */
264
- const readLoadFileMtime = (): number | null => {
265
- try {
266
- return fs.statSync(path.join(getSessionCacheDir(), ENV_LOAD_FILE)).mtimeMs
267
- } catch {
268
- return null
269
- }
270
- }
271
-
272
- /**
273
- * True when a MANUAL env-load landed on disk after `sinceMtime` (the file now
274
- * exists, is newer, and carries the manual-load `unset INFRA_KIT_ENV_AUTOLOADED`
275
- * line). Used to abort an in-flight auto-load so it never clobbers a deliberate load.
276
- */
277
- const manualLoadLandedSince = (sinceMtime: number | null): boolean => {
278
- try {
279
- const p = path.join(getSessionCacheDir(), ENV_LOAD_FILE)
280
-
281
- if (!fs.existsSync(p)) return false
282
-
283
- const mtime = fs.statSync(p).mtimeMs
284
-
285
- if (sinceMtime !== null && mtime <= sinceMtime) return false
286
-
287
- // Anchor to a whole line so the marker can't match inside a single-quoted
288
- // secret value that happens to contain this literal text.
289
- const manualMarker = new RegExp(`^unset ${INFRA_KIT_ENV_AUTOLOADED_VAR}$`, 'm')
290
-
291
- return manualMarker.test(fs.readFileSync(p, 'utf-8'))
292
- } catch {
293
- return false
294
- }
295
- }
296
-
297
- /**
298
- * True when a clear is pending on disk: an env-clear.sh exists and is at least as
299
- * new as env-load.sh (or no load file remains). Belt-and-suspenders next to the
300
- * INFRA_KIT_ENV_CLEARED env guard for the window before the shell sources the clear.
301
- */
302
- const isClearedOnDisk = (): boolean => {
303
- try {
304
- const dir = getSessionCacheDir()
305
- const clearPath = path.join(dir, ENV_CLEAR_FILE)
306
-
307
- if (!fs.existsSync(clearPath)) return false
308
-
309
- const loadPath = path.join(dir, ENV_LOAD_FILE)
310
-
311
- if (!fs.existsSync(loadPath)) return true
312
-
313
- return fs.statSync(clearPath).mtimeMs >= fs.statSync(loadPath).mtimeMs
314
- } catch {
315
- return false
316
- }
317
- }
318
-
319
- /** True when an auto-load failed within the backoff window (suppress retries). */
320
- const recentlyFailed = (): boolean => {
321
- try {
322
- const flagPath = path.join(getSessionCacheDir(), FAIL_SENTINEL_FILE)
323
-
324
- if (!fs.existsSync(flagPath)) return false
325
-
326
- return Date.now() - fs.statSync(flagPath).mtimeMs < FAIL_BACKOFF_MS
327
- } catch {
328
- return false
329
- }
330
- }
331
-
332
- /** Record an auto-load failure (refreshes the backoff window). */
333
- const recordFailure = (): void => {
334
- try {
335
- const dir = getSessionCacheDir()
336
-
337
- fs.mkdirSync(dir, { recursive: true, mode: 0o700 })
338
- fs.writeFileSync(path.join(dir, FAIL_SENTINEL_FILE), '', { mode: 0o600 })
339
- } catch {
340
- // No session cache dir — nothing to back off against.
341
- }
342
- }
343
-
344
- /** Clear the failure marker after a successful load. */
345
- const clearFailure = (): void => {
346
- try {
347
- fs.rmSync(path.join(getSessionCacheDir(), FAIL_SENTINEL_FILE), { force: true })
348
- } catch {
349
- // No session cache dir — nothing to clear.
350
- }
351
- }
352
-
353
- /**
354
- * Emit a warning at most once per shell session. Keyed on a flag file in the
355
- * session cache dir so a misconfigured `envAutoLoad.config` (or a repeated failure)
356
- * does not spam a warning on every cli-invocation. Falls back to a plain warn when
357
- * no session cache dir is available.
358
- */
359
- const warnOnce = (message: string, sentinelFile: string): void => {
360
- try {
361
- const dir = getSessionCacheDir()
362
- const flagPath = path.join(dir, sentinelFile)
363
-
364
- if (fs.existsSync(flagPath)) return
365
-
366
- fs.mkdirSync(dir, { recursive: true, mode: 0o700 })
367
- fs.writeFileSync(flagPath, '', { mode: 0o600 })
368
- } catch {
369
- // No session cache dir (e.g. INFRA_KIT_SESSION unset) — warn without de-dup.
370
- }
371
-
372
- logger.warn(message)
373
- }