@ai-matrx/messaging 0.11.6 → 0.11.8

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/index.d.cts CHANGED
@@ -1144,7 +1144,19 @@ declare function groupMessages(messages: readonly Message[], args?: {
1144
1144
  /** "Ana is typing…" / "Ana and Bo are typing…" / "3 people are typing…" */
1145
1145
  declare function formatTypists(names: readonly string[]): string | null;
1146
1146
  declare function participantNames(participants: readonly UserSummary[], excluding: UserId): readonly string[];
1147
- /** "Active now" / "Active 5m ago" — presence, said honestly. */
1147
+ /**
1148
+ * "Active now" / "Active 5m ago" — presence, said honestly.
1149
+ *
1150
+ * THE CASCADE WAS A RELATIVE TIME WEARING A DURATION'S CLOTHES (2026-09-12).
1151
+ * Three hand-rolled tiers turned an elapsed millisecond count into `5m ago` /
1152
+ * `3h ago` / `2d ago`, which is exactly `formatRelativeTime`'s `short` voice —
1153
+ * and this package already depends on kit. A package re-deriving another
1154
+ * package's capability ships the duplicate to every consumer of this one.
1155
+ *
1156
+ * What stays local is the only part that is a PRODUCT decision rather than a
1157
+ * formatting one: the two-minute "Active now" window, which says presence is
1158
+ * live rather than reporting a number nobody acts on.
1159
+ */
1148
1160
  declare function formatLastSeen(lastSeenMs: number | null, now?: number): string;
1149
1161
 
1150
1162
  /**
package/dist/index.d.ts CHANGED
@@ -1144,7 +1144,19 @@ declare function groupMessages(messages: readonly Message[], args?: {
1144
1144
  /** "Ana is typing…" / "Ana and Bo are typing…" / "3 people are typing…" */
1145
1145
  declare function formatTypists(names: readonly string[]): string | null;
1146
1146
  declare function participantNames(participants: readonly UserSummary[], excluding: UserId): readonly string[];
1147
- /** "Active now" / "Active 5m ago" — presence, said honestly. */
1147
+ /**
1148
+ * "Active now" / "Active 5m ago" — presence, said honestly.
1149
+ *
1150
+ * THE CASCADE WAS A RELATIVE TIME WEARING A DURATION'S CLOTHES (2026-09-12).
1151
+ * Three hand-rolled tiers turned an elapsed millisecond count into `5m ago` /
1152
+ * `3h ago` / `2d ago`, which is exactly `formatRelativeTime`'s `short` voice —
1153
+ * and this package already depends on kit. A package re-deriving another
1154
+ * package's capability ships the duplicate to every consumer of this one.
1155
+ *
1156
+ * What stays local is the only part that is a PRODUCT decision rather than a
1157
+ * formatting one: the two-minute "Active now" window, which says presence is
1158
+ * live rather than reporting a number nobody acts on.
1159
+ */
1148
1160
  declare function formatLastSeen(lastSeenMs: number | null, now?: number): string;
1149
1161
 
1150
1162
  /**
package/dist/index.js CHANGED
@@ -1503,6 +1503,7 @@ function messagingClientId() {
1503
1503
  }
1504
1504
 
1505
1505
  // src/core/format.ts
1506
+ import { formatRelativeTime } from "@ai-matrx/kit/format";
1506
1507
  var MINUTE = 6e4;
1507
1508
  var HOUR = 60 * MINUTE;
1508
1509
  var DAY = 24 * HOUR;
@@ -1586,11 +1587,8 @@ function participantNames(participants, excluding) {
1586
1587
  }
1587
1588
  function formatLastSeen(lastSeenMs, now = Date.now()) {
1588
1589
  if (lastSeenMs === null) return "";
1589
- const elapsed = now - lastSeenMs;
1590
- if (elapsed < 2 * MINUTE) return "Active now";
1591
- if (elapsed < HOUR) return `Active ${Math.round(elapsed / MINUTE)}m ago`;
1592
- if (elapsed < DAY) return `Active ${Math.round(elapsed / HOUR)}h ago`;
1593
- return `Active ${Math.round(elapsed / DAY)}d ago`;
1590
+ if (now - lastSeenMs < 2 * MINUTE) return "Active now";
1591
+ return `Active ${formatRelativeTime(lastSeenMs, { style: "short", now })}`;
1594
1592
  }
1595
1593
 
1596
1594
  // src/core/repository.ts