gm-skill 2.0.1227 → 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/README.md +1 -1
- package/gm-plugkit/plugkit-wasm-wrapper.js +48 -7
- package/gm.json +1 -1
- package/lib/daemon-bootstrap.js +24 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ An earlier generation fanned out fifteen per-platform downstream repos (gm-cc, g
|
|
|
35
35
|
|
|
36
36
|
## Version
|
|
37
37
|
|
|
38
|
-
`2.0.
|
|
38
|
+
`2.0.1229` — auto-bumped from the canonical `gm` repo. Every push to `AnEntrypoint/gm` (or any cascading sibling crate) republishes this package.
|
|
39
39
|
|
|
40
40
|
## Source of truth
|
|
41
41
|
|
|
@@ -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');
|
|
@@ -744,24 +762,45 @@ function isPortReachableSync(host, port, timeoutMs) {
|
|
|
744
762
|
s.on('connect', () => { done = true; s.destroy(); process.exit(0); });
|
|
745
763
|
s.on('error', () => { if (!done) process.exit(1); });
|
|
746
764
|
setTimeout(() => { if (!done) { s.destroy(); process.exit(1); } }, ${timeoutMs || 800});
|
|
747
|
-
`], { timeout: (timeoutMs || 800) + 2000 });
|
|
765
|
+
`], { timeout: (timeoutMs || 800) + 2000, windowsHide: true });
|
|
748
766
|
return r.status === 0;
|
|
749
767
|
}
|
|
750
768
|
|
|
751
|
-
let _acptoapiBoot = { spawned_at: 0, pid: null };
|
|
769
|
+
let _acptoapiBoot = { spawned_at: 0, pid: null, last_check_ts: 0, last_check_ok: false };
|
|
752
770
|
function ensureAcptoapi() {
|
|
753
771
|
const host = '127.0.0.1';
|
|
754
772
|
const port = 4800;
|
|
755
773
|
try {
|
|
756
|
-
|
|
757
|
-
|
|
774
|
+
// Two-strike port check: localhost connect can race against node cold-
|
|
775
|
+
// start on Windows. If the first check fails, retry once with a longer
|
|
776
|
+
// timeout before declaring the port dead. iter9 sniff reported 29
|
|
777
|
+
// bootstrap.acptoapi.spawned events in 30m despite acptoapi being alive
|
|
778
|
+
// on :4800 (HTTP 200) — the check flaked under heartbeat-tick load.
|
|
779
|
+
let reachable = isPortReachableSync(host, port, 1500);
|
|
780
|
+
if (!reachable) {
|
|
781
|
+
reachable = isPortReachableSync(host, port, 3000);
|
|
782
|
+
}
|
|
783
|
+
if (reachable) {
|
|
784
|
+
const wasDown = _acptoapiBoot.spawned_at > 0 || !_acptoapiBoot.last_check_ok;
|
|
785
|
+
_acptoapiBoot = { spawned_at: 0, pid: null, status: 'already-running', last_check_ts: Date.now(), last_check_ok: true };
|
|
786
|
+
// Only log on transitions (down → up) so the heartbeat doesn't spam
|
|
787
|
+
// bootstrap.jsonl every 60s with redundant "alive" events.
|
|
788
|
+
if (wasDown) {
|
|
789
|
+
logEvent('bootstrap', 'acptoapi.heartbeat-ok', { port, transition: 'down-to-up' });
|
|
790
|
+
}
|
|
758
791
|
return;
|
|
759
792
|
}
|
|
793
|
+
_acptoapiBoot.last_check_ok = false;
|
|
794
|
+
_acptoapiBoot.last_check_ts = Date.now();
|
|
760
795
|
if (_acptoapiBoot.spawned_at && Date.now() - _acptoapiBoot.spawned_at < 30000) {
|
|
761
796
|
return;
|
|
762
797
|
}
|
|
763
|
-
|
|
764
|
-
|
|
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');
|
|
765
804
|
const child = spawn(cmd, ['x', 'acptoapi@latest'], {
|
|
766
805
|
detached: true,
|
|
767
806
|
stdio: 'ignore',
|
|
@@ -769,7 +808,9 @@ function ensureAcptoapi() {
|
|
|
769
808
|
shell: false,
|
|
770
809
|
});
|
|
771
810
|
child.unref();
|
|
772
|
-
_acptoapiBoot =
|
|
811
|
+
_acptoapiBoot.spawned_at = Date.now();
|
|
812
|
+
_acptoapiBoot.pid = child.pid;
|
|
813
|
+
_acptoapiBoot.status = 'spawned';
|
|
773
814
|
logEvent('bootstrap', 'acptoapi.spawned', { pid: child.pid, port });
|
|
774
815
|
} catch (e) {
|
|
775
816
|
logEvent('bootstrap', 'acptoapi.spawn-failed', { error: e && e.message });
|
package/gm.json
CHANGED
package/lib/daemon-bootstrap.js
CHANGED
|
@@ -5,6 +5,28 @@ const { spawn, execSync } = require('child_process');
|
|
|
5
5
|
const os = require('os');
|
|
6
6
|
const spool = require('./spool.js');
|
|
7
7
|
|
|
8
|
+
// Resolve a bare command name to its .exe on Windows. cmd.exe + .cmd shim
|
|
9
|
+
// chains re-enter conhost (visible window flash) even with windowsHide:true
|
|
10
|
+
// on the parent. Spawning the real .exe directly lets CREATE_NO_WINDOW
|
|
11
|
+
// propagate cleanly. Falls back to the original name if no .exe is found.
|
|
12
|
+
// See [[windows-spawn-cmd-shim-flash]] for the discipline rationale.
|
|
13
|
+
function resolveWindowsExe(cmd) {
|
|
14
|
+
if (process.platform !== 'win32') return cmd;
|
|
15
|
+
try {
|
|
16
|
+
const out = execSync(`where ${cmd}`, {
|
|
17
|
+
encoding: 'utf-8',
|
|
18
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
19
|
+
windowsHide: true,
|
|
20
|
+
timeout: 800,
|
|
21
|
+
});
|
|
22
|
+
const lines = out.split(/\r?\n/).map(l => l.trim()).filter(Boolean);
|
|
23
|
+
const exe = lines.find(l => /\.exe$/i.test(l));
|
|
24
|
+
return exe || lines[0] || cmd;
|
|
25
|
+
} catch {
|
|
26
|
+
return cmd;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
8
30
|
const LOG_DIR = path.join(os.homedir(), '.claude', 'gm-log');
|
|
9
31
|
const GM_STATE_DIR = path.join(os.homedir(), '.gm');
|
|
10
32
|
|
|
@@ -159,7 +181,7 @@ async function ensureRsLearningDaemonRunning() {
|
|
|
159
181
|
CLAUDE_SESSION_ID: sessionId,
|
|
160
182
|
});
|
|
161
183
|
|
|
162
|
-
const proc = spawn('bun', ['x', 'rs-learn@latest'], {
|
|
184
|
+
const proc = spawn(resolveWindowsExe('bun'), ['x', 'rs-learn@latest'], {
|
|
163
185
|
detached: true,
|
|
164
186
|
stdio: 'ignore',
|
|
165
187
|
windowsHide: true,
|
|
@@ -213,7 +235,7 @@ async function ensureAcptoapiRunning() {
|
|
|
213
235
|
});
|
|
214
236
|
|
|
215
237
|
try {
|
|
216
|
-
const child = spawn('bun', ['x', 'acptoapi@latest'], {
|
|
238
|
+
const child = spawn(resolveWindowsExe('bun'), ['x', 'acptoapi@latest'], {
|
|
217
239
|
detached: true,
|
|
218
240
|
stdio: 'ignore',
|
|
219
241
|
windowsHide: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm-skill",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1229",
|
|
4
4
|
"description": "Canonical universal harness — AI-native software engineering via skill-driven orchestration; bootstraps plugkit for task execution and session isolation. Install in any AI coding agent host.",
|
|
5
5
|
"author": "AnEntrypoint",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"gm.json"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"gm-plugkit": "^2.0.
|
|
42
|
+
"gm-plugkit": "^2.0.1229"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
45
|
"node": ">=16.0.0"
|