@dxos/protocols 0.8.4-staging.ac66bdf99f → 0.9.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 (360) hide show
  1. package/LICENSE +102 -5
  2. package/dist/src/FeedProtocol.d.ts +5 -5
  3. package/dist/src/FeedProtocol.d.ts.map +1 -1
  4. package/dist/src/FeedProtocol.js.map +1 -1
  5. package/dist/src/FunctionProtocol.d.ts +7 -0
  6. package/dist/src/FunctionProtocol.d.ts.map +1 -1
  7. package/dist/src/TraceProtocol.d.ts +15 -0
  8. package/dist/src/TraceProtocol.d.ts.map +1 -0
  9. package/dist/src/TraceProtocol.js +4 -0
  10. package/dist/src/TraceProtocol.js.map +1 -0
  11. package/dist/src/automerge.d.ts +203 -13
  12. package/dist/src/automerge.d.ts.map +1 -1
  13. package/dist/src/automerge.js +17 -0
  14. package/dist/src/automerge.js.map +1 -1
  15. package/dist/src/buf/proto/gen/dxos/client/invitation_pb.d.ts +16 -4
  16. package/dist/src/buf/proto/gen/dxos/client/invitation_pb.d.ts.map +1 -1
  17. package/dist/src/buf/proto/gen/dxos/client/invitation_pb.js +17 -5
  18. package/dist/src/buf/proto/gen/dxos/client/invitation_pb.js.map +1 -1
  19. package/dist/src/buf/proto/gen/dxos/client/queue_pb.d.ts +74 -0
  20. package/dist/src/buf/proto/gen/dxos/client/queue_pb.d.ts.map +1 -1
  21. package/dist/src/buf/proto/gen/dxos/client/queue_pb.js +16 -1
  22. package/dist/src/buf/proto/gen/dxos/client/queue_pb.js.map +1 -1
  23. package/dist/src/buf/proto/gen/dxos/client/services_pb.d.ts +14 -0
  24. package/dist/src/buf/proto/gen/dxos/client/services_pb.d.ts.map +1 -1
  25. package/dist/src/buf/proto/gen/dxos/client/services_pb.js +1 -1
  26. package/dist/src/buf/proto/gen/dxos/client/services_pb.js.map +1 -1
  27. package/dist/src/buf/proto/gen/dxos/config_pb.d.ts +6 -0
  28. package/dist/src/buf/proto/gen/dxos/config_pb.d.ts.map +1 -1
  29. package/dist/src/buf/proto/gen/dxos/config_pb.js +1 -1
  30. package/dist/src/buf/proto/gen/dxos/config_pb.js.map +1 -1
  31. package/dist/src/buf/proto/gen/dxos/devtools/host_pb.d.ts +70 -0
  32. package/dist/src/buf/proto/gen/dxos/devtools/host_pb.d.ts.map +1 -1
  33. package/dist/src/buf/proto/gen/dxos/devtools/host_pb.js +16 -1
  34. package/dist/src/buf/proto/gen/dxos/devtools/host_pb.js.map +1 -1
  35. package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.d.ts +6 -0
  36. package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.d.ts.map +1 -1
  37. package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.js +1 -1
  38. package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.js.map +1 -1
  39. package/dist/src/buf/proto/gen/dxos/echo/service_pb.d.ts +17 -2
  40. package/dist/src/buf/proto/gen/dxos/echo/service_pb.d.ts.map +1 -1
  41. package/dist/src/buf/proto/gen/dxos/echo/service_pb.js +1 -1
  42. package/dist/src/buf/proto/gen/dxos/echo/service_pb.js.map +1 -1
  43. package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.d.ts +26 -0
  44. package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.d.ts.map +1 -1
  45. package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.js +26 -21
  46. package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.js.map +1 -1
  47. package/dist/src/buf/proto/gen/dxos/halo/invitations_pb.d.ts +11 -4
  48. package/dist/src/buf/proto/gen/dxos/halo/invitations_pb.d.ts.map +1 -1
  49. package/dist/src/buf/proto/gen/dxos/halo/invitations_pb.js +12 -5
  50. package/dist/src/buf/proto/gen/dxos/halo/invitations_pb.js.map +1 -1
  51. package/dist/src/codec.test.js +1 -1
  52. package/dist/src/edge/EdgeFunctionEnv.d.ts +27 -1
  53. package/dist/src/edge/EdgeFunctionEnv.d.ts.map +1 -1
  54. package/dist/src/edge/edge.d.ts +190 -3
  55. package/dist/src/edge/edge.d.ts.map +1 -1
  56. package/dist/src/edge/edge.js +107 -2
  57. package/dist/src/edge/edge.js.map +1 -1
  58. package/dist/src/edge/edge.test.d.ts +2 -0
  59. package/dist/src/edge/edge.test.d.ts.map +1 -0
  60. package/dist/src/edge/edge.test.js +50 -0
  61. package/dist/src/edge/edge.test.js.map +1 -0
  62. package/dist/src/edge/errors.d.ts.map +1 -1
  63. package/dist/src/edge/errors.js +1 -1
  64. package/dist/src/edge/errors.js.map +1 -1
  65. package/dist/src/edge/index.js +4 -4
  66. package/dist/src/edge/registry.d.ts +103 -18
  67. package/dist/src/edge/registry.d.ts.map +1 -1
  68. package/dist/src/edge/registry.js +72 -12
  69. package/dist/src/edge/registry.js.map +1 -1
  70. package/dist/src/errors/base-errors.d.ts +18 -18
  71. package/dist/src/errors/base-errors.d.ts.map +1 -1
  72. package/dist/src/errors/encoding.d.ts +1 -1
  73. package/dist/src/errors/encoding.d.ts.map +1 -1
  74. package/dist/src/errors/encoding.js +1 -1
  75. package/dist/src/errors/encoding.js.map +1 -1
  76. package/dist/src/errors/errors.d.ts +132 -132
  77. package/dist/src/errors/errors.d.ts.map +1 -1
  78. package/dist/src/errors/errors.js +1 -1
  79. package/dist/src/errors/errors.test.js +1 -1
  80. package/dist/src/errors/helpers.d.ts +2 -2
  81. package/dist/src/errors/helpers.d.ts.map +1 -1
  82. package/dist/src/errors/index.js +5 -5
  83. package/dist/src/errors/parameter.d.ts.map +1 -1
  84. package/dist/src/index.d.ts +1 -1
  85. package/dist/src/index.d.ts.map +1 -1
  86. package/dist/src/index.js +11 -11
  87. package/dist/src/index.js.map +1 -1
  88. package/dist/src/indexing.d.ts.map +1 -1
  89. package/dist/src/indexing.test.js +1 -1
  90. package/dist/src/invitation.js +3 -3
  91. package/dist/src/invitation.js.map +1 -1
  92. package/dist/src/profile-archive.d.ts +14 -1
  93. package/dist/src/profile-archive.d.ts.map +1 -1
  94. package/dist/src/profile-archive.js +2 -0
  95. package/dist/src/profile-archive.js.map +1 -1
  96. package/dist/src/proto/gen/dxos/agent/dashboard.d.ts +3 -6
  97. package/dist/src/proto/gen/dxos/agent/dashboard.d.ts.map +1 -1
  98. package/dist/src/proto/gen/dxos/agent/dashboard.js.map +1 -1
  99. package/dist/src/proto/gen/dxos/agent/echoproxy.d.ts +1 -2
  100. package/dist/src/proto/gen/dxos/agent/echoproxy.d.ts.map +1 -1
  101. package/dist/src/proto/gen/dxos/agent/epoch.d.ts +1 -2
  102. package/dist/src/proto/gen/dxos/agent/epoch.d.ts.map +1 -1
  103. package/dist/src/proto/gen/dxos/agent/functions.d.ts +6 -12
  104. package/dist/src/proto/gen/dxos/agent/functions.d.ts.map +1 -1
  105. package/dist/src/proto/gen/dxos/bot.d.ts +12 -24
  106. package/dist/src/proto/gen/dxos/bot.d.ts.map +1 -1
  107. package/dist/src/proto/gen/dxos/bot.js.map +1 -1
  108. package/dist/src/proto/gen/dxos/client/services.d.ts +242 -271
  109. package/dist/src/proto/gen/dxos/client/services.d.ts.map +1 -1
  110. package/dist/src/proto/gen/dxos/client/services.js +4 -2
  111. package/dist/src/proto/gen/dxos/client/services.js.map +1 -1
  112. package/dist/src/proto/gen/dxos/config.d.ts +58 -102
  113. package/dist/src/proto/gen/dxos/config.d.ts.map +1 -1
  114. package/dist/src/proto/gen/dxos/config.js.map +1 -1
  115. package/dist/src/proto/gen/dxos/devtools/host.d.ts +78 -96
  116. package/dist/src/proto/gen/dxos/devtools/host.d.ts.map +1 -1
  117. package/dist/src/proto/gen/dxos/devtools/swarm.d.ts +4 -8
  118. package/dist/src/proto/gen/dxos/devtools/swarm.d.ts.map +1 -1
  119. package/dist/src/proto/gen/dxos/echo/blob.d.ts +1 -2
  120. package/dist/src/proto/gen/dxos/echo/blob.d.ts.map +1 -1
  121. package/dist/src/proto/gen/dxos/echo/blob.js.map +1 -1
  122. package/dist/src/proto/gen/dxos/echo/feed.d.ts +4 -8
  123. package/dist/src/proto/gen/dxos/echo/feed.d.ts.map +1 -1
  124. package/dist/src/proto/gen/dxos/echo/filter.d.ts +2 -4
  125. package/dist/src/proto/gen/dxos/echo/filter.d.ts.map +1 -1
  126. package/dist/src/proto/gen/dxos/echo/filter.js.map +1 -1
  127. package/dist/src/proto/gen/dxos/echo/indexing.d.ts +2 -4
  128. package/dist/src/proto/gen/dxos/echo/indexing.d.ts.map +1 -1
  129. package/dist/src/proto/gen/dxos/echo/indexing.js.map +1 -1
  130. package/dist/src/proto/gen/dxos/echo/metadata.d.ts +12 -16
  131. package/dist/src/proto/gen/dxos/echo/metadata.d.ts.map +1 -1
  132. package/dist/src/proto/gen/dxos/echo/metadata.js.map +1 -1
  133. package/dist/src/proto/gen/dxos/echo/model/document.d.ts +11 -22
  134. package/dist/src/proto/gen/dxos/echo/model/document.d.ts.map +1 -1
  135. package/dist/src/proto/gen/dxos/echo/model/document.js.map +1 -1
  136. package/dist/src/proto/gen/dxos/echo/model/messenger.d.ts +1 -2
  137. package/dist/src/proto/gen/dxos/echo/model/messenger.d.ts.map +1 -1
  138. package/dist/src/proto/gen/dxos/echo/model/text.d.ts +2 -4
  139. package/dist/src/proto/gen/dxos/echo/model/text.d.ts.map +1 -1
  140. package/dist/src/proto/gen/dxos/echo/object.d.ts +6 -12
  141. package/dist/src/proto/gen/dxos/echo/object.d.ts.map +1 -1
  142. package/dist/src/proto/gen/dxos/echo/object.js.map +1 -1
  143. package/dist/src/proto/gen/dxos/echo/query.d.ts +4 -8
  144. package/dist/src/proto/gen/dxos/echo/query.d.ts.map +1 -1
  145. package/dist/src/proto/gen/dxos/echo/query.js.map +1 -1
  146. package/dist/src/proto/gen/dxos/echo/service.d.ts +36 -35
  147. package/dist/src/proto/gen/dxos/echo/service.d.ts.map +1 -1
  148. package/dist/src/proto/gen/dxos/echo/snapshot.d.ts +2 -4
  149. package/dist/src/proto/gen/dxos/echo/snapshot.d.ts.map +1 -1
  150. package/dist/src/proto/gen/dxos/echo/timeframe.d.ts +2 -4
  151. package/dist/src/proto/gen/dxos/echo/timeframe.d.ts.map +1 -1
  152. package/dist/src/proto/gen/dxos/edge/calls.d.ts +5 -10
  153. package/dist/src/proto/gen/dxos/edge/calls.d.ts.map +1 -1
  154. package/dist/src/proto/gen/dxos/edge/messenger.d.ts +6 -12
  155. package/dist/src/proto/gen/dxos/edge/messenger.d.ts.map +1 -1
  156. package/dist/src/proto/gen/dxos/edge/messenger.js.map +1 -1
  157. package/dist/src/proto/gen/dxos/edge/signal.d.ts +7 -14
  158. package/dist/src/proto/gen/dxos/edge/signal.d.ts.map +1 -1
  159. package/dist/src/proto/gen/dxos/error.d.ts +1 -2
  160. package/dist/src/proto/gen/dxos/error.d.ts.map +1 -1
  161. package/dist/src/proto/gen/dxos/gravity.d.ts +10 -20
  162. package/dist/src/proto/gen/dxos/gravity.d.ts.map +1 -1
  163. package/dist/src/proto/gen/dxos/halo/credentials/auth.d.ts +1 -2
  164. package/dist/src/proto/gen/dxos/halo/credentials/auth.d.ts.map +1 -1
  165. package/dist/src/proto/gen/dxos/halo/credentials/greet.d.ts +6 -12
  166. package/dist/src/proto/gen/dxos/halo/credentials/greet.d.ts.map +1 -1
  167. package/dist/src/proto/gen/dxos/halo/credentials/greet.js.map +1 -1
  168. package/dist/src/proto/gen/dxos/halo/credentials/identity.d.ts +2 -4
  169. package/dist/src/proto/gen/dxos/halo/credentials/identity.d.ts.map +1 -1
  170. package/dist/src/proto/gen/dxos/halo/credentials.d.ts +34 -44
  171. package/dist/src/proto/gen/dxos/halo/credentials.d.ts.map +1 -1
  172. package/dist/src/proto/gen/dxos/halo/credentials.js.map +1 -1
  173. package/dist/src/proto/gen/dxos/halo/invitations.d.ts +16 -28
  174. package/dist/src/proto/gen/dxos/halo/invitations.d.ts.map +1 -1
  175. package/dist/src/proto/gen/dxos/halo/invitations.js +3 -2
  176. package/dist/src/proto/gen/dxos/halo/invitations.js.map +1 -1
  177. package/dist/src/proto/gen/dxos/halo/keyring.d.ts +1 -2
  178. package/dist/src/proto/gen/dxos/halo/keyring.d.ts.map +1 -1
  179. package/dist/src/proto/gen/dxos/halo/keys.d.ts +2 -4
  180. package/dist/src/proto/gen/dxos/halo/keys.d.ts.map +1 -1
  181. package/dist/src/proto/gen/dxos/halo/signed.d.ts +4 -8
  182. package/dist/src/proto/gen/dxos/halo/signed.d.ts.map +1 -1
  183. package/dist/src/proto/gen/dxos/iframe.d.ts +4 -8
  184. package/dist/src/proto/gen/dxos/iframe.d.ts.map +1 -1
  185. package/dist/src/proto/gen/dxos/iframe.js.map +1 -1
  186. package/dist/src/proto/gen/dxos/keys.d.ts +2 -4
  187. package/dist/src/proto/gen/dxos/keys.d.ts.map +1 -1
  188. package/dist/src/proto/gen/dxos/mesh/bridge.d.ts +12 -24
  189. package/dist/src/proto/gen/dxos/mesh/bridge.d.ts.map +1 -1
  190. package/dist/src/proto/gen/dxos/mesh/broadcast.d.ts +1 -2
  191. package/dist/src/proto/gen/dxos/mesh/broadcast.d.ts.map +1 -1
  192. package/dist/src/proto/gen/dxos/mesh/messaging.d.ts +2 -4
  193. package/dist/src/proto/gen/dxos/mesh/messaging.d.ts.map +1 -1
  194. package/dist/src/proto/gen/dxos/mesh/muxer.d.ts +5 -10
  195. package/dist/src/proto/gen/dxos/mesh/muxer.d.ts.map +1 -1
  196. package/dist/src/proto/gen/dxos/mesh/presence.d.ts +1 -2
  197. package/dist/src/proto/gen/dxos/mesh/presence.d.ts.map +1 -1
  198. package/dist/src/proto/gen/dxos/mesh/protocol.d.ts +3 -6
  199. package/dist/src/proto/gen/dxos/mesh/protocol.d.ts.map +1 -1
  200. package/dist/src/proto/gen/dxos/mesh/replicator.d.ts +2 -4
  201. package/dist/src/proto/gen/dxos/mesh/replicator.d.ts.map +1 -1
  202. package/dist/src/proto/gen/dxos/mesh/signal.d.ts +9 -18
  203. package/dist/src/proto/gen/dxos/mesh/signal.d.ts.map +1 -1
  204. package/dist/src/proto/gen/dxos/mesh/signal.js.map +1 -1
  205. package/dist/src/proto/gen/dxos/mesh/swarm.d.ts +6 -12
  206. package/dist/src/proto/gen/dxos/mesh/swarm.d.ts.map +1 -1
  207. package/dist/src/proto/gen/dxos/mesh/teleport/auth.d.ts +2 -4
  208. package/dist/src/proto/gen/dxos/mesh/teleport/auth.d.ts.map +1 -1
  209. package/dist/src/proto/gen/dxos/mesh/teleport/automerge.d.ts +2 -4
  210. package/dist/src/proto/gen/dxos/mesh/teleport/automerge.d.ts.map +1 -1
  211. package/dist/src/proto/gen/dxos/mesh/teleport/blobsync.d.ts +3 -6
  212. package/dist/src/proto/gen/dxos/mesh/teleport/blobsync.d.ts.map +1 -1
  213. package/dist/src/proto/gen/dxos/mesh/teleport/control.d.ts +3 -6
  214. package/dist/src/proto/gen/dxos/mesh/teleport/control.d.ts.map +1 -1
  215. package/dist/src/proto/gen/dxos/mesh/teleport/gossip.d.ts +1 -2
  216. package/dist/src/proto/gen/dxos/mesh/teleport/gossip.d.ts.map +1 -1
  217. package/dist/src/proto/gen/dxos/mesh/teleport/notarization.d.ts +1 -2
  218. package/dist/src/proto/gen/dxos/mesh/teleport/notarization.d.ts.map +1 -1
  219. package/dist/src/proto/gen/dxos/mesh/teleport/replicator.d.ts +5 -10
  220. package/dist/src/proto/gen/dxos/mesh/teleport/replicator.d.ts.map +1 -1
  221. package/dist/src/proto/gen/dxos/mesh/teleport.d.ts +2 -4
  222. package/dist/src/proto/gen/dxos/mesh/teleport.d.ts.map +1 -1
  223. package/dist/src/proto/gen/dxos/registry.d.ts +3 -6
  224. package/dist/src/proto/gen/dxos/registry.d.ts.map +1 -1
  225. package/dist/src/proto/gen/dxos/rpc.d.ts +7 -14
  226. package/dist/src/proto/gen/dxos/rpc.d.ts.map +1 -1
  227. package/dist/src/proto/gen/dxos/rpc.js.map +1 -1
  228. package/dist/src/proto/gen/dxos/service/agentmanager.d.ts +4 -8
  229. package/dist/src/proto/gen/dxos/service/agentmanager.d.ts.map +1 -1
  230. package/dist/src/proto/gen/dxos/service/agentmanager.js.map +1 -1
  231. package/dist/src/proto/gen/dxos/service/publisher.d.ts +5 -10
  232. package/dist/src/proto/gen/dxos/service/publisher.d.ts.map +1 -1
  233. package/dist/src/proto/gen/dxos/service/supervisor.d.ts +12 -24
  234. package/dist/src/proto/gen/dxos/service/supervisor.d.ts.map +1 -1
  235. package/dist/src/proto/gen/dxos/service/supervisor.js.map +1 -1
  236. package/dist/src/proto/gen/dxos/service/tunnel.d.ts +3 -6
  237. package/dist/src/proto/gen/dxos/service/tunnel.d.ts.map +1 -1
  238. package/dist/src/proto/gen/dxos/tracing.d.ts +10 -20
  239. package/dist/src/proto/gen/dxos/tracing.d.ts.map +1 -1
  240. package/dist/src/proto/gen/dxos/type.d.ts +12 -24
  241. package/dist/src/proto/gen/dxos/type.d.ts.map +1 -1
  242. package/dist/src/proto/gen/dxos/value.d.ts +2 -4
  243. package/dist/src/proto/gen/dxos/value.d.ts.map +1 -1
  244. package/dist/src/proto/gen/example/testing/data.d.ts +4 -8
  245. package/dist/src/proto/gen/example/testing/data.d.ts.map +1 -1
  246. package/dist/src/proto/gen/example/testing/rpc.d.ts +7 -14
  247. package/dist/src/proto/gen/example/testing/rpc.d.ts.map +1 -1
  248. package/dist/src/proto/gen/google/protobuf.d.ts.map +1 -1
  249. package/dist/src/proto/gen/google/protobuf.js.map +1 -1
  250. package/dist/src/proto/gen/index.d.ts +7 -0
  251. package/dist/src/proto/gen/index.d.ts.map +1 -1
  252. package/dist/src/proto/gen/index.js +1 -1
  253. package/dist/src/proto/gen/index.js.map +1 -1
  254. package/dist/src/proto/index.js +1 -1
  255. package/dist/src/proto/substitutions.d.ts +8 -8
  256. package/dist/src/proto/substitutions.d.ts.map +1 -1
  257. package/dist/src/space-archive.d.ts +5 -5
  258. package/dist/src/space-archive.d.ts.map +1 -1
  259. package/dist/tsconfig.tsbuildinfo +1 -1
  260. package/package.json +12 -31
  261. package/src/FeedProtocol.ts +3 -0
  262. package/src/FunctionProtocol.ts +9 -0
  263. package/src/TraceProtocol.ts +21 -0
  264. package/src/automerge.ts +239 -13
  265. package/src/buf/proto/gen/dxos/client/invitation_pb.ts +19 -5
  266. package/src/buf/proto/gen/dxos/client/queue_pb.ts +88 -1
  267. package/src/buf/proto/gen/dxos/client/services_pb.ts +16 -1
  268. package/src/buf/proto/gen/dxos/config_pb.ts +8 -1
  269. package/src/buf/proto/gen/dxos/devtools/host_pb.ts +82 -1
  270. package/src/buf/proto/gen/dxos/echo/metadata_pb.ts +8 -1
  271. package/src/buf/proto/gen/dxos/echo/service_pb.ts +19 -3
  272. package/src/buf/proto/gen/dxos/halo/credentials_pb.ts +52 -21
  273. package/src/buf/proto/gen/dxos/halo/invitations_pb.ts +13 -5
  274. package/src/edge/EdgeFunctionEnv.ts +40 -3
  275. package/src/edge/edge.test.ts +64 -0
  276. package/src/edge/edge.ts +219 -5
  277. package/src/edge/registry.ts +82 -14
  278. package/src/index.ts +1 -1
  279. package/src/invitation.ts +3 -3
  280. package/src/profile-archive.ts +13 -0
  281. package/src/proto/dxos/client/invitation.proto +9 -2
  282. package/src/proto/dxos/client/queue.proto +21 -0
  283. package/src/proto/dxos/client/services.proto +4 -0
  284. package/src/proto/dxos/config.proto +2 -0
  285. package/src/proto/dxos/devtools/host.proto +27 -0
  286. package/src/proto/dxos/echo/metadata.proto +3 -0
  287. package/src/proto/dxos/echo/service.proto +14 -1
  288. package/src/proto/dxos/halo/credentials.proto +9 -0
  289. package/src/proto/dxos/halo/invitations.proto +5 -2
  290. package/src/proto/gen/dxos/agent/dashboard.ts +3 -6
  291. package/src/proto/gen/dxos/agent/echoproxy.ts +1 -2
  292. package/src/proto/gen/dxos/agent/epoch.ts +1 -2
  293. package/src/proto/gen/dxos/agent/functions.ts +6 -12
  294. package/src/proto/gen/dxos/bot.ts +12 -24
  295. package/src/proto/gen/dxos/client/services.ts +242 -271
  296. package/src/proto/gen/dxos/config.ts +58 -102
  297. package/src/proto/gen/dxos/devtools/host.ts +78 -96
  298. package/src/proto/gen/dxos/devtools/swarm.ts +4 -8
  299. package/src/proto/gen/dxos/echo/blob.ts +1 -2
  300. package/src/proto/gen/dxos/echo/feed.ts +4 -8
  301. package/src/proto/gen/dxos/echo/filter.ts +2 -4
  302. package/src/proto/gen/dxos/echo/indexing.ts +2 -4
  303. package/src/proto/gen/dxos/echo/metadata.ts +12 -16
  304. package/src/proto/gen/dxos/echo/model/document.ts +11 -22
  305. package/src/proto/gen/dxos/echo/model/messenger.ts +1 -2
  306. package/src/proto/gen/dxos/echo/model/text.ts +2 -4
  307. package/src/proto/gen/dxos/echo/object.ts +6 -12
  308. package/src/proto/gen/dxos/echo/query.ts +4 -8
  309. package/src/proto/gen/dxos/echo/service.ts +36 -35
  310. package/src/proto/gen/dxos/echo/snapshot.ts +2 -4
  311. package/src/proto/gen/dxos/echo/timeframe.ts +2 -4
  312. package/src/proto/gen/dxos/edge/calls.ts +5 -10
  313. package/src/proto/gen/dxos/edge/messenger.ts +6 -12
  314. package/src/proto/gen/dxos/edge/signal.ts +7 -14
  315. package/src/proto/gen/dxos/error.ts +1 -2
  316. package/src/proto/gen/dxos/gravity.ts +10 -20
  317. package/src/proto/gen/dxos/halo/credentials/auth.ts +1 -2
  318. package/src/proto/gen/dxos/halo/credentials/greet.ts +6 -12
  319. package/src/proto/gen/dxos/halo/credentials/identity.ts +2 -4
  320. package/src/proto/gen/dxos/halo/credentials.ts +34 -44
  321. package/src/proto/gen/dxos/halo/invitations.ts +16 -28
  322. package/src/proto/gen/dxos/halo/keyring.ts +1 -2
  323. package/src/proto/gen/dxos/halo/keys.ts +2 -4
  324. package/src/proto/gen/dxos/halo/signed.ts +4 -8
  325. package/src/proto/gen/dxos/iframe.ts +4 -8
  326. package/src/proto/gen/dxos/keys.ts +2 -4
  327. package/src/proto/gen/dxos/mesh/bridge.ts +12 -24
  328. package/src/proto/gen/dxos/mesh/broadcast.ts +1 -2
  329. package/src/proto/gen/dxos/mesh/messaging.ts +2 -4
  330. package/src/proto/gen/dxos/mesh/muxer.ts +5 -10
  331. package/src/proto/gen/dxos/mesh/presence.ts +1 -2
  332. package/src/proto/gen/dxos/mesh/protocol.ts +3 -6
  333. package/src/proto/gen/dxos/mesh/replicator.ts +2 -4
  334. package/src/proto/gen/dxos/mesh/signal.ts +9 -18
  335. package/src/proto/gen/dxos/mesh/swarm.ts +6 -12
  336. package/src/proto/gen/dxos/mesh/teleport/auth.ts +2 -4
  337. package/src/proto/gen/dxos/mesh/teleport/automerge.ts +2 -4
  338. package/src/proto/gen/dxos/mesh/teleport/blobsync.ts +3 -6
  339. package/src/proto/gen/dxos/mesh/teleport/control.ts +3 -6
  340. package/src/proto/gen/dxos/mesh/teleport/gossip.ts +1 -2
  341. package/src/proto/gen/dxos/mesh/teleport/notarization.ts +1 -2
  342. package/src/proto/gen/dxos/mesh/teleport/replicator.ts +5 -10
  343. package/src/proto/gen/dxos/mesh/teleport.ts +2 -4
  344. package/src/proto/gen/dxos/registry.ts +3 -6
  345. package/src/proto/gen/dxos/rpc.ts +7 -14
  346. package/src/proto/gen/dxos/service/agentmanager.ts +4 -8
  347. package/src/proto/gen/dxos/service/publisher.ts +5 -10
  348. package/src/proto/gen/dxos/service/supervisor.ts +12 -24
  349. package/src/proto/gen/dxos/service/tunnel.ts +3 -6
  350. package/src/proto/gen/dxos/tracing.ts +10 -20
  351. package/src/proto/gen/dxos/type.ts +12 -24
  352. package/src/proto/gen/dxos/value.ts +2 -4
  353. package/src/proto/gen/example/testing/data.ts +4 -8
  354. package/src/proto/gen/example/testing/rpc.ts +7 -14
  355. package/src/proto/gen/index.ts +8 -1
  356. package/dist/src/tracing.d.ts +0 -40
  357. package/dist/src/tracing.d.ts.map +0 -1
  358. package/dist/src/tracing.js +0 -50
  359. package/dist/src/tracing.js.map +0 -1
  360. package/src/tracing.ts +0 -86
package/src/edge/edge.ts CHANGED
@@ -13,10 +13,16 @@ import { SpaceId } from '@dxos/keys';
13
13
  */
14
14
  export const EDGE_CLIENT_TAG_HEADER = 'X-DXOS-Client-Tag';
15
15
 
16
+ /**
17
+ * HTTP header sent on every Edge request to provide a BYOK (Bring Your Own Key) for AI services.
18
+ */
19
+ export const BYOK_HEADER = 'X-BYOK';
20
+
16
21
  // TODO(burdon): Rename EdgerRouterEndpoint.
17
22
  // If we would rename it, we need to be careful to not break composer production.
18
23
  export enum EdgeService {
19
24
  AUTOMERGE_REPLICATOR = 'automerge-replicator',
25
+ SUBDUCTION_REPLICATOR = 'subduction-replicator',
20
26
  /**
21
27
  * Control feed replicator (hypercore append only logs) for the space.
22
28
  */
@@ -216,6 +222,12 @@ export type RecoverIdentityRequest = {
216
222
  lookupKey?: string;
217
223
  signature?: RecoverIdentitySignature;
218
224
  token?: string;
225
+ /**
226
+ * One-time proof minted by kms-service after a successful OAuth recovery flow.
227
+ * When provided, db-service redeems the proof to obtain the bound identityKey directly
228
+ * and `lookupKey`/`signature` are not required.
229
+ */
230
+ recoveryProof?: string;
219
231
  };
220
232
 
221
233
  export type RecoverIdentityResponseBody = {
@@ -314,8 +326,17 @@ export type EdgeAuthChallenge = {
314
326
  };
315
327
 
316
328
  export enum OAuthProvider {
317
- GOOGLE = 'google',
329
+ ATLASSIAN = 'atlassian',
330
+ ATPROTO = 'atproto',
331
+ /** @deprecated Use ATPROTO instead. */
318
332
  BLUESKY = 'bluesky',
333
+ DISCORD = 'discord',
334
+ GITHUB = 'github',
335
+ GOOGLE = 'google',
336
+ LINEAR = 'linear',
337
+ NOTION = 'notion',
338
+ SLACK = 'slack',
339
+ TRELLO = 'trello',
319
340
  }
320
341
 
321
342
  export const InitiateOAuthFlowRequestSchema = Schema.Struct({
@@ -325,8 +346,17 @@ export const InitiateOAuthFlowRequestSchema = Schema.Struct({
325
346
  scopes: Schema.mutable(Schema.Array(Schema.String)),
326
347
  // Set to true if we don't want periodic token refreshes in background, for cases like account connect
327
348
  noRefresh: Schema.optional(Schema.Boolean),
328
- // Provider-specific (user handle or did for bluesky) hint for auth server resolution
349
+ // Provider-specific (user handle or did for atproto) hint for auth server resolution
329
350
  loginHint: Schema.optional(Schema.String),
351
+ // Return a 302 redirect to composer://oauth/callback instead of HTML.
352
+ // Required for ASWebAuthenticationSession (iOS) which blocks JavaScript redirects.
353
+ nativeAppRedirect: Schema.optional(Schema.Boolean),
354
+ // OAuth-based account recovery: when purpose === 'register', kms-service writes a
355
+ // recovery binding for `identityKey` after the OAuth flow completes; when 'recovery',
356
+ // kms-service mints a one-time `recoveryProof` the client forwards to db-service.
357
+ registerRecovery: Schema.optional(Schema.Boolean),
358
+ identityKey: Schema.optional(Schema.String),
359
+ purpose: Schema.optional(Schema.Literal('register', 'recovery')),
330
360
  });
331
361
  export type InitiateOAuthFlowRequest = Schema.Schema.Type<typeof InitiateOAuthFlowRequestSchema>;
332
362
 
@@ -335,9 +365,29 @@ export type InitiateOAuthFlowResponse = {
335
365
  };
336
366
 
337
367
  export type OAuthFlowResult =
338
- | { success: true; accessToken: string; accessTokenId: string }
368
+ | { success: true; accessToken: string; accessTokenId: string; recoveryProof?: string }
339
369
  | { success: false; reason: string };
340
370
 
371
+ /**
372
+ * Completes OAuth recovery registration for an existing identity: routes the OAuth refresh token
373
+ * into the personal space and writes the recovery binding.
374
+ */
375
+ export type CompleteOAuthRegistrationRequest = {
376
+ registrationToken: string;
377
+ identityKey: string;
378
+ spaceKey: string;
379
+ };
380
+
381
+ export type CompleteOAuthRegistrationResponse = {
382
+ email?: string;
383
+ provider: OAuthProvider;
384
+ accessTokenId: string;
385
+ accessToken: string;
386
+ expiresInSeconds: number;
387
+ scopes: string[];
388
+ identifier: string;
389
+ };
390
+
341
391
  export enum EdgeWebsocketProtocol {
342
392
  V0 = 'edge-ws-v0',
343
393
  /**
@@ -543,7 +593,7 @@ export type InspectSpaceResponse = {
543
593
  objectCount: number;
544
594
  deletedObjectCount: number;
545
595
  indexedDocumentCount: number;
546
- objectsByType: { typeDxn: string; count: number }[];
596
+ objectsByType: { typeURI: string; count: number }[];
547
597
  indexerStatus: {
548
598
  indexingInProgress: boolean;
549
599
  cursors: { indexName: string; sourceName: string; resourceId: string | null; cursor: string | number }[];
@@ -571,7 +621,7 @@ export type InspectIdentityResponse = {
571
621
  spaces: InspectSpaceResponse[];
572
622
  };
573
623
 
574
- /** Matches the SerializedSpace format from @dxos/echo-db, extended with spaceId. */
624
+ /** Matches the SerializedSpace format from @dxos/echo-client, extended with spaceId. */
575
625
  export type SpaceExportPayload = {
576
626
  version: number;
577
627
  timestamp: string;
@@ -602,3 +652,167 @@ export type DeleteSpaceResponse = { status: string; spaceId: string };
602
652
 
603
653
  export type DeleteIdentityRequest = { identityKey: string };
604
654
  export type DeleteIdentityResponse = { status: string; identityKey: string };
655
+
656
+ //
657
+ // Account / Invitation
658
+ //
659
+
660
+ export const INVITATION_CODE_LENGTH = 8;
661
+ export const DEFAULT_INVITATIONS_PER_ACCOUNT = 5;
662
+
663
+ /** Crockford base32 alphabet (no I, L, O, U). Case-insensitive on the wire. */
664
+ export const INVITATION_CODE_ALPHABET = '0123456789ABCDEFGHJKMNPQRSTVWXYZ';
665
+
666
+ export const InvitationCodeSchema = Schema.String.pipe(
667
+ Schema.pattern(new RegExp(`^[${INVITATION_CODE_ALPHABET}]{${INVITATION_CODE_LENGTH}}$`)),
668
+ );
669
+
670
+ export const CheckEmailExistsRequestSchema = Schema.Struct({
671
+ email: Schema.String,
672
+ });
673
+ export type CheckEmailExistsRequest = Schema.Schema.Type<typeof CheckEmailExistsRequestSchema>;
674
+ export type CheckEmailExistsResponse = { exists: boolean };
675
+
676
+ export const ValidateInvitationCodeRequestSchema = Schema.Struct({
677
+ code: InvitationCodeSchema,
678
+ });
679
+ export type ValidateInvitationCodeRequest = Schema.Schema.Type<typeof ValidateInvitationCodeRequestSchema>;
680
+ export type ValidateInvitationCodeResponse = { valid: boolean };
681
+
682
+ /**
683
+ * Body of `POST /account/login`. Existing-account email recovery only --
684
+ * unlike `/account/signup`, this never creates new identities or waitlist rows.
685
+ */
686
+ export const LoginRequestSchema = Schema.Struct({
687
+ email: Schema.String,
688
+ identityDid: Schema.optional(Schema.String),
689
+ identityKey: Schema.optional(Schema.String),
690
+ });
691
+ export type LoginRequest = Schema.Schema.Type<typeof LoginRequestSchema>;
692
+
693
+ /**
694
+ * Response from `POST /account/login`. The shape is identical regardless of
695
+ * whether the email is registered, so the endpoint is safe against enumeration.
696
+ * Regular emails are delivered out-of-band and the response is `{}`.
697
+ */
698
+ export const LoginResponseSchema = Schema.Struct({
699
+ token: Schema.optional(Schema.String),
700
+ needsIdentity: Schema.optional(Schema.Boolean),
701
+ admitted: Schema.optional(Schema.Boolean),
702
+ });
703
+ export type LoginResponse = Schema.Schema.Type<typeof LoginResponseSchema>;
704
+
705
+ // Two-step signup: invitation code + identity DID + email.
706
+ export const RedeemInvitationCodeRequestSchema = Schema.Struct({
707
+ code: Schema.optional(InvitationCodeSchema),
708
+ identityDid: Schema.optional(Schema.String),
709
+ /** Raw hex public key, stored alongside the DID for the magic-link recovery flow. */
710
+ identityKey: Schema.optional(Schema.String),
711
+ email: Schema.String,
712
+ });
713
+ export type RedeemInvitationCodeRequest = Schema.Schema.Type<typeof RedeemInvitationCodeRequestSchema>;
714
+ export type RedeemInvitationCodeResponse =
715
+ | { accountId: string; emailVerificationSent: boolean }
716
+ | { needsIdentity: true };
717
+
718
+ export const GetAccountResponseSchema = Schema.Struct({
719
+ identityDid: Schema.String,
720
+ email: Schema.String,
721
+ emailVerified: Schema.Boolean,
722
+ /** ISO timestamp. */
723
+ createdAt: Schema.String,
724
+ invitationsRemaining: Schema.Number,
725
+ });
726
+ export type GetAccountResponse = Schema.Schema.Type<typeof GetAccountResponseSchema>;
727
+
728
+ export const AccountInvitationSchema = Schema.Struct({
729
+ code: Schema.String,
730
+ /** ISO timestamp. */
731
+ createdAt: Schema.String,
732
+ redeemedByIdentityDid: Schema.optional(Schema.String),
733
+ /** ISO timestamp. */
734
+ redeemedAt: Schema.optional(Schema.String),
735
+ });
736
+ export type AccountInvitation = Schema.Schema.Type<typeof AccountInvitationSchema>;
737
+
738
+ export const ListAccountInvitationsResponseSchema = Schema.Struct({
739
+ invitations: Schema.Array(AccountInvitationSchema),
740
+ });
741
+ export type ListAccountInvitationsResponse = Schema.Schema.Type<typeof ListAccountInvitationsResponseSchema>;
742
+
743
+ export type IssueInvitationResponse = { code: string };
744
+
745
+ export type ResendVerificationEmailResponse = {
746
+ sent: boolean;
747
+ cooldownSecondsRemaining?: number;
748
+ };
749
+
750
+ /**
751
+ * Submitted by users without an Account who want to request access. Captured
752
+ * by Hub for admin follow-up (e.g. mailing list, Discord notification).
753
+ */
754
+ export const RequestAccessRequestSchema = Schema.Struct({
755
+ email: Schema.String,
756
+ /** Optional: identity DID the user is currently signed in as. */
757
+ identityDid: Schema.optional(Schema.String),
758
+ /** Optional free-form message from the requester. */
759
+ message: Schema.optional(Schema.String),
760
+ });
761
+ export type RequestAccessRequest = Schema.Schema.Type<typeof RequestAccessRequestSchema>;
762
+ export type RequestAccessResponse = { received: boolean };
763
+
764
+ //
765
+ // Admin (X-API-KEY)
766
+ //
767
+
768
+ export type AdminListAccountsResponse = {
769
+ accounts: GetAccountResponse[];
770
+ };
771
+
772
+ export const AdminGrantInvitationsRequestSchema = Schema.Struct({
773
+ identityDid: Schema.String,
774
+ count: Schema.Number,
775
+ });
776
+ export type AdminGrantInvitationsRequest = Schema.Schema.Type<typeof AdminGrantInvitationsRequestSchema>;
777
+
778
+ export const AdminCreateInvitationCodesRequestSchema = Schema.Struct({
779
+ count: Schema.Number,
780
+ note: Schema.optional(Schema.String),
781
+ });
782
+ export type AdminCreateInvitationCodesRequest = Schema.Schema.Type<typeof AdminCreateInvitationCodesRequestSchema>;
783
+ export type AdminCreateInvitationCodesResponse = { codes: string[] };
784
+
785
+ export type AdminListInvitationCodesResponse = {
786
+ codes: Array<{
787
+ code: string;
788
+ /** ISO timestamp. */
789
+ createdAt: string;
790
+ note?: string;
791
+ issuedByIdentityDid?: string;
792
+ redeemedByIdentityDid?: string;
793
+ /** ISO timestamp. */
794
+ redeemedAt?: string;
795
+ /** ISO timestamp. Set when revoked. */
796
+ revokedAt?: string;
797
+ }>;
798
+ };
799
+
800
+ export const AdminRevokeInvitationCodeRequestSchema = Schema.Struct({
801
+ code: InvitationCodeSchema,
802
+ });
803
+ export type AdminRevokeInvitationCodeRequest = Schema.Schema.Type<typeof AdminRevokeInvitationCodeRequestSchema>;
804
+
805
+ /**
806
+ * Account/invitation-related variants placed in `EdgeFailure.data.type`.
807
+ * EdgeErrorData is open-ended; these are documentation for known values.
808
+ */
809
+ export type AccountErrorType =
810
+ | 'invitation_code_invalid'
811
+ | 'invitation_code_already_redeemed'
812
+ | 'invitation_code_revoked'
813
+ | 'email_already_registered'
814
+ | 'identity_already_associated'
815
+ | 'no_invitations_remaining'
816
+ | 'identity_not_associated_with_account'
817
+ | 'no_account'
818
+ | 'rate_limited';
@@ -15,6 +15,7 @@ export const PluginMetaSchema = Schema.Struct({
15
15
  id: Schema.String.pipe(Schema.nonEmptyString()),
16
16
  name: Schema.String.pipe(Schema.nonEmptyString()),
17
17
  description: Schema.optional(Schema.String),
18
+ author: Schema.optional(Schema.String),
18
19
  homePage: Schema.optional(Schema.String),
19
20
  source: Schema.optional(Schema.String),
20
21
  screenshots: Schema.optional(Schema.Array(Schema.String)),
@@ -31,14 +32,32 @@ export type PluginMeta = Schema.Schema.Type<typeof PluginMetaSchema>;
31
32
  export const PluginHealthSchema = Schema.Literal('ok', 'release-missing', 'manifest-invalid', 'repo-unavailable');
32
33
  export type PluginHealth = Schema.Schema.Type<typeof PluginHealthSchema>;
33
34
 
35
+ /**
36
+ * Filename of the entry module every plugin must publish at the root of its bundle.
37
+ * The host dynamic-imports `<manifest URL base>/index.mjs` directly — no per-plugin
38
+ * configuration. `composerPlugin` outputs the bundle under this name so plugin authors
39
+ * never have to think about it.
40
+ */
41
+ export const PLUGIN_ENTRY_FILENAME = 'index.mjs';
42
+
34
43
  /**
35
44
  * Shape of the manifest-asset JSON the registry service fetches from each plugin's latest release.
36
- * Extends {@link PluginMetaSchema} with an optional override for the module bundle filename
37
- * (defaults to `plugin.mjs`).
45
+ *
46
+ * Emitted by `@dxos/app-framework/vite-plugin`'s `composerPlugin` (see
47
+ * `MANIFEST_ASSET_NAME`). Lists every file the plugin needs at runtime — the entry
48
+ * module ({@link PLUGIN_ENTRY_FILENAME}) plus any sibling CSS, code-split chunks,
49
+ * fonts, etc. — so the host can eagerly precache the whole bundle for offline use.
50
+ * Paths in `assets` are relative to the manifest's URL.
38
51
  */
39
52
  export const PluginManifestSchema = Schema.Struct({
40
53
  ...PluginMetaSchema.fields,
41
- moduleFile: Schema.optional(Schema.String),
54
+ /** Plugin version (semver). Sourced from the publishing project's `package.json`. */
55
+ version: Schema.String.pipe(Schema.nonEmptyString()),
56
+ /**
57
+ * Relative paths of every file the plugin needs at runtime, including the entry.
58
+ * Must include {@link PLUGIN_ENTRY_FILENAME}; consumers verify on parse.
59
+ */
60
+ assets: Schema.Array(Schema.String).pipe(Schema.minItems(1)),
42
61
  });
43
62
  export type PluginManifest = Schema.Schema.Type<typeof PluginManifestSchema>;
44
63
 
@@ -46,17 +65,17 @@ export type PluginManifest = Schema.Schema.Type<typeof PluginManifestSchema>;
46
65
  * Single hydrated plugin entry returned by the registry service.
47
66
  */
48
67
  export const PluginEntrySchema = Schema.Struct({
49
- /** GitHub repository in `owner/name` form. */
50
- repo: Schema.String.pipe(Schema.nonEmptyString()),
68
+ /** GitHub repository in `owner/name` form. Empty string for entries sourced from a `manifestUrl`. */
69
+ repo: Schema.String,
51
70
  /** Plugin metadata from the repo's latest-release `manifest.json`. */
52
71
  meta: PluginMetaSchema,
53
72
  /**
54
- * URL from which Composer can dynamic-import the plugin module. The registry service is
55
- * responsible for returning a URL that is CORS-safe for browser `import()` (e.g. served or
56
- * proxied by the service itself); clients pass this value directly to the URL loader.
73
+ * URL of the plugin's `manifest.json`. Composer's URL loader fetches this, eagerly caches
74
+ * every declared asset via the platform `PluginAssetCache`, then dynamic-imports the entry.
75
+ * The URL must be CORS-safe and have its declared assets reachable as siblings.
57
76
  */
58
77
  moduleUrl: Schema.String,
59
- /** Release tag the entry was resolved from (e.g. `v0.1.0`). */
78
+ /** Release tag the entry was resolved from (e.g. `v0.1.0`). Empty string for `manifestUrl` entries. */
60
79
  releaseTag: Schema.String,
61
80
  /** Health signal set by the service when an entry fails to refresh. */
62
81
  health: PluginHealthSchema,
@@ -78,6 +97,59 @@ export const GetPluginsResponseBodySchema = Schema.Struct({
78
97
  });
79
98
  export type GetPluginsResponseBody = Schema.Schema.Type<typeof GetPluginsResponseBodySchema>;
80
99
 
100
+ /**
101
+ * A single published version of a plugin, as returned by the registry service's
102
+ * versions endpoint. Sourced from the publishing project's GitHub releases.
103
+ *
104
+ * The host treats `tag` opaquely; ordering — newest first — is the service's
105
+ * responsibility (typically reverse-chronological by release date).
106
+ */
107
+ export const PluginVersionSchema = Schema.Struct({
108
+ /** Release tag (e.g. `v0.1.21`). Stable identifier for this version. */
109
+ tag: Schema.String.pipe(Schema.nonEmptyString()),
110
+ /**
111
+ * URL of this version's `manifest.json`. Matches the shape of {@link PluginEntrySchema.fields.moduleUrl}
112
+ * but pinned to a specific release rather than the latest. Composer's URL loader fetches
113
+ * this when the user installs / rolls back to this version.
114
+ */
115
+ moduleUrl: Schema.String.pipe(Schema.nonEmptyString()),
116
+ /** Unix ms when the version was released. Optional — services that lack this signal can omit. */
117
+ releasedAt: Schema.optional(Schema.Number),
118
+ });
119
+ export type PluginVersion = Schema.Schema.Type<typeof PluginVersionSchema>;
120
+
121
+ /**
122
+ * Response body of `GET /registry/plugins/:repo/versions`.
123
+ *
124
+ * `:repo` is the GitHub `owner/name` form, URL-encoded (so `/` is escaped).
125
+ * Returns all hydratable releases for the repo, newest first; clients display them
126
+ * in the version picker for install / roll-back. Unauthenticated; same surface area
127
+ * as `GET /registry/plugins`.
128
+ */
129
+ export const GetPluginVersionsResponseBodySchema = Schema.Struct({
130
+ /** Wire-format schema version, pinned to 1. */
131
+ version: Schema.Literal(1),
132
+ /** Available versions for the requested repo, newest first. */
133
+ versions: Schema.Array(PluginVersionSchema),
134
+ /** Unix ms timestamp of the most recent successful refresh cycle for this repo. */
135
+ refreshedAt: Schema.Number,
136
+ });
137
+ export type GetPluginVersionsResponseBody = Schema.Schema.Type<typeof GetPluginVersionsResponseBodySchema>;
138
+
139
+ /**
140
+ * A catalog entry. Two flavours:
141
+ * - `{ repo }`: the registry service hydrates from the GitHub repo's latest release.
142
+ * Used by the production catalog.
143
+ * - `{ manifestUrl }`: the registry service skips GitHub and fetches the manifest directly.
144
+ * Used for local development against an in-progress plugin (e.g. served by `vite preview`)
145
+ * so authors can iterate without publishing a release.
146
+ */
147
+ export const RegistryEntrySchema = Schema.Union(
148
+ Schema.Struct({ repo: Schema.String.pipe(Schema.nonEmptyString()) }),
149
+ Schema.Struct({ manifestUrl: Schema.String.pipe(Schema.nonEmptyString()) }),
150
+ );
151
+ export type RegistryEntry = Schema.Schema.Type<typeof RegistryEntrySchema>;
152
+
81
153
  /**
82
154
  * Shape of the catalog manifest published in the upstream community-plugins repo.
83
155
  * Extra keys (e.g. `$schema`) are permitted.
@@ -85,11 +157,7 @@ export type GetPluginsResponseBody = Schema.Schema.Type<typeof GetPluginsRespons
85
157
  export const RegistryManifestSchema = Schema.Struct(
86
158
  {
87
159
  version: Schema.Literal(1),
88
- plugins: Schema.Array(
89
- Schema.Struct({
90
- repo: Schema.String,
91
- }),
92
- ),
160
+ plugins: Schema.Array(RegistryEntrySchema),
93
161
  },
94
162
  Schema.Record({ key: Schema.String, value: Schema.Unknown }),
95
163
  );
package/src/index.ts CHANGED
@@ -10,7 +10,7 @@ export * from './messenger.ts';
10
10
  export * from './profile-archive.ts';
11
11
  export * from './space-archive.ts';
12
12
  export * from './storage.ts';
13
- export * from './tracing.ts';
14
13
  export type * from './types.ts';
15
14
  export * as FunctionProtocol from './FunctionProtocol.ts';
16
15
  export * as FeedProtocol from './FeedProtocol.ts';
16
+ export * as TraceProtocol from './TraceProtocol.ts';
package/src/invitation.ts CHANGED
@@ -4,11 +4,11 @@
4
4
 
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
- import { ParamKeyAnnotation } from '@dxos/effect';
7
+ import { SchemaEx } from '@dxos/effect';
8
8
 
9
9
  // TODO(burdon): Use uniformly for processing HTTP params.
10
10
  export const InvitationUrl = Schema.Struct({
11
11
  accessToken: Schema.String, // TODO(burdon): Remove.
12
- deviceInvitationCode: Schema.String.pipe(ParamKeyAnnotation({ key: 'deviceInvitationCode' })),
13
- spaceInvitationCode: Schema.String.pipe(ParamKeyAnnotation({ key: 'spaceInvitationCode' })),
12
+ deviceInvitationCode: Schema.String.pipe(SchemaEx.ParamKeyAnnotation({ key: 'deviceInvitationCode' })),
13
+ spaceInvitationCode: Schema.String.pipe(SchemaEx.ParamKeyAnnotation({ key: 'spaceInvitationCode' })),
14
14
  });
@@ -8,17 +8,30 @@
8
8
  export type ProfileArchive = {
9
9
  meta: {
10
10
  timestamp: string;
11
+ /** Host (e.g. `main.composer.space`, `localhost:5173`) where the archive was exported. */
12
+ origin?: string;
11
13
  };
12
14
  storage: ProfileArchiveEntry[];
13
15
  };
14
16
 
15
17
  export type ProfileArchiveEntry = {
16
18
  type: ProfileArchiveEntryType;
19
+ /**
20
+ * FILE: filename in random-access storage.
21
+ * KEY_VALUE: binary LevelDB key.
22
+ * SQLITE_DATABASE: OPFS database filename (e.g. `DXOS`).
23
+ */
17
24
  key: string | Uint8Array;
25
+ /**
26
+ * FILE / KEY_VALUE / SQLITE_DATABASE: binary payload.
27
+ * SQLITE_DATABASE must be a valid SQLite file (magic `SQLite format 3`).
28
+ */
18
29
  value: string | Uint8Array;
19
30
  };
20
31
 
21
32
  export enum ProfileArchiveEntryType {
22
33
  FILE = 1,
23
34
  KEY_VALUE = 2,
35
+ /** OPFS-hosted SQLite database; `key` is the OPFS filename, `value` is raw SQLite bytes. */
36
+ SQLITE_DATABASE = 3,
24
37
  }
@@ -43,6 +43,9 @@ enum SpaceState {
43
43
  /// Space is active. Swarming and replication will be done.
44
44
  SPACE_ACTIVE = 6;
45
45
 
46
+ /// Space is tombstoned (soft-deleted). Replicated to other devices; never auto-opened.
47
+ SPACE_DELETED = 9;
48
+
46
49
  ///
47
50
  /// Runtime states:
48
51
  ///
@@ -85,8 +88,12 @@ message Invitation {
85
88
  }
86
89
 
87
90
  enum Kind {
88
- DEVICE = 0;
89
- SPACE = 1;
91
+ /// Unset / unknown. Must not be used for new invitations.
92
+ INVALID = 0;
93
+
94
+ DEVICE = 1;
95
+
96
+ SPACE = 2;
90
97
  }
91
98
 
92
99
  enum AuthMethod {
@@ -73,9 +73,30 @@ message SyncQueueRequest {
73
73
  optional bool should_pull = 5;
74
74
  }
75
75
 
76
+ message GetSyncStateRequest {
77
+ string space_id = 1;
78
+ /// If empty, returns state for all namespaces synced by the client.
79
+ repeated string namespaces = 2;
80
+ }
81
+
82
+ message QueueNamespaceSyncState {
83
+ string namespace = 1;
84
+ /// Blocks still to pull from remote. 0 when caught up.
85
+ int64 blocks_to_pull = 2;
86
+ /// Unpositioned blocks still to push to remote. 0 when caught up.
87
+ int64 blocks_to_push = 3;
88
+ /// Total blocks stored locally for this namespace in the space.
89
+ int64 total_blocks = 4;
90
+ }
91
+
92
+ message GetSyncStateResponse {
93
+ repeated QueueNamespaceSyncState namespaces = 1;
94
+ }
95
+
76
96
  service QueueService {
77
97
  rpc QueryQueue(QueryQueueRequest) returns (QueueQueryResult);
78
98
  rpc InsertIntoQueue(InsertIntoQueueRequest) returns (google.protobuf.Empty);
79
99
  rpc DeleteFromQueue(DeleteFromQueueRequest) returns (google.protobuf.Empty);
80
100
  rpc SyncQueue(SyncQueueRequest) returns (google.protobuf.Empty);
101
+ rpc GetSyncState(GetSyncStateRequest) returns (GetSyncStateResponse);
81
102
  }
@@ -146,6 +146,8 @@ message RecoverIdentityRequest {
146
146
  string recovery_code = 1;
147
147
  ExternalSignature external = 2;
148
148
  string token = 3;
149
+ /// One-time proof minted by edge kms-service after a successful OAuth recovery flow.
150
+ string recovery_proof = 4;
149
151
  }
150
152
  }
151
153
 
@@ -467,6 +469,8 @@ message ExportSpaceResponse {
467
469
 
468
470
  message ImportSpaceRequest {
469
471
  SpaceArchive archive = 1;
472
+ /// Immutable tags to set on the imported space at creation time.
473
+ repeated string tags = 2;
470
474
  }
471
475
 
472
476
  message ImportSpaceResponse {
@@ -145,6 +145,8 @@ message Runtime {
145
145
  message EdgeFeatures {
146
146
  optional bool feed_replicator = 1;
147
147
  optional bool echo_replicator = 2;
148
+ /// Enables Subduction sedimentree transport for Automerge document replication.
149
+ optional bool subduction_replicator = 5;
148
150
  optional bool signaling = 3;
149
151
  optional bool agents = 4;
150
152
  }
@@ -78,6 +78,13 @@ service DevtoolsHost {
78
78
  rpc SubscribeToSignalStatus(google.protobuf.Empty) returns (stream SubscribeToSignalStatusResponse);
79
79
  rpc SubscribeToSignal(google.protobuf.Empty) returns (stream SignalResponse);
80
80
  rpc SubscribeToSwarmInfo(SubscribeToSwarmInfoRequest) returns (stream SubscribeToSwarmInfoResponse);
81
+
82
+ //
83
+ // SQLite
84
+ //
85
+
86
+ rpc ExportSqliteDatabase(google.protobuf.Empty) returns (ExportSqliteDatabaseResponse);
87
+ rpc RunSqliteQuery(RunSqliteQueryRequest) returns (RunSqliteQueryResponse);
81
88
  }
82
89
 
83
90
  message Event {
@@ -338,3 +345,23 @@ message SubscribeToSwarmInfoRequest {}
338
345
  message SubscribeToSwarmInfoResponse {
339
346
  repeated dxos.devtools.swarm.SwarmInfo data = 1;
340
347
  }
348
+
349
+ //
350
+ // SQLite
351
+ //
352
+
353
+ message ExportSqliteDatabaseResponse {
354
+ bytes data = 1;
355
+ }
356
+
357
+ message RunSqliteQueryRequest {
358
+ string query = 1;
359
+ // JSON-encoded array of query parameters.
360
+ optional string params = 2;
361
+ }
362
+
363
+ message RunSqliteQueryResponse {
364
+ // JSON-encoded array of row objects.
365
+ string rows = 1;
366
+ optional string error = 2;
367
+ }
@@ -34,6 +34,9 @@ message EchoMetadata {
34
34
 
35
35
  // TODO(burdon): Circular dep.
36
36
  repeated dxos.client.services.Invitation invitations = 12;
37
+
38
+ /// Keys of spaces that have been tombstoned (soft-deleted). Survives restart; prevents re-acceptance.
39
+ repeated dxos.keys.PublicKey deleted_spaces = 13;
37
40
  }
38
41
 
39
42
  /// Per-space metadata. Frequent updates. Keep small.
@@ -60,8 +60,21 @@ message DocumentUpdate {
60
60
  /**
61
61
  * Automerge document incremental update.
62
62
  * Value returned by `Automerge.saveSince()`.
63
+ * Optional: if absent, the update only carries a transition signal (e.g.
64
+ * `requesting`) and not new bytes.
63
65
  */
64
- bytes mutation = 2;
66
+ optional bytes mutation = 2;
67
+
68
+ /**
69
+ * Set by the worker when the disk probe for this document completes
70
+ * negative — i.e. the document is not on local storage, and the worker
71
+ * has started a network fetch. The client moves the corresponding
72
+ * `DocHandleProxy` from `'pending'` to `'requesting'`. Once the bytes
73
+ * eventually arrive, a normal `mutation` update follows and the handle
74
+ * transitions to `'ready'`. Used by query-driven (disk-only) callers to
75
+ * give up on a load without waiting on the network.
76
+ */
77
+ optional bool requesting = 3;
65
78
  }
66
79
 
67
80
  message DocHeadsList {
@@ -87,6 +87,15 @@ message MemberProfile {
87
87
  optional ProfileDocument profile = 3;
88
88
  }
89
89
 
90
+ // [ASSERTION]: Space has been tombstoned (soft-deleted) by its owner.
91
+ // Written to the identity's HALO so the deletion replicates across the user's devices.
92
+ // A tombstone stops replication and unloads the space; data is not removed until garbage collection.
93
+ message SpaceDeleted {
94
+ dxos.keys.PublicKey space_key = 1;
95
+ google.protobuf.Timestamp deleted_at = 2;
96
+ optional string reason = 3;
97
+ }
98
+
90
99
  // [ASSERTION]: Device is authorized to sign messages for a given Agent (Identity).
91
100
  // NOTE: Devices are Admitted to Identities.
92
101
  message AuthorizedDevice {
@@ -16,8 +16,11 @@ package dxos.halo.invitations;
16
16
 
17
17
  message InvitationOptions {
18
18
  enum Role {
19
- GUEST = 0;
20
- HOST = 1;
19
+ // Sentinel so neither real role is the proto3 default (which is stripped on the wire,
20
+ // causing the receiver to see `role === undefined` and reject with InvalidInvitationExtensionRoleError).
21
+ INVALID = 0;
22
+ GUEST = 1;
23
+ HOST = 2;
21
24
  }
22
25
 
23
26
  /// Role of the peer.