@mulmobridge/protocol 0.1.3 → 0.1.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/index.d.ts +1 -1
- package/dist/socket.d.ts +27 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { EVENT_TYPES, type EventType, GENERATION_KINDS, type GenerationKind, type GenerationEvent, type PendingGeneration, generationKey } from "./events.js";
|
|
2
|
-
export { CHAT_SOCKET_PATH, CHAT_SOCKET_EVENTS, type ChatSocketEvent } from "./socket.js";
|
|
2
|
+
export { CHAT_SOCKET_PATH, CHAT_SOCKET_EVENTS, type ChatSocketEvent, type BridgeHandshakeAuth, type BridgeOptions } from "./socket.js";
|
|
3
3
|
export { type Attachment } from "./attachment.js";
|
|
4
4
|
export { CHAT_SERVICE_ROUTES } from "./routes.js";
|
package/dist/socket.d.ts
CHANGED
|
@@ -9,3 +9,30 @@ export declare const CHAT_SOCKET_EVENTS: {
|
|
|
9
9
|
readonly textChunk: "textChunk";
|
|
10
10
|
};
|
|
11
11
|
export type ChatSocketEvent = (typeof CHAT_SOCKET_EVENTS)[keyof typeof CHAT_SOCKET_EVENTS];
|
|
12
|
+
/**
|
|
13
|
+
* Bridge → host-app option bag carried on the handshake.
|
|
14
|
+
*
|
|
15
|
+
* Values are restricted to flat primitives (string / number /
|
|
16
|
+
* boolean). The restriction serves two purposes:
|
|
17
|
+
*
|
|
18
|
+
* 1. The wire contract is explicit — no surprise nested objects
|
|
19
|
+
* slip through to the host app's callback where a downstream
|
|
20
|
+
* merge might reintroduce prototype-pollution risk.
|
|
21
|
+
* 2. The scrape-from-env path produces strings anyway, so the
|
|
22
|
+
* ceiling is already flat primitives in practice.
|
|
23
|
+
*
|
|
24
|
+
* Protocol does not interpret any keys — bridges and host apps agree
|
|
25
|
+
* on names (`defaultRole`, …) out of band.
|
|
26
|
+
*/
|
|
27
|
+
export type BridgeOptions = Readonly<Record<string, string | number | boolean>>;
|
|
28
|
+
/**
|
|
29
|
+
* Shape of `socket.handshake.auth` on the bridge chat socket. The
|
|
30
|
+
* server validates `transportId` + `token`; `options` is the opaque-
|
|
31
|
+
* but-primitive bag forwarded to the host application's startChat
|
|
32
|
+
* callback. See `plans/feat-bridge-options-passthrough.md`.
|
|
33
|
+
*/
|
|
34
|
+
export interface BridgeHandshakeAuth {
|
|
35
|
+
transportId: string;
|
|
36
|
+
token?: string;
|
|
37
|
+
options?: BridgeOptions;
|
|
38
|
+
}
|