@dxos/protocols 0.8.4-main.c4373fc → 0.8.4-main.cb12b3f963

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 (476) hide show
  1. package/README.md +1 -1
  2. package/dist/src/FeedProtocol.d.ts +528 -0
  3. package/dist/src/FeedProtocol.d.ts.map +1 -0
  4. package/dist/src/FeedProtocol.js +237 -0
  5. package/dist/src/FeedProtocol.js.map +1 -0
  6. package/dist/src/FunctionProtocol.d.ts +82 -0
  7. package/dist/src/FunctionProtocol.d.ts.map +1 -0
  8. package/dist/src/FunctionProtocol.js +4 -0
  9. package/dist/src/FunctionProtocol.js.map +1 -0
  10. package/dist/src/automerge.d.ts +8 -0
  11. package/dist/src/automerge.d.ts.map +1 -1
  12. package/dist/src/automerge.js.map +1 -1
  13. package/dist/src/buf/proto/gen/dxos/client/queue_pb.d.ts +237 -0
  14. package/dist/src/buf/proto/gen/dxos/client/queue_pb.d.ts.map +1 -0
  15. package/dist/src/buf/proto/gen/dxos/client/queue_pb.js +44 -0
  16. package/dist/src/buf/proto/gen/dxos/client/queue_pb.js.map +1 -0
  17. package/dist/src/buf/proto/gen/dxos/client/services_pb.d.ts +128 -21
  18. package/dist/src/buf/proto/gen/dxos/client/services_pb.d.ts.map +1 -1
  19. package/dist/src/buf/proto/gen/dxos/client/services_pb.js +89 -53
  20. package/dist/src/buf/proto/gen/dxos/client/services_pb.js.map +1 -1
  21. package/dist/src/buf/proto/gen/dxos/config_pb.d.ts +112 -0
  22. package/dist/src/buf/proto/gen/dxos/config_pb.d.ts.map +1 -1
  23. package/dist/src/buf/proto/gen/dxos/config_pb.js +72 -1
  24. package/dist/src/buf/proto/gen/dxos/config_pb.js.map +1 -1
  25. package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.d.ts +6 -0
  26. package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.d.ts.map +1 -1
  27. package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.js +1 -1
  28. package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.js.map +1 -1
  29. package/dist/src/buf/proto/gen/dxos/echo/query_pb.d.ts +12 -2
  30. package/dist/src/buf/proto/gen/dxos/echo/query_pb.d.ts.map +1 -1
  31. package/dist/src/buf/proto/gen/dxos/echo/query_pb.js +1 -1
  32. package/dist/src/buf/proto/gen/dxos/echo/query_pb.js.map +1 -1
  33. package/dist/src/buf/proto/gen/dxos/echo/service_pb.d.ts +55 -9
  34. package/dist/src/buf/proto/gen/dxos/echo/service_pb.d.ts.map +1 -1
  35. package/dist/src/buf/proto/gen/dxos/echo/service_pb.js +15 -5
  36. package/dist/src/buf/proto/gen/dxos/echo/service_pb.js.map +1 -1
  37. package/dist/src/buf/proto/gen/dxos/edge/messenger_pb.d.ts +28 -0
  38. package/dist/src/buf/proto/gen/dxos/edge/messenger_pb.d.ts.map +1 -1
  39. package/dist/src/buf/proto/gen/dxos/edge/messenger_pb.js +10 -5
  40. package/dist/src/buf/proto/gen/dxos/edge/messenger_pb.js.map +1 -1
  41. package/dist/src/buf/proto/gen/dxos/google_pb.js +1 -1
  42. package/dist/src/buf/proto/gen/dxos/google_pb.js.map +1 -1
  43. package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.d.ts +39 -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 +27 -2
  46. package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.js.map +1 -1
  47. package/dist/src/buf/proto/gen/dxos/iframe_pb.d.ts +1 -10
  48. package/dist/src/buf/proto/gen/dxos/iframe_pb.d.ts.map +1 -1
  49. package/dist/src/buf/proto/gen/dxos/iframe_pb.js +1 -1
  50. package/dist/src/buf/proto/gen/dxos/iframe_pb.js.map +1 -1
  51. package/dist/src/buf/proto/gen/dxos/rpc_pb.d.ts +24 -0
  52. package/dist/src/buf/proto/gen/dxos/rpc_pb.d.ts.map +1 -1
  53. package/dist/src/buf/proto/gen/dxos/rpc_pb.js +12 -7
  54. package/dist/src/buf/proto/gen/dxos/rpc_pb.js.map +1 -1
  55. package/dist/src/buf/proto/gen/dxos/tracing_pb.d.ts +1 -139
  56. package/dist/src/buf/proto/gen/dxos/tracing_pb.d.ts.map +1 -1
  57. package/dist/src/buf/proto/gen/dxos/tracing_pb.js +11 -45
  58. package/dist/src/buf/proto/gen/dxos/tracing_pb.js.map +1 -1
  59. package/dist/src/edge/EdgeFunctionEnv.d.ts +108 -0
  60. package/dist/src/edge/EdgeFunctionEnv.d.ts.map +1 -0
  61. package/dist/src/edge/EdgeFunctionEnv.js +4 -0
  62. package/dist/src/edge/EdgeFunctionEnv.js.map +1 -0
  63. package/dist/src/edge/edge.d.ts +518 -0
  64. package/dist/src/edge/edge.d.ts.map +1 -0
  65. package/dist/src/edge/edge.js +180 -0
  66. package/dist/src/edge/edge.js.map +1 -0
  67. package/dist/src/edge/errors.d.ts +29 -0
  68. package/dist/src/edge/errors.d.ts.map +1 -0
  69. package/dist/src/edge/errors.js +69 -0
  70. package/dist/src/edge/errors.js.map +1 -0
  71. package/dist/src/edge/index.d.ts +5 -0
  72. package/dist/src/edge/index.d.ts.map +1 -0
  73. package/dist/src/edge/index.js +8 -0
  74. package/dist/src/edge/index.js.map +1 -0
  75. package/dist/src/edge/registry.d.ts +212 -0
  76. package/dist/src/edge/registry.d.ts.map +1 -0
  77. package/dist/src/edge/registry.js +139 -0
  78. package/dist/src/edge/registry.js.map +1 -0
  79. package/dist/src/errors/base-errors.d.ts +86 -8
  80. package/dist/src/errors/base-errors.d.ts.map +1 -1
  81. package/dist/src/errors/base-errors.js +4 -20
  82. package/dist/src/errors/base-errors.js.map +1 -1
  83. package/dist/src/errors/encoding.d.ts +2 -2
  84. package/dist/src/errors/encoding.d.ts.map +1 -1
  85. package/dist/src/errors/encoding.js.map +1 -1
  86. package/dist/src/errors/errors.d.ts +619 -42
  87. package/dist/src/errors/errors.d.ts.map +1 -1
  88. package/dist/src/errors/errors.js +49 -103
  89. package/dist/src/errors/errors.js.map +1 -1
  90. package/dist/src/errors/errors.test.js +1 -1
  91. package/dist/src/errors/errors.test.js.map +1 -1
  92. package/dist/src/errors/helpers.d.ts +9 -5
  93. package/dist/src/errors/helpers.d.ts.map +1 -1
  94. package/dist/src/errors/helpers.js +3 -3
  95. package/dist/src/errors/helpers.js.map +1 -1
  96. package/dist/src/errors/index.d.ts +5 -5
  97. package/dist/src/errors/parameter.d.ts.map +1 -1
  98. package/dist/src/feed-replication.d.ts.map +1 -1
  99. package/dist/src/index.d.ts +11 -12
  100. package/dist/src/index.d.ts.map +1 -1
  101. package/dist/src/index.js +4 -5
  102. package/dist/src/index.js.map +1 -1
  103. package/dist/src/indexing.d.ts.map +1 -1
  104. package/dist/src/messenger.d.ts +16 -0
  105. package/dist/src/messenger.d.ts.map +1 -0
  106. package/dist/src/messenger.js +4 -0
  107. package/dist/src/messenger.js.map +1 -0
  108. package/dist/src/proto/gen/dxos/agent/dashboard.d.ts +3 -6
  109. package/dist/src/proto/gen/dxos/agent/dashboard.d.ts.map +1 -1
  110. package/dist/src/proto/gen/dxos/agent/dashboard.js.map +1 -1
  111. package/dist/src/proto/gen/dxos/agent/echoproxy.d.ts +1 -2
  112. package/dist/src/proto/gen/dxos/agent/echoproxy.d.ts.map +1 -1
  113. package/dist/src/proto/gen/dxos/agent/epoch.d.ts +1 -2
  114. package/dist/src/proto/gen/dxos/agent/epoch.d.ts.map +1 -1
  115. package/dist/src/proto/gen/dxos/agent/functions.d.ts +6 -12
  116. package/dist/src/proto/gen/dxos/agent/functions.d.ts.map +1 -1
  117. package/dist/src/proto/gen/dxos/bot.d.ts +12 -24
  118. package/dist/src/proto/gen/dxos/bot.d.ts.map +1 -1
  119. package/dist/src/proto/gen/dxos/bot.js.map +1 -1
  120. package/dist/src/proto/gen/dxos/client/services.d.ts +1030 -913
  121. package/dist/src/proto/gen/dxos/client/services.d.ts.map +1 -1
  122. package/dist/src/proto/gen/dxos/client/services.js +116 -100
  123. package/dist/src/proto/gen/dxos/client/services.js.map +1 -1
  124. package/dist/src/proto/gen/dxos/config.d.ts +115 -100
  125. package/dist/src/proto/gen/dxos/config.d.ts.map +1 -1
  126. package/dist/src/proto/gen/dxos/config.js +26 -0
  127. package/dist/src/proto/gen/dxos/config.js.map +1 -1
  128. package/dist/src/proto/gen/dxos/devtools/host.d.ts +71 -119
  129. package/dist/src/proto/gen/dxos/devtools/host.d.ts.map +1 -1
  130. package/dist/src/proto/gen/dxos/devtools/swarm.d.ts +4 -8
  131. package/dist/src/proto/gen/dxos/devtools/swarm.d.ts.map +1 -1
  132. package/dist/src/proto/gen/dxos/echo/blob.d.ts +1 -2
  133. package/dist/src/proto/gen/dxos/echo/blob.d.ts.map +1 -1
  134. package/dist/src/proto/gen/dxos/echo/blob.js.map +1 -1
  135. package/dist/src/proto/gen/dxos/echo/feed.d.ts +4 -8
  136. package/dist/src/proto/gen/dxos/echo/feed.d.ts.map +1 -1
  137. package/dist/src/proto/gen/dxos/echo/filter.d.ts +2 -4
  138. package/dist/src/proto/gen/dxos/echo/filter.d.ts.map +1 -1
  139. package/dist/src/proto/gen/dxos/echo/filter.js.map +1 -1
  140. package/dist/src/proto/gen/dxos/echo/indexing.d.ts +2 -4
  141. package/dist/src/proto/gen/dxos/echo/indexing.d.ts.map +1 -1
  142. package/dist/src/proto/gen/dxos/echo/indexing.js.map +1 -1
  143. package/dist/src/proto/gen/dxos/echo/metadata.d.ts +12 -16
  144. package/dist/src/proto/gen/dxos/echo/metadata.d.ts.map +1 -1
  145. package/dist/src/proto/gen/dxos/echo/metadata.js.map +1 -1
  146. package/dist/src/proto/gen/dxos/echo/model/document.d.ts +11 -22
  147. package/dist/src/proto/gen/dxos/echo/model/document.d.ts.map +1 -1
  148. package/dist/src/proto/gen/dxos/echo/model/document.js.map +1 -1
  149. package/dist/src/proto/gen/dxos/echo/model/messenger.d.ts +1 -2
  150. package/dist/src/proto/gen/dxos/echo/model/messenger.d.ts.map +1 -1
  151. package/dist/src/proto/gen/dxos/echo/model/text.d.ts +2 -4
  152. package/dist/src/proto/gen/dxos/echo/model/text.d.ts.map +1 -1
  153. package/dist/src/proto/gen/dxos/echo/object.d.ts +6 -12
  154. package/dist/src/proto/gen/dxos/echo/object.d.ts.map +1 -1
  155. package/dist/src/proto/gen/dxos/echo/object.js.map +1 -1
  156. package/dist/src/proto/gen/dxos/echo/query.d.ts +21 -9
  157. package/dist/src/proto/gen/dxos/echo/query.d.ts.map +1 -1
  158. package/dist/src/proto/gen/dxos/echo/query.js.map +1 -1
  159. package/dist/src/proto/gen/dxos/echo/service.d.ts +47 -38
  160. package/dist/src/proto/gen/dxos/echo/service.d.ts.map +1 -1
  161. package/dist/src/proto/gen/dxos/echo/snapshot.d.ts +2 -4
  162. package/dist/src/proto/gen/dxos/echo/snapshot.d.ts.map +1 -1
  163. package/dist/src/proto/gen/dxos/echo/timeframe.d.ts +2 -4
  164. package/dist/src/proto/gen/dxos/echo/timeframe.d.ts.map +1 -1
  165. package/dist/src/proto/gen/dxos/edge/calls.d.ts +5 -10
  166. package/dist/src/proto/gen/dxos/edge/calls.d.ts.map +1 -1
  167. package/dist/src/proto/gen/dxos/edge/messenger.d.ts +28 -10
  168. package/dist/src/proto/gen/dxos/edge/messenger.d.ts.map +1 -1
  169. package/dist/src/proto/gen/dxos/edge/messenger.js.map +1 -1
  170. package/dist/src/proto/gen/dxos/edge/signal.d.ts +7 -14
  171. package/dist/src/proto/gen/dxos/edge/signal.d.ts.map +1 -1
  172. package/dist/src/proto/gen/dxos/error.d.ts +1 -2
  173. package/dist/src/proto/gen/dxos/error.d.ts.map +1 -1
  174. package/dist/src/proto/gen/dxos/gravity.d.ts +10 -20
  175. package/dist/src/proto/gen/dxos/gravity.d.ts.map +1 -1
  176. package/dist/src/proto/gen/dxos/halo/credentials/auth.d.ts +1 -2
  177. package/dist/src/proto/gen/dxos/halo/credentials/auth.d.ts.map +1 -1
  178. package/dist/src/proto/gen/dxos/halo/credentials/greet.d.ts +6 -12
  179. package/dist/src/proto/gen/dxos/halo/credentials/greet.d.ts.map +1 -1
  180. package/dist/src/proto/gen/dxos/halo/credentials/greet.js.map +1 -1
  181. package/dist/src/proto/gen/dxos/halo/credentials/identity.d.ts +2 -4
  182. package/dist/src/proto/gen/dxos/halo/credentials/identity.d.ts.map +1 -1
  183. package/dist/src/proto/gen/dxos/halo/credentials.d.ts +35 -43
  184. package/dist/src/proto/gen/dxos/halo/credentials.d.ts.map +1 -1
  185. package/dist/src/proto/gen/dxos/halo/credentials.js +9 -0
  186. package/dist/src/proto/gen/dxos/halo/credentials.js.map +1 -1
  187. package/dist/src/proto/gen/dxos/halo/invitations.d.ts +13 -26
  188. package/dist/src/proto/gen/dxos/halo/invitations.d.ts.map +1 -1
  189. package/dist/src/proto/gen/dxos/halo/invitations.js.map +1 -1
  190. package/dist/src/proto/gen/dxos/halo/keyring.d.ts +1 -2
  191. package/dist/src/proto/gen/dxos/halo/keyring.d.ts.map +1 -1
  192. package/dist/src/proto/gen/dxos/halo/keys.d.ts +2 -4
  193. package/dist/src/proto/gen/dxos/halo/keys.d.ts.map +1 -1
  194. package/dist/src/proto/gen/dxos/halo/signed.d.ts +4 -8
  195. package/dist/src/proto/gen/dxos/halo/signed.d.ts.map +1 -1
  196. package/dist/src/proto/gen/dxos/iframe.d.ts +4 -18
  197. package/dist/src/proto/gen/dxos/iframe.d.ts.map +1 -1
  198. package/dist/src/proto/gen/dxos/iframe.js.map +1 -1
  199. package/dist/src/proto/gen/dxos/keys.d.ts +2 -4
  200. package/dist/src/proto/gen/dxos/keys.d.ts.map +1 -1
  201. package/dist/src/proto/gen/dxos/mesh/bridge.d.ts +12 -24
  202. package/dist/src/proto/gen/dxos/mesh/bridge.d.ts.map +1 -1
  203. package/dist/src/proto/gen/dxos/mesh/broadcast.d.ts +1 -2
  204. package/dist/src/proto/gen/dxos/mesh/broadcast.d.ts.map +1 -1
  205. package/dist/src/proto/gen/dxos/mesh/messaging.d.ts +2 -4
  206. package/dist/src/proto/gen/dxos/mesh/messaging.d.ts.map +1 -1
  207. package/dist/src/proto/gen/dxos/mesh/muxer.d.ts +5 -10
  208. package/dist/src/proto/gen/dxos/mesh/muxer.d.ts.map +1 -1
  209. package/dist/src/proto/gen/dxos/mesh/presence.d.ts +1 -2
  210. package/dist/src/proto/gen/dxos/mesh/presence.d.ts.map +1 -1
  211. package/dist/src/proto/gen/dxos/mesh/protocol.d.ts +3 -6
  212. package/dist/src/proto/gen/dxos/mesh/protocol.d.ts.map +1 -1
  213. package/dist/src/proto/gen/dxos/mesh/replicator.d.ts +2 -4
  214. package/dist/src/proto/gen/dxos/mesh/replicator.d.ts.map +1 -1
  215. package/dist/src/proto/gen/dxos/mesh/signal.d.ts +9 -18
  216. package/dist/src/proto/gen/dxos/mesh/signal.d.ts.map +1 -1
  217. package/dist/src/proto/gen/dxos/mesh/signal.js.map +1 -1
  218. package/dist/src/proto/gen/dxos/mesh/swarm.d.ts +6 -12
  219. package/dist/src/proto/gen/dxos/mesh/swarm.d.ts.map +1 -1
  220. package/dist/src/proto/gen/dxos/mesh/teleport/auth.d.ts +2 -4
  221. package/dist/src/proto/gen/dxos/mesh/teleport/auth.d.ts.map +1 -1
  222. package/dist/src/proto/gen/dxos/mesh/teleport/automerge.d.ts +2 -4
  223. package/dist/src/proto/gen/dxos/mesh/teleport/automerge.d.ts.map +1 -1
  224. package/dist/src/proto/gen/dxos/mesh/teleport/blobsync.d.ts +3 -6
  225. package/dist/src/proto/gen/dxos/mesh/teleport/blobsync.d.ts.map +1 -1
  226. package/dist/src/proto/gen/dxos/mesh/teleport/control.d.ts +3 -6
  227. package/dist/src/proto/gen/dxos/mesh/teleport/control.d.ts.map +1 -1
  228. package/dist/src/proto/gen/dxos/mesh/teleport/gossip.d.ts +1 -2
  229. package/dist/src/proto/gen/dxos/mesh/teleport/gossip.d.ts.map +1 -1
  230. package/dist/src/proto/gen/dxos/mesh/teleport/notarization.d.ts +1 -2
  231. package/dist/src/proto/gen/dxos/mesh/teleport/notarization.d.ts.map +1 -1
  232. package/dist/src/proto/gen/dxos/mesh/teleport/replicator.d.ts +5 -10
  233. package/dist/src/proto/gen/dxos/mesh/teleport/replicator.d.ts.map +1 -1
  234. package/dist/src/proto/gen/dxos/mesh/teleport.d.ts +2 -4
  235. package/dist/src/proto/gen/dxos/mesh/teleport.d.ts.map +1 -1
  236. package/dist/src/proto/gen/dxos/registry.d.ts +3 -6
  237. package/dist/src/proto/gen/dxos/registry.d.ts.map +1 -1
  238. package/dist/src/proto/gen/dxos/rpc.d.ts +24 -12
  239. package/dist/src/proto/gen/dxos/rpc.d.ts.map +1 -1
  240. package/dist/src/proto/gen/dxos/rpc.js.map +1 -1
  241. package/dist/src/proto/gen/dxos/service/agentmanager.d.ts +4 -8
  242. package/dist/src/proto/gen/dxos/service/agentmanager.d.ts.map +1 -1
  243. package/dist/src/proto/gen/dxos/service/agentmanager.js.map +1 -1
  244. package/dist/src/proto/gen/dxos/service/publisher.d.ts +5 -10
  245. package/dist/src/proto/gen/dxos/service/publisher.d.ts.map +1 -1
  246. package/dist/src/proto/gen/dxos/service/supervisor.d.ts +12 -24
  247. package/dist/src/proto/gen/dxos/service/supervisor.d.ts.map +1 -1
  248. package/dist/src/proto/gen/dxos/service/supervisor.js.map +1 -1
  249. package/dist/src/proto/gen/dxos/service/tunnel.d.ts +3 -6
  250. package/dist/src/proto/gen/dxos/service/tunnel.d.ts.map +1 -1
  251. package/dist/src/proto/gen/dxos/tracing.d.ts +10 -99
  252. package/dist/src/proto/gen/dxos/tracing.d.ts.map +1 -1
  253. package/dist/src/proto/gen/dxos/type.d.ts +12 -24
  254. package/dist/src/proto/gen/dxos/type.d.ts.map +1 -1
  255. package/dist/src/proto/gen/dxos/value.d.ts +2 -4
  256. package/dist/src/proto/gen/dxos/value.d.ts.map +1 -1
  257. package/dist/src/proto/gen/example/testing/data.d.ts +4 -8
  258. package/dist/src/proto/gen/example/testing/data.d.ts.map +1 -1
  259. package/dist/src/proto/gen/example/testing/rpc.d.ts +7 -14
  260. package/dist/src/proto/gen/example/testing/rpc.d.ts.map +1 -1
  261. package/dist/src/proto/gen/google/protobuf.d.ts +326 -40
  262. package/dist/src/proto/gen/google/protobuf.d.ts.map +1 -1
  263. package/dist/src/proto/gen/google/protobuf.js +127 -1
  264. package/dist/src/proto/gen/google/protobuf.js.map +1 -1
  265. package/dist/src/proto/gen/index.d.ts +41 -7
  266. package/dist/src/proto/gen/index.d.ts.map +1 -1
  267. package/dist/src/proto/gen/index.js +1 -1
  268. package/dist/src/proto/gen/index.js.map +1 -1
  269. package/dist/src/proto/index.d.ts +2 -2
  270. package/dist/src/proto/substitutions.d.ts +8 -8
  271. package/dist/src/proto/substitutions.d.ts.map +1 -1
  272. package/dist/src/proto/types.d.ts +1 -1
  273. package/dist/src/space-archive.d.ts +62 -3
  274. package/dist/src/space-archive.d.ts.map +1 -1
  275. package/dist/src/space-archive.js +13 -1
  276. package/dist/src/space-archive.js.map +1 -1
  277. package/dist/src/types.d.ts +2 -2
  278. package/dist/tsconfig.tsbuildinfo +1 -1
  279. package/package.json +19 -34
  280. package/src/FeedProtocol.ts +320 -0
  281. package/src/FunctionProtocol.ts +102 -0
  282. package/src/automerge.ts +8 -0
  283. package/src/buf/proto/gen/dxos/agent/dashboard_pb.ts +1 -1
  284. package/src/buf/proto/gen/dxos/agent/echo-proxy_pb.ts +1 -1
  285. package/src/buf/proto/gen/dxos/agent/epoch_pb.ts +1 -1
  286. package/src/buf/proto/gen/dxos/agent/functions_pb.ts +1 -1
  287. package/src/buf/proto/gen/dxos/bot_pb.ts +1 -1
  288. package/src/buf/proto/gen/dxos/client/invitation_pb.ts +1 -1
  289. package/src/buf/proto/gen/dxos/client/logging_pb.ts +1 -1
  290. package/src/buf/proto/gen/dxos/client/queue_pb.ts +286 -0
  291. package/src/buf/proto/gen/dxos/client/services_pb.ts +189 -60
  292. package/src/buf/proto/gen/dxos/config_pb.ts +132 -2
  293. package/src/buf/proto/gen/dxos/devtools/diagnostics_pb.ts +1 -1
  294. package/src/buf/proto/gen/dxos/devtools/host_pb.ts +1 -1
  295. package/src/buf/proto/gen/dxos/devtools/swarm_pb.ts +1 -1
  296. package/src/buf/proto/gen/dxos/echo/blob_pb.ts +1 -1
  297. package/src/buf/proto/gen/dxos/echo/feed_pb.ts +1 -1
  298. package/src/buf/proto/gen/dxos/echo/filter_pb.ts +1 -1
  299. package/src/buf/proto/gen/dxos/echo/indexing_pb.ts +1 -1
  300. package/src/buf/proto/gen/dxos/echo/metadata_pb.ts +9 -2
  301. package/src/buf/proto/gen/dxos/echo/model/document_pb.ts +1 -1
  302. package/src/buf/proto/gen/dxos/echo/model/messenger_pb.ts +1 -1
  303. package/src/buf/proto/gen/dxos/echo/model/text_pb.ts +1 -1
  304. package/src/buf/proto/gen/dxos/echo/object_pb.ts +1 -1
  305. package/src/buf/proto/gen/dxos/echo/query_pb.ts +16 -4
  306. package/src/buf/proto/gen/dxos/echo/service_pb.ts +68 -16
  307. package/src/buf/proto/gen/dxos/echo/snapshot_pb.ts +1 -1
  308. package/src/buf/proto/gen/dxos/echo/timeframe_pb.ts +1 -1
  309. package/src/buf/proto/gen/dxos/edge/calls_pb.ts +1 -1
  310. package/src/buf/proto/gen/dxos/edge/messenger_pb.ts +39 -6
  311. package/src/buf/proto/gen/dxos/edge/signal_pb.ts +1 -1
  312. package/src/buf/proto/gen/dxos/error_pb.ts +1 -1
  313. package/src/buf/proto/gen/dxos/field_options_pb.ts +1 -1
  314. package/src/buf/proto/gen/dxos/google_pb.ts +1 -1
  315. package/src/buf/proto/gen/dxos/gravity_pb.ts +1 -1
  316. package/src/buf/proto/gen/dxos/halo/credentials/auth_pb.ts +1 -1
  317. package/src/buf/proto/gen/dxos/halo/credentials/greet_pb.ts +1 -1
  318. package/src/buf/proto/gen/dxos/halo/credentials/identity_pb.ts +1 -1
  319. package/src/buf/proto/gen/dxos/halo/credentials_pb.ts +49 -3
  320. package/src/buf/proto/gen/dxos/halo/invitations_pb.ts +1 -1
  321. package/src/buf/proto/gen/dxos/halo/keyring_pb.ts +1 -1
  322. package/src/buf/proto/gen/dxos/halo/keys_pb.ts +1 -1
  323. package/src/buf/proto/gen/dxos/halo/signed_pb.ts +1 -1
  324. package/src/buf/proto/gen/dxos/iframe_pb.ts +3 -14
  325. package/src/buf/proto/gen/dxos/keys_pb.ts +1 -1
  326. package/src/buf/proto/gen/dxos/mesh/bridge_pb.ts +1 -1
  327. package/src/buf/proto/gen/dxos/mesh/broadcast_pb.ts +1 -1
  328. package/src/buf/proto/gen/dxos/mesh/messaging_pb.ts +1 -1
  329. package/src/buf/proto/gen/dxos/mesh/muxer_pb.ts +1 -1
  330. package/src/buf/proto/gen/dxos/mesh/presence_pb.ts +1 -1
  331. package/src/buf/proto/gen/dxos/mesh/protocol_pb.ts +1 -1
  332. package/src/buf/proto/gen/dxos/mesh/replicator_pb.ts +1 -1
  333. package/src/buf/proto/gen/dxos/mesh/signal_pb.ts +1 -1
  334. package/src/buf/proto/gen/dxos/mesh/swarm_pb.ts +1 -1
  335. package/src/buf/proto/gen/dxos/mesh/teleport/admission-discovery_pb.ts +1 -1
  336. package/src/buf/proto/gen/dxos/mesh/teleport/auth_pb.ts +1 -1
  337. package/src/buf/proto/gen/dxos/mesh/teleport/automerge_pb.ts +1 -1
  338. package/src/buf/proto/gen/dxos/mesh/teleport/blobsync_pb.ts +1 -1
  339. package/src/buf/proto/gen/dxos/mesh/teleport/control_pb.ts +1 -1
  340. package/src/buf/proto/gen/dxos/mesh/teleport/gossip_pb.ts +1 -1
  341. package/src/buf/proto/gen/dxos/mesh/teleport/notarization_pb.ts +1 -1
  342. package/src/buf/proto/gen/dxos/mesh/teleport/replicator_pb.ts +1 -1
  343. package/src/buf/proto/gen/dxos/registry_pb.ts +1 -1
  344. package/src/buf/proto/gen/dxos/rpc_pb.ts +37 -8
  345. package/src/buf/proto/gen/dxos/service/agentmanager_pb.ts +1 -1
  346. package/src/buf/proto/gen/dxos/service/publisher_pb.ts +1 -1
  347. package/src/buf/proto/gen/dxos/service/supervisor_pb.ts +1 -1
  348. package/src/buf/proto/gen/dxos/service/tunnel_pb.ts +1 -1
  349. package/src/buf/proto/gen/dxos/tracing_pb.ts +12 -179
  350. package/src/buf/proto/gen/dxos/type_pb.ts +1 -1
  351. package/src/buf/proto/gen/dxos/value_pb.ts +1 -1
  352. package/src/buf/proto/gen/example/testing/data_pb.ts +1 -1
  353. package/src/buf/proto/gen/example/testing/rpc_pb.ts +1 -1
  354. package/src/codec.test.ts +1 -1
  355. package/src/edge/EdgeFunctionEnv.ts +191 -0
  356. package/src/edge/edge.ts +611 -0
  357. package/src/edge/errors.ts +85 -0
  358. package/src/edge/index.ts +8 -0
  359. package/src/edge/registry.ts +164 -0
  360. package/src/errors/base-errors.ts +4 -22
  361. package/src/errors/encoding.ts +2 -3
  362. package/src/errors/errors.test.ts +2 -2
  363. package/src/errors/errors.ts +57 -124
  364. package/src/errors/helpers.ts +6 -7
  365. package/src/errors/index.ts +5 -5
  366. package/src/feed-replication.ts +1 -0
  367. package/src/index.ts +11 -12
  368. package/src/indexing.test.ts +1 -1
  369. package/src/messenger.ts +22 -0
  370. package/src/proto/dxos/client/queue.proto +81 -0
  371. package/src/proto/dxos/client/services.proto +39 -4
  372. package/src/proto/dxos/config.proto +50 -1
  373. package/src/proto/dxos/echo/metadata.proto +3 -0
  374. package/src/proto/dxos/echo/query.proto +4 -1
  375. package/src/proto/dxos/echo/service.proto +27 -6
  376. package/src/proto/dxos/edge/messenger.proto +10 -0
  377. package/src/proto/dxos/halo/credentials.proto +15 -0
  378. package/src/proto/dxos/iframe.proto +1 -3
  379. package/src/proto/dxos/rpc.proto +7 -0
  380. package/src/proto/dxos/tracing.proto +0 -40
  381. package/src/proto/gen/dxos/agent/dashboard.ts +3 -6
  382. package/src/proto/gen/dxos/agent/echoproxy.ts +1 -2
  383. package/src/proto/gen/dxos/agent/epoch.ts +1 -2
  384. package/src/proto/gen/dxos/agent/functions.ts +6 -12
  385. package/src/proto/gen/dxos/bot.ts +12 -24
  386. package/src/proto/gen/dxos/client/services.ts +1030 -913
  387. package/src/proto/gen/dxos/config.ts +115 -100
  388. package/src/proto/gen/dxos/devtools/host.ts +71 -119
  389. package/src/proto/gen/dxos/devtools/swarm.ts +4 -8
  390. package/src/proto/gen/dxos/echo/blob.ts +1 -2
  391. package/src/proto/gen/dxos/echo/feed.ts +4 -8
  392. package/src/proto/gen/dxos/echo/filter.ts +2 -4
  393. package/src/proto/gen/dxos/echo/indexing.ts +2 -4
  394. package/src/proto/gen/dxos/echo/metadata.ts +12 -16
  395. package/src/proto/gen/dxos/echo/model/document.ts +11 -22
  396. package/src/proto/gen/dxos/echo/model/messenger.ts +1 -2
  397. package/src/proto/gen/dxos/echo/model/text.ts +2 -4
  398. package/src/proto/gen/dxos/echo/object.ts +6 -12
  399. package/src/proto/gen/dxos/echo/query.ts +21 -9
  400. package/src/proto/gen/dxos/echo/service.ts +46 -38
  401. package/src/proto/gen/dxos/echo/snapshot.ts +2 -4
  402. package/src/proto/gen/dxos/echo/timeframe.ts +2 -4
  403. package/src/proto/gen/dxos/edge/calls.ts +5 -10
  404. package/src/proto/gen/dxos/edge/messenger.ts +28 -10
  405. package/src/proto/gen/dxos/edge/signal.ts +7 -14
  406. package/src/proto/gen/dxos/error.ts +1 -2
  407. package/src/proto/gen/dxos/gravity.ts +10 -20
  408. package/src/proto/gen/dxos/halo/credentials/auth.ts +1 -2
  409. package/src/proto/gen/dxos/halo/credentials/greet.ts +6 -12
  410. package/src/proto/gen/dxos/halo/credentials/identity.ts +2 -4
  411. package/src/proto/gen/dxos/halo/credentials.ts +35 -43
  412. package/src/proto/gen/dxos/halo/invitations.ts +13 -26
  413. package/src/proto/gen/dxos/halo/keyring.ts +1 -2
  414. package/src/proto/gen/dxos/halo/keys.ts +2 -4
  415. package/src/proto/gen/dxos/halo/signed.ts +4 -8
  416. package/src/proto/gen/dxos/iframe.ts +4 -18
  417. package/src/proto/gen/dxos/keys.ts +2 -4
  418. package/src/proto/gen/dxos/mesh/bridge.ts +12 -24
  419. package/src/proto/gen/dxos/mesh/broadcast.ts +1 -2
  420. package/src/proto/gen/dxos/mesh/messaging.ts +2 -4
  421. package/src/proto/gen/dxos/mesh/muxer.ts +5 -10
  422. package/src/proto/gen/dxos/mesh/presence.ts +1 -2
  423. package/src/proto/gen/dxos/mesh/protocol.ts +3 -6
  424. package/src/proto/gen/dxos/mesh/replicator.ts +2 -4
  425. package/src/proto/gen/dxos/mesh/signal.ts +9 -18
  426. package/src/proto/gen/dxos/mesh/swarm.ts +6 -12
  427. package/src/proto/gen/dxos/mesh/teleport/auth.ts +2 -4
  428. package/src/proto/gen/dxos/mesh/teleport/automerge.ts +2 -4
  429. package/src/proto/gen/dxos/mesh/teleport/blobsync.ts +3 -6
  430. package/src/proto/gen/dxos/mesh/teleport/control.ts +3 -6
  431. package/src/proto/gen/dxos/mesh/teleport/gossip.ts +1 -2
  432. package/src/proto/gen/dxos/mesh/teleport/notarization.ts +1 -2
  433. package/src/proto/gen/dxos/mesh/teleport/replicator.ts +5 -10
  434. package/src/proto/gen/dxos/mesh/teleport.ts +2 -4
  435. package/src/proto/gen/dxos/registry.ts +3 -6
  436. package/src/proto/gen/dxos/rpc.ts +24 -12
  437. package/src/proto/gen/dxos/service/agentmanager.ts +4 -8
  438. package/src/proto/gen/dxos/service/publisher.ts +5 -10
  439. package/src/proto/gen/dxos/service/supervisor.ts +12 -24
  440. package/src/proto/gen/dxos/service/tunnel.ts +3 -6
  441. package/src/proto/gen/dxos/tracing.ts +10 -96
  442. package/src/proto/gen/dxos/type.ts +12 -24
  443. package/src/proto/gen/dxos/value.ts +2 -4
  444. package/src/proto/gen/example/testing/data.ts +4 -8
  445. package/src/proto/gen/example/testing/rpc.ts +7 -14
  446. package/src/proto/gen/google/protobuf.ts +326 -40
  447. package/src/proto/gen/index.ts +42 -8
  448. package/src/proto/index.ts +2 -2
  449. package/src/proto/types.ts +1 -1
  450. package/src/space-archive.ts +70 -1
  451. package/src/types.ts +2 -2
  452. package/dist/src/edge-error.d.ts +0 -26
  453. package/dist/src/edge-error.d.ts.map +0 -1
  454. package/dist/src/edge-error.js +0 -102
  455. package/dist/src/edge-error.js.map +0 -1
  456. package/dist/src/edge.d.ts +0 -246
  457. package/dist/src/edge.d.ts.map +0 -1
  458. package/dist/src/edge.js +0 -49
  459. package/dist/src/edge.js.map +0 -1
  460. package/dist/src/query.d.ts +0 -5
  461. package/dist/src/query.d.ts.map +0 -1
  462. package/dist/src/query.js +0 -8
  463. package/dist/src/query.js.map +0 -1
  464. package/dist/src/queue.d.ts +0 -28
  465. package/dist/src/queue.d.ts.map +0 -1
  466. package/dist/src/queue.js +0 -8
  467. package/dist/src/queue.js.map +0 -1
  468. package/dist/src/tracing.d.ts +0 -40
  469. package/dist/src/tracing.d.ts.map +0 -1
  470. package/dist/src/tracing.js +0 -50
  471. package/dist/src/tracing.js.map +0 -1
  472. package/src/edge-error.ts +0 -134
  473. package/src/edge.ts +0 -279
  474. package/src/query.ts +0 -8
  475. package/src/queue.ts +0 -38
  476. package/src/tracing.ts +0 -86
@@ -1,40 +0,0 @@
1
- export type Command = 'begin' | 'end' | 'update';
2
- export type TraceStatus = 'ok' | 'error';
3
- export type DataType = Record<string, any>;
4
- export type TracingContext = {
5
- span?: {
6
- id: string;
7
- command?: Command;
8
- parent?: string;
9
- status?: TraceStatus;
10
- data?: DataType;
11
- };
12
- };
13
- export type Trace = {
14
- begin: (opts: {
15
- id: string;
16
- parentId?: string;
17
- data?: DataType;
18
- }) => TracingContext;
19
- end: (opts: {
20
- id: string;
21
- status?: 'ok' | 'error';
22
- data?: DataType;
23
- }) => TracingContext;
24
- update: (opts: {
25
- id: string;
26
- data: DataType;
27
- }) => TracingContext;
28
- error: (opts: {
29
- id: string;
30
- error: Error;
31
- data?: DataType;
32
- }) => TracingContext;
33
- };
34
- export declare const trace: Trace;
35
- export type DataPipelineProcessed = {
36
- spaceKey: string;
37
- feedKey: string;
38
- seq: number;
39
- };
40
- //# sourceMappingURL=tracing.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../src/tracing.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEjD,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,OAAO,CAAC;AAEzC,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAE3C,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,CAAC,EAAE;QACL,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,WAAW,CAAC;QACrB,IAAI,CAAC,EAAE,QAAQ,CAAC;KACjB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAClB,KAAK,EAAE,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,QAAQ,CAAA;KAAE,KAAK,cAAc,CAAC;IACpF,GAAG,EAAE,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,QAAQ,CAAA;KAAE,KAAK,cAAc,CAAC;IACxF,MAAM,EAAE,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,QAAQ,CAAA;KAAE,KAAK,cAAc,CAAC;IACjE,KAAK,EAAE,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,KAAK,CAAC;QAAC,IAAI,CAAC,EAAE,QAAQ,CAAA;KAAE,KAAK,cAAc,CAAC;CAChF,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAgDnB,CAAC;AAMF,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC"}
@@ -1,50 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
- export const trace = {
5
- begin: ({ id, parentId, data }) => {
6
- return {
7
- span: {
8
- command: 'begin',
9
- id,
10
- parent: parentId,
11
- data,
12
- },
13
- };
14
- },
15
- end: ({ id, status, data }) => {
16
- return {
17
- span: {
18
- command: 'end',
19
- id,
20
- status: status ?? 'ok',
21
- data,
22
- },
23
- };
24
- },
25
- update: ({ id, data }) => {
26
- return {
27
- span: {
28
- command: 'update',
29
- id,
30
- data,
31
- },
32
- };
33
- },
34
- error: ({ id, error, data }) => {
35
- return {
36
- span: {
37
- command: 'end',
38
- id,
39
- status: 'error',
40
- data: {
41
- errorMessage: error.message,
42
- errorName: error.name,
43
- errorStack: error.stack,
44
- ...data,
45
- },
46
- },
47
- };
48
- },
49
- };
50
- //# sourceMappingURL=tracing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tracing.js","sourceRoot":"","sources":["../../src/tracing.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAyBF,MAAM,CAAC,MAAM,KAAK,GAAU;IAC1B,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE;QAChC,OAAO;YACL,IAAI,EAAE;gBACJ,OAAO,EAAE,OAAO;gBAChB,EAAE;gBACF,MAAM,EAAE,QAAQ;gBAChB,IAAI;aACL;SACF,CAAC;IACJ,CAAC;IAED,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE;QAC5B,OAAO;YACL,IAAI,EAAE;gBACJ,OAAO,EAAE,KAAK;gBACd,EAAE;gBACF,MAAM,EAAE,MAAM,IAAI,IAAI;gBACtB,IAAI;aACL;SACF,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACvB,OAAO;YACL,IAAI,EAAE;gBACJ,OAAO,EAAE,QAAQ;gBACjB,EAAE;gBACF,IAAI;aACL;SACF,CAAC;IACJ,CAAC;IAED,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;QAC7B,OAAO;YACL,IAAI,EAAE;gBACJ,OAAO,EAAE,KAAK;gBACd,EAAE;gBACF,MAAM,EAAE,OAAO;gBACf,IAAI,EAAE;oBACJ,YAAY,EAAE,KAAK,CAAC,OAAO;oBAC3B,SAAS,EAAE,KAAK,CAAC,IAAI;oBACrB,UAAU,EAAE,KAAK,CAAC,KAAK;oBACvB,GAAG,IAAI;iBACR;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
package/src/edge-error.ts DELETED
@@ -1,134 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { BaseError } from '@dxos/errors';
6
-
7
- import { type EdgeErrorData, type EdgeHttpFailure } from './edge';
8
-
9
- // TODO(burdon): Reconcile with @dxos/errors.
10
- export class EdgeCallFailedError extends Error {
11
- public static fromProcessingFailureCause(cause: Error): EdgeCallFailedError {
12
- return new EdgeCallFailedError({
13
- reason: 'Error processing request.',
14
- isRetryable: true,
15
- cause,
16
- });
17
- }
18
-
19
- public static async fromHttpFailure(response: Response): Promise<EdgeCallFailedError> {
20
- return new EdgeCallFailedError({
21
- reason: `HTTP code ${response.status}: ${response.statusText}.`,
22
- isRetryable: isRetryableCode(response.status),
23
- retryAfterMs: getRetryAfterMillis(response),
24
- cause: await parseErrorBody(response),
25
- });
26
- }
27
-
28
- public static fromUnsuccessfulResponse(response: Response, body: EdgeHttpFailure): EdgeCallFailedError {
29
- return new EdgeCallFailedError({
30
- reason: body.reason,
31
- errorData: body.errorData,
32
- isRetryable: body.errorData == null && response.headers.has('Retry-After'),
33
- retryAfterMs: getRetryAfterMillis(response),
34
- });
35
- }
36
-
37
- readonly reason: string;
38
- readonly errorData?: EdgeErrorData;
39
- readonly isRetryable?: boolean;
40
- readonly retryAfterMs?: number;
41
-
42
- constructor(args: {
43
- reason: string;
44
- isRetryable?: boolean;
45
- errorData?: EdgeErrorData;
46
- retryAfterMs?: number;
47
- cause?: Error;
48
- }) {
49
- super(args.reason, { cause: args.cause });
50
- this.reason = args.reason;
51
- this.errorData = args.errorData;
52
- this.retryAfterMs = args.retryAfterMs;
53
- this.isRetryable = Boolean(args.isRetryable);
54
- }
55
- }
56
-
57
- export class EdgeAuthChallengeError extends EdgeCallFailedError {
58
- constructor(
59
- public readonly challenge: string,
60
- errorData: EdgeErrorData,
61
- ) {
62
- super({ reason: 'Auth challenge.', errorData, isRetryable: false });
63
- }
64
- }
65
-
66
- const getRetryAfterMillis = (response: Response) => {
67
- const retryAfter = Number(response.headers.get('Retry-After'));
68
- return Number.isNaN(retryAfter) || retryAfter === 0 ? undefined : retryAfter * 1000;
69
- };
70
-
71
- export const createRetryableHttpFailure = (args: { reason: any; retryAfterSeconds: number }) => {
72
- return new Response(JSON.stringify({ success: false, reason: args.reason }), {
73
- headers: { 'Retry-After': String(args.retryAfterSeconds) },
74
- });
75
- };
76
-
77
- const isRetryableCode = (status: number) => {
78
- if (status === 501) {
79
- // Not Implemented
80
- return false;
81
- }
82
- return !(status >= 400 && status < 500);
83
- };
84
-
85
- const parseErrorBody = async (response: Response): Promise<Error | undefined> => {
86
- if (response.headers.get('Content-Type') !== 'application/json') {
87
- const body = await response.text();
88
- return new Error(body.slice(0, 256));
89
- }
90
-
91
- const body = await response.json();
92
- if (!('error' in body)) {
93
- return undefined;
94
- }
95
-
96
- return parseSerializedError(body.error);
97
- };
98
-
99
- type SerializedError = {
100
- code?: string;
101
- message?: string;
102
- context?: Record<string, unknown>;
103
- stack?: string;
104
- cause?: SerializedError;
105
- };
106
-
107
- const parseSerializedError = (serializedError: SerializedError): Error => {
108
- let err: Error;
109
- if (typeof serializedError.code === 'string') {
110
- err = new BaseError(serializedError.code, {
111
- message: serializedError.message ?? 'Unknown error',
112
- cause: serializedError.cause ? parseSerializedError(serializedError.cause) : undefined,
113
- context: serializedError.context,
114
- });
115
-
116
- if (serializedError.stack) {
117
- Object.defineProperty(err, 'stack', {
118
- value: serializedError.stack,
119
- });
120
- }
121
- } else {
122
- err = new Error(serializedError.message ?? 'Unknown error', {
123
- cause: serializedError.cause ? parseSerializedError(serializedError.cause) : undefined,
124
- });
125
-
126
- if (serializedError.stack) {
127
- Object.defineProperty(err, 'stack', {
128
- value: serializedError.stack,
129
- });
130
- }
131
- }
132
-
133
- return err;
134
- };
package/src/edge.ts DELETED
@@ -1,279 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import * as Schema from 'effect/Schema';
6
-
7
- import { SpaceId } from '@dxos/keys';
8
-
9
- // TODO(burdon): Rename EdgerRouterEndpoint.
10
- // If we would rename it, we need to be careful to not break composer production.
11
- export enum EdgeService {
12
- AUTOMERGE_REPLICATOR = 'automerge-replicator',
13
- FEED_REPLICATOR = 'feed-replicator',
14
- SWARM = 'swarm',
15
- SIGNAL = 'signal',
16
- STATUS = 'status',
17
- }
18
-
19
- export type EdgeHttpSuccess<T> = {
20
- success: true;
21
- data: T;
22
- };
23
-
24
- export type EdgeErrorData = { type: string } & Record<string, any>;
25
-
26
- export type EdgeHttpFailure = {
27
- // TODO(burdon): Why is this required?
28
- success: false;
29
- /**
30
- * An explanation of why the call failed. Used mostly for logging and monitoring.
31
- */
32
- reason: string;
33
- /**
34
- * Information that can be used to retry the request such that it will succeed, for example:
35
- * 1. { type: 'auth_required', challenge: string }
36
- * Requires retrying the request with challenge signature included.
37
- * 2. { type: 'user_confirmation_required', dialog: { title: string, message: string, confirmation_payload: string } }
38
- * Requires showing a confirmation dialog to a user and retrying the request with confirmation_payload included
39
- * if the user confirms.
40
- * When errorData is returned simply retrying the request won't have any effect.
41
- * EdgeHttpClient should parse well-known errorData into Error types and throw.
42
- */
43
- errorData?: EdgeErrorData;
44
- };
45
-
46
- export type EdgeHttpResponse<T> = EdgeHttpSuccess<T> | EdgeHttpFailure;
47
-
48
- export type GetNotarizationResponseBody = {
49
- awaitingNotarization: { credentials: string[] };
50
- };
51
-
52
- export type ExecuteWorkflowResponseBody = {
53
- success: boolean;
54
- reason?: string;
55
- output?: any;
56
- };
57
-
58
- export type PostNotarizationRequestBody = {
59
- credentials: string[];
60
- };
61
-
62
- export type JoinSpaceRequest = {
63
- invitationId: string;
64
- identityKey: string;
65
- /**
66
- * Base64 encoded signed challenge.
67
- * Used to verify the IdentityKey in case of `invitation.authMethod === Invitation.AuthMethod.KNOWN_PUBLIC_KEY`
68
- */
69
- signature?: string;
70
- };
71
-
72
- export type JoinSpaceResponseBody = {
73
- spaceMemberCredential: string;
74
- spaceGenesisFeedKey: string;
75
- };
76
-
77
- export type RecoverIdentitySignature =
78
- | string
79
- // This is the format of the signature from the WebAuthn authenticator.
80
- | {
81
- signature: string;
82
- clientDataJson: string;
83
- authenticatorData: string;
84
- };
85
-
86
- export type RecoverIdentityRequest = {
87
- deviceKey: string;
88
- controlFeedKey: string;
89
- lookupKey?: string;
90
- signature?: RecoverIdentitySignature;
91
- token?: string;
92
- };
93
-
94
- export type RecoverIdentityResponseBody = {
95
- identityKey: string;
96
- haloSpaceKey: string;
97
- genesisFeedKey: string;
98
- deviceAuthCredential: string;
99
- };
100
-
101
- export type CreateAgentRequestBody = {
102
- identityKey: string;
103
- haloSpaceId: SpaceId;
104
- haloSpaceKey: string;
105
- };
106
-
107
- export type CreateAgentResponseBody = {
108
- deviceKey: string;
109
- feedKey: string;
110
- };
111
-
112
- export type GetAgentStatusResponseBody = {
113
- agent: {
114
- deviceKey?: string;
115
- status: EdgeAgentStatus;
116
- };
117
- };
118
-
119
- export type UploadFunctionRequest = {
120
- name?: string;
121
- version: string;
122
- ownerPublicKey: string;
123
- entryPoint: string;
124
- assets: Record<string, Uint8Array>;
125
- };
126
-
127
- export type UploadFunctionResponseBody = {
128
- functionId: string;
129
- version: string;
130
- meta: {
131
- key?: string;
132
- name?: string;
133
- description?: string;
134
- /**
135
- * JSON Schema for the input of the function.
136
- */
137
- inputSchema?: object;
138
- /**
139
- * JSON Schema for the output of the function.
140
- */
141
- outputSchema?: object;
142
- };
143
- };
144
-
145
- export type CreateSpaceRequest = {
146
- /**
147
- * HEX encoded public key of the agent.
148
- */
149
- agentKey: string;
150
- };
151
-
152
- export type CreateSpaceResponseBody = {
153
- /**
154
- * HEX encoded public key of the space.
155
- */
156
- spaceKey: string;
157
- spaceId: SpaceId;
158
- automergeRoot: string;
159
- };
160
-
161
- export enum EdgeAgentStatus {
162
- ACTIVE = 'active',
163
- INACTIVE = 'inactive',
164
- NOT_FOUND = 'not_found',
165
- }
166
-
167
- export type EdgeAuthChallenge = {
168
- type: 'auth_challenge';
169
- challenge: string;
170
- };
171
-
172
- export enum OAuthProvider {
173
- GOOGLE = 'google',
174
- BLUESKY = 'bluesky',
175
- }
176
-
177
- export const InitiateOAuthFlowRequestSchema = Schema.Struct({
178
- provider: Schema.Enums(OAuthProvider),
179
- spaceId: Schema.String.pipe(Schema.filter(SpaceId.isValid)), // TODO(burdon): Use SpaceId.
180
- accessTokenId: Schema.String,
181
- scopes: Schema.mutable(Schema.Array(Schema.String)),
182
- // Set to true if we don't want periodic token refreshes in background, for cases like account connect
183
- noRefresh: Schema.optional(Schema.Boolean),
184
- // Provider-specific (user handle or did for bluesky) hint for auth server resolution
185
- loginHint: Schema.optional(Schema.String),
186
- });
187
- export type InitiateOAuthFlowRequest = Schema.Schema.Type<typeof InitiateOAuthFlowRequestSchema>;
188
-
189
- export type InitiateOAuthFlowResponse = {
190
- authUrl: string;
191
- };
192
-
193
- export type OAuthFlowResult =
194
- | { success: true; accessToken: string; accessTokenId: string }
195
- | { success: false; reason: string };
196
-
197
- export enum EdgeWebsocketProtocol {
198
- V0 = 'edge-ws-v0',
199
- /**
200
- * Enables message framing and muxing by service-id.
201
- */
202
- V1 = 'edge-ws-v1',
203
- }
204
-
205
- // TODO(mykola): Reconcile with type in EDGE repo.
206
- export type EdgeStatus = {
207
- problems: string[];
208
- agent: {
209
- agentStatus?: string;
210
- agentKey?: string;
211
- haloSpaceId?: SpaceId;
212
- fetchError?: string;
213
- };
214
- router: {
215
- connectedDevices?: {
216
- peerKey: string;
217
- topics: string[];
218
- }[];
219
- metrics?: {
220
- sentMessages: number;
221
- receivedMessages: number;
222
- sentBytes: number;
223
- receivedBytes: number;
224
- failedMessages: number;
225
- failedBytes: number;
226
- };
227
- fetchError?: string;
228
- };
229
- spaces: {
230
- data: Record<SpaceId, { diagnostics?: any & { redFlags: string[] }; fetchError?: string }>;
231
- fetchError?: string;
232
- };
233
- };
234
-
235
- //
236
- // Space import/export.
237
- //
238
-
239
- export type ImportBundleRequest = {
240
- bundle: {
241
- /**
242
- * DocumentId.
243
- */
244
- documentId: string;
245
- /**
246
- * Encoded mutation.
247
- */
248
- mutation: string;
249
- /**
250
- * Heads of the document.
251
- */
252
- heads: string[];
253
- }[];
254
- };
255
-
256
- export type ExportBundleRequest = {
257
- /**
258
- * DocumentId -> Heads (decoded heads since which we want to export).
259
- */
260
- docHeads: Record<string, string[]>;
261
- };
262
-
263
- export type ExportBundleResponse = {
264
- bundle: {
265
- /**
266
- * DocumentId.
267
- */
268
- documentId: string;
269
- /**
270
- * Encoded mutation.
271
- */
272
- mutation: string;
273
- }[];
274
- };
275
-
276
- export const DocumentCodec = {
277
- encode: (doc: Uint8Array) => Buffer.from(doc).toString('base64'),
278
- decode: (doc: string) => new Uint8Array(Buffer.from(doc, 'base64')),
279
- };
package/src/query.ts DELETED
@@ -1,8 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- /**
6
- * Channel name that will be used to query spaces from agent.
7
- */
8
- export const QUERY_CHANNEL = 'dxos.org/agent/plugin/query';
package/src/queue.ts DELETED
@@ -1,38 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import type { ObjectId } from './types.js';
6
-
7
- export type QueueCursor = string & { __QueueCursor: never };
8
-
9
- export type QueueQuery = {
10
- queueId: ObjectId;
11
-
12
- after?: QueueCursor;
13
- before?: QueueCursor;
14
- limit?: number;
15
- reverse?: boolean;
16
- objectIds?: ObjectId[];
17
- };
18
-
19
- // TODO(dmaretskyi): Rename QueueQueryResult.
20
- export type QueryResult = {
21
- // TODO(dmaretskyi): HasId & HasTypename.
22
-
23
- objects: unknown[];
24
-
25
- /**
26
- * Cursor at the end of the range.
27
- */
28
- nextCursor: QueueCursor | null;
29
- /**
30
- * Cursor at the start of the range.
31
- */
32
- prevCursor: QueueCursor | null;
33
- };
34
-
35
- /**
36
- * Position of an object in the queue that it is in.
37
- */
38
- export const KEY_QUEUE_POSITION = 'dxos.org/key/queue-position';
package/src/tracing.ts DELETED
@@ -1,86 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- export type Command = 'begin' | 'end' | 'update';
6
-
7
- export type TraceStatus = 'ok' | 'error';
8
-
9
- export type DataType = Record<string, any>;
10
-
11
- export type TracingContext = {
12
- span?: {
13
- id: string;
14
- command?: Command;
15
- parent?: string;
16
- status?: TraceStatus;
17
- data?: DataType;
18
- };
19
- };
20
-
21
- export type Trace = {
22
- begin: (opts: { id: string; parentId?: string; data?: DataType }) => TracingContext;
23
- end: (opts: { id: string; status?: 'ok' | 'error'; data?: DataType }) => TracingContext;
24
- update: (opts: { id: string; data: DataType }) => TracingContext;
25
- error: (opts: { id: string; error: Error; data?: DataType }) => TracingContext;
26
- };
27
-
28
- export const trace: Trace = {
29
- begin: ({ id, parentId, data }) => {
30
- return {
31
- span: {
32
- command: 'begin',
33
- id,
34
- parent: parentId,
35
- data,
36
- },
37
- };
38
- },
39
-
40
- end: ({ id, status, data }) => {
41
- return {
42
- span: {
43
- command: 'end',
44
- id,
45
- status: status ?? 'ok',
46
- data,
47
- },
48
- };
49
- },
50
-
51
- update: ({ id, data }) => {
52
- return {
53
- span: {
54
- command: 'update',
55
- id,
56
- data,
57
- },
58
- };
59
- },
60
-
61
- error: ({ id, error, data }) => {
62
- return {
63
- span: {
64
- command: 'end',
65
- id,
66
- status: 'error',
67
- data: {
68
- errorMessage: error.message,
69
- errorName: error.name,
70
- errorStack: error.stack,
71
- ...data,
72
- },
73
- },
74
- };
75
- },
76
- };
77
-
78
- //
79
- // Domain-specific tracing
80
- //
81
-
82
- export type DataPipelineProcessed = {
83
- spaceKey: string;
84
- feedKey: string;
85
- seq: number;
86
- };