@dxos/protocols 0.8.4-main.fd6878d → 0.8.4-staging.ac66bdf99f
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/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 +82 -0
- package/dist/src/FunctionProtocol.d.ts.map +1 -0
- package/dist/src/FunctionProtocol.js +4 -0
- package/dist/src/FunctionProtocol.js.map +1 -0
- package/dist/src/automerge.d.ts +8 -0
- package/dist/src/automerge.d.ts.map +1 -1
- package/dist/src/automerge.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/agent/dashboard_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/agent/dashboard_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/agent/echo-proxy_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/agent/echo-proxy_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/agent/epoch_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/agent/epoch_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/agent/functions_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/agent/functions_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/bot_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/bot_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/client/invitation_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/client/invitation_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/client/logging_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/client/logging_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/client/queue_pb.d.ts +237 -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 +44 -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 +129 -22
- 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 +90 -54
- 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 +142 -7
- package/dist/src/buf/proto/gen/dxos/config_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/config_pb.js +78 -2
- package/dist/src/buf/proto/gen/dxos/config_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/devtools/diagnostics_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/devtools/diagnostics_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/devtools/host_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/devtools/host_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/devtools/swarm_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/devtools/swarm_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/blob_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/blob_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/feed_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/feed_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/filter_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/filter_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/indexing_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/indexing_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.d.ts +7 -1
- 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 +2 -2
- package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/model/document_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/model/document_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/model/messenger_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/model/messenger_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/model/text_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/model/text_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/object_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/object_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/query_pb.d.ts +13 -3
- 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 +2 -2
- 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 +71 -10
- 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 +16 -6
- package/dist/src/buf/proto/gen/dxos/echo/service_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/snapshot_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/snapshot_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/timeframe_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/timeframe_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/edge/calls_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/edge/calls_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/edge/messenger_pb.d.ts +29 -1
- 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 +11 -6
- package/dist/src/buf/proto/gen/dxos/edge/messenger_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/edge/signal_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/edge/signal_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/error_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/error_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/field_options_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/field_options_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/google_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/google_pb.js +2 -2
- package/dist/src/buf/proto/gen/dxos/google_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/gravity_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/gravity_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/credentials/auth_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/credentials/auth_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/credentials/greet_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/credentials/greet_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/credentials/identity_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/credentials/identity_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.d.ts +40 -1
- 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 +28 -3
- 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 +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/invitations_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/keyring_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/keyring_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/keys_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/keys_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/signed_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/signed_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/iframe_pb.d.ts +2 -11
- package/dist/src/buf/proto/gen/dxos/iframe_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/iframe_pb.js +2 -2
- package/dist/src/buf/proto/gen/dxos/iframe_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/keys_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/keys_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/bridge_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/bridge_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/broadcast_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/broadcast_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/messaging_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/messaging_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/muxer_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/muxer_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/presence_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/presence_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/protocol_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/protocol_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/replicator_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/replicator_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/signal_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/signal_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/swarm_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/swarm_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/admission-discovery_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/admission-discovery_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/auth_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/auth_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/automerge_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/automerge_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/blobsync_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/blobsync_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/control_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/control_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/gossip_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/gossip_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/notarization_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/notarization_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/replicator_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/replicator_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/registry_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/registry_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/rpc_pb.d.ts +25 -1
- package/dist/src/buf/proto/gen/dxos/rpc_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/rpc_pb.js +13 -8
- package/dist/src/buf/proto/gen/dxos/rpc_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/service/agentmanager_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/service/agentmanager_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/service/publisher_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/service/publisher_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/service/supervisor_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/service/supervisor_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/service/tunnel_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/service/tunnel_pb.js +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/buf/proto/gen/dxos/type_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/type_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/value_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/value_pb.js +1 -1
- package/dist/src/buf/proto/gen/example/testing/data_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/example/testing/data_pb.js +1 -1
- package/dist/src/buf/proto/gen/example/testing/rpc_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/example/testing/rpc_pb.js +1 -1
- package/dist/src/codec.test.js +1 -1
- package/dist/src/edge/EdgeFunctionEnv.d.ts +108 -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 +511 -0
- package/dist/src/edge/edge.d.ts.map +1 -0
- package/dist/src/edge/edge.js +173 -0
- package/dist/src/edge/edge.js.map +1 -0
- package/dist/src/edge/errors.d.ts +29 -0
- package/dist/src/edge/errors.d.ts.map +1 -0
- package/dist/src/edge/errors.js +69 -0
- 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 +127 -0
- package/dist/src/edge/registry.d.ts.map +1 -0
- package/dist/src/edge/registry.js +79 -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 -19
- 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 +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 +50 -104
- package/dist/src/errors/errors.js.map +1 -1
- package/dist/src/errors/errors.test.js +2 -2
- 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/index.js +5 -5
- package/dist/src/feed-replication.d.ts.map +1 -1
- package/dist/src/index.d.ts +12 -12
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +11 -10
- package/dist/src/index.js.map +1 -1
- package/dist/src/indexing.d.ts +1 -1
- package/dist/src/indexing.d.ts.map +1 -1
- package/dist/src/indexing.js +1 -1
- package/dist/src/indexing.js.map +1 -1
- package/dist/src/indexing.test.js +1 -1
- package/dist/src/invitation.d.ts +1 -1
- package/dist/src/invitation.d.ts.map +1 -1
- package/dist/src/invitation.js +1 -1
- 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/proto/gen/dxos/client/services.d.ts +1019 -828
- package/dist/src/proto/gen/dxos/client/services.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/client/services.js +116 -100
- package/dist/src/proto/gen/dxos/client/services.js.map +1 -1
- package/dist/src/proto/gen/dxos/config.d.ts +87 -2
- 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 +31 -31
- package/dist/src/proto/gen/dxos/devtools/host.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/echo/metadata.d.ts +4 -0
- 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/query.d.ts +17 -1
- 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 +43 -8
- package/dist/src/proto/gen/dxos/echo/service.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/edge/messenger.d.ts +24 -0
- 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/halo/credentials.d.ts +15 -1
- 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/iframe.d.ts +0 -10
- 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/rpc.d.ts +19 -0
- 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/tracing.d.ts +0 -79
- package/dist/src/proto/gen/dxos/tracing.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 +42 -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/index.js +1 -1
- package/dist/src/proto/types.d.ts +1 -1
- package/dist/src/space-archive.d.ts +60 -1
- 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 +19 -17
- package/src/FeedProtocol.ts +320 -0
- package/src/FunctionProtocol.ts +102 -0
- package/src/automerge.ts +8 -0
- package/src/buf/proto/gen/dxos/agent/dashboard_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/agent/echo-proxy_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/agent/epoch_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/agent/functions_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/bot_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/client/invitation_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/client/logging_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/client/queue_pb.ts +286 -0
- package/src/buf/proto/gen/dxos/client/services_pb.ts +191 -62
- package/src/buf/proto/gen/dxos/config_pb.ts +166 -10
- package/src/buf/proto/gen/dxos/devtools/diagnostics_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/devtools/host_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/devtools/swarm_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/echo/blob_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/echo/feed_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/echo/filter_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/echo/indexing_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/echo/metadata_pb.ts +11 -4
- package/src/buf/proto/gen/dxos/echo/model/document_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/echo/model/messenger_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/echo/model/text_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/echo/object_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/echo/query_pb.ts +18 -6
- package/src/buf/proto/gen/dxos/echo/service_pb.ts +87 -18
- package/src/buf/proto/gen/dxos/echo/snapshot_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/echo/timeframe_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/edge/calls_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/edge/messenger_pb.ts +41 -8
- package/src/buf/proto/gen/dxos/edge/signal_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/error_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/field_options_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/google_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/gravity_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/halo/credentials/auth_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/halo/credentials/greet_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/halo/credentials/identity_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/halo/credentials_pb.ts +51 -5
- package/src/buf/proto/gen/dxos/halo/invitations_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/halo/keyring_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/halo/keys_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/halo/signed_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/iframe_pb.ts +5 -16
- package/src/buf/proto/gen/dxos/keys_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/bridge_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/broadcast_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/messaging_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/muxer_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/presence_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/protocol_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/replicator_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/signal_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/swarm_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/teleport/admission-discovery_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/teleport/auth_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/teleport/automerge_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/teleport/blobsync_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/teleport/control_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/teleport/gossip_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/teleport/notarization_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/teleport/replicator_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/registry_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/rpc_pb.ts +39 -10
- package/src/buf/proto/gen/dxos/service/agentmanager_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/service/publisher_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/service/supervisor_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/service/tunnel_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/tracing_pb.ts +12 -179
- package/src/buf/proto/gen/dxos/type_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/value_pb.ts +3 -3
- package/src/buf/proto/gen/example/testing/data_pb.ts +3 -3
- package/src/buf/proto/gen/example/testing/rpc_pb.ts +3 -3
- package/src/codec.test.ts +1 -1
- package/src/edge/EdgeFunctionEnv.ts +191 -0
- package/src/edge/edge.ts +604 -0
- package/src/edge/errors.ts +85 -0
- package/src/edge/index.ts +8 -0
- package/src/edge/registry.ts +96 -0
- package/src/errors/base-errors.ts +4 -20
- 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 -12
- package/src/indexing.test.ts +1 -1
- package/src/indexing.ts +1 -1
- package/src/invitation.ts +1 -1
- package/src/messenger.ts +22 -0
- package/src/proto/dxos/client/queue.proto +81 -0
- package/src/proto/dxos/client/services.proto +39 -4
- package/src/proto/dxos/config.proto +83 -40
- package/src/proto/dxos/echo/metadata.proto +3 -0
- package/src/proto/dxos/echo/query.proto +4 -1
- package/src/proto/dxos/echo/service.proto +38 -6
- package/src/proto/dxos/edge/messenger.proto +10 -0
- package/src/proto/dxos/halo/credentials.proto +15 -0
- 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/client/services.ts +1019 -828
- package/src/proto/gen/dxos/config.ts +87 -2
- package/src/proto/gen/dxos/devtools/host.ts +31 -31
- package/src/proto/gen/dxos/echo/metadata.ts +4 -0
- package/src/proto/gen/dxos/echo/query.ts +17 -1
- package/src/proto/gen/dxos/echo/service.ts +42 -8
- package/src/proto/gen/dxos/edge/messenger.ts +24 -0
- package/src/proto/gen/dxos/halo/credentials.ts +15 -1
- package/src/proto/gen/dxos/iframe.ts +0 -10
- package/src/proto/gen/dxos/rpc.ts +19 -0
- package/src/proto/gen/dxos/tracing.ts +0 -76
- package/src/proto/gen/google/protobuf.ts +326 -40
- package/src/proto/gen/index.ts +43 -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 +0 -26
- package/dist/src/edge-error.d.ts.map +0 -1
- package/dist/src/edge-error.js +0 -62
- package/dist/src/edge-error.js.map +0 -1
- package/dist/src/edge.d.ts +0 -243
- package/dist/src/edge.d.ts.map +0 -1
- package/dist/src/edge.js +0 -49
- 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 -24
- package/dist/src/queue.d.ts.map +0 -1
- package/dist/src/queue.js +0 -4
- package/dist/src/queue.js.map +0 -1
- package/src/edge-error.ts +0 -79
- package/src/edge.ts +0 -276
- package/src/query.ts +0 -8
- package/src/queue.ts +0 -33
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
|
|
7
|
+
/**
|
|
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.
|
|
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>;
|
|
26
|
+
|
|
27
|
+
/**
|
|
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.
|
|
30
|
+
*/
|
|
31
|
+
export const PluginHealthSchema = Schema.Literal('ok', 'release-missing', 'manifest-invalid', 'repo-unavailable');
|
|
32
|
+
export type PluginHealth = Schema.Schema.Type<typeof PluginHealthSchema>;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 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`).
|
|
38
|
+
*/
|
|
39
|
+
export const PluginManifestSchema = Schema.Struct({
|
|
40
|
+
...PluginMetaSchema.fields,
|
|
41
|
+
moduleFile: Schema.optional(Schema.String),
|
|
42
|
+
});
|
|
43
|
+
export type PluginManifest = Schema.Schema.Type<typeof PluginManifestSchema>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Single hydrated plugin entry returned by the registry service.
|
|
47
|
+
*/
|
|
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,
|
|
53
|
+
/**
|
|
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.
|
|
57
|
+
*/
|
|
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,
|
|
65
|
+
});
|
|
66
|
+
export type PluginEntry = Schema.Schema.Type<typeof PluginEntrySchema>;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Response body of `GET /registry/plugins`.
|
|
70
|
+
*/
|
|
71
|
+
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. */
|
|
77
|
+
refreshedAt: Schema.Number,
|
|
78
|
+
});
|
|
79
|
+
export type GetPluginsResponseBody = Schema.Schema.Type<typeof GetPluginsResponseBodySchema>;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Shape of the catalog manifest published in the upstream community-plugins repo.
|
|
83
|
+
* Extra keys (e.g. `$schema`) are permitted.
|
|
84
|
+
*/
|
|
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>;
|
|
@@ -6,37 +6,21 @@
|
|
|
6
6
|
* NOTE: Messages should be sentences (Start with a capital letter and end with a period).
|
|
7
7
|
* Errors can optionally include a JSON context object.
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
constructor(
|
|
11
|
-
readonly code: string,
|
|
12
|
-
message?: string,
|
|
13
|
-
readonly context?: Record<string, any>,
|
|
14
|
-
) {
|
|
15
|
-
// TODO(dmaretskyi): Error.cause.
|
|
16
|
-
super(message ?? code);
|
|
17
|
-
this.name = code;
|
|
18
|
-
// NOTE: Restores prototype chain (https://stackoverflow.com/a/48342359).
|
|
19
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// TODO(dmaretskyi): Consider common error classes with error codes:
|
|
24
|
-
// throw new SystemError(ERROR_CODE_OUT_OF_MEMORY, 'Out of memory', { a: 1, b: 2 });
|
|
9
|
+
import { BaseError } from '@dxos/errors';
|
|
25
10
|
|
|
26
11
|
/**
|
|
27
12
|
* User facing API Errors.
|
|
28
13
|
* E.g., something was misconfigured.
|
|
29
14
|
*/
|
|
30
|
-
export class ApiError extends BaseError {}
|
|
15
|
+
export class ApiError extends BaseError.extend('ApiError') {}
|
|
31
16
|
|
|
32
17
|
/**
|
|
33
18
|
* Internal system errors.
|
|
34
19
|
* E.g., unexpected/unrecoverable runtime error.
|
|
35
20
|
*/
|
|
36
|
-
export class SystemError extends BaseError {}
|
|
21
|
+
export class SystemError extends BaseError.extend('SystemError') {}
|
|
37
22
|
|
|
38
23
|
/**
|
|
39
24
|
* Database errors.
|
|
40
25
|
*/
|
|
41
|
-
|
|
42
|
-
export class DatabaseError extends BaseError {}
|
|
26
|
+
export class DatabaseError extends BaseError.extend('DatabaseError') {}
|
package/src/errors/encoding.ts
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type Error as SerializedErrorProto } from '../proto/gen/dxos/error.
|
|
6
|
-
|
|
7
|
-
import { reconstructError } from './helpers.js';
|
|
5
|
+
import { type Error as SerializedErrorProto } from '../proto/gen/dxos/error.ts';
|
|
6
|
+
import { reconstructError } from './helpers.ts';
|
|
8
7
|
|
|
9
8
|
export const encodeError = (err: any): SerializedErrorProto => {
|
|
10
9
|
if (typeof err === 'object' && err?.message) {
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import { describe, expect, test } from 'vitest';
|
|
6
6
|
|
|
7
|
-
import { ApiError } from './base-errors.
|
|
7
|
+
import { ApiError } from './base-errors.ts';
|
|
8
8
|
|
|
9
9
|
describe('Errors', () => {
|
|
10
10
|
test('test', async () => {
|
|
11
11
|
const runTest = async () => {
|
|
12
|
-
throw new ApiError('Test error');
|
|
12
|
+
throw new ApiError({ message: 'Test error' });
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
await expect(runTest()).rejects.toThrowError('Test error');
|
package/src/errors/errors.ts
CHANGED
|
@@ -2,208 +2,141 @@
|
|
|
2
2
|
// Copyright 2021 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { BaseError } from '@dxos/errors';
|
|
5
6
|
import { PublicKey } from '@dxos/keys';
|
|
6
7
|
|
|
7
|
-
import type { ObjectId } from '../types.
|
|
8
|
-
|
|
9
|
-
import { ApiError, BaseError, DatabaseError, SystemError } from './base-errors.js';
|
|
10
|
-
import { registerError, registerErrorMessageContext, registerErrorNoArgs } from './helpers.js';
|
|
8
|
+
import type { ObjectId } from '../types.ts';
|
|
9
|
+
import { registerError, registerErrorMessageContext, registerErrorNoArgs } from './helpers.ts';
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Thrown when request was terminated because the RPC endpoint has been closed.
|
|
14
13
|
*/
|
|
15
|
-
export class RpcClosedError extends
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
14
|
+
export class RpcClosedError extends BaseError.extend(
|
|
15
|
+
'RpcClosedError',
|
|
16
|
+
'Request was terminated because the RPC endpoint is closed.',
|
|
17
|
+
) {}
|
|
20
18
|
|
|
21
|
-
registerErrorNoArgs('
|
|
19
|
+
registerErrorNoArgs('RpcClosedError', RpcClosedError);
|
|
22
20
|
|
|
23
21
|
/**
|
|
24
22
|
* Thrown when `request` is called when RPC has not been opened.
|
|
25
23
|
*/
|
|
26
|
-
export class RpcNotOpenError extends
|
|
27
|
-
constructor() {
|
|
28
|
-
super('RPC_NOT_OPEN', 'RPC has not been opened.');
|
|
29
|
-
}
|
|
30
|
-
}
|
|
24
|
+
export class RpcNotOpenError extends BaseError.extend('RpcNotOpenError', 'RPC has not been opened.') {}
|
|
31
25
|
|
|
32
|
-
registerErrorNoArgs('
|
|
26
|
+
registerErrorNoArgs('RpcNotOpenError', RpcNotOpenError);
|
|
33
27
|
|
|
34
|
-
export class CancelledError extends
|
|
35
|
-
constructor(message?: string, context?: Record<string, any>) {
|
|
36
|
-
super('CANCELLED', message, context);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
28
|
+
export class CancelledError extends BaseError.extend('CancelledError') {}
|
|
39
29
|
|
|
40
|
-
registerErrorMessageContext('
|
|
30
|
+
registerErrorMessageContext('CancelledError', CancelledError);
|
|
41
31
|
|
|
42
|
-
export class InvalidConfigError extends
|
|
43
|
-
constructor(message?: string, context?: Record<string, any>) {
|
|
44
|
-
super('INVALID_CONFIG', message, context);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
32
|
+
export class InvalidConfigError extends BaseError.extend('InvalidConfigError') {}
|
|
47
33
|
|
|
48
|
-
registerErrorMessageContext('
|
|
34
|
+
registerErrorMessageContext('InvalidConfigError', InvalidConfigError);
|
|
49
35
|
|
|
50
36
|
/**
|
|
51
37
|
* Explicit failure to connect with remote client services.
|
|
52
38
|
*/
|
|
53
|
-
export class RemoteServiceConnectionError extends
|
|
54
|
-
constructor(message?: string, context?: Record<string, any>) {
|
|
55
|
-
super('REMOTE_SERVICE_CONNECTION_ERROR', message, context);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
39
|
+
export class RemoteServiceConnectionError extends BaseError.extend('RemoteServiceConnectionError') {}
|
|
58
40
|
|
|
59
|
-
registerErrorMessageContext('
|
|
41
|
+
registerErrorMessageContext('RemoteServiceConnectionError', RemoteServiceConnectionError);
|
|
60
42
|
|
|
61
43
|
/**
|
|
62
44
|
* Failed to open a connection to remote client services.
|
|
63
45
|
*/
|
|
64
|
-
export class RemoteServiceConnectionTimeout extends
|
|
65
|
-
constructor(message?: string, context?: Record<string, any>) {
|
|
66
|
-
super('REMOTE_SERVICE_CONNECTION_TIMEOUT', message, context);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
46
|
+
export class RemoteServiceConnectionTimeout extends BaseError.extend('RemoteServiceConnectionTimeout') {}
|
|
69
47
|
|
|
70
|
-
registerErrorMessageContext('
|
|
48
|
+
registerErrorMessageContext('RemoteServiceConnectionTimeout', RemoteServiceConnectionTimeout);
|
|
71
49
|
|
|
72
|
-
export class DataCorruptionError extends
|
|
73
|
-
constructor(message?: string, context?: Record<string, any>) {
|
|
74
|
-
super('DATA_CORRUPTION', message, context);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
50
|
+
export class DataCorruptionError extends BaseError.extend('DataCorruptionError') {}
|
|
77
51
|
|
|
78
|
-
registerErrorMessageContext('
|
|
52
|
+
registerErrorMessageContext('DataCorruptionError', DataCorruptionError);
|
|
79
53
|
|
|
80
|
-
export class InvalidInvitationExtensionRoleError extends
|
|
81
|
-
constructor(message?: string, context?: Record<string, any>) {
|
|
82
|
-
super('INVALID_INVITATION_EXTENSION_ROLE', message, context);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
54
|
+
export class InvalidInvitationExtensionRoleError extends BaseError.extend('InvalidInvitationExtensionRoleError') {}
|
|
85
55
|
|
|
86
|
-
registerErrorMessageContext('
|
|
56
|
+
registerErrorMessageContext('InvalidInvitationExtensionRoleError', InvalidInvitationExtensionRoleError);
|
|
87
57
|
|
|
88
|
-
export class IdentityNotInitializedError extends
|
|
89
|
-
constructor(message?: string, context?: Record<string, any>) {
|
|
90
|
-
super('IDENTITY_NOT_INITIALIZED', message, context);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
58
|
+
export class IdentityNotInitializedError extends BaseError.extend('IdentityNotInitializedError') {}
|
|
93
59
|
|
|
94
|
-
registerErrorMessageContext('
|
|
60
|
+
registerErrorMessageContext('IdentityNotInitializedError', IdentityNotInitializedError);
|
|
95
61
|
|
|
96
|
-
export class InvalidInvitationError extends
|
|
97
|
-
constructor(message?: string, context?: Record<string, any>) {
|
|
98
|
-
super('INVALID_INVITATION', message, context);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
62
|
+
export class InvalidInvitationError extends BaseError.extend('InvalidInvitationError') {}
|
|
101
63
|
|
|
102
|
-
registerErrorMessageContext('
|
|
64
|
+
registerErrorMessageContext('InvalidInvitationError', InvalidInvitationError);
|
|
103
65
|
|
|
104
|
-
export class AlreadyJoinedError extends
|
|
105
|
-
constructor(message?: string, context?: Record<string, any>) {
|
|
106
|
-
super('ALREADY_JOINED', message, context);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
66
|
+
export class AlreadyJoinedError extends BaseError.extend('AlreadyJoinedError') {}
|
|
109
67
|
|
|
110
|
-
registerErrorMessageContext('
|
|
68
|
+
registerErrorMessageContext('AlreadyJoinedError', AlreadyJoinedError);
|
|
111
69
|
|
|
112
|
-
export class ConnectionResetError extends BaseError {
|
|
113
|
-
constructor(message?: string, context?: any) {
|
|
114
|
-
super('CONNECTION_RESET', message, context);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
70
|
+
export class ConnectionResetError extends BaseError.extend('ConnectionResetError') {}
|
|
117
71
|
|
|
118
|
-
registerErrorMessageContext('
|
|
72
|
+
registerErrorMessageContext('ConnectionResetError', ConnectionResetError);
|
|
119
73
|
|
|
120
|
-
export class TimeoutError extends BaseError {
|
|
121
|
-
constructor(message?: string, context?: any) {
|
|
122
|
-
super('TIMEOUT', message, context);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
74
|
+
export class TimeoutError extends BaseError.extend('TimeoutError') {}
|
|
125
75
|
|
|
126
|
-
registerErrorMessageContext('
|
|
76
|
+
registerErrorMessageContext('TimeoutError', TimeoutError);
|
|
127
77
|
|
|
128
78
|
// General protocol error.
|
|
129
|
-
export class ProtocolError extends BaseError {
|
|
130
|
-
constructor(message?: string, context?: any) {
|
|
131
|
-
super('PROTOCOL_ERROR', message, context);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
79
|
+
export class ProtocolError extends BaseError.extend('ProtocolError') {}
|
|
134
80
|
|
|
135
|
-
registerErrorMessageContext(
|
|
81
|
+
registerErrorMessageContext(ProtocolError.name, ProtocolError);
|
|
136
82
|
|
|
137
83
|
// General connectivity errors.
|
|
138
|
-
export class ConnectivityError extends BaseError {
|
|
139
|
-
constructor(message?: string, context?: any) {
|
|
140
|
-
super('CONNECTIVITY_ERROR', message, context);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
84
|
+
export class ConnectivityError extends BaseError.extend('ConnectivityError') {}
|
|
143
85
|
|
|
144
|
-
registerErrorMessageContext('
|
|
86
|
+
registerErrorMessageContext('ConnectivityError', ConnectivityError);
|
|
145
87
|
|
|
146
|
-
export class RateLimitExceededError extends BaseError {
|
|
147
|
-
constructor(message?: string, context?: any) {
|
|
148
|
-
super('RATE_LIMIT_EXCEEDED', message, context);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
88
|
+
export class RateLimitExceededError extends BaseError.extend('RateLimitExceededError') {}
|
|
151
89
|
|
|
152
|
-
registerErrorMessageContext('
|
|
90
|
+
registerErrorMessageContext('RateLimitExceededError', RateLimitExceededError);
|
|
153
91
|
|
|
154
92
|
// TODO(nf): Rename? the protocol isn't what's unknown...
|
|
155
|
-
export class UnknownProtocolError extends BaseError {
|
|
156
|
-
constructor(message?: string, innerError?: Error) {
|
|
157
|
-
super('UNKNOWN_PROTOCOL_ERROR', message, innerError);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
93
|
+
export class UnknownProtocolError extends BaseError.extend('UnknownProtocolError') {}
|
|
160
94
|
|
|
161
|
-
|
|
95
|
+
registerError(UnknownProtocolError.name, (message, context) => new UnknownProtocolError({ message, context }));
|
|
162
96
|
|
|
163
|
-
export class InvalidStorageVersionError extends
|
|
97
|
+
export class InvalidStorageVersionError extends BaseError.extend(
|
|
98
|
+
'InvalidStorageVersionError',
|
|
99
|
+
'Invalid storage version.',
|
|
100
|
+
) {
|
|
164
101
|
constructor(expected: number, actual: number) {
|
|
165
|
-
super(
|
|
102
|
+
super({ context: { expected, actual } });
|
|
166
103
|
}
|
|
167
104
|
}
|
|
168
105
|
|
|
169
|
-
registerError('
|
|
106
|
+
registerError('InvalidStorageVersionError', (_, context) => {
|
|
170
107
|
return new InvalidStorageVersionError(context.expected ?? NaN, context.actual ?? NaN);
|
|
171
108
|
});
|
|
172
109
|
|
|
173
|
-
export class SpaceNotFoundError extends
|
|
110
|
+
export class SpaceNotFoundError extends BaseError.extend('SpaceNotFoundError', 'Space not found.') {
|
|
174
111
|
constructor(spaceKey: PublicKey) {
|
|
175
|
-
super(
|
|
112
|
+
super({ context: { spaceKey } });
|
|
176
113
|
}
|
|
177
114
|
}
|
|
178
115
|
|
|
179
|
-
registerError('
|
|
116
|
+
registerError('SpaceNotFoundError', (_, context) => {
|
|
180
117
|
return new SpaceNotFoundError(PublicKey.safeFrom(context.spaceKey) ?? PublicKey.from('00'));
|
|
181
118
|
});
|
|
182
119
|
|
|
183
|
-
export class EntityNotFoundError extends
|
|
120
|
+
export class EntityNotFoundError extends BaseError.extend('EntityNotFoundError', 'Item not found.') {
|
|
184
121
|
constructor(entityId: ObjectId) {
|
|
185
|
-
super(
|
|
122
|
+
super({ context: { entityId } });
|
|
186
123
|
}
|
|
187
124
|
}
|
|
188
125
|
|
|
189
|
-
registerError('
|
|
126
|
+
registerError('EntityNotFoundError', (_, context) => {
|
|
190
127
|
return new EntityNotFoundError(context.entityId);
|
|
191
128
|
});
|
|
192
129
|
|
|
193
|
-
export class UnknownModelError extends
|
|
130
|
+
export class UnknownModelError extends BaseError.extend('UnknownModelError', 'Unknown model.') {
|
|
194
131
|
constructor(model: string) {
|
|
195
|
-
super(
|
|
132
|
+
super({ context: { model } });
|
|
196
133
|
}
|
|
197
134
|
}
|
|
198
135
|
|
|
199
|
-
registerError('
|
|
136
|
+
registerError('UnknownModelError', (_, context) => {
|
|
200
137
|
return new UnknownModelError(context.model);
|
|
201
138
|
});
|
|
202
139
|
|
|
203
|
-
export class AuthorizationError extends
|
|
204
|
-
constructor(message?: string, context?: any) {
|
|
205
|
-
super('AUTHORIZATION_ERROR', message, context);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
140
|
+
export class AuthorizationError extends BaseError.extend('AuthorizationError') {}
|
|
208
141
|
|
|
209
|
-
registerErrorMessageContext('
|
|
142
|
+
registerErrorMessageContext('AuthorizationError', AuthorizationError);
|
package/src/errors/helpers.ts
CHANGED
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { BaseError } from '@dxos/errors';
|
|
5
6
|
import { invariant } from '@dxos/invariant';
|
|
6
7
|
|
|
7
|
-
import { type Error as SerializedErrorProto } from '../proto/gen/dxos/error.
|
|
8
|
-
|
|
9
|
-
import { SystemError } from './base-errors.js';
|
|
8
|
+
import { type Error as SerializedErrorProto } from '../proto/gen/dxos/error.ts';
|
|
10
9
|
|
|
11
10
|
export const reconstructError = (error: SerializedErrorProto) => {
|
|
12
11
|
const { name, message, context } = error;
|
|
@@ -20,21 +19,21 @@ export const registerError = (code: string, make: (message?: string, context?: a
|
|
|
20
19
|
errorRegistry.set(code, make);
|
|
21
20
|
};
|
|
22
21
|
|
|
23
|
-
export const registerErrorNoArgs = (code: string, Constructor: { new (): Error }) => {
|
|
22
|
+
export const registerErrorNoArgs = (code: string, Constructor: { new (options?: any): Error }) => {
|
|
24
23
|
registerError(code, () => new Constructor());
|
|
25
24
|
};
|
|
26
25
|
|
|
27
26
|
export const registerErrorMessageContext = (
|
|
28
27
|
code: string,
|
|
29
|
-
Constructor: { new (message?: string
|
|
28
|
+
Constructor: { new (options?: { message?: string; context?: any }): Error },
|
|
30
29
|
) => {
|
|
31
|
-
registerError(code, (message?: string, context?:
|
|
30
|
+
registerError(code, (message?: string, context?: any) => new Constructor({ message, context }));
|
|
32
31
|
};
|
|
33
32
|
|
|
34
33
|
export const errorFromCode = (code?: string, message?: string, context?: any) => {
|
|
35
34
|
if (code && errorRegistry.has(code)) {
|
|
36
35
|
return errorRegistry.get(code)!(message, context);
|
|
37
36
|
} else {
|
|
38
|
-
return new
|
|
37
|
+
return new BaseError(code ?? 'Error', { message, context });
|
|
39
38
|
}
|
|
40
39
|
};
|
package/src/errors/index.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export * from './encoding.
|
|
6
|
-
export * from './errors.
|
|
7
|
-
export * from './helpers.
|
|
8
|
-
export * from './base-errors.
|
|
9
|
-
export * from './parameter.
|
|
5
|
+
export * from './encoding.ts';
|
|
6
|
+
export * from './errors.ts';
|
|
7
|
+
export * from './helpers.ts';
|
|
8
|
+
export * from './base-errors.ts';
|
|
9
|
+
export * from './parameter.ts';
|
package/src/feed-replication.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
// Copyright 2021 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './
|
|
12
|
-
export * from './
|
|
13
|
-
export * from './
|
|
14
|
-
export type * from './
|
|
15
|
-
export * from './
|
|
16
|
-
export * from './
|
|
5
|
+
export * from './automerge.ts';
|
|
6
|
+
export * from './edge/index.ts';
|
|
7
|
+
export * from './errors/index.ts';
|
|
8
|
+
export * from './indexing.ts';
|
|
9
|
+
export * from './messenger.ts';
|
|
10
|
+
export * from './profile-archive.ts';
|
|
11
|
+
export * from './space-archive.ts';
|
|
12
|
+
export * from './storage.ts';
|
|
13
|
+
export * from './tracing.ts';
|
|
14
|
+
export type * from './types.ts';
|
|
15
|
+
export * as FunctionProtocol from './FunctionProtocol.ts';
|
|
16
|
+
export * as FeedProtocol from './FeedProtocol.ts';
|
package/src/indexing.test.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { describe, expect, test } from 'vitest';
|
|
6
6
|
|
|
7
|
-
import { ObjectPointerVersion, objectPointerCodec } from './indexing.
|
|
7
|
+
import { ObjectPointerVersion, objectPointerCodec } from './indexing.ts';
|
|
8
8
|
|
|
9
9
|
describe('Indexing object pointer codec', () => {
|
|
10
10
|
test('getVersion', async () => {
|
package/src/indexing.ts
CHANGED
package/src/invitation.ts
CHANGED
package/src/messenger.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type CleanupFn } from '@dxos/async';
|
|
6
|
+
|
|
7
|
+
import { type GossipMessage } from './proto/gen/dxos/mesh/teleport/gossip';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Message passing abstraction.
|
|
11
|
+
*/
|
|
12
|
+
export interface Messenger {
|
|
13
|
+
/**
|
|
14
|
+
* Register channel listener.
|
|
15
|
+
*/
|
|
16
|
+
listen: (channel: string, callback: (message: GossipMessage) => void) => CleanupFn;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Send message to channel.
|
|
20
|
+
*/
|
|
21
|
+
postMessage: (channel: string, message: any) => Promise<void>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package dxos.client.services;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/empty.proto";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
message QueueQuery {
|
|
9
|
+
string space_id = 1;
|
|
10
|
+
|
|
11
|
+
optional string queues_namespace = 2;
|
|
12
|
+
|
|
13
|
+
/// Queries the whole space if missing.
|
|
14
|
+
repeated string queue_ids = 3;
|
|
15
|
+
|
|
16
|
+
/// Filter items after this cursor. Exclusive.
|
|
17
|
+
optional string after = 4;
|
|
18
|
+
|
|
19
|
+
/// Filter items before this cursor. Exclusive.
|
|
20
|
+
optional string before = 5;
|
|
21
|
+
|
|
22
|
+
/// Filter items after this position. Inclusive.
|
|
23
|
+
optional int64 begin_position = 6;
|
|
24
|
+
|
|
25
|
+
/// Filter items before this position. Exclusive.
|
|
26
|
+
optional int64 end_position = 7;
|
|
27
|
+
|
|
28
|
+
optional int32 limit = 8;
|
|
29
|
+
optional bool reverse = 9;
|
|
30
|
+
|
|
31
|
+
// TODO(dmaretskyi): Remove this field -- raw queues dont index object IDs anymore.
|
|
32
|
+
repeated string object_ids = 100;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
message QueueQueryResult {
|
|
36
|
+
/// JSON-encoded object payloads. Each entry is a serialized ObjectJSON.
|
|
37
|
+
/// We use JSON strings instead of google.protobuf.Struct because Struct
|
|
38
|
+
/// coerces `undefined` to `null`, corrupting optional fields.
|
|
39
|
+
repeated string objects = 1;
|
|
40
|
+
|
|
41
|
+
/// Cursor to query the next items. Can be passed to `after` in query to keep querying.
|
|
42
|
+
string next_cursor = 2;
|
|
43
|
+
|
|
44
|
+
string prev_cursor = 3;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
message QueryQueueRequest {
|
|
48
|
+
QueueQuery query = 1;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
message InsertIntoQueueRequest {
|
|
52
|
+
string subspace_tag = 1;
|
|
53
|
+
string space_id = 2;
|
|
54
|
+
string queue_id = 3;
|
|
55
|
+
/// JSON-encoded object payloads. Each entry is a serialized ObjectJSON.
|
|
56
|
+
repeated string objects = 4;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
message DeleteFromQueueRequest {
|
|
60
|
+
string subspace_tag = 1;
|
|
61
|
+
string space_id = 2;
|
|
62
|
+
string queue_id = 3;
|
|
63
|
+
repeated string object_ids = 4;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
message SyncQueueRequest {
|
|
67
|
+
string subspace_tag = 1;
|
|
68
|
+
string space_id = 2;
|
|
69
|
+
string queue_id = 3;
|
|
70
|
+
/// Whether to push local changes to the server. Defaults to true.
|
|
71
|
+
optional bool should_push = 4;
|
|
72
|
+
/// Whether to pull remote changes from the server. Defaults to true.
|
|
73
|
+
optional bool should_pull = 5;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
service QueueService {
|
|
77
|
+
rpc QueryQueue(QueryQueueRequest) returns (QueueQueryResult);
|
|
78
|
+
rpc InsertIntoQueue(InsertIntoQueueRequest) returns (google.protobuf.Empty);
|
|
79
|
+
rpc DeleteFromQueue(DeleteFromQueueRequest) returns (google.protobuf.Empty);
|
|
80
|
+
rpc SyncQueue(SyncQueueRequest) returns (google.protobuf.Empty);
|
|
81
|
+
}
|