gm-skill 2.0.1249 → 2.0.1253

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.1249` — auto-bumped from the canonical `gm` repo. Every push to `AnEntrypoint/gm` (or any cascading sibling crate) republishes this package.
38
+ `2.0.1253` — 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
 
@@ -1 +1 @@
1
- 0.1.459
1
+ 0.1.462
package/bin/plugkit.wasm CHANGED
Binary file
@@ -1 +1 @@
1
- 75e1cce243a055d4d6e780dbe28744b89466dcb1c58fb2ebd87125206c78263d plugkit.wasm
1
+ 175d358336173d5f2ada381cb8de8f0364ced988fe46af21ded3f4e95711bc97 plugkit.wasm
@@ -477,31 +477,6 @@ 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
-
485
- let _rsLearnEmbedPath = undefined;
486
- function resolveRsLearnEmbedPath() {
487
- if (_rsLearnEmbedPath !== undefined) return _rsLearnEmbedPath;
488
- const isWin = process.platform === 'win32';
489
- const exe = isWin ? 'rs-learn-embed.exe' : 'rs-learn-embed';
490
- const candidates = [];
491
- if (process.env.RS_LEARN_EMBED_PATH) candidates.push(process.env.RS_LEARN_EMBED_PATH);
492
- const home = os.homedir();
493
- if (home) candidates.push(path.join(home, '.cargo', 'bin', exe));
494
- if (process.env.RS_LEARN_DEV_ROOT) candidates.push(path.join(process.env.RS_LEARN_DEV_ROOT, 'target', 'release', exe));
495
- const devRoot = path.resolve(__dirname, '..', '..', '..', 'rs-learn');
496
- candidates.push(path.join(devRoot, 'target', 'release', exe));
497
- if (isWin) candidates.push(path.join('C:\\dev\\rs-learn\\target\\release', exe));
498
- for (const c of candidates) {
499
- try { if (c && fs.existsSync(c)) { _rsLearnEmbedPath = c; return c; } } catch (_) {}
500
- }
501
- _rsLearnEmbedPath = null;
502
- return null;
503
- }
504
-
505
480
  function logEvent(sub, event, fields) {
506
481
  if (process.env.GM_LOG_DISABLE) return;
507
482
  try {
@@ -1449,84 +1424,6 @@ function makeHostFunctions(instanceRef) {
1449
1424
  }
1450
1425
  },
1451
1426
 
1452
- host_vec_embed: (textPtr, textLen) => {
1453
- try {
1454
- const text = readWasmStr(instanceRef.value, textPtr, textLen);
1455
- if (!text) return 0n;
1456
- const binPath = resolveRsLearnEmbedPath();
1457
- if (!binPath) {
1458
- const key = 'no-binary';
1459
- if (!_hostVecEmbedFailKeys.has(key)) {
1460
- _hostVecEmbedFailKeys.add(key);
1461
- try {
1462
- logEvent('plugkit', 'host_vec_embed.no-binary', {
1463
- hint: 'rs-learn-embed sidecar not found. Set RS_LEARN_EMBED_PATH or cargo install --path C:\\dev\\rs-learn\\crates\\embed.',
1464
- });
1465
- } catch (_) {}
1466
- }
1467
- return 0n;
1468
- }
1469
- const reqLine = JSON.stringify({ id: 1, text }) + '\n';
1470
- const cacheDir = path.join(process.cwd(), '.gm', 'embed-cache');
1471
- try { fs.mkdirSync(cacheDir, { recursive: true }); } catch (_) {}
1472
- const result = spawnSync(binPath, [], {
1473
- input: reqLine,
1474
- encoding: 'utf-8',
1475
- timeout: 300000,
1476
- windowsHide: true,
1477
- env: { ...process.env, RS_LEARN_EMBED_CACHE: cacheDir },
1478
- });
1479
- if (result.status !== 0) {
1480
- const reason = (result.stderr || 'unknown').slice(0, 300);
1481
- const key = String(result.status) + '|' + reason;
1482
- if (!_hostVecEmbedFailKeys.has(key)) {
1483
- _hostVecEmbedFailKeys.add(key);
1484
- try {
1485
- logEvent('plugkit', 'host_vec_embed.failed', {
1486
- status: result.status,
1487
- reason,
1488
- text_len: text.length,
1489
- via: 'rs-learn-embed sidecar',
1490
- });
1491
- } catch (_) {}
1492
- }
1493
- return 0n;
1494
- }
1495
- const lines = (result.stdout || '').split('\n').filter(l => l.trim());
1496
- for (let i = lines.length - 1; i >= 0; i--) {
1497
- try {
1498
- const j = JSON.parse(lines[i]);
1499
- if (Array.isArray(j.embedding)) {
1500
- return writeWasmStr(instanceRef.value, JSON.stringify(j.embedding));
1501
- }
1502
- if (j.error) {
1503
- const key = 'sidecar-error|' + j.error;
1504
- if (!_hostVecEmbedFailKeys.has(key)) {
1505
- _hostVecEmbedFailKeys.add(key);
1506
- try { logEvent('plugkit', 'host_vec_embed.failed', { reason: j.error, via: 'rs-learn-embed sidecar' }); } catch (_) {}
1507
- }
1508
- return 0n;
1509
- }
1510
- } catch (_) {}
1511
- }
1512
- const key = 'no-embedding';
1513
- if (!_hostVecEmbedFailKeys.has(key)) {
1514
- _hostVecEmbedFailKeys.add(key);
1515
- try {
1516
- logEvent('plugkit', 'host_vec_embed.failed', {
1517
- reason: 'no embedding in sidecar response',
1518
- stdout_excerpt: (result.stdout || '').slice(0, 300),
1519
- via: 'rs-learn-embed sidecar',
1520
- });
1521
- } catch (_) {}
1522
- }
1523
- return 0n;
1524
- } catch (e) {
1525
- try { logEvent('plugkit', 'host_vec_embed.exception', { message: e.message }); } catch (_) {}
1526
- return 0n;
1527
- }
1528
- },
1529
-
1530
1427
  host_exec_js: (codePtr, codeLen, optsPtr, optsLen) => {
1531
1428
  try {
1532
1429
  const code = readWasmStr(instanceRef.value, codePtr, codeLen);
@@ -1588,6 +1485,16 @@ function makeHostFunctions(instanceRef) {
1588
1485
 
1589
1486
  host_now_ms: () => BigInt(Date.now()),
1590
1487
 
1488
+ host_random_fill: (ptr, len) => {
1489
+ try {
1490
+ const buf = instanceRef.value.exports.memory.buffer;
1491
+ crypto.randomFillSync(new Uint8Array(buf, ptr, len));
1492
+ return 1;
1493
+ } catch (_) {
1494
+ return 0;
1495
+ }
1496
+ },
1497
+
1591
1498
  host_browser_exec: (bodyPtr, bodyLen, cwdPtr, cwdLen, sidPtr, sidLen) => {
1592
1499
  try {
1593
1500
  const body = readWasmStr(instanceRef.value, bodyPtr, bodyLen);
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.1249",
3
+ "version": "2.0.1253",
4
4
  "description": "Spool-dispatch orchestration engine with unified state machine, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
@@ -17,5 +17,5 @@
17
17
  "publishConfig": {
18
18
  "access": "public"
19
19
  },
20
- "plugkitVersion": "0.1.459"
20
+ "plugkitVersion": "0.1.462"
21
21
  }
package/lib/wasm-host.js CHANGED
@@ -26,7 +26,6 @@ class WasmHost {
26
26
  host_kv_query: this.hostKvQuery.bind(this),
27
27
  host_fetch: this.hostFetch.bind(this),
28
28
  host_vec_search: this.hostVecSearch.bind(this),
29
- host_vec_embed: this.hostVecEmbed.bind(this),
30
29
  host_browser_spawn: this.hostBrowserSpawn.bind(this),
31
30
  host_browser_eval: this.hostBrowserEval.bind(this),
32
31
  host_browser_close: this.hostBrowserClose.bind(this),
@@ -134,10 +133,6 @@ class WasmHost {
134
133
  return 0;
135
134
  }
136
135
 
137
- hostVecEmbed(textPtr, textLen) {
138
- return 0;
139
- }
140
-
141
136
  hostBrowserSpawn(urlPtr, urlLen) {
142
137
  return 0;
143
138
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-skill",
3
- "version": "2.0.1249",
3
+ "version": "2.0.1253",
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.1249"
42
+ "gm-plugkit": "^2.0.1253"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">=16.0.0"