gm-skill 2.0.1236 → 2.0.1237
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 +75 -28
- package/gm.json +1 -1
- 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.1237` — 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
|
|
|
@@ -482,6 +482,26 @@ function readCurrentSess() {
|
|
|
482
482
|
// embed call.
|
|
483
483
|
const _hostVecEmbedFailKeys = new Set();
|
|
484
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
|
+
|
|
485
505
|
function logEvent(sub, event, fields) {
|
|
486
506
|
if (process.env.GM_LOG_DISABLE) return;
|
|
487
507
|
try {
|
|
@@ -1474,31 +1494,31 @@ function makeHostFunctions(instanceRef) {
|
|
|
1474
1494
|
try {
|
|
1475
1495
|
const text = readWasmStr(instanceRef.value, textPtr, textLen);
|
|
1476
1496
|
if (!text) return 0n;
|
|
1477
|
-
const
|
|
1478
|
-
|
|
1479
|
-
|
|
1497
|
+
const binPath = resolveRsLearnEmbedPath();
|
|
1498
|
+
if (!binPath) {
|
|
1499
|
+
const key = 'no-binary';
|
|
1500
|
+
if (!_hostVecEmbedFailKeys.has(key)) {
|
|
1501
|
+
_hostVecEmbedFailKeys.add(key);
|
|
1480
1502
|
try {
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
// don't spam — only the first occurrence per process per reason.
|
|
1501
|
-
const reason = (result.stderr || 'no response').slice(0, 300);
|
|
1503
|
+
logEvent('plugkit', 'host_vec_embed.no-binary', {
|
|
1504
|
+
hint: 'rs-learn-embed sidecar not found. Set RS_LEARN_EMBED_PATH or cargo install --path C:\\dev\\rs-learn\\crates\\embed.',
|
|
1505
|
+
});
|
|
1506
|
+
} catch (_) {}
|
|
1507
|
+
}
|
|
1508
|
+
return 0n;
|
|
1509
|
+
}
|
|
1510
|
+
const reqLine = JSON.stringify({ id: 1, text }) + '\n';
|
|
1511
|
+
const cacheDir = path.join(process.cwd(), '.gm', 'embed-cache');
|
|
1512
|
+
try { fs.mkdirSync(cacheDir, { recursive: true }); } catch (_) {}
|
|
1513
|
+
const result = spawnSync(binPath, [], {
|
|
1514
|
+
input: reqLine,
|
|
1515
|
+
encoding: 'utf-8',
|
|
1516
|
+
timeout: 300000,
|
|
1517
|
+
windowsHide: true,
|
|
1518
|
+
env: { ...process.env, RS_LEARN_EMBED_CACHE: cacheDir },
|
|
1519
|
+
});
|
|
1520
|
+
if (result.status !== 0) {
|
|
1521
|
+
const reason = (result.stderr || 'unknown').slice(0, 300);
|
|
1502
1522
|
const key = String(result.status) + '|' + reason;
|
|
1503
1523
|
if (!_hostVecEmbedFailKeys.has(key)) {
|
|
1504
1524
|
_hostVecEmbedFailKeys.add(key);
|
|
@@ -1507,16 +1527,43 @@ function makeHostFunctions(instanceRef) {
|
|
|
1507
1527
|
status: result.status,
|
|
1508
1528
|
reason,
|
|
1509
1529
|
text_len: text.length,
|
|
1510
|
-
|
|
1530
|
+
via: 'rs-learn-embed sidecar',
|
|
1511
1531
|
});
|
|
1512
1532
|
} catch (_) {}
|
|
1513
1533
|
}
|
|
1514
|
-
console.error('[plugkit-wasm] host_vec_embed FAILED:', reason);
|
|
1515
1534
|
return 0n;
|
|
1516
1535
|
}
|
|
1517
|
-
|
|
1536
|
+
const lines = (result.stdout || '').split('\n').filter(l => l.trim());
|
|
1537
|
+
for (let i = lines.length - 1; i >= 0; i--) {
|
|
1538
|
+
try {
|
|
1539
|
+
const j = JSON.parse(lines[i]);
|
|
1540
|
+
if (Array.isArray(j.embedding)) {
|
|
1541
|
+
return writeWasmStr(instanceRef.value, JSON.stringify(j.embedding));
|
|
1542
|
+
}
|
|
1543
|
+
if (j.error) {
|
|
1544
|
+
const key = 'sidecar-error|' + j.error;
|
|
1545
|
+
if (!_hostVecEmbedFailKeys.has(key)) {
|
|
1546
|
+
_hostVecEmbedFailKeys.add(key);
|
|
1547
|
+
try { logEvent('plugkit', 'host_vec_embed.failed', { reason: j.error, via: 'rs-learn-embed sidecar' }); } catch (_) {}
|
|
1548
|
+
}
|
|
1549
|
+
return 0n;
|
|
1550
|
+
}
|
|
1551
|
+
} catch (_) {}
|
|
1552
|
+
}
|
|
1553
|
+
const key = 'no-embedding';
|
|
1554
|
+
if (!_hostVecEmbedFailKeys.has(key)) {
|
|
1555
|
+
_hostVecEmbedFailKeys.add(key);
|
|
1556
|
+
try {
|
|
1557
|
+
logEvent('plugkit', 'host_vec_embed.failed', {
|
|
1558
|
+
reason: 'no embedding in sidecar response',
|
|
1559
|
+
stdout_excerpt: (result.stdout || '').slice(0, 300),
|
|
1560
|
+
via: 'rs-learn-embed sidecar',
|
|
1561
|
+
});
|
|
1562
|
+
} catch (_) {}
|
|
1563
|
+
}
|
|
1564
|
+
return 0n;
|
|
1518
1565
|
} catch (e) {
|
|
1519
|
-
|
|
1566
|
+
try { logEvent('plugkit', 'host_vec_embed.exception', { message: e.message }); } catch (_) {}
|
|
1520
1567
|
return 0n;
|
|
1521
1568
|
}
|
|
1522
1569
|
},
|
package/gm.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm-skill",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1237",
|
|
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.1237"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
45
|
"node": ">=16.0.0"
|