@hmharness/cli 0.18.15 → 0.19.1

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.
Files changed (3) hide show
  1. package/dist/main.js +15 -0
  2. package/dist/tui.js +17 -0
  3. package/package.json +12 -10
package/dist/main.js CHANGED
@@ -909,6 +909,21 @@ flags:
909
909
  await tui(yes, rest.includes('--no-web'));
910
910
  return;
911
911
  }
912
+ if (cmd === 'cognitive') {
913
+ // Cognitive OS (blueprint 2026-09): read-only status one-pager. The
914
+ // subsystems are libraries first — they come alive when the agent loop
915
+ // and evolution pipeline adopt them; this command shows what exists.
916
+ await initHome();
917
+ const sub = rest.find((a) => !a.startsWith('-'));
918
+ if (sub !== 'status') {
919
+ stdout.write('用法: hmh cognitive status — 认知子系统状态(记忆五层/轨迹库/进化审计/环境注册表)\n');
920
+ return;
921
+ }
922
+ const { cognitiveStatus, formatCognitiveStatus } = await import('@hmharness/cognitive');
923
+ const status = await cognitiveStatus(homeDir());
924
+ stdout.write(formatCognitiveStatus(status) + '\n');
925
+ return;
926
+ }
912
927
  if (cmd === 'web') {
913
928
  await initHome();
914
929
  const port = Number(rest.find((a) => a.startsWith('--port='))?.slice(7) ?? 7788);
package/dist/tui.js CHANGED
@@ -121,6 +121,7 @@ export const COMMANDS = [
121
121
  { name: '/review', key: 'cmdReview' },
122
122
  { name: '/web', key: 'cmdWeb' },
123
123
  { name: '/remote', key: 'cmdRemote' },
124
+ { name: '/cognitive', key: 'cmdCognitive' },
124
125
  { name: '/exit', key: 'cmdExit' },
125
126
  ];
126
127
  /** Commands whose name starts with the input (input must start with '/'). */
@@ -2442,6 +2443,22 @@ export async function tui(yes, noWeb = false, opts = {}) {
2442
2443
  rt.addText(up ? t.tuiWebLinked(DEFAULT_WEB_PORT) : t.tuiWebHint, 'dim');
2443
2444
  return;
2444
2445
  }
2446
+ if (line === '/cognitive') {
2447
+ // Cognitive OS status (blueprint RD seed): same one-pager as
2448
+ // `hmh cognitive status` — memory layers, trajectories, audit, envs.
2449
+ rt.setBusy(true, '/cognitive');
2450
+ try {
2451
+ const { cognitiveStatus, formatCognitiveStatus } = await import('@hmharness/cognitive');
2452
+ const status = await cognitiveStatus(homeDir());
2453
+ for (const l of formatCognitiveStatus(status).split('\n'))
2454
+ rt.addText(l, 'plain');
2455
+ }
2456
+ catch (err) {
2457
+ rt.addText(String(err), 'err');
2458
+ }
2459
+ rt.setBusy(false);
2460
+ return;
2461
+ }
2445
2462
  if (line === '/remote' || line === '/remote lan' || line === '/remote wan') {
2446
2463
  // 2026-09-28 DSH Desktop pattern: /remote shows a QR of a ONE-TIME
2447
2464
  // pairing link fetched from the running web server (/api/pair-info).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hmharness/cli",
3
- "version": "0.18.15",
3
+ "version": "0.19.1",
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",
@@ -43,15 +43,17 @@
43
43
  "build": "tsc -p tsconfig.build.json"
44
44
  },
45
45
  "dependencies": {
46
- "@hmharness/agent": "0.18.15",
47
- "@hmharness/domain-harmony": "0.18.15",
48
- "@hmharness/domain-ops": "0.18.15",
49
- "@hmharness/evaluation": "0.18.15",
50
- "@hmharness/evolution": "0.18.15",
51
- "@hmharness/kernel": "0.18.15",
52
- "@hmharness/observability": "0.18.15",
53
- "@hmharness/sandbox": "0.18.15",
54
- "@hmharness/web": "0.18.15",
46
+ "@hmharness/agent": "0.19.1",
47
+ "@hmharness/cognitive": "0.19.1",
48
+ "@hmharness/domain-harmony": "0.19.1",
49
+ "@hmharness/domain-ops": "0.19.1",
50
+ "@hmharness/environments": "0.19.1",
51
+ "@hmharness/evaluation": "0.19.1",
52
+ "@hmharness/evolution": "0.19.1",
53
+ "@hmharness/kernel": "0.19.1",
54
+ "@hmharness/observability": "0.19.1",
55
+ "@hmharness/sandbox": "0.19.1",
56
+ "@hmharness/web": "0.19.1",
55
57
  "qrcode": "^1.5.4"
56
58
  }
57
59
  }