claudemesh-cli 0.10.1 → 0.10.2
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/index.js +74 -75
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -40189,7 +40189,7 @@ var package_default;
|
|
|
40189
40189
|
var init_package = __esm(() => {
|
|
40190
40190
|
package_default = {
|
|
40191
40191
|
name: "claudemesh-cli",
|
|
40192
|
-
version: "0.10.
|
|
40192
|
+
version: "0.10.2",
|
|
40193
40193
|
description: "Claude Code MCP client for claudemesh — peer mesh messaging between Claude sessions.",
|
|
40194
40194
|
keywords: [
|
|
40195
40195
|
"claude-code",
|
|
@@ -54909,9 +54909,74 @@ async function runDoctor() {
|
|
|
54909
54909
|
// src/commands/welcome.ts
|
|
54910
54910
|
init_config();
|
|
54911
54911
|
import { existsSync as existsSync6, readFileSync as readFileSync5 } from "node:fs";
|
|
54912
|
-
import { homedir as homedir6, hostname as
|
|
54912
|
+
import { homedir as homedir6, hostname as hostname4 } from "node:os";
|
|
54913
54913
|
import { join as join6 } from "node:path";
|
|
54914
54914
|
import { createInterface as createInterface2 } from "node:readline";
|
|
54915
|
+
|
|
54916
|
+
// src/commands/peers.ts
|
|
54917
|
+
init_config();
|
|
54918
|
+
import { hostname as hostname3 } from "node:os";
|
|
54919
|
+
async function runPeers(flags) {
|
|
54920
|
+
const useColor = !process.env.NO_COLOR && process.env.TERM !== "dumb" && process.stdout.isTTY;
|
|
54921
|
+
const dim2 = (s) => useColor ? `\x1B[2m${s}\x1B[22m` : s;
|
|
54922
|
+
const bold3 = (s) => useColor ? `\x1B[1m${s}\x1B[22m` : s;
|
|
54923
|
+
const green2 = (s) => useColor ? `\x1B[32m${s}\x1B[39m` : s;
|
|
54924
|
+
const yellow2 = (s) => useColor ? `\x1B[33m${s}\x1B[39m` : s;
|
|
54925
|
+
const config2 = loadConfig();
|
|
54926
|
+
const meshes = flags.mesh ? config2.meshes.filter((m) => m.slug === flags.mesh) : config2.meshes;
|
|
54927
|
+
if (meshes.length === 0) {
|
|
54928
|
+
console.error(flags.mesh ? `Mesh "${flags.mesh}" not found. Joined: ${config2.meshes.map((m) => m.slug).join(", ")}` : "No meshes joined. Run `claudemesh join <url>` first.");
|
|
54929
|
+
process.exit(1);
|
|
54930
|
+
}
|
|
54931
|
+
const allPeers = [];
|
|
54932
|
+
for (const mesh of meshes) {
|
|
54933
|
+
const displayName = config2.displayName ?? `${hostname3()}-${process.pid}`;
|
|
54934
|
+
const client2 = new BrokerClient(mesh, { displayName });
|
|
54935
|
+
try {
|
|
54936
|
+
await client2.connect();
|
|
54937
|
+
const peers = await client2.listPeers();
|
|
54938
|
+
if (flags.json) {
|
|
54939
|
+
allPeers.push({ mesh: mesh.slug, peers });
|
|
54940
|
+
continue;
|
|
54941
|
+
}
|
|
54942
|
+
console.log(bold3(`Peers on ${mesh.slug}`) + dim2(` (${peers.length})`));
|
|
54943
|
+
console.log("");
|
|
54944
|
+
if (peers.length === 0) {
|
|
54945
|
+
console.log(dim2(" No peers connected."));
|
|
54946
|
+
} else {
|
|
54947
|
+
for (const p of peers) {
|
|
54948
|
+
const groups = p.groups.length ? " [" + p.groups.map((g) => `@${g.name}${g.role ? `:${g.role}` : ""}`).join(", ") + "]" : "";
|
|
54949
|
+
const statusIcon = p.status === "working" ? yellow2("●") : green2("●");
|
|
54950
|
+
const name = bold3(p.displayName);
|
|
54951
|
+
const meta2 = [];
|
|
54952
|
+
if (p.peerType)
|
|
54953
|
+
meta2.push(p.peerType);
|
|
54954
|
+
if (p.channel)
|
|
54955
|
+
meta2.push(p.channel);
|
|
54956
|
+
if (p.model)
|
|
54957
|
+
meta2.push(p.model);
|
|
54958
|
+
const metaStr = meta2.length ? dim2(` (${meta2.join(", ")})`) : "";
|
|
54959
|
+
const cwdStr = p.cwd ? dim2(` cwd: ${p.cwd}`) : "";
|
|
54960
|
+
const summary = p.summary ? dim2(` ${p.summary}`) : "";
|
|
54961
|
+
console.log(` ${statusIcon} ${name}${groups}${metaStr}${summary}`);
|
|
54962
|
+
if (cwdStr)
|
|
54963
|
+
console.log(` ${cwdStr}`);
|
|
54964
|
+
}
|
|
54965
|
+
}
|
|
54966
|
+
console.log("");
|
|
54967
|
+
} catch (e) {
|
|
54968
|
+
console.error(dim2(` Could not connect to ${mesh.slug}: ${e instanceof Error ? e.message : String(e)}`));
|
|
54969
|
+
console.log("");
|
|
54970
|
+
} finally {
|
|
54971
|
+
client2.close();
|
|
54972
|
+
}
|
|
54973
|
+
}
|
|
54974
|
+
if (flags.json) {
|
|
54975
|
+
console.log(JSON.stringify(meshes.length === 1 ? allPeers[0]?.peers : allPeers, null, 2));
|
|
54976
|
+
}
|
|
54977
|
+
}
|
|
54978
|
+
|
|
54979
|
+
// src/commands/welcome.ts
|
|
54915
54980
|
init_colors();
|
|
54916
54981
|
init_spinner();
|
|
54917
54982
|
function detectState() {
|
|
@@ -55045,7 +55110,7 @@ async function runWelcome() {
|
|
|
55045
55110
|
}
|
|
55046
55111
|
const { generateKeypair: generateKeypair3 } = await Promise.resolve().then(() => (init_keypair(), exports_keypair));
|
|
55047
55112
|
const keypair = await generateKeypair3();
|
|
55048
|
-
const displayName = `${
|
|
55113
|
+
const displayName = `${hostname4()}-${process.pid}`;
|
|
55049
55114
|
const { syncWithBroker: syncWithBroker2 } = await Promise.resolve().then(() => exports_sync_with_broker);
|
|
55050
55115
|
const result = await syncWithBroker2(syncToken, keypair.publicKey, displayName);
|
|
55051
55116
|
const config2 = loadConfig();
|
|
@@ -55110,17 +55175,14 @@ async function runWelcome() {
|
|
|
55110
55175
|
await runLaunch({}, []);
|
|
55111
55176
|
return;
|
|
55112
55177
|
case 1:
|
|
55113
|
-
|
|
55114
|
-
|
|
55115
|
-
break;
|
|
55178
|
+
await runPeers({});
|
|
55179
|
+
return;
|
|
55116
55180
|
case 2:
|
|
55117
|
-
|
|
55118
|
-
|
|
55119
|
-
break;
|
|
55181
|
+
await runStatus();
|
|
55182
|
+
return;
|
|
55120
55183
|
case 3:
|
|
55121
|
-
|
|
55122
|
-
|
|
55123
|
-
break;
|
|
55184
|
+
await runDoctor();
|
|
55185
|
+
return;
|
|
55124
55186
|
}
|
|
55125
55187
|
return;
|
|
55126
55188
|
}
|
|
@@ -55164,69 +55226,6 @@ function runWelcomePlain() {
|
|
|
55164
55226
|
console.log("");
|
|
55165
55227
|
}
|
|
55166
55228
|
|
|
55167
|
-
// src/commands/peers.ts
|
|
55168
|
-
init_config();
|
|
55169
|
-
import { hostname as hostname4 } from "node:os";
|
|
55170
|
-
async function runPeers(flags) {
|
|
55171
|
-
const useColor = !process.env.NO_COLOR && process.env.TERM !== "dumb" && process.stdout.isTTY;
|
|
55172
|
-
const dim2 = (s) => useColor ? `\x1B[2m${s}\x1B[22m` : s;
|
|
55173
|
-
const bold3 = (s) => useColor ? `\x1B[1m${s}\x1B[22m` : s;
|
|
55174
|
-
const green2 = (s) => useColor ? `\x1B[32m${s}\x1B[39m` : s;
|
|
55175
|
-
const yellow2 = (s) => useColor ? `\x1B[33m${s}\x1B[39m` : s;
|
|
55176
|
-
const config2 = loadConfig();
|
|
55177
|
-
const meshes = flags.mesh ? config2.meshes.filter((m) => m.slug === flags.mesh) : config2.meshes;
|
|
55178
|
-
if (meshes.length === 0) {
|
|
55179
|
-
console.error(flags.mesh ? `Mesh "${flags.mesh}" not found. Joined: ${config2.meshes.map((m) => m.slug).join(", ")}` : "No meshes joined. Run `claudemesh join <url>` first.");
|
|
55180
|
-
process.exit(1);
|
|
55181
|
-
}
|
|
55182
|
-
const allPeers = [];
|
|
55183
|
-
for (const mesh of meshes) {
|
|
55184
|
-
const displayName = config2.displayName ?? `${hostname4()}-${process.pid}`;
|
|
55185
|
-
const client2 = new BrokerClient(mesh, { displayName });
|
|
55186
|
-
try {
|
|
55187
|
-
await client2.connect();
|
|
55188
|
-
const peers = await client2.listPeers();
|
|
55189
|
-
if (flags.json) {
|
|
55190
|
-
allPeers.push({ mesh: mesh.slug, peers });
|
|
55191
|
-
continue;
|
|
55192
|
-
}
|
|
55193
|
-
console.log(bold3(`Peers on ${mesh.slug}`) + dim2(` (${peers.length})`));
|
|
55194
|
-
console.log("");
|
|
55195
|
-
if (peers.length === 0) {
|
|
55196
|
-
console.log(dim2(" No peers connected."));
|
|
55197
|
-
} else {
|
|
55198
|
-
for (const p of peers) {
|
|
55199
|
-
const groups = p.groups.length ? " [" + p.groups.map((g) => `@${g.name}${g.role ? `:${g.role}` : ""}`).join(", ") + "]" : "";
|
|
55200
|
-
const statusIcon = p.status === "working" ? yellow2("●") : green2("●");
|
|
55201
|
-
const name = bold3(p.displayName);
|
|
55202
|
-
const meta2 = [];
|
|
55203
|
-
if (p.peerType)
|
|
55204
|
-
meta2.push(p.peerType);
|
|
55205
|
-
if (p.channel)
|
|
55206
|
-
meta2.push(p.channel);
|
|
55207
|
-
if (p.model)
|
|
55208
|
-
meta2.push(p.model);
|
|
55209
|
-
const metaStr = meta2.length ? dim2(` (${meta2.join(", ")})`) : "";
|
|
55210
|
-
const cwdStr = p.cwd ? dim2(` cwd: ${p.cwd}`) : "";
|
|
55211
|
-
const summary = p.summary ? dim2(` ${p.summary}`) : "";
|
|
55212
|
-
console.log(` ${statusIcon} ${name}${groups}${metaStr}${summary}`);
|
|
55213
|
-
if (cwdStr)
|
|
55214
|
-
console.log(` ${cwdStr}`);
|
|
55215
|
-
}
|
|
55216
|
-
}
|
|
55217
|
-
console.log("");
|
|
55218
|
-
} catch (e) {
|
|
55219
|
-
console.error(dim2(` Could not connect to ${mesh.slug}: ${e instanceof Error ? e.message : String(e)}`));
|
|
55220
|
-
console.log("");
|
|
55221
|
-
} finally {
|
|
55222
|
-
client2.close();
|
|
55223
|
-
}
|
|
55224
|
-
}
|
|
55225
|
-
if (flags.json) {
|
|
55226
|
-
console.log(JSON.stringify(meshes.length === 1 ? allPeers[0]?.peers : allPeers, null, 2));
|
|
55227
|
-
}
|
|
55228
|
-
}
|
|
55229
|
-
|
|
55230
55229
|
// src/commands/connect.ts
|
|
55231
55230
|
import { hostname as hostname5 } from "node:os";
|
|
55232
55231
|
import { createInterface as createInterface3 } from "node:readline";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudemesh-cli",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"description": "Claude Code MCP client for claudemesh — peer mesh messaging between Claude sessions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude-code",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"prettier": "3.6.2",
|
|
49
49
|
"typescript": "5.9.3",
|
|
50
50
|
"vitest": "4.0.14",
|
|
51
|
-
"@turbostarter/vitest-config": "0.1.0",
|
|
52
51
|
"@turbostarter/tsconfig": "0.1.0",
|
|
53
|
-
"@turbostarter/
|
|
54
|
-
"@turbostarter/eslint-config": "0.1.0"
|
|
52
|
+
"@turbostarter/vitest-config": "0.1.0",
|
|
53
|
+
"@turbostarter/eslint-config": "0.1.0",
|
|
54
|
+
"@turbostarter/prettier-config": "0.1.0"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "bun build src/index.ts --target=node --outfile dist/index.js --banner \"#!/usr/bin/env node\" && chmod +x dist/index.js",
|