@dxos/protocols 0.8.4-main.72ec0f3 → 0.8.4-main.74a063c4e0

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 (252) 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 +8 -2
  7. package/dist/src/FunctionProtocol.d.ts.map +1 -1
  8. package/dist/src/buf/proto/gen/dxos/client/queue_pb.d.ts +231 -0
  9. package/dist/src/buf/proto/gen/dxos/client/queue_pb.d.ts.map +1 -0
  10. package/dist/src/buf/proto/gen/dxos/client/queue_pb.js +44 -0
  11. package/dist/src/buf/proto/gen/dxos/client/queue_pb.js.map +1 -0
  12. package/dist/src/buf/proto/gen/dxos/client/services_pb.d.ts +33 -3
  13. package/dist/src/buf/proto/gen/dxos/client/services_pb.d.ts.map +1 -1
  14. package/dist/src/buf/proto/gen/dxos/client/services_pb.js +46 -37
  15. package/dist/src/buf/proto/gen/dxos/client/services_pb.js.map +1 -1
  16. package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.d.ts +6 -0
  17. package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.d.ts.map +1 -1
  18. package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.js +1 -1
  19. package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.js.map +1 -1
  20. package/dist/src/buf/proto/gen/dxos/echo/query_pb.d.ts +12 -2
  21. package/dist/src/buf/proto/gen/dxos/echo/query_pb.d.ts.map +1 -1
  22. package/dist/src/buf/proto/gen/dxos/echo/query_pb.js +1 -1
  23. package/dist/src/buf/proto/gen/dxos/echo/query_pb.js.map +1 -1
  24. package/dist/src/buf/proto/gen/dxos/echo/service_pb.d.ts +55 -9
  25. package/dist/src/buf/proto/gen/dxos/echo/service_pb.d.ts.map +1 -1
  26. package/dist/src/buf/proto/gen/dxos/echo/service_pb.js +15 -5
  27. package/dist/src/buf/proto/gen/dxos/echo/service_pb.js.map +1 -1
  28. package/dist/src/buf/proto/gen/dxos/edge/messenger_pb.d.ts +28 -0
  29. package/dist/src/buf/proto/gen/dxos/edge/messenger_pb.d.ts.map +1 -1
  30. package/dist/src/buf/proto/gen/dxos/edge/messenger_pb.js +10 -5
  31. package/dist/src/buf/proto/gen/dxos/edge/messenger_pb.js.map +1 -1
  32. package/dist/src/buf/proto/gen/dxos/google_pb.js +1 -1
  33. package/dist/src/buf/proto/gen/dxos/google_pb.js.map +1 -1
  34. package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.d.ts +39 -0
  35. package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.d.ts.map +1 -1
  36. package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.js +27 -2
  37. package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.js.map +1 -1
  38. package/dist/src/buf/proto/gen/dxos/iframe_pb.d.ts +1 -0
  39. package/dist/src/buf/proto/gen/dxos/iframe_pb.d.ts.map +1 -1
  40. package/dist/src/buf/proto/gen/dxos/iframe_pb.js.map +1 -1
  41. package/dist/src/buf/proto/gen/dxos/tracing_pb.js +1 -1
  42. package/dist/src/buf/proto/gen/dxos/tracing_pb.js.map +1 -1
  43. package/dist/src/codec.test.js +1 -1
  44. package/dist/src/edge/EdgeFunctionEnv.d.ts +108 -0
  45. package/dist/src/edge/EdgeFunctionEnv.d.ts.map +1 -0
  46. package/dist/src/edge/EdgeFunctionEnv.js +4 -0
  47. package/dist/src/edge/EdgeFunctionEnv.js.map +1 -0
  48. package/dist/src/{edge.d.ts → edge/edge.d.ts} +204 -26
  49. package/dist/src/edge/edge.d.ts.map +1 -0
  50. package/dist/src/{edge.js → edge/edge.js} +32 -14
  51. package/dist/src/edge/edge.js.map +1 -0
  52. package/dist/src/{edge-error.d.ts → edge/errors.d.ts} +6 -7
  53. package/dist/src/edge/errors.d.ts.map +1 -0
  54. package/dist/src/{edge-error.js → edge/errors.js} +14 -15
  55. package/dist/src/edge/errors.js.map +1 -0
  56. package/dist/src/edge/index.d.ts +4 -0
  57. package/dist/src/edge/index.d.ts.map +1 -0
  58. package/dist/src/edge/index.js +7 -0
  59. package/dist/src/edge/index.js.map +1 -0
  60. package/dist/src/errors/base-errors.d.ts +86 -8
  61. package/dist/src/errors/base-errors.d.ts.map +1 -1
  62. package/dist/src/errors/base-errors.js +4 -20
  63. package/dist/src/errors/base-errors.js.map +1 -1
  64. package/dist/src/errors/encoding.d.ts +2 -2
  65. package/dist/src/errors/encoding.d.ts.map +1 -1
  66. package/dist/src/errors/encoding.js +1 -1
  67. package/dist/src/errors/encoding.js.map +1 -1
  68. package/dist/src/errors/errors.d.ts +619 -42
  69. package/dist/src/errors/errors.d.ts.map +1 -1
  70. package/dist/src/errors/errors.js +50 -104
  71. package/dist/src/errors/errors.js.map +1 -1
  72. package/dist/src/errors/errors.test.js +2 -2
  73. package/dist/src/errors/errors.test.js.map +1 -1
  74. package/dist/src/errors/helpers.d.ts +9 -5
  75. package/dist/src/errors/helpers.d.ts.map +1 -1
  76. package/dist/src/errors/helpers.js +3 -3
  77. package/dist/src/errors/helpers.js.map +1 -1
  78. package/dist/src/errors/index.d.ts +5 -5
  79. package/dist/src/errors/index.js +5 -5
  80. package/dist/src/feed-replication.d.ts.map +1 -1
  81. package/dist/src/index.d.ts +12 -13
  82. package/dist/src/index.d.ts.map +1 -1
  83. package/dist/src/index.js +11 -12
  84. package/dist/src/index.js.map +1 -1
  85. package/dist/src/indexing.test.js +1 -1
  86. package/dist/src/messenger.d.ts +16 -0
  87. package/dist/src/messenger.d.ts.map +1 -0
  88. package/dist/src/messenger.js +4 -0
  89. package/dist/src/messenger.js.map +1 -0
  90. package/dist/src/proto/gen/dxos/client/services.d.ts +990 -852
  91. package/dist/src/proto/gen/dxos/client/services.d.ts.map +1 -1
  92. package/dist/src/proto/gen/dxos/client/services.js +95 -94
  93. package/dist/src/proto/gen/dxos/client/services.js.map +1 -1
  94. package/dist/src/proto/gen/dxos/devtools/host.d.ts +31 -31
  95. package/dist/src/proto/gen/dxos/devtools/host.d.ts.map +1 -1
  96. package/dist/src/proto/gen/dxos/echo/metadata.d.ts +4 -0
  97. package/dist/src/proto/gen/dxos/echo/metadata.d.ts.map +1 -1
  98. package/dist/src/proto/gen/dxos/echo/metadata.js.map +1 -1
  99. package/dist/src/proto/gen/dxos/echo/query.d.ts +17 -1
  100. package/dist/src/proto/gen/dxos/echo/query.d.ts.map +1 -1
  101. package/dist/src/proto/gen/dxos/echo/query.js.map +1 -1
  102. package/dist/src/proto/gen/dxos/echo/service.d.ts +34 -8
  103. package/dist/src/proto/gen/dxos/echo/service.d.ts.map +1 -1
  104. package/dist/src/proto/gen/dxos/edge/messenger.d.ts +24 -0
  105. package/dist/src/proto/gen/dxos/edge/messenger.d.ts.map +1 -1
  106. package/dist/src/proto/gen/dxos/edge/messenger.js.map +1 -1
  107. package/dist/src/proto/gen/dxos/halo/credentials.d.ts +15 -1
  108. package/dist/src/proto/gen/dxos/halo/credentials.d.ts.map +1 -1
  109. package/dist/src/proto/gen/dxos/halo/credentials.js +9 -0
  110. package/dist/src/proto/gen/dxos/halo/credentials.js.map +1 -1
  111. package/dist/src/proto/gen/google/protobuf.d.ts +326 -40
  112. package/dist/src/proto/gen/google/protobuf.d.ts.map +1 -1
  113. package/dist/src/proto/gen/google/protobuf.js +127 -1
  114. package/dist/src/proto/gen/google/protobuf.js.map +1 -1
  115. package/dist/src/proto/gen/index.d.ts +36 -0
  116. package/dist/src/proto/gen/index.d.ts.map +1 -1
  117. package/dist/src/proto/gen/index.js +1 -1
  118. package/dist/src/proto/gen/index.js.map +1 -1
  119. package/dist/src/proto/index.d.ts +2 -2
  120. package/dist/src/proto/index.js +1 -1
  121. package/dist/src/proto/types.d.ts +1 -1
  122. package/dist/src/space-archive.d.ts +60 -1
  123. package/dist/src/space-archive.d.ts.map +1 -1
  124. package/dist/src/space-archive.js +13 -1
  125. package/dist/src/space-archive.js.map +1 -1
  126. package/dist/src/types.d.ts +2 -2
  127. package/dist/tsconfig.tsbuildinfo +1 -1
  128. package/package.json +19 -15
  129. package/src/FeedProtocol.ts +320 -0
  130. package/src/FunctionProtocol.ts +8 -6
  131. package/src/buf/proto/gen/dxos/agent/dashboard_pb.ts +1 -1
  132. package/src/buf/proto/gen/dxos/agent/echo-proxy_pb.ts +1 -1
  133. package/src/buf/proto/gen/dxos/agent/epoch_pb.ts +1 -1
  134. package/src/buf/proto/gen/dxos/agent/functions_pb.ts +1 -1
  135. package/src/buf/proto/gen/dxos/bot_pb.ts +1 -1
  136. package/src/buf/proto/gen/dxos/client/invitation_pb.ts +1 -1
  137. package/src/buf/proto/gen/dxos/client/logging_pb.ts +1 -1
  138. package/src/buf/proto/gen/dxos/client/queue_pb.ts +280 -0
  139. package/src/buf/proto/gen/dxos/client/services_pb.ts +77 -40
  140. package/src/buf/proto/gen/dxos/config_pb.ts +1 -1
  141. package/src/buf/proto/gen/dxos/devtools/diagnostics_pb.ts +1 -1
  142. package/src/buf/proto/gen/dxos/devtools/host_pb.ts +1 -1
  143. package/src/buf/proto/gen/dxos/devtools/swarm_pb.ts +1 -1
  144. package/src/buf/proto/gen/dxos/echo/blob_pb.ts +1 -1
  145. package/src/buf/proto/gen/dxos/echo/feed_pb.ts +1 -1
  146. package/src/buf/proto/gen/dxos/echo/filter_pb.ts +1 -1
  147. package/src/buf/proto/gen/dxos/echo/indexing_pb.ts +1 -1
  148. package/src/buf/proto/gen/dxos/echo/metadata_pb.ts +9 -2
  149. package/src/buf/proto/gen/dxos/echo/model/document_pb.ts +1 -1
  150. package/src/buf/proto/gen/dxos/echo/model/messenger_pb.ts +1 -1
  151. package/src/buf/proto/gen/dxos/echo/model/text_pb.ts +1 -1
  152. package/src/buf/proto/gen/dxos/echo/object_pb.ts +1 -1
  153. package/src/buf/proto/gen/dxos/echo/query_pb.ts +16 -4
  154. package/src/buf/proto/gen/dxos/echo/service_pb.ts +68 -16
  155. package/src/buf/proto/gen/dxos/echo/snapshot_pb.ts +1 -1
  156. package/src/buf/proto/gen/dxos/echo/timeframe_pb.ts +1 -1
  157. package/src/buf/proto/gen/dxos/edge/calls_pb.ts +1 -1
  158. package/src/buf/proto/gen/dxos/edge/messenger_pb.ts +39 -6
  159. package/src/buf/proto/gen/dxos/edge/signal_pb.ts +1 -1
  160. package/src/buf/proto/gen/dxos/error_pb.ts +1 -1
  161. package/src/buf/proto/gen/dxos/field_options_pb.ts +1 -1
  162. package/src/buf/proto/gen/dxos/google_pb.ts +1 -1
  163. package/src/buf/proto/gen/dxos/gravity_pb.ts +1 -1
  164. package/src/buf/proto/gen/dxos/halo/credentials/auth_pb.ts +1 -1
  165. package/src/buf/proto/gen/dxos/halo/credentials/greet_pb.ts +1 -1
  166. package/src/buf/proto/gen/dxos/halo/credentials/identity_pb.ts +1 -1
  167. package/src/buf/proto/gen/dxos/halo/credentials_pb.ts +49 -3
  168. package/src/buf/proto/gen/dxos/halo/invitations_pb.ts +1 -1
  169. package/src/buf/proto/gen/dxos/halo/keyring_pb.ts +1 -1
  170. package/src/buf/proto/gen/dxos/halo/keys_pb.ts +1 -1
  171. package/src/buf/proto/gen/dxos/halo/signed_pb.ts +1 -1
  172. package/src/buf/proto/gen/dxos/iframe_pb.ts +2 -1
  173. package/src/buf/proto/gen/dxos/keys_pb.ts +1 -1
  174. package/src/buf/proto/gen/dxos/mesh/bridge_pb.ts +1 -1
  175. package/src/buf/proto/gen/dxos/mesh/broadcast_pb.ts +1 -1
  176. package/src/buf/proto/gen/dxos/mesh/messaging_pb.ts +1 -1
  177. package/src/buf/proto/gen/dxos/mesh/muxer_pb.ts +1 -1
  178. package/src/buf/proto/gen/dxos/mesh/presence_pb.ts +1 -1
  179. package/src/buf/proto/gen/dxos/mesh/protocol_pb.ts +1 -1
  180. package/src/buf/proto/gen/dxos/mesh/replicator_pb.ts +1 -1
  181. package/src/buf/proto/gen/dxos/mesh/signal_pb.ts +1 -1
  182. package/src/buf/proto/gen/dxos/mesh/swarm_pb.ts +1 -1
  183. package/src/buf/proto/gen/dxos/mesh/teleport/admission-discovery_pb.ts +1 -1
  184. package/src/buf/proto/gen/dxos/mesh/teleport/auth_pb.ts +1 -1
  185. package/src/buf/proto/gen/dxos/mesh/teleport/automerge_pb.ts +1 -1
  186. package/src/buf/proto/gen/dxos/mesh/teleport/blobsync_pb.ts +1 -1
  187. package/src/buf/proto/gen/dxos/mesh/teleport/control_pb.ts +1 -1
  188. package/src/buf/proto/gen/dxos/mesh/teleport/gossip_pb.ts +1 -1
  189. package/src/buf/proto/gen/dxos/mesh/teleport/notarization_pb.ts +1 -1
  190. package/src/buf/proto/gen/dxos/mesh/teleport/replicator_pb.ts +1 -1
  191. package/src/buf/proto/gen/dxos/registry_pb.ts +1 -1
  192. package/src/buf/proto/gen/dxos/rpc_pb.ts +1 -1
  193. package/src/buf/proto/gen/dxos/service/agentmanager_pb.ts +1 -1
  194. package/src/buf/proto/gen/dxos/service/publisher_pb.ts +1 -1
  195. package/src/buf/proto/gen/dxos/service/supervisor_pb.ts +1 -1
  196. package/src/buf/proto/gen/dxos/service/tunnel_pb.ts +1 -1
  197. package/src/buf/proto/gen/dxos/tracing_pb.ts +1 -1
  198. package/src/buf/proto/gen/dxos/type_pb.ts +1 -1
  199. package/src/buf/proto/gen/dxos/value_pb.ts +1 -1
  200. package/src/buf/proto/gen/example/testing/data_pb.ts +1 -1
  201. package/src/buf/proto/gen/example/testing/rpc_pb.ts +1 -1
  202. package/src/codec.test.ts +1 -1
  203. package/src/edge/EdgeFunctionEnv.ts +187 -0
  204. package/src/{edge.ts → edge/edge.ts} +166 -39
  205. package/src/{edge-error.ts → edge/errors.ts} +15 -16
  206. package/src/edge/index.ts +7 -0
  207. package/src/errors/base-errors.ts +4 -22
  208. package/src/errors/encoding.ts +2 -3
  209. package/src/errors/errors.test.ts +2 -2
  210. package/src/errors/errors.ts +57 -124
  211. package/src/errors/helpers.ts +6 -7
  212. package/src/errors/index.ts +5 -5
  213. package/src/feed-replication.ts +1 -0
  214. package/src/index.ts +12 -13
  215. package/src/indexing.test.ts +1 -1
  216. package/src/messenger.ts +22 -0
  217. package/src/proto/dxos/client/queue.proto +78 -0
  218. package/src/proto/dxos/client/services.proto +9 -1
  219. package/src/proto/dxos/config.proto +1 -1
  220. package/src/proto/dxos/echo/metadata.proto +3 -0
  221. package/src/proto/dxos/echo/query.proto +4 -1
  222. package/src/proto/dxos/echo/service.proto +27 -6
  223. package/src/proto/dxos/edge/messenger.proto +10 -0
  224. package/src/proto/dxos/halo/credentials.proto +15 -0
  225. package/src/proto/dxos/iframe.proto +1 -0
  226. package/src/proto/gen/dxos/client/services.ts +990 -852
  227. package/src/proto/gen/dxos/devtools/host.ts +31 -31
  228. package/src/proto/gen/dxos/echo/metadata.ts +4 -0
  229. package/src/proto/gen/dxos/echo/query.ts +17 -1
  230. package/src/proto/gen/dxos/echo/service.ts +33 -8
  231. package/src/proto/gen/dxos/edge/messenger.ts +24 -0
  232. package/src/proto/gen/dxos/halo/credentials.ts +15 -1
  233. package/src/proto/gen/google/protobuf.ts +326 -40
  234. package/src/proto/gen/index.ts +37 -1
  235. package/src/proto/index.ts +2 -2
  236. package/src/proto/types.ts +1 -1
  237. package/src/space-archive.ts +70 -1
  238. package/src/types.ts +2 -2
  239. package/dist/src/edge-error.d.ts.map +0 -1
  240. package/dist/src/edge-error.js.map +0 -1
  241. package/dist/src/edge.d.ts.map +0 -1
  242. package/dist/src/edge.js.map +0 -1
  243. package/dist/src/query.d.ts +0 -5
  244. package/dist/src/query.d.ts.map +0 -1
  245. package/dist/src/query.js +0 -8
  246. package/dist/src/query.js.map +0 -1
  247. package/dist/src/queue.d.ts +0 -37
  248. package/dist/src/queue.d.ts.map +0 -1
  249. package/dist/src/queue.js +0 -8
  250. package/dist/src/queue.js.map +0 -1
  251. package/src/query.ts +0 -8
  252. package/src/queue.ts +0 -51
@@ -2,7 +2,7 @@
2
2
  // Copyright 2020 DXOS.org
3
3
  //
4
4
 
5
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
5
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
6
6
  // @generated from file dxos/mesh/muxer.proto (package dxos.mesh.muxer, syntax proto3)
7
7
  /* eslint-disable */
8
8
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2021 DXOS.org
3
3
  //
4
4
 
5
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
5
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
6
6
  // @generated from file dxos/mesh/presence.proto (package dxos.mesh.presence, syntax proto3)
7
7
  /* eslint-disable */
8
8
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2021 DXOS.org
3
3
  //
4
4
 
5
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
5
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
6
6
  // @generated from file dxos/mesh/protocol.proto (package dxos.mesh.protocol, syntax proto3)
7
7
  /* eslint-disable */
8
8
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2019 DXOS.org
3
3
  //
4
4
 
5
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
5
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
6
6
  // @generated from file dxos/mesh/replicator.proto (package dxos.mesh.replicator, syntax proto3)
7
7
  /* eslint-disable */
8
8
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
5
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
6
6
  // @generated from file dxos/mesh/signal.proto (package dxos.mesh.signal, syntax proto3)
7
7
  /* eslint-disable */
8
8
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
5
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
6
6
  // @generated from file dxos/mesh/swarm.proto (package dxos.mesh.swarm, syntax proto3)
7
7
  /* eslint-disable */
8
8
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
5
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
6
6
  // @generated from file dxos/mesh/teleport/admission-discovery.proto (package dxos.mesh.teleport, syntax proto3)
7
7
  /* eslint-disable */
8
8
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
5
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
6
6
  // @generated from file dxos/mesh/teleport/auth.proto (package dxos.mesh.teleport.auth, syntax proto3)
7
7
  /* eslint-disable */
8
8
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
5
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
6
6
  // @generated from file dxos/mesh/teleport/automerge.proto (package dxos.mesh.teleport.automerge, syntax proto3)
7
7
  /* eslint-disable */
8
8
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
5
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
6
6
  // @generated from file dxos/mesh/teleport/blobsync.proto (package dxos.mesh.teleport.blobsync, syntax proto3)
7
7
  /* eslint-disable */
8
8
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
5
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
6
6
  // @generated from file dxos/mesh/teleport/control.proto (package dxos.mesh.teleport.control, syntax proto3)
7
7
  /* eslint-disable */
8
8
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
5
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
6
6
  // @generated from file dxos/mesh/teleport/gossip.proto (package dxos.mesh.teleport.gossip, syntax proto3)
7
7
  /* eslint-disable */
8
8
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
5
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
6
6
  // @generated from file dxos/mesh/teleport/notarization.proto (package dxos.mesh.teleport.notarization, syntax proto3)
7
7
  /* eslint-disable */
8
8
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
5
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
6
6
  // @generated from file dxos/mesh/teleport/replicator.proto (package dxos.mesh.teleport.replicator, syntax proto3)
7
7
  /* eslint-disable */
8
8
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2021 DXOS.org
3
3
  //
4
4
 
5
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
5
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
6
6
  // @generated from file dxos/registry.proto (package dxos.registry, syntax proto3)
7
7
  /* eslint-disable */
8
8
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2020 DXOS.org
3
3
  //
4
4
 
5
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
5
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
6
6
  // @generated from file dxos/rpc.proto (package dxos.rpc, syntax proto3)
7
7
  /* eslint-disable */
8
8
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
5
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
6
6
  // @generated from file dxos/service/agentmanager.proto (package dxos.service.agentmanager, syntax proto3)
7
7
  /* eslint-disable */
8
8
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
5
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
6
6
  // @generated from file dxos/service/publisher.proto (package dxos.service.publisher, syntax proto3)
7
7
  /* eslint-disable */
8
8
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
5
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
6
6
  // @generated from file dxos/service/supervisor.proto (package dxos.service.supervisor, syntax proto3)
7
7
  /* eslint-disable */
8
8
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
5
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
6
6
  // @generated from file dxos/service/tunnel.proto (package dxos.service.tunnel, syntax proto3)
7
7
  /* eslint-disable */
8
8
 
@@ -1,4 +1,4 @@
1
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
1
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
2
2
  // @generated from file dxos/tracing.proto (package dxos.tracing, syntax proto3)
3
3
  /* eslint-disable */
4
4
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
5
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
6
6
  // @generated from file dxos/type.proto (package dxos.type, syntax proto3)
7
7
  /* eslint-disable */
8
8
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2021 DXOS.org
3
3
  //
4
4
 
5
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
5
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
6
6
  // @generated from file dxos/value.proto (package dxos.value, syntax proto3)
7
7
  /* eslint-disable */
8
8
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2020 DXOS.org
3
3
  //
4
4
 
5
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
5
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
6
6
  // @generated from file example/testing/data.proto (package example.testing.data, syntax proto3)
7
7
  /* eslint-disable */
8
8
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2020 DXOS.org
3
3
  //
4
4
 
5
- // @generated by protoc-gen-es v2.9.0 with parameter "target=ts,import_extension=js"
5
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=js"
6
6
  // @generated from file example/testing/rpc.proto (package example.testing.rpc, syntax proto3)
7
7
  /* eslint-disable */
8
8
 
package/src/codec.test.ts CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { describe, expect, test } from 'vitest';
6
6
 
7
- import { schema } from './proto/index.js';
7
+ import { schema } from './proto/index.ts';
8
8
 
9
9
  describe('Codec', () => {
10
10
  test('encodes and decodes messages', async () => {
@@ -0,0 +1,187 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type SpaceId } from '@dxos/keys';
6
+
7
+ import type * as FeedProtocol from '../FeedProtocol';
8
+ import { type QueryRequest, type QueryResponse } from '../proto/gen/dxos/echo/query';
9
+ import { type CreateDocumentRequest, type CreateDocumentResponse } from '../proto/gen/dxos/echo/service';
10
+
11
+ /*
12
+
13
+ API for the edge functions service.
14
+ A function module should be a valid cloudflare worker module.
15
+
16
+ # Fetching metadata (done on deploy)
17
+
18
+ GET http://functions.dxos.internal/
19
+ X-DXOS-Function-Route: meta
20
+
21
+ Expected to return `FunctionMetadata` in JSON:
22
+
23
+ {
24
+ key: string;
25
+ name?: string;
26
+ description?: string;
27
+ inputSchema?: JsonSchemaType;
28
+ outputSchema?: JsonSchemaType;
29
+ }
30
+
31
+ # Invoking the function
32
+
33
+ POST http://functions.dxos.internal/
34
+ Content-Type: application/json
35
+ X-Trace-Queue-Dxn: dxn:queue:trace:AAAAAA:BBBBBB
36
+ X-Invocation-Id: XXXXXXX
37
+ X-Edge-Env: production
38
+
39
+ {input_data}
40
+
41
+ Expected to return `EdgeEnvelope` with the output data:
42
+
43
+ {
44
+ success: true,
45
+ data: unknown
46
+ }
47
+
48
+ On Error returns `EdgeEnvelope` with error:
49
+
50
+ {
51
+ success: false,
52
+ message: string
53
+ error: EncodedError
54
+ }
55
+
56
+ */
57
+
58
+ /**
59
+ * Environment available to the function running on Cloudflare.
60
+ */
61
+ export interface Env {
62
+ QUEUE_SERVICE: QueueService;
63
+ DATA_SERVICE: DataService;
64
+ FUNCTIONS_AI_SERVICE: FunctionsAiService;
65
+ }
66
+
67
+ /**
68
+ * Use to trace the execution across multiple services.
69
+ *
70
+ * NOTE: Currently unused in functions.
71
+ */
72
+ export interface TraceContext {}
73
+
74
+ /**
75
+ * Database API for other CF services like functions.
76
+ */
77
+ export interface DataService {
78
+ getSpaceMeta(ctx: TraceContext, spaceId: SpaceId): Promise<RpcResult<SpaceMeta | undefined>>;
79
+ getDocument(ctx: TraceContext, spaceId: SpaceId, documentId: string): Promise<RpcResult<RawDocument | undefined>>;
80
+
81
+ execQuery(ctx: TraceContext, request: QueryRequest): Promise<RpcResult<QueryResponse>>;
82
+ createDocument(ctx: TraceContext, request: CreateDocumentRequest): Promise<RpcResult<CreateDocumentResponse>>;
83
+
84
+ // TODO(burdon): Update? Return DocumentEntry?
85
+ changeDocument(ctx: TraceContext, spaceId: SpaceId, documentId: string, changes: Uint8Array): Promise<void>;
86
+ }
87
+
88
+ export interface QueueService {
89
+ queryQueue: (
90
+ ctx: TraceContext,
91
+ request: FeedProtocol.QueryQueueRequest,
92
+ ) => Promise<RpcResult<FeedProtocol.QueryResult>>;
93
+ insertIntoQueue: (
94
+ ctx: TraceContext,
95
+ request: FeedProtocol.InsertIntoQueueRequest,
96
+ ) => Promise<RpcResult<RpcDisposable>>;
97
+ deleteFromQueue: (
98
+ ctx: TraceContext,
99
+ request: FeedProtocol.DeleteFromQueueRequest,
100
+ ) => Promise<RpcResult<RpcDisposable>>;
101
+ }
102
+
103
+ /**
104
+ * FunctionsAiService API for other CF services like functions.
105
+ */
106
+ export interface FunctionsAiService {
107
+ /**
108
+ * Enables proxying HTTP requests to the AI service from other workers.
109
+ */
110
+ fetch(request: Request): Promise<RpcResult<Response>>;
111
+ }
112
+
113
+ export type ObjectDocumentJson = {
114
+ type?: string;
115
+ objectId: string;
116
+ documentId: string;
117
+ /** Base64 encoding of a document. */
118
+ document: string;
119
+ };
120
+
121
+ export type SpaceMeta = {
122
+ spaceKey: string;
123
+ rootDocumentId: string;
124
+ };
125
+
126
+ /**
127
+ * TODO(yaroslav): make Indexer return EchoObject after create() can properly reconstruct an object
128
+ * from this structure (meta, id and type aren't handled properly)
129
+ */
130
+ export type ObjectSnapshot = {
131
+ type?: string;
132
+ documentId: string;
133
+ objectId: string;
134
+ // TODO(mykola): Use ObjectStructure from @dxos/echo-protocol.
135
+ object: unknown;
136
+ };
137
+
138
+ export type ObjectReference = {
139
+ fromId: string;
140
+ toId: string;
141
+ fieldName: string;
142
+ };
143
+
144
+ export type QueryDocumentsResponse = {
145
+ results: RawObject[];
146
+ cursor?: string;
147
+ };
148
+
149
+ export type RawDocument = {
150
+ documentId: string;
151
+ data: Uint8Array;
152
+ };
153
+
154
+ export type RawObject = {
155
+ type?: string;
156
+ objectId: string;
157
+ document: RawDocument;
158
+ };
159
+
160
+ export type QueryReferencesRequest = {
161
+ spaceId: string;
162
+ objectId: string;
163
+ referenceType: 'from' | 'to';
164
+ };
165
+
166
+ export type QueryReferencesResponse = {
167
+ references: ObjectReference[];
168
+ };
169
+
170
+ /**
171
+ * Cloudflare Workers RPC returns objects/arrays/stubs that may need to be explicitly disposed.
172
+ *
173
+ * See: https://developers.cloudflare.com/workers/runtime-apis/rpc/lifecycle/
174
+ */
175
+ export interface RpcDisposable {
176
+ /**
177
+ * Disposes the RPC stub / returned value and releases any server-side resources it references.
178
+ */
179
+ [Symbol.dispose](): void;
180
+ }
181
+
182
+ /**
183
+ * Wraps a return type so that any non-primitive value is marked as disposable.
184
+ *
185
+ * This models Workers RPC behavior where any returned object (including arrays) gets a disposer added.
186
+ */
187
+ export type RpcResult<T> = T extends object ? T & RpcDisposable : T;