gm-skill 2.0.1248 → 2.0.1250
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 +10 -103
- package/gm.json +1 -1
- package/lib/skill-bootstrap.js +8 -0
- package/lib/wasm-host.js +0 -5
- 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.1250` — 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,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
package/lib/skill-bootstrap.js
CHANGED
|
@@ -172,12 +172,20 @@ function getManagedGitignoreEntries() {
|
|
|
172
172
|
'.gm/gm-fired-*',
|
|
173
173
|
'.gm/needs-gm',
|
|
174
174
|
'.gm/lastskill',
|
|
175
|
+
'.gm/last-prompt.txt',
|
|
175
176
|
'.gm/turn-state.json',
|
|
176
177
|
'.gm/turn-state.json.corrupted-*',
|
|
177
178
|
'.gm/residual-check-fired',
|
|
178
179
|
'.gm/bootstrap-status.json',
|
|
179
180
|
'.gm/bootstrap-error.json',
|
|
180
181
|
'.gm/rslearn-counter.json',
|
|
182
|
+
'.gm/git-block-counter.json',
|
|
183
|
+
'.gm/no-memorize-this-turn',
|
|
184
|
+
'.gm/learning-state.md',
|
|
185
|
+
'.gm/prd.paused.yml',
|
|
186
|
+
'.gm/rs-learn.db-shm',
|
|
187
|
+
'.gm/rs-learn.db-wal',
|
|
188
|
+
'.gm/hooks/',
|
|
181
189
|
'.gm/trajectory-drafts/',
|
|
182
190
|
'.gm/ingest-drafts/',
|
|
183
191
|
'.gm/prd-state.json',
|
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.
|
|
3
|
+
"version": "2.0.1250",
|
|
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.1250"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
45
|
"node": ">=16.0.0"
|