mulmoterminal 11.6.0 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -17
- package/bin/child-shutdown.d.ts +23 -0
- package/bin/child-shutdown.js +83 -0
- package/bin/mulmoterminal.js +1 -38
- package/bin/server-supervision.js +8 -7
- package/bin/stop.d.ts +6 -0
- package/bin/stop.js +46 -14
- package/common/headerChips.ts +1 -1
- package/dist/assets/{Notation-ntjjL2Db-TxtM9R06.js → Notation-ntjjL2Db-CPJ4YLXx.js} +1 -1
- package/dist/assets/{abnfDiagram-WEYOIA3C-CW7UReit.js → abnfDiagram-WEYOIA3C-7PXC5kiJ.js} +1 -1
- package/dist/assets/{architecture-WOLXFQ4H-DnhzK-BO.js → architecture-WOLXFQ4H-CRuEA57G.js} +1 -1
- package/dist/assets/{architectureDiagram-ZHVYKT53-DwW6p9NO.js → architectureDiagram-ZHVYKT53-BSFE1omc.js} +1 -1
- package/dist/assets/{blockDiagram-RJAE7QA3-B4cnNAXV.js → blockDiagram-RJAE7QA3-Cp_oClBF.js} +1 -1
- package/dist/assets/{c4Diagram-XDPPPE54-BLDuFPiK.js → c4Diagram-XDPPPE54-Dcw-zxJG.js} +1 -1
- package/dist/assets/channel-kAP9HD8l.js +1 -0
- package/dist/assets/{chunk-2E7WHVMD-COzpGUuX.js → chunk-2E7WHVMD-DGXHSAmr.js} +1 -1
- package/dist/assets/{chunk-4EMNKR2T-COagP44l.js → chunk-4EMNKR2T-aae6QE9-.js} +1 -1
- package/dist/assets/{chunk-55XCU76K-BwpQkZ5k.js → chunk-55XCU76K-PSHZpzAZ.js} +1 -1
- package/dist/assets/{chunk-7S6XSTFO-CZF3qjFc.js → chunk-7S6XSTFO-ErXUg2oi.js} +1 -1
- package/dist/assets/{chunk-AQDTSKZB-Bm-vjM5u.js → chunk-AQDTSKZB-DwroPBul.js} +1 -1
- package/dist/assets/{chunk-DSNLSHJZ-YcOasFmH.js → chunk-DSNLSHJZ-DQDFfuVb.js} +1 -1
- package/dist/assets/{chunk-HAGFOTED-D6vxFPZ3.js → chunk-HAGFOTED-Bpr3L93s.js} +1 -1
- package/dist/assets/{chunk-HNE4Q36P-DIAch2RD.js → chunk-HNE4Q36P-DcqGZZfI.js} +1 -1
- package/dist/assets/{chunk-NQOKRVIF-BTlr1l9u.js → chunk-NQOKRVIF-BVnFcqX0.js} +1 -1
- package/dist/assets/{chunk-UHW7PFBP-a5V_fns_.js → chunk-UHW7PFBP-DPvcJYDl.js} +1 -1
- package/dist/assets/{chunk-VQ5W62QI-B_-Dn7AD.js → chunk-VQ5W62QI-DxRF0__y.js} +1 -1
- package/dist/assets/{chunk-WQQL4CDK-D0dDRZfk.js → chunk-WQQL4CDK-DOUQP1nN.js} +1 -1
- package/dist/assets/{chunk-YZO67HFG-CocJKVca.js → chunk-YZO67HFG-DF6qPqMW.js} +1 -1
- package/dist/assets/{chunk-ZAUX2LTX-DX9XJqex.js → chunk-ZAUX2LTX-DT0h0f6h.js} +1 -1
- package/dist/assets/{chunk-ZCHMQSOR-C74IWK5c.js → chunk-ZCHMQSOR-DjiTCMui.js} +1 -1
- package/dist/assets/{classDiagram-v2-4MYWR3UA-DMWDP1qF.js → classDiagram-v2-4MYWR3UA-ij-um1x3.js} +1 -1
- package/dist/assets/{cynefin-EF2NZ3EQ-BKATBYos.js → cynefin-EF2NZ3EQ-CJlHbnrM.js} +1 -1
- package/dist/assets/{cynefinDiagram-WF24UDRP-CUiJTfIe.js → cynefinDiagram-WF24UDRP-04ydHw8z.js} +1 -1
- package/dist/assets/{dagre-NK4GIZVX-XkkngWBm.js → dagre-NK4GIZVX-DrOThbG9.js} +1 -1
- package/dist/assets/{diagram-CBK3MWTC-BkhwcjKi.js → diagram-CBK3MWTC-g4jeN2-Y.js} +1 -1
- package/dist/assets/{diagram-I5XIIV2D-DOR4ZRpQ.js → diagram-I5XIIV2D-bvl3Y6jm.js} +1 -1
- package/dist/assets/{diagram-ODIL2UCW-BMr2ABkn.js → diagram-ODIL2UCW-BYLB1lfa.js} +1 -1
- package/dist/assets/{diagram-PFBEJUXE-Ofm5PSoc.js → diagram-PFBEJUXE-BELACyab.js} +1 -1
- package/dist/assets/{diagram-RJA3I4VV-B0S15Lus.js → diagram-RJA3I4VV-amwK4F_Y.js} +1 -1
- package/dist/assets/{diagram-TYUNFSNR-2cJ8KF4k.js → diagram-TYUNFSNR-B3RsjYYA.js} +1 -1
- package/dist/assets/{dist-Cxa1ZSwB.js → dist-BM5gijNm.js} +1 -1
- package/dist/assets/{dist-D_YbgYR_.js → dist-BZyIjsqk.js} +1 -1
- package/dist/assets/{dist-D19RGUD4.js → dist-BfxQsFHv.js} +1 -1
- package/dist/assets/{dist-BEX87kB_.js → dist-Byxfb22z.js} +1 -1
- package/dist/assets/{dist-BB2-_aP1.js → dist-Cb2MMZ9g.js} +1 -1
- package/dist/assets/dist-IhiypC99.js +2 -0
- package/dist/assets/{ebnfDiagram-V4P3TTPT-CeoSSkCw.js → ebnfDiagram-V4P3TTPT-CzdujhfJ.js} +1 -1
- package/dist/assets/{echarts-gl-B96vw339.js → echarts-gl-BsUYWjjx.js} +1 -1
- package/dist/assets/{elk-QONTBCTQ-BojkGuFF.js → elk-QONTBCTQ-Dw45DgCY.js} +1 -1
- package/dist/assets/{emscripten-module-Q67P5WYC-BPqYeyBm.js → emscripten-module-Q67P5WYC-BiQEiLoH.js} +1 -1
- package/dist/assets/{erDiagram-KYQIGQAA-B7tup7CH.js → erDiagram-KYQIGQAA-DLdU1JKj.js} +1 -1
- package/dist/assets/{eventmodeling-K75KTNOO-BXarDxeW.js → eventmodeling-K75KTNOO-BVloGFgK.js} +1 -1
- package/dist/assets/flowDiagram-IUGLLWBU-DoZmm7K4.js +1 -0
- package/dist/assets/{ganttDiagram-R7GPNTJY-CJifbfz4.js → ganttDiagram-R7GPNTJY-C_9J67zg.js} +1 -1
- package/dist/assets/{gitGraph-VSP46ZUC-D1LbZDkE.js → gitGraph-VSP46ZUC-DiKucnRn.js} +1 -1
- package/dist/assets/{gitGraphDiagram-PDYL7XHY-B_PwhjjE.js → gitGraphDiagram-PDYL7XHY-BehHGyfN.js} +1 -1
- package/dist/assets/{index-qAA_W60w.js → index-D-mlIyCo.js} +600 -600
- package/dist/assets/{index-CyknXkqO.css → index-DXKgt5mT.css} +1 -1
- package/dist/assets/{info-OHQRW6UA-8ZR6VJeB.js → info-OHQRW6UA-CqWK_OUW.js} +1 -1
- package/dist/assets/{infoDiagram-MVDRKAX5-DuLT5SuR.js → infoDiagram-MVDRKAX5-CNlR0r46.js} +1 -1
- package/dist/assets/{ishikawaDiagram-HPEHV2GE-D_UBaxOt.js → ishikawaDiagram-HPEHV2GE-2D4crxoH.js} +1 -1
- package/dist/assets/{journeyDiagram-BOSHW7O7-Br28cJqJ.js → journeyDiagram-BOSHW7O7-BT1iMBU_.js} +1 -1
- package/dist/assets/{kanban-definition-FNSA4HC5-DuOxBWBZ.js → kanban-definition-FNSA4HC5-LU1OeBcP.js} +1 -1
- package/dist/assets/{line-ndfYPAWy.js → line-Dqz-w2iq.js} +1 -1
- package/dist/assets/{manifold-BM9Hnepl.js → manifold-DSP2_pga.js} +1 -1
- package/dist/assets/{mermaid-parser.core-B0YJNEXg.js → mermaid-parser.core-CVdVf9tB.js} +3 -3
- package/dist/assets/{mermaid.core-6sEjb7D3.js → mermaid.core-CSNDpz3l.js} +4 -4
- package/dist/assets/{mindmap-definition-6OY57UG3-BlbRBQeg.js → mindmap-definition-6OY57UG3-BXxDEkzE.js} +1 -1
- package/dist/assets/{packet-JDAUHWVQ-BRRHBJ5A.js → packet-JDAUHWVQ-BHxCn-2Q.js} +1 -1
- package/dist/assets/{pegDiagram-ECIUJNBX-BUdk7aWK.js → pegDiagram-ECIUJNBX-CUY1kVfN.js} +1 -1
- package/dist/assets/{pie-XZMESJXO-D2mirfQo.js → pie-XZMESJXO-BJ4qtbL-.js} +1 -1
- package/dist/assets/{pieDiagram-GNMPY74T-nM0iOQ8G.js → pieDiagram-GNMPY74T-ICXsqYA8.js} +1 -1
- package/dist/assets/{quadrantDiagram-D57K4MC3-exKy7WcE.js → quadrantDiagram-D57K4MC3-Cnw0xQGO.js} +1 -1
- package/dist/assets/{radar-ABXABTNO-DCWumfTz.js → radar-ABXABTNO-B8xmA4bj.js} +1 -1
- package/dist/assets/{railroad-I3PHUGI6-D9AwOJKe.js → railroad-I3PHUGI6-Cr99gD53.js} +1 -1
- package/dist/assets/{railroad-abnf-LNEFI6M7-DUScRhrf.js → railroad-abnf-LNEFI6M7-BCow8xYC.js} +1 -1
- package/dist/assets/{railroad-ebnf-DWYD2UWJ-DrP_DCv4.js → railroad-ebnf-DWYD2UWJ-B8SGkncp.js} +1 -1
- package/dist/assets/{railroad-peg-JR7BVNR7-CRVM5c4R.js → railroad-peg-JR7BVNR7-Dh4DmH_d.js} +1 -1
- package/dist/assets/{railroadDiagram-Y72NRBL7-CUKg-aoy.js → railroadDiagram-Y72NRBL7-oezdWttj.js} +1 -1
- package/dist/assets/{requirementDiagram-EQYSW5RA-meHCD3Cz.js → requirementDiagram-EQYSW5RA-mfH3i6yk.js} +1 -1
- package/dist/assets/{sankeyDiagram-SY24JHO5-n_9nmKk3.js → sankeyDiagram-SY24JHO5-87pVFkxh.js} +1 -1
- package/dist/assets/{sequenceDiagram-BLEHNHQU-CT8SyI0Y.js → sequenceDiagram-BLEHNHQU-D1zK19C7.js} +1 -1
- package/dist/assets/{stateDiagram-v2-A6IESKWZ-BxZ2RH73.js → stateDiagram-v2-A6IESKWZ-Bjja5B57.js} +1 -1
- package/dist/assets/{swimlanes-B3ENRKFQ-BTViD6zV.js → swimlanes-B3ENRKFQ-2l3frAQA.js} +1 -1
- package/dist/assets/swimlanesDiagram-AYQRV4AK-i3g4Maas.js +8 -0
- package/dist/assets/{timeline-definition-JXYKGLGB-IQBfJGeW.js → timeline-definition-JXYKGLGB-D_tlu75D.js} +1 -1
- package/dist/assets/{treeView-D4JQ5SDB-BisIwVJN.js → treeView-D4JQ5SDB-DgLGL6oc.js} +1 -1
- package/dist/assets/{treemap-SAJKECNS-C5QUphns.js → treemap-SAJKECNS-DK13ZPUI.js} +1 -1
- package/dist/assets/{usecaseDiagram-WPOLBNNX-B807VVis.js → usecaseDiagram-WPOLBNNX-Bx2xtgAR.js} +1 -1
- package/dist/assets/{vennDiagram-Q3Y3IDCW-BRlhWHgn.js → vennDiagram-Q3Y3IDCW--_vaXgIe.js} +1 -1
- package/dist/assets/{wardley-7MLQ67FV-CvYu-Y6M.js → wardley-7MLQ67FV-BX8gU4G9.js} +1 -1
- package/dist/assets/{wardleyDiagram-IVAIDKWA-CT_6TH4T.js → wardleyDiagram-IVAIDKWA-BWLgpLU3.js} +1 -1
- package/dist/assets/{xychartDiagram-4URNHDU4-BRJrZcyp.js → xychartDiagram-4URNHDU4-D4LPMf3j.js} +1 -1
- package/dist/index.html +2 -2
- package/docs/ChangeLog.md +60 -0
- package/docs/facts.json +1 -1
- package/docs/guide/en/config.md +23 -3
- package/docs/guide/en/feature-list.md +8 -1
- package/docs/guide/en/features.md +3 -1
- package/docs/guide/en/header-reference.md +2 -1
- package/docs/guide/en/index.md +3 -2
- package/docs/guide/en/v11.7.0.md +128 -0
- package/docs/guide/en/v12.0.0.md +117 -0
- package/docs/guide/ja/config.md +23 -3
- package/docs/guide/ja/feature-list.md +8 -1
- package/docs/guide/ja/features.md +3 -1
- package/docs/guide/ja/header-reference.md +2 -1
- package/docs/guide/ja/index.md +3 -2
- package/docs/guide/ja/v11.7.0.md +124 -0
- package/docs/guide/ja/v12.0.0.md +113 -0
- package/package.json +2 -2
- package/server/agents/claude/claude-peer-registry.ts +172 -0
- package/server/agents/claude/claude-peers.ts +132 -0
- package/server/config/app-config.ts +10 -0
- package/server/config/config-schema.ts +1 -1
- package/server/files/browseEntry.ts +21 -0
- package/server/files/files-browse.ts +78 -43
- package/server/files/renderedDoc.ts +24 -6
- package/server/files/renderedTabTools.ts +314 -0
- package/server/infra/process/psmux.ts +0 -6
- package/server/infra/process/pty-env.ts +46 -6
- package/server/infra/process/shutdown.ts +29 -11
- package/server/infra/process/tmux.ts +4 -17
- package/server/routes/session-routes.ts +5 -0
- package/server/routes/shutdown-routes.ts +6 -5
- package/server/session/pty/pty-spawn.ts +2 -4
- package/server/skills/mulmoterminal-header/SKILL.md +4 -1
- package/server/skills/mulmoterminal-keys/SKILL.md +22 -0
- package/dist/assets/channel-CyfdtUj-.js +0 -1
- package/dist/assets/dist-BVN0UWGk.js +0 -2
- package/dist/assets/flowDiagram-IUGLLWBU-BYupIXZr.js +0 -1
- package/dist/assets/swimlanesDiagram-AYQRV4AK-CsuNl-wv.js +0 -8
package/README.md
CHANGED
|
@@ -173,22 +173,33 @@ copying from a web page usually does, so that pasting text keeps working.
|
|
|
173
173
|
|
|
174
174
|
<a id="clicking-a-file-path"></a>
|
|
175
175
|
|
|
176
|
-
**Clicking a file path** — the other direction. A path an agent *prints* becomes a link
|
|
176
|
+
**Clicking a file path** — the other direction. A path an agent *prints* becomes a link (in a
|
|
177
|
+
Windows session that includes `\`-separated ones such as `.claude\notes\a.md` and `C:\work\a.ts`; a path
|
|
178
|
+
holding a space in a folder name is linked whole when it sits inside `"…"`, `'…'`, a backtick pair,
|
|
179
|
+
`(…)`, `(…)` or `「…」`, as in `Read(/Users/me/My Docs/a.md)`), and
|
|
177
180
|
**what it opens is chosen by its extension**, so each kind arrives as the thing it is rather
|
|
178
181
|
than as bytes:
|
|
179
182
|
|
|
180
183
|
| A clicked … | opens as |
|
|
181
184
|
|---|---|
|
|
182
|
-
| `.md` `.markdown` | **rendered** markdown in a new tab — the same sandboxed `…/md` HTML the Files preview renders,
|
|
183
|
-
| `.json` | **indented** in a new tab (Chrome and Safari otherwise show one long line) |
|
|
184
|
-
| `.csv` `.tsv` | a **table** in a new tab, with a sticky header that scrolls inside its own box |
|
|
185
|
+
| `.md` `.markdown` | **rendered** markdown in a new tab — the same sandboxed `…/md` HTML the Files preview renders, with a **toolbar** at the top that switches between the preview and the file's **source** and has a copy button for each (the source as it is; the preview as text and as HTML, so a rich editor keeps the headings). That toolbar is the one script the tab runs, admitted by a per-response nonce the way the pane's scroll reporter is, and nothing in the file runs; the two scripts the preview needs are still absent (the one that reports where you are reading, and the one that draws mermaid diagrams — so a mermaid fence stays a code block here). It follows your system light/dark setting and your browser's language, since under the sandbox it can't ask the app which theme or language is on |
|
|
186
|
+
| `.json` | **indented** in a new tab (Chrome and Safari otherwise show one long line), with the same toolbar: switch to the file as it is, copy either |
|
|
187
|
+
| `.csv` `.tsv` | a **table** in a new tab, with a sticky header that scrolls inside its own box, and the same toolbar: switch to the file as it is, copy either |
|
|
185
188
|
| source, config, logs, and `.txt` — 46 extensions | the app's own **Files** view (`/files?path=`), where CodeMirror highlights it, the tree is right there, and it can be edited |
|
|
186
189
|
| `.html` `.htm` | the **rendered page** in a new tab, under the same sandboxed policy as the Files pane's Preview: its scripts run at an opaque origin with no fetch or XHR (so they cannot reach the app or its API), and an image beside it loads by its relative path (a relative stylesheet or script does not). The raw route answers `.html` as plain text, so opening one there showed its source |
|
|
187
190
|
| images, PDF, SVG, video, audio | raw bytes in a new tab, which the browser renders better than an editor would |
|
|
188
191
|
| everything else — `.xlsx`, `.docx`, `.zip`, a `Makefile` | the app's own **Files** view. A tab cannot display these, so opening one there is not a view — it is a download starting with no warning. The pane names the file and offers **Open in OS**, which hands it to the application that owns it (Excel for an `.xlsx`) |
|
|
189
192
|
|
|
193
|
+
The same tab is one button away from the Files pane: on a Markdown, JSON or CSV/TSV file, the header's
|
|
194
|
+
open-in-new button opens that document, toolbar included, in a tab of its own.
|
|
195
|
+
|
|
190
196
|
**A path outside the session's working directory opens too** — absolute, `~/…`, or `../` climbing out.
|
|
191
|
-
Markdown, JSON, tables and source open
|
|
197
|
+
Markdown, JSON, tables and source open **in the Files pane on their own**: the tree stays on the cell's
|
|
198
|
+
directory and the file has no row in it, an arrow mark before its name says it is outside (hover for the
|
|
199
|
+
path), and it is read, previewed and saved against its own directory with the same conditional save as
|
|
200
|
+
any other file. History and Changes are not offered for it, and a link in its Preview is not followed.
|
|
201
|
+
With no pane to take the click, they open against the file's own directory in a tab or the Files view
|
|
202
|
+
as before. An HTML page, an image, a PDF,
|
|
192
203
|
an SVG, a video or an audio file opens in a new tab through a **one-file link**: the app asks the server
|
|
193
204
|
for it with a same-origin POST, and only that file is served under it — not its directory, and not the
|
|
194
205
|
image an HTML page links beside itself. The link lasts until the server restarts (or until many newer links push it out); seeking a video works.
|
|
@@ -203,12 +214,14 @@ to and simply opens as itself. A route that renders the file in a new tab (`.md`
|
|
|
203
214
|
keyboard stays in the terminal; the full-screen Files view, with no terminal beside it,
|
|
204
215
|
puts it in the editor. (ESLint's default output puts the path on a line of its own, with no line number to follow.)
|
|
205
216
|
|
|
206
|
-
**
|
|
217
|
+
**A right-click on the path opens a menu** instead of the browser's: open it in the pane (what a plain click does), open it in a **new tab** (the rendered document for Markdown, JSON and tables, the Files page for source, the one-file link for a picture or a PDF outside the cell), open it in the **Files view**, or **copy the path** as an absolute path, ready for a prompt or an issue. A right-click only opens the menu; it no longer also opens the file the way a click does (it used to, under the browser's menu). Off a link the right-click is the browser's as before. Cmd/Ctrl+click still opens a new Files tab.
|
|
218
|
+
|
|
219
|
+
**The [Files pane](#files-view-browse--edit) beside the terminal takes the click first** — beside an enlarged cell, and on the tiled grid too, where the pane opens beside the tile that printed the path, or moves to it, the way that tile's menu would open it (`fileLinkOpensPane`, on by default; `false` keeps a tiled-grid click on the routes above unless a pane is already beside that tile) — every
|
|
207
220
|
row above, since the pane is the same editor with a Preview for Markdown, HTML and SVG, shows an
|
|
208
221
|
image as a picture and a PDF in a frame, and plays a video or an audio file with the browser's own
|
|
209
222
|
controls (seeking included, whatever the file's size). The file opens *beside* the terminal
|
|
210
223
|
that printed it, and the pane opens itself if it was closed. It declines, leaving the routing
|
|
211
|
-
above untouched, when
|
|
224
|
+
above untouched, when `fileLinkOpensPane` is off on the tiled grid and no pane is beside the tiles, or when the path is not
|
|
212
225
|
under the directory of the cell the pane belongs to (the pane cannot walk above its root). A file too large to edit as text still offers **Open in OS**.
|
|
213
226
|
|
|
214
227
|
Highlighting in the Files view covers the JS/TS family, JSON and Markdown (the modes
|
|
@@ -688,9 +701,10 @@ there is no terminal to start it again in. A stop you asked for is still a stop:
|
|
|
688
701
|
managed to bind is not restarted either — the reason it printed is the answer, and
|
|
689
702
|
retrying would bury it. Repeated failures give up rather than respawn forever.
|
|
690
703
|
|
|
691
|
-
**Not on Windows**, where it is not yet possible: Node has no real signals there, so
|
|
692
|
-
|
|
693
|
-
a crash. Windows keeps the old behaviour — the launcher ends when its
|
|
704
|
+
**Not on Windows**, where it is not yet possible: Node has no real signals there, so a
|
|
705
|
+
`taskkill` (or a `stop` the server did not answer) terminates it outright, and the launcher
|
|
706
|
+
cannot tell that from a crash. Windows keeps the old behaviour — the launcher ends when its
|
|
707
|
+
server does.
|
|
694
708
|
|
|
695
709
|
**No tmux? No problem** — terminals fall back to plain (non-persistent) PTYs, exactly as
|
|
696
710
|
before. An explicit close (a cell's ✕) ends the tmux session; a machine reboot does not
|
|
@@ -738,8 +752,8 @@ What MulmoTerminal does differently behind psmux, and only there:
|
|
|
738
752
|
after it is not taken into it. `PSMUX_VT_INPUT=0` in the server's environment turns this off;
|
|
739
753
|
- counts emoji two cells wide in the browser (Unicode 11), as Claude Code and psmux do — otherwise
|
|
740
754
|
each emoji shifts the rest of its row by one column;
|
|
741
|
-
- keeps Volta's `_VOLTA_TOOL_RECURSION` out of
|
|
742
|
-
Volta's shim again;
|
|
755
|
+
- keeps Volta's `_VOLTA_TOOL_RECURSION` out of every cell's environment (psmux and real tmux alike), so
|
|
756
|
+
`node` in a cell resolves through Volta's shim again;
|
|
743
757
|
- turns psmux's warm pool off (`set -g warm off`, psmux 3.3.1+), in new servers and in the ones
|
|
744
758
|
already running. Every cell starts with `-e`, which never claims a spare shell, so the spares
|
|
745
759
|
only held memory and were restarted on every resize;
|
|
@@ -873,7 +887,7 @@ The Settings modal (the gear button) persists per-user UI choices to `~/.mulmote
|
|
|
873
887
|
| `quickCommands` | `{ label, text, agents? }` phrases the **phone** offers as chips on a session's terminal view. Tapping one puts `text` in the input box; it is not sent until you press send. `agents` scopes a chip to session kinds — any of `SESSION_AGENTS` (`"claude"`, `"codex"`, `"antigravity"`, `"grok"`, `"muse"`, `"copilot"`, `"cursor"`, `"shell"`); omit it to offer the chip everywhere. Empty by default. |
|
|
874
888
|
| `userMcpServers` | `{ id, url }` HTTP MCP servers merged into the `--mcp-config` of the **Claude** sessions that carry the full GUI MCP (codex is handed the GUI server alone, `codexGuiMcpServers`) — a cell whose working directory is the **workspace**, and a session the server starts itself (the phone, a scheduled task) unless it asks for a grid cell's shape, as an issue's seed session does (`issueSpawnOptions`). A cell in a project directory does not get this merge; the MCP config the user wrote is read either way. Takes effect on the next session. |
|
|
875
889
|
| `buttons` | Header action buttons — see [Header buttons](#header-buttons). Omit to keep the defaults; set to replace them. |
|
|
876
|
-
| `chips` | Header info chips (`dir` / `git` / `work` / `diff` / `ctx` / `usage` / `status` / `tools` / `env`, or custom text). `env` shows what this working tree was reserved by [`worktreeEnv`](#per-directory-settings-projectmulmoterminaljson) (`:3010`, clickable) and draws nothing where none is declared. Omit to keep the default set; `[]` hides all built-ins. `work` shows which PR / issue the cell is on (`#977 → #966`) and clears itself when the PR merges — see the [Configuration guide](https://receptron.github.io/mulmoterminal/guide/en/config.html#work-chip). |
|
|
890
|
+
| `chips` | Header info chips (`dir` / `git` / `work` / `diff` / `ctx` / `usage` / `status` / `tools` / `env` / `peer`, or custom text). `peer` is the name the other Claude Code sessions on this machine message this one by (`myrepo-66`, what their `ListAgents` lists), as an icon that copies it; it draws nothing on a cell that is not a Claude session. `env` shows what this working tree was reserved by [`worktreeEnv`](#per-directory-settings-projectmulmoterminaljson) (`:3010`, clickable) and draws nothing where none is declared. Omit to keep the default set; `[]` hides all built-ins. `work` shows which PR / issue the cell is on (`#977 → #966`) and clears itself when the PR merges — see the [Configuration guide](https://receptron.github.io/mulmoterminal/guide/en/config.html#work-chip). |
|
|
877
891
|
| `pushEnabled` | `true` to send a **Web Push** to your registered devices. Off by default; only sends while the **RemoteHost** channel is connected (see below). The master switch — `pushKinds` picks which moments. |
|
|
878
892
|
| `pushKinds` | Which moments push: `"finished"` (a turn ended, ✅) and/or `"waiting"` (the agent stopped to ask — a permission prompt or a question, ❓, **once per prompt**). Omit to keep both; `[]` for none. A kind added in a later version stays off until you tick it. |
|
|
879
893
|
| `worklogEnabled` | `true` to run the built-in **dev worklog** batch (see below). Off by default (each run spawns an LLM session, so it costs tokens). Editable in Settings → **Sessions and background tasks**. |
|
|
@@ -883,6 +897,7 @@ The Settings modal (the gear button) persists per-user UI choices to `~/.mulmote
|
|
|
883
897
|
| `tmuxPrefix` | The prefix key of the dedicated tmux server: `"none"` (default — every key reaches the agent, so Ctrl+B is "one character left" again), `"C-b"` (tmux's own default) or another control key such as `"C-]"`. Applied to a running tmux server on save. See the [Configuration guide](https://receptron.github.io/mulmoterminal/guide/en/config.html#tmux-prefix). Settings → **Terminal keys** has a dropdown. |
|
|
884
898
|
| `terminalSubmit` | Which bytes Claude reads as **submit** vs **newline**: `"cr"` (default — Enter submits, Shift+Enter makes a newline) or `"esc-cr"` (for a Claude Code rebound the other way). Applies to the keyboard **and** the phone remote-view submit, for **Claude sessions only** (shell/codex keep plain Enter). See the [Configuration guide](https://receptron.github.io/mulmoterminal/guide/en/config.html#terminal-submit). Settings → **Terminal keys** offers both, worded as behaviour. |
|
|
885
899
|
| `copyOnSelect` | `true` puts a **mouse selection on the clipboard the moment it settles**, with no key pressed (the PuTTY / iTerm2 behaviour). **Off by default** — it changes the clipboard when you may only have meant to highlight something. There is a checkbox in Settings → **Terminal keys**, applied at once; a hand edit of the file needs a **server restart, then a tab reload** (the server reads this file once at startup, and the browser reads the value from it on load). Composes with the `copy` keymap action rather than replacing it. Over plain `http://` the browser gives a page no clipboard access, so a fallback asks xterm to copy instead; see the [Configuration guide](https://receptron.github.io/mulmoterminal/guide/en/config.html#copy-on-select). |
|
|
900
|
+
| `fileLinkOpensPane` | `false` keeps a **file path clicked on the tiled grid** on its old route — a new tab, or the in-app Files view — unless a pane is already open beside that cell. **On by default**: the click opens the Files pane beside the tile that printed the path, the way the tile's menu would, or moves it there. Beside an enlarged cell nothing changes either way. Settings → Terminal keys has a checkbox |
|
|
886
901
|
| `questionPaneEnabled` | `true` offers a Claude session's **`AskUserQuestion` choices as buttons** in a pane beside the enlarged terminal. **The terminal's own dialog stays** and the pane drives it — a click presses the arrow keys and Enter in the real dialog, so either end can answer and the first one wins. Claude sessions only (the choices arrive on Claude Code's hooks). A **single** question can also be answered in your own words — a text box under the buttons writes into the dialog's own `Type something` row; several questions at once, or a multi-select one, get buttons only, and `Chat about this` stays in the terminal. **Off by default** — it lets a pane type into your terminal. Checkbox in Settings → **Terminal keys**, applied at once (the server re-reads the file per question). See the [Feature reference](https://receptron.github.io/mulmoterminal/guide/en/features.html#question-pane). |
|
|
887
902
|
| `decisionDigest` | Keep a **Markdown digest of the decisions this project's sessions asked for**, refreshed at startup and every few hours, so an agent can read what has already been decided before asking something similar. Written to `~/.mulmoterminal/decisions/<project>.md` (never into your repository) and served to agents by the bundled `mulmoterminal-decisions` skill. **Off by default** — it is a vision-stage idea, and it writes a file that would otherwise not exist. The digest holds dated facts, never inferred rules. Settings → **Sessions and background tasks** has the switch. |
|
|
888
903
|
| `issueWorkComments` | Let a cell **comment on the issue it is working on**: **one comment**, posted when the work starts and then **edited** as the PR opens and merges (closing the issue if the forge has not already), each milestone stamped in UTC. The comment names the working **directory** it happened in — the folder name only, never the path — so a reader can tell which clone, and two terminals do not start the same issue twice. It says it came from MulmoTerminal. CI is deliberately not reported: it is on the PR already, and it flaps. **Off by default**; it writes to the forge, often on somebody else's issue. Needs the matching CLI logged in — `gh` for GitHub, `glab` for gitlab.com and any host declared in `gitlabHosts`. See the [Configuration guide](https://receptron.github.io/mulmoterminal/guide/en/config.html#issue-work-comments). Editable in Settings → **GitHub and GitLab**. |
|
|
@@ -1149,7 +1164,7 @@ show are left as they are, and a file that isn't a JSON object is not touched
|
|
|
1149
1164
|
```bash
|
|
1150
1165
|
yarn install # postinstall fixes node-pty prebuilt binary perms
|
|
1151
1166
|
|
|
1152
|
-
yarn dev # backend (:34567) + Vite UI (:6856), concurrently — open http://localhost:6856
|
|
1167
|
+
yarn dev # backend (:34567) + Vite UI (:6856), concurrently (on Windows started directly, unprefixed) — open http://localhost:6856
|
|
1153
1168
|
# or individually:
|
|
1154
1169
|
yarn dev:server # backend only (node --import tsx --env-file-if-exists=.env server/index.ts)
|
|
1155
1170
|
yarn dev:client # Vite dev server only
|
|
@@ -1449,8 +1464,8 @@ goes to the tab that file already has. A link that climbs above the pane's folde
|
|
|
1449
1464
|
the pane says so; an external link opens in a new browser tab, and a `#heading` link scrolls the
|
|
1450
1465
|
document.
|
|
1451
1466
|
|
|
1452
|
-
The toggle is not the only way in:
|
|
1453
|
-
|
|
1467
|
+
The toggle is not the only way in: **clicking a file path the agent printed** opens it here too, beside
|
|
1468
|
+
that cell — on the tiled grid the pane opens or moves beside the tile — rather than in a new tab or full-screen — see
|
|
1454
1469
|
[Clicking a file path](#clicking-a-file-path).
|
|
1455
1470
|
|
|
1456
1471
|
**Open a file by name instead of walking the tree.** The pane's header has a **search** button
|
|
@@ -2143,7 +2158,7 @@ name in `MULMOTERMINAL_HOST` / `MULMOTERMINAL_ALLOWED_ORIGINS`, against DNS rebi
|
|
|
2143
2158
|
|
|
2144
2159
|
| Endpoint | Purpose |
|
|
2145
2160
|
| -------- | ------- |
|
|
2146
|
-
| `GET /api/session/:id?cwd=` | One session's summary — cumulative `usage` and `context` (model + last-turn context tokens). Backs the cell token & ctx% badges. |
|
|
2161
|
+
| `GET /api/session/:id?cwd=` | One session's summary — cumulative `usage` and `context` (model + last-turn context tokens), and for a Claude session `peerName`, the name other Claude Code sessions on this machine message it by (`null` when no running claude answers to the id). Backs the cell token & ctx% badges and the `peer` chip. |
|
|
2147
2162
|
| `GET /api/codex/sessions?cwd=` | Codex sessions for the project (from `~/.codex` rollouts), newest first. |
|
|
2148
2163
|
| `GET /api/antigravity/sessions?cwd=` | Antigravity conversations for the project, newest first. agy does record a workspace, but never as a complete conversation-to-workspace map (`cache/last_conversations.json` keeps one conversation per directory and is written at exit; `history.jsonl` carries no conversation id), so the project comes from MulmoTerminal's own `~/.mulmoterminal/antigravity-conversations.jsonl`; agy's transcript supplies the title. |
|
|
2149
2164
|
| `GET /api/grok/sessions?cwd=` | Grok conversations for the project, newest first. `~/.grok/sessions` is partitioned by working directory (percent-encoded), so this is a directory listing; each conversation's `summary.json` supplies the title and the last-active time, falling back to the directory's `prompt_history.jsonl`. |
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const SHUTDOWN_MESSAGE_TYPE = "shutdown";
|
|
2
|
+
export declare function isShutdownMessage(message: unknown): boolean;
|
|
3
|
+
export interface StoppableChild {
|
|
4
|
+
connected: boolean;
|
|
5
|
+
send: (message: unknown, callback: (error: Error | null) => void) => boolean;
|
|
6
|
+
kill: (signal?: NodeJS.Signals) => boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function askChildToStop(child: StoppableChild): void;
|
|
9
|
+
export interface ParentShutdownOptions {
|
|
10
|
+
graceMs?: number;
|
|
11
|
+
exit?: (code: number) => void;
|
|
12
|
+
on?: (signal: NodeJS.Signals, listener: () => void) => void;
|
|
13
|
+
onStopping?: () => void;
|
|
14
|
+
}
|
|
15
|
+
/** What the parent's shutdown reads of its child — a ChildProcess satisfies it. */
|
|
16
|
+
export interface SupervisedChild extends StoppableChild {
|
|
17
|
+
exitCode: number | null;
|
|
18
|
+
signalCode: NodeJS.Signals | null;
|
|
19
|
+
once: (event: "close", listener: () => void) => unknown;
|
|
20
|
+
}
|
|
21
|
+
export declare const CHILD_EXIT_GRACE_MS: number;
|
|
22
|
+
export declare function stopChildWithin(child: SupervisedChild, graceMs: number, onGone?: () => void): void;
|
|
23
|
+
export declare function installParentShutdown(getChild: () => SupervisedChild | null, options?: ParentShutdownOptions): void;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// How a parent stops its server: a message on the IPC channel both of its parents already open (the
|
|
2
|
+
// launcher and `yarn dev`), not a signal. On Windows a signal to ANOTHER process is
|
|
3
|
+
// TerminateProcess — the server's own handler never runs, and what it would have flushed to disk
|
|
4
|
+
// is lost (#3234). A message is handled the same way on every platform.
|
|
5
|
+
|
|
6
|
+
export const SHUTDOWN_MESSAGE_TYPE = "shutdown";
|
|
7
|
+
|
|
8
|
+
/** @param {unknown} message */
|
|
9
|
+
export function isShutdownMessage(message) {
|
|
10
|
+
return typeof message === "object" && message !== null && "type" in message && message.type === SHUTDOWN_MESSAGE_TYPE;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Ask a child server to run its own shutdown. Over the channel when there is one; a signal is the
|
|
15
|
+
* fallback for a child with no channel, or one the message could not reach.
|
|
16
|
+
*
|
|
17
|
+
* @param {{ connected: boolean, send: (message: unknown, callback: (error: Error | null) => void) => boolean, kill: (signal?: NodeJS.Signals) => boolean }} child
|
|
18
|
+
*/
|
|
19
|
+
export function askChildToStop(child) {
|
|
20
|
+
if (!child.connected) {
|
|
21
|
+
child.kill("SIGTERM");
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
child.send({ type: SHUTDOWN_MESSAGE_TYPE }, (error) => {
|
|
25
|
+
if (error) child.kill("SIGTERM");
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const CHILD_EXIT_GRACE_MS = 2000;
|
|
30
|
+
|
|
31
|
+
/** Ask the child to stop, and end it outright if it has not closed within `graceMs` — asking no
|
|
32
|
+
* longer comes with a signal that would have ended it anyway, and a child left running holds the
|
|
33
|
+
* port. `onGone` runs once, whichever comes first. */
|
|
34
|
+
export function stopChildWithin(child, graceMs, onGone = () => {}) {
|
|
35
|
+
let gone = false;
|
|
36
|
+
const finish = () => {
|
|
37
|
+
if (gone) return;
|
|
38
|
+
gone = true;
|
|
39
|
+
clearTimeout(giveUp);
|
|
40
|
+
onGone();
|
|
41
|
+
};
|
|
42
|
+
const giveUp = setTimeout(() => {
|
|
43
|
+
child.kill("SIGKILL");
|
|
44
|
+
finish();
|
|
45
|
+
}, graceMs);
|
|
46
|
+
giveUp.unref?.();
|
|
47
|
+
child.once("close", finish);
|
|
48
|
+
askChildToStop(child);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Ctrl+C reaches the child too (the signal goes to the whole process group), and the child now
|
|
52
|
+
* flushes queued session state before it exits (#2161). Exiting here the instant we have
|
|
53
|
+
* signalled would hand the shell back first and, when the terminal then goes away, cut that
|
|
54
|
+
* flush short — so we wait for the child's own exit.
|
|
55
|
+
*
|
|
56
|
+
* ASKED over the IPC channel, not signalled: on Windows a signal to the child is TerminateProcess,
|
|
57
|
+
* which ended it before that flush could run (#3234).
|
|
58
|
+
*
|
|
59
|
+
* Capped, because a child that will not die must not leave the user unable to get their prompt
|
|
60
|
+
* back. Past the cap the child is killed and we go.
|
|
61
|
+
*
|
|
62
|
+
* `getChild` rather than the child itself: it is replaced across restarts and bind-retries, and
|
|
63
|
+
* the handler is registered once. `onStopping` is for a parent that must stop restarting it. */
|
|
64
|
+
export function installParentShutdown(
|
|
65
|
+
getChild,
|
|
66
|
+
{ graceMs = CHILD_EXIT_GRACE_MS, exit = (code) => process.exit(code), on = (sig, fn) => process.on(sig, fn), onStopping = () => {} } = {},
|
|
67
|
+
) {
|
|
68
|
+
let shuttingDown = false;
|
|
69
|
+
const shutdown = () => {
|
|
70
|
+
const child = getChild();
|
|
71
|
+
// A second Ctrl+C means "stop waiting", not "signal twice".
|
|
72
|
+
if (shuttingDown || !child) return exit(0);
|
|
73
|
+
// A child that has already gone emits no further `close`, so waiting for one would spend the
|
|
74
|
+
// whole grace period doing nothing — Ctrl+C after a crash would feel like a hang (Codex on
|
|
75
|
+
// #2195 called this bounded and escapable; it is, and it is also free to avoid).
|
|
76
|
+
if (child.exitCode !== null || child.signalCode !== null) return exit(0);
|
|
77
|
+
shuttingDown = true;
|
|
78
|
+
onStopping();
|
|
79
|
+
stopChildWithin(child, graceMs, () => exit(0));
|
|
80
|
+
};
|
|
81
|
+
on("SIGINT", shutdown);
|
|
82
|
+
on("SIGTERM", shutdown);
|
|
83
|
+
}
|
package/bin/mulmoterminal.js
CHANGED
|
@@ -47,6 +47,7 @@ import { agentBin, AGENT_BIN_SPEC } from "./agent-bins.js";
|
|
|
47
47
|
import { configuredDefaultAgent, gateFor, isKnownAgent, missingAgentMessage, parseAgentArg, resolveDeclaredAgent } from "./default-agent.js";
|
|
48
48
|
import { setProcessTitle } from "./process-title.js";
|
|
49
49
|
import { nodeUpgradeGuide } from "./node-install.js";
|
|
50
|
+
import { installParentShutdown } from "./child-shutdown.js";
|
|
50
51
|
|
|
51
52
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
52
53
|
const PKG_DIR = join(__dirname, "..");
|
|
@@ -707,44 +708,6 @@ function notePortFromEnvironment(port) {
|
|
|
707
708
|
log(` Terminals inside cells inherit that PORT too, as in any shell you exported it from.`);
|
|
708
709
|
}
|
|
709
710
|
|
|
710
|
-
const CHILD_EXIT_GRACE_MS = 2000;
|
|
711
|
-
|
|
712
|
-
/** Ctrl+C reaches the child too (the signal goes to the whole process group), and the child now
|
|
713
|
-
* flushes queued session state before it exits (#2161). Exiting here the instant we have
|
|
714
|
-
* signalled would hand the shell back first and, when the terminal then goes away, cut that
|
|
715
|
-
* flush short — so we wait for the child's own exit.
|
|
716
|
-
*
|
|
717
|
-
* Capped, because a child that will not die must not leave the user unable to get their prompt
|
|
718
|
-
* back. Past the cap we go and leave it orphaned, which is what used to happen every time.
|
|
719
|
-
*
|
|
720
|
-
* `getChild` rather than the child itself: it is replaced across restarts and bind-retries, and
|
|
721
|
-
* the handler is registered once. */
|
|
722
|
-
export function installParentShutdown(
|
|
723
|
-
getChild,
|
|
724
|
-
{ graceMs = CHILD_EXIT_GRACE_MS, exit = (code) => process.exit(code), on = (sig, fn) => process.on(sig, fn) } = {},
|
|
725
|
-
) {
|
|
726
|
-
let shuttingDown = false;
|
|
727
|
-
const shutdown = () => {
|
|
728
|
-
const child = getChild();
|
|
729
|
-
// A second Ctrl+C means "stop waiting", not "signal twice".
|
|
730
|
-
if (shuttingDown || !child) return exit(0);
|
|
731
|
-
// A child that has already gone emits no further `close`, so waiting for one would spend the
|
|
732
|
-
// whole grace period doing nothing — Ctrl+C after a crash would feel like a hang (Codex on
|
|
733
|
-
// #2195 called this bounded and escapable; it is, and it is also free to avoid).
|
|
734
|
-
if (child.exitCode !== null || child.signalCode !== null) return exit(0);
|
|
735
|
-
shuttingDown = true;
|
|
736
|
-
const giveUp = setTimeout(() => exit(0), graceMs);
|
|
737
|
-
giveUp.unref?.();
|
|
738
|
-
child.once("close", () => {
|
|
739
|
-
clearTimeout(giveUp);
|
|
740
|
-
exit(0);
|
|
741
|
-
});
|
|
742
|
-
child.kill("SIGTERM");
|
|
743
|
-
};
|
|
744
|
-
on("SIGINT", shutdown);
|
|
745
|
-
on("SIGTERM", shutdown);
|
|
746
|
-
}
|
|
747
|
-
|
|
748
711
|
async function main() {
|
|
749
712
|
const args = process.argv.slice(2);
|
|
750
713
|
|
|
@@ -48,12 +48,13 @@ const CRASH_SIGNALS = new Set(["SIGABRT", "SIGSEGV", "SIGBUS", "SIGILL", "SIGFPE
|
|
|
48
48
|
/**
|
|
49
49
|
* Whether this platform can tell a stop from a crash at all.
|
|
50
50
|
*
|
|
51
|
-
* Windows cannot. Node has no real signals there, so `mulmoterminal stop
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
51
|
+
* Windows cannot. Node has no real signals there, so a `taskkill` — or a `mulmoterminal stop` the
|
|
52
|
+
* server did not answer over HTTP, which falls back to a signal — TERMINATES the process instead of
|
|
53
|
+
* delivering something its handler runs. The server then never reaches the `exit(0)` that means
|
|
54
|
+
* "somebody asked for this", and the exit arrives as a bare non-zero code with no signal: the exact
|
|
55
|
+
* shape of the crash this module exists to recover from. Restarting on it would resurrect a server
|
|
56
|
+
* the user just stopped, and leave them no way to stop it at all. (The Stop button and an answered
|
|
57
|
+
* `stop` do reach `exit(0)` there since #3234; the fallbacks are what still look like a crash.)
|
|
57
58
|
*
|
|
58
59
|
* So Windows keeps the behaviour it had before supervision existed — the launcher leaves with its
|
|
59
60
|
* server — and says nothing new about it. Fixing it properly means giving `stop` a way to reach
|
|
@@ -86,7 +87,7 @@ const canTellStopFromCrash = (platform) => platform !== "win32";
|
|
|
86
87
|
export function planAfterServerExit({ code, signal, everServed, consecutiveFailures, platform }) {
|
|
87
88
|
// A port that is taken will still be taken next time; the caller names who has it and stops.
|
|
88
89
|
if (code === PORT_IN_USE_EXIT_CODE) return { action: "port-in-use", delayMs: 0, reason: null };
|
|
89
|
-
// `mulmoterminal stop` and the browser's Stop button both
|
|
90
|
+
// `mulmoterminal stop` and the browser's Stop button both end in the server's own shutdown, which
|
|
90
91
|
// exits 0 (server/infra/process/shutdown.ts). Restarting that is the product's stop button not stopping.
|
|
91
92
|
if (code === 0) return { action: "stop", delayMs: 0, reason: null };
|
|
92
93
|
// Nothing below can be decided on a platform where a stop and a crash arrive identically, so it
|
package/bin/stop.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { InstanceEntry } from "./instances.js";
|
|
|
2
2
|
|
|
3
3
|
export interface StopEffects {
|
|
4
4
|
kill?: (pid: number) => void;
|
|
5
|
+
request?: (instance: InstanceEntry) => Promise<boolean>;
|
|
5
6
|
isAlive?: (pid: number) => boolean;
|
|
6
7
|
sleep?: (ms: number) => Promise<void>;
|
|
7
8
|
graceMs?: number;
|
|
@@ -26,6 +27,11 @@ export interface ConfirmDeps {
|
|
|
26
27
|
owners?: (port: number) => Promise<number[] | null>;
|
|
27
28
|
}
|
|
28
29
|
export declare function confirmInstance(instance: InstanceEntry, deps?: ConfirmDeps): Promise<boolean>;
|
|
30
|
+
export interface AskDeps {
|
|
31
|
+
fetchImpl?: (url: string, init: RequestInit) => Promise<{ ok: boolean }>;
|
|
32
|
+
timeoutMs?: number;
|
|
33
|
+
}
|
|
34
|
+
export declare function askServerToStop(instance: InstanceEntry, deps?: AskDeps): Promise<boolean>;
|
|
29
35
|
export declare function stopInstances(instances: readonly InstanceEntry[], effects?: StopEffects): Promise<StopResult>;
|
|
30
36
|
export declare function describeInstance(instance: InstanceEntry): string;
|
|
31
37
|
export declare function manualStopCommand(pids: readonly number[], platform?: NodeJS.Platform): string;
|
package/bin/stop.js
CHANGED
|
@@ -23,6 +23,8 @@ import { portOwners } from "./port-owner.js";
|
|
|
23
23
|
// a server that was merely mid-shutdown would send the user hunting for a problem that isn't there.
|
|
24
24
|
const GRACE_MS = 5000;
|
|
25
25
|
const POLL_MS = 100;
|
|
26
|
+
// How long the server has to answer the stop request before the signal is used instead.
|
|
27
|
+
const REQUEST_TIMEOUT_MS = 2000;
|
|
26
28
|
|
|
27
29
|
const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
28
30
|
|
|
@@ -50,20 +52,55 @@ export async function confirmInstance(instance, deps = {}) {
|
|
|
50
52
|
return pids !== null && pids.includes(instance.pid);
|
|
51
53
|
}
|
|
52
54
|
|
|
55
|
+
/** Why the signal could not be sent, or null when it was. ESRCH means the process ended between the
|
|
56
|
+
* registry being read and now — success, just not ours. Anything else (EPERM: another user's
|
|
57
|
+
* process) is a refusal the user has to see. */
|
|
58
|
+
function signalRefusal(kill, pid) {
|
|
59
|
+
try {
|
|
60
|
+
kill(pid);
|
|
61
|
+
return null;
|
|
62
|
+
} catch (err) {
|
|
63
|
+
return err?.code ?? "failed";
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Ask a server to stop the way the browser's Stop button does: POST /api/shutdown on its own port,
|
|
69
|
+
* which runs the same shutdown Ctrl+C runs. True when it said it is stopping.
|
|
70
|
+
*
|
|
71
|
+
* Not a signal first, because on Windows a signal to another process is TerminateProcess: the
|
|
72
|
+
* server never ran its shutdown, and the session state it flushes on the way out was lost (#3234).
|
|
73
|
+
* The Origin is the one the browser sends, which the same-origin gate admits.
|
|
74
|
+
*/
|
|
75
|
+
export async function askServerToStop(instance, { fetchImpl = fetch, timeoutMs = REQUEST_TIMEOUT_MS } = {}) {
|
|
76
|
+
const url = `http://127.0.0.1:${instance.port}/api/shutdown`;
|
|
77
|
+
const controller = new AbortController();
|
|
78
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
79
|
+
try {
|
|
80
|
+
const res = await fetchImpl(url, { method: "POST", headers: { Origin: `http://localhost:${instance.port}` }, signal: controller.signal });
|
|
81
|
+
return res.ok;
|
|
82
|
+
} catch {
|
|
83
|
+
return false;
|
|
84
|
+
} finally {
|
|
85
|
+
clearTimeout(timer);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
53
89
|
/**
|
|
54
90
|
* Ask every instance to stop, and report which did.
|
|
55
91
|
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* the reporting can be tested without
|
|
92
|
+
* Over HTTP first (`askServerToStop`), SIGTERM when that is not answered: the signal lands on the
|
|
93
|
+
* server's own handler on macOS and Linux, and is the only way left to a server that has stopped
|
|
94
|
+
* answering. The effects are injected so the waiting and the reporting can be tested without
|
|
95
|
+
* spawning anything.
|
|
59
96
|
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* the whisper sidecar, which exists on macOS alone.
|
|
97
|
+
* `--force` skips the request and only signals: the pid is not confirmed to own the port then, so
|
|
98
|
+
* the server answering on it may be a different one.
|
|
63
99
|
*/
|
|
64
100
|
export async function stopInstances(instances, effects = {}) {
|
|
65
101
|
const {
|
|
66
102
|
kill = (pid) => process.kill(pid, "SIGTERM"),
|
|
103
|
+
request = askServerToStop,
|
|
67
104
|
isAlive = isProcessAlive,
|
|
68
105
|
sleep = wait,
|
|
69
106
|
graceMs = GRACE_MS,
|
|
@@ -81,14 +118,9 @@ export async function stopInstances(instances, effects = {}) {
|
|
|
81
118
|
unconfirmed.push(instance);
|
|
82
119
|
continue;
|
|
83
120
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
} catch (err) {
|
|
88
|
-
// ESRCH means it ended between the registry being read and now — which is success, just not
|
|
89
|
-
// ours. Anything else (EPERM: another user's process) is a refusal the user has to see.
|
|
90
|
-
if (err?.code !== "ESRCH") stubborn.push({ ...instance, reason: err?.code ?? "failed" });
|
|
91
|
-
}
|
|
121
|
+
const refusal = !force && (await request(instance)) ? null : signalRefusal(kill, instance.pid);
|
|
122
|
+
if (refusal === null) asked.push(instance);
|
|
123
|
+
else if (refusal !== "ESRCH") stubborn.push({ ...instance, reason: refusal });
|
|
92
124
|
}
|
|
93
125
|
|
|
94
126
|
for (let waited = 0; waited < graceMs && asked.some((i) => isAlive(i.pid)); waited += POLL_MS) {
|
package/common/headerChips.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { isRecord } from "./isRecord.js";
|
|
|
10
10
|
export const MAX_HEADER_CHIPS = 16;
|
|
11
11
|
|
|
12
12
|
/** The built-in chips a terminal cell draws, in the order an unconfigured header shows them. */
|
|
13
|
-
export const CELL_CHIP_IDS = ["git", "work", "diff", "ctx", "usage", "env"] as const;
|
|
13
|
+
export const CELL_CHIP_IDS = ["git", "work", "diff", "ctx", "usage", "env", "peer"] as const;
|
|
14
14
|
export type CellChipId = (typeof CELL_CHIP_IDS)[number];
|
|
15
15
|
export const isCellChipId = (value: unknown): value is CellChipId => CELL_CHIP_IDS.some((id) => id === value);
|
|
16
16
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/opensheetmusicdisplay.min-CeBHhrOd.js","assets/rolldown-runtime-BCiCTKAo.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e}from"./rolldown-runtime-BCiCTKAo.js";import{C as t,D as n,E as r,S as i,T as a,_ as o,b as s,f as c,n as l,t as u,v as d,w as f,x as p,y as m}from"./index-
|
|
2
|
+
import{o as e}from"./rolldown-runtime-BCiCTKAo.js";import{C as t,D as n,E as r,S as i,T as a,_ as o,b as s,f as c,n as l,t as u,v as d,w as f,x as p,y as m}from"./index-D-mlIyCo.js";p(),r();var h={class:`sheet`},g={key:0,class:`status`},_={key:1,class:`status`},v=l(s({__name:`Notation`,props:{musicxml:{},tempo:{},now:{}},setup(r){let s=r,l=n(null),p=n(`loading`),v,y=[],b=0;function x(e){let t=v?.cursor;if(t===void 0||y.length===0)return;let n=u(y,e);if(n!==b)for(n<b&&(t.reset(),b=0);b<n;)t.next(),b++}let S=0;async function C(t){let n=l.value;if(!n)return;let r=++S;p.value=`loading`;try{let{OpenSheetMusicDisplay:i}=await c(async()=>{let{OpenSheetMusicDisplay:t}=await import(`./opensheetmusicdisplay.min-CeBHhrOd.js`).then(t=>e(t.default,1));return{OpenSheetMusicDisplay:t}},__vite__mapDeps([0,1]));if(r!==S)return;v??=new i(n,{backend:`svg`,autoResize:!0,autoBeam:!0,drawTitle:!1,drawComposer:!1,drawCredits:!1,followCursor:!0,defaultColorMusic:`#000000`});let a=v;if(await a.load(t),r!==S)return;a.render();let o=a.cursor;o.show(),o.reset();let l=240/s.tempo,u=[];for(;!o.iterator.EndReached;)u.push(o.iterator.currentTimeStamp.RealValue*l),o.next();o.reset(),y=u,b=0,p.value=`ready`,x(s.now)}catch(e){if(r!==S)return;console.error(`jinglescript: the sheet music could not be drawn`,e),p.value=`failed`}}return t(()=>void C(s.musicxml)),a(()=>s.musicxml,e=>void C(e)),a(()=>s.now,e=>x(e)),i(()=>{S++,v?.clear(),v=void 0}),(e,t)=>(f(),m(`div`,h,[p.value===`loading`?(f(),m(`p`,g,`Drawing the sheet music…`)):p.value===`failed`?(f(),m(`p`,_,`The sheet music could not be drawn. The audio still plays; the MusicXML can be downloaded below.`)):d(``,!0),o(`div`,{ref_key:`container`,ref:l,class:`page`},null,512)]))}}),[[`__scopeId`,`data-v-80f75f9d`]]);export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as e,t}from"./mermaid-parser.core-
|
|
1
|
+
import{m as e,t}from"./mermaid-parser.core-CVdVf9tB.js";import{n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as r}from"./src-Bc_iCBZR.js";import"./chunk-DSNLSHJZ-DQDFfuVb.js";import{n as i,r as a,t as o}from"./chunk-2E7WHVMD-DGXHSAmr.js";import{t as s}from"./chunk-JWPE2WC7-DVXcaiue.js";import"./mermaid.core-CSNDpz3l.js";var c=e().RailroadAbnf.parser.LangiumParser,l=n(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=n(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=n(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=n(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=n(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=n(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=n(e=>{s(e,o),e.title&&o.setTitle(e.title),e.rules.map(e=>o.addRule(m(e)))},`populateDb`),g={parser:{parse:n(e=>{o.clear(),r.debug(`[ABNF Parser] Starting Langium parse`);let n=c.parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new t(n);let i=n.value;r.debug(`[ABNF Parser] Parsed rules:`,i.rules.length),h(i),r.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:o}},db:o,renderer:a,styles:i};export{g as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-NGNAAXSQ-Bw6tHVuc.js";export{M as createArchitectureServices}from"./mermaid-parser.core-
|
|
1
|
+
import"./chunk-NGNAAXSQ-Bw6tHVuc.js";export{M as createArchitectureServices}from"./mermaid-parser.core-CVdVf9tB.js";
|