gm-skill 2.0.1240 → 2.0.1242
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/bin/plugkit.wasm +0 -0
- package/bin/plugkit.wasm.sha256 +1 -1
- package/gm-plugkit/plugkit-wasm-wrapper.js +4 -74
- package/gm.json +1 -1
- package/lib/daemon-bootstrap.js +0 -57
- package/lib/skill-bootstrap.js +0 -26
- 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.1242` — 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
|
|
package/bin/plugkit.wasm
CHANGED
|
Binary file
|
package/bin/plugkit.wasm.sha256
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
3e3a24fd68ef735adb111dd544bbed77e8841739949327e9288193cd3e8b17b8 plugkit.wasm
|
|
@@ -44,11 +44,11 @@ const SPOOL_POLL_PATTERNS = [
|
|
|
44
44
|
/\\bwhile\\b[^;]*?(?:!|-not)\\s*(?:-(?:f|e)\\s+|Test-Path\\s+)[^;]*?\\.gm[\\\\/](?:exec-spool|spool)/i,
|
|
45
45
|
/\\buntil\\b[^;]*?(?:-f|-e|Test-Path)\\s+[^;]*?\\.gm[\\\\/](?:exec-spool|spool)/i,
|
|
46
46
|
/\\bfor\\s+i\\s+in\\b[^;]*?;\\s*do\\b[^;]*?(?:sleep|Start-Sleep)[^;]*?\\.gm[\\\\/](?:exec-spool|spool)/i,
|
|
47
|
-
/\\b(?:cat|head|tail|less|more|type|Get-Content|gc)\\s+(?:-[A-Za-z]+\\s+)*['"]?[^'"|;&]*\\.gm[\\\\/](?:exec-spool|spool)[\\\\/]/i,
|
|
48
|
-
/\\b(?:
|
|
49
|
-
/\\b(?:
|
|
47
|
+
/\\b(?:cat|head|tail|less|more|type|Get-Content|gc)\\s+(?:-[A-Za-z]+\\s+)*['"]?[^'"|;&]*\\.gm[\\\\/](?:exec-spool|spool)[\\\\/]\\.status\\.json\\b/i,
|
|
48
|
+
/\\b(?:cat|head|tail|less|more|type|Get-Content|gc)\\s+(?:-[A-Za-z]+\\s+)*['"]?[^'"|;&]*\\.gm[\\\\/](?:exec-spool|spool)[\\\\/]\\.watcher\\.log\\b/i,
|
|
49
|
+
/\\b(?:ls|dir|Get-ChildItem|gci)\\s+(?:-[A-Za-z]+\\s+)*['"]?[^'"|;&]*\\.gm[\\\\/](?:exec-spool|spool)(?:[\\\\/](?:in|out)?)?[\\\\/]?['"]?\\s*(?:$|[|;&])/i,
|
|
50
|
+
/\\b(?:test|Test-Path|tp)\\s+(?:-[A-Za-z]+\\s+)?['"]?[^'"|;&]*\\.gm[\\\\/](?:exec-spool|spool)[\\\\/](?:out|in)[\\\\/]/i,
|
|
50
51
|
/\\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
52
|
/\\b(?:xargs|parallel|fzf)\\b[^|]*\\.gm[\\\\/](?:exec-spool|spool)/i,
|
|
53
53
|
];
|
|
54
54
|
|
|
@@ -791,64 +791,6 @@ function isPortReachableSync(host, port, timeoutMs) {
|
|
|
791
791
|
return r.status === 0;
|
|
792
792
|
}
|
|
793
793
|
|
|
794
|
-
let _acptoapiBoot = { spawned_at: 0, pid: null, last_check_ts: 0, last_check_ok: false };
|
|
795
|
-
function ensureAcptoapi() {
|
|
796
|
-
const host = '127.0.0.1';
|
|
797
|
-
const port = 4800;
|
|
798
|
-
try {
|
|
799
|
-
// Two-strike port check: localhost connect can race against node cold-
|
|
800
|
-
// start on Windows. If the first check fails, retry once with a longer
|
|
801
|
-
// timeout before declaring the port dead. iter9 sniff reported 29
|
|
802
|
-
// bootstrap.acptoapi.spawned events in 30m despite acptoapi being alive
|
|
803
|
-
// on :4800 (HTTP 200) — the check flaked under heartbeat-tick load.
|
|
804
|
-
let reachable = isPortReachableSync(host, port, 1500);
|
|
805
|
-
if (!reachable) {
|
|
806
|
-
reachable = isPortReachableSync(host, port, 3000);
|
|
807
|
-
}
|
|
808
|
-
if (reachable) {
|
|
809
|
-
const wasDown = _acptoapiBoot.spawned_at > 0 || !_acptoapiBoot.last_check_ok;
|
|
810
|
-
_acptoapiBoot = { spawned_at: 0, pid: null, status: 'already-running', last_check_ts: Date.now(), last_check_ok: true };
|
|
811
|
-
// Only log on transitions (down → up) so the heartbeat doesn't spam
|
|
812
|
-
// bootstrap.jsonl every 60s with redundant "alive" events.
|
|
813
|
-
if (wasDown) {
|
|
814
|
-
logEvent('bootstrap', 'acptoapi.heartbeat-ok', { port, transition: 'down-to-up' });
|
|
815
|
-
}
|
|
816
|
-
return;
|
|
817
|
-
}
|
|
818
|
-
_acptoapiBoot.last_check_ok = false;
|
|
819
|
-
_acptoapiBoot.last_check_ts = Date.now();
|
|
820
|
-
if (_acptoapiBoot.spawned_at && Date.now() - _acptoapiBoot.spawned_at < 30000) {
|
|
821
|
-
return;
|
|
822
|
-
}
|
|
823
|
-
// Resolve `bun` to its actual .exe on Windows so the spawned daemon
|
|
824
|
-
// doesn't enter conhost via a bun.cmd shim. See
|
|
825
|
-
// [[windows-spawn-cmd-shim-flash]].
|
|
826
|
-
//
|
|
827
|
-
// Use CREATE_NO_WINDOW (0x08000000) | DETACHED_PROCESS (0x00000008)
|
|
828
|
-
// creationFlags so the suppression is INHERITED by every descendant
|
|
829
|
-
// bun-x downloads and launches (acptoapi itself spawns 11 ACP sub-
|
|
830
|
-
// daemons via .cmd shims; without this flag each one pops a conhost
|
|
831
|
-
// window). windowsHide:true alone only hides the immediate child.
|
|
832
|
-
const CREATE_NO_WINDOW = 0x08000000;
|
|
833
|
-
const DETACHED_PROCESS = 0x00000008;
|
|
834
|
-
const cmd = resolveWindowsExeLocal('bun');
|
|
835
|
-
const child = spawn(cmd, ['x', 'acptoapi@latest'], {
|
|
836
|
-
detached: true,
|
|
837
|
-
stdio: 'ignore',
|
|
838
|
-
windowsHide: true,
|
|
839
|
-
shell: false,
|
|
840
|
-
creationFlags: CREATE_NO_WINDOW | DETACHED_PROCESS,
|
|
841
|
-
});
|
|
842
|
-
child.unref();
|
|
843
|
-
_acptoapiBoot.spawned_at = Date.now();
|
|
844
|
-
_acptoapiBoot.pid = child.pid;
|
|
845
|
-
_acptoapiBoot.status = 'spawned';
|
|
846
|
-
logEvent('bootstrap', 'acptoapi.spawned', { pid: child.pid, port });
|
|
847
|
-
} catch (e) {
|
|
848
|
-
logEvent('bootstrap', 'acptoapi.spawn-failed', { error: e && e.message });
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
|
|
852
794
|
function findFreePortSync() {
|
|
853
795
|
const r = spawnSync(process.execPath, ['-e', `
|
|
854
796
|
const net = require('net');
|
|
@@ -980,7 +922,6 @@ function getOrCreateBrowserSession(cwd, claudeSessionId, pw) {
|
|
|
980
922
|
return pwSessionId;
|
|
981
923
|
}
|
|
982
924
|
|
|
983
|
-
const ACPTOAPI_URL = process.env.ACPTOAPI_URL || 'http://127.0.0.1:4800';
|
|
984
925
|
const VEC_K_DEFAULT = 10;
|
|
985
926
|
const EMBED_MODEL_DEFAULT = process.env.EMBED_MODEL || 'mistral/mistral-embed';
|
|
986
927
|
const INFERENCE_MODEL_DEFAULT = process.env.INFERENCE_MODEL || 'groq/llama-3.3-70b-versatile';
|
|
@@ -1737,7 +1678,6 @@ async function runSpoolWatcher(instance, spoolDir) {
|
|
|
1737
1678
|
fs.mkdirSync(outDir, { recursive: true });
|
|
1738
1679
|
|
|
1739
1680
|
try { ensureSpoolPollGate(process.env.CLAUDE_PROJECT_DIR || process.cwd()); } catch (_) {}
|
|
1740
|
-
try { ensureAcptoapi(); } catch (_) {}
|
|
1741
1681
|
|
|
1742
1682
|
const LOCK_PATH = path.join(spoolDir, '.watcher.lock');
|
|
1743
1683
|
let _ownWrapperSha12 = '';
|
|
@@ -1854,7 +1794,6 @@ async function runSpoolWatcher(instance, spoolDir) {
|
|
|
1854
1794
|
const IDLE_CHECK_MS = 60_000;
|
|
1855
1795
|
const SHUTDOWN_REASON_PATH = path.join(spoolDir, '.shutdown-reason.json');
|
|
1856
1796
|
const STATUS_PATH_FOR_TEARDOWN = path.join(spoolDir, '.status.json');
|
|
1857
|
-
const ACPTOAPI_STATUS_PATH = path.join(process.cwd(), '.gm', 'acptoapi-status.json');
|
|
1858
1797
|
let lastActivityMs = Date.now();
|
|
1859
1798
|
function markActivity(source) {
|
|
1860
1799
|
lastActivityMs = Date.now();
|
|
@@ -1877,14 +1816,6 @@ async function runSpoolWatcher(instance, spoolDir) {
|
|
|
1877
1816
|
|
|
1878
1817
|
try { killAllTasks(`teardown:${reason}`); } catch (_) {}
|
|
1879
1818
|
|
|
1880
|
-
try {
|
|
1881
|
-
if (fs.existsSync(ACPTOAPI_STATUS_PATH)) {
|
|
1882
|
-
const status = JSON.parse(fs.readFileSync(ACPTOAPI_STATUS_PATH, 'utf-8'));
|
|
1883
|
-
if (status && Number.isFinite(status.pid)) killPidQuiet(status.pid);
|
|
1884
|
-
try { fs.unlinkSync(ACPTOAPI_STATUS_PATH); } catch (_) {}
|
|
1885
|
-
}
|
|
1886
|
-
} catch (_) {}
|
|
1887
|
-
|
|
1888
1819
|
try {
|
|
1889
1820
|
const portsFile = browserPortsFile(process.cwd());
|
|
1890
1821
|
const sessionsFile = browserSessionsFile(process.cwd());
|
|
@@ -2244,7 +2175,6 @@ async function runSpoolWatcher(instance, spoolDir) {
|
|
|
2244
2175
|
}
|
|
2245
2176
|
setInterval(writeStatus, 5000);
|
|
2246
2177
|
writeStatus();
|
|
2247
|
-
setInterval(() => { try { ensureAcptoapi(); } catch (_) {} }, 60000);
|
|
2248
2178
|
|
|
2249
2179
|
const UPDATE_AVAILABLE_PATH = path.join(spoolDir, '.update-available.json');
|
|
2250
2180
|
const UPDATE_CHECK_INTERVAL_MS = 5 * 60 * 1000;
|
package/gm.json
CHANGED
package/lib/daemon-bootstrap.js
CHANGED
|
@@ -216,62 +216,6 @@ async function ensureRsLearningDaemonRunning() {
|
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
async function ensureAcptoapiRunning() {
|
|
220
|
-
const sessionId = getSessionId();
|
|
221
|
-
const projectDir = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
222
|
-
const statusPath = path.join(projectDir, '.gm', 'acptoapi-status.json');
|
|
223
|
-
|
|
224
|
-
const host = '127.0.0.1';
|
|
225
|
-
const port = 4800;
|
|
226
|
-
|
|
227
|
-
try {
|
|
228
|
-
const reachable = await checkPortReachable(host, port);
|
|
229
|
-
|
|
230
|
-
if (reachable) {
|
|
231
|
-
emitDaemonEvent('acptoapi', 'info', 'Already running', { port, sessionId });
|
|
232
|
-
writeStatusFile('acptoapi', 'running', sessionId);
|
|
233
|
-
return { ok: true, message: 'acptoapi already running' };
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
emitDaemonEvent('acptoapi', 'info', 'Spawning daemon', { port, sessionId });
|
|
237
|
-
|
|
238
|
-
const env = Object.assign({}, process.env, {
|
|
239
|
-
CLAUDE_SESSION_ID: sessionId,
|
|
240
|
-
});
|
|
241
|
-
|
|
242
|
-
try {
|
|
243
|
-
// CREATE_NO_WINDOW | DETACHED_PROCESS — see ensureRsLearningDaemonRunning
|
|
244
|
-
// above. Inherited by acptoapi's 11 ACP sub-daemons so they don't pop
|
|
245
|
-
// conhost windows when bun-x launches their .cmd shims.
|
|
246
|
-
const child = spawn(resolveWindowsExe('bun'), ['x', 'acptoapi@latest'], {
|
|
247
|
-
detached: true,
|
|
248
|
-
stdio: 'ignore',
|
|
249
|
-
windowsHide: true,
|
|
250
|
-
env,
|
|
251
|
-
creationFlags: 0x08000000 | 0x00000008,
|
|
252
|
-
});
|
|
253
|
-
child.unref();
|
|
254
|
-
emitDaemonEvent('acptoapi', 'info', 'Daemon spawned', { pid: child.pid, port, sessionId });
|
|
255
|
-
writeStatusFile('acptoapi', 'spawned', sessionId, child.pid);
|
|
256
|
-
return { ok: true, message: 'acptoapi spawned', pid: child.pid };
|
|
257
|
-
} catch (spawnErr) {
|
|
258
|
-
emitDaemonEvent('acptoapi', 'warn', 'Spawn failed, fallback to SDK', {
|
|
259
|
-
error: spawnErr.message,
|
|
260
|
-
sessionId,
|
|
261
|
-
});
|
|
262
|
-
writeStatusFile('acptoapi', 'spawn_failed', sessionId);
|
|
263
|
-
return { ok: false, message: 'acptoapi spawn failed, fallback to Anthropic SDK', error: spawnErr.message };
|
|
264
|
-
}
|
|
265
|
-
} catch (err) {
|
|
266
|
-
emitDaemonEvent('acptoapi', 'error', 'Check failed', {
|
|
267
|
-
error: err.message,
|
|
268
|
-
sessionId,
|
|
269
|
-
});
|
|
270
|
-
writeStatusFile('acptoapi', 'check_error', sessionId);
|
|
271
|
-
return { ok: false, message: 'acptoapi check failed, fallback to Anthropic SDK', error: err.message };
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
219
|
async function ensureRsCodeinsightDaemonRunning() {
|
|
276
220
|
const daemonName = 'rs-codeinsight';
|
|
277
221
|
const sessionId = getSessionId();
|
|
@@ -459,7 +403,6 @@ async function ensureBrowserReady(sessionId = getSessionId()) {
|
|
|
459
403
|
}
|
|
460
404
|
|
|
461
405
|
module.exports = {
|
|
462
|
-
ensureAcptoapiRunning,
|
|
463
406
|
ensureRsCodeinsightDaemonRunning,
|
|
464
407
|
ensureRsCodeinsightReady,
|
|
465
408
|
ensureRsSearchDaemonRunning,
|
package/lib/skill-bootstrap.js
CHANGED
|
@@ -926,31 +926,6 @@ async function checkPortReachable(host, port, timeoutMs = 500) {
|
|
|
926
926
|
});
|
|
927
927
|
}
|
|
928
928
|
|
|
929
|
-
async function bootstrapAcptoapi() {
|
|
930
|
-
const port = 4800;
|
|
931
|
-
const running = await checkPortReachable('127.0.0.1', port);
|
|
932
|
-
if (running) return { ok: true, status: 'already-running' };
|
|
933
|
-
|
|
934
|
-
emitBootstrapEvent('info', 'Spawning acptoapi daemon');
|
|
935
|
-
try {
|
|
936
|
-
// CREATE_NO_WINDOW | DETACHED_PROCESS — see windows-spawn-cmd-shim-flash
|
|
937
|
-
// memory. acptoapi spawns 11 ACP sub-daemons via .cmd shims; without
|
|
938
|
-
// the inherited CREATE_NO_WINDOW flag each one pops a conhost window.
|
|
939
|
-
const child = spawn('bun', ['x', 'acptoapi@latest'], {
|
|
940
|
-
detached: true,
|
|
941
|
-
stdio: 'ignore',
|
|
942
|
-
windowsHide: true,
|
|
943
|
-
...(process.platform === 'win32' ? { creationFlags: 0x08000000 | 0x00000008 } : {}),
|
|
944
|
-
});
|
|
945
|
-
child.unref();
|
|
946
|
-
emitBootstrapEvent('info', 'acptoapi spawned', { pid: child.pid });
|
|
947
|
-
return { ok: true, status: 'spawned', pid: child.pid };
|
|
948
|
-
} catch (e) {
|
|
949
|
-
emitBootstrapEvent('error', 'Failed to spawn acptoapi', { error: e.message });
|
|
950
|
-
return { ok: false, error: e.message };
|
|
951
|
-
}
|
|
952
|
-
}
|
|
953
|
-
|
|
954
929
|
async function getSnapshot(sessionId, cwd) {
|
|
955
930
|
try {
|
|
956
931
|
const sid = sessionId || process.env.CLAUDE_SESSION_ID || 'default';
|
|
@@ -966,7 +941,6 @@ async function getSnapshot(sessionId, cwd) {
|
|
|
966
941
|
|
|
967
942
|
module.exports = {
|
|
968
943
|
bootstrapPlugkit,
|
|
969
|
-
bootstrapAcptoapi,
|
|
970
944
|
getSnapshot,
|
|
971
945
|
checkPortReachable,
|
|
972
946
|
ensureBuildToolIgnores,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm-skill",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1242",
|
|
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.1242"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
45
|
"node": ">=16.0.0"
|