mulmoterminal 4.7.1 → 4.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/README.md +4 -2
  2. package/common/terminalSubmit.ts +11 -0
  3. package/common/worktreePath.ts +62 -0
  4. package/dist/assets/{abnfDiagram-VRR7QNED-WSmThe6b-dBgFOZJ6.js → abnfDiagram-VRR7QNED-WSmThe6b-D73U7t0p.js} +1 -1
  5. package/dist/assets/architecture-TIHT7OUA-Cqhmai3f-DIzo7w_L.js +1 -0
  6. package/dist/assets/{architectureDiagram-ZJ3FMSHR-Tj3i7Oow-DEsMCnCO.js → architectureDiagram-ZJ3FMSHR-Tj3i7Oow-BqknvBAc.js} +1 -1
  7. package/dist/assets/{blockDiagram-677ZJIJ3-c-hNYBhI-B2nmyPz0.js → blockDiagram-677ZJIJ3-c-hNYBhI-C-R2DYLn.js} +1 -1
  8. package/dist/assets/{c4Diagram-LMCZKHZV-WIGVajf5-CmCUDAtE.js → c4Diagram-LMCZKHZV-WIGVajf5-CFLnFUVz.js} +1 -1
  9. package/dist/assets/channel-OqG5cGJi-D-WnjagZ.js +1 -0
  10. package/dist/assets/{chunk-32BRIVSS-CtSq3QOR-DYYdxRvv.js → chunk-32BRIVSS-CtSq3QOR-6rYea-CL.js} +1 -1
  11. package/dist/assets/{chunk-52WLFC77-2Up0T-6t-DkAuUA9O.js → chunk-52WLFC77-2Up0T-6t-khGqxV5O.js} +1 -1
  12. package/dist/assets/{chunk-C7G6YPKG-ivengO-7-DAJ9T7Qf.js → chunk-C7G6YPKG-ivengO-7-bFUHMUxV.js} +1 -1
  13. package/dist/assets/{chunk-EX3LRPZG-BHoWQ6W8-B2e2_95p.js → chunk-EX3LRPZG-BHoWQ6W8-B4lbxCc6.js} +1 -1
  14. package/dist/assets/{chunk-FWX5IMBZ-PvRXPghr-CjeJ_Ar9.js → chunk-FWX5IMBZ-PvRXPghr-C-d7oqbj.js} +2 -2
  15. package/dist/assets/{chunk-HOUHSVGY-A3_zwY4q-C95KqDEI.js → chunk-HOUHSVGY-A3_zwY4q-CG1yaORz.js} +1 -1
  16. package/dist/assets/{chunk-ICXQ74PX-vzZqgurQ-FWkJ2cxG.js → chunk-ICXQ74PX-vzZqgurQ-z7POXt-O.js} +1 -1
  17. package/dist/assets/{chunk-MOJQB5TN-CorQ_Pl1-mXFOYgnO.js → chunk-MOJQB5TN-CorQ_Pl1-BRlwRZvQ.js} +1 -1
  18. package/dist/assets/{chunk-OGEWGWER-BVhfs7WG-4RsxS3fR.js → chunk-OGEWGWER-BVhfs7WG-DtyxJwXq.js} +1 -1
  19. package/dist/assets/{chunk-PUDLZKDR-CJo7KQJ3-CqLwqZmB.js → chunk-PUDLZKDR-CJo7KQJ3-DJqCfvJf.js} +1 -1
  20. package/dist/assets/{chunk-Q4XR5HBZ-DLkq8ZGO-9ClFvrdq.js → chunk-Q4XR5HBZ-DLkq8ZGO-BPEblDJT.js} +1 -1
  21. package/dist/assets/{chunk-V7JOEXUC-DqefuUOb-H1x3ZOme.js → chunk-V7JOEXUC-DqefuUOb-Cal9YPT7.js} +1 -1
  22. package/dist/assets/{chunk-VAUOI2AC-BKx35BBi-E0yAewsj.js → chunk-VAUOI2AC-BKx35BBi-C6TYZmsd.js} +1 -1
  23. package/dist/assets/{chunk-VR4S4FIN-DpJgr4Ur-Cw4po3Ii.js → chunk-VR4S4FIN-DpJgr4Ur-DPYZWYg7.js} +1 -1
  24. package/dist/assets/{chunk-WYO6CB5R-nS6zX9ct-KrP8SxMs.js → chunk-WYO6CB5R-nS6zX9ct-n_cQEuya.js} +1 -1
  25. package/dist/assets/{chunk-ZGVPDNZ5-DNtiHxpJ-chUFyGWx.js → chunk-ZGVPDNZ5-DNtiHxpJ-D5R2K2Ln.js} +1 -1
  26. package/dist/assets/classDiagram-OUVF2IWQ-C6h0nbT3-odMHao8V.js +1 -0
  27. package/dist/assets/classDiagram-v2-EOCWNBFH-CzsXJ_wA-odMHao8V.js +1 -0
  28. package/dist/assets/cynefin-VYW2F7L2-DvSvuXnG-Bd7FA-7S.js +1 -0
  29. package/dist/assets/{cynefinDiagram-TSTJHNR4-969y1qZK-BGIuynhv.js → cynefinDiagram-TSTJHNR4-969y1qZK-HJ77EDhq.js} +1 -1
  30. package/dist/assets/{dagre-VKFMJZFB-CZfgAZFk-BTpA5SlQ.js → dagre-VKFMJZFB-CZfgAZFk-xZ8RjARw.js} +1 -1
  31. package/dist/assets/{diagram-FQU43EPY-CSdnleGM-Bpa9ofDC.js → diagram-FQU43EPY-CSdnleGM-dygm-wKf.js} +1 -1
  32. package/dist/assets/{diagram-G47NLZAW-DKYe-Mwx-WAKYgBrz.js → diagram-G47NLZAW-DKYe-Mwx-BKsERSmw.js} +1 -1
  33. package/dist/assets/{diagram-NH7WQ7WH-DMasKpwa-CW4r7qyE.js → diagram-NH7WQ7WH-DMasKpwa-C-2NxCY7.js} +1 -1
  34. package/dist/assets/{diagram-OA4YK3LP-CSyc0BDR-BKacee04.js → diagram-OA4YK3LP-CSyc0BDR-CG9LVpjD.js} +1 -1
  35. package/dist/assets/{diagram-WEI45ONY-CcJW2fNK-BeAKCOeu.js → diagram-WEI45ONY-CcJW2fNK-CKuHsuil.js} +1 -1
  36. package/dist/assets/{dist-V67wX5oT.js → dist-BLLns4ri.js} +1 -1
  37. package/dist/assets/{dist-Cpy0pAqt.js → dist-CVcPeY2Y.js} +1 -1
  38. package/dist/assets/{dist-ChlNuoKi.js → dist-Cgoq4tCl.js} +1 -1
  39. package/dist/assets/{dist-BxW5R1_A.js → dist-xND4uT4X.js} +1 -1
  40. package/dist/assets/{ebnfDiagram-CCIWWBDH-CeBUH2N0-oK8JFLJb.js → ebnfDiagram-CCIWWBDH-CeBUH2N0-CfFBaD9k.js} +1 -1
  41. package/dist/assets/{erDiagram-Q63AITRT-1OOp34oV-BmDLJ3fH.js → erDiagram-Q63AITRT-1OOp34oV-B3W5XEoS.js} +1 -1
  42. package/dist/assets/eventmodeling-45OFAUF4-jdctDg0T-DXK51Y5x.js +1 -0
  43. package/dist/assets/flowDiagram-23GEKE2U-DK0InIny-B9R0IDi2.js +1 -0
  44. package/dist/assets/{ganttDiagram-NO4QXBWP-DQT88dUZ-Dgt5eOG6.js → ganttDiagram-NO4QXBWP-DQT88dUZ-DnoN-05O.js} +1 -1
  45. package/dist/assets/gitGraph-TEB2WS4Q-C4cKwl5j-BOTQeJFL.js +1 -0
  46. package/dist/assets/{gitGraphDiagram-IHSO6WYX-CeZGS4qi-CD-l0vgt.js → gitGraphDiagram-IHSO6WYX-CeZGS4qi-DHXB0o1n.js} +1 -1
  47. package/dist/assets/index-BGaWniBo.js +621 -0
  48. package/dist/assets/index-BT6BPIOw.css +1 -0
  49. package/dist/assets/info-DKCQHKI2-DPUCBYWS-ShPzhVQp.js +1 -0
  50. package/dist/assets/{infoDiagram-FWYZ7A6U-BDt8lBTy-BYSwvgW6.js → infoDiagram-FWYZ7A6U-BDt8lBTy-awMv-sxW.js} +1 -1
  51. package/dist/assets/{ishikawaDiagram-FXEZZL3T-DOHYs_AA-DkznAJGt.js → ishikawaDiagram-FXEZZL3T-DOHYs_AA-BzXkQq1t.js} +1 -1
  52. package/dist/assets/{journeyDiagram-5HDEW3XC-B33IW9yy-CknzrT3m.js → journeyDiagram-5HDEW3XC-B33IW9yy-DrjUh4mD.js} +1 -1
  53. package/dist/assets/{kanban-definition-HUTT4EX6-Bkdm46eX-CY-MchUy.js → kanban-definition-HUTT4EX6-Bkdm46eX-DmJqBJoy.js} +1 -1
  54. package/dist/assets/{lib-B-JYnmBA.js → lib-C86aoJ06.js} +1 -1
  55. package/dist/assets/{line-Dy_Qlcgo-BdzF7qLz.js → line-Dy_Qlcgo-D6NH0gpW.js} +1 -1
  56. package/dist/assets/{marp-BRsT17Gj.js → marp-CmzbEzfr.js} +1 -1
  57. package/dist/assets/{mermaid-parser.core-C1baW7NG-DMZf-3IA.js → mermaid-parser.core-C1baW7NG-D_eQQyvn.js} +2 -2
  58. package/dist/assets/{mermaid.core-C09q4TmN-B_dowtFH.js → mermaid.core-C09q4TmN-DdALYz54.js} +3 -3
  59. package/dist/assets/{mindmap-definition-LN4V7U3C-bfYIhPQ0-Dx9H0q0M.js → mindmap-definition-LN4V7U3C-bfYIhPQ0-B3iIYwg5.js} +1 -1
  60. package/dist/assets/packet-7NZHBO7P-CC7His0F-BzFQ0NEg.js +1 -0
  61. package/dist/assets/{pegDiagram-2B236MQR-CZQOKUMC-B0QBQEzx.js → pegDiagram-2B236MQR-CZQOKUMC-EAFTspRa.js} +1 -1
  62. package/dist/assets/pie-RZYD4A2V-CCrcq2sL-BjklfafI.js +1 -0
  63. package/dist/assets/{pieDiagram-ENE6RG2P-DiVKPdHE-6bFmgSSf.js → pieDiagram-ENE6RG2P-DiVKPdHE-BICSsR8n.js} +1 -1
  64. package/dist/assets/{quadrantDiagram-ABIIQ3AL-CbPY3kXI-DR6UcImk.js → quadrantDiagram-ABIIQ3AL-CbPY3kXI-BUKD475g.js} +1 -1
  65. package/dist/assets/radar-I7S5WNFK-C5TUrpHf-BImJ_3Hw.js +1 -0
  66. package/dist/assets/railroad-3IZDKUUU-CGuuFEd8-8DufSEcC.js +1 -0
  67. package/dist/assets/railroad-abnf-AHOZXSZD-DuoCSFZY-tOK9lWu5.js +1 -0
  68. package/dist/assets/railroad-ebnf-EBAXGLYW-ig-DG9e_-B71K6ylI.js +1 -0
  69. package/dist/assets/railroad-peg-LSFZ7HO6-BkBgpyvu-B2Q89Scx.js +1 -0
  70. package/dist/assets/{railroadDiagram-RFXS5EU6-CFRaQzr0-B13UgpCt.js → railroadDiagram-RFXS5EU6-CFRaQzr0-BJg8769B.js} +1 -1
  71. package/dist/assets/{requirementDiagram-TGXJPOKE-BiIDduje-BnyCbAFy.js → requirementDiagram-TGXJPOKE-BiIDduje-Cy_9du0r.js} +1 -1
  72. package/dist/assets/{sankeyDiagram-HTMAVEWB-DcK87A5Y-DBqEvMS1.js → sankeyDiagram-HTMAVEWB-DcK87A5Y-zE5qwcQu.js} +1 -1
  73. package/dist/assets/{sequenceDiagram-DBY2YBRQ-DgEQYcvc-RMWJvTQk.js → sequenceDiagram-DBY2YBRQ-DgEQYcvc-BO7vUMHm.js} +1 -1
  74. package/dist/assets/{stateDiagram-2N3HPSRC-Bg7EXtW2-DTYEsQki.js → stateDiagram-2N3HPSRC-Bg7EXtW2-zJ5G9TFm.js} +1 -1
  75. package/dist/assets/stateDiagram-v2-6OUMAXLB-BjhArXP_-rvYxDueu.js +1 -0
  76. package/dist/assets/{swimlanes-5IMT3BWC-CKORDKr0-D9FhEzB6.js → swimlanes-5IMT3BWC-CKORDKr0-DEnF_sLu.js} +1 -1
  77. package/dist/assets/swimlanesDiagram-G3AALYLV-CyvIfl1o-xznFuWGK.js +8 -0
  78. package/dist/assets/{timeline-definition-FHXFAJF6-BM3Iky2r-BYeRiXBY.js → timeline-definition-FHXFAJF6-BM3Iky2r-BCfBiXZy.js} +1 -1
  79. package/dist/assets/treeView-QDETBFTQ-CqfT0I1z-g8xUV3lC.js +1 -0
  80. package/dist/assets/treemap-6X3UGDF4-CiJkiGWo-BkEOOysZ.js +1 -0
  81. package/dist/assets/{vennDiagram-L72KCM5P-VNmAhEFP-BjzOgidI.js → vennDiagram-L72KCM5P-VNmAhEFP-CyrK0lQN.js} +1 -1
  82. package/dist/assets/wardley-OPB4EBWU-D1tuVHAV-BEdE88bv.js +1 -0
  83. package/dist/assets/{wardleyDiagram-EHGQE667-BkHQpyFm-DzQER1Jf.js → wardleyDiagram-EHGQE667-BkHQpyFm-JWqoGk70.js} +1 -1
  84. package/dist/assets/{xychartDiagram-FW5EYKEG-Yz-8aLqK-D9KxXZYS.js → xychartDiagram-FW5EYKEG-Yz-8aLqK-S-U-7JZw.js} +1 -1
  85. package/dist/index.html +2 -2
  86. package/package.json +1 -1
  87. package/server/agents/antigravity-mcp.ts +5 -0
  88. package/server/agents/antigravity-session.ts +5 -1
  89. package/server/agents/antigravity-skills.ts +82 -0
  90. package/server/agents/codex-session.ts +16 -2
  91. package/server/agents/git-exclude.ts +32 -10
  92. package/server/agents/grok-session.ts +18 -1
  93. package/server/agents/muse-session.ts +16 -6
  94. package/server/backends/workspaceSetup.ts +15 -0
  95. package/server/config/config-routes.ts +12 -1
  96. package/server/config/cwd-presets.ts +17 -4
  97. package/server/files/pick-file.ts +48 -22
  98. package/server/git/worktree-routes.ts +5 -2
  99. package/server/infra/symlink-guard.ts +27 -0
  100. package/server/infra/tmux.ts +9 -1
  101. package/server/routes/session-routes.ts +21 -12
  102. package/server/routes/ws-routes.ts +229 -102
  103. package/server/session/codex-activity-track.ts +10 -3
  104. package/server/session/codex-activity-watch.ts +30 -0
  105. package/server/session/dir-session.ts +136 -12
  106. package/server/session/pty-spawn.ts +8 -0
  107. package/server/session/reap-idle-sessions.ts +7 -0
  108. package/server/session/registry.ts +40 -1
  109. package/server/session/spawn-antigravity.ts +5 -0
  110. package/server/session/spawn-codex.ts +28 -3
  111. package/server/session/surviving-sessions.ts +2 -0
  112. package/server/session/survivor-agent-guard.ts +106 -0
  113. package/server/session/worktree-session-limit.ts +2 -2
  114. package/server/skills/mulmoterminal-dirs/SKILL.md +3 -1
  115. package/dist/assets/architecture-TIHT7OUA-Cqhmai3f-sj7JkliI.js +0 -1
  116. package/dist/assets/channel-OqG5cGJi-zdxP6MgL.js +0 -1
  117. package/dist/assets/classDiagram-OUVF2IWQ-C6h0nbT3-CqjORMBj.js +0 -1
  118. package/dist/assets/classDiagram-v2-EOCWNBFH-CzsXJ_wA-CqjORMBj.js +0 -1
  119. package/dist/assets/cynefin-VYW2F7L2-DvSvuXnG-hgNrUHK4.js +0 -1
  120. package/dist/assets/eventmodeling-45OFAUF4-jdctDg0T-TG7KUatZ.js +0 -1
  121. package/dist/assets/flowDiagram-23GEKE2U-DK0InIny-qxrjE7ea.js +0 -1
  122. package/dist/assets/gitGraph-TEB2WS4Q-C4cKwl5j-D7MFV63o.js +0 -1
  123. package/dist/assets/index-CJj8AYYF.js +0 -621
  124. package/dist/assets/index-DNLQibYX.css +0 -1
  125. package/dist/assets/info-DKCQHKI2-DPUCBYWS-BxgyIApr.js +0 -1
  126. package/dist/assets/packet-7NZHBO7P-CC7His0F-BDwWs1zX.js +0 -1
  127. package/dist/assets/pie-RZYD4A2V-CCrcq2sL-BUfGnZ_U.js +0 -1
  128. package/dist/assets/radar-I7S5WNFK-C5TUrpHf-xJ223euq.js +0 -1
  129. package/dist/assets/railroad-3IZDKUUU-CGuuFEd8-BjavHk8u.js +0 -1
  130. package/dist/assets/railroad-abnf-AHOZXSZD-DuoCSFZY-DaxGYsAG.js +0 -1
  131. package/dist/assets/railroad-ebnf-EBAXGLYW-ig-DG9e_-BiuEkpVy.js +0 -1
  132. package/dist/assets/railroad-peg-LSFZ7HO6-BkBgpyvu-DjtS9QjD.js +0 -1
  133. package/dist/assets/stateDiagram-v2-6OUMAXLB-BjhArXP_-BwX0TEg2.js +0 -1
  134. package/dist/assets/swimlanesDiagram-G3AALYLV-CyvIfl1o-CdxmBQcP.js +0 -8
  135. package/dist/assets/treeView-QDETBFTQ-CqfT0I1z-s6d8KKbp.js +0 -1
  136. package/dist/assets/treemap-6X3UGDF4-CiJkiGWo-0QbEhU31.js +0 -1
  137. package/dist/assets/wardley-OPB4EBWU-D1tuVHAV-8lAEinVX.js +0 -1
package/README.md CHANGED
@@ -572,7 +572,7 @@ The Settings modal (the gear button) persists per-user UI choices to `~/.mulmote
572
572
 
573
573
  ![The Settings modal — theme, notification sound, PR repos, launch commands, and MCP servers](https://raw.githubusercontent.com/receptron/mulmoterminal/main/docs/guide/images/settings.png)
574
574
 
575
- *Open it from the gear button in the toolbar. Under the title, a **Version** row shows what is running: the version from the shipped `package.json`, plus a `commit <sha>` chip on a git checkout — there the version is only whatever was last released, so the commit is what identifies the build. When something newer exists, the row is followed by the header badge's update notice, command included. Pick a **theme**, set the **terminal font size**, **font** and **scroll speed**, set a custom **attention sound**, list the repos the cross-repo **PRs & Issues** view should aggregate, add **launch commands** for grid cells, register your own **MCP servers**, and turn on the switches for what this app writes on your behalf — **issue work comments**, the **PR clone footer**, the **closing summary**, the **decision digest**, the **dev worklog** — no need to hand-edit the config file. Four settings stay with their skill because a form would be the wrong tool for them (`keymap`, `themes`, `providers`, `buttons`/`chips`); Settings shows what each is doing now and launches that skill. Note that **theme, font size and scroll speed are stored per browser** (they're display preferences, so a phone and a desktop keep their own); the rest live in `~/.mulmoterminal/config.json` and are shared by every client.*
575
+ *Open it from the gear button in the toolbar. Under the title, a **Version** row shows what is running: the version from the shipped `package.json`, plus a `commit <sha>` chip on a git checkout — there the version is only whatever was last released, so the commit is what identifies the build. When something newer exists, the row is followed by the header badge's update notice, command included. Pick a **theme**, set the **terminal font size**, **font** and **scroll speed** (and whether sending **returns to the latest output**), set a custom **attention sound**, list the repos the cross-repo **PRs & Issues** view should aggregate, add **launch commands** for grid cells, register your own **MCP servers**, and turn on the switches for what this app writes on your behalf — **issue work comments**, the **PR clone footer**, the **closing summary**, the **decision digest**, the **dev worklog** — no need to hand-edit the config file. Four settings stay with their skill because a form would be the wrong tool for them (`keymap`, `themes`, `providers`, `buttons`/`chips`); Settings shows what each is doing now and launches that skill. Note that **theme, font size, scroll speed and the return-to-latest switch are stored per browser** (they're display preferences, so a phone and a desktop keep their own); the rest live in `~/.mulmoterminal/config.json` and are shared by every client.*
576
576
 
577
577
  | Field | Meaning |
578
578
  | ------------ | ------- |
@@ -847,7 +847,9 @@ In dev, open the Vite URL; its proxy forwards `/ws`, `/ws/pubsub`, and `/api` to
847
847
 
848
848
  An empty grid cell's launcher sets the **Working directory** by typing, by a preset
849
849
  chip, or with the **📁 folder button** (a native OS folder dialog). The preset chips are
850
- the directories you have launched in; the **workspace** leads them always, labelled
850
+ the directories you have launched in — **worktrees excluded**, since one is a single task's
851
+ branch that is deleted with the task, not a place to launch in again; the
852
+ **workspace** leads them always, labelled
851
853
  **WORKSPACE** and marked with an icon, whether or not you have ever launched there — it is
852
854
  the one directory where a claude or codex session reaches every GUI tool (agy and grok get
853
855
  what the directory registered, there as anywhere — see
@@ -82,6 +82,17 @@ export interface EnterKeyEvent {
82
82
  // bare Enter falls through to xterm's native \r (submit) and Option+Enter to
83
83
  // macOptionIsMeta's ESC+CR (newline). Leaving the bare-Enter path native keeps IME
84
84
  // candidate-confirm and the hottest key untouched in the default configuration.
85
+ // Whether an Enter-family keydown SUBMITS, as opposed to inserting a newline or belonging to an
86
+ // IME. Mode-INDEPENDENT on purpose: the two modes disagree about which bytes carry each meaning,
87
+ // never about the meaning itself (see the note on enterKeyOverride below) — a bare Enter submits
88
+ // in both, Shift/Alt+Enter make a newline in both. Ctrl/Meta+Enter is neither, so it answers no.
89
+ //
90
+ // Separate from `enterKeyOverride` because the caller that needs it is not the one deciding bytes:
91
+ // in "cr" mode a bare Enter is handled natively by xterm and the override returns null, so a
92
+ // caller reading that as "not a submit" would miss the most common submit there is (#1546).
93
+ export const enterSubmits = (e: EnterKeyEvent): boolean =>
94
+ e.type === "keydown" && e.key === "Enter" && !e.isComposing && !e.shiftKey && !e.altKey && !e.ctrlKey && !e.metaKey;
95
+
85
96
  export const enterKeyOverride = (mode: TerminalSubmitMode, e: EnterKeyEvent): string | null => {
86
97
  if (e.type !== "keydown" || e.key !== "Enter") return null;
87
98
  // IME composition (Japanese and other CJK input): this Enter confirms a candidate — it
@@ -0,0 +1,62 @@
1
+ // What a managed worktree's path says about it, for the two sides that both have to ask.
2
+ //
3
+ // In `common/` because the launch form and `mulmoterminal init` each decide from it — the browser
4
+ // records the directory a cell launched in, the CLI seeds the same list from Claude's history — and
5
+ // a rule mirrored into `src/` and `server/` is a rule that drifts.
6
+
7
+ import { dirPathKey } from "./dirPathKey.js";
8
+
9
+ // A managed worktree lives at <root>/<repo>-<8hex>/<task> (see the server's `worktreesRoot`).
10
+ const MANAGED_DIR = /^(.+)-[0-9a-f]{8}$/;
11
+
12
+ /**
13
+ * The repo and task to CALL a worktree path, for a header that would otherwise show a long managed
14
+ * path. Shape alone, with no idea where the managed root is — which is why it is only ever used to
15
+ * name something. Getting it wrong shows a label; it decides nothing.
16
+ */
17
+ export function worktreeLabel(cwd: string | null): { repo: string; task: string } | null {
18
+ if (!cwd) return null;
19
+ const parts = cwd.split(/[/\\]/).filter(Boolean);
20
+ const i = parts.indexOf("worktrees");
21
+ const dir = parts[i + 1];
22
+ const task = parts[i + 2];
23
+ if (i < 0 || !dir || !task) return null;
24
+ const m = MANAGED_DIR.exec(dir);
25
+ return m?.[1] === undefined ? null : { repo: m[1], task };
26
+ }
27
+
28
+ /**
29
+ * Whether this directory is one WE created — asked before recording it as a working-directory
30
+ * preset, which a worktree must never become: it is one branch for one task, deleted when the task
31
+ * is done, and nothing prunes the chip when the directory goes (the close button is the only
32
+ * remover), so the row filled with paths that no longer exist.
33
+ *
34
+ * Anchored on the managed ROOT, not on the shape above. Shape alone matches any
35
+ * `…/worktrees/<name>-<8hex>/<task>` a person or another tool happens to have, and the cost here is
36
+ * not a wrong label — it is a real working directory silently missing from the launcher (Codex on
37
+ * #1543). The root is the same authority the server's own `worktreeTask` uses; the browser is told
38
+ * it by `/api/config`.
39
+ *
40
+ * **An unknown root answers `false`** — record the directory. Before `/api/config` resolves there is
41
+ * nothing to compare against, and of the two ways to be wrong, an extra chip the user can delete
42
+ * beats a directory that quietly never appears.
43
+ *
44
+ * Lexical containment (`dirPathKey`), because the browser has no filesystem: it folds both
45
+ * separators, `.`/`..` and a trailing slash, but not a symlink or Windows' case-insensitivity.
46
+ * Both values come from the same server, so they agree in practice — and a spelling it cannot fold
47
+ * falls back to "not ours", which is the safe direction above.
48
+ */
49
+ export function isManagedWorktreePath(cwd: string | null | undefined, worktreesRoot: string | null | undefined): boolean {
50
+ if (!cwd || !worktreesRoot) return false;
51
+ const rootKey = dirPathKey(worktreesRoot);
52
+ if (rootKey === "") return false;
53
+ const prefix = rootKey.endsWith("/") ? rootKey : `${rootKey}/`;
54
+ const key = dirPathKey(cwd);
55
+ if (!key.startsWith(prefix)) return false;
56
+ const below = key.slice(prefix.length).split("/").filter(Boolean);
57
+ // `<repo>-<hash>/<task>` at least, and the first segment has to be a name WE mint. The root
58
+ // holds worktrees but is not one, the per-repo directory above a task is not one either, and a
59
+ // directory someone put under the root by hand carries no hash — all three are places a person
60
+ // could reasonably be working, and dropping one loses it from the launcher (Codex on #1543).
61
+ return below.length >= 2 && MANAGED_DIR.test(below[0] ?? "");
62
+ }
@@ -1 +1 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-Bdt8pFDJ-DsF7k-Jl.js";import{f as t}from"./src-CvsWqFln-Tc7ZSrRz.js";import{_ as n,g as r}from"./mermaid-parser.core-C1baW7NG-DMZf-3IA.js";import"./chunk-WYO6CB5R-nS6zX9ct-KrP8SxMs.js";import"./chunk-VAUOI2AC-BKx35BBi-E0yAewsj.js";import{n as i,r as a,t as o}from"./chunk-MOJQB5TN-CorQ_Pl1-mXFOYgnO.js";import{t as s}from"./chunk-JWPE2WC7-BQ3zXr2k-DSd3Ct95.js";var c=r().RailroadAbnf.parser.LangiumParser,l=e(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=e(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=e(e=>{if(e.includes(`*`)){let[t,n]=e.split(`*`);return{min:t?parseInt(t,10):0,max:n?parseInt(n,10):1/0}}let t=parseInt(e,10);return{min:t,max:t}},`parseRepeat`),f=e(e=>{let t=p(e.primary);if(!e.repeat)return t;let{min:n,max:r}=d(e.repeat);return n===0&&r===1?{type:`optional`,element:t}:{type:`repetition`,element:t,min:n,max:r}},`transformElement`),p=e(e=>{switch(e.$type){case`AbnfStringLiteral`:return{type:`terminal`,value:e.value};case`AbnfNumVal`:return{type:`terminal`,value:e.value};case`AbnfRuleName`:return{type:`nonterminal`,name:e.name};case`AbnfGroup`:return l(e.element);case`AbnfOptionalGroup`:return{type:`optional`,element:l(e.element)};default:throw Error(`Unsupported ABNF primary node: ${e.$type}`)}},`transformPrimary`),m=e(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=e(e=>{s(e,a),e.title&&a.setTitle(e.title),e.rules.map(e=>a.addRule(m(e)))},`populateDb`),g={parser:{parse:e(e=>{a.clear(),t.debug(`[ABNF Parser] Starting Langium parse`);let r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new n(r);let i=r.value;t.debug(`[ABNF Parser] Parsed rules:`,i.rules.length),h(i),t.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:a}},db:a,renderer:o,styles:i};export{g as diagram};
1
+ import{n as e}from"./chunk-Y2CYZVJY-Bdt8pFDJ-DsF7k-Jl.js";import{f as t}from"./src-CvsWqFln-Tc7ZSrRz.js";import{_ as n,g as r}from"./mermaid-parser.core-C1baW7NG-D_eQQyvn.js";import"./chunk-WYO6CB5R-nS6zX9ct-n_cQEuya.js";import"./chunk-VAUOI2AC-BKx35BBi-C6TYZmsd.js";import{n as i,r as a,t as o}from"./chunk-MOJQB5TN-CorQ_Pl1-BRlwRZvQ.js";import{t as s}from"./chunk-JWPE2WC7-BQ3zXr2k-DSd3Ct95.js";var c=r().RailroadAbnf.parser.LangiumParser,l=e(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=e(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=e(e=>{if(e.includes(`*`)){let[t,n]=e.split(`*`);return{min:t?parseInt(t,10):0,max:n?parseInt(n,10):1/0}}let t=parseInt(e,10);return{min:t,max:t}},`parseRepeat`),f=e(e=>{let t=p(e.primary);if(!e.repeat)return t;let{min:n,max:r}=d(e.repeat);return n===0&&r===1?{type:`optional`,element:t}:{type:`repetition`,element:t,min:n,max:r}},`transformElement`),p=e(e=>{switch(e.$type){case`AbnfStringLiteral`:return{type:`terminal`,value:e.value};case`AbnfNumVal`:return{type:`terminal`,value:e.value};case`AbnfRuleName`:return{type:`nonterminal`,name:e.name};case`AbnfGroup`:return l(e.element);case`AbnfOptionalGroup`:return{type:`optional`,element:l(e.element)};default:throw Error(`Unsupported ABNF primary node: ${e.$type}`)}},`transformPrimary`),m=e(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=e(e=>{s(e,a),e.title&&a.setTitle(e.title),e.rules.map(e=>a.addRule(m(e)))},`populateDb`),g={parser:{parse:e(e=>{a.clear(),t.debug(`[ABNF Parser] Starting Langium parse`);let r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new n(r);let i=r.value;t.debug(`[ABNF Parser] Parsed rules:`,i.rules.length),h(i),t.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:a}},db:a,renderer:o,styles:i};export{g as diagram};
@@ -0,0 +1 @@
1
+ import{f as e}from"./mermaid-parser.core-C1baW7NG-D_eQQyvn.js";export{e as createArchitectureServices};