claudemesh-cli 1.20.1 → 1.21.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/dist/entrypoints/cli.js +53 -131
- package/dist/entrypoints/cli.js.map +12 -14
- package/dist/entrypoints/mcp.js +3 -12
- package/dist/entrypoints/mcp.js.map +3 -3
- package/package.json +1 -1
package/dist/entrypoints/cli.js
CHANGED
|
@@ -88,7 +88,7 @@ __export(exports_urls, {
|
|
|
88
88
|
VERSION: () => VERSION,
|
|
89
89
|
URLS: () => URLS
|
|
90
90
|
});
|
|
91
|
-
var URLS, VERSION = "1.
|
|
91
|
+
var URLS, VERSION = "1.21.0", env;
|
|
92
92
|
var init_urls = __esm(() => {
|
|
93
93
|
URLS = {
|
|
94
94
|
BROKER: process.env.CLAUDEMESH_BROKER_URL ?? "wss://ic.claudemesh.com/ws",
|
|
@@ -398,7 +398,6 @@ var init_client = __esm(() => {
|
|
|
398
398
|
var exports_my = {};
|
|
399
399
|
__export(exports_my, {
|
|
400
400
|
revokeSession: () => revokeSession,
|
|
401
|
-
reslugMesh: () => reslugMesh,
|
|
402
401
|
renameMesh: () => renameMesh,
|
|
403
402
|
getProfile: () => getProfile,
|
|
404
403
|
getMeshes: () => getMeshes,
|
|
@@ -415,15 +414,7 @@ async function getMeshes(token) {
|
|
|
415
414
|
async function createMesh(token, body) {
|
|
416
415
|
return post("/api/my/meshes", body, token);
|
|
417
416
|
}
|
|
418
|
-
async function renameMesh(token,
|
|
419
|
-
return request({
|
|
420
|
-
path: `/api/cli/meshes/${slug}`,
|
|
421
|
-
method: "PATCH",
|
|
422
|
-
body: { name: newName },
|
|
423
|
-
token
|
|
424
|
-
});
|
|
425
|
-
}
|
|
426
|
-
async function reslugMesh(token, oldSlug, newSlug) {
|
|
417
|
+
async function renameMesh(token, oldSlug, newSlug) {
|
|
427
418
|
return request({
|
|
428
419
|
path: `/api/cli/meshes/${oldSlug}`,
|
|
429
420
|
method: "PATCH",
|
|
@@ -3667,15 +3658,14 @@ async function runLaunchWizard(opts) {
|
|
|
3667
3658
|
spinner.stop();
|
|
3668
3659
|
const choice = await menuSelect({
|
|
3669
3660
|
title: "Select mesh",
|
|
3670
|
-
items: opts.meshes.map((m) => m.
|
|
3661
|
+
items: opts.meshes.map((m) => m.slug),
|
|
3671
3662
|
row
|
|
3672
3663
|
});
|
|
3673
3664
|
mesh = opts.meshes[choice];
|
|
3674
3665
|
for (let i = 0;i < opts.meshes.length + 1; i++) {
|
|
3675
3666
|
writeCentered(row + i, " ");
|
|
3676
3667
|
}
|
|
3677
|
-
|
|
3678
|
-
writeCentered(row, `Mesh ${green("✓")} ${meshLabel}`);
|
|
3668
|
+
writeCentered(row, `Mesh ${green("✓")} ${mesh.slug}`);
|
|
3679
3669
|
spinner.start();
|
|
3680
3670
|
row++;
|
|
3681
3671
|
}
|
|
@@ -4392,29 +4382,17 @@ var init_create = __esm(() => {
|
|
|
4392
4382
|
});
|
|
4393
4383
|
|
|
4394
4384
|
// src/services/mesh/rename.ts
|
|
4395
|
-
async function renameMesh2(
|
|
4385
|
+
async function renameMesh2(oldSlug, newSlug) {
|
|
4396
4386
|
const auth = getStoredToken();
|
|
4397
4387
|
if (!auth)
|
|
4398
4388
|
throw new Error("Not signed in");
|
|
4399
|
-
await exports_my.renameMesh(auth.session_token,
|
|
4389
|
+
return await exports_my.renameMesh(auth.session_token, oldSlug, newSlug);
|
|
4400
4390
|
}
|
|
4401
4391
|
var init_rename = __esm(() => {
|
|
4402
4392
|
init_facade3();
|
|
4403
4393
|
init_facade6();
|
|
4404
4394
|
});
|
|
4405
4395
|
|
|
4406
|
-
// src/services/mesh/reslug.ts
|
|
4407
|
-
async function reslugMesh2(oldSlug, newSlug) {
|
|
4408
|
-
const auth = getStoredToken();
|
|
4409
|
-
if (!auth)
|
|
4410
|
-
throw new Error("Not signed in");
|
|
4411
|
-
return await exports_my.reslugMesh(auth.session_token, oldSlug, newSlug);
|
|
4412
|
-
}
|
|
4413
|
-
var init_reslug = __esm(() => {
|
|
4414
|
-
init_facade3();
|
|
4415
|
-
init_facade6();
|
|
4416
|
-
});
|
|
4417
|
-
|
|
4418
4396
|
// src/services/mesh/leave.ts
|
|
4419
4397
|
function leaveMesh(slug) {
|
|
4420
4398
|
return removeMeshConfig(slug);
|
|
@@ -4456,7 +4434,6 @@ var init_facade10 = __esm(() => {
|
|
|
4456
4434
|
init_list();
|
|
4457
4435
|
init_create();
|
|
4458
4436
|
init_rename();
|
|
4459
|
-
init_reslug();
|
|
4460
4437
|
init_leave();
|
|
4461
4438
|
init_join();
|
|
4462
4439
|
init_resolve_target();
|
|
@@ -5059,7 +5036,7 @@ async function deleteMesh(slug, opts = {}) {
|
|
|
5059
5036
|
}
|
|
5060
5037
|
render.section("select mesh to remove");
|
|
5061
5038
|
config.meshes.forEach((m, i) => {
|
|
5062
|
-
process.stdout.write(` ${bold(String(i + 1) + ")")} ${clay(m.slug)}
|
|
5039
|
+
process.stdout.write(` ${bold(String(i + 1) + ")")} ${clay(m.slug)}
|
|
5063
5040
|
`);
|
|
5064
5041
|
});
|
|
5065
5042
|
render.blank();
|
|
@@ -5157,58 +5134,9 @@ var exports_rename = {};
|
|
|
5157
5134
|
__export(exports_rename, {
|
|
5158
5135
|
rename: () => rename
|
|
5159
5136
|
});
|
|
5160
|
-
async function rename(
|
|
5161
|
-
const auth = getStoredToken();
|
|
5162
|
-
if (!auth) {
|
|
5163
|
-
console.error(` ${icons.cross} Renaming a mesh requires a claudemesh.com account session.`);
|
|
5164
|
-
console.error(` ${dim("Joining via invite signs you in to the mesh, not to a web account.")}`);
|
|
5165
|
-
console.error(` ${dim("Run")} ${bold("claudemesh login")} ${dim("first, then retry, or rename from the dashboard:")}`);
|
|
5166
|
-
console.error(` https://claudemesh.com/dashboard`);
|
|
5167
|
-
return EXIT.AUTH_FAILED;
|
|
5168
|
-
}
|
|
5169
|
-
try {
|
|
5170
|
-
await renameMesh2(slug, newName);
|
|
5171
|
-
const cfg = readConfig();
|
|
5172
|
-
const local = cfg.meshes.find((m) => m.slug === slug);
|
|
5173
|
-
if (local)
|
|
5174
|
-
setMeshConfig(slug, { ...local, name: newName });
|
|
5175
|
-
console.log(` ${green(icons.check)} Renamed "${slug}" to "${newName}"`);
|
|
5176
|
-
console.log(` ${dim('(slug stays "' + slug + '" — only the display name changed)')}`);
|
|
5177
|
-
return EXIT.SUCCESS;
|
|
5178
|
-
} catch (err) {
|
|
5179
|
-
if (err instanceof ApiError) {
|
|
5180
|
-
const body = err.body;
|
|
5181
|
-
const detail = body?.error ?? err.statusText;
|
|
5182
|
-
console.error(` ${icons.cross} ${detail}`);
|
|
5183
|
-
if (err.status === 401)
|
|
5184
|
-
return EXIT.AUTH_FAILED;
|
|
5185
|
-
if (err.status === 403)
|
|
5186
|
-
return EXIT.PERMISSION_DENIED;
|
|
5187
|
-
if (err.status === 404)
|
|
5188
|
-
return EXIT.NOT_FOUND;
|
|
5189
|
-
return EXIT.INTERNAL_ERROR;
|
|
5190
|
-
}
|
|
5191
|
-
console.error(` ${icons.cross} Failed: ${err instanceof Error ? err.message : err}`);
|
|
5192
|
-
return EXIT.INTERNAL_ERROR;
|
|
5193
|
-
}
|
|
5194
|
-
}
|
|
5195
|
-
var init_rename2 = __esm(() => {
|
|
5196
|
-
init_facade10();
|
|
5197
|
-
init_facade6();
|
|
5198
|
-
init_facade3();
|
|
5199
|
-
init_facade();
|
|
5200
|
-
init_styles();
|
|
5201
|
-
init_exit_codes();
|
|
5202
|
-
});
|
|
5203
|
-
|
|
5204
|
-
// src/commands/slug.ts
|
|
5205
|
-
var exports_slug = {};
|
|
5206
|
-
__export(exports_slug, {
|
|
5207
|
-
slug: () => slug
|
|
5208
|
-
});
|
|
5209
|
-
async function slug(oldSlug, newSlug) {
|
|
5137
|
+
async function rename(oldSlug, newSlug) {
|
|
5210
5138
|
if (!oldSlug || !newSlug) {
|
|
5211
|
-
console.error(` ${icons.cross} Usage: ${bold("claudemesh
|
|
5139
|
+
console.error(` ${icons.cross} Usage: ${bold("claudemesh rename")} <old-slug> <new-slug>`);
|
|
5212
5140
|
return EXIT.INVALID_ARGS;
|
|
5213
5141
|
}
|
|
5214
5142
|
if (!SLUG_RE.test(newSlug)) {
|
|
@@ -5233,14 +5161,14 @@ async function slug(oldSlug, newSlug) {
|
|
|
5233
5161
|
return EXIT.ALREADY_EXISTS;
|
|
5234
5162
|
}
|
|
5235
5163
|
try {
|
|
5236
|
-
const updated = await
|
|
5164
|
+
const updated = await renameMesh2(oldSlug, newSlug);
|
|
5237
5165
|
const local = cfg.meshes.find((m) => m.slug === oldSlug);
|
|
5238
5166
|
if (local) {
|
|
5239
5167
|
removeMeshConfig(oldSlug);
|
|
5240
|
-
setMeshConfig(updated.slug, { ...local, slug: updated.slug, name: updated.
|
|
5168
|
+
setMeshConfig(updated.slug, { ...local, slug: updated.slug, name: updated.slug });
|
|
5241
5169
|
}
|
|
5242
|
-
console.log(` ${green(icons.check)}
|
|
5243
|
-
console.log(` ${dim("Other peers will pick up the new
|
|
5170
|
+
console.log(` ${green(icons.check)} Renamed: "${oldSlug}" → "${updated.slug}"`);
|
|
5171
|
+
console.log(` ${dim("Other peers will pick up the new identifier after they run")} ${bold("claudemesh sync")}`);
|
|
5244
5172
|
return EXIT.SUCCESS;
|
|
5245
5173
|
} catch (err) {
|
|
5246
5174
|
if (err instanceof ApiError) {
|
|
@@ -5261,7 +5189,7 @@ async function slug(oldSlug, newSlug) {
|
|
|
5261
5189
|
}
|
|
5262
5190
|
}
|
|
5263
5191
|
var SLUG_RE;
|
|
5264
|
-
var
|
|
5192
|
+
var init_rename2 = __esm(() => {
|
|
5265
5193
|
init_facade10();
|
|
5266
5194
|
init_facade6();
|
|
5267
5195
|
init_facade3();
|
|
@@ -6384,7 +6312,7 @@ async function invite(email, opts = {}) {
|
|
|
6384
6312
|
Select mesh to share:
|
|
6385
6313
|
`);
|
|
6386
6314
|
config.meshes.forEach((m, i) => {
|
|
6387
|
-
console.log(` ${bold(String(i + 1) + ")")} ${m.slug}
|
|
6315
|
+
console.log(` ${bold(String(i + 1) + ")")} ${m.slug}`);
|
|
6388
6316
|
});
|
|
6389
6317
|
console.log("");
|
|
6390
6318
|
const choice = await prompt4(" Choice [1]: ") || "1";
|
|
@@ -6818,17 +6746,17 @@ function projectFields(record, fields) {
|
|
|
6818
6746
|
}
|
|
6819
6747
|
return out;
|
|
6820
6748
|
}
|
|
6821
|
-
async function listPeersForMesh(
|
|
6749
|
+
async function listPeersForMesh(slug) {
|
|
6822
6750
|
const config = readConfig();
|
|
6823
|
-
const joined = config.meshes.find((m) => m.slug ===
|
|
6751
|
+
const joined = config.meshes.find((m) => m.slug === slug);
|
|
6824
6752
|
const selfMemberPubkey = joined?.pubkey ?? null;
|
|
6825
|
-
const bridged = await tryBridge(
|
|
6753
|
+
const bridged = await tryBridge(slug, "peers");
|
|
6826
6754
|
if (bridged && bridged.ok) {
|
|
6827
6755
|
const peers = bridged.result;
|
|
6828
6756
|
return peers.map((p) => annotateSelf(p, selfMemberPubkey, null));
|
|
6829
6757
|
}
|
|
6830
6758
|
let result = [];
|
|
6831
|
-
await withMesh({ meshSlug:
|
|
6759
|
+
await withMesh({ meshSlug: slug }, async (client) => {
|
|
6832
6760
|
const all = await client.listPeers();
|
|
6833
6761
|
const selfSessionPubkey = client.getSessionPubkey();
|
|
6834
6762
|
result = all.map((p) => annotateSelf(p, selfMemberPubkey, selfSessionPubkey));
|
|
@@ -6851,15 +6779,15 @@ async function runPeers(flags) {
|
|
|
6851
6779
|
const fieldList = typeof flags.json === "string" && flags.json.length > 0 ? flags.json.split(",").map((s) => s.trim()).filter(Boolean) : null;
|
|
6852
6780
|
const wantsJson = flags.json !== undefined && flags.json !== false;
|
|
6853
6781
|
const allJson = [];
|
|
6854
|
-
for (const
|
|
6782
|
+
for (const slug of slugs) {
|
|
6855
6783
|
try {
|
|
6856
|
-
const peers = await listPeersForMesh(
|
|
6784
|
+
const peers = await listPeersForMesh(slug);
|
|
6857
6785
|
if (wantsJson) {
|
|
6858
6786
|
const projected = fieldList ? peers.map((p) => projectFields(p, fieldList)) : peers;
|
|
6859
|
-
allJson.push({ mesh:
|
|
6787
|
+
allJson.push({ mesh: slug, peers: projected });
|
|
6860
6788
|
continue;
|
|
6861
6789
|
}
|
|
6862
|
-
render.section(`peers on ${
|
|
6790
|
+
render.section(`peers on ${slug} (${peers.length})`);
|
|
6863
6791
|
if (peers.length === 0) {
|
|
6864
6792
|
render.info(dim(" (no peers connected)"));
|
|
6865
6793
|
continue;
|
|
@@ -6884,7 +6812,7 @@ async function runPeers(flags) {
|
|
|
6884
6812
|
render.info(dim(` cwd: ${p.cwd}`));
|
|
6885
6813
|
}
|
|
6886
6814
|
} catch (e) {
|
|
6887
|
-
render.err(`${
|
|
6815
|
+
render.err(`${slug}: ${e instanceof Error ? e.message : String(e)}`);
|
|
6888
6816
|
}
|
|
6889
6817
|
}
|
|
6890
6818
|
if (wantsJson) {
|
|
@@ -7173,11 +7101,11 @@ async function runMe(flags) {
|
|
|
7173
7101
|
}
|
|
7174
7102
|
const slugWidth = Math.max(...ws.meshes.map((m) => m.slug.length), 8);
|
|
7175
7103
|
for (const m of ws.meshes) {
|
|
7176
|
-
const
|
|
7104
|
+
const slug = cyan(m.slug.padEnd(slugWidth));
|
|
7177
7105
|
const peers = `${m.online}/${m.peers}`;
|
|
7178
7106
|
const role = dim(m.myRole);
|
|
7179
7107
|
const unread = m.unreadMentions > 0 ? " " + yellow(`${m.unreadMentions} @you`) : "";
|
|
7180
|
-
process.stdout.write(` ${
|
|
7108
|
+
process.stdout.write(` ${slug} ${peers.padStart(5)} online ${dim(String(m.topics).padStart(2) + " topics")} ${role}${unread}
|
|
7181
7109
|
`);
|
|
7182
7110
|
}
|
|
7183
7111
|
return EXIT.SUCCESS;
|
|
@@ -7207,11 +7135,11 @@ async function runMeTopics(flags) {
|
|
|
7207
7135
|
const slugWidth = Math.max(...visible.map((t) => t.meshSlug.length), 6);
|
|
7208
7136
|
const nameWidth = Math.max(...visible.map((t) => t.name.length), 8);
|
|
7209
7137
|
for (const t of visible) {
|
|
7210
|
-
const
|
|
7138
|
+
const slug = dim(t.meshSlug.padEnd(slugWidth));
|
|
7211
7139
|
const name = cyan(t.name.padEnd(nameWidth));
|
|
7212
7140
|
const unread = t.unread > 0 ? yellow(`${t.unread} unread`.padStart(10)) : dim("·".padStart(10));
|
|
7213
7141
|
const last = t.lastMessageAt ? dim(formatRelativeTime(t.lastMessageAt)) : dim("never");
|
|
7214
|
-
process.stdout.write(` ${
|
|
7142
|
+
process.stdout.write(` ${slug} ${name} ${unread} ${last}
|
|
7215
7143
|
`);
|
|
7216
7144
|
}
|
|
7217
7145
|
return EXIT.SUCCESS;
|
|
@@ -7247,13 +7175,13 @@ async function runMeNotifications(flags) {
|
|
|
7247
7175
|
}
|
|
7248
7176
|
const slugWidth = Math.max(...ws.notifications.map((n) => n.meshSlug.length), 6);
|
|
7249
7177
|
for (const n of ws.notifications) {
|
|
7250
|
-
const
|
|
7178
|
+
const slug = dim(n.meshSlug.padEnd(slugWidth));
|
|
7251
7179
|
const topic = cyan(`#${n.topicName}`);
|
|
7252
7180
|
const sender = n.senderName ? `from ${n.senderName}` : "from ?";
|
|
7253
7181
|
const ago = formatRelativeTime(n.createdAt);
|
|
7254
7182
|
const dot = n.read ? dim("·") : yellow("●");
|
|
7255
7183
|
const snippet = n.snippet ?? (n.ciphertext ? dim("[encrypted]") : dim("[empty]"));
|
|
7256
|
-
process.stdout.write(` ${dot} ${
|
|
7184
|
+
process.stdout.write(` ${dot} ${slug} ${topic} ${dim(sender)} ${dim(ago)}
|
|
7257
7185
|
` + ` ${snippet.length > 200 ? snippet.slice(0, 200) + "…" : snippet}
|
|
7258
7186
|
`);
|
|
7259
7187
|
}
|
|
@@ -7286,12 +7214,12 @@ async function runMeActivity(flags) {
|
|
|
7286
7214
|
}
|
|
7287
7215
|
const slugWidth = Math.max(...ws.activity.map((a) => a.meshSlug.length), 6);
|
|
7288
7216
|
for (const a of ws.activity) {
|
|
7289
|
-
const
|
|
7217
|
+
const slug = dim(a.meshSlug.padEnd(slugWidth));
|
|
7290
7218
|
const topic = cyan(`#${a.topicName}`);
|
|
7291
7219
|
const sender = a.senderName ?? "?";
|
|
7292
7220
|
const ago = formatRelativeTime(a.createdAt);
|
|
7293
7221
|
const snippet = a.snippet ?? (a.ciphertext ? dim("[encrypted]") : dim("[empty]"));
|
|
7294
|
-
process.stdout.write(` ${
|
|
7222
|
+
process.stdout.write(` ${slug} ${topic} ${dim(sender + " ·")} ${dim(ago)}
|
|
7295
7223
|
` + ` ${snippet.length > 200 ? snippet.slice(0, 200) + "…" : snippet}
|
|
7296
7224
|
`);
|
|
7297
7225
|
}
|
|
@@ -7330,10 +7258,10 @@ async function runMeSearch(flags) {
|
|
|
7330
7258
|
`));
|
|
7331
7259
|
const slugWidth = Math.max(...ws.topics.map((t) => t.meshSlug.length), 6);
|
|
7332
7260
|
for (const t of ws.topics) {
|
|
7333
|
-
const
|
|
7261
|
+
const slug = dim(t.meshSlug.padEnd(slugWidth));
|
|
7334
7262
|
const name = cyan(`#${t.name}`);
|
|
7335
7263
|
const desc = t.description ? dim(` — ${t.description}`) : "";
|
|
7336
|
-
process.stdout.write(` ${
|
|
7264
|
+
process.stdout.write(` ${slug} ${name}${desc}
|
|
7337
7265
|
`);
|
|
7338
7266
|
}
|
|
7339
7267
|
}
|
|
@@ -7343,13 +7271,13 @@ async function runMeSearch(flags) {
|
|
|
7343
7271
|
`));
|
|
7344
7272
|
const slugWidth = Math.max(...ws.messages.map((m) => m.meshSlug.length), 6);
|
|
7345
7273
|
for (const m of ws.messages) {
|
|
7346
|
-
const
|
|
7274
|
+
const slug = dim(m.meshSlug.padEnd(slugWidth));
|
|
7347
7275
|
const topic = cyan(`#${m.topicName}`);
|
|
7348
7276
|
const sender = m.senderName;
|
|
7349
7277
|
const ago = formatRelativeTime(m.createdAt);
|
|
7350
7278
|
const snippet = m.snippet ?? (m.bodyVersion === 2 ? dim("[encrypted — open the topic to decrypt]") : dim("[empty]"));
|
|
7351
7279
|
const highlighted = m.snippet ? highlightMatch(snippet, flags.query) : snippet;
|
|
7352
|
-
process.stdout.write(` ${
|
|
7280
|
+
process.stdout.write(` ${slug} ${topic} ${dim(sender + " ·")} ${dim(ago)}
|
|
7353
7281
|
` + ` ${highlighted}
|
|
7354
7282
|
`);
|
|
7355
7283
|
}
|
|
@@ -7394,11 +7322,11 @@ async function runMeTasks(flags) {
|
|
|
7394
7322
|
}
|
|
7395
7323
|
const slugWidth = Math.max(...ws.tasks.map((t) => t.meshSlug.length), 6);
|
|
7396
7324
|
for (const t of ws.tasks) {
|
|
7397
|
-
const
|
|
7325
|
+
const slug = dim(t.meshSlug.padEnd(slugWidth));
|
|
7398
7326
|
const status = t.status === "open" ? yellow("open ") : t.status === "claimed" ? cyan("working ") : green("done ");
|
|
7399
7327
|
const prio = t.priority === "urgent" ? yellow("!") : t.priority === "low" ? dim("·") : " ";
|
|
7400
7328
|
const claimer = t.claimedByName ? dim(` ← ${t.claimedByName}`) : "";
|
|
7401
|
-
process.stdout.write(` ${
|
|
7329
|
+
process.stdout.write(` ${slug} ${prio} ${status} ${t.title}${claimer}
|
|
7402
7330
|
`);
|
|
7403
7331
|
}
|
|
7404
7332
|
return EXIT.SUCCESS;
|
|
@@ -7431,12 +7359,12 @@ async function runMeState(flags) {
|
|
|
7431
7359
|
const slugWidth = Math.max(...ws.entries.map((e) => e.meshSlug.length), 6);
|
|
7432
7360
|
const keyWidth = Math.max(...ws.entries.map((e) => e.key.length), 8);
|
|
7433
7361
|
for (const e of ws.entries) {
|
|
7434
|
-
const
|
|
7362
|
+
const slug = dim(e.meshSlug.padEnd(slugWidth));
|
|
7435
7363
|
const key = cyan(e.key.padEnd(keyWidth));
|
|
7436
7364
|
const valueStr = typeof e.value === "string" ? e.value : JSON.stringify(e.value);
|
|
7437
7365
|
const trimmed = valueStr.length > 80 ? valueStr.slice(0, 80) + "…" : valueStr;
|
|
7438
7366
|
const ago = dim(formatRelativeTime(e.updatedAt));
|
|
7439
|
-
process.stdout.write(` ${
|
|
7367
|
+
process.stdout.write(` ${slug} ${key} ${trimmed} ${ago}
|
|
7440
7368
|
`);
|
|
7441
7369
|
}
|
|
7442
7370
|
return EXIT.SUCCESS;
|
|
@@ -7469,11 +7397,11 @@ async function runMeMemory(flags) {
|
|
|
7469
7397
|
}
|
|
7470
7398
|
const slugWidth = Math.max(...ws.memories.map((m) => m.meshSlug.length), 6);
|
|
7471
7399
|
for (const m of ws.memories) {
|
|
7472
|
-
const
|
|
7400
|
+
const slug = dim(m.meshSlug.padEnd(slugWidth));
|
|
7473
7401
|
const ago = dim(formatRelativeTime(m.rememberedAt));
|
|
7474
7402
|
const tags = m.tags.length > 0 ? " " + dim("[" + m.tags.join(", ") + "]") : "";
|
|
7475
7403
|
const content = m.content.length > 240 ? m.content.slice(0, 240) + "…" : m.content;
|
|
7476
|
-
process.stdout.write(` ${
|
|
7404
|
+
process.stdout.write(` ${slug} ${ago}${tags}
|
|
7477
7405
|
${content}
|
|
7478
7406
|
`);
|
|
7479
7407
|
}
|
|
@@ -10257,10 +10185,10 @@ async function resolvePeer(meshSlug, name) {
|
|
|
10257
10185
|
return { displayName: match.displayName, pubkey: key };
|
|
10258
10186
|
});
|
|
10259
10187
|
}
|
|
10260
|
-
function pickMesh2(
|
|
10188
|
+
function pickMesh2(slug) {
|
|
10261
10189
|
const cfg = readConfig();
|
|
10262
|
-
if (
|
|
10263
|
-
return cfg.meshes.find((m) => m.slug ===
|
|
10190
|
+
if (slug)
|
|
10191
|
+
return cfg.meshes.find((m) => m.slug === slug) ? slug : null;
|
|
10264
10192
|
return cfg.meshes[0]?.slug ?? null;
|
|
10265
10193
|
}
|
|
10266
10194
|
async function runGrant(peer, caps, opts = {}) {
|
|
@@ -14532,26 +14460,26 @@ __export(exports_seed_test_mesh, {
|
|
|
14532
14460
|
runSeedTestMesh: () => runSeedTestMesh
|
|
14533
14461
|
});
|
|
14534
14462
|
function runSeedTestMesh(args) {
|
|
14535
|
-
const [brokerUrl, meshId, memberId, pubkey,
|
|
14536
|
-
if (!brokerUrl || !meshId || !memberId || !pubkey || !
|
|
14463
|
+
const [brokerUrl, meshId, memberId, pubkey, slug] = args;
|
|
14464
|
+
if (!brokerUrl || !meshId || !memberId || !pubkey || !slug) {
|
|
14537
14465
|
render.err("Usage: claudemesh seed-test-mesh <broker-ws-url> <mesh-id> <member-id> <pubkey> <slug>");
|
|
14538
14466
|
render.info(dim('Example: claudemesh seed-test-mesh "ws://localhost:7900/ws" mesh-123 member-abc aaa..aaa smoke-test'));
|
|
14539
14467
|
process.exit(1);
|
|
14540
14468
|
}
|
|
14541
14469
|
const config = readConfig();
|
|
14542
|
-
config.meshes = config.meshes.filter((m) => m.slug !==
|
|
14470
|
+
config.meshes = config.meshes.filter((m) => m.slug !== slug);
|
|
14543
14471
|
config.meshes.push({
|
|
14544
14472
|
meshId,
|
|
14545
14473
|
memberId,
|
|
14546
|
-
slug
|
|
14547
|
-
name: `Test: ${
|
|
14474
|
+
slug,
|
|
14475
|
+
name: `Test: ${slug}`,
|
|
14548
14476
|
pubkey,
|
|
14549
14477
|
secretKey: "dev-only-stub",
|
|
14550
14478
|
brokerUrl,
|
|
14551
14479
|
joinedAt: new Date().toISOString()
|
|
14552
14480
|
});
|
|
14553
14481
|
writeConfig(config);
|
|
14554
|
-
render.ok(`seeded ${bold(
|
|
14482
|
+
render.ok(`seeded ${bold(slug)}`, dim(meshId));
|
|
14555
14483
|
render.hint(`run ${bold("claudemesh mcp")} to connect, or register with Claude Code via ${bold("claudemesh install")}`);
|
|
14556
14484
|
}
|
|
14557
14485
|
var init_seed_test_mesh = __esm(() => {
|
|
@@ -15137,8 +15065,7 @@ Mesh
|
|
|
15137
15065
|
claudemesh launch [slug] launch Claude Code on a mesh (alias: connect)
|
|
15138
15066
|
claudemesh list show your meshes (alias: ls)
|
|
15139
15067
|
claudemesh delete [slug] delete a mesh (alias: rm)
|
|
15140
|
-
claudemesh rename <
|
|
15141
|
-
claudemesh slug <old> <new> change a mesh's slug (URL-safe identifier)
|
|
15068
|
+
claudemesh rename <old> <new> change a mesh's slug (the identifier you see and type)
|
|
15142
15069
|
claudemesh share [email] share mesh (invite link / send email)
|
|
15143
15070
|
|
|
15144
15071
|
Peer (resource form, recommended)
|
|
@@ -15389,11 +15316,6 @@ async function main() {
|
|
|
15389
15316
|
process.exit(await rename2(positionals[0] ?? "", positionals[1] ?? ""));
|
|
15390
15317
|
break;
|
|
15391
15318
|
}
|
|
15392
|
-
case "slug": {
|
|
15393
|
-
const { slug: slug2 } = await Promise.resolve().then(() => (init_slug(), exports_slug));
|
|
15394
|
-
process.exit(await slug2(positionals[0] ?? "", positionals[1] ?? ""));
|
|
15395
|
-
break;
|
|
15396
|
-
}
|
|
15397
15319
|
case "share":
|
|
15398
15320
|
case "invite": {
|
|
15399
15321
|
const { invite: invite2 } = await Promise.resolve().then(() => (init_invite(), exports_invite));
|
|
@@ -16207,4 +16129,4 @@ main().catch((err) => {
|
|
|
16207
16129
|
process.exit(EXIT.INTERNAL_ERROR);
|
|
16208
16130
|
});
|
|
16209
16131
|
|
|
16210
|
-
//# debugId=
|
|
16132
|
+
//# debugId=D2E0E354A78D4E1B64756E2164756E21
|