@aiwayds/dsh-opentui 0.19.0 → 0.20.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/CHANGELOG.md +50 -0
- package/bin/dsh-opentui.mjs +30 -6
- package/dist/client/index.js +539 -199
- package/dist/client/index.js.map +12 -11
- package/dist/host-launch.mjs +8 -4
- package/dist/host-launch.mjs.map +5 -5
- package/dist/watchdog.mjs +15 -6
- package/dist/watchdog.mjs.map +4 -4
- package/package.json +1 -1
package/dist/host-launch.mjs
CHANGED
|
@@ -72,7 +72,7 @@ function defaultPidAlive(pid) {
|
|
|
72
72
|
return false;
|
|
73
73
|
return true;
|
|
74
74
|
}
|
|
75
|
-
function evidencesAgree(pid, registryPid, hooks) {
|
|
75
|
+
function evidencesAgree(pid, registryPid, hooks, expectedProfile = HOST_PROFILE) {
|
|
76
76
|
if (!Number.isInteger(pid) || pid <= 0)
|
|
77
77
|
return false;
|
|
78
78
|
if (registryPid !== pid)
|
|
@@ -81,7 +81,7 @@ function evidencesAgree(pid, registryPid, hooks) {
|
|
|
81
81
|
if (!cmd)
|
|
82
82
|
return false;
|
|
83
83
|
const profiles = [...cmd.matchAll(/--profile[= ]+([^\s]+)/g)].map((m) => m[1]);
|
|
84
|
-
if (profiles.length === 0 || profiles.some((p) => p !==
|
|
84
|
+
if (profiles.length === 0 || profiles.some((p) => p !== expectedProfile))
|
|
85
85
|
return false;
|
|
86
86
|
if (hooks.hasServerEnv(pid))
|
|
87
87
|
return true;
|
|
@@ -108,13 +108,14 @@ async function safeStopHost(options) {
|
|
|
108
108
|
pid,
|
|
109
109
|
registryPid,
|
|
110
110
|
hooks,
|
|
111
|
+
profile = HOST_PROFILE,
|
|
111
112
|
termGraceMs = DEFAULT_TERM_GRACE_MS,
|
|
112
113
|
killGraceMs = DEFAULT_KILL_GRACE_MS,
|
|
113
114
|
sleep = defaultSleep,
|
|
114
115
|
pidAlive = hooks.pidAlive ?? defaultPidAlive,
|
|
115
116
|
now = Date.now
|
|
116
117
|
} = options;
|
|
117
|
-
if (!evidencesAgree(pid, registryPid, hooks)) {
|
|
118
|
+
if (!evidencesAgree(pid, registryPid, hooks, profile)) {
|
|
118
119
|
return { attempted: false, evidencesOk: false, signals: [], stopped: !pidAlive(pid) };
|
|
119
120
|
}
|
|
120
121
|
const signals = [];
|
|
@@ -1032,6 +1033,7 @@ async function ensureHost(deps = {}) {
|
|
|
1032
1033
|
pid: forcePid,
|
|
1033
1034
|
registryPid: forcePid,
|
|
1034
1035
|
hooks: o.killHooks,
|
|
1036
|
+
profile: o.profile,
|
|
1035
1037
|
termGraceMs: FORCE_TERM_GRACE_MS,
|
|
1036
1038
|
killGraceMs: FORCE_KILL_GRACE_MS,
|
|
1037
1039
|
sleep: o.sleep,
|
|
@@ -1090,6 +1092,7 @@ async function ensureHost(deps = {}) {
|
|
|
1090
1092
|
pid: read.value.pid,
|
|
1091
1093
|
registryPid: read.value.pid,
|
|
1092
1094
|
hooks: o.killHooks,
|
|
1095
|
+
profile: o.profile,
|
|
1093
1096
|
termGraceMs: FORCE_TERM_GRACE_MS,
|
|
1094
1097
|
killGraceMs: FORCE_KILL_GRACE_MS,
|
|
1095
1098
|
sleep: o.sleep,
|
|
@@ -1172,6 +1175,7 @@ async function ensureHost(deps = {}) {
|
|
|
1172
1175
|
pid: child.pid,
|
|
1173
1176
|
registryPid,
|
|
1174
1177
|
hooks: o.killHooks,
|
|
1178
|
+
profile: o.profile,
|
|
1175
1179
|
termGraceMs: FORCE_TERM_GRACE_MS,
|
|
1176
1180
|
killGraceMs: FORCE_KILL_GRACE_MS,
|
|
1177
1181
|
sleep: o.sleep,
|
|
@@ -1272,5 +1276,5 @@ export {
|
|
|
1272
1276
|
readRegistry
|
|
1273
1277
|
};
|
|
1274
1278
|
|
|
1275
|
-
//# debugId=
|
|
1279
|
+
//# debugId=5785637837263AC664756E2164756E21
|
|
1276
1280
|
//# sourceMappingURL=host-launch.mjs.map
|