agent-comms 3.19.0 → 3.21.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.
Files changed (174) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +1 -1
  4. package/dist/bridges/cc-peer/front-runtime.d.ts.map +1 -1
  5. package/dist/bridges/cc-peer/front-runtime.js +2 -1
  6. package/dist/bridges/cc-peer/front-runtime.js.map +1 -1
  7. package/dist/bridges/cc-peer/run.d.ts.map +1 -1
  8. package/dist/bridges/cc-peer/run.js +2 -1
  9. package/dist/bridges/cc-peer/run.js.map +1 -1
  10. package/dist/bridges/user/web/contract.d.ts +1796 -0
  11. package/dist/bridges/user/web/contract.d.ts.map +1 -0
  12. package/dist/bridges/user/web/contract.js +120 -0
  13. package/dist/bridges/user/web/contract.js.map +1 -0
  14. package/dist/bridges/user/web/dist/bundle.js +49 -565
  15. package/dist/bridges/user/web/{frontend → dist}/index.html +1 -1
  16. package/dist/bridges/user/web/dist/mesh-worker.js +1 -1
  17. package/dist/bridges/user/web/dist/sw.js +1 -1
  18. package/dist/bridges/user/web/frontend/components/App.d.ts +3 -4
  19. package/dist/bridges/user/web/frontend/components/App.d.ts.map +1 -1
  20. package/dist/bridges/user/web/frontend/components/App.js +11 -9
  21. package/dist/bridges/user/web/frontend/components/App.js.map +1 -1
  22. package/dist/bridges/user/web/frontend/components/ChatArea.d.ts +5 -2
  23. package/dist/bridges/user/web/frontend/components/ChatArea.d.ts.map +1 -1
  24. package/dist/bridges/user/web/frontend/components/ChatArea.js +12 -8
  25. package/dist/bridges/user/web/frontend/components/ChatArea.js.map +1 -1
  26. package/dist/bridges/user/web/frontend/components/CreateRoomForm.d.ts +1 -1
  27. package/dist/bridges/user/web/frontend/components/CreateRoomForm.d.ts.map +1 -1
  28. package/dist/bridges/user/web/frontend/components/CreateRoomForm.js +19 -13
  29. package/dist/bridges/user/web/frontend/components/CreateRoomForm.js.map +1 -1
  30. package/dist/bridges/user/web/frontend/components/JoinForm.d.ts +1 -1
  31. package/dist/bridges/user/web/frontend/components/JoinForm.d.ts.map +1 -1
  32. package/dist/bridges/user/web/frontend/components/JoinForm.js +7 -7
  33. package/dist/bridges/user/web/frontend/components/JoinForm.js.map +1 -1
  34. package/dist/bridges/user/web/frontend/components/Message.d.ts +1 -1
  35. package/dist/bridges/user/web/frontend/components/Message.d.ts.map +1 -1
  36. package/dist/bridges/user/web/frontend/components/Message.js +10 -6
  37. package/dist/bridges/user/web/frontend/components/Message.js.map +1 -1
  38. package/dist/bridges/user/web/frontend/components/MessageList.d.ts +1 -1
  39. package/dist/bridges/user/web/frontend/components/MessageList.d.ts.map +1 -1
  40. package/dist/bridges/user/web/frontend/components/MessageList.js +8 -6
  41. package/dist/bridges/user/web/frontend/components/MessageList.js.map +1 -1
  42. package/dist/bridges/user/web/frontend/components/ProjectTree.d.ts +2 -3
  43. package/dist/bridges/user/web/frontend/components/ProjectTree.d.ts.map +1 -1
  44. package/dist/bridges/user/web/frontend/components/ProjectTree.js +38 -22
  45. package/dist/bridges/user/web/frontend/components/ProjectTree.js.map +1 -1
  46. package/dist/bridges/user/web/frontend/components/Sidebar.d.ts +3 -2
  47. package/dist/bridges/user/web/frontend/components/Sidebar.d.ts.map +1 -1
  48. package/dist/bridges/user/web/frontend/components/Sidebar.js +9 -6
  49. package/dist/bridges/user/web/frontend/components/Sidebar.js.map +1 -1
  50. package/dist/bridges/user/web/frontend/main.d.ts +3 -4
  51. package/dist/bridges/user/web/frontend/main.d.ts.map +1 -1
  52. package/dist/bridges/user/web/frontend/main.js +40 -37
  53. package/dist/bridges/user/web/frontend/main.js.map +1 -1
  54. package/dist/bridges/user/web/frontend/messages.d.ts +1 -0
  55. package/dist/bridges/user/web/frontend/messages.d.ts.map +1 -1
  56. package/dist/bridges/user/web/frontend/messages.js +6 -0
  57. package/dist/bridges/user/web/frontend/messages.js.map +1 -1
  58. package/dist/bridges/user/web/frontend/sw.js +2 -9
  59. package/dist/bridges/user/web/frontend/sw.js.map +1 -1
  60. package/dist/bridges/user/web/frontend/theme.d.ts +154 -0
  61. package/dist/bridges/user/web/frontend/theme.d.ts.map +1 -0
  62. package/dist/bridges/user/web/frontend/theme.js +36 -0
  63. package/dist/bridges/user/web/frontend/theme.js.map +1 -0
  64. package/dist/bridges/user/web/frontend/use-client-state.d.ts +6 -0
  65. package/dist/bridges/user/web/frontend/use-client-state.d.ts.map +1 -0
  66. package/dist/bridges/user/web/frontend/use-client-state.js +8 -0
  67. package/dist/bridges/user/web/frontend/use-client-state.js.map +1 -0
  68. package/dist/bridges/user/web/server.js +9 -3
  69. package/dist/bridges/user/web/server.js.map +1 -1
  70. package/dist/bridges/user/web/test/contract.unit.test.d.ts +2 -0
  71. package/dist/bridges/user/web/test/contract.unit.test.d.ts.map +1 -0
  72. package/dist/bridges/user/web/test/contract.unit.test.js +56 -0
  73. package/dist/bridges/user/web/test/contract.unit.test.js.map +1 -0
  74. package/dist/bridges/user/web/vite.config.d.ts +10 -0
  75. package/dist/bridges/user/web/vite.config.d.ts.map +1 -0
  76. package/dist/bridges/user/web/vite.config.js +66 -0
  77. package/dist/bridges/user/web/vite.config.js.map +1 -0
  78. package/dist/core/bridge-mesh.d.ts +2 -0
  79. package/dist/core/bridge-mesh.d.ts.map +1 -1
  80. package/dist/core/bridge-mesh.js +5 -1
  81. package/dist/core/bridge-mesh.js.map +1 -1
  82. package/dist/core/bridge.d.ts +1 -0
  83. package/dist/core/bridge.d.ts.map +1 -1
  84. package/dist/core/bridge.js +5 -0
  85. package/dist/core/bridge.js.map +1 -1
  86. package/dist/core/gossip-directory.d.ts +6 -2
  87. package/dist/core/gossip-directory.d.ts.map +1 -1
  88. package/dist/core/gossip-directory.js +25 -4
  89. package/dist/core/gossip-directory.js.map +1 -1
  90. package/dist/core/mesh-store.d.ts +14 -0
  91. package/dist/core/mesh-store.d.ts.map +1 -1
  92. package/dist/core/mesh-store.js +40 -0
  93. package/dist/core/mesh-store.js.map +1 -1
  94. package/dist/core/package-version.d.ts +4 -0
  95. package/dist/core/package-version.d.ts.map +1 -1
  96. package/dist/core/package-version.js +2 -1
  97. package/dist/core/package-version.js.map +1 -1
  98. package/dist/core/peer-versions.d.ts +16 -0
  99. package/dist/core/peer-versions.d.ts.map +1 -0
  100. package/dist/core/peer-versions.js +42 -0
  101. package/dist/core/peer-versions.js.map +1 -0
  102. package/dist/core/room-lifecycle.d.ts +5 -5
  103. package/dist/core/room-lifecycle.d.ts.map +1 -1
  104. package/dist/core/room-lifecycle.js +11 -5
  105. package/dist/core/room-lifecycle.js.map +1 -1
  106. package/dist/core/room-lookup.d.ts +9 -0
  107. package/dist/core/room-lookup.d.ts.map +1 -0
  108. package/dist/core/room-lookup.js +26 -0
  109. package/dist/core/room-lookup.js.map +1 -0
  110. package/dist/core/room-messaging.d.ts +2 -2
  111. package/dist/core/room-messaging.d.ts.map +1 -1
  112. package/dist/core/room-messaging.js +5 -2
  113. package/dist/core/room-messaging.js.map +1 -1
  114. package/dist/core/tool.d.ts +16 -0
  115. package/dist/core/tool.d.ts.map +1 -1
  116. package/dist/core/tool.js +10 -4
  117. package/dist/core/tool.js.map +1 -1
  118. package/dist/core/transport.d.ts +4 -0
  119. package/dist/core/transport.d.ts.map +1 -1
  120. package/dist/core/types.d.ts +6 -0
  121. package/dist/core/types.d.ts.map +1 -1
  122. package/dist/core/types.js +4 -0
  123. package/dist/core/types.js.map +1 -1
  124. package/dist/core/version-report-actions.d.ts +18 -0
  125. package/dist/core/version-report-actions.d.ts.map +1 -0
  126. package/dist/core/version-report-actions.js +51 -0
  127. package/dist/core/version-report-actions.js.map +1 -0
  128. package/dist/core/wire-mesh-core-version.d.ts +6 -0
  129. package/dist/core/wire-mesh-core-version.d.ts.map +1 -0
  130. package/dist/core/wire-mesh-core-version.js +20 -0
  131. package/dist/core/wire-mesh-core-version.js.map +1 -0
  132. package/dist/core/wire-mesh-transport.d.ts +4 -0
  133. package/dist/core/wire-mesh-transport.d.ts.map +1 -1
  134. package/dist/core/wire-mesh-transport.js +8 -9
  135. package/dist/core/wire-mesh-transport.js.map +1 -1
  136. package/dist/test/agent-comms-version-gossip.integration.test.d.ts +5 -0
  137. package/dist/test/agent-comms-version-gossip.integration.test.d.ts.map +1 -0
  138. package/dist/test/agent-comms-version-gossip.integration.test.js +103 -0
  139. package/dist/test/agent-comms-version-gossip.integration.test.js.map +1 -0
  140. package/dist/test/peer-versions.test.d.ts +5 -0
  141. package/dist/test/peer-versions.test.d.ts.map +1 -0
  142. package/dist/test/peer-versions.test.js +68 -0
  143. package/dist/test/peer-versions.test.js.map +1 -0
  144. package/dist/test/query-version.integration.test.d.ts +5 -0
  145. package/dist/test/query-version.integration.test.d.ts.map +1 -0
  146. package/dist/test/query-version.integration.test.js +64 -0
  147. package/dist/test/query-version.integration.test.js.map +1 -0
  148. package/dist/test/send-by-room-name.test.d.ts +5 -0
  149. package/dist/test/send-by-room-name.test.d.ts.map +1 -0
  150. package/dist/test/send-by-room-name.test.js +77 -0
  151. package/dist/test/send-by-room-name.test.js.map +1 -0
  152. package/dist/test/tool-version-reporting.test.js +38 -0
  153. package/dist/test/tool-version-reporting.test.js.map +1 -1
  154. package/dist/test/version-report-actions.test.d.ts +5 -0
  155. package/dist/test/version-report-actions.test.d.ts.map +1 -0
  156. package/dist/test/version-report-actions.test.js +88 -0
  157. package/dist/test/version-report-actions.test.js.map +1 -0
  158. package/dist/test/wire-mesh-core-version.test.d.ts +5 -0
  159. package/dist/test/wire-mesh-core-version.test.d.ts.map +1 -0
  160. package/dist/test/wire-mesh-core-version.test.js +14 -0
  161. package/dist/test/wire-mesh-core-version.test.js.map +1 -0
  162. package/package.json +23 -7
  163. package/dist/bridges/user/web/build.d.ts +0 -12
  164. package/dist/bridges/user/web/build.d.ts.map +0 -1
  165. package/dist/bridges/user/web/build.js +0 -95
  166. package/dist/bridges/user/web/build.js.map +0 -1
  167. package/dist/bridges/user/web/frontend/dom.d.ts +0 -25
  168. package/dist/bridges/user/web/frontend/dom.d.ts.map +0 -1
  169. package/dist/bridges/user/web/frontend/dom.js +0 -48
  170. package/dist/bridges/user/web/frontend/dom.js.map +0 -1
  171. package/dist/bridges/user/web/generated-html.d.ts +0 -6
  172. package/dist/bridges/user/web/generated-html.d.ts.map +0 -1
  173. package/dist/bridges/user/web/generated-html.js +0 -179
  174. package/dist/bridges/user/web/generated-html.js.map +0 -1
@@ -0,0 +1,1796 @@
1
+ /**
2
+ * oRPC contract for the web UI's browser-to-server protocol.
3
+ *
4
+ * One procedure per browser-facing action, plus a single `subscribeEvents` procedure that unifies what the JSON-over-WebSocket protocol split across three separate concepts: the chat socket's `delivery` frames, the mesh socket's `state_sync` method, and its `state_update` method. Entity and delivery-event shapes are imported from core/types.ts rather than re-declared here -- core already carries the single source of truth Zod schema for each (AgentIdentitySchema, RoomSchema, RoomMessageSchema, DmMessageSchema, DeliveryEventSchema), and duplicating them a third time (frontend/types.ts's hand-written interfaces are the second copy) is exactly the kind of drift that let frontend/mesh-worker.ts's local MeshStatePatch keep a "message_read" variant the real server stopped emitting once room.read replaced the old mesh-wide broadcast.
5
+ */
6
+ import { z } from "zod";
7
+ declare const ActionResultSchema: z.ZodObject<{
8
+ content: z.ZodString;
9
+ isError: z.ZodBoolean;
10
+ }, z.core.$strip>;
11
+ declare const MeshStatePatchSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
12
+ type: z.ZodLiteral<"agent_upsert">;
13
+ agent: z.ZodObject<{
14
+ id: z.ZodString;
15
+ version: z.ZodNumber;
16
+ name: z.ZodString;
17
+ harness: z.ZodString;
18
+ cwd: z.ZodString;
19
+ pid: z.ZodNumber;
20
+ startedAt: z.ZodString;
21
+ visibility: z.ZodUnion<readonly [z.ZodLiteral<"visible">, z.ZodLiteral<"hidden">, z.ZodLiteral<"ghost">]> & {
22
+ is: (value: unknown) => value is "visible" | "hidden" | "ghost";
23
+ };
24
+ status: z.ZodUnion<readonly [z.ZodLiteral<"active">, z.ZodLiteral<"idle">, z.ZodLiteral<"busy">, z.ZodLiteral<"offline">]> & {
25
+ is: (value: unknown) => value is "active" | "idle" | "busy" | "offline";
26
+ };
27
+ tags: z.ZodArray<z.ZodString>;
28
+ subscribedRooms: z.ZodArray<z.ZodString>;
29
+ }, z.core.$strip> & {
30
+ is: (value: unknown) => value is {
31
+ id: string;
32
+ version: number;
33
+ name: string;
34
+ harness: string;
35
+ cwd: string;
36
+ pid: number;
37
+ startedAt: string;
38
+ visibility: "visible" | "hidden" | "ghost";
39
+ status: "active" | "idle" | "busy" | "offline";
40
+ tags: string[];
41
+ subscribedRooms: string[];
42
+ };
43
+ };
44
+ }, z.core.$strip>, z.ZodObject<{
45
+ type: z.ZodLiteral<"agent_offline">;
46
+ agentId: z.ZodString;
47
+ }, z.core.$strip>, z.ZodObject<{
48
+ type: z.ZodLiteral<"room_upsert">;
49
+ room: z.ZodObject<{
50
+ id: z.ZodString;
51
+ version: z.ZodNumber;
52
+ name: z.ZodString;
53
+ type: z.ZodUnion<readonly [z.ZodLiteral<"public">, z.ZodLiteral<"private">, z.ZodLiteral<"secret">]> & {
54
+ is: (value: unknown) => value is "public" | "private" | "secret";
55
+ };
56
+ owner: z.ZodString;
57
+ createdAt: z.ZodString;
58
+ description: z.ZodString;
59
+ members: z.ZodArray<z.ZodString>;
60
+ invited: z.ZodArray<z.ZodString>;
61
+ memberJoins: z.ZodRecord<z.ZodString, z.ZodNumber>;
62
+ memberLeaves: z.ZodRecord<z.ZodString, z.ZodNumber>;
63
+ invitedJoins: z.ZodRecord<z.ZodString, z.ZodNumber>;
64
+ invitedLeaves: z.ZodRecord<z.ZodString, z.ZodNumber>;
65
+ }, z.core.$strip> & {
66
+ is: (value: unknown) => value is {
67
+ id: string;
68
+ version: number;
69
+ name: string;
70
+ type: "public" | "private" | "secret";
71
+ owner: string;
72
+ createdAt: string;
73
+ description: string;
74
+ members: string[];
75
+ invited: string[];
76
+ memberJoins: Record<string, number>;
77
+ memberLeaves: Record<string, number>;
78
+ invitedJoins: Record<string, number>;
79
+ invitedLeaves: Record<string, number>;
80
+ };
81
+ };
82
+ }, z.core.$strip>, z.ZodObject<{
83
+ type: z.ZodLiteral<"room_delete">;
84
+ roomId: z.ZodString;
85
+ }, z.core.$strip>, z.ZodObject<{
86
+ type: z.ZodLiteral<"message_add">;
87
+ roomId: z.ZodString;
88
+ message: z.ZodObject<{
89
+ id: z.ZodString;
90
+ from: z.ZodString;
91
+ room: z.ZodString;
92
+ content: z.ZodString;
93
+ timestamp: z.ZodString;
94
+ replyTo: z.ZodOptional<z.ZodString>;
95
+ readBy: z.ZodArray<z.ZodString>;
96
+ streamingBehavior: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"steer">, z.ZodLiteral<"followUp">, z.ZodLiteral<"info">]> & {
97
+ is: (value: unknown) => value is "steer" | "followUp" | "info";
98
+ }>;
99
+ }, z.core.$strip> & {
100
+ is: (value: unknown) => value is {
101
+ id: string;
102
+ from: string;
103
+ room: string;
104
+ content: string;
105
+ timestamp: string;
106
+ readBy: string[];
107
+ replyTo?: string | undefined;
108
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
109
+ };
110
+ };
111
+ }, z.core.$strip>, z.ZodObject<{
112
+ type: z.ZodLiteral<"dm_add">;
113
+ key: z.ZodString;
114
+ message: z.ZodObject<{
115
+ id: z.ZodString;
116
+ from: z.ZodString;
117
+ to: z.ZodString;
118
+ content: z.ZodString;
119
+ timestamp: z.ZodString;
120
+ readBy: z.ZodArray<z.ZodString>;
121
+ streamingBehavior: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"steer">, z.ZodLiteral<"followUp">, z.ZodLiteral<"info">]> & {
122
+ is: (value: unknown) => value is "steer" | "followUp" | "info";
123
+ }>;
124
+ }, z.core.$strip> & {
125
+ is: (value: unknown) => value is {
126
+ id: string;
127
+ from: string;
128
+ to: string;
129
+ content: string;
130
+ timestamp: string;
131
+ readBy: string[];
132
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
133
+ };
134
+ };
135
+ }, z.core.$strip>, z.ZodObject<{
136
+ type: z.ZodLiteral<"delivery">;
137
+ agentId: z.ZodString;
138
+ event: z.ZodDiscriminatedUnion<[z.ZodObject<{
139
+ type: z.ZodLiteral<"room_message">;
140
+ message: z.ZodObject<{
141
+ id: z.ZodString;
142
+ from: z.ZodString;
143
+ room: z.ZodString;
144
+ content: z.ZodString;
145
+ timestamp: z.ZodString;
146
+ replyTo: z.ZodOptional<z.ZodString>;
147
+ readBy: z.ZodArray<z.ZodString>;
148
+ streamingBehavior: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"steer">, z.ZodLiteral<"followUp">, z.ZodLiteral<"info">]> & {
149
+ is: (value: unknown) => value is "steer" | "followUp" | "info";
150
+ }>;
151
+ }, z.core.$strip> & {
152
+ is: (value: unknown) => value is {
153
+ id: string;
154
+ from: string;
155
+ room: string;
156
+ content: string;
157
+ timestamp: string;
158
+ readBy: string[];
159
+ replyTo?: string | undefined;
160
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
161
+ };
162
+ };
163
+ }, z.core.$strip>, z.ZodObject<{
164
+ type: z.ZodLiteral<"dm">;
165
+ message: z.ZodObject<{
166
+ id: z.ZodString;
167
+ from: z.ZodString;
168
+ to: z.ZodString;
169
+ content: z.ZodString;
170
+ timestamp: z.ZodString;
171
+ readBy: z.ZodArray<z.ZodString>;
172
+ streamingBehavior: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"steer">, z.ZodLiteral<"followUp">, z.ZodLiteral<"info">]> & {
173
+ is: (value: unknown) => value is "steer" | "followUp" | "info";
174
+ }>;
175
+ }, z.core.$strip> & {
176
+ is: (value: unknown) => value is {
177
+ id: string;
178
+ from: string;
179
+ to: string;
180
+ content: string;
181
+ timestamp: string;
182
+ readBy: string[];
183
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
184
+ };
185
+ };
186
+ }, z.core.$strip>, z.ZodObject<{
187
+ type: z.ZodLiteral<"room_invite">;
188
+ room: z.ZodString;
189
+ roomDescription: z.ZodString;
190
+ from: z.ZodString;
191
+ fromName: z.ZodString;
192
+ fromCwd: z.ZodString;
193
+ }, z.core.$strip>, z.ZodObject<{
194
+ type: z.ZodLiteral<"member_joined">;
195
+ room: z.ZodString;
196
+ agent: z.ZodString;
197
+ }, z.core.$strip>, z.ZodObject<{
198
+ type: z.ZodLiteral<"member_left">;
199
+ room: z.ZodString;
200
+ agent: z.ZodString;
201
+ }, z.core.$strip>, z.ZodObject<{
202
+ type: z.ZodLiteral<"room_members">;
203
+ room: z.ZodString;
204
+ members: z.ZodArray<z.ZodObject<{
205
+ id: z.ZodString;
206
+ name: z.ZodString;
207
+ status: z.ZodUnion<readonly [z.ZodLiteral<"active">, z.ZodLiteral<"idle">, z.ZodLiteral<"busy">, z.ZodLiteral<"offline">]> & {
208
+ is: (value: unknown) => value is "active" | "idle" | "busy" | "offline";
209
+ };
210
+ }, z.core.$strip> & {
211
+ is: (value: unknown) => value is {
212
+ id: string;
213
+ name: string;
214
+ status: "active" | "idle" | "busy" | "offline";
215
+ };
216
+ }>;
217
+ }, z.core.$strip>, z.ZodObject<{
218
+ type: z.ZodLiteral<"member_status">;
219
+ room: z.ZodString;
220
+ agent: z.ZodString;
221
+ status: z.ZodUnion<readonly [z.ZodLiteral<"active">, z.ZodLiteral<"idle">, z.ZodLiteral<"busy">, z.ZodLiteral<"offline">]> & {
222
+ is: (value: unknown) => value is "active" | "idle" | "busy" | "offline";
223
+ };
224
+ }, z.core.$strip>, z.ZodObject<{
225
+ type: z.ZodLiteral<"delivery_status">;
226
+ messageId: z.ZodString;
227
+ agent: z.ZodString;
228
+ status: z.ZodUnion<readonly [z.ZodLiteral<"delivered">, z.ZodLiteral<"read">]> & {
229
+ is: (value: unknown) => value is "delivered" | "read";
230
+ };
231
+ room: z.ZodOptional<z.ZodString>;
232
+ }, z.core.$strip>, z.ZodObject<{
233
+ type: z.ZodLiteral<"invite_declined">;
234
+ room: z.ZodString;
235
+ agent: z.ZodString;
236
+ agentName: z.ZodString;
237
+ reason: z.ZodString;
238
+ }, z.core.$strip>, z.ZodObject<{
239
+ type: z.ZodLiteral<"name_changed">;
240
+ agent: z.ZodString;
241
+ oldName: z.ZodString;
242
+ newName: z.ZodString;
243
+ }, z.core.$strip>, z.ZodObject<{
244
+ type: z.ZodLiteral<"connection_request">;
245
+ connectionId: z.ZodString;
246
+ peerId: z.ZodString;
247
+ dataPort: z.ZodNumber;
248
+ name: z.ZodString;
249
+ fingerprint: z.ZodString;
250
+ }, z.core.$strip>, z.ZodObject<{
251
+ type: z.ZodLiteral<"capability_request">;
252
+ requestId: z.ZodString;
253
+ capability: z.ZodString;
254
+ scopeKind: z.ZodString;
255
+ scopePath: z.ZodOptional<z.ZodString>;
256
+ requesterDevice: z.ZodString;
257
+ }, z.core.$strip>], "type"> & {
258
+ is: (value: unknown) => value is {
259
+ type: "room_message";
260
+ message: {
261
+ id: string;
262
+ from: string;
263
+ room: string;
264
+ content: string;
265
+ timestamp: string;
266
+ readBy: string[];
267
+ replyTo?: string | undefined;
268
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
269
+ };
270
+ } | {
271
+ type: "dm";
272
+ message: {
273
+ id: string;
274
+ from: string;
275
+ to: string;
276
+ content: string;
277
+ timestamp: string;
278
+ readBy: string[];
279
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
280
+ };
281
+ } | {
282
+ type: "room_invite";
283
+ room: string;
284
+ roomDescription: string;
285
+ from: string;
286
+ fromName: string;
287
+ fromCwd: string;
288
+ } | {
289
+ type: "member_joined";
290
+ room: string;
291
+ agent: string;
292
+ } | {
293
+ type: "member_left";
294
+ room: string;
295
+ agent: string;
296
+ } | {
297
+ type: "room_members";
298
+ room: string;
299
+ members: {
300
+ id: string;
301
+ name: string;
302
+ status: "active" | "idle" | "busy" | "offline";
303
+ }[];
304
+ } | {
305
+ type: "member_status";
306
+ room: string;
307
+ agent: string;
308
+ status: "active" | "idle" | "busy" | "offline";
309
+ } | {
310
+ type: "delivery_status";
311
+ messageId: string;
312
+ agent: string;
313
+ status: "delivered" | "read";
314
+ room?: string | undefined;
315
+ } | {
316
+ type: "invite_declined";
317
+ room: string;
318
+ agent: string;
319
+ agentName: string;
320
+ reason: string;
321
+ } | {
322
+ type: "name_changed";
323
+ agent: string;
324
+ oldName: string;
325
+ newName: string;
326
+ } | {
327
+ type: "connection_request";
328
+ connectionId: string;
329
+ peerId: string;
330
+ dataPort: number;
331
+ name: string;
332
+ fingerprint: string;
333
+ } | {
334
+ type: "capability_request";
335
+ requestId: string;
336
+ capability: string;
337
+ scopeKind: string;
338
+ requesterDevice: string;
339
+ scopePath?: string | undefined;
340
+ };
341
+ };
342
+ }, z.core.$strip>], "type">;
343
+ declare const SerialisedStateSchema: z.ZodObject<{
344
+ agents: z.ZodRecord<z.ZodString, z.ZodObject<{
345
+ id: z.ZodString;
346
+ version: z.ZodNumber;
347
+ name: z.ZodString;
348
+ harness: z.ZodString;
349
+ cwd: z.ZodString;
350
+ pid: z.ZodNumber;
351
+ startedAt: z.ZodString;
352
+ visibility: z.ZodUnion<readonly [z.ZodLiteral<"visible">, z.ZodLiteral<"hidden">, z.ZodLiteral<"ghost">]> & {
353
+ is: (value: unknown) => value is "visible" | "hidden" | "ghost";
354
+ };
355
+ status: z.ZodUnion<readonly [z.ZodLiteral<"active">, z.ZodLiteral<"idle">, z.ZodLiteral<"busy">, z.ZodLiteral<"offline">]> & {
356
+ is: (value: unknown) => value is "active" | "idle" | "busy" | "offline";
357
+ };
358
+ tags: z.ZodArray<z.ZodString>;
359
+ subscribedRooms: z.ZodArray<z.ZodString>;
360
+ }, z.core.$strip> & {
361
+ is: (value: unknown) => value is {
362
+ id: string;
363
+ version: number;
364
+ name: string;
365
+ harness: string;
366
+ cwd: string;
367
+ pid: number;
368
+ startedAt: string;
369
+ visibility: "visible" | "hidden" | "ghost";
370
+ status: "active" | "idle" | "busy" | "offline";
371
+ tags: string[];
372
+ subscribedRooms: string[];
373
+ };
374
+ }>;
375
+ rooms: z.ZodRecord<z.ZodString, z.ZodObject<{
376
+ id: z.ZodString;
377
+ version: z.ZodNumber;
378
+ name: z.ZodString;
379
+ type: z.ZodUnion<readonly [z.ZodLiteral<"public">, z.ZodLiteral<"private">, z.ZodLiteral<"secret">]> & {
380
+ is: (value: unknown) => value is "public" | "private" | "secret";
381
+ };
382
+ owner: z.ZodString;
383
+ createdAt: z.ZodString;
384
+ description: z.ZodString;
385
+ members: z.ZodArray<z.ZodString>;
386
+ invited: z.ZodArray<z.ZodString>;
387
+ memberJoins: z.ZodRecord<z.ZodString, z.ZodNumber>;
388
+ memberLeaves: z.ZodRecord<z.ZodString, z.ZodNumber>;
389
+ invitedJoins: z.ZodRecord<z.ZodString, z.ZodNumber>;
390
+ invitedLeaves: z.ZodRecord<z.ZodString, z.ZodNumber>;
391
+ }, z.core.$strip> & {
392
+ is: (value: unknown) => value is {
393
+ id: string;
394
+ version: number;
395
+ name: string;
396
+ type: "public" | "private" | "secret";
397
+ owner: string;
398
+ createdAt: string;
399
+ description: string;
400
+ members: string[];
401
+ invited: string[];
402
+ memberJoins: Record<string, number>;
403
+ memberLeaves: Record<string, number>;
404
+ invitedJoins: Record<string, number>;
405
+ invitedLeaves: Record<string, number>;
406
+ };
407
+ }>;
408
+ messages: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
409
+ id: z.ZodString;
410
+ from: z.ZodString;
411
+ room: z.ZodString;
412
+ content: z.ZodString;
413
+ timestamp: z.ZodString;
414
+ replyTo: z.ZodOptional<z.ZodString>;
415
+ readBy: z.ZodArray<z.ZodString>;
416
+ streamingBehavior: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"steer">, z.ZodLiteral<"followUp">, z.ZodLiteral<"info">]> & {
417
+ is: (value: unknown) => value is "steer" | "followUp" | "info";
418
+ }>;
419
+ }, z.core.$strip> & {
420
+ is: (value: unknown) => value is {
421
+ id: string;
422
+ from: string;
423
+ room: string;
424
+ content: string;
425
+ timestamp: string;
426
+ readBy: string[];
427
+ replyTo?: string | undefined;
428
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
429
+ };
430
+ }>>;
431
+ dms: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
432
+ id: z.ZodString;
433
+ from: z.ZodString;
434
+ to: z.ZodString;
435
+ content: z.ZodString;
436
+ timestamp: z.ZodString;
437
+ readBy: z.ZodArray<z.ZodString>;
438
+ streamingBehavior: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"steer">, z.ZodLiteral<"followUp">, z.ZodLiteral<"info">]> & {
439
+ is: (value: unknown) => value is "steer" | "followUp" | "info";
440
+ }>;
441
+ }, z.core.$strip> & {
442
+ is: (value: unknown) => value is {
443
+ id: string;
444
+ from: string;
445
+ to: string;
446
+ content: string;
447
+ timestamp: string;
448
+ readBy: string[];
449
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
450
+ };
451
+ }>>;
452
+ }, z.core.$strip>;
453
+ /**
454
+ * The one stream every tab subscribes to. Unifies state_sync (a full snapshot, sent once on connect or resume-without-lastEventId), state_update (an incremental patch), and the old chat socket's delivery frames -- today three separate wire concepts -- into a single ordered event stream a tab can resume by lastEventId.
455
+ */
456
+ declare const MeshEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
457
+ kind: z.ZodLiteral<"state_sync">;
458
+ state: z.ZodObject<{
459
+ agents: z.ZodRecord<z.ZodString, z.ZodObject<{
460
+ id: z.ZodString;
461
+ version: z.ZodNumber;
462
+ name: z.ZodString;
463
+ harness: z.ZodString;
464
+ cwd: z.ZodString;
465
+ pid: z.ZodNumber;
466
+ startedAt: z.ZodString;
467
+ visibility: z.ZodUnion<readonly [z.ZodLiteral<"visible">, z.ZodLiteral<"hidden">, z.ZodLiteral<"ghost">]> & {
468
+ is: (value: unknown) => value is "visible" | "hidden" | "ghost";
469
+ };
470
+ status: z.ZodUnion<readonly [z.ZodLiteral<"active">, z.ZodLiteral<"idle">, z.ZodLiteral<"busy">, z.ZodLiteral<"offline">]> & {
471
+ is: (value: unknown) => value is "active" | "idle" | "busy" | "offline";
472
+ };
473
+ tags: z.ZodArray<z.ZodString>;
474
+ subscribedRooms: z.ZodArray<z.ZodString>;
475
+ }, z.core.$strip> & {
476
+ is: (value: unknown) => value is {
477
+ id: string;
478
+ version: number;
479
+ name: string;
480
+ harness: string;
481
+ cwd: string;
482
+ pid: number;
483
+ startedAt: string;
484
+ visibility: "visible" | "hidden" | "ghost";
485
+ status: "active" | "idle" | "busy" | "offline";
486
+ tags: string[];
487
+ subscribedRooms: string[];
488
+ };
489
+ }>;
490
+ rooms: z.ZodRecord<z.ZodString, z.ZodObject<{
491
+ id: z.ZodString;
492
+ version: z.ZodNumber;
493
+ name: z.ZodString;
494
+ type: z.ZodUnion<readonly [z.ZodLiteral<"public">, z.ZodLiteral<"private">, z.ZodLiteral<"secret">]> & {
495
+ is: (value: unknown) => value is "public" | "private" | "secret";
496
+ };
497
+ owner: z.ZodString;
498
+ createdAt: z.ZodString;
499
+ description: z.ZodString;
500
+ members: z.ZodArray<z.ZodString>;
501
+ invited: z.ZodArray<z.ZodString>;
502
+ memberJoins: z.ZodRecord<z.ZodString, z.ZodNumber>;
503
+ memberLeaves: z.ZodRecord<z.ZodString, z.ZodNumber>;
504
+ invitedJoins: z.ZodRecord<z.ZodString, z.ZodNumber>;
505
+ invitedLeaves: z.ZodRecord<z.ZodString, z.ZodNumber>;
506
+ }, z.core.$strip> & {
507
+ is: (value: unknown) => value is {
508
+ id: string;
509
+ version: number;
510
+ name: string;
511
+ type: "public" | "private" | "secret";
512
+ owner: string;
513
+ createdAt: string;
514
+ description: string;
515
+ members: string[];
516
+ invited: string[];
517
+ memberJoins: Record<string, number>;
518
+ memberLeaves: Record<string, number>;
519
+ invitedJoins: Record<string, number>;
520
+ invitedLeaves: Record<string, number>;
521
+ };
522
+ }>;
523
+ messages: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
524
+ id: z.ZodString;
525
+ from: z.ZodString;
526
+ room: z.ZodString;
527
+ content: z.ZodString;
528
+ timestamp: z.ZodString;
529
+ replyTo: z.ZodOptional<z.ZodString>;
530
+ readBy: z.ZodArray<z.ZodString>;
531
+ streamingBehavior: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"steer">, z.ZodLiteral<"followUp">, z.ZodLiteral<"info">]> & {
532
+ is: (value: unknown) => value is "steer" | "followUp" | "info";
533
+ }>;
534
+ }, z.core.$strip> & {
535
+ is: (value: unknown) => value is {
536
+ id: string;
537
+ from: string;
538
+ room: string;
539
+ content: string;
540
+ timestamp: string;
541
+ readBy: string[];
542
+ replyTo?: string | undefined;
543
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
544
+ };
545
+ }>>;
546
+ dms: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
547
+ id: z.ZodString;
548
+ from: z.ZodString;
549
+ to: z.ZodString;
550
+ content: z.ZodString;
551
+ timestamp: z.ZodString;
552
+ readBy: z.ZodArray<z.ZodString>;
553
+ streamingBehavior: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"steer">, z.ZodLiteral<"followUp">, z.ZodLiteral<"info">]> & {
554
+ is: (value: unknown) => value is "steer" | "followUp" | "info";
555
+ }>;
556
+ }, z.core.$strip> & {
557
+ is: (value: unknown) => value is {
558
+ id: string;
559
+ from: string;
560
+ to: string;
561
+ content: string;
562
+ timestamp: string;
563
+ readBy: string[];
564
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
565
+ };
566
+ }>>;
567
+ }, z.core.$strip>;
568
+ }, z.core.$strip>, z.ZodObject<{
569
+ kind: z.ZodLiteral<"state_patch">;
570
+ patch: z.ZodDiscriminatedUnion<[z.ZodObject<{
571
+ type: z.ZodLiteral<"agent_upsert">;
572
+ agent: z.ZodObject<{
573
+ id: z.ZodString;
574
+ version: z.ZodNumber;
575
+ name: z.ZodString;
576
+ harness: z.ZodString;
577
+ cwd: z.ZodString;
578
+ pid: z.ZodNumber;
579
+ startedAt: z.ZodString;
580
+ visibility: z.ZodUnion<readonly [z.ZodLiteral<"visible">, z.ZodLiteral<"hidden">, z.ZodLiteral<"ghost">]> & {
581
+ is: (value: unknown) => value is "visible" | "hidden" | "ghost";
582
+ };
583
+ status: z.ZodUnion<readonly [z.ZodLiteral<"active">, z.ZodLiteral<"idle">, z.ZodLiteral<"busy">, z.ZodLiteral<"offline">]> & {
584
+ is: (value: unknown) => value is "active" | "idle" | "busy" | "offline";
585
+ };
586
+ tags: z.ZodArray<z.ZodString>;
587
+ subscribedRooms: z.ZodArray<z.ZodString>;
588
+ }, z.core.$strip> & {
589
+ is: (value: unknown) => value is {
590
+ id: string;
591
+ version: number;
592
+ name: string;
593
+ harness: string;
594
+ cwd: string;
595
+ pid: number;
596
+ startedAt: string;
597
+ visibility: "visible" | "hidden" | "ghost";
598
+ status: "active" | "idle" | "busy" | "offline";
599
+ tags: string[];
600
+ subscribedRooms: string[];
601
+ };
602
+ };
603
+ }, z.core.$strip>, z.ZodObject<{
604
+ type: z.ZodLiteral<"agent_offline">;
605
+ agentId: z.ZodString;
606
+ }, z.core.$strip>, z.ZodObject<{
607
+ type: z.ZodLiteral<"room_upsert">;
608
+ room: z.ZodObject<{
609
+ id: z.ZodString;
610
+ version: z.ZodNumber;
611
+ name: z.ZodString;
612
+ type: z.ZodUnion<readonly [z.ZodLiteral<"public">, z.ZodLiteral<"private">, z.ZodLiteral<"secret">]> & {
613
+ is: (value: unknown) => value is "public" | "private" | "secret";
614
+ };
615
+ owner: z.ZodString;
616
+ createdAt: z.ZodString;
617
+ description: z.ZodString;
618
+ members: z.ZodArray<z.ZodString>;
619
+ invited: z.ZodArray<z.ZodString>;
620
+ memberJoins: z.ZodRecord<z.ZodString, z.ZodNumber>;
621
+ memberLeaves: z.ZodRecord<z.ZodString, z.ZodNumber>;
622
+ invitedJoins: z.ZodRecord<z.ZodString, z.ZodNumber>;
623
+ invitedLeaves: z.ZodRecord<z.ZodString, z.ZodNumber>;
624
+ }, z.core.$strip> & {
625
+ is: (value: unknown) => value is {
626
+ id: string;
627
+ version: number;
628
+ name: string;
629
+ type: "public" | "private" | "secret";
630
+ owner: string;
631
+ createdAt: string;
632
+ description: string;
633
+ members: string[];
634
+ invited: string[];
635
+ memberJoins: Record<string, number>;
636
+ memberLeaves: Record<string, number>;
637
+ invitedJoins: Record<string, number>;
638
+ invitedLeaves: Record<string, number>;
639
+ };
640
+ };
641
+ }, z.core.$strip>, z.ZodObject<{
642
+ type: z.ZodLiteral<"room_delete">;
643
+ roomId: z.ZodString;
644
+ }, z.core.$strip>, z.ZodObject<{
645
+ type: z.ZodLiteral<"message_add">;
646
+ roomId: z.ZodString;
647
+ message: z.ZodObject<{
648
+ id: z.ZodString;
649
+ from: z.ZodString;
650
+ room: z.ZodString;
651
+ content: z.ZodString;
652
+ timestamp: z.ZodString;
653
+ replyTo: z.ZodOptional<z.ZodString>;
654
+ readBy: z.ZodArray<z.ZodString>;
655
+ streamingBehavior: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"steer">, z.ZodLiteral<"followUp">, z.ZodLiteral<"info">]> & {
656
+ is: (value: unknown) => value is "steer" | "followUp" | "info";
657
+ }>;
658
+ }, z.core.$strip> & {
659
+ is: (value: unknown) => value is {
660
+ id: string;
661
+ from: string;
662
+ room: string;
663
+ content: string;
664
+ timestamp: string;
665
+ readBy: string[];
666
+ replyTo?: string | undefined;
667
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
668
+ };
669
+ };
670
+ }, z.core.$strip>, z.ZodObject<{
671
+ type: z.ZodLiteral<"dm_add">;
672
+ key: z.ZodString;
673
+ message: z.ZodObject<{
674
+ id: z.ZodString;
675
+ from: z.ZodString;
676
+ to: z.ZodString;
677
+ content: z.ZodString;
678
+ timestamp: z.ZodString;
679
+ readBy: z.ZodArray<z.ZodString>;
680
+ streamingBehavior: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"steer">, z.ZodLiteral<"followUp">, z.ZodLiteral<"info">]> & {
681
+ is: (value: unknown) => value is "steer" | "followUp" | "info";
682
+ }>;
683
+ }, z.core.$strip> & {
684
+ is: (value: unknown) => value is {
685
+ id: string;
686
+ from: string;
687
+ to: string;
688
+ content: string;
689
+ timestamp: string;
690
+ readBy: string[];
691
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
692
+ };
693
+ };
694
+ }, z.core.$strip>, z.ZodObject<{
695
+ type: z.ZodLiteral<"delivery">;
696
+ agentId: z.ZodString;
697
+ event: z.ZodDiscriminatedUnion<[z.ZodObject<{
698
+ type: z.ZodLiteral<"room_message">;
699
+ message: z.ZodObject<{
700
+ id: z.ZodString;
701
+ from: z.ZodString;
702
+ room: z.ZodString;
703
+ content: z.ZodString;
704
+ timestamp: z.ZodString;
705
+ replyTo: z.ZodOptional<z.ZodString>;
706
+ readBy: z.ZodArray<z.ZodString>;
707
+ streamingBehavior: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"steer">, z.ZodLiteral<"followUp">, z.ZodLiteral<"info">]> & {
708
+ is: (value: unknown) => value is "steer" | "followUp" | "info";
709
+ }>;
710
+ }, z.core.$strip> & {
711
+ is: (value: unknown) => value is {
712
+ id: string;
713
+ from: string;
714
+ room: string;
715
+ content: string;
716
+ timestamp: string;
717
+ readBy: string[];
718
+ replyTo?: string | undefined;
719
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
720
+ };
721
+ };
722
+ }, z.core.$strip>, z.ZodObject<{
723
+ type: z.ZodLiteral<"dm">;
724
+ message: z.ZodObject<{
725
+ id: z.ZodString;
726
+ from: z.ZodString;
727
+ to: z.ZodString;
728
+ content: z.ZodString;
729
+ timestamp: z.ZodString;
730
+ readBy: z.ZodArray<z.ZodString>;
731
+ streamingBehavior: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"steer">, z.ZodLiteral<"followUp">, z.ZodLiteral<"info">]> & {
732
+ is: (value: unknown) => value is "steer" | "followUp" | "info";
733
+ }>;
734
+ }, z.core.$strip> & {
735
+ is: (value: unknown) => value is {
736
+ id: string;
737
+ from: string;
738
+ to: string;
739
+ content: string;
740
+ timestamp: string;
741
+ readBy: string[];
742
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
743
+ };
744
+ };
745
+ }, z.core.$strip>, z.ZodObject<{
746
+ type: z.ZodLiteral<"room_invite">;
747
+ room: z.ZodString;
748
+ roomDescription: z.ZodString;
749
+ from: z.ZodString;
750
+ fromName: z.ZodString;
751
+ fromCwd: z.ZodString;
752
+ }, z.core.$strip>, z.ZodObject<{
753
+ type: z.ZodLiteral<"member_joined">;
754
+ room: z.ZodString;
755
+ agent: z.ZodString;
756
+ }, z.core.$strip>, z.ZodObject<{
757
+ type: z.ZodLiteral<"member_left">;
758
+ room: z.ZodString;
759
+ agent: z.ZodString;
760
+ }, z.core.$strip>, z.ZodObject<{
761
+ type: z.ZodLiteral<"room_members">;
762
+ room: z.ZodString;
763
+ members: z.ZodArray<z.ZodObject<{
764
+ id: z.ZodString;
765
+ name: z.ZodString;
766
+ status: z.ZodUnion<readonly [z.ZodLiteral<"active">, z.ZodLiteral<"idle">, z.ZodLiteral<"busy">, z.ZodLiteral<"offline">]> & {
767
+ is: (value: unknown) => value is "active" | "idle" | "busy" | "offline";
768
+ };
769
+ }, z.core.$strip> & {
770
+ is: (value: unknown) => value is {
771
+ id: string;
772
+ name: string;
773
+ status: "active" | "idle" | "busy" | "offline";
774
+ };
775
+ }>;
776
+ }, z.core.$strip>, z.ZodObject<{
777
+ type: z.ZodLiteral<"member_status">;
778
+ room: z.ZodString;
779
+ agent: z.ZodString;
780
+ status: z.ZodUnion<readonly [z.ZodLiteral<"active">, z.ZodLiteral<"idle">, z.ZodLiteral<"busy">, z.ZodLiteral<"offline">]> & {
781
+ is: (value: unknown) => value is "active" | "idle" | "busy" | "offline";
782
+ };
783
+ }, z.core.$strip>, z.ZodObject<{
784
+ type: z.ZodLiteral<"delivery_status">;
785
+ messageId: z.ZodString;
786
+ agent: z.ZodString;
787
+ status: z.ZodUnion<readonly [z.ZodLiteral<"delivered">, z.ZodLiteral<"read">]> & {
788
+ is: (value: unknown) => value is "delivered" | "read";
789
+ };
790
+ room: z.ZodOptional<z.ZodString>;
791
+ }, z.core.$strip>, z.ZodObject<{
792
+ type: z.ZodLiteral<"invite_declined">;
793
+ room: z.ZodString;
794
+ agent: z.ZodString;
795
+ agentName: z.ZodString;
796
+ reason: z.ZodString;
797
+ }, z.core.$strip>, z.ZodObject<{
798
+ type: z.ZodLiteral<"name_changed">;
799
+ agent: z.ZodString;
800
+ oldName: z.ZodString;
801
+ newName: z.ZodString;
802
+ }, z.core.$strip>, z.ZodObject<{
803
+ type: z.ZodLiteral<"connection_request">;
804
+ connectionId: z.ZodString;
805
+ peerId: z.ZodString;
806
+ dataPort: z.ZodNumber;
807
+ name: z.ZodString;
808
+ fingerprint: z.ZodString;
809
+ }, z.core.$strip>, z.ZodObject<{
810
+ type: z.ZodLiteral<"capability_request">;
811
+ requestId: z.ZodString;
812
+ capability: z.ZodString;
813
+ scopeKind: z.ZodString;
814
+ scopePath: z.ZodOptional<z.ZodString>;
815
+ requesterDevice: z.ZodString;
816
+ }, z.core.$strip>], "type"> & {
817
+ is: (value: unknown) => value is {
818
+ type: "room_message";
819
+ message: {
820
+ id: string;
821
+ from: string;
822
+ room: string;
823
+ content: string;
824
+ timestamp: string;
825
+ readBy: string[];
826
+ replyTo?: string | undefined;
827
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
828
+ };
829
+ } | {
830
+ type: "dm";
831
+ message: {
832
+ id: string;
833
+ from: string;
834
+ to: string;
835
+ content: string;
836
+ timestamp: string;
837
+ readBy: string[];
838
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
839
+ };
840
+ } | {
841
+ type: "room_invite";
842
+ room: string;
843
+ roomDescription: string;
844
+ from: string;
845
+ fromName: string;
846
+ fromCwd: string;
847
+ } | {
848
+ type: "member_joined";
849
+ room: string;
850
+ agent: string;
851
+ } | {
852
+ type: "member_left";
853
+ room: string;
854
+ agent: string;
855
+ } | {
856
+ type: "room_members";
857
+ room: string;
858
+ members: {
859
+ id: string;
860
+ name: string;
861
+ status: "active" | "idle" | "busy" | "offline";
862
+ }[];
863
+ } | {
864
+ type: "member_status";
865
+ room: string;
866
+ agent: string;
867
+ status: "active" | "idle" | "busy" | "offline";
868
+ } | {
869
+ type: "delivery_status";
870
+ messageId: string;
871
+ agent: string;
872
+ status: "delivered" | "read";
873
+ room?: string | undefined;
874
+ } | {
875
+ type: "invite_declined";
876
+ room: string;
877
+ agent: string;
878
+ agentName: string;
879
+ reason: string;
880
+ } | {
881
+ type: "name_changed";
882
+ agent: string;
883
+ oldName: string;
884
+ newName: string;
885
+ } | {
886
+ type: "connection_request";
887
+ connectionId: string;
888
+ peerId: string;
889
+ dataPort: number;
890
+ name: string;
891
+ fingerprint: string;
892
+ } | {
893
+ type: "capability_request";
894
+ requestId: string;
895
+ capability: string;
896
+ scopeKind: string;
897
+ requesterDevice: string;
898
+ scopePath?: string | undefined;
899
+ };
900
+ };
901
+ }, z.core.$strip>], "type">;
902
+ }, z.core.$strip>, z.ZodObject<{
903
+ kind: z.ZodLiteral<"delivery">;
904
+ event: z.ZodDiscriminatedUnion<[z.ZodObject<{
905
+ type: z.ZodLiteral<"room_message">;
906
+ message: z.ZodObject<{
907
+ id: z.ZodString;
908
+ from: z.ZodString;
909
+ room: z.ZodString;
910
+ content: z.ZodString;
911
+ timestamp: z.ZodString;
912
+ replyTo: z.ZodOptional<z.ZodString>;
913
+ readBy: z.ZodArray<z.ZodString>;
914
+ streamingBehavior: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"steer">, z.ZodLiteral<"followUp">, z.ZodLiteral<"info">]> & {
915
+ is: (value: unknown) => value is "steer" | "followUp" | "info";
916
+ }>;
917
+ }, z.core.$strip> & {
918
+ is: (value: unknown) => value is {
919
+ id: string;
920
+ from: string;
921
+ room: string;
922
+ content: string;
923
+ timestamp: string;
924
+ readBy: string[];
925
+ replyTo?: string | undefined;
926
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
927
+ };
928
+ };
929
+ }, z.core.$strip>, z.ZodObject<{
930
+ type: z.ZodLiteral<"dm">;
931
+ message: z.ZodObject<{
932
+ id: z.ZodString;
933
+ from: z.ZodString;
934
+ to: z.ZodString;
935
+ content: z.ZodString;
936
+ timestamp: z.ZodString;
937
+ readBy: z.ZodArray<z.ZodString>;
938
+ streamingBehavior: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"steer">, z.ZodLiteral<"followUp">, z.ZodLiteral<"info">]> & {
939
+ is: (value: unknown) => value is "steer" | "followUp" | "info";
940
+ }>;
941
+ }, z.core.$strip> & {
942
+ is: (value: unknown) => value is {
943
+ id: string;
944
+ from: string;
945
+ to: string;
946
+ content: string;
947
+ timestamp: string;
948
+ readBy: string[];
949
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
950
+ };
951
+ };
952
+ }, z.core.$strip>, z.ZodObject<{
953
+ type: z.ZodLiteral<"room_invite">;
954
+ room: z.ZodString;
955
+ roomDescription: z.ZodString;
956
+ from: z.ZodString;
957
+ fromName: z.ZodString;
958
+ fromCwd: z.ZodString;
959
+ }, z.core.$strip>, z.ZodObject<{
960
+ type: z.ZodLiteral<"member_joined">;
961
+ room: z.ZodString;
962
+ agent: z.ZodString;
963
+ }, z.core.$strip>, z.ZodObject<{
964
+ type: z.ZodLiteral<"member_left">;
965
+ room: z.ZodString;
966
+ agent: z.ZodString;
967
+ }, z.core.$strip>, z.ZodObject<{
968
+ type: z.ZodLiteral<"room_members">;
969
+ room: z.ZodString;
970
+ members: z.ZodArray<z.ZodObject<{
971
+ id: z.ZodString;
972
+ name: z.ZodString;
973
+ status: z.ZodUnion<readonly [z.ZodLiteral<"active">, z.ZodLiteral<"idle">, z.ZodLiteral<"busy">, z.ZodLiteral<"offline">]> & {
974
+ is: (value: unknown) => value is "active" | "idle" | "busy" | "offline";
975
+ };
976
+ }, z.core.$strip> & {
977
+ is: (value: unknown) => value is {
978
+ id: string;
979
+ name: string;
980
+ status: "active" | "idle" | "busy" | "offline";
981
+ };
982
+ }>;
983
+ }, z.core.$strip>, z.ZodObject<{
984
+ type: z.ZodLiteral<"member_status">;
985
+ room: z.ZodString;
986
+ agent: z.ZodString;
987
+ status: z.ZodUnion<readonly [z.ZodLiteral<"active">, z.ZodLiteral<"idle">, z.ZodLiteral<"busy">, z.ZodLiteral<"offline">]> & {
988
+ is: (value: unknown) => value is "active" | "idle" | "busy" | "offline";
989
+ };
990
+ }, z.core.$strip>, z.ZodObject<{
991
+ type: z.ZodLiteral<"delivery_status">;
992
+ messageId: z.ZodString;
993
+ agent: z.ZodString;
994
+ status: z.ZodUnion<readonly [z.ZodLiteral<"delivered">, z.ZodLiteral<"read">]> & {
995
+ is: (value: unknown) => value is "delivered" | "read";
996
+ };
997
+ room: z.ZodOptional<z.ZodString>;
998
+ }, z.core.$strip>, z.ZodObject<{
999
+ type: z.ZodLiteral<"invite_declined">;
1000
+ room: z.ZodString;
1001
+ agent: z.ZodString;
1002
+ agentName: z.ZodString;
1003
+ reason: z.ZodString;
1004
+ }, z.core.$strip>, z.ZodObject<{
1005
+ type: z.ZodLiteral<"name_changed">;
1006
+ agent: z.ZodString;
1007
+ oldName: z.ZodString;
1008
+ newName: z.ZodString;
1009
+ }, z.core.$strip>, z.ZodObject<{
1010
+ type: z.ZodLiteral<"connection_request">;
1011
+ connectionId: z.ZodString;
1012
+ peerId: z.ZodString;
1013
+ dataPort: z.ZodNumber;
1014
+ name: z.ZodString;
1015
+ fingerprint: z.ZodString;
1016
+ }, z.core.$strip>, z.ZodObject<{
1017
+ type: z.ZodLiteral<"capability_request">;
1018
+ requestId: z.ZodString;
1019
+ capability: z.ZodString;
1020
+ scopeKind: z.ZodString;
1021
+ scopePath: z.ZodOptional<z.ZodString>;
1022
+ requesterDevice: z.ZodString;
1023
+ }, z.core.$strip>], "type"> & {
1024
+ is: (value: unknown) => value is {
1025
+ type: "room_message";
1026
+ message: {
1027
+ id: string;
1028
+ from: string;
1029
+ room: string;
1030
+ content: string;
1031
+ timestamp: string;
1032
+ readBy: string[];
1033
+ replyTo?: string | undefined;
1034
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
1035
+ };
1036
+ } | {
1037
+ type: "dm";
1038
+ message: {
1039
+ id: string;
1040
+ from: string;
1041
+ to: string;
1042
+ content: string;
1043
+ timestamp: string;
1044
+ readBy: string[];
1045
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
1046
+ };
1047
+ } | {
1048
+ type: "room_invite";
1049
+ room: string;
1050
+ roomDescription: string;
1051
+ from: string;
1052
+ fromName: string;
1053
+ fromCwd: string;
1054
+ } | {
1055
+ type: "member_joined";
1056
+ room: string;
1057
+ agent: string;
1058
+ } | {
1059
+ type: "member_left";
1060
+ room: string;
1061
+ agent: string;
1062
+ } | {
1063
+ type: "room_members";
1064
+ room: string;
1065
+ members: {
1066
+ id: string;
1067
+ name: string;
1068
+ status: "active" | "idle" | "busy" | "offline";
1069
+ }[];
1070
+ } | {
1071
+ type: "member_status";
1072
+ room: string;
1073
+ agent: string;
1074
+ status: "active" | "idle" | "busy" | "offline";
1075
+ } | {
1076
+ type: "delivery_status";
1077
+ messageId: string;
1078
+ agent: string;
1079
+ status: "delivered" | "read";
1080
+ room?: string | undefined;
1081
+ } | {
1082
+ type: "invite_declined";
1083
+ room: string;
1084
+ agent: string;
1085
+ agentName: string;
1086
+ reason: string;
1087
+ } | {
1088
+ type: "name_changed";
1089
+ agent: string;
1090
+ oldName: string;
1091
+ newName: string;
1092
+ } | {
1093
+ type: "connection_request";
1094
+ connectionId: string;
1095
+ peerId: string;
1096
+ dataPort: number;
1097
+ name: string;
1098
+ fingerprint: string;
1099
+ } | {
1100
+ type: "capability_request";
1101
+ requestId: string;
1102
+ capability: string;
1103
+ scopeKind: string;
1104
+ requesterDevice: string;
1105
+ scopePath?: string | undefined;
1106
+ };
1107
+ };
1108
+ }, z.core.$strip>], "kind">;
1109
+ export declare const meshContract: {
1110
+ send: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<z.ZodObject<{
1111
+ target: z.ZodString;
1112
+ content: z.ZodString;
1113
+ }, z.core.$strip>, z.ZodObject<{
1114
+ content: z.ZodString;
1115
+ isError: z.ZodBoolean;
1116
+ }, z.core.$strip>, object>;
1117
+ dm: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<z.ZodObject<{
1118
+ target: z.ZodString;
1119
+ content: z.ZodString;
1120
+ }, z.core.$strip>, z.ZodObject<{
1121
+ content: z.ZodString;
1122
+ isError: z.ZodBoolean;
1123
+ }, z.core.$strip>, object>;
1124
+ joinRoom: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<z.ZodObject<{
1125
+ room: z.ZodString;
1126
+ }, z.core.$strip>, z.ZodObject<{
1127
+ content: z.ZodString;
1128
+ isError: z.ZodBoolean;
1129
+ }, z.core.$strip>, object>;
1130
+ leaveRoom: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<z.ZodObject<{
1131
+ room: z.ZodOptional<z.ZodString>;
1132
+ }, z.core.$strip>, z.ZodObject<{
1133
+ content: z.ZodString;
1134
+ isError: z.ZodBoolean;
1135
+ }, z.core.$strip>, object>;
1136
+ createRoom: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<z.ZodObject<{
1137
+ name: z.ZodString;
1138
+ type: z.ZodUnion<readonly [z.ZodLiteral<"public">, z.ZodLiteral<"private">, z.ZodLiteral<"secret">]>;
1139
+ description: z.ZodOptional<z.ZodString>;
1140
+ }, z.core.$strip>, z.ZodObject<{
1141
+ content: z.ZodString;
1142
+ isError: z.ZodBoolean;
1143
+ }, z.core.$strip>, object>;
1144
+ listRooms: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
1145
+ content: z.ZodString;
1146
+ isError: z.ZodBoolean;
1147
+ }, z.core.$strip>, object>;
1148
+ listAgents: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
1149
+ content: z.ZodString;
1150
+ isError: z.ZodBoolean;
1151
+ }, z.core.$strip>, object>;
1152
+ readRoom: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<z.ZodObject<{
1153
+ room: z.ZodOptional<z.ZodString>;
1154
+ }, z.core.$strip>, z.ZodObject<{
1155
+ content: z.ZodString;
1156
+ isError: z.ZodBoolean;
1157
+ }, z.core.$strip>, object>;
1158
+ destroyRoom: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<z.ZodObject<{
1159
+ room: z.ZodString;
1160
+ }, z.core.$strip>, z.ZodObject<{
1161
+ content: z.ZodString;
1162
+ isError: z.ZodBoolean;
1163
+ }, z.core.$strip>, object>;
1164
+ invite: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<z.ZodObject<{
1165
+ room: z.ZodString;
1166
+ agent: z.ZodString;
1167
+ }, z.core.$strip>, z.ZodObject<{
1168
+ content: z.ZodString;
1169
+ isError: z.ZodBoolean;
1170
+ }, z.core.$strip>, object>;
1171
+ declineInvite: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<z.ZodObject<{
1172
+ room: z.ZodString;
1173
+ reason: z.ZodString;
1174
+ }, z.core.$strip>, z.ZodObject<{
1175
+ content: z.ZodString;
1176
+ isError: z.ZodBoolean;
1177
+ }, z.core.$strip>, object>;
1178
+ kick: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<z.ZodObject<{
1179
+ room: z.ZodString;
1180
+ agent: z.ZodString;
1181
+ }, z.core.$strip>, z.ZodObject<{
1182
+ content: z.ZodString;
1183
+ isError: z.ZodBoolean;
1184
+ }, z.core.$strip>, object>;
1185
+ renameAgent: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<z.ZodObject<{
1186
+ agent: z.ZodString;
1187
+ name: z.ZodString;
1188
+ }, z.core.$strip>, z.ZodObject<{
1189
+ content: z.ZodString;
1190
+ isError: z.ZodBoolean;
1191
+ }, z.core.$strip>, object>;
1192
+ pushSubscribe: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<z.ZodObject<{
1193
+ subscription: z.ZodObject<{
1194
+ endpoint: z.ZodString;
1195
+ keys: z.ZodObject<{
1196
+ p256dh: z.ZodString;
1197
+ auth: z.ZodString;
1198
+ }, z.core.$strip>;
1199
+ }, z.core.$strip>;
1200
+ agentId: z.ZodOptional<z.ZodString>;
1201
+ }, z.core.$strip>, z.ZodObject<{
1202
+ content: z.ZodString;
1203
+ isError: z.ZodBoolean;
1204
+ }, z.core.$strip>, object>;
1205
+ pushUnsubscribe: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<z.ZodObject<{
1206
+ agentId: z.ZodOptional<z.ZodString>;
1207
+ }, z.core.$strip>, z.ZodObject<{
1208
+ content: z.ZodString;
1209
+ isError: z.ZodBoolean;
1210
+ }, z.core.$strip>, object>;
1211
+ subscribeEvents: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<z.ZodObject<{
1212
+ lastEventId: z.ZodOptional<z.ZodString>;
1213
+ }, z.core.$strip>, import("@orpc/contract").Schema<AsyncIteratorObject<{
1214
+ kind: "state_sync";
1215
+ state: {
1216
+ agents: Record<string, {
1217
+ id: string;
1218
+ version: number;
1219
+ name: string;
1220
+ harness: string;
1221
+ cwd: string;
1222
+ pid: number;
1223
+ startedAt: string;
1224
+ visibility: "visible" | "hidden" | "ghost";
1225
+ status: "active" | "idle" | "busy" | "offline";
1226
+ tags: string[];
1227
+ subscribedRooms: string[];
1228
+ }>;
1229
+ rooms: Record<string, {
1230
+ id: string;
1231
+ version: number;
1232
+ name: string;
1233
+ type: "public" | "private" | "secret";
1234
+ owner: string;
1235
+ createdAt: string;
1236
+ description: string;
1237
+ members: string[];
1238
+ invited: string[];
1239
+ memberJoins: Record<string, number>;
1240
+ memberLeaves: Record<string, number>;
1241
+ invitedJoins: Record<string, number>;
1242
+ invitedLeaves: Record<string, number>;
1243
+ }>;
1244
+ messages: Record<string, {
1245
+ id: string;
1246
+ from: string;
1247
+ room: string;
1248
+ content: string;
1249
+ timestamp: string;
1250
+ readBy: string[];
1251
+ replyTo?: string | undefined;
1252
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
1253
+ }[]>;
1254
+ dms: Record<string, {
1255
+ id: string;
1256
+ from: string;
1257
+ to: string;
1258
+ content: string;
1259
+ timestamp: string;
1260
+ readBy: string[];
1261
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
1262
+ }[]>;
1263
+ };
1264
+ } | {
1265
+ kind: "state_patch";
1266
+ patch: {
1267
+ type: "agent_upsert";
1268
+ agent: {
1269
+ id: string;
1270
+ version: number;
1271
+ name: string;
1272
+ harness: string;
1273
+ cwd: string;
1274
+ pid: number;
1275
+ startedAt: string;
1276
+ visibility: "visible" | "hidden" | "ghost";
1277
+ status: "active" | "idle" | "busy" | "offline";
1278
+ tags: string[];
1279
+ subscribedRooms: string[];
1280
+ };
1281
+ } | {
1282
+ type: "agent_offline";
1283
+ agentId: string;
1284
+ } | {
1285
+ type: "room_upsert";
1286
+ room: {
1287
+ id: string;
1288
+ version: number;
1289
+ name: string;
1290
+ type: "public" | "private" | "secret";
1291
+ owner: string;
1292
+ createdAt: string;
1293
+ description: string;
1294
+ members: string[];
1295
+ invited: string[];
1296
+ memberJoins: Record<string, number>;
1297
+ memberLeaves: Record<string, number>;
1298
+ invitedJoins: Record<string, number>;
1299
+ invitedLeaves: Record<string, number>;
1300
+ };
1301
+ } | {
1302
+ type: "room_delete";
1303
+ roomId: string;
1304
+ } | {
1305
+ type: "message_add";
1306
+ roomId: string;
1307
+ message: {
1308
+ id: string;
1309
+ from: string;
1310
+ room: string;
1311
+ content: string;
1312
+ timestamp: string;
1313
+ readBy: string[];
1314
+ replyTo?: string | undefined;
1315
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
1316
+ };
1317
+ } | {
1318
+ type: "dm_add";
1319
+ key: string;
1320
+ message: {
1321
+ id: string;
1322
+ from: string;
1323
+ to: string;
1324
+ content: string;
1325
+ timestamp: string;
1326
+ readBy: string[];
1327
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
1328
+ };
1329
+ } | {
1330
+ type: "delivery";
1331
+ agentId: string;
1332
+ event: {
1333
+ type: "room_message";
1334
+ message: {
1335
+ id: string;
1336
+ from: string;
1337
+ room: string;
1338
+ content: string;
1339
+ timestamp: string;
1340
+ readBy: string[];
1341
+ replyTo?: string | undefined;
1342
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
1343
+ };
1344
+ } | {
1345
+ type: "dm";
1346
+ message: {
1347
+ id: string;
1348
+ from: string;
1349
+ to: string;
1350
+ content: string;
1351
+ timestamp: string;
1352
+ readBy: string[];
1353
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
1354
+ };
1355
+ } | {
1356
+ type: "room_invite";
1357
+ room: string;
1358
+ roomDescription: string;
1359
+ from: string;
1360
+ fromName: string;
1361
+ fromCwd: string;
1362
+ } | {
1363
+ type: "member_joined";
1364
+ room: string;
1365
+ agent: string;
1366
+ } | {
1367
+ type: "member_left";
1368
+ room: string;
1369
+ agent: string;
1370
+ } | {
1371
+ type: "room_members";
1372
+ room: string;
1373
+ members: {
1374
+ id: string;
1375
+ name: string;
1376
+ status: "active" | "idle" | "busy" | "offline";
1377
+ }[];
1378
+ } | {
1379
+ type: "member_status";
1380
+ room: string;
1381
+ agent: string;
1382
+ status: "active" | "idle" | "busy" | "offline";
1383
+ } | {
1384
+ type: "delivery_status";
1385
+ messageId: string;
1386
+ agent: string;
1387
+ status: "delivered" | "read";
1388
+ room?: string | undefined;
1389
+ } | {
1390
+ type: "invite_declined";
1391
+ room: string;
1392
+ agent: string;
1393
+ agentName: string;
1394
+ reason: string;
1395
+ } | {
1396
+ type: "name_changed";
1397
+ agent: string;
1398
+ oldName: string;
1399
+ newName: string;
1400
+ } | {
1401
+ type: "connection_request";
1402
+ connectionId: string;
1403
+ peerId: string;
1404
+ dataPort: number;
1405
+ name: string;
1406
+ fingerprint: string;
1407
+ } | {
1408
+ type: "capability_request";
1409
+ requestId: string;
1410
+ capability: string;
1411
+ scopeKind: string;
1412
+ requesterDevice: string;
1413
+ scopePath?: string | undefined;
1414
+ };
1415
+ };
1416
+ } | {
1417
+ kind: "delivery";
1418
+ event: {
1419
+ type: "room_message";
1420
+ message: {
1421
+ id: string;
1422
+ from: string;
1423
+ room: string;
1424
+ content: string;
1425
+ timestamp: string;
1426
+ readBy: string[];
1427
+ replyTo?: string | undefined;
1428
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
1429
+ };
1430
+ } | {
1431
+ type: "dm";
1432
+ message: {
1433
+ id: string;
1434
+ from: string;
1435
+ to: string;
1436
+ content: string;
1437
+ timestamp: string;
1438
+ readBy: string[];
1439
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
1440
+ };
1441
+ } | {
1442
+ type: "room_invite";
1443
+ room: string;
1444
+ roomDescription: string;
1445
+ from: string;
1446
+ fromName: string;
1447
+ fromCwd: string;
1448
+ } | {
1449
+ type: "member_joined";
1450
+ room: string;
1451
+ agent: string;
1452
+ } | {
1453
+ type: "member_left";
1454
+ room: string;
1455
+ agent: string;
1456
+ } | {
1457
+ type: "room_members";
1458
+ room: string;
1459
+ members: {
1460
+ id: string;
1461
+ name: string;
1462
+ status: "active" | "idle" | "busy" | "offline";
1463
+ }[];
1464
+ } | {
1465
+ type: "member_status";
1466
+ room: string;
1467
+ agent: string;
1468
+ status: "active" | "idle" | "busy" | "offline";
1469
+ } | {
1470
+ type: "delivery_status";
1471
+ messageId: string;
1472
+ agent: string;
1473
+ status: "delivered" | "read";
1474
+ room?: string | undefined;
1475
+ } | {
1476
+ type: "invite_declined";
1477
+ room: string;
1478
+ agent: string;
1479
+ agentName: string;
1480
+ reason: string;
1481
+ } | {
1482
+ type: "name_changed";
1483
+ agent: string;
1484
+ oldName: string;
1485
+ newName: string;
1486
+ } | {
1487
+ type: "connection_request";
1488
+ connectionId: string;
1489
+ peerId: string;
1490
+ dataPort: number;
1491
+ name: string;
1492
+ fingerprint: string;
1493
+ } | {
1494
+ type: "capability_request";
1495
+ requestId: string;
1496
+ capability: string;
1497
+ scopeKind: string;
1498
+ requesterDevice: string;
1499
+ scopePath?: string | undefined;
1500
+ };
1501
+ }, unknown, void>, import("@orpc/client").AsyncIteratorClass<{
1502
+ kind: "state_sync";
1503
+ state: {
1504
+ agents: Record<string, {
1505
+ id: string;
1506
+ version: number;
1507
+ name: string;
1508
+ harness: string;
1509
+ cwd: string;
1510
+ pid: number;
1511
+ startedAt: string;
1512
+ visibility: "visible" | "hidden" | "ghost";
1513
+ status: "active" | "idle" | "busy" | "offline";
1514
+ tags: string[];
1515
+ subscribedRooms: string[];
1516
+ }>;
1517
+ rooms: Record<string, {
1518
+ id: string;
1519
+ version: number;
1520
+ name: string;
1521
+ type: "public" | "private" | "secret";
1522
+ owner: string;
1523
+ createdAt: string;
1524
+ description: string;
1525
+ members: string[];
1526
+ invited: string[];
1527
+ memberJoins: Record<string, number>;
1528
+ memberLeaves: Record<string, number>;
1529
+ invitedJoins: Record<string, number>;
1530
+ invitedLeaves: Record<string, number>;
1531
+ }>;
1532
+ messages: Record<string, {
1533
+ id: string;
1534
+ from: string;
1535
+ room: string;
1536
+ content: string;
1537
+ timestamp: string;
1538
+ readBy: string[];
1539
+ replyTo?: string | undefined;
1540
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
1541
+ }[]>;
1542
+ dms: Record<string, {
1543
+ id: string;
1544
+ from: string;
1545
+ to: string;
1546
+ content: string;
1547
+ timestamp: string;
1548
+ readBy: string[];
1549
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
1550
+ }[]>;
1551
+ };
1552
+ } | {
1553
+ kind: "state_patch";
1554
+ patch: {
1555
+ type: "agent_upsert";
1556
+ agent: {
1557
+ id: string;
1558
+ version: number;
1559
+ name: string;
1560
+ harness: string;
1561
+ cwd: string;
1562
+ pid: number;
1563
+ startedAt: string;
1564
+ visibility: "visible" | "hidden" | "ghost";
1565
+ status: "active" | "idle" | "busy" | "offline";
1566
+ tags: string[];
1567
+ subscribedRooms: string[];
1568
+ };
1569
+ } | {
1570
+ type: "agent_offline";
1571
+ agentId: string;
1572
+ } | {
1573
+ type: "room_upsert";
1574
+ room: {
1575
+ id: string;
1576
+ version: number;
1577
+ name: string;
1578
+ type: "public" | "private" | "secret";
1579
+ owner: string;
1580
+ createdAt: string;
1581
+ description: string;
1582
+ members: string[];
1583
+ invited: string[];
1584
+ memberJoins: Record<string, number>;
1585
+ memberLeaves: Record<string, number>;
1586
+ invitedJoins: Record<string, number>;
1587
+ invitedLeaves: Record<string, number>;
1588
+ };
1589
+ } | {
1590
+ type: "room_delete";
1591
+ roomId: string;
1592
+ } | {
1593
+ type: "message_add";
1594
+ roomId: string;
1595
+ message: {
1596
+ id: string;
1597
+ from: string;
1598
+ room: string;
1599
+ content: string;
1600
+ timestamp: string;
1601
+ readBy: string[];
1602
+ replyTo?: string | undefined;
1603
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
1604
+ };
1605
+ } | {
1606
+ type: "dm_add";
1607
+ key: string;
1608
+ message: {
1609
+ id: string;
1610
+ from: string;
1611
+ to: string;
1612
+ content: string;
1613
+ timestamp: string;
1614
+ readBy: string[];
1615
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
1616
+ };
1617
+ } | {
1618
+ type: "delivery";
1619
+ agentId: string;
1620
+ event: {
1621
+ type: "room_message";
1622
+ message: {
1623
+ id: string;
1624
+ from: string;
1625
+ room: string;
1626
+ content: string;
1627
+ timestamp: string;
1628
+ readBy: string[];
1629
+ replyTo?: string | undefined;
1630
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
1631
+ };
1632
+ } | {
1633
+ type: "dm";
1634
+ message: {
1635
+ id: string;
1636
+ from: string;
1637
+ to: string;
1638
+ content: string;
1639
+ timestamp: string;
1640
+ readBy: string[];
1641
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
1642
+ };
1643
+ } | {
1644
+ type: "room_invite";
1645
+ room: string;
1646
+ roomDescription: string;
1647
+ from: string;
1648
+ fromName: string;
1649
+ fromCwd: string;
1650
+ } | {
1651
+ type: "member_joined";
1652
+ room: string;
1653
+ agent: string;
1654
+ } | {
1655
+ type: "member_left";
1656
+ room: string;
1657
+ agent: string;
1658
+ } | {
1659
+ type: "room_members";
1660
+ room: string;
1661
+ members: {
1662
+ id: string;
1663
+ name: string;
1664
+ status: "active" | "idle" | "busy" | "offline";
1665
+ }[];
1666
+ } | {
1667
+ type: "member_status";
1668
+ room: string;
1669
+ agent: string;
1670
+ status: "active" | "idle" | "busy" | "offline";
1671
+ } | {
1672
+ type: "delivery_status";
1673
+ messageId: string;
1674
+ agent: string;
1675
+ status: "delivered" | "read";
1676
+ room?: string | undefined;
1677
+ } | {
1678
+ type: "invite_declined";
1679
+ room: string;
1680
+ agent: string;
1681
+ agentName: string;
1682
+ reason: string;
1683
+ } | {
1684
+ type: "name_changed";
1685
+ agent: string;
1686
+ oldName: string;
1687
+ newName: string;
1688
+ } | {
1689
+ type: "connection_request";
1690
+ connectionId: string;
1691
+ peerId: string;
1692
+ dataPort: number;
1693
+ name: string;
1694
+ fingerprint: string;
1695
+ } | {
1696
+ type: "capability_request";
1697
+ requestId: string;
1698
+ capability: string;
1699
+ scopeKind: string;
1700
+ requesterDevice: string;
1701
+ scopePath?: string | undefined;
1702
+ };
1703
+ };
1704
+ } | {
1705
+ kind: "delivery";
1706
+ event: {
1707
+ type: "room_message";
1708
+ message: {
1709
+ id: string;
1710
+ from: string;
1711
+ room: string;
1712
+ content: string;
1713
+ timestamp: string;
1714
+ readBy: string[];
1715
+ replyTo?: string | undefined;
1716
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
1717
+ };
1718
+ } | {
1719
+ type: "dm";
1720
+ message: {
1721
+ id: string;
1722
+ from: string;
1723
+ to: string;
1724
+ content: string;
1725
+ timestamp: string;
1726
+ readBy: string[];
1727
+ streamingBehavior?: "steer" | "followUp" | "info" | undefined;
1728
+ };
1729
+ } | {
1730
+ type: "room_invite";
1731
+ room: string;
1732
+ roomDescription: string;
1733
+ from: string;
1734
+ fromName: string;
1735
+ fromCwd: string;
1736
+ } | {
1737
+ type: "member_joined";
1738
+ room: string;
1739
+ agent: string;
1740
+ } | {
1741
+ type: "member_left";
1742
+ room: string;
1743
+ agent: string;
1744
+ } | {
1745
+ type: "room_members";
1746
+ room: string;
1747
+ members: {
1748
+ id: string;
1749
+ name: string;
1750
+ status: "active" | "idle" | "busy" | "offline";
1751
+ }[];
1752
+ } | {
1753
+ type: "member_status";
1754
+ room: string;
1755
+ agent: string;
1756
+ status: "active" | "idle" | "busy" | "offline";
1757
+ } | {
1758
+ type: "delivery_status";
1759
+ messageId: string;
1760
+ agent: string;
1761
+ status: "delivered" | "read";
1762
+ room?: string | undefined;
1763
+ } | {
1764
+ type: "invite_declined";
1765
+ room: string;
1766
+ agent: string;
1767
+ agentName: string;
1768
+ reason: string;
1769
+ } | {
1770
+ type: "name_changed";
1771
+ agent: string;
1772
+ oldName: string;
1773
+ newName: string;
1774
+ } | {
1775
+ type: "connection_request";
1776
+ connectionId: string;
1777
+ peerId: string;
1778
+ dataPort: number;
1779
+ name: string;
1780
+ fingerprint: string;
1781
+ } | {
1782
+ type: "capability_request";
1783
+ requestId: string;
1784
+ capability: string;
1785
+ scopeKind: string;
1786
+ requesterDevice: string;
1787
+ scopePath?: string | undefined;
1788
+ };
1789
+ }, unknown, void>>, object>;
1790
+ };
1791
+ export type MeshEvent = z.infer<typeof MeshEventSchema>;
1792
+ export type MeshStatePatch = z.infer<typeof MeshStatePatchSchema>;
1793
+ export type SerialisedState = z.infer<typeof SerialisedStateSchema>;
1794
+ export type ActionResult = z.infer<typeof ActionResultSchema>;
1795
+ export {};
1796
+ //# sourceMappingURL=contract.d.ts.map