@dxos/protocols 0.8.4-main.fffef41 → 0.8.4-staging.60fe92afc8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/src/FeedProtocol.d.ts +528 -0
- package/dist/src/FeedProtocol.d.ts.map +1 -0
- package/dist/src/FeedProtocol.js +237 -0
- package/dist/src/FeedProtocol.js.map +1 -0
- package/dist/src/FunctionProtocol.d.ts +15 -2
- package/dist/src/FunctionProtocol.d.ts.map +1 -1
- package/dist/src/TraceProtocol.d.ts +15 -0
- package/dist/src/TraceProtocol.d.ts.map +1 -0
- package/dist/src/TraceProtocol.js +4 -0
- package/dist/src/TraceProtocol.js.map +1 -0
- package/dist/src/automerge.d.ts +203 -13
- package/dist/src/automerge.d.ts.map +1 -1
- package/dist/src/automerge.js +17 -0
- package/dist/src/automerge.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/client/invitation_pb.d.ts +16 -4
- package/dist/src/buf/proto/gen/dxos/client/invitation_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/client/invitation_pb.js +17 -5
- package/dist/src/buf/proto/gen/dxos/client/invitation_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/client/queue_pb.d.ts +311 -0
- package/dist/src/buf/proto/gen/dxos/client/queue_pb.d.ts.map +1 -0
- package/dist/src/buf/proto/gen/dxos/client/queue_pb.js +59 -0
- package/dist/src/buf/proto/gen/dxos/client/queue_pb.js.map +1 -0
- package/dist/src/buf/proto/gen/dxos/client/services_pb.d.ts +78 -3
- package/dist/src/buf/proto/gen/dxos/client/services_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/client/services_pb.js +68 -37
- package/dist/src/buf/proto/gen/dxos/client/services_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/config_pb.d.ts +112 -0
- package/dist/src/buf/proto/gen/dxos/config_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/config_pb.js +72 -1
- package/dist/src/buf/proto/gen/dxos/config_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/devtools/host_pb.d.ts +70 -0
- package/dist/src/buf/proto/gen/dxos/devtools/host_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/devtools/host_pb.js +16 -1
- package/dist/src/buf/proto/gen/dxos/devtools/host_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.d.ts +12 -0
- package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/query_pb.d.ts +12 -2
- package/dist/src/buf/proto/gen/dxos/echo/query_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/query_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/query_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/service_pb.d.ts +68 -7
- package/dist/src/buf/proto/gen/dxos/echo/service_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/service_pb.js +15 -5
- package/dist/src/buf/proto/gen/dxos/echo/service_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/edge/messenger_pb.d.ts +28 -0
- package/dist/src/buf/proto/gen/dxos/edge/messenger_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/edge/messenger_pb.js +10 -5
- package/dist/src/buf/proto/gen/dxos/edge/messenger_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/google_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/google_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.d.ts +65 -0
- package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.js +52 -22
- package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/invitations_pb.d.ts +11 -4
- package/dist/src/buf/proto/gen/dxos/halo/invitations_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/invitations_pb.js +12 -5
- package/dist/src/buf/proto/gen/dxos/halo/invitations_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/iframe_pb.d.ts +1 -10
- package/dist/src/buf/proto/gen/dxos/iframe_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/iframe_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/iframe_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/rpc_pb.d.ts +24 -0
- package/dist/src/buf/proto/gen/dxos/rpc_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/rpc_pb.js +12 -7
- package/dist/src/buf/proto/gen/dxos/rpc_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/tracing_pb.d.ts +1 -139
- package/dist/src/buf/proto/gen/dxos/tracing_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/tracing_pb.js +11 -45
- package/dist/src/buf/proto/gen/dxos/tracing_pb.js.map +1 -1
- package/dist/src/edge/EdgeFunctionEnv.d.ts +134 -0
- package/dist/src/edge/EdgeFunctionEnv.d.ts.map +1 -0
- package/dist/src/edge/EdgeFunctionEnv.js +4 -0
- package/dist/src/edge/EdgeFunctionEnv.js.map +1 -0
- package/dist/src/edge/edge.d.ts +698 -0
- package/dist/src/edge/edge.d.ts.map +1 -0
- package/dist/src/edge/edge.js +278 -0
- package/dist/src/edge/edge.js.map +1 -0
- package/dist/src/edge/edge.test.d.ts +2 -0
- package/dist/src/edge/edge.test.d.ts.map +1 -0
- package/dist/src/edge/edge.test.js +50 -0
- package/dist/src/edge/edge.test.js.map +1 -0
- package/dist/src/{edge-error.d.ts → edge/errors.d.ts} +6 -7
- package/dist/src/edge/errors.d.ts.map +1 -0
- package/dist/src/{edge-error.js → edge/errors.js} +13 -14
- package/dist/src/edge/errors.js.map +1 -0
- package/dist/src/edge/index.d.ts +5 -0
- package/dist/src/edge/index.d.ts.map +1 -0
- package/dist/src/edge/index.js +8 -0
- package/dist/src/edge/index.js.map +1 -0
- package/dist/src/edge/registry.d.ts +212 -0
- package/dist/src/edge/registry.d.ts.map +1 -0
- package/dist/src/edge/registry.js +139 -0
- package/dist/src/edge/registry.js.map +1 -0
- package/dist/src/errors/base-errors.d.ts +86 -8
- package/dist/src/errors/base-errors.d.ts.map +1 -1
- package/dist/src/errors/base-errors.js +4 -20
- package/dist/src/errors/base-errors.js.map +1 -1
- package/dist/src/errors/encoding.d.ts +2 -2
- package/dist/src/errors/encoding.d.ts.map +1 -1
- package/dist/src/errors/encoding.js.map +1 -1
- package/dist/src/errors/errors.d.ts +619 -42
- package/dist/src/errors/errors.d.ts.map +1 -1
- package/dist/src/errors/errors.js +49 -103
- package/dist/src/errors/errors.js.map +1 -1
- package/dist/src/errors/errors.test.js +1 -1
- package/dist/src/errors/errors.test.js.map +1 -1
- package/dist/src/errors/helpers.d.ts +9 -5
- package/dist/src/errors/helpers.d.ts.map +1 -1
- package/dist/src/errors/helpers.js +3 -3
- package/dist/src/errors/helpers.js.map +1 -1
- package/dist/src/errors/index.d.ts +5 -5
- package/dist/src/errors/parameter.d.ts.map +1 -1
- package/dist/src/feed-replication.d.ts.map +1 -1
- package/dist/src/index.d.ts +12 -13
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/indexing.d.ts.map +1 -1
- package/dist/src/invitation.js +3 -3
- package/dist/src/invitation.js.map +1 -1
- package/dist/src/messenger.d.ts +16 -0
- package/dist/src/messenger.d.ts.map +1 -0
- package/dist/src/messenger.js +4 -0
- package/dist/src/messenger.js.map +1 -0
- package/dist/src/profile-archive.d.ts +14 -1
- package/dist/src/profile-archive.d.ts.map +1 -1
- package/dist/src/profile-archive.js +2 -0
- package/dist/src/profile-archive.js.map +1 -1
- package/dist/src/proto/gen/dxos/agent/dashboard.d.ts +3 -6
- package/dist/src/proto/gen/dxos/agent/dashboard.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/agent/dashboard.js.map +1 -1
- package/dist/src/proto/gen/dxos/agent/echoproxy.d.ts +1 -2
- package/dist/src/proto/gen/dxos/agent/echoproxy.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/agent/epoch.d.ts +1 -2
- package/dist/src/proto/gen/dxos/agent/epoch.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/agent/functions.d.ts +6 -12
- package/dist/src/proto/gen/dxos/agent/functions.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/bot.d.ts +12 -24
- package/dist/src/proto/gen/dxos/bot.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/bot.js.map +1 -1
- package/dist/src/proto/gen/dxos/client/services.d.ts +1050 -915
- package/dist/src/proto/gen/dxos/client/services.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/client/services.js +109 -94
- package/dist/src/proto/gen/dxos/client/services.js.map +1 -1
- package/dist/src/proto/gen/dxos/config.d.ts +115 -100
- package/dist/src/proto/gen/dxos/config.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/config.js +26 -0
- package/dist/src/proto/gen/dxos/config.js.map +1 -1
- package/dist/src/proto/gen/dxos/devtools/host.d.ts +101 -119
- package/dist/src/proto/gen/dxos/devtools/host.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/devtools/swarm.d.ts +4 -8
- package/dist/src/proto/gen/dxos/devtools/swarm.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/echo/blob.d.ts +1 -2
- package/dist/src/proto/gen/dxos/echo/blob.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/echo/blob.js.map +1 -1
- package/dist/src/proto/gen/dxos/echo/feed.d.ts +4 -8
- package/dist/src/proto/gen/dxos/echo/feed.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/echo/filter.d.ts +2 -4
- package/dist/src/proto/gen/dxos/echo/filter.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/echo/filter.js.map +1 -1
- package/dist/src/proto/gen/dxos/echo/indexing.d.ts +2 -4
- package/dist/src/proto/gen/dxos/echo/indexing.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/echo/indexing.js.map +1 -1
- package/dist/src/proto/gen/dxos/echo/metadata.d.ts +16 -16
- package/dist/src/proto/gen/dxos/echo/metadata.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/echo/metadata.js.map +1 -1
- package/dist/src/proto/gen/dxos/echo/model/document.d.ts +11 -22
- package/dist/src/proto/gen/dxos/echo/model/document.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/echo/model/document.js.map +1 -1
- package/dist/src/proto/gen/dxos/echo/model/messenger.d.ts +1 -2
- package/dist/src/proto/gen/dxos/echo/model/messenger.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/echo/model/text.d.ts +2 -4
- package/dist/src/proto/gen/dxos/echo/model/text.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/echo/object.d.ts +6 -12
- package/dist/src/proto/gen/dxos/echo/object.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/echo/object.js.map +1 -1
- package/dist/src/proto/gen/dxos/echo/query.d.ts +21 -9
- package/dist/src/proto/gen/dxos/echo/query.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/echo/query.js.map +1 -1
- package/dist/src/proto/gen/dxos/echo/service.d.ts +61 -34
- package/dist/src/proto/gen/dxos/echo/service.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/echo/snapshot.d.ts +2 -4
- package/dist/src/proto/gen/dxos/echo/snapshot.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/echo/timeframe.d.ts +2 -4
- package/dist/src/proto/gen/dxos/echo/timeframe.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/edge/calls.d.ts +5 -10
- package/dist/src/proto/gen/dxos/edge/calls.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/edge/messenger.d.ts +28 -10
- package/dist/src/proto/gen/dxos/edge/messenger.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/edge/messenger.js.map +1 -1
- package/dist/src/proto/gen/dxos/edge/signal.d.ts +7 -14
- package/dist/src/proto/gen/dxos/edge/signal.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/error.d.ts +1 -2
- package/dist/src/proto/gen/dxos/error.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/gravity.d.ts +10 -20
- package/dist/src/proto/gen/dxos/gravity.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/halo/credentials/auth.d.ts +1 -2
- package/dist/src/proto/gen/dxos/halo/credentials/auth.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/halo/credentials/greet.d.ts +6 -12
- package/dist/src/proto/gen/dxos/halo/credentials/greet.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/halo/credentials/greet.js.map +1 -1
- package/dist/src/proto/gen/dxos/halo/credentials/identity.d.ts +2 -4
- package/dist/src/proto/gen/dxos/halo/credentials/identity.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/halo/credentials.d.ts +47 -43
- package/dist/src/proto/gen/dxos/halo/credentials.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/halo/credentials.js +9 -0
- package/dist/src/proto/gen/dxos/halo/credentials.js.map +1 -1
- package/dist/src/proto/gen/dxos/halo/invitations.d.ts +16 -28
- package/dist/src/proto/gen/dxos/halo/invitations.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/halo/invitations.js +3 -2
- package/dist/src/proto/gen/dxos/halo/invitations.js.map +1 -1
- package/dist/src/proto/gen/dxos/halo/keyring.d.ts +1 -2
- package/dist/src/proto/gen/dxos/halo/keyring.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/halo/keys.d.ts +2 -4
- package/dist/src/proto/gen/dxos/halo/keys.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/halo/signed.d.ts +4 -8
- package/dist/src/proto/gen/dxos/halo/signed.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/iframe.d.ts +4 -18
- package/dist/src/proto/gen/dxos/iframe.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/iframe.js.map +1 -1
- package/dist/src/proto/gen/dxos/keys.d.ts +2 -4
- package/dist/src/proto/gen/dxos/keys.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/mesh/bridge.d.ts +12 -24
- package/dist/src/proto/gen/dxos/mesh/bridge.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/mesh/broadcast.d.ts +1 -2
- package/dist/src/proto/gen/dxos/mesh/broadcast.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/mesh/messaging.d.ts +2 -4
- package/dist/src/proto/gen/dxos/mesh/messaging.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/mesh/muxer.d.ts +5 -10
- package/dist/src/proto/gen/dxos/mesh/muxer.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/mesh/presence.d.ts +1 -2
- package/dist/src/proto/gen/dxos/mesh/presence.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/mesh/protocol.d.ts +3 -6
- package/dist/src/proto/gen/dxos/mesh/protocol.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/mesh/replicator.d.ts +2 -4
- package/dist/src/proto/gen/dxos/mesh/replicator.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/mesh/signal.d.ts +9 -18
- package/dist/src/proto/gen/dxos/mesh/signal.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/mesh/signal.js.map +1 -1
- package/dist/src/proto/gen/dxos/mesh/swarm.d.ts +6 -12
- package/dist/src/proto/gen/dxos/mesh/swarm.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/mesh/teleport/auth.d.ts +2 -4
- package/dist/src/proto/gen/dxos/mesh/teleport/auth.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/mesh/teleport/automerge.d.ts +2 -4
- package/dist/src/proto/gen/dxos/mesh/teleport/automerge.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/mesh/teleport/blobsync.d.ts +3 -6
- package/dist/src/proto/gen/dxos/mesh/teleport/blobsync.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/mesh/teleport/control.d.ts +3 -6
- package/dist/src/proto/gen/dxos/mesh/teleport/control.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/mesh/teleport/gossip.d.ts +1 -2
- package/dist/src/proto/gen/dxos/mesh/teleport/gossip.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/mesh/teleport/notarization.d.ts +1 -2
- package/dist/src/proto/gen/dxos/mesh/teleport/notarization.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/mesh/teleport/replicator.d.ts +5 -10
- package/dist/src/proto/gen/dxos/mesh/teleport/replicator.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/mesh/teleport.d.ts +2 -4
- package/dist/src/proto/gen/dxos/mesh/teleport.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/registry.d.ts +3 -6
- package/dist/src/proto/gen/dxos/registry.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/rpc.d.ts +24 -12
- package/dist/src/proto/gen/dxos/rpc.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/rpc.js.map +1 -1
- package/dist/src/proto/gen/dxos/service/agentmanager.d.ts +4 -8
- package/dist/src/proto/gen/dxos/service/agentmanager.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/service/agentmanager.js.map +1 -1
- package/dist/src/proto/gen/dxos/service/publisher.d.ts +5 -10
- package/dist/src/proto/gen/dxos/service/publisher.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/service/supervisor.d.ts +12 -24
- package/dist/src/proto/gen/dxos/service/supervisor.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/service/supervisor.js.map +1 -1
- package/dist/src/proto/gen/dxos/service/tunnel.d.ts +3 -6
- package/dist/src/proto/gen/dxos/service/tunnel.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/tracing.d.ts +10 -99
- package/dist/src/proto/gen/dxos/tracing.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/type.d.ts +12 -24
- package/dist/src/proto/gen/dxos/type.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/value.d.ts +2 -4
- package/dist/src/proto/gen/dxos/value.d.ts.map +1 -1
- package/dist/src/proto/gen/example/testing/data.d.ts +4 -8
- package/dist/src/proto/gen/example/testing/data.d.ts.map +1 -1
- package/dist/src/proto/gen/example/testing/rpc.d.ts +7 -14
- package/dist/src/proto/gen/example/testing/rpc.d.ts.map +1 -1
- package/dist/src/proto/gen/google/protobuf.d.ts +326 -40
- package/dist/src/proto/gen/google/protobuf.d.ts.map +1 -1
- package/dist/src/proto/gen/google/protobuf.js +127 -1
- package/dist/src/proto/gen/google/protobuf.js.map +1 -1
- package/dist/src/proto/gen/index.d.ts +47 -7
- package/dist/src/proto/gen/index.d.ts.map +1 -1
- package/dist/src/proto/gen/index.js +1 -1
- package/dist/src/proto/gen/index.js.map +1 -1
- package/dist/src/proto/index.d.ts +2 -2
- package/dist/src/proto/substitutions.d.ts +8 -8
- package/dist/src/proto/substitutions.d.ts.map +1 -1
- package/dist/src/proto/types.d.ts +1 -1
- package/dist/src/space-archive.d.ts +62 -3
- package/dist/src/space-archive.d.ts.map +1 -1
- package/dist/src/space-archive.js +13 -1
- package/dist/src/space-archive.js.map +1 -1
- package/dist/src/types.d.ts +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +20 -35
- package/src/FeedProtocol.ts +323 -0
- package/src/FunctionProtocol.ts +17 -6
- package/src/TraceProtocol.ts +21 -0
- package/src/automerge.ts +239 -13
- package/src/buf/proto/gen/dxos/agent/dashboard_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/agent/echo-proxy_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/agent/epoch_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/agent/functions_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/bot_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/client/invitation_pb.ts +20 -6
- package/src/buf/proto/gen/dxos/client/logging_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/client/queue_pb.ts +373 -0
- package/src/buf/proto/gen/dxos/client/services_pb.ts +129 -40
- package/src/buf/proto/gen/dxos/config_pb.ts +132 -2
- package/src/buf/proto/gen/dxos/devtools/diagnostics_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/devtools/host_pb.ts +83 -2
- package/src/buf/proto/gen/dxos/devtools/swarm_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/echo/blob_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/echo/feed_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/echo/filter_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/echo/indexing_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/echo/metadata_pb.ts +16 -2
- package/src/buf/proto/gen/dxos/echo/model/document_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/echo/model/messenger_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/echo/model/text_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/echo/object_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/echo/query_pb.ts +16 -4
- package/src/buf/proto/gen/dxos/echo/service_pb.ts +81 -13
- package/src/buf/proto/gen/dxos/echo/snapshot_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/echo/timeframe_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/edge/calls_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/edge/messenger_pb.ts +39 -6
- package/src/buf/proto/gen/dxos/edge/signal_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/error_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/field_options_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/google_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/gravity_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/halo/credentials/auth_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/halo/credentials/greet_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/halo/credentials/identity_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/halo/credentials_pb.ts +100 -23
- package/src/buf/proto/gen/dxos/halo/invitations_pb.ts +14 -6
- package/src/buf/proto/gen/dxos/halo/keyring_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/halo/keys_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/halo/signed_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/iframe_pb.ts +3 -14
- package/src/buf/proto/gen/dxos/keys_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/bridge_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/broadcast_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/messaging_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/muxer_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/presence_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/protocol_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/replicator_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/signal_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/swarm_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/teleport/admission-discovery_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/teleport/auth_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/teleport/automerge_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/teleport/blobsync_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/teleport/control_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/teleport/gossip_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/teleport/notarization_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/teleport/replicator_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/registry_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/rpc_pb.ts +37 -8
- package/src/buf/proto/gen/dxos/service/agentmanager_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/service/publisher_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/service/supervisor_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/service/tunnel_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/tracing_pb.ts +12 -179
- package/src/buf/proto/gen/dxos/type_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/value_pb.ts +1 -1
- package/src/buf/proto/gen/example/testing/data_pb.ts +1 -1
- package/src/buf/proto/gen/example/testing/rpc_pb.ts +1 -1
- package/src/codec.test.ts +1 -1
- package/src/edge/EdgeFunctionEnv.ts +228 -0
- package/src/edge/edge.test.ts +64 -0
- package/src/edge/edge.ts +818 -0
- package/src/{edge-error.ts → edge/errors.ts} +15 -16
- package/src/edge/index.ts +8 -0
- package/src/edge/registry.ts +164 -0
- package/src/errors/base-errors.ts +4 -22
- package/src/errors/encoding.ts +2 -3
- package/src/errors/errors.test.ts +2 -2
- package/src/errors/errors.ts +57 -124
- package/src/errors/helpers.ts +6 -7
- package/src/errors/index.ts +5 -5
- package/src/feed-replication.ts +1 -0
- package/src/index.ts +12 -13
- package/src/indexing.test.ts +1 -1
- package/src/invitation.ts +3 -3
- package/src/messenger.ts +22 -0
- package/src/profile-archive.ts +13 -0
- package/src/proto/dxos/client/invitation.proto +9 -2
- package/src/proto/dxos/client/queue.proto +102 -0
- package/src/proto/dxos/client/services.proto +23 -1
- package/src/proto/dxos/config.proto +50 -1
- package/src/proto/dxos/devtools/host.proto +27 -0
- package/src/proto/dxos/echo/metadata.proto +6 -0
- package/src/proto/dxos/echo/query.proto +4 -1
- package/src/proto/dxos/echo/service.proto +38 -4
- package/src/proto/dxos/edge/messenger.proto +10 -0
- package/src/proto/dxos/halo/credentials.proto +24 -0
- package/src/proto/dxos/halo/invitations.proto +5 -2
- package/src/proto/dxos/iframe.proto +1 -3
- package/src/proto/dxos/rpc.proto +7 -0
- package/src/proto/dxos/tracing.proto +0 -40
- package/src/proto/gen/dxos/agent/dashboard.ts +3 -6
- package/src/proto/gen/dxos/agent/echoproxy.ts +1 -2
- package/src/proto/gen/dxos/agent/epoch.ts +1 -2
- package/src/proto/gen/dxos/agent/functions.ts +6 -12
- package/src/proto/gen/dxos/bot.ts +12 -24
- package/src/proto/gen/dxos/client/services.ts +1050 -915
- package/src/proto/gen/dxos/config.ts +115 -100
- package/src/proto/gen/dxos/devtools/host.ts +101 -119
- package/src/proto/gen/dxos/devtools/swarm.ts +4 -8
- package/src/proto/gen/dxos/echo/blob.ts +1 -2
- package/src/proto/gen/dxos/echo/feed.ts +4 -8
- package/src/proto/gen/dxos/echo/filter.ts +2 -4
- package/src/proto/gen/dxos/echo/indexing.ts +2 -4
- package/src/proto/gen/dxos/echo/metadata.ts +16 -16
- package/src/proto/gen/dxos/echo/model/document.ts +11 -22
- package/src/proto/gen/dxos/echo/model/messenger.ts +1 -2
- package/src/proto/gen/dxos/echo/model/text.ts +2 -4
- package/src/proto/gen/dxos/echo/object.ts +6 -12
- package/src/proto/gen/dxos/echo/query.ts +21 -9
- package/src/proto/gen/dxos/echo/service.ts +60 -34
- package/src/proto/gen/dxos/echo/snapshot.ts +2 -4
- package/src/proto/gen/dxos/echo/timeframe.ts +2 -4
- package/src/proto/gen/dxos/edge/calls.ts +5 -10
- package/src/proto/gen/dxos/edge/messenger.ts +28 -10
- package/src/proto/gen/dxos/edge/signal.ts +7 -14
- package/src/proto/gen/dxos/error.ts +1 -2
- package/src/proto/gen/dxos/gravity.ts +10 -20
- package/src/proto/gen/dxos/halo/credentials/auth.ts +1 -2
- package/src/proto/gen/dxos/halo/credentials/greet.ts +6 -12
- package/src/proto/gen/dxos/halo/credentials/identity.ts +2 -4
- package/src/proto/gen/dxos/halo/credentials.ts +47 -43
- package/src/proto/gen/dxos/halo/invitations.ts +16 -28
- package/src/proto/gen/dxos/halo/keyring.ts +1 -2
- package/src/proto/gen/dxos/halo/keys.ts +2 -4
- package/src/proto/gen/dxos/halo/signed.ts +4 -8
- package/src/proto/gen/dxos/iframe.ts +4 -18
- package/src/proto/gen/dxos/keys.ts +2 -4
- package/src/proto/gen/dxos/mesh/bridge.ts +12 -24
- package/src/proto/gen/dxos/mesh/broadcast.ts +1 -2
- package/src/proto/gen/dxos/mesh/messaging.ts +2 -4
- package/src/proto/gen/dxos/mesh/muxer.ts +5 -10
- package/src/proto/gen/dxos/mesh/presence.ts +1 -2
- package/src/proto/gen/dxos/mesh/protocol.ts +3 -6
- package/src/proto/gen/dxos/mesh/replicator.ts +2 -4
- package/src/proto/gen/dxos/mesh/signal.ts +9 -18
- package/src/proto/gen/dxos/mesh/swarm.ts +6 -12
- package/src/proto/gen/dxos/mesh/teleport/auth.ts +2 -4
- package/src/proto/gen/dxos/mesh/teleport/automerge.ts +2 -4
- package/src/proto/gen/dxos/mesh/teleport/blobsync.ts +3 -6
- package/src/proto/gen/dxos/mesh/teleport/control.ts +3 -6
- package/src/proto/gen/dxos/mesh/teleport/gossip.ts +1 -2
- package/src/proto/gen/dxos/mesh/teleport/notarization.ts +1 -2
- package/src/proto/gen/dxos/mesh/teleport/replicator.ts +5 -10
- package/src/proto/gen/dxos/mesh/teleport.ts +2 -4
- package/src/proto/gen/dxos/registry.ts +3 -6
- package/src/proto/gen/dxos/rpc.ts +24 -12
- package/src/proto/gen/dxos/service/agentmanager.ts +4 -8
- package/src/proto/gen/dxos/service/publisher.ts +5 -10
- package/src/proto/gen/dxos/service/supervisor.ts +12 -24
- package/src/proto/gen/dxos/service/tunnel.ts +3 -6
- package/src/proto/gen/dxos/tracing.ts +10 -96
- package/src/proto/gen/dxos/type.ts +12 -24
- package/src/proto/gen/dxos/value.ts +2 -4
- package/src/proto/gen/example/testing/data.ts +4 -8
- package/src/proto/gen/example/testing/rpc.ts +7 -14
- package/src/proto/gen/google/protobuf.ts +326 -40
- package/src/proto/gen/index.ts +48 -8
- package/src/proto/index.ts +2 -2
- package/src/proto/types.ts +1 -1
- package/src/space-archive.ts +70 -1
- package/src/types.ts +2 -2
- package/dist/src/edge-error.d.ts.map +0 -1
- package/dist/src/edge-error.js.map +0 -1
- package/dist/src/edge.d.ts +0 -333
- package/dist/src/edge.d.ts.map +0 -1
- package/dist/src/edge.js +0 -155
- package/dist/src/edge.js.map +0 -1
- package/dist/src/query.d.ts +0 -5
- package/dist/src/query.d.ts.map +0 -1
- package/dist/src/query.js +0 -8
- package/dist/src/query.js.map +0 -1
- package/dist/src/queue.d.ts +0 -37
- package/dist/src/queue.d.ts.map +0 -1
- package/dist/src/queue.js +0 -8
- package/dist/src/queue.js.map +0 -1
- package/dist/src/tracing.d.ts +0 -40
- package/dist/src/tracing.d.ts.map +0 -1
- package/dist/src/tracing.js +0 -50
- package/dist/src/tracing.js.map +0 -1
- package/src/edge.ts +0 -477
- package/src/query.ts +0 -8
- package/src/queue.ts +0 -51
- package/src/tracing.ts +0 -86
package/dist/src/queue.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { SpaceId } from '@dxos/keys';
|
|
2
|
-
import type { ObjectId } from './types.js';
|
|
3
|
-
export type QueueCursor = string & {
|
|
4
|
-
__QueueCursor: never;
|
|
5
|
-
};
|
|
6
|
-
export type QueueQuery = {
|
|
7
|
-
queueId: ObjectId;
|
|
8
|
-
after?: QueueCursor;
|
|
9
|
-
before?: QueueCursor;
|
|
10
|
-
limit?: number;
|
|
11
|
-
reverse?: boolean;
|
|
12
|
-
objectIds?: ObjectId[];
|
|
13
|
-
};
|
|
14
|
-
export type QueryResult = {
|
|
15
|
-
objects: unknown[];
|
|
16
|
-
/**
|
|
17
|
-
* Cursor at the end of the range.
|
|
18
|
-
*/
|
|
19
|
-
nextCursor: QueueCursor | null;
|
|
20
|
-
/**
|
|
21
|
-
* Cursor at the start of the range.
|
|
22
|
-
*/
|
|
23
|
-
prevCursor: QueueCursor | null;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Position of an object in the queue that it is in.
|
|
27
|
-
*/
|
|
28
|
-
export declare const KEY_QUEUE_POSITION = "dxos.org/key/queue-position";
|
|
29
|
-
/**
|
|
30
|
-
* Service for managing queues.
|
|
31
|
-
*/
|
|
32
|
-
export interface QueueService {
|
|
33
|
-
queryQueue(subspaceTag: string, spaceId: SpaceId, query: QueueQuery): Promise<QueryResult>;
|
|
34
|
-
insertIntoQueue(subspaceTag: string, spaceId: SpaceId, queueId: ObjectId, objects: unknown[]): Promise<void>;
|
|
35
|
-
deleteFromQueue(subspaceTag: string, spaceId: SpaceId, queueId: ObjectId, objectIds: ObjectId[]): Promise<void>;
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=queue.d.ts.map
|
package/dist/src/queue.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../src/queue.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG;IAAE,aAAa,EAAE,KAAK,CAAA;CAAE,CAAC;AAE5D,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,EAAE,QAAQ,CAAC;IAElB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;CACxB,CAAC;AAGF,MAAM,MAAM,WAAW,GAAG;IAGxB,OAAO,EAAE,OAAO,EAAE,CAAC;IAEnB;;OAEG;IACH,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B;;OAEG;IACH,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,gCAAgC,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAE3F,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7G,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjH"}
|
package/dist/src/queue.js
DELETED
package/dist/src/queue.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"queue.js","sourceRoot":"","sources":["../../src/queue.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAkCF;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,6BAA6B,CAAC"}
|
package/dist/src/tracing.d.ts
DELETED
|
@@ -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"}
|
package/dist/src/tracing.js
DELETED
|
@@ -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
|
package/dist/src/tracing.js.map
DELETED
|
@@ -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.ts
DELETED
|
@@ -1,477 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Schema from 'effect/Schema';
|
|
6
|
-
|
|
7
|
-
import { BaseError } from '@dxos/errors';
|
|
8
|
-
import { invariant } from '@dxos/invariant';
|
|
9
|
-
import { SpaceId } from '@dxos/keys';
|
|
10
|
-
|
|
11
|
-
// TODO(burdon): Rename EdgerRouterEndpoint.
|
|
12
|
-
// If we would rename it, we need to be careful to not break composer production.
|
|
13
|
-
export enum EdgeService {
|
|
14
|
-
AUTOMERGE_REPLICATOR = 'automerge-replicator',
|
|
15
|
-
FEED_REPLICATOR = 'feed-replicator',
|
|
16
|
-
SWARM = 'swarm',
|
|
17
|
-
SIGNAL = 'signal',
|
|
18
|
-
STATUS = 'status',
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export type EdgeSuccess<T> = {
|
|
22
|
-
success: true;
|
|
23
|
-
data: T;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export type SerializedError = {
|
|
27
|
-
code?: string;
|
|
28
|
-
message?: string;
|
|
29
|
-
context?: Record<string, unknown>;
|
|
30
|
-
stack?: string;
|
|
31
|
-
cause?: SerializedError;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export type EdgeErrorData = { type: string } & Record<string, any>;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* This is the shape of the error response from the Edge service,
|
|
38
|
-
* when the error is gracefully handled, the Response will be an object with this shape and have status code 200.
|
|
39
|
-
*/
|
|
40
|
-
// TODO(dmaretskyi): Refactor this type to just be { success: false, error: SerializedError }
|
|
41
|
-
// reason -> error.message
|
|
42
|
-
// cause -> error.cause
|
|
43
|
-
// errorData.type -> error.code
|
|
44
|
-
// ...errorData -> error.context
|
|
45
|
-
export type EdgeFailure = {
|
|
46
|
-
/**
|
|
47
|
-
* Branded Type.
|
|
48
|
-
*/
|
|
49
|
-
success: false;
|
|
50
|
-
/**
|
|
51
|
-
* An explanation of why the call failed. Used mostly for logging and monitoring.
|
|
52
|
-
*/
|
|
53
|
-
reason: string;
|
|
54
|
-
/**
|
|
55
|
-
* Cause Error captured on the EDGE service to aid debugging on the client.
|
|
56
|
-
*/
|
|
57
|
-
cause?: SerializedError;
|
|
58
|
-
/**
|
|
59
|
-
* Information that can be used to retry the request such that it will succeed, for example:
|
|
60
|
-
* 1. { type: 'auth_required', challenge: string }
|
|
61
|
-
* Requires retrying the request with challenge signature included.
|
|
62
|
-
* 2. { type: 'user_confirmation_required', dialog: { title: string, message: string, confirmation_payload: string } }
|
|
63
|
-
* Requires showing a confirmation dialog to a user and retrying the request with confirmation_payload included
|
|
64
|
-
* if the user confirms.
|
|
65
|
-
* When errorData is returned simply retrying the request won't have any effect.
|
|
66
|
-
* EdgeHttpClient should parse well-known errorData into Error types and throw.
|
|
67
|
-
*/
|
|
68
|
-
errorData?: EdgeErrorData;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Represents a body response from the Edge service.
|
|
73
|
-
*/
|
|
74
|
-
export type EdgeBody<T> = EdgeSuccess<T> | EdgeFailure;
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Use this to create a response from the Edge service.
|
|
78
|
-
*/
|
|
79
|
-
export const EdgeResponse = Object.freeze({
|
|
80
|
-
success: <T>(data: T, status: number = 200): Response => {
|
|
81
|
-
invariant(status >= 200 && status < 300, 'Status code must be in the 2xx range');
|
|
82
|
-
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
83
|
-
return new Response(
|
|
84
|
-
JSON.stringify({
|
|
85
|
-
success: true,
|
|
86
|
-
data,
|
|
87
|
-
} satisfies EdgeSuccess<T>),
|
|
88
|
-
{
|
|
89
|
-
status,
|
|
90
|
-
headers,
|
|
91
|
-
},
|
|
92
|
-
);
|
|
93
|
-
},
|
|
94
|
-
failure: ({
|
|
95
|
-
reason,
|
|
96
|
-
cause,
|
|
97
|
-
errorData,
|
|
98
|
-
shouldRetryAfter,
|
|
99
|
-
status = 500,
|
|
100
|
-
}: {
|
|
101
|
-
/**
|
|
102
|
-
* An explanation of why the call failed. Used mostly for logging and monitoring.
|
|
103
|
-
*/
|
|
104
|
-
reason: string;
|
|
105
|
-
/**
|
|
106
|
-
* Error that caused the failure.
|
|
107
|
-
* Useful for debugging.
|
|
108
|
-
*/
|
|
109
|
-
cause?: Error;
|
|
110
|
-
/**
|
|
111
|
-
* Information that can be used to retry the request such that it will succeed, for example:
|
|
112
|
-
* 1. { type: 'auth_required', challenge: string }
|
|
113
|
-
* Requires retrying the request with challenge signature included.
|
|
114
|
-
* 2. { type: 'user_confirmation_required', dialog: { title: string, message: string, confirmation_payload: string } }
|
|
115
|
-
* Requires showing a confirmation dialog to a user and retrying the request with confirmation_payload included
|
|
116
|
-
* if the user confirms.
|
|
117
|
-
* When errorData is returned simply retrying the request won't have any effect.
|
|
118
|
-
* EdgeHttpClient should parse well-known errorData into Error types and throw.
|
|
119
|
-
*/
|
|
120
|
-
errorData?: EdgeErrorData;
|
|
121
|
-
/**
|
|
122
|
-
* If provided, this request will be marked as retryable and the client will wait for the specified number of milliseconds before retrying.
|
|
123
|
-
* If not provided, the client will not retry the request.
|
|
124
|
-
*/
|
|
125
|
-
shouldRetryAfter?: number;
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Status code of the response.
|
|
129
|
-
* @default 500
|
|
130
|
-
*/
|
|
131
|
-
status?: number;
|
|
132
|
-
}): Response => {
|
|
133
|
-
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
134
|
-
if (shouldRetryAfter) {
|
|
135
|
-
headers.set('Retry-After', String(shouldRetryAfter));
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return new Response(
|
|
139
|
-
JSON.stringify({
|
|
140
|
-
success: false,
|
|
141
|
-
reason,
|
|
142
|
-
errorData,
|
|
143
|
-
cause: cause ? ErrorCodec.encode(cause) : undefined,
|
|
144
|
-
} satisfies EdgeFailure),
|
|
145
|
-
{
|
|
146
|
-
status,
|
|
147
|
-
headers,
|
|
148
|
-
},
|
|
149
|
-
);
|
|
150
|
-
},
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
export type GetNotarizationResponseBody = {
|
|
154
|
-
awaitingNotarization: { credentials: string[] };
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
export type ExecuteWorkflowResponseBody = {
|
|
158
|
-
success: boolean;
|
|
159
|
-
reason?: string;
|
|
160
|
-
output?: any;
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
export type PostNotarizationRequestBody = {
|
|
164
|
-
credentials: string[];
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
export type JoinSpaceRequest = {
|
|
168
|
-
invitationId: string;
|
|
169
|
-
identityKey: string;
|
|
170
|
-
/**
|
|
171
|
-
* Base64 encoded signed challenge.
|
|
172
|
-
* Used to verify the IdentityKey in case of `invitation.authMethod === Invitation.AuthMethod.KNOWN_PUBLIC_KEY`
|
|
173
|
-
*/
|
|
174
|
-
signature?: string;
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
export type JoinSpaceResponseBody = {
|
|
178
|
-
spaceMemberCredential: string;
|
|
179
|
-
spaceGenesisFeedKey: string;
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
export type RecoverIdentitySignature =
|
|
183
|
-
| string
|
|
184
|
-
// This is the format of the signature from the WebAuthn authenticator.
|
|
185
|
-
| {
|
|
186
|
-
signature: string;
|
|
187
|
-
clientDataJson: string;
|
|
188
|
-
authenticatorData: string;
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
export type RecoverIdentityRequest = {
|
|
192
|
-
deviceKey: string;
|
|
193
|
-
controlFeedKey: string;
|
|
194
|
-
lookupKey?: string;
|
|
195
|
-
signature?: RecoverIdentitySignature;
|
|
196
|
-
token?: string;
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
export type RecoverIdentityResponseBody = {
|
|
200
|
-
identityKey: string;
|
|
201
|
-
haloSpaceKey: string;
|
|
202
|
-
genesisFeedKey: string;
|
|
203
|
-
deviceAuthCredential: string;
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
export type CreateAgentRequestBody = {
|
|
207
|
-
identityKey: string;
|
|
208
|
-
haloSpaceId: SpaceId;
|
|
209
|
-
haloSpaceKey: string;
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
export type CreateAgentResponseBody = {
|
|
213
|
-
deviceKey: string;
|
|
214
|
-
feedKey: string;
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
export type GetAgentStatusResponseBody = {
|
|
218
|
-
agent: {
|
|
219
|
-
deviceKey?: string;
|
|
220
|
-
status: EdgeAgentStatus;
|
|
221
|
-
};
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
export type UploadFunctionRequest = {
|
|
225
|
-
name?: string;
|
|
226
|
-
version: string;
|
|
227
|
-
ownerPublicKey: string;
|
|
228
|
-
entryPoint: string;
|
|
229
|
-
assets: Record<string, Uint8Array>;
|
|
230
|
-
/**
|
|
231
|
-
* Runtime in Edge that will be used to run the function.
|
|
232
|
-
* Runtime cannot be changed once the function was deployed.
|
|
233
|
-
* @default Runtime.WORKERS_FOR_PLATFORMS
|
|
234
|
-
*/
|
|
235
|
-
runtime?: Runtime;
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* Note: Do not change the values of these enums, this values are stored in the FunctionVersions database.
|
|
240
|
-
*/
|
|
241
|
-
export enum Runtime {
|
|
242
|
-
// https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/
|
|
243
|
-
WORKERS_FOR_PLATFORMS = 'WORKERS_FOR_PLATFORMS',
|
|
244
|
-
// https://developers.cloudflare.com/workers/runtime-apis/bindings/worker-loader/
|
|
245
|
-
WORKER_LOADER = 'WORKER_LOADER',
|
|
246
|
-
// Local worker dispatcher for testing.
|
|
247
|
-
TEST = 'TEST',
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
export type UploadFunctionResponseBody = {
|
|
251
|
-
functionId: string;
|
|
252
|
-
version: string;
|
|
253
|
-
meta: {
|
|
254
|
-
key?: string;
|
|
255
|
-
name?: string;
|
|
256
|
-
description?: string;
|
|
257
|
-
/**
|
|
258
|
-
* JSON Schema for the input of the function.
|
|
259
|
-
*/
|
|
260
|
-
inputSchema?: object;
|
|
261
|
-
/**
|
|
262
|
-
* JSON Schema for the output of the function.
|
|
263
|
-
*/
|
|
264
|
-
outputSchema?: object;
|
|
265
|
-
};
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
export type CreateSpaceRequest = {
|
|
269
|
-
/**
|
|
270
|
-
* HEX encoded public key of the agent.
|
|
271
|
-
*/
|
|
272
|
-
agentKey: string;
|
|
273
|
-
};
|
|
274
|
-
|
|
275
|
-
export type CreateSpaceResponseBody = {
|
|
276
|
-
/**
|
|
277
|
-
* HEX encoded public key of the space.
|
|
278
|
-
*/
|
|
279
|
-
spaceKey: string;
|
|
280
|
-
spaceId: SpaceId;
|
|
281
|
-
automergeRoot: string;
|
|
282
|
-
};
|
|
283
|
-
|
|
284
|
-
export enum EdgeAgentStatus {
|
|
285
|
-
ACTIVE = 'active',
|
|
286
|
-
INACTIVE = 'inactive',
|
|
287
|
-
NOT_FOUND = 'not_found',
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
export type EdgeAuthChallenge = {
|
|
291
|
-
type: 'auth_challenge';
|
|
292
|
-
challenge: string;
|
|
293
|
-
};
|
|
294
|
-
|
|
295
|
-
export enum OAuthProvider {
|
|
296
|
-
GOOGLE = 'google',
|
|
297
|
-
BLUESKY = 'bluesky',
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
export const InitiateOAuthFlowRequestSchema = Schema.Struct({
|
|
301
|
-
provider: Schema.Enums(OAuthProvider),
|
|
302
|
-
spaceId: Schema.String.pipe(Schema.filter(SpaceId.isValid)), // TODO(burdon): Use SpaceId.
|
|
303
|
-
accessTokenId: Schema.String,
|
|
304
|
-
scopes: Schema.mutable(Schema.Array(Schema.String)),
|
|
305
|
-
// Set to true if we don't want periodic token refreshes in background, for cases like account connect
|
|
306
|
-
noRefresh: Schema.optional(Schema.Boolean),
|
|
307
|
-
// Provider-specific (user handle or did for bluesky) hint for auth server resolution
|
|
308
|
-
loginHint: Schema.optional(Schema.String),
|
|
309
|
-
});
|
|
310
|
-
export type InitiateOAuthFlowRequest = Schema.Schema.Type<typeof InitiateOAuthFlowRequestSchema>;
|
|
311
|
-
|
|
312
|
-
export type InitiateOAuthFlowResponse = {
|
|
313
|
-
authUrl: string;
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
export type OAuthFlowResult =
|
|
317
|
-
| { success: true; accessToken: string; accessTokenId: string }
|
|
318
|
-
| { success: false; reason: string };
|
|
319
|
-
|
|
320
|
-
export enum EdgeWebsocketProtocol {
|
|
321
|
-
V0 = 'edge-ws-v0',
|
|
322
|
-
/**
|
|
323
|
-
* Enables message framing and muxing by service-id.
|
|
324
|
-
*/
|
|
325
|
-
V1 = 'edge-ws-v1',
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
// TODO(mykola): Reconcile with type in EDGE repo.
|
|
329
|
-
export type EdgeStatus = {
|
|
330
|
-
problems: string[];
|
|
331
|
-
agent: {
|
|
332
|
-
agentStatus?: string;
|
|
333
|
-
agentKey?: string;
|
|
334
|
-
haloSpaceId?: SpaceId;
|
|
335
|
-
fetchError?: string;
|
|
336
|
-
};
|
|
337
|
-
router: {
|
|
338
|
-
connectedDevices?: {
|
|
339
|
-
peerKey: string;
|
|
340
|
-
topics: string[];
|
|
341
|
-
}[];
|
|
342
|
-
metrics?: {
|
|
343
|
-
sentMessages: number;
|
|
344
|
-
receivedMessages: number;
|
|
345
|
-
sentBytes: number;
|
|
346
|
-
receivedBytes: number;
|
|
347
|
-
failedMessages: number;
|
|
348
|
-
failedBytes: number;
|
|
349
|
-
};
|
|
350
|
-
fetchError?: string;
|
|
351
|
-
};
|
|
352
|
-
spaces: {
|
|
353
|
-
data: Record<SpaceId, { diagnostics?: any & { redFlags: string[] }; fetchError?: string }>;
|
|
354
|
-
fetchError?: string;
|
|
355
|
-
};
|
|
356
|
-
};
|
|
357
|
-
|
|
358
|
-
//
|
|
359
|
-
// Space import/export.
|
|
360
|
-
//
|
|
361
|
-
|
|
362
|
-
export type ImportBundleRequest = {
|
|
363
|
-
bundle: {
|
|
364
|
-
/**
|
|
365
|
-
* DocumentId.
|
|
366
|
-
*/
|
|
367
|
-
documentId: string;
|
|
368
|
-
/**
|
|
369
|
-
* Encoded mutation.
|
|
370
|
-
*/
|
|
371
|
-
mutation: string;
|
|
372
|
-
/**
|
|
373
|
-
* Heads of the document.
|
|
374
|
-
*/
|
|
375
|
-
heads: string[];
|
|
376
|
-
}[];
|
|
377
|
-
};
|
|
378
|
-
|
|
379
|
-
export type ExportBundleRequest = {
|
|
380
|
-
/**
|
|
381
|
-
* DocumentId -> Heads (decoded heads since which we want to export).
|
|
382
|
-
*/
|
|
383
|
-
docHeads: Record<string, string[]>;
|
|
384
|
-
};
|
|
385
|
-
|
|
386
|
-
export type ExportBundleResponse = {
|
|
387
|
-
bundle: {
|
|
388
|
-
/**
|
|
389
|
-
* DocumentId.
|
|
390
|
-
*/
|
|
391
|
-
documentId: string;
|
|
392
|
-
/**
|
|
393
|
-
* Encoded mutation.
|
|
394
|
-
*/
|
|
395
|
-
mutation: string;
|
|
396
|
-
}[];
|
|
397
|
-
};
|
|
398
|
-
|
|
399
|
-
export const DocumentCodec = Object.freeze({
|
|
400
|
-
encode: (doc: Uint8Array) => Buffer.from(doc).toString('base64'),
|
|
401
|
-
decode: (doc: string) => new Uint8Array(Buffer.from(doc, 'base64')),
|
|
402
|
-
});
|
|
403
|
-
|
|
404
|
-
const MAX_ERROR_DEPTH = 3;
|
|
405
|
-
|
|
406
|
-
/**
|
|
407
|
-
* Codec for serializing and deserializing Edge Errors.
|
|
408
|
-
*/
|
|
409
|
-
export const ErrorCodec = Object.freeze({
|
|
410
|
-
encode: (err: Error, depth: number = 0): SerializedError => ({
|
|
411
|
-
code: 'code' in err ? (err as any).code : undefined,
|
|
412
|
-
message: err.message,
|
|
413
|
-
stack: err.stack,
|
|
414
|
-
cause: err.cause instanceof Error && depth < MAX_ERROR_DEPTH ? ErrorCodec.encode(err.cause, depth + 1) : undefined,
|
|
415
|
-
}),
|
|
416
|
-
decode: (serializedError: SerializedError, depth: number = 0): Error => {
|
|
417
|
-
let err: Error;
|
|
418
|
-
if (typeof serializedError.code === 'string') {
|
|
419
|
-
err = new BaseError(serializedError.code, {
|
|
420
|
-
message: serializedError.message ?? 'Unknown error',
|
|
421
|
-
cause:
|
|
422
|
-
serializedError.cause && depth < MAX_ERROR_DEPTH
|
|
423
|
-
? ErrorCodec.decode(serializedError.cause, depth + 1)
|
|
424
|
-
: undefined,
|
|
425
|
-
context: serializedError.context,
|
|
426
|
-
});
|
|
427
|
-
|
|
428
|
-
if (serializedError.stack) {
|
|
429
|
-
Object.defineProperty(err, 'stack', {
|
|
430
|
-
value: serializedError.stack,
|
|
431
|
-
});
|
|
432
|
-
}
|
|
433
|
-
} else {
|
|
434
|
-
err = new Error(serializedError.message ?? 'Unknown error', {
|
|
435
|
-
cause:
|
|
436
|
-
serializedError.cause && depth < MAX_ERROR_DEPTH
|
|
437
|
-
? ErrorCodec.decode(serializedError.cause, depth + 1)
|
|
438
|
-
: undefined,
|
|
439
|
-
});
|
|
440
|
-
|
|
441
|
-
if (serializedError.stack) {
|
|
442
|
-
Object.defineProperty(err, 'stack', {
|
|
443
|
-
value: serializedError.stack,
|
|
444
|
-
});
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
return err;
|
|
449
|
-
},
|
|
450
|
-
});
|
|
451
|
-
|
|
452
|
-
/**
|
|
453
|
-
* Codec for serializing and deserializing Edge unhandled HTTP errors.
|
|
454
|
-
*/
|
|
455
|
-
export const EdgeHttpErrorCodec = Object.freeze({
|
|
456
|
-
encode: (err: Error): Response =>
|
|
457
|
-
new Response(
|
|
458
|
-
JSON.stringify({
|
|
459
|
-
error: ErrorCodec.encode(err),
|
|
460
|
-
}),
|
|
461
|
-
{ status: 500 },
|
|
462
|
-
),
|
|
463
|
-
|
|
464
|
-
decode: async (response: Response): Promise<Error | undefined> => {
|
|
465
|
-
if (response.headers.get('Content-Type') !== 'application/json') {
|
|
466
|
-
const body = await response.clone().text();
|
|
467
|
-
return new Error(body.slice(0, 256));
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
const body = await response.clone().json();
|
|
471
|
-
if (!('error' in body)) {
|
|
472
|
-
return undefined;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
return ErrorCodec.decode(body.error);
|
|
476
|
-
},
|
|
477
|
-
});
|
package/src/query.ts
DELETED
package/src/queue.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import type { SpaceId } from '@dxos/keys';
|
|
6
|
-
|
|
7
|
-
import type { ObjectId } from './types.js';
|
|
8
|
-
|
|
9
|
-
export type QueueCursor = string & { __QueueCursor: never };
|
|
10
|
-
|
|
11
|
-
export type QueueQuery = {
|
|
12
|
-
queueId: ObjectId;
|
|
13
|
-
|
|
14
|
-
after?: QueueCursor;
|
|
15
|
-
before?: QueueCursor;
|
|
16
|
-
limit?: number;
|
|
17
|
-
reverse?: boolean;
|
|
18
|
-
objectIds?: ObjectId[];
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
// TODO(dmaretskyi): Rename QueueQueryResult.
|
|
22
|
-
export type QueryResult = {
|
|
23
|
-
// TODO(dmaretskyi): HasId & HasTypename.
|
|
24
|
-
|
|
25
|
-
objects: unknown[];
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Cursor at the end of the range.
|
|
29
|
-
*/
|
|
30
|
-
nextCursor: QueueCursor | null;
|
|
31
|
-
/**
|
|
32
|
-
* Cursor at the start of the range.
|
|
33
|
-
*/
|
|
34
|
-
prevCursor: QueueCursor | null;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Position of an object in the queue that it is in.
|
|
39
|
-
*/
|
|
40
|
-
export const KEY_QUEUE_POSITION = 'dxos.org/key/queue-position';
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Service for managing queues.
|
|
44
|
-
*/
|
|
45
|
-
export interface QueueService {
|
|
46
|
-
queryQueue(subspaceTag: string, spaceId: SpaceId, query: QueueQuery): Promise<QueryResult>;
|
|
47
|
-
|
|
48
|
-
insertIntoQueue(subspaceTag: string, spaceId: SpaceId, queueId: ObjectId, objects: unknown[]): Promise<void>;
|
|
49
|
-
|
|
50
|
-
deleteFromQueue(subspaceTag: string, spaceId: SpaceId, queueId: ObjectId, objectIds: ObjectId[]): Promise<void>;
|
|
51
|
-
}
|