@dxos/echo-query 0.8.4-main.c85a9c8dae → 0.8.4-main.d05673bc65

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.
@@ -7874,8 +7874,8 @@ type QueueSubspaceTag = (typeof QueueSubspaceTags)[keyof typeof QueueSubspaceTag
7874
7874
  * dxn:echo:<space key>:<echo id>
7875
7875
  * dxn:echo:BA25QRC2FEWCSAMRP4RZL65LWJ7352CKE:01J00J9B45YHYSGZQTQMSKMGJ6
7876
7876
  * dxn:echo:@:01J00J9B45YHYSGZQTQMSKMGJ6
7877
- * dxn:type:dxos.org/type/Calendar
7878
- * dxn:plugin:dxos.org/agent/plugin/functions
7877
+ * dxn:type:org.dxos.type.calendar
7878
+ * dxn:plugin:org.dxos.agent.plugin.functions
7879
7879
  * ```
7880
7880
  */
7881
7881
  declare class DXN {
@@ -7912,11 +7912,11 @@ declare class DXN {
7912
7912
  static parse(dxn: string): DXN;
7913
7913
  static tryParse(dxn: string): DXN | undefined;
7914
7914
  /**
7915
- * @example `dxn:type:example.com/type/Person`
7915
+ * @example `dxn:type:com.example.type.person`
7916
7916
  */
7917
7917
  static fromTypename(typename: string): DXN;
7918
7918
  /**
7919
- * @example `dxn:type:example.com/type/Person:0.1.0`
7919
+ * @example `dxn:type:com.example.type.person:0.1.0`
7920
7920
  */
7921
7921
  static fromTypenameAndVersion(typename: string, version: string): DXN;
7922
7922
  /**
@@ -8394,7 +8394,138 @@ declare global {
8394
8394
  * @category Constructors
8395
8395
  */
8396
8396
  //#endregion
8397
- //#region ../echo/dist/types/src/internal/json-schema/json-schema-type.d.ts
8397
+ //#region ../echo/dist/types/src/internal/Entity/entity.d.ts
8398
+ type EchoTypeSchemaProps<T$1, ExtraFields = {}> = Simplify$1<AnyEntity & ToMutable<T$1> & ExtraFields>;
8399
+ interface EchoTypeSchema<Self extends Schema.Any, ExtraFields = {}, K$1 extends EntityKind = EntityKind, Fields extends Struct.Fields = Struct.Fields> extends TypeMeta, AnnotableClass<EchoTypeSchema<Self, ExtraFields, K$1, Fields>, EchoTypeSchemaProps<Schema.Type<Self>, ExtraFields>, EchoTypeSchemaProps<Schema.Encoded<Self>, ExtraFields>, Schema.Context<Self>> {
8400
+ /**
8401
+ * Schema kind key that marks this as an ECHO schema and indicates its kind.
8402
+ * Makes EchoTypeSchema satisfy the Type.AnyObj or Type.Relation.Any type.
8403
+ */
8404
+ readonly [SchemaKindId]: K$1;
8405
+ /**
8406
+ * The fields defined in the original struct schema.
8407
+ * Allows accessing field definitions for introspection.
8408
+ */
8409
+ readonly fields: Fields;
8410
+ instanceOf(value: unknown): boolean;
8411
+ }
8412
+ declare namespace Filter_d_exports {
8413
+ export { Any$3 as Any, Filter, Props, TextSearchOptions, Type$2 as Type, and, between, contains, eq, everything, foreignKeys, fromAst$1 as fromAst, gt, gte, id, in$ as in, is$1 as is, lt, lte, neq, not, nothing, or, props, tag, text, type$2 as type, typeDXN, typename$1 as typename };
8414
+ }
8415
+ interface Filter<T$1> {
8416
+ '~Filter': {
8417
+ value: Contravariant<T$1>;
8418
+ };
8419
+ ast: Filter$1;
8420
+ }
8421
+ type Props<T$1> = { [K in keyof T$1 & string]?: Filter<T$1[K]> | T$1[K] };
8422
+ type Any$3 = Filter<any>;
8423
+ type Type$2<F extends Any$3> = F extends Filter<infer T> ? T : never;
8424
+ declare class FilterClass implements Any$3 {
8425
+ readonly ast: Filter$1;
8426
+ private static 'variance';
8427
+ constructor(ast: Filter$1);
8428
+ '~Filter': {
8429
+ value: Contravariant<any>;
8430
+ };
8431
+ }
8432
+ declare const is$1: (value: unknown) => value is Any$3;
8433
+ /** Construct a filter from an ast. */
8434
+ declare const fromAst$1: (ast: Filter$1) => Any$3;
8435
+ /**
8436
+ * Filter that matches all objects.
8437
+ */
8438
+ declare const everything: () => FilterClass;
8439
+ /**
8440
+ * Filter that matches no objects.
8441
+ */
8442
+ declare const nothing: () => FilterClass;
8443
+ declare const id: (...ids: ObjectId[]) => Any$3;
8444
+ /**
8445
+ * Filter by type.
8446
+ */
8447
+ declare const type$2: <S$1 extends Schema.All>(schema: S$1 | string, props?: Props<Schema.Type<S$1>>) => Filter<Schema.Type<S$1>>;
8448
+ /**
8449
+ * Filter by non-qualified typename.
8450
+ */
8451
+ declare const typename$1: (typename: string) => Any$3;
8452
+ /**
8453
+ * Filter by fully qualified type DXN.
8454
+ */
8455
+ declare const typeDXN: (dxn: DXN) => Any$3;
8456
+ /**
8457
+ * Filter by tag.
8458
+ */
8459
+ declare const tag: (tag: string) => Any$3;
8460
+ /**
8461
+ * Filter by properties.
8462
+ */
8463
+ declare const props: <T$1>(props: Props<T$1>) => Filter<T$1>;
8464
+ type TextSearchOptions = {
8465
+ type?: 'full-text' | 'vector';
8466
+ };
8467
+ /**
8468
+ * Full-text or vector search.
8469
+ */
8470
+ declare const text: (text: string, options?: TextSearchOptions) => Any$3;
8471
+ /**
8472
+ * Filter by foreign keys.
8473
+ */
8474
+ declare const foreignKeys: <S$1 extends Schema.All>(schema: S$1 | string, keys: ForeignKey[]) => Filter<Schema.Type<S$1>>;
8475
+ /**
8476
+ * Predicate for property to be equal to the provided value.
8477
+ */
8478
+ declare const eq: <T$1>(value: T$1) => Filter<T$1 | undefined>;
8479
+ /**
8480
+ * Predicate for property to be not equal to the provided value.
8481
+ */
8482
+ declare const neq: <T$1>(value: T$1) => Filter<T$1 | undefined>;
8483
+ /**
8484
+ * Predicate for property to be greater than the provided value.
8485
+ */
8486
+ declare const gt: <T$1>(value: T$1) => Filter<T$1 | undefined>;
8487
+ /**
8488
+ * Predicate for property to be greater than or equal to the provided value.
8489
+ */
8490
+ declare const gte: <T$1>(value: T$1) => Filter<T$1 | undefined>;
8491
+ /**
8492
+ * Predicate for property to be less than the provided value.
8493
+ */
8494
+ declare const lt: <T$1>(value: T$1) => Filter<T$1 | undefined>;
8495
+ /**
8496
+ * Predicate for property to be less than or equal to the provided value.
8497
+ */
8498
+ declare const lte: <T$1>(value: T$1) => Filter<T$1 | undefined>;
8499
+ /**
8500
+ * Predicate for property to be in the provided array.
8501
+ * @param values - Values to check against.
8502
+ */
8503
+ declare const in$: <T$1>(...values: T$1[]) => Filter<T$1 | undefined>;
8504
+ /**
8505
+ * Predicate for an array property to contain the provided value.
8506
+ * @param value - Value to check against.
8507
+ */
8508
+ declare const contains: <T$1>(value: T$1) => Filter<readonly T$1[] | undefined>;
8509
+ /**
8510
+ * Predicate for property to be in the provided range.
8511
+ * @param from - Start of the range (inclusive).
8512
+ * @param to - End of the range (exclusive).
8513
+ */
8514
+ declare const between: <T$1>(from: T$1, to: T$1) => Filter<unknown>;
8515
+ /**
8516
+ * Negate the filter.
8517
+ */
8518
+ declare const not: <F extends Any$3>(filter: F) => Filter<Type$2<F>>;
8519
+ /**
8520
+ * Combine filters with a logical AND.
8521
+ */
8522
+ declare const and: <Filters extends readonly Any$3[]>(...filters: Filters) => Filter<Type$2<Filters[number]>>;
8523
+ /**
8524
+ * Combine filters with a logical OR.
8525
+ */
8526
+ declare const or: <Filters extends readonly Any$3[]>(...filters: Filters) => Filter<Type$2<Filters[number]>>;
8527
+ //#endregion
8528
+ //#region ../echo/dist/types/src/internal/JsonSchema/json-schema-type.d.ts
8398
8529
  /**
8399
8530
  * Describes a schema for the JSON-schema objects stored in ECHO.
8400
8531
  * Contains extensions for ECHO (e.g., references).
@@ -8427,7 +8558,7 @@ declare const _JsonSchemaType: Struct<{
8427
8558
  * Typename of this schema.
8428
8559
  * Only on schema representing an ECHO object.
8429
8560
  *
8430
- * @example 'example.com/type/MyType'
8561
+ * @example 'com.example.type.my-type'
8431
8562
  */
8432
8563
  typename: optional<typeof String$>;
8433
8564
  /**
@@ -8520,7 +8651,7 @@ declare const _JsonSchemaType: Struct<{
8520
8651
  patternProperties: optional<Record$<typeof String$, suspend<JsonSchemaType, JsonSchemaType, never>>>;
8521
8652
  propertyNames: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
8522
8653
  definitions: optional<Record$<typeof String$, suspend<JsonSchemaType, JsonSchemaType, never>>>;
8523
- dependencies: optional<Record$<typeof String$, suspend<string | JsonSchemaType | readonly string[], string | JsonSchemaType | readonly string[], never>>>;
8654
+ dependencies: optional<Record$<typeof String$, suspend<string | readonly string[] | JsonSchemaType, string | readonly string[] | JsonSchemaType, never>>>;
8524
8655
  contentMediaType: optional<typeof String$>;
8525
8656
  contentEncoding: optional<typeof String$>;
8526
8657
  if: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
@@ -8606,7 +8737,7 @@ declare const _JsonSchemaType: Struct<{
8606
8737
  interface JsonSchemaType extends Schema.Type<typeof _JsonSchemaType> {}
8607
8738
  declare const JsonSchemaType: Schema<JsonSchemaType>;
8608
8739
  //#endregion
8609
- //#region ../echo/dist/types/src/internal/ref/ref.d.ts
8740
+ //#region ../echo/dist/types/src/internal/Ref/ref.d.ts
8610
8741
  declare const RefTypeId: unique symbol;
8611
8742
  /**
8612
8743
  * Reference Schema.
@@ -8724,136 +8855,168 @@ interface RefResolver {
8724
8855
  resolveSchema(dxn: DXN): Promise<Schema.AnyNoContext | undefined>;
8725
8856
  }
8726
8857
  //#endregion
8727
- //#region ../echo/dist/types/src/internal/entities/entity.d.ts
8728
- type EchoTypeSchemaProps<T$1, ExtraFields = {}> = Simplify$1<AnyEntity & ToMutable<T$1> & ExtraFields>;
8729
- interface EchoTypeSchema<Self extends Schema.Any, ExtraFields = {}, K$1 extends EntityKind = EntityKind, Fields extends Struct.Fields = Struct.Fields> extends TypeMeta, AnnotableClass<EchoTypeSchema<Self, ExtraFields, K$1, Fields>, EchoTypeSchemaProps<Schema.Type<Self>, ExtraFields>, EchoTypeSchemaProps<Schema.Encoded<Self>, ExtraFields>, Schema.Context<Self>> {
8730
- /**
8731
- * Schema kind key that marks this as an ECHO schema and indicates its kind.
8732
- * Makes EchoTypeSchema satisfy the Type.AnyObj or Type.Relation.Any type.
8733
- */
8734
- readonly [SchemaKindId]: K$1;
8735
- /**
8736
- * The fields defined in the original struct schema.
8737
- * Allows accessing field definitions for introspection.
8738
- */
8739
- readonly fields: Fields;
8740
- instanceOf(value: unknown): boolean;
8741
- }
8742
- declare namespace Filter_d_exports {
8743
- export { Any$3 as Any, Filter, Props, TextSearchOptions, Type$2 as Type, and, between, contains, eq, everything, foreignKeys, fromAst$1 as fromAst, gt, gte, id, in$ as in, is$1 as is, lt, lte, neq, not, nothing, or, props, tag, text, type$2 as type, typeDXN, typename$1 as typename };
8744
- }
8745
- interface Filter<T$1> {
8746
- '~Filter': {
8747
- value: Contravariant<T$1>;
8748
- };
8749
- ast: Filter$1;
8750
- }
8751
- type Props<T$1> = { [K in keyof T$1 & string]?: Filter<T$1[K]> | T$1[K] };
8752
- type Any$3 = Filter<any>;
8753
- type Type$2<F extends Any$3> = F extends Filter<infer T> ? T : never;
8754
- declare class FilterClass implements Any$3 {
8755
- readonly ast: Filter$1;
8756
- private static 'variance';
8757
- constructor(ast: Filter$1);
8758
- '~Filter': {
8759
- value: Contravariant<any>;
8760
- };
8761
- }
8762
- declare const is$1: (value: unknown) => value is Any$3;
8763
- /** Construct a filter from an ast. */
8764
- declare const fromAst$1: (ast: Filter$1) => Any$3;
8765
- /**
8766
- * Filter that matches all objects.
8767
- */
8768
- declare const everything: () => FilterClass;
8769
- /**
8770
- * Filter that matches no objects.
8771
- */
8772
- declare const nothing: () => FilterClass;
8773
- declare const id: (...ids: ObjectId[]) => Any$3;
8774
- /**
8775
- * Filter by type.
8776
- */
8777
- declare const type$2: <S$1 extends Schema.All>(schema: S$1 | string, props?: Props<Schema.Type<S$1>>) => Filter<Schema.Type<S$1>>;
8778
- /**
8779
- * Filter by non-qualified typename.
8780
- */
8781
- declare const typename$1: (typename: string) => Any$3;
8782
- /**
8783
- * Filter by fully qualified type DXN.
8784
- */
8785
- declare const typeDXN: (dxn: DXN) => Any$3;
8786
- /**
8787
- * Filter by tag.
8788
- */
8789
- declare const tag: (tag: string) => Any$3;
8790
- /**
8791
- * Filter by properties.
8792
- */
8793
- declare const props: <T$1>(props: Props<T$1>) => Filter<T$1>;
8794
- type TextSearchOptions = {
8795
- type?: 'full-text' | 'vector';
8796
- };
8797
- /**
8798
- * Full-text or vector search.
8799
- */
8800
- declare const text: (text: string, options?: TextSearchOptions) => Any$3;
8801
- /**
8802
- * Filter by foreign keys.
8803
- */
8804
- declare const foreignKeys: <S$1 extends Schema.All>(schema: S$1 | string, keys: ForeignKey[]) => Filter<Schema.Type<S$1>>;
8805
- /**
8806
- * Predicate for property to be equal to the provided value.
8807
- */
8808
- declare const eq: <T$1>(value: T$1) => Filter<T$1 | undefined>;
8809
- /**
8810
- * Predicate for property to be not equal to the provided value.
8811
- */
8812
- declare const neq: <T$1>(value: T$1) => Filter<T$1 | undefined>;
8813
- /**
8814
- * Predicate for property to be greater than the provided value.
8815
- */
8816
- declare const gt: <T$1>(value: T$1) => Filter<T$1 | undefined>;
8817
- /**
8818
- * Predicate for property to be greater than or equal to the provided value.
8819
- */
8820
- declare const gte: <T$1>(value: T$1) => Filter<T$1 | undefined>;
8821
- /**
8822
- * Predicate for property to be less than the provided value.
8823
- */
8824
- declare const lt: <T$1>(value: T$1) => Filter<T$1 | undefined>;
8825
- /**
8826
- * Predicate for property to be less than or equal to the provided value.
8827
- */
8828
- declare const lte: <T$1>(value: T$1) => Filter<T$1 | undefined>;
8829
- /**
8830
- * Predicate for property to be in the provided array.
8831
- * @param values - Values to check against.
8832
- */
8833
- declare const in$: <T$1>(...values: T$1[]) => Filter<T$1 | undefined>;
8858
+ //#region ../echo/dist/types/src/internal/Obj/typed-object.d.ts
8834
8859
  /**
8835
- * Predicate for an array property to contain the provided value.
8836
- * @param value - Value to check against.
8860
+ * Definition for an object type that can be stored in an ECHO database.
8861
+ * Implements effect schema to define object properties.
8862
+ * Has a typename and version.
8863
+ *
8864
+ * In contrast to {@link EchoSchema} this definition is not recorded in the database.
8865
+ *
8866
+ * @deprecated Use `Type.AnyObj` from `@dxos/echo` instead.
8837
8867
  */
8838
- declare const contains: <T$1>(value: T$1) => Filter<readonly T$1[] | undefined>;
8868
+ interface TypedObject<A$1 = any, I$1 = any> extends TypeMeta, Schema<A$1, I$1> {}
8839
8869
  /**
8840
- * Predicate for property to be in the provided range.
8841
- * @param from - Start of the range (inclusive).
8842
- * @param to - End of the range (exclusive).
8870
+ * Typed object that could be used as a prototype in class definitions.
8871
+ * This is an internal API type.
8872
+ *
8873
+ * @deprecated Use `Type.AnyObj` from `@dxos/echo` instead.
8843
8874
  */
8844
- declare const between: <T$1>(from: T$1, to: T$1) => Filter<unknown>;
8875
+ interface TypedObjectPrototype<A$1 = any, I$1 = any> extends TypedObject<A$1, I$1> {
8876
+ /** Type constructor. */
8877
+ new (): AnyEntity & A$1;
8878
+ }
8879
+ //#endregion
8880
+ //#region ../echo/dist/types/src/internal/Type/persistent-schema.d.ts
8845
8881
  /**
8846
- * Negate the filter.
8882
+ * Persistent representation of a schema.
8847
8883
  */
8848
- declare const not: <F extends Any$3>(filter: F) => Filter<Type$2<F>>;
8884
+ declare const PersistentSchema: EchoObjectSchema<Struct<{
8885
+ name: optional<typeof String$>;
8886
+ typename: refine<string, typeof String$>;
8887
+ version: refine<string, typeof String$>;
8888
+ jsonSchema: Schema<JsonSchemaType, JsonSchemaType, never>;
8889
+ }>, Readonly<{
8890
+ name: optional<typeof String$>;
8891
+ typename: refine<string, typeof String$>;
8892
+ version: refine<string, typeof String$>;
8893
+ jsonSchema: Schema<JsonSchemaType, JsonSchemaType, never>;
8894
+ }>>;
8895
+ interface PersistentSchema extends Schema.Type<typeof PersistentSchema> {}
8896
+ //#endregion
8897
+ //#region ../echo/dist/types/src/internal/Type/echo-schema.d.ts
8849
8898
  /**
8850
- * Combine filters with a logical AND.
8899
+ * Base schema type.
8851
8900
  */
8852
- declare const and: <Filters extends readonly Any$3[]>(...filters: Filters) => Filter<Type$2<Filters[number]>>;
8901
+ interface BaseSchema<A$1 = any, I$1 = any> extends TypedObject<A$1, I$1> {
8902
+ get readonly(): boolean;
8903
+ get mutable(): EchoSchema<A$1, I$1>;
8904
+ get snapshot(): Schema<A$1, I$1>;
8905
+ get jsonSchema(): JsonSchemaType;
8906
+ }
8907
+ declare const EchoSchema_base: TypedObjectPrototype<any, any>;
8853
8908
  /**
8854
- * Combine filters with a logical OR.
8909
+ * Represents a schema that is persisted in the ECHO database.
8910
+ * Schema can me mutable or readonly (specified by the {@link EchoSchema.readonly} field).
8911
+ *
8912
+ * Schema that can be modified at runtime via the API.
8913
+ * Is an instance of effect-schema (`Schema.Schema.AnyNoContext`) so it can be used in the same way as a regular schema.
8914
+ * IMPORTANT: The schema AST will change reactively when the schema is updated, including synced updates from remote peers.
8915
+ *
8916
+ * The class constructor is a schema instance itself, and can be used in the echo object definitions:
8917
+ *
8918
+ * @example
8919
+ * ```ts
8920
+ * export class TableType extends Schema.Struct({...}).pipe(Type.object({ typename: 'com.example.type.table', version: '0.1.0' })){
8921
+ * title: Schema.String,
8922
+ * schema: Schema.optional(ref(EchoSchema)),
8923
+ * props: Schema.mutable(S.Array(TablePropSchema)),
8924
+ * }) {}
8925
+ * ```
8926
+ *
8927
+ * The ECHO API will translate any references to PersistentSchema objects to be resolved as EchoSchema objects.
8855
8928
  */
8856
- declare const or: <Filters extends readonly Any$3[]>(...filters: Filters) => Filter<Type$2<Filters[number]>>;
8929
+ declare class EchoSchema<A$1 = any, I$1 = any> extends EchoSchema_base implements BaseSchema<A$1, I$1> {
8930
+ private readonly _persistentSchema;
8931
+ private _schema;
8932
+ private _isDirty;
8933
+ /**
8934
+ * Schema kind key that marks this as an ECHO schema.
8935
+ * Makes EchoSchema satisfy the Type.AnyObj type.
8936
+ */
8937
+ readonly [SchemaKindId]: EntityKind.Object;
8938
+ constructor(_persistentSchema: PersistentSchema);
8939
+ get [TypeId$1](): {
8940
+ _A: (_: any) => any;
8941
+ _I: (_: any) => any;
8942
+ _R: (_: never) => never;
8943
+ };
8944
+ get Type(): A$1;
8945
+ get Encoded(): I$1;
8946
+ get Context(): never;
8947
+ get ast(): AST;
8948
+ get annotations(): (annotations: Annotations.GenericSchema<any>) => Schema<any, any, never>;
8949
+ get pipe(): Schema.AnyNoContext['pipe'];
8950
+ get kind(): EntityKind.Object;
8951
+ get typename(): string;
8952
+ get version(): string;
8953
+ get readonly(): boolean;
8954
+ /**
8955
+ * Returns an immutable schema snapshot of the current state of the schema.
8956
+ */
8957
+ get snapshot(): Schema.AnyNoContext;
8958
+ /**
8959
+ * Returns the JSON schema for the schema.
8960
+ */
8961
+ get jsonSchema(): JsonSchemaType;
8962
+ /**
8963
+ * Returns a mutable schema.
8964
+ */
8965
+ get mutable(): EchoSchema;
8966
+ /**
8967
+ * Id of the ECHO object containing the schema.
8968
+ */
8969
+ get id(): ObjectId;
8970
+ /**
8971
+ * Short name of the schema.
8972
+ */
8973
+ get name(): string | undefined;
8974
+ get [SchemaMetaSymbol](): SchemaMeta;
8975
+ /**
8976
+ * Reference to the underlying persistent schema object.
8977
+ */
8978
+ get persistentSchema(): PersistentType;
8979
+ getProperties(): PropertySignature$1[];
8980
+ /**
8981
+ * @throws Error if the schema is readonly.
8982
+ */
8983
+ updateTypename(typename: string): void;
8984
+ /**
8985
+ * @throws Error if the schema is readonly.
8986
+ */
8987
+ addFields(fields: Struct.Fields): void;
8988
+ /**
8989
+ * @throws Error if the schema is readonly.
8990
+ */
8991
+ updateFields(fields: Struct.Fields): void;
8992
+ /**
8993
+ * @throws Error if the schema is readonly.
8994
+ */
8995
+ updateFieldPropertyName({
8996
+ before,
8997
+ after
8998
+ }: {
8999
+ before: PropertyKey;
9000
+ after: PropertyKey;
9001
+ }): void;
9002
+ /**
9003
+ * @throws Error if the schema is readonly.
9004
+ */
9005
+ removeFields(fieldNames: string[]): void;
9006
+ /**
9007
+ * Wrapper for Obj.change that handles the change context for the persistent schema.
9008
+ */
9009
+ private _change;
9010
+ /**
9011
+ * Called by DatabaseSchemaRegistry on update.
9012
+ */
9013
+ _invalidate(): void;
9014
+ /**
9015
+ * Rebuilds this schema if it is dirty.
9016
+ */
9017
+ _rebuild(): void;
9018
+ _getSchema(): Schema.AnyNoContext;
9019
+ }
8857
9020
  //#endregion
8858
9021
  //#region ../echo/dist/types/src/Relation.d.ts
8859
9022
  type Endpoints$1<Source, Target$1> = {
@@ -9164,7 +9327,7 @@ type Query$1 = {
9164
9327
  * @default false
9165
9328
  *
9166
9329
  * The system schema include but are not limited to:
9167
- * - dxos.org/type/Schema
9330
+ * - org.dxos.type.schema
9168
9331
  */
9169
9332
  includeSystem?: boolean;
9170
9333
  };
@@ -9240,7 +9403,7 @@ interface RefResolverOptions {
9240
9403
  middleware?: (obj: AnyProperties) => AnyProperties;
9241
9404
  }
9242
9405
  /**
9243
- *
9406
+ * Manages cross-space database interactions.
9244
9407
  */
9245
9408
  interface Hypergraph extends Queryable {
9246
9409
  get schemaRegistry(): SchemaRegistry;
@@ -9263,6 +9426,11 @@ interface Hypergraph extends Queryable {
9263
9426
  * @returns Result of `onLoad`.
9264
9427
  */
9265
9428
  createRefResolver(options: RefResolverOptions): Resolver;
9429
+ /**
9430
+ * Get a database by space ID.
9431
+ * @returns The database for the given space ID, or undefined if not found.
9432
+ */
9433
+ getDatabase(spaceId: SpaceId): Database | undefined;
9266
9434
  }
9267
9435
  //#endregion
9268
9436
  //#region ../echo/dist/types/src/Collection.d.ts
@@ -9281,7 +9449,7 @@ interface Collection extends Schema.Type<typeof Collection> {}
9281
9449
  *
9282
9450
  * @example
9283
9451
  * ```ts
9284
- * const feed = Obj.make(Feed.Feed, { name: 'notifications', kind: 'dxos.org/plugin/notifications/v1' });
9452
+ * const feed = Obj.make(Feed.Feed, { name: 'notifications', kind: 'org.dxos.plugin.notifications.v1' });
9285
9453
  * ```
9286
9454
  */
9287
9455
  declare const Feed: Obj$1<{
@@ -9580,7 +9748,7 @@ type FlushOptions = {
9580
9748
  disk?: boolean;
9581
9749
  /**
9582
9750
  * Wait for pending index updates.
9583
- * @default false
9751
+ * @default true
9584
9752
  */
9585
9753
  indexes?: boolean;
9586
9754
  /**
@@ -9636,7 +9804,7 @@ interface Database extends Queryable {
9636
9804
  }
9637
9805
  declare const Database: Schema<Database>;
9638
9806
  //#endregion
9639
- //#region ../echo/dist/types/src/internal/entities/object.d.ts
9807
+ //#region ../echo/dist/types/src/internal/Entity/object.d.ts
9640
9808
  /**
9641
9809
  * Object schema type with kind marker.
9642
9810
  */
@@ -9651,169 +9819,6 @@ declare const EchoObjectSchema: {
9651
9819
  }) => EchoObjectSchema<Self, Fields>;
9652
9820
  };
9653
9821
  //#endregion
9654
- //#region ../echo/dist/types/src/internal/object/typed-object.d.ts
9655
- /**
9656
- * Definition for an object type that can be stored in an ECHO database.
9657
- * Implements effect schema to define object properties.
9658
- * Has a typename and version.
9659
- *
9660
- * In contrast to {@link EchoSchema} this definition is not recorded in the database.
9661
- *
9662
- * @deprecated Use `Type.AnyObj` from `@dxos/echo` instead.
9663
- */
9664
- interface TypedObject<A$1 = any, I$1 = any> extends TypeMeta, Schema<A$1, I$1> {}
9665
- /**
9666
- * Typed object that could be used as a prototype in class definitions.
9667
- * This is an internal API type.
9668
- *
9669
- * @deprecated Use `Type.AnyObj` from `@dxos/echo` instead.
9670
- */
9671
- interface TypedObjectPrototype<A$1 = any, I$1 = any> extends TypedObject<A$1, I$1> {
9672
- /** Type constructor. */
9673
- new (): AnyEntity & A$1;
9674
- }
9675
- //#endregion
9676
- //#region ../echo/dist/types/src/internal/schema/persistent-schema.d.ts
9677
- /**
9678
- * Persistent representation of a schema.
9679
- */
9680
- declare const PersistentSchema: EchoObjectSchema<Struct<{
9681
- name: optional<typeof String$>;
9682
- typename: refine<string, typeof String$>;
9683
- version: refine<string, typeof String$>;
9684
- jsonSchema: Schema<JsonSchemaType, JsonSchemaType, never>;
9685
- }>, Readonly<{
9686
- name: optional<typeof String$>;
9687
- typename: refine<string, typeof String$>;
9688
- version: refine<string, typeof String$>;
9689
- jsonSchema: Schema<JsonSchemaType, JsonSchemaType, never>;
9690
- }>>;
9691
- interface PersistentSchema extends Schema.Type<typeof PersistentSchema> {}
9692
- //#endregion
9693
- //#region ../echo/dist/types/src/internal/schema/echo-schema.d.ts
9694
- /**
9695
- * Base schema type.
9696
- */
9697
- interface BaseSchema<A$1 = any, I$1 = any> extends TypedObject<A$1, I$1> {
9698
- get readonly(): boolean;
9699
- get mutable(): EchoSchema<A$1, I$1>;
9700
- get snapshot(): Schema<A$1, I$1>;
9701
- get jsonSchema(): JsonSchemaType;
9702
- }
9703
- declare const EchoSchema_base: TypedObjectPrototype<any, any>;
9704
- /**
9705
- * Represents a schema that is persisted in the ECHO database.
9706
- * Schema can me mutable or readonly (specified by the {@link EchoSchema.readonly} field).
9707
- *
9708
- * Schema that can be modified at runtime via the API.
9709
- * Is an instance of effect-schema (`Schema.Schema.AnyNoContext`) so it can be used in the same way as a regular schema.
9710
- * IMPORTANT: The schema AST will change reactively when the schema is updated, including synced updates from remote peers.
9711
- *
9712
- * The class constructor is a schema instance itself, and can be used in the echo object definitions:
9713
- *
9714
- * @example
9715
- * ```ts
9716
- * export class TableType extends Schema.Struct({...}).pipe(Type.object({ typename: 'example.org/type/Table', version: '0.1.0' })){
9717
- * title: Schema.String,
9718
- * schema: Schema.optional(ref(EchoSchema)),
9719
- * props: Schema.mutable(S.Array(TablePropSchema)),
9720
- * }) {}
9721
- * ```
9722
- *
9723
- * The ECHO API will translate any references to PersistentSchema objects to be resolved as EchoSchema objects.
9724
- */
9725
- declare class EchoSchema<A$1 = any, I$1 = any> extends EchoSchema_base implements BaseSchema<A$1, I$1> {
9726
- private readonly _persistentSchema;
9727
- private _schema;
9728
- private _isDirty;
9729
- /**
9730
- * Schema kind key that marks this as an ECHO schema.
9731
- * Makes EchoSchema satisfy the Type.AnyObj type.
9732
- */
9733
- readonly [SchemaKindId]: EntityKind.Object;
9734
- constructor(_persistentSchema: PersistentSchema);
9735
- get [TypeId$1](): {
9736
- _A: (_: any) => any;
9737
- _I: (_: any) => any;
9738
- _R: (_: never) => never;
9739
- };
9740
- get Type(): A$1;
9741
- get Encoded(): I$1;
9742
- get Context(): never;
9743
- get ast(): AST;
9744
- get annotations(): (annotations: Annotations.GenericSchema<any>) => Schema<any, any, never>;
9745
- get pipe(): Schema.AnyNoContext['pipe'];
9746
- get kind(): EntityKind.Object;
9747
- get typename(): string;
9748
- get version(): string;
9749
- get readonly(): boolean;
9750
- /**
9751
- * Returns an immutable schema snapshot of the current state of the schema.
9752
- */
9753
- get snapshot(): Schema.AnyNoContext;
9754
- /**
9755
- * Returns the JSON schema for the schema.
9756
- */
9757
- get jsonSchema(): JsonSchemaType;
9758
- /**
9759
- * Returns a mutable schema.
9760
- */
9761
- get mutable(): EchoSchema;
9762
- /**
9763
- * Id of the ECHO object containing the schema.
9764
- */
9765
- get id(): ObjectId;
9766
- /**
9767
- * Short name of the schema.
9768
- */
9769
- get name(): string | undefined;
9770
- get [SchemaMetaSymbol](): SchemaMeta;
9771
- /**
9772
- * Reference to the underlying persistent schema object.
9773
- */
9774
- get persistentSchema(): PersistentType;
9775
- getProperties(): PropertySignature$1[];
9776
- /**
9777
- * @throws Error if the schema is readonly.
9778
- */
9779
- updateTypename(typename: string): void;
9780
- /**
9781
- * @throws Error if the schema is readonly.
9782
- */
9783
- addFields(fields: Struct.Fields): void;
9784
- /**
9785
- * @throws Error if the schema is readonly.
9786
- */
9787
- updateFields(fields: Struct.Fields): void;
9788
- /**
9789
- * @throws Error if the schema is readonly.
9790
- */
9791
- updateFieldPropertyName({
9792
- before,
9793
- after
9794
- }: {
9795
- before: PropertyKey;
9796
- after: PropertyKey;
9797
- }): void;
9798
- /**
9799
- * @throws Error if the schema is readonly.
9800
- */
9801
- removeFields(fieldNames: string[]): void;
9802
- /**
9803
- * Wrapper for Obj.change that handles the change context for the persistent schema.
9804
- */
9805
- private _change;
9806
- /**
9807
- * Called by DatabaseSchemaRegistry on update.
9808
- */
9809
- _invalidate(): void;
9810
- /**
9811
- * Rebuilds this schema if it is dirty.
9812
- */
9813
- _rebuild(): void;
9814
- _getSchema(): Schema.AnyNoContext;
9815
- }
9816
- //#endregion
9817
9822
  //#region ../echo/dist/types/src/Entity.d.ts
9818
9823
  declare const KindId$1: "~@dxos/echo/Kind";
9819
9824
  type KindId$1 = typeof KindId;
@@ -9832,7 +9837,7 @@ interface OfKind<K$1 extends Kind> {
9832
9837
  */
9833
9838
  interface Unknown extends OfKind<Kind> {}
9834
9839
  //#endregion
9835
- //#region ../echo/dist/types/src/internal/types/base.d.ts
9840
+ //#region ../echo/dist/types/src/internal/common/types/base.d.ts
9836
9841
  /**
9837
9842
  * Base type for all data objects (reactive, ECHO, and other raw objects).
9838
9843
  * NOTE: This describes the base type for all database objects.
@@ -9847,7 +9852,7 @@ interface AnyEntity {
9847
9852
  readonly id: ObjectId;
9848
9853
  }
9849
9854
  //#endregion
9850
- //#region ../echo/dist/types/src/internal/types/entity.d.ts
9855
+ //#region ../echo/dist/types/src/internal/common/types/entity.d.ts
9851
9856
  /**
9852
9857
  * String key used to identify the kind of an entity instance (object or relation).
9853
9858
  */
@@ -9867,7 +9872,7 @@ declare enum EntityKind {
9867
9872
  Relation = "relation",
9868
9873
  }
9869
9874
  //#endregion
9870
- //#region ../echo/dist/types/src/internal/annotations/annotations.d.ts
9875
+ //#region ../echo/dist/types/src/internal/Annotation/annotations.d.ts
9871
9876
  declare const TypeMeta: Struct<{
9872
9877
  typename: refine<string, typeof String$>;
9873
9878
  version: refine<string, typeof String$>;