gm-skill 2.0.1231 → 2.0.1233

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 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.1231` — auto-bumped from the canonical `gm` repo. Every push to `AnEntrypoint/gm` (or any cascading sibling crate) republishes this package.
38
+ `2.0.1233` — 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
 
@@ -477,6 +477,11 @@ function readCurrentSess() {
477
477
  return __sessCache.value;
478
478
  }
479
479
 
480
+ // iter13: dedup set for host_vec_embed.failed event emissions — we only
481
+ // want one event per distinct failure-reason per process, not one per
482
+ // embed call.
483
+ const _hostVecEmbedFailKeys = new Set();
484
+
480
485
  function logEvent(sub, event, fields) {
481
486
  if (process.env.GM_LOG_DISABLE) return;
482
487
  try {
@@ -913,7 +918,17 @@ function getOrCreateBrowserSession(cwd, claudeSessionId, pw) {
913
918
  '--no-default-browser-check',
914
919
  '--disable-features=Translate',
915
920
  ];
916
- const child = spawn(chrome, chromeArgs, { detached: true, stdio: 'ignore' });
921
+ // Chrome itself is GUI but its remote-debugging port creates conhost
922
+ // when launched from a console-attached parent. CREATE_NO_WINDOW
923
+ // (0x08000000) | DETACHED_PROCESS (0x00000008) prevents the helper
924
+ // processes (sandbox, GPU, network service) from allocating consoles.
925
+ // Inherited by the entire chrome subprocess tree on Windows.
926
+ const child = spawn(chrome, chromeArgs, {
927
+ detached: true,
928
+ stdio: 'ignore',
929
+ windowsHide: true,
930
+ ...(process.platform === 'win32' ? { creationFlags: 0x08000000 | 0x00000008 } : {}),
931
+ });
917
932
  const chromePid = child.pid;
918
933
  child.unref();
919
934
  const deadline = Date.now() + 10000;
@@ -1461,13 +1476,42 @@ function makeHostFunctions(instanceRef) {
1461
1476
  if (!text) return 0n;
1462
1477
  const body = JSON.stringify({ model: EMBED_MODEL_DEFAULT, input: text });
1463
1478
  const result = spawnSync(process.execPath, ['-e', `
1464
- fetch('${ACPTOAPI_URL}/v1/embeddings', { method: 'POST', headers: { 'content-type': 'application/json' }, body: ${JSON.stringify(body)} })
1465
- .then(r => { if (!r.ok) throw new Error('HTTP ' + r.status); return r.text(); })
1466
- .then(t => process.stdout.write(t))
1467
- .catch(e => { process.stderr.write('embed-error: ' + e.message); process.exit(2); });
1468
- `], { encoding: 'utf-8', timeout: 30000 });
1479
+ (async () => {
1480
+ try {
1481
+ const r = await fetch('${ACPTOAPI_URL}/v1/embeddings', { method: 'POST', headers: { 'content-type': 'application/json' }, body: ${JSON.stringify(body)} });
1482
+ if (!r.ok) {
1483
+ const errBody = await r.text();
1484
+ throw new Error('HTTP ' + r.status + ': ' + errBody.slice(0, 300));
1485
+ }
1486
+ const t = await r.text();
1487
+ process.stdout.write(t);
1488
+ } catch (e) {
1489
+ process.stderr.write('embed-error: ' + e.message);
1490
+ process.exit(2);
1491
+ }
1492
+ })();
1493
+ `], { encoding: 'utf-8', timeout: 30000, windowsHide: true });
1469
1494
  if (result.status !== 0 || !result.stdout) {
1470
- console.error('[plugkit-wasm] host_vec_embed FAILED:', result.stderr || 'no response');
1495
+ // iter13: failures here had been silently returning 0n which surfaced
1496
+ // as auto_recall.count=0 with no diagnostic. acptoapi 1.0.102+
1497
+ // returns 410 Gone on /v1/embeddings (embeddings now live in
1498
+ // rs-learn natively). Log a structured event so the failure is
1499
+ // visible in gmsniff. Dedup on the (status, reason) key so we
1500
+ // don't spam — only the first occurrence per process per reason.
1501
+ const reason = (result.stderr || 'no response').slice(0, 300);
1502
+ const key = String(result.status) + '|' + reason;
1503
+ if (!_hostVecEmbedFailKeys.has(key)) {
1504
+ _hostVecEmbedFailKeys.add(key);
1505
+ try {
1506
+ logEvent('plugkit', 'host_vec_embed.failed', {
1507
+ status: result.status,
1508
+ reason,
1509
+ text_len: text.length,
1510
+ hint: 'acptoapi 1.0.102+ returns 410 on /v1/embeddings — embeddings are served by rs-learn natively. Once rs-learn-embed sidecar is wired into host_vec_embed, this event will stop firing.',
1511
+ });
1512
+ } catch (_) {}
1513
+ }
1514
+ console.error('[plugkit-wasm] host_vec_embed FAILED:', reason);
1471
1515
  return 0n;
1472
1516
  }
1473
1517
  return writeWasmStr(instanceRef.value, result.stdout);
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.1231",
3
+ "version": "2.0.1233",
4
4
  "description": "Spool-dispatch orchestration engine with unified state machine, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
@@ -292,11 +292,12 @@ async function ensureRsCodeinsightDaemonRunning() {
292
292
  CLAUDE_SESSION_ID: sessionId,
293
293
  });
294
294
 
295
- const proc = spawn('bun', ['x', 'rs-codeinsight@latest'], {
295
+ const proc = spawn(resolveWindowsExe('bun'), ['x', 'rs-codeinsight@latest'], {
296
296
  detached: true,
297
297
  stdio: 'ignore',
298
298
  windowsHide: true,
299
299
  env,
300
+ creationFlags: 0x08000000 | 0x00000008,
300
301
  });
301
302
 
302
303
  const pid = proc.pid;
@@ -337,11 +338,12 @@ async function ensureRsSearchDaemonRunning() {
337
338
  CLAUDE_SESSION_ID: sessionId,
338
339
  });
339
340
 
340
- const proc = spawn('bun', ['x', 'rs-search@latest'], {
341
+ const proc = spawn(resolveWindowsExe('bun'), ['x', 'rs-search@latest'], {
341
342
  detached: true,
342
343
  stdio: 'ignore',
343
344
  windowsHide: true,
344
345
  env,
346
+ creationFlags: 0x08000000 | 0x00000008,
345
347
  });
346
348
 
347
349
  const pid = proc.pid;
@@ -735,11 +735,17 @@ async function spawnPlugkitWatcher(wasmPath) {
735
735
  const logFd = openWatcherLog(projectDir);
736
736
 
737
737
  const runtime = process.platform === 'win32' ? 'bun.exe' : 'bun';
738
+ // CREATE_NO_WINDOW (0x08000000) | DETACHED_PROCESS (0x00000008) —
739
+ // inherited by all descendants so bun.exe → spool watcher → any
740
+ // downstream spawn never allocates a console window. Without this,
741
+ // windowsHide:true only hides the immediate bun.exe child while
742
+ // .cmd shims it later spawns each pop their own conhost.
738
743
  const proc = spawn(runtime, [wrapperPath, 'spool'], {
739
744
  detached: true,
740
745
  stdio: ['ignore', logFd, logFd],
741
746
  windowsHide: true,
742
747
  env: { ...process.env, CLAUDE_PROJECT_DIR: projectDir },
748
+ ...(process.platform === 'win32' ? { creationFlags: 0x08000000 | 0x00000008 } : {}),
743
749
  });
744
750
 
745
751
  try { fs.closeSync(logFd); } catch (_) {}
@@ -927,10 +933,14 @@ async function bootstrapAcptoapi() {
927
933
 
928
934
  emitBootstrapEvent('info', 'Spawning acptoapi daemon');
929
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.
930
939
  const child = spawn('bun', ['x', 'acptoapi@latest'], {
931
940
  detached: true,
932
941
  stdio: 'ignore',
933
942
  windowsHide: true,
943
+ ...(process.platform === 'win32' ? { creationFlags: 0x08000000 | 0x00000008 } : {}),
934
944
  });
935
945
  child.unref();
936
946
  emitBootstrapEvent('info', 'acptoapi spawned', { pid: child.pid });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-skill",
3
- "version": "2.0.1231",
3
+ "version": "2.0.1233",
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.1231"
42
+ "gm-plugkit": "^2.0.1233"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">=16.0.0"