@ttt-productions/chat-react 0.12.3 → 0.12.4
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/realtime/channel-client.js +2 -2
- package/dist/realtime/inbox-client.d.ts +2 -2
- package/dist/realtime/inbox-client.js +3 -3
- package/dist/realtime/index.js +1 -1
- package/dist/realtime/map.d.ts +2 -2
- package/dist/realtime/map.d.ts.map +1 -1
- package/dist/realtime/map.js +4 -2
- package/dist/realtime/map.js.map +1 -1
- package/dist/realtime/shared.d.ts +1 -6
- package/dist/realtime/shared.d.ts.map +1 -1
- package/dist/realtime/shared.js +9 -11
- package/dist/realtime/shared.js.map +1 -1
- package/dist/realtime/socket.d.ts +1 -1
- package/dist/realtime/socket.d.ts.map +1 -1
- package/dist/realtime/socket.js +6 -5
- package/dist/realtime/socket.js.map +1 -1
- package/dist/realtime/wire.d.ts +9 -59
- package/dist/realtime/wire.d.ts.map +1 -1
- package/dist/realtime/wire.js +14 -50
- package/dist/realtime/wire.js.map +1 -1
- package/package.json +7 -7
|
@@ -31,8 +31,8 @@ const INITIAL = {
|
|
|
31
31
|
* Retryable error-frame code the channel DO sends when a send arrives BEFORE the
|
|
32
32
|
* member row has synced through the async backend→worker pipeline (a just-created
|
|
33
33
|
* invite/channel). The socket stays open; the client re-sends after `retryAfterMs`
|
|
34
|
-
* through the normal resendPendingSends machinery (same caps). The string is
|
|
35
|
-
* wire contract with
|
|
34
|
+
* through the normal resendPendingSends machinery (same caps). The string is part
|
|
35
|
+
* of the wire contract with the worker runtime's send handler.
|
|
36
36
|
*/
|
|
37
37
|
const MEMBERSHIP_PENDING_CODE = 'membership-pending';
|
|
38
38
|
/** Fallback retry delay when the frame omits/breaks `retryAfterMs`. */
|
|
@@ -3,7 +3,7 @@ import type { SocketFactory } from './socket.js';
|
|
|
3
3
|
import type { GrantProvider, TransportTimers, RealtimeStatus } from './shared.js';
|
|
4
4
|
export interface InboxClientState {
|
|
5
5
|
status: RealtimeStatus;
|
|
6
|
-
/** Active (non-tombstoned) channel/invite registry entries —
|
|
6
|
+
/** Active (non-tombstoned) channel/invite registry entries — inbox-view visibility. */
|
|
7
7
|
registry: WireRegistryEntry[];
|
|
8
8
|
/** True if ANY active channel/invite has unread (drives the dock dot). */
|
|
9
9
|
hasUnread: boolean;
|
|
@@ -50,7 +50,7 @@ export declare class InboxClient {
|
|
|
50
50
|
/** True if a specific channel/invite currently carries an unread dot. */
|
|
51
51
|
channelHasUnread(channelRef: string): boolean;
|
|
52
52
|
/**
|
|
53
|
-
* Clear a channel/invite's unread WITHOUT opening it (the
|
|
53
|
+
* Clear a channel/invite's unread WITHOUT opening it (the inbox-view mark-read
|
|
54
54
|
* controls). Sends `mark-read` on the inbox socket; the inbox DO advances the
|
|
55
55
|
* member's read cursor to tail on the channel DO and then pushes a fresh
|
|
56
56
|
* authoritative snapshot, which is what removes the row — there is NO optimistic
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// The Inbox realtime client: a SEPARATE WebSocket (scope `inbox`) to the user's
|
|
2
2
|
// inbox DO. It maintains the channel/invite registry + unread projection that
|
|
3
|
-
// drives the
|
|
3
|
+
// drives the inbox view — DOTS ONLY, no counts (Contract C / "Unread + inbox").
|
|
4
4
|
//
|
|
5
5
|
// The inbox DO pushes a full `snapshot` ({ registry, hasUnread }) on connect, on
|
|
6
6
|
// `resume`, and on every live delta (a projection apply). This client just
|
|
@@ -125,7 +125,7 @@ export class InboxClient {
|
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
applySnapshot(snap) {
|
|
128
|
-
// Keep every non-tombstoned entry — including ARCHIVED rows — so the
|
|
128
|
+
// Keep every non-tombstoned entry — including ARCHIVED rows — so the inbox view can
|
|
129
129
|
// render both the active list and the Archived toggle. `archived` is a distinct
|
|
130
130
|
// dimension from `tombstoned`; archived rows are still `state: 'active'`.
|
|
131
131
|
const registry = snap.registry.filter((e) => e.state === 'active');
|
|
@@ -149,7 +149,7 @@ export class InboxClient {
|
|
|
149
149
|
return this.state.unreadChannelRefs.includes(channelRef);
|
|
150
150
|
}
|
|
151
151
|
/**
|
|
152
|
-
* Clear a channel/invite's unread WITHOUT opening it (the
|
|
152
|
+
* Clear a channel/invite's unread WITHOUT opening it (the inbox-view mark-read
|
|
153
153
|
* controls). Sends `mark-read` on the inbox socket; the inbox DO advances the
|
|
154
154
|
* member's read cursor to tail on the channel DO and then pushes a fresh
|
|
155
155
|
* authoritative snapshot, which is what removes the row — there is NO optimistic
|
package/dist/realtime/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// The realtime (Cloudflare Durable Object) chat transport — the client half of
|
|
2
|
-
// the chat
|
|
2
|
+
// the chat Worker wire protocol (Contract A connection + Contract C wire). The
|
|
3
3
|
// FIRESTORE transport stays the unchanged default; this is opt-in via
|
|
4
4
|
// `ChatCoreConfig.transport === 'realtime'` + a `realtime.client` from
|
|
5
5
|
// `createRealtimeChatClient(...)`.
|
package/dist/realtime/map.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ChatMessageV1 } from '@ttt-productions/chat-core';
|
|
2
|
+
import { MODERATION_REDACTED_TEXT } from '@ttt-productions/chat-schemas';
|
|
2
3
|
import type { RevisionKind, WireMessageRow } from './wire.js';
|
|
3
|
-
|
|
4
|
-
export declare const MODERATION_REDACTED_TEXT: "[message removed]";
|
|
4
|
+
export { MODERATION_REDACTED_TEXT };
|
|
5
5
|
/** The effective moderation overlay for a message: the max-`messageRevision` kind. */
|
|
6
6
|
export interface ModerationOverlay {
|
|
7
7
|
kind: RevisionKind;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/realtime/map.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/realtime/map.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAI9D,OAAO,EAAE,wBAAwB,EAAE,CAAC;AAEpC,sFAAsF;AACtF,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,YAAY,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,iBAAiB,GAAG,IAAI,GAAG,aAAa,CAc/G;AAED,4FAA4F;AAC5F,wBAAgB,cAAc,CAAC,GAAG,EAAE,cAAc,GAAG,iBAAiB,GAAG,IAAI,CAG5E;AAED,qFAAqF;AACrF,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAElD;AAuBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,GAAG,aAAa,CAqBrF;AAED,8FAA8F;AAC9F,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IACtC,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CACjE,GAAG,aAAa,CAYhB"}
|
package/dist/realtime/map.js
CHANGED
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
// Identity invariant: the DO stores uid references only (`senderUid`), never a
|
|
6
6
|
// display name — names resolve at render time through the ChatNameResolver
|
|
7
7
|
// context, identical to the Firestore path.
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import { MODERATION_REDACTED_TEXT } from '@ttt-productions/chat-schemas';
|
|
9
|
+
// The redacted-text constant lives in the wire contract; re-export to keep this
|
|
10
|
+
// module's public surface stable.
|
|
11
|
+
export { MODERATION_REDACTED_TEXT };
|
|
10
12
|
/**
|
|
11
13
|
* Apply a moderation overlay to a mapped message so the ORIGINAL content never
|
|
12
14
|
* renders for a hidden/deleted message. Pure — returns a new message; the input
|
package/dist/realtime/map.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.js","sourceRoot":"","sources":["../../src/realtime/map.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,+EAA+E;AAC/E,kDAAkD;AAClD,EAAE;AACF,+EAA+E;AAC/E,2EAA2E;AAC3E,4CAA4C;
|
|
1
|
+
{"version":3,"file":"map.js","sourceRoot":"","sources":["../../src/realtime/map.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,+EAA+E;AAC/E,kDAAkD;AAClD,EAAE;AACF,+EAA+E;AAC/E,2EAA2E;AAC3E,4CAA4C;AAG5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAGzE,gFAAgF;AAChF,kCAAkC;AAClC,OAAO,EAAE,wBAAwB,EAAE,CAAC;AAQpC;;;;;;;;;GASG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAsB,EAAE,OAAiC;IAC9F,IAAI,CAAC,OAAO;QAAE,OAAO,OAAO,CAAC;IAC7B,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,CAAC,IAAI,KAAK,UAAU,CAAC;IAC1E,OAAO;QACL,GAAG,OAAO;QACV,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,wBAAwB,EAAE,CAAC,CA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ers;
|
|
16
16
|
/** Connection status surfaced to the UI. */
|
|
17
17
|
export type RealtimeStatus = 'idle' | 'connecting' | 'open' | 'reconnecting' | 'closed';
|
|
18
|
-
|
|
19
|
-
export declare const HEARTBEAT_MS = 20000;
|
|
20
|
-
/** Typing coalescing minimum interval (worker `TYPING_COALESCE_MS`). */
|
|
21
|
-
export declare const TYPING_COALESCE_MS = 2000;
|
|
22
|
-
/** History page cap (worker `HISTORY_PAGE_MAX`). */
|
|
23
|
-
export declare const HISTORY_PAGE_MAX = 50;
|
|
18
|
+
export { HEARTBEAT_MS, TYPING_COALESCE_MS, HISTORY_PAGE_MAX } from '@ttt-productions/chat-schemas';
|
|
24
19
|
/**
|
|
25
20
|
* Max reconnect resends of one un-acked send before its optimistic row is flipped
|
|
26
21
|
* to a visible failed state (retry affordance) instead of a permanent ghost. Each
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/realtime/shared.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/realtime/shared.ts"],"names":[],"mappings":"AASA;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;AAElD,4FAA4F;AAC5F,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,EAAE,EAAE,EAAE,MAAM,KAAK,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;IAC1E,YAAY,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,KAAK,IAAI,CAAC;IACzD,GAAG,EAAE,MAAM,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,aAAa,EAAE,eAI3B,CAAC;AAEF,4CAA4C;AAC5C,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,YAAY,GAAG,MAAM,GAAG,cAAc,GAAG,QAAQ,CAAC;AAIxF,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEnG;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,uBAAuB,QAAS,CAAC"}
|
package/dist/realtime/shared.js
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
// Shared injected contracts + tunable constants for the realtime transport.
|
|
2
2
|
//
|
|
3
|
-
// The
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
3
|
+
// The client-agreed limits (`HEARTBEAT_MS`, `TYPING_COALESCE_MS`,
|
|
4
|
+
// `HISTORY_PAGE_MAX`) come from the one wire contract in
|
|
5
|
+
// `@ttt-productions/chat-schemas`; they are re-exported here so the transport's
|
|
6
|
+
// existing import sites are unchanged. The worker runtime is the authority and
|
|
7
|
+
// rejects anything out of bounds, but the client uses these to coalesce and
|
|
8
|
+
// paginate politely. The remaining constants below are client-only retry policy.
|
|
8
9
|
export const defaultTimers = {
|
|
9
10
|
setTimeout: (fn, ms) => setTimeout(fn, ms),
|
|
10
11
|
clearTimeout: (h) => clearTimeout(h),
|
|
11
12
|
now: () => Date.now(),
|
|
12
13
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export const TYPING_COALESCE_MS = 2_000;
|
|
17
|
-
/** History page cap (worker `HISTORY_PAGE_MAX`). */
|
|
18
|
-
export const HISTORY_PAGE_MAX = 50;
|
|
14
|
+
// The client-agreed limits live in the wire contract; re-export to keep this
|
|
15
|
+
// module's public surface stable.
|
|
16
|
+
export { HEARTBEAT_MS, TYPING_COALESCE_MS, HISTORY_PAGE_MAX } from '@ttt-productions/chat-schemas';
|
|
19
17
|
/**
|
|
20
18
|
* Max reconnect resends of one un-acked send before its optimistic row is flipped
|
|
21
19
|
* to a visible failed state (retry affordance) instead of a permanent ghost. Each
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/realtime/shared.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,EAAE;AACF,
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/realtime/shared.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,EAAE;AACF,kEAAkE;AAClE,yDAAyD;AACzD,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,iFAAiF;AAkBjF,MAAM,CAAC,MAAM,aAAa,GAAoB;IAC5C,UAAU,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,EAAE,EAAE,CAAC;IAC1C,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IACpC,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;CACtB,CAAC;AAKF,6EAA6E;AAC7E,kCAAkC;AAClC,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEnG;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC"}
|
|
@@ -26,7 +26,7 @@ export type SocketFactory = (args: {
|
|
|
26
26
|
handlers: SocketHandlers;
|
|
27
27
|
}) => RealtimeSocket;
|
|
28
28
|
/**
|
|
29
|
-
* The default browser socket factory. Offers `[
|
|
29
|
+
* The default browser socket factory. Offers `[CHAT_SUBPROTOCOL, grantToken]` as the
|
|
30
30
|
* subprotocol list so the grant rides in `Sec-WebSocket-Protocol`, never the URL.
|
|
31
31
|
*/
|
|
32
32
|
export declare const browserSocketFactory: SocketFactory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socket.d.ts","sourceRoot":"","sources":["../../src/realtime/socket.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"socket.d.ts","sourceRoot":"","sources":["../../src/realtime/socket.ts"],"names":[],"mappings":"AAaA,+DAA+D;AAC/D,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,2FAA2F;IAC3F,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,+FAA+F;AAC/F,MAAM,WAAW,cAAc;IAC7B,kDAAkD;IAClD,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,uEAAuE;IACvE,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,kEAAkE;IAClE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,cAAc,CAAC;CAC1B,KAAK,cAAc,CAAC;AAiBrB;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAuBlC,CAAC"}
|
package/dist/realtime/socket.js
CHANGED
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
// real network is touched.
|
|
4
4
|
//
|
|
5
5
|
// Contract A transport: the grant token is offered as the SECOND WebSocket
|
|
6
|
-
// subprotocol — `Sec-WebSocket-Protocol:
|
|
7
|
-
// the URL (tokens never appear in URLs; Contract A). The browser sets
|
|
8
|
-
// from `new WebSocket(url, [
|
|
9
|
-
// cookie + grant + Origin BEFORE accept and echoes back only
|
|
6
|
+
// subprotocol — `Sec-WebSocket-Protocol: <CHAT_SUBPROTOCOL>, <grant-token>` —
|
|
7
|
+
// never in the URL (tokens never appear in URLs; Contract A). The browser sets
|
|
8
|
+
// that header from `new WebSocket(url, [CHAT_SUBPROTOCOL, grantToken])`. The
|
|
9
|
+
// worker validates cookie + grant + Origin BEFORE accept and echoes back only
|
|
10
|
+
// CHAT_SUBPROTOCOL.
|
|
10
11
|
import { CHAT_SUBPROTOCOL } from './wire.js';
|
|
11
12
|
const WS_OPEN = 1;
|
|
12
13
|
/**
|
|
13
|
-
* The default browser socket factory. Offers `[
|
|
14
|
+
* The default browser socket factory. Offers `[CHAT_SUBPROTOCOL, grantToken]` as the
|
|
14
15
|
* subprotocol list so the grant rides in `Sec-WebSocket-Protocol`, never the URL.
|
|
15
16
|
*/
|
|
16
17
|
export const browserSocketFactory = ({ url, grantToken, handlers }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socket.js","sourceRoot":"","sources":["../../src/realtime/socket.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,gFAAgF;AAChF,2BAA2B;AAC3B,EAAE;AACF,2EAA2E;AAC3E,
|
|
1
|
+
{"version":3,"file":"socket.js","sourceRoot":"","sources":["../../src/realtime/socket.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,gFAAgF;AAChF,2BAA2B;AAC3B,EAAE;AACF,2EAA2E;AAC3E,8EAA8E;AAC9E,+EAA+E;AAC/E,6EAA6E;AAC7E,8EAA8E;AAC9E,oBAAoB;AAEpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AA6C7C,MAAM,OAAO,GAAG,CAAC,CAAC;AAElB;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAkB,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE;IACnF,MAAM,IAAI,GAAI,UAA4C,CAAC,SAAS,CAAC;IACrE,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CA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S`). */
|
|
6
|
-
export declare const CLIENT_FRAME: {
|
|
7
|
-
readonly SEND: "send";
|
|
8
|
-
readonly READ_ACK: "read-ack";
|
|
9
|
-
readonly HISTORY: "history";
|
|
10
|
-
readonly TYPING: "typing";
|
|
11
|
-
readonly PRESENCE_SUBSCRIBE: "presence-subscribe";
|
|
12
|
-
readonly PRESENCE_UNSUBSCRIBE: "presence-unsubscribe";
|
|
13
|
-
readonly HEARTBEAT: "heartbeat";
|
|
14
|
-
readonly RESUME: "resume";
|
|
15
|
-
/** INBOX-socket-only: clear a channel's unread without opening it. The inbox DO
|
|
16
|
-
* validates the ref against the caller's registry, advances the read cursor to
|
|
17
|
-
* tail on the channel DO, then pushes a fresh authoritative snapshot. */
|
|
18
|
-
readonly MARK_READ: "mark-read";
|
|
19
|
-
};
|
|
20
|
-
/** DO → client message `type`s (chat-worker `SERVER_KINDS`). */
|
|
21
|
-
export declare const SERVER_FRAME: {
|
|
22
|
-
readonly MESSAGE: "message";
|
|
23
|
-
readonly ACK: "ack";
|
|
24
|
-
readonly HISTORY_PAGE: "history-page";
|
|
25
|
-
readonly PRESENCE: "presence";
|
|
26
|
-
readonly TYPING: "typing";
|
|
27
|
-
readonly UNREAD: "unread";
|
|
28
|
-
readonly SNAPSHOT: "snapshot";
|
|
29
|
-
readonly ERROR: "error";
|
|
30
|
-
readonly REVISION: "revision";
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* WebSocket close codes (Contract C). 4xxx are app codes; 1013 is the standard
|
|
34
|
-
* "try again later". Mirrors chat-worker `CLOSE_CODES`.
|
|
35
|
-
*/
|
|
36
|
-
export declare const CHAT_CLOSE_CODES: {
|
|
37
|
-
readonly AUTH_EXPIRED: 4401;
|
|
38
|
-
readonly REVOKED: 4403;
|
|
39
|
-
readonly FLOOD: 4408;
|
|
40
|
-
readonly TOO_LARGE: 4413;
|
|
41
|
-
readonly SOCKET_CAP: 4429;
|
|
42
|
-
readonly OVERLOADED: 1013;
|
|
43
|
-
};
|
|
44
|
-
export type ChatCloseCode = (typeof CHAT_CLOSE_CODES)[keyof typeof CHAT_CLOSE_CODES];
|
|
45
|
-
/** A logical chat channel — typed tuple (NEVER a path string). Mirrors the worker's ChannelRefTuple. */
|
|
46
|
-
export type ChannelRefTuple = {
|
|
47
|
-
scope: 'channel';
|
|
48
|
-
workProjectId: string;
|
|
49
|
-
guildChatChannelId: string;
|
|
50
|
-
} | {
|
|
51
|
-
scope: 'invite';
|
|
52
|
-
guildInviteId: string;
|
|
53
|
-
};
|
|
1
|
+
export { CHAT_SUBPROTOCOL, CHAT_WIRE_VERSION, CHAT_CLOSE_CODES, CLIENT_KINDS as CLIENT_FRAME, SERVER_KINDS as SERVER_FRAME, } from '@ttt-productions/chat-schemas';
|
|
2
|
+
export type { ChatCloseCode, ChannelRefTuple } from '@ttt-productions/chat-schemas';
|
|
3
|
+
import type { ChannelRefTuple } from '@ttt-productions/chat-schemas';
|
|
54
4
|
/**
|
|
55
|
-
* The moderation revision `kind` (
|
|
5
|
+
* The moderation revision `kind` (the worker runtime's revision input + the
|
|
56
6
|
* `revisions.kind` column). The EFFECTIVE state of a message is its
|
|
57
7
|
* MAX-`messageRevision` row's kind, so a `restore` (a later revision) supersedes
|
|
58
8
|
* an earlier `moderate`/`delete`. `moderate`/`delete` blank the original text;
|
|
@@ -60,8 +10,8 @@ export type ChannelRefTuple = {
|
|
|
60
10
|
*/
|
|
61
11
|
export type RevisionKind = 'delete' | 'moderate' | 'edit' | 'restore';
|
|
62
12
|
/**
|
|
63
|
-
* A message row as the Channel DO stores + broadcasts it (
|
|
64
|
-
*
|
|
13
|
+
* A message row as the Channel DO stores + broadcasts it (the worker runtime's
|
|
14
|
+
* message row). `replyTo`/`attachmentMeta` arrive as JSON STRINGS (or null) —
|
|
65
15
|
* the DO stores them stringified and does not re-parse before broadcast. The
|
|
66
16
|
* adapter mapping in `map.ts` parses them into the UI `ChatMessageV1` shape.
|
|
67
17
|
*/
|
|
@@ -107,14 +57,14 @@ export interface WireChannelSnapshot {
|
|
|
107
57
|
resync?: boolean;
|
|
108
58
|
delta?: WireMessageRow[];
|
|
109
59
|
}
|
|
110
|
-
/** A registry entry in the inbox snapshot (
|
|
60
|
+
/** A registry entry in the inbox snapshot (the worker runtime's registry entry). */
|
|
111
61
|
export interface WireRegistryEntry {
|
|
112
62
|
channelRef: string;
|
|
113
63
|
kind: string;
|
|
114
64
|
state: 'active' | 'tombstoned';
|
|
115
65
|
registryVersion: number;
|
|
116
66
|
/**
|
|
117
|
-
* The typed channel-ref tuple — the OPENABLE identity for the
|
|
67
|
+
* The typed channel-ref tuple — the OPENABLE identity for the inbox view (the
|
|
118
68
|
* `channelRef` is an opaque DO-id dedup key). Null/absent on legacy or pre-tuple
|
|
119
69
|
* rows; the consumer falls back to hiding the open action for those entries.
|
|
120
70
|
*/
|
|
@@ -126,7 +76,7 @@ export interface WireRegistryEntry {
|
|
|
126
76
|
unread?: boolean;
|
|
127
77
|
/**
|
|
128
78
|
* Archived state — DISTINCT from `tombstoned`. An archived row is still an ACTIVE
|
|
129
|
-
* membership (`state: 'active'`, history readable) but is grouped under the
|
|
79
|
+
* membership (`state: 'active'`, history readable) but is grouped under the inbox
|
|
130
80
|
* view's Archived toggle instead of the active list. The client must NOT count
|
|
131
81
|
* archived rows in the unread roll-up (archive = done; the DO clears unread on
|
|
132
82
|
* archive). Optional/absent on a pre-archive DO (treated as not-archived).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../src/realtime/wire.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../src/realtime/wire.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,IAAI,YAAY,EAC5B,YAAY,IAAI,YAAY,GAC7B,MAAM,+BAA+B,CAAC;AACvC,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE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;CAAE,CAAC;AAEvG,qFAAqF;AACrF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAEjF;AAED,kFAAkF;AAClF,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAAG,IAAI,CAQ/G;AAED,wGAAwG;AACxG,wBAAgB,eAAe,CAAC,CAAC,EAAE,mBAAmB,GAAG,iBAAiB,GAAG,CAAC,IAAI,iBAAiB,CAElG"}
|
package/dist/realtime/wire.js
CHANGED
|
@@ -1,57 +1,21 @@
|
|
|
1
|
-
// Chat realtime WIRE PROTOCOL (Contract C) — the client side of the
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// Chat realtime WIRE PROTOCOL (Contract C) — the client side of the Channel +
|
|
2
|
+
// Inbox Durable Object protocol. The canonical protocol declarations (subprotocol,
|
|
3
|
+
// frame-kind maps, close codes, channel-ref tuple, grant scope, client-agreed
|
|
4
|
+
// limits) are owned by `@ttt-productions/chat-schemas`; this file consumes them
|
|
5
|
+
// and adds the client-side raw row/frame shapes the transport maps into the UI
|
|
6
|
+
// message shape. The client and the worker runtime agree on the wire by both
|
|
7
|
+
// importing that one contract; neither imports the other.
|
|
6
8
|
//
|
|
7
9
|
// Frame shape on the socket is `{ v, type, payload }` (NOT realtime-core's
|
|
8
|
-
// `{ v, kind, payload }`): the
|
|
10
|
+
// `{ v, kind, payload }`): the worker runtime `send`/`broadcast` emit
|
|
9
11
|
// `JSON.stringify({ v: 1, type, payload })` and read `env.type` + `env.payload`.
|
|
10
12
|
// We keep that field name here to match; realtime-core's envelope schema is the
|
|
11
|
-
// generic transport primitive, the chat
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
export const CLIENT_FRAME = {
|
|
18
|
-
SEND: 'send',
|
|
19
|
-
READ_ACK: 'read-ack',
|
|
20
|
-
HISTORY: 'history',
|
|
21
|
-
TYPING: 'typing',
|
|
22
|
-
PRESENCE_SUBSCRIBE: 'presence-subscribe',
|
|
23
|
-
PRESENCE_UNSUBSCRIBE: 'presence-unsubscribe',
|
|
24
|
-
HEARTBEAT: 'heartbeat',
|
|
25
|
-
RESUME: 'resume',
|
|
26
|
-
/** INBOX-socket-only: clear a channel's unread without opening it. The inbox DO
|
|
27
|
-
* validates the ref against the caller's registry, advances the read cursor to
|
|
28
|
-
* tail on the channel DO, then pushes a fresh authoritative snapshot. */
|
|
29
|
-
MARK_READ: 'mark-read',
|
|
30
|
-
};
|
|
31
|
-
/** DO → client message `type`s (chat-worker `SERVER_KINDS`). */
|
|
32
|
-
export const SERVER_FRAME = {
|
|
33
|
-
MESSAGE: 'message',
|
|
34
|
-
ACK: 'ack',
|
|
35
|
-
HISTORY_PAGE: 'history-page',
|
|
36
|
-
PRESENCE: 'presence',
|
|
37
|
-
TYPING: 'typing',
|
|
38
|
-
UNREAD: 'unread',
|
|
39
|
-
SNAPSHOT: 'snapshot',
|
|
40
|
-
ERROR: 'error',
|
|
41
|
-
REVISION: 'revision',
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* WebSocket close codes (Contract C). 4xxx are app codes; 1013 is the standard
|
|
45
|
-
* "try again later". Mirrors chat-worker `CLOSE_CODES`.
|
|
46
|
-
*/
|
|
47
|
-
export const CHAT_CLOSE_CODES = {
|
|
48
|
-
AUTH_EXPIRED: 4401,
|
|
49
|
-
REVOKED: 4403,
|
|
50
|
-
FLOOD: 4408,
|
|
51
|
-
TOO_LARGE: 4413,
|
|
52
|
-
SOCKET_CAP: 4429,
|
|
53
|
-
OVERLOADED: 1013,
|
|
54
|
-
};
|
|
13
|
+
// generic transport primitive, the chat protocol chose `type` for its frames.
|
|
14
|
+
// Re-export the canonical wire contract so this package's public surface is
|
|
15
|
+
// unchanged. `CLIENT_FRAME`/`SERVER_FRAME` are this package's historical names
|
|
16
|
+
// for the frame-kind maps (`CLIENT_KINDS`/`SERVER_KINDS` in the contract).
|
|
17
|
+
export { CHAT_SUBPROTOCOL, CHAT_WIRE_VERSION, CHAT_CLOSE_CODES, CLIENT_KINDS as CLIENT_FRAME, SERVER_KINDS as SERVER_FRAME, } from '@ttt-productions/chat-schemas';
|
|
18
|
+
import { CHAT_WIRE_VERSION } from '@ttt-productions/chat-schemas';
|
|
55
19
|
/** Build an outbound `{ v, type, payload }` frame (the wire format the DO reads). */
|
|
56
20
|
export function buildFrame(type, payload) {
|
|
57
21
|
return JSON.stringify({ v: CHAT_WIRE_VERSION, type, payload });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wire.js","sourceRoot":"","sources":["../../src/realtime/wire.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"wire.js","sourceRoot":"","sources":["../../src/realtime/wire.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,mFAAmF;AACnF,8EAA8E;AAC9E,gFAAgF;AAChF,+EAA+E;AAC/E,6EAA6E;AAC7E,0DAA0D;AAC1D,EAAE;AACF,2EAA2E;AAC3E,sEAAsE;AACtE,iFAAiF;AACjF,gFAAgF;AAChF,8EAA8E;AAE9E,4EAA4E;AAC5E,+EAA+E;AAC/E,2EAA2E;AAC3E,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,IAAI,YAAY,EAC5B,YAAY,IAAI,YAAY,GAC7B,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAsHlE,qFAAqF;AACrF,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,OAAgC;IACvE,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;AACjE,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAY,CAAC;QAC1C,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC;QACvD,OAAO,MAA0E,CAAC;IACpF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,wGAAwG;AACxG,MAAM,UAAU,eAAe,CAAC,CAA0C;IACxE,OAAO,KAAK,CAAC,OAAO,CAAE,CAAuB,CAAC,QAAQ,CAAC,CAAC;AAC1D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttt-productions/chat-react",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.4",
|
|
4
4
|
"description": "Chat React UI, hooks, and Firebase-client adapter for TTT Productions apps (realtime newest window + infinite older pagination)",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -61,15 +61,15 @@
|
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@ttt-productions/chat-core": "^0.10.1",
|
|
64
|
-
"@ttt-productions/chat-schemas": "^0.9.
|
|
65
|
-
"@ttt-productions/realtime-core": "^0.1.
|
|
66
|
-
"@ttt-productions/media-schemas": "^0.14.
|
|
64
|
+
"@ttt-productions/chat-schemas": "^0.9.1",
|
|
65
|
+
"@ttt-productions/realtime-core": "^0.1.2",
|
|
66
|
+
"@ttt-productions/media-schemas": "^0.14.1",
|
|
67
67
|
"@ttt-productions/ui-core": "^0.11.4",
|
|
68
68
|
"@ttt-productions/file-input": "^0.11.0",
|
|
69
|
-
"@ttt-productions/upload-ui": "^0.7.
|
|
70
|
-
"@ttt-productions/media-viewer": "^0.10.
|
|
69
|
+
"@ttt-productions/upload-ui": "^0.7.4",
|
|
70
|
+
"@ttt-productions/media-viewer": "^0.10.2",
|
|
71
71
|
"@ttt-productions/mobile-core": "^0.9.0",
|
|
72
|
-
"@ttt-productions/firebase-helpers": "^0.12.
|
|
72
|
+
"@ttt-productions/firebase-helpers": "^0.12.1"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@ttt-productions/query-core": "^0.14.0",
|