summaryrefslogtreecommitdiffhomepage
path: root/src/core/wire/conformance.test.ts
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-12 15:08:24 +0900
committerAdam Malczewski <[email protected]>2026-06-12 15:08:24 +0900
commit5ef7cc2916c544a66d68805063b02290f24d9a25 (patch)
tree51724187d01813bbbbaef513eb8cada2e1bda1a6 /src/core/wire/conformance.test.ts
parentfb37680bd013509ab5d72619f261713e8473e988 (diff)
downloaddispatch-web-5ef7cc2916c544a66d68805063b02290f24d9a25.tar.gz
dispatch-web-5ef7cc2916c544a66d68805063b02290f24d9a25.zip
feat(chat): multi-client live view — watch in-flight turns + user prompt on stream
- subscribe every open conversation on load + WS reconnect (resync), unsubscribe on tab close - derive a stream-based 'generating' state for watchers (Composer running indicator) - fold the user-message turn event so watchers render the prompt mid-turn (de-dup vs sender's optimistic echo) - re-pin [email protected] / [email protected]; re-mirror contracts; add user-message to the exhaustiveness guard
Diffstat (limited to 'src/core/wire/conformance.test.ts')
-rw-r--r--src/core/wire/conformance.test.ts17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/core/wire/conformance.test.ts b/src/core/wire/conformance.test.ts
index 690ba4e..a258873 100644
--- a/src/core/wire/conformance.test.ts
+++ b/src/core/wire/conformance.test.ts
@@ -27,6 +27,7 @@ describe("classifies every AgentEvent type", () => {
const samples: AgentEvent[] = [
{ type: "status", conversationId: "c1", status: "idle" },
{ type: "turn-start", conversationId: "c1", turnId: "t1" },
+ { type: "user-message", conversationId: "c1", turnId: "t1", text: "hi" },
{ type: "text-delta", conversationId: "c1", turnId: "t1", delta: "hi" },
{ type: "reasoning-delta", conversationId: "c1", turnId: "t1", delta: "thinking" },
{
@@ -81,6 +82,7 @@ describe("classifies every AgentEvent type", () => {
expect(labels).toEqual([
"status",
"turn-start",
+ "user-message",
"text-delta",
"reasoning-delta",
"tool-call",
@@ -94,8 +96,8 @@ describe("classifies every AgentEvent type", () => {
]);
});
- it("covers all 12 AgentEvent variants", () => {
- expect(samples).toHaveLength(12);
+ it("covers all 13 AgentEvent variants", () => {
+ expect(samples).toHaveLength(13);
});
});
@@ -148,9 +150,18 @@ describe("classifies every WsClientMessage type", () => {
{ type: "unsubscribe" as const, surfaceId: "s" },
{ type: "invoke" as const, surfaceId: "s", actionId: "a" },
{ type: "chat.send" as const, message: "hi" },
+ { type: "chat.subscribe" as const, conversationId: "c1" },
+ { type: "chat.unsubscribe" as const, conversationId: "c1" },
];
const labels = msgs.map(assertWsClientMessageExhaustive);
- expect(labels).toEqual(["subscribe", "unsubscribe", "invoke", "chat.send"]);
+ expect(labels).toEqual([
+ "subscribe",
+ "unsubscribe",
+ "invoke",
+ "chat.send",
+ "chat.subscribe",
+ "chat.unsubscribe",
+ ]);
});
});