@joe-broadhead/messaging 0.7.0 → 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 (97) hide show
  1. package/CHANGELOG.md +259 -2
  2. package/dist/bin/messaging-mcp.js +5484 -3858
  3. package/dist/bin/messaging-relay.js +4728 -1136
  4. package/dist/bin/messaging.js +4616 -2807
  5. package/dist/bin/messagingd.js +16451 -9444
  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 +46 -143
  9. package/dist/lib/modules/core/consent.js +1 -1
  10. package/dist/lib/modules/core/conversation/context.js +80 -0
  11. package/dist/lib/modules/core/conversation/event.js +125 -0
  12. package/dist/lib/modules/core/conversation/guest-invitation.js +42 -0
  13. package/dist/lib/modules/core/conversation/ids.js +38 -0
  14. package/dist/lib/modules/core/conversation/link.js +35 -0
  15. package/dist/lib/modules/core/conversation/log.js +988 -0
  16. package/dist/lib/modules/core/conversation/ratchet.js +243 -0
  17. package/dist/lib/modules/core/conversation/request-log.js +158 -0
  18. package/dist/lib/modules/core/conversation/request-seal.js +41 -0
  19. package/dist/lib/modules/core/conversation/requests.js +87 -0
  20. package/dist/lib/modules/core/conversation/seal.js +251 -0
  21. package/dist/lib/modules/core/conversation-agent-tools.js +69 -0
  22. package/dist/lib/modules/core/federation/directory-proof.js +83 -0
  23. package/dist/lib/modules/core/federation/proof-state.js +167 -0
  24. package/dist/lib/modules/core/federation/roster-proof.js +74 -0
  25. package/dist/lib/modules/core/index.js +16 -2
  26. package/dist/lib/modules/core/jelly-host.js +5 -5
  27. package/dist/lib/modules/core/schema/common.js +85 -3
  28. package/dist/lib/modules/core/schema/consent.js +5 -4
  29. package/dist/lib/modules/core/schema/contact-request.js +22 -0
  30. package/dist/lib/modules/core/schema/conv-frames.js +94 -0
  31. package/dist/lib/modules/core/schema/conversation.js +326 -0
  32. package/dist/lib/modules/core/schema/envelope.js +8 -24
  33. package/dist/lib/modules/core/schema/errors.js +42 -2
  34. package/dist/lib/modules/core/schema/guest-invitation.js +13 -0
  35. package/dist/lib/modules/core/schema/index.js +6 -0
  36. package/dist/lib/modules/core/schema/ipc/consent.js +13 -9
  37. package/dist/lib/modules/core/schema/ipc/conversation-views.js +80 -0
  38. package/dist/lib/modules/core/schema/ipc/conversations.js +128 -0
  39. package/dist/lib/modules/core/schema/ipc/device.js +2 -0
  40. package/dist/lib/modules/core/schema/ipc/jelly.js +3 -38
  41. package/dist/lib/modules/core/schema/ipc/shapes.js +14 -72
  42. package/dist/lib/modules/core/schema/ipc/surfaces.js +12 -195
  43. package/dist/lib/modules/core/schema/ipc/tasks.js +31 -0
  44. package/dist/lib/modules/core/schema/ipc.js +18 -44
  45. package/dist/lib/modules/core/testing.js +1 -0
  46. package/dist/lib/modules/core/version.js +1 -1
  47. package/dist/lib/modules/ipc/client.js +10 -2
  48. package/dist/lib/modules/ipc/server.js +14 -5
  49. package/dist/lib/modules/ipc/testing.js +13 -23
  50. package/dist/spec/messaging-v1.md +835 -380
  51. package/dist/third-party-notices.md +1 -1
  52. package/dist/third-party.json +1 -1
  53. package/dist/types/core/agent/operations.d.ts +5 -52
  54. package/dist/types/core/agent/present.d.ts +6 -21
  55. package/dist/types/core/agent-tools.d.ts +277 -438
  56. package/dist/types/core/conversation/context.d.ts +56 -0
  57. package/dist/types/core/conversation/event.d.ts +36 -0
  58. package/dist/types/core/conversation/guest-invitation.d.ts +8 -0
  59. package/dist/types/core/conversation/ids.d.ts +18 -0
  60. package/dist/types/core/conversation/link.d.ts +16 -0
  61. package/dist/types/core/conversation/log.d.ts +157 -0
  62. package/dist/types/core/conversation/ratchet.d.ts +95 -0
  63. package/dist/types/core/conversation/request-log.d.ts +24 -0
  64. package/dist/types/core/conversation/request-seal.d.ts +6 -0
  65. package/dist/types/core/conversation/requests.d.ts +14 -0
  66. package/dist/types/core/conversation/seal.d.ts +70 -0
  67. package/dist/types/core/conversation-agent-tools.d.ts +918 -0
  68. package/dist/types/core/federation/directory-proof.d.ts +8 -0
  69. package/dist/types/core/federation/proof-state.d.ts +114 -0
  70. package/dist/types/core/federation/roster-proof.d.ts +7 -0
  71. package/dist/types/core/index.d.ts +15 -3
  72. package/dist/types/core/jelly-host.d.ts +1 -1
  73. package/dist/types/core/schema/common.d.ts +85 -4
  74. package/dist/types/core/schema/consent.d.ts +7 -7
  75. package/dist/types/core/schema/contact-request.d.ts +264 -0
  76. package/dist/types/core/schema/conv-frames.d.ts +1200 -0
  77. package/dist/types/core/schema/conversation.d.ts +2803 -0
  78. package/dist/types/core/schema/envelope.d.ts +89 -130
  79. package/dist/types/core/schema/errors.d.ts +40 -0
  80. package/dist/types/core/schema/guest-invitation.d.ts +51 -0
  81. package/dist/types/core/schema/index.d.ts +6 -0
  82. package/dist/types/core/schema/ipc/consent.d.ts +89 -49
  83. package/dist/types/core/schema/ipc/conversation-views.d.ts +1023 -0
  84. package/dist/types/core/schema/ipc/conversations.d.ts +3987 -0
  85. package/dist/types/core/schema/ipc/device.d.ts +10 -0
  86. package/dist/types/core/schema/ipc/jelly.d.ts +2 -105
  87. package/dist/types/core/schema/ipc/shapes.d.ts +16 -95
  88. package/dist/types/core/schema/ipc/surfaces.d.ts +28 -424
  89. package/dist/types/core/schema/ipc/tasks.d.ts +208 -0
  90. package/dist/types/core/schema/ipc.d.ts +2684 -523
  91. package/dist/types/core/schema/relay.d.ts +20 -4
  92. package/dist/types/core/testing.d.ts +1 -0
  93. package/dist/types/core/version.d.ts +1 -1
  94. package/dist/types/ipc/client.d.ts +4 -1
  95. package/dist/types/ipc/server.d.ts +10 -1
  96. package/dist/types/ipc/testing.d.ts +21 -8
  97. package/package.json +1 -1
@@ -1,40 +1,18 @@
1
- /**
2
- * The local API's surface methods (spec §8.2; design §7.5): what agents reach through their tools
3
- * and what people reach through the CLI and the TUI, by conversation.
4
- *
5
- * - Agent tier (`run/agent.sock`): `contacts.list`, `msg.send`, `item.read`, `conv.read`, `search`.
6
- * - Human tier (`run/admin.sock`): `conv.list`, `conv.read`, `conv.markRead`, `conv.subscribe`,
7
- * `person.send`, `people.search`, `people.get`.
8
- *
9
- * A conversation is named by a `ConversationRef`: `dm:<person>` (this person's DM with another),
10
- * `channel:<name>` (a channel this person is in, by its local name) or `agent:<person>/<agent>`
11
- * (a local session's mail and tasks with that agent, on any of the person's devices).
12
- */
1
+ /** Discovery and task-envelope reads. Conversation methods live in conversations.ts. */
13
2
  import { z } from "zod";
14
- /** A conversation: `dm:<person>`, `channel:<name>` or `agent:<person>/<agent>`. */
15
- export declare const ConversationRef: z.ZodString;
16
- export type ConversationRef = z.infer<typeof ConversationRef>;
17
- /** A place in a conversation: a line's `seq` in a DM or a channel, an entry's `{at, id}` with an agent. */
18
- export declare const ConvPlace: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
19
- at: z.ZodNumber;
20
- id: z.ZodString;
21
- }, z.core.$strict>]>;
22
- export type ConvPlace = z.infer<typeof ConvPlace>;
23
- /** One conversation this person has (DMs with lines, channels it is in) and this device's read state. */
24
- export declare const ConvSummary: z.ZodObject<{
25
- conversation: z.ZodString;
3
+ /** Verified discovery metadata, without transcript or read-state placeholders. */
4
+ export declare const ContactConversation: z.ZodObject<{
5
+ cid: z.ZodString;
26
6
  kind: z.ZodEnum<{
7
+ self: "self";
27
8
  channel: "channel";
9
+ group: "group";
28
10
  dm: "dm";
29
11
  }>;
30
- lastAt: z.ZodOptional<z.ZodNumber>;
31
12
  name: z.ZodOptional<z.ZodString>;
32
- lastSeq: z.ZodOptional<z.ZodNumber>;
33
- readUpTo: z.ZodNumber;
34
- unread: z.ZodNumber;
35
- }, z.core.$strip>;
36
- export type ConvSummary = z.infer<typeof ConvSummary>;
37
- /** A person of the realm, as verified (a roster realm: a team person). */
13
+ dmWith: z.ZodOptional<z.ZodString>;
14
+ }, z.core.$strict>;
15
+ export type ContactConversation = z.infer<typeof ContactConversation>;
38
16
  export declare const PersonSummary: z.ZodObject<{
39
17
  person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
40
18
  name: z.ZodString;
@@ -53,20 +31,11 @@ export declare const PersonSummary: z.ZodObject<{
53
31
  }, z.core.$strip>;
54
32
  export type PersonSummary = z.infer<typeof PersonSummary>;
55
33
  export declare const SURFACE_METHODS: {
56
- /**
57
- * Agent tier. Who this session can reach: every known agent session (`entries`, as `directory.list`
58
- * did in 0.1), and this person's conversations with their read state (`conversations`, as
59
- * `conv.list` returns them).
60
- */
61
34
  readonly "contacts.list": {
62
35
  readonly params: z.ZodObject<{
63
36
  person: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
64
37
  includeOffline: z.ZodOptional<z.ZodBoolean>;
65
38
  }, z.core.$strict>;
66
- /**
67
- * `reach`: for each other person among `entries` and the DMs, and each person whose card this device holds, what they may
68
- * be sent, from their card or the defaults of the relation (spec §6.9, "Contact cards").
69
- */
70
39
  readonly result: z.ZodObject<{
71
40
  entries: z.ZodArray<z.ZodObject<{
72
41
  address: z.ZodString;
@@ -91,33 +60,32 @@ export declare const SURFACE_METHODS: {
91
60
  self: z.ZodBoolean;
92
61
  expect: z.ZodOptional<z.ZodEnum<{
93
62
  kept: "kept";
94
- next_turn: "next_turn";
95
63
  wake: "wake";
64
+ next_turn: "next_turn";
96
65
  next_prompt: "next_prompt";
97
66
  on_read: "on_read";
98
67
  offline: "offline";
99
68
  }>>;
100
69
  }, z.core.$strip>>;
101
70
  conversations: z.ZodArray<z.ZodObject<{
102
- conversation: z.ZodString;
71
+ cid: z.ZodString;
103
72
  kind: z.ZodEnum<{
73
+ self: "self";
104
74
  channel: "channel";
75
+ group: "group";
105
76
  dm: "dm";
106
77
  }>;
107
- lastAt: z.ZodOptional<z.ZodNumber>;
108
78
  name: z.ZodOptional<z.ZodString>;
109
- lastSeq: z.ZodOptional<z.ZodNumber>;
110
- readUpTo: z.ZodNumber;
111
- unread: z.ZodNumber;
112
- }, z.core.$strip>>;
79
+ dmWith: z.ZodOptional<z.ZodString>;
80
+ }, z.core.$strict>>;
113
81
  reach: z.ZodArray<z.ZodObject<{
114
82
  person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
115
83
  can: z.ZodObject<{
116
84
  chat: z.ZodBoolean;
117
85
  agentMail: z.ZodBoolean;
118
86
  ask: z.ZodEnum<{
119
- open: "open";
120
87
  request: "request";
88
+ open: "open";
121
89
  no: "no";
122
90
  }>;
123
91
  trustedUntil: z.ZodOptional<z.ZodNumber>;
@@ -131,130 +99,12 @@ export declare const SURFACE_METHODS: {
131
99
  }, z.core.$strip>>;
132
100
  }, z.core.$strip>;
133
101
  };
134
- /**
135
- * Agent tier. One send from the session `key` (spec §8.2): mail or a task to an agent
136
- * (`person/agent[@label]`), a line to a person (`<person>`), or a post to a channel (`#<channel>`).
137
- * A line or a post is attributed to the session; it takes one text part of at most
138
- * `LIMITS.chatChars`, `kind: "message"`, and `replyTo` as the thread (the thread's first line),
139
- * and none of the A2A fields. `idempotencyKey` makes any send idempotent.
140
- */
141
- readonly "msg.send": {
142
- readonly params: z.ZodObject<{
143
- key: z.ZodString;
144
- to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
145
- kind: z.ZodEnum<{
146
- message: "message";
147
- task: "task";
148
- }>;
149
- parts: z.ZodArray<z.ZodObject<{
150
- text: z.ZodOptional<z.ZodString>;
151
- raw: z.ZodOptional<z.ZodString>;
152
- url: z.ZodOptional<z.ZodString>;
153
- data: z.ZodOptional<z.ZodUnknown>;
154
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
155
- filename: z.ZodOptional<z.ZodString>;
156
- mediaType: z.ZodOptional<z.ZodString>;
157
- }, z.core.$strip>>;
158
- contextId: z.ZodOptional<z.ZodString>;
159
- taskId: z.ZodOptional<z.ZodString>;
160
- replyTo: z.ZodOptional<z.ZodString>;
161
- idempotencyKey: z.ZodOptional<z.ZodString>;
162
- messageId: z.ZodOptional<z.ZodString>;
163
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
164
- extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
165
- referenceTaskIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
166
- wake: z.ZodOptional<z.ZodBoolean>;
167
- request: z.ZodOptional<z.ZodObject<{
168
- contact: z.ZodString;
169
- }, z.core.$strict>>;
170
- onBehalfOf: z.ZodOptional<z.ZodObject<{
171
- taskId: z.ZodString;
172
- scope: z.ZodOptional<z.ZodArray<z.ZodString>>;
173
- maxDepth: z.ZodOptional<z.ZodNumber>;
174
- }, z.core.$strict>>;
175
- }, z.core.$strict>;
176
- readonly result: z.ZodObject<{
177
- results: z.ZodArray<z.ZodObject<{
178
- to: z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>;
179
- envelopeId: z.ZodString;
180
- messageId: z.ZodString;
181
- taskId: z.ZodOptional<z.ZodString>;
182
- contextId: z.ZodString;
183
- stage: z.ZodEnum<{
184
- accepted: "accepted";
185
- relayed: "relayed";
186
- delivered: "delivered";
187
- held: "held";
188
- handed_to_agent: "handed_to_agent";
189
- read: "read";
190
- replied: "replied";
191
- rejected: "rejected";
192
- expired: "expired";
193
- }>;
194
- code: z.ZodOptional<z.ZodEnum<{
195
- expired: "expired";
196
- invalid_request: "invalid_request";
197
- not_member: "not_member";
198
- bad_signature: "bad_signature";
199
- unknown_session: "unknown_session";
200
- ambiguous_address: "ambiguous_address";
201
- no_recipients: "no_recipients";
202
- unknown_address: "unknown_address";
203
- refused: "refused";
204
- declined: "declined";
205
- request_required: "request_required";
206
- rate_limited: "rate_limited";
207
- loop_guard: "loop_guard";
208
- too_large: "too_large";
209
- secret_refused: "secret_refused";
210
- duplicate: "duplicate";
211
- relay_unavailable: "relay_unavailable";
212
- not_found: "not_found";
213
- invalid_state: "invalid_state";
214
- forbidden: "forbidden";
215
- guarded_turn: "guarded_turn";
216
- roster_conflict: "roster_conflict";
217
- invite_invalid: "invite_invalid";
218
- no_identity: "no_identity";
219
- binding_invalid: "binding_invalid";
220
- jelly_unavailable: "jelly_unavailable";
221
- log_conflict: "log_conflict";
222
- device_limit: "device_limit";
223
- admission_required: "admission_required";
224
- admission_invalid: "admission_invalid";
225
- directory_inconsistent: "directory_inconsistent";
226
- unknown_device: "unknown_device";
227
- directory_unavailable: "directory_unavailable";
228
- login_unsupported: "login_unsupported";
229
- login_denied: "login_denied";
230
- grant_required: "grant_required";
231
- grant_invalid: "grant_invalid";
232
- ticket_required: "ticket_required";
233
- ticket_invalid: "ticket_invalid";
234
- daemon_unavailable: "daemon_unavailable";
235
- daemon_mismatch: "daemon_mismatch";
236
- internal: "internal";
237
- }>>;
238
- expect: z.ZodOptional<z.ZodEnum<{
239
- kept: "kept";
240
- next_turn: "next_turn";
241
- wake: "wake";
242
- next_prompt: "next_prompt";
243
- on_read: "on_read";
244
- offline: "offline";
245
- }>>;
246
- }, z.core.$strip>>;
247
- }, z.core.$strip>;
248
- };
249
- /**
250
- * Agent tier. One item of the session `key` by id: something it received (`received`: returns the
251
- * full message, marks it read and sends a read receipt, as `inbox.read` did in 0.1), or something
252
- * it sent to an agent (`sent`: how far it got, as `message.status` did). `not_found` otherwise.
253
- */
102
+ /** A received item, or the delivery records of a sent task envelope. */
254
103
  readonly "item.read": {
255
104
  readonly params: z.ZodObject<{
256
105
  key: z.ZodString;
257
106
  id: z.ZodString;
107
+ cid: z.ZodOptional<z.ZodString>;
258
108
  }, z.core.$strict>;
259
109
  readonly result: z.ZodDiscriminatedUnion<[z.ZodObject<{
260
110
  kind: z.ZodLiteral<"received">;
@@ -262,12 +112,14 @@ export declare const SURFACE_METHODS: {
262
112
  id: z.ZodString;
263
113
  key: z.ZodString;
264
114
  from: z.ZodObject<{
265
- address: z.ZodString;
266
115
  person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
267
116
  agent: z.ZodOptional<z.ZodString>;
268
- device: z.ZodString;
269
- label: z.ZodString;
117
+ address: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
118
+ device: z.ZodOptional<z.ZodString>;
119
+ label: z.ZodOptional<z.ZodString>;
270
120
  }, z.core.$strip>;
121
+ cid: z.ZodOptional<z.ZodString>;
122
+ eventId: z.ZodOptional<z.ZodString>;
271
123
  kind: z.ZodEnum<{
272
124
  message: "message";
273
125
  task: "task";
@@ -322,7 +174,7 @@ export declare const SURFACE_METHODS: {
322
174
  }, z.core.$strip>, z.ZodObject<{
323
175
  kind: z.ZodLiteral<"sent">;
324
176
  envelopeId: z.ZodString;
325
- to: z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>;
177
+ to: z.ZodString;
326
178
  stage: z.ZodEnum<{
327
179
  accepted: "accepted";
328
180
  relayed: "relayed";
@@ -359,6 +211,7 @@ export declare const SURFACE_METHODS: {
359
211
  refused: "refused";
360
212
  declined: "declined";
361
213
  request_required: "request_required";
214
+ peer_outdated: "peer_outdated";
362
215
  rate_limited: "rate_limited";
363
216
  loop_guard: "loop_guard";
364
217
  too_large: "too_large";
@@ -375,6 +228,8 @@ export declare const SURFACE_METHODS: {
375
228
  binding_invalid: "binding_invalid";
376
229
  jelly_unavailable: "jelly_unavailable";
377
230
  log_conflict: "log_conflict";
231
+ conv_conflict: "conv_conflict";
232
+ stale_epoch: "stale_epoch";
378
233
  device_limit: "device_limit";
379
234
  admission_required: "admission_required";
380
235
  admission_invalid: "admission_invalid";
@@ -389,208 +244,13 @@ export declare const SURFACE_METHODS: {
389
244
  ticket_invalid: "ticket_invalid";
390
245
  daemon_unavailable: "daemon_unavailable";
391
246
  daemon_mismatch: "daemon_mismatch";
247
+ store_refused: "store_refused";
392
248
  internal: "internal";
393
249
  }>>;
394
250
  note: z.ZodOptional<z.ZodString>;
395
251
  }, z.core.$strip>>;
396
252
  }, z.core.$strip>], "kind">;
397
253
  };
398
- /**
399
- * Agent and human tiers. A page of one conversation, oldest first. With no cursor, the latest
400
- * `limit` (default 30 with an agent, 50 in a DM or a channel); with `before`, the latest `limit`
401
- * before that place; with `after`, the earliest `limit` after it. `more`: entries remain past the
402
- * page in the direction read. Changes no stage and sends no receipt.
403
- * - `dm:` and `channel:` give `lines`; `thread` narrows to a thread's first line and its replies;
404
- * the cursor is a line's `seq`.
405
- * - `agent:<person>/<agent>` needs the session `key` and gives `entries`: mail either way and tasks
406
- * either way between that session and the agent; the cursor is an entry's `{at, id}`.
407
- */
408
- readonly "conv.read": {
409
- readonly params: z.ZodObject<{
410
- key: z.ZodOptional<z.ZodString>;
411
- conversation: z.ZodString;
412
- thread: z.ZodOptional<z.ZodString>;
413
- before: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
414
- at: z.ZodNumber;
415
- id: z.ZodString;
416
- }, z.core.$strict>]>>;
417
- after: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
418
- at: z.ZodNumber;
419
- id: z.ZodString;
420
- }, z.core.$strict>]>>;
421
- limit: z.ZodOptional<z.ZodNumber>;
422
- }, z.core.$strict>;
423
- readonly result: z.ZodDiscriminatedUnion<[z.ZodObject<{
424
- kind: z.ZodLiteral<"lines">;
425
- lines: z.ZodArray<z.ZodObject<{
426
- id: z.ZodString;
427
- seq: z.ZodNumber;
428
- at: z.ZodNumber;
429
- person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
430
- agent: z.ZodOptional<z.ZodString>;
431
- direction: z.ZodEnum<{
432
- out: "out";
433
- in: "in";
434
- }>;
435
- body: z.ZodString;
436
- thread: z.ZodOptional<z.ZodString>;
437
- state: z.ZodOptional<z.ZodEnum<{
438
- delivered: "delivered";
439
- held: "held";
440
- refused: "refused";
441
- sent: "sent";
442
- }>>;
443
- refused: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>>;
444
- notice: z.ZodOptional<z.ZodLiteral<true>>;
445
- }, z.core.$strip>>;
446
- more: z.ZodBoolean;
447
- }, z.core.$strip>, z.ZodObject<{
448
- kind: z.ZodLiteral<"agent">;
449
- entries: z.ZodArray<z.ZodObject<{
450
- id: z.ZodString;
451
- kind: z.ZodEnum<{
452
- task: "task";
453
- mail: "mail";
454
- }>;
455
- direction: z.ZodEnum<{
456
- out: "out";
457
- in: "in";
458
- }>;
459
- peer: z.ZodString;
460
- at: z.ZodNumber;
461
- text: z.ZodOptional<z.ZodString>;
462
- taskId: z.ZodOptional<z.ZodString>;
463
- stage: z.ZodOptional<z.ZodEnum<{
464
- accepted: "accepted";
465
- relayed: "relayed";
466
- delivered: "delivered";
467
- held: "held";
468
- handed_to_agent: "handed_to_agent";
469
- read: "read";
470
- replied: "replied";
471
- rejected: "rejected";
472
- expired: "expired";
473
- }>>;
474
- role: z.ZodOptional<z.ZodEnum<{
475
- requester: "requester";
476
- executor: "executor";
477
- }>>;
478
- state: z.ZodOptional<z.ZodEnum<{
479
- TASK_STATE_SUBMITTED: "TASK_STATE_SUBMITTED";
480
- TASK_STATE_WORKING: "TASK_STATE_WORKING";
481
- TASK_STATE_COMPLETED: "TASK_STATE_COMPLETED";
482
- TASK_STATE_FAILED: "TASK_STATE_FAILED";
483
- TASK_STATE_CANCELED: "TASK_STATE_CANCELED";
484
- TASK_STATE_INPUT_REQUIRED: "TASK_STATE_INPUT_REQUIRED";
485
- TASK_STATE_REJECTED: "TASK_STATE_REJECTED";
486
- TASK_STATE_AUTH_REQUIRED: "TASK_STATE_AUTH_REQUIRED";
487
- }>>;
488
- }, z.core.$strip>>;
489
- more: z.ZodBoolean;
490
- }, z.core.$strip>], "kind">;
491
- };
492
- /** Agent tier. Full-text search over the DM and channel lines `conv.read` can read, newest first. */
493
- readonly search: {
494
- readonly params: z.ZodObject<{
495
- query: z.ZodString;
496
- conversation: z.ZodOptional<z.ZodString>;
497
- limit: z.ZodOptional<z.ZodNumber>;
498
- }, z.core.$strict>;
499
- readonly result: z.ZodObject<{
500
- hits: z.ZodArray<z.ZodObject<{
501
- id: z.ZodString;
502
- seq: z.ZodNumber;
503
- at: z.ZodNumber;
504
- person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
505
- agent: z.ZodOptional<z.ZodString>;
506
- direction: z.ZodEnum<{
507
- out: "out";
508
- in: "in";
509
- }>;
510
- body: z.ZodString;
511
- thread: z.ZodOptional<z.ZodString>;
512
- state: z.ZodOptional<z.ZodEnum<{
513
- delivered: "delivered";
514
- held: "held";
515
- refused: "refused";
516
- sent: "sent";
517
- }>>;
518
- refused: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>>;
519
- notice: z.ZodOptional<z.ZodLiteral<true>>;
520
- conversation: z.ZodString;
521
- }, z.core.$strip>>;
522
- }, z.core.$strip>;
523
- };
524
- /**
525
- * Human tier. The channels this person is in and the DMs with lines, newest first, at most `limit`
526
- * (default 100), each with this device's read state.
527
- */
528
- readonly "conv.list": {
529
- readonly params: z.ZodObject<{
530
- limit: z.ZodOptional<z.ZodNumber>;
531
- }, z.core.$strict>;
532
- readonly result: z.ZodObject<{
533
- conversations: z.ZodArray<z.ZodObject<{
534
- conversation: z.ZodString;
535
- kind: z.ZodEnum<{
536
- channel: "channel";
537
- dm: "dm";
538
- }>;
539
- lastAt: z.ZodOptional<z.ZodNumber>;
540
- name: z.ZodOptional<z.ZodString>;
541
- lastSeq: z.ZodOptional<z.ZodNumber>;
542
- readUpTo: z.ZodNumber;
543
- unread: z.ZodNumber;
544
- }, z.core.$strip>>;
545
- }, z.core.$strip>;
546
- };
547
- /**
548
- * Human tier. Marks a DM or a channel read on this device up to `upTo` (a line's `seq`): the cursor
549
- * only moves forward, and never past the newest seq here. Returns the cursor and what is still unread.
550
- */
551
- readonly "conv.markRead": {
552
- readonly params: z.ZodObject<{
553
- conversation: z.ZodString;
554
- upTo: z.ZodNumber;
555
- }, z.core.$strict>;
556
- readonly result: z.ZodObject<{
557
- readUpTo: z.ZodNumber;
558
- unread: z.ZodNumber;
559
- }, z.core.$strip>;
560
- };
561
- /**
562
- * Human tier. `conv` events go only to connections that call this (spec §6.8). With `since` (the
563
- * `seq` of the last event the client handled), the daemon first replays one event per line changed
564
- * after it, oldest first, or sends none and answers `gap: true` when it cannot replay them all; the
565
- * client then reloads with `conv.list` and `conv.read`. `seq` is the newest seq at the call.
566
- */
567
- readonly "conv.subscribe": {
568
- readonly params: z.ZodObject<{
569
- since: z.ZodOptional<z.ZodNumber>;
570
- }, z.core.$strict>;
571
- readonly result: z.ZodObject<{
572
- seq: z.ZodNumber;
573
- gap: z.ZodBoolean;
574
- }, z.core.$strip>;
575
- };
576
- /**
577
- * Human tier. A line from the person (no agent) to a DM or a channel this person is in. `thread` is
578
- * the `id` of the thread's first line. `clientId` makes the call idempotent: a repeat with the same
579
- * `clientId` and the same conversation, thread and text returns the first line's result and sends nothing.
580
- */
581
- readonly "person.send": {
582
- readonly params: z.ZodObject<{
583
- conversation: z.ZodString;
584
- text: z.ZodString;
585
- thread: z.ZodOptional<z.ZodString>;
586
- clientId: z.ZodOptional<z.ZodString>;
587
- }, z.core.$strict>;
588
- readonly result: z.ZodObject<{
589
- id: z.ZodString;
590
- conversation: z.ZodString;
591
- }, z.core.$strip>;
592
- };
593
- /** Human tier. The persons of the realm whose handle starts with `query` (all with none), at most `limit` (default 50). */
594
254
  readonly "people.search": {
595
255
  readonly params: z.ZodObject<{
596
256
  query: z.ZodOptional<z.ZodString>;
@@ -615,60 +275,4 @@ export declare const SURFACE_METHODS: {
615
275
  }, z.core.$strip>>;
616
276
  }, z.core.$strip>;
617
277
  };
618
- /** Human tier. One person and their current devices, as verified. `not_found` for a person this realm does not know. */
619
- readonly "people.get": {
620
- readonly params: z.ZodObject<{
621
- person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
622
- }, z.core.$strict>;
623
- /** A device's `away`: its latest presence, still fresh, says no window of the person is visible on it (spec §6.5). */
624
- readonly result: z.ZodObject<{
625
- person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
626
- name: z.ZodString;
627
- handle: z.ZodString;
628
- org: z.ZodEnum<{
629
- other: "other";
630
- none: "none";
631
- same: "same";
632
- }>;
633
- vouched: z.ZodEnum<{
634
- admin: "admin";
635
- device: "device";
636
- jelly: "jelly";
637
- service: "service";
638
- }>;
639
- devices: z.ZodArray<z.ZodObject<{
640
- device: z.ZodString;
641
- label: z.ZodString;
642
- self: z.ZodBoolean;
643
- away: z.ZodOptional<z.ZodLiteral<true>>;
644
- }, z.core.$strip>>;
645
- deviceChanges: z.ZodOptional<z.ZodArray<z.ZodObject<{
646
- change: z.ZodEnum<{
647
- removed: "removed";
648
- replaced: "replaced";
649
- added: "added";
650
- vouched: "vouched";
651
- }>;
652
- device: z.ZodString;
653
- label: z.ZodString;
654
- kind: z.ZodOptional<z.ZodEnum<{
655
- "jelly-host": "jelly-host";
656
- laptop: "laptop";
657
- server: "server";
658
- other: "other";
659
- }>>;
660
- vouch: z.ZodEnum<{
661
- admin: "admin";
662
- device: "device";
663
- jelly: "jelly";
664
- }>;
665
- via: z.ZodOptional<z.ZodEnum<{
666
- host: "host";
667
- browser: "browser";
668
- }>>;
669
- approver: z.ZodOptional<z.ZodString>;
670
- at: z.ZodNumber;
671
- }, z.core.$strip>>>;
672
- }, z.core.$strip>;
673
- };
674
278
  };