@dxos/protocols 0.8.4-main.fffef41 → 0.8.4-staging.60fe92afc8

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 (507) hide show
  1. package/LICENSE +102 -5
  2. package/README.md +1 -1
  3. package/dist/src/FeedProtocol.d.ts +528 -0
  4. package/dist/src/FeedProtocol.d.ts.map +1 -0
  5. package/dist/src/FeedProtocol.js +237 -0
  6. package/dist/src/FeedProtocol.js.map +1 -0
  7. package/dist/src/FunctionProtocol.d.ts +15 -2
  8. package/dist/src/FunctionProtocol.d.ts.map +1 -1
  9. package/dist/src/TraceProtocol.d.ts +15 -0
  10. package/dist/src/TraceProtocol.d.ts.map +1 -0
  11. package/dist/src/TraceProtocol.js +4 -0
  12. package/dist/src/TraceProtocol.js.map +1 -0
  13. package/dist/src/automerge.d.ts +203 -13
  14. package/dist/src/automerge.d.ts.map +1 -1
  15. package/dist/src/automerge.js +17 -0
  16. package/dist/src/automerge.js.map +1 -1
  17. package/dist/src/buf/proto/gen/dxos/client/invitation_pb.d.ts +16 -4
  18. package/dist/src/buf/proto/gen/dxos/client/invitation_pb.d.ts.map +1 -1
  19. package/dist/src/buf/proto/gen/dxos/client/invitation_pb.js +17 -5
  20. package/dist/src/buf/proto/gen/dxos/client/invitation_pb.js.map +1 -1
  21. package/dist/src/buf/proto/gen/dxos/client/queue_pb.d.ts +311 -0
  22. package/dist/src/buf/proto/gen/dxos/client/queue_pb.d.ts.map +1 -0
  23. package/dist/src/buf/proto/gen/dxos/client/queue_pb.js +59 -0
  24. package/dist/src/buf/proto/gen/dxos/client/queue_pb.js.map +1 -0
  25. package/dist/src/buf/proto/gen/dxos/client/services_pb.d.ts +78 -3
  26. package/dist/src/buf/proto/gen/dxos/client/services_pb.d.ts.map +1 -1
  27. package/dist/src/buf/proto/gen/dxos/client/services_pb.js +68 -37
  28. package/dist/src/buf/proto/gen/dxos/client/services_pb.js.map +1 -1
  29. package/dist/src/buf/proto/gen/dxos/config_pb.d.ts +112 -0
  30. package/dist/src/buf/proto/gen/dxos/config_pb.d.ts.map +1 -1
  31. package/dist/src/buf/proto/gen/dxos/config_pb.js +72 -1
  32. package/dist/src/buf/proto/gen/dxos/config_pb.js.map +1 -1
  33. package/dist/src/buf/proto/gen/dxos/devtools/host_pb.d.ts +70 -0
  34. package/dist/src/buf/proto/gen/dxos/devtools/host_pb.d.ts.map +1 -1
  35. package/dist/src/buf/proto/gen/dxos/devtools/host_pb.js +16 -1
  36. package/dist/src/buf/proto/gen/dxos/devtools/host_pb.js.map +1 -1
  37. package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.d.ts +12 -0
  38. package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.d.ts.map +1 -1
  39. package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.js +1 -1
  40. package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.js.map +1 -1
  41. package/dist/src/buf/proto/gen/dxos/echo/query_pb.d.ts +12 -2
  42. package/dist/src/buf/proto/gen/dxos/echo/query_pb.d.ts.map +1 -1
  43. package/dist/src/buf/proto/gen/dxos/echo/query_pb.js +1 -1
  44. package/dist/src/buf/proto/gen/dxos/echo/query_pb.js.map +1 -1
  45. package/dist/src/buf/proto/gen/dxos/echo/service_pb.d.ts +68 -7
  46. package/dist/src/buf/proto/gen/dxos/echo/service_pb.d.ts.map +1 -1
  47. package/dist/src/buf/proto/gen/dxos/echo/service_pb.js +15 -5
  48. package/dist/src/buf/proto/gen/dxos/echo/service_pb.js.map +1 -1
  49. package/dist/src/buf/proto/gen/dxos/edge/messenger_pb.d.ts +28 -0
  50. package/dist/src/buf/proto/gen/dxos/edge/messenger_pb.d.ts.map +1 -1
  51. package/dist/src/buf/proto/gen/dxos/edge/messenger_pb.js +10 -5
  52. package/dist/src/buf/proto/gen/dxos/edge/messenger_pb.js.map +1 -1
  53. package/dist/src/buf/proto/gen/dxos/google_pb.js +1 -1
  54. package/dist/src/buf/proto/gen/dxos/google_pb.js.map +1 -1
  55. package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.d.ts +65 -0
  56. package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.d.ts.map +1 -1
  57. package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.js +52 -22
  58. package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.js.map +1 -1
  59. package/dist/src/buf/proto/gen/dxos/halo/invitations_pb.d.ts +11 -4
  60. package/dist/src/buf/proto/gen/dxos/halo/invitations_pb.d.ts.map +1 -1
  61. package/dist/src/buf/proto/gen/dxos/halo/invitations_pb.js +12 -5
  62. package/dist/src/buf/proto/gen/dxos/halo/invitations_pb.js.map +1 -1
  63. package/dist/src/buf/proto/gen/dxos/iframe_pb.d.ts +1 -10
  64. package/dist/src/buf/proto/gen/dxos/iframe_pb.d.ts.map +1 -1
  65. package/dist/src/buf/proto/gen/dxos/iframe_pb.js +1 -1
  66. package/dist/src/buf/proto/gen/dxos/iframe_pb.js.map +1 -1
  67. package/dist/src/buf/proto/gen/dxos/rpc_pb.d.ts +24 -0
  68. package/dist/src/buf/proto/gen/dxos/rpc_pb.d.ts.map +1 -1
  69. package/dist/src/buf/proto/gen/dxos/rpc_pb.js +12 -7
  70. package/dist/src/buf/proto/gen/dxos/rpc_pb.js.map +1 -1
  71. package/dist/src/buf/proto/gen/dxos/tracing_pb.d.ts +1 -139
  72. package/dist/src/buf/proto/gen/dxos/tracing_pb.d.ts.map +1 -1
  73. package/dist/src/buf/proto/gen/dxos/tracing_pb.js +11 -45
  74. package/dist/src/buf/proto/gen/dxos/tracing_pb.js.map +1 -1
  75. package/dist/src/edge/EdgeFunctionEnv.d.ts +134 -0
  76. package/dist/src/edge/EdgeFunctionEnv.d.ts.map +1 -0
  77. package/dist/src/edge/EdgeFunctionEnv.js +4 -0
  78. package/dist/src/edge/EdgeFunctionEnv.js.map +1 -0
  79. package/dist/src/edge/edge.d.ts +698 -0
  80. package/dist/src/edge/edge.d.ts.map +1 -0
  81. package/dist/src/edge/edge.js +278 -0
  82. package/dist/src/edge/edge.js.map +1 -0
  83. package/dist/src/edge/edge.test.d.ts +2 -0
  84. package/dist/src/edge/edge.test.d.ts.map +1 -0
  85. package/dist/src/edge/edge.test.js +50 -0
  86. package/dist/src/edge/edge.test.js.map +1 -0
  87. package/dist/src/{edge-error.d.ts → edge/errors.d.ts} +6 -7
  88. package/dist/src/edge/errors.d.ts.map +1 -0
  89. package/dist/src/{edge-error.js → edge/errors.js} +13 -14
  90. package/dist/src/edge/errors.js.map +1 -0
  91. package/dist/src/edge/index.d.ts +5 -0
  92. package/dist/src/edge/index.d.ts.map +1 -0
  93. package/dist/src/edge/index.js +8 -0
  94. package/dist/src/edge/index.js.map +1 -0
  95. package/dist/src/edge/registry.d.ts +212 -0
  96. package/dist/src/edge/registry.d.ts.map +1 -0
  97. package/dist/src/edge/registry.js +139 -0
  98. package/dist/src/edge/registry.js.map +1 -0
  99. package/dist/src/errors/base-errors.d.ts +86 -8
  100. package/dist/src/errors/base-errors.d.ts.map +1 -1
  101. package/dist/src/errors/base-errors.js +4 -20
  102. package/dist/src/errors/base-errors.js.map +1 -1
  103. package/dist/src/errors/encoding.d.ts +2 -2
  104. package/dist/src/errors/encoding.d.ts.map +1 -1
  105. package/dist/src/errors/encoding.js.map +1 -1
  106. package/dist/src/errors/errors.d.ts +619 -42
  107. package/dist/src/errors/errors.d.ts.map +1 -1
  108. package/dist/src/errors/errors.js +49 -103
  109. package/dist/src/errors/errors.js.map +1 -1
  110. package/dist/src/errors/errors.test.js +1 -1
  111. package/dist/src/errors/errors.test.js.map +1 -1
  112. package/dist/src/errors/helpers.d.ts +9 -5
  113. package/dist/src/errors/helpers.d.ts.map +1 -1
  114. package/dist/src/errors/helpers.js +3 -3
  115. package/dist/src/errors/helpers.js.map +1 -1
  116. package/dist/src/errors/index.d.ts +5 -5
  117. package/dist/src/errors/parameter.d.ts.map +1 -1
  118. package/dist/src/feed-replication.d.ts.map +1 -1
  119. package/dist/src/index.d.ts +12 -13
  120. package/dist/src/index.d.ts.map +1 -1
  121. package/dist/src/index.js +4 -5
  122. package/dist/src/index.js.map +1 -1
  123. package/dist/src/indexing.d.ts.map +1 -1
  124. package/dist/src/invitation.js +3 -3
  125. package/dist/src/invitation.js.map +1 -1
  126. package/dist/src/messenger.d.ts +16 -0
  127. package/dist/src/messenger.d.ts.map +1 -0
  128. package/dist/src/messenger.js +4 -0
  129. package/dist/src/messenger.js.map +1 -0
  130. package/dist/src/profile-archive.d.ts +14 -1
  131. package/dist/src/profile-archive.d.ts.map +1 -1
  132. package/dist/src/profile-archive.js +2 -0
  133. package/dist/src/profile-archive.js.map +1 -1
  134. package/dist/src/proto/gen/dxos/agent/dashboard.d.ts +3 -6
  135. package/dist/src/proto/gen/dxos/agent/dashboard.d.ts.map +1 -1
  136. package/dist/src/proto/gen/dxos/agent/dashboard.js.map +1 -1
  137. package/dist/src/proto/gen/dxos/agent/echoproxy.d.ts +1 -2
  138. package/dist/src/proto/gen/dxos/agent/echoproxy.d.ts.map +1 -1
  139. package/dist/src/proto/gen/dxos/agent/epoch.d.ts +1 -2
  140. package/dist/src/proto/gen/dxos/agent/epoch.d.ts.map +1 -1
  141. package/dist/src/proto/gen/dxos/agent/functions.d.ts +6 -12
  142. package/dist/src/proto/gen/dxos/agent/functions.d.ts.map +1 -1
  143. package/dist/src/proto/gen/dxos/bot.d.ts +12 -24
  144. package/dist/src/proto/gen/dxos/bot.d.ts.map +1 -1
  145. package/dist/src/proto/gen/dxos/bot.js.map +1 -1
  146. package/dist/src/proto/gen/dxos/client/services.d.ts +1050 -915
  147. package/dist/src/proto/gen/dxos/client/services.d.ts.map +1 -1
  148. package/dist/src/proto/gen/dxos/client/services.js +109 -94
  149. package/dist/src/proto/gen/dxos/client/services.js.map +1 -1
  150. package/dist/src/proto/gen/dxos/config.d.ts +115 -100
  151. package/dist/src/proto/gen/dxos/config.d.ts.map +1 -1
  152. package/dist/src/proto/gen/dxos/config.js +26 -0
  153. package/dist/src/proto/gen/dxos/config.js.map +1 -1
  154. package/dist/src/proto/gen/dxos/devtools/host.d.ts +101 -119
  155. package/dist/src/proto/gen/dxos/devtools/host.d.ts.map +1 -1
  156. package/dist/src/proto/gen/dxos/devtools/swarm.d.ts +4 -8
  157. package/dist/src/proto/gen/dxos/devtools/swarm.d.ts.map +1 -1
  158. package/dist/src/proto/gen/dxos/echo/blob.d.ts +1 -2
  159. package/dist/src/proto/gen/dxos/echo/blob.d.ts.map +1 -1
  160. package/dist/src/proto/gen/dxos/echo/blob.js.map +1 -1
  161. package/dist/src/proto/gen/dxos/echo/feed.d.ts +4 -8
  162. package/dist/src/proto/gen/dxos/echo/feed.d.ts.map +1 -1
  163. package/dist/src/proto/gen/dxos/echo/filter.d.ts +2 -4
  164. package/dist/src/proto/gen/dxos/echo/filter.d.ts.map +1 -1
  165. package/dist/src/proto/gen/dxos/echo/filter.js.map +1 -1
  166. package/dist/src/proto/gen/dxos/echo/indexing.d.ts +2 -4
  167. package/dist/src/proto/gen/dxos/echo/indexing.d.ts.map +1 -1
  168. package/dist/src/proto/gen/dxos/echo/indexing.js.map +1 -1
  169. package/dist/src/proto/gen/dxos/echo/metadata.d.ts +16 -16
  170. package/dist/src/proto/gen/dxos/echo/metadata.d.ts.map +1 -1
  171. package/dist/src/proto/gen/dxos/echo/metadata.js.map +1 -1
  172. package/dist/src/proto/gen/dxos/echo/model/document.d.ts +11 -22
  173. package/dist/src/proto/gen/dxos/echo/model/document.d.ts.map +1 -1
  174. package/dist/src/proto/gen/dxos/echo/model/document.js.map +1 -1
  175. package/dist/src/proto/gen/dxos/echo/model/messenger.d.ts +1 -2
  176. package/dist/src/proto/gen/dxos/echo/model/messenger.d.ts.map +1 -1
  177. package/dist/src/proto/gen/dxos/echo/model/text.d.ts +2 -4
  178. package/dist/src/proto/gen/dxos/echo/model/text.d.ts.map +1 -1
  179. package/dist/src/proto/gen/dxos/echo/object.d.ts +6 -12
  180. package/dist/src/proto/gen/dxos/echo/object.d.ts.map +1 -1
  181. package/dist/src/proto/gen/dxos/echo/object.js.map +1 -1
  182. package/dist/src/proto/gen/dxos/echo/query.d.ts +21 -9
  183. package/dist/src/proto/gen/dxos/echo/query.d.ts.map +1 -1
  184. package/dist/src/proto/gen/dxos/echo/query.js.map +1 -1
  185. package/dist/src/proto/gen/dxos/echo/service.d.ts +61 -34
  186. package/dist/src/proto/gen/dxos/echo/service.d.ts.map +1 -1
  187. package/dist/src/proto/gen/dxos/echo/snapshot.d.ts +2 -4
  188. package/dist/src/proto/gen/dxos/echo/snapshot.d.ts.map +1 -1
  189. package/dist/src/proto/gen/dxos/echo/timeframe.d.ts +2 -4
  190. package/dist/src/proto/gen/dxos/echo/timeframe.d.ts.map +1 -1
  191. package/dist/src/proto/gen/dxos/edge/calls.d.ts +5 -10
  192. package/dist/src/proto/gen/dxos/edge/calls.d.ts.map +1 -1
  193. package/dist/src/proto/gen/dxos/edge/messenger.d.ts +28 -10
  194. package/dist/src/proto/gen/dxos/edge/messenger.d.ts.map +1 -1
  195. package/dist/src/proto/gen/dxos/edge/messenger.js.map +1 -1
  196. package/dist/src/proto/gen/dxos/edge/signal.d.ts +7 -14
  197. package/dist/src/proto/gen/dxos/edge/signal.d.ts.map +1 -1
  198. package/dist/src/proto/gen/dxos/error.d.ts +1 -2
  199. package/dist/src/proto/gen/dxos/error.d.ts.map +1 -1
  200. package/dist/src/proto/gen/dxos/gravity.d.ts +10 -20
  201. package/dist/src/proto/gen/dxos/gravity.d.ts.map +1 -1
  202. package/dist/src/proto/gen/dxos/halo/credentials/auth.d.ts +1 -2
  203. package/dist/src/proto/gen/dxos/halo/credentials/auth.d.ts.map +1 -1
  204. package/dist/src/proto/gen/dxos/halo/credentials/greet.d.ts +6 -12
  205. package/dist/src/proto/gen/dxos/halo/credentials/greet.d.ts.map +1 -1
  206. package/dist/src/proto/gen/dxos/halo/credentials/greet.js.map +1 -1
  207. package/dist/src/proto/gen/dxos/halo/credentials/identity.d.ts +2 -4
  208. package/dist/src/proto/gen/dxos/halo/credentials/identity.d.ts.map +1 -1
  209. package/dist/src/proto/gen/dxos/halo/credentials.d.ts +47 -43
  210. package/dist/src/proto/gen/dxos/halo/credentials.d.ts.map +1 -1
  211. package/dist/src/proto/gen/dxos/halo/credentials.js +9 -0
  212. package/dist/src/proto/gen/dxos/halo/credentials.js.map +1 -1
  213. package/dist/src/proto/gen/dxos/halo/invitations.d.ts +16 -28
  214. package/dist/src/proto/gen/dxos/halo/invitations.d.ts.map +1 -1
  215. package/dist/src/proto/gen/dxos/halo/invitations.js +3 -2
  216. package/dist/src/proto/gen/dxos/halo/invitations.js.map +1 -1
  217. package/dist/src/proto/gen/dxos/halo/keyring.d.ts +1 -2
  218. package/dist/src/proto/gen/dxos/halo/keyring.d.ts.map +1 -1
  219. package/dist/src/proto/gen/dxos/halo/keys.d.ts +2 -4
  220. package/dist/src/proto/gen/dxos/halo/keys.d.ts.map +1 -1
  221. package/dist/src/proto/gen/dxos/halo/signed.d.ts +4 -8
  222. package/dist/src/proto/gen/dxos/halo/signed.d.ts.map +1 -1
  223. package/dist/src/proto/gen/dxos/iframe.d.ts +4 -18
  224. package/dist/src/proto/gen/dxos/iframe.d.ts.map +1 -1
  225. package/dist/src/proto/gen/dxos/iframe.js.map +1 -1
  226. package/dist/src/proto/gen/dxos/keys.d.ts +2 -4
  227. package/dist/src/proto/gen/dxos/keys.d.ts.map +1 -1
  228. package/dist/src/proto/gen/dxos/mesh/bridge.d.ts +12 -24
  229. package/dist/src/proto/gen/dxos/mesh/bridge.d.ts.map +1 -1
  230. package/dist/src/proto/gen/dxos/mesh/broadcast.d.ts +1 -2
  231. package/dist/src/proto/gen/dxos/mesh/broadcast.d.ts.map +1 -1
  232. package/dist/src/proto/gen/dxos/mesh/messaging.d.ts +2 -4
  233. package/dist/src/proto/gen/dxos/mesh/messaging.d.ts.map +1 -1
  234. package/dist/src/proto/gen/dxos/mesh/muxer.d.ts +5 -10
  235. package/dist/src/proto/gen/dxos/mesh/muxer.d.ts.map +1 -1
  236. package/dist/src/proto/gen/dxos/mesh/presence.d.ts +1 -2
  237. package/dist/src/proto/gen/dxos/mesh/presence.d.ts.map +1 -1
  238. package/dist/src/proto/gen/dxos/mesh/protocol.d.ts +3 -6
  239. package/dist/src/proto/gen/dxos/mesh/protocol.d.ts.map +1 -1
  240. package/dist/src/proto/gen/dxos/mesh/replicator.d.ts +2 -4
  241. package/dist/src/proto/gen/dxos/mesh/replicator.d.ts.map +1 -1
  242. package/dist/src/proto/gen/dxos/mesh/signal.d.ts +9 -18
  243. package/dist/src/proto/gen/dxos/mesh/signal.d.ts.map +1 -1
  244. package/dist/src/proto/gen/dxos/mesh/signal.js.map +1 -1
  245. package/dist/src/proto/gen/dxos/mesh/swarm.d.ts +6 -12
  246. package/dist/src/proto/gen/dxos/mesh/swarm.d.ts.map +1 -1
  247. package/dist/src/proto/gen/dxos/mesh/teleport/auth.d.ts +2 -4
  248. package/dist/src/proto/gen/dxos/mesh/teleport/auth.d.ts.map +1 -1
  249. package/dist/src/proto/gen/dxos/mesh/teleport/automerge.d.ts +2 -4
  250. package/dist/src/proto/gen/dxos/mesh/teleport/automerge.d.ts.map +1 -1
  251. package/dist/src/proto/gen/dxos/mesh/teleport/blobsync.d.ts +3 -6
  252. package/dist/src/proto/gen/dxos/mesh/teleport/blobsync.d.ts.map +1 -1
  253. package/dist/src/proto/gen/dxos/mesh/teleport/control.d.ts +3 -6
  254. package/dist/src/proto/gen/dxos/mesh/teleport/control.d.ts.map +1 -1
  255. package/dist/src/proto/gen/dxos/mesh/teleport/gossip.d.ts +1 -2
  256. package/dist/src/proto/gen/dxos/mesh/teleport/gossip.d.ts.map +1 -1
  257. package/dist/src/proto/gen/dxos/mesh/teleport/notarization.d.ts +1 -2
  258. package/dist/src/proto/gen/dxos/mesh/teleport/notarization.d.ts.map +1 -1
  259. package/dist/src/proto/gen/dxos/mesh/teleport/replicator.d.ts +5 -10
  260. package/dist/src/proto/gen/dxos/mesh/teleport/replicator.d.ts.map +1 -1
  261. package/dist/src/proto/gen/dxos/mesh/teleport.d.ts +2 -4
  262. package/dist/src/proto/gen/dxos/mesh/teleport.d.ts.map +1 -1
  263. package/dist/src/proto/gen/dxos/registry.d.ts +3 -6
  264. package/dist/src/proto/gen/dxos/registry.d.ts.map +1 -1
  265. package/dist/src/proto/gen/dxos/rpc.d.ts +24 -12
  266. package/dist/src/proto/gen/dxos/rpc.d.ts.map +1 -1
  267. package/dist/src/proto/gen/dxos/rpc.js.map +1 -1
  268. package/dist/src/proto/gen/dxos/service/agentmanager.d.ts +4 -8
  269. package/dist/src/proto/gen/dxos/service/agentmanager.d.ts.map +1 -1
  270. package/dist/src/proto/gen/dxos/service/agentmanager.js.map +1 -1
  271. package/dist/src/proto/gen/dxos/service/publisher.d.ts +5 -10
  272. package/dist/src/proto/gen/dxos/service/publisher.d.ts.map +1 -1
  273. package/dist/src/proto/gen/dxos/service/supervisor.d.ts +12 -24
  274. package/dist/src/proto/gen/dxos/service/supervisor.d.ts.map +1 -1
  275. package/dist/src/proto/gen/dxos/service/supervisor.js.map +1 -1
  276. package/dist/src/proto/gen/dxos/service/tunnel.d.ts +3 -6
  277. package/dist/src/proto/gen/dxos/service/tunnel.d.ts.map +1 -1
  278. package/dist/src/proto/gen/dxos/tracing.d.ts +10 -99
  279. package/dist/src/proto/gen/dxos/tracing.d.ts.map +1 -1
  280. package/dist/src/proto/gen/dxos/type.d.ts +12 -24
  281. package/dist/src/proto/gen/dxos/type.d.ts.map +1 -1
  282. package/dist/src/proto/gen/dxos/value.d.ts +2 -4
  283. package/dist/src/proto/gen/dxos/value.d.ts.map +1 -1
  284. package/dist/src/proto/gen/example/testing/data.d.ts +4 -8
  285. package/dist/src/proto/gen/example/testing/data.d.ts.map +1 -1
  286. package/dist/src/proto/gen/example/testing/rpc.d.ts +7 -14
  287. package/dist/src/proto/gen/example/testing/rpc.d.ts.map +1 -1
  288. package/dist/src/proto/gen/google/protobuf.d.ts +326 -40
  289. package/dist/src/proto/gen/google/protobuf.d.ts.map +1 -1
  290. package/dist/src/proto/gen/google/protobuf.js +127 -1
  291. package/dist/src/proto/gen/google/protobuf.js.map +1 -1
  292. package/dist/src/proto/gen/index.d.ts +47 -7
  293. package/dist/src/proto/gen/index.d.ts.map +1 -1
  294. package/dist/src/proto/gen/index.js +1 -1
  295. package/dist/src/proto/gen/index.js.map +1 -1
  296. package/dist/src/proto/index.d.ts +2 -2
  297. package/dist/src/proto/substitutions.d.ts +8 -8
  298. package/dist/src/proto/substitutions.d.ts.map +1 -1
  299. package/dist/src/proto/types.d.ts +1 -1
  300. package/dist/src/space-archive.d.ts +62 -3
  301. package/dist/src/space-archive.d.ts.map +1 -1
  302. package/dist/src/space-archive.js +13 -1
  303. package/dist/src/space-archive.js.map +1 -1
  304. package/dist/src/types.d.ts +2 -2
  305. package/dist/tsconfig.tsbuildinfo +1 -1
  306. package/package.json +20 -35
  307. package/src/FeedProtocol.ts +323 -0
  308. package/src/FunctionProtocol.ts +17 -6
  309. package/src/TraceProtocol.ts +21 -0
  310. package/src/automerge.ts +239 -13
  311. package/src/buf/proto/gen/dxos/agent/dashboard_pb.ts +1 -1
  312. package/src/buf/proto/gen/dxos/agent/echo-proxy_pb.ts +1 -1
  313. package/src/buf/proto/gen/dxos/agent/epoch_pb.ts +1 -1
  314. package/src/buf/proto/gen/dxos/agent/functions_pb.ts +1 -1
  315. package/src/buf/proto/gen/dxos/bot_pb.ts +1 -1
  316. package/src/buf/proto/gen/dxos/client/invitation_pb.ts +20 -6
  317. package/src/buf/proto/gen/dxos/client/logging_pb.ts +1 -1
  318. package/src/buf/proto/gen/dxos/client/queue_pb.ts +373 -0
  319. package/src/buf/proto/gen/dxos/client/services_pb.ts +129 -40
  320. package/src/buf/proto/gen/dxos/config_pb.ts +132 -2
  321. package/src/buf/proto/gen/dxos/devtools/diagnostics_pb.ts +1 -1
  322. package/src/buf/proto/gen/dxos/devtools/host_pb.ts +83 -2
  323. package/src/buf/proto/gen/dxos/devtools/swarm_pb.ts +1 -1
  324. package/src/buf/proto/gen/dxos/echo/blob_pb.ts +1 -1
  325. package/src/buf/proto/gen/dxos/echo/feed_pb.ts +1 -1
  326. package/src/buf/proto/gen/dxos/echo/filter_pb.ts +1 -1
  327. package/src/buf/proto/gen/dxos/echo/indexing_pb.ts +1 -1
  328. package/src/buf/proto/gen/dxos/echo/metadata_pb.ts +16 -2
  329. package/src/buf/proto/gen/dxos/echo/model/document_pb.ts +1 -1
  330. package/src/buf/proto/gen/dxos/echo/model/messenger_pb.ts +1 -1
  331. package/src/buf/proto/gen/dxos/echo/model/text_pb.ts +1 -1
  332. package/src/buf/proto/gen/dxos/echo/object_pb.ts +1 -1
  333. package/src/buf/proto/gen/dxos/echo/query_pb.ts +16 -4
  334. package/src/buf/proto/gen/dxos/echo/service_pb.ts +81 -13
  335. package/src/buf/proto/gen/dxos/echo/snapshot_pb.ts +1 -1
  336. package/src/buf/proto/gen/dxos/echo/timeframe_pb.ts +1 -1
  337. package/src/buf/proto/gen/dxos/edge/calls_pb.ts +1 -1
  338. package/src/buf/proto/gen/dxos/edge/messenger_pb.ts +39 -6
  339. package/src/buf/proto/gen/dxos/edge/signal_pb.ts +1 -1
  340. package/src/buf/proto/gen/dxos/error_pb.ts +1 -1
  341. package/src/buf/proto/gen/dxos/field_options_pb.ts +1 -1
  342. package/src/buf/proto/gen/dxos/google_pb.ts +1 -1
  343. package/src/buf/proto/gen/dxos/gravity_pb.ts +1 -1
  344. package/src/buf/proto/gen/dxos/halo/credentials/auth_pb.ts +1 -1
  345. package/src/buf/proto/gen/dxos/halo/credentials/greet_pb.ts +1 -1
  346. package/src/buf/proto/gen/dxos/halo/credentials/identity_pb.ts +1 -1
  347. package/src/buf/proto/gen/dxos/halo/credentials_pb.ts +100 -23
  348. package/src/buf/proto/gen/dxos/halo/invitations_pb.ts +14 -6
  349. package/src/buf/proto/gen/dxos/halo/keyring_pb.ts +1 -1
  350. package/src/buf/proto/gen/dxos/halo/keys_pb.ts +1 -1
  351. package/src/buf/proto/gen/dxos/halo/signed_pb.ts +1 -1
  352. package/src/buf/proto/gen/dxos/iframe_pb.ts +3 -14
  353. package/src/buf/proto/gen/dxos/keys_pb.ts +1 -1
  354. package/src/buf/proto/gen/dxos/mesh/bridge_pb.ts +1 -1
  355. package/src/buf/proto/gen/dxos/mesh/broadcast_pb.ts +1 -1
  356. package/src/buf/proto/gen/dxos/mesh/messaging_pb.ts +1 -1
  357. package/src/buf/proto/gen/dxos/mesh/muxer_pb.ts +1 -1
  358. package/src/buf/proto/gen/dxos/mesh/presence_pb.ts +1 -1
  359. package/src/buf/proto/gen/dxos/mesh/protocol_pb.ts +1 -1
  360. package/src/buf/proto/gen/dxos/mesh/replicator_pb.ts +1 -1
  361. package/src/buf/proto/gen/dxos/mesh/signal_pb.ts +1 -1
  362. package/src/buf/proto/gen/dxos/mesh/swarm_pb.ts +1 -1
  363. package/src/buf/proto/gen/dxos/mesh/teleport/admission-discovery_pb.ts +1 -1
  364. package/src/buf/proto/gen/dxos/mesh/teleport/auth_pb.ts +1 -1
  365. package/src/buf/proto/gen/dxos/mesh/teleport/automerge_pb.ts +1 -1
  366. package/src/buf/proto/gen/dxos/mesh/teleport/blobsync_pb.ts +1 -1
  367. package/src/buf/proto/gen/dxos/mesh/teleport/control_pb.ts +1 -1
  368. package/src/buf/proto/gen/dxos/mesh/teleport/gossip_pb.ts +1 -1
  369. package/src/buf/proto/gen/dxos/mesh/teleport/notarization_pb.ts +1 -1
  370. package/src/buf/proto/gen/dxos/mesh/teleport/replicator_pb.ts +1 -1
  371. package/src/buf/proto/gen/dxos/registry_pb.ts +1 -1
  372. package/src/buf/proto/gen/dxos/rpc_pb.ts +37 -8
  373. package/src/buf/proto/gen/dxos/service/agentmanager_pb.ts +1 -1
  374. package/src/buf/proto/gen/dxos/service/publisher_pb.ts +1 -1
  375. package/src/buf/proto/gen/dxos/service/supervisor_pb.ts +1 -1
  376. package/src/buf/proto/gen/dxos/service/tunnel_pb.ts +1 -1
  377. package/src/buf/proto/gen/dxos/tracing_pb.ts +12 -179
  378. package/src/buf/proto/gen/dxos/type_pb.ts +1 -1
  379. package/src/buf/proto/gen/dxos/value_pb.ts +1 -1
  380. package/src/buf/proto/gen/example/testing/data_pb.ts +1 -1
  381. package/src/buf/proto/gen/example/testing/rpc_pb.ts +1 -1
  382. package/src/codec.test.ts +1 -1
  383. package/src/edge/EdgeFunctionEnv.ts +228 -0
  384. package/src/edge/edge.test.ts +64 -0
  385. package/src/edge/edge.ts +818 -0
  386. package/src/{edge-error.ts → edge/errors.ts} +15 -16
  387. package/src/edge/index.ts +8 -0
  388. package/src/edge/registry.ts +164 -0
  389. package/src/errors/base-errors.ts +4 -22
  390. package/src/errors/encoding.ts +2 -3
  391. package/src/errors/errors.test.ts +2 -2
  392. package/src/errors/errors.ts +57 -124
  393. package/src/errors/helpers.ts +6 -7
  394. package/src/errors/index.ts +5 -5
  395. package/src/feed-replication.ts +1 -0
  396. package/src/index.ts +12 -13
  397. package/src/indexing.test.ts +1 -1
  398. package/src/invitation.ts +3 -3
  399. package/src/messenger.ts +22 -0
  400. package/src/profile-archive.ts +13 -0
  401. package/src/proto/dxos/client/invitation.proto +9 -2
  402. package/src/proto/dxos/client/queue.proto +102 -0
  403. package/src/proto/dxos/client/services.proto +23 -1
  404. package/src/proto/dxos/config.proto +50 -1
  405. package/src/proto/dxos/devtools/host.proto +27 -0
  406. package/src/proto/dxos/echo/metadata.proto +6 -0
  407. package/src/proto/dxos/echo/query.proto +4 -1
  408. package/src/proto/dxos/echo/service.proto +38 -4
  409. package/src/proto/dxos/edge/messenger.proto +10 -0
  410. package/src/proto/dxos/halo/credentials.proto +24 -0
  411. package/src/proto/dxos/halo/invitations.proto +5 -2
  412. package/src/proto/dxos/iframe.proto +1 -3
  413. package/src/proto/dxos/rpc.proto +7 -0
  414. package/src/proto/dxos/tracing.proto +0 -40
  415. package/src/proto/gen/dxos/agent/dashboard.ts +3 -6
  416. package/src/proto/gen/dxos/agent/echoproxy.ts +1 -2
  417. package/src/proto/gen/dxos/agent/epoch.ts +1 -2
  418. package/src/proto/gen/dxos/agent/functions.ts +6 -12
  419. package/src/proto/gen/dxos/bot.ts +12 -24
  420. package/src/proto/gen/dxos/client/services.ts +1050 -915
  421. package/src/proto/gen/dxos/config.ts +115 -100
  422. package/src/proto/gen/dxos/devtools/host.ts +101 -119
  423. package/src/proto/gen/dxos/devtools/swarm.ts +4 -8
  424. package/src/proto/gen/dxos/echo/blob.ts +1 -2
  425. package/src/proto/gen/dxos/echo/feed.ts +4 -8
  426. package/src/proto/gen/dxos/echo/filter.ts +2 -4
  427. package/src/proto/gen/dxos/echo/indexing.ts +2 -4
  428. package/src/proto/gen/dxos/echo/metadata.ts +16 -16
  429. package/src/proto/gen/dxos/echo/model/document.ts +11 -22
  430. package/src/proto/gen/dxos/echo/model/messenger.ts +1 -2
  431. package/src/proto/gen/dxos/echo/model/text.ts +2 -4
  432. package/src/proto/gen/dxos/echo/object.ts +6 -12
  433. package/src/proto/gen/dxos/echo/query.ts +21 -9
  434. package/src/proto/gen/dxos/echo/service.ts +60 -34
  435. package/src/proto/gen/dxos/echo/snapshot.ts +2 -4
  436. package/src/proto/gen/dxos/echo/timeframe.ts +2 -4
  437. package/src/proto/gen/dxos/edge/calls.ts +5 -10
  438. package/src/proto/gen/dxos/edge/messenger.ts +28 -10
  439. package/src/proto/gen/dxos/edge/signal.ts +7 -14
  440. package/src/proto/gen/dxos/error.ts +1 -2
  441. package/src/proto/gen/dxos/gravity.ts +10 -20
  442. package/src/proto/gen/dxos/halo/credentials/auth.ts +1 -2
  443. package/src/proto/gen/dxos/halo/credentials/greet.ts +6 -12
  444. package/src/proto/gen/dxos/halo/credentials/identity.ts +2 -4
  445. package/src/proto/gen/dxos/halo/credentials.ts +47 -43
  446. package/src/proto/gen/dxos/halo/invitations.ts +16 -28
  447. package/src/proto/gen/dxos/halo/keyring.ts +1 -2
  448. package/src/proto/gen/dxos/halo/keys.ts +2 -4
  449. package/src/proto/gen/dxos/halo/signed.ts +4 -8
  450. package/src/proto/gen/dxos/iframe.ts +4 -18
  451. package/src/proto/gen/dxos/keys.ts +2 -4
  452. package/src/proto/gen/dxos/mesh/bridge.ts +12 -24
  453. package/src/proto/gen/dxos/mesh/broadcast.ts +1 -2
  454. package/src/proto/gen/dxos/mesh/messaging.ts +2 -4
  455. package/src/proto/gen/dxos/mesh/muxer.ts +5 -10
  456. package/src/proto/gen/dxos/mesh/presence.ts +1 -2
  457. package/src/proto/gen/dxos/mesh/protocol.ts +3 -6
  458. package/src/proto/gen/dxos/mesh/replicator.ts +2 -4
  459. package/src/proto/gen/dxos/mesh/signal.ts +9 -18
  460. package/src/proto/gen/dxos/mesh/swarm.ts +6 -12
  461. package/src/proto/gen/dxos/mesh/teleport/auth.ts +2 -4
  462. package/src/proto/gen/dxos/mesh/teleport/automerge.ts +2 -4
  463. package/src/proto/gen/dxos/mesh/teleport/blobsync.ts +3 -6
  464. package/src/proto/gen/dxos/mesh/teleport/control.ts +3 -6
  465. package/src/proto/gen/dxos/mesh/teleport/gossip.ts +1 -2
  466. package/src/proto/gen/dxos/mesh/teleport/notarization.ts +1 -2
  467. package/src/proto/gen/dxos/mesh/teleport/replicator.ts +5 -10
  468. package/src/proto/gen/dxos/mesh/teleport.ts +2 -4
  469. package/src/proto/gen/dxos/registry.ts +3 -6
  470. package/src/proto/gen/dxos/rpc.ts +24 -12
  471. package/src/proto/gen/dxos/service/agentmanager.ts +4 -8
  472. package/src/proto/gen/dxos/service/publisher.ts +5 -10
  473. package/src/proto/gen/dxos/service/supervisor.ts +12 -24
  474. package/src/proto/gen/dxos/service/tunnel.ts +3 -6
  475. package/src/proto/gen/dxos/tracing.ts +10 -96
  476. package/src/proto/gen/dxos/type.ts +12 -24
  477. package/src/proto/gen/dxos/value.ts +2 -4
  478. package/src/proto/gen/example/testing/data.ts +4 -8
  479. package/src/proto/gen/example/testing/rpc.ts +7 -14
  480. package/src/proto/gen/google/protobuf.ts +326 -40
  481. package/src/proto/gen/index.ts +48 -8
  482. package/src/proto/index.ts +2 -2
  483. package/src/proto/types.ts +1 -1
  484. package/src/space-archive.ts +70 -1
  485. package/src/types.ts +2 -2
  486. package/dist/src/edge-error.d.ts.map +0 -1
  487. package/dist/src/edge-error.js.map +0 -1
  488. package/dist/src/edge.d.ts +0 -333
  489. package/dist/src/edge.d.ts.map +0 -1
  490. package/dist/src/edge.js +0 -155
  491. package/dist/src/edge.js.map +0 -1
  492. package/dist/src/query.d.ts +0 -5
  493. package/dist/src/query.d.ts.map +0 -1
  494. package/dist/src/query.js +0 -8
  495. package/dist/src/query.js.map +0 -1
  496. package/dist/src/queue.d.ts +0 -37
  497. package/dist/src/queue.d.ts.map +0 -1
  498. package/dist/src/queue.js +0 -8
  499. package/dist/src/queue.js.map +0 -1
  500. package/dist/src/tracing.d.ts +0 -40
  501. package/dist/src/tracing.d.ts.map +0 -1
  502. package/dist/src/tracing.js +0 -50
  503. package/dist/src/tracing.js.map +0 -1
  504. package/src/edge.ts +0 -477
  505. package/src/query.ts +0 -8
  506. package/src/queue.ts +0 -51
  507. package/src/tracing.ts +0 -86
@@ -0,0 +1,237 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+ export const KEY_QUEUE_POSITION = 'org.dxos.key.queue-position';
5
+ import * as Schema from 'effect/Schema';
6
+ import { invariant } from '@dxos/invariant';
7
+ import { SpaceId } from '@dxos/keys';
8
+ import { EdgeService } from './edge/edge.js';
9
+ /**
10
+ * Opaque pagination cursor for feed queries.
11
+ */
12
+ export const FeedCursor = Schema.String.pipe(Schema.brand('@dxos/feed/FeedCursor'));
13
+ /**
14
+ * Replicated queue block payload and ordering metadata.
15
+ */
16
+ export const Block = Schema.Struct({
17
+ /**
18
+ * Appears on blocks returned from query.
19
+ */
20
+ feedId: Schema.UndefinedOr(Schema.String),
21
+ /**
22
+ * Actor that produced this block.
23
+ */
24
+ actorId: Schema.String,
25
+ /**
26
+ * Per-feed monotonic sequence assigned by the actor.
27
+ */
28
+ sequence: Schema.Number,
29
+ /**
30
+ * Actor of the immediate predecessor block, if any.
31
+ */
32
+ prevActorId: Schema.NullOr(Schema.String),
33
+ /**
34
+ * Sequence of the immediate predecessor block, if any.
35
+ */
36
+ prevSequence: Schema.NullOr(Schema.Number),
37
+ /**
38
+ * Globally ordered position assigned by a position authority.
39
+ * Unlike `sequence` (per-feed causal order), this enables merged incremental reads across feeds.
40
+ */
41
+ position: Schema.NullOr(Schema.Number),
42
+ /**
43
+ * Milliseconds since Unix epoch when the block was created.
44
+ */
45
+ timestamp: Schema.Number,
46
+ /**
47
+ * Serialized application payload.
48
+ */
49
+ data: Schema.Uint8Array,
50
+ /**
51
+ * Local insertion ID.
52
+ * Not replicated.
53
+ */
54
+ // TODO(dmaretskyi): Remove. Use cursors.
55
+ insertionId: Schema.optional(Schema.Number),
56
+ });
57
+ //
58
+ // RPC Schemas
59
+ //
60
+ /**
61
+ * Query parameters for retrieving blocks from one namespace in one space.
62
+ */
63
+ export const QueryRequest = Schema.Struct({
64
+ /**
65
+ * Optional request correlation identifier.
66
+ */
67
+ requestId: Schema.optional(Schema.String),
68
+ /**
69
+ * Target space identifier.
70
+ */
71
+ spaceId: SpaceId,
72
+ /**
73
+ * Feed namespace to query.
74
+ */
75
+ feedNamespace: Schema.String,
76
+ query: Schema.optional(Schema.Union(Schema.Struct({
77
+ /**
78
+ * Explicit list of feed IDs to read from.
79
+ */
80
+ feedIds: Schema.Array(Schema.String),
81
+ }), Schema.Struct({
82
+ /**
83
+ * Existing subscription to resolve feed IDs from.
84
+ */
85
+ subscriptionId: Schema.String,
86
+ }))),
87
+ /**
88
+ * Get changes following this cursor (exclusive).
89
+ *
90
+ * Must not be used with `position`.
91
+ */
92
+ cursor: Schema.optional(FeedCursor),
93
+ /**
94
+ * Get changes following this position.
95
+ * Returned blocks have strictly greater position than this.
96
+ *
97
+ * Must not be used with `cursor`.
98
+ */
99
+ position: Schema.optional(Schema.Number),
100
+ /**
101
+ * Only return blocks that are not positioned.
102
+ *
103
+ * Must not be used with `cursor` or `position`.
104
+ */
105
+ unpositionedOnly: Schema.optional(Schema.Boolean),
106
+ /**
107
+ * Maximum number of blocks to return.
108
+ */
109
+ limit: Schema.optional(Schema.Number),
110
+ });
111
+ /**
112
+ * Result payload for a query operation.
113
+ */
114
+ export const QueryResponse = Schema.Struct({
115
+ /**
116
+ * Echoed request correlation identifier.
117
+ */
118
+ requestId: Schema.optional(Schema.String),
119
+ /**
120
+ * Cursor to continue reading from this result boundary.
121
+ */
122
+ nextCursor: FeedCursor,
123
+ /**
124
+ * Indicates whether more matching blocks are available.
125
+ */
126
+ hasMore: Schema.Boolean,
127
+ /**
128
+ * Returned blocks for the current page.
129
+ */
130
+ blocks: Schema.Array(Block),
131
+ });
132
+ /**
133
+ * Parameters for creating or refreshing a feed subscription.
134
+ */
135
+ export const SubscribeRequest = Schema.Struct({
136
+ /**
137
+ * Optional request correlation identifier.
138
+ */
139
+ requestId: Schema.optional(Schema.String),
140
+ /**
141
+ * Optional space scope for the subscription.
142
+ */
143
+ spaceId: Schema.optional(Schema.String),
144
+ /**
145
+ * Feeds to include in the subscription.
146
+ */
147
+ feedIds: Schema.Array(Schema.String),
148
+ });
149
+ /**
150
+ * Response payload for subscription creation.
151
+ */
152
+ export const SubscribeResponse = Schema.Struct({
153
+ /**
154
+ * Echoed request correlation identifier.
155
+ */
156
+ requestId: Schema.optional(Schema.String),
157
+ /**
158
+ * Identifier to use in subsequent subscription queries.
159
+ */
160
+ subscriptionId: Schema.String,
161
+ /**
162
+ * Expiration timestamp in milliseconds since Unix epoch.
163
+ */
164
+ expiresAt: Schema.Number,
165
+ });
166
+ /**
167
+ * Request payload for appending one or more blocks.
168
+ */
169
+ export const AppendRequest = Schema.Struct({
170
+ /**
171
+ * Optional request correlation identifier.
172
+ */
173
+ requestId: Schema.optional(Schema.String),
174
+ /**
175
+ * Target space identifier.
176
+ */
177
+ spaceId: Schema.String,
178
+ /**
179
+ * Namespace that all appended blocks belong to.
180
+ */
181
+ feedNamespace: Schema.String,
182
+ /**
183
+ * Blocks to append.
184
+ */
185
+ blocks: Schema.Array(Block),
186
+ });
187
+ /**
188
+ * Result payload for append operations.
189
+ */
190
+ export const AppendResponse = Schema.Struct({
191
+ /**
192
+ * Echoed request correlation identifier.
193
+ */
194
+ requestId: Schema.optional(Schema.String),
195
+ /**
196
+ * Assigned global positions for appended blocks.
197
+ */
198
+ positions: Schema.Array(Schema.Number),
199
+ });
200
+ /**
201
+ * Tagged transport message union for queue protocol RPC traffic.
202
+ */
203
+ export const ProtocolMessage = Schema.Union(Schema.TaggedStruct('QueryRequest', QueryRequest.fields), Schema.TaggedStruct('QueryResponse', QueryResponse.fields), Schema.TaggedStruct('SubscribeRequest', SubscribeRequest.fields), Schema.TaggedStruct('SubscribeResponse', SubscribeResponse.fields), Schema.TaggedStruct('AppendRequest', AppendRequest.fields), Schema.TaggedStruct('AppendResponse', AppendResponse.fields), Schema.TaggedStruct('Error', {
204
+ /**
205
+ * Human-readable error message.
206
+ */
207
+ message: Schema.String,
208
+ })).pipe(Schema.extend(Schema.Struct({
209
+ senderPeerId: Schema.UndefinedOr(Schema.String),
210
+ /**
211
+ * Could be undefined if the recipient could be assumed from the context.
212
+ */
213
+ recipientPeerId: Schema.UndefinedOr(Schema.String),
214
+ })));
215
+ /**
216
+ * Reserved namespaces with protocol-level semantics.
217
+ */
218
+ export const WellKnownNamespaces = {
219
+ data: 'data',
220
+ trace: 'trace',
221
+ };
222
+ export const isWellKnownNamespace = (namespace) => Object.values(WellKnownNamespaces).includes(namespace);
223
+ /**
224
+ * Encodes queue replicator service identifier as `<service>:<namespace>:<spaceId>`.
225
+ */
226
+ export const encodeServiceId = (namespace, spaceId) => `${EdgeService.QUEUE_REPLICATOR}:${namespace}:${spaceId}`;
227
+ /**
228
+ * Decodes and validates queue replicator service identifier.
229
+ */
230
+ export const decodeServiceId = (serviceId) => {
231
+ const [service, namespace, spaceId] = serviceId.split(':');
232
+ invariant(service === EdgeService.QUEUE_REPLICATOR, `Invalid service: ${service}`);
233
+ invariant(isWellKnownNamespace(namespace), `Invalid namespace: ${namespace}`);
234
+ invariant(SpaceId.isValid(spaceId), `Invalid spaceId: ${spaceId}`);
235
+ return { namespace: namespace, spaceId };
236
+ };
237
+ //# sourceMappingURL=FeedProtocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeedProtocol.js","sourceRoot":"","sources":["../../src/FeedProtocol.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAeF,MAAM,CAAC,MAAM,kBAAkB,GAAG,6BAA6B,CAAC;AAEhE,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC;AAGpF;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;IACjC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC;IAEzC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM;IAEtB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC,MAAM;IAEvB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;IAEzC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;IAE1C;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;IAEtC;;OAEG;IACH,SAAS,EAAE,MAAM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,MAAM,eAAe,GAAG,CAAC,SAAiB,EAAE,OAAgB,EAAE,EAAE,CACrE,GAAG,WAAW,CAAC,gBAAgB,IAAI,SAAS,IAAI,OAAO,EAAE,CAAC;AAE5D;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,SAAiB,EACkD,EAAE;IACrE,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3D,SAAS,CAAC,OAAO,KAAK,WAAW,CAAC,gBAAgB,EAAE,oBAAoB,OAAO,EAAE,CAAC,CAAC;IACnF,SAAS,CAAC,oBAAoB,CAAC,SAAS,CAAC,EAAE,sBAAsB,SAAS,EAAE,CAAC,CAAC;IAC9E,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,oBAAoB,OAAO,EAAE,CAAC,CAAC;IACnE,OAAO,EAAE,SAAS,EAAE,SAA6C,EAAE,OAAO,EAAE,CAAC;AAC/E,CAAC,CAAC"}
@@ -1,7 +1,9 @@
1
1
  import { type SpaceId } from '@dxos/keys';
2
2
  import type * as QueryProto from '@dxos/protocols/proto/dxos/echo/query';
3
3
  import type * as DataProto from '@dxos/protocols/proto/dxos/echo/service';
4
- import { type QueueService } from './queue';
4
+ import { type EdgeFunctionEnv } from './edge';
5
+ import type * as FeedProtocol from './FeedProtocol';
6
+ import type * as TraceProtocol from './TraceProtocol';
5
7
  /**
6
8
  * Function implementation.
7
9
  * This is a contract between the user-defined function and the runtime.
@@ -57,7 +59,18 @@ export interface Context {
57
59
  * Queue service.
58
60
  * Available if the function is invoked in context of a space.
59
61
  */
60
- queueService?: QueueService;
62
+ queueService?: FeedProtocol.QueueService;
63
+ /**
64
+ * Functions service.
65
+ * Available if the function is invoked in context of a space.
66
+ */
67
+ functionsAiService?: EdgeFunctionEnv.FunctionsAiService;
68
+ /**
69
+ * Functions service.
70
+ * Available if the function is invoked in context of a space.
71
+ */
72
+ functionsService?: EdgeFunctionEnv.FunctionsService;
73
+ traceService?: TraceProtocol.TraceService;
61
74
  };
62
75
  /**
63
76
  * That space that the function is invoked in context of.
@@ -1 +1 @@
1
- {"version":3,"file":"FunctionProtocol.d.ts","sourceRoot":"","sources":["../../src/FunctionProtocol.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,KAAK,UAAU,MAAM,uCAAuC,CAAC;AACzE,OAAO,KAAK,KAAK,SAAS,MAAM,yCAAyC,CAAC;AAE1E,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAa5C;;;GAGG;AACH,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;CACjC;AAED;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtF;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE;QACR;;;WAGG;QACH,YAAY,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC;QAEvC;;;WAGG;QACH,WAAW,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC;Q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C,OAAO,CAAC,CAAC;AAEtF;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE;QACR;;;WAGG;QACH,YAAY,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC;QAEvC;;;WAGG;QACH,WAAW,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC;QAEpC;;;WAGG;QACH,YAAY,CAAC,EAAE,YAAY,CAAC,YAAY,CAAC;QAEzC;;;WAGG;QACH,kBAAkB,CAAC,EAAE,eAAe,CAAC,kBAAkB,CAAC;QAExD;;;WAGG;QACH,gBAAgB,CAAC,EAAE,eAAe,CAAC,gBAAgB,CAAC;QAEpD,YAAY,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC;KAC3C,CAAC;IAEF;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Allows consumers to write trace events to the trace.
3
+ */
4
+ export interface TraceService {
5
+ write(events: Event[]): void;
6
+ }
7
+ /**
8
+ * Single typed trace event.
9
+ */
10
+ export interface Event {
11
+ key: string;
12
+ isEphemeral: boolean;
13
+ data: unknown;
14
+ }
15
+ //# sourceMappingURL=TraceProtocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TraceProtocol.d.ts","sourceRoot":"","sources":["../../src/TraceProtocol.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;CACf"}
@@ -0,0 +1,4 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+ //# sourceMappingURL=TraceProtocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TraceProtocol.js","sourceRoot":"","sources":["../../src/TraceProtocol.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE"}
@@ -1,6 +1,20 @@
1
+ /**
2
+ * Opaque identifier of a peer participating in automerge-repo sync.
3
+ *
4
+ * Branded `string` so it cannot be accidentally confused with arbitrary
5
+ * strings. Matches the `PeerId` type exported by `@automerge/automerge-repo`.
6
+ */
1
7
  export type PeerId = string & {
2
8
  __peerId: true;
3
9
  };
10
+ /**
11
+ * Sent by a peer when joining a connection.
12
+ *
13
+ * @remarks
14
+ * Upstream automerge-repo: first frame after `peer-candidate` to negotiate
15
+ * supported protocol versions. The other side responds with a
16
+ * {@link PeerProtocolMessage} containing the selected version.
17
+ */
4
18
  export type JoinProtocolMessage = {
5
19
  type: 'join';
6
20
  targetId?: PeerId;
@@ -8,12 +22,26 @@ export type JoinProtocolMessage = {
8
22
  supportedProtocolVersions: string;
9
23
  metadata?: Record<string, unknown>;
10
24
  };
25
+ /**
26
+ * Sent by a peer when leaving a connection.
27
+ *
28
+ * @remarks
29
+ * Upstream automerge-repo: signals graceful disconnect so the remote tears
30
+ * down its sync state for this peer before the underlying transport closes.
31
+ */
11
32
  export type LeaveProtocolMessage = {
12
33
  type: 'leave';
13
34
  targetId?: PeerId;
14
35
  senderId: PeerId;
15
36
  metadata?: Record<string, unknown>;
16
37
  };
38
+ /**
39
+ * Sent in response to a {@link JoinProtocolMessage} confirming the handshake
40
+ * and the selected protocol version.
41
+ *
42
+ * @remarks
43
+ * Upstream automerge-repo: completes the version negotiation handshake.
44
+ */
17
45
  export type PeerProtocolMessage = {
18
46
  type: 'peer';
19
47
  senderId: PeerId;
@@ -25,8 +53,10 @@ export type PeerProtocolMessage = {
25
53
  * Sent by a {@link Repo} to request a document from a peer.
26
54
  *
27
55
  * @remarks
28
- * This is identical to a {@link SyncMessage} except that it is sent by a {@link Repo}
29
- * as the initial sync message when asking the other peer if it has the document.
56
+ * Upstream automerge-repo: identical wire shape to {@link SyncProtocolMessage}
57
+ * except this is the initial sync message used when asking the other peer if
58
+ * it has the document. The peer replies with sync messages or
59
+ * {@link UnavailableProtocolMessage}.
30
60
  */
31
61
  export type RequestProtocolMessage = {
32
62
  type: 'request';
@@ -37,7 +67,12 @@ export type RequestProtocolMessage = {
37
67
  metadata?: Record<string, unknown>;
38
68
  };
39
69
  /**
40
- * A sync message for a particular document
70
+ * Automerge sync message for a particular document.
71
+ *
72
+ * @remarks
73
+ * Upstream automerge-repo: carries the binary delta produced by Automerge's
74
+ * sync algorithm (`Automerge.generateSyncMessage`). Symmetric: peers exchange
75
+ * sync messages until both sides have converged.
41
76
  */
42
77
  export type SyncProtocolMessage = {
43
78
  type: 'sync';
@@ -48,8 +83,12 @@ export type SyncProtocolMessage = {
48
83
  metadata?: Record<string, unknown>;
49
84
  };
50
85
  /**
51
- * Sent by a {@link Repo} to indicate that it does not have the document and none of its connected
52
- * peers do either.
86
+ * Sent by a {@link Repo} to indicate that it does not have the document and
87
+ * none of its connected peers do either.
88
+ *
89
+ * @remarks
90
+ * Upstream automerge-repo: terminates a {@link RequestProtocolMessage} fan-out
91
+ * when no peer in the cluster can serve the document.
53
92
  */
54
93
  export type UnavailableProtocolMessage = {
55
94
  type: 'doc-unavailable';
@@ -59,16 +98,17 @@ export type UnavailableProtocolMessage = {
59
98
  metadata?: Record<string, unknown>;
60
99
  };
61
100
  /**
62
- * An ephemeral message.
101
+ * An ephemeral message gossiped between peers.
63
102
  *
64
103
  * @remarks
65
- * Ephemeral messages are not persisted anywhere. The data property can be used by the application
66
- * as needed. The repo gossips these around.
104
+ * Upstream automerge-repo: ephemeral messages are not persisted anywhere.
105
+ * The `data` property can be used by the application as needed. The repo
106
+ * gossips these around.
67
107
  *
68
- * In order to avoid infinite loops of ephemeral messages, every message has (a) a session ID, which
69
- * is a random number generated by the sender at startup time; and (b) a sequence number. The
70
- * combination of these two things allows us to discard messages we have already seen.
71
- * */
108
+ * To avoid infinite loops, every message carries (a) a `sessionId` randomly
109
+ * generated by the sender at startup time and (b) a sequence number
110
+ * (`count`). The pair lets receivers discard messages they have already seen.
111
+ */
72
112
  export type EphemeralProtocolMessage = {
73
113
  type: 'ephemeral';
74
114
  senderId: PeerId;
@@ -79,14 +119,96 @@ export type EphemeralProtocolMessage = {
79
119
  data: Uint8Array;
80
120
  metadata?: Record<string, unknown>;
81
121
  };
122
+ /** Wire literal for {@link ErrorProtocolMessage}. */
123
+ export declare const MESSAGE_TYPE_ERROR = "error";
124
+ /**
125
+ * Out-of-band error reported by a peer.
126
+ *
127
+ * @remarks
128
+ * Upstream automerge-repo: surfaces protocol-level failures (e.g. version
129
+ * mismatch, malformed frame). `senderId` and `targetId` are optional so the
130
+ * frame can be emitted before the handshake completes.
131
+ *
132
+ * The `connectionId` field is a DXOS extension carried on the subduction
133
+ * channel only. Edge → client errors with `connectionId` are restart signals
134
+ * for a specific {@link EdgeSubductionReplicatorConnection} lifetime; the
135
+ * client matches it against its local `_connectionId` and tears down only
136
+ * that connection. The field is optional so the same type can carry
137
+ * upstream-style classical-channel errors that have no connection identity.
138
+ */
82
139
  export type ErrorProtocolMessage = {
83
- type: 'error';
140
+ type: typeof MESSAGE_TYPE_ERROR;
84
141
  senderId?: PeerId;
85
142
  targetId?: PeerId;
86
143
  message: string;
144
+ connectionId?: string;
87
145
  metadata?: Record<string, unknown>;
88
146
  };
147
+ /** Wire literal for {@link SubductionConnectionMessage}. */
148
+ export declare const MESSAGE_TYPE_SUBDUCTION_CONNECTION = "subduction-connection";
149
+ /** Wire literal for {@link SubductionFrameEnvelope}. */
150
+ export declare const MESSAGE_TYPE_SUBDUCTION_FRAME = "subduction-frame";
151
+ /**
152
+ * Inner subduction transport frame emitted by automerge-repo's
153
+ * `NetworkAdapterTransport.#sendFrame`.
154
+ *
155
+ * @remarks
156
+ * Owned by upstream `@automerge/automerge-subduction`: `data` is an opaque
157
+ * byte blob (handshake bytes prefixed with `SUH\0`, or post-handshake
158
+ * sedimentree messages prefixed with `SUM\0`); DXOS code MUST NOT inspect
159
+ * `data`.
160
+ *
161
+ * The literal value `'subduction-connection'` matches the
162
+ * `SUBDUCTION_MESSAGE_TYPE` constant in
163
+ * `@automerge/automerge-repo/src/subduction/network.ts`. Do not redefine the
164
+ * value; if upstream renames it, update {@link MESSAGE_TYPE_SUBDUCTION_CONNECTION}.
165
+ *
166
+ * On the Edge subduction channel this frame never appears top-level — it is
167
+ * always wrapped in a {@link SubductionFrameEnvelope}. In-memory subduction
168
+ * adapters carry it directly.
169
+ */
170
+ export type SubductionConnectionMessage = {
171
+ type: typeof MESSAGE_TYPE_SUBDUCTION_CONNECTION;
172
+ senderId: PeerId;
173
+ targetId: PeerId;
174
+ data: Uint8Array;
175
+ metadata?: Record<string, unknown>;
176
+ };
177
+ /**
178
+ * DXOS-specific wire envelope around a {@link SubductionConnectionMessage}.
179
+ *
180
+ * @remarks
181
+ * Specific to the DXOS edge subduction channel; not used by upstream
182
+ * automerge-repo or in-memory subduction adapters.
183
+ *
184
+ * Carries the originator's `connectionId` (the value of
185
+ * `EdgeSubductionReplicatorConnection._connectionId` on the client, and of
186
+ * the matching `ClientSession` on the edge). The edge uses `connectionId` as
187
+ * the session key and echoes it back on every outbound reply.
188
+ *
189
+ * Frames whose `connectionId` does not match the local connection's UUID are
190
+ * stale (e.g. left over from a previous lifetime after
191
+ * `_onRestartRequested` rotated the UUID) and MUST be dropped on receipt.
192
+ */
193
+ export type SubductionFrameEnvelope = {
194
+ type: typeof MESSAGE_TYPE_SUBDUCTION_FRAME;
195
+ connectionId: string;
196
+ subductionFrame: SubductionConnectionMessage;
197
+ };
198
+ /** Wire literal for {@link CollectionQueryMessage}. */
89
199
  export declare const MESSAGE_TYPE_COLLECTION_QUERY = "collection-query";
200
+ /**
201
+ * Request the remote peer's view of a collection.
202
+ *
203
+ * @remarks
204
+ * DXOS-specific. Sent by `CollectionSynchronizer` to ask a peer for the set
205
+ * of document heads it has for a given `collectionId`. The peer replies with
206
+ * a {@link CollectionStateMessage}.
207
+ *
208
+ * If the requester already has a `stateTag` from a previous reply, the peer
209
+ * MAY skip sending the state when its current tag matches (no change since
210
+ * the last query).
211
+ */
90
212
  export type CollectionQueryMessage = {
91
213
  type: typeof MESSAGE_TYPE_COLLECTION_QUERY;
92
214
  senderId: PeerId;
@@ -99,7 +221,21 @@ export type CollectionQueryMessage = {
99
221
  stateTag?: string;
100
222
  metadata?: Record<string, unknown>;
101
223
  };
224
+ /** Wire literal for {@link CollectionStateMessage}. */
102
225
  export declare const MESSAGE_TYPE_COLLECTION_STATE = "collection-state";
226
+ /**
227
+ * Reply to a {@link CollectionQueryMessage} carrying the responder's view of
228
+ * a collection.
229
+ *
230
+ * @remarks
231
+ * DXOS-specific. The `state` payload shape is implementation-defined — today
232
+ * it is a `{ documents: Record<DocumentId, Heads[]> }` map produced by the
233
+ * edge from `Subduction.getAllHeads()`, but the type leaves this open for
234
+ * alternative encodings.
235
+ *
236
+ * `stateTag` lets the requester short-circuit future queries when nothing
237
+ * has changed (see {@link CollectionQueryMessage.stateTag}).
238
+ */
103
239
  export type CollectionStateMessage = {
104
240
  type: typeof MESSAGE_TYPE_COLLECTION_STATE;
105
241
  senderId: PeerId;
@@ -115,5 +251,59 @@ export type CollectionStateMessage = {
115
251
  stateTag?: string;
116
252
  metadata?: Record<string, unknown>;
117
253
  };
254
+ /**
255
+ * Union of every message that flows through the **classical automerge-repo**
256
+ * sync channel (`EchoEdgeReplicator`, in-memory `TestAdapter`).
257
+ *
258
+ * @remarks
259
+ * Combines the upstream automerge-repo sync messages (join / leave / peer /
260
+ * request / sync / doc-unavailable / ephemeral / error) with DXOS's
261
+ * collection-sync extension (collection-query / collection-state).
262
+ *
263
+ * Does NOT include subduction transport frames or the reconnect marker —
264
+ * those live on a separate channel; see {@link SubductionProtocolMessage}.
265
+ */
118
266
  export type AutomergeProtocolMessage = JoinProtocolMessage | PeerProtocolMessage | LeaveProtocolMessage | RequestProtocolMessage | SyncProtocolMessage | UnavailableProtocolMessage | EphemeralProtocolMessage | ErrorProtocolMessage | CollectionQueryMessage | CollectionStateMessage;
267
+ /**
268
+ * Union of every message that flows through the subduction channel **in
269
+ * process** — i.e. between automerge-repo's `NetworkAdapterTransport` and the
270
+ * DXOS adapter / replicator layer, before wire encoding.
271
+ *
272
+ * @remarks
273
+ * Distinct from {@link AutomergeProtocolMessage}, which describes the classical
274
+ * automerge-repo sync protocol carried by `EchoEdgeReplicator` (mesh sync,
275
+ * in-memory test adapters). The subduction channel multiplexes:
276
+ *
277
+ * - opaque transport frames ({@link SubductionConnectionMessage}) produced
278
+ * by `@automerge/automerge-repo/subduction/network.ts`;
279
+ * - DXOS collection sync messages ({@link CollectionQueryMessage} /
280
+ * {@link CollectionStateMessage});
281
+ * - edge-initiated restart signals ({@link ErrorProtocolMessage} carrying
282
+ * the offending `connectionId`).
283
+ *
284
+ * The {@link SubductionFrameEnvelope} is intentionally NOT a member: it only
285
+ * exists on the wire to attach a `connectionId` to a raw
286
+ * {@link SubductionConnectionMessage}. See {@link SubductionProtocolMessageEnveloped}
287
+ * for the corresponding wire union.
288
+ */
289
+ export type SubductionProtocolMessage = CollectionQueryMessage | CollectionStateMessage | SubductionConnectionMessage | ErrorProtocolMessage;
290
+ /**
291
+ * Union of every message that flows over the **Edge subduction byte channel
292
+ * wire** (`EdgeService.SUBDUCTION_REPLICATOR`), i.e. the cbor-encoded payload
293
+ * of a `RouterMessage` targeting the subduction service.
294
+ *
295
+ * @remarks
296
+ * The wire counterpart of {@link SubductionProtocolMessage} — identical except
297
+ * that {@link SubductionConnectionMessage} is replaced by
298
+ * {@link SubductionFrameEnvelope}, which wraps it together with the originator's
299
+ * `connectionId` so the peer can drop stale frames from previous connection
300
+ * lifetimes.
301
+ *
302
+ * The wrap/unwrap happens at the
303
+ * {@link EdgeSubductionReplicatorConnection} boundary on the client and the
304
+ * matching `SubductionTransport` boundary on the edge. Other code paths (the
305
+ * in-memory `TestAdapter` pair, in-process subduction adapter) carry
306
+ * {@link SubductionProtocolMessage} directly without ever building an envelope.
307
+ */
308
+ export type SubductionProtocolMessageEnveloped = CollectionQueryMessage | CollectionStateMessage | SubductionFrameEnvelope | ErrorProtocolMessage;
119
309
  //# sourceMappingURL=automerge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"automerge.d.ts","sourceRoot":"","sources":["../../src/automerge.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG;IAAE,QAAQ,EAAE,IAAI,CAAA;CAAE,CAAC;AAEjD,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,yBAAyB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,uBAAuB,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,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B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,MAAM,yBAAyB,GACjC,sBAAsB,GACtB,sBAAsB,GACtB,2BAA2B,GAC3B,oBAAoB,CAAC;AAEzB;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,kCAAkC,GAC1C,sBAAsB,GACtB,sBAAsB,GACtB,uBAAuB,GACvB,oBAAoB,CAAC"}
@@ -1,6 +1,23 @@
1
1
  //
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
+ /** Wire literal for {@link ErrorProtocolMessage}. */
5
+ export const MESSAGE_TYPE_ERROR = 'error';
6
+ // ─── Subduction transport / control protocol ──────────────────────────────────
7
+ // Frames produced and consumed by `@automerge/automerge-repo`'s subduction
8
+ // transport bridge (`NetworkAdapterTransport`) plus the DXOS-side envelope
9
+ // and reconnect marker. Carried by the Edge subduction channel
10
+ // (`EdgeService.SUBDUCTION_REPLICATOR`) and the in-memory subduction adapter.
11
+ /** Wire literal for {@link SubductionConnectionMessage}. */
12
+ export const MESSAGE_TYPE_SUBDUCTION_CONNECTION = 'subduction-connection';
13
+ /** Wire literal for {@link SubductionFrameEnvelope}. */
14
+ export const MESSAGE_TYPE_SUBDUCTION_FRAME = 'subduction-frame';
15
+ // ─── DXOS collection sync protocol ────────────────────────────────────────────
16
+ // DXOS extension on top of the automerge-repo Message type, used by
17
+ // `CollectionSynchronizer` to negotiate per-collection sync state. Carried
18
+ // by both the classical and subduction channels.
19
+ /** Wire literal for {@link CollectionQueryMessage}. */
4
20
  export const MESSAGE_TYPE_COLLECTION_QUERY = 'collection-query';
21
+ /** Wire literal for {@link CollectionStateMessage}. */
5
22
  export const MESSAGE_TYPE_COLLECTION_STATE = 'collection-state';
6
23
  //# sourceMappingURL=automerge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"automerge.js","sourceRoot":"","sources":["../../src/automerge.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAiGF,MAAM,CAAC,MAAM,6BAA6B,GAAG,kBAAkB,CAAC;AAgBhE,MAAM,CAAC,MAAM,6BAA6B,GAAG,kBAAkB,CAAC"}
1
+ {"version":3,"file":"automerge.js","sourceRoot":"","sources":["../../src/automerge.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAyIF,qDAAqD;AACrD,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAC;AA0B1C,iFAAiF;AACjF,2EAA2E;AAC3E,2EAA2E;AAC3E,+DAA+D;AAC/D,8EAA8E;AAE9E,4DAA4D;AAC5D,MAAM,CAAC,MAAM,kCAAkC,GAAG,uBAAuB,CAAC;AAE1E,wDAAwD;AACxD,MAAM,CAAC,MAAM,6BAA6B,GAAG,kBAAkB,CAAC;AAmDhE,iFAAiF;AACjF,oEAAoE;AACpE,2EAA2E;AAC3E,iDAAiD;AAEjD,uDAAuD;AACvD,MAAM,CAAC,MAAM,6BAA6B,GAAG,kBAAkB,CAAC;AA4BhE,uDAAuD;AACvD,MAAM,CAAC,MAAM,6BAA6B,GAAG,kBAAkB,CAAC"}