@ai-matrx/messaging 0.4.0 → 0.6.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.
- package/CHANGELOG.md +50 -0
- package/dist/index.cjs +0 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -11
- package/dist/index.d.ts +16 -11
- package/dist/index.js +0 -16
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +5 -18
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +16 -11
- package/dist/react.d.ts +16 -11
- package/dist/react.js +3 -16
- package/dist/react.js.map +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
# Changelog — `@ai-matrx/messaging`
|
|
2
2
|
|
|
3
|
+
## 0.6.0 — 2026-09-07
|
|
4
|
+
|
|
5
|
+
**The two entries did not agree on their own branded ids.** A consumer that minted a
|
|
6
|
+
`ConversationId` with `asConversationId` from `@ai-matrx/messaging` could not pass it to a hook
|
|
7
|
+
from `@ai-matrx/messaging/react` — the two were different types, with an error message that
|
|
8
|
+
blames the consumer. Found by the first real adoption, which does exactly that on its
|
|
9
|
+
conversation route.
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- **The nominal brand is a named marker, not a `unique symbol`.** The package ships two entries
|
|
14
|
+
built as two bundles, so every shared type is DECLARED TWICE in the shipped `.d.ts` — and two
|
|
15
|
+
`declare const brand: unique symbol` declarations are two different symbols, hence two
|
|
16
|
+
incompatible `ConversationId`s. A structural marker (`__mxBrand`) is identical in both
|
|
17
|
+
declarations, so the brands unify while still being impossible to produce by accident. No
|
|
18
|
+
runtime change: the marker is types-only.
|
|
19
|
+
- **`verify-tarball` now typechecks a real consumer against BOTH entries** — core-minted ids
|
|
20
|
+
assigned to `/react` types and back. It fails against the `unique symbol` build, which is the
|
|
21
|
+
only way this class can be caught: in `src/` there is only ever one declaration, so every
|
|
22
|
+
source gate stays green while the shipped types are broken.
|
|
23
|
+
- The canary still imported `getInitials` / `avatarPaletteIndex`, which moved to
|
|
24
|
+
`@ai-matrx/kit/format` in 0.5.0 — it would have failed that release's publish.
|
|
25
|
+
|
|
26
|
+
### Consumer action (C28)
|
|
27
|
+
|
|
28
|
+
None. `asConversationId(...)` and friends behave exactly as before; ids from the two entries now
|
|
29
|
+
actually interoperate, which is what the types always claimed.
|
|
30
|
+
|
|
31
|
+
## 0.5.0 — 2026-09-07
|
|
32
|
+
|
|
33
|
+
**Consumer action (C28).** Two exports MOVED OUT of this package to
|
|
34
|
+
`@ai-matrx/kit/format`. Update the import; the behaviour is identical.
|
|
35
|
+
|
|
36
|
+
| was | now |
|
|
37
|
+
|---|---|
|
|
38
|
+
| `import { getInitials } from "@ai-matrx/messaging"` | `import { getInitials } from "@ai-matrx/kit/format"` |
|
|
39
|
+
| `import { avatarPaletteIndex } from "@ai-matrx/messaging"` | `import { avatarPaletteIndex } from "@ai-matrx/kit/format"` |
|
|
40
|
+
|
|
41
|
+
**Why.** Duplication census finding H1 (2026-09-07): both bodies were
|
|
42
|
+
duplicated in `@ai-matrx/meet`, and while two packages claimed them no host
|
|
43
|
+
twin had a correct owner to point at. They now live in `@ai-matrx/kit`, which
|
|
44
|
+
has zero sibling dependencies.
|
|
45
|
+
|
|
46
|
+
The conversation-shaped formatters — `formatConversationTime`,
|
|
47
|
+
`formatMessageTime`, `formatDateSeparator`, `formatLastSeen`, `formatTypists`,
|
|
48
|
+
`groupMessages`, `isSameDay`, `participantNames` — all stay here. Nothing is
|
|
49
|
+
re-exported: this package imports kit directly.
|
|
50
|
+
|
|
51
|
+
New dependency: `@ai-matrx/kit` (`latest`).
|
|
52
|
+
|
|
3
53
|
## 0.4.0 — 2026-09-07
|
|
4
54
|
|
|
5
55
|
**A ```matrx fence written in the PLATFORM's dialect was being deleted on render.** Found the
|
package/dist/index.cjs
CHANGED
|
@@ -30,7 +30,6 @@ __export(src_exports, {
|
|
|
30
30
|
asMessageId: () => asMessageId,
|
|
31
31
|
asOrganizationId: () => asOrganizationId,
|
|
32
32
|
asUserId: () => asUserId,
|
|
33
|
-
avatarPaletteIndex: () => avatarPaletteIndex,
|
|
34
33
|
composeFence: () => composeFence,
|
|
35
34
|
conversationTopic: () => conversationTopic,
|
|
36
35
|
createActionRegistry: () => createActionRegistry,
|
|
@@ -48,7 +47,6 @@ __export(src_exports, {
|
|
|
48
47
|
formatLastSeen: () => formatLastSeen,
|
|
49
48
|
formatMessageTime: () => formatMessageTime,
|
|
50
49
|
formatTypists: () => formatTypists,
|
|
51
|
-
getInitials: () => getInitials,
|
|
52
50
|
groupMessages: () => groupMessages,
|
|
53
51
|
inboxTopic: () => inboxTopic,
|
|
54
52
|
invalidResponse: () => invalidResponse,
|
|
@@ -1496,20 +1494,6 @@ function formatDateSeparator(isoString, now = Date.now(), locale) {
|
|
|
1496
1494
|
day: "numeric"
|
|
1497
1495
|
});
|
|
1498
1496
|
}
|
|
1499
|
-
function getInitials(name) {
|
|
1500
|
-
const parts = name.trim().split(/\s+/).filter(Boolean);
|
|
1501
|
-
if (parts.length === 0) return "?";
|
|
1502
|
-
const first = parts[0]?.[0] ?? "";
|
|
1503
|
-
const last = parts.length > 1 ? parts.at(-1)?.[0] ?? "" : "";
|
|
1504
|
-
return `${first}${last}`.toUpperCase() || "?";
|
|
1505
|
-
}
|
|
1506
|
-
function avatarPaletteIndex(seed, buckets = 8) {
|
|
1507
|
-
let hash = 0;
|
|
1508
|
-
for (let index = 0; index < seed.length; index += 1) {
|
|
1509
|
-
hash = hash * 31 + seed.charCodeAt(index) | 0;
|
|
1510
|
-
}
|
|
1511
|
-
return Math.abs(hash) % buckets;
|
|
1512
|
-
}
|
|
1513
1497
|
function groupMessages(messages, args = {}) {
|
|
1514
1498
|
const windowMs = args.windowMs ?? 5 * MINUTE;
|
|
1515
1499
|
const now = args.now ?? Date.now();
|