gm-skill 2.0.1226 → 2.0.1228
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 +27 -5
- package/gm.json +1 -1
- package/lib/skill-bootstrap.js +3 -0
- package/lib/spool-dispatch.js +3 -0
- 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.1228` — 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
|
|
|
@@ -47,6 +47,9 @@ const SPOOL_POLL_PATTERNS = [
|
|
|
47
47
|
/\\b(?:cat|head|tail|less|more|type|Get-Content|gc)\\s+(?:-[A-Za-z]+\\s+)*['"]?[^'"|;&]*\\.gm[\\\\/](?:exec-spool|spool)[\\\\/]/i,
|
|
48
48
|
/\\b(?:ls|dir|Get-ChildItem|gci)\\s+(?:-[A-Za-z]+\\s+)*['"]?[^'"|;&]*\\.gm[\\\\/](?:exec-spool|spool)[\\\\/]/i,
|
|
49
49
|
/\\b(?:test|Test-Path|tp)\\s+(?:-[A-Za-z]+\\s+)?['"]?[^'"|;&]*\\.gm[\\\\/](?:exec-spool|spool)[\\\\/]/i,
|
|
50
|
+
/\\bfind\\b[^|]*['"]?[^'"|;&]*\\.gm[\\\\/](?:exec-spool|spool)\\b/i,
|
|
51
|
+
/\\b(?:stat|file|wc|Get-Item|gi|Get-Acl|Resolve-Path|Select-String|sls)\\b[^|]*['"]?[^'"|;&]*\\.gm[\\\\/](?:exec-spool|spool)[\\\\/]?/i,
|
|
52
|
+
/\\b(?:xargs|parallel|fzf)\\b[^|]*\\.gm[\\\\/](?:exec-spool|spool)/i,
|
|
50
53
|
];
|
|
51
54
|
|
|
52
55
|
const SPOOL_POLL_REASON = 'spool polling and bash-reads of .gm/exec-spool/ are forbidden — plugkit is synchronous from your view, and the Read tool is the canonical way to inspect spool files. Specific replacements:\\n\\n- Instead of \`cat .gm/exec-spool/.status.json\` → use the Read tool: \`Read .gm/exec-spool/.status.json\`\\n- Instead of \`ls .gm/exec-spool/out/\` → check the specific response file you wrote, e.g. \`Read .gm/exec-spool/out/<verb>-<N>.json\`\\n- Instead of \`cat .gm/exec-spool/.watcher.log\` → use the Read tool with offset for tailing\\n- Instead of \`sleep N; cat .gm/exec-spool/<...>\` → just Read the response file directly; if it doesn\\'t exist yet, the watcher is dead (Read .gm/exec-spool/.status.json — fresh ts means alive) or the verb is slow (Read .gm/exec-spool/.watcher.log for the dispatch trace)\\n\\nYou are the state machine. Plugkit serves the response the moment you write the request file. If you find yourself thinking "let me just check whether the file is there yet" — use Read. If you find yourself thinking "the watcher might have died" — Read .gm/exec-spool/.status.json. Bash on .gm/exec-spool/ is wrong every single time.';
|
|
@@ -741,19 +744,36 @@ function isPortReachableSync(host, port, timeoutMs) {
|
|
|
741
744
|
s.on('connect', () => { done = true; s.destroy(); process.exit(0); });
|
|
742
745
|
s.on('error', () => { if (!done) process.exit(1); });
|
|
743
746
|
setTimeout(() => { if (!done) { s.destroy(); process.exit(1); } }, ${timeoutMs || 800});
|
|
744
|
-
`], { timeout: (timeoutMs || 800) + 2000 });
|
|
747
|
+
`], { timeout: (timeoutMs || 800) + 2000, windowsHide: true });
|
|
745
748
|
return r.status === 0;
|
|
746
749
|
}
|
|
747
750
|
|
|
748
|
-
let _acptoapiBoot = { spawned_at: 0, pid: null };
|
|
751
|
+
let _acptoapiBoot = { spawned_at: 0, pid: null, last_check_ts: 0, last_check_ok: false };
|
|
749
752
|
function ensureAcptoapi() {
|
|
750
753
|
const host = '127.0.0.1';
|
|
751
754
|
const port = 4800;
|
|
752
755
|
try {
|
|
753
|
-
|
|
754
|
-
|
|
756
|
+
// Two-strike port check: localhost connect can race against node cold-
|
|
757
|
+
// start on Windows. If the first check fails, retry once with a longer
|
|
758
|
+
// timeout before declaring the port dead. iter9 sniff reported 29
|
|
759
|
+
// bootstrap.acptoapi.spawned events in 30m despite acptoapi being alive
|
|
760
|
+
// on :4800 (HTTP 200) — the check flaked under heartbeat-tick load.
|
|
761
|
+
let reachable = isPortReachableSync(host, port, 1500);
|
|
762
|
+
if (!reachable) {
|
|
763
|
+
reachable = isPortReachableSync(host, port, 3000);
|
|
764
|
+
}
|
|
765
|
+
if (reachable) {
|
|
766
|
+
const wasDown = _acptoapiBoot.spawned_at > 0 || !_acptoapiBoot.last_check_ok;
|
|
767
|
+
_acptoapiBoot = { spawned_at: 0, pid: null, status: 'already-running', last_check_ts: Date.now(), last_check_ok: true };
|
|
768
|
+
// Only log on transitions (down → up) so the heartbeat doesn't spam
|
|
769
|
+
// bootstrap.jsonl every 60s with redundant "alive" events.
|
|
770
|
+
if (wasDown) {
|
|
771
|
+
logEvent('bootstrap', 'acptoapi.heartbeat-ok', { port, transition: 'down-to-up' });
|
|
772
|
+
}
|
|
755
773
|
return;
|
|
756
774
|
}
|
|
775
|
+
_acptoapiBoot.last_check_ok = false;
|
|
776
|
+
_acptoapiBoot.last_check_ts = Date.now();
|
|
757
777
|
if (_acptoapiBoot.spawned_at && Date.now() - _acptoapiBoot.spawned_at < 30000) {
|
|
758
778
|
return;
|
|
759
779
|
}
|
|
@@ -766,7 +786,9 @@ function ensureAcptoapi() {
|
|
|
766
786
|
shell: false,
|
|
767
787
|
});
|
|
768
788
|
child.unref();
|
|
769
|
-
_acptoapiBoot =
|
|
789
|
+
_acptoapiBoot.spawned_at = Date.now();
|
|
790
|
+
_acptoapiBoot.pid = child.pid;
|
|
791
|
+
_acptoapiBoot.status = 'spawned';
|
|
770
792
|
logEvent('bootstrap', 'acptoapi.spawned', { pid: child.pid, port });
|
|
771
793
|
} catch (e) {
|
|
772
794
|
logEvent('bootstrap', 'acptoapi.spawn-failed', { error: e && e.message });
|
package/gm.json
CHANGED
package/lib/skill-bootstrap.js
CHANGED
|
@@ -340,6 +340,9 @@ const SPOOL_POLL_PATTERNS = [
|
|
|
340
340
|
/\\b(?:cat|head|tail|less|more|type|Get-Content|gc)\\s+(?:-[A-Za-z]+\\s+)*['"]?[^'"|;&]*\\.gm[\\\\/](?:exec-spool|spool)[\\\\/]/i,
|
|
341
341
|
/\\b(?:ls|dir|Get-ChildItem|gci)\\s+(?:-[A-Za-z]+\\s+)*['"]?[^'"|;&]*\\.gm[\\\\/](?:exec-spool|spool)[\\\\/]/i,
|
|
342
342
|
/\\b(?:test|Test-Path|tp)\\s+(?:-[A-Za-z]+\\s+)?['"]?[^'"|;&]*\\.gm[\\\\/](?:exec-spool|spool)[\\\\/]/i,
|
|
343
|
+
/\\bfind\\b[^|]*['"]?[^'"|;&]*\\.gm[\\\\/](?:exec-spool|spool)\\b/i,
|
|
344
|
+
/\\b(?:stat|file|wc|Get-Item|gi|Get-Acl|Resolve-Path|Select-String|sls)\\b[^|]*['"]?[^'"|;&]*\\.gm[\\\\/](?:exec-spool|spool)[\\\\/]?/i,
|
|
345
|
+
/\\b(?:xargs|parallel|fzf)\\b[^|]*\\.gm[\\\\/](?:exec-spool|spool)/i,
|
|
343
346
|
];
|
|
344
347
|
|
|
345
348
|
const SPOOL_POLL_REASON = 'spool polling and bash-reads of .gm/exec-spool/ are forbidden — plugkit is synchronous from your view, and the Read tool is the canonical way to inspect spool files. Specific replacements:\\n\\n- Instead of \`cat .gm/exec-spool/.status.json\` → use the Read tool: \`Read .gm/exec-spool/.status.json\`\\n- Instead of \`ls .gm/exec-spool/out/\` → check the specific response file you wrote, e.g. \`Read .gm/exec-spool/out/<verb>-<N>.json\`\\n- Instead of \`cat .gm/exec-spool/.watcher.log\` → use the Read tool with offset for tailing\\n- Instead of \`sleep N; cat .gm/exec-spool/<...>\` → just Read the response file directly; if it doesn\\'t exist yet, the watcher is dead (Read .gm/exec-spool/.status.json — fresh ts means alive) or the verb is slow (Read .gm/exec-spool/.watcher.log for the dispatch trace)\\n\\nYou are the state machine. Plugkit serves the response the moment you write the request file. If you find yourself thinking "let me just check whether the file is there yet" — use Read. If you find yourself thinking "the watcher might have died" — Read .gm/exec-spool/.status.json. Bash on .gm/exec-spool/ is wrong every single time.';
|
package/lib/spool-dispatch.js
CHANGED
|
@@ -206,6 +206,9 @@ const SPOOL_POLL_PATTERNS = [
|
|
|
206
206
|
/\b(?:cat|head|tail|less|more|type|Get-Content|gc)\s+(?:-[A-Za-z]+\s+)*['"]?[^'"|;&]*\.gm[\\/](?:exec-spool|spool)[\\/]/i,
|
|
207
207
|
/\b(?:ls|dir|Get-ChildItem|gci)\s+(?:-[A-Za-z]+\s+)*['"]?[^'"|;&]*\.gm[\\/](?:exec-spool|spool)[\\/]/i,
|
|
208
208
|
/\b(?:test|Test-Path|tp)\s+(?:-[A-Za-z]+\s+)?['"]?[^'"|;&]*\.gm[\\/](?:exec-spool|spool)[\\/]/i,
|
|
209
|
+
/\bfind\b[^|]*['"]?[^'"|;&]*\.gm[\\/](?:exec-spool|spool)\b/i,
|
|
210
|
+
/\b(?:stat|file|wc|Get-Item|gi|Get-Acl|Resolve-Path|Select-String|sls)\b[^|]*['"]?[^'"|;&]*\.gm[\\/](?:exec-spool|spool)[\\/]?/i,
|
|
211
|
+
/\b(?:xargs|parallel|fzf)\b[^|]*\.gm[\\/](?:exec-spool|spool)/i,
|
|
209
212
|
];
|
|
210
213
|
|
|
211
214
|
const SPOOL_POLL_REASON = 'spool polling and bash-reads of .gm/exec-spool/ are forbidden — plugkit is synchronous from your view, and the Read tool is the canonical way to inspect spool files. Specific replacements:\n\n- Instead of `cat .gm/exec-spool/.status.json` → use the Read tool: `Read .gm/exec-spool/.status.json`\n- Instead of `ls .gm/exec-spool/out/` → check the specific response file you wrote, e.g. `Read .gm/exec-spool/out/<verb>-<N>.json`\n- Instead of `cat .gm/exec-spool/.watcher.log` → use the Read tool with offset for tailing\n- Instead of `sleep N; cat .gm/exec-spool/<...>` → just Read the response file directly; if it doesn\'t exist yet, the watcher is dead (Read .gm/exec-spool/.status.json — fresh ts means alive) or the verb is slow (Read .gm/exec-spool/.watcher.log for the dispatch trace)\n\nYou are the state machine. Plugkit serves the response the moment you write the request file. If you find yourself thinking "let me just check whether the file is there yet" — use Read. If you find yourself thinking "the watcher might have died" — Read .gm/exec-spool/.status.json. Bash on .gm/exec-spool/ is wrong every single time.';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm-skill",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1228",
|
|
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.1228"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
45
|
"node": ">=16.0.0"
|