@hmharness/cli 0.23.17 → 0.23.19
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/dist/main.js +59 -7
- package/package.json +12 -12
package/dist/main.js
CHANGED
|
@@ -911,6 +911,56 @@ flags:
|
|
|
911
911
|
await tui(yes, rest.includes('--no-web'));
|
|
912
912
|
return;
|
|
913
913
|
}
|
|
914
|
+
if (cmd === 'lsp') {
|
|
915
|
+
// LSP management surface (Capability OS first slice: source trust)
|
|
916
|
+
await initHome();
|
|
917
|
+
const sub = rest[0] ?? 'list';
|
|
918
|
+
const { discoverServers } = await import('@hmharness/lsp');
|
|
919
|
+
const { listTrust, trustServer, untrustServer } = await import('@hmharness/lsp');
|
|
920
|
+
if (sub === 'list') {
|
|
921
|
+
const servers = discoverServers(true);
|
|
922
|
+
const trusted = new Map((await listTrust(homeDir())).map((t) => [t.id, t]));
|
|
923
|
+
if (servers.length === 0) {
|
|
924
|
+
stdout.write('(本机未发现任何 language server——PATH 与 DevEco 安装目录均无)\n');
|
|
925
|
+
return;
|
|
926
|
+
}
|
|
927
|
+
for (const s of servers) {
|
|
928
|
+
const t = trusted.get(s.id);
|
|
929
|
+
const state = !t ? (s.origin.includes('DevEco-local') ? '自动信任(官方布局,首次使用钉哈希)' : '未信任(hmh lsp trust ' + s.id + ')') : `${t.autoTrusted ? '自动' : '手动'}信任@${t.trustedAt.slice(0, 10)} sha:${t.sha256.slice(0, 8)}…`;
|
|
930
|
+
stdout.write(` ${s.healthy ? '✓' : '✗'} ${s.id.padEnd(16)} ${s.origin.padEnd(18)} ${s.official ? 'official' : 'COMMUNITY'} · ${state}\n`);
|
|
931
|
+
if (!s.healthy && s.unhealthyReason)
|
|
932
|
+
stdout.write(DIM(` ${s.unhealthyReason}\n`));
|
|
933
|
+
}
|
|
934
|
+
return;
|
|
935
|
+
}
|
|
936
|
+
if (sub === 'trust' || sub === 'untrust') {
|
|
937
|
+
const id = rest[1];
|
|
938
|
+
if (!id) {
|
|
939
|
+
stdout.write(`用法: hmh lsp ${sub} <server-id>(见 hmh lsp list)\n`);
|
|
940
|
+
return;
|
|
941
|
+
}
|
|
942
|
+
if (sub === 'untrust') {
|
|
943
|
+
const ok = await untrustServer(homeDir(), id);
|
|
944
|
+
stdout.write(ok ? `已撤销 ${id} 的信任\n` : `${id} 本就未信任\n`);
|
|
945
|
+
return;
|
|
946
|
+
}
|
|
947
|
+
const server = discoverServers().find((s) => s.id === id);
|
|
948
|
+
if (!server) {
|
|
949
|
+
stdout.write(`未发现 server '${id}'(hmh lsp list 查看可用项)\n`);
|
|
950
|
+
return;
|
|
951
|
+
}
|
|
952
|
+
const r = await trustServer(homeDir(), server);
|
|
953
|
+
if (!r.ok) {
|
|
954
|
+
stdout.write(`信任失败: ${r.error}\n`);
|
|
955
|
+
return;
|
|
956
|
+
}
|
|
957
|
+
stdout.write(`已信任 ${id}(${server.origin})· sha256 钉住 ${r.sha256.slice(0, 16)}…\n`);
|
|
958
|
+
stdout.write(DIM(' 二进制变更后将被拒绝执行(篡改检测);撤销: hmh lsp untrust ' + id + '\n'));
|
|
959
|
+
return;
|
|
960
|
+
}
|
|
961
|
+
stdout.write('用法: hmh lsp list | trust <id> | untrust <id> — 语言服务器发现与健康/信任状态\n');
|
|
962
|
+
return;
|
|
963
|
+
}
|
|
914
964
|
if (cmd === 'cognitive') {
|
|
915
965
|
// Cognitive OS (blueprint 2026-09): read-only status one-pager. The
|
|
916
966
|
// subsystems are libraries first — they come alive when the agent loop
|
|
@@ -1236,16 +1286,18 @@ flags:
|
|
|
1236
1286
|
}
|
|
1237
1287
|
if (sub === 'absorb') {
|
|
1238
1288
|
// crowd loop: merge someone else's summary into local priors
|
|
1239
|
-
// (fingerprint-matched, deduped; local evidence always dominates)
|
|
1240
|
-
//
|
|
1241
|
-
//
|
|
1289
|
+
// (fingerprint-matched, deduped; local evidence always dominates).
|
|
1290
|
+
// Sources: a local file OR --from=<https-url> (e.g. the repo's crowd/
|
|
1291
|
+
// directory — the one-command collective-loop entry).
|
|
1242
1292
|
const file = rest.slice(1).find((a) => !a.startsWith('-'));
|
|
1243
|
-
|
|
1244
|
-
|
|
1293
|
+
const from = rest.find((a) => a.startsWith('--from='))?.slice(7);
|
|
1294
|
+
if (!file && !from) {
|
|
1295
|
+
stdout.write('用法: hmh cognitive absorb <pack.json> | --from=<https-url> — 吸收他人匿名经验为本机先验(指纹须匹配)\n');
|
|
1296
|
+
stdout.write(DIM(' --from 示例: --from=https://raw.githubusercontent.com/swsgbl/hmharness/main/crowd/win32-x64.json\n'));
|
|
1245
1297
|
return;
|
|
1246
1298
|
}
|
|
1247
|
-
const { absorbCrowdSummary } = await import('@hmharness/cognitive');
|
|
1248
|
-
const r = await absorbCrowdSummary(homeDir(), file);
|
|
1299
|
+
const { absorbCrowdSummary, absorbCrowdUrl } = await import('@hmharness/cognitive');
|
|
1300
|
+
const r = from ? await absorbCrowdUrl(homeDir(), from) : await absorbCrowdSummary(homeDir(), file);
|
|
1249
1301
|
if (!r.ok) {
|
|
1250
1302
|
stdout.write(`吸收失败: ${r.error}\n`);
|
|
1251
1303
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hmharness/cli",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.19",
|
|
4
4
|
"description": "hmharness command line: one-shot tasks, an interactive REPL, a fullscreen TUI, the web frontend, and direct tool invocation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -44,17 +44,17 @@
|
|
|
44
44
|
"build": "tsc -p tsconfig.build.json"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@hmharness/agent": "0.23.
|
|
48
|
-
"@hmharness/cognitive": "0.23.
|
|
49
|
-
"@hmharness/domain-harmony": "0.23.
|
|
50
|
-
"@hmharness/domain-ops": "0.23.
|
|
51
|
-
"@hmharness/environments": "0.23.
|
|
52
|
-
"@hmharness/evaluation": "0.23.
|
|
53
|
-
"@hmharness/evolution": "0.23.
|
|
54
|
-
"@hmharness/kernel": "0.23.
|
|
55
|
-
"@hmharness/observability": "0.23.
|
|
56
|
-
"@hmharness/sandbox": "0.23.
|
|
57
|
-
"@hmharness/web": "0.23.
|
|
47
|
+
"@hmharness/agent": "0.23.19",
|
|
48
|
+
"@hmharness/cognitive": "0.23.19",
|
|
49
|
+
"@hmharness/domain-harmony": "0.23.19",
|
|
50
|
+
"@hmharness/domain-ops": "0.23.19",
|
|
51
|
+
"@hmharness/environments": "0.23.19",
|
|
52
|
+
"@hmharness/evaluation": "0.23.19",
|
|
53
|
+
"@hmharness/evolution": "0.23.19",
|
|
54
|
+
"@hmharness/kernel": "0.23.19",
|
|
55
|
+
"@hmharness/observability": "0.23.19",
|
|
56
|
+
"@hmharness/sandbox": "0.23.19",
|
|
57
|
+
"@hmharness/web": "0.23.19",
|
|
58
58
|
"qrcode": "^1.5.4"
|
|
59
59
|
}
|
|
60
60
|
}
|