Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(chat): add chat wire service

Steven Enamakel755f8fe3ceef
diff --git a/app/src/services/chatWire.ts b/app/src/services/chatWire.ts
index c567636b47..cc93ca05f5 100644
--- a/app/src/services/chatWire.ts
+++ b/app/src/services/chatWire.ts
@@ -37,11 +37,15 @@ type Variant<K extends Tag> = Extract<WebChannelEvent, { event: K }>;
type NoNull<T> = { [P in keyof T]: Exclude<T[P], null> };
type Req<T, K extends keyof T> = Omit<T, K> & { [P in K]-?: Exclude<T[P], null | undefined> };
-/** Wire event `K`, nulls dropped, with `R` guaranteed present. */
-export type WireEvent<K extends Tag, R extends keyof Variant<K> = never> = Req<
- NoNull<Variant<K>>,
- R
->;
+/**
+ * Wire event `K` as consumers see it: nulls dropped, `R` guaranteed present.
+ * The `event` tag is the Socket.IO event name, so it is not repeated in the
+ * payload type, and `client_id` (routing only) is optional for consumers.
+ */
+export type WireEvent<K extends Tag, R extends keyof Variant<K> = never> = Omit<
+ Req<NoNull<Variant<K>>, R>,
+ 'event' | 'client_id'
+> & { client_id?: string };
// ── Shared payloads ──────────────────────────────────────────────────────────