@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
@@ -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,133 +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
- conv_conflict: "conv_conflict";
223
- stale_epoch: "stale_epoch";
224
- device_limit: "device_limit";
225
- admission_required: "admission_required";
226
- admission_invalid: "admission_invalid";
227
- directory_inconsistent: "directory_inconsistent";
228
- unknown_device: "unknown_device";
229
- directory_unavailable: "directory_unavailable";
230
- login_unsupported: "login_unsupported";
231
- login_denied: "login_denied";
232
- grant_required: "grant_required";
233
- grant_invalid: "grant_invalid";
234
- ticket_required: "ticket_required";
235
- ticket_invalid: "ticket_invalid";
236
- daemon_unavailable: "daemon_unavailable";
237
- daemon_mismatch: "daemon_mismatch";
238
- store_refused: "store_refused";
239
- internal: "internal";
240
- }>>;
241
- expect: z.ZodOptional<z.ZodEnum<{
242
- kept: "kept";
243
- next_turn: "next_turn";
244
- wake: "wake";
245
- next_prompt: "next_prompt";
246
- on_read: "on_read";
247
- offline: "offline";
248
- }>>;
249
- }, z.core.$strip>>;
250
- }, z.core.$strip>;
251
- };
252
- /**
253
- * Agent tier. One item of the session `key` by id: something it received (`received`: returns the
254
- * full message, marks it read and sends a read receipt, as `inbox.read` did in 0.1), or something
255
- * it sent to an agent (`sent`: how far it got, as `message.status` did). `not_found` otherwise.
256
- */
102
+ /** A received item, or the delivery records of a sent task envelope. */
257
103
  readonly "item.read": {
258
104
  readonly params: z.ZodObject<{
259
105
  key: z.ZodString;
260
106
  id: z.ZodString;
107
+ cid: z.ZodOptional<z.ZodString>;
261
108
  }, z.core.$strict>;
262
109
  readonly result: z.ZodDiscriminatedUnion<[z.ZodObject<{
263
110
  kind: z.ZodLiteral<"received">;
@@ -265,12 +112,14 @@ export declare const SURFACE_METHODS: {
265
112
  id: z.ZodString;
266
113
  key: z.ZodString;
267
114
  from: z.ZodObject<{
268
- address: z.ZodString;
269
115
  person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
270
116
  agent: z.ZodOptional<z.ZodString>;
271
- device: z.ZodString;
272
- label: z.ZodString;
117
+ address: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
118
+ device: z.ZodOptional<z.ZodString>;
119
+ label: z.ZodOptional<z.ZodString>;
273
120
  }, z.core.$strip>;
121
+ cid: z.ZodOptional<z.ZodString>;
122
+ eventId: z.ZodOptional<z.ZodString>;
274
123
  kind: z.ZodEnum<{
275
124
  message: "message";
276
125
  task: "task";
@@ -325,7 +174,7 @@ export declare const SURFACE_METHODS: {
325
174
  }, z.core.$strip>, z.ZodObject<{
326
175
  kind: z.ZodLiteral<"sent">;
327
176
  envelopeId: z.ZodString;
328
- to: z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>;
177
+ to: z.ZodString;
329
178
  stage: z.ZodEnum<{
330
179
  accepted: "accepted";
331
180
  relayed: "relayed";
@@ -362,6 +211,7 @@ export declare const SURFACE_METHODS: {
362
211
  refused: "refused";
363
212
  declined: "declined";
364
213
  request_required: "request_required";
214
+ peer_outdated: "peer_outdated";
365
215
  rate_limited: "rate_limited";
366
216
  loop_guard: "loop_guard";
367
217
  too_large: "too_large";
@@ -401,202 +251,6 @@ export declare const SURFACE_METHODS: {
401
251
  }, z.core.$strip>>;
402
252
  }, z.core.$strip>], "kind">;
403
253
  };
404
- /**
405
- * Agent and human tiers. A page of one conversation, oldest first. With no cursor, the latest
406
- * `limit` (default 30 with an agent, 50 in a DM or a channel); with `before`, the latest `limit`
407
- * before that place; with `after`, the earliest `limit` after it. `more`: entries remain past the
408
- * page in the direction read. Changes no stage and sends no receipt.
409
- * - `dm:` and `channel:` give `lines`; `thread` narrows to a thread's first line and its replies;
410
- * the cursor is a line's `seq`.
411
- * - `agent:<person>/<agent>` needs the session `key` and gives `entries`: mail either way and tasks
412
- * either way between that session and the agent; the cursor is an entry's `{at, id}`.
413
- */
414
- readonly "conv.read": {
415
- readonly params: z.ZodObject<{
416
- key: z.ZodOptional<z.ZodString>;
417
- conversation: z.ZodString;
418
- thread: z.ZodOptional<z.ZodString>;
419
- before: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
420
- at: z.ZodNumber;
421
- id: z.ZodString;
422
- }, z.core.$strict>]>>;
423
- after: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
424
- at: z.ZodNumber;
425
- id: z.ZodString;
426
- }, z.core.$strict>]>>;
427
- limit: z.ZodOptional<z.ZodNumber>;
428
- }, z.core.$strict>;
429
- readonly result: z.ZodDiscriminatedUnion<[z.ZodObject<{
430
- kind: z.ZodLiteral<"lines">;
431
- lines: z.ZodArray<z.ZodObject<{
432
- id: z.ZodString;
433
- seq: z.ZodNumber;
434
- at: z.ZodNumber;
435
- person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
436
- agent: z.ZodOptional<z.ZodString>;
437
- direction: z.ZodEnum<{
438
- out: "out";
439
- in: "in";
440
- }>;
441
- body: z.ZodString;
442
- thread: z.ZodOptional<z.ZodString>;
443
- state: z.ZodOptional<z.ZodEnum<{
444
- delivered: "delivered";
445
- held: "held";
446
- refused: "refused";
447
- sent: "sent";
448
- }>>;
449
- refused: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>>;
450
- notice: z.ZodOptional<z.ZodLiteral<true>>;
451
- }, z.core.$strip>>;
452
- more: z.ZodBoolean;
453
- }, z.core.$strip>, z.ZodObject<{
454
- kind: z.ZodLiteral<"agent">;
455
- entries: z.ZodArray<z.ZodObject<{
456
- id: z.ZodString;
457
- kind: z.ZodEnum<{
458
- task: "task";
459
- mail: "mail";
460
- }>;
461
- direction: z.ZodEnum<{
462
- out: "out";
463
- in: "in";
464
- }>;
465
- peer: z.ZodString;
466
- at: z.ZodNumber;
467
- text: z.ZodOptional<z.ZodString>;
468
- taskId: z.ZodOptional<z.ZodString>;
469
- stage: z.ZodOptional<z.ZodEnum<{
470
- accepted: "accepted";
471
- relayed: "relayed";
472
- delivered: "delivered";
473
- held: "held";
474
- handed_to_agent: "handed_to_agent";
475
- read: "read";
476
- replied: "replied";
477
- rejected: "rejected";
478
- expired: "expired";
479
- }>>;
480
- role: z.ZodOptional<z.ZodEnum<{
481
- requester: "requester";
482
- executor: "executor";
483
- }>>;
484
- state: z.ZodOptional<z.ZodEnum<{
485
- TASK_STATE_SUBMITTED: "TASK_STATE_SUBMITTED";
486
- TASK_STATE_WORKING: "TASK_STATE_WORKING";
487
- TASK_STATE_COMPLETED: "TASK_STATE_COMPLETED";
488
- TASK_STATE_FAILED: "TASK_STATE_FAILED";
489
- TASK_STATE_CANCELED: "TASK_STATE_CANCELED";
490
- TASK_STATE_INPUT_REQUIRED: "TASK_STATE_INPUT_REQUIRED";
491
- TASK_STATE_REJECTED: "TASK_STATE_REJECTED";
492
- TASK_STATE_AUTH_REQUIRED: "TASK_STATE_AUTH_REQUIRED";
493
- }>>;
494
- }, z.core.$strip>>;
495
- more: z.ZodBoolean;
496
- }, z.core.$strip>], "kind">;
497
- };
498
- /** Agent tier. Full-text search over the DM and channel lines `conv.read` can read, newest first. */
499
- readonly search: {
500
- readonly params: z.ZodObject<{
501
- query: z.ZodString;
502
- conversation: z.ZodOptional<z.ZodString>;
503
- limit: z.ZodOptional<z.ZodNumber>;
504
- }, z.core.$strict>;
505
- readonly result: z.ZodObject<{
506
- hits: z.ZodArray<z.ZodObject<{
507
- id: z.ZodString;
508
- seq: z.ZodNumber;
509
- at: z.ZodNumber;
510
- person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
511
- agent: z.ZodOptional<z.ZodString>;
512
- direction: z.ZodEnum<{
513
- out: "out";
514
- in: "in";
515
- }>;
516
- body: z.ZodString;
517
- thread: z.ZodOptional<z.ZodString>;
518
- state: z.ZodOptional<z.ZodEnum<{
519
- delivered: "delivered";
520
- held: "held";
521
- refused: "refused";
522
- sent: "sent";
523
- }>>;
524
- refused: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>>;
525
- notice: z.ZodOptional<z.ZodLiteral<true>>;
526
- conversation: z.ZodString;
527
- }, z.core.$strip>>;
528
- }, z.core.$strip>;
529
- };
530
- /**
531
- * Human tier. The channels this person is in and the DMs with lines, newest first, at most `limit`
532
- * (default 100), each with this device's read state.
533
- */
534
- readonly "conv.list": {
535
- readonly params: z.ZodObject<{
536
- limit: z.ZodOptional<z.ZodNumber>;
537
- }, z.core.$strict>;
538
- readonly result: z.ZodObject<{
539
- conversations: z.ZodArray<z.ZodObject<{
540
- conversation: z.ZodString;
541
- kind: z.ZodEnum<{
542
- channel: "channel";
543
- dm: "dm";
544
- }>;
545
- lastAt: z.ZodOptional<z.ZodNumber>;
546
- name: z.ZodOptional<z.ZodString>;
547
- lastSeq: z.ZodOptional<z.ZodNumber>;
548
- readUpTo: z.ZodNumber;
549
- unread: z.ZodNumber;
550
- }, z.core.$strip>>;
551
- }, z.core.$strip>;
552
- };
553
- /**
554
- * Human tier. Marks a DM or a channel read on this device up to `upTo` (a line's `seq`): the cursor
555
- * only moves forward, and never past the newest seq here. Returns the cursor and what is still unread.
556
- */
557
- readonly "conv.markRead": {
558
- readonly params: z.ZodObject<{
559
- conversation: z.ZodString;
560
- upTo: z.ZodNumber;
561
- }, z.core.$strict>;
562
- readonly result: z.ZodObject<{
563
- readUpTo: z.ZodNumber;
564
- unread: z.ZodNumber;
565
- }, z.core.$strip>;
566
- };
567
- /**
568
- * Human tier. `conv` events go only to connections that call this (spec §6.8). With `since` (the
569
- * `seq` of the last event the client handled), the daemon first replays one event per line changed
570
- * after it, oldest first, or sends none and answers `gap: true` when it cannot replay them all; the
571
- * client then reloads with `conv.list` and `conv.read`. `seq` is the newest seq at the call.
572
- */
573
- readonly "conv.subscribe": {
574
- readonly params: z.ZodObject<{
575
- since: z.ZodOptional<z.ZodNumber>;
576
- }, z.core.$strict>;
577
- readonly result: z.ZodObject<{
578
- seq: z.ZodNumber;
579
- gap: z.ZodBoolean;
580
- }, z.core.$strip>;
581
- };
582
- /**
583
- * Human tier. A line from the person (no agent) to a DM or a channel this person is in. `thread` is
584
- * the `id` of the thread's first line. `clientId` makes the call idempotent: a repeat with the same
585
- * `clientId` and the same conversation, thread and text returns the first line's result and sends nothing.
586
- */
587
- readonly "person.send": {
588
- readonly params: z.ZodObject<{
589
- conversation: z.ZodString;
590
- text: z.ZodString;
591
- thread: z.ZodOptional<z.ZodString>;
592
- clientId: z.ZodOptional<z.ZodString>;
593
- }, z.core.$strict>;
594
- readonly result: z.ZodObject<{
595
- id: z.ZodString;
596
- conversation: z.ZodString;
597
- }, z.core.$strip>;
598
- };
599
- /** Human tier. The persons of the realm whose handle starts with `query` (all with none), at most `limit` (default 50). */
600
254
  readonly "people.search": {
601
255
  readonly params: z.ZodObject<{
602
256
  query: z.ZodOptional<z.ZodString>;
@@ -621,60 +275,4 @@ export declare const SURFACE_METHODS: {
621
275
  }, z.core.$strip>>;
622
276
  }, z.core.$strip>;
623
277
  };
624
- /** Human tier. One person and their current devices, as verified. `not_found` for a person this realm does not know. */
625
- readonly "people.get": {
626
- readonly params: z.ZodObject<{
627
- person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
628
- }, z.core.$strict>;
629
- /** A device's `away`: its latest presence, still fresh, says no window of the person is visible on it (spec §6.5). */
630
- readonly result: z.ZodObject<{
631
- person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
632
- name: z.ZodString;
633
- handle: z.ZodString;
634
- org: z.ZodEnum<{
635
- other: "other";
636
- none: "none";
637
- same: "same";
638
- }>;
639
- vouched: z.ZodEnum<{
640
- admin: "admin";
641
- device: "device";
642
- jelly: "jelly";
643
- service: "service";
644
- }>;
645
- devices: z.ZodArray<z.ZodObject<{
646
- device: z.ZodString;
647
- label: z.ZodString;
648
- self: z.ZodBoolean;
649
- away: z.ZodOptional<z.ZodLiteral<true>>;
650
- }, z.core.$strip>>;
651
- deviceChanges: z.ZodOptional<z.ZodArray<z.ZodObject<{
652
- change: z.ZodEnum<{
653
- removed: "removed";
654
- replaced: "replaced";
655
- added: "added";
656
- vouched: "vouched";
657
- }>;
658
- device: z.ZodString;
659
- label: z.ZodString;
660
- kind: z.ZodOptional<z.ZodEnum<{
661
- "jelly-host": "jelly-host";
662
- laptop: "laptop";
663
- server: "server";
664
- other: "other";
665
- }>>;
666
- vouch: z.ZodEnum<{
667
- admin: "admin";
668
- device: "device";
669
- jelly: "jelly";
670
- }>;
671
- via: z.ZodOptional<z.ZodEnum<{
672
- host: "host";
673
- browser: "browser";
674
- }>>;
675
- approver: z.ZodOptional<z.ZodString>;
676
- at: z.ZodNumber;
677
- }, z.core.$strip>>>;
678
- }, z.core.$strip>;
679
- };
680
278
  };