@joe-broadhead/messaging 0.7.1 → 0.9.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 (94) hide show
  1. package/CHANGELOG.md +364 -2
  2. package/dist/bin/messaging-mcp.js +5498 -4338
  3. package/dist/bin/messaging-relay.js +8626 -5540
  4. package/dist/bin/messaging.js +4492 -3158
  5. package/dist/bin/messagingd.js +19672 -12412
  6. package/dist/lib/modules/core/agent/operations.js +19 -327
  7. package/dist/lib/modules/core/agent/present.js +20 -55
  8. package/dist/lib/modules/core/agent-tools.js +35 -139
  9. package/dist/lib/modules/core/consent.js +54 -14
  10. package/dist/lib/modules/core/contact-card.js +3 -3
  11. package/dist/lib/modules/core/conversation/event.js +29 -4
  12. package/dist/lib/modules/core/conversation/guest-invitation.js +42 -0
  13. package/dist/lib/modules/core/conversation/log.js +287 -65
  14. package/dist/lib/modules/core/conversation/request-log.js +158 -0
  15. package/dist/lib/modules/core/conversation/request-seal.js +41 -0
  16. package/dist/lib/modules/core/conversation/requests.js +87 -0
  17. package/dist/lib/modules/core/conversation/seal.js +90 -37
  18. package/dist/lib/modules/core/conversation-agent-tools.js +69 -0
  19. package/dist/lib/modules/core/federation/directory-proof.js +83 -0
  20. package/dist/lib/modules/core/federation/proof-state.js +167 -0
  21. package/dist/lib/modules/core/federation/roster-proof.js +74 -0
  22. package/dist/lib/modules/core/index.js +9 -4
  23. package/dist/lib/modules/core/jelly-host.js +8 -5
  24. package/dist/lib/modules/core/schema/common.js +33 -5
  25. package/dist/lib/modules/core/schema/consent.js +23 -5
  26. package/dist/lib/modules/core/schema/contact-request.js +22 -0
  27. package/dist/lib/modules/core/schema/conv-frames.js +101 -0
  28. package/dist/lib/modules/core/schema/conversation.js +67 -33
  29. package/dist/lib/modules/core/schema/directory-frames.js +8 -3
  30. package/dist/lib/modules/core/schema/envelope.js +8 -24
  31. package/dist/lib/modules/core/schema/errors.js +7 -5
  32. package/dist/lib/modules/core/schema/guest-invitation.js +13 -0
  33. package/dist/lib/modules/core/schema/index.js +5 -0
  34. package/dist/lib/modules/core/schema/ipc/consent.js +97 -18
  35. package/dist/lib/modules/core/schema/ipc/conversation-views.js +87 -0
  36. package/dist/lib/modules/core/schema/ipc/conversations.js +132 -0
  37. package/dist/lib/modules/core/schema/ipc/device.js +9 -0
  38. package/dist/lib/modules/core/schema/ipc/jelly.js +17 -45
  39. package/dist/lib/modules/core/schema/ipc/shapes.js +74 -73
  40. package/dist/lib/modules/core/schema/ipc/surfaces.js +12 -195
  41. package/dist/lib/modules/core/schema/ipc/tasks.js +31 -0
  42. package/dist/lib/modules/core/schema/ipc.js +68 -46
  43. package/dist/lib/modules/core/testing.js +1 -1
  44. package/dist/lib/modules/core/version.js +1 -1
  45. package/dist/lib/modules/ipc/client.js +10 -2
  46. package/dist/lib/modules/ipc/server.js +14 -5
  47. package/dist/lib/modules/ipc/testing.js +13 -23
  48. package/dist/spec/messaging-v1.md +854 -445
  49. package/dist/third-party-notices.md +1 -1
  50. package/dist/third-party.json +1 -1
  51. package/dist/types/core/agent/operations.d.ts +5 -52
  52. package/dist/types/core/agent/present.d.ts +6 -21
  53. package/dist/types/core/agent-tools.d.ts +295 -442
  54. package/dist/types/core/consent.d.ts +30 -7
  55. package/dist/types/core/contact-card.d.ts +3 -3
  56. package/dist/types/core/conversation/event.d.ts +6 -6
  57. package/dist/types/core/conversation/guest-invitation.d.ts +8 -0
  58. package/dist/types/core/conversation/log.d.ts +28 -13
  59. package/dist/types/core/conversation/request-log.d.ts +24 -0
  60. package/dist/types/core/conversation/request-seal.d.ts +6 -0
  61. package/dist/types/core/conversation/requests.d.ts +14 -0
  62. package/dist/types/core/conversation/seal.d.ts +32 -9
  63. package/dist/types/core/conversation-agent-tools.d.ts +939 -0
  64. package/dist/types/core/federation/directory-proof.d.ts +8 -0
  65. package/dist/types/core/federation/proof-state.d.ts +114 -0
  66. package/dist/types/core/federation/roster-proof.d.ts +7 -0
  67. package/dist/types/core/index.d.ts +11 -6
  68. package/dist/types/core/jelly-host.d.ts +1 -1
  69. package/dist/types/core/schema/common.d.ts +33 -6
  70. package/dist/types/core/schema/consent.d.ts +29 -8
  71. package/dist/types/core/schema/contact-request.d.ts +264 -0
  72. package/dist/types/core/schema/conv-frames.d.ts +1204 -0
  73. package/dist/types/core/schema/conversation.d.ts +1410 -264
  74. package/dist/types/core/schema/directory-frames.d.ts +8 -3
  75. package/dist/types/core/schema/envelope.d.ts +85 -130
  76. package/dist/types/core/schema/errors.d.ts +5 -1
  77. package/dist/types/core/schema/guest-invitation.d.ts +51 -0
  78. package/dist/types/core/schema/index.d.ts +5 -0
  79. package/dist/types/core/schema/ipc/consent.d.ts +464 -62
  80. package/dist/types/core/schema/ipc/conversation-views.d.ts +1199 -0
  81. package/dist/types/core/schema/ipc/conversations.d.ts +4355 -0
  82. package/dist/types/core/schema/ipc/device.d.ts +10 -0
  83. package/dist/types/core/schema/ipc/jelly.d.ts +16 -111
  84. package/dist/types/core/schema/ipc/shapes.d.ts +211 -95
  85. package/dist/types/core/schema/ipc/surfaces.d.ts +26 -427
  86. package/dist/types/core/schema/ipc/tasks.d.ts +210 -0
  87. package/dist/types/core/schema/ipc.d.ts +3859 -890
  88. package/dist/types/core/schema/relay.d.ts +12 -4
  89. package/dist/types/core/testing.d.ts +1 -1
  90. package/dist/types/core/version.d.ts +1 -1
  91. package/dist/types/ipc/client.d.ts +4 -1
  92. package/dist/types/ipc/server.d.ts +16 -1
  93. package/dist/types/ipc/testing.d.ts +21 -8
  94. package/package.json +1 -1
@@ -0,0 +1,939 @@
1
+ /** Shared conversation-model tools, including the retained task-envelope path. */
2
+ import { z } from "zod";
3
+ export declare const ToolSource: z.ZodDiscriminatedUnion<[z.ZodObject<{
4
+ kind: z.ZodLiteral<"conv">;
5
+ cid: z.ZodString;
6
+ event: z.ZodString;
7
+ }, z.core.$strict>, z.ZodObject<{
8
+ kind: z.ZodLiteral<"task">;
9
+ taskId: z.ZodString;
10
+ }, z.core.$strict>], "kind">;
11
+ export type ToolSource = z.infer<typeof ToolSource>;
12
+ /** Rendered model result: peer text and names are fenced by the client, never instructions. */
13
+ export declare const ConversationToolEvent: z.ZodObject<{
14
+ cite: z.ZodString;
15
+ cid: z.ZodString;
16
+ id: z.ZodString;
17
+ seq: z.ZodNumber;
18
+ at: z.ZodNumber;
19
+ conv: z.ZodObject<{
20
+ kind: z.ZodEnum<{
21
+ self: "self";
22
+ channel: "channel";
23
+ group: "group";
24
+ dm: "dm";
25
+ }>;
26
+ name: z.ZodOptional<z.ZodString>;
27
+ }, z.core.$strip>;
28
+ author: z.ZodObject<{
29
+ person: z.ZodString;
30
+ agent: z.ZodOptional<z.ZodString>;
31
+ of: z.ZodOptional<z.ZodString>;
32
+ side: z.ZodEnum<{
33
+ peer: "peer";
34
+ ours: "ours";
35
+ }>;
36
+ }, z.core.$strip>;
37
+ thread: z.ZodOptional<z.ZodString>;
38
+ text: z.ZodOptional<z.ZodString>;
39
+ truncated: z.ZodOptional<z.ZodBoolean>;
40
+ deleted: z.ZodOptional<z.ZodBoolean>;
41
+ nextOffset: z.ZodOptional<z.ZodNumber>;
42
+ }, z.core.$strip>;
43
+ export type ConversationToolEvent = z.infer<typeof ConversationToolEvent>;
44
+ export declare const ConversationTools: {
45
+ readonly contacts: {
46
+ readonly input: z.ZodObject<{
47
+ query: z.ZodOptional<z.ZodString>;
48
+ kind: z.ZodOptional<z.ZodEnum<{
49
+ person: "person";
50
+ channel: "channel";
51
+ agent: "agent";
52
+ }>>;
53
+ can: z.ZodOptional<z.ZodEnum<{
54
+ chat: "chat";
55
+ ask: "ask";
56
+ }>>;
57
+ limit: z.ZodOptional<z.ZodNumber>;
58
+ }, z.core.$strict>;
59
+ readonly output: z.ZodObject<{
60
+ me: z.ZodObject<{
61
+ address: z.ZodString;
62
+ person: z.ZodString;
63
+ agent: z.ZodString;
64
+ device: z.ZodString;
65
+ relay: z.ZodEnum<{
66
+ offline: "offline";
67
+ connected: "connected";
68
+ }>;
69
+ }, z.core.$strip>;
70
+ contacts: z.ZodArray<z.ZodObject<{
71
+ can: z.ZodObject<{
72
+ chat: z.ZodBoolean;
73
+ agentMail: z.ZodBoolean;
74
+ ask: z.ZodEnum<{
75
+ request: "request";
76
+ open: "open";
77
+ no: "no";
78
+ }>;
79
+ source: z.ZodEnum<{
80
+ default: "default";
81
+ card: "card";
82
+ }>;
83
+ card: z.ZodOptional<z.ZodString>;
84
+ }, z.core.$strip>;
85
+ state: z.ZodOptional<z.ZodEnum<{
86
+ unknown: "unknown";
87
+ idle: "idle";
88
+ busy: "busy";
89
+ kept: "kept";
90
+ }>>;
91
+ seen: z.ZodOptional<z.ZodOptional<z.ZodString>>;
92
+ repo: z.ZodOptional<z.ZodOptional<z.ZodString>>;
93
+ branch: z.ZodOptional<z.ZodOptional<z.ZodString>>;
94
+ doing: z.ZodOptional<z.ZodOptional<z.ZodString>>;
95
+ expect: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
96
+ kept: "kept";
97
+ wake: "wake";
98
+ next_turn: "next_turn";
99
+ next_prompt: "next_prompt";
100
+ on_read: "on_read";
101
+ offline: "offline";
102
+ }>>>;
103
+ address: z.ZodString;
104
+ kind: z.ZodEnum<{
105
+ person: "person";
106
+ channel: "channel";
107
+ agent: "agent";
108
+ }>;
109
+ name: z.ZodString;
110
+ org: z.ZodEnum<{
111
+ other: "other";
112
+ same: "same";
113
+ }>;
114
+ presence: z.ZodEnum<{
115
+ unknown: "unknown";
116
+ away: "away";
117
+ offline: "offline";
118
+ online: "online";
119
+ }>;
120
+ agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
121
+ address: z.ZodString;
122
+ state: z.ZodEnum<{
123
+ unknown: "unknown";
124
+ idle: "idle";
125
+ busy: "busy";
126
+ kept: "kept";
127
+ }>;
128
+ expect: z.ZodOptional<z.ZodEnum<{
129
+ kept: "kept";
130
+ wake: "wake";
131
+ next_turn: "next_turn";
132
+ next_prompt: "next_prompt";
133
+ on_read: "on_read";
134
+ offline: "offline";
135
+ }>>;
136
+ seen: z.ZodOptional<z.ZodString>;
137
+ repo: z.ZodOptional<z.ZodString>;
138
+ branch: z.ZodOptional<z.ZodString>;
139
+ doing: z.ZodOptional<z.ZodString>;
140
+ }, z.core.$strip>>>;
141
+ }, z.core.$strip>>;
142
+ more: z.ZodBoolean;
143
+ notice: z.ZodOptional<z.ZodString>;
144
+ }, z.core.$strip>;
145
+ };
146
+ readonly conversations: {
147
+ readonly input: z.ZodObject<{
148
+ cid: z.ZodOptional<z.ZodString>;
149
+ limit: z.ZodOptional<z.ZodNumber>;
150
+ cursor: z.ZodOptional<z.ZodString>;
151
+ }, z.core.$strict>;
152
+ readonly output: z.ZodObject<{
153
+ conversations: z.ZodArray<z.ZodObject<{
154
+ cid: z.ZodString;
155
+ kind: z.ZodEnum<{
156
+ self: "self";
157
+ channel: "channel";
158
+ group: "group";
159
+ dm: "dm";
160
+ }>;
161
+ name: z.ZodOptional<z.ZodString>;
162
+ reason: z.ZodEnum<{
163
+ seat: "seat";
164
+ allow: "allow";
165
+ ask: "ask";
166
+ }>;
167
+ lookbackDays: z.ZodNumber;
168
+ indexedFrom: z.ZodOptional<z.ZodNumber>;
169
+ complete: z.ZodBoolean;
170
+ }, z.core.$strip>>;
171
+ cursor: z.ZodOptional<z.ZodString>;
172
+ notice: z.ZodOptional<z.ZodString>;
173
+ }, z.core.$strip>;
174
+ };
175
+ readonly send: {
176
+ readonly input: z.ZodObject<{
177
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
178
+ name: z.ZodString;
179
+ mime: z.ZodString;
180
+ data: z.ZodString;
181
+ }, z.core.$strict>>>;
182
+ replyTo: z.ZodOptional<z.ZodString>;
183
+ onBehalfOf: z.ZodOptional<z.ZodString>;
184
+ key: z.ZodOptional<z.ZodString>;
185
+ to: z.ZodOptional<z.ZodString>;
186
+ cid: z.ZodOptional<z.ZodString>;
187
+ text: z.ZodString;
188
+ thread: z.ZodOptional<z.ZodString>;
189
+ answer: z.ZodOptional<z.ZodString>;
190
+ ask: z.ZodOptional<z.ZodBoolean>;
191
+ clientId: z.ZodOptional<z.ZodString>;
192
+ }, z.core.$strict>;
193
+ readonly output: z.ZodUnion<readonly [z.ZodObject<{
194
+ source: z.ZodObject<{
195
+ kind: z.ZodLiteral<"conv">;
196
+ cid: z.ZodString;
197
+ event: z.ZodString;
198
+ }, z.core.$strict>;
199
+ stage: z.ZodLiteral<"pending">;
200
+ clientId: z.ZodString;
201
+ expect: z.ZodOptional<z.ZodEnum<{
202
+ kept: "kept";
203
+ wake: "wake";
204
+ next_turn: "next_turn";
205
+ next_prompt: "next_prompt";
206
+ on_read: "on_read";
207
+ offline: "offline";
208
+ on_consent: "on_consent";
209
+ }>>;
210
+ }, z.core.$strip>, z.ZodObject<{
211
+ id: z.ZodString;
212
+ source: z.ZodObject<{
213
+ kind: z.ZodLiteral<"task">;
214
+ taskId: z.ZodString;
215
+ }, z.core.$strict>;
216
+ kind: z.ZodEnum<{
217
+ task: "task";
218
+ continuation: "continuation";
219
+ }>;
220
+ results: z.ZodArray<z.ZodObject<{
221
+ to: z.ZodString;
222
+ stage: z.ZodEnum<{
223
+ accepted: "accepted";
224
+ relayed: "relayed";
225
+ delivered: "delivered";
226
+ held: "held";
227
+ handed_to_agent: "handed_to_agent";
228
+ read: "read";
229
+ replied: "replied";
230
+ rejected: "rejected";
231
+ expired: "expired";
232
+ }>;
233
+ code: z.ZodOptional<z.ZodEnum<{
234
+ expired: "expired";
235
+ invalid_request: "invalid_request";
236
+ not_member: "not_member";
237
+ bad_signature: "bad_signature";
238
+ unknown_session: "unknown_session";
239
+ ambiguous_address: "ambiguous_address";
240
+ no_recipients: "no_recipients";
241
+ unknown_address: "unknown_address";
242
+ refused: "refused";
243
+ declined: "declined";
244
+ request_required: "request_required";
245
+ peer_outdated: "peer_outdated";
246
+ rate_limited: "rate_limited";
247
+ loop_guard: "loop_guard";
248
+ too_large: "too_large";
249
+ secret_refused: "secret_refused";
250
+ duplicate: "duplicate";
251
+ relay_unavailable: "relay_unavailable";
252
+ not_found: "not_found";
253
+ invalid_state: "invalid_state";
254
+ forbidden: "forbidden";
255
+ guarded_turn: "guarded_turn";
256
+ roster_conflict: "roster_conflict";
257
+ invite_invalid: "invite_invalid";
258
+ no_identity: "no_identity";
259
+ binding_invalid: "binding_invalid";
260
+ jelly_unavailable: "jelly_unavailable";
261
+ log_conflict: "log_conflict";
262
+ conv_conflict: "conv_conflict";
263
+ conflict: "conflict";
264
+ stale_epoch: "stale_epoch";
265
+ device_limit: "device_limit";
266
+ admission_required: "admission_required";
267
+ admission_invalid: "admission_invalid";
268
+ directory_inconsistent: "directory_inconsistent";
269
+ unknown_device: "unknown_device";
270
+ directory_unavailable: "directory_unavailable";
271
+ login_unsupported: "login_unsupported";
272
+ login_denied: "login_denied";
273
+ grant_required: "grant_required";
274
+ grant_invalid: "grant_invalid";
275
+ ticket_required: "ticket_required";
276
+ ticket_invalid: "ticket_invalid";
277
+ daemon_unavailable: "daemon_unavailable";
278
+ daemon_mismatch: "daemon_mismatch";
279
+ store_refused: "store_refused";
280
+ internal: "internal";
281
+ }>>;
282
+ expect: z.ZodOptional<z.ZodEnum<{
283
+ kept: "kept";
284
+ wake: "wake";
285
+ next_turn: "next_turn";
286
+ next_prompt: "next_prompt";
287
+ on_read: "on_read";
288
+ offline: "offline";
289
+ on_consent: "on_consent";
290
+ }>>;
291
+ }, z.core.$strip>>;
292
+ note: z.ZodString;
293
+ }, z.core.$strip>, z.ZodObject<{
294
+ stage: z.ZodLiteral<"held">;
295
+ code: z.ZodEnum<{
296
+ audience: "audience";
297
+ context: "context";
298
+ }>;
299
+ expect: z.ZodLiteral<"on_consent">;
300
+ note: z.ZodString;
301
+ }, z.core.$strip>]>;
302
+ };
303
+ readonly inbox: {
304
+ readonly input: z.ZodObject<{
305
+ unread: z.ZodOptional<z.ZodBoolean>;
306
+ from: z.ZodOptional<z.ZodString>;
307
+ limit: z.ZodOptional<z.ZodNumber>;
308
+ }, z.core.$strict>;
309
+ readonly output: z.ZodObject<{
310
+ items: z.ZodArray<z.ZodObject<{
311
+ id: z.ZodString;
312
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
313
+ kind: z.ZodLiteral<"conv">;
314
+ cid: z.ZodString;
315
+ event: z.ZodString;
316
+ }, z.core.$strict>, z.ZodObject<{
317
+ kind: z.ZodLiteral<"task">;
318
+ taskId: z.ZodString;
319
+ }, z.core.$strict>], "kind">;
320
+ from: z.ZodString;
321
+ preview: z.ZodOptional<z.ZodString>;
322
+ at: z.ZodNumber;
323
+ stage: z.ZodEnum<{
324
+ delivered: "delivered";
325
+ handed_to_agent: "handed_to_agent";
326
+ read: "read";
327
+ }>;
328
+ consent: z.ZodEnum<{
329
+ self: "self";
330
+ guarded: "guarded";
331
+ trusted: "trusted";
332
+ }>;
333
+ chain: z.ZodOptional<z.ZodObject<{
334
+ path: z.ZodString;
335
+ depth: z.ZodNumber;
336
+ maxDepth: z.ZodNumber;
337
+ scope: z.ZodOptional<z.ZodString>;
338
+ }, z.core.$strip>>;
339
+ }, z.core.$strip>>;
340
+ unread: z.ZodNumber;
341
+ notice: z.ZodOptional<z.ZodString>;
342
+ }, z.core.$strip>;
343
+ };
344
+ readonly read: {
345
+ readonly input: z.ZodObject<{
346
+ cid: z.ZodOptional<z.ZodString>;
347
+ source: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
348
+ kind: z.ZodLiteral<"conv">;
349
+ cid: z.ZodString;
350
+ event: z.ZodString;
351
+ }, z.core.$strict>, z.ZodObject<{
352
+ kind: z.ZodLiteral<"task">;
353
+ taskId: z.ZodString;
354
+ }, z.core.$strict>], "kind">>;
355
+ id: z.ZodOptional<z.ZodString>;
356
+ offset: z.ZodOptional<z.ZodNumber>;
357
+ thread: z.ZodOptional<z.ZodString>;
358
+ before: z.ZodOptional<z.ZodString>;
359
+ after: z.ZodOptional<z.ZodString>;
360
+ limit: z.ZodOptional<z.ZodNumber>;
361
+ cursor: z.ZodOptional<z.ZodString>;
362
+ }, z.core.$strict>;
363
+ readonly output: z.ZodUnion<readonly [z.ZodObject<{
364
+ events: z.ZodArray<z.ZodObject<{
365
+ cite: z.ZodString;
366
+ cid: z.ZodString;
367
+ id: z.ZodString;
368
+ seq: z.ZodNumber;
369
+ at: z.ZodNumber;
370
+ conv: z.ZodObject<{
371
+ kind: z.ZodEnum<{
372
+ self: "self";
373
+ channel: "channel";
374
+ group: "group";
375
+ dm: "dm";
376
+ }>;
377
+ name: z.ZodOptional<z.ZodString>;
378
+ }, z.core.$strip>;
379
+ author: z.ZodObject<{
380
+ person: z.ZodString;
381
+ agent: z.ZodOptional<z.ZodString>;
382
+ of: z.ZodOptional<z.ZodString>;
383
+ side: z.ZodEnum<{
384
+ peer: "peer";
385
+ ours: "ours";
386
+ }>;
387
+ }, z.core.$strip>;
388
+ thread: z.ZodOptional<z.ZodString>;
389
+ text: z.ZodOptional<z.ZodString>;
390
+ truncated: z.ZodOptional<z.ZodBoolean>;
391
+ deleted: z.ZodOptional<z.ZodBoolean>;
392
+ nextOffset: z.ZodOptional<z.ZodNumber>;
393
+ }, z.core.$strip>>;
394
+ cursor: z.ZodOptional<z.ZodString>;
395
+ notice: z.ZodOptional<z.ZodString>;
396
+ }, z.core.$strip>, z.ZodObject<{
397
+ item: z.ZodUnion<readonly [z.ZodObject<{
398
+ id: z.ZodString;
399
+ source: z.ZodObject<{
400
+ kind: z.ZodLiteral<"conv">;
401
+ cid: z.ZodString;
402
+ event: z.ZodString;
403
+ }, z.core.$strict>;
404
+ event: z.ZodObject<{
405
+ cite: z.ZodString;
406
+ cid: z.ZodString;
407
+ id: z.ZodString;
408
+ seq: z.ZodNumber;
409
+ at: z.ZodNumber;
410
+ conv: z.ZodObject<{
411
+ kind: z.ZodEnum<{
412
+ self: "self";
413
+ channel: "channel";
414
+ group: "group";
415
+ dm: "dm";
416
+ }>;
417
+ name: z.ZodOptional<z.ZodString>;
418
+ }, z.core.$strip>;
419
+ author: z.ZodObject<{
420
+ person: z.ZodString;
421
+ agent: z.ZodOptional<z.ZodString>;
422
+ of: z.ZodOptional<z.ZodString>;
423
+ side: z.ZodEnum<{
424
+ peer: "peer";
425
+ ours: "ours";
426
+ }>;
427
+ }, z.core.$strip>;
428
+ thread: z.ZodOptional<z.ZodString>;
429
+ text: z.ZodOptional<z.ZodString>;
430
+ truncated: z.ZodOptional<z.ZodBoolean>;
431
+ deleted: z.ZodOptional<z.ZodBoolean>;
432
+ nextOffset: z.ZodOptional<z.ZodNumber>;
433
+ }, z.core.$strip>;
434
+ }, z.core.$strip>, z.ZodObject<{
435
+ id: z.ZodString;
436
+ source: z.ZodObject<{
437
+ kind: z.ZodLiteral<"task">;
438
+ taskId: z.ZodString;
439
+ }, z.core.$strict>;
440
+ kind: z.ZodEnum<{
441
+ task: "task";
442
+ continuation: "continuation";
443
+ }>;
444
+ from: z.ZodString;
445
+ at: z.ZodString;
446
+ parts: z.ZodArray<z.ZodObject<{
447
+ type: z.ZodEnum<{
448
+ file: "file";
449
+ text: "text";
450
+ url: "url";
451
+ data: "data";
452
+ }>;
453
+ author: z.ZodEnum<{
454
+ peer: "peer";
455
+ ours: "ours";
456
+ }>;
457
+ content: z.ZodString;
458
+ filename: z.ZodOptional<z.ZodString>;
459
+ mediaType: z.ZodOptional<z.ZodString>;
460
+ bytes: z.ZodOptional<z.ZodNumber>;
461
+ }, z.core.$strip>>;
462
+ verified: z.ZodOptional<z.ZodEnum<{
463
+ none: "none";
464
+ signature: "signature";
465
+ }>>;
466
+ replyTo: z.ZodOptional<z.ZodString>;
467
+ chain: z.ZodOptional<z.ZodObject<{
468
+ path: z.ZodString;
469
+ depth: z.ZodNumber;
470
+ maxDepth: z.ZodNumber;
471
+ scope: z.ZodOptional<z.ZodString>;
472
+ }, z.core.$strip>>;
473
+ task: z.ZodOptional<z.ZodObject<{
474
+ id: z.ZodString;
475
+ role: z.ZodEnum<{
476
+ mine: "mine";
477
+ asked: "asked";
478
+ }>;
479
+ counterpart: z.ZodString;
480
+ state: z.ZodEnum<{
481
+ rejected: "rejected";
482
+ failed: "failed";
483
+ submitted: "submitted";
484
+ working: "working";
485
+ completed: "completed";
486
+ canceled: "canceled";
487
+ input_required: "input_required";
488
+ auth_required: "auth_required";
489
+ }>;
490
+ title: z.ZodOptional<z.ZodString>;
491
+ titleAuthor: z.ZodOptional<z.ZodEnum<{
492
+ peer: "peer";
493
+ ours: "ours";
494
+ }>>;
495
+ status: z.ZodOptional<z.ZodString>;
496
+ statusAuthor: z.ZodOptional<z.ZodEnum<{
497
+ peer: "peer";
498
+ ours: "ours";
499
+ }>>;
500
+ signIn: z.ZodOptional<z.ZodObject<{
501
+ tool: z.ZodOptional<z.ZodString>;
502
+ by: z.ZodEnum<{
503
+ you: "you";
504
+ them: "them";
505
+ }>;
506
+ }, z.core.$strip>>;
507
+ refusal: z.ZodOptional<z.ZodObject<{
508
+ reason: z.ZodString;
509
+ }, z.core.$strip>>;
510
+ createdAt: z.ZodString;
511
+ updatedAt: z.ZodString;
512
+ consent: z.ZodOptional<z.ZodEnum<{
513
+ self: "self";
514
+ guarded: "guarded";
515
+ trusted: "trusted";
516
+ }>>;
517
+ chain: z.ZodOptional<z.ZodObject<{
518
+ path: z.ZodString;
519
+ depth: z.ZodNumber;
520
+ maxDepth: z.ZodNumber;
521
+ scope: z.ZodOptional<z.ZodString>;
522
+ }, z.core.$strip>>;
523
+ history: z.ZodArray<z.ZodObject<{
524
+ from: z.ZodEnum<{
525
+ requester: "requester";
526
+ executor: "executor";
527
+ }>;
528
+ author: z.ZodEnum<{
529
+ peer: "peer";
530
+ ours: "ours";
531
+ }>;
532
+ parts: z.ZodArray<z.ZodObject<{
533
+ type: z.ZodEnum<{
534
+ file: "file";
535
+ text: "text";
536
+ url: "url";
537
+ data: "data";
538
+ }>;
539
+ author: z.ZodEnum<{
540
+ peer: "peer";
541
+ ours: "ours";
542
+ }>;
543
+ content: z.ZodString;
544
+ filename: z.ZodOptional<z.ZodString>;
545
+ mediaType: z.ZodOptional<z.ZodString>;
546
+ bytes: z.ZodOptional<z.ZodNumber>;
547
+ }, z.core.$strip>>;
548
+ }, z.core.$strip>>;
549
+ artifacts: z.ZodArray<z.ZodObject<{
550
+ author: z.ZodEnum<{
551
+ peer: "peer";
552
+ ours: "ours";
553
+ }>;
554
+ name: z.ZodOptional<z.ZodString>;
555
+ parts: z.ZodArray<z.ZodObject<{
556
+ type: z.ZodEnum<{
557
+ file: "file";
558
+ text: "text";
559
+ url: "url";
560
+ data: "data";
561
+ }>;
562
+ author: z.ZodEnum<{
563
+ peer: "peer";
564
+ ours: "ours";
565
+ }>;
566
+ content: z.ZodString;
567
+ filename: z.ZodOptional<z.ZodString>;
568
+ mediaType: z.ZodOptional<z.ZodString>;
569
+ bytes: z.ZodOptional<z.ZodNumber>;
570
+ }, z.core.$strip>>;
571
+ }, z.core.$strip>>;
572
+ followUps: z.ZodOptional<z.ZodArray<z.ZodObject<{
573
+ id: z.ZodString;
574
+ sentAt: z.ZodString;
575
+ stage: z.ZodEnum<{
576
+ accepted: "accepted";
577
+ relayed: "relayed";
578
+ delivered: "delivered";
579
+ held: "held";
580
+ handed_to_agent: "handed_to_agent";
581
+ read: "read";
582
+ replied: "replied";
583
+ rejected: "rejected";
584
+ expired: "expired";
585
+ }>;
586
+ read: z.ZodBoolean;
587
+ }, z.core.$strip>>>;
588
+ }, z.core.$strip>>;
589
+ }, z.core.$strip>]>;
590
+ notice: z.ZodOptional<z.ZodString>;
591
+ }, z.core.$strip>, z.ZodObject<{
592
+ stage: z.ZodLiteral<"held">;
593
+ code: z.ZodEnum<{
594
+ audience: "audience";
595
+ context: "context";
596
+ }>;
597
+ expect: z.ZodLiteral<"on_consent">;
598
+ note: z.ZodString;
599
+ }, z.core.$strip>]>;
600
+ };
601
+ readonly search: {
602
+ readonly input: z.ZodObject<{
603
+ query: z.ZodString;
604
+ cid: z.ZodOptional<z.ZodString>;
605
+ from: z.ZodOptional<z.ZodString>;
606
+ after: z.ZodOptional<z.ZodNumber>;
607
+ before: z.ZodOptional<z.ZodNumber>;
608
+ thread: z.ZodOptional<z.ZodString>;
609
+ limit: z.ZodOptional<z.ZodNumber>;
610
+ cursor: z.ZodOptional<z.ZodString>;
611
+ }, z.core.$strict>;
612
+ readonly output: z.ZodUnion<readonly [z.ZodObject<{
613
+ events: z.ZodArray<z.ZodObject<{
614
+ cite: z.ZodString;
615
+ cid: z.ZodString;
616
+ id: z.ZodString;
617
+ seq: z.ZodNumber;
618
+ at: z.ZodNumber;
619
+ conv: z.ZodObject<{
620
+ kind: z.ZodEnum<{
621
+ self: "self";
622
+ channel: "channel";
623
+ group: "group";
624
+ dm: "dm";
625
+ }>;
626
+ name: z.ZodOptional<z.ZodString>;
627
+ }, z.core.$strip>;
628
+ author: z.ZodObject<{
629
+ person: z.ZodString;
630
+ agent: z.ZodOptional<z.ZodString>;
631
+ of: z.ZodOptional<z.ZodString>;
632
+ side: z.ZodEnum<{
633
+ peer: "peer";
634
+ ours: "ours";
635
+ }>;
636
+ }, z.core.$strip>;
637
+ thread: z.ZodOptional<z.ZodString>;
638
+ text: z.ZodOptional<z.ZodString>;
639
+ truncated: z.ZodOptional<z.ZodBoolean>;
640
+ deleted: z.ZodOptional<z.ZodBoolean>;
641
+ nextOffset: z.ZodOptional<z.ZodNumber>;
642
+ }, z.core.$strip>>;
643
+ cursor: z.ZodOptional<z.ZodString>;
644
+ notice: z.ZodOptional<z.ZodString>;
645
+ }, z.core.$strip>, z.ZodObject<{
646
+ stage: z.ZodLiteral<"held">;
647
+ code: z.ZodEnum<{
648
+ audience: "audience";
649
+ context: "context";
650
+ }>;
651
+ expect: z.ZodLiteral<"on_consent">;
652
+ note: z.ZodString;
653
+ }, z.core.$strip>]>;
654
+ };
655
+ readonly context: {
656
+ readonly input: z.ZodObject<{
657
+ cid: z.ZodString;
658
+ event: z.ZodString;
659
+ before: z.ZodOptional<z.ZodNumber>;
660
+ after: z.ZodOptional<z.ZodNumber>;
661
+ }, z.core.$strict>;
662
+ readonly output: z.ZodUnion<readonly [z.ZodObject<{
663
+ event: z.ZodObject<{
664
+ cite: z.ZodString;
665
+ cid: z.ZodString;
666
+ id: z.ZodString;
667
+ seq: z.ZodNumber;
668
+ at: z.ZodNumber;
669
+ conv: z.ZodObject<{
670
+ kind: z.ZodEnum<{
671
+ self: "self";
672
+ channel: "channel";
673
+ group: "group";
674
+ dm: "dm";
675
+ }>;
676
+ name: z.ZodOptional<z.ZodString>;
677
+ }, z.core.$strip>;
678
+ author: z.ZodObject<{
679
+ person: z.ZodString;
680
+ agent: z.ZodOptional<z.ZodString>;
681
+ of: z.ZodOptional<z.ZodString>;
682
+ side: z.ZodEnum<{
683
+ peer: "peer";
684
+ ours: "ours";
685
+ }>;
686
+ }, z.core.$strip>;
687
+ thread: z.ZodOptional<z.ZodString>;
688
+ text: z.ZodOptional<z.ZodString>;
689
+ truncated: z.ZodOptional<z.ZodBoolean>;
690
+ deleted: z.ZodOptional<z.ZodBoolean>;
691
+ nextOffset: z.ZodOptional<z.ZodNumber>;
692
+ }, z.core.$strip>;
693
+ before: z.ZodArray<z.ZodObject<{
694
+ cite: z.ZodString;
695
+ cid: z.ZodString;
696
+ id: z.ZodString;
697
+ seq: z.ZodNumber;
698
+ at: z.ZodNumber;
699
+ conv: z.ZodObject<{
700
+ kind: z.ZodEnum<{
701
+ self: "self";
702
+ channel: "channel";
703
+ group: "group";
704
+ dm: "dm";
705
+ }>;
706
+ name: z.ZodOptional<z.ZodString>;
707
+ }, z.core.$strip>;
708
+ author: z.ZodObject<{
709
+ person: z.ZodString;
710
+ agent: z.ZodOptional<z.ZodString>;
711
+ of: z.ZodOptional<z.ZodString>;
712
+ side: z.ZodEnum<{
713
+ peer: "peer";
714
+ ours: "ours";
715
+ }>;
716
+ }, z.core.$strip>;
717
+ thread: z.ZodOptional<z.ZodString>;
718
+ text: z.ZodOptional<z.ZodString>;
719
+ truncated: z.ZodOptional<z.ZodBoolean>;
720
+ deleted: z.ZodOptional<z.ZodBoolean>;
721
+ nextOffset: z.ZodOptional<z.ZodNumber>;
722
+ }, z.core.$strip>>;
723
+ after: z.ZodArray<z.ZodObject<{
724
+ cite: z.ZodString;
725
+ cid: z.ZodString;
726
+ id: z.ZodString;
727
+ seq: z.ZodNumber;
728
+ at: z.ZodNumber;
729
+ conv: z.ZodObject<{
730
+ kind: z.ZodEnum<{
731
+ self: "self";
732
+ channel: "channel";
733
+ group: "group";
734
+ dm: "dm";
735
+ }>;
736
+ name: z.ZodOptional<z.ZodString>;
737
+ }, z.core.$strip>;
738
+ author: z.ZodObject<{
739
+ person: z.ZodString;
740
+ agent: z.ZodOptional<z.ZodString>;
741
+ of: z.ZodOptional<z.ZodString>;
742
+ side: z.ZodEnum<{
743
+ peer: "peer";
744
+ ours: "ours";
745
+ }>;
746
+ }, z.core.$strip>;
747
+ thread: z.ZodOptional<z.ZodString>;
748
+ text: z.ZodOptional<z.ZodString>;
749
+ truncated: z.ZodOptional<z.ZodBoolean>;
750
+ deleted: z.ZodOptional<z.ZodBoolean>;
751
+ nextOffset: z.ZodOptional<z.ZodNumber>;
752
+ }, z.core.$strip>>;
753
+ root: z.ZodOptional<z.ZodObject<{
754
+ cite: z.ZodString;
755
+ cid: z.ZodString;
756
+ id: z.ZodString;
757
+ seq: z.ZodNumber;
758
+ at: z.ZodNumber;
759
+ conv: z.ZodObject<{
760
+ kind: z.ZodEnum<{
761
+ self: "self";
762
+ channel: "channel";
763
+ group: "group";
764
+ dm: "dm";
765
+ }>;
766
+ name: z.ZodOptional<z.ZodString>;
767
+ }, z.core.$strip>;
768
+ author: z.ZodObject<{
769
+ person: z.ZodString;
770
+ agent: z.ZodOptional<z.ZodString>;
771
+ of: z.ZodOptional<z.ZodString>;
772
+ side: z.ZodEnum<{
773
+ peer: "peer";
774
+ ours: "ours";
775
+ }>;
776
+ }, z.core.$strip>;
777
+ thread: z.ZodOptional<z.ZodString>;
778
+ text: z.ZodOptional<z.ZodString>;
779
+ truncated: z.ZodOptional<z.ZodBoolean>;
780
+ deleted: z.ZodOptional<z.ZodBoolean>;
781
+ nextOffset: z.ZodOptional<z.ZodNumber>;
782
+ }, z.core.$strip>>;
783
+ notice: z.ZodOptional<z.ZodString>;
784
+ }, z.core.$strip>, z.ZodObject<{
785
+ stage: z.ZodLiteral<"held">;
786
+ code: z.ZodEnum<{
787
+ audience: "audience";
788
+ context: "context";
789
+ }>;
790
+ expect: z.ZodLiteral<"on_consent">;
791
+ note: z.ZodString;
792
+ }, z.core.$strip>]>;
793
+ };
794
+ readonly tasks: {
795
+ readonly input: z.ZodObject<{
796
+ role: z.ZodOptional<z.ZodEnum<{
797
+ mine: "mine";
798
+ asked: "asked";
799
+ }>>;
800
+ state: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
801
+ done: "done";
802
+ open: "open";
803
+ }>, z.ZodEnum<{
804
+ rejected: "rejected";
805
+ failed: "failed";
806
+ submitted: "submitted";
807
+ working: "working";
808
+ completed: "completed";
809
+ canceled: "canceled";
810
+ input_required: "input_required";
811
+ auth_required: "auth_required";
812
+ }>]>>;
813
+ limit: z.ZodOptional<z.ZodNumber>;
814
+ cursor: z.ZodOptional<z.ZodString>;
815
+ }, z.core.$strict>;
816
+ readonly output: z.ZodObject<{
817
+ tasks: z.ZodArray<z.ZodObject<{
818
+ role: z.ZodEnum<{
819
+ mine: "mine";
820
+ asked: "asked";
821
+ }>;
822
+ state: z.ZodEnum<{
823
+ rejected: "rejected";
824
+ failed: "failed";
825
+ submitted: "submitted";
826
+ working: "working";
827
+ completed: "completed";
828
+ canceled: "canceled";
829
+ input_required: "input_required";
830
+ auth_required: "auth_required";
831
+ }>;
832
+ status: z.ZodOptional<z.ZodString>;
833
+ id: z.ZodString;
834
+ chain: z.ZodOptional<z.ZodObject<{
835
+ path: z.ZodString;
836
+ depth: z.ZodNumber;
837
+ maxDepth: z.ZodNumber;
838
+ scope: z.ZodOptional<z.ZodString>;
839
+ }, z.core.$strip>>;
840
+ consent: z.ZodOptional<z.ZodEnum<{
841
+ self: "self";
842
+ guarded: "guarded";
843
+ trusted: "trusted";
844
+ }>>;
845
+ updatedAt: z.ZodString;
846
+ signIn: z.ZodOptional<z.ZodObject<{
847
+ tool: z.ZodOptional<z.ZodString>;
848
+ by: z.ZodEnum<{
849
+ you: "you";
850
+ them: "them";
851
+ }>;
852
+ }, z.core.$strip>>;
853
+ refusal: z.ZodOptional<z.ZodObject<{
854
+ reason: z.ZodString;
855
+ }, z.core.$strip>>;
856
+ title: z.ZodOptional<z.ZodString>;
857
+ counterpart: z.ZodString;
858
+ titleAuthor: z.ZodOptional<z.ZodEnum<{
859
+ peer: "peer";
860
+ ours: "ours";
861
+ }>>;
862
+ statusAuthor: z.ZodOptional<z.ZodEnum<{
863
+ peer: "peer";
864
+ ours: "ours";
865
+ }>>;
866
+ }, z.core.$strip>>;
867
+ nextCursor: z.ZodOptional<z.ZodString>;
868
+ total: z.ZodNumber;
869
+ notice: z.ZodOptional<z.ZodString>;
870
+ }, z.core.$strip>;
871
+ };
872
+ readonly task_update: {
873
+ readonly input: z.ZodObject<{
874
+ id: z.ZodString;
875
+ state: z.ZodEnum<{
876
+ rejected: "rejected";
877
+ failed: "failed";
878
+ working: "working";
879
+ completed: "completed";
880
+ input_required: "input_required";
881
+ }>;
882
+ text: z.ZodOptional<z.ZodString>;
883
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
884
+ name: z.ZodString;
885
+ mime: z.ZodString;
886
+ data: z.ZodString;
887
+ }, z.core.$strict>>>;
888
+ }, z.core.$strict>;
889
+ readonly output: z.ZodObject<{
890
+ id: z.ZodString;
891
+ state: z.ZodEnum<{
892
+ rejected: "rejected";
893
+ failed: "failed";
894
+ submitted: "submitted";
895
+ working: "working";
896
+ completed: "completed";
897
+ canceled: "canceled";
898
+ input_required: "input_required";
899
+ auth_required: "auth_required";
900
+ }>;
901
+ stage: z.ZodEnum<{
902
+ accepted: "accepted";
903
+ relayed: "relayed";
904
+ delivered: "delivered";
905
+ held: "held";
906
+ handed_to_agent: "handed_to_agent";
907
+ read: "read";
908
+ replied: "replied";
909
+ rejected: "rejected";
910
+ expired: "expired";
911
+ }>;
912
+ to: z.ZodString;
913
+ }, z.core.$strip>;
914
+ };
915
+ readonly task_cancel: {
916
+ readonly input: z.ZodObject<{
917
+ id: z.ZodString;
918
+ reason: z.ZodOptional<z.ZodString>;
919
+ }, z.core.$strict>;
920
+ readonly output: z.ZodObject<{
921
+ id: z.ZodString;
922
+ state: z.ZodEnum<{
923
+ rejected: "rejected";
924
+ failed: "failed";
925
+ submitted: "submitted";
926
+ working: "working";
927
+ completed: "completed";
928
+ canceled: "canceled";
929
+ input_required: "input_required";
930
+ auth_required: "auth_required";
931
+ }>;
932
+ to: z.ZodString;
933
+ }, z.core.$strip>;
934
+ };
935
+ };
936
+ export type ConversationToolVerb = keyof typeof ConversationTools;
937
+ export declare const CONVERSATION_TOOL_VERBS: readonly ["contacts", "conversations", "send", "inbox", "read", "search", "context", "tasks", "task_update", "task_cancel"];
938
+ export type ConversationToolInput<V extends ConversationToolVerb> = z.output<(typeof ConversationTools)[V]["input"]>;
939
+ export type ConversationToolOutput<V extends ConversationToolVerb> = z.output<(typeof ConversationTools)[V]["output"]>;