claudemesh-cli 1.11.0 → 1.12.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.12.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,7 @@ var init_notification = __esm(() => {
12288
12288
  var exports_me = {};
12289
12289
  __export(exports_me, {
12290
12290
  runMeTopics: () => runMeTopics,
12291
+ runMeNotifications: () => runMeNotifications,
12291
12292
  runMe: () => runMe
12292
12293
  });
12293
12294
  async function runMe(flags) {
@@ -12363,6 +12364,49 @@ async function runMeTopics(flags) {
12363
12364
  return EXIT.SUCCESS;
12364
12365
  });
12365
12366
  }
12367
+ async function runMeNotifications(flags) {
12368
+ return withRestKey({
12369
+ meshSlug: flags.mesh ?? null,
12370
+ purpose: "workspace-notifications",
12371
+ capabilities: ["read"]
12372
+ }, async ({ secret }) => {
12373
+ const params = new URLSearchParams;
12374
+ if (flags.all)
12375
+ params.set("include", "all");
12376
+ if (flags.since)
12377
+ params.set("since", flags.since);
12378
+ const path = "/api/v1/me/notifications" + (params.toString() ? `?${params.toString()}` : "");
12379
+ const ws = await request({
12380
+ path,
12381
+ token: secret
12382
+ });
12383
+ if (flags.json) {
12384
+ console.log(JSON.stringify(ws, null, 2));
12385
+ return EXIT.SUCCESS;
12386
+ }
12387
+ const headerLabel = flags.all ? "@-mentions (all)" : "@-mentions (unread)";
12388
+ render.section(`${clay(headerLabel)} — ${ws.totals.total} ${dim(ws.totals.unread > 0 ? `· ${ws.totals.unread} unread` : "· nothing pending")}`);
12389
+ if (ws.notifications.length === 0) {
12390
+ process.stdout.write(dim(flags.all ? ` no @-mentions in window
12391
+ ` : ` inbox zero — nothing waiting
12392
+ `));
12393
+ return EXIT.SUCCESS;
12394
+ }
12395
+ const slugWidth = Math.max(...ws.notifications.map((n) => n.meshSlug.length), 6);
12396
+ for (const n of ws.notifications) {
12397
+ const slug = dim(n.meshSlug.padEnd(slugWidth));
12398
+ const topic = cyan(`#${n.topicName}`);
12399
+ const sender = n.senderName ? `from ${n.senderName}` : "from ?";
12400
+ const ago = formatRelativeTime(n.createdAt);
12401
+ const dot = n.read ? dim("·") : yellow("●");
12402
+ const snippet = n.snippet ?? (n.ciphertext ? dim("[encrypted]") : dim("[empty]"));
12403
+ process.stdout.write(` ${dot} ${slug} ${topic} ${dim(sender)} ${dim(ago)}
12404
+ ` + ` ${snippet.length > 200 ? snippet.slice(0, 200) + "…" : snippet}
12405
+ `);
12406
+ }
12407
+ return EXIT.SUCCESS;
12408
+ });
12409
+ }
12366
12410
  function formatRelativeTime(iso) {
12367
12411
  const then = new Date(iso).getTime();
12368
12412
  const now = Date.now();
@@ -14028,6 +14072,7 @@ Topic (conversation scope, v0.2.0)
14028
14072
  claudemesh send "#topic" "msg" send to a topic (WS path, v1 plaintext)
14029
14073
  claudemesh me cross-mesh workspace overview (v0.4.0)
14030
14074
  claudemesh me topics cross-mesh topic list [--unread]
14075
+ claudemesh me notifications cross-mesh @-mentions [--all] [--since=ISO]
14031
14076
  claudemesh member list mesh roster with online state [--online]
14032
14077
  claudemesh notification list recent @-mentions of you [--since <ISO>]
14033
14078
 
@@ -14897,10 +14942,20 @@ async function main() {
14897
14942
  } else if (sub === "topics") {
14898
14943
  const { runMeTopics: runMeTopics2 } = await Promise.resolve().then(() => (init_me(), exports_me));
14899
14944
  process.exit(await runMeTopics2({ ...f, unread: !!flags.unread }));
14945
+ } else if (sub === "notifications" || sub === "notifs") {
14946
+ const { runMeNotifications: runMeNotifications2 } = await Promise.resolve().then(() => (init_me(), exports_me));
14947
+ process.exit(await runMeNotifications2({
14948
+ ...f,
14949
+ all: !!flags.all,
14950
+ since: flags.since
14951
+ }));
14900
14952
  } 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)`);
14953
+ console.error(`Usage: claudemesh me (cross-mesh overview)
14954
+ claudemesh me topics (cross-mesh topic list)
14955
+ claudemesh me topics --unread (only unread topics)
14956
+ claudemesh me notifications (unread @-mentions, last 7d)
14957
+ claudemesh me notifications --all (include already-read)
14958
+ claudemesh me notifications --since=ISO (custom window)`);
14904
14959
  process.exit(EXIT.INVALID_ARGS);
14905
14960
  }
14906
14961
  break;
@@ -14970,4 +15025,4 @@ main().catch((err) => {
14970
15025
  process.exit(EXIT.INTERNAL_ERROR);
14971
15026
  });
14972
15027
 
14973
- //# debugId=9953681D906F7F1E64756E2164756E21
15028
+ //# debugId=2102749345F189DF64756E2164756E21