moondesk 0.5.4 → 0.5.5
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 +2 -0
- package/npm/moondesk.js +19 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -123,6 +123,8 @@ Use `[w] Workspaces` to add, rename, inspect, copy, rotate, or remove projects.
|
|
|
123
123
|
|
|
124
124
|
Browser control is shared by the host, so workspaces using browser mode control the same selected browser/DevTools bridge.
|
|
125
125
|
|
|
126
|
+
Because every workspace shares this host and public tunnel, stopping MoonDesk disconnects all active workspace connectors. Pressing `q` or `Ctrl+C` in the live dashboard therefore opens a shutdown confirmation instead of stopping the host immediately; `Enter` confirms and `Esc` keeps MoonDesk running.
|
|
127
|
+
|
|
126
128
|
## Tools
|
|
127
129
|
|
|
128
130
|
In `multi-tools` mode MoonDesk exposes 12 local tools:
|
package/npm/moondesk.js
CHANGED
|
@@ -39,14 +39,31 @@ function cleanupEphemeralUpdateFiles(statePath, requestPath) {
|
|
|
39
39
|
|
|
40
40
|
function runNative(binaryPath, args, options = {}) {
|
|
41
41
|
const spawnImpl = options.spawnImpl ?? spawn;
|
|
42
|
+
const signalTarget = options.signalTarget ?? process;
|
|
42
43
|
return new Promise((resolve, reject) => {
|
|
43
44
|
const child = spawnImpl(binaryPath, args, {
|
|
44
45
|
cwd: options.cwd ?? process.cwd(),
|
|
45
46
|
env: options.env ?? process.env,
|
|
46
47
|
stdio: "inherit",
|
|
47
48
|
});
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
|
|
50
|
+
// The native TUI owns Ctrl+C confirmation once the shared host is running.
|
|
51
|
+
// Without a listener, Node's default SIGINT behavior can terminate the npm
|
|
52
|
+
// wrapper before the native child restores the terminal and closes ngrok.
|
|
53
|
+
const ignoreParentSigint = () => {};
|
|
54
|
+
signalTarget.on?.("SIGINT", ignoreParentSigint);
|
|
55
|
+
const cleanupSignalHandler = () => {
|
|
56
|
+
signalTarget.off?.("SIGINT", ignoreParentSigint);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
child.once("error", (error) => {
|
|
60
|
+
cleanupSignalHandler();
|
|
61
|
+
reject(error);
|
|
62
|
+
});
|
|
63
|
+
child.once("exit", (code, signal) => {
|
|
64
|
+
cleanupSignalHandler();
|
|
65
|
+
resolve({ code: code ?? 1, signal });
|
|
66
|
+
});
|
|
50
67
|
});
|
|
51
68
|
}
|
|
52
69
|
|