claudemesh-cli 1.12.0 → 1.14.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
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.14.0", env;
|
|
92
92
|
var init_urls = __esm(() => {
|
|
93
93
|
URLS = {
|
|
94
94
|
BROKER: process.env.CLAUDEMESH_BROKER_URL ?? "wss://ic.claudemesh.com/ws",
|
|
@@ -12288,7 +12288,9 @@ var init_notification = __esm(() => {
|
|
|
12288
12288
|
var exports_me = {};
|
|
12289
12289
|
__export(exports_me, {
|
|
12290
12290
|
runMeTopics: () => runMeTopics,
|
|
12291
|
+
runMeSearch: () => runMeSearch,
|
|
12291
12292
|
runMeNotifications: () => runMeNotifications,
|
|
12293
|
+
runMeActivity: () => runMeActivity,
|
|
12292
12294
|
runMe: () => runMe
|
|
12293
12295
|
});
|
|
12294
12296
|
async function runMe(flags) {
|
|
@@ -12407,6 +12409,114 @@ async function runMeNotifications(flags) {
|
|
|
12407
12409
|
return EXIT.SUCCESS;
|
|
12408
12410
|
});
|
|
12409
12411
|
}
|
|
12412
|
+
async function runMeActivity(flags) {
|
|
12413
|
+
return withRestKey({
|
|
12414
|
+
meshSlug: flags.mesh ?? null,
|
|
12415
|
+
purpose: "workspace-activity",
|
|
12416
|
+
capabilities: ["read"]
|
|
12417
|
+
}, async ({ secret }) => {
|
|
12418
|
+
const params = new URLSearchParams;
|
|
12419
|
+
if (flags.since)
|
|
12420
|
+
params.set("since", flags.since);
|
|
12421
|
+
const path = "/api/v1/me/activity" + (params.toString() ? `?${params.toString()}` : "");
|
|
12422
|
+
const ws = await request({
|
|
12423
|
+
path,
|
|
12424
|
+
token: secret
|
|
12425
|
+
});
|
|
12426
|
+
if (flags.json) {
|
|
12427
|
+
console.log(JSON.stringify(ws, null, 2));
|
|
12428
|
+
return EXIT.SUCCESS;
|
|
12429
|
+
}
|
|
12430
|
+
render.section(`${clay("activity")} — ${ws.totals.events} ${dim(flags.since ? `since ${flags.since}` : "in the last 24h")}`);
|
|
12431
|
+
if (ws.activity.length === 0) {
|
|
12432
|
+
process.stdout.write(dim(` quiet — no activity in window
|
|
12433
|
+
`));
|
|
12434
|
+
return EXIT.SUCCESS;
|
|
12435
|
+
}
|
|
12436
|
+
const slugWidth = Math.max(...ws.activity.map((a) => a.meshSlug.length), 6);
|
|
12437
|
+
for (const a of ws.activity) {
|
|
12438
|
+
const slug = dim(a.meshSlug.padEnd(slugWidth));
|
|
12439
|
+
const topic = cyan(`#${a.topicName}`);
|
|
12440
|
+
const sender = a.senderName ?? "?";
|
|
12441
|
+
const ago = formatRelativeTime(a.createdAt);
|
|
12442
|
+
const snippet = a.snippet ?? (a.ciphertext ? dim("[encrypted]") : dim("[empty]"));
|
|
12443
|
+
process.stdout.write(` ${slug} ${topic} ${dim(sender + " ·")} ${dim(ago)}
|
|
12444
|
+
` + ` ${snippet.length > 200 ? snippet.slice(0, 200) + "…" : snippet}
|
|
12445
|
+
`);
|
|
12446
|
+
}
|
|
12447
|
+
return EXIT.SUCCESS;
|
|
12448
|
+
});
|
|
12449
|
+
}
|
|
12450
|
+
async function runMeSearch(flags) {
|
|
12451
|
+
if (!flags.query || flags.query.length < 2) {
|
|
12452
|
+
process.stderr.write(`Usage: claudemesh me search <query> (min 2 chars)
|
|
12453
|
+
`);
|
|
12454
|
+
return EXIT.INVALID_ARGS;
|
|
12455
|
+
}
|
|
12456
|
+
return withRestKey({
|
|
12457
|
+
meshSlug: flags.mesh ?? null,
|
|
12458
|
+
purpose: "workspace-search",
|
|
12459
|
+
capabilities: ["read"]
|
|
12460
|
+
}, async ({ secret }) => {
|
|
12461
|
+
const params = new URLSearchParams({ q: flags.query });
|
|
12462
|
+
const ws = await request({
|
|
12463
|
+
path: `/api/v1/me/search?${params.toString()}`,
|
|
12464
|
+
token: secret
|
|
12465
|
+
});
|
|
12466
|
+
if (flags.json) {
|
|
12467
|
+
console.log(JSON.stringify(ws, null, 2));
|
|
12468
|
+
return EXIT.SUCCESS;
|
|
12469
|
+
}
|
|
12470
|
+
render.section(`${clay("search")} — "${flags.query}" ${dim(`${ws.totals.topics} topic${ws.totals.topics === 1 ? "" : "s"}, ` + `${ws.totals.messages} message${ws.totals.messages === 1 ? "" : "s"}`)}`);
|
|
12471
|
+
if (ws.topics.length === 0 && ws.messages.length === 0) {
|
|
12472
|
+
process.stdout.write(dim(` no matches
|
|
12473
|
+
`));
|
|
12474
|
+
return EXIT.SUCCESS;
|
|
12475
|
+
}
|
|
12476
|
+
if (ws.topics.length > 0) {
|
|
12477
|
+
process.stdout.write(dim(`
|
|
12478
|
+
topics
|
|
12479
|
+
`));
|
|
12480
|
+
const slugWidth = Math.max(...ws.topics.map((t) => t.meshSlug.length), 6);
|
|
12481
|
+
for (const t of ws.topics) {
|
|
12482
|
+
const slug = dim(t.meshSlug.padEnd(slugWidth));
|
|
12483
|
+
const name = cyan(`#${t.name}`);
|
|
12484
|
+
const desc = t.description ? dim(` — ${t.description}`) : "";
|
|
12485
|
+
process.stdout.write(` ${slug} ${name}${desc}
|
|
12486
|
+
`);
|
|
12487
|
+
}
|
|
12488
|
+
}
|
|
12489
|
+
if (ws.messages.length > 0) {
|
|
12490
|
+
process.stdout.write(dim(`
|
|
12491
|
+
messages
|
|
12492
|
+
`));
|
|
12493
|
+
const slugWidth = Math.max(...ws.messages.map((m) => m.meshSlug.length), 6);
|
|
12494
|
+
for (const m of ws.messages) {
|
|
12495
|
+
const slug = dim(m.meshSlug.padEnd(slugWidth));
|
|
12496
|
+
const topic = cyan(`#${m.topicName}`);
|
|
12497
|
+
const sender = m.senderName;
|
|
12498
|
+
const ago = formatRelativeTime(m.createdAt);
|
|
12499
|
+
const snippet = m.snippet ?? (m.bodyVersion === 2 ? dim("[encrypted — open the topic to decrypt]") : dim("[empty]"));
|
|
12500
|
+
const highlighted = m.snippet ? highlightMatch(snippet, flags.query) : snippet;
|
|
12501
|
+
process.stdout.write(` ${slug} ${topic} ${dim(sender + " ·")} ${dim(ago)}
|
|
12502
|
+
` + ` ${highlighted}
|
|
12503
|
+
`);
|
|
12504
|
+
}
|
|
12505
|
+
}
|
|
12506
|
+
return EXIT.SUCCESS;
|
|
12507
|
+
});
|
|
12508
|
+
}
|
|
12509
|
+
function highlightMatch(text, query) {
|
|
12510
|
+
if (!query)
|
|
12511
|
+
return text;
|
|
12512
|
+
const idx = text.toLowerCase().indexOf(query.toLowerCase());
|
|
12513
|
+
if (idx === -1)
|
|
12514
|
+
return text;
|
|
12515
|
+
const before = text.slice(0, idx);
|
|
12516
|
+
const match = text.slice(idx, idx + query.length);
|
|
12517
|
+
const after = text.slice(idx + query.length);
|
|
12518
|
+
return `${before}${yellow(match)}${after}`;
|
|
12519
|
+
}
|
|
12410
12520
|
function formatRelativeTime(iso) {
|
|
12411
12521
|
const then = new Date(iso).getTime();
|
|
12412
12522
|
const now = Date.now();
|
|
@@ -14073,6 +14183,8 @@ Topic (conversation scope, v0.2.0)
|
|
|
14073
14183
|
claudemesh me cross-mesh workspace overview (v0.4.0)
|
|
14074
14184
|
claudemesh me topics cross-mesh topic list [--unread]
|
|
14075
14185
|
claudemesh me notifications cross-mesh @-mentions [--all] [--since=ISO]
|
|
14186
|
+
claudemesh me activity cross-mesh recent messages [--since=ISO]
|
|
14187
|
+
claudemesh me search <q> cross-mesh search (topics + messages)
|
|
14076
14188
|
claudemesh member list mesh roster with online state [--online]
|
|
14077
14189
|
claudemesh notification list recent @-mentions of you [--since <ISO>]
|
|
14078
14190
|
|
|
@@ -14949,13 +15061,26 @@ async function main() {
|
|
|
14949
15061
|
all: !!flags.all,
|
|
14950
15062
|
since: flags.since
|
|
14951
15063
|
}));
|
|
15064
|
+
} else if (sub === "activity") {
|
|
15065
|
+
const { runMeActivity: runMeActivity2 } = await Promise.resolve().then(() => (init_me(), exports_me));
|
|
15066
|
+
process.exit(await runMeActivity2({
|
|
15067
|
+
...f,
|
|
15068
|
+
since: flags.since
|
|
15069
|
+
}));
|
|
15070
|
+
} else if (sub === "search") {
|
|
15071
|
+
const { runMeSearch: runMeSearch2 } = await Promise.resolve().then(() => (init_me(), exports_me));
|
|
15072
|
+
const query = positionals.slice(1).join(" ").trim();
|
|
15073
|
+
process.exit(await runMeSearch2({ ...f, query }));
|
|
14952
15074
|
} else {
|
|
14953
15075
|
console.error(`Usage: claudemesh me (cross-mesh overview)
|
|
14954
15076
|
claudemesh me topics (cross-mesh topic list)
|
|
14955
15077
|
claudemesh me topics --unread (only unread topics)
|
|
14956
15078
|
claudemesh me notifications (unread @-mentions, last 7d)
|
|
14957
15079
|
claudemesh me notifications --all (include already-read)
|
|
14958
|
-
claudemesh me notifications --since=ISO (custom window)
|
|
15080
|
+
claudemesh me notifications --since=ISO (custom window)
|
|
15081
|
+
claudemesh me activity (recent messages, last 24h)
|
|
15082
|
+
claudemesh me activity --since=ISO (custom window)
|
|
15083
|
+
claudemesh me search <query> (cross-mesh search)`);
|
|
14959
15084
|
process.exit(EXIT.INVALID_ARGS);
|
|
14960
15085
|
}
|
|
14961
15086
|
break;
|
|
@@ -15025,4 +15150,4 @@ main().catch((err) => {
|
|
|
15025
15150
|
process.exit(EXIT.INTERNAL_ERROR);
|
|
15026
15151
|
});
|
|
15027
15152
|
|
|
15028
|
-
//# debugId=
|
|
15153
|
+
//# debugId=70FF6020E5175BED64756E2164756E21
|