@qalqi/headless-hermes 0.2.1 → 0.3.0
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 +143 -3
- package/agent/.mcp.json +9 -0
- package/agent/AGENTS.md +30 -0
- package/agent/github/workflows/headless-hermes-verify.yml +34 -0
- package/agent/skills/headless-hermes-port/SKILL.md +72 -0
- package/agent/skills/headless-hermes-verify/SKILL.md +58 -0
- package/bin/headless-hermes.js +259 -0
- package/bin/napi-host.js +38 -1
- package/conformance.json +1456 -0
- package/index.js +26 -2
- package/lib/verify.js +102 -0
- package/mcp-server.js +321 -0
- package/package.json +11 -6
package/bin/napi-host.js
CHANGED
|
@@ -1,6 +1,43 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
+
// Two modes:
|
|
4
|
+
// npx napi-host <script.js> [addons] [-- args] (default: the native host)
|
|
5
|
+
// npx napi-host --verify [manifest] [--json] (deterministic .headless/verify.json replay, no AI)
|
|
6
|
+
//
|
|
7
|
+
// --verify runs the installed napi-host once per test and diffs stdout against the golden files
|
|
8
|
+
// in the manifest; it is the cheap CI replay. The manifest is written once by an agent.
|
|
9
|
+
|
|
3
10
|
const { spawnSync } = require('child_process');
|
|
4
|
-
const
|
|
11
|
+
const path = require('path');
|
|
12
|
+
|
|
13
|
+
const args = process.argv.slice(2);
|
|
14
|
+
if (args[0] === '--verify') {
|
|
15
|
+
const manifestPath = args.find((a) => !a.startsWith('--')) || path.join(process.cwd(), '.headless', 'verify.json');
|
|
16
|
+
let verify;
|
|
17
|
+
try { verify = require('../lib/verify.js'); }
|
|
18
|
+
catch { verify = require(path.join(__dirname, '..', 'lib', 'verify.js')); }
|
|
19
|
+
|
|
20
|
+
let report;
|
|
21
|
+
try {
|
|
22
|
+
report = verify.replay(path.resolve(manifestPath), process.cwd());
|
|
23
|
+
} catch (e) {
|
|
24
|
+
console.error(`verify: ${e.message}`);
|
|
25
|
+
process.exit(2);
|
|
26
|
+
}
|
|
27
|
+
if (process.argv.includes('--json')) {
|
|
28
|
+
console.log(JSON.stringify({ ok: report.ok, engine: report.engine, tests: report.tests, note: report.note }, null, 1));
|
|
29
|
+
} else {
|
|
30
|
+
const pin = report.engine;
|
|
31
|
+
console.log(`${pin.ok ? 'ok ' : 'FAIL'} engine ${pin.note}`);
|
|
32
|
+
if (report.note) console.log(`ok ${report.note}`);
|
|
33
|
+
for (const t of report.tests) {
|
|
34
|
+
console.log(`${t.ok ? 'ok ' : 'FAIL'} ${t.name}`);
|
|
35
|
+
if (!t.ok && t.reason) console.log(` ${t.reason.split('\n').join('\n ')}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
process.exit(report.ok ? 0 : 1);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const r = spawnSync(require('..').bin('napi-host'), args, { stdio: 'inherit' });
|
|
5
42
|
if (r.error) { console.error(r.error.message); process.exit(1); }
|
|
6
43
|
process.exit(r.status === null ? 1 : r.status);
|