@ai-matrx/messaging 0.11.4 → 0.11.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog — `@ai-matrx/messaging`
2
2
 
3
+ ## 0.11.5 — 2026-09-12
4
+
5
+ ### Changed
6
+
7
+ - **`formatLastSeen` speaks the kit voice.** Its three hand-rolled tiers turned
8
+ an elapsed millisecond count into `5m ago` / `3h ago` / `2d ago`, which is
9
+ exactly `formatRelativeTime`'s `short` voice from `@ai-matrx/kit/format` — a
10
+ package this one already depends on. A package re-deriving another package's
11
+ capability ships the duplicate to every consumer of this one. The two-minute
12
+ "Active now" window stays local: it is a presence decision, not a formatting
13
+ one.
14
+ - Visible change: an elapsed time that rounded up into its own next tier now
15
+ promotes properly (`60m ago` → `1h ago`), and sub-minute presence outside the
16
+ "Active now" window reads `30s ago` instead of `0m ago`.
17
+
3
18
  ## 0.11.4
4
19
 
5
20
  Automatic changed-only republish (docs/metadata drift since the last tag — see
package/dist/index.cjs CHANGED
@@ -1571,6 +1571,7 @@ function messagingClientId() {
1571
1571
  }
1572
1572
 
1573
1573
  // src/core/format.ts
1574
+ var import_format = require("@ai-matrx/kit/format");
1574
1575
  var MINUTE = 6e4;
1575
1576
  var HOUR = 60 * MINUTE;
1576
1577
  var DAY = 24 * HOUR;
@@ -1654,11 +1655,8 @@ function participantNames(participants, excluding) {
1654
1655
  }
1655
1656
  function formatLastSeen(lastSeenMs, now = Date.now()) {
1656
1657
  if (lastSeenMs === null) return "";
1657
- const elapsed = now - lastSeenMs;
1658
- if (elapsed < 2 * MINUTE) return "Active now";
1659
- if (elapsed < HOUR) return `Active ${Math.round(elapsed / MINUTE)}m ago`;
1660
- if (elapsed < DAY) return `Active ${Math.round(elapsed / HOUR)}h ago`;
1661
- return `Active ${Math.round(elapsed / DAY)}d ago`;
1658
+ if (now - lastSeenMs < 2 * MINUTE) return "Active now";
1659
+ return `Active ${(0, import_format.formatRelativeTime)(lastSeenMs, { style: "short", now })}`;
1662
1660
  }
1663
1661
 
1664
1662
  // src/core/repository.ts