@balababa/codex-mesh 0.2.0 → 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 CHANGED
@@ -31,15 +31,15 @@ see [artifact exports](docs/ARTIFACTS.md).
31
31
 
32
32
  ## npm 安装与普通用户接入
33
33
 
34
- 同一个 **0.2.0** 包包含 Rust Hub/Node/MCP/管理命令、启动器和 Skill。
35
- 普通用户不需要 Rust、源码仓库或本地编译。目前已打包平台为 Linux x86_64、
36
- glibc >=2.35,Node.js >=24.19.0;其他平台会明确报错。
34
+ 当前源码版本为 **0.3.0**,新增 Hub 网页管理界面。Rust Hub/Node/MCP/管理命令、
35
+ 启动器和 Skill 使用同一版本。普通用户不需要 Rust、源码仓库或本地编译。
36
+ 支持 Linux x86_64、glibc >=2.35,Node.js >=24.19.0。
37
37
 
38
- npm 包名为 **`@balababa/codex-mesh`**,使用维护者个人 scope。
39
- 正式发布前可安装本地产物;发布后可运行 `npm install -g @balababa/codex-mesh@0.2.0`:
38
+ 包名为 **`@balababa/codex-mesh`**。npm 已发布版本为 **0.2.0**;当前 0.3.0
39
+ 尚未发布。连接 0.3.0 Hub 时需使用匹配的 0.3.0 本地产物:
40
40
 
41
41
  ```sh
42
- npm install -g /absolute/path/balababa-codex-mesh-0.2.0.tgz
42
+ npm install -g /absolute/path/balababa-codex-mesh-0.3.0.tgz
43
43
  codex-mesh setup
44
44
  codex-mesh doctor
45
45
  codex
@@ -54,7 +54,7 @@ codex
54
54
  同一个本地 tarball 可用于 npx 按需启动 MCP:
55
55
 
56
56
  ```sh
57
- npx --yes --package=/absolute/path/balababa-codex-mesh-0.2.0.tgz \
57
+ npx --yes --package=/absolute/path/balababa-codex-mesh-0.3.0.tgz \
58
58
  codex-mesh mcp --socket /absolute/private/mesh/mcp.sock
59
59
  ```
60
60
 
@@ -140,3 +140,16 @@ $codex-mesh 加入 Mesh,列出在线机器和 Agent。
140
140
 
141
141
  See [ordinary Codex setup and delivery semantics](docs/STOCK_CODEX.md).
142
142
  Building alone does not install the Skill, register MCP or switch a deployment.
143
+
144
+ ## 域名和网页管理
145
+
146
+ 0.3.0 Hub 内置网页版只读集群概览,入口为 `/`。网页使用独立管理凭据,
147
+ 列出所有明确登记的 Agent 和节点,不启动推理、不读取私有会话历史。
148
+ 凭据仅保留在页面内存中;支持搜索、分页和刷新。Hub 仍监听回环地址,
149
+ 公网域名由 HTTPS 反向代理承接。配置模板与验收步骤见
150
+ [PUBLIC_HUB.md](docs/PUBLIC_HUB.md)。真实域名、TLS 和公网连通性需分别验证。
151
+
152
+ For an explicitly chosen daemon outside the default verified version range, use
153
+ `codex-mesh setup --skip-daemon-version-check`. The choice persists for setup and
154
+ doctor; `setup --check-daemon-version` restores checking. Socket security and
155
+ runtime checks remain enabled. See [installation options](docs/INSTALL.md).
package/docs/INSTALL.md CHANGED
@@ -1,12 +1,13 @@
1
1
  # npm installation and ordinary Codex setup
2
2
 
3
- Release version: **0.2.0** (npm, Rust binary and Skill metadata).
3
+ Source release version: **0.3.0** (npm, Rust binary and Skill metadata).
4
4
 
5
5
  The npm package name is **`@balababa/codex-mesh`**, using the maintainer's
6
6
  personal scope. The operator selected this name after the prior organization
7
7
  scope failed publication with `Scope not found`. The command remains `codex-mesh`.
8
- Local tarball installation works before publication; registry installation below
9
- requires a successful publication. The unrelated unscoped `codex-mesh` package
8
+ Version 0.2.0 is published and its registry global/npx installation was verified.
9
+ Source version 0.3.0 adds the Hub dashboard and is not yet published; use its
10
+ matching local tarball with a 0.3.0 Hub. The unrelated unscoped `codex-mesh` package
10
11
  is not this implementation.
11
12
 
12
13
  ## Supported runtime
@@ -19,7 +20,7 @@ libgcc); consumers need no Rust/compiler/source tree. Ordinary Codex daemon
19
20
  0.173.x/0.174.x is the checked compatibility range; 0.174.0 is the real npm
20
21
  acceptance target. The daemon must already be running and normally authenticated.
21
22
 
22
- After publication under an authorized name, the intended command is:
23
+ Install the published 0.2.0 release only when connecting to a matching 0.2.0 Hub:
23
24
 
24
25
  ```sh
25
26
  npm install -g @balababa/codex-mesh@0.2.0
@@ -27,10 +28,10 @@ codex-mesh setup
27
28
  codex-mesh doctor
28
29
  ```
29
30
 
30
- Until publication, use the tested local artifact instead:
31
+ For the 0.3.0 Hub/dashboard build, use the matching local artifact:
31
32
 
32
33
  ```sh
33
- npm install -g /absolute/path/balababa-codex-mesh-0.2.0.tgz
34
+ npm install -g /absolute/path/balababa-codex-mesh-0.3.0.tgz
34
35
  codex-mesh setup
35
36
  codex-mesh doctor
36
37
  ```
@@ -129,7 +130,7 @@ replies use notify to avoid wake loops.
129
130
  The same package provides every Rust subcommand, including stdio MCP:
130
131
 
131
132
  ```sh
132
- npx --yes --package=/absolute/path/balababa-codex-mesh-0.2.0.tgz \
133
+ npx --yes --package=/absolute/path/balababa-codex-mesh-0.3.0.tgz \
133
134
  codex-mesh mcp --socket /absolute/private/mesh-runtime/mcp.sock
134
135
  ```
135
136
 
@@ -191,3 +192,30 @@ Artifacts appear under ignored `artifacts/npm/`. The pack script verifies Rust,
191
192
  npm, binary and Skill versions and writes the binary SHA-256 manifest. It never
192
193
  publishes. Tests install this tarball into an isolated npm global prefix and use
193
194
  npx against the same local artifact. See the repository docs/TEST_REPORT.md for measured scope.
195
+
196
+ ## Public domain and web management
197
+
198
+ 0.3.0 serves its read-only dashboard at the Hub root. Use a management/client
199
+ credential, separate from per-node setup credentials. For verified HTTPS domain
200
+ access, Caddy reverse proxy, external checks and current privilege prerequisites,
201
+ see [PUBLIC_HUB.md](PUBLIC_HUB.md). HTTP remains loopback-only.
202
+
203
+ ## Optional daemon version gate
204
+
205
+ Default setup accepts measured daemon versions 0.173.x/0.174.x. To explicitly try
206
+ another daemon version without upgrading/restarting it, run:
207
+
208
+ ```sh
209
+ codex-mesh setup --skip-daemon-version-check
210
+ codex-mesh doctor
211
+ ```
212
+
213
+ The boolean policy is saved as `skipDaemonVersionCheck` in the private
214
+ `installation.json`; subsequent setup and doctor reuse it. Doctor labels the
215
+ skipped version check explicitly. Re-enable the default with
216
+ `codex-mesh setup --check-daemon-version`. Both flags work with non-interactive
217
+ setup; they are mutually exclusive. Only the version gate is bypassed: running
218
+ daemon discovery, private owned socket checks, actual Node startup/connectivity,
219
+ MCP and all sandbox/approval rules still apply. This does not certify 0.172.0
220
+ native queue/steer compatibility. Use an actual project allowlist rather than
221
+ accepting Downloads unless that is the intended workspace.
@@ -66,17 +66,19 @@ function absoluteProgram(program) {
66
66
  const p=path.join(dir,program);try{fs.accessSync(p,fs.constants.X_OK);return fs.realpathSync(p);}catch{}
67
67
  }throw new Error(`Cannot find ${program}; install ordinary Codex and place it on PATH`);
68
68
  }
69
- function daemon(codex,socketOverride) {
69
+ export function daemonVersionPolicy(options,previous={}) {
70
+ return options.skipDaemonVersionCheck ?? previous.skipDaemonVersionCheck ?? false;
71
+ }
72
+ export function daemon(codex,socketOverride,skipVersionCheck=false) {
70
73
  const d=JSON.parse(command(codex,['app-server','daemon','version']));
71
74
  if(!socketOverride && (d.status!=='running' || !d.socketPath)) throw new Error('Codex owning daemon is not running; start it with your normal Codex workflow, then rerun setup');
72
75
  const socket=path.resolve(socketOverride||d.socketPath);
73
76
  const advertised=fs.lstatSync(socket),resolved=fs.realpathSync(socket),s=fs.statSync(resolved);
74
77
  const parents=[path.dirname(socket),path.dirname(resolved)].map(p=>fs.statSync(p));
75
78
  if(advertised.uid!==process.getuid() || !s.isSocket() || s.uid!==process.getuid() || (s.mode&0o077) || parents.some(p=>!p.isDirectory()||p.uid!==process.getuid()||(p.mode&0o077))) throw new Error('Owning daemon socket/rendezvous directories must be private and owned by this user');
76
- // Stock compatibility was measured on 0.173/0.174; reject older/mismatched APIs
77
- // rather than pretending any app-server supports the required native queue.
79
+ // Version opt-out does not bypass native socket ownership or runtime checks.
78
80
  const v=d.appServerVersion||d.managedCodexVersion||'';
79
- if(!/^0\.(173|174)\./.test(v)) throw new Error(`Unverified Codex daemon ${v}; supported daemon versions are 0.173.x/0.174.x`);
81
+ if(!skipVersionCheck&&!/^0\.(173|174)\./.test(v)) throw new Error(`Unverified Codex daemon ${v}; supported daemon versions are 0.173.x/0.174.x. To try this daemon explicitly, rerun setup --skip-daemon-version-check`);
80
82
  return {socket,version:v,cli:command(codex,['--version'])};
81
83
  }
82
84
  export function localHealth(socket) {
@@ -139,7 +141,7 @@ function options(args) {
139
141
  const o={allowDirs:[]};
140
142
  const names={'--hub':'hub','--token-file':'tokenFile','--node-token-file':'tokenFile','--admin-token-file':'adminTokenFile','--node-id':'nodeId','--node-name':'nodeName','--allow-dir':'allowDirs','--codex':'codex','--daemon-socket':'daemonSocket','--service':'service','--skills-dir':'skillsDir'};
141
143
  for(let i=0;i<args.length;i++){
142
- const a=args[i];if(['--non-interactive','--manager','--help','--json'].includes(a)){o[a.slice(2).replace(/-([a-z])/g,(_,c)=>c.toUpperCase())]=true;continue;}
144
+ const a=args[i];if(a==='--skip-daemon-version-check'||a==='--check-daemon-version'){if(o.skipDaemonVersionCheck!==undefined)throw new Error('Choose only one daemon version policy flag');o.skipDaemonVersionCheck=a==='--skip-daemon-version-check';continue;}if(['--non-interactive','--manager','--help','--json'].includes(a)){o[a.slice(2).replace(/-([a-z])/g,(_,c)=>c.toUpperCase())]=true;continue;}
143
145
  if(!names[a]||!args[i+1]||args[i+1].startsWith('--'))throw new Error(`Unknown or missing option ${a}; see codex-mesh setup --help`);
144
146
  const v=args[++i];if(names[a]==='allowDirs')o.allowDirs.push(v);else o[names[a]]=v;
145
147
  }return o;
@@ -195,7 +197,9 @@ async function setup(o,context) {
195
197
  const nodeId=o.nodeId||old?.nodeId||grant.node_id;
196
198
  if(nodeId!==grant.node_id)throw new Error('Node UUID does not match this node credential (management tokens cannot join)');
197
199
  const codex=absoluteProgram(o.codex||old?.codex||'codex');
198
- const d=daemon(codex,o.daemonSocket);
200
+ const skipDaemonVersionCheck=daemonVersionPolicy(o,old||{});
201
+ const d=daemon(codex,o.daemonSocket,skipDaemonVersionCheck);
202
+ if(skipDaemonVersionCheck)console.error(`Daemon version check skipped by saved/explicit policy (${d.version||"unknown"}); runtime compatibility is not guaranteed.`);
199
203
  const allowed=(o.allowDirs.length?o.allowDirs:old?.allowed||[]).map(p=>fs.realpathSync(path.resolve(p)));
200
204
  if(!allowed.length || allowed.some(p=>!fs.statSync(p).isDirectory()))throw new Error('At least one --allow-dir DIRECTORY is required');
201
205
  const service=o.service||old?.service||'systemd';if(!['systemd','process'].includes(service))throw new Error('--service must be systemd or process');
@@ -205,7 +209,7 @@ async function setup(o,context) {
205
209
  if(!fs.existsSync(binary)){fs.copyFileSync(context.binary,binary,fs.constants.COPYFILE_EXCL);fs.chmodSync(binary,0o700);}
206
210
  if(hash(binary)!==hash(context.binary))throw new Error('Stable binary checksum mismatch');
207
211
  const skillsDir=path.resolve(o.skillsDir||old?.skillsDir||process.env.CODEX_MESH_SKILLS_DIR||path.join(os.homedir(),'.agents/skills'));
208
- const state={root,version:context.version,packageName:JSON.parse(fs.readFileSync(path.join(context.packageRoot,'package.json'))).name,status:'pending',hub,nodeId,nodeName:o.nodeName||old?.nodeName||os.hostname(),codex,daemonSocket:d.socket,allowed,service,skillsDir,binary,socket:path.join(root,'mcp.sock'),nodeConfig:path.join(root,'node.json'),unit:'codex-mesh-'+crypto.createHash('sha256').update(root).digest('hex').slice(0,12)+'.service'};
212
+ const state={root,version:context.version,packageName:JSON.parse(fs.readFileSync(path.join(context.packageRoot,'package.json'))).name,status:'pending',hub,nodeId,nodeName:o.nodeName||old?.nodeName||os.hostname(),codex,daemonSocket:d.socket,skipDaemonVersionCheck,allowed,service,skillsDir,binary,socket:path.join(root,'mcp.sock'),nodeConfig:path.join(root,'node.json'),unit:'codex-mesh-'+crypto.createHash('sha256').update(root).digest('hex').slice(0,12)+'.service'};
209
213
  const current=mcp(codex);
210
214
  if(current&&!matchesMcp(current,old||state))throw new Error('Existing mesh MCP registration is unmanaged; preserve it or explicitly remove it before setup');
211
215
  const target=path.join(skillsDir,'codex-mesh');
@@ -241,7 +245,7 @@ async function inspect(state,context,requireReady=true) {
241
245
  await check('configuration',()=>{privateDir(state.root);privateFile(path.join(state.root,'installation.json'));privateFile(state.nodeConfig);const node=json(state.nodeConfig);if(node.node_id!==state.nodeId||node.local_mcp_socket!==state.socket||JSON.stringify(node.allowed_directories)!==JSON.stringify(state.allowed)||state.allowed.some(p=>fs.realpathSync(p)!==p))throw Error();if(requireReady&&state.status!=='ready')throw Error();if(state.version!==context.version)throw Error();},'Run codex-mesh setup again with this version; incomplete setup is not ready.');
242
246
  await check('binary/Skill version',()=>{if(command(state.binary,['--version'])!==`codex-mesh ${context.version}`||hash(state.binary)!==hash(context.binary))throw Error();const text=fs.readFileSync(path.join(state.skillsDir,'codex-mesh/SKILL.md'),'utf8');if(!text.includes(`version: "${context.version}"`)||text!==fs.readFileSync(path.join(context.packageRoot,'skills/codex-mesh/SKILL.md'),'utf8'))throw Error();},'Run setup to refresh stable binary and managed Skill; leave enrolled sessions before upgrading.');
243
247
  await check('node credential/Hub',async()=>{const grant=await request(hubUrl(state.hub),'/v1/node/check',readToken(path.join(state.root,'node.token')));if(grant.node_id!==state.nodeId||grant.version!==context.version)throw Error();},'Check private node token (chmod 600), SSH tunnel/Hub URL, node UUID and matching Hub version.');
244
- await check('owning Codex daemon',()=>{const d=daemon(state.codex,state.daemonSocket);if(d.socket!==state.daemonSocket)throw Error();},'Start the owning ordinary Codex daemon; rerun setup if its socket changed.');
248
+ await check(state.skipDaemonVersionCheck?'owning Codex daemon (version check skipped by saved policy)':'owning Codex daemon',()=>{const d=daemon(state.codex,state.daemonSocket,state.skipDaemonVersionCheck===true);if(d.socket!==state.daemonSocket)throw Error();},'Start the owning ordinary Codex daemon; rerun setup if its socket changed.');
245
249
  await check('Node service',async()=>{if(!serviceAlive(state))throw Error();const h=await localHealth(state.socket);if(h.node_id!==state.nodeId||h.version!==context.version||!h.hub_connected)throw Error();},'Inspect private node.log and rerun setup. Never restart the user Codex daemon for a Mesh upgrade.');
246
250
  await check('MCP registration',()=>{if(!matchesMcp(mcp(state.codex),state))throw Error();},'Run setup in the same CODEX_HOME used by your ordinary Codex.');
247
251
  await check('MCP initialize/tools',()=>{const messages=[{jsonrpc:'2.0',id:1,method:'initialize',params:{protocolVersion:'2024-11-05',capabilities:{},clientInfo:{name:'mesh-doctor',version:context.version}}},{jsonrpc:'2.0',id:2,method:'tools/list',params:{}}];const output=command(state.binary,['mcp','--socket',state.socket],{input:messages.map(m=>JSON.stringify(m)+'\n').join('')});const replies=output.split('\n').map(JSON.parse);if(!replies.find(r=>r.id===1&&r.result)||replies.find(r=>r.id===2)?.result?.tools?.length!==8)throw Error();},'Repair the managed Node/socket and rerun setup; doctor never calls mesh_join.');
@@ -260,7 +264,7 @@ export function savedAgentArgs(args) {
260
264
  }
261
265
  export async function main(args,context) {
262
266
  const [action,...rest]=args;const o=options(rest);
263
- if(o.help){console.log(`codex-mesh ${action}\nsetup [--non-interactive] --hub URL --token-file FILE [--node-id UUID] --allow-dir DIR...\n [--node-name NAME] [--codex PATH] [--daemon-socket PATH] [--service systemd|process]\n [--skills-dir DIR] [--admin-token-file FILE]\nsetup --manager [--non-interactive] --hub URL --admin-token-file FILE\ndoctor [--json]\nCredentials are FILE paths only; never pass token values. CODEX_MESH_HOME isolates Mesh state.\nDefault systemd user service survives terminals; process backend is explicitly opt-in and needs setup after reboot.\nUpgrade: install new npm version, leave Mesh sessions, rerun setup; no install hooks restart services.`);return;}
267
+ if(o.help){console.log(`codex-mesh ${action}\nsetup [--non-interactive] --hub URL --token-file FILE [--node-id UUID] --allow-dir DIR...\n [--node-name NAME] [--codex PATH] [--daemon-socket PATH] [--service systemd|process]\n [--skills-dir DIR] [--admin-token-file FILE]\n [--skip-daemon-version-check | --check-daemon-version]\nsetup --manager [--non-interactive] --hub URL --admin-token-file FILE\ndoctor [--json]\nCredentials are FILE paths only; never pass token values. CODEX_MESH_HOME isolates Mesh state.\nDefault systemd user service survives terminals; process backend is explicitly opt-in and needs setup after reboot.\nDaemon version policy is saved; skip only bypasses version gating, never socket security or runtime checks.\nUpgrade: install new npm version, leave Mesh sessions, rerun setup; no install hooks restart services.`);return;}
264
268
  if(action==='setup')return setup(o,context);
265
269
  const root=home();const file=path.join(root,'installation.json');let checks;
266
270
  if(fs.existsSync(file)){try{checks=await inspect(json(file),context);}catch{checks=[{name:'configuration',ok:false,fix:'Saved installation configuration is incomplete/invalid; rerun setup with explicit options after preserving its private runtime state.'}];}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@balababa/codex-mesh",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Session-native Mesh Hub, ordinary Codex MCP/Skill and Agent management",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
Binary file
package/release.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "0.2.0",
2
+ "version": "0.3.0",
3
3
  "protocolVersion": 1,
4
4
  "platforms": {
5
5
  "linux-x64-gnu": {
6
6
  "path": "platforms/linux-x64-gnu/codex-mesh",
7
- "sha256": "531429c37563df5f487b5813db4981c29151d94e030347e2b6051bb84cc442c9",
7
+ "sha256": "83ff1768379f66447f45e933613a94d89c649ee0bca9adf13caea69714179eda",
8
8
  "nodeMinimum": "24.19.0",
9
9
  "glibcMinimum": "2.35"
10
10
  }
@@ -2,7 +2,7 @@
2
2
  name: codex-mesh
3
3
  description: Connect ordinary Codex to Codex Mesh (集群/机器/Agent 通信). Use when the user wants to join or leave Mesh, discover enrolled agents or machines, send a peer message, or read Mesh replies. Mesh MCP supplies the actions; this skill explains the workflow.
4
4
  metadata:
5
- version: "0.2.0"
5
+ version: "0.3.0"
6
6
  ---
7
7
 
8
8
  # Codex Mesh
@@ -1,4 +1,4 @@
1
- # Host setup for packaged Mesh 0.2.0
1
+ # Host setup for packaged Mesh 0.3.0
2
2
 
3
3
  The Skill supplies instructions; MCP performs actions; a persistent local Node
4
4
  receives messages and wakes explicitly enrolled native sessions. Installing or
@@ -26,7 +26,7 @@ supported reload or a new session. Do not call mesh_join merely to diagnose an
26
26
  installation. Doctor checks readiness without inference or enrollment.
27
27
 
28
28
  For an npm/npx MCP entry, first complete host setup, then use the exact authorized
29
- package version with `npx --yes --package=<package>@0.2.0 codex-mesh mcp --socket
29
+ package version with `npx --yes --package=<package>@0.3.0 codex-mesh mcp --socket
30
30
  /private/mesh/mcp.sock`. The Node remains in stable managed storage. The package
31
31
  name is `@balababa/codex-mesh` under the maintainer personal scope; registry
32
32
  installation requires publication of that version. Do not install the unrelated unscoped `codex-mesh` package.