@dxos/protocols 0.8.4-staging.ac66bdf99f → 0.9.1-main.c7dcc2e112

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 (372) hide show
  1. package/LICENSE +102 -5
  2. package/dist/src/Config2.d.ts +91 -0
  3. package/dist/src/Config2.d.ts.map +1 -0
  4. package/dist/src/Config2.js +56 -0
  5. package/dist/src/Config2.js.map +1 -0
  6. package/dist/src/FeedProtocol.d.ts +5 -5
  7. package/dist/src/FeedProtocol.d.ts.map +1 -1
  8. package/dist/src/FeedProtocol.js.map +1 -1
  9. package/dist/src/FunctionProtocol.d.ts +7 -0
  10. package/dist/src/FunctionProtocol.d.ts.map +1 -1
  11. package/dist/src/TraceProtocol.d.ts +15 -0
  12. package/dist/src/TraceProtocol.d.ts.map +1 -0
  13. package/dist/src/TraceProtocol.js +4 -0
  14. package/dist/src/TraceProtocol.js.map +1 -0
  15. package/dist/src/automerge.d.ts +203 -13
  16. package/dist/src/automerge.d.ts.map +1 -1
  17. package/dist/src/automerge.js +17 -0
  18. package/dist/src/automerge.js.map +1 -1
  19. package/dist/src/buf/proto/gen/dxos/client/invitation_pb.d.ts +16 -4
  20. package/dist/src/buf/proto/gen/dxos/client/invitation_pb.d.ts.map +1 -1
  21. package/dist/src/buf/proto/gen/dxos/client/invitation_pb.js +17 -5
  22. package/dist/src/buf/proto/gen/dxos/client/invitation_pb.js.map +1 -1
  23. package/dist/src/buf/proto/gen/dxos/client/queue_pb.d.ts +74 -0
  24. package/dist/src/buf/proto/gen/dxos/client/queue_pb.d.ts.map +1 -1
  25. package/dist/src/buf/proto/gen/dxos/client/queue_pb.js +16 -1
  26. package/dist/src/buf/proto/gen/dxos/client/queue_pb.js.map +1 -1
  27. package/dist/src/buf/proto/gen/dxos/client/services_pb.d.ts +14 -0
  28. package/dist/src/buf/proto/gen/dxos/client/services_pb.d.ts.map +1 -1
  29. package/dist/src/buf/proto/gen/dxos/client/services_pb.js +1 -1
  30. package/dist/src/buf/proto/gen/dxos/client/services_pb.js.map +1 -1
  31. package/dist/src/buf/proto/gen/dxos/config_pb.d.ts +6 -0
  32. package/dist/src/buf/proto/gen/dxos/config_pb.d.ts.map +1 -1
  33. package/dist/src/buf/proto/gen/dxos/config_pb.js +1 -1
  34. package/dist/src/buf/proto/gen/dxos/config_pb.js.map +1 -1
  35. package/dist/src/buf/proto/gen/dxos/devtools/host_pb.d.ts +70 -0
  36. package/dist/src/buf/proto/gen/dxos/devtools/host_pb.d.ts.map +1 -1
  37. package/dist/src/buf/proto/gen/dxos/devtools/host_pb.js +16 -1
  38. package/dist/src/buf/proto/gen/dxos/devtools/host_pb.js.map +1 -1
  39. package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.d.ts +6 -0
  40. package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.d.ts.map +1 -1
  41. package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.js +1 -1
  42. package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.js.map +1 -1
  43. package/dist/src/buf/proto/gen/dxos/echo/service_pb.d.ts +17 -2
  44. package/dist/src/buf/proto/gen/dxos/echo/service_pb.d.ts.map +1 -1
  45. package/dist/src/buf/proto/gen/dxos/echo/service_pb.js +1 -1
  46. package/dist/src/buf/proto/gen/dxos/echo/service_pb.js.map +1 -1
  47. package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.d.ts +26 -0
  48. package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.d.ts.map +1 -1
  49. package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.js +26 -21
  50. package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.js.map +1 -1
  51. package/dist/src/buf/proto/gen/dxos/halo/invitations_pb.d.ts +11 -4
  52. package/dist/src/buf/proto/gen/dxos/halo/invitations_pb.d.ts.map +1 -1
  53. package/dist/src/buf/proto/gen/dxos/halo/invitations_pb.js +12 -5
  54. package/dist/src/buf/proto/gen/dxos/halo/invitations_pb.js.map +1 -1
  55. package/dist/src/codec.test.js +1 -1
  56. package/dist/src/edge/EdgeFunctionEnv.d.ts +27 -1
  57. package/dist/src/edge/EdgeFunctionEnv.d.ts.map +1 -1
  58. package/dist/src/edge/edge.d.ts +272 -3
  59. package/dist/src/edge/edge.d.ts.map +1 -1
  60. package/dist/src/edge/edge.js +157 -2
  61. package/dist/src/edge/edge.js.map +1 -1
  62. package/dist/src/edge/edge.test.d.ts +2 -0
  63. package/dist/src/edge/edge.test.d.ts.map +1 -0
  64. package/dist/src/edge/edge.test.js +50 -0
  65. package/dist/src/edge/edge.test.js.map +1 -0
  66. package/dist/src/edge/errors.d.ts.map +1 -1
  67. package/dist/src/edge/errors.js +1 -1
  68. package/dist/src/edge/errors.js.map +1 -1
  69. package/dist/src/edge/index.js +4 -4
  70. package/dist/src/edge/registry.d.ts +248 -76
  71. package/dist/src/edge/registry.d.ts.map +1 -1
  72. package/dist/src/edge/registry.js +151 -52
  73. package/dist/src/edge/registry.js.map +1 -1
  74. package/dist/src/errors/base-errors.d.ts +18 -18
  75. package/dist/src/errors/base-errors.d.ts.map +1 -1
  76. package/dist/src/errors/encoding.d.ts +1 -1
  77. package/dist/src/errors/encoding.d.ts.map +1 -1
  78. package/dist/src/errors/encoding.js +1 -1
  79. package/dist/src/errors/encoding.js.map +1 -1
  80. package/dist/src/errors/errors.d.ts +132 -132
  81. package/dist/src/errors/errors.d.ts.map +1 -1
  82. package/dist/src/errors/errors.js +1 -1
  83. package/dist/src/errors/errors.test.js +1 -1
  84. package/dist/src/errors/helpers.d.ts +2 -2
  85. package/dist/src/errors/helpers.d.ts.map +1 -1
  86. package/dist/src/errors/index.js +5 -5
  87. package/dist/src/errors/parameter.d.ts.map +1 -1
  88. package/dist/src/index.d.ts +2 -1
  89. package/dist/src/index.d.ts.map +1 -1
  90. package/dist/src/index.js +12 -11
  91. package/dist/src/index.js.map +1 -1
  92. package/dist/src/indexing.d.ts.map +1 -1
  93. package/dist/src/indexing.test.js +1 -1
  94. package/dist/src/invitation.js +3 -3
  95. package/dist/src/invitation.js.map +1 -1
  96. package/dist/src/profile-archive.d.ts +14 -1
  97. package/dist/src/profile-archive.d.ts.map +1 -1
  98. package/dist/src/profile-archive.js +2 -0
  99. package/dist/src/profile-archive.js.map +1 -1
  100. package/dist/src/proto/gen/dxos/agent/dashboard.d.ts +3 -6
  101. package/dist/src/proto/gen/dxos/agent/dashboard.d.ts.map +1 -1
  102. package/dist/src/proto/gen/dxos/agent/dashboard.js.map +1 -1
  103. package/dist/src/proto/gen/dxos/agent/echoproxy.d.ts +1 -2
  104. package/dist/src/proto/gen/dxos/agent/echoproxy.d.ts.map +1 -1
  105. package/dist/src/proto/gen/dxos/agent/epoch.d.ts +1 -2
  106. package/dist/src/proto/gen/dxos/agent/epoch.d.ts.map +1 -1
  107. package/dist/src/proto/gen/dxos/agent/functions.d.ts +6 -12
  108. package/dist/src/proto/gen/dxos/agent/functions.d.ts.map +1 -1
  109. package/dist/src/proto/gen/dxos/bot.d.ts +12 -24
  110. package/dist/src/proto/gen/dxos/bot.d.ts.map +1 -1
  111. package/dist/src/proto/gen/dxos/bot.js.map +1 -1
  112. package/dist/src/proto/gen/dxos/client/services.d.ts +121 -150
  113. package/dist/src/proto/gen/dxos/client/services.d.ts.map +1 -1
  114. package/dist/src/proto/gen/dxos/client/services.js +4 -2
  115. package/dist/src/proto/gen/dxos/client/services.js.map +1 -1
  116. package/dist/src/proto/gen/dxos/config.d.ts +58 -102
  117. package/dist/src/proto/gen/dxos/config.d.ts.map +1 -1
  118. package/dist/src/proto/gen/dxos/config.js.map +1 -1
  119. package/dist/src/proto/gen/dxos/devtools/host.d.ts +78 -96
  120. package/dist/src/proto/gen/dxos/devtools/host.d.ts.map +1 -1
  121. package/dist/src/proto/gen/dxos/devtools/swarm.d.ts +4 -8
  122. package/dist/src/proto/gen/dxos/devtools/swarm.d.ts.map +1 -1
  123. package/dist/src/proto/gen/dxos/echo/blob.d.ts +1 -2
  124. package/dist/src/proto/gen/dxos/echo/blob.d.ts.map +1 -1
  125. package/dist/src/proto/gen/dxos/echo/blob.js.map +1 -1
  126. package/dist/src/proto/gen/dxos/echo/feed.d.ts +4 -8
  127. package/dist/src/proto/gen/dxos/echo/feed.d.ts.map +1 -1
  128. package/dist/src/proto/gen/dxos/echo/filter.d.ts +2 -4
  129. package/dist/src/proto/gen/dxos/echo/filter.d.ts.map +1 -1
  130. package/dist/src/proto/gen/dxos/echo/filter.js.map +1 -1
  131. package/dist/src/proto/gen/dxos/echo/indexing.d.ts +2 -4
  132. package/dist/src/proto/gen/dxos/echo/indexing.d.ts.map +1 -1
  133. package/dist/src/proto/gen/dxos/echo/indexing.js.map +1 -1
  134. package/dist/src/proto/gen/dxos/echo/metadata.d.ts +12 -16
  135. package/dist/src/proto/gen/dxos/echo/metadata.d.ts.map +1 -1
  136. package/dist/src/proto/gen/dxos/echo/metadata.js.map +1 -1
  137. package/dist/src/proto/gen/dxos/echo/model/document.d.ts +11 -22
  138. package/dist/src/proto/gen/dxos/echo/model/document.d.ts.map +1 -1
  139. package/dist/src/proto/gen/dxos/echo/model/document.js.map +1 -1
  140. package/dist/src/proto/gen/dxos/echo/model/messenger.d.ts +1 -2
  141. package/dist/src/proto/gen/dxos/echo/model/messenger.d.ts.map +1 -1
  142. package/dist/src/proto/gen/dxos/echo/model/text.d.ts +2 -4
  143. package/dist/src/proto/gen/dxos/echo/model/text.d.ts.map +1 -1
  144. package/dist/src/proto/gen/dxos/echo/object.d.ts +6 -12
  145. package/dist/src/proto/gen/dxos/echo/object.d.ts.map +1 -1
  146. package/dist/src/proto/gen/dxos/echo/object.js.map +1 -1
  147. package/dist/src/proto/gen/dxos/echo/query.d.ts +4 -8
  148. package/dist/src/proto/gen/dxos/echo/query.d.ts.map +1 -1
  149. package/dist/src/proto/gen/dxos/echo/query.js.map +1 -1
  150. package/dist/src/proto/gen/dxos/echo/service.d.ts +36 -35
  151. package/dist/src/proto/gen/dxos/echo/service.d.ts.map +1 -1
  152. package/dist/src/proto/gen/dxos/echo/snapshot.d.ts +2 -4
  153. package/dist/src/proto/gen/dxos/echo/snapshot.d.ts.map +1 -1
  154. package/dist/src/proto/gen/dxos/echo/timeframe.d.ts +2 -4
  155. package/dist/src/proto/gen/dxos/echo/timeframe.d.ts.map +1 -1
  156. package/dist/src/proto/gen/dxos/edge/calls.d.ts +5 -10
  157. package/dist/src/proto/gen/dxos/edge/calls.d.ts.map +1 -1
  158. package/dist/src/proto/gen/dxos/edge/messenger.d.ts +6 -12
  159. package/dist/src/proto/gen/dxos/edge/messenger.d.ts.map +1 -1
  160. package/dist/src/proto/gen/dxos/edge/messenger.js.map +1 -1
  161. package/dist/src/proto/gen/dxos/edge/signal.d.ts +7 -14
  162. package/dist/src/proto/gen/dxos/edge/signal.d.ts.map +1 -1
  163. package/dist/src/proto/gen/dxos/error.d.ts +1 -2
  164. package/dist/src/proto/gen/dxos/error.d.ts.map +1 -1
  165. package/dist/src/proto/gen/dxos/gravity.d.ts +10 -20
  166. package/dist/src/proto/gen/dxos/gravity.d.ts.map +1 -1
  167. package/dist/src/proto/gen/dxos/halo/credentials/auth.d.ts +1 -2
  168. package/dist/src/proto/gen/dxos/halo/credentials/auth.d.ts.map +1 -1
  169. package/dist/src/proto/gen/dxos/halo/credentials/greet.d.ts +6 -12
  170. package/dist/src/proto/gen/dxos/halo/credentials/greet.d.ts.map +1 -1
  171. package/dist/src/proto/gen/dxos/halo/credentials/greet.js.map +1 -1
  172. package/dist/src/proto/gen/dxos/halo/credentials/identity.d.ts +2 -4
  173. package/dist/src/proto/gen/dxos/halo/credentials/identity.d.ts.map +1 -1
  174. package/dist/src/proto/gen/dxos/halo/credentials.d.ts +34 -44
  175. package/dist/src/proto/gen/dxos/halo/credentials.d.ts.map +1 -1
  176. package/dist/src/proto/gen/dxos/halo/credentials.js.map +1 -1
  177. package/dist/src/proto/gen/dxos/halo/invitations.d.ts +16 -28
  178. package/dist/src/proto/gen/dxos/halo/invitations.d.ts.map +1 -1
  179. package/dist/src/proto/gen/dxos/halo/invitations.js +3 -2
  180. package/dist/src/proto/gen/dxos/halo/invitations.js.map +1 -1
  181. package/dist/src/proto/gen/dxos/halo/keyring.d.ts +1 -2
  182. package/dist/src/proto/gen/dxos/halo/keyring.d.ts.map +1 -1
  183. package/dist/src/proto/gen/dxos/halo/keys.d.ts +2 -4
  184. package/dist/src/proto/gen/dxos/halo/keys.d.ts.map +1 -1
  185. package/dist/src/proto/gen/dxos/halo/signed.d.ts +4 -8
  186. package/dist/src/proto/gen/dxos/halo/signed.d.ts.map +1 -1
  187. package/dist/src/proto/gen/dxos/iframe.d.ts +4 -8
  188. package/dist/src/proto/gen/dxos/iframe.d.ts.map +1 -1
  189. package/dist/src/proto/gen/dxos/iframe.js.map +1 -1
  190. package/dist/src/proto/gen/dxos/keys.d.ts +2 -4
  191. package/dist/src/proto/gen/dxos/keys.d.ts.map +1 -1
  192. package/dist/src/proto/gen/dxos/mesh/bridge.d.ts +12 -24
  193. package/dist/src/proto/gen/dxos/mesh/bridge.d.ts.map +1 -1
  194. package/dist/src/proto/gen/dxos/mesh/broadcast.d.ts +1 -2
  195. package/dist/src/proto/gen/dxos/mesh/broadcast.d.ts.map +1 -1
  196. package/dist/src/proto/gen/dxos/mesh/messaging.d.ts +2 -4
  197. package/dist/src/proto/gen/dxos/mesh/messaging.d.ts.map +1 -1
  198. package/dist/src/proto/gen/dxos/mesh/muxer.d.ts +5 -10
  199. package/dist/src/proto/gen/dxos/mesh/muxer.d.ts.map +1 -1
  200. package/dist/src/proto/gen/dxos/mesh/presence.d.ts +1 -2
  201. package/dist/src/proto/gen/dxos/mesh/presence.d.ts.map +1 -1
  202. package/dist/src/proto/gen/dxos/mesh/protocol.d.ts +3 -6
  203. package/dist/src/proto/gen/dxos/mesh/protocol.d.ts.map +1 -1
  204. package/dist/src/proto/gen/dxos/mesh/replicator.d.ts +2 -4
  205. package/dist/src/proto/gen/dxos/mesh/replicator.d.ts.map +1 -1
  206. package/dist/src/proto/gen/dxos/mesh/signal.d.ts +9 -18
  207. package/dist/src/proto/gen/dxos/mesh/signal.d.ts.map +1 -1
  208. package/dist/src/proto/gen/dxos/mesh/signal.js.map +1 -1
  209. package/dist/src/proto/gen/dxos/mesh/swarm.d.ts +6 -12
  210. package/dist/src/proto/gen/dxos/mesh/swarm.d.ts.map +1 -1
  211. package/dist/src/proto/gen/dxos/mesh/teleport/auth.d.ts +2 -4
  212. package/dist/src/proto/gen/dxos/mesh/teleport/auth.d.ts.map +1 -1
  213. package/dist/src/proto/gen/dxos/mesh/teleport/automerge.d.ts +2 -4
  214. package/dist/src/proto/gen/dxos/mesh/teleport/automerge.d.ts.map +1 -1
  215. package/dist/src/proto/gen/dxos/mesh/teleport/blobsync.d.ts +3 -6
  216. package/dist/src/proto/gen/dxos/mesh/teleport/blobsync.d.ts.map +1 -1
  217. package/dist/src/proto/gen/dxos/mesh/teleport/control.d.ts +3 -6
  218. package/dist/src/proto/gen/dxos/mesh/teleport/control.d.ts.map +1 -1
  219. package/dist/src/proto/gen/dxos/mesh/teleport/gossip.d.ts +1 -2
  220. package/dist/src/proto/gen/dxos/mesh/teleport/gossip.d.ts.map +1 -1
  221. package/dist/src/proto/gen/dxos/mesh/teleport/notarization.d.ts +1 -2
  222. package/dist/src/proto/gen/dxos/mesh/teleport/notarization.d.ts.map +1 -1
  223. package/dist/src/proto/gen/dxos/mesh/teleport/replicator.d.ts +5 -10
  224. package/dist/src/proto/gen/dxos/mesh/teleport/replicator.d.ts.map +1 -1
  225. package/dist/src/proto/gen/dxos/mesh/teleport.d.ts +2 -4
  226. package/dist/src/proto/gen/dxos/mesh/teleport.d.ts.map +1 -1
  227. package/dist/src/proto/gen/dxos/registry.d.ts +3 -6
  228. package/dist/src/proto/gen/dxos/registry.d.ts.map +1 -1
  229. package/dist/src/proto/gen/dxos/rpc.d.ts +7 -14
  230. package/dist/src/proto/gen/dxos/rpc.d.ts.map +1 -1
  231. package/dist/src/proto/gen/dxos/rpc.js.map +1 -1
  232. package/dist/src/proto/gen/dxos/service/agentmanager.d.ts +4 -8
  233. package/dist/src/proto/gen/dxos/service/agentmanager.d.ts.map +1 -1
  234. package/dist/src/proto/gen/dxos/service/agentmanager.js.map +1 -1
  235. package/dist/src/proto/gen/dxos/service/publisher.d.ts +5 -10
  236. package/dist/src/proto/gen/dxos/service/publisher.d.ts.map +1 -1
  237. package/dist/src/proto/gen/dxos/service/supervisor.d.ts +12 -24
  238. package/dist/src/proto/gen/dxos/service/supervisor.d.ts.map +1 -1
  239. package/dist/src/proto/gen/dxos/service/supervisor.js.map +1 -1
  240. package/dist/src/proto/gen/dxos/service/tunnel.d.ts +3 -6
  241. package/dist/src/proto/gen/dxos/service/tunnel.d.ts.map +1 -1
  242. package/dist/src/proto/gen/dxos/tracing.d.ts +10 -20
  243. package/dist/src/proto/gen/dxos/tracing.d.ts.map +1 -1
  244. package/dist/src/proto/gen/dxos/type.d.ts +12 -24
  245. package/dist/src/proto/gen/dxos/type.d.ts.map +1 -1
  246. package/dist/src/proto/gen/dxos/value.d.ts +2 -4
  247. package/dist/src/proto/gen/dxos/value.d.ts.map +1 -1
  248. package/dist/src/proto/gen/example/testing/data.d.ts +4 -8
  249. package/dist/src/proto/gen/example/testing/data.d.ts.map +1 -1
  250. package/dist/src/proto/gen/example/testing/rpc.d.ts +7 -14
  251. package/dist/src/proto/gen/example/testing/rpc.d.ts.map +1 -1
  252. package/dist/src/proto/gen/google/protobuf.d.ts +27 -27
  253. package/dist/src/proto/gen/google/protobuf.d.ts.map +1 -1
  254. package/dist/src/proto/gen/google/protobuf.js.map +1 -1
  255. package/dist/src/proto/gen/index.d.ts +7 -0
  256. package/dist/src/proto/gen/index.d.ts.map +1 -1
  257. package/dist/src/proto/gen/index.js +1 -1
  258. package/dist/src/proto/gen/index.js.map +1 -1
  259. package/dist/src/proto/index.js +1 -1
  260. package/dist/src/proto/substitutions.d.ts +8 -8
  261. package/dist/src/proto/substitutions.d.ts.map +1 -1
  262. package/dist/src/space-archive.d.ts +5 -5
  263. package/dist/src/space-archive.d.ts.map +1 -1
  264. package/dist/tsconfig.tsbuildinfo +1 -1
  265. package/package.json +14 -32
  266. package/src/Config2.ts +68 -0
  267. package/src/FeedProtocol.ts +3 -0
  268. package/src/FunctionProtocol.ts +9 -0
  269. package/src/TraceProtocol.ts +21 -0
  270. package/src/automerge.ts +239 -13
  271. package/src/buf/proto/gen/dxos/client/invitation_pb.ts +19 -5
  272. package/src/buf/proto/gen/dxos/client/queue_pb.ts +88 -1
  273. package/src/buf/proto/gen/dxos/client/services_pb.ts +16 -1
  274. package/src/buf/proto/gen/dxos/config_pb.ts +8 -1
  275. package/src/buf/proto/gen/dxos/devtools/host_pb.ts +82 -1
  276. package/src/buf/proto/gen/dxos/echo/metadata_pb.ts +8 -1
  277. package/src/buf/proto/gen/dxos/echo/service_pb.ts +19 -3
  278. package/src/buf/proto/gen/dxos/halo/credentials_pb.ts +52 -21
  279. package/src/buf/proto/gen/dxos/halo/invitations_pb.ts +13 -5
  280. package/src/edge/EdgeFunctionEnv.ts +40 -3
  281. package/src/edge/edge.test.ts +64 -0
  282. package/src/edge/edge.ts +281 -5
  283. package/src/edge/registry.ts +170 -61
  284. package/src/index.ts +2 -1
  285. package/src/invitation.ts +3 -3
  286. package/src/lexicons/org.dxos.experimental/README.md +29 -0
  287. package/src/lexicons/org.dxos.experimental/package.profile.json +87 -0
  288. package/src/lexicons/org.dxos.experimental/package.release.json +45 -0
  289. package/src/lexicons/org.dxos.experimental/publisher.profile.json +37 -0
  290. package/src/lexicons/org.dxos.experimental/publisher.verification.json +36 -0
  291. package/src/profile-archive.ts +13 -0
  292. package/src/proto/dxos/client/invitation.proto +9 -2
  293. package/src/proto/dxos/client/queue.proto +21 -0
  294. package/src/proto/dxos/client/services.proto +4 -0
  295. package/src/proto/dxos/config.proto +2 -0
  296. package/src/proto/dxos/devtools/host.proto +27 -0
  297. package/src/proto/dxos/echo/metadata.proto +3 -0
  298. package/src/proto/dxos/echo/service.proto +14 -1
  299. package/src/proto/dxos/halo/credentials.proto +9 -0
  300. package/src/proto/dxos/halo/invitations.proto +5 -2
  301. package/src/proto/gen/dxos/agent/dashboard.ts +3 -6
  302. package/src/proto/gen/dxos/agent/echoproxy.ts +1 -2
  303. package/src/proto/gen/dxos/agent/epoch.ts +1 -2
  304. package/src/proto/gen/dxos/agent/functions.ts +6 -12
  305. package/src/proto/gen/dxos/bot.ts +12 -24
  306. package/src/proto/gen/dxos/client/services.ts +121 -150
  307. package/src/proto/gen/dxos/config.ts +58 -102
  308. package/src/proto/gen/dxos/devtools/host.ts +78 -96
  309. package/src/proto/gen/dxos/devtools/swarm.ts +4 -8
  310. package/src/proto/gen/dxos/echo/blob.ts +1 -2
  311. package/src/proto/gen/dxos/echo/feed.ts +4 -8
  312. package/src/proto/gen/dxos/echo/filter.ts +2 -4
  313. package/src/proto/gen/dxos/echo/indexing.ts +2 -4
  314. package/src/proto/gen/dxos/echo/metadata.ts +12 -16
  315. package/src/proto/gen/dxos/echo/model/document.ts +11 -22
  316. package/src/proto/gen/dxos/echo/model/messenger.ts +1 -2
  317. package/src/proto/gen/dxos/echo/model/text.ts +2 -4
  318. package/src/proto/gen/dxos/echo/object.ts +6 -12
  319. package/src/proto/gen/dxos/echo/query.ts +4 -8
  320. package/src/proto/gen/dxos/echo/service.ts +36 -35
  321. package/src/proto/gen/dxos/echo/snapshot.ts +2 -4
  322. package/src/proto/gen/dxos/echo/timeframe.ts +2 -4
  323. package/src/proto/gen/dxos/edge/calls.ts +5 -10
  324. package/src/proto/gen/dxos/edge/messenger.ts +6 -12
  325. package/src/proto/gen/dxos/edge/signal.ts +7 -14
  326. package/src/proto/gen/dxos/error.ts +1 -2
  327. package/src/proto/gen/dxos/gravity.ts +10 -20
  328. package/src/proto/gen/dxos/halo/credentials/auth.ts +1 -2
  329. package/src/proto/gen/dxos/halo/credentials/greet.ts +6 -12
  330. package/src/proto/gen/dxos/halo/credentials/identity.ts +2 -4
  331. package/src/proto/gen/dxos/halo/credentials.ts +34 -44
  332. package/src/proto/gen/dxos/halo/invitations.ts +16 -28
  333. package/src/proto/gen/dxos/halo/keyring.ts +1 -2
  334. package/src/proto/gen/dxos/halo/keys.ts +2 -4
  335. package/src/proto/gen/dxos/halo/signed.ts +4 -8
  336. package/src/proto/gen/dxos/iframe.ts +4 -8
  337. package/src/proto/gen/dxos/keys.ts +2 -4
  338. package/src/proto/gen/dxos/mesh/bridge.ts +12 -24
  339. package/src/proto/gen/dxos/mesh/broadcast.ts +1 -2
  340. package/src/proto/gen/dxos/mesh/messaging.ts +2 -4
  341. package/src/proto/gen/dxos/mesh/muxer.ts +5 -10
  342. package/src/proto/gen/dxos/mesh/presence.ts +1 -2
  343. package/src/proto/gen/dxos/mesh/protocol.ts +3 -6
  344. package/src/proto/gen/dxos/mesh/replicator.ts +2 -4
  345. package/src/proto/gen/dxos/mesh/signal.ts +9 -18
  346. package/src/proto/gen/dxos/mesh/swarm.ts +6 -12
  347. package/src/proto/gen/dxos/mesh/teleport/auth.ts +2 -4
  348. package/src/proto/gen/dxos/mesh/teleport/automerge.ts +2 -4
  349. package/src/proto/gen/dxos/mesh/teleport/blobsync.ts +3 -6
  350. package/src/proto/gen/dxos/mesh/teleport/control.ts +3 -6
  351. package/src/proto/gen/dxos/mesh/teleport/gossip.ts +1 -2
  352. package/src/proto/gen/dxos/mesh/teleport/notarization.ts +1 -2
  353. package/src/proto/gen/dxos/mesh/teleport/replicator.ts +5 -10
  354. package/src/proto/gen/dxos/mesh/teleport.ts +2 -4
  355. package/src/proto/gen/dxos/registry.ts +3 -6
  356. package/src/proto/gen/dxos/rpc.ts +7 -14
  357. package/src/proto/gen/dxos/service/agentmanager.ts +4 -8
  358. package/src/proto/gen/dxos/service/publisher.ts +5 -10
  359. package/src/proto/gen/dxos/service/supervisor.ts +12 -24
  360. package/src/proto/gen/dxos/service/tunnel.ts +3 -6
  361. package/src/proto/gen/dxos/tracing.ts +10 -20
  362. package/src/proto/gen/dxos/type.ts +12 -24
  363. package/src/proto/gen/dxos/value.ts +2 -4
  364. package/src/proto/gen/example/testing/data.ts +4 -8
  365. package/src/proto/gen/example/testing/rpc.ts +7 -14
  366. package/src/proto/gen/google/protobuf.ts +27 -27
  367. package/src/proto/gen/index.ts +8 -1
  368. package/dist/src/tracing.d.ts +0 -40
  369. package/dist/src/tracing.d.ts.map +0 -1
  370. package/dist/src/tracing.js +0 -50
  371. package/dist/src/tracing.js.map +0 -1
  372. package/src/tracing.ts +0 -86
package/src/edge/edge.ts CHANGED
@@ -13,10 +13,16 @@ import { SpaceId } from '@dxos/keys';
13
13
  */
14
14
  export const EDGE_CLIENT_TAG_HEADER = 'X-DXOS-Client-Tag';
15
15
 
16
+ /**
17
+ * HTTP header sent on every Edge request to provide a BYOK (Bring Your Own Key) for AI services.
18
+ */
19
+ export const BYOK_HEADER = 'X-BYOK';
20
+
16
21
  // TODO(burdon): Rename EdgerRouterEndpoint.
17
22
  // If we would rename it, we need to be careful to not break composer production.
18
23
  export enum EdgeService {
19
24
  AUTOMERGE_REPLICATOR = 'automerge-replicator',
25
+ SUBDUCTION_REPLICATOR = 'subduction-replicator',
20
26
  /**
21
27
  * Control feed replicator (hypercore append only logs) for the space.
22
28
  */
@@ -216,6 +222,12 @@ export type RecoverIdentityRequest = {
216
222
  lookupKey?: string;
217
223
  signature?: RecoverIdentitySignature;
218
224
  token?: string;
225
+ /**
226
+ * One-time proof minted by kms-service after a successful OAuth recovery flow.
227
+ * When provided, db-service redeems the proof to obtain the bound identityKey directly
228
+ * and `lookupKey`/`signature` are not required.
229
+ */
230
+ recoveryProof?: string;
219
231
  };
220
232
 
221
233
  export type RecoverIdentityResponseBody = {
@@ -314,10 +326,22 @@ export type EdgeAuthChallenge = {
314
326
  };
315
327
 
316
328
  export enum OAuthProvider {
317
- GOOGLE = 'google',
329
+ ATLASSIAN = 'atlassian',
330
+ ATPROTO = 'atproto',
331
+ /** @deprecated Use ATPROTO instead. */
318
332
  BLUESKY = 'bluesky',
333
+ DISCORD = 'discord',
334
+ GITHUB = 'github',
335
+ GOOGLE = 'google',
336
+ LINEAR = 'linear',
337
+ NOTION = 'notion',
338
+ SLACK = 'slack',
339
+ TRELLO = 'trello',
319
340
  }
320
341
 
342
+ /** atproto OAuth scopes for the Atmosphere integration and account-recovery flows. */
343
+ export const ATPROTO_OAUTH_SCOPES = ['atproto', 'transition:generic', 'transition:email'] as const;
344
+
321
345
  export const InitiateOAuthFlowRequestSchema = Schema.Struct({
322
346
  provider: Schema.Enums(OAuthProvider),
323
347
  spaceId: Schema.String.pipe(Schema.filter(SpaceId.isValid)), // TODO(burdon): Use SpaceId.
@@ -325,8 +349,17 @@ export const InitiateOAuthFlowRequestSchema = Schema.Struct({
325
349
  scopes: Schema.mutable(Schema.Array(Schema.String)),
326
350
  // Set to true if we don't want periodic token refreshes in background, for cases like account connect
327
351
  noRefresh: Schema.optional(Schema.Boolean),
328
- // Provider-specific (user handle or did for bluesky) hint for auth server resolution
352
+ // Provider-specific (user handle or did for atproto) hint for auth server resolution
329
353
  loginHint: Schema.optional(Schema.String),
354
+ // Return a 302 redirect to composer://oauth/callback instead of HTML.
355
+ // Required for ASWebAuthenticationSession (iOS) which blocks JavaScript redirects.
356
+ nativeAppRedirect: Schema.optional(Schema.Boolean),
357
+ // OAuth-based account recovery: when purpose === 'register', kms-service writes a
358
+ // recovery binding for `identityKey` after the OAuth flow completes; when 'recovery',
359
+ // kms-service mints a one-time `recoveryProof` the client forwards to db-service.
360
+ registerRecovery: Schema.optional(Schema.Boolean),
361
+ identityKey: Schema.optional(Schema.String),
362
+ purpose: Schema.optional(Schema.Literal('register', 'recovery')),
330
363
  });
331
364
  export type InitiateOAuthFlowRequest = Schema.Schema.Type<typeof InitiateOAuthFlowRequestSchema>;
332
365
 
@@ -335,9 +368,29 @@ export type InitiateOAuthFlowResponse = {
335
368
  };
336
369
 
337
370
  export type OAuthFlowResult =
338
- | { success: true; accessToken: string; accessTokenId: string }
371
+ | { success: true; accessToken: string; accessTokenId: string; recoveryProof?: string }
339
372
  | { success: false; reason: string };
340
373
 
374
+ /**
375
+ * Completes OAuth recovery registration for an existing identity: routes the OAuth refresh token
376
+ * into the personal space and writes the recovery binding.
377
+ */
378
+ export type CompleteOAuthRegistrationRequest = {
379
+ registrationToken: string;
380
+ identityKey: string;
381
+ spaceKey: string;
382
+ };
383
+
384
+ export type CompleteOAuthRegistrationResponse = {
385
+ email?: string;
386
+ provider: OAuthProvider;
387
+ accessTokenId: string;
388
+ accessToken: string;
389
+ expiresInSeconds: number;
390
+ scopes: string[];
391
+ identifier: string;
392
+ };
393
+
341
394
  export enum EdgeWebsocketProtocol {
342
395
  V0 = 'edge-ws-v0',
343
396
  /**
@@ -543,7 +596,7 @@ export type InspectSpaceResponse = {
543
596
  objectCount: number;
544
597
  deletedObjectCount: number;
545
598
  indexedDocumentCount: number;
546
- objectsByType: { typeDxn: string; count: number }[];
599
+ objectsByType: { typeURI: string; count: number }[];
547
600
  indexerStatus: {
548
601
  indexingInProgress: boolean;
549
602
  cursors: { indexName: string; sourceName: string; resourceId: string | null; cursor: string | number }[];
@@ -571,7 +624,7 @@ export type InspectIdentityResponse = {
571
624
  spaces: InspectSpaceResponse[];
572
625
  };
573
626
 
574
- /** Matches the SerializedSpace format from @dxos/echo-db, extended with spaceId. */
627
+ /** Matches the SerializedSpace format from @dxos/echo-client, extended with spaceId. */
575
628
  export type SpaceExportPayload = {
576
629
  version: number;
577
630
  timestamp: string;
@@ -602,3 +655,226 @@ export type DeleteSpaceResponse = { status: string; spaceId: string };
602
655
 
603
656
  export type DeleteIdentityRequest = { identityKey: string };
604
657
  export type DeleteIdentityResponse = { status: string; identityKey: string };
658
+
659
+ //
660
+ // Account / Invitation
661
+ //
662
+
663
+ export const INVITATION_CODE_LENGTH = 8;
664
+ export const DEFAULT_INVITATIONS_PER_ACCOUNT = 5;
665
+
666
+ /** Crockford base32 alphabet (no I, L, O, U). Case-insensitive on the wire. */
667
+ export const INVITATION_CODE_ALPHABET = '0123456789ABCDEFGHJKMNPQRSTVWXYZ';
668
+
669
+ export const InvitationCodeSchema = Schema.String.pipe(
670
+ Schema.pattern(new RegExp(`^[${INVITATION_CODE_ALPHABET}]{${INVITATION_CODE_LENGTH}}$`)),
671
+ );
672
+
673
+ export const CheckEmailExistsRequestSchema = Schema.Struct({
674
+ email: Schema.String,
675
+ });
676
+ export type CheckEmailExistsRequest = Schema.Schema.Type<typeof CheckEmailExistsRequestSchema>;
677
+ export type CheckEmailExistsResponse = { exists: boolean };
678
+
679
+ export const ValidateInvitationCodeRequestSchema = Schema.Struct({
680
+ code: InvitationCodeSchema,
681
+ });
682
+ export type ValidateInvitationCodeRequest = Schema.Schema.Type<typeof ValidateInvitationCodeRequestSchema>;
683
+ export type ValidateInvitationCodeResponse = { valid: boolean };
684
+
685
+ /**
686
+ * Body of `POST /account/login`. Existing-account email recovery only --
687
+ * unlike `/account/signup`, this never creates new identities or waitlist rows.
688
+ */
689
+ export const LoginRequestSchema = Schema.Struct({
690
+ email: Schema.String,
691
+ identityDid: Schema.optional(Schema.String),
692
+ identityKey: Schema.optional(Schema.String),
693
+ });
694
+ export type LoginRequest = Schema.Schema.Type<typeof LoginRequestSchema>;
695
+
696
+ /**
697
+ * Response from `POST /account/login`. The shape is identical regardless of
698
+ * whether the email is registered, so the endpoint is safe against enumeration.
699
+ * Regular emails are delivered out-of-band and the response is `{}`.
700
+ */
701
+ export const LoginResponseSchema = Schema.Struct({
702
+ token: Schema.optional(Schema.String),
703
+ needsIdentity: Schema.optional(Schema.Boolean),
704
+ admitted: Schema.optional(Schema.Boolean),
705
+ });
706
+ export type LoginResponse = Schema.Schema.Type<typeof LoginResponseSchema>;
707
+
708
+ // Two-step signup: invitation code + identity DID + email.
709
+ export const RedeemInvitationCodeRequestSchema = Schema.Struct({
710
+ code: Schema.optional(InvitationCodeSchema),
711
+ identityDid: Schema.optional(Schema.String),
712
+ /** Raw hex public key, stored alongside the DID for the magic-link recovery flow. */
713
+ identityKey: Schema.optional(Schema.String),
714
+ email: Schema.String,
715
+ });
716
+ export type RedeemInvitationCodeRequest = Schema.Schema.Type<typeof RedeemInvitationCodeRequestSchema>;
717
+ export type RedeemInvitationCodeResponse =
718
+ | { accountId: string; emailVerificationSent: boolean }
719
+ | { needsIdentity: true };
720
+
721
+ export const GetAccountResponseSchema = Schema.Struct({
722
+ identityDid: Schema.String,
723
+ email: Schema.String,
724
+ emailVerified: Schema.Boolean,
725
+ /** ISO timestamp. */
726
+ createdAt: Schema.String,
727
+ invitationsRemaining: Schema.Number,
728
+ });
729
+ export type GetAccountResponse = Schema.Schema.Type<typeof GetAccountResponseSchema>;
730
+
731
+ export const AccountInvitationSchema = Schema.Struct({
732
+ code: Schema.String,
733
+ /** ISO timestamp. */
734
+ createdAt: Schema.String,
735
+ redeemedByIdentityDid: Schema.optional(Schema.String),
736
+ /** ISO timestamp. */
737
+ redeemedAt: Schema.optional(Schema.String),
738
+ });
739
+ export type AccountInvitation = Schema.Schema.Type<typeof AccountInvitationSchema>;
740
+
741
+ export const ListAccountInvitationsResponseSchema = Schema.Struct({
742
+ invitations: Schema.Array(AccountInvitationSchema),
743
+ });
744
+ export type ListAccountInvitationsResponse = Schema.Schema.Type<typeof ListAccountInvitationsResponseSchema>;
745
+
746
+ export type IssueInvitationResponse = { code: string };
747
+
748
+ export type ResendVerificationEmailResponse = {
749
+ sent: boolean;
750
+ cooldownSecondsRemaining?: number;
751
+ };
752
+
753
+ /**
754
+ * Submitted by users without an Account who want to request access. Captured
755
+ * by Hub for admin follow-up (e.g. mailing list, Discord notification).
756
+ */
757
+ export const RequestAccessRequestSchema = Schema.Struct({
758
+ email: Schema.String,
759
+ /** Optional: identity DID the user is currently signed in as. */
760
+ identityDid: Schema.optional(Schema.String),
761
+ /** Optional free-form message from the requester. */
762
+ message: Schema.optional(Schema.String),
763
+ });
764
+ export type RequestAccessRequest = Schema.Schema.Type<typeof RequestAccessRequestSchema>;
765
+ export type RequestAccessResponse = { received: boolean };
766
+
767
+ //
768
+ // Metering (VP auth)
769
+ //
770
+
771
+ /** Structured usage key aligned with {@link MeteringLimitSchema} (without cap/window fields). */
772
+ export const MeteringUsageKeySchema = Schema.Struct({
773
+ /** Event type (e.g. `ai`). */
774
+ eventType: Schema.String,
775
+ /** Value key being metered (e.g. `outputTokens`). */
776
+ valueKey: Schema.String,
777
+ /**
778
+ * Positional match against the event's subtype segments (e.g. model); `*` matches any
779
+ * segment, and positions beyond the pattern are unconstrained.
780
+ */
781
+ subtypePattern: Schema.Array(Schema.String),
782
+ });
783
+ export type MeteringUsageKey = Schema.Schema.Type<typeof MeteringUsageKeySchema>;
784
+
785
+ /** Rolling-window usage total for a structured key. */
786
+ export const MeteringUsageItemSchema = Schema.Struct({
787
+ ...MeteringUsageKeySchema.fields,
788
+ amount: Schema.Number,
789
+ });
790
+ export type MeteringUsageItem = Schema.Schema.Type<typeof MeteringUsageItemSchema>;
791
+
792
+ /** A single raw usage bucket (1h resolution) for a structured key. */
793
+ export const MeteringUsageBucketSchema = Schema.Struct({
794
+ ...MeteringUsageKeySchema.fields,
795
+ /** Bucket start timestamp (epoch ms, floored to the hour). */
796
+ bucketStart: Schema.Number,
797
+ amount: Schema.Number,
798
+ });
799
+ export type MeteringUsageBucket = Schema.Schema.Type<typeof MeteringUsageBucketSchema>;
800
+
801
+ export const MeteringLimitSchema = Schema.Struct({
802
+ /** Event type the limit applies to (e.g. `ai`). */
803
+ eventType: Schema.String,
804
+ /** Value key being limited (e.g. `outputTokens`). */
805
+ valueKey: Schema.String,
806
+ /**
807
+ * Positional match against the event's subtype segments (e.g. model); `*` matches any
808
+ * segment, and positions beyond the pattern are unconstrained.
809
+ */
810
+ subtypePattern: Schema.Array(Schema.String),
811
+ /** Rolling-window cap; `null` means unlimited. */
812
+ limit: Schema.NullOr(Schema.Number),
813
+ /** Window duration in seconds. */
814
+ windowDuration: Schema.Number,
815
+ });
816
+ export type MeteringLimit = Schema.Schema.Type<typeof MeteringLimitSchema>;
817
+
818
+ export const GetProfileUsageResponseSchema = Schema.Struct({
819
+ profileId: Schema.String,
820
+ usage: Schema.Array(MeteringUsageItemSchema),
821
+ limits: Schema.Array(MeteringLimitSchema),
822
+ buckets: Schema.Array(MeteringUsageBucketSchema),
823
+ });
824
+ export type GetProfileUsageResponse = Schema.Schema.Type<typeof GetProfileUsageResponseSchema>;
825
+
826
+ //
827
+ // Admin (X-API-KEY)
828
+ //
829
+
830
+ export type AdminListAccountsResponse = {
831
+ accounts: GetAccountResponse[];
832
+ };
833
+
834
+ export const AdminGrantInvitationsRequestSchema = Schema.Struct({
835
+ identityDid: Schema.String,
836
+ count: Schema.Number,
837
+ });
838
+ export type AdminGrantInvitationsRequest = Schema.Schema.Type<typeof AdminGrantInvitationsRequestSchema>;
839
+
840
+ export const AdminCreateInvitationCodesRequestSchema = Schema.Struct({
841
+ count: Schema.Number,
842
+ note: Schema.optional(Schema.String),
843
+ });
844
+ export type AdminCreateInvitationCodesRequest = Schema.Schema.Type<typeof AdminCreateInvitationCodesRequestSchema>;
845
+ export type AdminCreateInvitationCodesResponse = { codes: string[] };
846
+
847
+ export type AdminListInvitationCodesResponse = {
848
+ codes: Array<{
849
+ code: string;
850
+ /** ISO timestamp. */
851
+ createdAt: string;
852
+ note?: string;
853
+ issuedByIdentityDid?: string;
854
+ redeemedByIdentityDid?: string;
855
+ /** ISO timestamp. */
856
+ redeemedAt?: string;
857
+ /** ISO timestamp. Set when revoked. */
858
+ revokedAt?: string;
859
+ }>;
860
+ };
861
+
862
+ export const AdminRevokeInvitationCodeRequestSchema = Schema.Struct({
863
+ code: InvitationCodeSchema,
864
+ });
865
+ export type AdminRevokeInvitationCodeRequest = Schema.Schema.Type<typeof AdminRevokeInvitationCodeRequestSchema>;
866
+
867
+ /**
868
+ * Account/invitation-related variants placed in `EdgeFailure.data.type`.
869
+ * EdgeErrorData is open-ended; these are documentation for known values.
870
+ */
871
+ export type AccountErrorType =
872
+ | 'invitation_code_invalid'
873
+ | 'invitation_code_already_redeemed'
874
+ | 'invitation_code_revoked'
875
+ | 'email_already_registered'
876
+ | 'identity_already_associated'
877
+ | 'no_invitations_remaining'
878
+ | 'identity_not_associated_with_account'
879
+ | 'no_account'
880
+ | 'rate_limited';
@@ -4,93 +4,202 @@
4
4
 
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
+ import * as Config2 from '../Config2.ts';
8
+
7
9
  /**
8
- * Hydrated plugin metadata, mirroring the @dxos/app-framework `Plugin.Meta` shape.
9
- *
10
- * Defined locally rather than imported from @dxos/app-framework to keep the protocols
11
- * package free of UI/runtime dependencies. Consumers can treat decoded values as
12
- * `Plugin.Meta` directly.
10
+ * A snapshot of a plugin's declared dependencies resolved to concrete installed versions at build
11
+ * time (`{ "@dxos/app-framework": "0.8.3", "react": "19.2.0", … }`). The host derives SDK
12
+ * compatibility from the subset it shares with the plugin (the externalized `@dxos/*` packages).
13
13
  */
14
- export const PluginMetaSchema = Schema.Struct({
15
- id: Schema.String.pipe(Schema.nonEmptyString()),
16
- name: Schema.String.pipe(Schema.nonEmptyString()),
17
- description: Schema.optional(Schema.String),
18
- homePage: Schema.optional(Schema.String),
19
- source: Schema.optional(Schema.String),
20
- screenshots: Schema.optional(Schema.Array(Schema.String)),
21
- tags: Schema.optional(Schema.Array(Schema.String)),
22
- icon: Schema.optional(Schema.String),
23
- iconHue: Schema.optional(Schema.String),
24
- });
25
- export type PluginMeta = Schema.Schema.Type<typeof PluginMetaSchema>;
14
+ export const DependencyMapSchema = Schema.Record({ key: Schema.String, value: Schema.String });
15
+ export type DependencyMap = Schema.Schema.Type<typeof DependencyMapSchema>;
26
16
 
27
17
  /**
28
- * Health signal the registry service attaches to a hydrated entry when a refresh fails.
29
- * Clients surface the appropriate badge or filter entries based on this field.
18
+ * Filename of the entry module every plugin must publish at the root of its bundle.
19
+ * The host dynamic-imports `<manifest URL base>/index.mjs` directly no per-plugin
20
+ * configuration. `composerPlugin` outputs the bundle under this name so plugin authors
21
+ * never have to think about it.
30
22
  */
31
- export const PluginHealthSchema = Schema.Literal('ok', 'release-missing', 'manifest-invalid', 'repo-unavailable');
32
- export type PluginHealth = Schema.Schema.Type<typeof PluginHealthSchema>;
23
+ export const PLUGIN_ENTRY_FILENAME = 'index.mjs';
33
24
 
34
25
  /**
35
26
  * Shape of the manifest-asset JSON the registry service fetches from each plugin's latest release.
36
- * Extends {@link PluginMetaSchema} with an optional override for the module bundle filename
37
- * (defaults to `plugin.mjs`).
27
+ *
28
+ * Emitted by `@dxos/app-framework/vite-plugin`'s `composerPlugin` (see
29
+ * `MANIFEST_ASSET_NAME`). Lists every file the plugin needs at runtime — the entry
30
+ * module ({@link PLUGIN_ENTRY_FILENAME}) plus any sibling CSS, code-split chunks,
31
+ * fonts, etc. — so the host can eagerly precache the whole bundle for offline use.
32
+ * Paths in `assets` are relative to the manifest's URL.
38
33
  */
39
34
  export const PluginManifestSchema = Schema.Struct({
40
- ...PluginMetaSchema.fields,
41
- moduleFile: Schema.optional(Schema.String),
35
+ ...Config2.Plugin.fields,
36
+ /** Plugin version (semver). Sourced from the publishing project's `package.json`. */
37
+ version: Schema.String.pipe(Schema.nonEmptyString()),
38
+ /**
39
+ * Relative paths of every file the plugin needs at runtime, including the entry.
40
+ * Must include {@link PLUGIN_ENTRY_FILENAME}; consumers verify on parse.
41
+ */
42
+ assets: Schema.Array(Schema.String).pipe(Schema.minItems(1)),
43
+ /** Declared dependencies resolved to installed versions at build time (SDK-compat source). */
44
+ dependencies: Schema.optional(DependencyMapSchema),
42
45
  });
43
46
  export type PluginManifest = Schema.Schema.Type<typeof PluginManifestSchema>;
44
47
 
48
+ // ─── ATProto-native registry view ────────────────────────────────────────────
49
+
45
50
  /**
46
- * Single hydrated plugin entry returned by the registry service.
51
+ * A single installable release of a plugin, projected from a `package.release`
52
+ * ATProto record.
47
53
  */
48
- export const PluginEntrySchema = Schema.Struct({
49
- /** GitHub repository in `owner/name` form. */
50
- repo: Schema.String.pipe(Schema.nonEmptyString()),
51
- /** Plugin metadata from the repo's latest-release `manifest.json`. */
52
- meta: PluginMetaSchema,
54
+ export const PluginReleaseSchema = Schema.Struct({
55
+ /** Semver version string, e.g. `0.8.3`. */
56
+ version: Schema.String.pipe(Schema.nonEmptyString()),
57
+ /** URL the host dynamic-imports to install this specific version. */
58
+ moduleUrl: Schema.String.pipe(Schema.nonEmptyString()),
53
59
  /**
54
- * URL from which Composer can dynamic-import the plugin module. The registry service is
55
- * responsible for returning a URL that is CORS-safe for browser `import()` (e.g. served or
56
- * proxied by the service itself); clients pass this value directly to the URL loader.
60
+ * Dependencies this release was built against, resolved to installed versions. The host derives
61
+ * SDK compatibility from the `@dxos/*` subset to decide whether to offer this release.
57
62
  */
58
- moduleUrl: Schema.String,
59
- /** Release tag the entry was resolved from (e.g. `v0.1.0`). */
60
- releaseTag: Schema.String,
61
- /** Health signal set by the service when an entry fails to refresh. */
62
- health: PluginHealthSchema,
63
- /** Unix ms when this entry was last successfully hydrated. */
64
- hydratedAt: Schema.Number,
63
+ dependencies: Schema.optional(DependencyMapSchema),
65
64
  });
66
- export type PluginEntry = Schema.Schema.Type<typeof PluginEntrySchema>;
65
+ export type PluginRelease = Schema.Schema.Type<typeof PluginReleaseSchema>;
66
+
67
+ /**
68
+ * Verbatim content of a `package.profile` ATProto record. `key` is the record's rkey (a reverse-domain
69
+ * NSID), denormalized into the body. Version-independent identity + display metadata; provenance
70
+ * (`author`) is resolved separately from the publisher DID/handle.
71
+ */
72
+ export const PluginProfileSchema = Schema.Struct({
73
+ /** Reverse-domain NSID — the plugin's globally-unique key and the `package.profile` rkey (e.g. `org.dxos.plugin.excalidraw`). */
74
+ key: Schema.String.pipe(Schema.nonEmptyString()),
75
+ /** Plugin display name. */
76
+ name: Schema.String.pipe(Schema.nonEmptyString()),
77
+ /** Short description of plugin functionality. */
78
+ description: Schema.optional(Schema.String),
79
+ /** Publisher's homepage or plugin documentation URL. */
80
+ homePage: Schema.optional(Schema.String),
81
+ /** Source repository URL. */
82
+ source: Schema.optional(Schema.String),
83
+ /** Tags to help categorize the plugin. */
84
+ tags: Schema.optional(Schema.Array(Schema.String)),
85
+ /** Preview images — theme-keyed screenshot URLs shown on the plugin's card. */
86
+ screenshots: Schema.optional(Schema.Array(Config2.Screenshot)),
87
+ /** Icon identifier resolvable by `@ch-ui/icons` (e.g. `ph--sparkle--regular`), with an optional palette hue. */
88
+ icon: Schema.optional(Config2.Icon),
89
+ /** Composer plugin ids this plugin depends on at runtime (NSIDs). Author-declared, version-independent. */
90
+ dependsOn: Schema.optional(Schema.Array(Schema.String)),
91
+ /** Relative path inside the package to a bundled MDL spec (consumed by plugin-code). */
92
+ spec: Schema.optional(Schema.String),
93
+ });
94
+ export type PluginProfile = Schema.Schema.Type<typeof PluginProfileSchema>;
95
+
96
+ /**
97
+ * A single hydrated plugin entry returned by `GET /registry/plugins`.
98
+ *
99
+ * This is an indexer-assembled *view* — analogous to emdash's `PackageView` — projected
100
+ * from four ATProto record types: `package.profile`, `package.release`,
101
+ * `publisher.profile`, and `publisher.verification`. It is NOT a direct serialization
102
+ * of any single ATProto record.
103
+ *
104
+ * Design notes:
105
+ * - `profile.key` is required to be a valid NSID (e.g. `org.dxos.plugin.excalidraw`), making it
106
+ * the single identifier for both PDS addressing and the composer runtime plugin id.
107
+ * `DXN.make(profile.key, latestVersion)` reconstructs the canonical plugin DXN.
108
+ * - `releases` inlines all known versions, eliminating a separate versions round-trip for
109
+ * the version picker. Ordered newest-first.
110
+ * - `latestVersion` is a convenience pointer into `releases` indicating the recommended
111
+ * install target.
112
+ */
113
+ export const PluginViewSchema = Schema.Struct({
114
+ // ── Addressing / provenance (indexer-derived) ────────────────────────────
115
+ /**
116
+ * `at://` URI of the source `package.profile` record.
117
+ * Globally unique and stable — never changes after the record is published.
118
+ */
119
+ uri: Schema.String.pipe(Schema.nonEmptyString()),
120
+ /** Publisher DID, e.g. `did:plc:abc…`. Cryptographic identity; never changes. */
121
+ did: Schema.String.pipe(Schema.nonEmptyString()),
122
+ /**
123
+ * Publisher AT Protocol handle at index time, e.g. `alice.bsky.social`.
124
+ * Display-only — handles can be reassigned; never use as a stable key.
125
+ */
126
+ handle: Schema.optional(Schema.String),
127
+ /** Unix ms when the indexer last assembled this entry. */
128
+ indexedAt: Schema.Number,
129
+ /**
130
+ * Trust labels derived from curator `publisher.verification` records.
131
+ * An empty array means the entry has no verification signal.
132
+ */
133
+ labels: Schema.Array(Schema.String),
134
+
135
+ // ── Verbatim profile record content ─────────────────────────────────────
136
+ profile: PluginProfileSchema,
137
+
138
+ // ── Releases (projected from package.release records) ───────────────────
139
+ /**
140
+ * All known releases for this package, ordered newest-first.
141
+ * Powers the version picker directly — no separate endpoint needed.
142
+ */
143
+ releases: Schema.Array(PluginReleaseSchema),
144
+ /**
145
+ * The latest (recommended) release version. Always references an entry in `releases`.
146
+ * Used by the host to determine whether an update is available.
147
+ */
148
+ latestVersion: Schema.String.pipe(Schema.nonEmptyString()),
149
+ });
150
+ export type PluginView = Schema.Schema.Type<typeof PluginViewSchema>;
67
151
 
68
152
  /**
69
153
  * Response body of `GET /registry/plugins`.
70
154
  */
71
155
  export const GetPluginsResponseBodySchema = Schema.Struct({
72
- /** Wire-format schema version, pinned to 1. */
73
- version: Schema.Literal(1),
74
- /** Hydrated entries. Order matches the order in the upstream catalog manifest. */
75
- plugins: Schema.Array(PluginEntrySchema),
76
- /** Unix ms timestamp of the most recent successful refresh cycle. */
156
+ /** Wire-format schema version, pinned to 2. */
157
+ version: Schema.Literal(2),
158
+ /** Hydrated entries. */
159
+ plugins: Schema.Array(PluginViewSchema),
160
+ /** Unix ms timestamp of the most recent successful index cycle. */
77
161
  refreshedAt: Schema.Number,
78
162
  });
79
163
  export type GetPluginsResponseBody = Schema.Schema.Type<typeof GetPluginsResponseBodySchema>;
80
164
 
165
+ // ─── Publisher records ────────────────────────────────────────────────────────
166
+
167
+ /** Content of a `publisher.profile` ATProto record. Display metadata for a publisher DID. */
168
+ export const PublisherProfileSchema = Schema.Struct({
169
+ displayName: Schema.String.pipe(Schema.nonEmptyString()),
170
+ bio: Schema.optional(Schema.String),
171
+ homepageUrl: Schema.optional(Schema.String),
172
+ contact: Schema.optional(Schema.String),
173
+ });
174
+ export type PublisherProfile = Schema.Schema.Type<typeof PublisherProfileSchema>;
175
+
81
176
  /**
82
- * Shape of the catalog manifest published in the upstream community-plugins repo.
83
- * Extra keys (e.g. `$schema`) are permitted.
177
+ * Content of a `publisher.verification` record written by the curator DID.
178
+ * Links a publisher DID to a trusted AT Protocol handle.
84
179
  */
85
- export const RegistryManifestSchema = Schema.Struct(
86
- {
87
- version: Schema.Literal(1),
88
- plugins: Schema.Array(
89
- Schema.Struct({
90
- repo: Schema.String,
91
- }),
92
- ),
93
- },
94
- Schema.Record({ key: Schema.String, value: Schema.Unknown }),
95
- );
96
- export type RegistryManifest = Schema.Schema.Type<typeof RegistryManifestSchema>;
180
+ export const PublisherVerificationSchema = Schema.Struct({
181
+ subject: Schema.String.pipe(Schema.nonEmptyString()),
182
+ handle: Schema.String.pipe(Schema.nonEmptyString()),
183
+ displayName: Schema.String.pipe(Schema.nonEmptyString()),
184
+ createdAt: Schema.String.pipe(Schema.nonEmptyString()),
185
+ });
186
+ export type PublisherVerification = Schema.Schema.Type<typeof PublisherVerificationSchema>;
187
+
188
+ // ─── NSID constants ───────────────────────────────────────────────────────────
189
+
190
+ /** NSID constants for the four `org.dxos.experimental.*` record collections. */
191
+ export const NSID = {
192
+ PackageProfile: 'org.dxos.experimental.package.profile',
193
+ PackageRelease: 'org.dxos.experimental.package.release',
194
+ PublisherProfile: 'org.dxos.experimental.publisher.profile',
195
+ PublisherVerification: 'org.dxos.experimental.publisher.verification',
196
+ } as const;
197
+
198
+ export type RegistryNsid = (typeof NSID)[keyof typeof NSID];
199
+
200
+ export const ALL_NSIDS: readonly RegistryNsid[] = [
201
+ NSID.PackageProfile,
202
+ NSID.PackageRelease,
203
+ NSID.PublisherProfile,
204
+ NSID.PublisherVerification,
205
+ ];
package/src/index.ts CHANGED
@@ -10,7 +10,8 @@ export * from './messenger.ts';
10
10
  export * from './profile-archive.ts';
11
11
  export * from './space-archive.ts';
12
12
  export * from './storage.ts';
13
- export * from './tracing.ts';
14
13
  export type * from './types.ts';
14
+ export * as Config2 from './Config2.ts';
15
15
  export * as FunctionProtocol from './FunctionProtocol.ts';
16
16
  export * as FeedProtocol from './FeedProtocol.ts';
17
+ export * as TraceProtocol from './TraceProtocol.ts';
package/src/invitation.ts CHANGED
@@ -4,11 +4,11 @@
4
4
 
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
- import { ParamKeyAnnotation } from '@dxos/effect';
7
+ import { SchemaEx } from '@dxos/effect';
8
8
 
9
9
  // TODO(burdon): Use uniformly for processing HTTP params.
10
10
  export const InvitationUrl = Schema.Struct({
11
11
  accessToken: Schema.String, // TODO(burdon): Remove.
12
- deviceInvitationCode: Schema.String.pipe(ParamKeyAnnotation({ key: 'deviceInvitationCode' })),
13
- spaceInvitationCode: Schema.String.pipe(ParamKeyAnnotation({ key: 'spaceInvitationCode' })),
12
+ deviceInvitationCode: Schema.String.pipe(SchemaEx.ParamKeyAnnotation({ key: 'deviceInvitationCode' })),
13
+ spaceInvitationCode: Schema.String.pipe(SchemaEx.ParamKeyAnnotation({ key: 'spaceInvitationCode' })),
14
14
  });
@@ -0,0 +1,29 @@
1
+ # `org.dxos.experimental.*` lexicons
2
+
3
+ Experimental AT Protocol lexicons for the DXOS plugin registry. The `experimental` segment is intentional — these schemas are unstable and will be renamed to a final namespace before promotion.
4
+
5
+ ## Records
6
+
7
+ | NSID | rkey | Purpose |
8
+ | ---------------------------------------------- | ------------------ | ----------------------------------------------------- |
9
+ | `org.dxos.experimental.package.profile` | `<key>` | Mutable package metadata (one per key per DID). |
10
+ | `org.dxos.experimental.package.release` | `<key>:<version>` | Versioned artifact record (conceptually single-write).|
11
+ | `org.dxos.experimental.publisher.profile` | `self` | Identity-level publisher metadata. |
12
+ | `org.dxos.experimental.publisher.verification` | `<verified DID>` | Trust attestation about a publisher. |
13
+
14
+ ## Trust model
15
+
16
+ `publisher.verification` records are public and unrestricted — anyone may author one. Trust is an indexing policy, not a write gate. Today the indexer honors verification records **only** from a single configured verifier DID (`REGISTRY_CURATOR_DID`) and indexes a publisher's records only if that verifier has vouched for the author DID. Revocation is achieved by deleting the verification record — the indexer unindexes that publisher on the next backfill sweep. This single-verifier gate is intended to generalize to multiple verifiers / moderation labels (à la Bluesky labelers) once that surface exists.
17
+
18
+ See `packages/sdk/app-framework/docs/registry-spec.md` for the full design, including the integrity / tamper-detection model.
19
+
20
+ ## Prior art
21
+
22
+ These lexicons are modeled on the emdash RFC:
23
+
24
+ - RFC: [emdash-cms/emdash#694](https://github.com/emdash-cms/emdash/pull/694) — design rationale, trust model trade-offs, rkey conventions, and the `experimental` namespace strategy.
25
+ - Implementation: [emdash-cms/emdash#923](https://github.com/emdash-cms/emdash/pull/923) — client, CLI, and lexicon bindings.
26
+
27
+ Differences from emdash's `com.emdashcms.experimental.*`:
28
+
29
+ - `releaseExtension` / `declaredAccess` records (sandbox manifest, granular permissions) are **not** included in v0; they will be added in a follow-on once the runtime sandbox surface is defined.