@joe-broadhead/messaging 0.0.0-stage → 0.7.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 (257) hide show
  1. package/CHANGELOG.md +175 -0
  2. package/LICENSE +21 -0
  3. package/NOTICE +12 -0
  4. package/README.md +36 -2
  5. package/dist/bin/messaging-mcp.js +25887 -0
  6. package/dist/bin/messaging-relay.js +19014 -0
  7. package/dist/bin/messaging.js +14732 -0
  8. package/dist/bin/messagingd.js +28682 -0
  9. package/dist/lib/core-testing.js +1 -0
  10. package/dist/lib/core.js +1 -0
  11. package/dist/lib/ipc-testing.js +1 -0
  12. package/dist/lib/ipc.js +1 -0
  13. package/dist/lib/modules/core/address.js +42 -0
  14. package/dist/lib/modules/core/agent/operations.js +595 -0
  15. package/dist/lib/modules/core/agent/present.js +244 -0
  16. package/dist/lib/modules/core/agent/text.js +79 -0
  17. package/dist/lib/modules/core/agent-tools.js +458 -0
  18. package/dist/lib/modules/core/b64u.js +20 -0
  19. package/dist/lib/modules/core/cards.js +55 -0
  20. package/dist/lib/modules/core/check.js +20 -0
  21. package/dist/lib/modules/core/consent.js +199 -0
  22. package/dist/lib/modules/core/contact-card.js +74 -0
  23. package/dist/lib/modules/core/delegation.js +174 -0
  24. package/dist/lib/modules/core/directory/device-log.js +258 -0
  25. package/dist/lib/modules/core/directory/epoch.js +103 -0
  26. package/dist/lib/modules/core/directory/handle.js +29 -0
  27. package/dist/lib/modules/core/directory/jelly-device.js +204 -0
  28. package/dist/lib/modules/core/directory/jelly-issuer.js +12 -0
  29. package/dist/lib/modules/core/directory/jelly-token.js +305 -0
  30. package/dist/lib/modules/core/directory/keys-statement.js +43 -0
  31. package/dist/lib/modules/core/directory/link.js +81 -0
  32. package/dist/lib/modules/core/directory/merkle-log.js +250 -0
  33. package/dist/lib/modules/core/directory/person-view.js +197 -0
  34. package/dist/lib/modules/core/directory/person.js +40 -0
  35. package/dist/lib/modules/core/directory/realm.js +59 -0
  36. package/dist/lib/modules/core/directory/smt.js +266 -0
  37. package/dist/lib/modules/core/envelope.js +320 -0
  38. package/dist/lib/modules/core/hash.js +5 -0
  39. package/dist/lib/modules/core/head.js +27 -0
  40. package/dist/lib/modules/core/identity.js +71 -0
  41. package/dist/lib/modules/core/index.js +44 -0
  42. package/dist/lib/modules/core/jcs.js +96 -0
  43. package/dist/lib/modules/core/jelly-host-double.js +35 -0
  44. package/dist/lib/modules/core/jelly-host.js +211 -0
  45. package/dist/lib/modules/core/keys.js +79 -0
  46. package/dist/lib/modules/core/peer-text.js +563 -0
  47. package/dist/lib/modules/core/realm.js +1 -0
  48. package/dist/lib/modules/core/roster.js +454 -0
  49. package/dist/lib/modules/core/schema/a2a.js +85 -0
  50. package/dist/lib/modules/core/schema/common.js +254 -0
  51. package/dist/lib/modules/core/schema/consent.js +120 -0
  52. package/dist/lib/modules/core/schema/delegation.js +58 -0
  53. package/dist/lib/modules/core/schema/directory-frames.js +270 -0
  54. package/dist/lib/modules/core/schema/directory.js +169 -0
  55. package/dist/lib/modules/core/schema/envelope.js +211 -0
  56. package/dist/lib/modules/core/schema/errors.js +65 -0
  57. package/dist/lib/modules/core/schema/index.js +15 -0
  58. package/dist/lib/modules/core/schema/ipc/consent.js +181 -0
  59. package/dist/lib/modules/core/schema/ipc/device.js +276 -0
  60. package/dist/lib/modules/core/schema/ipc/jelly.js +189 -0
  61. package/dist/lib/modules/core/schema/ipc/shapes.js +185 -0
  62. package/dist/lib/modules/core/schema/ipc/surfaces.js +223 -0
  63. package/dist/lib/modules/core/schema/ipc.js +451 -0
  64. package/dist/lib/modules/core/schema/jelly.js +122 -0
  65. package/dist/lib/modules/core/schema/realm.js +27 -0
  66. package/dist/lib/modules/core/schema/relay.js +112 -0
  67. package/dist/lib/modules/core/schema/roster.js +126 -0
  68. package/dist/lib/modules/core/sign.js +43 -0
  69. package/dist/lib/modules/core/task.js +37 -0
  70. package/dist/lib/modules/core/testing.js +20 -0
  71. package/dist/lib/modules/core/ulid.js +36 -0
  72. package/dist/lib/modules/core/version.js +6 -0
  73. package/dist/lib/modules/core/wire.js +255 -0
  74. package/dist/lib/modules/ipc/client.js +289 -0
  75. package/dist/lib/modules/ipc/framing.js +33 -0
  76. package/dist/lib/modules/ipc/index.js +6 -0
  77. package/dist/lib/modules/ipc/paths.js +102 -0
  78. package/dist/lib/modules/ipc/pipes.js +65 -0
  79. package/dist/lib/modules/ipc/rpc.js +8 -0
  80. package/dist/lib/modules/ipc/server.js +317 -0
  81. package/dist/lib/modules/ipc/testing.js +145 -0
  82. package/dist/lib/modules/ipc/trust.js +166 -0
  83. package/dist/lib/modules/ipc/windows-acl.js +275 -0
  84. package/dist/lib/modules/vendor/zod/index.js +7 -0
  85. package/dist/lib/modules/vendor/zod/v4/classic/checks.js +1 -0
  86. package/dist/lib/modules/vendor/zod/v4/classic/coerce.js +17 -0
  87. package/dist/lib/modules/vendor/zod/v4/classic/compat.js +31 -0
  88. package/dist/lib/modules/vendor/zod/v4/classic/deep-partial.js +13 -0
  89. package/dist/lib/modules/vendor/zod/v4/classic/errors.js +57 -0
  90. package/dist/lib/modules/vendor/zod/v4/classic/external.js +17 -0
  91. package/dist/lib/modules/vendor/zod/v4/classic/from-json-schema.js +881 -0
  92. package/dist/lib/modules/vendor/zod/v4/classic/in-out.js +36 -0
  93. package/dist/lib/modules/vendor/zod/v4/classic/iso.js +15 -0
  94. package/dist/lib/modules/vendor/zod/v4/classic/parse.js +16 -0
  95. package/dist/lib/modules/vendor/zod/v4/classic/schemas.js +1535 -0
  96. package/dist/lib/modules/vendor/zod/v4/core/api.js +1107 -0
  97. package/dist/lib/modules/vendor/zod/v4/core/checks.js +516 -0
  98. package/dist/lib/modules/vendor/zod/v4/core/compile.js +1866 -0
  99. package/dist/lib/modules/vendor/zod/v4/core/core.js +141 -0
  100. package/dist/lib/modules/vendor/zod/v4/core/doc.js +38 -0
  101. package/dist/lib/modules/vendor/zod/v4/core/errors.js +267 -0
  102. package/dist/lib/modules/vendor/zod/v4/core/index.js +19 -0
  103. package/dist/lib/modules/vendor/zod/v4/core/json-schema-generator.js +99 -0
  104. package/dist/lib/modules/vendor/zod/v4/core/json-schema-processors.js +843 -0
  105. package/dist/lib/modules/vendor/zod/v4/core/json-schema.js +1 -0
  106. package/dist/lib/modules/vendor/zod/v4/core/memoizer.js +311 -0
  107. package/dist/lib/modules/vendor/zod/v4/core/parse.js +175 -0
  108. package/dist/lib/modules/vendor/zod/v4/core/regexes.js +156 -0
  109. package/dist/lib/modules/vendor/zod/v4/core/registries.js +51 -0
  110. package/dist/lib/modules/vendor/zod/v4/core/schemas.js +2636 -0
  111. package/dist/lib/modules/vendor/zod/v4/core/to-json-schema.js +651 -0
  112. package/dist/lib/modules/vendor/zod/v4/core/util.js +873 -0
  113. package/dist/lib/modules/vendor/zod/v4/core/versions.js +5 -0
  114. package/dist/lib/modules/vendor/zod/v4/core/visit.js +169 -0
  115. package/dist/lib/modules/vendor/zod/v4/locales/ar.js +111 -0
  116. package/dist/lib/modules/vendor/zod/v4/locales/az.js +110 -0
  117. package/dist/lib/modules/vendor/zod/v4/locales/be.js +168 -0
  118. package/dist/lib/modules/vendor/zod/v4/locales/bg.js +125 -0
  119. package/dist/lib/modules/vendor/zod/v4/locales/bn.js +113 -0
  120. package/dist/lib/modules/vendor/zod/v4/locales/ca.js +112 -0
  121. package/dist/lib/modules/vendor/zod/v4/locales/ckb.js +133 -0
  122. package/dist/lib/modules/vendor/zod/v4/locales/cs.js +116 -0
  123. package/dist/lib/modules/vendor/zod/v4/locales/da.js +120 -0
  124. package/dist/lib/modules/vendor/zod/v4/locales/de.js +113 -0
  125. package/dist/lib/modules/vendor/zod/v4/locales/el.js +112 -0
  126. package/dist/lib/modules/vendor/zod/v4/locales/en.js +125 -0
  127. package/dist/lib/modules/vendor/zod/v4/locales/eo.js +114 -0
  128. package/dist/lib/modules/vendor/zod/v4/locales/es.js +136 -0
  129. package/dist/lib/modules/vendor/zod/v4/locales/fa.js +119 -0
  130. package/dist/lib/modules/vendor/zod/v4/locales/fi.js +117 -0
  131. package/dist/lib/modules/vendor/zod/v4/locales/fr-CA.js +112 -0
  132. package/dist/lib/modules/vendor/zod/v4/locales/fr.js +129 -0
  133. package/dist/lib/modules/vendor/zod/v4/locales/gu.js +113 -0
  134. package/dist/lib/modules/vendor/zod/v4/locales/he.js +221 -0
  135. package/dist/lib/modules/vendor/zod/v4/locales/hi.js +111 -0
  136. package/dist/lib/modules/vendor/zod/v4/locales/hr.js +126 -0
  137. package/dist/lib/modules/vendor/zod/v4/locales/hu.js +113 -0
  138. package/dist/lib/modules/vendor/zod/v4/locales/hy.js +158 -0
  139. package/dist/lib/modules/vendor/zod/v4/locales/id.js +111 -0
  140. package/dist/lib/modules/vendor/zod/v4/locales/index.js +63 -0
  141. package/dist/lib/modules/vendor/zod/v4/locales/is.js +114 -0
  142. package/dist/lib/modules/vendor/zod/v4/locales/it.js +113 -0
  143. package/dist/lib/modules/vendor/zod/v4/locales/ja.js +112 -0
  144. package/dist/lib/modules/vendor/zod/v4/locales/ka.js +117 -0
  145. package/dist/lib/modules/vendor/zod/v4/locales/kh.js +5 -0
  146. package/dist/lib/modules/vendor/zod/v4/locales/km.js +115 -0
  147. package/dist/lib/modules/vendor/zod/v4/locales/kn.js +116 -0
  148. package/dist/lib/modules/vendor/zod/v4/locales/ko.js +116 -0
  149. package/dist/lib/modules/vendor/zod/v4/locales/lt.js +207 -0
  150. package/dist/lib/modules/vendor/zod/v4/locales/mk.js +114 -0
  151. package/dist/lib/modules/vendor/zod/v4/locales/ms.js +112 -0
  152. package/dist/lib/modules/vendor/zod/v4/locales/ne.js +111 -0
  153. package/dist/lib/modules/vendor/zod/v4/locales/nl.js +115 -0
  154. package/dist/lib/modules/vendor/zod/v4/locales/nn.js +113 -0
  155. package/dist/lib/modules/vendor/zod/v4/locales/no.js +113 -0
  156. package/dist/lib/modules/vendor/zod/v4/locales/ota.js +114 -0
  157. package/dist/lib/modules/vendor/zod/v4/locales/pl.js +114 -0
  158. package/dist/lib/modules/vendor/zod/v4/locales/ps.js +119 -0
  159. package/dist/lib/modules/vendor/zod/v4/locales/pt-BR.js +143 -0
  160. package/dist/lib/modules/vendor/zod/v4/locales/pt.js +142 -0
  161. package/dist/lib/modules/vendor/zod/v4/locales/ro.js +122 -0
  162. package/dist/lib/modules/vendor/zod/v4/locales/ru.js +168 -0
  163. package/dist/lib/modules/vendor/zod/v4/locales/sk.js +116 -0
  164. package/dist/lib/modules/vendor/zod/v4/locales/sl.js +114 -0
  165. package/dist/lib/modules/vendor/zod/v4/locales/sv.js +115 -0
  166. package/dist/lib/modules/vendor/zod/v4/locales/ta.js +115 -0
  167. package/dist/lib/modules/vendor/zod/v4/locales/tg.js +117 -0
  168. package/dist/lib/modules/vendor/zod/v4/locales/th.js +115 -0
  169. package/dist/lib/modules/vendor/zod/v4/locales/tk.js +107 -0
  170. package/dist/lib/modules/vendor/zod/v4/locales/tr.js +110 -0
  171. package/dist/lib/modules/vendor/zod/v4/locales/ua.js +5 -0
  172. package/dist/lib/modules/vendor/zod/v4/locales/uk.js +113 -0
  173. package/dist/lib/modules/vendor/zod/v4/locales/ur.js +115 -0
  174. package/dist/lib/modules/vendor/zod/v4/locales/uz.js +113 -0
  175. package/dist/lib/modules/vendor/zod/v4/locales/vi.js +113 -0
  176. package/dist/lib/modules/vendor/zod/v4/locales/yo.js +112 -0
  177. package/dist/lib/modules/vendor/zod/v4/locales/zh-CN.js +114 -0
  178. package/dist/lib/modules/vendor/zod/v4/locales/zh-TW.js +112 -0
  179. package/dist/lib/testing-jelly-id.js +1219 -0
  180. package/dist/lib/zod.js +1 -0
  181. package/dist/spec/messaging-v1.md +3426 -0
  182. package/dist/third-party-notices.md +239 -0
  183. package/dist/third-party.json +88 -0
  184. package/dist/types/core/address.d.ts +16 -0
  185. package/dist/types/core/agent/operations.d.ts +129 -0
  186. package/dist/types/core/agent/present.d.ts +57 -0
  187. package/dist/types/core/agent/text.d.ts +62 -0
  188. package/dist/types/core/agent-tools.d.ts +948 -0
  189. package/dist/types/core/b64u.d.ts +6 -0
  190. package/dist/types/core/cards.d.ts +21 -0
  191. package/dist/types/core/check.d.ts +10 -0
  192. package/dist/types/core/consent.d.ts +132 -0
  193. package/dist/types/core/contact-card.d.ts +34 -0
  194. package/dist/types/core/delegation.d.ts +71 -0
  195. package/dist/types/core/directory/device-log.d.ts +119 -0
  196. package/dist/types/core/directory/epoch.d.ts +53 -0
  197. package/dist/types/core/directory/handle.d.ts +11 -0
  198. package/dist/types/core/directory/jelly-device.d.ts +88 -0
  199. package/dist/types/core/directory/jelly-issuer.d.ts +8 -0
  200. package/dist/types/core/directory/jelly-token.d.ts +116 -0
  201. package/dist/types/core/directory/keys-statement.d.ts +22 -0
  202. package/dist/types/core/directory/link.d.ts +36 -0
  203. package/dist/types/core/directory/merkle-log.d.ts +40 -0
  204. package/dist/types/core/directory/person-view.d.ts +90 -0
  205. package/dist/types/core/directory/person.d.ts +8 -0
  206. package/dist/types/core/directory/realm.d.ts +23 -0
  207. package/dist/types/core/directory/smt.d.ts +52 -0
  208. package/dist/types/core/envelope.d.ts +68 -0
  209. package/dist/types/core/hash.d.ts +2 -0
  210. package/dist/types/core/head.d.ts +34 -0
  211. package/dist/types/core/identity.d.ts +35 -0
  212. package/dist/types/core/index.d.ts +38 -0
  213. package/dist/types/core/jcs.d.ts +12 -0
  214. package/dist/types/core/jelly-host-double.d.ts +21 -0
  215. package/dist/types/core/jelly-host.d.ts +86 -0
  216. package/dist/types/core/keys.d.ts +16 -0
  217. package/dist/types/core/peer-text.d.ts +87 -0
  218. package/dist/types/core/realm.d.ts +36 -0
  219. package/dist/types/core/roster.d.ts +146 -0
  220. package/dist/types/core/schema/a2a.d.ts +251 -0
  221. package/dist/types/core/schema/common.d.ts +272 -0
  222. package/dist/types/core/schema/consent.d.ts +140 -0
  223. package/dist/types/core/schema/delegation.d.ts +58 -0
  224. package/dist/types/core/schema/directory-frames.d.ts +1301 -0
  225. package/dist/types/core/schema/directory.d.ts +375 -0
  226. package/dist/types/core/schema/envelope.d.ts +750 -0
  227. package/dist/types/core/schema/errors.d.ts +104 -0
  228. package/dist/types/core/schema/index.d.ts +15 -0
  229. package/dist/types/core/schema/ipc/consent.d.ts +555 -0
  230. package/dist/types/core/schema/ipc/device.d.ts +729 -0
  231. package/dist/types/core/schema/ipc/jelly.d.ts +501 -0
  232. package/dist/types/core/schema/ipc/shapes.d.ts +411 -0
  233. package/dist/types/core/schema/ipc/surfaces.d.ts +674 -0
  234. package/dist/types/core/schema/ipc.d.ts +3131 -0
  235. package/dist/types/core/schema/jelly.d.ts +160 -0
  236. package/dist/types/core/schema/realm.d.ts +38 -0
  237. package/dist/types/core/schema/relay.d.ts +1122 -0
  238. package/dist/types/core/schema/roster.d.ts +347 -0
  239. package/dist/types/core/sign.d.ts +13 -0
  240. package/dist/types/core/task.d.ts +6 -0
  241. package/dist/types/core/testing.d.ts +18 -0
  242. package/dist/types/core/ulid.d.ts +5 -0
  243. package/dist/types/core/version.d.ts +6 -0
  244. package/dist/types/core/wire.d.ts +14 -0
  245. package/dist/types/ipc/client.d.ts +85 -0
  246. package/dist/types/ipc/framing.d.ts +12 -0
  247. package/dist/types/ipc/index.d.ts +6 -0
  248. package/dist/types/ipc/paths.d.ts +39 -0
  249. package/dist/types/ipc/pipes.d.ts +16 -0
  250. package/dist/types/ipc/rpc.d.ts +13 -0
  251. package/dist/types/ipc/server.d.ts +94 -0
  252. package/dist/types/ipc/testing.d.ts +89 -0
  253. package/dist/types/ipc/trust.d.ts +49 -0
  254. package/dist/types/ipc/windows-acl.d.ts +56 -0
  255. package/dist/types/testing/jelly-id.d.ts +518 -0
  256. package/dist/types/zod.d.ts +1 -0
  257. package/package.json +77 -4
@@ -0,0 +1,104 @@
1
+ import { z } from "zod";
2
+ /** The closed set of Messaging error codes. Every emitted code must be documented in docs/spec/messaging-v1.md. */
3
+ export declare const ErrorCode: z.ZodEnum<{
4
+ expired: "expired";
5
+ invalid_request: "invalid_request";
6
+ not_member: "not_member";
7
+ bad_signature: "bad_signature";
8
+ unknown_session: "unknown_session";
9
+ ambiguous_address: "ambiguous_address";
10
+ no_recipients: "no_recipients";
11
+ unknown_address: "unknown_address";
12
+ refused: "refused";
13
+ declined: "declined";
14
+ request_required: "request_required";
15
+ rate_limited: "rate_limited";
16
+ loop_guard: "loop_guard";
17
+ too_large: "too_large";
18
+ secret_refused: "secret_refused";
19
+ duplicate: "duplicate";
20
+ relay_unavailable: "relay_unavailable";
21
+ not_found: "not_found";
22
+ invalid_state: "invalid_state";
23
+ forbidden: "forbidden";
24
+ guarded_turn: "guarded_turn";
25
+ roster_conflict: "roster_conflict";
26
+ invite_invalid: "invite_invalid";
27
+ no_identity: "no_identity";
28
+ binding_invalid: "binding_invalid";
29
+ jelly_unavailable: "jelly_unavailable";
30
+ log_conflict: "log_conflict";
31
+ device_limit: "device_limit";
32
+ admission_required: "admission_required";
33
+ admission_invalid: "admission_invalid";
34
+ directory_inconsistent: "directory_inconsistent";
35
+ unknown_device: "unknown_device";
36
+ directory_unavailable: "directory_unavailable";
37
+ login_unsupported: "login_unsupported";
38
+ login_denied: "login_denied";
39
+ grant_required: "grant_required";
40
+ grant_invalid: "grant_invalid";
41
+ ticket_required: "ticket_required";
42
+ ticket_invalid: "ticket_invalid";
43
+ daemon_unavailable: "daemon_unavailable";
44
+ daemon_mismatch: "daemon_mismatch";
45
+ internal: "internal";
46
+ }>;
47
+ export type ErrorCode = z.infer<typeof ErrorCode>;
48
+ export declare const ErrorBody: z.ZodObject<{
49
+ code: z.ZodEnum<{
50
+ expired: "expired";
51
+ invalid_request: "invalid_request";
52
+ not_member: "not_member";
53
+ bad_signature: "bad_signature";
54
+ unknown_session: "unknown_session";
55
+ ambiguous_address: "ambiguous_address";
56
+ no_recipients: "no_recipients";
57
+ unknown_address: "unknown_address";
58
+ refused: "refused";
59
+ declined: "declined";
60
+ request_required: "request_required";
61
+ rate_limited: "rate_limited";
62
+ loop_guard: "loop_guard";
63
+ too_large: "too_large";
64
+ secret_refused: "secret_refused";
65
+ duplicate: "duplicate";
66
+ relay_unavailable: "relay_unavailable";
67
+ not_found: "not_found";
68
+ invalid_state: "invalid_state";
69
+ forbidden: "forbidden";
70
+ guarded_turn: "guarded_turn";
71
+ roster_conflict: "roster_conflict";
72
+ invite_invalid: "invite_invalid";
73
+ no_identity: "no_identity";
74
+ binding_invalid: "binding_invalid";
75
+ jelly_unavailable: "jelly_unavailable";
76
+ log_conflict: "log_conflict";
77
+ device_limit: "device_limit";
78
+ admission_required: "admission_required";
79
+ admission_invalid: "admission_invalid";
80
+ directory_inconsistent: "directory_inconsistent";
81
+ unknown_device: "unknown_device";
82
+ directory_unavailable: "directory_unavailable";
83
+ login_unsupported: "login_unsupported";
84
+ login_denied: "login_denied";
85
+ grant_required: "grant_required";
86
+ grant_invalid: "grant_invalid";
87
+ ticket_required: "ticket_required";
88
+ ticket_invalid: "ticket_invalid";
89
+ daemon_unavailable: "daemon_unavailable";
90
+ daemon_mismatch: "daemon_mismatch";
91
+ internal: "internal";
92
+ }>;
93
+ message: z.ZodString;
94
+ }, z.core.$strip>;
95
+ export type ErrorBody = z.infer<typeof ErrorBody>;
96
+ /** Error carrying a Messaging code. Messages must never contain bodies, keys or secrets. */
97
+ export declare class MessagingError extends Error {
98
+ readonly code: ErrorCode;
99
+ constructor(code: ErrorCode, message: string, options?: {
100
+ cause?: unknown;
101
+ });
102
+ toBody(): ErrorBody;
103
+ }
104
+ export declare function isMessagingError(value: unknown): value is MessagingError;
@@ -0,0 +1,15 @@
1
+ export * from "./common.js";
2
+ export * from "./errors.js";
3
+ export * from "./realm.js";
4
+ export * from "./jelly.js";
5
+ export * from "./directory.js";
6
+ export * as A2A from "./a2a.js";
7
+ export * from "./envelope.js";
8
+ export * from "./delegation.js";
9
+ export * from "./consent.js";
10
+ export * from "./roster.js";
11
+ export * from "./relay.js";
12
+ export * from "./directory-frames.js";
13
+ export * from "./ipc.js";
14
+ export * from "./ipc/device.js";
15
+ export * from "./ipc/consent.js";
@@ -0,0 +1,555 @@
1
+ /**
2
+ * Consent methods (spec §8.2, "Consent"; §6.9): grants and held requests. Every one is human tier: none is in `AGENT_METHODS`, so the agent
3
+ * socket refuses them, and agents never set or read a person's grants. Spread into `IPC_METHODS`.
4
+ */
5
+ import { z } from "zod";
6
+ /** A grant's subject as a person names it: a person, or a channel by its name here. */
7
+ export declare const GrantTarget: z.ZodUnion<readonly [z.ZodObject<{
8
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
9
+ }, z.core.$strict>, z.ZodObject<{
10
+ channel: z.ZodString;
11
+ }, z.core.$strict>]>;
12
+ export type GrantTarget = z.infer<typeof GrantTarget>;
13
+ /** A grant as this device holds it. A channel subject carries the channel's id and, while this person is in it, its name here. */
14
+ export declare const GrantView: z.ZodObject<{
15
+ id: z.ZodString;
16
+ ts: z.ZodNumber;
17
+ by: z.ZodString;
18
+ resignedAt: z.ZodOptional<z.ZodNumber>;
19
+ chat: z.ZodOptional<z.ZodEnum<{
20
+ open: "open";
21
+ muted: "muted";
22
+ blocked: "blocked";
23
+ }>>;
24
+ agentMail: z.ZodOptional<z.ZodEnum<{
25
+ open: "open";
26
+ blocked: "blocked";
27
+ }>>;
28
+ ask: z.ZodOptional<z.ZodEnum<{
29
+ open: "open";
30
+ request: "request";
31
+ no: "no";
32
+ }>>;
33
+ trustedUntil: z.ZodOptional<z.ZodNumber>;
34
+ discoverable: z.ZodOptional<z.ZodBoolean>;
35
+ subject: z.ZodUnion<readonly [z.ZodObject<{
36
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
37
+ }, z.core.$strip>, z.ZodObject<{
38
+ channel: z.ZodString;
39
+ name: z.ZodOptional<z.ZodString>;
40
+ }, z.core.$strip>]>;
41
+ }, z.core.$strip>;
42
+ export type GrantView = z.infer<typeof GrantView>;
43
+ /** Widening levels that lapsed with their signer, waiting for the person to set them again (spec §6.9, "Signers"). */
44
+ export declare const GrantReview: z.ZodObject<{
45
+ subject: z.ZodUnion<readonly [z.ZodObject<{
46
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
47
+ }, z.core.$strip>, z.ZodObject<{
48
+ channel: z.ZodString;
49
+ name: z.ZodOptional<z.ZodString>;
50
+ }, z.core.$strip>]>;
51
+ chat: z.ZodOptional<z.ZodLiteral<"open">>;
52
+ agentMail: z.ZodOptional<z.ZodLiteral<"open">>;
53
+ ask: z.ZodOptional<z.ZodEnum<{
54
+ open: "open";
55
+ request: "request";
56
+ }>>;
57
+ trustedUntil: z.ZodOptional<z.ZodNumber>;
58
+ discoverable: z.ZodOptional<z.ZodLiteral<true>>;
59
+ at: z.ZodNumber;
60
+ }, z.core.$strip>;
61
+ export type GrantReview = z.infer<typeof GrantReview>;
62
+ /**
63
+ * `grant.set`'s params: the whole new grant for one subject. A level left out is the relation's default; with no
64
+ * level it is a clear. `trust: true` trusts for `LIMITS.trustDefaultMs`; `trustedUntil` names the end instead.
65
+ */
66
+ export declare const GrantSetParams: z.ZodObject<{
67
+ trust: z.ZodOptional<z.ZodLiteral<true>>;
68
+ chat: z.ZodOptional<z.ZodEnum<{
69
+ open: "open";
70
+ muted: "muted";
71
+ blocked: "blocked";
72
+ }>>;
73
+ agentMail: z.ZodOptional<z.ZodEnum<{
74
+ open: "open";
75
+ blocked: "blocked";
76
+ }>>;
77
+ ask: z.ZodOptional<z.ZodEnum<{
78
+ open: "open";
79
+ request: "request";
80
+ no: "no";
81
+ }>>;
82
+ trustedUntil: z.ZodOptional<z.ZodNumber>;
83
+ discoverable: z.ZodOptional<z.ZodBoolean>;
84
+ subject: z.ZodUnion<readonly [z.ZodObject<{
85
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
86
+ }, z.core.$strict>, z.ZodObject<{
87
+ channel: z.ZodString;
88
+ }, z.core.$strict>]>;
89
+ }, z.core.$strict>;
90
+ export type GrantSetParams = z.infer<typeof GrantSetParams>;
91
+ /** A request this device holds for its person to answer (spec §6.9, "Holds"): mail or a task to one of their agents. */
92
+ export declare const AskRequest: z.ZodObject<{
93
+ id: z.ZodString;
94
+ kind: z.ZodEnum<{
95
+ message: "message";
96
+ task: "task";
97
+ }>;
98
+ from: z.ZodObject<{
99
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
100
+ device: z.ZodString;
101
+ label: z.ZodString;
102
+ agent: z.ZodString;
103
+ address: z.ZodString;
104
+ }, z.core.$strip>;
105
+ to: z.ZodString;
106
+ preview: z.ZodString;
107
+ at: z.ZodNumber;
108
+ exp: z.ZodNumber;
109
+ }, z.core.$strip>;
110
+ export type AskRequest = z.infer<typeof AskRequest>;
111
+ /**
112
+ * A message request this device holds for its person (spec §6.9, "Message requests"): a person of another org asks to
113
+ * write to them. `name`, `email` and `org` are the realm's verified profile of the sender, never the request's text.
114
+ */
115
+ export declare const ContactRequestView: z.ZodObject<{
116
+ id: z.ZodString;
117
+ kind: z.ZodLiteral<"contact">;
118
+ from: z.ZodObject<{
119
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
120
+ device: z.ZodString;
121
+ label: z.ZodString;
122
+ name: z.ZodString;
123
+ email: z.ZodOptional<z.ZodString>;
124
+ org: z.ZodEnum<{
125
+ other: "other";
126
+ none: "none";
127
+ same: "same";
128
+ }>;
129
+ }, z.core.$strip>;
130
+ text: z.ZodString;
131
+ at: z.ZodNumber;
132
+ exp: z.ZodNumber;
133
+ }, z.core.$strip>;
134
+ export type ContactRequestView = z.infer<typeof ContactRequestView>;
135
+ /**
136
+ * A contact one of this person's agents asks them to make (spec §6.9, "Message requests"): `send {to: "me", request:
137
+ * {contact}}`. Only the person sends a message request, with `contact.request`; answering this one `decline`
138
+ * dismisses it.
139
+ */
140
+ export declare const ContactSuggestion: z.ZodObject<{
141
+ id: z.ZodString;
142
+ kind: z.ZodLiteral<"suggestion">;
143
+ agent: z.ZodString;
144
+ email: z.ZodString;
145
+ at: z.ZodNumber;
146
+ }, z.core.$strip>;
147
+ export type ContactSuggestion = z.infer<typeof ContactSuggestion>;
148
+ /** What `request.list` lists: asks to the person's agents, message requests, and contacts their agents suggest. */
149
+ export declare const HeldRequest: z.ZodUnion<readonly [z.ZodObject<{
150
+ id: z.ZodString;
151
+ kind: z.ZodEnum<{
152
+ message: "message";
153
+ task: "task";
154
+ }>;
155
+ from: z.ZodObject<{
156
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
157
+ device: z.ZodString;
158
+ label: z.ZodString;
159
+ agent: z.ZodString;
160
+ address: z.ZodString;
161
+ }, z.core.$strip>;
162
+ to: z.ZodString;
163
+ preview: z.ZodString;
164
+ at: z.ZodNumber;
165
+ exp: z.ZodNumber;
166
+ }, z.core.$strip>, z.ZodObject<{
167
+ id: z.ZodString;
168
+ kind: z.ZodLiteral<"contact">;
169
+ from: z.ZodObject<{
170
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
171
+ device: z.ZodString;
172
+ label: z.ZodString;
173
+ name: z.ZodString;
174
+ email: z.ZodOptional<z.ZodString>;
175
+ org: z.ZodEnum<{
176
+ other: "other";
177
+ none: "none";
178
+ same: "same";
179
+ }>;
180
+ }, z.core.$strip>;
181
+ text: z.ZodString;
182
+ at: z.ZodNumber;
183
+ exp: z.ZodNumber;
184
+ }, z.core.$strip>, z.ZodObject<{
185
+ id: z.ZodString;
186
+ kind: z.ZodLiteral<"suggestion">;
187
+ agent: z.ZodString;
188
+ email: z.ZodString;
189
+ at: z.ZodNumber;
190
+ }, z.core.$strip>]>;
191
+ export type HeldRequest = z.infer<typeof HeldRequest>;
192
+ /**
193
+ * For an ask: `once` delivers it, guarded; `always` sets the sender's grant to `ask: "open"` (keeping its other
194
+ * levels), then delivers it, guarded. For a message request: `accept` sets the sender's grant to `chat: "open"`
195
+ * (keeping its other levels), files the request as their first line and sends them a card. For both: `decline`
196
+ * refuses it (`declined`); `block` sets the sender's grant to `chat: "blocked"` (keeping its other levels), then
197
+ * declines it. For a suggestion: `decline` dismisses it.
198
+ */
199
+ export declare const RequestAnswer: z.ZodEnum<{
200
+ once: "once";
201
+ always: "always";
202
+ accept: "accept";
203
+ decline: "decline";
204
+ block: "block";
205
+ }>;
206
+ export type RequestAnswer = z.infer<typeof RequestAnswer>;
207
+ /** A message request's text: 1 to `LIMITS.requestChars` UTF-16 code units. */
208
+ export declare const RequestText: z.ZodString;
209
+ /**
210
+ * What another person's card says this person may send them, or, with no card, the defaults of the relation
211
+ * (spec §6.9, "Contact cards"). `at` is when the card was signed.
212
+ */
213
+ /**
214
+ * What a person may be sent (spec §6.9, "Contact cards"), and `devicesChangedAt`: when a device of theirs was last
215
+ * added or removed, while that is under 7 days ago (design §2.8: their devices changed; a rekey or attest is not a change).
216
+ */
217
+ export declare const PersonReach: z.ZodObject<{
218
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
219
+ can: z.ZodObject<{
220
+ chat: z.ZodBoolean;
221
+ agentMail: z.ZodBoolean;
222
+ ask: z.ZodEnum<{
223
+ open: "open";
224
+ request: "request";
225
+ no: "no";
226
+ }>;
227
+ trustedUntil: z.ZodOptional<z.ZodNumber>;
228
+ }, z.core.$strict>;
229
+ source: z.ZodEnum<{
230
+ default: "default";
231
+ card: "card";
232
+ }>;
233
+ at: z.ZodOptional<z.ZodNumber>;
234
+ devicesChangedAt: z.ZodOptional<z.ZodNumber>;
235
+ }, z.core.$strip>;
236
+ export type PersonReach = z.infer<typeof PersonReach>;
237
+ /** `request.answer`'s params, which `request.answer.preview` takes too (spec §8.2, "Previews"). */
238
+ export declare const RequestAnswerParams: z.ZodObject<{
239
+ id: z.ZodString;
240
+ answer: z.ZodEnum<{
241
+ once: "once";
242
+ always: "always";
243
+ accept: "accept";
244
+ decline: "decline";
245
+ block: "block";
246
+ }>;
247
+ all: z.ZodOptional<z.ZodBoolean>;
248
+ }, z.core.$strict>;
249
+ /** `contact.request`'s params; its preview takes them with `text` optional (it reads only `email`). */
250
+ export declare const ContactRequestParams: z.ZodObject<{
251
+ email: z.ZodString;
252
+ text: z.ZodString;
253
+ suggestion: z.ZodOptional<z.ZodString>;
254
+ }, z.core.$strict>;
255
+ export declare const CONSENT_METHODS: {
256
+ /** This person's grants, newest first, and the review list. With `subject`, only that subject's. */
257
+ readonly "grant.list": {
258
+ readonly params: z.ZodObject<{
259
+ subject: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
260
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
261
+ }, z.core.$strict>, z.ZodObject<{
262
+ channel: z.ZodString;
263
+ }, z.core.$strict>]>>;
264
+ }, z.core.$strict>;
265
+ readonly result: z.ZodObject<{
266
+ grants: z.ZodArray<z.ZodObject<{
267
+ id: z.ZodString;
268
+ ts: z.ZodNumber;
269
+ by: z.ZodString;
270
+ resignedAt: z.ZodOptional<z.ZodNumber>;
271
+ chat: z.ZodOptional<z.ZodEnum<{
272
+ open: "open";
273
+ muted: "muted";
274
+ blocked: "blocked";
275
+ }>>;
276
+ agentMail: z.ZodOptional<z.ZodEnum<{
277
+ open: "open";
278
+ blocked: "blocked";
279
+ }>>;
280
+ ask: z.ZodOptional<z.ZodEnum<{
281
+ open: "open";
282
+ request: "request";
283
+ no: "no";
284
+ }>>;
285
+ trustedUntil: z.ZodOptional<z.ZodNumber>;
286
+ discoverable: z.ZodOptional<z.ZodBoolean>;
287
+ subject: z.ZodUnion<readonly [z.ZodObject<{
288
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
289
+ }, z.core.$strip>, z.ZodObject<{
290
+ channel: z.ZodString;
291
+ name: z.ZodOptional<z.ZodString>;
292
+ }, z.core.$strip>]>;
293
+ }, z.core.$strip>>;
294
+ review: z.ZodArray<z.ZodObject<{
295
+ subject: z.ZodUnion<readonly [z.ZodObject<{
296
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
297
+ }, z.core.$strip>, z.ZodObject<{
298
+ channel: z.ZodString;
299
+ name: z.ZodOptional<z.ZodString>;
300
+ }, z.core.$strip>]>;
301
+ chat: z.ZodOptional<z.ZodLiteral<"open">>;
302
+ agentMail: z.ZodOptional<z.ZodLiteral<"open">>;
303
+ ask: z.ZodOptional<z.ZodEnum<{
304
+ open: "open";
305
+ request: "request";
306
+ }>>;
307
+ trustedUntil: z.ZodOptional<z.ZodNumber>;
308
+ discoverable: z.ZodOptional<z.ZodLiteral<true>>;
309
+ at: z.ZodNumber;
310
+ }, z.core.$strip>>;
311
+ }, z.core.$strip>;
312
+ };
313
+ /**
314
+ * Signs and stores the subject's new grant, sends it to this person's other devices, and drops the subject from
315
+ * the review list. `not_found` for a person the realm does not know or a channel this person is not in.
316
+ */
317
+ readonly "grant.set": {
318
+ readonly params: z.ZodObject<{
319
+ trust: z.ZodOptional<z.ZodLiteral<true>>;
320
+ chat: z.ZodOptional<z.ZodEnum<{
321
+ open: "open";
322
+ muted: "muted";
323
+ blocked: "blocked";
324
+ }>>;
325
+ agentMail: z.ZodOptional<z.ZodEnum<{
326
+ open: "open";
327
+ blocked: "blocked";
328
+ }>>;
329
+ ask: z.ZodOptional<z.ZodEnum<{
330
+ open: "open";
331
+ request: "request";
332
+ no: "no";
333
+ }>>;
334
+ trustedUntil: z.ZodOptional<z.ZodNumber>;
335
+ discoverable: z.ZodOptional<z.ZodBoolean>;
336
+ subject: z.ZodUnion<readonly [z.ZodObject<{
337
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
338
+ }, z.core.$strict>, z.ZodObject<{
339
+ channel: z.ZodString;
340
+ }, z.core.$strict>]>;
341
+ }, z.core.$strict>;
342
+ readonly result: z.ZodObject<{
343
+ grant: z.ZodObject<{
344
+ id: z.ZodString;
345
+ ts: z.ZodNumber;
346
+ by: z.ZodString;
347
+ resignedAt: z.ZodOptional<z.ZodNumber>;
348
+ chat: z.ZodOptional<z.ZodEnum<{
349
+ open: "open";
350
+ muted: "muted";
351
+ blocked: "blocked";
352
+ }>>;
353
+ agentMail: z.ZodOptional<z.ZodEnum<{
354
+ open: "open";
355
+ blocked: "blocked";
356
+ }>>;
357
+ ask: z.ZodOptional<z.ZodEnum<{
358
+ open: "open";
359
+ request: "request";
360
+ no: "no";
361
+ }>>;
362
+ trustedUntil: z.ZodOptional<z.ZodNumber>;
363
+ discoverable: z.ZodOptional<z.ZodBoolean>;
364
+ subject: z.ZodUnion<readonly [z.ZodObject<{
365
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
366
+ }, z.core.$strip>, z.ZodObject<{
367
+ channel: z.ZodString;
368
+ name: z.ZodOptional<z.ZodString>;
369
+ }, z.core.$strip>]>;
370
+ }, z.core.$strip>;
371
+ }, z.core.$strip>;
372
+ };
373
+ /** What `grant.set` with these params would mean, in one fixed sentence; changes nothing. */
374
+ readonly "grant.set.preview": {
375
+ readonly params: z.ZodObject<{
376
+ trust: z.ZodOptional<z.ZodLiteral<true>>;
377
+ chat: z.ZodOptional<z.ZodEnum<{
378
+ open: "open";
379
+ muted: "muted";
380
+ blocked: "blocked";
381
+ }>>;
382
+ agentMail: z.ZodOptional<z.ZodEnum<{
383
+ open: "open";
384
+ blocked: "blocked";
385
+ }>>;
386
+ ask: z.ZodOptional<z.ZodEnum<{
387
+ open: "open";
388
+ request: "request";
389
+ no: "no";
390
+ }>>;
391
+ trustedUntil: z.ZodOptional<z.ZodNumber>;
392
+ discoverable: z.ZodOptional<z.ZodBoolean>;
393
+ subject: z.ZodUnion<readonly [z.ZodObject<{
394
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
395
+ }, z.core.$strict>, z.ZodObject<{
396
+ channel: z.ZodString;
397
+ }, z.core.$strict>]>;
398
+ }, z.core.$strict>;
399
+ readonly result: z.ZodObject<{
400
+ sentence: z.ZodString;
401
+ }, z.core.$strip>;
402
+ };
403
+ /** The requests this device holds for its person, oldest first: asks, then message requests, then suggestions. */
404
+ readonly "request.list": {
405
+ readonly params: z.ZodObject<{}, z.core.$strict>;
406
+ readonly result: z.ZodObject<{
407
+ requests: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
408
+ id: z.ZodString;
409
+ kind: z.ZodEnum<{
410
+ message: "message";
411
+ task: "task";
412
+ }>;
413
+ from: z.ZodObject<{
414
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
415
+ device: z.ZodString;
416
+ label: z.ZodString;
417
+ agent: z.ZodString;
418
+ address: z.ZodString;
419
+ }, z.core.$strip>;
420
+ to: z.ZodString;
421
+ preview: z.ZodString;
422
+ at: z.ZodNumber;
423
+ exp: z.ZodNumber;
424
+ }, z.core.$strip>, z.ZodObject<{
425
+ id: z.ZodString;
426
+ kind: z.ZodLiteral<"contact">;
427
+ from: z.ZodObject<{
428
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
429
+ device: z.ZodString;
430
+ label: z.ZodString;
431
+ name: z.ZodString;
432
+ email: z.ZodOptional<z.ZodString>;
433
+ org: z.ZodEnum<{
434
+ other: "other";
435
+ none: "none";
436
+ same: "same";
437
+ }>;
438
+ }, z.core.$strip>;
439
+ text: z.ZodString;
440
+ at: z.ZodNumber;
441
+ exp: z.ZodNumber;
442
+ }, z.core.$strip>, z.ZodObject<{
443
+ id: z.ZodString;
444
+ kind: z.ZodLiteral<"suggestion">;
445
+ agent: z.ZodString;
446
+ email: z.ZodString;
447
+ at: z.ZodNumber;
448
+ }, z.core.$strip>]>>;
449
+ }, z.core.$strip>;
450
+ };
451
+ /**
452
+ * Answers a held request; with `all`, every request of the same kind held from the same sending person. Returns
453
+ * the ids answered. `not_found` for an id this device does not hold; `invalid_request` for an answer its kind does
454
+ * not take.
455
+ */
456
+ readonly "request.answer": {
457
+ readonly params: z.ZodObject<{
458
+ id: z.ZodString;
459
+ answer: z.ZodEnum<{
460
+ once: "once";
461
+ always: "always";
462
+ accept: "accept";
463
+ decline: "decline";
464
+ block: "block";
465
+ }>;
466
+ all: z.ZodOptional<z.ZodBoolean>;
467
+ }, z.core.$strict>;
468
+ readonly result: z.ZodObject<{
469
+ answered: z.ZodArray<z.ZodString>;
470
+ }, z.core.$strip>;
471
+ };
472
+ /**
473
+ * Read-only: what `request.answer` would do, for its confirmation (spec §6.9, "Holds", "Message requests"). It takes
474
+ * exactly `request.answer`'s input. It returns whom the person answers (`from`: the realm's verified profile of the
475
+ * sender, or of the person for their own agent's suggestion; `name` and `email` are untrusted text), the request's
476
+ * `kind`, the sender's `agent` and the local session it is `to` (an ask), how many requests the answer would settle
477
+ * (`count`, more than 1 only with `all`), and one fixed `sentence`: what this `answer` does. `not_found` and `invalid_request` as `request.answer` would answer. Changes nothing.
478
+ */
479
+ readonly "request.answer.preview": {
480
+ readonly params: z.ZodObject<{
481
+ id: z.ZodString;
482
+ answer: z.ZodEnum<{
483
+ once: "once";
484
+ always: "always";
485
+ accept: "accept";
486
+ decline: "decline";
487
+ block: "block";
488
+ }>;
489
+ all: z.ZodOptional<z.ZodBoolean>;
490
+ }, z.core.$strict>;
491
+ readonly result: z.ZodObject<{
492
+ kind: z.ZodEnum<{
493
+ message: "message";
494
+ task: "task";
495
+ contact: "contact";
496
+ suggestion: "suggestion";
497
+ }>;
498
+ from: z.ZodObject<{
499
+ name: z.ZodString;
500
+ email: z.ZodOptional<z.ZodString>;
501
+ org: z.ZodEnum<{
502
+ other: "other";
503
+ none: "none";
504
+ same: "same";
505
+ }>;
506
+ }, z.core.$strip>;
507
+ agent: z.ZodOptional<z.ZodString>;
508
+ to: z.ZodOptional<z.ZodString>;
509
+ count: z.ZodNumber;
510
+ sentence: z.ZodString;
511
+ }, z.core.$strip>;
512
+ };
513
+ /**
514
+ * A message request (spec §6.9, "Message requests"), hosted realms only: resolves the exact `email` at the
515
+ * directory, then sends `text` to every device of that person as a request, and files it as this person's line in
516
+ * `dm:<person>`. `not_found` when no Messaging user with that email accepts requests (the same for an unknown and an
517
+ * undiscoverable email); `rate_limited` while a request to them waits, or past `LIMITS.requestsPerDay` persons
518
+ * today. `suggestion` dismisses the agent's suggestion it answers.
519
+ */
520
+ readonly "contact.request": {
521
+ readonly params: z.ZodObject<{
522
+ email: z.ZodString;
523
+ text: z.ZodString;
524
+ suggestion: z.ZodOptional<z.ZodString>;
525
+ }, z.core.$strict>;
526
+ readonly result: z.ZodObject<{
527
+ id: z.ZodString;
528
+ conversation: z.ZodString;
529
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
530
+ }, z.core.$strip>;
531
+ };
532
+ /** Whether `contact.request` would find a person for `email`; counts against the directory's lookup limits. Sends nothing. */
533
+ readonly "contact.request.preview": {
534
+ readonly params: z.ZodObject<{
535
+ email: z.ZodString;
536
+ text: z.ZodOptional<z.ZodString>;
537
+ suggestion: z.ZodOptional<z.ZodString>;
538
+ }, z.core.$strict>;
539
+ readonly result: z.ZodObject<{
540
+ found: z.ZodBoolean;
541
+ }, z.core.$strip>;
542
+ };
543
+ /**
544
+ * Asks `person` for their card (spec §6.9, "Contact cards"): at most once a day per person; `sent: false` when
545
+ * this device asked them in the last day.
546
+ */
547
+ readonly "card.get": {
548
+ readonly params: z.ZodObject<{
549
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
550
+ }, z.core.$strict>;
551
+ readonly result: z.ZodObject<{
552
+ sent: z.ZodBoolean;
553
+ }, z.core.$strip>;
554
+ };
555
+ };