@joe-broadhead/messaging 0.0.0-stage → 0.7.1

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 (273) hide show
  1. package/CHANGELOG.md +220 -0
  2. package/LICENSE +21 -0
  3. package/NOTICE +12 -0
  4. package/README.md +36 -2
  5. package/dist/bin/messaging-mcp.js +26524 -0
  6. package/dist/bin/messaging-relay.js +19768 -0
  7. package/dist/bin/messaging.js +15465 -0
  8. package/dist/bin/messagingd.js +29449 -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 +477 -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/conversation/context.js +80 -0
  24. package/dist/lib/modules/core/conversation/event.js +100 -0
  25. package/dist/lib/modules/core/conversation/ids.js +38 -0
  26. package/dist/lib/modules/core/conversation/link.js +35 -0
  27. package/dist/lib/modules/core/conversation/log.js +766 -0
  28. package/dist/lib/modules/core/conversation/ratchet.js +243 -0
  29. package/dist/lib/modules/core/conversation/seal.js +198 -0
  30. package/dist/lib/modules/core/delegation.js +174 -0
  31. package/dist/lib/modules/core/directory/device-log.js +258 -0
  32. package/dist/lib/modules/core/directory/epoch.js +103 -0
  33. package/dist/lib/modules/core/directory/handle.js +29 -0
  34. package/dist/lib/modules/core/directory/jelly-device.js +204 -0
  35. package/dist/lib/modules/core/directory/jelly-issuer.js +12 -0
  36. package/dist/lib/modules/core/directory/jelly-token.js +305 -0
  37. package/dist/lib/modules/core/directory/keys-statement.js +43 -0
  38. package/dist/lib/modules/core/directory/link.js +81 -0
  39. package/dist/lib/modules/core/directory/merkle-log.js +250 -0
  40. package/dist/lib/modules/core/directory/person-view.js +197 -0
  41. package/dist/lib/modules/core/directory/person.js +40 -0
  42. package/dist/lib/modules/core/directory/realm.js +59 -0
  43. package/dist/lib/modules/core/directory/smt.js +266 -0
  44. package/dist/lib/modules/core/envelope.js +320 -0
  45. package/dist/lib/modules/core/hash.js +5 -0
  46. package/dist/lib/modules/core/head.js +27 -0
  47. package/dist/lib/modules/core/identity.js +71 -0
  48. package/dist/lib/modules/core/index.js +53 -0
  49. package/dist/lib/modules/core/jcs.js +96 -0
  50. package/dist/lib/modules/core/jelly-host-double.js +35 -0
  51. package/dist/lib/modules/core/jelly-host.js +211 -0
  52. package/dist/lib/modules/core/keys.js +79 -0
  53. package/dist/lib/modules/core/peer-text.js +563 -0
  54. package/dist/lib/modules/core/realm.js +1 -0
  55. package/dist/lib/modules/core/roster.js +454 -0
  56. package/dist/lib/modules/core/schema/a2a.js +85 -0
  57. package/dist/lib/modules/core/schema/common.js +310 -0
  58. package/dist/lib/modules/core/schema/consent.js +120 -0
  59. package/dist/lib/modules/core/schema/conversation.js +292 -0
  60. package/dist/lib/modules/core/schema/delegation.js +58 -0
  61. package/dist/lib/modules/core/schema/directory-frames.js +270 -0
  62. package/dist/lib/modules/core/schema/directory.js +169 -0
  63. package/dist/lib/modules/core/schema/envelope.js +211 -0
  64. package/dist/lib/modules/core/schema/errors.js +104 -0
  65. package/dist/lib/modules/core/schema/index.js +16 -0
  66. package/dist/lib/modules/core/schema/ipc/consent.js +181 -0
  67. package/dist/lib/modules/core/schema/ipc/device.js +276 -0
  68. package/dist/lib/modules/core/schema/ipc/jelly.js +189 -0
  69. package/dist/lib/modules/core/schema/ipc/shapes.js +185 -0
  70. package/dist/lib/modules/core/schema/ipc/surfaces.js +223 -0
  71. package/dist/lib/modules/core/schema/ipc.js +451 -0
  72. package/dist/lib/modules/core/schema/jelly.js +122 -0
  73. package/dist/lib/modules/core/schema/realm.js +27 -0
  74. package/dist/lib/modules/core/schema/relay.js +112 -0
  75. package/dist/lib/modules/core/schema/roster.js +126 -0
  76. package/dist/lib/modules/core/sign.js +43 -0
  77. package/dist/lib/modules/core/task.js +37 -0
  78. package/dist/lib/modules/core/testing.js +21 -0
  79. package/dist/lib/modules/core/ulid.js +36 -0
  80. package/dist/lib/modules/core/version.js +6 -0
  81. package/dist/lib/modules/core/wire.js +255 -0
  82. package/dist/lib/modules/ipc/client.js +289 -0
  83. package/dist/lib/modules/ipc/framing.js +33 -0
  84. package/dist/lib/modules/ipc/index.js +6 -0
  85. package/dist/lib/modules/ipc/paths.js +102 -0
  86. package/dist/lib/modules/ipc/pipes.js +65 -0
  87. package/dist/lib/modules/ipc/rpc.js +8 -0
  88. package/dist/lib/modules/ipc/server.js +317 -0
  89. package/dist/lib/modules/ipc/testing.js +145 -0
  90. package/dist/lib/modules/ipc/trust.js +166 -0
  91. package/dist/lib/modules/ipc/windows-acl.js +275 -0
  92. package/dist/lib/modules/vendor/zod/index.js +7 -0
  93. package/dist/lib/modules/vendor/zod/v4/classic/checks.js +1 -0
  94. package/dist/lib/modules/vendor/zod/v4/classic/coerce.js +17 -0
  95. package/dist/lib/modules/vendor/zod/v4/classic/compat.js +31 -0
  96. package/dist/lib/modules/vendor/zod/v4/classic/deep-partial.js +13 -0
  97. package/dist/lib/modules/vendor/zod/v4/classic/errors.js +57 -0
  98. package/dist/lib/modules/vendor/zod/v4/classic/external.js +17 -0
  99. package/dist/lib/modules/vendor/zod/v4/classic/from-json-schema.js +881 -0
  100. package/dist/lib/modules/vendor/zod/v4/classic/in-out.js +36 -0
  101. package/dist/lib/modules/vendor/zod/v4/classic/iso.js +15 -0
  102. package/dist/lib/modules/vendor/zod/v4/classic/parse.js +16 -0
  103. package/dist/lib/modules/vendor/zod/v4/classic/schemas.js +1535 -0
  104. package/dist/lib/modules/vendor/zod/v4/core/api.js +1107 -0
  105. package/dist/lib/modules/vendor/zod/v4/core/checks.js +516 -0
  106. package/dist/lib/modules/vendor/zod/v4/core/compile.js +1866 -0
  107. package/dist/lib/modules/vendor/zod/v4/core/core.js +141 -0
  108. package/dist/lib/modules/vendor/zod/v4/core/doc.js +38 -0
  109. package/dist/lib/modules/vendor/zod/v4/core/errors.js +267 -0
  110. package/dist/lib/modules/vendor/zod/v4/core/index.js +19 -0
  111. package/dist/lib/modules/vendor/zod/v4/core/json-schema-generator.js +99 -0
  112. package/dist/lib/modules/vendor/zod/v4/core/json-schema-processors.js +843 -0
  113. package/dist/lib/modules/vendor/zod/v4/core/json-schema.js +1 -0
  114. package/dist/lib/modules/vendor/zod/v4/core/memoizer.js +311 -0
  115. package/dist/lib/modules/vendor/zod/v4/core/parse.js +175 -0
  116. package/dist/lib/modules/vendor/zod/v4/core/regexes.js +156 -0
  117. package/dist/lib/modules/vendor/zod/v4/core/registries.js +51 -0
  118. package/dist/lib/modules/vendor/zod/v4/core/schemas.js +2636 -0
  119. package/dist/lib/modules/vendor/zod/v4/core/to-json-schema.js +651 -0
  120. package/dist/lib/modules/vendor/zod/v4/core/util.js +873 -0
  121. package/dist/lib/modules/vendor/zod/v4/core/versions.js +5 -0
  122. package/dist/lib/modules/vendor/zod/v4/core/visit.js +169 -0
  123. package/dist/lib/modules/vendor/zod/v4/locales/ar.js +111 -0
  124. package/dist/lib/modules/vendor/zod/v4/locales/az.js +110 -0
  125. package/dist/lib/modules/vendor/zod/v4/locales/be.js +168 -0
  126. package/dist/lib/modules/vendor/zod/v4/locales/bg.js +125 -0
  127. package/dist/lib/modules/vendor/zod/v4/locales/bn.js +113 -0
  128. package/dist/lib/modules/vendor/zod/v4/locales/ca.js +112 -0
  129. package/dist/lib/modules/vendor/zod/v4/locales/ckb.js +133 -0
  130. package/dist/lib/modules/vendor/zod/v4/locales/cs.js +116 -0
  131. package/dist/lib/modules/vendor/zod/v4/locales/da.js +120 -0
  132. package/dist/lib/modules/vendor/zod/v4/locales/de.js +113 -0
  133. package/dist/lib/modules/vendor/zod/v4/locales/el.js +112 -0
  134. package/dist/lib/modules/vendor/zod/v4/locales/en.js +125 -0
  135. package/dist/lib/modules/vendor/zod/v4/locales/eo.js +114 -0
  136. package/dist/lib/modules/vendor/zod/v4/locales/es.js +136 -0
  137. package/dist/lib/modules/vendor/zod/v4/locales/fa.js +119 -0
  138. package/dist/lib/modules/vendor/zod/v4/locales/fi.js +117 -0
  139. package/dist/lib/modules/vendor/zod/v4/locales/fr-CA.js +112 -0
  140. package/dist/lib/modules/vendor/zod/v4/locales/fr.js +129 -0
  141. package/dist/lib/modules/vendor/zod/v4/locales/gu.js +113 -0
  142. package/dist/lib/modules/vendor/zod/v4/locales/he.js +221 -0
  143. package/dist/lib/modules/vendor/zod/v4/locales/hi.js +111 -0
  144. package/dist/lib/modules/vendor/zod/v4/locales/hr.js +126 -0
  145. package/dist/lib/modules/vendor/zod/v4/locales/hu.js +113 -0
  146. package/dist/lib/modules/vendor/zod/v4/locales/hy.js +158 -0
  147. package/dist/lib/modules/vendor/zod/v4/locales/id.js +111 -0
  148. package/dist/lib/modules/vendor/zod/v4/locales/index.js +63 -0
  149. package/dist/lib/modules/vendor/zod/v4/locales/is.js +114 -0
  150. package/dist/lib/modules/vendor/zod/v4/locales/it.js +113 -0
  151. package/dist/lib/modules/vendor/zod/v4/locales/ja.js +112 -0
  152. package/dist/lib/modules/vendor/zod/v4/locales/ka.js +117 -0
  153. package/dist/lib/modules/vendor/zod/v4/locales/kh.js +5 -0
  154. package/dist/lib/modules/vendor/zod/v4/locales/km.js +115 -0
  155. package/dist/lib/modules/vendor/zod/v4/locales/kn.js +116 -0
  156. package/dist/lib/modules/vendor/zod/v4/locales/ko.js +116 -0
  157. package/dist/lib/modules/vendor/zod/v4/locales/lt.js +207 -0
  158. package/dist/lib/modules/vendor/zod/v4/locales/mk.js +114 -0
  159. package/dist/lib/modules/vendor/zod/v4/locales/ms.js +112 -0
  160. package/dist/lib/modules/vendor/zod/v4/locales/ne.js +111 -0
  161. package/dist/lib/modules/vendor/zod/v4/locales/nl.js +115 -0
  162. package/dist/lib/modules/vendor/zod/v4/locales/nn.js +113 -0
  163. package/dist/lib/modules/vendor/zod/v4/locales/no.js +113 -0
  164. package/dist/lib/modules/vendor/zod/v4/locales/ota.js +114 -0
  165. package/dist/lib/modules/vendor/zod/v4/locales/pl.js +114 -0
  166. package/dist/lib/modules/vendor/zod/v4/locales/ps.js +119 -0
  167. package/dist/lib/modules/vendor/zod/v4/locales/pt-BR.js +143 -0
  168. package/dist/lib/modules/vendor/zod/v4/locales/pt.js +142 -0
  169. package/dist/lib/modules/vendor/zod/v4/locales/ro.js +122 -0
  170. package/dist/lib/modules/vendor/zod/v4/locales/ru.js +168 -0
  171. package/dist/lib/modules/vendor/zod/v4/locales/sk.js +116 -0
  172. package/dist/lib/modules/vendor/zod/v4/locales/sl.js +114 -0
  173. package/dist/lib/modules/vendor/zod/v4/locales/sv.js +115 -0
  174. package/dist/lib/modules/vendor/zod/v4/locales/ta.js +115 -0
  175. package/dist/lib/modules/vendor/zod/v4/locales/tg.js +117 -0
  176. package/dist/lib/modules/vendor/zod/v4/locales/th.js +115 -0
  177. package/dist/lib/modules/vendor/zod/v4/locales/tk.js +107 -0
  178. package/dist/lib/modules/vendor/zod/v4/locales/tr.js +110 -0
  179. package/dist/lib/modules/vendor/zod/v4/locales/ua.js +5 -0
  180. package/dist/lib/modules/vendor/zod/v4/locales/uk.js +113 -0
  181. package/dist/lib/modules/vendor/zod/v4/locales/ur.js +115 -0
  182. package/dist/lib/modules/vendor/zod/v4/locales/uz.js +113 -0
  183. package/dist/lib/modules/vendor/zod/v4/locales/vi.js +113 -0
  184. package/dist/lib/modules/vendor/zod/v4/locales/yo.js +112 -0
  185. package/dist/lib/modules/vendor/zod/v4/locales/zh-CN.js +114 -0
  186. package/dist/lib/modules/vendor/zod/v4/locales/zh-TW.js +112 -0
  187. package/dist/lib/testing-jelly-id.js +1219 -0
  188. package/dist/lib/zod.js +1 -0
  189. package/dist/spec/messaging-v1.md +3744 -0
  190. package/dist/third-party-notices.md +239 -0
  191. package/dist/third-party.json +88 -0
  192. package/dist/types/core/address.d.ts +16 -0
  193. package/dist/types/core/agent/operations.d.ts +129 -0
  194. package/dist/types/core/agent/present.d.ts +57 -0
  195. package/dist/types/core/agent/text.d.ts +62 -0
  196. package/dist/types/core/agent-tools.d.ts +966 -0
  197. package/dist/types/core/b64u.d.ts +6 -0
  198. package/dist/types/core/cards.d.ts +21 -0
  199. package/dist/types/core/check.d.ts +10 -0
  200. package/dist/types/core/consent.d.ts +132 -0
  201. package/dist/types/core/contact-card.d.ts +34 -0
  202. package/dist/types/core/conversation/context.d.ts +56 -0
  203. package/dist/types/core/conversation/event.d.ts +36 -0
  204. package/dist/types/core/conversation/ids.d.ts +18 -0
  205. package/dist/types/core/conversation/link.d.ts +16 -0
  206. package/dist/types/core/conversation/log.d.ts +142 -0
  207. package/dist/types/core/conversation/ratchet.d.ts +95 -0
  208. package/dist/types/core/conversation/seal.d.ts +47 -0
  209. package/dist/types/core/delegation.d.ts +71 -0
  210. package/dist/types/core/directory/device-log.d.ts +119 -0
  211. package/dist/types/core/directory/epoch.d.ts +53 -0
  212. package/dist/types/core/directory/handle.d.ts +11 -0
  213. package/dist/types/core/directory/jelly-device.d.ts +88 -0
  214. package/dist/types/core/directory/jelly-issuer.d.ts +8 -0
  215. package/dist/types/core/directory/jelly-token.d.ts +116 -0
  216. package/dist/types/core/directory/keys-statement.d.ts +22 -0
  217. package/dist/types/core/directory/link.d.ts +36 -0
  218. package/dist/types/core/directory/merkle-log.d.ts +40 -0
  219. package/dist/types/core/directory/person-view.d.ts +90 -0
  220. package/dist/types/core/directory/person.d.ts +8 -0
  221. package/dist/types/core/directory/realm.d.ts +23 -0
  222. package/dist/types/core/directory/smt.d.ts +52 -0
  223. package/dist/types/core/envelope.d.ts +68 -0
  224. package/dist/types/core/hash.d.ts +2 -0
  225. package/dist/types/core/head.d.ts +34 -0
  226. package/dist/types/core/identity.d.ts +35 -0
  227. package/dist/types/core/index.d.ts +45 -0
  228. package/dist/types/core/jcs.d.ts +12 -0
  229. package/dist/types/core/jelly-host-double.d.ts +21 -0
  230. package/dist/types/core/jelly-host.d.ts +86 -0
  231. package/dist/types/core/keys.d.ts +16 -0
  232. package/dist/types/core/peer-text.d.ts +87 -0
  233. package/dist/types/core/realm.d.ts +36 -0
  234. package/dist/types/core/roster.d.ts +146 -0
  235. package/dist/types/core/schema/a2a.d.ts +251 -0
  236. package/dist/types/core/schema/common.d.ts +328 -0
  237. package/dist/types/core/schema/consent.d.ts +140 -0
  238. package/dist/types/core/schema/conversation.d.ts +1657 -0
  239. package/dist/types/core/schema/delegation.d.ts +58 -0
  240. package/dist/types/core/schema/directory-frames.d.ts +1301 -0
  241. package/dist/types/core/schema/directory.d.ts +375 -0
  242. package/dist/types/core/schema/envelope.d.ts +756 -0
  243. package/dist/types/core/schema/errors.d.ts +142 -0
  244. package/dist/types/core/schema/index.d.ts +16 -0
  245. package/dist/types/core/schema/ipc/consent.d.ts +555 -0
  246. package/dist/types/core/schema/ipc/device.d.ts +735 -0
  247. package/dist/types/core/schema/ipc/jelly.d.ts +501 -0
  248. package/dist/types/core/schema/ipc/shapes.d.ts +414 -0
  249. package/dist/types/core/schema/ipc/surfaces.d.ts +680 -0
  250. package/dist/types/core/schema/ipc.d.ts +3146 -0
  251. package/dist/types/core/schema/jelly.d.ts +160 -0
  252. package/dist/types/core/schema/realm.d.ts +38 -0
  253. package/dist/types/core/schema/relay.d.ts +1134 -0
  254. package/dist/types/core/schema/roster.d.ts +347 -0
  255. package/dist/types/core/sign.d.ts +13 -0
  256. package/dist/types/core/task.d.ts +6 -0
  257. package/dist/types/core/testing.d.ts +19 -0
  258. package/dist/types/core/ulid.d.ts +5 -0
  259. package/dist/types/core/version.d.ts +6 -0
  260. package/dist/types/core/wire.d.ts +14 -0
  261. package/dist/types/ipc/client.d.ts +85 -0
  262. package/dist/types/ipc/framing.d.ts +12 -0
  263. package/dist/types/ipc/index.d.ts +6 -0
  264. package/dist/types/ipc/paths.d.ts +39 -0
  265. package/dist/types/ipc/pipes.d.ts +16 -0
  266. package/dist/types/ipc/rpc.d.ts +13 -0
  267. package/dist/types/ipc/server.d.ts +94 -0
  268. package/dist/types/ipc/testing.d.ts +89 -0
  269. package/dist/types/ipc/trust.d.ts +49 -0
  270. package/dist/types/ipc/windows-acl.d.ts +56 -0
  271. package/dist/types/testing/jelly-id.d.ts +518 -0
  272. package/dist/types/zod.d.ts +1 -0
  273. package/package.json +77 -4
@@ -0,0 +1,735 @@
1
+ /**
2
+ * The `device.*` IPC methods (spec §8.2, "Devices"; design §2.2, §7.5): this device's binding in its realm, and
3
+ * its person's devices. `device.status` and `device.bind` are on the agent tier (the plugin's runtime binds its
4
+ * host's daemon zero-click with a Jelly token, never a tool); `device.list`, `device.remove`, `device.link` and
5
+ * `device.approve` are for people, on the admin socket, and `device.approve.preview` is human tier. Spread into
6
+ * `IPC_METHODS`.
7
+ */
8
+ import { z } from "zod";
9
+ /**
10
+ * - `none`: this device is not a device of any person yet (a directory realm: not bound; a roster realm: no team).
11
+ * - `bound`: a current device of its person.
12
+ * - `attest-due`: bound, and its last Jelly token is over `LIMITS.attestAfterMs` old: the plugin binds again.
13
+ * - `removed`: its person's log (or the roster) shows it removed; it can never be bound again.
14
+ * - `replace`: `identity.replace` made this device new keys to replace its predecessor (design §13.8); the plugin
15
+ * binds it with a Jelly token for `device`, as for `none`, and the daemon then removes the predecessor.
16
+ */
17
+ export declare const BindingState: z.ZodEnum<{
18
+ removed: "removed";
19
+ none: "none";
20
+ bound: "bound";
21
+ "attest-due": "attest-due";
22
+ replace: "replace";
23
+ }>;
24
+ export type BindingState = z.infer<typeof BindingState>;
25
+ /** An alarm of this device's realm (spec §15.9): `directory` (the directory contradicted itself) or `restored`. */
26
+ export declare const RealmAlarmSummary: z.ZodObject<{
27
+ kind: z.ZodEnum<{
28
+ directory: "directory";
29
+ restored: "restored";
30
+ }>;
31
+ reason: z.ZodString;
32
+ at: z.ZodNumber;
33
+ }, z.core.$strip>;
34
+ export declare const DeviceStatus: z.ZodObject<{
35
+ realm: z.ZodEnum<{
36
+ roster: "roster";
37
+ directory: "directory";
38
+ }>;
39
+ device: z.ZodOptional<z.ZodString>;
40
+ binding: z.ZodEnum<{
41
+ removed: "removed";
42
+ none: "none";
43
+ bound: "bound";
44
+ "attest-due": "attest-due";
45
+ replace: "replace";
46
+ }>;
47
+ person: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
48
+ label: z.ZodOptional<z.ZodString>;
49
+ sth: z.ZodOptional<z.ZodObject<{
50
+ size: z.ZodNumber;
51
+ root: z.ZodString;
52
+ ts: z.ZodNumber;
53
+ }, z.core.$strip>>;
54
+ alarm: z.ZodOptional<z.ZodObject<{
55
+ kind: z.ZodEnum<{
56
+ directory: "directory";
57
+ restored: "restored";
58
+ }>;
59
+ reason: z.ZodString;
60
+ at: z.ZodNumber;
61
+ }, z.core.$strip>>;
62
+ }, z.core.$strip>;
63
+ export type DeviceStatus = z.infer<typeof DeviceStatus>;
64
+ /**
65
+ * One change of a person's devices (design §2.8): `added` (bound; a roster realm: admitted), `vouched` (an `attest`
66
+ * raised a device approved by link to Jelly-vouched), `removed` (unbound, or `member.remove`) or `replaced` (unbound
67
+ * by its successor after a restore, design §13.8). `label`, `kind`, `vouch` and `via` are the device's; `approver`
68
+ * names the device that approved one bound by link, by its label; `at` is the entry's time.
69
+ */
70
+ export declare const DeviceChangeView: z.ZodObject<{
71
+ change: z.ZodEnum<{
72
+ removed: "removed";
73
+ replaced: "replaced";
74
+ added: "added";
75
+ vouched: "vouched";
76
+ }>;
77
+ device: z.ZodString;
78
+ label: z.ZodString;
79
+ kind: z.ZodOptional<z.ZodEnum<{
80
+ "jelly-host": "jelly-host";
81
+ laptop: "laptop";
82
+ server: "server";
83
+ other: "other";
84
+ }>>;
85
+ vouch: z.ZodEnum<{
86
+ admin: "admin";
87
+ device: "device";
88
+ jelly: "jelly";
89
+ }>;
90
+ via: z.ZodOptional<z.ZodEnum<{
91
+ host: "host";
92
+ browser: "browser";
93
+ }>>;
94
+ approver: z.ZodOptional<z.ZodString>;
95
+ at: z.ZodNumber;
96
+ }, z.core.$strip>;
97
+ export type DeviceChangeView = z.infer<typeof DeviceChangeView>;
98
+ /** One device of this device's person. */
99
+ export declare const DeviceListEntry: z.ZodObject<{
100
+ device: z.ZodString;
101
+ label: z.ZodString;
102
+ kind: z.ZodOptional<z.ZodEnum<{
103
+ "jelly-host": "jelly-host";
104
+ laptop: "laptop";
105
+ server: "server";
106
+ other: "other";
107
+ }>>;
108
+ vouched: z.ZodEnum<{
109
+ admin: "admin";
110
+ device: "device";
111
+ jelly: "jelly";
112
+ }>;
113
+ via: z.ZodOptional<z.ZodEnum<{
114
+ host: "host";
115
+ browser: "browser";
116
+ }>>;
117
+ current: z.ZodBoolean;
118
+ self: z.ZodBoolean;
119
+ since: z.ZodOptional<z.ZodNumber>;
120
+ unbound: z.ZodOptional<z.ZodObject<{
121
+ at: z.ZodNumber;
122
+ reason: z.ZodEnum<{
123
+ self: "self";
124
+ removed: "removed";
125
+ lost: "lost";
126
+ replaced: "replaced";
127
+ account_deleted: "account_deleted";
128
+ }>;
129
+ by: z.ZodString;
130
+ }, z.core.$strip>>;
131
+ }, z.core.$strip>;
132
+ export type DeviceListEntry = z.infer<typeof DeviceListEntry>;
133
+ /** What a link request asks for, and the code to compare. */
134
+ export declare const LinkPreview: z.ZodObject<{
135
+ device: z.ZodString;
136
+ label: z.ZodString;
137
+ kind: z.ZodEnum<{
138
+ "jelly-host": "jelly-host";
139
+ laptop: "laptop";
140
+ server: "server";
141
+ other: "other";
142
+ }>;
143
+ sas: z.ZodString;
144
+ }, z.core.$strip>;
145
+ /**
146
+ * A key's fingerprint as Jelly ID's consent page shows it (Jelly's contract v1.2 §12.2): the first six bytes of the
147
+ * key's RFC 7638 thumbprint, lower-case hex, in three groups of four.
148
+ */
149
+ export declare const KeyFingerprint: z.ZodString;
150
+ /** The code the person types at Jelly ID's page: ten symbols grouped 5-5 (Jelly's contract v1.2 §12.1). */
151
+ export declare const LoginUserCode: z.ZodString;
152
+ /**
153
+ * What a sign-in is for: binding (or attesting) this device, removing another device of its person, a step of
154
+ * `identity.replace` (binding the new keys, then removing the predecessor), or `directory.erase`.
155
+ */
156
+ export declare const LoginPurpose: z.ZodEnum<{
157
+ bind: "bind";
158
+ replace: "replace";
159
+ remove: "remove";
160
+ erase: "erase";
161
+ }>;
162
+ /** The kinds a device that signs in may give itself: never `jelly-host`. */
163
+ export declare const LoginKind: z.ZodEnum<{
164
+ laptop: "laptop";
165
+ server: "server";
166
+ other: "other";
167
+ }>;
168
+ /**
169
+ * A device's sign-in through the browser (spec §15.9, "Signing in through the browser"), as `device.login.status`
170
+ * reports it and the `login` event announces it.
171
+ *
172
+ * - `idle`: none since the daemon started.
173
+ * - `pending`: waiting for the person at Jelly ID (or binding with the token Jelly ID just gave).
174
+ * - `done`: `bind` bound or attested this device; `remove` removed `device`. `seq` is the log entry's.
175
+ * - `failed`: `code` and `message` in the house style (`expired`, `login_denied`, `login_unsupported`, ...).
176
+ * - `cancelled`: `device.login.cancel`, a newer `device.login`, or the daemon stopping.
177
+ */
178
+ export declare const LoginState: z.ZodDiscriminatedUnion<[z.ZodObject<{
179
+ state: z.ZodLiteral<"idle">;
180
+ }, z.core.$strip>, z.ZodObject<{
181
+ verificationUri: z.ZodString;
182
+ userCode: z.ZodString;
183
+ fingerprint: z.ZodString;
184
+ expires: z.ZodNumber;
185
+ state: z.ZodLiteral<"pending">;
186
+ purpose: z.ZodEnum<{
187
+ bind: "bind";
188
+ replace: "replace";
189
+ remove: "remove";
190
+ erase: "erase";
191
+ }>;
192
+ }, z.core.$strip>, z.ZodObject<{
193
+ state: z.ZodLiteral<"done">;
194
+ purpose: z.ZodEnum<{
195
+ bind: "bind";
196
+ replace: "replace";
197
+ remove: "remove";
198
+ erase: "erase";
199
+ }>;
200
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
201
+ device: z.ZodString;
202
+ seq: z.ZodNumber;
203
+ }, z.core.$strip>, z.ZodObject<{
204
+ state: z.ZodLiteral<"failed">;
205
+ purpose: z.ZodEnum<{
206
+ bind: "bind";
207
+ replace: "replace";
208
+ remove: "remove";
209
+ erase: "erase";
210
+ }>;
211
+ code: z.ZodEnum<{
212
+ expired: "expired";
213
+ invalid_request: "invalid_request";
214
+ not_member: "not_member";
215
+ bad_signature: "bad_signature";
216
+ unknown_session: "unknown_session";
217
+ ambiguous_address: "ambiguous_address";
218
+ no_recipients: "no_recipients";
219
+ unknown_address: "unknown_address";
220
+ refused: "refused";
221
+ declined: "declined";
222
+ request_required: "request_required";
223
+ rate_limited: "rate_limited";
224
+ loop_guard: "loop_guard";
225
+ too_large: "too_large";
226
+ secret_refused: "secret_refused";
227
+ duplicate: "duplicate";
228
+ relay_unavailable: "relay_unavailable";
229
+ not_found: "not_found";
230
+ invalid_state: "invalid_state";
231
+ forbidden: "forbidden";
232
+ guarded_turn: "guarded_turn";
233
+ roster_conflict: "roster_conflict";
234
+ invite_invalid: "invite_invalid";
235
+ no_identity: "no_identity";
236
+ binding_invalid: "binding_invalid";
237
+ jelly_unavailable: "jelly_unavailable";
238
+ log_conflict: "log_conflict";
239
+ conv_conflict: "conv_conflict";
240
+ stale_epoch: "stale_epoch";
241
+ device_limit: "device_limit";
242
+ admission_required: "admission_required";
243
+ admission_invalid: "admission_invalid";
244
+ directory_inconsistent: "directory_inconsistent";
245
+ unknown_device: "unknown_device";
246
+ directory_unavailable: "directory_unavailable";
247
+ login_unsupported: "login_unsupported";
248
+ login_denied: "login_denied";
249
+ grant_required: "grant_required";
250
+ grant_invalid: "grant_invalid";
251
+ ticket_required: "ticket_required";
252
+ ticket_invalid: "ticket_invalid";
253
+ daemon_unavailable: "daemon_unavailable";
254
+ daemon_mismatch: "daemon_mismatch";
255
+ store_refused: "store_refused";
256
+ internal: "internal";
257
+ }>;
258
+ message: z.ZodString;
259
+ }, z.core.$strip>, z.ZodObject<{
260
+ state: z.ZodLiteral<"cancelled">;
261
+ purpose: z.ZodEnum<{
262
+ bind: "bind";
263
+ replace: "replace";
264
+ remove: "remove";
265
+ erase: "erase";
266
+ }>;
267
+ }, z.core.$strip>], "state">;
268
+ export type LoginState = z.infer<typeof LoginState>;
269
+ /** `device.remove`'s params, which its preview takes too (spec §8.2, "Previews"). */
270
+ export declare const DeviceRemoveParams: z.ZodObject<{
271
+ device: z.ZodString;
272
+ reason: z.ZodOptional<z.ZodEnum<{
273
+ self: "self";
274
+ removed: "removed";
275
+ lost: "lost";
276
+ }>>;
277
+ token: z.ZodOptional<z.ZodString>;
278
+ }, z.core.$strict>;
279
+ /** `device.approve`'s params; its preview takes them with `sas` optional. */
280
+ export declare const DeviceApproveParams: z.ZodObject<{
281
+ link: z.ZodString;
282
+ sas: z.ZodString;
283
+ }, z.core.$strict>;
284
+ /** `identity.replace`'s params, which its preview takes too (spec §8.2, "Previews"); the preview never reads `token`. */
285
+ export declare const IdentityReplaceParams: z.ZodObject<{
286
+ token: z.ZodOptional<z.ZodString>;
287
+ label: z.ZodOptional<z.ZodString>;
288
+ }, z.core.$strict>;
289
+ /** `directory.erase`'s params, which its preview takes too; the preview never reads `token`. */
290
+ export declare const DirectoryEraseParams: z.ZodObject<{
291
+ token: z.ZodOptional<z.ZodString>;
292
+ }, z.core.$strict>;
293
+ export declare const DEVICE_METHODS: {
294
+ /** Agent tier. This device's realm and binding; the device id the plugin asks Jelly ID to bind. */
295
+ readonly "device.status": {
296
+ readonly params: z.ZodObject<{}, z.core.$strict>;
297
+ readonly result: z.ZodObject<{
298
+ realm: z.ZodEnum<{
299
+ roster: "roster";
300
+ directory: "directory";
301
+ }>;
302
+ device: z.ZodOptional<z.ZodString>;
303
+ binding: z.ZodEnum<{
304
+ removed: "removed";
305
+ none: "none";
306
+ bound: "bound";
307
+ "attest-due": "attest-due";
308
+ replace: "replace";
309
+ }>;
310
+ person: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
311
+ label: z.ZodOptional<z.ZodString>;
312
+ sth: z.ZodOptional<z.ZodObject<{
313
+ size: z.ZodNumber;
314
+ root: z.ZodString;
315
+ ts: z.ZodNumber;
316
+ }, z.core.$strip>>;
317
+ alarm: z.ZodOptional<z.ZodObject<{
318
+ kind: z.ZodEnum<{
319
+ directory: "directory";
320
+ restored: "restored";
321
+ }>;
322
+ reason: z.ZodString;
323
+ at: z.ZodNumber;
324
+ }, z.core.$strip>>;
325
+ }, z.core.$strip>;
326
+ };
327
+ /**
328
+ * Agent tier, for the plugin's runtime only (design §2.2). Binds this device (or attests it again) with a Jelly
329
+ * resource token whose `cnf` names this device's key, for this home's account if it has one. A directory realm only.
330
+ */
331
+ readonly "device.bind": {
332
+ readonly params: z.ZodObject<{
333
+ token: z.ZodString;
334
+ label: z.ZodOptional<z.ZodString>;
335
+ kind: z.ZodOptional<z.ZodEnum<{
336
+ "jelly-host": "jelly-host";
337
+ laptop: "laptop";
338
+ server: "server";
339
+ other: "other";
340
+ }>>;
341
+ }, z.core.$strict>;
342
+ readonly result: z.ZodObject<{
343
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
344
+ device: z.ZodString;
345
+ seq: z.ZodNumber;
346
+ }, z.core.$strip>;
347
+ };
348
+ /** Admin tier. This device's person's devices, current first. */
349
+ readonly "device.list": {
350
+ readonly params: z.ZodObject<{}, z.core.$strict>;
351
+ readonly result: z.ZodObject<{
352
+ devices: z.ZodArray<z.ZodObject<{
353
+ device: z.ZodString;
354
+ label: z.ZodString;
355
+ kind: z.ZodOptional<z.ZodEnum<{
356
+ "jelly-host": "jelly-host";
357
+ laptop: "laptop";
358
+ server: "server";
359
+ other: "other";
360
+ }>>;
361
+ vouched: z.ZodEnum<{
362
+ admin: "admin";
363
+ device: "device";
364
+ jelly: "jelly";
365
+ }>;
366
+ via: z.ZodOptional<z.ZodEnum<{
367
+ host: "host";
368
+ browser: "browser";
369
+ }>>;
370
+ current: z.ZodBoolean;
371
+ self: z.ZodBoolean;
372
+ since: z.ZodOptional<z.ZodNumber>;
373
+ unbound: z.ZodOptional<z.ZodObject<{
374
+ at: z.ZodNumber;
375
+ reason: z.ZodEnum<{
376
+ self: "self";
377
+ removed: "removed";
378
+ lost: "lost";
379
+ replaced: "replaced";
380
+ account_deleted: "account_deleted";
381
+ }>;
382
+ by: z.ZodString;
383
+ }, z.core.$strip>>;
384
+ }, z.core.$strip>>;
385
+ }, z.core.$strip>;
386
+ };
387
+ /**
388
+ * Admin tier. Removes a device of this device's person: this device itself, or another with a fresh Jelly token
389
+ * bound to this device (design §2.1). A directory realm only; a roster realm removes machines with `team.remove`.
390
+ */
391
+ readonly "device.remove": {
392
+ readonly params: z.ZodObject<{
393
+ device: z.ZodString;
394
+ reason: z.ZodOptional<z.ZodEnum<{
395
+ self: "self";
396
+ removed: "removed";
397
+ lost: "lost";
398
+ }>>;
399
+ token: z.ZodOptional<z.ZodString>;
400
+ }, z.core.$strict>;
401
+ readonly result: z.ZodObject<{
402
+ seq: z.ZodNumber;
403
+ }, z.core.$strip>;
404
+ };
405
+ /**
406
+ * Admin tier, on a new device that Jelly ID does not enrol (design §2.5). Makes this device's link request: its
407
+ * text (shown as a QR code too) and the code to compare, valid until `expires`. The daemon then waits to be
408
+ * approved, and binds itself when its person's log shows the approval. A directory realm only.
409
+ */
410
+ readonly "device.link": {
411
+ readonly params: z.ZodObject<{
412
+ label: z.ZodOptional<z.ZodString>;
413
+ kind: z.ZodOptional<z.ZodEnum<{
414
+ "jelly-host": "jelly-host";
415
+ laptop: "laptop";
416
+ server: "server";
417
+ other: "other";
418
+ }>>;
419
+ }, z.core.$strict>;
420
+ readonly result: z.ZodObject<{
421
+ link: z.ZodString;
422
+ sas: z.ZodString;
423
+ expires: z.ZodNumber;
424
+ }, z.core.$strip>;
425
+ };
426
+ /**
427
+ * Admin tier, in a directory realm, not under a Jelly host (spec §15.9, "Signing in through the browser"). Starts
428
+ * a sign-in at Jelly ID for this device and returns where the person approves it, the code and this key's
429
+ * fingerprint to check there, and when it expires. The daemon then polls Jelly ID and, once approved, binds this
430
+ * device (or attests it again), or with `remove` removes that other device of its person with the token. A newer
431
+ * call cancels a pending one. Needs Jelly ID's device sign-in (its contract v1.2 §12): `login_unsupported` without.
432
+ */
433
+ readonly "device.login": {
434
+ readonly params: z.ZodObject<{
435
+ label: z.ZodOptional<z.ZodString>;
436
+ kind: z.ZodOptional<z.ZodEnum<{
437
+ laptop: "laptop";
438
+ server: "server";
439
+ other: "other";
440
+ }>>;
441
+ remove: z.ZodOptional<z.ZodObject<{
442
+ device: z.ZodString;
443
+ reason: z.ZodOptional<z.ZodEnum<{
444
+ removed: "removed";
445
+ lost: "lost";
446
+ }>>;
447
+ }, z.core.$strict>>;
448
+ }, z.core.$strict>;
449
+ readonly result: z.ZodObject<{
450
+ verificationUri: z.ZodString;
451
+ userCode: z.ZodString;
452
+ fingerprint: z.ZodString;
453
+ expires: z.ZodNumber;
454
+ purpose: z.ZodEnum<{
455
+ bind: "bind";
456
+ replace: "replace";
457
+ remove: "remove";
458
+ erase: "erase";
459
+ }>;
460
+ interval: z.ZodNumber;
461
+ }, z.core.$strip>;
462
+ };
463
+ /** Admin tier. The sign-in's state; with `waitMs`, answers once it changes or the wait ends. */
464
+ readonly "device.login.status": {
465
+ readonly params: z.ZodObject<{
466
+ waitMs: z.ZodOptional<z.ZodNumber>;
467
+ }, z.core.$strict>;
468
+ readonly result: z.ZodDiscriminatedUnion<[z.ZodObject<{
469
+ state: z.ZodLiteral<"idle">;
470
+ }, z.core.$strip>, z.ZodObject<{
471
+ verificationUri: z.ZodString;
472
+ userCode: z.ZodString;
473
+ fingerprint: z.ZodString;
474
+ expires: z.ZodNumber;
475
+ state: z.ZodLiteral<"pending">;
476
+ purpose: z.ZodEnum<{
477
+ bind: "bind";
478
+ replace: "replace";
479
+ remove: "remove";
480
+ erase: "erase";
481
+ }>;
482
+ }, z.core.$strip>, z.ZodObject<{
483
+ state: z.ZodLiteral<"done">;
484
+ purpose: z.ZodEnum<{
485
+ bind: "bind";
486
+ replace: "replace";
487
+ remove: "remove";
488
+ erase: "erase";
489
+ }>;
490
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
491
+ device: z.ZodString;
492
+ seq: z.ZodNumber;
493
+ }, z.core.$strip>, z.ZodObject<{
494
+ state: z.ZodLiteral<"failed">;
495
+ purpose: z.ZodEnum<{
496
+ bind: "bind";
497
+ replace: "replace";
498
+ remove: "remove";
499
+ erase: "erase";
500
+ }>;
501
+ code: z.ZodEnum<{
502
+ expired: "expired";
503
+ invalid_request: "invalid_request";
504
+ not_member: "not_member";
505
+ bad_signature: "bad_signature";
506
+ unknown_session: "unknown_session";
507
+ ambiguous_address: "ambiguous_address";
508
+ no_recipients: "no_recipients";
509
+ unknown_address: "unknown_address";
510
+ refused: "refused";
511
+ declined: "declined";
512
+ request_required: "request_required";
513
+ rate_limited: "rate_limited";
514
+ loop_guard: "loop_guard";
515
+ too_large: "too_large";
516
+ secret_refused: "secret_refused";
517
+ duplicate: "duplicate";
518
+ relay_unavailable: "relay_unavailable";
519
+ not_found: "not_found";
520
+ invalid_state: "invalid_state";
521
+ forbidden: "forbidden";
522
+ guarded_turn: "guarded_turn";
523
+ roster_conflict: "roster_conflict";
524
+ invite_invalid: "invite_invalid";
525
+ no_identity: "no_identity";
526
+ binding_invalid: "binding_invalid";
527
+ jelly_unavailable: "jelly_unavailable";
528
+ log_conflict: "log_conflict";
529
+ conv_conflict: "conv_conflict";
530
+ stale_epoch: "stale_epoch";
531
+ device_limit: "device_limit";
532
+ admission_required: "admission_required";
533
+ admission_invalid: "admission_invalid";
534
+ directory_inconsistent: "directory_inconsistent";
535
+ unknown_device: "unknown_device";
536
+ directory_unavailable: "directory_unavailable";
537
+ login_unsupported: "login_unsupported";
538
+ login_denied: "login_denied";
539
+ grant_required: "grant_required";
540
+ grant_invalid: "grant_invalid";
541
+ ticket_required: "ticket_required";
542
+ ticket_invalid: "ticket_invalid";
543
+ daemon_unavailable: "daemon_unavailable";
544
+ daemon_mismatch: "daemon_mismatch";
545
+ store_refused: "store_refused";
546
+ internal: "internal";
547
+ }>;
548
+ message: z.ZodString;
549
+ }, z.core.$strip>, z.ZodObject<{
550
+ state: z.ZodLiteral<"cancelled">;
551
+ purpose: z.ZodEnum<{
552
+ bind: "bind";
553
+ replace: "replace";
554
+ remove: "remove";
555
+ erase: "erase";
556
+ }>;
557
+ }, z.core.$strip>], "state">;
558
+ };
559
+ /** Admin tier. Cancels a pending sign-in; nothing when none is pending. */
560
+ readonly "device.login.cancel": {
561
+ readonly params: z.ZodObject<{}, z.core.$strict>;
562
+ readonly result: z.ZodObject<{
563
+ ok: z.ZodLiteral<true>;
564
+ }, z.core.$strip>;
565
+ };
566
+ /** Human tier, read-only (design §13.12): what a link request asks for, and its code. Refuses an expired one. */
567
+ /** `device.approve`'s input (spec §8.2, "Previews"); the code may be left out, and is never checked here. */
568
+ readonly "device.approve.preview": {
569
+ readonly params: z.ZodObject<{
570
+ link: z.ZodString;
571
+ sas: z.ZodOptional<z.ZodString>;
572
+ }, z.core.$strict>;
573
+ readonly result: z.ZodObject<{
574
+ device: z.ZodString;
575
+ label: z.ZodString;
576
+ kind: z.ZodEnum<{
577
+ "jelly-host": "jelly-host";
578
+ laptop: "laptop";
579
+ server: "server";
580
+ other: "other";
581
+ }>;
582
+ sas: z.ZodString;
583
+ }, z.core.$strip>;
584
+ };
585
+ /**
586
+ * Admin tier, on a device of the person that Jelly ID vouched for: approves the link request, whose code the
587
+ * person compared and gives back as `sas`, by appending the new device's `bind` to the person's log.
588
+ */
589
+ readonly "device.approve": {
590
+ readonly params: z.ZodObject<{
591
+ link: z.ZodString;
592
+ sas: z.ZodString;
593
+ }, z.core.$strict>;
594
+ readonly result: z.ZodObject<{
595
+ device: z.ZodString;
596
+ seq: z.ZodNumber;
597
+ }, z.core.$strip>;
598
+ };
599
+ /**
600
+ * Admin tier, a directory realm (design §13.8, A8; spec §15.9 "Replacing this device"): this home gets new keys
601
+ * and replaces its predecessor, the device its store belongs to (after a restore: `keys_missing` or `restored`; or
602
+ * on purpose, for a fresh key). Each call moves the replacement on and says where it stands:
603
+ * - `done`: the new device is bound (a `bind` with a Jelly token for its key) and the predecessor unbound with
604
+ * reason `replaced` (signed by the new device, with a Jelly token for it); grants re-signed, conversations kept
605
+ * under the successor rule;
606
+ * - `token`: under a Jelly host, waiting for the host's token for `device` (`device.bind` or this method with it);
607
+ * - `sign-in`: waiting for the person at Jelly ID; call again once it is done. A sign-in's token vouches for one
608
+ * act (spec §15.3), so through the browser the replacement takes two: one binds the new key, one removes the
609
+ * predecessor. A Jelly host's token does both.
610
+ * `no_identity` before this home was bound to an account; `invalid_state` on a removed device.
611
+ */
612
+ readonly "identity.replace": {
613
+ readonly params: z.ZodObject<{
614
+ token: z.ZodOptional<z.ZodString>;
615
+ label: z.ZodOptional<z.ZodString>;
616
+ }, z.core.$strict>;
617
+ readonly result: z.ZodDiscriminatedUnion<[z.ZodObject<{
618
+ state: z.ZodLiteral<"done">;
619
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
620
+ device: z.ZodString;
621
+ predecessor: z.ZodString;
622
+ seq: z.ZodNumber;
623
+ }, z.core.$strip>, z.ZodObject<{
624
+ state: z.ZodLiteral<"token">;
625
+ device: z.ZodString;
626
+ }, z.core.$strip>, z.ZodObject<{
627
+ verificationUri: z.ZodString;
628
+ userCode: z.ZodString;
629
+ fingerprint: z.ZodString;
630
+ expires: z.ZodNumber;
631
+ state: z.ZodLiteral<"sign-in">;
632
+ purpose: z.ZodEnum<{
633
+ bind: "bind";
634
+ replace: "replace";
635
+ remove: "remove";
636
+ erase: "erase";
637
+ }>;
638
+ interval: z.ZodNumber;
639
+ device: z.ZodString;
640
+ }, z.core.$strip>], "state">;
641
+ };
642
+ /**
643
+ * Human tier, read-only: what `identity.replace` would do (design §13.8: the predecessor as `device.remove.preview`
644
+ * shows a device), why, how many sign-ins it still needs, and the confirmation's fixed sentence.
645
+ */
646
+ readonly "identity.replace.preview": {
647
+ readonly params: z.ZodObject<{
648
+ token: z.ZodOptional<z.ZodString>;
649
+ label: z.ZodOptional<z.ZodString>;
650
+ }, z.core.$strict>;
651
+ readonly result: z.ZodObject<{
652
+ predecessor: z.ZodObject<{
653
+ device: z.ZodString;
654
+ label: z.ZodString;
655
+ kind: z.ZodOptional<z.ZodEnum<{
656
+ "jelly-host": "jelly-host";
657
+ laptop: "laptop";
658
+ server: "server";
659
+ other: "other";
660
+ }>>;
661
+ vouch: z.ZodEnum<{
662
+ device: "device";
663
+ jelly: "jelly";
664
+ }>;
665
+ via: z.ZodOptional<z.ZodEnum<{
666
+ host: "host";
667
+ browser: "browser";
668
+ }>>;
669
+ since: z.ZodOptional<z.ZodNumber>;
670
+ current: z.ZodBoolean;
671
+ }, z.core.$strip>;
672
+ alarm: z.ZodNullable<z.ZodEnum<{
673
+ restored: "restored";
674
+ keys_missing: "keys_missing";
675
+ }>>;
676
+ device: z.ZodOptional<z.ZodString>;
677
+ signIns: z.ZodNumber;
678
+ sentence: z.ZodString;
679
+ }, z.core.$strip>;
680
+ };
681
+ /**
682
+ * Admin tier, a directory realm (design §3.7; spec §15.10 `dir.erase`): erases this person's account from
683
+ * Messaging, from this device: an `unbind` of every current device, with a fresh Jelly token bound to this one (a
684
+ * Jelly host's `token`, or a sign-in through the browser). The directory deletes the profile, every log body and
685
+ * keys statement, and the queues; the account can never be bound again. `done`: erased, and this device stops as
686
+ * removed. `rate_limited` (with `retryAfterMs`) past the directory's 10 erasures per person a day.
687
+ */
688
+ readonly "directory.erase": {
689
+ readonly params: z.ZodObject<{
690
+ token: z.ZodOptional<z.ZodString>;
691
+ }, z.core.$strict>;
692
+ readonly result: z.ZodDiscriminatedUnion<[z.ZodObject<{
693
+ state: z.ZodLiteral<"done">;
694
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
695
+ devices: z.ZodNumber;
696
+ }, z.core.$strip>, z.ZodObject<{
697
+ verificationUri: z.ZodString;
698
+ userCode: z.ZodString;
699
+ fingerprint: z.ZodString;
700
+ expires: z.ZodNumber;
701
+ state: z.ZodLiteral<"sign-in">;
702
+ purpose: z.ZodEnum<{
703
+ bind: "bind";
704
+ replace: "replace";
705
+ remove: "remove";
706
+ erase: "erase";
707
+ }>;
708
+ interval: z.ZodNumber;
709
+ }, z.core.$strip>], "state">;
710
+ };
711
+ /** Human tier, read-only: exactly what `directory.erase` deletes, and what stays. */
712
+ readonly "directory.erase.preview": {
713
+ readonly params: z.ZodObject<{
714
+ token: z.ZodOptional<z.ZodString>;
715
+ }, z.core.$strict>;
716
+ readonly result: z.ZodObject<{
717
+ person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
718
+ devices: z.ZodArray<z.ZodObject<{
719
+ device: z.ZodString;
720
+ label: z.ZodString;
721
+ kind: z.ZodOptional<z.ZodEnum<{
722
+ "jelly-host": "jelly-host";
723
+ laptop: "laptop";
724
+ server: "server";
725
+ other: "other";
726
+ }>>;
727
+ self: z.ZodBoolean;
728
+ }, z.core.$strip>>;
729
+ signIns: z.ZodNumber;
730
+ perDay: z.ZodNumber;
731
+ lost: z.ZodArray<z.ZodString>;
732
+ kept: z.ZodArray<z.ZodString>;
733
+ }, z.core.$strip>;
734
+ };
735
+ };