infra-kit 0.1.126 → 0.1.127

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 (318) hide show
  1. package/.eslintcache +1 -1
  2. package/.omc/state/agent-replay-036daa78-5fee-4c7d-9b44-53584acb0d87.jsonl +26 -0
  3. package/.omc/state/agent-replay-0a65ec83-9de7-458d-9d0f-e56e1a26c68e.jsonl +2 -0
  4. package/.omc/state/agent-replay-1b6ffc57-2d9b-4af4-b603-f1cef7e01b0a.jsonl +17 -0
  5. package/.omc/state/agent-replay-2ac0dcd0-01f7-41a8-a8c9-f2195599817b.jsonl +5 -0
  6. package/.omc/state/agent-replay-d02e6565-5168-40c8-8629-de219a29fa43.jsonl +2 -0
  7. package/.omc/state/idle-notif-cooldown.json +1 -1
  8. package/.omc/state/sessions/036daa78-5fee-4c7d-9b44-53584acb0d87/last-tool-error-state.json +7 -0
  9. package/.omc/state/sessions/036daa78-5fee-4c7d-9b44-53584acb0d87/mission-state.json +129 -0
  10. package/.omc/state/sessions/036daa78-5fee-4c7d-9b44-53584acb0d87/pre-tool-advisory-throttle.json +34 -0
  11. package/.omc/state/sessions/036daa78-5fee-4c7d-9b44-53584acb0d87/ralph-state.json +13 -0
  12. package/.omc/state/sessions/036daa78-5fee-4c7d-9b44-53584acb0d87/ralplan-state.json +11 -0
  13. package/.omc/state/sessions/036daa78-5fee-4c7d-9b44-53584acb0d87/subagent-tracking-state.json +80 -0
  14. package/.omc/state/sessions/036daa78-5fee-4c7d-9b44-53584acb0d87/ultrawork-state.json +11 -0
  15. package/.omc/state/sessions/0a65ec83-9de7-458d-9d0f-e56e1a26c68e/pre-tool-advisory-throttle.json +18 -0
  16. package/.omc/state/sessions/0a65ec83-9de7-458d-9d0f-e56e1a26c68e/skill-active-state.json +15 -0
  17. package/.omc/state/sessions/1b6ffc57-2d9b-4af4-b603-f1cef7e01b0a/last-tool-error-state.json +7 -0
  18. package/.omc/state/sessions/1b6ffc57-2d9b-4af4-b603-f1cef7e01b0a/mission-state.json +139 -0
  19. package/.omc/state/sessions/1b6ffc57-2d9b-4af4-b603-f1cef7e01b0a/pre-tool-advisory-throttle.json +50 -0
  20. package/.omc/state/sessions/1b6ffc57-2d9b-4af4-b603-f1cef7e01b0a/ralplan-state.json +11 -0
  21. package/.omc/state/sessions/1b6ffc57-2d9b-4af4-b603-f1cef7e01b0a/subagent-tracking-state.json +90 -0
  22. package/.omc/state/sessions/2ac0dcd0-01f7-41a8-a8c9-f2195599817b/last-tool-error-state.json +7 -0
  23. package/.omc/state/sessions/2ac0dcd0-01f7-41a8-a8c9-f2195599817b/mission-state.json +79 -0
  24. package/.omc/state/sessions/2ac0dcd0-01f7-41a8-a8c9-f2195599817b/pre-tool-advisory-throttle.json +10 -0
  25. package/.omc/state/sessions/2ac0dcd0-01f7-41a8-a8c9-f2195599817b/skill-active-state.json +15 -0
  26. package/.omc/state/sessions/2ac0dcd0-01f7-41a8-a8c9-f2195599817b/subagent-tracking-state.json +26 -0
  27. package/.omc/state/sessions/7772f972-4ec1-4287-bf42-a92c14cf3ffc/pre-tool-advisory-throttle.json +10 -0
  28. package/.omc/state/sessions/d02e6565-5168-40c8-8629-de219a29fa43/last-tool-error-state.json +7 -0
  29. package/.omc/state/sessions/d02e6565-5168-40c8-8629-de219a29fa43/mission-state.json +53 -0
  30. package/.omc/state/sessions/d02e6565-5168-40c8-8629-de219a29fa43/pre-tool-advisory-throttle.json +18 -0
  31. package/.omc/state/sessions/d02e6565-5168-40c8-8629-de219a29fa43/subagent-tracking-state.json +17 -0
  32. package/.turbo/turbo-build.log +7 -6
  33. package/.turbo/turbo-eslint-check.log +2 -1
  34. package/.turbo/turbo-prettier-check.log +1 -1
  35. package/.turbo/turbo-test.log +406 -128
  36. package/.turbo/turbo-ts-check.log +1 -1
  37. package/coverage/base.css +224 -0
  38. package/coverage/block-navigation.js +87 -0
  39. package/coverage/cli/index.html +116 -0
  40. package/coverage/cli/package.json.html +283 -0
  41. package/coverage/cli/src/commands/audit/audit.ts.html +616 -0
  42. package/coverage/cli/src/commands/audit/index.html +131 -0
  43. package/coverage/cli/src/commands/audit/index.ts.html +88 -0
  44. package/coverage/cli/src/commands/doctor/doctor.ts.html +1654 -0
  45. package/coverage/cli/src/commands/doctor/index.html +131 -0
  46. package/coverage/cli/src/commands/doctor/index.ts.html +88 -0
  47. package/coverage/cli/src/commands/env-clear/env-clear.ts.html +370 -0
  48. package/coverage/cli/src/commands/env-clear/index.html +131 -0
  49. package/coverage/cli/src/commands/env-clear/index.ts.html +88 -0
  50. package/coverage/cli/src/commands/env-list/env-list.ts.html +229 -0
  51. package/coverage/cli/src/commands/env-list/index.html +131 -0
  52. package/coverage/cli/src/commands/env-list/index.ts.html +88 -0
  53. package/coverage/cli/src/commands/env-load/env-load.ts.html +1201 -0
  54. package/coverage/cli/src/commands/env-load/index.html +131 -0
  55. package/coverage/cli/src/commands/env-load/index.ts.html +91 -0
  56. package/coverage/cli/src/commands/env-status/env-status.ts.html +409 -0
  57. package/coverage/cli/src/commands/env-status/index.html +131 -0
  58. package/coverage/cli/src/commands/env-status/index.ts.html +88 -0
  59. package/coverage/cli/src/commands/gh-merge-dev/gh-merge-dev.ts.html +694 -0
  60. package/coverage/cli/src/commands/gh-merge-dev/index.html +131 -0
  61. package/coverage/cli/src/commands/gh-merge-dev/index.ts.html +88 -0
  62. package/coverage/cli/src/commands/gh-release-deliver/gh-release-deliver.ts.html +1495 -0
  63. package/coverage/cli/src/commands/gh-release-deliver/index.html +131 -0
  64. package/coverage/cli/src/commands/gh-release-deliver/index.ts.html +88 -0
  65. package/coverage/cli/src/commands/gh-release-deploy-all/gh-release-deploy-all.ts.html +706 -0
  66. package/coverage/cli/src/commands/gh-release-deploy-all/index.html +131 -0
  67. package/coverage/cli/src/commands/gh-release-deploy-all/index.ts.html +88 -0
  68. package/coverage/cli/src/commands/gh-release-deploy-selected/gh-release-deploy-selected.ts.html +994 -0
  69. package/coverage/cli/src/commands/gh-release-deploy-selected/index.html +131 -0
  70. package/coverage/cli/src/commands/gh-release-deploy-selected/index.ts.html +88 -0
  71. package/coverage/cli/src/commands/gh-release-list/gh-release-list.ts.html +355 -0
  72. package/coverage/cli/src/commands/gh-release-list/index.html +131 -0
  73. package/coverage/cli/src/commands/gh-release-list/index.ts.html +88 -0
  74. package/coverage/cli/src/commands/init/agent-files.ts.html +742 -0
  75. package/coverage/cli/src/commands/init/index.html +146 -0
  76. package/coverage/cli/src/commands/init/init.ts.html +1159 -0
  77. package/coverage/cli/src/commands/init/migrate-config.ts.html +1219 -0
  78. package/coverage/cli/src/commands/release-create/index.html +131 -0
  79. package/coverage/cli/src/commands/release-create/index.ts.html +88 -0
  80. package/coverage/cli/src/commands/release-create/release-create.ts.html +1426 -0
  81. package/coverage/cli/src/commands/release-desc-edit/index.html +131 -0
  82. package/coverage/cli/src/commands/release-desc-edit/index.ts.html +88 -0
  83. package/coverage/cli/src/commands/release-desc-edit/release-desc-edit.ts.html +766 -0
  84. package/coverage/cli/src/commands/vendor-check/index.html +131 -0
  85. package/coverage/cli/src/commands/vendor-check/index.ts.html +88 -0
  86. package/coverage/cli/src/commands/vendor-check/vendor-check.ts.html +466 -0
  87. package/coverage/cli/src/commands/vendor-config/index.html +116 -0
  88. package/coverage/cli/src/commands/vendor-config/vendor-config.ts.html +571 -0
  89. package/coverage/cli/src/commands/vendor-diff/index.html +131 -0
  90. package/coverage/cli/src/commands/vendor-diff/index.ts.html +88 -0
  91. package/coverage/cli/src/commands/vendor-diff/vendor-diff.ts.html +316 -0
  92. package/coverage/cli/src/commands/vendor-manifest/index.html +131 -0
  93. package/coverage/cli/src/commands/vendor-manifest/index.ts.html +88 -0
  94. package/coverage/cli/src/commands/vendor-manifest/vendor-manifest.ts.html +265 -0
  95. package/coverage/cli/src/commands/vendor-sync/index.html +131 -0
  96. package/coverage/cli/src/commands/vendor-sync/index.ts.html +88 -0
  97. package/coverage/cli/src/commands/vendor-sync/vendor-sync.ts.html +355 -0
  98. package/coverage/cli/src/commands/version/index.html +131 -0
  99. package/coverage/cli/src/commands/version/index.ts.html +88 -0
  100. package/coverage/cli/src/commands/version/version.ts.html +184 -0
  101. package/coverage/cli/src/commands/worktrees-add/index.html +131 -0
  102. package/coverage/cli/src/commands/worktrees-add/index.ts.html +88 -0
  103. package/coverage/cli/src/commands/worktrees-add/worktrees-add.ts.html +1183 -0
  104. package/coverage/cli/src/commands/worktrees-list/index.html +131 -0
  105. package/coverage/cli/src/commands/worktrees-list/index.ts.html +88 -0
  106. package/coverage/cli/src/commands/worktrees-list/worktrees-list.ts.html +400 -0
  107. package/coverage/cli/src/commands/worktrees-reload/index.html +131 -0
  108. package/coverage/cli/src/commands/worktrees-reload/index.ts.html +88 -0
  109. package/coverage/cli/src/commands/worktrees-reload/worktrees-reload.ts.html +775 -0
  110. package/coverage/cli/src/commands/worktrees-remove/index.html +131 -0
  111. package/coverage/cli/src/commands/worktrees-remove/index.ts.html +88 -0
  112. package/coverage/cli/src/commands/worktrees-remove/worktrees-remove.ts.html +682 -0
  113. package/coverage/cli/src/commands/worktrees-sync/index.html +131 -0
  114. package/coverage/cli/src/commands/worktrees-sync/index.ts.html +88 -0
  115. package/coverage/cli/src/commands/worktrees-sync/worktrees-sync.ts.html +679 -0
  116. package/coverage/cli/src/dev/__tests__/fixtures.ts.html +787 -0
  117. package/coverage/cli/src/dev/__tests__/index.html +116 -0
  118. package/coverage/cli/src/dev/dev-server.ts.html +1855 -0
  119. package/coverage/cli/src/dev/discovery.ts.html +598 -0
  120. package/coverage/cli/src/dev/index.html +191 -0
  121. package/coverage/cli/src/dev/interfaces.ts.html +223 -0
  122. package/coverage/cli/src/dev/logger.ts.html +1102 -0
  123. package/coverage/cli/src/dev/ports.ts.html +430 -0
  124. package/coverage/cli/src/dev/serverless-local-run.ts.html +916 -0
  125. package/coverage/cli/src/entry/dev-server.ts.html +409 -0
  126. package/coverage/cli/src/entry/index.html +116 -0
  127. package/coverage/cli/src/index.html +116 -0
  128. package/coverage/cli/src/integrations/cmux/canonicalize-cmux-title.ts.html +178 -0
  129. package/coverage/cli/src/integrations/cmux/close-workspace-by-title.ts.html +262 -0
  130. package/coverage/cli/src/integrations/cmux/index.html +191 -0
  131. package/coverage/cli/src/integrations/cmux/index.ts.html +100 -0
  132. package/coverage/cli/src/integrations/cmux/list-workspace-titles.ts.html +226 -0
  133. package/coverage/cli/src/integrations/cmux/open-workspace-with-layout.ts.html +325 -0
  134. package/coverage/cli/src/integrations/cmux/workspace-title.ts.html +154 -0
  135. package/coverage/cli/src/integrations/cursor/add-folders-to-workspace.ts.html +337 -0
  136. package/coverage/cli/src/integrations/cursor/index.html +206 -0
  137. package/coverage/cli/src/integrations/cursor/index.ts.html +103 -0
  138. package/coverage/cli/src/integrations/cursor/launch-cursor.ts.html +121 -0
  139. package/coverage/cli/src/integrations/cursor/open-cursor-workspace.ts.html +277 -0
  140. package/coverage/cli/src/integrations/cursor/reconcile-workspace-folders.ts.html +355 -0
  141. package/coverage/cli/src/integrations/cursor/remove-folders-from-workspace.ts.html +364 -0
  142. package/coverage/cli/src/integrations/cursor/resolve-workspace-path.ts.html +124 -0
  143. package/coverage/cli/src/integrations/doppler/doppler-cli-auth.ts.html +178 -0
  144. package/coverage/cli/src/integrations/doppler/doppler-errors.ts.html +349 -0
  145. package/coverage/cli/src/integrations/doppler/doppler-project.ts.html +355 -0
  146. package/coverage/cli/src/integrations/doppler/index.html +161 -0
  147. package/coverage/cli/src/integrations/doppler/index.ts.html +97 -0
  148. package/coverage/cli/src/integrations/gh/gh-cli-auth/gh-cli-auth.ts.html +172 -0
  149. package/coverage/cli/src/integrations/gh/gh-cli-auth/index.html +131 -0
  150. package/coverage/cli/src/integrations/gh/gh-cli-auth/index.ts.html +88 -0
  151. package/coverage/cli/src/integrations/gh/gh-release-prs/gh-release-prs.ts.html +703 -0
  152. package/coverage/cli/src/integrations/gh/gh-release-prs/index.html +131 -0
  153. package/coverage/cli/src/integrations/gh/gh-release-prs/index.ts.html +91 -0
  154. package/coverage/cli/src/integrations/gh/index.html +116 -0
  155. package/coverage/cli/src/integrations/gh/index.ts.html +94 -0
  156. package/coverage/cli/src/integrations/ide/add-ide-worktree-folders.ts.html +316 -0
  157. package/coverage/cli/src/integrations/ide/index.html +191 -0
  158. package/coverage/cli/src/integrations/ide/index.ts.html +103 -0
  159. package/coverage/cli/src/integrations/ide/open-ide-workspace.ts.html +238 -0
  160. package/coverage/cli/src/integrations/ide/provider-label.ts.html +157 -0
  161. package/coverage/cli/src/integrations/ide/remove-ide-worktree-folders.ts.html +520 -0
  162. package/coverage/cli/src/integrations/ide/types.ts.html +208 -0
  163. package/coverage/cli/src/integrations/jira/api.ts.html +1060 -0
  164. package/coverage/cli/src/integrations/jira/index.html +131 -0
  165. package/coverage/cli/src/integrations/jira/index.ts.html +142 -0
  166. package/coverage/cli/src/integrations/zed/add-folders-to-zed-workspace.ts.html +175 -0
  167. package/coverage/cli/src/integrations/zed/index.html +161 -0
  168. package/coverage/cli/src/integrations/zed/index.ts.html +94 -0
  169. package/coverage/cli/src/integrations/zed/open-zed-workspace.ts.html +238 -0
  170. package/coverage/cli/src/integrations/zed/reuse-zed-workspace.ts.html +256 -0
  171. package/coverage/cli/src/lib/assert-never/assert-never.ts.html +130 -0
  172. package/coverage/cli/src/lib/assert-never/index.html +131 -0
  173. package/coverage/cli/src/lib/assert-never/index.ts.html +88 -0
  174. package/coverage/cli/src/lib/command-catalog/command-catalog.ts.html +523 -0
  175. package/coverage/cli/src/lib/command-catalog/index.html +116 -0
  176. package/coverage/cli/src/lib/command-echo/command-echo.ts.html +319 -0
  177. package/coverage/cli/src/lib/command-echo/index.html +131 -0
  178. package/coverage/cli/src/lib/command-echo/index.ts.html +88 -0
  179. package/coverage/cli/src/lib/constants/constants.ts.html +472 -0
  180. package/coverage/cli/src/lib/constants/index.html +131 -0
  181. package/coverage/cli/src/lib/constants/index.ts.html +139 -0
  182. package/coverage/cli/src/lib/env-autoload/env-autoload.ts.html +1111 -0
  183. package/coverage/cli/src/lib/env-autoload/index.html +116 -0
  184. package/coverage/cli/src/lib/errors/format-zx-error.ts.html +247 -0
  185. package/coverage/cli/src/lib/errors/index.html +146 -0
  186. package/coverage/cli/src/lib/errors/is-prompt-cancellation.ts.html +199 -0
  187. package/coverage/cli/src/lib/errors/operation-error.ts.html +325 -0
  188. package/coverage/cli/src/lib/git-guard/git-guard.ts.html +250 -0
  189. package/coverage/cli/src/lib/git-guard/index.html +131 -0
  190. package/coverage/cli/src/lib/git-guard/index.ts.html +91 -0
  191. package/coverage/cli/src/lib/git-utils/git-utils.ts.html +622 -0
  192. package/coverage/cli/src/lib/git-utils/index.html +131 -0
  193. package/coverage/cli/src/lib/git-utils/index.ts.html +115 -0
  194. package/coverage/cli/src/lib/infra-kit-config/index.html +131 -0
  195. package/coverage/cli/src/lib/infra-kit-config/index.ts.html +142 -0
  196. package/coverage/cli/src/lib/infra-kit-config/infra-kit-config.ts.html +1447 -0
  197. package/coverage/cli/src/lib/json-output/index.html +116 -0
  198. package/coverage/cli/src/lib/json-output/json-output.ts.html +226 -0
  199. package/coverage/cli/src/lib/logger/index.html +116 -0
  200. package/coverage/cli/src/lib/logger/index.ts.html +205 -0
  201. package/coverage/cli/src/lib/managed-block/index.html +131 -0
  202. package/coverage/cli/src/lib/managed-block/index.ts.html +109 -0
  203. package/coverage/cli/src/lib/managed-block/managed-block.ts.html +520 -0
  204. package/coverage/cli/src/lib/package-config/index.html +146 -0
  205. package/coverage/cli/src/lib/package-config/index.ts.html +94 -0
  206. package/coverage/cli/src/lib/package-config/package-config-schema.ts.html +142 -0
  207. package/coverage/cli/src/lib/package-config/package-config.ts.html +376 -0
  208. package/coverage/cli/src/lib/package-validator/checks/config-check.ts.html +175 -0
  209. package/coverage/cli/src/lib/package-validator/checks/files-check.ts.html +172 -0
  210. package/coverage/cli/src/lib/package-validator/checks/index.html +176 -0
  211. package/coverage/cli/src/lib/package-validator/checks/index.ts.html +97 -0
  212. package/coverage/cli/src/lib/package-validator/checks/scripts-check.ts.html +154 -0
  213. package/coverage/cli/src/lib/package-validator/checks/turbo-check.ts.html +226 -0
  214. package/coverage/cli/src/lib/package-validator/fs-utils.ts.html +139 -0
  215. package/coverage/cli/src/lib/package-validator/index.html +146 -0
  216. package/coverage/cli/src/lib/package-validator/index.ts.html +94 -0
  217. package/coverage/cli/src/lib/package-validator/loader/config-loader.ts.html +316 -0
  218. package/coverage/cli/src/lib/package-validator/loader/index.html +146 -0
  219. package/coverage/cli/src/lib/package-validator/loader/index.ts.html +91 -0
  220. package/coverage/cli/src/lib/package-validator/loader/package-discovery.ts.html +379 -0
  221. package/coverage/cli/src/lib/package-validator/package-validator.ts.html +229 -0
  222. package/coverage/cli/src/lib/path-display/index.html +131 -0
  223. package/coverage/cli/src/lib/path-display/index.ts.html +88 -0
  224. package/coverage/cli/src/lib/path-display/path-display.ts.html +211 -0
  225. package/coverage/cli/src/lib/release-id/index.html +131 -0
  226. package/coverage/cli/src/lib/release-id/index.ts.html +130 -0
  227. package/coverage/cli/src/lib/release-id/release-id.ts.html +859 -0
  228. package/coverage/cli/src/lib/release-utils/index.html +131 -0
  229. package/coverage/cli/src/lib/release-utils/index.ts.html +130 -0
  230. package/coverage/cli/src/lib/release-utils/release-utils.ts.html +778 -0
  231. package/coverage/cli/src/lib/render/index.html +116 -0
  232. package/coverage/cli/src/lib/render/render.ts.html +157 -0
  233. package/coverage/cli/src/lib/vendor/__tests__/index.html +116 -0
  234. package/coverage/cli/src/lib/vendor/__tests__/zx-mock.ts.html +181 -0
  235. package/coverage/cli/src/lib/vendor/config-schema.ts.html +319 -0
  236. package/coverage/cli/src/lib/vendor/config.ts.html +259 -0
  237. package/coverage/cli/src/lib/vendor/factory-config-schema.ts.html +190 -0
  238. package/coverage/cli/src/lib/vendor/factory-config.ts.html +358 -0
  239. package/coverage/cli/src/lib/vendor/hash.ts.html +133 -0
  240. package/coverage/cli/src/lib/vendor/index.html +251 -0
  241. package/coverage/cli/src/lib/vendor/index.ts.html +154 -0
  242. package/coverage/cli/src/lib/vendor/manifest.ts.html +538 -0
  243. package/coverage/cli/src/lib/vendor/skip-sets.ts.html +229 -0
  244. package/coverage/cli/src/lib/vendor/sync-ops.ts.html +955 -0
  245. package/coverage/cli/src/lib/vendor/walk.ts.html +253 -0
  246. package/coverage/cli/src/lib/version-utils/index.html +161 -0
  247. package/coverage/cli/src/lib/version-utils/index.ts.html +139 -0
  248. package/coverage/cli/src/lib/version-utils/load-existing-versions.ts.html +343 -0
  249. package/coverage/cli/src/lib/version-utils/next-version.ts.html +934 -0
  250. package/coverage/cli/src/lib/version-utils/version-utils.ts.html +178 -0
  251. package/coverage/cli/src/lib/worktrees/index.html +131 -0
  252. package/coverage/cli/src/lib/worktrees/index.ts.html +88 -0
  253. package/coverage/cli/src/lib/worktrees/remove-worktrees.ts.html +283 -0
  254. package/coverage/cli/src/tui/boot.tsx.html +265 -0
  255. package/coverage/cli/src/tui/index.html +116 -0
  256. package/coverage/cli/src/tui/screens/command-palette.tsx.html +562 -0
  257. package/coverage/cli/src/tui/screens/index.html +116 -0
  258. package/coverage/cli/src/types.ts.html +283 -0
  259. package/coverage/clover.xml +4488 -0
  260. package/coverage/coverage-final.json +156 -0
  261. package/coverage/favicon.png +0 -0
  262. package/coverage/index.html +1076 -0
  263. package/coverage/prettify.css +1 -0
  264. package/coverage/prettify.js +2 -0
  265. package/coverage/sort-arrow-sprite.png +0 -0
  266. package/coverage/sorter.js +210 -0
  267. package/dist/chunk-DB6CTNBS.js +3 -0
  268. package/dist/chunk-DB6CTNBS.js.map +7 -0
  269. package/dist/chunk-SGR2XAVR.js +164 -0
  270. package/dist/chunk-SGR2XAVR.js.map +7 -0
  271. package/dist/cli.js +5 -5
  272. package/dist/cli.js.map +3 -3
  273. package/dist/dev-server.js +13 -0
  274. package/dist/dev-server.js.map +7 -0
  275. package/dist/mcp.js +1 -1
  276. package/dist/mcp.js.map +1 -1
  277. package/package.json +6 -1
  278. package/scripts/build.js +4 -4
  279. package/src/.omc/state/agent-replay-2ac0dcd0-01f7-41a8-a8c9-f2195599817b.jsonl +5 -0
  280. package/src/.omc/state/sessions/2ac0dcd0-01f7-41a8-a8c9-f2195599817b/mission-state.json +79 -0
  281. package/src/.omc/state/sessions/2ac0dcd0-01f7-41a8-a8c9-f2195599817b/pre-tool-advisory-throttle.json +26 -0
  282. package/src/.omc/state/sessions/2ac0dcd0-01f7-41a8-a8c9-f2195599817b/subagent-tracking-state.json +26 -0
  283. package/src/commands/doctor/doctor.ts +53 -0
  284. package/src/commands/env-autoload/env-autoload.ts +14 -2
  285. package/src/commands/env-clear/env-clear.ts +48 -7
  286. package/src/commands/env-load/env-load.ts +23 -1
  287. package/src/commands/init/__tests__/shell-body.test.ts +73 -3
  288. package/src/commands/init/init.ts +74 -7
  289. package/src/dev/__tests__/dev-server-options.test.ts +57 -0
  290. package/src/dev/__tests__/dev-server.test.ts +420 -0
  291. package/src/dev/__tests__/discovery.test.ts +181 -0
  292. package/src/dev/__tests__/fixtures.ts +257 -0
  293. package/src/dev/__tests__/ports.test.ts +98 -0
  294. package/src/dev/__tests__/serverless-local-run.test.ts +533 -0
  295. package/src/dev/dev-server.ts +796 -0
  296. package/src/dev/discovery.ts +229 -0
  297. package/src/dev/interfaces.ts +11 -0
  298. package/src/dev/managed-child.ts +73 -0
  299. package/src/dev/ports.ts +100 -0
  300. package/src/dev/serverless-local-run.ts +329 -0
  301. package/src/dev/turbo-watch.ts +62 -0
  302. package/src/dev/ui-dev.ts +62 -0
  303. package/src/entry/cli.ts +25 -6
  304. package/src/entry/dev-server.ts +103 -0
  305. package/src/lib/command-catalog/__tests__/__snapshots__/command-catalog.test.ts.snap +1 -0
  306. package/src/lib/command-catalog/command-catalog.ts +4 -0
  307. package/src/lib/constants/constants.ts +38 -0
  308. package/src/lib/constants/index.ts +4 -0
  309. package/src/lib/env-autoload/__tests__/env-autoload.test.ts +25 -0
  310. package/src/lib/env-autoload/env-autoload.ts +35 -4
  311. package/src/lib/infra-kit-config/index.ts +2 -0
  312. package/src/lib/infra-kit-config/infra-kit-config.ts +22 -0
  313. package/src/lib/warm-cache/__tests__/warm-cache.test.ts +164 -0
  314. package/src/lib/warm-cache/index.ts +7 -0
  315. package/src/lib/warm-cache/warm-cache.ts +136 -0
  316. package/tsconfig.tsbuildinfo +1 -1
  317. package/dist/chunk-EY5LDHXC.js +0 -164
  318. package/dist/chunk-EY5LDHXC.js.map +0 -7
@@ -0,0 +1,533 @@
1
+ import * as fs from 'node:fs'
2
+ import * as path from 'node:path'
3
+ import process from 'node:process'
4
+ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
5
+
6
+ import { ServerlessLocalRun } from 'src/dev/serverless-local-run'
7
+
8
+ import { PREFIX, boot, canBind, getFreePort, handlerSource, makeApiFixture, spyStdoutWrite } from './fixtures'
9
+
10
+ /** Overwrite the compiled handler in an api fixture with custom source. */
11
+ const writeHandler = (apiDir: string, source: string): void => {
12
+ fs.writeFileSync(path.join(apiDir, 'dist', 'handler.js'), source)
13
+ }
14
+
15
+ /** Overwrite serverless.yml in an api fixture (for the error-path specs). */
16
+ const writeServerless = (apiDir: string, yml: string): void => {
17
+ fs.writeFileSync(path.join(apiDir, 'serverless.yml'), yml)
18
+ }
19
+
20
+ const ORIGINAL_CWD = process.cwd()
21
+ const tmpDirs: string[] = []
22
+ const running: ServerlessLocalRun[] = []
23
+
24
+ let apiDir: string
25
+ let port: number
26
+
27
+ beforeEach(async () => {
28
+ apiDir = makeApiFixture(1)
29
+ tmpDirs.push(apiDir)
30
+ port = await getFreePort()
31
+ })
32
+
33
+ afterEach(async () => {
34
+ process.chdir(ORIGINAL_CWD)
35
+ for (const server of running.splice(0)) {
36
+ try {
37
+ await server.close()
38
+ } catch {
39
+ // already closed
40
+ }
41
+ }
42
+ for (const dir of tmpDirs.splice(0)) {
43
+ fs.rmSync(dir, { recursive: true, force: true })
44
+ }
45
+ })
46
+
47
+ describe('serverlessLocalRun — boot + HTTP->Lambda transform', () => {
48
+ it('serves a GET route with 200 and echoes query params into the Lambda event', async () => {
49
+ running.push(await boot(apiDir, port))
50
+
51
+ const res = await fetch(`http://127.0.0.1:${port}${PREFIX}/ping?foo=bar&n=2`)
52
+
53
+ expect(res.status).toBe(200)
54
+
55
+ const body = (await res.json()) as { route: string; event: { queryStringParameters: Record<string, string> } }
56
+
57
+ expect(body.route).toBe('ping')
58
+ expect(body.event.queryStringParameters).toEqual({ foo: 'bar', n: '2' })
59
+ })
60
+
61
+ it('echoes a POST JSON body back as the Lambda event.body string', async () => {
62
+ running.push(await boot(apiDir, port))
63
+
64
+ const res = await fetch(`http://127.0.0.1:${port}${PREFIX}/echo`, {
65
+ method: 'POST',
66
+ headers: { 'content-type': 'application/json', 'x-trace': 'abc123' },
67
+ body: JSON.stringify({ hello: 'world' }),
68
+ })
69
+
70
+ expect(res.status).toBe(200)
71
+
72
+ const body = (await res.json()) as { event: { body: string; headers: Record<string, string> } }
73
+
74
+ // The transform stringifies the parsed request body onto event.body.
75
+ expect(JSON.parse(body.event.body)).toEqual({ hello: 'world' })
76
+ // Request headers flow through to event.headers.
77
+ expect(body.event.headers['x-trace']).toBe('abc123')
78
+ })
79
+
80
+ it('maps a path parameter ({id}) into event.pathParameters', async () => {
81
+ running.push(await boot(apiDir, port))
82
+
83
+ const res = await fetch(`http://127.0.0.1:${port}${PREFIX}/item/42`)
84
+ const body = (await res.json()) as { event: { pathParameters: Record<string, string> } }
85
+
86
+ expect(body.event.pathParameters).toEqual({ id: '42' })
87
+ })
88
+
89
+ it('populates event.httpMethod and event.path from the request', async () => {
90
+ running.push(await boot(apiDir, port))
91
+
92
+ const res = await fetch(`http://127.0.0.1:${port}${PREFIX}/ping`)
93
+ const body = (await res.json()) as {
94
+ event: { httpMethod: string; path: string; requestContext: { httpMethod: string; resourcePath: string } }
95
+ }
96
+
97
+ expect(body.event.httpMethod).toBe('GET')
98
+ expect(body.event.path).toBe(`${PREFIX}/ping`)
99
+ expect(body.event.requestContext.httpMethod).toBe('GET')
100
+ expect(body.event.requestContext.resourcePath).toBe(`${PREFIX}/ping`)
101
+ })
102
+ })
103
+
104
+ describe('serverlessLocalRun — CORS + health', () => {
105
+ it('answers an OPTIONS preflight with 204 and CORS headers', async () => {
106
+ running.push(await boot(apiDir, port))
107
+
108
+ const res = await fetch(`http://127.0.0.1:${port}${PREFIX}/ping`, { method: 'OPTIONS' })
109
+
110
+ expect(res.status).toBe(204)
111
+ expect(res.headers.get('access-control-allow-origin')).toBe('*')
112
+ expect(res.headers.get('access-control-allow-methods')).toContain('OPTIONS')
113
+ })
114
+
115
+ it('serves GET /__health with 200 {status:"ok"} carrying the app name', async () => {
116
+ running.push(await boot(apiDir, port))
117
+
118
+ const res = await fetch(`http://127.0.0.1:${port}/__health`)
119
+
120
+ expect(res.status).toBe(200)
121
+
122
+ const body = (await res.json()) as { status: string; app: string; port: number }
123
+
124
+ expect(body.status).toBe('ok')
125
+ expect(body.app).toBe('testapp')
126
+ expect(body.port).toBe(port)
127
+ })
128
+
129
+ it('reports app:null on /__health when the appName is omitted', async () => {
130
+ // No chdir needed: the runner reads serverless.yml + the handler from controllersPath.
131
+ const server = new ServerlessLocalRun({ controllersPath: apiDir, prefixUrl: PREFIX, port })
132
+
133
+ running.push(server)
134
+ await server.start()
135
+
136
+ const res = await fetch(`http://127.0.0.1:${port}/__health`)
137
+
138
+ expect(res.status).toBe(200)
139
+
140
+ const body = (await res.json()) as { app: string | null }
141
+
142
+ expect(body.app).toBeNull()
143
+ })
144
+ })
145
+
146
+ describe('serverlessLocalRun — Lambda context', () => {
147
+ it('provides a functional getContext(): bounded remaining time, local ids, no-op callbacks', async () => {
148
+ writeHandler(
149
+ apiDir,
150
+ [
151
+ 'export const ping = async (event, ctx) => ({',
152
+ ' statusCode: 200,',
153
+ " headers: { 'content-type': 'application/json' },",
154
+ ' body: JSON.stringify({',
155
+ ' remaining: ctx.getRemainingTimeInMillis(),',
156
+ ' arn: ctx.invokedFunctionArn,',
157
+ ' reqId: ctx.awsRequestId,',
158
+ " noops: [ctx.done(), ctx.fail('e'), ctx.succeed('s')].every((r) => r === undefined),",
159
+ ' }),',
160
+ '})',
161
+ '',
162
+ ].join('\n'),
163
+ )
164
+
165
+ running.push(await boot(apiDir, port))
166
+
167
+ const res = await fetch(`http://127.0.0.1:${port}${PREFIX}/ping`)
168
+ const body = (await res.json()) as { remaining: number; arn: string; reqId: string; noops: boolean }
169
+
170
+ expect(res.status).toBe(200)
171
+ // getRemainingTimeInMillis is positive and bounded by the 30s budget.
172
+ expect(body.remaining).toBeGreaterThan(0)
173
+ expect(body.remaining).toBeLessThanOrEqual(30000)
174
+ expect(body.arn).toContain('lambda:local:')
175
+ expect(body.reqId).toMatch(/^local-\d+$/)
176
+ // done / fail / succeed are no-ops that return undefined without throwing.
177
+ expect(body.noops).toBe(true)
178
+ })
179
+
180
+ it('returns 500 when a handler throws', async () => {
181
+ writeHandler(apiDir, 'export const ping = async () => { throw new Error("boom") }\n')
182
+
183
+ running.push(await boot(apiDir, port))
184
+
185
+ const res = await fetch(`http://127.0.0.1:${port}${PREFIX}/ping`)
186
+
187
+ expect(res.status).toBe(500)
188
+ })
189
+ })
190
+
191
+ describe('serverlessLocalRun — start() error paths', () => {
192
+ it('rejects when a handler string points at a missing controller file', async () => {
193
+ writeServerless(
194
+ apiDir,
195
+ [
196
+ 'service: t',
197
+ 'functions:',
198
+ ' bad:',
199
+ ' handler: dist/does-not-exist.ping',
200
+ ' events:',
201
+ ' - http:',
202
+ ' method: get',
203
+ ' path: bad',
204
+ '',
205
+ ].join('\n'),
206
+ )
207
+
208
+ await expect(boot(apiDir, port)).rejects.toThrow()
209
+ })
210
+
211
+ it('rejects with a clear error on an invalid HTTP method', async () => {
212
+ writeServerless(
213
+ apiDir,
214
+ [
215
+ 'service: t',
216
+ 'functions:',
217
+ ' ping:',
218
+ ' handler: dist/handler.ping',
219
+ ' events:',
220
+ ' - http:',
221
+ ' method: FOOBAR',
222
+ ' path: ping',
223
+ '',
224
+ ].join('\n'),
225
+ )
226
+
227
+ await expect(boot(apiDir, port)).rejects.toThrow(/Invalid HTTP method/)
228
+ })
229
+ })
230
+
231
+ describe('serverlessLocalRun — close releases the port', () => {
232
+ it('frees the bound port after close() so a new listener can bind it', async () => {
233
+ const server = await boot(apiDir, port)
234
+
235
+ running.push(server)
236
+
237
+ // Port is in use while running.
238
+ expect(await canBind(port)).toBe(false)
239
+
240
+ await server.close()
241
+ running.splice(running.indexOf(server), 1)
242
+
243
+ expect(await canBind(port)).toBe(true)
244
+ })
245
+ })
246
+
247
+ describe('serverlessLocalRun — reload picks up a changed handler on a fresh instance', () => {
248
+ // The reload mechanism is per-INSTANCE ESM cache-busting: each ServerlessLocalRun
249
+ // sets a `?v=<timestamp>` query on the handler import, so a NEW instance loads the
250
+ // rewritten dist file while the OLD instance keeps its already-imported module.
251
+ it('serves v2 from a new instance after the dist handler is overwritten, while the old instance still serves v1', async () => {
252
+ const original = await boot(apiDir, port)
253
+
254
+ running.push(original)
255
+
256
+ const v1 = (await (await fetch(`http://127.0.0.1:${port}${PREFIX}/ping`)).json()) as { version: number }
257
+
258
+ expect(v1.version).toBe(1)
259
+
260
+ // Overwrite the compiled handler in place (simulates a rebuild writing new dist output).
261
+ writeHandler(apiDir, handlerSource(2))
262
+
263
+ // Poll: boot a fresh instance (new cache-bust) until it serves v2, bounded to 3s.
264
+ // The served response is the assertion — no fixed sleep stands in for it.
265
+ const deadline = Date.now() + 3000
266
+ let sawV2 = false
267
+
268
+ while (Date.now() < deadline && !sawV2) {
269
+ const reloadPort = await getFreePort()
270
+ const reloaded = await boot(apiDir, reloadPort)
271
+
272
+ const body = (await (await fetch(`http://127.0.0.1:${reloadPort}${PREFIX}/ping`)).json()) as { version: number }
273
+
274
+ await reloaded.close()
275
+
276
+ if (body.version === 2) {
277
+ sawV2 = true
278
+ break
279
+ }
280
+ await new Promise((r) => {
281
+ return setTimeout(r, 50)
282
+ })
283
+ }
284
+
285
+ expect(sawV2).toBe(true)
286
+
287
+ // The original instance imported v1 once at start() and does NOT hot-reload.
288
+ const stillV1 = (await (await fetch(`http://127.0.0.1:${port}${PREFIX}/ping`)).json()) as { version: number }
289
+
290
+ expect(stillV1.version).toBe(1)
291
+ })
292
+ })
293
+
294
+ describe('serverlessLocalRun — route key includes the HTTP method', () => {
295
+ it('routes GET and POST on the same path to their OWN handlers (no method collision)', async () => {
296
+ writeServerless(
297
+ apiDir,
298
+ [
299
+ 'service: t',
300
+ 'functions:',
301
+ ' getThing:',
302
+ ' handler: dist/handler.getThing',
303
+ ' events:',
304
+ ' - http:',
305
+ ' method: get',
306
+ ' path: thing',
307
+ ' postThing:',
308
+ ' handler: dist/handler.postThing',
309
+ ' events:',
310
+ ' - http:',
311
+ ' method: post',
312
+ ' path: thing',
313
+ '',
314
+ ].join('\n'),
315
+ )
316
+ writeHandler(
317
+ apiDir,
318
+ [
319
+ 'const ok = (route) => ({ statusCode: 200, headers: {}, body: JSON.stringify({ route }) })',
320
+ 'export const getThing = async () => ok("get-thing")',
321
+ 'export const postThing = async () => ok("post-thing")',
322
+ '',
323
+ ].join('\n'),
324
+ )
325
+
326
+ running.push(await boot(apiDir, port))
327
+
328
+ const getBody = (await (await fetch(`http://127.0.0.1:${port}${PREFIX}/thing`)).json()) as { route: string }
329
+ const postBody = (await (await fetch(`http://127.0.0.1:${port}${PREFIX}/thing`, { method: 'POST' })).json()) as {
330
+ route: string
331
+ }
332
+
333
+ // Before the fix, both would resolve to whichever route registered last.
334
+ expect(getBody.route).toBe('get-thing')
335
+ expect(postBody.route).toBe('post-thing')
336
+ })
337
+
338
+ it('throws on a genuinely duplicate method+path route', async () => {
339
+ writeServerless(
340
+ apiDir,
341
+ [
342
+ 'service: t',
343
+ 'functions:',
344
+ ' a:',
345
+ ' handler: dist/handler.ping',
346
+ ' events:',
347
+ ' - http:',
348
+ ' method: get',
349
+ ' path: dup',
350
+ ' b:',
351
+ ' handler: dist/handler.ping',
352
+ ' events:',
353
+ ' - http:',
354
+ ' method: get',
355
+ ' path: dup',
356
+ '',
357
+ ].join('\n'),
358
+ )
359
+
360
+ await expect(boot(apiDir, port)).rejects.toThrow(/Duplicate route/)
361
+ })
362
+ })
363
+
364
+ describe('serverlessLocalRun — injected handler logger (real Powertools)', () => {
365
+ it('lets a handler call info/debug/warn/error + createChild().info() without throwing, emitting output', async () => {
366
+ const prevDev = process.env.POWERTOOLS_DEV
367
+
368
+ process.env.POWERTOOLS_DEV = 'true'
369
+
370
+ writeHandler(
371
+ apiDir,
372
+ [
373
+ 'export const ping = async (event, ctx, log) => {',
374
+ " log.info('info-mark')",
375
+ " log.debug('debug-mark')",
376
+ " log.warn('warn-mark')",
377
+ " log.error('error-mark')",
378
+ " log.createChild({ serviceName: 'child' }).info('child-mark')",
379
+ ' return { statusCode: 200, headers: {}, body: JSON.stringify({ ok: true }) }',
380
+ '}',
381
+ '',
382
+ ].join('\n'),
383
+ )
384
+
385
+ // Powertools DEV routes through the global console (info/debug -> stdout, warn/error -> stderr).
386
+ // Spy the console methods directly — Node's Console dispatches writes through internal symbols
387
+ // that a process.stdout.write spy would miss.
388
+ const captured: string[] = []
389
+ const collect = (...args: unknown[]): void => {
390
+ captured.push(
391
+ args
392
+ .map((a) => {
393
+ return String(a)
394
+ })
395
+ .join(' '),
396
+ )
397
+ }
398
+ const spies = (['log', 'info', 'debug', 'warn', 'error'] as const).map((method) => {
399
+ return vi.spyOn(console, method).mockImplementation(collect as never)
400
+ })
401
+
402
+ try {
403
+ running.push(await boot(apiDir, port))
404
+
405
+ const res = await fetch(`http://127.0.0.1:${port}${PREFIX}/ping`)
406
+
407
+ // A 200 means every log.* / createChild call returned without throwing (functional-break check).
408
+ expect(res.status).toBe(200)
409
+ } finally {
410
+ for (const spy of spies) {
411
+ spy.mockRestore()
412
+ }
413
+ if (prevDev == null) {
414
+ delete process.env.POWERTOOLS_DEV
415
+ } else {
416
+ process.env.POWERTOOLS_DEV = prevDev
417
+ }
418
+ }
419
+
420
+ const all = captured.join('')
421
+
422
+ expect(all).toContain('info-mark')
423
+ expect(all).toContain('debug-mark')
424
+ expect(all).toContain('warn-mark')
425
+ expect(all).toContain('error-mark')
426
+ expect(all).toContain('child-mark')
427
+ })
428
+ })
429
+
430
+ describe('serverlessLocalRun — getRegisteredRoutes', () => {
431
+ it('returns the registered METHOD /path keys (sorted) and excludes /__health', async () => {
432
+ const server = await boot(apiDir, port)
433
+
434
+ running.push(server)
435
+
436
+ // The api fixture declares ping (GET), echo (POST) and item/{id} (GET); {id} -> :id.
437
+ expect(server.getRegisteredRoutes()).toEqual([
438
+ `GET ${PREFIX}/item/:id`,
439
+ `GET ${PREFIX}/ping`,
440
+ `POST ${PREFIX}/echo`,
441
+ ])
442
+ // The internal liveness route is registered outside defineRoute and must not appear.
443
+ expect(
444
+ server.getRegisteredRoutes().some((r) => {
445
+ return r.includes('__health')
446
+ }),
447
+ ).toBe(false)
448
+ })
449
+ })
450
+
451
+ describe('serverlessLocalRun — opt-in request logging (DEV_SERVER_REQUEST_LOG)', () => {
452
+ it('emits one "<method> <url> → <status> <ms>ms" line per request when set to 1', async () => {
453
+ process.env.DEV_SERVER_REQUEST_LOG = '1'
454
+ const writes: string[] = []
455
+ const spy = spyStdoutWrite(writes)
456
+
457
+ try {
458
+ // The hook is wired in the constructor from the env, so boot AFTER setting it.
459
+ running.push(await boot(apiDir, port))
460
+ await fetch(`http://127.0.0.1:${port}${PREFIX}/ping`)
461
+ // onResponse fires just after the response is sent; give it a beat.
462
+ await new Promise((r) => {
463
+ return setTimeout(r, 50)
464
+ })
465
+ } finally {
466
+ spy.mockRestore()
467
+ delete process.env.DEV_SERVER_REQUEST_LOG
468
+ }
469
+
470
+ // The request line is the only output using the ' → ' arrow (Powertools JSON never does).
471
+ const reqLines = writes.filter((w) => {
472
+ return w.includes('→')
473
+ })
474
+
475
+ expect(reqLines.length).toBeGreaterThanOrEqual(1)
476
+
477
+ const joined = reqLines.join('')
478
+
479
+ expect(joined).toContain('GET')
480
+ expect(joined).toContain(`${PREFIX}/ping`)
481
+ expect(joined).toContain('200')
482
+ })
483
+
484
+ it('writes no request line when the env var is unset', async () => {
485
+ delete process.env.DEV_SERVER_REQUEST_LOG
486
+ const writes: string[] = []
487
+ const spy = spyStdoutWrite(writes)
488
+
489
+ try {
490
+ running.push(await boot(apiDir, port))
491
+ await fetch(`http://127.0.0.1:${port}${PREFIX}/ping`)
492
+ await new Promise((r) => {
493
+ return setTimeout(r, 50)
494
+ })
495
+ } finally {
496
+ spy.mockRestore()
497
+ }
498
+
499
+ expect(
500
+ writes.filter((w) => {
501
+ return w.includes('→')
502
+ }),
503
+ ).toHaveLength(0)
504
+ })
505
+ })
506
+
507
+ describe('serverlessLocalRun — cwd independence (no chdir)', () => {
508
+ it('imports the handler at the runner cwd, not the app dir (process.chdir removed)', async () => {
509
+ writeHandler(
510
+ apiDir,
511
+ [
512
+ // Captured at module-eval time, i.e. when the runner `import()`s the handler.
513
+ 'const cwdAtImport = process.cwd()',
514
+ 'export const ping = async () => ({',
515
+ ' statusCode: 200,',
516
+ ' headers: {},',
517
+ ' body: JSON.stringify({ cwdAtImport }),',
518
+ '})',
519
+ '',
520
+ ].join('\n'),
521
+ )
522
+
523
+ const bootCwd = process.cwd()
524
+
525
+ running.push(await boot(apiDir, port))
526
+
527
+ const body = (await (await fetch(`http://127.0.0.1:${port}${PREFIX}/ping`)).json()) as { cwdAtImport: string }
528
+
529
+ // The handler module imported under the runner's cwd — NOT after a chdir into the app dir.
530
+ expect(body.cwdAtImport).toBe(bootCwd)
531
+ expect(body.cwdAtImport).not.toBe(apiDir)
532
+ })
533
+ })