gm-plugkit 2.0.1228 → 2.0.1229
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/package.json +1 -1
- package/plugkit-wasm-wrapper.js +24 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm-plugkit",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1229",
|
|
4
4
|
"description": "Bootstrap and daemon-spawn tool for gm plugkit binary. Downloads the correct platform binary, verifies SHA256, and starts the spool watcher daemon. Includes plugkit-wasm-wrapper for WASM-based spool watching.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
package/plugkit-wasm-wrapper.js
CHANGED
|
@@ -736,6 +736,24 @@ function cleanDeadProfileFragments(cwd) {
|
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
738
|
|
|
739
|
+
function resolveWindowsExeLocal(cmd) {
|
|
740
|
+
if (process.platform !== 'win32') return cmd;
|
|
741
|
+
try {
|
|
742
|
+
const out = spawnSync('where', [cmd], {
|
|
743
|
+
encoding: 'utf-8',
|
|
744
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
745
|
+
windowsHide: true,
|
|
746
|
+
timeout: 800,
|
|
747
|
+
});
|
|
748
|
+
if (out.status !== 0) return cmd;
|
|
749
|
+
const lines = (out.stdout || '').split(/\r?\n/).map(l => l.trim()).filter(Boolean);
|
|
750
|
+
const exe = lines.find(l => /\.exe$/i.test(l));
|
|
751
|
+
return exe || lines[0] || cmd;
|
|
752
|
+
} catch {
|
|
753
|
+
return cmd;
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
|
|
739
757
|
function isPortReachableSync(host, port, timeoutMs) {
|
|
740
758
|
const r = spawnSync(process.execPath, ['-e', `
|
|
741
759
|
const net = require('net');
|
|
@@ -777,8 +795,12 @@ function ensureAcptoapi() {
|
|
|
777
795
|
if (_acptoapiBoot.spawned_at && Date.now() - _acptoapiBoot.spawned_at < 30000) {
|
|
778
796
|
return;
|
|
779
797
|
}
|
|
780
|
-
|
|
781
|
-
|
|
798
|
+
// Resolve `bun` to its actual .exe on Windows so the spawned daemon
|
|
799
|
+
// doesn't enter conhost via a bun.cmd shim. See
|
|
800
|
+
// [[windows-spawn-cmd-shim-flash]] — cmd.exe + .cmd chain re-enters
|
|
801
|
+
// conhost even with windowsHide:true on the parent. Falls back to
|
|
802
|
+
// the bare name on non-Windows / when `where` can't resolve.
|
|
803
|
+
const cmd = resolveWindowsExeLocal('bun');
|
|
782
804
|
const child = spawn(cmd, ['x', 'acptoapi@latest'], {
|
|
783
805
|
detached: true,
|
|
784
806
|
stdio: 'ignore',
|