@hmharness/cli 0.23.34 → 0.23.36

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.
@@ -63,9 +63,9 @@ let PACKAGES = ['cli', 'web', 'agent', 'kernel', 'sandbox', 'evolution',
63
63
  // The release bot keeps versions synced; the NAMES must cover the full
64
64
  // first-party set so the offline path cannot produce an incomplete tree.
65
65
  const FALLBACK_PINS = {
66
- cli: '0.23.34', web: '0.23.34', agent: '0.23.34', kernel: '0.23.34',
67
- sandbox: '0.23.34', evolution: '0.23.34', 'domain-ops': '0.23.34',
68
- evaluation: '0.23.34', observability: '0.23.34', 'domain-harmony': '0.23.34',
66
+ cli: '0.23.36', web: '0.23.36', agent: '0.23.36', kernel: '0.23.36',
67
+ sandbox: '0.23.36', evolution: '0.23.36', 'domain-ops': '0.23.36',
68
+ evaluation: '0.23.36', observability: '0.23.36', 'domain-harmony': '0.23.36',
69
69
  };
70
70
 
71
71
  // ---------- helpers ---------------------------------------------------------
@@ -44,7 +44,16 @@ function exposedFilter() {
44
44
  const pats = raw.split(',').map((s) => s.trim()).filter(Boolean);
45
45
  return (t) => pats.some((p) => t.name === p || t.name.startsWith(p.endsWith('_') || p.endsWith('-') ? p : p + '_'));
46
46
  }
47
- return (t) => t.name.startsWith('harmony_');
47
+ // The user's REAL browser via the extension bridge: read-only trio by
48
+ // default. extension_page_act moves the user's logged-in pages and its
49
+ // per-call approval gate lives in the agent runner, NOT on this stdio
50
+ // surface — so it ships ONLY behind an explicit opt-in.
51
+ const allowAct = process.env.HMH_MCP_EXTENSION_ACT === '1';
52
+ return (t) => t.name.startsWith('harmony_')
53
+ || t.name === 'extension_status'
54
+ || t.name === 'extension_tabs'
55
+ || t.name === 'extension_page_read'
56
+ || (allowAct && t.name === 'extension_page_act');
48
57
  }
49
58
  export async function serveMcp() {
50
59
  // stdout is the protocol channel: silence any library prints.
@@ -52,6 +61,21 @@ export async function serveMcp() {
52
61
  console.log = (...a) => console.error(...a);
53
62
  void realLog;
54
63
  const { reg } = await buildRegistry({ mcp: false, announce: false });
64
+ // MCP hosts list tools ONCE at startup; a browser opened later must not
65
+ // leave the extension family invisible until the next host restart. If the
66
+ // agent's registry skipped it (bridge healthy but no extension connected
67
+ // YET), register on a healthy bridge alone — every call re-checks over
68
+ // HTTP and fails honestly with the next step when no browser is there.
69
+ if (!reg.list().some((t) => t.name === 'extension_status')) {
70
+ try {
71
+ const { discoverExtensionBridgeSync, extensionTools } = await import('@hmharness/extension');
72
+ const { pageReadSink } = await import('@hmharness/agent');
73
+ if (discoverExtensionBridgeSync(homeDir()).healthy) {
74
+ reg.registerAll(extensionTools({ home: homeDir(), onPageRead: pageReadSink(homeDir()) }));
75
+ }
76
+ }
77
+ catch { /* extension optional: never block the MCP surface */ }
78
+ }
55
79
  const tools = reg.list().filter(exposedFilter());
56
80
  const byName = new Map(tools.map((t) => [t.name, t]));
57
81
  const ctx = { cwd: process.cwd(), home: homeDir() };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hmharness/cli",
3
- "version": "0.23.34",
3
+ "version": "0.23.36",
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",
@@ -45,20 +45,20 @@
45
45
  "build": "tsc -p tsconfig.build.json"
46
46
  },
47
47
  "dependencies": {
48
- "@hmharness/agent": "0.23.34",
49
- "@hmharness/browser": "0.23.34",
50
- "@hmharness/cognitive": "0.23.34",
51
- "@hmharness/domain-harmony": "0.23.34",
52
- "@hmharness/domain-ops": "0.23.34",
53
- "@hmharness/environments": "0.23.34",
54
- "@hmharness/evaluation": "0.23.34",
55
- "@hmharness/evolution": "0.23.34",
56
- "@hmharness/extension": "0.23.34",
57
- "@hmharness/kernel": "0.23.34",
58
- "@hmharness/observability": "0.23.34",
59
- "@hmharness/sandbox": "0.23.34",
60
- "@hmharness/web": "0.23.34",
48
+ "@hmharness/agent": "0.23.36",
49
+ "@hmharness/browser": "0.23.36",
50
+ "@hmharness/cognitive": "0.23.36",
51
+ "@hmharness/domain-harmony": "0.23.36",
52
+ "@hmharness/domain-ops": "0.23.36",
53
+ "@hmharness/environments": "0.23.36",
54
+ "@hmharness/evaluation": "0.23.36",
55
+ "@hmharness/evolution": "0.23.36",
56
+ "@hmharness/extension": "0.23.36",
57
+ "@hmharness/kernel": "0.23.36",
58
+ "@hmharness/observability": "0.23.36",
59
+ "@hmharness/sandbox": "0.23.36",
60
+ "@hmharness/web": "0.23.36",
61
61
  "qrcode": "^1.5.4",
62
- "@hmharness/lsp": "0.23.34"
62
+ "@hmharness/lsp": "0.23.36"
63
63
  }
64
64
  }
@@ -1,5 +1,15 @@
1
1
  {
2
2
  "notes": [
3
+ {
4
+ "v": "0.23.36",
5
+ "date": "2026-10-18",
6
+ "note": "Web server 按路由域拆分为六模块(44 条中 38 条出仓,server.ts 减 44%,逐字搬运+每域真服务器冒烟锁定合约);MCP 面暴露浏览器扩展只读工具族(操作类需显式 opt-in)"
7
+ },
8
+ {
9
+ "v": "0.23.35",
10
+ "date": "2026-10-16",
11
+ "note": "P0-C 桌面桥契约闭环(单实例守卫:拒绝启动绝不误杀);执行前动作门生产化(v0.24 研究 66 真跑交付:opt-in 条件化门控+轨迹遥测,默认关);长时运行压测(崩溃恢复游标契约,重复执行陷阱实锤并修复)"
12
+ },
3
13
  {
4
14
  "v": "0.23.34",
5
15
  "date": "2026-10-15",