@ai-matrx/messaging 0.11.5 → 0.11.6

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,19 +1144,7 @@ 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
- /**
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
- */
1147
+ /** "Active now" / "Active 5m ago" — presence, said honestly. */
1160
1148
  declare function formatLastSeen(lastSeenMs: number | null, now?: number): string;
1161
1149
 
1162
1150
  /**
package/dist/index.d.ts CHANGED
@@ -1144,19 +1144,7 @@ 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
- /**
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
- */
1147
+ /** "Active now" / "Active 5m ago" — presence, said honestly. */
1160
1148
  declare function formatLastSeen(lastSeenMs: number | null, now?: number): string;
1161
1149
 
1162
1150
  /**
package/dist/index.js CHANGED
@@ -1503,7 +1503,6 @@ function messagingClientId() {
1503
1503
  }
1504
1504
 
1505
1505
  // src/core/format.ts
1506
- import { formatRelativeTime } from "@ai-matrx/kit/format";
1507
1506
  var MINUTE = 6e4;
1508
1507
  var HOUR = 60 * MINUTE;
1509
1508
  var DAY = 24 * HOUR;
@@ -1587,8 +1586,11 @@ function participantNames(participants, excluding) {
1587
1586
  }
1588
1587
  function formatLastSeen(lastSeenMs, now = Date.now()) {
1589
1588
  if (lastSeenMs === null) return "";
1590
- if (now - lastSeenMs < 2 * MINUTE) return "Active now";
1591
- return `Active ${formatRelativeTime(lastSeenMs, { style: "short", now })}`;
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`;
1592
1594
  }
1593
1595
 
1594
1596
  // src/core/repository.ts