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.
- package/dist/chunk-2PZRQHWF.js +2 -0
- package/dist/chunk-2PZRQHWF.js.map +7 -0
- package/dist/chunk-6RRAK2QO.js +5 -0
- package/dist/chunk-6RRAK2QO.js.map +7 -0
- package/dist/chunk-IX2A34UU.js +2 -0
- package/dist/chunk-IX2A34UU.js.map +7 -0
- package/dist/chunk-V5IDN7ZM.js +162 -0
- package/dist/chunk-V5IDN7ZM.js.map +7 -0
- package/dist/{chunk-YSBF5C7C.js → chunk-Z6KTUVIC.js} +2 -2
- package/dist/chunk-Z6KTUVIC.js.map +7 -0
- package/dist/cli.js +4 -4
- package/dist/cli.js.map +3 -3
- package/dist/dev-server.js +15 -10
- package/dist/dev-server.js.map +4 -4
- package/dist/entry/index.d.ts +1 -1
- package/dist/entry/vite.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/lib/package-config/package-config-schema.d.ts +35 -0
- package/dist/lib/package-config/package-config.d.ts +28 -0
- package/dist/lib/release-slug/release-slug.d.ts +19 -0
- package/dist/lib/vite/vite.d.ts +135 -0
- package/dist/mcp.js +1 -1
- package/dist/mcp.js.map +1 -1
- package/dist/vite.js +2 -0
- package/dist/vite.js.map +7 -0
- package/package.json +10 -2
- package/.eslintcache +0 -1
- package/.omc/state/agent-replay-036daa78-5fee-4c7d-9b44-53584acb0d87.jsonl +0 -26
- package/.omc/state/agent-replay-0a58307d-2a37-4c69-851c-83a646502d62.jsonl +0 -1
- package/.omc/state/agent-replay-0a65ec83-9de7-458d-9d0f-e56e1a26c68e.jsonl +0 -2
- package/.omc/state/agent-replay-0d1515ce-4ebe-4ce8-a865-2897f68de168.jsonl +0 -1
- package/.omc/state/agent-replay-11c41aa0-51fa-49e1-a1dc-26dcd6ac26cc.jsonl +0 -16
- package/.omc/state/agent-replay-127837d3-a000-4656-9453-2324ab353723.jsonl +0 -5
- package/.omc/state/agent-replay-15c409af-24fa-4026-88d3-a82dd1e68b87.jsonl +0 -11
- package/.omc/state/agent-replay-1b6ffc57-2d9b-4af4-b603-f1cef7e01b0a.jsonl +0 -17
- package/.omc/state/agent-replay-1fcfe0ec-7567-41c3-9bfd-501e99e86819.jsonl +0 -19
- package/.omc/state/agent-replay-2ac0dcd0-01f7-41a8-a8c9-f2195599817b.jsonl +0 -5
- package/.omc/state/agent-replay-2ccbd177-0d5d-4d4a-ab94-a22464786221.jsonl +0 -1
- package/.omc/state/agent-replay-36d91435-50b4-442f-9f4e-3cc68d776236.jsonl +0 -2
- package/.omc/state/agent-replay-38382db5-3088-4b5a-aff7-2561a60827c7.jsonl +0 -17
- package/.omc/state/agent-replay-4cf1c186-81b2-497c-b002-d7f84e7839f3.jsonl +0 -9
- package/.omc/state/agent-replay-50c36be9-a3a2-42b9-9c85-5a06d3e22f6a.jsonl +0 -5
- package/.omc/state/agent-replay-5c4ab554-64f1-42ae-83e3-21e0237e955c.jsonl +0 -11
- package/.omc/state/agent-replay-6be1264f-8069-4412-8119-86118ed1943e.jsonl +0 -3
- package/.omc/state/agent-replay-707b4784-2117-4b19-ae68-68a031f0d76d.jsonl +0 -2
- package/.omc/state/agent-replay-74afa912-1443-4011-b4f2-db9f055cdd9f.jsonl +0 -3
- package/.omc/state/agent-replay-8198b3e5-fad6-4ee0-9c59-ef773ad89af4.jsonl +0 -1
- package/.omc/state/agent-replay-8cd7652a-b8b5-49cf-9b1f-bee8e5972458.jsonl +0 -3
- package/.omc/state/agent-replay-8dd0ad2f-3a90-4158-b9de-ec8e19a7c983.jsonl +0 -3
- package/.omc/state/agent-replay-9bea518f-a9ee-4d14-bb53-a936ebaf647c.jsonl +0 -7
- package/.omc/state/agent-replay-a60ac2ec-afbd-449f-a540-6df287392fc2.jsonl +0 -1
- package/.omc/state/agent-replay-afc6290b-40d3-4bef-b3b6-14484c034ab9.jsonl +0 -14
- package/.omc/state/agent-replay-b52d89fb-0e24-4901-bc66-27e3c1697126.jsonl +0 -2
- package/.omc/state/agent-replay-be37e426-6fc8-47f4-8178-221c8494551c.jsonl +0 -3
- package/.omc/state/agent-replay-c967c819-3d1c-447b-ab48-56a8448ef9f8.jsonl +0 -2
- package/.omc/state/agent-replay-d02e6565-5168-40c8-8629-de219a29fa43.jsonl +0 -2
- package/.omc/state/agent-replay-d367c3be-9c2a-48e7-bcea-b45861af568c.jsonl +0 -2
- package/.omc/state/agent-replay-d5aae73c-340d-4aa2-9fe0-1bf2d79b69dc.jsonl +0 -10
- package/.omc/state/agent-replay-e947a3c6-989d-4a60-91dd-6b0ddd827b2d.jsonl +0 -3
- package/.omc/state/agent-replay-eb44055b-c2fa-4e66-b491-a1d9b44f51c7.jsonl +0 -1
- package/.omc/state/agent-replay-f2846d8f-974c-486c-b16f-4bdaa28ca45f.jsonl +0 -2
- package/.omc/state/agent-replay-f581a1ae-0ee4-48a3-96f3-ce31a0633bb0.jsonl +0 -1
- package/.omc/state/agent-replay-f99d8dad-81d1-4987-8183-62edf0843d0c.jsonl +0 -2
- package/.omc/state/agent-replay-fe1057b4-9a25-4e8e-8c3f-3e11652ee697.jsonl +0 -5
- package/.omc/state/idle-notif-cooldown.json +0 -3
- package/.omc/state/last-tool-error.json +0 -7
- package/.omc/state/mission-state.json +0 -53
- package/.omc/state/sessions/036daa78-5fee-4c7d-9b44-53584acb0d87/last-tool-error-state.json +0 -7
- package/.omc/state/sessions/036daa78-5fee-4c7d-9b44-53584acb0d87/mission-state.json +0 -129
- package/.omc/state/sessions/036daa78-5fee-4c7d-9b44-53584acb0d87/pre-tool-advisory-throttle.json +0 -34
- package/.omc/state/sessions/036daa78-5fee-4c7d-9b44-53584acb0d87/ralph-state.json +0 -13
- package/.omc/state/sessions/036daa78-5fee-4c7d-9b44-53584acb0d87/ralplan-state.json +0 -11
- package/.omc/state/sessions/036daa78-5fee-4c7d-9b44-53584acb0d87/subagent-tracking-state.json +0 -80
- package/.omc/state/sessions/036daa78-5fee-4c7d-9b44-53584acb0d87/ultrawork-state.json +0 -11
- package/.omc/state/sessions/0a58307d-2a37-4c69-851c-83a646502d62/pre-tool-advisory-throttle.json +0 -18
- package/.omc/state/sessions/0a58307d-2a37-4c69-851c-83a646502d62/subagent-tracking-state.json +0 -7
- package/.omc/state/sessions/0a65ec83-9de7-458d-9d0f-e56e1a26c68e/pre-tool-advisory-throttle.json +0 -18
- package/.omc/state/sessions/0a65ec83-9de7-458d-9d0f-e56e1a26c68e/skill-active-state.json +0 -15
- package/.omc/state/sessions/0d1515ce-4ebe-4ce8-a865-2897f68de168/pre-tool-advisory-throttle.json +0 -10
- package/.omc/state/sessions/11c41aa0-51fa-49e1-a1dc-26dcd6ac26cc/last-tool-error-state.json +0 -7
- package/.omc/state/sessions/11c41aa0-51fa-49e1-a1dc-26dcd6ac26cc/mission-state.json +0 -117
- package/.omc/state/sessions/11c41aa0-51fa-49e1-a1dc-26dcd6ac26cc/pre-tool-advisory-throttle.json +0 -42
- package/.omc/state/sessions/11c41aa0-51fa-49e1-a1dc-26dcd6ac26cc/subagent-tracking-state.json +0 -53
- package/.omc/state/sessions/127837d3-a000-4656-9453-2324ab353723/mission-state.json +0 -61
- package/.omc/state/sessions/127837d3-a000-4656-9453-2324ab353723/pre-tool-advisory-throttle.json +0 -22
- package/.omc/state/sessions/127837d3-a000-4656-9453-2324ab353723/skill-active-state.json +0 -15
- package/.omc/state/sessions/127837d3-a000-4656-9453-2324ab353723/subagent-tracking-state.json +0 -26
- package/.omc/state/sessions/15c409af-24fa-4026-88d3-a82dd1e68b87/last-tool-error-state.json +0 -7
- package/.omc/state/sessions/15c409af-24fa-4026-88d3-a82dd1e68b87/mission-state.json +0 -89
- package/.omc/state/sessions/15c409af-24fa-4026-88d3-a82dd1e68b87/pre-tool-advisory-throttle.json +0 -34
- package/.omc/state/sessions/15c409af-24fa-4026-88d3-a82dd1e68b87/ralph-state.json +0 -13
- package/.omc/state/sessions/15c409af-24fa-4026-88d3-a82dd1e68b87/skill-active-state.json +0 -15
- package/.omc/state/sessions/15c409af-24fa-4026-88d3-a82dd1e68b87/subagent-tracking-state.json +0 -44
- package/.omc/state/sessions/15c409af-24fa-4026-88d3-a82dd1e68b87/ultrawork-state.json +0 -11
- package/.omc/state/sessions/1b6ffc57-2d9b-4af4-b603-f1cef7e01b0a/last-tool-error-state.json +0 -7
- package/.omc/state/sessions/1b6ffc57-2d9b-4af4-b603-f1cef7e01b0a/mission-state.json +0 -139
- package/.omc/state/sessions/1b6ffc57-2d9b-4af4-b603-f1cef7e01b0a/pre-tool-advisory-throttle.json +0 -50
- package/.omc/state/sessions/1b6ffc57-2d9b-4af4-b603-f1cef7e01b0a/ralplan-state.json +0 -11
- package/.omc/state/sessions/1b6ffc57-2d9b-4af4-b603-f1cef7e01b0a/subagent-tracking-state.json +0 -90
- package/.omc/state/sessions/1fcfe0ec-7567-41c3-9bfd-501e99e86819/last-tool-error-state.json +0 -7
- package/.omc/state/sessions/1fcfe0ec-7567-41c3-9bfd-501e99e86819/mission-state.json +0 -109
- package/.omc/state/sessions/1fcfe0ec-7567-41c3-9bfd-501e99e86819/pre-tool-advisory-throttle.json +0 -42
- package/.omc/state/sessions/1fcfe0ec-7567-41c3-9bfd-501e99e86819/ralph-state.json +0 -13
- package/.omc/state/sessions/1fcfe0ec-7567-41c3-9bfd-501e99e86819/skill-active-state.json +0 -15
- package/.omc/state/sessions/1fcfe0ec-7567-41c3-9bfd-501e99e86819/subagent-tracking-state.json +0 -62
- package/.omc/state/sessions/1fcfe0ec-7567-41c3-9bfd-501e99e86819/ultrawork-state.json +0 -11
- package/.omc/state/sessions/23d0ff82-17e5-428b-8743-38f7979bb6f3/last-tool-error-state.json +0 -7
- package/.omc/state/sessions/23d0ff82-17e5-428b-8743-38f7979bb6f3/pre-tool-advisory-throttle.json +0 -18
- package/.omc/state/sessions/2ac0dcd0-01f7-41a8-a8c9-f2195599817b/last-tool-error-state.json +0 -7
- package/.omc/state/sessions/2ac0dcd0-01f7-41a8-a8c9-f2195599817b/mission-state.json +0 -79
- package/.omc/state/sessions/2ac0dcd0-01f7-41a8-a8c9-f2195599817b/pre-tool-advisory-throttle.json +0 -10
- package/.omc/state/sessions/2ac0dcd0-01f7-41a8-a8c9-f2195599817b/skill-active-state.json +0 -15
- package/.omc/state/sessions/2ac0dcd0-01f7-41a8-a8c9-f2195599817b/subagent-tracking-state.json +0 -26
- package/.omc/state/sessions/2ccbd177-0d5d-4d4a-ab94-a22464786221/pre-tool-advisory-throttle.json +0 -18
- package/.omc/state/sessions/2ccbd177-0d5d-4d4a-ab94-a22464786221/subagent-tracking-state.json +0 -17
- package/.omc/state/sessions/36d91435-50b4-442f-9f4e-3cc68d776236/pre-tool-advisory-throttle.json +0 -18
- package/.omc/state/sessions/36d91435-50b4-442f-9f4e-3cc68d776236/subagent-tracking-state.json +0 -17
- package/.omc/state/sessions/38382db5-3088-4b5a-aff7-2561a60827c7/last-tool-error-state.json +0 -7
- package/.omc/state/sessions/38382db5-3088-4b5a-aff7-2561a60827c7/mission-state.json +0 -145
- package/.omc/state/sessions/38382db5-3088-4b5a-aff7-2561a60827c7/pre-tool-advisory-throttle.json +0 -38
- package/.omc/state/sessions/38382db5-3088-4b5a-aff7-2561a60827c7/ralplan-state.json +0 -11
- package/.omc/state/sessions/38382db5-3088-4b5a-aff7-2561a60827c7/subagent-tracking-state.json +0 -98
- package/.omc/state/sessions/3a844fbd-ace8-4af1-8516-33d611839886/pre-tool-advisory-throttle.json +0 -18
- package/.omc/state/sessions/41336850-028c-476b-be1a-2164e1e46cac/last-tool-error-state.json +0 -7
- package/.omc/state/sessions/41336850-028c-476b-be1a-2164e1e46cac/pre-tool-advisory-throttle.json +0 -18
- package/.omc/state/sessions/4cf1c186-81b2-497c-b002-d7f84e7839f3/last-tool-error-state.json +0 -7
- package/.omc/state/sessions/4cf1c186-81b2-497c-b002-d7f84e7839f3/pre-tool-advisory-throttle.json +0 -18
- package/.omc/state/sessions/4cf1c186-81b2-497c-b002-d7f84e7839f3/subagent-tracking-state.json +0 -7
- package/.omc/state/sessions/50c36be9-a3a2-42b9-9c85-5a06d3e22f6a/mission-state.json +0 -61
- package/.omc/state/sessions/50c36be9-a3a2-42b9-9c85-5a06d3e22f6a/pre-tool-advisory-throttle.json +0 -22
- package/.omc/state/sessions/50c36be9-a3a2-42b9-9c85-5a06d3e22f6a/skill-active-state.json +0 -15
- package/.omc/state/sessions/50c36be9-a3a2-42b9-9c85-5a06d3e22f6a/subagent-tracking-state.json +0 -26
- package/.omc/state/sessions/560ea519-574a-4713-b134-5bf6cfaf3c33/pre-tool-advisory-throttle.json +0 -18
- package/.omc/state/sessions/5c4ab554-64f1-42ae-83e3-21e0237e955c/mission-state.json +0 -117
- package/.omc/state/sessions/5c4ab554-64f1-42ae-83e3-21e0237e955c/pre-tool-advisory-throttle.json +0 -18
- package/.omc/state/sessions/5c4ab554-64f1-42ae-83e3-21e0237e955c/subagent-tracking-state.json +0 -17
- package/.omc/state/sessions/6be1264f-8069-4412-8119-86118ed1943e/last-tool-error-state.json +0 -7
- package/.omc/state/sessions/6be1264f-8069-4412-8119-86118ed1943e/mission-state.json +0 -53
- package/.omc/state/sessions/6be1264f-8069-4412-8119-86118ed1943e/pre-tool-advisory-throttle.json +0 -22
- package/.omc/state/sessions/6be1264f-8069-4412-8119-86118ed1943e/skill-active-state.json +0 -15
- package/.omc/state/sessions/6be1264f-8069-4412-8119-86118ed1943e/subagent-tracking-state.json +0 -17
- package/.omc/state/sessions/707b4784-2117-4b19-ae68-68a031f0d76d/pre-tool-advisory-throttle.json +0 -18
- package/.omc/state/sessions/707b4784-2117-4b19-ae68-68a031f0d76d/subagent-tracking-state.json +0 -17
- package/.omc/state/sessions/74afa912-1443-4011-b4f2-db9f055cdd9f/pre-tool-advisory-throttle.json +0 -18
- package/.omc/state/sessions/74afa912-1443-4011-b4f2-db9f055cdd9f/skill-active-state.json +0 -15
- package/.omc/state/sessions/74afa912-1443-4011-b4f2-db9f055cdd9f/subagent-tracking-state.json +0 -17
- package/.omc/state/sessions/7772f972-4ec1-4287-bf42-a92c14cf3ffc/pre-tool-advisory-throttle.json +0 -10
- package/.omc/state/sessions/8198b3e5-fad6-4ee0-9c59-ef773ad89af4/pre-tool-advisory-throttle.json +0 -14
- package/.omc/state/sessions/8198b3e5-fad6-4ee0-9c59-ef773ad89af4/subagent-tracking-state.json +0 -17
- package/.omc/state/sessions/8cd7652a-b8b5-49cf-9b1f-bee8e5972458/pre-tool-advisory-throttle.json +0 -18
- package/.omc/state/sessions/8cd7652a-b8b5-49cf-9b1f-bee8e5972458/ralplan-state.json +0 -11
- package/.omc/state/sessions/8cd7652a-b8b5-49cf-9b1f-bee8e5972458/subagent-tracking-state.json +0 -35
- package/.omc/state/sessions/8dd0ad2f-3a90-4158-b9de-ec8e19a7c983/pre-tool-advisory-throttle.json +0 -14
- package/.omc/state/sessions/8dd0ad2f-3a90-4158-b9de-ec8e19a7c983/ralph-state.json +0 -13
- package/.omc/state/sessions/8dd0ad2f-3a90-4158-b9de-ec8e19a7c983/subagent-tracking-state.json +0 -17
- package/.omc/state/sessions/8dd0ad2f-3a90-4158-b9de-ec8e19a7c983/ultrawork-state.json +0 -11
- package/.omc/state/sessions/9bea518f-a9ee-4d14-bb53-a936ebaf647c/last-tool-error-state.json +0 -7
- package/.omc/state/sessions/9bea518f-a9ee-4d14-bb53-a936ebaf647c/mission-state.json +0 -79
- package/.omc/state/sessions/9bea518f-a9ee-4d14-bb53-a936ebaf647c/pre-tool-advisory-throttle.json +0 -22
- package/.omc/state/sessions/9bea518f-a9ee-4d14-bb53-a936ebaf647c/progress.txt +0 -7
- package/.omc/state/sessions/9bea518f-a9ee-4d14-bb53-a936ebaf647c/skill-active-state.json +0 -15
- package/.omc/state/sessions/9bea518f-a9ee-4d14-bb53-a936ebaf647c/subagent-tracking-state.json +0 -26
- package/.omc/state/sessions/a60ac2ec-afbd-449f-a540-6df287392fc2/pre-tool-advisory-throttle.json +0 -18
- package/.omc/state/sessions/a60ac2ec-afbd-449f-a540-6df287392fc2/subagent-tracking-state.json +0 -7
- package/.omc/state/sessions/afc6290b-40d3-4bef-b3b6-14484c034ab9/last-tool-error-state.json +0 -7
- package/.omc/state/sessions/afc6290b-40d3-4bef-b3b6-14484c034ab9/mission-state.json +0 -89
- package/.omc/state/sessions/afc6290b-40d3-4bef-b3b6-14484c034ab9/pre-tool-advisory-throttle.json +0 -34
- package/.omc/state/sessions/afc6290b-40d3-4bef-b3b6-14484c034ab9/ralph-state.json +0 -13
- package/.omc/state/sessions/afc6290b-40d3-4bef-b3b6-14484c034ab9/skill-active-state.json +0 -15
- package/.omc/state/sessions/afc6290b-40d3-4bef-b3b6-14484c034ab9/subagent-tracking-state.json +0 -35
- package/.omc/state/sessions/afc6290b-40d3-4bef-b3b6-14484c034ab9/ultrawork-state.json +0 -11
- package/.omc/state/sessions/b52d89fb-0e24-4901-bc66-27e3c1697126/pre-tool-advisory-throttle.json +0 -14
- package/.omc/state/sessions/b52d89fb-0e24-4901-bc66-27e3c1697126/subagent-tracking-state.json +0 -17
- package/.omc/state/sessions/c513ef38-cc3e-4a29-9c4c-1e0137245dd5/pre-tool-advisory-throttle.json +0 -18
- package/.omc/state/sessions/c967c819-3d1c-447b-ab48-56a8448ef9f8/pre-tool-advisory-throttle.json +0 -10
- package/.omc/state/sessions/c967c819-3d1c-447b-ab48-56a8448ef9f8/subagent-tracking-state.json +0 -7
- package/.omc/state/sessions/d02e6565-5168-40c8-8629-de219a29fa43/last-tool-error-state.json +0 -7
- package/.omc/state/sessions/d02e6565-5168-40c8-8629-de219a29fa43/mission-state.json +0 -53
- package/.omc/state/sessions/d02e6565-5168-40c8-8629-de219a29fa43/pre-tool-advisory-throttle.json +0 -18
- package/.omc/state/sessions/d02e6565-5168-40c8-8629-de219a29fa43/subagent-tracking-state.json +0 -17
- package/.omc/state/sessions/d5aae73c-340d-4aa2-9fe0-1bf2d79b69dc/last-tool-error-state.json +0 -7
- package/.omc/state/sessions/d5aae73c-340d-4aa2-9fe0-1bf2d79b69dc/mission-state.json +0 -103
- package/.omc/state/sessions/d5aae73c-340d-4aa2-9fe0-1bf2d79b69dc/pre-tool-advisory-throttle.json +0 -30
- package/.omc/state/sessions/d5aae73c-340d-4aa2-9fe0-1bf2d79b69dc/ralph-state.json +0 -13
- package/.omc/state/sessions/d5aae73c-340d-4aa2-9fe0-1bf2d79b69dc/subagent-tracking-state.json +0 -62
- package/.omc/state/sessions/d5aae73c-340d-4aa2-9fe0-1bf2d79b69dc/ultrawork-state.json +0 -11
- package/.omc/state/sessions/e947a3c6-989d-4a60-91dd-6b0ddd827b2d/last-tool-error-state.json +0 -7
- package/.omc/state/sessions/e947a3c6-989d-4a60-91dd-6b0ddd827b2d/pre-tool-advisory-throttle.json +0 -10
- package/.omc/state/sessions/e947a3c6-989d-4a60-91dd-6b0ddd827b2d/subagent-tracking-state.json +0 -26
- package/.omc/state/sessions/eb44055b-c2fa-4e66-b491-a1d9b44f51c7/last-tool-error-state.json +0 -7
- package/.omc/state/sessions/eb44055b-c2fa-4e66-b491-a1d9b44f51c7/pre-tool-advisory-throttle.json +0 -18
- package/.omc/state/sessions/eb44055b-c2fa-4e66-b491-a1d9b44f51c7/subagent-tracking-state.json +0 -17
- package/.omc/state/sessions/ed3e2cfb-a666-4bb1-bcc1-569d5d0b837a/pre-tool-advisory-throttle.json +0 -18
- package/.omc/state/sessions/f581a1ae-0ee4-48a3-96f3-ce31a0633bb0/pre-tool-advisory-throttle.json +0 -18
- package/.omc/state/sessions/f581a1ae-0ee4-48a3-96f3-ce31a0633bb0/subagent-tracking-state.json +0 -17
- package/.omc/state/sessions/f99d8dad-81d1-4987-8183-62edf0843d0c/pre-tool-advisory-throttle.json +0 -14
- package/.omc/state/sessions/f99d8dad-81d1-4987-8183-62edf0843d0c/ralph-state.json +0 -13
- package/.omc/state/sessions/f99d8dad-81d1-4987-8183-62edf0843d0c/ultrawork-state.json +0 -11
- package/.omc/state/sessions/f9c17a0e-2dd8-4f7d-badf-631f266c5d4c/pre-tool-advisory-throttle.json +0 -10
- package/.omc/state/sessions/fe1057b4-9a25-4e8e-8c3f-3e11652ee697/last-tool-error-state.json +0 -7
- package/.omc/state/sessions/fe1057b4-9a25-4e8e-8c3f-3e11652ee697/mission-state.json +0 -61
- package/.omc/state/sessions/fe1057b4-9a25-4e8e-8c3f-3e11652ee697/prd.json +0 -22
- package/.omc/state/sessions/fe1057b4-9a25-4e8e-8c3f-3e11652ee697/pre-tool-advisory-throttle.json +0 -22
- package/.omc/state/sessions/fe1057b4-9a25-4e8e-8c3f-3e11652ee697/progress.txt +0 -22
- package/.omc/state/sessions/fe1057b4-9a25-4e8e-8c3f-3e11652ee697/skill-active-state.json +0 -15
- package/.omc/state/sessions/fe1057b4-9a25-4e8e-8c3f-3e11652ee697/subagent-tracking-state.json +0 -26
- package/.omc/state/subagent-tracking.json +0 -17
- package/.turbo/turbo-build.log +0 -7
- package/.turbo/turbo-check.log +0 -14
- package/.turbo/turbo-eslint-check.log +0 -2
- package/.turbo/turbo-eslint-fix.log +0 -1
- package/.turbo/turbo-infra-kit-check.log +0 -14
- package/.turbo/turbo-prettier-check.log +0 -1
- package/.turbo/turbo-prettier-fix.log +0 -1
- package/.turbo/turbo-test.log +0 -406
- package/.turbo/turbo-ts-check.log +0 -1
- package/.turbo/turbo-validate.log +0 -14
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/cli/index.html +0 -116
- package/coverage/cli/package.json.html +0 -283
- package/coverage/cli/src/commands/audit/audit.ts.html +0 -616
- package/coverage/cli/src/commands/audit/index.html +0 -131
- package/coverage/cli/src/commands/audit/index.ts.html +0 -88
- package/coverage/cli/src/commands/doctor/doctor.ts.html +0 -1654
- package/coverage/cli/src/commands/doctor/index.html +0 -131
- package/coverage/cli/src/commands/doctor/index.ts.html +0 -88
- package/coverage/cli/src/commands/env-clear/env-clear.ts.html +0 -370
- package/coverage/cli/src/commands/env-clear/index.html +0 -131
- package/coverage/cli/src/commands/env-clear/index.ts.html +0 -88
- package/coverage/cli/src/commands/env-list/env-list.ts.html +0 -229
- package/coverage/cli/src/commands/env-list/index.html +0 -131
- package/coverage/cli/src/commands/env-list/index.ts.html +0 -88
- package/coverage/cli/src/commands/env-load/env-load.ts.html +0 -1201
- package/coverage/cli/src/commands/env-load/index.html +0 -131
- package/coverage/cli/src/commands/env-load/index.ts.html +0 -91
- package/coverage/cli/src/commands/env-status/env-status.ts.html +0 -409
- package/coverage/cli/src/commands/env-status/index.html +0 -131
- package/coverage/cli/src/commands/env-status/index.ts.html +0 -88
- package/coverage/cli/src/commands/gh-merge-dev/gh-merge-dev.ts.html +0 -694
- package/coverage/cli/src/commands/gh-merge-dev/index.html +0 -131
- package/coverage/cli/src/commands/gh-merge-dev/index.ts.html +0 -88
- package/coverage/cli/src/commands/gh-release-deliver/gh-release-deliver.ts.html +0 -1495
- package/coverage/cli/src/commands/gh-release-deliver/index.html +0 -131
- package/coverage/cli/src/commands/gh-release-deliver/index.ts.html +0 -88
- package/coverage/cli/src/commands/gh-release-deploy-all/gh-release-deploy-all.ts.html +0 -706
- package/coverage/cli/src/commands/gh-release-deploy-all/index.html +0 -131
- package/coverage/cli/src/commands/gh-release-deploy-all/index.ts.html +0 -88
- package/coverage/cli/src/commands/gh-release-deploy-selected/gh-release-deploy-selected.ts.html +0 -994
- package/coverage/cli/src/commands/gh-release-deploy-selected/index.html +0 -131
- package/coverage/cli/src/commands/gh-release-deploy-selected/index.ts.html +0 -88
- package/coverage/cli/src/commands/gh-release-list/gh-release-list.ts.html +0 -355
- package/coverage/cli/src/commands/gh-release-list/index.html +0 -131
- package/coverage/cli/src/commands/gh-release-list/index.ts.html +0 -88
- package/coverage/cli/src/commands/init/agent-files.ts.html +0 -742
- package/coverage/cli/src/commands/init/index.html +0 -146
- package/coverage/cli/src/commands/init/init.ts.html +0 -1159
- package/coverage/cli/src/commands/init/migrate-config.ts.html +0 -1219
- package/coverage/cli/src/commands/release-create/index.html +0 -131
- package/coverage/cli/src/commands/release-create/index.ts.html +0 -88
- package/coverage/cli/src/commands/release-create/release-create.ts.html +0 -1426
- package/coverage/cli/src/commands/release-desc-edit/index.html +0 -131
- package/coverage/cli/src/commands/release-desc-edit/index.ts.html +0 -88
- package/coverage/cli/src/commands/release-desc-edit/release-desc-edit.ts.html +0 -766
- package/coverage/cli/src/commands/vendor-check/index.html +0 -131
- package/coverage/cli/src/commands/vendor-check/index.ts.html +0 -88
- package/coverage/cli/src/commands/vendor-check/vendor-check.ts.html +0 -466
- package/coverage/cli/src/commands/vendor-config/index.html +0 -116
- package/coverage/cli/src/commands/vendor-config/vendor-config.ts.html +0 -571
- package/coverage/cli/src/commands/vendor-diff/index.html +0 -131
- package/coverage/cli/src/commands/vendor-diff/index.ts.html +0 -88
- package/coverage/cli/src/commands/vendor-diff/vendor-diff.ts.html +0 -316
- package/coverage/cli/src/commands/vendor-manifest/index.html +0 -131
- package/coverage/cli/src/commands/vendor-manifest/index.ts.html +0 -88
- package/coverage/cli/src/commands/vendor-manifest/vendor-manifest.ts.html +0 -265
- package/coverage/cli/src/commands/vendor-sync/index.html +0 -131
- package/coverage/cli/src/commands/vendor-sync/index.ts.html +0 -88
- package/coverage/cli/src/commands/vendor-sync/vendor-sync.ts.html +0 -355
- package/coverage/cli/src/commands/version/index.html +0 -131
- package/coverage/cli/src/commands/version/index.ts.html +0 -88
- package/coverage/cli/src/commands/version/version.ts.html +0 -184
- package/coverage/cli/src/commands/worktrees-add/index.html +0 -131
- package/coverage/cli/src/commands/worktrees-add/index.ts.html +0 -88
- package/coverage/cli/src/commands/worktrees-add/worktrees-add.ts.html +0 -1183
- package/coverage/cli/src/commands/worktrees-list/index.html +0 -131
- package/coverage/cli/src/commands/worktrees-list/index.ts.html +0 -88
- package/coverage/cli/src/commands/worktrees-list/worktrees-list.ts.html +0 -400
- package/coverage/cli/src/commands/worktrees-reload/index.html +0 -131
- package/coverage/cli/src/commands/worktrees-reload/index.ts.html +0 -88
- package/coverage/cli/src/commands/worktrees-reload/worktrees-reload.ts.html +0 -775
- package/coverage/cli/src/commands/worktrees-remove/index.html +0 -131
- package/coverage/cli/src/commands/worktrees-remove/index.ts.html +0 -88
- package/coverage/cli/src/commands/worktrees-remove/worktrees-remove.ts.html +0 -682
- package/coverage/cli/src/commands/worktrees-sync/index.html +0 -131
- package/coverage/cli/src/commands/worktrees-sync/index.ts.html +0 -88
- package/coverage/cli/src/commands/worktrees-sync/worktrees-sync.ts.html +0 -679
- package/coverage/cli/src/dev/__tests__/fixtures.ts.html +0 -787
- package/coverage/cli/src/dev/__tests__/index.html +0 -116
- package/coverage/cli/src/dev/dev-server.ts.html +0 -1855
- package/coverage/cli/src/dev/discovery.ts.html +0 -598
- package/coverage/cli/src/dev/index.html +0 -191
- package/coverage/cli/src/dev/interfaces.ts.html +0 -223
- package/coverage/cli/src/dev/logger.ts.html +0 -1102
- package/coverage/cli/src/dev/ports.ts.html +0 -430
- package/coverage/cli/src/dev/serverless-local-run.ts.html +0 -916
- package/coverage/cli/src/entry/dev-server.ts.html +0 -409
- package/coverage/cli/src/entry/index.html +0 -116
- package/coverage/cli/src/index.html +0 -116
- package/coverage/cli/src/integrations/cmux/canonicalize-cmux-title.ts.html +0 -178
- package/coverage/cli/src/integrations/cmux/close-workspace-by-title.ts.html +0 -262
- package/coverage/cli/src/integrations/cmux/index.html +0 -191
- package/coverage/cli/src/integrations/cmux/index.ts.html +0 -100
- package/coverage/cli/src/integrations/cmux/list-workspace-titles.ts.html +0 -226
- package/coverage/cli/src/integrations/cmux/open-workspace-with-layout.ts.html +0 -325
- package/coverage/cli/src/integrations/cmux/workspace-title.ts.html +0 -154
- package/coverage/cli/src/integrations/cursor/add-folders-to-workspace.ts.html +0 -337
- package/coverage/cli/src/integrations/cursor/index.html +0 -206
- package/coverage/cli/src/integrations/cursor/index.ts.html +0 -103
- package/coverage/cli/src/integrations/cursor/launch-cursor.ts.html +0 -121
- package/coverage/cli/src/integrations/cursor/open-cursor-workspace.ts.html +0 -277
- package/coverage/cli/src/integrations/cursor/reconcile-workspace-folders.ts.html +0 -355
- package/coverage/cli/src/integrations/cursor/remove-folders-from-workspace.ts.html +0 -364
- package/coverage/cli/src/integrations/cursor/resolve-workspace-path.ts.html +0 -124
- package/coverage/cli/src/integrations/doppler/doppler-cli-auth.ts.html +0 -178
- package/coverage/cli/src/integrations/doppler/doppler-errors.ts.html +0 -349
- package/coverage/cli/src/integrations/doppler/doppler-project.ts.html +0 -355
- package/coverage/cli/src/integrations/doppler/index.html +0 -161
- package/coverage/cli/src/integrations/doppler/index.ts.html +0 -97
- package/coverage/cli/src/integrations/gh/gh-cli-auth/gh-cli-auth.ts.html +0 -172
- package/coverage/cli/src/integrations/gh/gh-cli-auth/index.html +0 -131
- package/coverage/cli/src/integrations/gh/gh-cli-auth/index.ts.html +0 -88
- package/coverage/cli/src/integrations/gh/gh-release-prs/gh-release-prs.ts.html +0 -703
- package/coverage/cli/src/integrations/gh/gh-release-prs/index.html +0 -131
- package/coverage/cli/src/integrations/gh/gh-release-prs/index.ts.html +0 -91
- package/coverage/cli/src/integrations/gh/index.html +0 -116
- package/coverage/cli/src/integrations/gh/index.ts.html +0 -94
- package/coverage/cli/src/integrations/ide/add-ide-worktree-folders.ts.html +0 -316
- package/coverage/cli/src/integrations/ide/index.html +0 -191
- package/coverage/cli/src/integrations/ide/index.ts.html +0 -103
- package/coverage/cli/src/integrations/ide/open-ide-workspace.ts.html +0 -238
- package/coverage/cli/src/integrations/ide/provider-label.ts.html +0 -157
- package/coverage/cli/src/integrations/ide/remove-ide-worktree-folders.ts.html +0 -520
- package/coverage/cli/src/integrations/ide/types.ts.html +0 -208
- package/coverage/cli/src/integrations/jira/api.ts.html +0 -1060
- package/coverage/cli/src/integrations/jira/index.html +0 -131
- package/coverage/cli/src/integrations/jira/index.ts.html +0 -142
- package/coverage/cli/src/integrations/zed/add-folders-to-zed-workspace.ts.html +0 -175
- package/coverage/cli/src/integrations/zed/index.html +0 -161
- package/coverage/cli/src/integrations/zed/index.ts.html +0 -94
- package/coverage/cli/src/integrations/zed/open-zed-workspace.ts.html +0 -238
- package/coverage/cli/src/integrations/zed/reuse-zed-workspace.ts.html +0 -256
- package/coverage/cli/src/lib/assert-never/assert-never.ts.html +0 -130
- package/coverage/cli/src/lib/assert-never/index.html +0 -131
- package/coverage/cli/src/lib/assert-never/index.ts.html +0 -88
- package/coverage/cli/src/lib/command-catalog/command-catalog.ts.html +0 -523
- package/coverage/cli/src/lib/command-catalog/index.html +0 -116
- package/coverage/cli/src/lib/command-echo/command-echo.ts.html +0 -319
- package/coverage/cli/src/lib/command-echo/index.html +0 -131
- package/coverage/cli/src/lib/command-echo/index.ts.html +0 -88
- package/coverage/cli/src/lib/constants/constants.ts.html +0 -472
- package/coverage/cli/src/lib/constants/index.html +0 -131
- package/coverage/cli/src/lib/constants/index.ts.html +0 -139
- package/coverage/cli/src/lib/env-autoload/env-autoload.ts.html +0 -1111
- package/coverage/cli/src/lib/env-autoload/index.html +0 -116
- package/coverage/cli/src/lib/errors/format-zx-error.ts.html +0 -247
- package/coverage/cli/src/lib/errors/index.html +0 -146
- package/coverage/cli/src/lib/errors/is-prompt-cancellation.ts.html +0 -199
- package/coverage/cli/src/lib/errors/operation-error.ts.html +0 -325
- package/coverage/cli/src/lib/git-guard/git-guard.ts.html +0 -250
- package/coverage/cli/src/lib/git-guard/index.html +0 -131
- package/coverage/cli/src/lib/git-guard/index.ts.html +0 -91
- package/coverage/cli/src/lib/git-utils/git-utils.ts.html +0 -622
- package/coverage/cli/src/lib/git-utils/index.html +0 -131
- package/coverage/cli/src/lib/git-utils/index.ts.html +0 -115
- package/coverage/cli/src/lib/infra-kit-config/index.html +0 -131
- package/coverage/cli/src/lib/infra-kit-config/index.ts.html +0 -142
- package/coverage/cli/src/lib/infra-kit-config/infra-kit-config.ts.html +0 -1447
- package/coverage/cli/src/lib/json-output/index.html +0 -116
- package/coverage/cli/src/lib/json-output/json-output.ts.html +0 -226
- package/coverage/cli/src/lib/logger/index.html +0 -116
- package/coverage/cli/src/lib/logger/index.ts.html +0 -205
- package/coverage/cli/src/lib/managed-block/index.html +0 -131
- package/coverage/cli/src/lib/managed-block/index.ts.html +0 -109
- package/coverage/cli/src/lib/managed-block/managed-block.ts.html +0 -520
- package/coverage/cli/src/lib/package-config/index.html +0 -146
- package/coverage/cli/src/lib/package-config/index.ts.html +0 -94
- package/coverage/cli/src/lib/package-config/package-config-schema.ts.html +0 -142
- package/coverage/cli/src/lib/package-config/package-config.ts.html +0 -376
- package/coverage/cli/src/lib/package-validator/checks/config-check.ts.html +0 -175
- package/coverage/cli/src/lib/package-validator/checks/files-check.ts.html +0 -172
- package/coverage/cli/src/lib/package-validator/checks/index.html +0 -176
- package/coverage/cli/src/lib/package-validator/checks/index.ts.html +0 -97
- package/coverage/cli/src/lib/package-validator/checks/scripts-check.ts.html +0 -154
- package/coverage/cli/src/lib/package-validator/checks/turbo-check.ts.html +0 -226
- package/coverage/cli/src/lib/package-validator/fs-utils.ts.html +0 -139
- package/coverage/cli/src/lib/package-validator/index.html +0 -146
- package/coverage/cli/src/lib/package-validator/index.ts.html +0 -94
- package/coverage/cli/src/lib/package-validator/loader/config-loader.ts.html +0 -316
- package/coverage/cli/src/lib/package-validator/loader/index.html +0 -146
- package/coverage/cli/src/lib/package-validator/loader/index.ts.html +0 -91
- package/coverage/cli/src/lib/package-validator/loader/package-discovery.ts.html +0 -379
- package/coverage/cli/src/lib/package-validator/package-validator.ts.html +0 -229
- package/coverage/cli/src/lib/path-display/index.html +0 -131
- package/coverage/cli/src/lib/path-display/index.ts.html +0 -88
- package/coverage/cli/src/lib/path-display/path-display.ts.html +0 -211
- package/coverage/cli/src/lib/release-id/index.html +0 -131
- package/coverage/cli/src/lib/release-id/index.ts.html +0 -130
- package/coverage/cli/src/lib/release-id/release-id.ts.html +0 -859
- package/coverage/cli/src/lib/release-utils/index.html +0 -131
- package/coverage/cli/src/lib/release-utils/index.ts.html +0 -130
- package/coverage/cli/src/lib/release-utils/release-utils.ts.html +0 -778
- package/coverage/cli/src/lib/render/index.html +0 -116
- package/coverage/cli/src/lib/render/render.ts.html +0 -157
- package/coverage/cli/src/lib/vendor/__tests__/index.html +0 -116
- package/coverage/cli/src/lib/vendor/__tests__/zx-mock.ts.html +0 -181
- package/coverage/cli/src/lib/vendor/config-schema.ts.html +0 -319
- package/coverage/cli/src/lib/vendor/config.ts.html +0 -259
- package/coverage/cli/src/lib/vendor/factory-config-schema.ts.html +0 -190
- package/coverage/cli/src/lib/vendor/factory-config.ts.html +0 -358
- package/coverage/cli/src/lib/vendor/hash.ts.html +0 -133
- package/coverage/cli/src/lib/vendor/index.html +0 -251
- package/coverage/cli/src/lib/vendor/index.ts.html +0 -154
- package/coverage/cli/src/lib/vendor/manifest.ts.html +0 -538
- package/coverage/cli/src/lib/vendor/skip-sets.ts.html +0 -229
- package/coverage/cli/src/lib/vendor/sync-ops.ts.html +0 -955
- package/coverage/cli/src/lib/vendor/walk.ts.html +0 -253
- package/coverage/cli/src/lib/version-utils/index.html +0 -161
- package/coverage/cli/src/lib/version-utils/index.ts.html +0 -139
- package/coverage/cli/src/lib/version-utils/load-existing-versions.ts.html +0 -343
- package/coverage/cli/src/lib/version-utils/next-version.ts.html +0 -934
- package/coverage/cli/src/lib/version-utils/version-utils.ts.html +0 -178
- package/coverage/cli/src/lib/worktrees/index.html +0 -131
- package/coverage/cli/src/lib/worktrees/index.ts.html +0 -88
- package/coverage/cli/src/lib/worktrees/remove-worktrees.ts.html +0 -283
- package/coverage/cli/src/tui/boot.tsx.html +0 -265
- package/coverage/cli/src/tui/index.html +0 -116
- package/coverage/cli/src/tui/screens/command-palette.tsx.html +0 -562
- package/coverage/cli/src/tui/screens/index.html +0 -116
- package/coverage/cli/src/types.ts.html +0 -283
- package/coverage/clover.xml +0 -4488
- package/coverage/coverage-final.json +0 -156
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -1076
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -210
- package/dist/chunk-DB6CTNBS.js +0 -3
- package/dist/chunk-DB6CTNBS.js.map +0 -7
- package/dist/chunk-QBHCWAAG.js +0 -164
- package/dist/chunk-QBHCWAAG.js.map +0 -7
- package/dist/chunk-YSBF5C7C.js.map +0 -7
- package/eslint.config.js +0 -35
- package/infra-kit.config.ts +0 -5
- package/scripts/build.js +0 -75
- package/src/.omc/state/agent-replay-2ac0dcd0-01f7-41a8-a8c9-f2195599817b.jsonl +0 -5
- package/src/.omc/state/agent-replay-2ccbd177-0d5d-4d4a-ab94-a22464786221.jsonl +0 -2
- package/src/.omc/state/agent-replay-707b4784-2117-4b19-ae68-68a031f0d76d.jsonl +0 -2
- package/src/.omc/state/agent-replay-8dd0ad2f-3a90-4158-b9de-ec8e19a7c983.jsonl +0 -11
- package/src/.omc/state/agent-replay-c513ef38-cc3e-4a29-9c4c-1e0137245dd5.jsonl +0 -4
- package/src/.omc/state/agent-replay-ed3e2cfb-a666-4bb1-bcc1-569d5d0b837a.jsonl +0 -2
- package/src/.omc/state/idle-notif-cooldown.json +0 -3
- package/src/.omc/state/sessions/0a58307d-2a37-4c69-851c-83a646502d62/pre-tool-advisory-throttle.json +0 -18
- package/src/.omc/state/sessions/2ac0dcd0-01f7-41a8-a8c9-f2195599817b/mission-state.json +0 -79
- package/src/.omc/state/sessions/2ac0dcd0-01f7-41a8-a8c9-f2195599817b/pre-tool-advisory-throttle.json +0 -26
- package/src/.omc/state/sessions/2ac0dcd0-01f7-41a8-a8c9-f2195599817b/subagent-tracking-state.json +0 -26
- package/src/.omc/state/sessions/2ccbd177-0d5d-4d4a-ab94-a22464786221/last-tool-error-state.json +0 -7
- package/src/.omc/state/sessions/2ccbd177-0d5d-4d4a-ab94-a22464786221/mission-state.json +0 -53
- package/src/.omc/state/sessions/2ccbd177-0d5d-4d4a-ab94-a22464786221/pre-tool-advisory-throttle.json +0 -22
- package/src/.omc/state/sessions/2ccbd177-0d5d-4d4a-ab94-a22464786221/subagent-tracking-state.json +0 -17
- package/src/.omc/state/sessions/707b4784-2117-4b19-ae68-68a031f0d76d/last-tool-error-state.json +0 -7
- package/src/.omc/state/sessions/707b4784-2117-4b19-ae68-68a031f0d76d/mission-state.json +0 -53
- package/src/.omc/state/sessions/707b4784-2117-4b19-ae68-68a031f0d76d/pre-tool-advisory-throttle.json +0 -22
- package/src/.omc/state/sessions/707b4784-2117-4b19-ae68-68a031f0d76d/subagent-tracking-state.json +0 -17
- package/src/.omc/state/sessions/8dd0ad2f-3a90-4158-b9de-ec8e19a7c983/mission-state.json +0 -79
- package/src/.omc/state/sessions/8dd0ad2f-3a90-4158-b9de-ec8e19a7c983/pre-tool-advisory-throttle.json +0 -22
- package/src/.omc/state/sessions/8dd0ad2f-3a90-4158-b9de-ec8e19a7c983/ralph-state.json +0 -13
- package/src/.omc/state/sessions/8dd0ad2f-3a90-4158-b9de-ec8e19a7c983/subagent-tracking-state.json +0 -26
- package/src/.omc/state/sessions/8dd0ad2f-3a90-4158-b9de-ec8e19a7c983/ultrawork-state.json +0 -11
- package/src/.omc/state/sessions/c513ef38-cc3e-4a29-9c4c-1e0137245dd5/mission-state.json +0 -79
- package/src/.omc/state/sessions/c513ef38-cc3e-4a29-9c4c-1e0137245dd5/pre-tool-advisory-throttle.json +0 -22
- package/src/.omc/state/sessions/c513ef38-cc3e-4a29-9c4c-1e0137245dd5/subagent-tracking-state.json +0 -26
- package/src/.omc/state/sessions/ed3e2cfb-a666-4bb1-bcc1-569d5d0b837a/pre-tool-advisory-throttle.json +0 -18
- package/src/.omc/state/sessions/ed3e2cfb-a666-4bb1-bcc1-569d5d0b837a/ralph-state.json +0 -13
- package/src/.omc/state/sessions/ed3e2cfb-a666-4bb1-bcc1-569d5d0b837a/ultrawork-state.json +0 -11
- package/src/.omc/state/sessions/f99d8dad-81d1-4987-8183-62edf0843d0c/pre-tool-advisory-throttle.json +0 -14
- package/src/commands/.omc/state/sessions/afc6290b-40d3-4bef-b3b6-14484c034ab9/pre-tool-advisory-throttle.json +0 -14
- package/src/commands/.omc/state/sessions/c967c819-3d1c-447b-ab48-56a8448ef9f8/pre-tool-advisory-throttle.json +0 -18
- package/src/commands/.omc/state/sessions/f09f401f-56c6-42cd-97be-c742c1956468/pre-tool-advisory-throttle.json +0 -14
- package/src/commands/audit/.omc/state/agent-replay-f9c17a0e-2dd8-4f7d-badf-631f266c5d4c.jsonl +0 -4
- package/src/commands/audit/.omc/state/sessions/f9c17a0e-2dd8-4f7d-badf-631f266c5d4c/mission-state.json +0 -79
- package/src/commands/audit/.omc/state/sessions/f9c17a0e-2dd8-4f7d-badf-631f266c5d4c/pre-tool-advisory-throttle.json +0 -22
- package/src/commands/audit/.omc/state/sessions/f9c17a0e-2dd8-4f7d-badf-631f266c5d4c/subagent-tracking-state.json +0 -26
- package/src/commands/audit/__tests__/audit.test.ts +0 -59
- package/src/commands/audit/audit.ts +0 -177
- package/src/commands/audit/index.ts +0 -1
- package/src/commands/config/.omc/state/sessions/41336850-028c-476b-be1a-2164e1e46cac/last-tool-error-state.json +0 -7
- package/src/commands/config/.omc/state/sessions/41336850-028c-476b-be1a-2164e1e46cac/pre-tool-advisory-throttle.json +0 -18
- package/src/commands/config/config.ts +0 -137
- package/src/commands/config/index.ts +0 -1
- package/src/commands/doctor/.omc/state/sessions/8dd0ad2f-3a90-4158-b9de-ec8e19a7c983/pre-tool-advisory-throttle.json +0 -14
- package/src/commands/doctor/__tests__/agent-files.test.ts +0 -88
- package/src/commands/doctor/__tests__/check-ide-installed.test.ts +0 -142
- package/src/commands/doctor/__tests__/check-legacy-user-global-config.test.ts +0 -110
- package/src/commands/doctor/doctor.ts +0 -576
- package/src/commands/doctor/index.ts +0 -1
- package/src/commands/env-autoload/env-autoload.ts +0 -24
- package/src/commands/env-autoload/index.ts +0 -1
- package/src/commands/env-clear/__tests__/env-clear.test.ts +0 -27
- package/src/commands/env-clear/env-clear.ts +0 -136
- package/src/commands/env-clear/index.ts +0 -1
- package/src/commands/env-list/env-list.ts +0 -48
- package/src/commands/env-list/index.ts +0 -1
- package/src/commands/env-load/__tests__/env-load.test.ts +0 -200
- package/src/commands/env-load/env-load.ts +0 -394
- package/src/commands/env-load/index.ts +0 -2
- package/src/commands/env-status/__tests__/env-status.test.ts +0 -78
- package/src/commands/env-status/env-status.ts +0 -108
- package/src/commands/env-status/index.ts +0 -1
- package/src/commands/gh-merge-dev/gh-merge-dev.ts +0 -203
- package/src/commands/gh-merge-dev/index.ts +0 -1
- package/src/commands/gh-release-deliver/gh-release-deliver.ts +0 -470
- package/src/commands/gh-release-deliver/index.ts +0 -1
- package/src/commands/gh-release-deploy-all/gh-release-deploy-all.ts +0 -207
- package/src/commands/gh-release-deploy-all/index.ts +0 -1
- package/src/commands/gh-release-deploy-selected/gh-release-deploy-selected.ts +0 -303
- package/src/commands/gh-release-deploy-selected/index.ts +0 -1
- package/src/commands/gh-release-list/gh-release-list.ts +0 -90
- package/src/commands/gh-release-list/index.ts +0 -1
- package/src/commands/init/.omc/state/sessions/8dd0ad2f-3a90-4158-b9de-ec8e19a7c983/pre-tool-advisory-throttle.json +0 -18
- package/src/commands/init/__tests__/agent-files.test.ts +0 -265
- package/src/commands/init/__tests__/migrate-config.test.ts +0 -422
- package/src/commands/init/__tests__/migrate-factory-config.test.ts +0 -93
- package/src/commands/init/__tests__/seed-user-global-config.test.ts +0 -64
- package/src/commands/init/__tests__/shell-body.test.ts +0 -131
- package/src/commands/init/agent-files.ts +0 -219
- package/src/commands/init/index.ts +0 -8
- package/src/commands/init/init.ts +0 -440
- package/src/commands/init/migrate-config.ts +0 -378
- package/src/commands/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/src/commands/release-create/__tests__/release-create.test.ts +0 -92
- package/src/commands/release-create/index.ts +0 -1
- package/src/commands/release-create/release-create.ts +0 -447
- package/src/commands/release-desc-edit/index.ts +0 -1
- package/src/commands/release-desc-edit/release-desc-edit.ts +0 -227
- package/src/commands/vendor-check/__tests__/runtime-isolation.test.ts +0 -71
- package/src/commands/vendor-check/__tests__/vendor-check.test.ts +0 -87
- package/src/commands/vendor-check/index.ts +0 -1
- package/src/commands/vendor-check/vendor-check.ts +0 -127
- package/src/commands/vendor-config/__tests__/vendor-config.test.ts +0 -103
- package/src/commands/vendor-config/index.ts +0 -1
- package/src/commands/vendor-config/vendor-config.ts +0 -162
- package/src/commands/vendor-diff/__tests__/vendor-diff.test.ts +0 -74
- package/src/commands/vendor-diff/index.ts +0 -1
- package/src/commands/vendor-diff/vendor-diff.ts +0 -77
- package/src/commands/vendor-manifest/index.ts +0 -1
- package/src/commands/vendor-manifest/vendor-manifest.ts +0 -60
- package/src/commands/vendor-sync/__tests__/vendor-write.test.ts +0 -86
- package/src/commands/vendor-sync/index.ts +0 -1
- package/src/commands/vendor-sync/vendor-sync.ts +0 -90
- package/src/commands/version/index.ts +0 -1
- package/src/commands/version/version.ts +0 -33
- package/src/commands/worktrees-add/index.ts +0 -1
- package/src/commands/worktrees-add/worktrees-add.ts +0 -366
- package/src/commands/worktrees-list/index.ts +0 -1
- package/src/commands/worktrees-list/worktrees-list.ts +0 -105
- package/src/commands/worktrees-reload/__tests__/reload-cmux.test.ts +0 -119
- package/src/commands/worktrees-reload/index.ts +0 -1
- package/src/commands/worktrees-reload/worktrees-reload.ts +0 -230
- package/src/commands/worktrees-remove/index.ts +0 -1
- package/src/commands/worktrees-remove/worktrees-remove.ts +0 -199
- package/src/commands/worktrees-sync/index.ts +0 -1
- package/src/commands/worktrees-sync/worktrees-sync.ts +0 -198
- package/src/dev/__tests__/dev-server-options.test.ts +0 -57
- package/src/dev/__tests__/dev-server.test.ts +0 -420
- package/src/dev/__tests__/discovery.test.ts +0 -181
- package/src/dev/__tests__/fixtures.ts +0 -257
- package/src/dev/__tests__/ports.test.ts +0 -98
- package/src/dev/__tests__/serverless-local-run.test.ts +0 -533
- package/src/dev/dev-server.ts +0 -796
- package/src/dev/discovery.ts +0 -229
- package/src/dev/interfaces.ts +0 -11
- package/src/dev/managed-child.ts +0 -73
- package/src/dev/ports.ts +0 -100
- package/src/dev/serverless-local-run.ts +0 -329
- package/src/dev/turbo-watch.ts +0 -62
- package/src/dev/ui-dev.ts +0 -62
- package/src/entry/cli.ts +0 -630
- package/src/entry/dev-server.ts +0 -103
- package/src/entry/index.ts +0 -11
- package/src/entry/mcp.ts +0 -43
- package/src/integrations/cmux/__tests__/canonicalize-cmux-title.test.ts +0 -56
- package/src/integrations/cmux/__tests__/close-workspace-by-title.test.ts +0 -63
- package/src/integrations/cmux/__tests__/list-workspace-titles.test.ts +0 -65
- package/src/integrations/cmux/__tests__/open-workspace-with-layout.test.ts +0 -127
- package/src/integrations/cmux/canonicalize-cmux-title.ts +0 -31
- package/src/integrations/cmux/close-workspace-by-title.ts +0 -59
- package/src/integrations/cmux/index.ts +0 -5
- package/src/integrations/cmux/list-workspace-titles.ts +0 -47
- package/src/integrations/cmux/open-workspace-with-layout.ts +0 -80
- package/src/integrations/cmux/workspace-title.ts +0 -23
- package/src/integrations/cursor/.omc/state/agent-replay-f99d8dad-81d1-4987-8183-62edf0843d0c.jsonl +0 -2
- package/src/integrations/cursor/.omc/state/idle-notif-cooldown.json +0 -3
- package/src/integrations/cursor/.omc/state/sessions/f99d8dad-81d1-4987-8183-62edf0843d0c/pre-tool-advisory-throttle.json +0 -18
- package/src/integrations/cursor/.omc/state/sessions/f99d8dad-81d1-4987-8183-62edf0843d0c/subagent-tracking-state.json +0 -17
- package/src/integrations/cursor/add-folders-to-workspace.ts +0 -84
- package/src/integrations/cursor/index.ts +0 -6
- package/src/integrations/cursor/launch-cursor.ts +0 -12
- package/src/integrations/cursor/open-cursor-workspace.ts +0 -64
- package/src/integrations/cursor/reconcile-workspace-folders.ts +0 -90
- package/src/integrations/cursor/remove-folders-from-workspace.ts +0 -93
- package/src/integrations/cursor/resolve-workspace-path.ts +0 -13
- package/src/integrations/doppler/__tests__/doppler-errors.test.ts +0 -76
- package/src/integrations/doppler/doppler-cli-auth.ts +0 -31
- package/src/integrations/doppler/doppler-errors.ts +0 -88
- package/src/integrations/doppler/doppler-project.ts +0 -90
- package/src/integrations/doppler/index.ts +0 -4
- package/src/integrations/gh/gh-cli-auth/gh-cli-auth.ts +0 -29
- package/src/integrations/gh/gh-cli-auth/index.ts +0 -1
- package/src/integrations/gh/gh-release-prs/.omc/state/sessions/c6ed6186-1aac-48e0-aa2a-edc6da8e0410/pre-tool-advisory-throttle.json +0 -10
- package/src/integrations/gh/gh-release-prs/__tests__/gh-release-prs.test.ts +0 -198
- package/src/integrations/gh/gh-release-prs/gh-release-prs.ts +0 -206
- package/src/integrations/gh/gh-release-prs/index.ts +0 -2
- package/src/integrations/gh/index.ts +0 -3
- package/src/integrations/ide/__tests__/ide-facade.test.ts +0 -289
- package/src/integrations/ide/add-ide-worktree-folders.ts +0 -77
- package/src/integrations/ide/index.ts +0 -6
- package/src/integrations/ide/open-ide-workspace.ts +0 -51
- package/src/integrations/ide/provider-label.ts +0 -24
- package/src/integrations/ide/remove-ide-worktree-folders.ts +0 -145
- package/src/integrations/ide/types.ts +0 -41
- package/src/integrations/jira/api.ts +0 -325
- package/src/integrations/jira/index.ts +0 -19
- package/src/integrations/jira/types.ts +0 -85
- package/src/integrations/linear/.gitkeep +0 -0
- package/src/integrations/zed/__tests__/open-zed-workspace.test.ts +0 -69
- package/src/integrations/zed/__tests__/reuse-zed-workspace.test.ts +0 -86
- package/src/integrations/zed/add-folders-to-zed-workspace.ts +0 -30
- package/src/integrations/zed/index.ts +0 -3
- package/src/integrations/zed/open-zed-workspace.ts +0 -51
- package/src/integrations/zed/reuse-zed-workspace.ts +0 -57
- package/src/lib/.omc/state/sessions/f9c17a0e-2dd8-4f7d-badf-631f266c5d4c/pre-tool-advisory-throttle.json +0 -18
- package/src/lib/assert-never/assert-never.ts +0 -15
- package/src/lib/assert-never/index.ts +0 -1
- package/src/lib/command-catalog/__tests__/__snapshots__/command-catalog.test.ts.snap +0 -213
- package/src/lib/command-catalog/__tests__/command-catalog.test.ts +0 -193
- package/src/lib/command-catalog/command-catalog.ts +0 -146
- package/src/lib/command-catalog/index.ts +0 -2
- package/src/lib/command-echo/__tests__/command-echo.test.ts +0 -127
- package/src/lib/command-echo/command-echo.ts +0 -78
- package/src/lib/command-echo/index.ts +0 -1
- package/src/lib/constants/__tests__/constants.test.ts +0 -182
- package/src/lib/constants/constants.ts +0 -167
- package/src/lib/constants/index.ts +0 -22
- package/src/lib/env-autoload/__tests__/env-autoload.test.ts +0 -327
- package/src/lib/env-autoload/env-autoload.ts +0 -373
- package/src/lib/env-autoload/index.ts +0 -9
- package/src/lib/error-handlers/index.ts +0 -36
- package/src/lib/errors/__tests__/is-prompt-cancellation.test.ts +0 -48
- package/src/lib/errors/__tests__/operation-error.test.ts +0 -62
- package/src/lib/errors/format-zx-error.ts +0 -54
- package/src/lib/errors/is-prompt-cancellation.ts +0 -38
- package/src/lib/errors/operation-error.ts +0 -80
- package/src/lib/git-guard/__tests__/git-guard.test.ts +0 -92
- package/src/lib/git-guard/git-guard.ts +0 -55
- package/src/lib/git-guard/index.ts +0 -2
- package/src/lib/git-utils/__tests__/git-primitives.test.ts +0 -217
- package/src/lib/git-utils/__tests__/git-utils.test.ts +0 -49
- package/src/lib/git-utils/git-utils.ts +0 -179
- package/src/lib/git-utils/index.ts +0 -10
- package/src/lib/infra-kit-config/.omc/state/sessions/8dd0ad2f-3a90-4158-b9de-ec8e19a7c983/pre-tool-advisory-throttle.json +0 -18
- package/src/lib/infra-kit-config/__tests__/env-autoload-schema.test.ts +0 -71
- package/src/lib/infra-kit-config/__tests__/infra-kit-config.test.ts +0 -504
- package/src/lib/infra-kit-config/index.ts +0 -19
- package/src/lib/infra-kit-config/infra-kit-config.ts +0 -454
- package/src/lib/json-output/__tests__/json-output.test.ts +0 -139
- package/src/lib/json-output/index.ts +0 -1
- package/src/lib/json-output/json-output.ts +0 -47
- package/src/lib/logger/index.ts +0 -40
- package/src/lib/managed-block/__tests__/managed-block.test.ts +0 -121
- package/src/lib/managed-block/index.ts +0 -8
- package/src/lib/managed-block/managed-block.ts +0 -145
- package/src/lib/package-config/.omc/state/sessions/dde22a92-a0e9-4948-905d-25c9a812ab35/last-tool-error-state.json +0 -7
- package/src/lib/package-config/.omc/state/sessions/dde22a92-a0e9-4948-905d-25c9a812ab35/pre-tool-advisory-throttle.json +0 -10
- package/src/lib/package-config/__tests__/package-config.test.ts +0 -95
- package/src/lib/package-config/index.ts +0 -3
- package/src/lib/package-config/package-config-schema.ts +0 -19
- package/src/lib/package-config/package-config.ts +0 -97
- package/src/lib/package-validator/.omc/state/sessions/f9c17a0e-2dd8-4f7d-badf-631f266c5d4c/pre-tool-advisory-throttle.json +0 -10
- package/src/lib/package-validator/__tests__/package-validator.test.ts +0 -270
- package/src/lib/package-validator/checks/__tests__/checks.test.ts +0 -130
- package/src/lib/package-validator/checks/config-check.ts +0 -30
- package/src/lib/package-validator/checks/files-check.ts +0 -29
- package/src/lib/package-validator/checks/index.ts +0 -4
- package/src/lib/package-validator/checks/scripts-check.ts +0 -23
- package/src/lib/package-validator/checks/turbo-check.ts +0 -47
- package/src/lib/package-validator/fs-utils.ts +0 -18
- package/src/lib/package-validator/index.ts +0 -3
- package/src/lib/package-validator/loader/config-loader.ts +0 -77
- package/src/lib/package-validator/loader/index.ts +0 -2
- package/src/lib/package-validator/loader/package-discovery.ts +0 -98
- package/src/lib/package-validator/package-validator.ts +0 -48
- package/src/lib/package-validator/types.ts +0 -15
- package/src/lib/path-display/index.ts +0 -1
- package/src/lib/path-display/path-display.ts +0 -42
- package/src/lib/release-id/__tests__/release-id.test.ts +0 -359
- package/src/lib/release-id/__tests__/versioned-regression.test.ts +0 -69
- package/src/lib/release-id/index.ts +0 -15
- package/src/lib/release-id/release-id.ts +0 -258
- package/src/lib/release-utils/__tests__/release-utils.test.ts +0 -122
- package/src/lib/release-utils/index.ts +0 -15
- package/src/lib/release-utils/release-utils.ts +0 -231
- package/src/lib/render/__tests__/render.test.ts +0 -48
- package/src/lib/render/index.ts +0 -1
- package/src/lib/render/render.ts +0 -24
- package/src/lib/tool-handler/index.ts +0 -1
- package/src/lib/tool-handler/tool-handler.ts +0 -30
- package/src/lib/vendor/.omc/state/sessions/f09f401f-56c6-42cd-97be-c742c1956468/pre-tool-advisory-throttle.json +0 -10
- package/src/lib/vendor/__tests__/config-schema.test.ts +0 -31
- package/src/lib/vendor/__tests__/config.test.ts +0 -63
- package/src/lib/vendor/__tests__/factory-config.test.ts +0 -92
- package/src/lib/vendor/__tests__/vendor-lib.test.ts +0 -158
- package/src/lib/vendor/__tests__/zx-mock.ts +0 -32
- package/src/lib/vendor/config-schema.ts +0 -78
- package/src/lib/vendor/config.ts +0 -58
- package/src/lib/vendor/factory-config-schema.ts +0 -35
- package/src/lib/vendor/factory-config.ts +0 -91
- package/src/lib/vendor/hash.ts +0 -16
- package/src/lib/vendor/index.ts +0 -23
- package/src/lib/vendor/manifest.ts +0 -151
- package/src/lib/vendor/skip-sets.ts +0 -48
- package/src/lib/vendor/sync-ops.ts +0 -290
- package/src/lib/vendor/walk.ts +0 -56
- package/src/lib/version-utils/__tests__/load-existing-versions.test.ts +0 -37
- package/src/lib/version-utils/__tests__/next-version.test.ts +0 -407
- package/src/lib/version-utils/index.ts +0 -18
- package/src/lib/version-utils/load-existing-versions.ts +0 -86
- package/src/lib/version-utils/next-version.ts +0 -283
- package/src/lib/version-utils/version-utils.ts +0 -31
- package/src/lib/warm-cache/__tests__/warm-cache.test.ts +0 -164
- package/src/lib/warm-cache/index.ts +0 -7
- package/src/lib/warm-cache/warm-cache.ts +0 -136
- package/src/lib/worktrees/__tests__/remove-worktrees.test.ts +0 -167
- package/src/lib/worktrees/index.ts +0 -1
- package/src/lib/worktrees/remove-worktrees.ts +0 -66
- package/src/mcp/prompts/index.ts +0 -3
- package/src/mcp/resources/index.ts +0 -3
- package/src/mcp/server.ts +0 -27
- package/src/mcp/tools/index.ts +0 -21
- package/src/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/src/sanity.test.tsx +0 -8
- package/src/tui/__tests__/boot.test.tsx +0 -61
- package/src/tui/__tests__/no-react-boundary.test.ts +0 -51
- package/src/tui/boot.tsx +0 -60
- package/src/tui/screens/__tests__/command-palette.test.tsx +0 -136
- package/src/tui/screens/command-palette.tsx +0 -159
- package/src/tui/types.ts +0 -8
- package/src/types.ts +0 -66
- package/tsconfig.json +0 -46
- package/tsconfig.tsbuildinfo +0 -1
- package/vitest.config.ts +0 -26
- package/vitest.setup.ts +0 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/lib/release-slug/release-slug.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Shared, dependency-light release-slug helper.\n *\n * Extracted from `lib/vite/vite.ts` so BOTH the published `infra-kit/vite` helper\n * (which re-exports it) and the dev-server's dev-context fragment writer derive the\n * `<release>` hostname segment from ONE implementation \u2014 the recorded slug and the\n * helper-computed slug can never drift. Pure (regex only, no imports) so importing it\n * into the lightweight `infra-kit/vite` bundle stays cheap.\n */\n\n/**\n * Slugify a git branch into a `<release>` token: strip a leading git-flow prefix\n * (`feature/`, `release/`, \u2026), lowercase, collapse non-alphanumeric runs to `-`,\n * and trim stray dashes.\n *\n * @example\n * slugifyRelease('release/2.4') // => '2-4'\n * slugifyRelease('feature/HUL-123') // => 'hul-123'\n */\nexport const slugifyRelease = (branch: string): string => {\n // Collect the alphanumeric runs and join with `-`. Doing it this way (rather\n // than collapse-then-trim) is linear and sidesteps a super-linear trim regex,\n // while inherently dropping any leading/trailing separators.\n const runs = branch\n .replace(/^(?:feature|feat|release|hotfix|bugfix|fix|chore)\\//i, '')\n .toLowerCase()\n .match(/[a-z0-9]+/g)\n\n return runs ? runs.join('-') : ''\n}\n"],
|
|
5
|
+
"mappings": "AAmBO,IAAMA,EAAkBC,GAA2B,CAIxD,IAAMC,EAAOD,EACV,QAAQ,uDAAwD,EAAE,EAClE,YAAY,EACZ,MAAM,YAAY,EAErB,OAAOC,EAAOA,EAAK,KAAK,GAAG,EAAI,EACjC",
|
|
6
|
+
"names": ["slugifyRelease", "branch", "runs"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import O from"node:process";import $ from"pino";import se from"pino-pretty";var _="/tmp/mcp-infra-kit.log",Dt=()=>{let e=O.argv.includes("--debug")?"debug":"info",t=$({level:e},$.destination({dest:_}));return t.info(`Logger initialized with level: ${e}. Logging to: ${_}`),t},ie=()=>{let e=O.argv.includes("--debug")?"debug":"info",t=["time","pid","hostname"];return e==="debug"&&t.push("level"),$({level:e},se({destination:2,ignore:t.join(","),colorize:!0}))},g=ie();import*as u from"node:fs";import*as c from"node:path";function ae(e){let t=e;for(let r=0;r<10;r++){let n=c.join(t,"pnpm-workspace.yaml");if(u.existsSync(n))return t;t=c.dirname(t)}throw new Error("Could not find monorepo root (pnpm-workspace.yaml)")}function B(e,t){let r=c.join(e,"package.json");if(!u.existsSync(r))return t;try{let n=JSON.parse(u.readFileSync(r,"utf-8"));return typeof n.name=="string"?n.name:t}catch{return t}}function It(e){let t=c.join(e,"apps"),r=[];if(!u.existsSync(t))throw new Error(`Apps directory not found: ${t}`);let n=u.readdirSync(t,{withFileTypes:!0}).filter(o=>o.isDirectory()).map(o=>o.name);for(let o of n){let i=c.join(t,o,"api"),a=c.join(i,"serverless.yml");u.existsSync(a)&&r.push({name:o,packageName:B(i,o),path:i})}return r}function ce(e){let t=c.join(e,"package.json");if(!u.existsSync(t))return!1;try{let r=JSON.parse(u.readFileSync(t,"utf-8"));return typeof r.scripts?.dev=="string"&&r.scripts.dev.length>0}catch{return!1}}function Et(e){let t=c.join(e,"apps"),r=[];if(!u.existsSync(t))return r;let n=u.readdirSync(t,{withFileTypes:!0}).filter(o=>o.isDirectory()).map(o=>o.name);for(let o of n){let i=c.join(t,o,"ui");u.existsSync(i)&&ce(i)&&r.push({name:o,packageName:B(i,o),path:i})}return r}function jt(e){let t=e?.filter(Boolean)??[];return t.length>0?t:null}function Nt(e){let t=ae(e),r=c.relative(c.join(t,"apps"),e),n=r.split(c.sep)[0];if(r===""||r.startsWith("..")||c.isAbsolute(r)||!n)throw new Error(`--self: not inside an apps/<app> directory (cwd: ${e}). Run from an app folder or use --app=<name>.`);return n}function Lt(e){let t=c.join(e,"packages");if(!u.existsSync(t))return[];let r=u.readdirSync(t,{withFileTypes:!0}).filter(o=>o.isDirectory()).map(o=>o.name),n=[];for(let o of r){let i=c.join(t,o,"dist");u.existsSync(i)&&u.statSync(i).isDirectory()&&n.push(i)}return n}function Tt(e){return e.map(t=>c.join(t.path,"dist")).filter(t=>u.existsSync(t))}function Wt(e,t,r){let n=c.normalize(e),o=r.find(a=>n.startsWith(c.normalize(a)));return o?{kind:"package",packageDir:o}:{kind:"app",app:t.find(a=>n.startsWith(c.normalize(a)))}}import pe from"node:process";import{$ as D}from"zx";var ue=async()=>{try{return await D`cmux --version`.quiet(),!0}catch{return!1}},le=async e=>{let{cwd:t,title:r,layout:n}=e,o=JSON.stringify(n),a=(await D({env:{...pe.env,CMUX_QUIET:"1"}})`cmux new-workspace --name ${r} --cwd ${t} --focus false --layout ${o}`).stdout;return fe(a)},me=async e=>{try{await D`cmux close-workspace --workspace ${e}`.quiet()}catch(t){g.debug({error:t,ref:e},"cmux: skipped closing dev workspace")}},fe=e=>{let t=e.match(/workspace:\d+/);if(!t)throw new Error("cmux: could not locate workspace ref in new-workspace output");return t[0]};var de=/\bv(\d+\.\d+\.\d+)\b/g,h=e=>e.trim().replace(/\s+/g," ").replace(de,"$1");import{$ as K}from"zx";var ge=async e=>{try{let t=(await K`cmux list-workspaces`.quiet()).stdout,r=he(t,e);if(!r)return;await K`cmux close-workspace --workspace ${r}`.quiet()}catch(t){g.debug({error:t,title:e},"cmux: skipped closing workspace")}},he=(e,t)=>{let r=h(t);for(let n of e.split(`
|
|
2
|
+
`)){let o=n.match(/^[* ]\s*(workspace:\d+)\s+(.+?)(?:\s+\[selected\])?\s*$/);if(!o)continue;let i=o[1],a=o[2]?.trim()??"";if(h(a)===r)return i}};import{$ as xe}from"zx";var we=async()=>{try{let e=(await xe`cmux list-workspaces`.quiet()).stdout,t=new Set;for(let r of e.split(`
|
|
3
|
+
`)){let n=r.match(/^[* ]\s*workspace:\d+\s+(.+?)(?:\s+\[selected\])?\s*$/);if(!n)continue;let o=n[1]?.trim();o&&t.add(h(o))}return t}catch(e){return g.debug({error:e},"cmux: skipped listing workspace titles"),new Set}};import{$ as P}from"zx";import L from"node:fs/promises";import _e from"node:os";import b from"node:path";import{z as s}from"zod";import V from"node:path";import{$ as m}from"zx";var ke=/^v?(\d+)\.(\d+)\.(\d+)$/,ve=/^(\d+)\.(\d+)\.(\d+)$/,ye=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,C="release/",A="release/v",M="refs/heads/",be="next";var z=new Set(["dev","main","next","hotfix","regular","release"]),d=class extends Error{constructor(t){super(t),this.name="InvalidReleaseNameError"}},x=class extends Error{constructor(t){super(t),this.name="InvalidReleaseRefError"}},G=e=>e.startsWith(M)?e.slice(M.length):e,U=(e,t,r)=>({kind:"version",semver:{major:e,minor:t,patch:r},raw:`${e}.${t}.${r}`}),I=e=>{if(e.length===0)throw new d('Release name is empty. Provide a kebab-case name like "checkout-redesign".');if(e.length>50)throw new d(`Release name "${e}" is ${e.length} characters; the maximum is 50.`);if(!ye.test(e))throw new d(`Release name "${e}" is not kebab-case. Use lowercase letters, digits, and single hyphens, e.g. "checkout-redesign".`);if(z.has(e))throw new d(`Release name "${e}" is reserved. Reserved names: ${[...z].join(", ")}.`)},v=e=>{let t=G(e.trim());if(!t.startsWith(C))return null;if(t.startsWith(A)){let n=t.slice(A.length),o=ve.exec(n);if(o)return U(Number(o[1]),Number(o[2]),Number(o[3]))}let r=t.slice(C.length);try{I(r)}catch{return null}return{kind:"name",name:r,raw:r}},Pe=e=>{let t=e.trim();if(G(t).startsWith(C)){let o=v(t);if(!o)throw new x(`"${e}" looks like a release branch but is not a valid release/v<semver> or release/<name> ref.`);return o}let n=ke.exec(t);if(n)return U(Number(n[1]),Number(n[2]),Number(n[3]));if(t.toLowerCase()===be)throw new x('The "next" token must be resolved to a concrete version (via computeNextVersion) before parsing a release ref.');try{I(t)}catch(o){let i=o instanceof Error?o.message:String(o);throw new x(`Cannot parse "${e}" as a release ref: ${i}`)}return{kind:"name",name:t,raw:t}},Ce=e=>e.kind==="version"?`${A}${e.raw}`:`${C}${e.name}`,Re=(e,t)=>{let r=t==="hotfix"?"Hotfix":"Release";return e.kind==="version"?`${r} v${e.raw}`:`${r} ${e.name}`},Se=e=>e.kind==="version"?`Release v${e.raw} (RC)`:`Release ${e.name} (RC)`,$e=e=>e.kind==="version"?`v${e.raw}`:e.name,E=e=>e.raw,j=e=>e==null?!1:v(e)!==null,F=e=>{if(e===void 0)return null;let t=e instanceof Date?e.getTime():new Date(e).getTime();return Number.isNaN(t)?null:t},De=(e,t,r)=>{if(e.kind==="version"&&t.kind==="version")return e.semver.major!==t.semver.major?e.semver.major-t.semver.major:e.semver.minor!==t.semver.minor?e.semver.minor-t.semver.minor:e.semver.patch-t.semver.patch;if(e.kind==="version")return-1;if(t.kind==="version")return 1;let n=F(r?.a),o=F(r?.b);return n!==null&&o!==null&&n!==o?n-o:e.name<t.name?-1:e.name>t.name?1:0};var Ae=async e=>{let r=(await m`git worktree list`).stdout.split(`
|
|
4
|
+
`).filter(Boolean),n={release:Ie,feature:Ee};return r.map(n[e]).filter(o=>o!==null)},q=e=>{let t=e.trimEnd();if(!t.endsWith("]"))return null;let r=t.lastIndexOf("[");if(r===-1)return null;let n=t.slice(r+1,-1);return n.length>0?n:null},Ie=e=>{let t=q(e);return j(t)?t:null},Ee=e=>{let t=q(e);return t?.startsWith("feature/")?t:null},y=async()=>(await m`git rev-parse --show-toplevel`).stdout.trim(),H=async()=>(await m`git rev-parse --abbrev-ref HEAD`).stdout.trim(),je=async()=>(await m`git status --porcelain`).stdout.trim().length===0,Ne=async()=>{let e=await y(),[t,r]=await Promise.all([m({cwd:e})`git rev-parse --absolute-git-dir`,m({cwd:e})`git rev-parse --git-common-dir`]),n=t.stdout.trim(),o=V.resolve(e,r.stdout.trim());return n!==o},Le=async()=>{let e=await y();return V.basename(e)},Te=async e=>{(await m`git branch --list ${e}`).stdout.trim().length!==0&&await H()!==e&&await m`git branch -D ${e}`},We=async e=>{(await m`git ls-remote --heads origin ${e}`).stdout.trim().length!==0&&await m`git push origin --delete ${e}`};var J="infra-kit.json",Y=".infra-kit",Oe="infra-kit.json",Be="projects",Ke=s.object({provider:s.literal("doppler"),config:s.object({name:s.string().min(1)})}),Me=s.discriminatedUnion("provider",[Ke]),ze=s.object({workspaceConfigPath:s.string().min(1)}),Fe=s.object({provider:s.literal("cursor"),config:ze}),Ge=s.object({}),Ue=s.object({provider:s.literal("zed"),config:Ge}),X=s.discriminatedUnion("provider",[Fe,Ue]),Ve=s.union([X,s.array(X).min(1)]),qe=s.object({provider:s.literal("jira"),config:s.object({baseUrl:s.string().url(),projectId:s.number().int().positive()})}),He=s.discriminatedUnion("provider",[qe]),Je=["two-columns","three-pane"],Xe=s.object({layout:s.enum(Je).optional()}),Ye=s.object({openInGithubDesktop:s.boolean().optional(),openInCmux:s.boolean().optional(),cmux:Xe.optional()}),Qe=s.object({port:s.number().int().positive().optional(),prefixUrl:s.string().min(1).optional()}).strict(),Ze=s.record(s.string().min(1),Qe),et=s.enum(["local","cloud"]),tt=s.object({watchDeps:s.boolean().optional(),proxy:s.record(s.string().min(1),et).optional()}).strict(),rt=s.object({apps:s.record(s.string().min(1),tt).optional(),cmux:s.boolean().optional()}).strict(),nt=s.record(s.string().min(1),rt),ot=s.object({trigger:s.enum(["shell-startup","cli-invocation"]),config:s.string().min(1)}).strict(),Q=s.object({environments:s.array(s.string().min(1)).min(1),envManagement:Me,ide:Ve.optional(),taskManager:He.optional(),worktrees:Ye.optional(),envAutoLoad:ot.optional(),dev:Ze.optional(),devPresets:nt.optional()}),Z=Q.superRefine((e,t)=>{if(!Array.isArray(e.ide))return;let r=new Set;for(let n of e.ide){if(r.has(n.provider)){t.addIssue({code:"custom",message:"each IDE provider may appear at most once",path:["ide"]});return}r.add(n.provider)}}),ee=Q.partial(),st=e=>{let t=e.ide;return t?Array.isArray(t)?t:[t]:[]},it="two-columns",T=e=>e.worktrees?.cmux?.layout??it,w=null,te=async()=>{let e=await y(),t=b.basename(e),r=b.join(_e.homedir(),Y);return{main:b.join(e,J),userGlobal:b.join(r,Oe),userProject:b.join(r,Be,t,J),projectName:t}},W=async()=>{let e=await te(),t;try{t=await L.stat(e.main)}catch{w=null;let l=e.main.replace(/\.json$/,".yml");throw await N(l)?new Error(`infra-kit.json not found at ${e.main}. A legacy infra-kit.yml exists \u2014 run \`infra-kit init\` to convert it.`):new Error(`infra-kit.json not found at ${e.main}`)}let[r,n]=await Promise.all([N(e.userGlobal),N(e.userProject)]),o={main:Number(t.mtimeMs),userGlobal:r?Number(r.mtimeMs):null,userProject:n?Number(n.mtimeMs):null};if(w&&pt(w.mtimes,o))return w.value;let i=[{label:"infra-kit.json",path:e.main,required:!0},{label:"~/.infra-kit/infra-kit.json",path:e.userGlobal,required:!1},{label:`~/.infra-kit/projects/${e.projectName}/infra-kit.json`,path:e.userProject,required:!1}],a={};for(let l of i){let f=await ut(l);f!==null&&(a={...a,...f})}let p=Z.safeParse(a);if(!p.success)throw new Error(`Invalid merged infra-kit config: ${s.prettifyError(p.error)}`);return w={mtimes:o,value:p.data},p.data},at=()=>{w=null},N=async e=>{try{return await L.stat(e)}catch{return null}},ct=async e=>{try{return await L.readFile(e,"utf-8")}catch{return null}},pt=(e,t)=>{let r=Object.keys(e);return r.length!==Object.keys(t).length?!1:r.every(n=>e[n]===t[n])},ut=async e=>{let t=await ct(e.path);if(t===null){if(e.required)throw new Error(`${e.label} not found at ${e.path}`);return null}let r;try{r=t.trim()===""?{}:JSON.parse(t)}catch(o){throw new Error(`Invalid JSON in ${e.label} at ${e.path}: ${o.message}`)}let n=ee.safeParse(r);if(!n.success)throw new Error(`Invalid ${e.label} at ${e.path}: ${s.prettifyError(n.error)}`);return n.data};var lt=async e=>{let{cwd:t,title:r}=e,n=T(await W()),o=(await P`cmux workspace create --cwd ${t}`).stdout,i=ft(o),a=(await P`cmux list-pane-surfaces --workspace ${i}`).stdout,p=mt(a);await P`cmux new-split right --workspace ${i} --surface ${p}`,n==="three-pane"&&await P`cmux new-split down --workspace ${i} --surface ${p}`,r&&await P`cmux workspace rename --workspace ${i} --title ${r}`},mt=e=>{let t=e.match(/surface:\d+/);if(!t)throw new Error("cmux: could not locate initial surface in list-pane-surfaces output");return t[0]},ft=e=>{let t=e.match(/workspace:\d+/);if(!t)throw new Error("cmux: could not locate workspace ref in workspace create output");return t[0]};var dt=e=>{let{repoName:t,branch:r}=e,n=v(r),o=n?E(n):r;return`${t} ${o}`};var gt=["api","ui"],ht=e=>{let t=e.split("/"),[r,n]=t;if(t.length>2||!r)throw new Error(`devPresets: invalid target "${e}" (expected "<app>" or "<app>/api|ui")`);if(n===void 0)return{appGlob:r,parts:gt,explicit:!1};if(n==="api"||n==="ui")return{appGlob:r,parts:[n],explicit:!0};throw new Error(`devPresets: invalid target part "${n}" in "${e}" (expected "api" or "ui")`)},xt=(e,t)=>t==="api"?e.api:e.ui,wt=e=>[...new Set([...e.api,...e.ui])].sort(),re=(e,t)=>`${e}/${t}`,kt=(e,t)=>(e?0:2)+(t?1:0),vt=(e,t)=>t.watchDeps===void 0?e??{watchDeps:!0,rank:t.rank,explicitValue:!1}:!e||!e.explicitValue?{watchDeps:t.watchDeps,rank:t.rank,explicitValue:!0}:t.rank>e.rank?{watchDeps:t.watchDeps,rank:t.rank,explicitValue:!0}:t.rank<e.rank?e:{watchDeps:e.watchDeps&&t.watchDeps,rank:e.rank,explicitValue:!0},yt=(e,t,r)=>{let{app:n,part:o,watchDeps:i,isGlob:a,explicit:p}=r;if(!xt(t,o).includes(n)){p&&!a&&e.unmatched.push(re(n,o));return}let l=re(n,o),f=vt(e.targets.get(l),{watchDeps:i,rank:kt(a,p)});e.targets.set(l,{app:n,part:o,...f})},bt=(e,t)=>{let r=Object.entries(e.apps??{"*":{}}),n={targets:new Map,proxy:{},unmatched:[]};for(let[a,p]of r){let{appGlob:l,parts:f,explicit:R}=ht(a),k=l==="*",ne=k?wt(t):[l];for(let S of ne){for(let oe of f)yt(n,t,{app:S,part:oe,watchDeps:p.watchDeps,isGlob:k,explicit:R});p.proxy&&(n.proxy[S]={...n.proxy[S]??{},...p.proxy})}}let o=[...n.targets.values()].map(({app:a,part:p,watchDeps:l})=>({app:a,part:p,watchDeps:l})),i=[...new Set(o.filter(a=>a.part==="api").map(a=>a.app))];return{targets:o,cmux:e.cmux??!1,proxy:n.proxy,localApps:i,unmatched:n.unmatched}},Pt=(e,t)=>Object.keys(e).find(r=>e[r]===t),Ct=({preset:e,app:t,route:r,launchedPkgs:n,ctx:o})=>{let i=o.routePkg(t,r);if(i===void 0)return{preset:e,app:t,route:r,kind:"unknown-route",message:`preset "${e}": proxy override "${r}" on "${t}" names a route not declared in ${t}'s infra-kit.config.ts dev.proxy.routes`};if(n.has(i))return null;let a=Pt(o.apiPkgByApp,i),p=a?`add "${a}/api" to the preset`:`launch the api whose package is "${i}"`;return{preset:e,app:t,route:r,pkg:i,kind:"backend-not-launched",message:`preset "${e}": proxy override "${r}" \u2192 "local" requires backend "${i}" to run locally, but the preset does not launch it \u2014 ${p}, or set "${r}" to "cloud"`}},Sr=(e,t)=>{let r=[];for(let[n,o]of Object.entries(e)){let i=bt(o,t.discovered),a=new Set(i.localApps.map(p=>t.apiPkgByApp[p]).filter(p=>p!==void 0));for(let[p,l]of Object.entries(i.proxy))for(let[f,R]of Object.entries(l)){if(R!=="local")continue;let k=Ct({preset:n,app:p,route:f,launchedPkgs:a,ctx:t});k&&r.push(k)}}return r};export{d as a,I as b,v as c,Pe as d,Ce as e,Re as f,Se as g,$e as h,E as i,j,De as k,Ae as l,y as m,H as n,je as o,Ne as p,Le as q,Te as r,We as s,_ as t,Dt as u,g as v,ae as w,It as x,Et as y,jt as z,Nt as A,Lt as B,Tt as C,Wt as D,bt as E,Sr as F,Y as G,Z as H,ee as I,st as J,te as K,W as L,at as M,h as N,ge as O,we as P,ue as Q,le as R,me as S,lt as T,dt as U};
|
|
5
|
+
//# sourceMappingURL=chunk-6RRAK2QO.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/lib/logger/index.ts", "../src/dev/discovery.ts", "../src/integrations/cmux/open-dev-workspace.ts", "../src/integrations/cmux/canonicalize-cmux-title.ts", "../src/integrations/cmux/close-workspace-by-title.ts", "../src/integrations/cmux/list-workspace-titles.ts", "../src/integrations/cmux/open-workspace-with-layout.ts", "../src/lib/infra-kit-config/infra-kit-config.ts", "../src/lib/git-utils/git-utils.ts", "../src/lib/release-id/release-id.ts", "../src/integrations/cmux/workspace-title.ts", "../src/dev/presets.ts"],
|
|
4
|
+
"sourcesContent": ["import process from 'node:process'\nimport pino from 'pino'\nimport pretty from 'pino-pretty'\n\n// eslint-disable-next-line sonarjs/publicly-writable-directories\nexport const LOG_FILE_PATH = '/tmp/mcp-infra-kit.log'\n\nexport const initLoggerMcp = () => {\n const logLevel = process.argv.includes('--debug') ? 'debug' : 'info'\n\n const logger = pino({ level: logLevel }, pino.destination({ dest: LOG_FILE_PATH }))\n\n logger.info(`Logger initialized with level: ${logLevel}. Logging to: ${LOG_FILE_PATH}`)\n\n return logger\n}\n\nexport const initLoggerCLI = () => {\n const logLevel = process.argv.includes('--debug') ? 'debug' : 'info'\n\n const ignoreFields = ['time', 'pid', 'hostname']\n\n if (logLevel === 'debug') {\n ignoreFields.push('level')\n }\n\n const logger = pino(\n { level: logLevel },\n pretty({\n destination: 2,\n ignore: ignoreFields.join(','),\n colorize: true,\n }),\n )\n\n return logger\n}\n\n// Singleton logger instance for CLI usage\nexport const logger = initLoggerCLI()\n", "/**\n * Filesystem discovery helpers for the dev-server.\n *\n * These functions read the filesystem (walking for the monorepo root, scanning\n * `apps/` and `packages/`) but never `chdir` and never resolve ports / prefixes \u2014\n * that stays with the pure {@link file://./ports.ts} layer. The starting directory\n * is passed in so discovery is testable against a fixture root.\n */\nimport * as fs from 'node:fs'\nimport * as path from 'node:path'\n\n/** Bare metadata for a discovered API app (no resolved port / prefix). */\nexport interface DiscoveredApiApp {\n /** App folder name (e.g. backoffice, client). */\n name: string\n /** Package name from package.json (e.g. sls-trvl-client), or the folder name as fallback. */\n packageName: string\n path: string\n}\n\n/** Walk up from `startDir` (max 10 levels) to the dir containing `pnpm-workspace.yaml`. */\nexport function findMonorepoRoot(startDir: string): string {\n let currentDir = startDir\n\n for (let i = 0; i < 10; i++) {\n const workspaceFile = path.join(currentDir, 'pnpm-workspace.yaml')\n\n if (fs.existsSync(workspaceFile)) {\n return currentDir\n }\n currentDir = path.dirname(currentDir)\n }\n\n throw new Error('Could not find monorepo root (pnpm-workspace.yaml)')\n}\n\n/** Read the `name` field from `<apiPath>/package.json`, falling back to `appName`. */\nexport function getPackageName(apiPath: string, appName: string): string {\n const pkgPath = path.join(apiPath, 'package.json')\n\n if (!fs.existsSync(pkgPath)) return appName\n\n try {\n const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8')) as { name?: string }\n\n return typeof pkg.name === 'string' ? pkg.name : appName\n } catch {\n return appName\n }\n}\n\n/** Discover every `apps/<app>` that has an `api/serverless.yml` (bare metadata only). */\nexport function discoverApiApps(root: string): DiscoveredApiApp[] {\n const appsDir = path.join(root, 'apps')\n const apps: DiscoveredApiApp[] = []\n\n if (!fs.existsSync(appsDir)) {\n throw new Error(`Apps directory not found: ${appsDir}`)\n }\n\n const appDirs = fs\n .readdirSync(appsDir, { withFileTypes: true })\n .filter((dirent) => {\n return dirent.isDirectory()\n })\n .map((dirent) => {\n return dirent.name\n })\n\n for (const appName of appDirs) {\n const apiPath = path.join(appsDir, appName, 'api')\n const serverlessPath = path.join(apiPath, 'serverless.yml')\n\n if (fs.existsSync(serverlessPath)) {\n apps.push({\n name: appName,\n packageName: getPackageName(apiPath, appName),\n path: apiPath,\n })\n }\n }\n\n return apps\n}\n\n/** Bare metadata for a discovered UI app (a frontend with its own framework `dev` script). */\nexport interface DiscoveredUiApp {\n /** App folder name (e.g. backoffice, client). */\n name: string\n /** package.json `name` \u2014 used as the exact `turbo run dev --filter` target. */\n packageName: string\n /** Absolute path to `apps/<app>/ui`. */\n path: string\n}\n\n/** True when `<dir>/package.json` declares a non-empty `scripts.dev`. */\nfunction hasDevScript(dir: string): boolean {\n const pkgPath = path.join(dir, 'package.json')\n\n if (!fs.existsSync(pkgPath)) return false\n\n try {\n const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8')) as { scripts?: Record<string, string> }\n\n return typeof pkg.scripts?.dev === 'string' && pkg.scripts.dev.length > 0\n } catch {\n return false\n }\n}\n\n/**\n * Discover every `apps/<app>/ui` whose package.json declares a `dev` script \u2014 the frontends\n * `infra-kit dev --ui` runs (via one delegated `turbo run dev`). Lenient: no `apps/` dir \u2192 `[]`\n * (UIs are optional), unlike {@link discoverApiApps} which requires it.\n */\nexport function discoverUiApps(root: string): DiscoveredUiApp[] {\n const appsDir = path.join(root, 'apps')\n const apps: DiscoveredUiApp[] = []\n\n if (!fs.existsSync(appsDir)) return apps\n\n const appDirs = fs\n .readdirSync(appsDir, { withFileTypes: true })\n .filter((dirent) => {\n return dirent.isDirectory()\n })\n .map((dirent) => {\n return dirent.name\n })\n\n for (const appName of appDirs) {\n const uiPath = path.join(appsDir, appName, 'ui')\n\n if (fs.existsSync(uiPath) && hasDevScript(uiPath)) {\n apps.push({\n name: appName,\n packageName: getPackageName(uiPath, appName),\n path: uiPath,\n })\n }\n }\n\n return apps\n}\n\n/** Normalize the `--app` include list: drop empties, and collapse an empty list to `null`. */\nexport function normalizeAppInclude(include?: string[] | null): string[] | null {\n const filtered = include?.filter(Boolean) ?? []\n\n return filtered.length > 0 ? filtered : null\n}\n\n/**\n * Infer the current app's folder name from `startDir`, so a per-app script can\n * run `infra-kit dev --self` without hardcoding its own app name. Walks up to the\n * monorepo root (via {@link findMonorepoRoot}), then takes the first path segment\n * of `startDir` relative to `<root>/apps` \u2014 e.g. `apps/config-handler/api` and\n * `apps/config-handler` both resolve to `config-handler`. Throws when `startDir`\n * isn't inside `<root>/apps/<app>/...` (repo root, or an unrelated path).\n *\n * @example\n * resolveSelfAppName('/repo/apps/config-handler/api') // => 'config-handler'\n */\nexport function resolveSelfAppName(startDir: string): string {\n const root = findMonorepoRoot(startDir)\n const relative = path.relative(path.join(root, 'apps'), startDir)\n const firstSegment = relative.split(path.sep)[0]\n const isOutsideApps = relative === '' || relative.startsWith('..') || path.isAbsolute(relative)\n\n if (isOutsideApps || !firstSegment) {\n throw new Error(\n `--self: not inside an apps/<app> directory (cwd: ${startDir}). Run from an app folder or use --app=<name>.`,\n )\n }\n\n return firstSegment\n}\n\n/**\n * Existing `packages/<pkg>/dist` directories under the monorepo root \u2014 the compiled\n * outputs `turbo watch` rewrites. Watched (alongside app dist) because editing a shared\n * lib rewrites only the lib's `dist`, never the dependent app's, so a package-dist change\n * is the only signal that a lib was rebuilt.\n */\nexport function getPackageDistDirs(root: string): string[] {\n const packagesDir = path.join(root, 'packages')\n\n if (!fs.existsSync(packagesDir)) return []\n\n const names = fs\n .readdirSync(packagesDir, { withFileTypes: true })\n .filter((d) => {\n return d.isDirectory()\n })\n .map((d) => {\n return d.name\n })\n const dirs: string[] = []\n\n for (const name of names) {\n const distDir = path.join(packagesDir, name, 'dist')\n\n if (fs.existsSync(distDir) && fs.statSync(distDir).isDirectory()) {\n dirs.push(distDir)\n }\n }\n\n return dirs\n}\n\n/** Existing `<app.path>/dist` directories for the given apps (order preserved). */\nexport function getAppDistDirs(apps: Array<{ path: string }>): string[] {\n return apps\n .map((app) => {\n return path.join(app.path, 'dist')\n })\n .filter((dir) => {\n return fs.existsSync(dir)\n })\n}\n\n/** How a watched dist change should be routed. */\nexport interface ChangeClassification {\n kind: 'app' | 'package'\n /** For app changes: the matched app dist dir (undefined when nothing matched). */\n app?: string\n /** For package changes: the matched `packages/<pkg>/dist` dir (the change identity used to scope restarts). */\n packageDir?: string\n}\n\n/**\n * Route a changed compiled-output path: a `packages/<pkg>/dist` change is a shared-package\n * rebuild \u2014 the matched package dist dir is returned so the caller can restart only the apps\n * whose dependency closure includes it. An `<app>/dist` change restarts only that app (the\n * matched app dist dir is returned; `undefined` when the path matches neither). Package matches\n * take precedence.\n */\nexport function classifyDistChange(\n changedPath: string,\n appDistDirs: string[],\n packageDistDirs: string[],\n): ChangeClassification {\n const normalized = path.normalize(changedPath)\n\n const matchedPackageDir = packageDistDirs.find((dir) => {\n return normalized.startsWith(path.normalize(dir))\n })\n\n if (matchedPackageDir) {\n return { kind: 'package', packageDir: matchedPackageDir }\n }\n\n const matchedDir = appDistDirs.find((dir) => {\n return normalized.startsWith(path.normalize(dir))\n })\n\n return { kind: 'app', app: matchedDir }\n}\n", "import process from 'node:process'\nimport { $ } from 'zx'\n\nimport type { CmuxLayoutNode } from 'src/dev/cmux-layout'\nimport { logger } from 'src/lib/logger'\n\n/** Args for {@link openCmuxDevWorkspace}: the workspace root, title, and pane layout tree. */\ninterface OpenCmuxDevWorkspaceArgs {\n cwd: string\n title: string\n layout: CmuxLayoutNode\n}\n\n/**\n * True iff the `cmux` CLI is invokable (i.e. `cmux --version` resolves). Used to\n * gate `--cmux` mode and fall back to single-process dev when cmux is absent.\n */\nexport const isCmuxAvailable = async (): Promise<boolean> => {\n try {\n await $`cmux --version`.quiet()\n\n return true\n } catch {\n return false\n }\n}\n\n/**\n * Open ONE cmux workspace rooted at `cwd`, laid out per `layout` (one pane per\n * command). Runs in a `CMUX_QUIET=1` scoped env to suppress cmux's one-time compat\n * notice, then parses and returns the `workspace:<id>` ref from stdout.\n */\nexport const openCmuxDevWorkspace = async (args: OpenCmuxDevWorkspaceArgs): Promise<string> => {\n const { cwd, title, layout } = args\n const layoutJson = JSON.stringify(layout)\n\n const $cmux = $({ env: { ...process.env, CMUX_QUIET: '1' } })\n const output = (await $cmux`cmux new-workspace --name ${title} --cwd ${cwd} --focus false --layout ${layoutJson}`)\n .stdout\n\n return parseWorkspaceRef(output)\n}\n\n/**\n * Best-effort close of the cmux workspace `ref`, tearing down the workspace and\n * every pane process. Silently no-ops (debug-logged) if cmux isn't running or the\n * close fails, mirroring {@link file://./close-workspace-by-title.ts}.\n */\nexport const closeCmuxDevWorkspace = async (ref: string): Promise<void> => {\n try {\n await $`cmux close-workspace --workspace ${ref}`.quiet()\n } catch (error) {\n logger.debug({ error, ref }, 'cmux: skipped closing dev workspace')\n }\n}\n\n/**\n * Extract the `workspace:<id>` ref from `cmux new-workspace` output (e.g.\n * `OK workspace:5`). Throws a clear error when no ref is present.\n *\n * @example\n * parseWorkspaceRef('OK workspace:5\\n') // => 'workspace:5'\n */\nconst parseWorkspaceRef = (output: string): string => {\n const match = output.match(/workspace:\\d+/)\n\n if (!match) {\n throw new Error('cmux: could not locate workspace ref in new-workspace output')\n }\n\n return match[0]\n}\n", "/** Matches a `v`-prefixed semver token (e.g. `v1.48.0`) anchored on shape. */\nconst V_SEMVER_TOKEN_RE = /\\bv(\\d+\\.\\d+\\.\\d+)\\b/g\n\n/**\n * Canonicalizes a cmux workspace title into a stable dedup/close key.\n *\n * cmux workspace titles are human display strings built by\n * `buildCmuxWorkspaceTitle`, so the value stored when a workspace is created can\n * drift from the value rebuilt later \u2014 across whitespace and across CLI versions\n * (an older build titled version releases `v1.48.0`; the current build titles\n * them `1.48.0`). Keying dedup or close on the raw title silently creates\n * duplicate / unclosable workspaces whenever that drift occurs.\n *\n * Canonicalization collapses the known drift axes so both sides round-trip to an\n * equal key:\n * - trims and collapses internal whitespace to single spaces;\n * - normalizes a `v`-prefixed semver token to its bare form\n * (`v1.48.0` \u2192 `1.48.0`), anchored on semver shape so named releases that\n * merely start with `v` (e.g. `vega-redesign`) are left untouched.\n *\n * Non-release fallback titles (which may contain `/`, e.g. `feature/foo`) are\n * preserved as-is apart from whitespace normalization.\n *\n * @example\n * canonicalizeCmuxTitle('hulyo-monorepo v1.48.0') // => 'hulyo-monorepo 1.48.0'\n * canonicalizeCmuxTitle('hulyo-monorepo 1.48.0') // => 'hulyo-monorepo 1.48.0'\n * canonicalizeCmuxTitle('hulyo-monorepo vega-redesign') // => 'hulyo-monorepo vega-redesign'\n */\nexport const canonicalizeCmuxTitle = (raw: string): string => {\n return raw.trim().replace(/\\s+/g, ' ').replace(V_SEMVER_TOKEN_RE, '$1')\n}\n", "import { $ } from 'zx'\n\nimport { logger } from 'src/lib/logger'\n\nimport { canonicalizeCmuxTitle } from './canonicalize-cmux-title'\n\n/**\n * Best-effort close of the cmux workspace whose title matches `title` (compared\n * via {@link canonicalizeCmuxTitle}, so a drifted stored title still resolves).\n * Silently no-ops if cmux isn't running, the workspace isn't found, or close fails.\n */\nexport const closeCmuxWorkspaceByTitle = async (title: string): Promise<void> => {\n try {\n const listOutput = (await $`cmux list-workspaces`.quiet()).stdout\n\n const ref = findWorkspaceRefByTitle(listOutput, title)\n\n if (!ref) {\n return\n }\n\n await $`cmux close-workspace --workspace ${ref}`.quiet()\n } catch (error) {\n logger.debug({ error, title }, 'cmux: skipped closing workspace')\n }\n}\n\n/**\n * Parses `cmux list-workspaces` output and returns the workspace ref whose\n * title matches `title`, or undefined if no match. Both sides are compared via\n * {@link canonicalizeCmuxTitle} so a workspace stored under a drifted title\n * (whitespace, or an older CLI's `v`-prefixed semver) is still found \u2014 keeping\n * close symmetric with the cmux open dedup in `worktrees-reload`.\n *\n * Each line looks like:\n * \" workspace:8 hulyo-monorepo 1.48.0\"\n * \"* workspace:6 obsidian-workspace [selected]\"\n */\nconst findWorkspaceRefByTitle = (output: string, title: string): string | undefined => {\n const target = canonicalizeCmuxTitle(title)\n\n for (const rawLine of output.split('\\n')) {\n // eslint-disable-next-line sonarjs/super-linear-regex, regexp/no-super-linear-backtracking\n const match = rawLine.match(/^[* ]\\s*(workspace:\\d+)\\s+(.+?)(?:\\s+\\[selected\\])?\\s*$/)\n\n if (!match) {\n continue\n }\n\n const ref = match[1]\n const lineTitle = match[2]?.trim() ?? ''\n\n if (canonicalizeCmuxTitle(lineTitle) === target) {\n return ref\n }\n }\n\n return undefined\n}\n", "import { $ } from 'zx'\n\nimport { logger } from 'src/lib/logger'\n\nimport { canonicalizeCmuxTitle } from './canonicalize-cmux-title'\n\n/**\n * Returns the set of **canonical** titles for all currently-open cmux\n * workspaces (see {@link canonicalizeCmuxTitle}). Keying on the canonical form\n * lets callers match a workspace even when its stored title drifted from the\n * title they rebuild (whitespace, or an older CLI's `v`-prefixed semver).\n * Returns an empty set if cmux isn't running, the call fails, or the output\n * can't be parsed \u2014 callers should treat \"empty\" as \"unknown, proceed as if\n * nothing is open\".\n *\n * Each line of `cmux list-workspaces` looks like:\n * \" workspace:8 hulyo-monorepo 1.48.0\"\n * \"* workspace:6 obsidian-workspace [selected]\"\n */\nexport const listCmuxWorkspaceTitles = async (): Promise<Set<string>> => {\n try {\n const output = (await $`cmux list-workspaces`.quiet()).stdout\n\n const titles = new Set<string>()\n\n for (const rawLine of output.split('\\n')) {\n // eslint-disable-next-line sonarjs/super-linear-regex, regexp/no-super-linear-backtracking\n const match = rawLine.match(/^[* ]\\s*workspace:\\d+\\s+(.+?)(?:\\s+\\[selected\\])?\\s*$/)\n\n if (!match) {\n continue\n }\n\n const title = match[1]?.trim()\n\n if (title) {\n titles.add(canonicalizeCmuxTitle(title))\n }\n }\n\n return titles\n } catch (error) {\n logger.debug({ error }, 'cmux: skipped listing workspace titles')\n\n return new Set()\n }\n}\n", "import { $ } from 'zx'\n\nimport { getInfraKitConfig, resolveCmuxLayout } from 'src/lib/infra-kit-config'\n\ninterface OpenCmuxWorkspaceArgs {\n cwd: string\n title?: string\n}\n\n/**\n * Opens a new cmux workspace rooted at `cwd`, with panes arranged per the\n * configured `worktrees.cmux.layout` (resolved via {@link resolveCmuxLayout},\n * default `two-columns`):\n * two-columns \u2014 left | right, both full-height (two panes)\n * three-pane \u2014 left-top / left-bottom | full-height right (three panes)\n * All panes inherit `cwd` from the workspace.\n */\nexport const openCmuxWorkspaceWithLayout = async (args: OpenCmuxWorkspaceArgs): Promise<void> => {\n const { cwd, title } = args\n\n const layout = resolveCmuxLayout(await getInfraKitConfig())\n\n const newWorkspaceOutput = (await $`cmux workspace create --cwd ${cwd}`).stdout\n\n const workspaceRef = parseWorkspaceRef(newWorkspaceOutput)\n\n const surfacesOutput = (await $`cmux list-pane-surfaces --workspace ${workspaceRef}`).stdout\n\n const leftTopRef = parseFirstSurfaceRef(surfacesOutput)\n\n // Both layouts share the vertical split into left | right columns; only the\n // legacy three-pane layout additionally splits the left column top/bottom.\n await $`cmux new-split right --workspace ${workspaceRef} --surface ${leftTopRef}`\n\n if (layout === 'three-pane') {\n await $`cmux new-split down --workspace ${workspaceRef} --surface ${leftTopRef}`\n }\n\n if (title) {\n await $`cmux workspace rename --workspace ${workspaceRef} --title ${title}`\n }\n}\n\n/**\n * Extracts the first `surface:<id>` reference from the output of\n * `cmux list-pane-surfaces`. Used to locate the initial (primary) pane\n * surface so subsequent splits can be anchored relative to it.\n *\n * @example\n * const output = 'surface:12 (active)\\nsurface:13\\n'\n * parseFirstSurfaceRef(output) // => 'surface:12'\n */\nconst parseFirstSurfaceRef = (output: string): string => {\n const match = output.match(/surface:\\d+/)\n\n if (!match) {\n throw new Error('cmux: could not locate initial surface in list-pane-surfaces output')\n }\n\n return match[0]\n}\n\n/**\n * Extracts the `workspace:<id>` reference from the output of\n * `cmux workspace create`. The returned ref is used to target the newly\n * created workspace in follow-up `cmux` commands (splits, rename, etc.).\n *\n * @example\n * const output = 'created workspace:7\\n'\n * parseWorkspaceRef(output) // => 'workspace:7'\n */\nconst parseWorkspaceRef = (output: string): string => {\n const match = output.match(/workspace:\\d+/)\n\n if (!match) {\n throw new Error('cmux: could not locate workspace ref in workspace create output')\n }\n\n return match[0]\n}\n", "import fs from 'node:fs/promises'\nimport os from 'node:os'\nimport path from 'node:path'\nimport { z } from 'zod'\n\nimport { getProjectRoot } from 'src/lib/git-utils'\n\nconst INFRA_KIT_CONFIG_FILE = 'infra-kit.json'\n\n/**\n * Directory under the user's home that holds all machine-local infra-kit config:\n * the runtime `infra-kit.json` merge layer, per-project overrides, and the factory\n * registry (`vendor.json`). Single source of truth for `.infra-kit`, reused\n * by the vendor factory-config loader (no import cycle \u2014 this module imports no\n * `lib/vendor` code).\n */\nexport const USER_CONFIG_DIR_NAME = '.infra-kit'\nconst USER_GLOBAL_CONFIG_FILE = 'infra-kit.json'\nconst USER_PROJECTS_DIR = 'projects'\n\n// envManagement\nconst dopplerEnvManagementSchema = z.object({\n provider: z.literal('doppler'),\n config: z.object({\n name: z.string().min(1),\n }),\n})\n\nconst envManagementSchema = z.discriminatedUnion('provider', [dopplerEnvManagementSchema])\n\n// ide\n// There is one attach style: each worktree is added to the configured editor's\n// workspace and opened (no per-window mode). Cursor needs a `.code-workspace`\n// path to reconcile its `folders` array against.\nconst cursorIdeConfigSchema = z.object({\n workspaceConfigPath: z.string().min(1),\n})\n\nconst cursorIdeSchema = z.object({\n provider: z.literal('cursor'),\n config: cursorIdeConfigSchema,\n})\n\n// Zed has no portable workspace file (no `.code-workspace`) and no folder-remove\n// CLI: a multi-worktree workspace is realized by a single `zed <root> <wt...>`\n// invocation. So `config` carries no settings \u2014 there's no path to point at.\nconst zedIdeConfigSchema = z.object({})\n\nconst zedIdeSchema = z.object({\n provider: z.literal('zed'),\n config: zedIdeConfigSchema,\n})\n\nconst ideSchema = z.discriminatedUnion('provider', [cursorIdeSchema, zedIdeSchema])\n\n// `ide` accepts a single provider (back-compat) OR an array to drive multiple\n// editors at once (e.g. Cursor + Zed). Normalized to an array everywhere via\n// `resolveConfiguredIdes`. Uniqueness-by-provider is enforced at parse time by a\n// `.superRefine` on the full config schema (see below) \u2014 not here, so the message\n// survives `z.union` error aggregation.\nconst idesSchema = z.union([ideSchema, z.array(ideSchema).min(1)])\n\n// taskManager\nconst jiraTaskManagerSchema = z.object({\n provider: z.literal('jira'),\n config: z.object({\n baseUrl: z.string().url(),\n projectId: z.number().int().positive(),\n }),\n})\n\nconst taskManagerSchema = z.discriminatedUnion('provider', [jiraTaskManagerSchema])\n\n// cmux pane layout for opened worktree workspaces. Named presets keep the config\n// typo-proof (an enum, not a free string) and let the opener switch on a single\n// value; extend the enum + the opener's switch to add a layout.\n// two-columns \u2014 left | right, both full-height (default)\n// three-pane \u2014 left split top/bottom + full-height right (legacy layout)\nconst cmuxLayouts = ['two-columns', 'three-pane'] as const\n\nconst cmuxConfigSchema = z.object({\n layout: z.enum(cmuxLayouts).optional(),\n})\n\n// worktrees prompt defaults\nconst worktreesConfigSchema = z.object({\n openInGithubDesktop: z.boolean().optional(),\n openInCmux: z.boolean().optional(),\n cmux: cmuxConfigSchema.optional(),\n})\n\n// dev-server per-app overrides. Maps an app folder name (e.g. `client`) to its\n// local dev port and/or URL prefix. Both keys optional. An app absent from the\n// map falls back to env (`{APP}_PORT` / `PORT`) then the built-in defaults, so\n// the map is intentionally NOT validated against the discovered apps here \u2014 an\n// unknown app name is simply ignored at resolve time (lib/dev), never a parse\n// error that would brick every command.\nconst devAppConfigSchema = z\n .object({\n port: z.number().int().positive().optional(),\n prefixUrl: z.string().min(1).optional(),\n })\n .strict()\n\nconst devConfigSchema = z.record(z.string().min(1), devAppConfigSchema)\n\n// devPresets: named local-dev sessions, declared in the per-project infra-kit.json\n// (team presets committed; personal ones layered via the user-project override).\n// Each preset names launch targets (apps/<app>/{api,ui}), optional per-backend\n// `watchDeps`, per-route proxy-source overrides, and a `cmux` layout flag; it is\n// consumed by `infra-kit dev <preset>` and resolved by src/dev/presets. The SHAPE\n// is strict (typos in a preset surface as parse errors), but unknown app/route\n// NAMES are intentionally NOT validated here \u2014 they resolve at run time against the\n// discovered apps, so a stale preset never bricks every command.\nconst proxySourceSchema = z.enum(['local', 'cloud'])\n\nconst devPresetAppSchema = z\n .object({\n // api targets only: watch the backend's dist + shared-package subdeps and restart on change.\n watchDeps: z.boolean().optional(),\n // route path (e.g. `/api`) \u2192 source, overriding that route's config.ts default for this session.\n proxy: z.record(z.string().min(1), proxySourceSchema).optional(),\n })\n .strict()\n\nconst devPresetSchema = z\n .object({\n // Launch-target key (`client`, `client/ui`, `client/api`, `*/api`) \u2192 its settings. Omit = all.\n apps: z.record(z.string().min(1), devPresetAppSchema).optional(),\n // Run each launched target in its own cmux pane (one workspace, N panes).\n cmux: z.boolean().optional(),\n })\n .strict()\n\nconst devPresetsSchema = z.record(z.string().min(1), devPresetSchema)\n\n// env auto-load: opt-in convenience that primes Doppler env when you work inside\n// this project / a worktree. Absent => disabled. `trigger` selects the moment\n// (pick one):\n// shell-startup \u2014 when a new shell opens inside the project\n// cli-invocation \u2014 before each `infra-kit` command (primes SUBSEQUENT commands)\n// `config` names which environment to load. It is intentionally NOT validated\n// against `environments` here: an invalid name must DISABLE the feature at\n// resolve time (lib/env-autoload), never throw inside the merged-config parse and\n// brick every command.\nconst envAutoLoadSchema = z\n .object({\n trigger: z.enum(['shell-startup', 'cli-invocation']),\n config: z.string().min(1),\n })\n .strict()\n\n// Base object shape, kept separate so `.partial()` (which only works on a plain\n// ZodObject, not the `.superRefine`-wrapped full schema) can derive the override\n// schema from it.\nconst infraKitConfigObject = z.object({\n environments: z.array(z.string().min(1)).min(1),\n envManagement: envManagementSchema,\n ide: idesSchema.optional(),\n taskManager: taskManagerSchema.optional(),\n worktrees: worktreesConfigSchema.optional(),\n envAutoLoad: envAutoLoadSchema.optional(),\n dev: devConfigSchema.optional(),\n devPresets: devPresetsSchema.optional(),\n})\n\n// Full schema = base object + a parse-time uniqueness check on the `ide` array.\n// This runs inside the *merged* `safeParse` in getInfraKitConfig, so it's the\n// gate for the final config. (The override layers use the `.partial()` form\n// below, which drops this object-level refinement \u2014 acceptable, the merged\n// parse is authoritative.)\nexport const infraKitConfigSchema = infraKitConfigObject.superRefine((cfg, ctx) => {\n if (!Array.isArray(cfg.ide)) return\n\n const seen = new Set<string>()\n\n for (const entry of cfg.ide) {\n if (seen.has(entry.provider)) {\n ctx.addIssue({\n code: 'custom',\n message: 'each IDE provider may appear at most once',\n path: ['ide'],\n })\n\n return\n }\n\n seen.add(entry.provider)\n }\n})\n\nexport const infraKitOverrideConfigSchema = infraKitConfigObject.partial()\n\nexport type InfraKitConfig = z.infer<typeof infraKitConfigSchema>\n\n/** Resolved env auto-load config (`{ trigger, config }`), or `undefined` when off. */\nexport type EnvAutoLoadConfig = z.infer<typeof envAutoLoadSchema>\n\n/** Per-app dev-server overrides (`{ port?, prefixUrl? }`). */\nexport type DevAppConfig = z.infer<typeof devAppConfigSchema>\n\n/** The full `dev` section: a map of app folder name to its {@link DevAppConfig}. */\nexport type DevConfig = z.infer<typeof devConfigSchema>\n\n/** A proxy route's resolved source in a preset override (`'local' | 'cloud'`). */\nexport type ProxySource = z.infer<typeof proxySourceSchema>\n\n/** A single dev preset (`{ apps?, cmux? }`) from the `devPresets` map. */\nexport type DevPreset = z.infer<typeof devPresetSchema>\n\n/** The `devPresets` map: preset name \u2192 {@link DevPreset}. */\nexport type DevPresets = z.infer<typeof devPresetsSchema>\n\n/** A single resolved IDE entry (`{ provider, config }`). */\nexport type ConfiguredIde = z.infer<typeof ideSchema>\n\n/**\n * Normalize the `ide` config (single object, array, or unset) into a flat list.\n * Validation-free: assumes already-parsed input (uniqueness is enforced by the\n * schema). The one source of truth for \"which editors are configured.\"\n *\n * @example\n * resolveConfiguredIdes({ ide: { provider: 'cursor', config: {...} } }) // => [cursor]\n * resolveConfiguredIdes({ ide: [cursor, zed] }) // => [cursor, zed]\n * resolveConfiguredIdes({}) // => []\n */\nexport const resolveConfiguredIdes = (config: InfraKitConfig): ConfiguredIde[] => {\n const ide = config.ide\n\n if (!ide) return []\n\n return Array.isArray(ide) ? ide : [ide]\n}\n\n/** A cmux pane layout preset (see {@link cmuxLayouts}). */\nexport type CmuxLayout = (typeof cmuxLayouts)[number]\n\n/** The layout applied when `worktrees.cmux.layout` is left unset. */\nexport const DEFAULT_CMUX_LAYOUT: CmuxLayout = 'two-columns'\n\n/**\n * Resolve the cmux pane layout for opened worktree workspaces, falling back to\n * {@link DEFAULT_CMUX_LAYOUT} when unconfigured. The one source of truth for\n * \"which layout should the cmux opener build.\"\n *\n * @example\n * resolveCmuxLayout({ worktrees: { cmux: { layout: 'three-pane' } } }) // => 'three-pane'\n * resolveCmuxLayout({}) // => 'two-columns'\n */\nexport const resolveCmuxLayout = (config: InfraKitConfig): CmuxLayout => {\n return config.worktrees?.cmux?.layout ?? DEFAULT_CMUX_LAYOUT\n}\n\nexport interface InfraKitConfigPaths {\n /** Committed project config (required). */\n main: string\n /** User-scope global overrides applied to every project. */\n userGlobal: string\n /** User-scope per-project overrides \u2014 `<userProjectsDir>/<projectName>/infra-kit.json`. */\n userProject: string\n /** Repo basename (`path.basename(projectRoot)`) used to namespace the user-project file. */\n projectName: string\n}\n\ninterface CacheEntry {\n mtimes: Record<keyof Omit<InfraKitConfigPaths, 'projectName'>, number | null>\n value: InfraKitConfig\n}\n\nlet cached: CacheEntry | null = null\n\n/**\n * Resolve every file path that participates in the config merge chain. Always\n * returns paths even for files that don't yet exist, so callers can use them\n * for \"where would my override go?\" prompts.\n *\n * @example\n * const paths = await getInfraKitConfigPaths()\n * // {\n * // main: '/Users/arthur/projects/api/infra-kit.json',\n * // userGlobal: '/Users/arthur/.infra-kit/infra-kit.json',\n * // userProject: '/Users/arthur/.infra-kit/projects/api/infra-kit.json',\n * // projectName: 'api',\n * // }\n */\nexport const getInfraKitConfigPaths = async (): Promise<InfraKitConfigPaths> => {\n const projectRoot = await getProjectRoot()\n // Repo name is the project-root basename (same as getRepoName), derived here to\n // avoid a second `git rev-parse` \u2014 getRepoName would re-resolve the root.\n const projectName = path.basename(projectRoot)\n const userConfigDir = path.join(os.homedir(), USER_CONFIG_DIR_NAME)\n\n return {\n main: path.join(projectRoot, INFRA_KIT_CONFIG_FILE),\n userGlobal: path.join(userConfigDir, USER_GLOBAL_CONFIG_FILE),\n userProject: path.join(userConfigDir, USER_PROJECTS_DIR, projectName, INFRA_KIT_CONFIG_FILE),\n projectName,\n }\n}\n\n/**\n * Read and validate `infra-kit.json`, with optional override layers shallow-merged\n * on top in this order (later wins):\n * 1. project `infra-kit.json` \u2014 committed source of truth\n * 2. `~/.infra-kit/infra-kit.json` \u2014 user-global defaults\n * 3. `~/.infra-kit/projects/<repo-name>/infra-kit.json` \u2014 user-scope per-project overrides\n *\n * Top-level keys (entire capability sections like `ide`, `envManagement`)\n * replace wholesale. Results are cached per file mtimes so the long-running\n * MCP server picks up edits without a restart.\n *\n * @example\n * // infra-kit.json: { \"environments\": [\"dev\"], \"envManagement\": { \"provider\": \"doppler\", \"config\": { \"name\": \"p\" } } }\n * // ~/.infra-kit/infra-kit.json: { \"ide\": { \"provider\": \"cursor\", \"config\": { \"workspaceConfigPath\": \"./ws.code-workspace\" } } }\n * const cfg = await getInfraKitConfig()\n * // => { environments: ['dev'], envManagement: {...}, ide: { provider: 'cursor', config: { workspaceConfigPath: './ws.code-workspace' } } }\n */\nexport const getInfraKitConfig = async (): Promise<InfraKitConfig> => {\n const paths = await getInfraKitConfigPaths()\n\n let mainStat: Awaited<ReturnType<typeof fs.stat>>\n\n try {\n mainStat = await fs.stat(paths.main)\n } catch {\n cached = null\n\n // Bridge the YAML\u2192JSON cutover: if a legacy infra-kit.yml is sitting where\n // the JSON config should be, point the user at the one-shot migration.\n const legacyYmlPath = paths.main.replace(/\\.json$/, '.yml')\n\n if (await statIfExists(legacyYmlPath)) {\n throw new Error(\n `infra-kit.json not found at ${paths.main}. A legacy infra-kit.yml exists \u2014 run \\`infra-kit init\\` to convert it.`,\n )\n }\n\n throw new Error(`infra-kit.json not found at ${paths.main}`)\n }\n\n const [userGlobalStat, userProjectStat] = await Promise.all([\n statIfExists(paths.userGlobal),\n statIfExists(paths.userProject),\n ])\n\n const mtimes = {\n main: Number(mainStat.mtimeMs),\n userGlobal: userGlobalStat ? Number(userGlobalStat.mtimeMs) : null,\n userProject: userProjectStat ? Number(userProjectStat.mtimeMs) : null,\n }\n\n if (cached && shallowEqual(cached.mtimes, mtimes)) {\n return cached.value\n }\n\n const layers: ConfigLayer[] = [\n { label: 'infra-kit.json', path: paths.main, required: true },\n { label: '~/.infra-kit/infra-kit.json', path: paths.userGlobal, required: false },\n {\n label: `~/.infra-kit/projects/${paths.projectName}/infra-kit.json`,\n path: paths.userProject,\n required: false,\n },\n ]\n\n let merged: Record<string, unknown> = {}\n\n for (const layer of layers) {\n const data = await loadLayer(layer)\n\n if (data === null) continue\n\n merged = { ...merged, ...data }\n }\n\n const finalResult = infraKitConfigSchema.safeParse(merged)\n\n if (!finalResult.success) {\n throw new Error(`Invalid merged infra-kit config: ${z.prettifyError(finalResult.error)}`)\n }\n\n cached = { mtimes, value: finalResult.data }\n\n return finalResult.data\n}\n\n/**\n * For tests \u2014 drops the in-memory cache so the next read hits disk.\n *\n * @example\n * resetInfraKitConfigCache()\n * await getInfraKitConfig() // re-reads files even if mtimes look unchanged\n */\nexport const resetInfraKitConfigCache = (): void => {\n cached = null\n}\n\n/**\n * `fs.stat` that returns `null` instead of throwing on ENOENT. Used so the\n * resolver can probe optional files in the merge chain without try/catch noise.\n *\n * @example\n * const stat = await statIfExists('/does/not/exist') // => null\n */\nconst statIfExists = async (filePath: string): Promise<Awaited<ReturnType<typeof fs.stat>> | null> => {\n try {\n return await fs.stat(filePath)\n } catch {\n return null\n }\n}\n\n/**\n * `fs.readFile` that returns `null` instead of throwing on ENOENT.\n *\n * @example\n * const raw = await readIfExists('/missing.json') // => null\n * const raw = await readIfExists('/exists.json') // => '{ \"environments\": [\"dev\"] }\\n'\n */\nconst readIfExists = async (filePath: string): Promise<string | null> => {\n try {\n return await fs.readFile(filePath, 'utf-8')\n } catch {\n return null\n }\n}\n\n/**\n * Reference-equality comparison of every key in two flat records. Used to\n * cheaply detect whether the cached mtime fingerprint still matches.\n *\n * @example\n * shallowEqual({ a: 1, b: 2 }, { a: 1, b: 2 }) // => true\n * shallowEqual({ a: 1 }, { a: 1, b: 2 }) // => false\n * shallowEqual({ a: 1 }, { a: 2 }) // => false\n */\nconst shallowEqual = <T extends Record<string, unknown>>(a: T, b: T): boolean => {\n const keys = Object.keys(a)\n\n if (keys.length !== Object.keys(b).length) return false\n\n return keys.every((k) => {\n return a[k] === b[k]\n })\n}\n\ninterface ConfigLayer {\n label: string\n path: string\n required: boolean\n}\n\n/**\n * Read a single layer of the merge chain: parse the JSON if the file exists\n * and validate it against the override schema. Returns `null` if an optional\n * layer is missing; throws if the layer is required, malformed, or invalid.\n * An empty/whitespace-only file is treated as `{}` (JSON.parse would throw).\n *\n * @example\n * await loadLayer({ label: '~/.infra-kit/infra-kit.json', path: '/missing.json', required: false })\n * // => null\n *\n * @example\n * // /home/me/.infra-kit/infra-kit.json: '{ \"ide\": { \"provider\": \"cursor\", \"config\": { \"workspaceConfigPath\": \"./ws.code-workspace\" } } }'\n * await loadLayer({ label: '~/.infra-kit/infra-kit.json', path: '/home/me/.infra-kit/infra-kit.json', required: false })\n * // => { ide: { provider: 'cursor', config: { workspaceConfigPath: './ws.code-workspace' } } }\n */\nconst loadLayer = async (layer: ConfigLayer): Promise<Record<string, unknown> | null> => {\n const raw = await readIfExists(layer.path)\n\n if (raw === null) {\n if (layer.required) {\n throw new Error(`${layer.label} not found at ${layer.path}`)\n }\n\n return null\n }\n\n let parsedRaw: unknown\n\n try {\n parsedRaw = raw.trim() === '' ? {} : JSON.parse(raw)\n } catch (err) {\n throw new Error(`Invalid JSON in ${layer.label} at ${layer.path}: ${(err as Error).message}`)\n }\n\n const result = infraKitOverrideConfigSchema.safeParse(parsedRaw)\n\n if (!result.success) {\n throw new Error(`Invalid ${layer.label} at ${layer.path}: ${z.prettifyError(result.error)}`)\n }\n\n return result.data as Record<string, unknown>\n}\n", "import path from 'node:path'\nimport { $ } from 'zx'\n\nimport { isReleaseBranch } from 'src/lib/release-id'\n\n/**\n * Get current git worktrees\n *\n * @returns [release/v1.18.22, release/v1.18.23, release/v1.18.24] or [feature/mobile-app, feature/explore-page, feature/login-page]\n */\nexport const getCurrentWorktrees = async (type: 'release' | 'feature'): Promise<string[]> => {\n const worktreesOutput = await $`git worktree list`\n\n const worktreeLines = worktreesOutput.stdout.split('\\n').filter(Boolean)\n\n const worktreePredicateMap = {\n release: releaseWorktreePredicate,\n feature: featureWorktreePredicate,\n }\n\n return worktreeLines.map(worktreePredicateMap[type]).filter((branch) => {\n return branch !== null\n })\n}\n\n/**\n * Extract the branch name from a `git worktree list` output line.\n *\n * `git worktree list` formats each line as:\n * <path> <hash> [<branch>]\n *\n * Reads the branch from the trailing `[branch]` token so it works for the\n * main checkout too (whose path does not encode the branch name).\n */\nconst parseWorktreeBranch = (line: string): string | null => {\n const trimmed = line.trimEnd()\n\n if (!trimmed.endsWith(']')) return null\n\n const open = trimmed.lastIndexOf('[')\n\n if (open === -1) return null\n\n const branch = trimmed.slice(open + 1, -1)\n\n return branch.length > 0 ? branch : null\n}\n\n/**\n * Extract a release branch name from a `git worktree list` output line.\n *\n * Returns `null` for lines that are not release worktrees.\n *\n * @example\n * releaseWorktreePredicate('/path/to/release/v1.18.22 abc1234 [release/v1.18.22]')\n * // => 'release/v1.18.22'\n *\n * @example\n * releaseWorktreePredicate('/path/to/feature/login abc1234 [feature/login]')\n * // => null\n */\nconst releaseWorktreePredicate = (line: string): string | null => {\n const branch = parseWorktreeBranch(line)\n\n return isReleaseBranch(branch) ? branch : null\n}\n\n/**\n * Extract a feature branch name from a `git worktree list` output line.\n *\n * Returns `null` for lines that are not feature worktrees.\n *\n * @example\n * featureWorktreePredicate('/path/to/feature/login-page abc1234 [feature/login-page]')\n * // => 'feature/login-page'\n *\n * @example\n * featureWorktreePredicate('/path/to/release/v1.18.22 abc1234 [release/v1.18.22]')\n * // => null\n */\nconst featureWorktreePredicate = (line: string): string | null => {\n const branch = parseWorktreeBranch(line)\n\n return branch?.startsWith('feature/') ? branch : null\n}\n\n/**\n * Get the current project root directory\n */\nexport const getProjectRoot = async (): Promise<string> => {\n const result = await $`git rev-parse --show-toplevel`\n\n return result.stdout.trim()\n}\n\n/**\n * Get the current git branch name (e.g. `dev`, `main`, `release/v1.2.3`).\n */\nexport const getCurrentBranch = async (): Promise<string> => {\n const result = await $`git rev-parse --abbrev-ref HEAD`\n\n return result.stdout.trim()\n}\n\n/**\n * Whether the working tree has no staged, unstaged, or untracked changes.\n */\nexport const isWorkingTreeClean = async (): Promise<boolean> => {\n const result = await $`git status --porcelain`\n\n return result.stdout.trim().length === 0\n}\n\n/**\n * Whether the current checkout is a linked git worktree rather than the main\n * repository checkout.\n *\n * A linked worktree's git dir lives under `<main>/.git/worktrees/<name>`, so it\n * differs from the shared common dir; in the main checkout the two resolve to\n * the same path. Both are anchored to the toplevel so `--git-common-dir` (which\n * git may report relative to cwd) resolves consistently.\n */\nexport const isInsideLinkedWorktree = async (): Promise<boolean> => {\n const cwd = await getProjectRoot()\n\n const [gitDirResult, commonDirResult] = await Promise.all([\n $({ cwd })`git rev-parse --absolute-git-dir`,\n $({ cwd })`git rev-parse --git-common-dir`,\n ])\n\n const gitDir = gitDirResult.stdout.trim()\n const commonDir = path.resolve(cwd, commonDirResult.stdout.trim())\n\n return gitDir !== commonDir\n}\n\n/**\n * Get the current repository name (basename of the project root)\n */\nexport const getRepoName = async (): Promise<string> => {\n const projectRoot = await getProjectRoot()\n\n return path.basename(projectRoot)\n}\n\n/**\n * Delete a local branch if it exists and is not the current checkout.\n *\n * Idempotent: a no-op when the branch is absent (`git branch --list` prints\n * nothing). Uses force `-D` because a delivered release branch was\n * squash-merged \u2014 its tip is unreachable from the base, so `-d` would refuse\n * with \"not fully merged\". The delete itself still rejects if the branch is\n * checked out in another worktree; callers decide how to handle that.\n */\nexport const deleteLocalBranch = async (branch: string): Promise<void> => {\n const listed = await $`git branch --list ${branch}`\n\n if (listed.stdout.trim().length === 0) return\n\n if ((await getCurrentBranch()) === branch) return\n\n await $`git branch -D ${branch}`\n}\n\n/**\n * Delete a branch on the `origin` remote if it exists.\n *\n * Idempotent: a no-op when the branch is absent on the remote. Existence is\n * probed with `git ls-remote --heads` (empty stdout = absent) rather than\n * `--exit-code`, so a genuine network/auth failure rejects and propagates to\n * the caller instead of being silently misread as \"branch absent\".\n */\nexport const deleteRemoteBranch = async (branch: string): Promise<void> => {\n const refs = await $`git ls-remote --heads origin ${branch}`\n\n if (refs.stdout.trim().length === 0) return\n\n await $`git push origin --delete ${branch}`\n}\n", "/**\n * A release identity is either a semantic version or a free-form kebab-case\n * name. `raw` is the canonical token for the id: the no-`v` semver string for\n * versions (e.g. `1.2.3`) and the name itself for named releases.\n */\nexport type ReleaseId =\n | { kind: 'version'; semver: { major: number; minor: number; patch: number }; raw: string }\n | { kind: 'name'; name: string; raw: string }\n\n/** Matches a bare or `v`-prefixed semver token, e.g. `1.2.3` or `v1.2.3`. */\nconst VERSION_RE = /^v?(\\d+)\\.(\\d+)\\.(\\d+)$/\n\n/** Matches the semver core after the `v` in a `release/v\u2026` branch. */\nconst BRANCH_SEMVER_RE = /^(\\d+)\\.(\\d+)\\.(\\d+)$/\n\n/** Kebab-case: lowercase alphanumeric segments joined by single hyphens. */\nconst KEBAB_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/\n\nconst RELEASE_BRANCH_PREFIX = 'release/'\nconst VERSION_BRANCH_PREFIX = 'release/v'\nconst REFS_HEADS_PREFIX = 'refs/heads/'\n\nconst NEXT_TOKEN = 'next'\nconst MAX_NAME_LENGTH = 50\n\n/**\n * Names that would collide with branch/release semantics or read as a special\n * token. Banned regardless of kebab-case validity.\n */\nconst RESERVED_NAMES: ReadonlySet<string> = new Set(['dev', 'main', 'next', 'hotfix', 'regular', 'release'])\n\n/** Thrown by {@link validateName} when a release name is not acceptable. */\nexport class InvalidReleaseNameError extends Error {\n constructor(message: string) {\n super(message)\n this.name = 'InvalidReleaseNameError'\n }\n}\n\n/** Thrown by {@link parseReleaseRef} when a release ref cannot be parsed. */\nexport class InvalidReleaseRefError extends Error {\n constructor(message: string) {\n super(message)\n this.name = 'InvalidReleaseRefError'\n }\n}\n\nconst stripRefsHeads = (input: string): string => {\n return input.startsWith(REFS_HEADS_PREFIX) ? input.slice(REFS_HEADS_PREFIX.length) : input\n}\n\nconst makeVersion = (major: number, minor: number, patch: number): ReleaseId => {\n return {\n kind: 'version',\n semver: { major, minor, patch },\n raw: `${major}.${minor}.${patch}`,\n }\n}\n\n/**\n * Validate a release name. Throws {@link InvalidReleaseNameError} with a\n * specific message unless the name is kebab-case, at most 50 characters, and\n * not a reserved word. Semver-looking tokens (e.g. `1.2.3`) are already\n * excluded by the kebab-case rule since they contain dots.\n */\nexport const validateName = (name: string): void => {\n if (name.length === 0) {\n throw new InvalidReleaseNameError('Release name is empty. Provide a kebab-case name like \"checkout-redesign\".')\n }\n\n if (name.length > MAX_NAME_LENGTH) {\n throw new InvalidReleaseNameError(\n `Release name \"${name}\" is ${name.length} characters; the maximum is ${MAX_NAME_LENGTH}.`,\n )\n }\n\n if (!KEBAB_RE.test(name)) {\n throw new InvalidReleaseNameError(\n `Release name \"${name}\" is not kebab-case. Use lowercase letters, digits, and single hyphens, e.g. \"checkout-redesign\".`,\n )\n }\n\n if (RESERVED_NAMES.has(name)) {\n throw new InvalidReleaseNameError(\n `Release name \"${name}\" is reserved. Reserved names: ${[...RESERVED_NAMES].join(', ')}.`,\n )\n }\n}\n\n/**\n * Lenient parse of a git branch name into a {@link ReleaseId}. Tolerates a\n * leading `refs/heads/`. Returns `null` for anything that is not a valid\n * `release/v<semver>` or `release/<name>` branch. Never throws.\n *\n * Precedence is version-first: `release/v<semver>` is a version, but if the\n * segment after `release/v` is not a valid semver (e.g. `release/vnext`), the\n * whole token after `release/` is treated as a candidate name instead.\n */\nexport const parseBranchName = (branch: string): ReleaseId | null => {\n const stripped = stripRefsHeads(branch.trim())\n\n if (!stripped.startsWith(RELEASE_BRANCH_PREFIX)) return null\n\n if (stripped.startsWith(VERSION_BRANCH_PREFIX)) {\n const semverPart = stripped.slice(VERSION_BRANCH_PREFIX.length)\n const match = BRANCH_SEMVER_RE.exec(semverPart)\n\n if (match) {\n return makeVersion(Number(match[1]), Number(match[2]), Number(match[3]))\n }\n }\n\n const namePart = stripped.slice(RELEASE_BRANCH_PREFIX.length)\n\n try {\n validateName(namePart)\n } catch {\n return null\n }\n\n return { kind: 'name', name: namePart, raw: namePart }\n}\n\n/**\n * Strict parse of a release ref into a {@link ReleaseId}. Throws\n * {@link InvalidReleaseRefError} on invalid input. Precedence (order matters):\n * 1. `release/\u2026` (or `refs/heads/release/\u2026`) \u2192 delegate to parseBranchName.\n * 2. semver token (`1.2.3` / `v1.2.3`) \u2192 version.\n * 3. `next` \u2192 throws; callers must resolve `next` to a concrete version\n * via computeNextVersion before calling this.\n * 4. otherwise \u2192 validateName, returning a named release.\n */\nexport const parseReleaseRef = (input: string): ReleaseId => {\n const trimmed = input.trim()\n const branchCandidate = stripRefsHeads(trimmed)\n\n if (branchCandidate.startsWith(RELEASE_BRANCH_PREFIX)) {\n const parsed = parseBranchName(trimmed)\n\n if (!parsed) {\n throw new InvalidReleaseRefError(\n `\"${input}\" looks like a release branch but is not a valid release/v<semver> or release/<name> ref.`,\n )\n }\n\n return parsed\n }\n\n const versionMatch = VERSION_RE.exec(trimmed)\n\n if (versionMatch) {\n return makeVersion(Number(versionMatch[1]), Number(versionMatch[2]), Number(versionMatch[3]))\n }\n\n if (trimmed.toLowerCase() === NEXT_TOKEN) {\n throw new InvalidReleaseRefError(\n 'The \"next\" token must be resolved to a concrete version (via computeNextVersion) before parsing a release ref.',\n )\n }\n\n try {\n validateName(trimmed)\n } catch (err) {\n const reason = err instanceof Error ? err.message : String(err)\n\n throw new InvalidReleaseRefError(`Cannot parse \"${input}\" as a release ref: ${reason}`)\n }\n\n return { kind: 'name', name: trimmed, raw: trimmed }\n}\n\n/** Render the branch name for a release id: `release/v1.2.3` | `release/<name>`. */\nexport const formatBranchName = (id: ReleaseId): string => {\n if (id.kind === 'version') return `${VERSION_BRANCH_PREFIX}${id.raw}`\n\n return `${RELEASE_BRANCH_PREFIX}${id.name}`\n}\n\n/**\n * Render a PR title: `Release v1.2.3` / `Hotfix v1.2.3` for versions,\n * `Release <name>` / `Hotfix <name>` for names.\n */\nexport const formatPrTitle = (id: ReleaseId, type: 'regular' | 'hotfix'): string => {\n const prefix = type === 'hotfix' ? 'Hotfix' : 'Release'\n\n if (id.kind === 'version') return `${prefix} v${id.raw}`\n\n return `${prefix} ${id.name}`\n}\n\n/** Render a release-candidate PR title: `Release v1.2.3 (RC)` | `Release <name> (RC)`. */\nexport const formatRcTitle = (id: ReleaseId): string => {\n if (id.kind === 'version') return `Release v${id.raw} (RC)`\n\n return `Release ${id.name} (RC)`\n}\n\n/** Render the Jira fix-version name: `v1.2.3` | `<name>`. */\nexport const formatJiraName = (id: ReleaseId): string => {\n if (id.kind === 'version') return `v${id.raw}`\n\n return id.name\n}\n\n/** Render a short human display label: `1.2.3` | `<name>`. */\nexport const displayLabel = (id: ReleaseId): string => {\n return id.raw\n}\n\n/** True iff `branch` is a valid release branch under either scheme. */\nexport const isReleaseBranch = (branch: string | null | undefined): boolean => {\n if (branch === null || branch === undefined) return false\n\n return parseBranchName(branch) !== null\n}\n\nconst toTime = (value: string | Date | undefined): number | null => {\n if (value === undefined) return null\n\n const time = value instanceof Date ? value.getTime() : new Date(value).getTime()\n\n return Number.isNaN(time) ? null : time\n}\n\n/**\n * Comparator for {@link ReleaseId} values (locked ordering):\n * - All versions sort before all names.\n * - Versions: semver ascending (major, then minor, then patch; numeric).\n * - Names: by date ascending when both dates are provided, otherwise\n * lexicographic by name. The result is stable and deterministic.\n */\nexport const compareReleaseIds = (\n a: ReleaseId,\n b: ReleaseId,\n dates?: { a?: string | Date; b?: string | Date },\n): number => {\n if (a.kind === 'version' && b.kind === 'version') {\n if (a.semver.major !== b.semver.major) return a.semver.major - b.semver.major\n if (a.semver.minor !== b.semver.minor) return a.semver.minor - b.semver.minor\n\n return a.semver.patch - b.semver.patch\n }\n\n if (a.kind === 'version') return -1\n if (b.kind === 'version') return 1\n\n const timeA = toTime(dates?.a)\n const timeB = toTime(dates?.b)\n\n if (timeA !== null && timeB !== null && timeA !== timeB) {\n return timeA - timeB\n }\n\n if (a.name < b.name) return -1\n if (a.name > b.name) return 1\n\n return 0\n}\n", "import { displayLabel, parseBranchName } from 'src/lib/release-id'\n\ninterface BuildCmuxWorkspaceTitleArgs {\n repoName: string\n branch: string\n}\n\n/**\n * Builds the cmux workspace title used by `worktrees-add` and looked up by\n * `worktrees-remove`. Release branches are rendered via their release-id\n * display label so the title reads e.g. `\"hulyo-monorepo 1.48.0\"` for\n * `\"release/v1.48.0\"` and `\"hulyo-monorepo checkout-redesign\"` for\n * `\"release/checkout-redesign\"`. Non-release branches (cmux titles them too)\n * fall back to the raw branch string.\n */\nexport const buildCmuxWorkspaceTitle = (args: BuildCmuxWorkspaceTitleArgs): string => {\n const { repoName, branch } = args\n\n const id = parseBranchName(branch)\n const label = id ? displayLabel(id) : branch\n\n return `${repoName} ${label}`\n}\n", "/**\n * Pure resolution of a named dev preset into a concrete run plan.\n *\n * A preset (declared under `devPresets` in the per-project infra-kit.json) names\n * launch targets (`client`, `client/api`, `client/ui`, or a `*` glob), optional\n * per-target `watchDeps` (api + ui), per-route proxy-source overrides, and a `cmux` layout\n * flag. This module turns that declarative shape into a flat {@link ResolvedPreset}\n * the runner consumes. Side-effect free: the discovered app parts are passed in\n * (never read from disk here), so resolution is fully unit-testable.\n */\nimport type { DevPreset, DevPresets, ProxySource } from 'src/lib/infra-kit-config'\n\n/** The two launchable halves of an `apps/<app>` folder. */\nexport type AppPart = 'api' | 'ui'\n\n/** One concrete thing to launch: a single part of a single app. */\nexport interface ResolvedTarget {\n /** App folder name (e.g. `client`). */\n app: string\n /** Which half of the app to launch. */\n part: AppPart\n /**\n * Participate in dependency-closure watching (uniform for api + ui): react to a change in\n * this target's own workspace-dependency closure. Default `true` (opt-in participation).\n * Resolution is specificity-ordered: an explicit value on a more-specific key (a concrete\n * app, or an explicit `/part`) wins over a `*` glob; at equal specificity an explicit\n * `false` wins over `true` (order-independent opt-out). See {@link resolveWatch}.\n */\n watchDeps: boolean\n}\n\n/** Which apps have an `api` / `ui` part on disk \u2014 the resolver's view of discovery. */\nexport interface DiscoveredParts {\n /** App names that have `apps/<app>/api`. */\n api: string[]\n /** App names that have `apps/<app>/ui`. */\n ui: string[]\n}\n\n/** A fully-resolved preset: the flat run plan derived from its declarative shape. */\nexport interface ResolvedPreset {\n /** Every (app, part) to launch, de-duplicated. */\n targets: ResolvedTarget[]\n /** Run each target in its own cmux pane. */\n cmux: boolean\n /** app \u2192 (route path \u2192 source) overrides, threaded to the proxy resolver. */\n proxy: Record<string, Record<string, ProxySource>>\n /** Apps whose `api` part is launched \u2014 their backends are local (derived). */\n localApps: string[]\n /** Explicitly-named `<app>/<part>` targets that matched no discovered app/part (for a warning). */\n unmatched: string[]\n}\n\n/** The two parts, in stable order, used when a bare `<app>` key means \"both halves\". */\nconst ALL_PARTS: readonly AppPart[] = ['api', 'ui']\n\ninterface ParsedKey {\n /** App name or `*` (all discovered apps). */\n appGlob: string\n /** Parts the key selects (both when no `/part` suffix is given). */\n parts: readonly AppPart[]\n /** True when the key named a specific part (`client/api`) \u2014 drives the unmatched warning. */\n explicit: boolean\n}\n\n/**\n * Parse a preset target key into an app glob + selected parts.\n *\n * @example\n * parseTargetKey('client') // => { appGlob: 'client', parts: ['api','ui'], explicit: false }\n * parseTargetKey('client/api') // => { appGlob: 'client', parts: ['api'], explicit: true }\n * parseTargetKey('*') // => { appGlob: '*', parts: ['api','ui'], explicit: false }\n */\nexport const parseTargetKey = (key: string): ParsedKey => {\n const segments = key.split('/')\n const [appGlob, part] = segments\n\n if (segments.length > 2 || !appGlob) {\n throw new Error(`devPresets: invalid target \"${key}\" (expected \"<app>\" or \"<app>/api|ui\")`)\n }\n\n if (part === undefined) {\n return { appGlob, parts: ALL_PARTS, explicit: false }\n }\n\n if (part === 'api' || part === 'ui') {\n return { appGlob, parts: [part], explicit: true }\n }\n\n throw new Error(`devPresets: invalid target part \"${part}\" in \"${key}\" (expected \"api\" or \"ui\")`)\n}\n\n/** App names that have `part` on disk, per the discovery result. */\nconst appsWithPart = (discovered: DiscoveredParts, part: AppPart): string[] => {\n return part === 'api' ? discovered.api : discovered.ui\n}\n\n/** Every discovered app name (union of api + ui halves), sorted for deterministic output. */\nconst allApps = (discovered: DiscoveredParts): string[] => {\n return [...new Set([...discovered.api, ...discovered.ui])].sort()\n}\n\n/** Stable `app/part` identity key for de-duplicating targets across preset keys. */\nconst targetId = (app: string, part: AppPart): string => {\n return `${app}/${part}`\n}\n\n/** A resolved target plus the provenance the merge needs to order later keys by specificity. */\ninterface ResolvedTargetInternal extends ResolvedTarget {\n /** Specificity rank of the key that set `watchDeps` (see {@link keyRank}) \u2014 a higher rank wins. */\n rank: number\n /** Whether `watchDeps` came from an explicit preset value (vs the participate-default). */\n explicitValue: boolean\n}\n\ninterface ResolveState {\n targets: Map<string, ResolvedTargetInternal>\n proxy: Record<string, Record<string, ProxySource>>\n unmatched: string[]\n}\n\n/**\n * Specificity rank of a preset key, higher = more specific. A concrete app beats a `*` glob\n * (the dominant axis, +2), and within either an explicit `<app>/api` part beats a bare `<app>`\n * (+1). So a bare glob is 0, a glob with an explicit part is 1, a bare concrete app is 2, and a\n * concrete app with an explicit part is 3.\n */\nconst keyRank = (isGlob: boolean, explicit: boolean): number => {\n return (isGlob ? 0 : 2) + (explicit ? 1 : 0)\n}\n\n/**\n * Merge a preset key's `watchDeps` into any prior resolution for the same target. A key that\n * omits `watchDeps` never clobbers a prior explicit value (and, absent any explicit value,\n * seeds the participate-default `true`). A strictly more-specific key ({@link keyRank}) wins in\n * either direction, so a `*` glob cannot override a concrete `client/api` and vice-versa. At\n * equal specificity an explicit `false` wins over `true`, making the result order-independent.\n */\nconst resolveWatch = (\n prior: ResolvedTargetInternal | undefined,\n next: { watchDeps: boolean | undefined; rank: number },\n): { watchDeps: boolean; rank: number; explicitValue: boolean } => {\n // This key configured nothing \u2192 keep the prior resolution, or seed the participate-default.\n if (next.watchDeps === undefined) {\n return prior ?? { watchDeps: true, rank: next.rank, explicitValue: false }\n }\n\n // No prior explicit value (fresh, or only a default) \u2192 this explicit value takes it.\n if (!prior || !prior.explicitValue) {\n return { watchDeps: next.watchDeps, rank: next.rank, explicitValue: true }\n }\n\n // A strictly more-specific key wins over a less-specific one, in either direction.\n if (next.rank > prior.rank) return { watchDeps: next.watchDeps, rank: next.rank, explicitValue: true }\n if (next.rank < prior.rank) return prior\n\n // Equal specificity: false wins (AND), so the outcome is independent of key order. Defensive \u2014\n // with today's key grammar each target id is reachable by one key per rank, so two explicit keys\n // can't tie; this keeps resolution deterministic if the grammar ever grows same-rank forms.\n return { watchDeps: prior.watchDeps && next.watchDeps, rank: prior.rank, explicitValue: true }\n}\n\n/**\n * Fold one (app, part) into the accumulator: record a target when the part exists,\n * merge `watchDeps` with any prior target of the same identity by specificity\n * ({@link resolveWatch}), and flag an explicitly-named-but-missing part as unmatched\n * (glob-expanded misses are silent).\n */\nconst addTarget = (\n state: ResolveState,\n discovered: DiscoveredParts,\n spec: { app: string; part: AppPart; watchDeps: boolean | undefined; isGlob: boolean; explicit: boolean },\n): void => {\n const { app, part, watchDeps, isGlob, explicit } = spec\n\n if (!appsWithPart(discovered, part).includes(app)) {\n // A bare `<app>` (both parts) silently skips the missing half; only an explicit,\n // non-glob `<app>/<part>` that can't be found is a mistake worth surfacing.\n if (explicit && !isGlob) {\n state.unmatched.push(targetId(app, part))\n }\n\n return\n }\n\n const id = targetId(app, part)\n const merged = resolveWatch(state.targets.get(id), { watchDeps, rank: keyRank(isGlob, explicit) })\n\n state.targets.set(id, { app, part, ...merged })\n}\n\n/**\n * Resolve a preset against the discovered app parts. Expands globs (`*`) and bare\n * `<app>` keys (both halves), de-duplicates targets, derives the local-backend set\n * from the launched `api` targets, and collects per-app proxy overrides. Unknown\n * app/route names are tolerated (an explicit missing target lands in `unmatched`,\n * not an exception) so a stale preset degrades gracefully.\n *\n * @example\n * resolvePreset(\n * { apps: { 'client/ui': {}, 'client/api': { watchDeps: false } } },\n * { api: ['client'], ui: ['client'] },\n * )\n * // => {\n * // targets: [{ app: 'client', part: 'ui', watchDeps: true }, // default participate\n * // { app: 'client', part: 'api', watchDeps: false }], // explicit opt-out\n * // cmux: false, proxy: {}, localApps: ['client'], unmatched: [],\n * // }\n */\nexport const resolvePreset = (preset: DevPreset, discovered: DiscoveredParts): ResolvedPreset => {\n const entries = Object.entries(preset.apps ?? { '*': {} })\n const state: ResolveState = { targets: new Map(), proxy: {}, unmatched: [] }\n\n for (const [key, cfg] of entries) {\n const { appGlob, parts, explicit } = parseTargetKey(key)\n const isGlob = appGlob === '*'\n const apps = isGlob ? allApps(discovered) : [appGlob]\n\n for (const app of apps) {\n for (const part of parts) {\n addTarget(state, discovered, { app, part, watchDeps: cfg.watchDeps, isGlob, explicit })\n }\n\n if (cfg.proxy) {\n state.proxy[app] = { ...(state.proxy[app] ?? {}), ...cfg.proxy }\n }\n }\n }\n\n const targets: ResolvedTarget[] = [...state.targets.values()].map(({ app, part, watchDeps }) => {\n return { app, part, watchDeps }\n })\n const localApps = [\n ...new Set(\n targets\n .filter((t) => {\n return t.part === 'api'\n })\n .map((t) => {\n return t.app\n }),\n ),\n ]\n\n return { targets, cmux: preset.cmux ?? false, proxy: state.proxy, localApps, unmatched: state.unmatched }\n}\n\n/** A devPresets proxy-locality violation surfaced by the audit. */\nexport interface PresetProxyIssue {\n /** Preset name the violation is in. */\n preset: string\n /** Frontend app folder the override is under (e.g. `client`). */\n app: string\n /** Route path forced to a source (e.g. `/api`). */\n route: string\n /** Backend pkg the route maps to; undefined when the route is not declared in the frontend config. */\n pkg?: string\n /** `unknown-route` = route absent from the frontend config; `backend-not-launched` = local target not launched. */\n kind: 'unknown-route' | 'backend-not-launched'\n /** Human-readable, actionable explanation. */\n message: string\n}\n\n/**\n * Cross-file lookups the proxy validator needs, kept injectable so the rule stays\n * filesystem-free (and unit-testable). The impure side (audit) builds these from\n * discovery + each frontend's loaded `infra-kit.config.ts`.\n */\nexport interface PresetProxyContext {\n /** Discovered app parts, for resolving each preset's launch set. */\n discovered: DiscoveredParts\n /** App folder name \u2192 its `apps/<app>/api` package name. */\n apiPkgByApp: Record<string, string>\n /** (frontend app folder, route path) \u2192 backend pkg from that frontend's config; undefined when the route is absent. */\n routePkg: (app: string, route: string) => string | undefined\n}\n\ninterface CheckLocalRouteArgs {\n preset: string\n app: string\n route: string\n launchedPkgs: ReadonlySet<string>\n ctx: PresetProxyContext\n}\n\n/** App folder whose `api` package is `pkg` (for the remediation hint), or undefined. */\nconst ownerApp = (apiPkgByApp: Record<string, string>, pkg: string): string | undefined => {\n return Object.keys(apiPkgByApp).find((app) => {\n return apiPkgByApp[app] === pkg\n })\n}\n\n/**\n * Validate one `route \u2192 'local'` override: the route must be declared in the\n * frontend config, and the backend pkg it maps to must be in the preset's launched\n * set. Returns the issue, or null when the override is satisfiable.\n */\nconst checkLocalRoute = ({ preset, app, route, launchedPkgs, ctx }: CheckLocalRouteArgs): PresetProxyIssue | null => {\n const pkg = ctx.routePkg(app, route)\n\n if (pkg === undefined) {\n return {\n preset,\n app,\n route,\n kind: 'unknown-route',\n message: `preset \"${preset}\": proxy override \"${route}\" on \"${app}\" names a route not declared in ${app}'s infra-kit.config.ts dev.proxy.routes`,\n }\n }\n\n if (launchedPkgs.has(pkg)) {\n return null\n }\n\n const owner = ownerApp(ctx.apiPkgByApp, pkg)\n const hint = owner ? `add \"${owner}/api\" to the preset` : `launch the api whose package is \"${pkg}\"`\n\n return {\n preset,\n app,\n route,\n pkg,\n kind: 'backend-not-launched',\n message: `preset \"${preset}\": proxy override \"${route}\" \u2192 \"local\" requires backend \"${pkg}\" to run locally, but the preset does not launch it \u2014 ${hint}, or set \"${route}\" to \"cloud\"`,\n }\n}\n\n/**\n * Audit every preset's per-route proxy overrides: a route pinned to `local` is only\n * valid when the backend package it resolves to (per the frontend's\n * `infra-kit.config.ts`) is actually launched by that same preset. Catches the\n * `{ \"client/ui\": { \"proxy\": { \"/api\": \"local\" } } }` case where no local backend\n * is running to serve `/api`. `cloud` overrides are always satisfiable and skipped.\n *\n * @example\n * validatePresetProxy(\n * { 'client-remote': { apps: { 'client/ui': { proxy: { '/api': 'local' } } } } },\n * { discovered: { api: ['client'], ui: ['client'] }, apiPkgByApp: { client: 'backend-api' },\n * routePkg: () => 'backend-api' },\n * )\n * // => [{ preset: 'client-remote', app: 'client', route: '/api', pkg: 'backend-api',\n * // kind: 'backend-not-launched', message: '\u2026' }]\n */\nexport const validatePresetProxy = (presets: DevPresets, ctx: PresetProxyContext): PresetProxyIssue[] => {\n const issues: PresetProxyIssue[] = []\n\n for (const [preset, def] of Object.entries(presets)) {\n const resolved = resolvePreset(def, ctx.discovered)\n const launchedPkgs = new Set(\n resolved.localApps\n .map((app) => {\n return ctx.apiPkgByApp[app]\n })\n .filter((pkg): pkg is string => {\n return pkg !== undefined\n }),\n )\n\n for (const [app, routes] of Object.entries(resolved.proxy)) {\n for (const [route, source] of Object.entries(routes)) {\n if (source !== 'local') {\n continue\n }\n\n const issue = checkLocalRoute({ preset, app, route, launchedPkgs, ctx })\n\n if (issue) {\n issues.push(issue)\n }\n }\n }\n }\n\n return issues\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAa,eACpB,OAAOC,MAAU,OACjB,OAAOC,OAAY,cAGZ,IAAMC,EAAgB,yBAEhBC,GAAgB,IAAM,CACjC,IAAMC,EAAWL,EAAQ,KAAK,SAAS,SAAS,EAAI,QAAU,OAExDM,EAASL,EAAK,CAAE,MAAOI,CAAS,EAAGJ,EAAK,YAAY,CAAE,KAAME,CAAc,CAAC,CAAC,EAElF,OAAAG,EAAO,KAAK,kCAAkCD,CAAQ,iBAAiBF,CAAa,EAAE,EAE/EG,CACT,EAEaC,GAAgB,IAAM,CACjC,IAAMF,EAAWL,EAAQ,KAAK,SAAS,SAAS,EAAI,QA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AK,cAC1K,CACF,EAkBaK,GAAsB,CAACC,EAAqBJ,IAAgD,CACvG,IAAMK,EAA6B,CAAC,EAEpC,OAAW,CAACnB,EAAQoB,CAAG,IAAK,OAAO,QAAQF,CAAO,EAAG,CACnD,IAAMG,EAAWtB,GAAcqB,EAAKN,EAAI,UAAU,EAC5CD,EAAe,IAAI,IACvBQ,EAAS,UACN,IAAKnC,GACG4B,EAAI,YAAY5B,CAAG,CAC3B,EACA,OAAQwB,GACAA,IAAQ,MAChB,CACL,EAEA,OAAW,CAACxB,EAAKoC,CAAM,IAAK,OAAO,QAAQD,EAAS,KAAK,EACvD,OAAW,CAACT,EAAOW,CAAM,IAAK,OAAO,QAAQD,CAAM,EAAG,CACpD,GAAIC,IAAW,QACb,SAGF,IAAMC,EAAQb,GAAgB,CAAE,OAAAX,EAAQ,IAAAd,EAAK,MAAA0B,EAAO,aAAAC,EAAc,IAAAC,CAAI,CAAC,EAEnEU,GACFL,EAAO,KAAKK,CAAK,CAErB,CAEJ,CAEA,OAAOL,CACT",
|
|
6
|
+
"names": ["process", "pino", "pretty", "LOG_FILE_PATH", "initLoggerMcp", "logLevel", "logger", "initLoggerCLI", "ignoreFields", "fs", "path", "findMonorepoRoot", "startDir", "currentDir", "i", "workspaceFile", "getPackageName", "apiPath", "appName", "pkgPath", "pkg", "discoverApiApps", "root", "appsDir", "apps", "appDirs", "dirent", "serverlessPath", "hasDevScript", "dir", "discoverUiApps", "uiPath", "normalizeAppInclude", "include", "filtered", "resolveSelfAppName", "relative", "firstSegment", "getPackageDistDirs", "packagesDir", "names", "d", "dirs", "name", "distDir", "getAppDistDirs", "app", "classifyDistChange", "changedPath", "appDistDirs", "packageDistDirs", "normalized", "matchedPackageDir", "process", "$", "isCmuxAvailable", "$", "openCmuxDevWorkspace", "args", "cwd", "title", "layout", "layoutJson", "output", "process", "parseWorkspaceRef", "closeCmuxDevWorkspace", "ref", "error", "logger", "match", "V_SEMVER_TOKEN_RE", "canonicalizeCmuxTitle", "raw", "$", "closeCmuxWorkspaceByTitle", "title", "listOutput", "$", "ref", "findWorkspaceRefByTitle", "error", "logger", "output", "target", "canonicalizeCmuxTitle", "rawLine", "match", "lineTitle", "$", "listCmuxWorkspaceTitles", "output", "$", "titles", "rawLine", "match", "title", "canonicalizeCmuxTitle", "error", "logger", "$", "fs", "os", "path", "z", "path", "$", "VERSION_RE", "BRANCH_SEMVER_RE", "KEBAB_RE", "RELEASE_BRANCH_PREFIX", "VERSION_BRANCH_PREFIX", "REFS_HEADS_PREFIX", "NEXT_TOKEN", "RESERVED_NAMES", "InvalidReleaseNameError", "message", "InvalidReleaseRefError", "stripRefsHeads", "input", "REFS_HEADS_PREFIX", "makeVersion", "major", "minor", "patch", "validateName", "name", "KEBAB_RE", "parseBranchName", "branch", "stripped", "RELEASE_BRANCH_PREFIX", "VERSION_BRANCH_PREFIX", "semverPart", "match", "BRANCH_SEMVER_RE", "namePart", "parseReleaseRef", "trimmed", "parsed", "versionMatch", "VERSION_RE", "NEXT_TOKEN", "err", "reason", "formatBranchName", "id", "formatPrTitle", "type", "prefix", "formatRcTitle", "formatJiraName", "displayLabel", "isReleaseBranch", "toTime", "value", "time", "compareReleaseIds", "a", "b", "dates", "timeA", "timeB", "getCurrentWorktrees", "type", "worktreeLines", "$", "worktreePredicateMap", "releaseWorktreePredicate", "featureWorktreePredicate", "branch", "parseWorktreeBranch", "line", "trimmed", "open", "isReleaseBranch", "getProjectRoot", "getCurrentBranch", "isWorkingTreeClean", "isInsideLinkedWorktree", "cwd", "gitDirResult", "commonDirResult", "gitDir", "commonDir", "path", "getRepoName", "projectRoot", "deleteLocalBranch", "deleteRemoteBranch", "INFRA_KIT_CONFIG_FILE", "USER_CONFIG_DIR_NAME", "USER_GLOBAL_CONFIG_FILE", "USER_PROJECTS_DIR", "dopplerEnvManagementSchema", "z", "envManagementSchema", "cursorIdeConfigSchema", "cursorIdeSchema", "zedIdeConfigSchema", "zedIdeSchema", "ideSchema", "idesSchema", "jiraTaskManagerSchema", "taskManagerSchema", "cmuxLayouts", "cmuxConfigSchema", "worktreesConfigSchema", "devAppConfigSchema", "devConfigSchema", "proxySourceSchema", "devPresetAppSchema", "devPresetSchema", "devPresetsSchema", "envAutoLoadSchema", "infraKitConfigObject", "infraKitConfigSchema", "cfg", "ctx", "seen", "entry", "infraKitOverrideConfigSchema", "resolveConfiguredIdes", "config", "ide", "DEFAULT_CMUX_LAYOUT", "resolveCmuxLayout", "cached", "getInfraKitConfigPaths", "projectRoot", "getProjectRoot", "projectName", "path", "userConfigDir", "os", "getInfraKitConfig", "paths", "mainStat", "fs", "legacyYmlPath", "statIfExists", "userGlobalStat", "userProjectStat", "mtimes", "shallowEqual", "layers", "merged", "layer", "data", "loadLayer", "finalResult", "resetInfraKitConfigCache", "filePath", "readIfExists", "a", "b", "keys", "k", "raw", "parsedRaw", "err", "result", "openCmuxWorkspaceWithLayout", "args", "cwd", "title", "layout", "resolveCmuxLayout", "getInfraKitConfig", "newWorkspaceOutput", "$", "workspaceRef", "parseWorkspaceRef", "surfacesOutput", "leftTopRef", "parseFirstSurfaceRef", "output", "match", "buildCmuxWorkspaceTitle", "args", "repoName", "branch", "id", "parseBranchName", "label", "displayLabel", "ALL_PARTS", "parseTargetKey", "key", "segments", "appGlob", "part", "appsWithPart", "discovered", "allApps", "targetId", "app", "keyRank", "isGlob", "explicit", "resolveWatch", "prior", "next", "addTarget", "state", "spec", "watchDeps", "id", "merged", "resolvePreset", "preset", "entries", "cfg", "parts", "apps", "targets", "localApps", "t", "ownerApp", "apiPkgByApp", "pkg", "checkLocalRoute", "route", "launchedPkgs", "ctx", "owner", "hint", "validatePresetProxy", "presets", "issues", "def", "resolved", "routes", "source", "issue"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as x}from"./chunk-2PZRQHWF.js";import{Buffer as S}from"node:buffer";import{execFileSync as R}from"node:child_process";import u from"node:fs";import w from"node:net";import l from"node:path";import m from"node:process";import{pathToFileURL as b}from"node:url";import{z as f}from"zod";import{z as o}from"zod";var v=o.strictObject({requiredScripts:o.array(o.string().min(1)).optional(),requiredFiles:o.array(o.string().min(1)).optional(),turbo:o.strictObject({requiredTasks:o.array(o.string().min(1)).optional()}).optional(),dev:o.strictObject({proxy:o.strictObject({templates:o.strictObject({local:o.string().min(1),cloud:o.string().min(1)}),routes:o.record(o.string().min(1),o.strictObject({packageName:o.string().min(1),from:o.array(o.enum(["local","cloud"])).min(1),default:o.enum(["local","cloud"]).optional()}).refine(e=>e.from.length<=1||e.default!==void 0,{message:"default is required when `from` has more than one source"}).refine(e=>e.default===void 0||e.from.includes(e.default),{message:"default must be listed in `from`"}))}).optional()}).optional()});var h="INFRA_KIT_ENV",k="infra-kit.config.ts",A=l.join(".infra-kit","dev-context"),K=l.join(".infra-kit","dev-context.json"),D=f.object({package:f.string(),port:f.number(),pid:f.number().optional(),writtenAt:f.number().optional(),release:f.string().optional()}),E=(e,t)=>{let r=t?.username??e.E2E__BASIC_AUTH_USERNAME,n=t?.password??e.E2E__BASIC_AUTH_PASSWORD;return!r||!n?void 0:`Basic ${S.from(`${r}:${n}`).toString("base64")}`};var I=(e,t)=>e.replaceAll("<release>",t.release).replaceAll("<packageName>",t.packageName).replaceAll("<env>",t.env),N=(e,t)=>{let r=e.default??e.from[0];return e.from.includes("local")&&t.has(e.packageName)?"local":r},O=({routePath:e,route:t,templates:r,localSet:n,env:a,getRelease:i,localInfo:c})=>{if(N(t,n)==="local"){let d=c?.get(t.packageName)?.release??i();return{target:I(r.local,{release:d,packageName:t.packageName,env:a??""}),changeOrigin:!0}}if(!a)throw new Error(`infra-kit/vite: proxy route "${e}" resolves to a cloud backend but ${h} is not set. Source an environment from Doppler first (e.g. \`infra-kit env-load dev\`).`);return{target:I(r.cloud,{release:"",packageName:t.packageName,env:a}),changeOrigin:!0,secure:!1,cookieDomainRewrite:"localhost"}},_=({proxy:e,localSet:t,env:r,getRelease:n,authHeader:a,localInfo:i})=>{let c={},s=a?{Authorization:a}:void 0;for(let[g,d]of Object.entries(e.routes)){let p=O({routePath:g,route:d,templates:e.templates,localSet:t,env:r,getRelease:n,localInfo:i});c[g]=s?{...p,headers:s}:p}return c},j=e=>{let t;return()=>(t??={value:e()},t.value)},C=async e=>{let t=l.join(e,k);if(!u.existsSync(t))return;let r=u.statSync(t),i=(await import(`${b(t).href}?mtime=${Number(r.mtimeMs)}`)).default;if(i===void 0)return;let c=typeof i=="function"?await i():i,s=v.safeParse(c);if(!s.success)throw new Error(`infra-kit/vite: invalid ${k} at ${t}: ${f.prettifyError(s.error)}`);return s.data.dev},L=e=>{if(Array.isArray(e))return e.filter(t=>typeof t=="string");if(e!==null&&typeof e=="object"){let t=e.packages??e.localPackages;if(Array.isArray(t))return t.filter(r=>typeof r=="string")}return[]},P=(e,t)=>{let r=l.resolve(e);for(;;){let n=l.join(r,t);if(u.existsSync(n))return n;let a=l.dirname(r);if(a===r)return;r=a}},y=()=>({packages:new Set,info:new Map}),T=e=>{let t;try{t=u.readdirSync(e)}catch{return y()}let r=new Set,n=new Map;for(let a of t)if(a.endsWith(".json"))try{let i=D.safeParse(JSON.parse(u.readFileSync(l.join(e,a),"utf-8")));if(!i.success)continue;r.add(i.data.package),n.set(i.data.package,{port:i.data.port,release:i.data.release})}catch{continue}return{packages:r,info:n}},F=e=>{let t=P(e,A);if(t)return T(t);let r=P(e,K);if(!r)return y();try{return{packages:new Set(L(JSON.parse(u.readFileSync(r,"utf-8")))),info:new Map}}catch{return y()}};var V=e=>R("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:e,encoding:"utf-8"}).trim(),$=()=>new Promise((e,t)=>{let r=w.createServer();r.unref(),r.on("error",t),r.listen(0,"127.0.0.1",()=>{let n=r.address(),a=typeof n=="object"&&n!==null?n.port:0;r.close(()=>e(a))})}),B=async(e={})=>{let t=e.cwd??m.cwd();if(e.command==="build")return{proxy:{}};let r=e.port??await $(),n=await C(t);if(!n?.proxy)return{port:r,proxy:{}};let{packages:a,info:i}=F(t),c=m.env[h],s=E(m.env,e.basicAuth),g=j(()=>x(V(t)));return{port:r,proxy:_({proxy:n.proxy,localSet:a,env:c,getRelease:g,authHeader:s,localInfo:i})}},ee=async(e={})=>(await B(e)).proxy;export{v as a,_ as b,C as c,B as d,ee as e};
|
|
2
|
+
//# sourceMappingURL=chunk-IX2A34UU.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/lib/vite/vite.ts", "../src/lib/package-config/package-config-schema.ts"],
|
|
4
|
+
"sourcesContent": ["import { Buffer } from 'node:buffer'\nimport { execFileSync } from 'node:child_process'\nimport fs from 'node:fs'\nimport net from 'node:net'\nimport path from 'node:path'\nimport process from 'node:process'\nimport { pathToFileURL } from 'node:url'\nimport { z } from 'zod'\n\nimport type {\n InfraKitDev,\n InfraKitDevProxy,\n InfraKitDevProxyRoute,\n InfraKitDevProxySource,\n} from '../package-config/package-config'\nimport { packageConfigSchema } from '../package-config/package-config-schema'\nimport { slugifyRelease } from '../release-slug/release-slug'\n\n/**\n * Env-name handle read at vite-config time to fill the `<env>` placeholder in a\n * cloud proxy target. Inlined (not imported from `src/lib/constants`) to keep the\n * `infra-kit/vite` bundle's import graph tiny \u2014 see the module header. Kept\n * byte-identical to `INFRA_KIT_ENV_VAR` in `src/lib/constants/constants.ts`.\n */\nconst INFRA_KIT_ENV = 'INFRA_KIT_ENV'\n\n/** Per-package config filename, mirrored from the CLI's `PACKAGE_CONFIG_FILE`. */\nconst PACKAGE_CONFIG_FILE = 'infra-kit.config.ts'\n\n/**\n * Repo-relative dev-context fragment DIRECTORY, searched upward from cwd. Each\n * runner (single-process or cmux pane) writes its OWN `<app>.json` fragment here\n * recording its real bound port + release; the helper merges them (see\n * {@link readLocalContext}). This is the current source of truth.\n */\nconst DEV_CONTEXT_DIR = path.join('.infra-kit', 'dev-context')\n\n/**\n * Legacy single-file dev-context manifest, searched upward from cwd. Read only as\n * a transitional back-compat path when {@link DEV_CONTEXT_DIR} is absent (the\n * directory wins per-package when both exist).\n */\nconst DEV_CONTEXT_FILE = path.join('.infra-kit', 'dev-context.json')\n\n/**\n * One `.infra-kit/dev-context/<app>.json` fragment. `package` + `port` are the\n * load-bearing fields the helper reads (`package` \u2192 localSet, `port` \u2192 the real\n * bound port for a future `127.0.0.1:<port>` mode / Layer B route); `release` lets\n * the helper prefer the runner-recorded slug over its own git derivation.\n * `pid`/`writtenAt` are staleness metadata (unused on the read path here). Kept\n * lenient (not `.strict()`) so extra writer fields never reject a valid fragment.\n */\nconst devContextFragmentSchema = z.object({\n package: z.string(),\n port: z.number(),\n pid: z.number().optional(),\n writtenAt: z.number().optional(),\n release: z.string().optional(),\n})\n\n/**\n * A single Vite `server.proxy` entry. `changeOrigin` is always set; the\n * cloud-only pair (`secure: false` + `cookieDomainRewrite: 'localhost'`) makes a\n * local FE talk to an HTTPS cloud BE without cert/cookie-domain breakage.\n * `headers` is present only when HTTP Basic Auth is injected (see\n * {@link buildBasicAuthHeader}) \u2014 it carries the `Authorization` header applied\n * uniformly to every route so upstream environments behind auth (e2e/staging)\n * stay reachable.\n */\nexport interface InfraKitViteProxyEntry {\n target: string\n changeOrigin: true\n secure?: false\n cookieDomainRewrite?: 'localhost'\n headers?: Record<string, string>\n}\n\n/** A Vite `server.proxy`-shaped map: path-prefix \u2192 proxy entry. */\nexport type InfraKitViteProxy = Record<string, InfraKitViteProxyEntry>\n\n/** Explicit HTTP Basic Auth credentials, overriding the `E2E__BASIC_AUTH_*` env vars. */\nexport interface InfraKitBasicAuth {\n username: string\n password: string\n}\n\nexport interface InfraKitDevOptions {\n /** Package dir whose `infra-kit.config.ts` is loaded. Defaults to `process.cwd()`. */\n cwd?: string\n /**\n * Explicit HTTP Basic Auth credentials injected into every proxy route as an\n * `Authorization` header. Takes precedence over the `E2E__BASIC_AUTH_USERNAME`\n * / `E2E__BASIC_AUTH_PASSWORD` env vars. Omit to use the env-based default.\n */\n basicAuth?: InfraKitBasicAuth\n /**\n * Vite's `command`. Pass it (`defineConfig(async ({ command }) => ({ server: await infraKitDev({ command }) }))`)\n * so `build` is a no-op: `server` is irrelevant to a build and proxy resolution would otherwise\n * fail-fast on a cloud route with no sourced env. Omit (or `'serve'`) for the dev-server config.\n */\n command?: 'build' | 'serve'\n /**\n * Explicit dev-server port. Omit for a **per-worktree dynamic** free port (a fresh OS-assigned\n * port) so N simultaneous git worktrees never collide on Vite's default `5173`; Vite prints the\n * chosen URL. Pass a fixed number only when an external contract pins the port.\n */\n port?: number\n}\n\n/**\n * Build the `Authorization: Basic <base64(user:pass)>` header value. Credentials\n * come from `override` when given, else from `E2E__BASIC_AUTH_USERNAME` /\n * `E2E__BASIC_AUTH_PASSWORD` (NOTE: double underscore). Returns `undefined` when\n * either half is missing, so callers add no `headers` key at all.\n */\nconst buildBasicAuthHeader = (env: NodeJS.ProcessEnv, override?: InfraKitBasicAuth): string | undefined => {\n const username = override?.username ?? env.E2E__BASIC_AUTH_USERNAME\n const password = override?.password ?? env.E2E__BASIC_AUTH_PASSWORD\n\n if (!username || !password) return undefined\n\n const encoded = Buffer.from(`${username}:${password}`).toString('base64')\n\n return `Basic ${encoded}`\n}\n\n/**\n * Re-exported from the shared, dependency-light `lib/release-slug` module so the\n * published `infra-kit/vite` surface (`entry/vite.ts:7`) is unchanged while the\n * dev-server's fragment writer derives `<release>` from the SAME implementation\n * (no slug drift). See {@link slugifyRelease}.\n */\nexport { slugifyRelease }\n\n/** Fill the `<release>`/`<packageName>`/`<env>` placeholders in a URL template. */\nconst interpolate = (template: string, values: { release: string; packageName: string; env: string }): string => {\n return template\n .replaceAll('<release>', values.release)\n .replaceAll('<packageName>', values.packageName)\n .replaceAll('<env>', values.env)\n}\n\n/**\n * Pick the effective source for a route: `local` when the route lists `local` as\n * a capability AND its packageName is in the local dev set; otherwise the fallback\n * \u2014 the declared `default` for a multi-source route, or the sole `from` entry for\n * a single-source one. Always resolves (the schema guarantees a usable fallback).\n */\nconst pickSource = (route: InfraKitDevProxyRoute, localSet: ReadonlySet<string>): InfraKitDevProxySource => {\n // `from` is guaranteed non-empty by the schema, so `from[0]` is always present.\n const fallback = route.default ?? route.from[0]!\n\n return route.from.includes('local') && localSet.has(route.packageName) ? 'local' : fallback\n}\n\ninterface ResolveRouteArgs {\n routePath: string\n route: InfraKitDevProxyRoute\n templates: InfraKitDevProxy['templates']\n localSet: ReadonlySet<string>\n env: string | undefined\n getRelease: () => string\n /** Per-package runtime data (recorded release/port) from the dev-context merge. */\n localInfo?: ReadonlyMap<string, LocalPackageInfo>\n}\n\n/** Resolve one route into a Vite proxy entry (or throw an actionable error). */\nconst resolveRoute = ({\n routePath,\n route,\n templates,\n localSet,\n env,\n getRelease,\n localInfo,\n}: ResolveRouteArgs): InfraKitViteProxyEntry => {\n const source = pickSource(route, localSet)\n\n if (source === 'local') {\n // Prefer THIS package's runner-recorded release slug (R4) over the single\n // global git derivation, so cross-branch FE/BE pairings don't drift the\n // emitted `<release>` from the segment the runner aliased. Fall back to the\n // global git slug only when the fragment carried no release.\n const release = localInfo?.get(route.packageName)?.release ?? getRelease()\n\n const target = interpolate(templates.local, {\n release,\n packageName: route.packageName,\n env: env ?? '',\n })\n\n return { target, changeOrigin: true }\n }\n\n if (!env) {\n throw new Error(\n `infra-kit/vite: proxy route \"${routePath}\" resolves to a cloud backend but ${INFRA_KIT_ENV} is not set. Source an environment from Doppler first (e.g. \\`infra-kit env-load dev\\`).`,\n )\n }\n\n const target = interpolate(templates.cloud, { release: '', packageName: route.packageName, env })\n\n return { target, changeOrigin: true, secure: false, cookieDomainRewrite: 'localhost' }\n}\n\ninterface ResolveProxyArgs {\n proxy: InfraKitDevProxy\n localSet: ReadonlySet<string>\n env: string | undefined\n getRelease: () => string\n /** Pre-computed `Authorization` header value applied uniformly to every route. */\n authHeader?: string\n /** Per-package runtime data (recorded release/port) from the dev-context merge. */\n localInfo?: ReadonlyMap<string, LocalPackageInfo>\n}\n\n/**\n * Pure resolver: turn a `dev.proxy` config + resolved inputs (local set, env,\n * lazy release) into a Vite `server.proxy` map. Side-effect-free so the\n * resolution shape is fully unit-testable. When `authHeader` is set, every route\n * entry gets a matching `headers.Authorization`; otherwise no `headers` key.\n */\nexport const resolveProxyConfig = ({\n proxy,\n localSet,\n env,\n getRelease,\n authHeader,\n localInfo,\n}: ResolveProxyArgs): InfraKitViteProxy => {\n const result: InfraKitViteProxy = {}\n const headers = authHeader ? { Authorization: authHeader } : undefined\n\n for (const [routePath, route] of Object.entries(proxy.routes)) {\n const entry = resolveRoute({ routePath, route, templates: proxy.templates, localSet, env, getRelease, localInfo })\n\n result[routePath] = headers ? { ...entry, headers } : entry\n }\n\n return result\n}\n\n/** Memoize a zero-arg thunk so `<release>` git resolution runs at most once. */\nconst once = <T>(fn: () => T): (() => T) => {\n let cached: { value: T } | undefined\n\n return () => {\n cached ??= { value: fn() }\n\n return cached.value\n }\n}\n\n/**\n * Load a package's `infra-kit.config.ts` and return its `dev` block, or\n * `undefined` when the config or the `dev` key is absent. The `.ts` config is\n * evaluated via Node's native type stripping (Node >= 24) \u2014 the same mechanism\n * the CLI's config loader uses. Cache-busted by mtime so repeated dev-server\n * reloads pick up edits.\n */\nexport const loadDev = async (cwd: string): Promise<InfraKitDev | undefined> => {\n const configPath = path.join(cwd, PACKAGE_CONFIG_FILE)\n\n if (!fs.existsSync(configPath)) return undefined\n\n const stat = fs.statSync(configPath)\n const moduleUrl = `${pathToFileURL(configPath).href}?mtime=${Number(stat.mtimeMs)}`\n\n const imported = (await import(moduleUrl)) as { default?: unknown }\n const rawExport = imported.default\n\n if (rawExport === undefined) return undefined\n\n const resolved = typeof rawExport === 'function' ? await (rawExport as () => unknown)() : rawExport\n\n const parsed = packageConfigSchema.safeParse(resolved)\n\n if (!parsed.success) {\n throw new Error(`infra-kit/vite: invalid ${PACKAGE_CONFIG_FILE} at ${configPath}: ${z.prettifyError(parsed.error)}`)\n }\n\n return parsed.data.dev\n}\n\n/** Coerce a parsed dev-context.json into the set of locally-running package names. */\nconst extractPackages = (parsed: unknown): string[] => {\n if (Array.isArray(parsed)) {\n return parsed.filter((v): v is string => {\n return typeof v === 'string'\n })\n }\n\n if (parsed !== null && typeof parsed === 'object') {\n const candidate = (parsed as Record<string, unknown>).packages ?? (parsed as Record<string, unknown>).localPackages\n\n if (Array.isArray(candidate)) {\n return candidate.filter((v): v is string => {\n return typeof v === 'string'\n })\n }\n }\n\n return []\n}\n\n/** Search upward from `start` for `relative`, returning the first hit or undefined. */\nconst findUp = (start: string, relative: string): string | undefined => {\n let dir = path.resolve(start)\n\n for (;;) {\n const candidate = path.join(dir, relative)\n\n if (fs.existsSync(candidate)) return candidate\n\n const parent = path.dirname(dir)\n\n if (parent === dir) return undefined\n\n dir = parent\n }\n}\n\n/** Per-package runtime data merged from the dev-context fragment directory. */\nexport interface LocalPackageInfo {\n /** The real bound port the runner recorded (available for a future direct mode). */\n port: number\n /** The runner-recorded release slug, preferred over the helper's git derivation. */\n release?: string\n}\n\n/**\n * The locally-running package set plus a `package \u2192 { port, release }` map merged\n * from the dev-context fragments. `packages` feeds `pickSource`; `info` lets a\n * `local` route emit the per-package recorded release (see {@link resolveRoute}).\n */\nexport interface LocalContext {\n packages: ReadonlySet<string>\n info: ReadonlyMap<string, LocalPackageInfo>\n}\n\n/** An empty {@link LocalContext} (frontend-only / dev-context absent). */\nconst emptyLocalContext = (): LocalContext => {\n return { packages: new Set(), info: new Map() }\n}\n\n/**\n * Merge every `<app>.json` fragment in the dev-context directory into a\n * {@link LocalContext}. Two DISTINCT failure branches (do NOT collapse them into\n * one directory-wide catch):\n * - `readdir`-ENOENT (directory vanished mid-race) \u2192 empty context, matching the\n * dir-absent back-compat behaviour.\n * - a single corrupt/truncated/invalid `<app>.json` \u2192 that ONE fragment is\n * SKIPPED (per-fragment `safeParse` isolation); the rest still merge, so one bad\n * fragment never collapses the whole localSet to empty (which would silently\n * drop a started package to cloud).\n */\nconst readFragmentDir = (dir: string): LocalContext => {\n let entries: string[]\n\n try {\n entries = fs.readdirSync(dir)\n } catch {\n return emptyLocalContext()\n }\n\n const packages = new Set<string>()\n const info = new Map<string, LocalPackageInfo>()\n\n for (const name of entries) {\n if (!name.endsWith('.json')) continue\n\n try {\n const parsed = devContextFragmentSchema.safeParse(JSON.parse(fs.readFileSync(path.join(dir, name), 'utf-8')))\n\n if (!parsed.success) continue\n\n packages.add(parsed.data.package)\n info.set(parsed.data.package, { port: parsed.data.port, release: parsed.data.release })\n } catch {\n // Corrupt/truncated fragment (JSON.parse / read failure): skip ONLY this one.\n continue\n }\n }\n\n return { packages, info }\n}\n\n/**\n * Read the locally-running package context, searched upward from `cwd`. Prefers\n * the `.infra-kit/dev-context/` fragment DIRECTORY (merged via\n * {@link readFragmentDir}); when it is absent, falls back to the legacy single\n * `.infra-kit/dev-context.json` file (read as before \u2014 no per-package release);\n * when neither exists \u2192 empty context (frontend-only, every route resolves cloud).\n */\nexport const readLocalContext = (cwd: string): LocalContext => {\n const dir = findUp(cwd, DEV_CONTEXT_DIR)\n\n if (dir) return readFragmentDir(dir)\n\n const legacy = findUp(cwd, DEV_CONTEXT_FILE)\n\n if (!legacy) return emptyLocalContext()\n\n try {\n return { packages: new Set(extractPackages(JSON.parse(fs.readFileSync(legacy, 'utf-8')))), info: new Map() }\n } catch {\n return emptyLocalContext()\n }\n}\n\n/**\n * Read the set of locally-running packages (searched upward from `cwd`). Thin\n * wrapper over {@link readLocalContext} preserving the historical `Set`-returning\n * contract. Absent dev-context \u2192 empty set (frontend-only cloud resolution).\n */\nexport const readLocalSet = (cwd: string): ReadonlySet<string> => {\n return readLocalContext(cwd).packages\n}\n\n/** Current git branch of `cwd` (raw, un-slugified). */\nconst readGitBranch = (cwd: string): string => {\n // eslint-disable-next-line sonarjs/no-os-command-from-path\n return execFileSync('git', ['rev-parse', '--abbrev-ref', 'HEAD'], { cwd, encoding: 'utf-8' }).trim()\n}\n\n/**\n * An OS-assigned free TCP port on 127.0.0.1 \u2014 the per-worktree dev-server port (mirrors the\n * backend's `listen(0)`). This probes then releases the port, so there is a small TOCTOU window\n * before Vite binds it; Vite's default `strictPort: false` absorbs a lost race by stepping to the\n * next free port. Only a consumer that sets `strictPort: true` would hard-fail on the rare collision.\n */\nconst getFreePort = (): Promise<number> => {\n return new Promise((resolve, reject) => {\n const srv = net.createServer()\n\n srv.unref()\n srv.on('error', reject)\n srv.listen(0, '127.0.0.1', () => {\n const address = srv.address()\n const port = typeof address === 'object' && address !== null ? address.port : 0\n\n srv.close(() => {\n return resolve(port)\n })\n })\n })\n}\n\n/**\n * Resolve a package's `dev` block into a ready-made Vite `server` config: a per-worktree dev-server\n * `port` plus the `proxy` map. Loads the package's `infra-kit.config.ts`, merges the local dev set\n * from the `.infra-kit/dev-context/` fragment directory, and interpolates the local/cloud templates.\n * `<env>` comes from `INFRA_KIT_ENV`; `<release>` from each package's runner-recorded fragment when\n * present, else the slugified git branch (computed lazily, only when a local route needs it).\n *\n * `port` defaults to a fresh OS-assigned free port so simultaneous git worktrees never collide on\n * Vite's `5173` (override via `options.port`). Pass `command` so `build` is a no-op (empty proxy, no\n * port) \u2014 a build ignores `server` and proxy resolution would otherwise fail-fast on a cloud route\n * with no sourced env.\n *\n * @example\n * // vite.config.ts \u2014 the whole `server` field is the helper's output\n * import { infraKitDev } from 'infra-kit/vite'\n * export default defineConfig(async ({ command }) => ({ server: await infraKitDev({ command }) }))\n */\nexport const infraKitDev = async (\n options: InfraKitDevOptions = {},\n): Promise<{ port?: number; proxy: InfraKitViteProxy }> => {\n const cwd = options.cwd ?? process.cwd()\n\n // A build ignores `server`; skip the port + proxy work (proxy resolution would fail-fast on a\n // cloud route with no sourced env).\n if (options.command === 'build') return { proxy: {} }\n\n const port = options.port ?? (await getFreePort())\n const dev = await loadDev(cwd)\n\n if (!dev?.proxy) return { port, proxy: {} }\n\n const { packages: localSet, info: localInfo } = readLocalContext(cwd)\n const env = process.env[INFRA_KIT_ENV]\n const authHeader = buildBasicAuthHeader(process.env, options.basicAuth)\n const getRelease = once(() => {\n return slugifyRelease(readGitBranch(cwd))\n })\n\n return { port, proxy: resolveProxyConfig({ proxy: dev.proxy, localSet, env, getRelease, authHeader, localInfo }) }\n}\n\n/**\n * Convenience wrapper returning just the proxy map (for spreading into\n * `server.proxy` directly). Equivalent to `(await infraKitDev(options)).proxy`.\n */\nexport const infraKitProxy = async (options: InfraKitDevOptions = {}): Promise<InfraKitViteProxy> => {\n return (await infraKitDev(options)).proxy\n}\n", "import { z } from 'zod'\n\n/**\n * Schema for the resolved (post-factory) package config object. `strictObject`\n * rejects unknown keys so typos in `infra-kit.config.ts` surface as validation\n * errors instead of being silently ignored.\n *\n * Kept in its own module \u2014 separate from the public `defineConfig`/types entry \u2014\n * so the published `infra-kit` type surface stays free of a `zod` import.\n */\nexport const packageConfigSchema = z.strictObject({\n requiredScripts: z.array(z.string().min(1)).optional(),\n requiredFiles: z.array(z.string().min(1)).optional(),\n turbo: z\n .strictObject({\n requiredTasks: z.array(z.string().min(1)).optional(),\n })\n .optional(),\n dev: z\n .strictObject({\n proxy: z\n .strictObject({\n templates: z.strictObject({\n local: z.string().min(1),\n cloud: z.string().min(1),\n }),\n routes: z.record(\n z.string().min(1),\n z\n .strictObject({\n packageName: z.string().min(1),\n from: z.array(z.enum(['local', 'cloud'])).min(1),\n default: z.enum(['local', 'cloud']).optional(),\n })\n .refine(\n (route) => {\n return route.from.length <= 1 || route.default !== undefined\n },\n {\n message: 'default is required when `from` has more than one source',\n },\n )\n .refine(\n (route) => {\n return route.default === undefined || route.from.includes(route.default)\n },\n {\n message: 'default must be listed in `from`',\n },\n ),\n ),\n })\n .optional(),\n })\n .optional(),\n})\n"],
|
|
5
|
+
"mappings": "wCAAA,OAAS,UAAAA,MAAc,cACvB,OAAS,gBAAAC,MAAoB,qBAC7B,OAAOC,MAAQ,UACf,OAAOC,MAAS,WAChB,OAAOC,MAAU,YACjB,OAAOC,MAAa,eACpB,OAAS,iBAAAC,MAAqB,WAC9B,OAAS,KAAAC,MAAS,MCPlB,OAAS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,SAAS,EAChEW,EAAaC,EAAK,IACfC,EAAexB,EAAcC,CAAG,CAAC,CACzC,EAED,MAAO,CAAE,KAAAQ,EAAM,MAAOgB,EAAmB,CAAE,MAAOZ,EAAI,MAAO,SAAAE,EAAU,IAAAG,EAAK,WAAAI,EAAY,WAAAF,EAAY,UAAAJ,CAAU,CAAC,CAAE,CACnH,EAMaU,GAAgB,MAAOf,EAA8B,CAAC,KACzD,MAAMD,EAAYC,CAAO,GAAG",
|
|
6
|
+
"names": ["Buffer", "execFileSync", "fs", "net", "path", "process", "pathToFileURL", "z", "z", "packageConfigSchema", "route", "INFRA_KIT_ENV", "PACKAGE_CONFIG_FILE", "DEV_CONTEXT_DIR", "path", "DEV_CONTEXT_FILE", "devContextFragmentSchema", "z", "buildBasicAuthHeader", "env", "override", "username", "password", "Buffer", "interpolate", "template", "values", "pickSource", "route", "localSet", "fallback", "resolveRoute", "routePath", "templates", "env", "getRelease", "localInfo", "release", "INFRA_KIT_ENV", "resolveProxyConfig", "proxy", "authHeader", "result", "headers", "entry", "once", "fn", "cached", "loadDev", "cwd", "configPath", "path", "PACKAGE_CONFIG_FILE", "fs", "stat", "rawExport", "pathToFileURL", "resolved", "parsed", "packageConfigSchema", "z", "extractPackages", "v", "candidate", "findUp", "start", "relative", "dir", "parent", "emptyLocalContext", "readFragmentDir", "entries", "packages", "info", "name", "devContextFragmentSchema", "readLocalContext", "DEV_CONTEXT_DIR", "legacy", "DEV_CONTEXT_FILE", "readGitBranch", "cwd", "execFileSync", "getFreePort", "resolve", "reject", "srv", "net", "address", "port", "infraKitDev", "options", "process", "dev", "loadDev", "localSet", "localInfo", "readLocalContext", "env", "INFRA_KIT_ENV", "authHeader", "buildBasicAuthHeader", "getRelease", "once", "slugifyRelease", "resolveProxyConfig", "infraKitProxy"]
|
|
7
|
+
}
|