@joe-broadhead/messaging 0.7.1 → 0.8.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 (89) hide show
  1. package/CHANGELOG.md +214 -2
  2. package/dist/bin/messaging-mcp.js +5043 -4054
  3. package/dist/bin/messaging-relay.js +8263 -5425
  4. package/dist/bin/messaging.js +5982 -4906
  5. package/dist/bin/messagingd.js +19956 -13716
  6. package/dist/lib/modules/core/agent/operations.js +19 -327
  7. package/dist/lib/modules/core/agent/present.js +15 -55
  8. package/dist/lib/modules/core/agent-tools.js +23 -139
  9. package/dist/lib/modules/core/consent.js +1 -1
  10. package/dist/lib/modules/core/conversation/event.js +29 -4
  11. package/dist/lib/modules/core/conversation/guest-invitation.js +42 -0
  12. package/dist/lib/modules/core/conversation/log.js +287 -65
  13. package/dist/lib/modules/core/conversation/request-log.js +158 -0
  14. package/dist/lib/modules/core/conversation/request-seal.js +41 -0
  15. package/dist/lib/modules/core/conversation/requests.js +87 -0
  16. package/dist/lib/modules/core/conversation/seal.js +90 -37
  17. package/dist/lib/modules/core/conversation-agent-tools.js +69 -0
  18. package/dist/lib/modules/core/federation/directory-proof.js +83 -0
  19. package/dist/lib/modules/core/federation/proof-state.js +167 -0
  20. package/dist/lib/modules/core/federation/roster-proof.js +74 -0
  21. package/dist/lib/modules/core/index.js +8 -3
  22. package/dist/lib/modules/core/jelly-host.js +5 -5
  23. package/dist/lib/modules/core/schema/common.js +31 -5
  24. package/dist/lib/modules/core/schema/consent.js +5 -4
  25. package/dist/lib/modules/core/schema/contact-request.js +22 -0
  26. package/dist/lib/modules/core/schema/conv-frames.js +94 -0
  27. package/dist/lib/modules/core/schema/conversation.js +67 -33
  28. package/dist/lib/modules/core/schema/envelope.js +8 -24
  29. package/dist/lib/modules/core/schema/errors.js +4 -3
  30. package/dist/lib/modules/core/schema/guest-invitation.js +13 -0
  31. package/dist/lib/modules/core/schema/index.js +5 -0
  32. package/dist/lib/modules/core/schema/ipc/consent.js +13 -9
  33. package/dist/lib/modules/core/schema/ipc/conversation-views.js +80 -0
  34. package/dist/lib/modules/core/schema/ipc/conversations.js +128 -0
  35. package/dist/lib/modules/core/schema/ipc/device.js +2 -0
  36. package/dist/lib/modules/core/schema/ipc/jelly.js +3 -38
  37. package/dist/lib/modules/core/schema/ipc/shapes.js +14 -72
  38. package/dist/lib/modules/core/schema/ipc/surfaces.js +12 -195
  39. package/dist/lib/modules/core/schema/ipc/tasks.js +31 -0
  40. package/dist/lib/modules/core/schema/ipc.js +18 -44
  41. package/dist/lib/modules/core/testing.js +1 -1
  42. package/dist/lib/modules/core/version.js +1 -1
  43. package/dist/lib/modules/ipc/client.js +10 -2
  44. package/dist/lib/modules/ipc/server.js +14 -5
  45. package/dist/lib/modules/ipc/testing.js +13 -23
  46. package/dist/spec/messaging-v1.md +546 -409
  47. package/dist/third-party-notices.md +1 -1
  48. package/dist/third-party.json +1 -1
  49. package/dist/types/core/agent/operations.d.ts +5 -52
  50. package/dist/types/core/agent/present.d.ts +6 -21
  51. package/dist/types/core/agent-tools.d.ts +263 -442
  52. package/dist/types/core/conversation/event.d.ts +6 -6
  53. package/dist/types/core/conversation/guest-invitation.d.ts +8 -0
  54. package/dist/types/core/conversation/log.d.ts +28 -13
  55. package/dist/types/core/conversation/request-log.d.ts +24 -0
  56. package/dist/types/core/conversation/request-seal.d.ts +6 -0
  57. package/dist/types/core/conversation/requests.d.ts +14 -0
  58. package/dist/types/core/conversation/seal.d.ts +32 -9
  59. package/dist/types/core/conversation-agent-tools.d.ts +918 -0
  60. package/dist/types/core/federation/directory-proof.d.ts +8 -0
  61. package/dist/types/core/federation/proof-state.d.ts +114 -0
  62. package/dist/types/core/federation/roster-proof.d.ts +7 -0
  63. package/dist/types/core/index.d.ts +10 -5
  64. package/dist/types/core/jelly-host.d.ts +1 -1
  65. package/dist/types/core/schema/common.d.ts +31 -6
  66. package/dist/types/core/schema/consent.d.ts +7 -7
  67. package/dist/types/core/schema/contact-request.d.ts +264 -0
  68. package/dist/types/core/schema/conv-frames.d.ts +1200 -0
  69. package/dist/types/core/schema/conversation.d.ts +1410 -264
  70. package/dist/types/core/schema/envelope.d.ts +83 -130
  71. package/dist/types/core/schema/errors.d.ts +3 -1
  72. package/dist/types/core/schema/guest-invitation.d.ts +51 -0
  73. package/dist/types/core/schema/index.d.ts +5 -0
  74. package/dist/types/core/schema/ipc/consent.d.ts +89 -49
  75. package/dist/types/core/schema/ipc/conversation-views.d.ts +1023 -0
  76. package/dist/types/core/schema/ipc/conversations.d.ts +3987 -0
  77. package/dist/types/core/schema/ipc/device.d.ts +4 -0
  78. package/dist/types/core/schema/ipc/jelly.d.ts +2 -105
  79. package/dist/types/core/schema/ipc/shapes.d.ts +13 -95
  80. package/dist/types/core/schema/ipc/surfaces.d.ts +25 -427
  81. package/dist/types/core/schema/ipc/tasks.d.ts +208 -0
  82. package/dist/types/core/schema/ipc.d.ts +2671 -525
  83. package/dist/types/core/schema/relay.d.ts +8 -4
  84. package/dist/types/core/testing.d.ts +1 -1
  85. package/dist/types/core/version.d.ts +1 -1
  86. package/dist/types/ipc/client.d.ts +4 -1
  87. package/dist/types/ipc/server.d.ts +10 -1
  88. package/dist/types/ipc/testing.d.ts +21 -8
  89. package/package.json +1 -1
@@ -0,0 +1,918 @@
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
+ stale_epoch: "stale_epoch";
264
+ device_limit: "device_limit";
265
+ admission_required: "admission_required";
266
+ admission_invalid: "admission_invalid";
267
+ directory_inconsistent: "directory_inconsistent";
268
+ unknown_device: "unknown_device";
269
+ directory_unavailable: "directory_unavailable";
270
+ login_unsupported: "login_unsupported";
271
+ login_denied: "login_denied";
272
+ grant_required: "grant_required";
273
+ grant_invalid: "grant_invalid";
274
+ ticket_required: "ticket_required";
275
+ ticket_invalid: "ticket_invalid";
276
+ daemon_unavailable: "daemon_unavailable";
277
+ daemon_mismatch: "daemon_mismatch";
278
+ store_refused: "store_refused";
279
+ internal: "internal";
280
+ }>>;
281
+ expect: z.ZodOptional<z.ZodEnum<{
282
+ kept: "kept";
283
+ wake: "wake";
284
+ next_turn: "next_turn";
285
+ next_prompt: "next_prompt";
286
+ on_read: "on_read";
287
+ offline: "offline";
288
+ on_consent: "on_consent";
289
+ }>>;
290
+ }, z.core.$strip>>;
291
+ note: z.ZodString;
292
+ }, z.core.$strip>, z.ZodObject<{
293
+ stage: z.ZodLiteral<"held">;
294
+ code: z.ZodEnum<{
295
+ audience: "audience";
296
+ context: "context";
297
+ }>;
298
+ expect: z.ZodLiteral<"on_consent">;
299
+ note: z.ZodString;
300
+ }, z.core.$strip>]>;
301
+ };
302
+ readonly inbox: {
303
+ readonly input: z.ZodObject<{
304
+ unread: z.ZodOptional<z.ZodBoolean>;
305
+ from: z.ZodOptional<z.ZodString>;
306
+ limit: z.ZodOptional<z.ZodNumber>;
307
+ }, z.core.$strict>;
308
+ readonly output: z.ZodObject<{
309
+ items: z.ZodArray<z.ZodObject<{
310
+ id: z.ZodString;
311
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
312
+ kind: z.ZodLiteral<"conv">;
313
+ cid: z.ZodString;
314
+ event: z.ZodString;
315
+ }, z.core.$strict>, z.ZodObject<{
316
+ kind: z.ZodLiteral<"task">;
317
+ taskId: z.ZodString;
318
+ }, z.core.$strict>], "kind">;
319
+ from: z.ZodString;
320
+ preview: z.ZodOptional<z.ZodString>;
321
+ at: z.ZodNumber;
322
+ stage: z.ZodEnum<{
323
+ delivered: "delivered";
324
+ handed_to_agent: "handed_to_agent";
325
+ read: "read";
326
+ }>;
327
+ consent: z.ZodEnum<{
328
+ self: "self";
329
+ guarded: "guarded";
330
+ trusted: "trusted";
331
+ }>;
332
+ chain: z.ZodOptional<z.ZodObject<{
333
+ path: z.ZodString;
334
+ depth: z.ZodNumber;
335
+ maxDepth: z.ZodNumber;
336
+ scope: z.ZodOptional<z.ZodString>;
337
+ }, z.core.$strip>>;
338
+ }, z.core.$strip>>;
339
+ unread: z.ZodNumber;
340
+ notice: z.ZodOptional<z.ZodString>;
341
+ }, z.core.$strip>;
342
+ };
343
+ readonly read: {
344
+ readonly input: z.ZodObject<{
345
+ cid: z.ZodOptional<z.ZodString>;
346
+ source: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
347
+ kind: z.ZodLiteral<"conv">;
348
+ cid: z.ZodString;
349
+ event: z.ZodString;
350
+ }, z.core.$strict>, z.ZodObject<{
351
+ kind: z.ZodLiteral<"task">;
352
+ taskId: z.ZodString;
353
+ }, z.core.$strict>], "kind">>;
354
+ id: z.ZodOptional<z.ZodString>;
355
+ offset: z.ZodOptional<z.ZodNumber>;
356
+ thread: z.ZodOptional<z.ZodString>;
357
+ before: z.ZodOptional<z.ZodString>;
358
+ after: z.ZodOptional<z.ZodString>;
359
+ limit: z.ZodOptional<z.ZodNumber>;
360
+ cursor: z.ZodOptional<z.ZodString>;
361
+ }, z.core.$strict>;
362
+ readonly output: z.ZodUnion<readonly [z.ZodObject<{
363
+ events: z.ZodArray<z.ZodObject<{
364
+ cite: z.ZodString;
365
+ cid: z.ZodString;
366
+ id: z.ZodString;
367
+ seq: z.ZodNumber;
368
+ at: z.ZodNumber;
369
+ conv: z.ZodObject<{
370
+ kind: z.ZodEnum<{
371
+ self: "self";
372
+ channel: "channel";
373
+ group: "group";
374
+ dm: "dm";
375
+ }>;
376
+ name: z.ZodOptional<z.ZodString>;
377
+ }, z.core.$strip>;
378
+ author: z.ZodObject<{
379
+ person: z.ZodString;
380
+ agent: z.ZodOptional<z.ZodString>;
381
+ of: z.ZodOptional<z.ZodString>;
382
+ side: z.ZodEnum<{
383
+ peer: "peer";
384
+ ours: "ours";
385
+ }>;
386
+ }, z.core.$strip>;
387
+ thread: z.ZodOptional<z.ZodString>;
388
+ text: z.ZodOptional<z.ZodString>;
389
+ truncated: z.ZodOptional<z.ZodBoolean>;
390
+ deleted: z.ZodOptional<z.ZodBoolean>;
391
+ nextOffset: z.ZodOptional<z.ZodNumber>;
392
+ }, z.core.$strip>>;
393
+ cursor: z.ZodOptional<z.ZodString>;
394
+ notice: z.ZodOptional<z.ZodString>;
395
+ }, z.core.$strip>, z.ZodObject<{
396
+ item: z.ZodUnion<readonly [z.ZodObject<{
397
+ id: z.ZodString;
398
+ source: z.ZodObject<{
399
+ kind: z.ZodLiteral<"conv">;
400
+ cid: z.ZodString;
401
+ event: z.ZodString;
402
+ }, z.core.$strict>;
403
+ event: z.ZodObject<{
404
+ cite: z.ZodString;
405
+ cid: z.ZodString;
406
+ id: z.ZodString;
407
+ seq: z.ZodNumber;
408
+ at: z.ZodNumber;
409
+ conv: z.ZodObject<{
410
+ kind: z.ZodEnum<{
411
+ self: "self";
412
+ channel: "channel";
413
+ group: "group";
414
+ dm: "dm";
415
+ }>;
416
+ name: z.ZodOptional<z.ZodString>;
417
+ }, z.core.$strip>;
418
+ author: z.ZodObject<{
419
+ person: z.ZodString;
420
+ agent: z.ZodOptional<z.ZodString>;
421
+ of: z.ZodOptional<z.ZodString>;
422
+ side: z.ZodEnum<{
423
+ peer: "peer";
424
+ ours: "ours";
425
+ }>;
426
+ }, z.core.$strip>;
427
+ thread: z.ZodOptional<z.ZodString>;
428
+ text: z.ZodOptional<z.ZodString>;
429
+ truncated: z.ZodOptional<z.ZodBoolean>;
430
+ deleted: z.ZodOptional<z.ZodBoolean>;
431
+ nextOffset: z.ZodOptional<z.ZodNumber>;
432
+ }, z.core.$strip>;
433
+ }, z.core.$strip>, z.ZodObject<{
434
+ id: z.ZodString;
435
+ source: z.ZodObject<{
436
+ kind: z.ZodLiteral<"task">;
437
+ taskId: z.ZodString;
438
+ }, z.core.$strict>;
439
+ kind: z.ZodEnum<{
440
+ task: "task";
441
+ continuation: "continuation";
442
+ }>;
443
+ from: z.ZodString;
444
+ at: z.ZodString;
445
+ parts: z.ZodArray<z.ZodObject<{
446
+ type: z.ZodEnum<{
447
+ file: "file";
448
+ text: "text";
449
+ url: "url";
450
+ data: "data";
451
+ }>;
452
+ author: z.ZodEnum<{
453
+ peer: "peer";
454
+ ours: "ours";
455
+ }>;
456
+ content: z.ZodString;
457
+ filename: z.ZodOptional<z.ZodString>;
458
+ mediaType: z.ZodOptional<z.ZodString>;
459
+ bytes: z.ZodOptional<z.ZodNumber>;
460
+ }, z.core.$strip>>;
461
+ verified: z.ZodOptional<z.ZodEnum<{
462
+ none: "none";
463
+ signature: "signature";
464
+ }>>;
465
+ replyTo: z.ZodOptional<z.ZodString>;
466
+ chain: z.ZodOptional<z.ZodObject<{
467
+ path: z.ZodString;
468
+ depth: z.ZodNumber;
469
+ maxDepth: z.ZodNumber;
470
+ scope: z.ZodOptional<z.ZodString>;
471
+ }, z.core.$strip>>;
472
+ task: z.ZodOptional<z.ZodObject<{
473
+ id: z.ZodString;
474
+ role: z.ZodEnum<{
475
+ mine: "mine";
476
+ asked: "asked";
477
+ }>;
478
+ counterpart: z.ZodString;
479
+ state: z.ZodEnum<{
480
+ rejected: "rejected";
481
+ failed: "failed";
482
+ submitted: "submitted";
483
+ working: "working";
484
+ completed: "completed";
485
+ canceled: "canceled";
486
+ input_required: "input_required";
487
+ auth_required: "auth_required";
488
+ }>;
489
+ title: z.ZodOptional<z.ZodString>;
490
+ titleAuthor: z.ZodOptional<z.ZodEnum<{
491
+ peer: "peer";
492
+ ours: "ours";
493
+ }>>;
494
+ status: z.ZodOptional<z.ZodString>;
495
+ statusAuthor: z.ZodOptional<z.ZodEnum<{
496
+ peer: "peer";
497
+ ours: "ours";
498
+ }>>;
499
+ createdAt: z.ZodString;
500
+ updatedAt: z.ZodString;
501
+ consent: z.ZodOptional<z.ZodEnum<{
502
+ self: "self";
503
+ guarded: "guarded";
504
+ trusted: "trusted";
505
+ }>>;
506
+ chain: z.ZodOptional<z.ZodObject<{
507
+ path: z.ZodString;
508
+ depth: z.ZodNumber;
509
+ maxDepth: z.ZodNumber;
510
+ scope: z.ZodOptional<z.ZodString>;
511
+ }, z.core.$strip>>;
512
+ history: z.ZodArray<z.ZodObject<{
513
+ from: z.ZodEnum<{
514
+ requester: "requester";
515
+ executor: "executor";
516
+ }>;
517
+ author: z.ZodEnum<{
518
+ peer: "peer";
519
+ ours: "ours";
520
+ }>;
521
+ parts: z.ZodArray<z.ZodObject<{
522
+ type: z.ZodEnum<{
523
+ file: "file";
524
+ text: "text";
525
+ url: "url";
526
+ data: "data";
527
+ }>;
528
+ author: z.ZodEnum<{
529
+ peer: "peer";
530
+ ours: "ours";
531
+ }>;
532
+ content: z.ZodString;
533
+ filename: z.ZodOptional<z.ZodString>;
534
+ mediaType: z.ZodOptional<z.ZodString>;
535
+ bytes: z.ZodOptional<z.ZodNumber>;
536
+ }, z.core.$strip>>;
537
+ }, z.core.$strip>>;
538
+ artifacts: z.ZodArray<z.ZodObject<{
539
+ author: z.ZodEnum<{
540
+ peer: "peer";
541
+ ours: "ours";
542
+ }>;
543
+ name: z.ZodOptional<z.ZodString>;
544
+ parts: z.ZodArray<z.ZodObject<{
545
+ type: z.ZodEnum<{
546
+ file: "file";
547
+ text: "text";
548
+ url: "url";
549
+ data: "data";
550
+ }>;
551
+ author: z.ZodEnum<{
552
+ peer: "peer";
553
+ ours: "ours";
554
+ }>;
555
+ content: z.ZodString;
556
+ filename: z.ZodOptional<z.ZodString>;
557
+ mediaType: z.ZodOptional<z.ZodString>;
558
+ bytes: z.ZodOptional<z.ZodNumber>;
559
+ }, z.core.$strip>>;
560
+ }, z.core.$strip>>;
561
+ followUps: z.ZodOptional<z.ZodArray<z.ZodObject<{
562
+ id: z.ZodString;
563
+ sentAt: z.ZodString;
564
+ stage: z.ZodEnum<{
565
+ accepted: "accepted";
566
+ relayed: "relayed";
567
+ delivered: "delivered";
568
+ held: "held";
569
+ handed_to_agent: "handed_to_agent";
570
+ read: "read";
571
+ replied: "replied";
572
+ rejected: "rejected";
573
+ expired: "expired";
574
+ }>;
575
+ read: z.ZodBoolean;
576
+ }, z.core.$strip>>>;
577
+ }, z.core.$strip>>;
578
+ }, z.core.$strip>]>;
579
+ notice: z.ZodOptional<z.ZodString>;
580
+ }, z.core.$strip>, z.ZodObject<{
581
+ stage: z.ZodLiteral<"held">;
582
+ code: z.ZodEnum<{
583
+ audience: "audience";
584
+ context: "context";
585
+ }>;
586
+ expect: z.ZodLiteral<"on_consent">;
587
+ note: z.ZodString;
588
+ }, z.core.$strip>]>;
589
+ };
590
+ readonly search: {
591
+ readonly input: z.ZodObject<{
592
+ query: z.ZodString;
593
+ cid: z.ZodOptional<z.ZodString>;
594
+ from: z.ZodOptional<z.ZodString>;
595
+ after: z.ZodOptional<z.ZodNumber>;
596
+ before: z.ZodOptional<z.ZodNumber>;
597
+ thread: z.ZodOptional<z.ZodString>;
598
+ limit: z.ZodOptional<z.ZodNumber>;
599
+ cursor: z.ZodOptional<z.ZodString>;
600
+ }, z.core.$strict>;
601
+ readonly output: z.ZodUnion<readonly [z.ZodObject<{
602
+ events: z.ZodArray<z.ZodObject<{
603
+ cite: z.ZodString;
604
+ cid: z.ZodString;
605
+ id: z.ZodString;
606
+ seq: z.ZodNumber;
607
+ at: z.ZodNumber;
608
+ conv: z.ZodObject<{
609
+ kind: z.ZodEnum<{
610
+ self: "self";
611
+ channel: "channel";
612
+ group: "group";
613
+ dm: "dm";
614
+ }>;
615
+ name: z.ZodOptional<z.ZodString>;
616
+ }, z.core.$strip>;
617
+ author: z.ZodObject<{
618
+ person: z.ZodString;
619
+ agent: z.ZodOptional<z.ZodString>;
620
+ of: z.ZodOptional<z.ZodString>;
621
+ side: z.ZodEnum<{
622
+ peer: "peer";
623
+ ours: "ours";
624
+ }>;
625
+ }, z.core.$strip>;
626
+ thread: z.ZodOptional<z.ZodString>;
627
+ text: z.ZodOptional<z.ZodString>;
628
+ truncated: z.ZodOptional<z.ZodBoolean>;
629
+ deleted: z.ZodOptional<z.ZodBoolean>;
630
+ nextOffset: z.ZodOptional<z.ZodNumber>;
631
+ }, z.core.$strip>>;
632
+ cursor: z.ZodOptional<z.ZodString>;
633
+ notice: z.ZodOptional<z.ZodString>;
634
+ }, z.core.$strip>, z.ZodObject<{
635
+ stage: z.ZodLiteral<"held">;
636
+ code: z.ZodEnum<{
637
+ audience: "audience";
638
+ context: "context";
639
+ }>;
640
+ expect: z.ZodLiteral<"on_consent">;
641
+ note: z.ZodString;
642
+ }, z.core.$strip>]>;
643
+ };
644
+ readonly context: {
645
+ readonly input: z.ZodObject<{
646
+ cid: z.ZodString;
647
+ event: z.ZodString;
648
+ before: z.ZodOptional<z.ZodNumber>;
649
+ after: z.ZodOptional<z.ZodNumber>;
650
+ }, z.core.$strict>;
651
+ readonly output: z.ZodUnion<readonly [z.ZodObject<{
652
+ event: z.ZodObject<{
653
+ cite: z.ZodString;
654
+ cid: z.ZodString;
655
+ id: z.ZodString;
656
+ seq: z.ZodNumber;
657
+ at: z.ZodNumber;
658
+ conv: z.ZodObject<{
659
+ kind: z.ZodEnum<{
660
+ self: "self";
661
+ channel: "channel";
662
+ group: "group";
663
+ dm: "dm";
664
+ }>;
665
+ name: z.ZodOptional<z.ZodString>;
666
+ }, z.core.$strip>;
667
+ author: z.ZodObject<{
668
+ person: z.ZodString;
669
+ agent: z.ZodOptional<z.ZodString>;
670
+ of: z.ZodOptional<z.ZodString>;
671
+ side: z.ZodEnum<{
672
+ peer: "peer";
673
+ ours: "ours";
674
+ }>;
675
+ }, z.core.$strip>;
676
+ thread: z.ZodOptional<z.ZodString>;
677
+ text: z.ZodOptional<z.ZodString>;
678
+ truncated: z.ZodOptional<z.ZodBoolean>;
679
+ deleted: z.ZodOptional<z.ZodBoolean>;
680
+ nextOffset: z.ZodOptional<z.ZodNumber>;
681
+ }, z.core.$strip>;
682
+ before: z.ZodArray<z.ZodObject<{
683
+ cite: z.ZodString;
684
+ cid: z.ZodString;
685
+ id: z.ZodString;
686
+ seq: z.ZodNumber;
687
+ at: z.ZodNumber;
688
+ conv: z.ZodObject<{
689
+ kind: z.ZodEnum<{
690
+ self: "self";
691
+ channel: "channel";
692
+ group: "group";
693
+ dm: "dm";
694
+ }>;
695
+ name: z.ZodOptional<z.ZodString>;
696
+ }, z.core.$strip>;
697
+ author: z.ZodObject<{
698
+ person: z.ZodString;
699
+ agent: z.ZodOptional<z.ZodString>;
700
+ of: z.ZodOptional<z.ZodString>;
701
+ side: z.ZodEnum<{
702
+ peer: "peer";
703
+ ours: "ours";
704
+ }>;
705
+ }, z.core.$strip>;
706
+ thread: z.ZodOptional<z.ZodString>;
707
+ text: z.ZodOptional<z.ZodString>;
708
+ truncated: z.ZodOptional<z.ZodBoolean>;
709
+ deleted: z.ZodOptional<z.ZodBoolean>;
710
+ nextOffset: z.ZodOptional<z.ZodNumber>;
711
+ }, z.core.$strip>>;
712
+ after: z.ZodArray<z.ZodObject<{
713
+ cite: z.ZodString;
714
+ cid: z.ZodString;
715
+ id: z.ZodString;
716
+ seq: z.ZodNumber;
717
+ at: z.ZodNumber;
718
+ conv: z.ZodObject<{
719
+ kind: z.ZodEnum<{
720
+ self: "self";
721
+ channel: "channel";
722
+ group: "group";
723
+ dm: "dm";
724
+ }>;
725
+ name: z.ZodOptional<z.ZodString>;
726
+ }, z.core.$strip>;
727
+ author: z.ZodObject<{
728
+ person: z.ZodString;
729
+ agent: z.ZodOptional<z.ZodString>;
730
+ of: z.ZodOptional<z.ZodString>;
731
+ side: z.ZodEnum<{
732
+ peer: "peer";
733
+ ours: "ours";
734
+ }>;
735
+ }, z.core.$strip>;
736
+ thread: z.ZodOptional<z.ZodString>;
737
+ text: z.ZodOptional<z.ZodString>;
738
+ truncated: z.ZodOptional<z.ZodBoolean>;
739
+ deleted: z.ZodOptional<z.ZodBoolean>;
740
+ nextOffset: z.ZodOptional<z.ZodNumber>;
741
+ }, z.core.$strip>>;
742
+ root: z.ZodOptional<z.ZodObject<{
743
+ cite: z.ZodString;
744
+ cid: z.ZodString;
745
+ id: z.ZodString;
746
+ seq: z.ZodNumber;
747
+ at: z.ZodNumber;
748
+ conv: z.ZodObject<{
749
+ kind: z.ZodEnum<{
750
+ self: "self";
751
+ channel: "channel";
752
+ group: "group";
753
+ dm: "dm";
754
+ }>;
755
+ name: z.ZodOptional<z.ZodString>;
756
+ }, z.core.$strip>;
757
+ author: z.ZodObject<{
758
+ person: z.ZodString;
759
+ agent: z.ZodOptional<z.ZodString>;
760
+ of: z.ZodOptional<z.ZodString>;
761
+ side: z.ZodEnum<{
762
+ peer: "peer";
763
+ ours: "ours";
764
+ }>;
765
+ }, z.core.$strip>;
766
+ thread: z.ZodOptional<z.ZodString>;
767
+ text: z.ZodOptional<z.ZodString>;
768
+ truncated: z.ZodOptional<z.ZodBoolean>;
769
+ deleted: z.ZodOptional<z.ZodBoolean>;
770
+ nextOffset: z.ZodOptional<z.ZodNumber>;
771
+ }, z.core.$strip>>;
772
+ notice: z.ZodOptional<z.ZodString>;
773
+ }, z.core.$strip>, z.ZodObject<{
774
+ stage: z.ZodLiteral<"held">;
775
+ code: z.ZodEnum<{
776
+ audience: "audience";
777
+ context: "context";
778
+ }>;
779
+ expect: z.ZodLiteral<"on_consent">;
780
+ note: z.ZodString;
781
+ }, z.core.$strip>]>;
782
+ };
783
+ readonly tasks: {
784
+ readonly input: z.ZodObject<{
785
+ role: z.ZodOptional<z.ZodEnum<{
786
+ mine: "mine";
787
+ asked: "asked";
788
+ }>>;
789
+ state: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
790
+ done: "done";
791
+ open: "open";
792
+ }>, z.ZodEnum<{
793
+ rejected: "rejected";
794
+ failed: "failed";
795
+ submitted: "submitted";
796
+ working: "working";
797
+ completed: "completed";
798
+ canceled: "canceled";
799
+ input_required: "input_required";
800
+ auth_required: "auth_required";
801
+ }>]>>;
802
+ limit: z.ZodOptional<z.ZodNumber>;
803
+ cursor: z.ZodOptional<z.ZodString>;
804
+ }, z.core.$strict>;
805
+ readonly output: z.ZodObject<{
806
+ tasks: z.ZodArray<z.ZodObject<{
807
+ role: z.ZodEnum<{
808
+ mine: "mine";
809
+ asked: "asked";
810
+ }>;
811
+ state: z.ZodEnum<{
812
+ rejected: "rejected";
813
+ failed: "failed";
814
+ submitted: "submitted";
815
+ working: "working";
816
+ completed: "completed";
817
+ canceled: "canceled";
818
+ input_required: "input_required";
819
+ auth_required: "auth_required";
820
+ }>;
821
+ status: z.ZodOptional<z.ZodString>;
822
+ id: z.ZodString;
823
+ chain: z.ZodOptional<z.ZodObject<{
824
+ path: z.ZodString;
825
+ depth: z.ZodNumber;
826
+ maxDepth: z.ZodNumber;
827
+ scope: z.ZodOptional<z.ZodString>;
828
+ }, z.core.$strip>>;
829
+ consent: z.ZodOptional<z.ZodEnum<{
830
+ self: "self";
831
+ guarded: "guarded";
832
+ trusted: "trusted";
833
+ }>>;
834
+ updatedAt: z.ZodString;
835
+ title: z.ZodOptional<z.ZodString>;
836
+ counterpart: z.ZodString;
837
+ titleAuthor: z.ZodOptional<z.ZodEnum<{
838
+ peer: "peer";
839
+ ours: "ours";
840
+ }>>;
841
+ statusAuthor: z.ZodOptional<z.ZodEnum<{
842
+ peer: "peer";
843
+ ours: "ours";
844
+ }>>;
845
+ }, z.core.$strip>>;
846
+ nextCursor: z.ZodOptional<z.ZodString>;
847
+ total: z.ZodNumber;
848
+ notice: z.ZodOptional<z.ZodString>;
849
+ }, z.core.$strip>;
850
+ };
851
+ readonly task_update: {
852
+ readonly input: z.ZodObject<{
853
+ id: z.ZodString;
854
+ state: z.ZodEnum<{
855
+ rejected: "rejected";
856
+ failed: "failed";
857
+ working: "working";
858
+ completed: "completed";
859
+ input_required: "input_required";
860
+ }>;
861
+ text: z.ZodOptional<z.ZodString>;
862
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
863
+ name: z.ZodString;
864
+ mime: z.ZodString;
865
+ data: z.ZodString;
866
+ }, z.core.$strict>>>;
867
+ }, z.core.$strict>;
868
+ readonly output: z.ZodObject<{
869
+ id: z.ZodString;
870
+ state: z.ZodEnum<{
871
+ rejected: "rejected";
872
+ failed: "failed";
873
+ submitted: "submitted";
874
+ working: "working";
875
+ completed: "completed";
876
+ canceled: "canceled";
877
+ input_required: "input_required";
878
+ auth_required: "auth_required";
879
+ }>;
880
+ stage: z.ZodEnum<{
881
+ accepted: "accepted";
882
+ relayed: "relayed";
883
+ delivered: "delivered";
884
+ held: "held";
885
+ handed_to_agent: "handed_to_agent";
886
+ read: "read";
887
+ replied: "replied";
888
+ rejected: "rejected";
889
+ expired: "expired";
890
+ }>;
891
+ to: z.ZodString;
892
+ }, z.core.$strip>;
893
+ };
894
+ readonly task_cancel: {
895
+ readonly input: z.ZodObject<{
896
+ id: z.ZodString;
897
+ reason: z.ZodOptional<z.ZodString>;
898
+ }, z.core.$strict>;
899
+ readonly output: z.ZodObject<{
900
+ id: z.ZodString;
901
+ state: z.ZodEnum<{
902
+ rejected: "rejected";
903
+ failed: "failed";
904
+ submitted: "submitted";
905
+ working: "working";
906
+ completed: "completed";
907
+ canceled: "canceled";
908
+ input_required: "input_required";
909
+ auth_required: "auth_required";
910
+ }>;
911
+ to: z.ZodString;
912
+ }, z.core.$strip>;
913
+ };
914
+ };
915
+ export type ConversationToolVerb = keyof typeof ConversationTools;
916
+ export declare const CONVERSATION_TOOL_VERBS: readonly ["contacts", "conversations", "send", "inbox", "read", "search", "context", "tasks", "task_update", "task_cancel"];
917
+ export type ConversationToolInput<V extends ConversationToolVerb> = z.output<(typeof ConversationTools)[V]["input"]>;
918
+ export type ConversationToolOutput<V extends ConversationToolVerb> = z.output<(typeof ConversationTools)[V]["output"]>;