claudemesh-cli 1.11.0 → 1.13.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.
@@ -88,7 +88,7 @@ __export(exports_urls, {
88
88
  VERSION: () => VERSION,
89
89
  URLS: () => URLS
90
90
  });
91
- var URLS, VERSION = "1.11.0", env;
91
+ var URLS, VERSION = "1.13.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,6 +12288,8 @@ var init_notification = __esm(() => {
12288
12288
  var exports_me = {};
12289
12289
  __export(exports_me, {
12290
12290
  runMeTopics: () => runMeTopics,
12291
+ runMeNotifications: () => runMeNotifications,
12292
+ runMeActivity: () => runMeActivity,
12291
12293
  runMe: () => runMe
12292
12294
  });
12293
12295
  async function runMe(flags) {
@@ -12363,6 +12365,87 @@ async function runMeTopics(flags) {
12363
12365
  return EXIT.SUCCESS;
12364
12366
  });
12365
12367
  }
12368
+ async function runMeNotifications(flags) {
12369
+ return withRestKey({
12370
+ meshSlug: flags.mesh ?? null,
12371
+ purpose: "workspace-notifications",
12372
+ capabilities: ["read"]
12373
+ }, async ({ secret }) => {
12374
+ const params = new URLSearchParams;
12375
+ if (flags.all)
12376
+ params.set("include", "all");
12377
+ if (flags.since)
12378
+ params.set("since", flags.since);
12379
+ const path = "/api/v1/me/notifications" + (params.toString() ? `?${params.toString()}` : "");
12380
+ const ws = await request({
12381
+ path,
12382
+ token: secret
12383
+ });
12384
+ if (flags.json) {
12385
+ console.log(JSON.stringify(ws, null, 2));
12386
+ return EXIT.SUCCESS;
12387
+ }
12388
+ const headerLabel = flags.all ? "@-mentions (all)" : "@-mentions (unread)";
12389
+ render.section(`${clay(headerLabel)} — ${ws.totals.total} ${dim(ws.totals.unread > 0 ? `· ${ws.totals.unread} unread` : "· nothing pending")}`);
12390
+ if (ws.notifications.length === 0) {
12391
+ process.stdout.write(dim(flags.all ? ` no @-mentions in window
12392
+ ` : ` inbox zero — nothing waiting
12393
+ `));
12394
+ return EXIT.SUCCESS;
12395
+ }
12396
+ const slugWidth = Math.max(...ws.notifications.map((n) => n.meshSlug.length), 6);
12397
+ for (const n of ws.notifications) {
12398
+ const slug = dim(n.meshSlug.padEnd(slugWidth));
12399
+ const topic = cyan(`#${n.topicName}`);
12400
+ const sender = n.senderName ? `from ${n.senderName}` : "from ?";
12401
+ const ago = formatRelativeTime(n.createdAt);
12402
+ const dot = n.read ? dim("·") : yellow("●");
12403
+ const snippet = n.snippet ?? (n.ciphertext ? dim("[encrypted]") : dim("[empty]"));
12404
+ process.stdout.write(` ${dot} ${slug} ${topic} ${dim(sender)} ${dim(ago)}
12405
+ ` + ` ${snippet.length > 200 ? snippet.slice(0, 200) + "…" : snippet}
12406
+ `);
12407
+ }
12408
+ return EXIT.SUCCESS;
12409
+ });
12410
+ }
12411
+ async function runMeActivity(flags) {
12412
+ return withRestKey({
12413
+ meshSlug: flags.mesh ?? null,
12414
+ purpose: "workspace-activity",
12415
+ capabilities: ["read"]
12416
+ }, async ({ secret }) => {
12417
+ const params = new URLSearchParams;
12418
+ if (flags.since)
12419
+ params.set("since", flags.since);
12420
+ const path = "/api/v1/me/activity" + (params.toString() ? `?${params.toString()}` : "");
12421
+ const ws = await request({
12422
+ path,
12423
+ token: secret
12424
+ });
12425
+ if (flags.json) {
12426
+ console.log(JSON.stringify(ws, null, 2));
12427
+ return EXIT.SUCCESS;
12428
+ }
12429
+ render.section(`${clay("activity")} — ${ws.totals.events} ${dim(flags.since ? `since ${flags.since}` : "in the last 24h")}`);
12430
+ if (ws.activity.length === 0) {
12431
+ process.stdout.write(dim(` quiet — no activity in window
12432
+ `));
12433
+ return EXIT.SUCCESS;
12434
+ }
12435
+ const slugWidth = Math.max(...ws.activity.map((a) => a.meshSlug.length), 6);
12436
+ for (const a of ws.activity) {
12437
+ const slug = dim(a.meshSlug.padEnd(slugWidth));
12438
+ const topic = cyan(`#${a.topicName}`);
12439
+ const sender = a.senderName ?? "?";
12440
+ const ago = formatRelativeTime(a.createdAt);
12441
+ const snippet = a.snippet ?? (a.ciphertext ? dim("[encrypted]") : dim("[empty]"));
12442
+ process.stdout.write(` ${slug} ${topic} ${dim(sender + " ·")} ${dim(ago)}
12443
+ ` + ` ${snippet.length > 200 ? snippet.slice(0, 200) + "…" : snippet}
12444
+ `);
12445
+ }
12446
+ return EXIT.SUCCESS;
12447
+ });
12448
+ }
12366
12449
  function formatRelativeTime(iso) {
12367
12450
  const then = new Date(iso).getTime();
12368
12451
  const now = Date.now();
@@ -14028,6 +14111,8 @@ Topic (conversation scope, v0.2.0)
14028
14111
  claudemesh send "#topic" "msg" send to a topic (WS path, v1 plaintext)
14029
14112
  claudemesh me cross-mesh workspace overview (v0.4.0)
14030
14113
  claudemesh me topics cross-mesh topic list [--unread]
14114
+ claudemesh me notifications cross-mesh @-mentions [--all] [--since=ISO]
14115
+ claudemesh me activity cross-mesh recent messages [--since=ISO]
14031
14116
  claudemesh member list mesh roster with online state [--online]
14032
14117
  claudemesh notification list recent @-mentions of you [--since <ISO>]
14033
14118
 
@@ -14897,10 +14982,28 @@ async function main() {
14897
14982
  } else if (sub === "topics") {
14898
14983
  const { runMeTopics: runMeTopics2 } = await Promise.resolve().then(() => (init_me(), exports_me));
14899
14984
  process.exit(await runMeTopics2({ ...f, unread: !!flags.unread }));
14985
+ } else if (sub === "notifications" || sub === "notifs") {
14986
+ const { runMeNotifications: runMeNotifications2 } = await Promise.resolve().then(() => (init_me(), exports_me));
14987
+ process.exit(await runMeNotifications2({
14988
+ ...f,
14989
+ all: !!flags.all,
14990
+ since: flags.since
14991
+ }));
14992
+ } else if (sub === "activity") {
14993
+ const { runMeActivity: runMeActivity2 } = await Promise.resolve().then(() => (init_me(), exports_me));
14994
+ process.exit(await runMeActivity2({
14995
+ ...f,
14996
+ since: flags.since
14997
+ }));
14900
14998
  } else {
14901
- console.error(`Usage: claudemesh me (cross-mesh overview)
14902
- claudemesh me topics (cross-mesh topic list)
14903
- claudemesh me topics --unread (only unread topics)`);
14999
+ console.error(`Usage: claudemesh me (cross-mesh overview)
15000
+ claudemesh me topics (cross-mesh topic list)
15001
+ claudemesh me topics --unread (only unread topics)
15002
+ claudemesh me notifications (unread @-mentions, last 7d)
15003
+ claudemesh me notifications --all (include already-read)
15004
+ claudemesh me notifications --since=ISO (custom window)
15005
+ claudemesh me activity (recent messages, last 24h)
15006
+ claudemesh me activity --since=ISO (custom window)`);
14904
15007
  process.exit(EXIT.INVALID_ARGS);
14905
15008
  }
14906
15009
  break;
@@ -14970,4 +15073,4 @@ main().catch((err) => {
14970
15073
  process.exit(EXIT.INTERNAL_ERROR);
14971
15074
  });
14972
15075
 
14973
- //# debugId=9953681D906F7F1E64756E2164756E21
15076
+ //# debugId=E4399AFE3999F90D64756E2164756E21