dsh-chat-embed 0.6.14 → 0.6.16
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 +7 -5
- package/client.js +2032 -202
- package/index.js +14 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
* Keep this module inert beyond that probe. It must not import browser
|
|
18
18
|
* globals, and anything it registers must be cleaned up through `ctx.effect`
|
|
19
19
|
* so uninstalling the bundle leaves the Host process exactly as it was.
|
|
20
|
+
* The waiting patcher is the exception. Quitting disposes this plugin, and
|
|
21
|
+
* killing that process then is the moment it is waiting for.
|
|
20
22
|
*/
|
|
21
23
|
|
|
22
24
|
import { spawn, spawnSync } from 'node:child_process'
|
|
@@ -899,9 +901,11 @@ function startPatchTask(action, report, run) {
|
|
|
899
901
|
* Start the patch script so that it outlives this process.
|
|
900
902
|
*
|
|
901
903
|
* It has to: the swap waits for DSH to exit, and that exit takes this Host with
|
|
902
|
-
* it. On Windows that means Task Scheduler (see {@link patchTaskCommand})
|
|
903
|
-
* the
|
|
904
|
-
* a
|
|
904
|
+
* it. On Windows that means Task Scheduler (see {@link patchTaskCommand}),
|
|
905
|
+
* because the shell's job object kills every process it spawned. On macOS and
|
|
906
|
+
* Linux a `detached` child is a new session, so the parent exiting does not
|
|
907
|
+
* take it along — as long as the route disposer does not kill it. That
|
|
908
|
+
* disposer runs on quit, which is the moment the child is waiting for.
|
|
905
909
|
*
|
|
906
910
|
* @param {string} action 'apply' or 'revert'
|
|
907
911
|
* @param {object} report the probe's answer
|
|
@@ -1095,7 +1099,13 @@ function installHttpRoutes(ctx, deps = {}) {
|
|
|
1095
1099
|
return undefined
|
|
1096
1100
|
}
|
|
1097
1101
|
return () => {
|
|
1098
|
-
|
|
1102
|
+
// Leave the patcher running. Quitting DSH disposes plugins first, and on
|
|
1103
|
+
// macOS and Linux `waiting` is the live child whose job is to survive that
|
|
1104
|
+
// quit and swap app.asar afterwards. Killing it here left the archive
|
|
1105
|
+
// staged and the switch off after every restart. A new switch click still
|
|
1106
|
+
// replaces the previous waiter through stopWaiting() above. On Windows the
|
|
1107
|
+
// patcher is a scheduled task; kill() only ends that task and cannot reach
|
|
1108
|
+
// the already-detached process, so skipping it changes nothing there.
|
|
1099
1109
|
for (const dispose of disposers) {
|
|
1100
1110
|
try {
|
|
1101
1111
|
dispose()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-chat-embed",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.16",
|
|
4
4
|
"author": "poluce <fishsummer@126.com>",
|
|
5
5
|
"description": "Multi-tab AI chat embed for the DeepSeek Harness desktop app: DeepSeek, 豆包, ChatGPT, MiniMax, Kimi, Gemini and Grok, each signed in separately.",
|
|
6
6
|
"type": "module",
|