@dxos/echo-query 0.8.4-main.ef1bc66f44 → 0.8.4-main.effb148878

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.
@@ -1,5 +1,3 @@
1
- import { InspectOptionsStylized, inspect } from "node:util";
2
- import "protobufjs";
3
1
  import "@dxos/log";
4
2
 
5
3
  //#region rolldown:runtime
@@ -4711,7 +4709,7 @@ declare namespace FastCheck_d_exports {
4711
4709
  export { Arbitrary, ArrayConstraints$1 as ArrayConstraints, AsyncCommand, AsyncPropertyHookFunction, BigIntArrayConstraints, BigIntConstraints$1 as BigIntConstraints, BigUintConstraints, CloneValue, Command, CommandsContraints, ContextValue, DateConstraints$1 as DateConstraints, DepthContext, DepthIdentifier, DepthSize, DictionaryConstraints, DomainConstraints, DoubleConstraints, EmailAddressConstraints, ExecutionStatus, ExecutionTree, FalsyContraints, FalsyValue, Float32ArrayConstraints, Float64ArrayConstraints, FloatConstraints, GeneratorValue, GlobalAsyncPropertyHookFunction, GlobalParameters, GlobalPropertyHookFunction, IAsyncProperty, IAsyncPropertyWithHooks, ICommand, IProperty, IPropertyWithHooks, IRawProperty, IntArrayConstraints, IntegerConstraints, JsonSharedConstraints, JsonValue, LetrecLooselyTypedBuilder, LetrecLooselyTypedTie, LetrecTypedBuilder, LetrecTypedTie, LetrecValue, LoremConstraints, MaybeWeightedArbitrary, Memo, MixedCaseConstraints, ModelRunAsyncSetup, ModelRunSetup, NatConstraints, ObjectConstraints, OneOfConstraints, OneOfValue, OptionConstraints, Parameters$1 as Parameters, PreconditionFailure, PropertyFailure, PropertyHookFunction, Random, RandomType, RecordConstraints, RecordValue, RunDetails, RunDetailsCommon, RunDetailsFailureInterrupted, RunDetailsFailureProperty, RunDetailsFailureTooManySkips, RunDetailsSuccess, Scheduler, SchedulerAct, SchedulerConstraints, SchedulerReportItem, SchedulerSequenceItem, ShuffledSubarrayConstraints, Size, SizeForArbitrary, SparseArrayConstraints, Stream$1 as Stream, StringConstraints$1 as StringConstraints, StringMatchingConstraints, StringSharedConstraints, SubarrayConstraints, UnicodeJsonSharedConstraints, UniqueArrayConstraints, UniqueArrayConstraintsCustomCompare, UniqueArrayConstraintsCustomCompareSelect, UniqueArrayConstraintsRecommended, UniqueArraySharedConstraints, UuidConstraints, Value$1 as Value, VerbosityLevel, WebAuthorityConstraints, WebFragmentsConstraints, WebPathConstraints, WebQueryParametersConstraints, WebSegmentConstraints, WebUrlConstraints, WeightedArbitrary, WithAsyncToStringMethod, WithCloneMethod, WithToStringMethod, __commitHash, __type, __version, anything, array, ascii, asciiString, assert, asyncDefaultReportMessage, asyncModelRun, asyncProperty, asyncStringify, asyncToStringMethod, base64, base64String, bigInt, bigInt64Array, bigIntN, bigUint, bigUint64Array, bigUintN, boolean, char, char16bits, check, clone, cloneIfNeeded, cloneMethod, commands, compareBooleanFunc, compareFunc, configureGlobal, constant, constantFrom, context, createDepthIdentifier, date, defaultReportMessage, dictionary, domain, double, emailAddress, falsy, float, float32Array, float64Array, fullUnicode, fullUnicodeString, func, gen, getDepthContextFor, hasAsyncToStringMethod, hasCloneMethod, hasToStringMethod, hash, hexa, hexaString, infiniteStream, int16Array, int32Array, int8Array, integer, ipV4, ipV4Extended, ipV6, json, jsonValue, letrec, limitShrink, lorem, mapToConstant, maxSafeInteger, maxSafeNat, memo, mixedCase, modelRun, nat, noBias, noShrink, object, oneof, option, pre, property$1 as property, readConfigureGlobal, record, resetConfigureGlobal, sample, scheduledModelRun, scheduler, schedulerFor, shuffledSubarray, sparseArray, statistics, stream, string, string16bits, stringMatching, stringOf, stringify, subarray, toStringMethod, tuple, uint16Array, uint32Array, uint8Array, uint8ClampedArray, ulid, unicode, unicodeJson, unicodeJsonValue, unicodeString, uniqueArray, uuid, uuidV, webAuthority, webFragments, webPath, webQueryParameters, webSegment, webUrl };
4712
4710
  }
4713
4711
  //#endregion
4714
- //#region ../../../../node_modules/.pnpm/effect@3.19.16/node_modules/effect/dist/dts/Arbitrary.d.ts
4712
+ //#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Arbitrary.d.ts
4715
4713
  /**
4716
4714
  * @category model
4717
4715
  * @since 3.10.0
@@ -4756,7 +4754,7 @@ interface DateConstraints {
4756
4754
  readonly constraints: DateConstraints$1;
4757
4755
  }
4758
4756
  //#endregion
4759
- //#region ../../../../node_modules/.pnpm/effect@3.19.16/node_modules/effect/dist/dts/Types.d.ts
4757
+ //#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Types.d.ts
4760
4758
  /**
4761
4759
  * A utility type that transforms a union type `T` into an intersection type.
4762
4760
  *
@@ -4764,6 +4762,20 @@ interface DateConstraints {
4764
4762
  * @category types
4765
4763
  */
4766
4764
  type UnionToIntersection<T$1> = (T$1 extends any ? (x: T$1) => any : never) extends ((x: infer R) => any) ? R : never;
4765
+ /**
4766
+ * Simplifies the type signature of a type.
4767
+ *
4768
+ * @example
4769
+ * ```ts
4770
+ * import type { Types } from "effect"
4771
+ *
4772
+ * type Res = Types.Simplify<{ a: number } & { b: number }> // { a: number; b: number; }
4773
+ * ```
4774
+ *
4775
+ * @since 2.0.0
4776
+ * @category types
4777
+ */
4778
+ type Simplify$1<A$1> = { [K in keyof A$1]: A$1[K] } extends infer B ? B : never;
4767
4779
  /**
4768
4780
  * Describes the concurrency to use when executing multiple Effect's.
4769
4781
  *
@@ -4832,8 +4844,12 @@ declare namespace Contravariant {
4832
4844
  */
4833
4845
  type Type<A$1> = A$1 extends Contravariant<infer U> ? U : never;
4834
4846
  }
4847
+ /**
4848
+ * @since 3.9.0
4849
+ */
4850
+ type NoExcessProperties<T$1, U$1> = T$1 & { readonly [K in Exclude<keyof U$1, keyof T$1>]: never };
4835
4851
  //#endregion
4836
- //#region ../../../../node_modules/.pnpm/effect@3.19.16/node_modules/effect/dist/dts/Equivalence.d.ts
4852
+ //#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Equivalence.d.ts
4837
4853
  /**
4838
4854
  * @category type class
4839
4855
  * @since 2.0.0
@@ -4842,7 +4858,7 @@ interface Equivalence<in A$1> {
4842
4858
  (self: A$1, that: A$1): boolean;
4843
4859
  }
4844
4860
  //#endregion
4845
- //#region ../../../../node_modules/.pnpm/effect@3.19.16/node_modules/effect/dist/dts/Hash.d.ts
4861
+ //#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Hash.d.ts
4846
4862
  /**
4847
4863
  * @since 2.0.0
4848
4864
  * @category models
@@ -4851,7 +4867,7 @@ interface Hash {
4851
4867
  [symbol](): number;
4852
4868
  }
4853
4869
  //#endregion
4854
- //#region ../../../../node_modules/.pnpm/effect@3.19.16/node_modules/effect/dist/dts/Equal.d.ts
4870
+ //#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Equal.d.ts
4855
4871
  /**
4856
4872
  * @since 2.0.0
4857
4873
  * @category models
@@ -4860,7 +4876,7 @@ interface Equal extends Hash {
4860
4876
  [symbol](that: Equal): boolean;
4861
4877
  }
4862
4878
  //#endregion
4863
- //#region ../../../../node_modules/.pnpm/effect@3.19.16/node_modules/effect/dist/dts/Pipeable.d.ts
4879
+ //#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Pipeable.d.ts
4864
4880
  /**
4865
4881
  * @since 2.0.0
4866
4882
  * @category Models
@@ -4890,7 +4906,7 @@ interface Pipeable {
4890
4906
  pipe<A$1, B$1 = never, C = never, D = never, E$1 = never, F = never, G = never, H$1 = never, I$1 = never, J = never, K$1 = never, L$1 = never, M = never, N = never, O = never, P$1 = never, Q = never, R$1 = never, S$1 = never, T$1 = never, U$1 = never>(this: A$1, ab: (_: A$1) => B$1, bc: (_: B$1) => C, cd: (_: C) => D, de: (_: D) => E$1, ef: (_: E$1) => F, fg: (_: F) => G, gh: (_: G) => H$1, hi: (_: H$1) => I$1, ij: (_: I$1) => J, jk: (_: J) => K$1, kl: (_: K$1) => L$1, lm: (_: L$1) => M, mn: (_: M) => N, no: (_: N) => O, op: (_: O) => P$1, pq: (_: P$1) => Q, qr: (_: Q) => R$1, rs: (_: R$1) => S$1, st: (_: S$1) => T$1, tu: (_: T$1) => U$1): U$1;
4891
4907
  }
4892
4908
  //#endregion
4893
- //#region ../../../../node_modules/.pnpm/effect@3.19.16/node_modules/effect/dist/dts/Unify.d.ts
4909
+ //#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Unify.d.ts
4894
4910
  /**
4895
4911
  * @since 2.0.0
4896
4912
  */
@@ -4919,7 +4935,7 @@ declare const ignoreSymbol: unique symbol;
4919
4935
  */
4920
4936
  type ignoreSymbol = typeof ignoreSymbol;
4921
4937
  //#endregion
4922
- //#region ../../../../node_modules/.pnpm/effect@3.19.16/node_modules/effect/dist/dts/Utils.d.ts
4938
+ //#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Utils.d.ts
4923
4939
  /**
4924
4940
  * @since 3.0.6
4925
4941
  */
@@ -4936,7 +4952,7 @@ declare class YieldWrap<T$1> {
4936
4952
  [YieldWrapTypeId](): T$1;
4937
4953
  }
4938
4954
  //#endregion
4939
- //#region ../../../../node_modules/.pnpm/effect@3.19.16/node_modules/effect/dist/dts/Option.d.ts
4955
+ //#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Option.d.ts
4940
4956
  /**
4941
4957
  * The `Option` data type represents optional values. An `Option<A>` can either
4942
4958
  * be `Some<A>`, containing a value of type `A`, or `None`, representing the
@@ -4960,12 +4976,12 @@ type Option<A$1> = None$1<A$1> | Some$1<A$1>;
4960
4976
  * @category Symbols
4961
4977
  * @since 2.0.0
4962
4978
  */
4963
- declare const TypeId$3: unique symbol;
4979
+ declare const TypeId$4: unique symbol;
4964
4980
  /**
4965
4981
  * @category Symbols
4966
4982
  * @since 2.0.0
4967
4983
  */
4968
- type TypeId$3 = typeof TypeId$3;
4984
+ type TypeId$4 = typeof TypeId$4;
4969
4985
  /**
4970
4986
  * @category Models
4971
4987
  * @since 2.0.0
@@ -4973,7 +4989,7 @@ type TypeId$3 = typeof TypeId$3;
4973
4989
  interface None$1<out A$1> extends Pipeable, Inspectable {
4974
4990
  readonly _tag: "None";
4975
4991
  readonly _op: "None";
4976
- readonly [TypeId$3]: {
4992
+ readonly [TypeId$4]: {
4977
4993
  readonly _A: Covariant<A$1>;
4978
4994
  };
4979
4995
  [typeSymbol]?: unknown;
@@ -4988,7 +5004,7 @@ interface Some$1<out A$1> extends Pipeable, Inspectable {
4988
5004
  readonly _tag: "Some";
4989
5005
  readonly _op: "Some";
4990
5006
  readonly value: A$1;
4991
- readonly [TypeId$3]: {
5007
+ readonly [TypeId$4]: {
4992
5008
  readonly _A: Covariant<A$1>;
4993
5009
  };
4994
5010
  [typeSymbol]?: unknown;
@@ -5037,7 +5053,7 @@ declare namespace Option {
5037
5053
  */
5038
5054
  interface OptionUnifyIgnore {}
5039
5055
  //#endregion
5040
- //#region ../../../../node_modules/.pnpm/effect@3.19.16/node_modules/effect/dist/dts/Context.d.ts
5056
+ //#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Context.d.ts
5041
5057
  /**
5042
5058
  * @since 2.0.0
5043
5059
  * @category symbol
@@ -5096,8 +5112,8 @@ interface TagClassShape<Id$1, Shape> {
5096
5112
  * @since 2.0.0
5097
5113
  * @category models
5098
5114
  */
5099
- interface TagClass<Self, Id$1 extends string, Type$5> extends Tag$2<Self, Type$5> {
5100
- new (_: never): TagClassShape<Id$1, Type$5>;
5115
+ interface TagClass<Self, Id$1 extends string, Type$6> extends Tag$2<Self, Type$6> {
5116
+ new (_: never): TagClassShape<Id$1, Type$6>;
5101
5117
  readonly key: Id$1;
5102
5118
  }
5103
5119
  /**
@@ -5127,18 +5143,18 @@ declare namespace Tag$2 {
5127
5143
  */
5128
5144
  type Identifier<T$1 extends Tag$2<any, any> | TagClassShape<any, any>> = T$1 extends Tag$2<any, any> ? T$1["Identifier"] : T$1 extends TagClassShape<any, any> ? T$1 : never;
5129
5145
  }
5130
- declare const TypeId$2: unique symbol;
5146
+ declare const TypeId$3: unique symbol;
5131
5147
  /**
5132
5148
  * @since 2.0.0
5133
5149
  * @category symbol
5134
5150
  */
5135
- type TypeId$2 = typeof TypeId$2;
5151
+ type TypeId$3 = typeof TypeId$3;
5136
5152
  /**
5137
5153
  * @since 2.0.0
5138
5154
  * @category models
5139
5155
  */
5140
5156
  interface Context$1<in Services> extends Equal, Pipeable, Inspectable {
5141
- readonly [TypeId$2]: {
5157
+ readonly [TypeId$3]: {
5142
5158
  readonly _Services: Contravariant<Services>;
5143
5159
  };
5144
5160
  readonly unsafeMap: Map<string, any>;
@@ -5162,7 +5178,7 @@ interface Context$1<in Services> extends Equal, Pipeable, Inspectable {
5162
5178
  */
5163
5179
  declare const Tag$2: <const Id$1 extends string>(id: Id$1) => <Self, Shape>() => TagClass<Self, Id$1, Shape>;
5164
5180
  //#endregion
5165
- //#region ../../../../node_modules/.pnpm/effect@3.19.16/node_modules/effect/dist/dts/Sink.d.ts
5181
+ //#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Sink.d.ts
5166
5182
  /**
5167
5183
  * @since 2.0.0
5168
5184
  * @category symbols
@@ -5218,7 +5234,7 @@ declare namespace Sink {
5218
5234
  }
5219
5235
  }
5220
5236
  //#endregion
5221
- //#region ../../../../node_modules/.pnpm/effect@3.19.16/node_modules/effect/dist/dts/STM.d.ts
5237
+ //#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/STM.d.ts
5222
5238
  /**
5223
5239
  * @since 2.0.0
5224
5240
  * @category symbols
@@ -5337,7 +5353,7 @@ declare namespace STM {
5337
5353
  }
5338
5354
  }
5339
5355
  //#endregion
5340
- //#region ../../../../node_modules/.pnpm/effect@3.19.16/node_modules/effect/dist/dts/Stream.d.ts
5356
+ //#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Stream.d.ts
5341
5357
  /**
5342
5358
  * @since 2.0.0
5343
5359
  * @category symbols
@@ -5450,7 +5466,7 @@ declare namespace Stream {
5450
5466
  type DynamicTupleOf<T$1, N extends number, R$1 extends Array<unknown>> = R$1["length"] extends N ? R$1 : DynamicTupleOf<T$1, N, [T$1, ...R$1]>;
5451
5467
  }
5452
5468
  //#endregion
5453
- //#region ../../../../node_modules/.pnpm/effect@3.19.16/node_modules/effect/dist/dts/Channel.d.ts
5469
+ //#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Channel.d.ts
5454
5470
  /**
5455
5471
  * @since 2.0.0
5456
5472
  * @category symbols
@@ -5544,7 +5560,7 @@ declare namespace Channel {
5544
5560
  }
5545
5561
  }
5546
5562
  //#endregion
5547
- //#region ../../../../node_modules/.pnpm/effect@3.19.16/node_modules/effect/dist/dts/Cause.d.ts
5563
+ //#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Cause.d.ts
5548
5564
  /**
5549
5565
  * A unique symbol identifying the `NoSuchElementException` type.
5550
5566
  *
@@ -5684,7 +5700,7 @@ declare const NoSuchElementException: new (message?: string | undefined) => NoSu
5684
5700
  */
5685
5701
  declare const UnknownException: new (error: unknown, message?: string | undefined) => UnknownException;
5686
5702
  //#endregion
5687
- //#region ../../../../node_modules/.pnpm/effect@3.19.16/node_modules/effect/dist/dts/Effect.d.ts
5703
+ //#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Effect.d.ts
5688
5704
  /**
5689
5705
  * @since 2.0.0
5690
5706
  * @category Symbols
@@ -5875,7 +5891,7 @@ declare namespace Tag$1 {
5875
5891
  * @since 3.9.0
5876
5892
  * @category Models
5877
5893
  */
5878
- type Proxy<Self, Type$5> = { [k in keyof Type$5 as Type$5[k] extends ((...args: infer Args extends ReadonlyArray<any>) => infer Ret) ? ((...args: Readonly<Args>) => Ret) extends Type$5[k] ? k : never : k]: Type$5[k] extends ((...args: infer Args extends ReadonlyArray<any>) => Effect<infer A, infer E, infer R>) ? (...args: Readonly<Args>) => Effect<A, E, Self | R> : Type$5[k] extends ((...args: infer Args extends ReadonlyArray<any>) => Promise<infer A>) ? (...args: Readonly<Args>) => Effect<A, UnknownException, Self> : Type$5[k] extends ((...args: infer Args extends ReadonlyArray<any>) => infer A) ? (...args: Readonly<Args>) => Effect<A, never, Self> : Type$5[k] extends Effect<infer A, infer E, infer R> ? Effect<A, E, Self | R> : Effect<Type$5[k], never, Self> };
5894
+ type Proxy<Self, Type$6> = { [k in keyof Type$6 as Type$6[k] extends ((...args: infer Args extends ReadonlyArray<any>) => infer Ret) ? ((...args: Readonly<Args>) => Ret) extends Type$6[k] ? k : never : k]: Type$6[k] extends ((...args: infer Args extends ReadonlyArray<any>) => Effect<infer A, infer E, infer R>) ? (...args: Readonly<Args>) => Effect<A, E, Self | R> : Type$6[k] extends ((...args: infer Args extends ReadonlyArray<any>) => Promise<infer A>) ? (...args: Readonly<Args>) => Effect<A, UnknownException, Self> : Type$6[k] extends ((...args: infer Args extends ReadonlyArray<any>) => infer A) ? (...args: Readonly<Args>) => Effect<A, never, Self> : Type$6[k] extends Effect<infer A, infer E, infer R> ? Effect<A, E, Self | R> : Effect<Type$6[k], never, Self> };
5879
5895
  }
5880
5896
  /**
5881
5897
  * Creates a unique tag for a dependency, embedding the service's methods as
@@ -5910,11 +5926,11 @@ declare namespace Tag$1 {
5910
5926
  * @since 2.0.0
5911
5927
  * @category Context
5912
5928
  */
5913
- declare const Tag$1: <const Id$1 extends string>(id: Id$1) => <Self, Type$5 extends Tag$1.AllowedType>() => TagClass<Self, Id$1, Type$5> & (Type$5 extends Record<PropertyKey, any> ? Tag$1.Proxy<Self, Type$5> : {}) & {
5914
- use: <X>(body: (_: Type$5) => X) => [X] extends [Effect<infer A, infer E, infer R>] ? Effect<A, E, R | Self> : [X] extends [PromiseLike<infer A>] ? Effect<A, UnknownException, Self> : Effect<X, never, Self>;
5929
+ declare const Tag$1: <const Id$1 extends string>(id: Id$1) => <Self, Type$6 extends Tag$1.AllowedType>() => TagClass<Self, Id$1, Type$6> & (Type$6 extends Record<PropertyKey, any> ? Tag$1.Proxy<Self, Type$6> : {}) & {
5930
+ use: <X>(body: (_: Type$6) => X) => [X] extends [Effect<infer A, infer E, infer R>] ? Effect<A, E, R | Self> : [X] extends [PromiseLike<infer A>] ? Effect<A, UnknownException, Self> : Effect<X, never, Self>;
5915
5931
  };
5916
5932
  //#endregion
5917
- //#region ../../../../node_modules/.pnpm/effect@3.19.16/node_modules/effect/dist/dts/Inspectable.d.ts
5933
+ //#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Inspectable.d.ts
5918
5934
  /**
5919
5935
  * @since 2.0.0
5920
5936
  * @category models
@@ -5925,7 +5941,7 @@ interface Inspectable {
5925
5941
  [NodeInspectSymbol](): unknown;
5926
5942
  }
5927
5943
  //#endregion
5928
- //#region ../../../../node_modules/.pnpm/effect@3.19.16/node_modules/effect/dist/dts/Either.d.ts
5944
+ //#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Either.d.ts
5929
5945
  /**
5930
5946
  * @category models
5931
5947
  * @since 2.0.0
@@ -5935,12 +5951,12 @@ type Either<A$1, E$1 = never> = Left$1<E$1, A$1> | Right$1<E$1, A$1>;
5935
5951
  * @category symbols
5936
5952
  * @since 2.0.0
5937
5953
  */
5938
- declare const TypeId$1: unique symbol;
5954
+ declare const TypeId$2: unique symbol;
5939
5955
  /**
5940
5956
  * @category symbols
5941
5957
  * @since 2.0.0
5942
5958
  */
5943
- type TypeId$1 = typeof TypeId$1;
5959
+ type TypeId$2 = typeof TypeId$2;
5944
5960
  /**
5945
5961
  * @category models
5946
5962
  * @since 2.0.0
@@ -5949,7 +5965,7 @@ interface Left$1<out E$1, out A$1> extends Pipeable, Inspectable {
5949
5965
  readonly _tag: "Left";
5950
5966
  readonly _op: "Left";
5951
5967
  readonly left: E$1;
5952
- readonly [TypeId$1]: {
5968
+ readonly [TypeId$2]: {
5953
5969
  readonly _R: Covariant<A$1>;
5954
5970
  readonly _L: Covariant<E$1>;
5955
5971
  };
@@ -5965,7 +5981,7 @@ interface Right$1<out E$1, out A$1> extends Pipeable, Inspectable {
5965
5981
  readonly _tag: "Right";
5966
5982
  readonly _op: "Right";
5967
5983
  readonly right: A$1;
5968
- readonly [TypeId$1]: {
5984
+ readonly [TypeId$2]: {
5969
5985
  readonly _R: Covariant<A$1>;
5970
5986
  readonly _L: Covariant<E$1>;
5971
5987
  };
@@ -6003,7 +6019,7 @@ declare namespace Either {
6003
6019
  type Right<T$1 extends Either<any, any>> = [T$1] extends [Either<infer _A, infer _E>] ? _A : never;
6004
6020
  }
6005
6021
  //#endregion
6006
- //#region ../../../../node_modules/.pnpm/effect@3.19.16/node_modules/effect/dist/dts/Array.d.ts
6022
+ //#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Array.d.ts
6007
6023
  /**
6008
6024
  * @category models
6009
6025
  * @since 2.0.0
@@ -6015,12 +6031,12 @@ type NonEmptyReadonlyArray<A$1> = readonly [A$1, ...Array<A$1>];
6015
6031
  */
6016
6032
  type NonEmptyArray<A$1> = [A$1, ...Array<A$1>];
6017
6033
  //#endregion
6018
- //#region ../../../../node_modules/.pnpm/effect@3.19.16/node_modules/effect/dist/dts/SchemaAST.d.ts
6034
+ //#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/SchemaAST.d.ts
6019
6035
  /**
6020
6036
  * @category model
6021
6037
  * @since 3.10.0
6022
6038
  */
6023
- type AST = Declaration | Literal$1 | UniqueSymbol | UndefinedKeyword | VoidKeyword | NeverKeyword | UnknownKeyword | AnyKeyword | StringKeyword | NumberKeyword | BooleanKeyword | BigIntKeyword | SymbolKeyword | ObjectKeyword | Enums | TemplateLiteral | Refinement$1 | TupleType$1 | TypeLiteral$1 | Union$1 | Suspend | Transformation$1;
6039
+ type AST = Declaration | Literal$1 | UniqueSymbol | UndefinedKeyword | VoidKeyword | NeverKeyword | UnknownKeyword | AnyKeyword | StringKeyword | NumberKeyword | BooleanKeyword | BigIntKeyword | SymbolKeyword | ObjectKeyword | Enums$1 | TemplateLiteral | Refinement$1 | TupleType$1 | TypeLiteral$1 | Union$1 | Suspend | Transformation$1;
6024
6040
  /**
6025
6041
  * @category annotations
6026
6042
  * @since 3.19.0
@@ -6417,7 +6433,7 @@ declare class ObjectKeyword implements Annotated {
6417
6433
  * @category model
6418
6434
  * @since 3.10.0
6419
6435
  */
6420
- declare class Enums implements Annotated {
6436
+ declare class Enums$1 implements Annotated {
6421
6437
  readonly enums: ReadonlyArray<readonly [string, string | number]>;
6422
6438
  readonly annotations: Annotations$1;
6423
6439
  /**
@@ -6482,7 +6498,7 @@ declare class TemplateLiteral implements Annotated {
6482
6498
  * @category model
6483
6499
  * @since 3.10.0
6484
6500
  */
6485
- declare class Type$4 implements Annotated {
6501
+ declare class Type$5 implements Annotated {
6486
6502
  readonly type: AST;
6487
6503
  readonly annotations: Annotations$1;
6488
6504
  constructor(type: AST, annotations?: Annotations$1);
@@ -6499,7 +6515,7 @@ declare class Type$4 implements Annotated {
6499
6515
  * @category model
6500
6516
  * @since 3.10.0
6501
6517
  */
6502
- declare class OptionalType extends Type$4 {
6518
+ declare class OptionalType extends Type$5 {
6503
6519
  readonly isOptional: boolean;
6504
6520
  constructor(type: AST, isOptional: boolean, annotations?: Annotations$1);
6505
6521
  /**
@@ -6517,14 +6533,14 @@ declare class OptionalType extends Type$4 {
6517
6533
  */
6518
6534
  declare class TupleType$1 implements Annotated {
6519
6535
  readonly elements: ReadonlyArray<OptionalType>;
6520
- readonly rest: ReadonlyArray<Type$4>;
6536
+ readonly rest: ReadonlyArray<Type$5>;
6521
6537
  readonly isReadonly: boolean;
6522
6538
  readonly annotations: Annotations$1;
6523
6539
  /**
6524
6540
  * @since 3.10.0
6525
6541
  */
6526
6542
  readonly _tag = "TupleType";
6527
- constructor(elements: ReadonlyArray<OptionalType>, rest: ReadonlyArray<Type$4>, isReadonly: boolean, annotations?: Annotations$1);
6543
+ constructor(elements: ReadonlyArray<OptionalType>, rest: ReadonlyArray<Type$5>, isReadonly: boolean, annotations?: Annotations$1);
6528
6544
  /**
6529
6545
  * @since 3.10.0
6530
6546
  */
@@ -6827,14 +6843,14 @@ declare class TypeLiteralTransformation {
6827
6843
  constructor(propertySignatureTransformations: ReadonlyArray<PropertySignatureTransformation$1>);
6828
6844
  }
6829
6845
  //#endregion
6830
- //#region ../../../../node_modules/.pnpm/effect@3.19.16/node_modules/effect/dist/dts/ParseResult.d.ts
6846
+ //#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/ParseResult.d.ts
6831
6847
  /**
6832
6848
  * `ParseIssue` is a type that represents the different types of errors that can occur when decoding/encoding a value.
6833
6849
  *
6834
6850
  * @category model
6835
6851
  * @since 3.10.0
6836
6852
  */
6837
- type ParseIssue = Type$3 | Missing | Unexpected | Forbidden | Pointer | Refinement | Transformation | Composite;
6853
+ type ParseIssue = Type$4 | Missing | Unexpected | Forbidden | Pointer | Refinement | Transformation | Composite;
6838
6854
  /**
6839
6855
  * @category model
6840
6856
  * @since 3.10.0
@@ -6891,7 +6907,7 @@ declare class Missing {
6891
6907
  /**
6892
6908
  * @since 3.10.0
6893
6909
  */
6894
- readonly ast: Type$4;
6910
+ readonly ast: Type$5;
6895
6911
  /**
6896
6912
  * @since 3.10.0
6897
6913
  */
@@ -6908,7 +6924,7 @@ declare class Missing {
6908
6924
  /**
6909
6925
  * @since 3.10.0
6910
6926
  */
6911
- ast: Type$4,
6927
+ ast: Type$5,
6912
6928
  /**
6913
6929
  * @since 3.10.0
6914
6930
  */
@@ -6972,7 +6988,7 @@ declare class Transformation {
6972
6988
  * @category model
6973
6989
  * @since 3.10.0
6974
6990
  */
6975
- declare class Type$3 {
6991
+ declare class Type$4 {
6976
6992
  readonly ast: AST;
6977
6993
  readonly actual: unknown;
6978
6994
  readonly message?: string | undefined;
@@ -6999,7 +7015,7 @@ declare class Forbidden {
6999
7015
  constructor(ast: AST, actual: unknown, message?: string | undefined);
7000
7016
  }
7001
7017
  //#endregion
7002
- //#region ../../../../node_modules/.pnpm/effect@3.19.16/node_modules/effect/dist/dts/Pretty.d.ts
7018
+ //#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Pretty.d.ts
7003
7019
  /**
7004
7020
  * @category model
7005
7021
  * @since 3.10.0
@@ -7013,7 +7029,7 @@ interface Pretty<To> {
7013
7029
  */
7014
7030
  type PrettyAnnotation<A$1, TypeParameters extends ReadonlyArray<any> = readonly []> = (...pretties: { readonly [K in keyof TypeParameters]: Pretty<TypeParameters[K]> }) => Pretty<A$1>;
7015
7031
  //#endregion
7016
- //#region ../../../../node_modules/.pnpm/effect@3.19.16/node_modules/effect/dist/dts/Schema.d.ts
7032
+ //#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Schema.d.ts
7017
7033
  /**
7018
7034
  * @since 3.10.0
7019
7035
  */
@@ -7022,12 +7038,12 @@ type Simplify<A$1> = { [K in keyof A$1]: A$1[K] } & {};
7022
7038
  * @since 3.10.0
7023
7039
  * @category symbol
7024
7040
  */
7025
- declare const TypeId: unique symbol;
7041
+ declare const TypeId$1: unique symbol;
7026
7042
  /**
7027
7043
  * @since 3.10.0
7028
7044
  * @category symbol
7029
7045
  */
7030
- type TypeId = typeof TypeId;
7046
+ type TypeId$1 = typeof TypeId$1;
7031
7047
  /**
7032
7048
  * @category model
7033
7049
  * @since 3.10.0
@@ -7088,7 +7104,7 @@ declare namespace Schema {
7088
7104
  * @since 3.10.0
7089
7105
  */
7090
7106
  interface Variance<A$1, I$1, R$1> {
7091
- readonly [TypeId]: {
7107
+ readonly [TypeId$1]: {
7092
7108
  readonly _A: Invariant<A$1>;
7093
7109
  readonly _I: Invariant<I$1>;
7094
7110
  readonly _R: Covariant<R$1>;
@@ -7149,6 +7165,24 @@ interface Literal<Literals extends NonEmptyReadonlyArray<LiteralValue>> extends
7149
7165
  declare function Literal<Literals extends NonEmptyReadonlyArray<LiteralValue>>(...literals: Literals): Literal<Literals>;
7150
7166
  declare function Literal(): Never;
7151
7167
  declare function Literal<Literals extends ReadonlyArray<LiteralValue>>(...literals: Literals): SchemaClass<Literals[number]>;
7168
+ /**
7169
+ * @category api interface
7170
+ * @since 3.10.0
7171
+ */
7172
+ interface Enums<A$1 extends EnumsDefinition> extends AnnotableClass<Enums<A$1>, A$1[keyof A$1]> {
7173
+ readonly enums: A$1;
7174
+ }
7175
+ /**
7176
+ * @since 3.10.0
7177
+ */
7178
+ type EnumsDefinition = {
7179
+ [x: string]: string | number;
7180
+ };
7181
+ /**
7182
+ * @category constructors
7183
+ * @since 3.10.0
7184
+ */
7185
+ declare const Enums: <A$1 extends EnumsDefinition>(enums: A$1) => Enums<A$1>;
7152
7186
  declare const Null_base: SchemaClass<null, null, never>;
7153
7187
  /**
7154
7188
  * @category primitives
@@ -7166,7 +7200,7 @@ declare const Unknown_base: SchemaClass<unknown, unknown, never>;
7166
7200
  * @category primitives
7167
7201
  * @since 3.10.0
7168
7202
  */
7169
- declare class Unknown$2 extends Unknown_base {}
7203
+ declare class Unknown$3 extends Unknown_base {}
7170
7204
  declare const Any_base: SchemaClass<any, any, never>;
7171
7205
  /**
7172
7206
  * @category primitives
@@ -7265,6 +7299,14 @@ interface TupleType<Elements extends TupleType.Elements, Rest$1 extends TupleTyp
7265
7299
  readonly elements: Readonly<Elements>;
7266
7300
  readonly rest: Readonly<Rest$1>;
7267
7301
  }
7302
+ /**
7303
+ * @category api interface
7304
+ * @since 3.13.3
7305
+ */
7306
+ interface Tuple2<Fst extends Schema.Any, Snd extends Schema.Any> extends AnnotableClass<Tuple2<Fst, Snd>, readonly [Schema.Type<Fst>, Schema.Type<Snd>], readonly [Schema.Encoded<Fst>, Schema.Encoded<Snd>], Schema.Context<Fst> | Schema.Context<Snd>> {
7307
+ readonly elements: readonly [Fst, Snd];
7308
+ readonly rest: readonly [];
7309
+ }
7268
7310
  /**
7269
7311
  * @category api interface
7270
7312
  * @since 3.10.0
@@ -7369,14 +7411,14 @@ type PropertySignatureTypeId = typeof PropertySignatureTypeId;
7369
7411
  * @category PropertySignature
7370
7412
  * @since 3.10.0
7371
7413
  */
7372
- interface PropertySignature<TypeToken extends PropertySignature.Token, Type$5, Key$1 extends PropertyKey, EncodedToken extends PropertySignature.Token, Encoded$1, HasDefault extends boolean = false, R$1 = never> extends Schema.Variance<Type$5, Encoded$1, R$1>, Pipeable {
7414
+ interface PropertySignature<TypeToken extends PropertySignature.Token, Type$6, Key$1 extends PropertyKey, EncodedToken extends PropertySignature.Token, Encoded$1, HasDefault extends boolean = false, R$1 = never> extends Schema.Variance<Type$6, Encoded$1, R$1>, Pipeable {
7373
7415
  readonly [PropertySignatureTypeId]: null;
7374
7416
  readonly _TypeToken: TypeToken;
7375
7417
  readonly _EncodedToken: EncodedToken;
7376
7418
  readonly _HasDefault: HasDefault;
7377
7419
  readonly _Key: Key$1;
7378
7420
  readonly ast: PropertySignature.AST;
7379
- annotations(annotations: PropertySignature.Annotations<Type$5>): PropertySignature<TypeToken, Type$5, Key$1, EncodedToken, Encoded$1, HasDefault, R$1>;
7421
+ annotations(annotations: PropertySignature.Annotations<Type$6>): PropertySignature<TypeToken, Type$6, Key$1, EncodedToken, Encoded$1, HasDefault, R$1>;
7380
7422
  }
7381
7423
  /**
7382
7424
  * @category api interface
@@ -7520,6 +7562,64 @@ interface Struct<Fields extends Struct.Fields> extends AnnotableClass<Struct<Fie
7520
7562
  */
7521
7563
  declare function Struct<Fields extends Struct.Fields, const Records extends IndexSignature.NonEmptyRecords>(fields: Fields, ...records: Records): TypeLiteral<Fields, Records>;
7522
7564
  declare function Struct<Fields extends Struct.Fields>(fields: Fields): Struct<Fields>;
7565
+ /**
7566
+ * @category api interface
7567
+ * @since 3.10.0
7568
+ */
7569
+ interface tag$1<Tag$3 extends LiteralValue> extends PropertySignature<":", Tag$3, never, ":", Tag$3, true, never> {}
7570
+ /**
7571
+ * Returns a property signature that represents a tag.
7572
+ * A tag is a literal value that is used to distinguish between different types of objects.
7573
+ * The tag is optional when using the `make` method.
7574
+ *
7575
+ * @example
7576
+ * ```ts
7577
+ * import * as assert from "node:assert"
7578
+ * import { Schema } from "effect"
7579
+ *
7580
+ * const User = Schema.Struct({
7581
+ * _tag: Schema.tag("User"),
7582
+ * name: Schema.String,
7583
+ * age: Schema.Number
7584
+ * })
7585
+ *
7586
+ * assert.deepStrictEqual(User.make({ name: "John", age: 44 }), { _tag: "User", name: "John", age: 44 })
7587
+ * ```
7588
+ *
7589
+ * @see {@link TaggedStruct}
7590
+ *
7591
+ * @since 3.10.0
7592
+ */
7593
+ declare const tag$1: <Tag$3 extends LiteralValue>(tag: Tag$3) => tag$1<Tag$3>;
7594
+ /**
7595
+ * @category api interface
7596
+ * @since 3.10.0
7597
+ */
7598
+ type TaggedStruct<Tag$3 extends LiteralValue, Fields extends Struct.Fields> = Struct<{
7599
+ _tag: tag$1<Tag$3>;
7600
+ } & Fields>;
7601
+ /**
7602
+ * A tagged struct is a struct that has a tag property that is used to distinguish between different types of objects.
7603
+ *
7604
+ * The tag is optional when using the `make` method.
7605
+ *
7606
+ * @example
7607
+ * ```ts
7608
+ * import * as assert from "node:assert"
7609
+ * import { Schema } from "effect"
7610
+ *
7611
+ * const User = Schema.TaggedStruct("User", {
7612
+ * name: Schema.String,
7613
+ * age: Schema.Number
7614
+ * })
7615
+ *
7616
+ * assert.deepStrictEqual(User.make({ name: "John", age: 44 }), { _tag: "User", name: "John", age: 44 })
7617
+ * ```
7618
+ *
7619
+ * @category constructors
7620
+ * @since 3.10.0
7621
+ */
7622
+ declare const TaggedStruct: <Tag$3 extends LiteralValue, Fields extends Struct.Fields>(value: Tag$3, fields: Fields) => TaggedStruct<Tag$3, Fields>;
7523
7623
  /**
7524
7624
  * @category api interface
7525
7625
  * @since 3.10.0
@@ -7647,12 +7747,6 @@ declare namespace Annotations {
7647
7747
  */
7648
7748
  interface Filter<A$1, P$1 = A$1> extends Schema<A$1, readonly [P$1]> {}
7649
7749
  }
7650
- declare const NonEmptyString_base: filter<typeof String$>;
7651
- /**
7652
- * @category string constructors
7653
- * @since 3.10.0
7654
- */
7655
- declare class NonEmptyString extends NonEmptyString_base {}
7656
7750
  type RequiredKeys<T$1> = { [K in keyof T$1]-?: {} extends Pick<T$1, K> ? never : K }[keyof T$1];
7657
7751
  /**
7658
7752
  * @category Constructor utils
@@ -7662,37 +7756,31 @@ type MakeOptions = boolean | {
7662
7756
  readonly disableValidation?: boolean | undefined;
7663
7757
  };
7664
7758
  //#endregion
7665
- //#region ../../../common/debug/dist/types/src/devtools-formatter.d.ts
7759
+ //#region ../../../common/keys/dist/types/src/URI.d.ts
7760
+ /**
7761
+ * Branded string type for any URI.
7762
+ * Base type for more specific URI schemes like DXN and EchoURI.
7763
+ */
7764
+ type URI = string & {
7765
+ readonly __URI: unique symbol;
7766
+ };
7767
+ //#endregion
7768
+ //#region ../../../common/keys/dist/types/src/DXN.d.ts
7666
7769
  /**
7667
- * Lets types provide custom formatters for the Chrome Devtools.
7770
+ * DXN names a resource (type, plugin, capability, etc.).
7668
7771
  *
7669
- * https://www.mattzeunert.com/2016/02/19/custom-chrome-devtools-object-formatters.html
7670
- * NOTE: Must be enabled in chrome devtools preferences.
7772
+ * Format: `dxn:<nsid>[:<version>]` where NSID is an atproto-style dotted name.
7671
7773
  *
7672
7774
  * @example
7673
- * ```typescript
7674
- * class MyType {
7675
- * get [devtoolsFormatter] (): DevtoolsFormatter {
7676
- * ...
7677
- * }
7775
+ * ```
7776
+ * dxn:org.dxos.type.calendar
7777
+ * dxn:org.dxos.type.calendar:1.0.0
7778
+ * dxn:org.dxos.plugin.markdown
7678
7779
  * ```
7679
7780
  */
7680
- declare const devtoolsFormatter: unique symbol;
7681
- type JsonML = [string, Record<string, any>?, ...(JsonML | string)[]];
7682
- interface DevtoolsFormatter {
7683
- /**
7684
- * NOTE: Make sure to do an instance check and return null if the object is not of the correct type.
7685
- */
7686
- header: (config?: any) => JsonML | null;
7687
- hasBody?: (config?: any) => boolean;
7688
- body?: (config?: any) => JsonML | null;
7689
- }
7690
- //#endregion
7691
- //#region ../../../common/debug/dist/types/src/inspect-custom.d.ts
7692
- /**
7693
- * Using this allows code to be written in a portable fashion, so that the custom inspect function is used in an Node.js environment and ignored in the browser.
7694
- */
7695
- declare const inspectCustom: unique symbol;
7781
+ type DXN = URI & {
7782
+ readonly __DXN: unique symbol;
7783
+ };
7696
7784
  //#endregion
7697
7785
  //#region ../../../common/keys/dist/types/src/object-id.d.ts
7698
7786
  declare const ObjectIdSchema: refine<string, typeof String$>;
@@ -7728,6 +7816,23 @@ interface ObjectIdClass extends SchemaClass<ObjectId, string> {
7728
7816
  * NOTE: The generated IDs depend on the order of ObjectId.random() calls, which might be affected by test order, scheduling, etc.
7729
7817
  */
7730
7818
  dangerouslyDisableRandomness(): void;
7819
+ /**
7820
+ * WARNING: To be used only within tests.
7821
+ *
7822
+ * Pins the time component of generated ObjectIds and seeds the PRNG used for the random component,
7823
+ * causing the same sequence of IDs to be generated across runs.
7824
+ * Do not use in production code as this will cause data collisions.
7825
+ *
7826
+ * @param time - Fixed timestamp (ms since epoch) used as the ULID time component.
7827
+ * @param seed - Seed value for the PRNG used for the ULID random component.
7828
+ *
7829
+ * ```ts
7830
+ * ObjectId.dangerouslySetSeed(new Date('2025-01-01').getTime(), 42);
7831
+ * ```
7832
+ *
7833
+ * NOTE: The generated IDs depend on the order of ObjectId.random() calls, which might be affected by test order, scheduling, etc.
7834
+ */
7835
+ dangerouslySetSeed(time: number, seed: number): void;
7731
7836
  }
7732
7837
  /**
7733
7838
  * Randomly generated unique identifier for an object.
@@ -7754,125 +7859,20 @@ declare const SpaceId: Schema<SpaceId, string> & {
7754
7859
  random: () => SpaceId;
7755
7860
  };
7756
7861
  //#endregion
7757
- //#region ../../../common/keys/dist/types/src/dxn.d.ts
7758
- declare const QueueSubspaceTags: Readonly<{
7759
- DATA: "data";
7760
- TRACE: "trace";
7761
- }>;
7762
- type QueueSubspaceTag = (typeof QueueSubspaceTags)[keyof typeof QueueSubspaceTags];
7862
+ //#region ../../../common/keys/dist/types/src/EchoURI.d.ts
7763
7863
  /**
7764
- * DXN unambiguously names a resource like an ECHO object, schema definition, plugin, etc.
7765
- * Each DXN starts with a dxn prefix, followed by a resource kind.
7766
- * Colon Symbol : is used a delimiter between parts.
7767
- * DXNs may contain slashes.
7768
- * '@' in the place of the space id is used to denote that the DXN should be resolved in the local space.
7864
+ * Addresses an ECHO object or space. Uses the `echo:` URI scheme.
7769
7865
  *
7770
7866
  * @example
7771
7867
  * ```
7772
- * dxn:echo:<space key>:<echo id>
7773
- * dxn:echo:BA25QRC2FEWCSAMRP4RZL65LWJ7352CKE:01J00J9B45YHYSGZQTQMSKMGJ6
7774
- * dxn:echo:@:01J00J9B45YHYSGZQTQMSKMGJ6
7775
- * dxn:type:dxos.org/type/Calendar
7776
- * dxn:plugin:dxos.org/agent/plugin/functions
7868
+ * echo://BA25QRC2FEWCSAMRP4RZL65LWJ7352CKE/01J00J9B45YHYSGZQTQMSKMGJ6
7869
+ * echo:/01J00J9B45YHYSGZQTQMSKMGJ6
7870
+ * echo://BA25QRC2FEWCSAMRP4RZL65LWJ7352CKE
7777
7871
  * ```
7778
7872
  */
7779
- declare class DXN {
7780
- #private;
7781
- static Schema: refine<string, typeof NonEmptyString>;
7782
- static hash(dxn: DXN): string;
7783
- /**
7784
- * Kind constants.
7785
- */
7786
- static kind: Readonly<{
7787
- /**
7788
- * dxn:type:<type_name>[:<version>]
7789
- */
7790
- TYPE: "type";
7791
- /**
7792
- * dxn:echo:<space_id>:<echo_id>
7793
- * dxn:echo:@:<echo_id>
7794
- */
7795
- ECHO: "echo";
7796
- /**
7797
- * The subspace tag enables us to partition queues by usage within the context of a space.
7798
- * dxn:queue:<subspace_tag>:<space_id>:<queue_id>[:object_id]
7799
- * dxn:queue:data:BA25QRC2FEWCSAMRP4RZL65LWJ7352CKE:01J00J9B45YHYSGZQTQMSKMGJ6
7800
- * dxn:queue:trace:BA25QRC2FEWCSAMRP4RZL65LWJ7352CKE:01J00J9B45YHYSGZQTQMSKMGJ6
7801
- */
7802
- QUEUE: "queue";
7803
- }>;
7804
- /**
7805
- * Exactly equals.
7806
- */
7807
- static equals(a: DXN, b: DXN): boolean;
7808
- static equalsEchoId(a: DXN, b: DXN): boolean;
7809
- static isDXNString(dxn: string): boolean;
7810
- static parse(dxn: string): DXN;
7811
- static tryParse(dxn: string): DXN | undefined;
7812
- /**
7813
- * @example `dxn:type:example.com/type/Person`
7814
- */
7815
- static fromTypename(typename: string): DXN;
7816
- /**
7817
- * @example `dxn:type:example.com/type/Person:0.1.0`
7818
- */
7819
- static fromTypenameAndVersion(typename: string, version: string): DXN;
7820
- /**
7821
- * @example `dxn:echo:BA25QRC2FEWCSAMRP4RZL65LWJ7352CKE:01J00J9B45YHYSGZQTQMSKMGJ6`
7822
- */
7823
- static fromSpaceAndObjectId(spaceId: SpaceId, objectId: ObjectId): DXN;
7824
- /**
7825
- * @example `dxn:echo:@:01J00J9B45YHYSGZQTQMSKMGJ6`
7826
- */
7827
- static fromLocalObjectId(id: string): DXN;
7828
- static fromQueue(subspaceTag: QueueSubspaceTag, spaceId: SpaceId, queueId: ObjectId, objectId?: ObjectId): DXN;
7829
- constructor(kind: string, parts: string[]);
7830
- toString(): DXN.String;
7831
- toJSON(): string;
7832
- /**
7833
- * Used by Node.js to get textual representation of this object when it's printed with a `console.log` statement.
7834
- */
7835
- [inspectCustom](depth: number, options: InspectOptionsStylized, inspectFn: typeof inspect): string;
7836
- get [devtoolsFormatter](): DevtoolsFormatter;
7837
- get kind(): string;
7838
- get parts(): string[];
7839
- get typename(): string;
7840
- equals(other: DXN): boolean;
7841
- hasTypenameOf(typename: string): boolean;
7842
- isLocalObjectId(): boolean;
7843
- asTypeDXN(): DXN.TypeDXN | undefined;
7844
- asEchoDXN(): DXN.EchoDXN | undefined;
7845
- asQueueDXN(): DXN.QueueDXN | undefined;
7846
- /**
7847
- * Produces a new DXN with the given parts appended.
7848
- */
7849
- extend(parts: string[]): DXN;
7850
- }
7851
- /**
7852
- * API namespace.
7853
- */
7854
- declare namespace DXN {
7855
- /**
7856
- * DXN represented as a javascript string.
7857
- */
7858
- type String = string & {
7859
- __DXNString: never;
7860
- };
7861
- type TypeDXN = {
7862
- type: string;
7863
- version?: string;
7864
- };
7865
- type EchoDXN = {
7866
- spaceId?: SpaceId;
7867
- echoId: string;
7868
- };
7869
- type QueueDXN = {
7870
- subspaceTag: QueueSubspaceTag;
7871
- spaceId: SpaceId;
7872
- queueId: string;
7873
- objectId?: string;
7874
- };
7875
- }
7873
+ type EchoURI = URI & {
7874
+ readonly __EchoURI: unique symbol;
7875
+ };
7876
7876
  //#endregion
7877
7877
  //#region ../echo-protocol/dist/types/src/foreign-key.d.ts
7878
7878
  declare const ForeignKey_: Struct<{
@@ -7892,27 +7892,24 @@ type ForeignKey = Schema.Type<typeof ForeignKey_>;
7892
7892
  */
7893
7893
  declare const ForeignKey: Schema<ForeignKey>;
7894
7894
  //#endregion
7895
- //#region ../../../common/util/dist/types/src/types.d.ts
7896
- /**
7897
- * Removes readonly modifiers from top-level properties of T.
7898
- * Also converts readonly arrays at the top level to mutable arrays.
7899
- * For nested properties, mutability depends on the schema definition.
7900
- */
7901
- type ToMutable<T$1> = T$1 extends object ? { -readonly [K in keyof T$1]: T$1[K] extends readonly (infer U)[] ? U[] : T$1[K] } : T$1;
7902
- //#endregion
7903
7895
  //#region ../echo-protocol/dist/types/src/reference.d.ts
7904
7896
  /**
7905
7897
  * Reference as it is stored in Automerge document.
7906
7898
  */
7907
7899
  type EncodedReference = {
7908
- '/': string;
7900
+ '/': URI;
7909
7901
  };
7910
7902
  declare const EncodedReference: Readonly<{
7911
7903
  isEncodedReference: (value: any) => value is EncodedReference;
7912
- getReferenceString: (value: EncodedReference) => string;
7913
- toDXN: (value: EncodedReference) => DXN;
7914
- fromDXN: (dxn: DXN) => EncodedReference;
7915
- fromLegacyTypename: (typename: string) => EncodedReference;
7904
+ /**
7905
+ * Returns the opaque URI stored in the encoded reference (any scheme: `echo:` or `dxn:`).
7906
+ * Consumers can narrow with `EchoURI.isEchoURI(uri)` / `DXN.isDXN(uri)`.
7907
+ */
7908
+ toURI: (value: EncodedReference) => URI;
7909
+ /**
7910
+ * Creates an encoded reference from an opaque URI.
7911
+ */
7912
+ fromURI: (uri: URI) => EncodedReference;
7916
7913
  }>;
7917
7914
  //#endregion
7918
7915
  //#region ../echo-protocol/dist/types/src/query/ast.d.ts
@@ -7923,13 +7920,13 @@ declare const EncodedReference: Readonly<{
7923
7920
  */
7924
7921
  declare const FilterObject_: Struct<{
7925
7922
  type: Literal<["object"]>;
7926
- typename: Union<[refine<string, typeof NonEmptyString>, typeof Null]>;
7923
+ typename: Union<[Schema<URI, URI, never>, typeof Null]>;
7927
7924
  id: optional<Array$<ObjectIdClass>>;
7928
7925
  /**
7929
7926
  * Filter by property.
7930
7927
  * Must not include object ID.
7931
7928
  */
7932
- props: Record$<SchemaClass<string, string, never>, suspend<FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, never>>;
7929
+ props: Record$<SchemaClass<string, string, never>, suspend<FilterAnd | FilterChildOf | FilterCompare | FilterContains | FilterIn | FilterNot | FilterObject | FilterOr | FilterRange | FilterTag | FilterTextSearch | FilterTimestamp, FilterAnd | FilterChildOf | FilterCompare | FilterContains | FilterIn | FilterNot | FilterObject | FilterOr | FilterRange | FilterTag | FilterTextSearch | FilterTimestamp, never>>;
7933
7930
  /**
7934
7931
  * Objects that have any of the given foreign keys.
7935
7932
  */
@@ -7940,6 +7937,15 @@ declare const FilterObject_: Struct<{
7940
7937
  readonly source: string;
7941
7938
  readonly id: string;
7942
7939
  }, never>>>;
7940
+ /**
7941
+ * Match objects whose meta `key` equals this fully-qualified registry key (FQN format).
7942
+ */
7943
+ metaKey: optional<typeof String$>;
7944
+ /**
7945
+ * Semver range matched against the object's meta `version`.
7946
+ * Only consulted when {@link metaKey} is set. Objects with no `version` do not satisfy a version-constrained filter.
7947
+ */
7948
+ metaVersion: optional<typeof String$>;
7943
7949
  }>;
7944
7950
  interface FilterObject extends Schema.Type<typeof FilterObject_> {}
7945
7951
  declare const FilterObject: Schema<FilterObject>;
@@ -7949,7 +7955,7 @@ declare const FilterObject: Schema<FilterObject>;
7949
7955
  declare const FilterCompare_: Struct<{
7950
7956
  type: Literal<["compare"]>;
7951
7957
  operator: Literal<["eq", "neq", "gt", "gte", "lt", "lte"]>;
7952
- value: typeof Unknown$2;
7958
+ value: typeof Unknown$3;
7953
7959
  }>;
7954
7960
  interface FilterCompare extends Schema.Type<typeof FilterCompare_> {}
7955
7961
  declare const FilterCompare: Schema<FilterCompare>;
@@ -7994,6 +8000,18 @@ declare const FilterRange_: Struct<{
7994
8000
  }>;
7995
8001
  interface FilterRange extends Schema.Type<typeof FilterRange_> {}
7996
8002
  declare const FilterRange: Schema<FilterRange>;
8003
+ /**
8004
+ * Filter by system timestamp (createdAt / updatedAt).
8005
+ * Timestamps are unix milliseconds stored in the object meta index.
8006
+ */
8007
+ declare const FilterTimestamp_: Struct<{
8008
+ type: Literal<["timestamp"]>;
8009
+ field: Literal<["createdAt", "updatedAt"]>;
8010
+ operator: Literal<["gt", "gte", "lt", "lte"]>;
8011
+ value: typeof Number$;
8012
+ }>;
8013
+ interface FilterTimestamp extends Schema.Type<typeof FilterTimestamp_> {}
8014
+ declare const FilterTimestamp: Schema<FilterTimestamp>;
7997
8015
  /**
7998
8016
  * Text search.
7999
8017
  */
@@ -8009,7 +8027,7 @@ declare const FilterTextSearch: Schema<FilterTextSearch>;
8009
8027
  */
8010
8028
  declare const FilterNot_: Struct<{
8011
8029
  type: Literal<["not"]>;
8012
- filter: suspend<FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, never>;
8030
+ filter: suspend<FilterAnd | FilterChildOf | FilterCompare | FilterContains | FilterIn | FilterNot | FilterObject | FilterOr | FilterRange | FilterTag | FilterTextSearch | FilterTimestamp, FilterAnd | FilterChildOf | FilterCompare | FilterContains | FilterIn | FilterNot | FilterObject | FilterOr | FilterRange | FilterTag | FilterTextSearch | FilterTimestamp, never>;
8013
8031
  }>;
8014
8032
  interface FilterNot extends Schema.Type<typeof FilterNot_> {}
8015
8033
  declare const FilterNot: Schema<FilterNot>;
@@ -8018,7 +8036,7 @@ declare const FilterNot: Schema<FilterNot>;
8018
8036
  */
8019
8037
  declare const FilterAnd_: Struct<{
8020
8038
  type: Literal<["and"]>;
8021
- filters: Array$<suspend<FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, never>>;
8039
+ filters: Array$<suspend<FilterAnd | FilterChildOf | FilterCompare | FilterContains | FilterIn | FilterNot | FilterObject | FilterOr | FilterRange | FilterTag | FilterTextSearch | FilterTimestamp, FilterAnd | FilterChildOf | FilterCompare | FilterContains | FilterIn | FilterNot | FilterObject | FilterOr | FilterRange | FilterTag | FilterTextSearch | FilterTimestamp, never>>;
8022
8040
  }>;
8023
8041
  interface FilterAnd extends Schema.Type<typeof FilterAnd_> {}
8024
8042
  declare const FilterAnd: Schema<FilterAnd>;
@@ -8027,21 +8045,34 @@ declare const FilterAnd: Schema<FilterAnd>;
8027
8045
  */
8028
8046
  declare const FilterOr_: Struct<{
8029
8047
  type: Literal<["or"]>;
8030
- filters: Array$<suspend<FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, never>>;
8048
+ filters: Array$<suspend<FilterAnd | FilterChildOf | FilterCompare | FilterContains | FilterIn | FilterNot | FilterObject | FilterOr | FilterRange | FilterTag | FilterTextSearch | FilterTimestamp, FilterAnd | FilterChildOf | FilterCompare | FilterContains | FilterIn | FilterNot | FilterObject | FilterOr | FilterRange | FilterTag | FilterTextSearch | FilterTimestamp, never>>;
8031
8049
  }>;
8032
8050
  interface FilterOr extends Schema.Type<typeof FilterOr_> {}
8033
8051
  declare const FilterOr: Schema<FilterOr>;
8052
+ /**
8053
+ * Filter objects that are children of the specified parents.
8054
+ * With transitive=true (default), matches grandchildren and beyond.
8055
+ */
8056
+ declare const FilterChildOf_: Struct<{
8057
+ type: Literal<["child-of"]>;
8058
+ /** Parent DXNs to match children of. */
8059
+ parents: Array$<Schema<EchoURI, EchoURI, never>>;
8060
+ /** Whether to match transitively (grandchildren, etc.). Defaults to true. */
8061
+ transitive: typeof Boolean$;
8062
+ }>;
8063
+ interface FilterChildOf extends Schema.Type<typeof FilterChildOf_> {}
8064
+ declare const FilterChildOf: Schema<FilterChildOf>;
8034
8065
  /**
8035
8066
  * Union of filters.
8036
8067
  */
8037
- declare const Filter$1: Union<[Schema<FilterObject, FilterObject, never>, Schema<FilterCompare, FilterCompare, never>, Schema<FilterIn, FilterIn, never>, Schema<FilterContains, FilterContains, never>, Schema<FilterTag, FilterTag, never>, Schema<FilterRange, FilterRange, never>, Schema<FilterTextSearch, FilterTextSearch, never>, Schema<FilterNot, FilterNot, never>, Schema<FilterAnd, FilterAnd, never>, Schema<FilterOr, FilterOr, never>]>;
8068
+ declare const Filter$1: Union<[Schema<FilterObject, FilterObject, never>, Schema<FilterCompare, FilterCompare, never>, Schema<FilterIn, FilterIn, never>, Schema<FilterContains, FilterContains, never>, Schema<FilterTag, FilterTag, never>, Schema<FilterRange, FilterRange, never>, Schema<FilterTimestamp, FilterTimestamp, never>, Schema<FilterTextSearch, FilterTextSearch, never>, Schema<FilterChildOf, FilterChildOf, never>, Schema<FilterNot, FilterNot, never>, Schema<FilterAnd, FilterAnd, never>, Schema<FilterOr, FilterOr, never>]>;
8038
8069
  type Filter$1 = Schema.Type<typeof Filter$1>;
8039
8070
  /**
8040
8071
  * Query objects by type, id, and/or predicates.
8041
8072
  */
8042
8073
  declare const QuerySelectClause_: Struct<{
8043
8074
  type: Literal<["select"]>;
8044
- filter: suspend<FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, never>;
8075
+ filter: suspend<FilterAnd | FilterChildOf | FilterCompare | FilterContains | FilterIn | FilterNot | FilterObject | FilterOr | FilterRange | FilterTag | FilterTextSearch | FilterTimestamp, FilterAnd | FilterChildOf | FilterCompare | FilterContains | FilterIn | FilterNot | FilterObject | FilterOr | FilterRange | FilterTag | FilterTextSearch | FilterTimestamp, never>;
8045
8076
  }>;
8046
8077
  interface QuerySelectClause extends Schema.Type<typeof QuerySelectClause_> {}
8047
8078
  declare const QuerySelectClause: Schema<QuerySelectClause>;
@@ -8050,8 +8081,8 @@ declare const QuerySelectClause: Schema<QuerySelectClause>;
8050
8081
  */
8051
8082
  declare const QueryFilterClause_: Struct<{
8052
8083
  type: Literal<["filter"]>;
8053
- selection: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, never>;
8054
- filter: suspend<FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, never>;
8084
+ selection: suspend<QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, never>;
8085
+ filter: suspend<FilterAnd | FilterChildOf | FilterCompare | FilterContains | FilterIn | FilterNot | FilterObject | FilterOr | FilterRange | FilterTag | FilterTextSearch | FilterTimestamp, FilterAnd | FilterChildOf | FilterCompare | FilterContains | FilterIn | FilterNot | FilterObject | FilterOr | FilterRange | FilterTag | FilterTextSearch | FilterTimestamp, never>;
8055
8086
  }>;
8056
8087
  interface QueryFilterClause extends Schema.Type<typeof QueryFilterClause_> {}
8057
8088
  declare const QueryFilterClause: Schema<QueryFilterClause>;
@@ -8060,7 +8091,7 @@ declare const QueryFilterClause: Schema<QueryFilterClause>;
8060
8091
  */
8061
8092
  declare const QueryReferenceTraversalClause_: Struct<{
8062
8093
  type: Literal<["reference-traversal"]>;
8063
- anchor: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, never>;
8094
+ anchor: suspend<QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, never>;
8064
8095
  property: typeof String$;
8065
8096
  }>;
8066
8097
  interface QueryReferenceTraversalClause extends Schema.Type<typeof QueryReferenceTraversalClause_> {}
@@ -8070,13 +8101,13 @@ declare const QueryReferenceTraversalClause: Schema<QueryReferenceTraversalClaus
8070
8101
  */
8071
8102
  declare const QueryIncomingReferencesClause_: Struct<{
8072
8103
  type: Literal<["incoming-references"]>;
8073
- anchor: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, never>;
8104
+ anchor: suspend<QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, never>;
8074
8105
  /**
8075
8106
  * Property path where the reference is located.
8076
8107
  * If null, matches references from any property.
8077
8108
  */
8078
8109
  property: NullOr<typeof String$>;
8079
- typename: Union<[refine<string, typeof NonEmptyString>, typeof Null]>;
8110
+ typename: Union<[Schema<URI, URI, never>, typeof Null]>;
8080
8111
  }>;
8081
8112
  interface QueryIncomingReferencesClause extends Schema.Type<typeof QueryIncomingReferencesClause_> {}
8082
8113
  declare const QueryIncomingReferencesClause: Schema<QueryIncomingReferencesClause>;
@@ -8085,14 +8116,14 @@ declare const QueryIncomingReferencesClause: Schema<QueryIncomingReferencesClaus
8085
8116
  */
8086
8117
  declare const QueryRelationClause_: Struct<{
8087
8118
  type: Literal<["relation"]>;
8088
- anchor: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, never>;
8119
+ anchor: suspend<QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, never>;
8089
8120
  /**
8090
8121
  * outgoing: anchor is the source of the relation.
8091
8122
  * incoming: anchor is the target of the relation.
8092
8123
  * both: anchor is either the source or target of the relation.
8093
8124
  */
8094
8125
  direction: Literal<["outgoing", "incoming", "both"]>;
8095
- filter: optional<suspend<FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, never>>;
8126
+ filter: optional<suspend<FilterAnd | FilterChildOf | FilterCompare | FilterContains | FilterIn | FilterNot | FilterObject | FilterOr | FilterRange | FilterTag | FilterTextSearch | FilterTimestamp, FilterAnd | FilterChildOf | FilterCompare | FilterContains | FilterIn | FilterNot | FilterObject | FilterOr | FilterRange | FilterTag | FilterTextSearch | FilterTimestamp, never>>;
8096
8127
  }>;
8097
8128
  interface QueryRelationClause extends Schema.Type<typeof QueryRelationClause_> {}
8098
8129
  declare const QueryRelationClause: Schema<QueryRelationClause>;
@@ -8101,7 +8132,7 @@ declare const QueryRelationClause: Schema<QueryRelationClause>;
8101
8132
  */
8102
8133
  declare const QueryRelationTraversalClause_: Struct<{
8103
8134
  type: Literal<["relation-traversal"]>;
8104
- anchor: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, never>;
8135
+ anchor: suspend<QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, never>;
8105
8136
  direction: Literal<["source", "target", "both"]>;
8106
8137
  }>;
8107
8138
  interface QueryRelationTraversalClause extends Schema.Type<typeof QueryRelationTraversalClause_> {}
@@ -8111,7 +8142,7 @@ declare const QueryRelationTraversalClause: Schema<QueryRelationTraversalClause>
8111
8142
  */
8112
8143
  declare const QueryHierarchyTraversalClause_: Struct<{
8113
8144
  type: Literal<["hierarchy-traversal"]>;
8114
- anchor: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, never>;
8145
+ anchor: suspend<QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, never>;
8115
8146
  /**
8116
8147
  * to-parent: traverse from child to parent.
8117
8148
  * to-children: traverse from parent to children.
@@ -8125,7 +8156,7 @@ declare const QueryHierarchyTraversalClause: Schema<QueryHierarchyTraversalClaus
8125
8156
  */
8126
8157
  declare const QueryUnionClause_: Struct<{
8127
8158
  type: Literal<["union"]>;
8128
- queries: Array$<suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, never>>;
8159
+ queries: Array$<suspend<QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, never>>;
8129
8160
  }>;
8130
8161
  interface QueryUnionClause extends Schema.Type<typeof QueryUnionClause_> {}
8131
8162
  declare const QueryUnionClause: Schema<QueryUnionClause>;
@@ -8134,8 +8165,8 @@ declare const QueryUnionClause: Schema<QueryUnionClause>;
8134
8165
  */
8135
8166
  declare const QuerySetDifferenceClause_: Struct<{
8136
8167
  type: Literal<["set-difference"]>;
8137
- source: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, never>;
8138
- exclude: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, never>;
8168
+ source: suspend<QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, never>;
8169
+ exclude: suspend<QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, never>;
8139
8170
  }>;
8140
8171
  interface QuerySetDifferenceClause extends Schema.Type<typeof QuerySetDifferenceClause_> {}
8141
8172
  declare const QuerySetDifferenceClause: Schema<QuerySetDifferenceClause>;
@@ -8159,7 +8190,7 @@ declare const Order$1: Schema<Order$1>;
8159
8190
  */
8160
8191
  declare const QueryOrderClause_: Struct<{
8161
8192
  type: Literal<["order"]>;
8162
- query: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, never>;
8193
+ query: suspend<QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, never>;
8163
8194
  order: Array$<Schema<{
8164
8195
  readonly kind: "natural";
8165
8196
  } | {
@@ -8187,17 +8218,13 @@ declare const QueryOrderClause: Schema<QueryOrderClause>;
8187
8218
  */
8188
8219
  declare const QueryOptionsClause_: Struct<{
8189
8220
  type: Literal<["options"]>;
8190
- query: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, never>;
8221
+ query: suspend<QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, never>;
8191
8222
  options: suspend<{
8192
- readonly deleted?: "include" | "exclude" | "only" | undefined;
8193
- readonly spaceIds?: readonly string[] | undefined;
8194
- readonly allQueuesFromSpaces?: boolean | undefined;
8195
- readonly queues?: readonly string[] | undefined;
8223
+ readonly deleted?: "exclude" | "include" | "only" | undefined;
8224
+ readonly debugLabel?: string | undefined;
8196
8225
  }, {
8197
- readonly deleted?: "include" | "exclude" | "only" | undefined;
8198
- readonly spaceIds?: readonly string[] | undefined;
8199
- readonly allQueuesFromSpaces?: boolean | undefined;
8200
- readonly queues?: readonly string[] | undefined;
8226
+ readonly debugLabel?: string | undefined;
8227
+ readonly deleted?: "exclude" | "include" | "only" | undefined;
8201
8228
  }, never>;
8202
8229
  }>;
8203
8230
  interface QueryOptionsClause extends Schema.Type<typeof QueryOptionsClause_> {}
@@ -8207,74 +8234,85 @@ declare const QueryOptionsClause: Schema<QueryOptionsClause>;
8207
8234
  */
8208
8235
  declare const QueryLimitClause_: Struct<{
8209
8236
  type: Literal<["limit"]>;
8210
- query: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, never>;
8237
+ query: suspend<QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, never>;
8211
8238
  limit: typeof Number$;
8212
8239
  }>;
8213
8240
  interface QueryLimitClause extends Schema.Type<typeof QueryLimitClause_> {}
8214
8241
  declare const QueryLimitClause: Schema<QueryLimitClause>;
8215
- declare const Query_: Union<[Schema<QuerySelectClause, QuerySelectClause, never>, Schema<QueryFilterClause, QueryFilterClause, never>, Schema<QueryReferenceTraversalClause, QueryReferenceTraversalClause, never>, Schema<QueryIncomingReferencesClause, QueryIncomingReferencesClause, never>, Schema<QueryRelationClause, QueryRelationClause, never>, Schema<QueryRelationTraversalClause, QueryRelationTraversalClause, never>, Schema<QueryHierarchyTraversalClause, QueryHierarchyTraversalClause, never>, Schema<QueryUnionClause, QueryUnionClause, never>, Schema<QuerySetDifferenceClause, QuerySetDifferenceClause, never>, Schema<QueryOrderClause, QueryOrderClause, never>, Schema<QueryOptionsClause, QueryOptionsClause, never>, Schema<QueryLimitClause, QueryLimitClause, never>]>;
8216
- type Query$1 = Schema.Type<typeof Query_>;
8217
- declare const Query$1: Schema<Query$1>;
8242
+ declare const QueryFromClause_: Struct<{
8243
+ type: Literal<["from"]>;
8244
+ query: suspend<QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, never>;
8245
+ from: Union<[TaggedStruct<"scope", {
8246
+ scope: suspend<{
8247
+ readonly spaceIds?: readonly string[] | undefined;
8248
+ readonly allFeedsFromSpaces?: boolean | undefined;
8249
+ readonly feeds?: readonly EchoURI[] | undefined;
8250
+ }, {
8251
+ readonly allFeedsFromSpaces?: boolean | undefined;
8252
+ readonly feeds?: readonly EchoURI[] | undefined;
8253
+ readonly spaceIds?: readonly string[] | undefined;
8254
+ }, never>;
8255
+ }>, TaggedStruct<"query", {
8256
+ query: suspend<QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, never>;
8257
+ }>]>;
8258
+ }>;
8259
+ interface QueryFromClause extends Schema.Type<typeof QueryFromClause_> {}
8260
+ declare const QueryFromClause: Schema<QueryFromClause>;
8261
+ declare const Query_: Union<[Schema<QuerySelectClause, QuerySelectClause, never>, Schema<QueryFilterClause, QueryFilterClause, never>, Schema<QueryReferenceTraversalClause, QueryReferenceTraversalClause, never>, Schema<QueryIncomingReferencesClause, QueryIncomingReferencesClause, never>, Schema<QueryRelationClause, QueryRelationClause, never>, Schema<QueryRelationTraversalClause, QueryRelationTraversalClause, never>, Schema<QueryHierarchyTraversalClause, QueryHierarchyTraversalClause, never>, Schema<QueryUnionClause, QueryUnionClause, never>, Schema<QuerySetDifferenceClause, QuerySetDifferenceClause, never>, Schema<QueryOrderClause, QueryOrderClause, never>, Schema<QueryOptionsClause, QueryOptionsClause, never>, Schema<QueryLimitClause, QueryLimitClause, never>, Schema<QueryFromClause, QueryFromClause, never>]>;
8262
+ type Query$2 = Schema.Type<typeof Query_>;
8263
+ declare const Query$2: Schema<Query$2>;
8218
8264
  declare const QueryOptions: Struct<{
8265
+ /**
8266
+ * Nested select statements will use this option to filter deleted objects.
8267
+ */
8268
+ deleted: optional<Literal<["include", "exclude", "only"]>>;
8269
+ /**
8270
+ * Diagnostics-only label for logs / tooling (not used by execution semantics).
8271
+ */
8272
+ debugLabel: optional<typeof String$>;
8273
+ }>;
8274
+ interface QueryOptions extends Schema.Type<typeof QueryOptions> {}
8275
+ /**
8276
+ * Specifies the scope of the data to query from.
8277
+ */
8278
+ declare const Scope: Struct<{
8219
8279
  /**
8220
8280
  * The nested select statemets will select from the given spaces.
8221
8281
  *
8222
- * NOTE: Spaces and queues are unioned together if both are specified.
8282
+ * NOTE: Spaces and feeds are unioned together if both are specified.
8223
8283
  */
8224
8284
  spaceIds: optional<Array$<typeof String$>>;
8225
8285
  /**
8226
- * If true, the nested select statements will select from all queues in the spaces specified by `spaceIds`.
8286
+ * If true, the nested select statements will select from all feeds in the spaces specified by `spaceIds`.
8227
8287
  */
8228
- allQueuesFromSpaces: optional<typeof Boolean$>;
8288
+ allFeedsFromSpaces: optional<typeof Boolean$>;
8229
8289
  /**
8230
- * The nested select statemets will select from the given queues.
8290
+ * The nested select statemets will select from the given feeds (by EchoURI or legacy DXN).
8231
8291
  *
8232
- * NOTE: Spaces and queues are unioned together if both are specified.
8233
- */
8234
- queues: optional<Array$<refine<string, typeof NonEmptyString>>>;
8235
- /**
8236
- * Nested select statements will use this option to filter deleted objects.
8292
+ * NOTE: Spaces and feeds are unioned together if both are specified.
8237
8293
  */
8238
- deleted: optional<Literal<["include", "exclude", "only"]>>;
8294
+ feeds: optional<Array$<Schema<EchoURI, EchoURI, never>>>;
8239
8295
  }>;
8240
- interface QueryOptions extends Schema.Type<typeof QueryOptions> {}
8296
+ interface Scope extends Schema.Type<typeof Scope> {}
8241
8297
  //#endregion
8242
- //#region ../echo/dist/types/src/internal/types/base.d.ts
8298
+ //#region ../../../common/util/dist/types/src/types.d.ts
8243
8299
  /**
8244
- * Canonical type for all ECHO entities (objects and relations).
8300
+ * Removes readonly modifiers from top-level properties of T.
8301
+ * Also converts readonly arrays at the top level to mutable arrays.
8302
+ * For nested properties, mutability depends on the schema definition.
8245
8303
  */
8246
- interface AnyEntity {
8247
- readonly id: ObjectId;
8248
- }
8304
+ type ToMutable<T$1> = T$1 extends object ? { -readonly [K in keyof T$1]: T$1[K] extends readonly (infer U)[] ? U[] : T$1[K] } : T$1;
8249
8305
  //#endregion
8250
- //#region ../echo/dist/types/src/internal/types/entity.d.ts
8251
- /**
8252
- * String key used to identify the kind of an entity instance (object or relation).
8253
- */
8254
- declare const KindId: "~@dxos/echo/Kind";
8255
- type KindId = typeof KindId;
8256
- /**
8257
- * String key used to identify the kind of a schema (object schema or relation schema).
8258
- * Parallels KindId which identifies instance kinds.
8259
- */
8260
- declare const SchemaKindId: "~@dxos/echo/SchemaKind";
8261
- type SchemaKindId = typeof SchemaKindId;
8306
+ //#region ../../../common/effect/dist/types/src/json-path.d.ts
8307
+ type JsonPath = string & {
8308
+ __JsonPath: true;
8309
+ };
8262
8310
  /**
8263
- * Kinds of entities stored in ECHO: objects and relations.
8311
+ * https://www.ietf.org/archive/id/draft-goessner-dispatch-jsonpath-00.html
8264
8312
  */
8265
- declare enum EntityKind {
8266
- Object = "object",
8267
- Relation = "relation",
8268
- }
8269
- //#endregion
8270
- //#region ../echo/dist/types/src/internal/annotations/annotations.d.ts
8271
- declare const TypeMeta: Struct<{
8272
- typename: refine<string, typeof String$>;
8273
- version: refine<string, typeof String$>;
8274
- }>;
8275
- interface TypeMeta extends Schema.Type<typeof TypeMeta> {}
8313
+ declare const JsonPath: Schema<JsonPath>;
8276
8314
  //#endregion
8277
- //#region ../../../../node_modules/.pnpm/@effect-atom+atom@0.5.1_@effect+experimental@0.58.0_@effect+platform@0.94.4_effect@3.19_2781dcea2245861d5b097a0ab57df73a/node_modules/@effect-atom/atom/dist/dts/AtomHttpApi.d.ts
8315
+ //#region ../../../../node_modules/.pnpm/@effect-atom+atom@0.5.1_@effect+experimental@0.58.0_@effect+platform@0.94.4_effect@3.20_0d92fe5e7b61f71046b89ef5357c0767/node_modules/@effect-atom/atom/dist/dts/AtomHttpApi.d.ts
8278
8316
  declare global {
8279
8317
  interface ErrorConstructor {
8280
8318
  stackTraceLimit: number;
@@ -8285,7 +8323,7 @@ declare global {
8285
8323
  * @category Constructors
8286
8324
  */
8287
8325
  //#endregion
8288
- //#region ../../../../node_modules/.pnpm/@effect-atom+atom@0.5.1_@effect+experimental@0.58.0_@effect+platform@0.94.4_effect@3.19_2781dcea2245861d5b097a0ab57df73a/node_modules/@effect-atom/atom/dist/dts/AtomRpc.d.ts
8326
+ //#region ../../../../node_modules/.pnpm/@effect-atom+atom@0.5.1_@effect+experimental@0.58.0_@effect+platform@0.94.4_effect@3.20_0d92fe5e7b61f71046b89ef5357c0767/node_modules/@effect-atom/atom/dist/dts/AtomRpc.d.ts
8289
8327
  declare global {
8290
8328
  interface ErrorConstructor {
8291
8329
  stackTraceLimit: number;
@@ -8296,87 +8334,309 @@ declare global {
8296
8334
  * @category Constructors
8297
8335
  */
8298
8336
  //#endregion
8299
- //#region ../echo/dist/types/src/internal/ref/ref.d.ts
8300
- declare const RefTypeId: unique symbol;
8301
- /**
8302
- * Reference Schema.
8303
- */
8304
- interface RefSchema<T$1 extends AnyEntity> extends SchemaClass<Ref<T$1>, EncodedReference> {}
8337
+ //#region ../echo/dist/types/src/internal/JsonSchema/json-schema-type.d.ts
8305
8338
  /**
8306
- * Type of the `Ref` function and extra methods attached to it.
8339
+ * Describes a schema for the JSON-schema objects stored in ECHO.
8340
+ * Contains extensions for ECHO (e.g., references).
8341
+ * Ref: https://json-schema.org/draft-07/schema
8307
8342
  */
8308
- interface RefFn {
8309
- <S$1 extends Schema.Any>(schema: S$1): RefSchema<Schema.Type<S$1>>;
8343
+ declare const _JsonSchemaType: Struct<{
8310
8344
  /**
8311
- * @returns True if the object is a reference.
8345
+ * Identifier for this schema.
8346
+ * This schema might be referenced by $ref clause in other schemas.
8312
8347
  */
8313
- isRef: (obj: unknown) => obj is Ref<any>;
8348
+ $id: optional<typeof String$>;
8314
8349
  /**
8315
- * @returns True if the reference points to the given object id.
8350
+ * Schema of this schema.
8351
+ * Set to "https://json-schema.org/draft-07/schema".
8316
8352
  */
8317
- hasObjectId: (id: ObjectId) => (ref: Ref<any>) => boolean;
8353
+ $schema: optional<typeof String$>;
8318
8354
  /**
8319
- * @returns True if the schema is a reference schema.
8355
+ * Reference to another schema.
8320
8356
  */
8321
- isRefSchema: (schema: Schema<any, any>) => schema is RefSchema<any>;
8357
+ $ref: optional<typeof String$>;
8322
8358
  /**
8323
- * @returns True if the schema AST is a reference schema.
8359
+ * Comments are ignored when interpreting the schema.
8324
8360
  */
8325
- isRefSchemaAST: (ast: AST) => boolean;
8361
+ $comment: optional<typeof String$>;
8326
8362
  /**
8327
- * Constructs a reference that points to the given object.
8363
+ * Defines whether this schema is an object schema or a relation schema.
8328
8364
  */
8329
- make: <T$1 extends AnyEntity>(object: T$1) => Ref<T$1>;
8365
+ entityKind: optional<Enums<typeof EntityKind>>;
8330
8366
  /**
8331
- * Constructs a reference that points to the object specified by the provided DXN.
8367
+ * Typename of this schema.
8368
+ * Only on schema representing an ECHO object.
8369
+ *
8370
+ * @example 'com.example.type.my-type'
8332
8371
  */
8333
- fromDXN: (dxn: DXN) => Ref<any>;
8334
- }
8335
- /**
8336
- * Schema builder for references.
8337
- */
8338
- declare const Ref: RefFn;
8339
- /**
8340
- * Represents materialized reference to a target.
8341
- * This is the data type for the fields marked as ref.
8342
- */
8343
- interface Ref<T$1> extends Pipeable {
8372
+ typename: optional<typeof String$>;
8344
8373
  /**
8345
- * Target object DXN.
8374
+ * Version of this schema.
8375
+ * Custom dialect for ECHO.
8346
8376
  */
8347
- get dxn(): DXN;
8377
+ version: optional<typeof String$>;
8348
8378
  /**
8349
- * Returns true if the reference has a target available (inlined or resolver set).
8379
+ * Target of this relation.
8380
+ * Only for relation schemas.
8381
+ * The referenced schema must be an object schema.
8350
8382
  */
8351
- get isAvailable(): boolean;
8383
+ relationTarget: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
8352
8384
  /**
8353
- * @returns The reference target.
8354
- * May return `undefined` if the object is not loaded in the working set.
8355
- * Accessing this property, even if it returns `undefined` will trigger the object to be loaded to the working set.
8385
+ * Source of this relation.
8386
+ * Only for relation schemas.
8387
+ * The referenced schema must be an object schema.
8356
8388
  */
8357
- get target(): T$1 | undefined;
8389
+ relationSource: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
8358
8390
  /**
8359
- * @returns Promise that will resolves with the target object.
8360
- * Will load the object from disk if it is not present in the working set.
8361
- * @throws If the object is not available locally.
8391
+ * Title of this schema.
8362
8392
  */
8363
- load(): Promise<T$1>;
8393
+ title: optional<typeof String$>;
8364
8394
  /**
8365
- * @returns Promise that will resolves with the target object or undefined if the object is not loaded locally.
8395
+ * Description of this schema.
8366
8396
  */
8367
- tryLoad(): Promise<T$1 | undefined>;
8397
+ description: optional<typeof String$>;
8368
8398
  /**
8369
- * Do not inline the target object in the reference.
8370
- * Makes .target unavailable unless the reference is connected to a database context.
8371
- *
8372
- * When serialized with toJSON, the difference is between:
8373
- * `{ "/": "dxn:..." }`
8374
- * and
8375
- * `{ "/": "dxn:...", "target": { ... } }`
8376
- *
8377
- * Clones the reference object.
8399
+ * Whether this schema is read-only.
8378
8400
  */
8379
- noInline(): Ref<T$1>;
8401
+ readOnly: optional<typeof Boolean$>;
8402
+ /**
8403
+ * Whether this schema is write-only.
8404
+ */
8405
+ writeOnly: optional<typeof Boolean$>;
8406
+ /**
8407
+ * Examples of instances of this schema.
8408
+ */
8409
+ examples: optional<Array$<typeof Any$4>>;
8410
+ /**
8411
+ * Default value for this schema.
8412
+ */
8413
+ default: optional<typeof Any$4>;
8414
+ /**
8415
+ * This schema only matches values that are equal to this value.
8416
+ */
8417
+ const: optional<typeof Any$4>;
8418
+ /**
8419
+ * This schema only matches one of the values in this array.
8420
+ */
8421
+ enum: optional<Array$<typeof Any$4>>;
8422
+ /**
8423
+ * Base type of the schema.
8424
+ */
8425
+ type: optional<Union<[Literal<["array", "boolean", "integer", "null", "number", "object", "string"]>, Array$<Literal<["array", "boolean", "integer", "null", "number", "object", "string"]>>]>>;
8426
+ multipleOf: optional<filter<typeof Number$>>;
8427
+ maximum: optional<typeof Number$>;
8428
+ exclusiveMaximum: optional<typeof Number$>;
8429
+ minimum: optional<typeof Number$>;
8430
+ exclusiveMinimum: optional<typeof Number$>;
8431
+ maxLength: optional<filter<typeof Number$>>;
8432
+ /**
8433
+ * Regex pattern for strings.
8434
+ */
8435
+ pattern: optional<typeof String$>;
8436
+ /**
8437
+ * Serialized from {@link FormatAnnotationId}.
8438
+ */
8439
+ format: optional<typeof String$>;
8440
+ minLength: optional<filter<typeof Number$>>;
8441
+ items: optional<Union<[suspend<JsonSchemaType, JsonSchemaType, never>, Array$<suspend<JsonSchemaType, JsonSchemaType, never>>]>>;
8442
+ additionalItems: optional<Union<[suspend<JsonSchemaType, JsonSchemaType, never>, typeof Boolean$]>>;
8443
+ maxItems: optional<filter<typeof Number$>>;
8444
+ minItems: optional<filter<typeof Number$>>;
8445
+ uniqueItems: optional<typeof Boolean$>;
8446
+ contains: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
8447
+ maxProperties: optional<filter<typeof Number$>>;
8448
+ minProperties: optional<filter<typeof Number$>>;
8449
+ required: optional<Array$<typeof String$>>;
8450
+ /**
8451
+ * Non-standard JSON Schema extension.
8452
+ * Defines the order of properties in the object.
8453
+ * The unmentioned properties are placed at the end.
8454
+ *
8455
+ * Related: https://github.com/json-schema/json-schema/issues/119
8456
+ */
8457
+ propertyOrder: optional<Array$<typeof String$>>;
8458
+ additionalProperties: optional<Union<[suspend<JsonSchemaType, JsonSchemaType, never>, typeof Boolean$]>>;
8459
+ properties: optional<Record$<typeof String$, suspend<JsonSchemaType, JsonSchemaType, never>>>;
8460
+ patternProperties: optional<Record$<typeof String$, suspend<JsonSchemaType, JsonSchemaType, never>>>;
8461
+ propertyNames: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
8462
+ definitions: optional<Record$<typeof String$, suspend<JsonSchemaType, JsonSchemaType, never>>>;
8463
+ dependencies: optional<Record$<typeof String$, suspend<string | JsonSchemaType | readonly string[], string | JsonSchemaType | readonly string[], never>>>;
8464
+ contentMediaType: optional<typeof String$>;
8465
+ contentEncoding: optional<typeof String$>;
8466
+ if: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
8467
+ then: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
8468
+ else: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
8469
+ allOf: optional<Array$<suspend<JsonSchemaType, JsonSchemaType, never>>>;
8470
+ anyOf: optional<Array$<suspend<JsonSchemaType, JsonSchemaType, never>>>;
8471
+ oneOf: optional<Array$<suspend<JsonSchemaType, JsonSchemaType, never>>>;
8472
+ not: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
8473
+ $defs: optional<Record$<typeof String$, suspend<JsonSchemaType, JsonSchemaType, never>>>;
8474
+ currency: optional<typeof String$>;
8475
+ reference: optional<Struct<{
8476
+ schema: suspend<JsonSchemaType, JsonSchemaType, never>;
8477
+ schemaVersion: optional<typeof String$>;
8478
+ schemaObject: optional<typeof String$>;
8479
+ }>>;
8480
+ /**
8481
+ * ECHO-specific annotations.
8482
+ */
8483
+ annotations: optional<Struct<{
8484
+ /**
8485
+ * Label for this schema.
8486
+ * Mapped from {@link LabelAnnotationId}.
8487
+ */
8488
+ labelProp: optional<Union<[Schema<JsonPath, JsonPath, never>, Array$<Schema<JsonPath, JsonPath, never>>]>>;
8489
+ /**
8490
+ * Generator function for this schema.
8491
+ * Mapped from {@link GeneratorAnnotationId}.
8492
+ */
8493
+ generator: optional<Union<[typeof String$, Tuple2<typeof String$, typeof Number$>]>>;
8494
+ /**
8495
+ * {@link PropertyMeta} annotations get serialized here.
8496
+ */
8497
+ meta: optional<Record$<typeof String$, typeof Any$4>>;
8498
+ /**
8499
+ * @deprecated
8500
+ */
8501
+ type: optional<Struct<{
8502
+ typename: typeof String$;
8503
+ version: typeof String$;
8504
+ schemaId: optional<typeof String$>;
8505
+ }>>;
8506
+ /**
8507
+ * @deprecated Superseded by `meta`.
8508
+ */
8509
+ annotations: optional<Record$<typeof String$, typeof Any$4>>;
8510
+ }>>;
8511
+ /**
8512
+ * @deprecated Use `annotations` instead.
8513
+ */
8514
+ echo: optional<Struct<{
8515
+ /**
8516
+ * Label for this schema.
8517
+ * Mapped from {@link LabelAnnotationId}.
8518
+ */
8519
+ labelProp: optional<Union<[Schema<JsonPath, JsonPath, never>, Array$<Schema<JsonPath, JsonPath, never>>]>>;
8520
+ /**
8521
+ * Generator function for this schema.
8522
+ * Mapped from {@link GeneratorAnnotationId}.
8523
+ */
8524
+ generator: optional<Union<[typeof String$, Tuple2<typeof String$, typeof Number$>]>>;
8525
+ /**
8526
+ * {@link PropertyMeta} annotations get serialized here.
8527
+ */
8528
+ meta: optional<Record$<typeof String$, typeof Any$4>>;
8529
+ /**
8530
+ * @deprecated
8531
+ */
8532
+ type: optional<Struct<{
8533
+ typename: typeof String$;
8534
+ version: typeof String$;
8535
+ schemaId: optional<typeof String$>;
8536
+ }>>;
8537
+ /**
8538
+ * @deprecated Superseded by `meta`.
8539
+ */
8540
+ annotations: optional<Record$<typeof String$, typeof Any$4>>;
8541
+ }>>;
8542
+ }>;
8543
+ /**
8544
+ * https://json-schema.org/draft-07/schema
8545
+ */
8546
+ interface JsonSchemaType extends Schema.Type<typeof _JsonSchemaType> {}
8547
+ declare const JsonSchemaType: Schema<JsonSchemaType>;
8548
+ //#endregion
8549
+ //#region ../echo/dist/types/src/internal/Ref/ref.d.ts
8550
+ declare const RefTypeId: unique symbol;
8551
+ /**
8552
+ * Reference Schema.
8553
+ */
8554
+ interface RefSchema$1<T$1 extends AnyEntity> extends SchemaClass<Ref<T$1>, EncodedReference> {}
8555
+ /**
8556
+ * Type of the `Ref` function and extra methods attached to it.
8557
+ */
8558
+ interface RefFn {
8559
+ <S$1 extends AnyEntity$1 | UnknownTypeSchema<any, any> = AnyEntity$1>(schema: S$1): RefSchema$1<S$1 extends AnyType ? AnyEntity$1 : S$1 extends AnyObj | AnyRelation ? InstanceType$1<S$1> : S$1 extends UnknownTypeSchema<infer A, any> ? A : never>;
8560
+ /**
8561
+ * @returns True if the object is a reference.
8562
+ */
8563
+ isRef: (obj: unknown) => obj is Ref<any>;
8564
+ /**
8565
+ * @returns True if the reference points to the given object id.
8566
+ */
8567
+ hasObjectId: (id: ObjectId) => (ref: Ref<any>) => boolean;
8568
+ /**
8569
+ * @returns True if the schema is a reference schema.
8570
+ */
8571
+ isRefSchema: (schema: Schema<any, any>) => schema is RefSchema$1<any>;
8572
+ /**
8573
+ * @returns True if the schema AST is a reference schema.
8574
+ */
8575
+ isRefSchemaAST: (ast: AST) => boolean;
8576
+ /**
8577
+ * Constructs a reference that points to the given object.
8578
+ */
8579
+ make: <T$1 extends AnyEntity>(object: T$1) => Ref<T$1>;
8580
+ /**
8581
+ * Constructs a reference that points to the object specified by the provided URI
8582
+ * (either an `echo:` EchoURI for an object reference or a `dxn:` DXN for a type reference).
8583
+ */
8584
+ fromURI: (uri: URI) => Ref<any>;
8585
+ }
8586
+ /**
8587
+ * Schema builder for references.
8588
+ */
8589
+ declare const Ref: RefFn;
8590
+ /**
8591
+ * Represents materialized reference to a target.
8592
+ * This is the data type for the fields marked as ref.
8593
+ */
8594
+ interface Ref<T$1> extends Pipeable {
8595
+ /**
8596
+ * Target URI (either an `echo:` EchoURI for an object reference or a `dxn:` DXN for a type reference).
8597
+ */
8598
+ get uri(): URI;
8599
+ /**
8600
+ * Returns true if the reference has a target available (inlined or resolver set).
8601
+ */
8602
+ get isAvailable(): boolean;
8603
+ /**
8604
+ * @returns The reference target.
8605
+ * May return `undefined` if the object is not loaded in the working set.
8606
+ * Accessing this property, even if it returns `undefined` will trigger the object to be loaded to the working set.
8607
+ */
8608
+ get target(): T$1 | undefined;
8609
+ /**
8610
+ * @returns Promise that will resolves with the target object.
8611
+ * Will load the object from disk if it is not present in the working set.
8612
+ * @throws If the object is not available locally.
8613
+ */
8614
+ load(): Promise<T$1>;
8615
+ /**
8616
+ * @returns Promise that will resolves with the target object or undefined if the object is not loaded locally.
8617
+ */
8618
+ tryLoad(): Promise<T$1 | undefined>;
8619
+ /**
8620
+ * Subscribe to the ref's resolution event.
8621
+ * The callback fires when the target object becomes available in the working set
8622
+ * (e.g. when its document is loaded after sibling-client mutation).
8623
+ * Note: the resolver only schedules a notification when the target is requested
8624
+ * via {@link target} while it is not yet loaded.
8625
+ * @returns Function that unsubscribes the callback.
8626
+ */
8627
+ onResolved(callback: () => void): () => void;
8628
+ /**
8629
+ * Do not inline the target object in the reference.
8630
+ * Makes .target unavailable unless the reference is connected to a database context.
8631
+ *
8632
+ * When serialized with toJSON, the difference is between:
8633
+ * `{ "/": "dxn:..." }`
8634
+ * and
8635
+ * `{ "/": "dxn:...", "target": { ... } }`
8636
+ *
8637
+ * Clones the reference object.
8638
+ */
8639
+ noInline(): Ref<T$1>;
8380
8640
  /**
8381
8641
  * Serializes the reference to a JSON object.
8382
8642
  * The serialization format is compatible with the IPLD-style encoded references.
@@ -8398,115 +8658,90 @@ declare namespace Ref {
8398
8658
  */
8399
8659
  type Target<R$1> = R$1 extends Ref<infer U> ? U : never;
8400
8660
  }
8401
- //#endregion
8402
- //#region ../echo/dist/types/src/internal/entities/relation.d.ts
8403
- /**
8404
- * Property name for relation source when object is serialized to JSON.
8405
- */
8406
- declare const ATTR_RELATION_SOURCE = "@relationSource";
8407
- /**
8408
- * Property name for relation target when object is serialized to JSON.
8409
- */
8410
- declare const ATTR_RELATION_TARGET = "@relationTarget";
8661
+ interface RefResolver {
8662
+ /**
8663
+ * Resolve ref synchronously from the objects in the working set.
8664
+ *
8665
+ * @param uri
8666
+ * @param load If true the resolver should attempt to load the object from disk.
8667
+ * @param onLoad Callback to call when the object is loaded.
8668
+ */
8669
+ resolveSync(uri: URI, load: boolean, onLoad?: () => void): AnyProperties | undefined;
8670
+ /**
8671
+ * Resolver ref asynchronously.
8672
+ */
8673
+ resolve(uri: URI): Promise<AnyProperties | undefined>;
8674
+ resolveSchema(uri: URI): Promise<Schema.AnyNoContext | undefined>;
8675
+ /**
8676
+ * Resolve the source `Type.AnyEntity` entity for a type URI. Used by
8677
+ * deserialization paths (`Obj.fromJSON`) to set the back-reference accessed
8678
+ * via `Obj.getType` / `Entity.getType`. Optional — resolvers that only
8679
+ * carry raw schemas may leave this unimplemented; the deserializer falls
8680
+ * back to leaving the type entity unset.
8681
+ */
8682
+ resolveType?(uri: URI): Promise<unknown | undefined>;
8683
+ }
8411
8684
  //#endregion
8412
8685
  //#region ../echo/dist/types/src/Ref.d.ts
8413
- type Unknown$1 = Ref<Unknown>;
8414
8686
  /**
8415
- * Extract reference target.
8687
+ * Instance type for a reference.
8688
+ *
8689
+ * Reference can point to any object or relation.
8690
+ * References are lazy loaded.
8691
+ *
8692
+ * `ref.dxn` is the DXN of the referenced object.
8693
+ *
8694
+ * @example
8695
+ * ```ts
8696
+ * const taskRef: Ref<Task> = Ref.make(task);
8697
+ *
8698
+ * await taskRef.load(); // Returns Promise<Task>
8699
+ * yield* Database.load(taskRef); // Effectful version.
8700
+ *
8701
+ * database.makeRef(dxn); // Create a ref from a DXN.
8702
+ * ```
8416
8703
  */
8417
- type Target$1<R$1 extends Unknown$1> = R$1 extends Ref<infer T> ? T : never;
8418
- //#endregion
8419
- //#region ../echo/dist/types/src/Relation.d.ts
8420
- declare const Source: unique symbol;
8421
- type Source = typeof Source;
8422
- declare const Target: unique symbol;
8423
- type Target = typeof Target;
8424
- //#endregion
8425
- //#region ../echo/dist/types/src/Type.d.ts
8704
+ type Ref$1<T$1> = Ref<T$1>;
8705
+ type Unknown$2 = Ref<Unknown$1>;
8426
8706
  /**
8427
- * Type that marks a schema as an ECHO schema.
8428
- * The value indicates the entity kind (Object or Relation).
8707
+ * Factory function to create a Ref schema for the given target schema.
8708
+ * Use this in schema definitions to declare reference fields.
8709
+ *
8710
+ * @example
8711
+ * ```ts
8712
+ * const Task = Schema.Struct({
8713
+ * assignee: Ref.Ref(Person), // Creates a Ref schema
8714
+ * }).pipe(Type.makeObject(DXN.make('com.example.type.task', '0.1.0')));
8715
+ * ```
8429
8716
  */
8430
- type EchoSchemaKind<K$1 extends EntityKind = EntityKind> = {
8431
- readonly [SchemaKindId]: K$1;
8717
+ declare const Ref$1: {
8718
+ <S$1 extends AnyObj | AnyRelation>(type: S$1): RefSchema<InstanceType$1<S$1> & Unknown$1>;
8719
+ <T$1 extends Type$1<any>>(type: T$1): RefSchema<InstanceType$1<T$1>>;
8720
+ <S$1 extends UnknownTypeSchema<any, any>>(schema: S$1): RefSchema<Schema.Type<S$1> & Unknown$1>;
8432
8721
  };
8433
8722
  /**
8434
- * JSON-encoded properties for objects.
8435
- */
8436
-
8437
- /**
8438
- * JSON-encoded properties for relations.
8439
- */
8440
- interface RelationJsonProps {
8441
- id: string;
8442
- [ATTR_RELATION_SOURCE]: string;
8443
- [ATTR_RELATION_TARGET]: string;
8444
- }
8445
- type RelationSchemaType = Schema<{
8446
- id: ObjectId;
8447
- } & Record<string, unknown>, {
8448
- id: string;
8449
- } & Record<string, unknown>> & EchoSchemaKind<EntityKind.Relation> & TypeMeta;
8450
- /**
8451
- * Runtime Effect schema for any ECHO relation.
8452
- * Use for validation, parsing, or as a reference target for collections.
8453
- * A relation has `id`, source, and target fields plus any additional properties.
8454
- *
8455
- * NOTE: `Schema.is(Type.Relation)` does STRUCTURAL validation only (checks for `id` field).
8456
- * Use `Relation.isRelation()` for proper ECHO instance type guards that check the KindId brand.
8723
+ * TypeScript type for a Ref schema.
8724
+ * This is the type of the SCHEMA itself, not the runtime ref instance.
8725
+ * For the instance type, use `Ref.Ref<T>` from the Ref module.
8457
8726
  *
8458
8727
  * @example
8459
8728
  * ```ts
8460
- * // Structural type guard (accepts any object with id field)
8461
- * if (Schema.is(Type.Relation)(unknownValue)) { ... }
8729
+ * // Schema type annotation (rarely needed, usually inferred):
8730
+ * const refSchema: Ref.RefSchema<typeof Task> = Ref.Ref(Task);
8462
8731
  *
8463
- * // ECHO instance type guard (checks KindId brand)
8464
- * if (Relation.isRelation(unknownValue)) { ... }
8732
+ * // Instance type annotation (use Ref.Ref instead):
8733
+ * const refInstance: Ref.Ref<Task> = Ref.make(task);
8465
8734
  * ```
8466
8735
  */
8467
- declare const Relation: RelationSchemaType;
8736
+ interface RefSchema<T$1 extends Unknown> extends RefSchema$1<T$1> {}
8468
8737
  /**
8469
- * TypeScript type for an ECHO relation schema.
8470
- * `T` is the instance type produced by the schema (excluding source/target).
8471
- * `Source` and `Target` are the endpoint types.
8472
- * `Fields` is the optional struct fields type for introspection.
8738
+ * Extract reference target.
8473
8739
  */
8474
- interface Relation<T$1 = any, Source$1 = any, Target$2 = any, Fields extends Struct.Fields = Struct.Fields> extends TypeMeta, EchoSchemaKind<EntityKind.Relation>, AnnotableClass<Relation<T$1, Source$1, Target$2, Fields>, OfKind<typeof Kind.Relation> & Relation.Endpoints<Source$1, Target$2> & T$1, Simplify<RelationJsonProps & ToMutable<T$1>>, never> {
8475
- /**
8476
- * The fields defined in the original struct schema.
8477
- * Allows accessing field definitions for introspection.
8478
- */
8479
- readonly fields: Fields;
8480
- }
8740
+ type Target$1<R$1 extends Unknown$2> = R$1 extends Ref<infer T> ? T : never;
8481
8741
  /**
8482
- * Structural base type for any ECHO relation schema.
8483
- * Accepts static schemas (created with Type.relation()).
8484
- * NOTE: Does not include the brand symbol to avoid TS4053 declaration portability issues.
8485
- * Use Type.isRelationSchema() for runtime type guards.
8742
+ * Reference resolver.
8486
8743
  */
8487
- type RelationSchemaBase = Schema.AnyNoContext & {
8488
- readonly typename: string;
8489
- readonly version: string;
8490
- };
8491
- declare namespace Relation {
8492
- /**
8493
- * Type that represents any ECHO relation schema.
8494
- * Accepts static schemas (Type.relation()).
8495
- */
8496
- type Any = RelationSchemaBase;
8497
- /**
8498
- * Get relation source type.
8499
- */
8500
- type Source<A$1> = A$1 extends Relation.Endpoints<infer S, infer _T> ? S : never;
8501
- /**
8502
- * Get relation target type.
8503
- */
8504
- type Target<A$1> = A$1 extends Relation.Endpoints<infer _S, infer T> ? T : never;
8505
- type Endpoints<Source$1, Target$2> = {
8506
- [Source]: Source$1;
8507
- [Target]: Target$2;
8508
- };
8509
- }
8744
+ type Resolver = RefResolver;
8510
8745
  //#endregion
8511
8746
  //#region ../echo/dist/types/src/Obj.d.ts
8512
8747
  /**
@@ -8516,7 +8751,7 @@ interface BaseObj extends AnyEntity, OfKind<typeof Kind.Object> {}
8516
8751
  /**
8517
8752
  * Object type with specific properties.
8518
8753
  */
8519
-
8754
+ type OfShape<Props$2> = BaseObj & Props$2;
8520
8755
  /**
8521
8756
  * Object with no known properties beyond id and kind.
8522
8757
  * Use this when the object's schema/properties are not known.
@@ -8525,37 +8760,47 @@ interface BaseObj extends AnyEntity, OfKind<typeof Kind.Object> {}
8525
8760
  * NOTE: This is a TypeScript type only, not a schema.
8526
8761
  * To validate that a value is an ECHO object, use `Schema.is(Type.Obj)`.
8527
8762
  */
8528
- interface Unknown extends BaseObj {}
8529
- //#endregion
8530
- //#region ../echo/dist/types/src/Entity.d.ts
8531
- declare const Kind: typeof EntityKind;
8532
- type Kind = EntityKind;
8763
+ interface Unknown$1 extends BaseObj {}
8533
8764
  /**
8534
- * Assigns a kind to an Object or Relation instance.
8535
- * NOTE: Needed to make `isRelation` and `isObject` checks work.
8765
+ * Runtime Effect schema for any ECHO object.
8766
+ * Use for validation, parsing, or as a reference target for collections.
8767
+ *
8768
+ * NOTE: `Schema.is(Type.Obj)` does STRUCTURAL validation only (checks for `id` field).
8769
+ * Use `Obj.isObject()` for proper ECHO instance type guards that check the KindId brand.
8770
+ *
8771
+ * @example
8772
+ * ```ts
8773
+ * // Structural type guard (accepts any object with id field)
8774
+ * if (Schema.is(Type.Obj)(unknownValue)) { ... }
8775
+ *
8776
+ * // ECHO instance type guard (checks KindId brand)
8777
+ * if (Obj.isObject(unknownValue)) { ... }
8778
+ *
8779
+ * // Reference to any object type
8780
+ * const Collection = Schema.Struct({
8781
+ * objects: Schema.Array(Ref.Ref(Obj.Unknown)),
8782
+ * }).pipe(Type.makeObject(DXN.make('com.example.type.collection', '0.1.0')));
8783
+ * ```
8536
8784
  */
8537
- interface OfKind<K$1 extends Kind> {
8538
- readonly [KindId]: K$1;
8539
- readonly id: ObjectId;
8540
- }
8785
+ declare const Unknown$1: UnknownTypeSchema<Unknown$1, typeof Kind.Object>;
8541
8786
  declare namespace Filter_d_exports {
8542
- 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 };
8787
+ export { Any$3 as Any, ChildOfOptions, Filter, KeyFilterOptions, Props$1 as Props, TextSearchOptions, Type$3 as Type, and, between, childOf, contains, created, eq, everything, foreignKeys, fromAst$1 as fromAst, gt, gte, id, in$ as in, is$1 as is, key$1 as key, lt, lte, neq, not, nothing, or, pretty$1 as pretty, props, tag, text, type$2 as type, typeURI, typename, updated };
8543
8788
  }
8544
8789
  interface Filter<T$1> {
8545
8790
  '~Filter': {
8546
- value: Contravariant<T$1>;
8791
+ value: Covariant<T$1>;
8547
8792
  };
8548
8793
  ast: Filter$1;
8549
8794
  }
8550
- type Props<T$1> = { [K in keyof T$1 & string]?: Filter<T$1[K]> | T$1[K] };
8795
+ type Props$1<T$1> = { [K in keyof T$1 & string]?: Filter<T$1[K]> | T$1[K] };
8551
8796
  type Any$3 = Filter<any>;
8552
- type Type$2<F extends Any$3> = F extends Filter<infer T> ? T : never;
8797
+ type Type$3<F extends Any$3> = F extends Filter<infer T> ? T : never;
8553
8798
  declare class FilterClass implements Any$3 {
8554
8799
  readonly ast: Filter$1;
8555
- private static variance;
8800
+ private static 'variance';
8556
8801
  constructor(ast: Filter$1);
8557
8802
  '~Filter': {
8558
- value: Contravariant<any>;
8803
+ value: Covariant<any>;
8559
8804
  };
8560
8805
  }
8561
8806
  declare const is$1: (value: unknown) => value is Any$3;
@@ -8572,24 +8817,56 @@ declare const nothing: () => FilterClass;
8572
8817
  declare const id: (...ids: ObjectId[]) => Any$3;
8573
8818
  /**
8574
8819
  * Filter by type.
8820
+ *
8821
+ * Accepts a `Type.Type` entity (the value produced by `Type.makeObject` /
8822
+ * `Type.makeRelation`), a `Schema.Union` of such entities (for filtering across a
8823
+ * union of ECHO types), or a non-qualified typename string.
8575
8824
  */
8576
- declare const type$2: <S$1 extends Schema.All>(schema: S$1 | string, props?: Props<Schema.Type<S$1>>) => Filter<Schema.Type<S$1>>;
8825
+ declare const type$2: {
8826
+ <T$1 extends AnyEntity$1>(type: T$1, props?: Props$1<InstanceType$1<T$1>>): Filter<InstanceType$1<T$1>>;
8827
+ <S$1 extends UnknownTypeSchema<any, any>>(schema: S$1, props?: Props$1<Schema.Type<S$1>>): Filter<Schema.Type<S$1>>;
8828
+ <S$1 extends Union<readonly Schema.AnyNoContext[]>>(union: S$1, props?: Props$1<Schema.Type<S$1>>): Filter<Schema.Type<S$1>>;
8829
+ (schema: string, props?: Props$1<unknown>): Filter<any>;
8830
+ (input: AnyEntity$1 | string, props?: Props$1<unknown>): Filter<unknown>;
8831
+ };
8577
8832
  /**
8578
8833
  * Filter by non-qualified typename.
8579
8834
  */
8580
- declare const typename$1: (typename: string) => Any$3;
8835
+ declare const typename: (typename: string) => Any$3;
8581
8836
  /**
8582
- * Filter by fully qualified type DXN.
8837
+ * Filter by fully qualified type URI — either a typename DXN (for static schemas) or
8838
+ * a schema-as-object EchoURI (for stored dynamic schemas). See `getSchemaURI`.
8583
8839
  */
8584
- declare const typeDXN: (dxn: DXN) => Any$3;
8840
+ declare const typeURI: (uri: URI) => Any$3;
8585
8841
  /**
8586
8842
  * Filter by tag.
8587
8843
  */
8588
8844
  declare const tag: (tag: string) => Any$3;
8845
+ /**
8846
+ * Options for {@link key} filter.
8847
+ */
8848
+ type KeyFilterOptions = {
8849
+ /**
8850
+ * Optional semver range expression (e.g. `^1.2.3`, `~2.0.0`, `>=1.0.0 <2.0.0`).
8851
+ * Matches the object's meta `version` field against the range.
8852
+ * If omitted, matches any version (including objects with no version).
8853
+ */
8854
+ version?: string;
8855
+ };
8856
+ /**
8857
+ * Filter by registry key stored in object meta.
8858
+ *
8859
+ * @example
8860
+ * ```ts
8861
+ * Filter.key('org.example.type.foo');
8862
+ * Filter.key('org.example.type.foo', { version: '^1.2.3' });
8863
+ * ```
8864
+ */
8865
+ declare const key$1: (key: string, options?: KeyFilterOptions) => Any$3;
8589
8866
  /**
8590
8867
  * Filter by properties.
8591
8868
  */
8592
- declare const props: <T$1>(props: Props<T$1>) => Filter<T$1>;
8869
+ declare const props: <T$1>(props: Props$1<T$1>) => Filter<T$1>;
8593
8870
  type TextSearchOptions = {
8594
8871
  type?: 'full-text' | 'vector';
8595
8872
  };
@@ -8600,7 +8877,7 @@ declare const text: (text: string, options?: TextSearchOptions) => Any$3;
8600
8877
  /**
8601
8878
  * Filter by foreign keys.
8602
8879
  */
8603
- declare const foreignKeys: <S$1 extends Schema.All>(schema: S$1 | string, keys: ForeignKey[]) => Filter<Schema.Type<S$1>>;
8880
+ declare const foreignKeys: <S$1 extends AnyEntity$1 | string>(schema: S$1, keys: ForeignKey[]) => Filter<S$1 extends AnyEntity$1 ? InstanceType$1<S$1> : unknown>;
8604
8881
  /**
8605
8882
  * Predicate for property to be equal to the provided value.
8606
8883
  */
@@ -8629,7 +8906,7 @@ declare const lte: <T$1>(value: T$1) => Filter<T$1 | undefined>;
8629
8906
  * Predicate for property to be in the provided array.
8630
8907
  * @param values - Values to check against.
8631
8908
  */
8632
- declare const in$: <T$1>(...values: T$1[]) => Filter<T$1 | undefined>;
8909
+ declare const in$: <T$1>(...values: T$1[]) => Filter<T$1>;
8633
8910
  /**
8634
8911
  * Predicate for an array property to contain the provided value.
8635
8912
  * @param value - Value to check against.
@@ -8640,133 +8917,542 @@ declare const contains: <T$1>(value: T$1) => Filter<readonly T$1[] | undefined>;
8640
8917
  * @param from - Start of the range (inclusive).
8641
8918
  * @param to - End of the range (exclusive).
8642
8919
  */
8643
- declare const between: <T$1>(from: T$1, to: T$1) => Filter<unknown>;
8920
+ declare const between: <T$1>(from: T$1, to: T$1) => Filter<T$1>;
8921
+ type TimeRange = {
8922
+ after?: Date | number;
8923
+ before?: Date | number;
8924
+ };
8925
+ /**
8926
+ * Filter objects by updatedAt timestamp.
8927
+ */
8928
+ declare const updated: (range: TimeRange) => Any$3;
8929
+ /**
8930
+ * Filter objects by createdAt timestamp.
8931
+ */
8932
+ declare const created: (range: TimeRange) => Any$3;
8933
+ type ChildOfOptions = {
8934
+ /** Whether to match transitively (grandchildren, etc.). Defaults to true. */
8935
+ transitive?: boolean;
8936
+ };
8937
+ /**
8938
+ * Filter objects that are children of the specified parent(s).
8939
+ * Accepts ECHO objects, Refs, or arrays of either.
8940
+ * Refs are resolved to DXNs without loading; objects use {@link Obj.getURI}.
8941
+ * With transitive=true (default), also matches grandchildren and beyond.
8942
+ */
8943
+ declare const childOf: (parents: Unknown$1 | Unknown$2 | readonly (Unknown$1 | Unknown$2)[], options?: ChildOfOptions) => Any$3;
8644
8944
  /**
8645
8945
  * Negate the filter.
8646
8946
  */
8647
- declare const not: <F extends Any$3>(filter: F) => Filter<Type$2<F>>;
8947
+ declare const not: <F extends Any$3>(filter: F) => Filter<Type$3<F>>;
8648
8948
  /**
8649
8949
  * Combine filters with a logical AND.
8650
8950
  */
8651
- declare const and: <Filters extends readonly Any$3[]>(...filters: Filters) => Filter<Type$2<Filters[number]>>;
8951
+ declare const and: <Filters extends readonly Any$3[]>(...filters: Filters) => Filter<Type$3<Filters[number]>>;
8652
8952
  /**
8653
8953
  * Combine filters with a logical OR.
8654
8954
  */
8655
- declare const or: <Filters extends readonly Any$3[]>(...filters: Filters) => Filter<Type$2<Filters[number]>>;
8656
- declare namespace Order_d_exports {
8657
- export { Any$2 as Any, Order, natural, property, rank };
8658
- }
8659
- interface Order<T$1> {
8660
- '~Order': {
8661
- value: T$1;
8662
- };
8663
- ast: Order$1;
8664
- }
8665
- type Any$2 = Order<any>;
8666
- declare const natural: Order<any>;
8667
- declare const property: <T$1>(property: keyof T$1 & string, direction: OrderDirection) => Order<T$1>;
8955
+ declare const or: <Filters extends readonly Any$3[]>(...filters: Filters) => Filter<Type$3<Filters[number]>>;
8668
8956
  /**
8669
- * Order by relevance rank (for FTS/vector search results).
8670
- * Higher rank = better match. Default direction is 'desc' (best matches first).
8957
+ * Returns a human-readable string representation of a Filter AST.
8671
8958
  */
8672
- declare const rank: <T$1>(direction?: OrderDirection) => Order<T$1>;
8673
- declare namespace Query_d_exports {
8674
- export { Any$1 as Any, Query, Type$1 as Type, all, fromAst, is, select, type$1 as type, without };
8675
- }
8959
+ declare const pretty$1: (filter: Any$3) => string;
8960
+ //#endregion
8961
+ //#region ../echo/dist/types/src/JsonSchema.d.ts
8676
8962
  /**
8677
- * All property paths inside T that are references.
8963
+ * Serializable JsonSchema type definition.
8678
8964
  */
8679
- type RefPropKey<T$1> = keyof T$1 & string;
8680
- interface Query<T$1> {
8681
- '~Query': {
8682
- value: T$1;
8683
- };
8684
- ast: Query$1;
8965
+ type JsonSchema = JsonSchemaType;
8966
+ declare const JsonSchema: Schema<JsonSchemaType>;
8967
+ //#endregion
8968
+ //#region ../../../common/async/dist/types/src/cleanup.d.ts
8969
+ type CleanupFn = () => void;
8970
+ //#endregion
8971
+ //#region ../echo/dist/types/src/QueryResult.d.ts
8972
+ /**
8973
+ * Individual query result entry.
8974
+ */
8975
+ type Entry$1<T$1> = {
8976
+ id: string;
8685
8977
  /**
8686
- * Filter the current selection based on a filter.
8687
- * @param filter - Filter to select the objects.
8688
- * @returns Query for the selected objects.
8978
+ * May not be present for remote results.
8689
8979
  */
8690
- select(filter: Filter<T$1>): Query<T$1>;
8691
- select(props: Props<T$1>): Query<T$1>;
8692
- /**
8693
- * Traverse an outgoing reference.
8980
+ result?: T$1;
8981
+ match?: {
8982
+ /**
8983
+ * Higher means better match.
8984
+ */
8985
+ rank: number;
8986
+ };
8987
+ /**
8988
+ * Query resolution metadata.
8989
+ */
8990
+ resolution?: {
8991
+ source: 'remote' | 'local' | 'index';
8992
+ /**
8993
+ * Query resolution time in milliseconds.
8994
+ */
8995
+ time: number;
8996
+ };
8997
+ };
8998
+ type RunOptions = {
8999
+ timeout?: number;
9000
+ };
9001
+ type SubscriptionOptions = {
9002
+ /**
9003
+ * Fire the callback immediately.
9004
+ */
9005
+ fire?: boolean;
9006
+ };
9007
+ interface QueryResult<T$1> {
9008
+ /**
9009
+ * Currently available results along with their match metadata.
9010
+ */
9011
+ readonly entries: Entry$1<T$1>[];
9012
+ /**
9013
+ * Currently available results.
9014
+ */
9015
+ readonly results: T$1[];
9016
+ /**
9017
+ * Returns all known results.
9018
+ */
9019
+ run(opts?: RunOptions): Promise<T$1[]>;
9020
+ /**
9021
+ * Returns all known results along with their match metadata.
9022
+ */
9023
+ runEntries(opts?: RunOptions): Promise<Entry$1<T$1>[]>;
9024
+ /**
9025
+ * Returns currently available results synchronously.
9026
+ */
9027
+ runSync(): T$1[];
9028
+ /**
9029
+ * Returns currently available results synchronously along with their match metadata.
9030
+ */
9031
+ runSyncEntries(): Entry$1<T$1>[];
9032
+ /**
9033
+ * Returns first result.
9034
+ */
9035
+ first(opts?: RunOptions): Promise<T$1>;
9036
+ /**
9037
+ * Returns first result if there is one.
9038
+ */
9039
+ firstOrUndefined(opts?: RunOptions): Promise<T$1 | undefined>;
9040
+ /**
9041
+ * Subscribes to changes in query results.
9042
+ */
9043
+ subscribe(callback?: (query: QueryResult<T$1>) => void, opts?: SubscriptionOptions): CleanupFn;
9044
+ }
9045
+ //#endregion
9046
+ //#region ../echo/dist/types/src/SchemaRegistry.d.ts
9047
+ type Query$1 = {
9048
+ /**
9049
+ * Filter by schema ID.
9050
+ * Schema id is a DXN with `echo` or `type` kind.
9051
+ */
9052
+ id?: string | string[];
9053
+ /**
9054
+ * Id of the backing ECHO object.
9055
+ */
9056
+ backingObjectId?: ObjectId | ObjectId[];
9057
+ /**
9058
+ * One or more typenames to filter by.
9059
+ */
9060
+ typename?: string | string[];
9061
+ /**
9062
+ * [Semver Range](https://docs.npmjs.com/cli/v6/using-npm/semver#ranges) for the schema version.
9063
+ */
9064
+ version?: string;
9065
+ /**
9066
+ * Where to look for the schema.
9067
+ *
9068
+ * Database schema are stored in the database of the current space.
9069
+ * Runtime schema are registered in the runtime.
9070
+ *
9071
+ * @default ['database']
9072
+ */
9073
+ location?: ('database' | 'runtime')[];
9074
+ /**
9075
+ * Include system schemas.
9076
+ * @default false
9077
+ *
9078
+ * The system schema include but are not limited to:
9079
+ * - org.dxos.type.schema
9080
+ */
9081
+ includeSystem?: boolean;
9082
+ };
9083
+ /**
9084
+ * Input for schema registration.
9085
+ * The typename, version and schema mutability metadata is read from the schema annotations.
9086
+ *
9087
+ * Accepts:
9088
+ * - Branded ECHO schemas created with Type.Obj() or Type.Relation()
9089
+ * - JSON schema with typename and version
9090
+ */
9091
+ type RegisterSchemaInput = AnyEntity$1 | {
9092
+ typename: string;
9093
+ version: string;
9094
+ jsonSchema: JsonSchema;
9095
+ /**
9096
+ * Display name of the schema.
9097
+ */
9098
+ name?: string;
9099
+ };
9100
+ interface SchemaRegistry {
9101
+ /**
9102
+ * Checks if the provided schema is registered.
9103
+ */
9104
+ hasSchema(schema: AnyEntity$1): boolean;
9105
+ /**
9106
+ * Registers the provided schema(s).
9107
+ *
9108
+ * @returns The persisted type entities. The entity kind of each input is
9109
+ * preserved (an object schema comes back as `Type.AnyObj`), so the result can
9110
+ * be chained into `Obj.make` / `Relation.make` without casts. Each stored
9111
+ * schema is also a `Type.Type` record, so its `Ref` targets a
9112
+ * `Ref(Type.Type)` field.
9113
+ *
9114
+ * The behavior of this method depends on the state of the database.
9115
+ * The general principle is that the schema will be upserted into the space.
9116
+ * If an equivalent schema with the same name and version already exists, the method does nothing.
9117
+ * If a different schema with the same name and version exists, the method throws an error.
9118
+ * If no schema with the same name and version exists, a new schema will be inserted based on semantic versioning rules.
9119
+ */
9120
+ register<T$1 extends AnyEntity$1>(input: T$1[]): Promise<T$1[]>;
9121
+ register(input: RegisterSchemaInput[]): Promise<Type$1[]>;
9122
+ query<Q extends NoExcessProperties<Query$1, Q>>(query?: Q & Query$1): QueryResult<Type$1>;
9123
+ }
9124
+ //#endregion
9125
+ //#region ../echo/dist/types/src/Hypergraph.d.ts
9126
+ /**
9127
+ * Resolution context.
9128
+ * Affects how non-absolute DXNs are resolved.
9129
+ */
9130
+ interface RefResolutionContext {
9131
+ /**
9132
+ * Space that the resolution is happening from.
9133
+ */
9134
+ space?: SpaceId;
9135
+ /**
9136
+ * Feed that the resolution is happening from.
9137
+ * This feed will be searched first, and then the space it belongs to.
9138
+ */
9139
+ feed?: URI;
9140
+ }
9141
+ interface RefResolverOptions {
9142
+ /**
9143
+ * Resolution context.
9144
+ * Affects how non-absolute DXNs are resolved.
9145
+ */
9146
+ context?: RefResolutionContext;
9147
+ /**
9148
+ * Middleware to change the resolved object before returning it.
9149
+ * @deprecated On track to be removed.
9150
+ */
9151
+ middleware?: (obj: AnyProperties) => AnyProperties;
9152
+ }
9153
+ /**
9154
+ * Manages cross-space database interactions.
9155
+ */
9156
+ interface Hypergraph extends Queryable {
9157
+ get schemaRegistry(): SchemaRegistry;
9158
+ /**
9159
+ * Query objects.
9160
+ */
9161
+ query: QueryFn;
9162
+ /**
9163
+ * Creates a reference to an existing object in the database.
9164
+ *
9165
+ * NOTE: The reference may be dangling if the object is not present in the database.
9166
+ * NOTE: Difference from `Ref.fromURI`
9167
+ * `Ref.fromURI(dxn)` returns an unhydrated reference. The `.load` and `.target` APIs will not work.
9168
+ * `db.makeRef(dxn)` is preferable in cases with access to the database.
9169
+ */
9170
+ makeRef<T$1 extends Unknown = Unknown>(uri: URI): Ref$1<T$1>;
9171
+ /**
9172
+ * @param hostDb Host database for reference resolution.
9173
+ * @param middleware Called with the loaded object. The caller may change the object.
9174
+ * @returns Result of `onLoad`.
9175
+ */
9176
+ createRefResolver(options: RefResolverOptions): Resolver;
9177
+ /**
9178
+ * Get a database by space ID.
9179
+ * @returns The database for the given space ID, or undefined if not found.
9180
+ */
9181
+ getDatabase(spaceId: SpaceId): Database | undefined;
9182
+ }
9183
+ //#endregion
9184
+ //#region ../echo/dist/types/src/Collection.d.ts
9185
+ /**
9186
+ * A an ordered set of objects.
9187
+ */
9188
+ declare const Collection: Obj$1<{
9189
+ readonly name?: string | undefined;
9190
+ readonly objects: readonly Ref<Unknown$1>[];
9191
+ }, Struct.Fields>;
9192
+ type Collection = InstanceType$1<typeof Collection>;
9193
+ //#endregion
9194
+ //#region ../echo/dist/types/src/Feed.d.ts
9195
+ /**
9196
+ * Runtime schema for a Feed object.
9197
+ *
9198
+ * @example
9199
+ * ```ts
9200
+ * const feed = Obj.make(Feed.Feed, { name: 'notifications', kind: 'org.dxos.plugin.notifications.v1' });
9201
+ * ```
9202
+ */
9203
+ declare const Feed: Obj$1<{
9204
+ readonly name?: string | undefined;
9205
+ readonly kind?: string | undefined;
9206
+ readonly namespace?: "data" | "trace" | undefined;
9207
+ }, Struct.Fields>;
9208
+ /**
9209
+ * TypeScript instance type for a Feed object.
9210
+ */
9211
+ type Feed = InstanceType$1<typeof Feed>;
9212
+ //#endregion
9213
+ //#region ../echo/dist/types/src/View.d.ts
9214
+ /**
9215
+ * Views are generated or user-defined projections of a schema's properties.
9216
+ * They are used to configure the visual representation of the data.
9217
+ */
9218
+ declare const ViewSchema: Obj$1<{
9219
+ readonly query: {
9220
+ readonly raw?: string | undefined;
9221
+ readonly ast: QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause;
9222
+ };
9223
+ readonly projection: {
9224
+ readonly schema?: JsonSchemaType | undefined;
9225
+ readonly fields: readonly {
9226
+ readonly id: string;
9227
+ readonly path: JsonPath;
9228
+ readonly visible?: boolean | undefined;
9229
+ readonly referencePath?: JsonPath | undefined;
9230
+ }[];
9231
+ readonly pivotFieldId?: string | undefined;
9232
+ };
9233
+ }, Struct.Fields>;
9234
+ interface View extends InstanceType$1<typeof ViewSchema> {}
9235
+ declare const View: Obj$1<View>;
9236
+ //#endregion
9237
+ //#region ../echo/dist/types/src/Dataset.d.ts
9238
+ /**
9239
+ * Abstract set of objects, represented by a view, feed, or collection.
9240
+ * Schema-level union of the underlying type entities (rebuilt via
9241
+ * `Type.getSchema`) so this can still be consumed by Schema-side APIs such
9242
+ * as `Filter.type(...)` on a union.
9243
+ */
9244
+ type Dataset = Feed | Collection | View;
9245
+ declare const Dataset: Union<[Schema<{
9246
+ readonly name?: string | undefined;
9247
+ readonly kind?: string | undefined;
9248
+ readonly namespace?: "data" | "trace" | undefined;
9249
+ } & OfKind<EntityKind.Object>, {
9250
+ readonly name?: string | undefined;
9251
+ readonly kind?: string | undefined;
9252
+ readonly namespace?: "data" | "trace" | undefined;
9253
+ } & OfKind<EntityKind.Object>, never>, Schema<{
9254
+ readonly name?: string | undefined;
9255
+ readonly objects: readonly Ref<Unknown$1>[];
9256
+ } & OfKind<EntityKind.Object>, {
9257
+ readonly name?: string | undefined;
9258
+ readonly objects: readonly Ref<Unknown$1>[];
9259
+ } & OfKind<EntityKind.Object>, never>, Schema<View & OfKind<EntityKind.Object>, View & OfKind<EntityKind.Object>, never>]>;
9260
+ declare namespace Order_d_exports {
9261
+ export { Any$2 as Any, Order, natural, property, rank };
9262
+ }
9263
+ interface Order<T$1> {
9264
+ '~Order': {
9265
+ value: T$1;
9266
+ };
9267
+ ast: Order$1;
9268
+ }
9269
+ type Any$2 = Order<any>;
9270
+ declare const natural: Order<any>;
9271
+ declare const property: <T$1>(property: keyof T$1 & string, direction: OrderDirection) => Order<T$1>;
9272
+ /**
9273
+ * Order by relevance rank (for FTS/vector search results).
9274
+ * Higher rank = better match. Default direction is 'desc' (best matches first).
9275
+ */
9276
+ declare const rank: <T$1>(direction?: OrderDirection) => Order<T$1>;
9277
+ //#endregion
9278
+ //#region ../echo/dist/types/src/Relation.d.ts
9279
+ type Endpoints$1<Source$1, Target$2> = {
9280
+ [Source$1]: Source$1;
9281
+ [Target$2]: Target$2;
9282
+ };
9283
+ /**
9284
+ * Get relation source type.
9285
+ */
9286
+ type SourceOf<A$1> = A$1 extends Endpoints$1<infer S, infer _T> ? S : never;
9287
+ /**
9288
+ * Get relation target type.
9289
+ */
9290
+ type TargetOf<A$1> = A$1 extends Endpoints$1<infer _S, infer T> ? T : never;
9291
+ declare namespace Query_d_exports {
9292
+ export { Any$1 as Any, Query, Type$2 as Type, all, from, fromAst, is, pretty, select, type$1 as type, without };
9293
+ }
9294
+ /**
9295
+ * All property paths inside T that are references.
9296
+ */
9297
+ type RefPropKey<T$1> = keyof T$1 & string;
9298
+ interface Query<T$1> {
9299
+ '~Query': {
9300
+ value: T$1;
9301
+ };
9302
+ ast: Query$2;
9303
+ /**
9304
+ * Filter the current selection based on a filter.
9305
+ * @param filter - Filter to select the objects.
9306
+ * @returns Query for the selected objects.
9307
+ */
9308
+ 'select'(filter: Filter<T$1>): Query<T$1>;
9309
+ 'select'(props: Props$1<T$1>): Query<T$1>;
9310
+ /**
9311
+ * Traverse an outgoing reference.
8694
9312
  * @param key - Property path inside T that is a reference or optional reference.
8695
9313
  * @returns Query for the target of the reference.
8696
9314
  */
8697
- reference<K$1 extends RefPropKey<T$1>>(key: K$1): Query<T$1[K$1] extends Unknown$1 ? Target$1<T$1[K$1]> : T$1[K$1] extends Unknown$1 | undefined ? Target$1<Exclude<T$1[K$1], undefined>> : never>;
9315
+ 'reference'<K$1 extends RefPropKey<T$1>>(key: K$1): Query<T$1[K$1] extends Unknown$2 ? Target$1<T$1[K$1]> : T$1[K$1] extends Unknown$2 | undefined ? Target$1<Exclude<T$1[K$1], undefined>> : never>;
8698
9316
  /**
8699
9317
  * Find objects referencing this object.
8700
9318
  * @param target - Schema of the referencing object. If not provided, matches any type.
8701
9319
  * @param key - Property path inside the referencing object that is a reference. If not provided, matches any property.
8702
9320
  * @returns Query for the referencing objects.
8703
9321
  */
8704
- referencedBy<S$1 extends Schema.All>(target: S$1 | string, key: RefPropKey<Schema.Type<S$1>>): Query<Schema.Type<S$1>>;
8705
- referencedBy<S$1 extends Schema.All>(target: S$1 | string): Query<Schema.Type<S$1>>;
8706
- referencedBy(): Query<any>;
9322
+ 'referencedBy'<S$1 extends AnyEntity$1>(target: S$1 | string, key: RefPropKey<InstanceType$1<S$1>>): Query<InstanceType$1<S$1>>;
9323
+ 'referencedBy'<S$1 extends AnyEntity$1>(target: S$1 | string): Query<InstanceType$1<S$1>>;
9324
+ 'referencedBy'(): Query<any>;
8707
9325
  /**
8708
9326
  * Find relations where this object is the source.
8709
9327
  * @returns Query for the relation objects.
8710
9328
  * @param relation - Schema of the relation.
8711
9329
  * @param predicates - Predicates to filter the relation objects.
8712
9330
  */
8713
- sourceOf<S$1 extends Schema.All>(relation: S$1 | string, predicates?: Props<Schema.Type<S$1>>): Query<Schema.Type<S$1>>;
9331
+ 'sourceOf'<R$1 extends AnyRelation>(relation?: R$1 | string, predicates?: Props$1<InstanceType$1<R$1>>): Query<InstanceType$1<R$1>>;
8714
9332
  /**
8715
9333
  * Find relations where this object is the target.
8716
9334
  * @returns Query for the relation objects.
8717
- * @param relation - Schema of the relation.
9335
+ * @param relation - Type entity of the relation.
8718
9336
  * @param predicates - Predicates to filter the relation objects.
8719
9337
  */
8720
- targetOf<S$1 extends Schema.All>(relation: S$1 | string, predicates?: Props<Schema.Type<S$1>>): Query<Schema.Type<S$1>>;
9338
+ 'targetOf'<R$1 extends AnyRelation>(relation?: R$1 | string, predicates?: Props$1<InstanceType$1<R$1>>): Query<InstanceType$1<R$1>>;
8721
9339
  /**
8722
9340
  * For a query for relations, get the source objects.
8723
9341
  * @returns Query for the source objects.
8724
9342
  */
8725
- source(): Query<Relation.Source<T$1>>;
9343
+ 'source'(): Query<SourceOf<T$1>>;
8726
9344
  /**
8727
9345
  * For a query for relations, get the target objects.
8728
9346
  * @returns Query for the target objects.
8729
9347
  */
8730
- target(): Query<Relation.Target<T$1>>;
9348
+ 'target'(): Query<TargetOf<T$1>>;
8731
9349
  /**
8732
9350
  * Get the parent object of the current selection.
8733
9351
  * @returns Query for the parent objects.
8734
9352
  */
8735
- parent(): Query<any>;
9353
+ 'parent'(): Query<any>;
8736
9354
  /**
8737
9355
  * Get all child objects of the current selection.
8738
9356
  * @returns Query for the child objects.
8739
9357
  */
8740
- children(): Query<any>;
9358
+ 'children'(): Query<any>;
8741
9359
  /**
8742
9360
  * Order the query results.
8743
9361
  * Orders are specified in priority order. The first order will be applied first, etc.
8744
9362
  * @param order - Order to sort the results.
8745
9363
  * @returns Query for the ordered results.
8746
9364
  */
8747
- orderBy(...order: NonEmptyArray<Order<T$1>>): Query<T$1>;
9365
+ 'orderBy'(...order: NonEmptyArray<Order<T$1>>): Query<T$1>;
8748
9366
  /**
8749
9367
  * Limit the number of results.
8750
9368
  * @param limit - Maximum number of results to return.
8751
9369
  * @returns Query for the limited results.
8752
9370
  */
8753
- limit(limit: number): Query<T$1>;
9371
+ 'limit'(limit: number): Query<T$1>;
9372
+ /**
9373
+ * Query from selected databases only.
9374
+ *
9375
+ * Example:
9376
+ *
9377
+ * ```ts
9378
+ * Query.select(Filter.type(Person)).from(db);
9379
+ * ```
9380
+ *
9381
+ * @param options.includeFeeds [false] - Whether to include feeds in the query. Default is to query from automerge documents only.
9382
+ */
9383
+ 'from'(database: Database | Database[], options?: {
9384
+ includeFeeds?: boolean;
9385
+ }): Query<T$1>;
9386
+ /**
9387
+ * Query from selected feeds only.
9388
+ *
9389
+ * Example:
9390
+ *
9391
+ * ```ts
9392
+ * Query.select(Filter.type(Person)).from(feed);
9393
+ * ```
9394
+ *
9395
+ */
9396
+ 'from'(feeds: Feed | Feed[]): Query<T$1>;
9397
+ /**
9398
+ * Query from all accessible spaces.
9399
+ *
9400
+ * Example:
9401
+ *
9402
+ * ```ts
9403
+ * Query.select(Filter.type(Person)).from('all-accessible-spaces');
9404
+ * ```
9405
+ *
9406
+ * @param options.includeFeeds [false] - Whether to include feeds in the query. Default is to query from automerge documents only.
9407
+ */
9408
+ 'from'(allSpaces: 'all-accessible-spaces', options?: {
9409
+ includeFeeds?: boolean;
9410
+ }): Query<T$1>;
9411
+ /**
9412
+ * Query from a dataset.
9413
+ * Currently only feeds are supported.
9414
+ *
9415
+ * Example:
9416
+ *
9417
+ * ```ts
9418
+ * Query.type(Person).from(feed);
9419
+ * ```
9420
+ */
9421
+ 'from'(dataset: Dataset): Query<T$1>;
9422
+ /**
9423
+ * Query from the results of another query.
9424
+ *
9425
+ * Example:
9426
+ *
9427
+ * ```ts
9428
+ * Query.select(Filter.props({ foo: 'foo' })).from(Query.select(Filter.type(Contact)).reference('org'));
9429
+ * ```
9430
+ */
9431
+ 'from'(query: Any$1): Query<T$1>;
9432
+ /**
9433
+ * Query from a raw scope specification.
9434
+ */
9435
+ 'from'(scope: Scope): Query<T$1>;
8754
9436
  /**
8755
9437
  * Add options to a query.
8756
9438
  */
8757
- options(options: QueryOptions): Query<T$1>;
9439
+ 'options'(options: QueryOptions): Query<T$1>;
9440
+ /**
9441
+ * Attach a diagnostic label for logs and tooling (execution semantics unchanged).
9442
+ */
9443
+ 'debugLabel'(label: string): Query<T$1>;
8758
9444
  }
8759
9445
  type Any$1 = Query<any>;
8760
- type Type$1<Q extends Any$1> = Q extends Query<infer T> ? T : never;
9446
+ type Type$2<Q extends Any$1> = Q extends Query<infer T> ? T : never;
8761
9447
  declare const is: (value: unknown) => value is Any$1;
8762
9448
  /** Construct a query from an ast. */
8763
- declare const fromAst: (ast: Query$1) => Any$1;
9449
+ declare const fromAst: (ast: Query$2) => Any$1;
8764
9450
  /**
8765
9451
  * Select objects based on a filter.
8766
9452
  * @param filter - Filter to select the objects.
8767
9453
  * @returns Query for the selected objects.
8768
9454
  */
8769
- declare const select: <F extends Any$3>(filter: F) => Query<Type$2<F>>;
9455
+ declare const select: <F extends Any$3>(filter: F) => Query<Type$3<F>>;
8770
9456
  /**
8771
9457
  * Query for objects of a given schema.
8772
9458
  * @param schema - Schema of the objects.
@@ -8775,7 +9461,19 @@ declare const select: <F extends Any$3>(filter: F) => Query<Type$2<F>>;
8775
9461
  *
8776
9462
  * Shorthand for: `Query.select(Filter.type(schema, predicates))`.
8777
9463
  */
8778
- declare const type$1: (schema: Schema.All | string, predicates?: Props<unknown>) => Any$1;
9464
+ /**
9465
+ * Instance type for a query over `type`. Falls back to `Entity.Unknown` when the
9466
+ * type can't be narrowed — e.g. the caller passes the wide `Type.AnyEntity` — so
9467
+ * results aren't typed as the useless bare `OfKind<...>` union that
9468
+ * `Type.InstanceType<Type.AnyEntity>` produces.
9469
+ */
9470
+ type QueryInstance<T$1 extends AnyEntity$1> = AnyEntity$1 extends T$1 ? Unknown : InstanceType$1<T$1>;
9471
+ declare const type$1: {
9472
+ <T$1 extends AnyEntity$1>(type: T$1, predicates?: Props$1<QueryInstance<T$1>>): Query<QueryInstance<T$1>>;
9473
+ <S$1 extends UnknownTypeSchema<any, any>>(schema: S$1, predicates?: Props$1<Schema.Type<S$1>>): Query<Schema.Type<S$1>>;
9474
+ <S$1 extends Union<readonly Schema.AnyNoContext[]>>(union: S$1, predicates?: Props$1<Schema.Type<S$1>>): Query<Schema.Type<S$1>>;
9475
+ (schema: string, predicates?: Props$1<unknown>): Query<any>;
9476
+ };
8779
9477
  /**
8780
9478
  * Combine results of multiple queries.
8781
9479
  * @param queries - Queries to combine.
@@ -8789,6 +9487,495 @@ declare const all: (...queries: Any$1[]) => Any$1;
8789
9487
  * @returns Query for the results of the source query minus the results of the exclude query.
8790
9488
  */
8791
9489
  declare const without: <T$1>(source: Query<T$1>, exclude: Query<T$1>) => Query<T$1>;
9490
+ /**
9491
+ * Create a query scoped to a data source.
9492
+ * The returned query selects everything from the source; chain `.select()` to narrow results.
9493
+ *
9494
+ * @param source - Data source: database, feed, 'all-accessible-spaces', or another query.
9495
+ * @returns Query scoped to the given source.
9496
+ */
9497
+ declare const from: (source: Database | Database[] | Feed | Feed[] | Any$1 | Scope | 'all-accessible-spaces', options?: {
9498
+ includeFeeds?: boolean;
9499
+ }) => Any$1;
9500
+ /**
9501
+ * Returns a human-readable string representation of a Query AST.
9502
+ */
9503
+ declare const pretty: (query: Any$1) => string;
9504
+ //#endregion
9505
+ //#region ../echo/dist/types/src/Database.d.ts
9506
+ /**
9507
+ * `query` API function declaration.
9508
+ */
9509
+ interface QueryFn {
9510
+ <Q extends Any$1>(query: Q): QueryResult<Type$2<Q>>;
9511
+ <F extends Any$3>(filter: F): QueryResult<Type$3<F>>;
9512
+ }
9513
+ /**
9514
+ * Common interface for Database, Feed, and Hypergraph.
9515
+ */
9516
+ interface Queryable {
9517
+ query: QueryFn;
9518
+ }
9519
+ type GetObjectByIdOptions = {
9520
+ deleted?: boolean;
9521
+ };
9522
+ type ObjectPlacement = 'root-doc' | 'linked-doc';
9523
+ type AddOptions = {
9524
+ /**
9525
+ * Where to place the object in the Automerge document tree.
9526
+ * Root document is always loaded with the space.
9527
+ * Linked documents are loaded lazily.
9528
+ * Placing large number of objects in the root document may slow down the initial load.
9529
+ *
9530
+ * @default 'linked-doc'
9531
+ */
9532
+ placeIn?: ObjectPlacement;
9533
+ };
9534
+ type FlushOptions = {
9535
+ /**
9536
+ * Write any pending changes to disk.
9537
+ * @default true
9538
+ */
9539
+ disk?: boolean;
9540
+ /**
9541
+ * Wait for pending index updates.
9542
+ * @default true
9543
+ */
9544
+ indexes?: boolean;
9545
+ /**
9546
+ * Flush pending updates to objects and queries.
9547
+ * @default false
9548
+ */
9549
+ updates?: boolean;
9550
+ };
9551
+ /**
9552
+ * Identifier denoting an ECHO Database.
9553
+ */
9554
+ declare const TypeId: unique symbol;
9555
+ type TypeId = typeof TypeId;
9556
+ /**
9557
+ * ECHO Database interface.
9558
+ */
9559
+ interface Database extends Queryable {
9560
+ readonly [TypeId]: TypeId;
9561
+ get spaceId(): SpaceId;
9562
+ get schemaRegistry(): SchemaRegistry;
9563
+ get graph(): Hypergraph;
9564
+ toJSON(): object;
9565
+ /**
9566
+ * Return object by local ID.
9567
+ */
9568
+ getObjectById<T$1 extends Unknown$1 = OfShape<AnyProperties>>(id: string, opts?: GetObjectByIdOptions): T$1 | undefined;
9569
+ /**
9570
+ * Query objects.
9571
+ */
9572
+ query: QueryFn;
9573
+ /**
9574
+ * Creates a reference to an existing object in the database.
9575
+ *
9576
+ * NOTE: The reference may be dangling if the object is not present in the database.
9577
+ * NOTE: Difference from `Ref.fromURI`
9578
+ * `Ref.fromURI(dxn)` returns an unhydrated reference. The `.load` and `.target` APIs will not work.
9579
+ * `db.makeRef(dxn)` is preferable in cases with access to the database.
9580
+ */
9581
+ makeRef<T$1 extends Unknown = Unknown>(uri: URI): Ref<T$1>;
9582
+ /**
9583
+ * Adds object to the database.
9584
+ */
9585
+ add<T$1 extends Unknown = Unknown>(obj: T$1, opts?: AddOptions): T$1;
9586
+ /**
9587
+ * Removes object from the database.
9588
+ */
9589
+ remove(obj: Unknown): void;
9590
+ /**
9591
+ * Wait for all pending changes to be saved to disk.
9592
+ * Optionaly waits for changes to be propagated to indexes and event handlers.
9593
+ */
9594
+ flush(opts?: FlushOptions): Promise<void>;
9595
+ }
9596
+ declare const Database: Schema<Database>;
9597
+ //#endregion
9598
+ //#region ../echo/dist/types/src/internal/Type/type-schema.d.ts
9599
+ /**
9600
+ * Raw struct backing {@link TypeSchema}. Exposed only so `TypeSchema`
9601
+ * (the TS type) can derive its data fields via `Schema.Schema.Type<typeof ...>`;
9602
+ * runtime callers should use {@link TypeSchema} (the piped, branded entity).
9603
+ *
9604
+ * `typename` and `version` are NOT data fields — they live in `ObjectMeta.key` /
9605
+ * `ObjectMeta.version` (the canonical registry-provenance pair, queryable via
9606
+ * `Filter.key(...)`). The same `jsonSchema` payload also embeds them so a
9607
+ * standalone JSON-Schema export remains self-describing, but the schema-registry
9608
+ * reads/writes them through meta.
9609
+ */
9610
+ declare const TypeSchemaStruct: Struct<{
9611
+ name: optional<typeof String$>;
9612
+ jsonSchema: Schema<JsonSchemaType, JsonSchemaType, never>;
9613
+ }>;
9614
+ /**
9615
+ * Persistent representation of a schema.
9616
+ */
9617
+ declare const TypeSchema: EchoTypeKindSchema<Struct<{
9618
+ name: optional<typeof String$>;
9619
+ jsonSchema: Schema<JsonSchemaType, JsonSchemaType, never>;
9620
+ }>, Readonly<{
9621
+ name: optional<typeof String$>;
9622
+ jsonSchema: Schema<JsonSchemaType, JsonSchemaType, never>;
9623
+ }>>;
9624
+ /**
9625
+ * Persistent representation of a schema — the runtime shape that
9626
+ * `db.add(Type.makeObjectFromJsonSchema(...))` / `db.schemaRegistry.register([...])` produces
9627
+ * and `Filter.type(Type.Type).run()` returns.
9628
+ *
9629
+ * Structurally identical to a static `Type.Type` entity: the entity-handler's
9630
+ * `get` trap exposes `[SchemaKindId]` (derived from `system.kind` and
9631
+ * `data.jsonSchema.entityKind`) and rebuilds `[StaticTypeSchemaSlot]` lazily
9632
+ * from `jsonSchema`, so a persisted instance satisfies the public `Type<A>`
9633
+ * interface without casting.
9634
+ */
9635
+ type TypeSchema = Schema.Type<typeof TypeSchemaStruct> & {
9636
+ /** Object identifier — injected by `EchoTypeKindSchema` and stamped at construction. */
9637
+ readonly id: string;
9638
+ /** Entity-kind discriminator (object/relation/type) carried on every entity instance. */
9639
+ readonly [KindId]: EntityKind.Type;
9640
+ /** Kind of schema described by this meta-instance — always `EntityKind.Type` for `Type.Type` itself. */
9641
+ readonly [SchemaKindId]: EntityKind.Type;
9642
+ /** Effect Schema rebuilt lazily from `jsonSchema`; satisfies `Type.getSchema(...)` without an extra cast. */
9643
+ readonly [StaticTypeSchemaSlot]: Schema.AnyNoContext;
9644
+ };
9645
+ //#endregion
9646
+ //#region ../echo/dist/types/src/Type.d.ts
9647
+ /**
9648
+ * Structural base shared by the three sibling type-entity interfaces
9649
+ * ({@link Obj}, {@link Relation}, {@link Type}). NOT exported — callers
9650
+ * should constrain on {@link AnyEntity} when they want "any of the three"
9651
+ * and on the specific kind interface otherwise.
9652
+ */
9653
+ interface BaseTypeEntity<A$1> {
9654
+ /**
9655
+ * Entity-kind brand of the type-entity value itself — always `EntityKind.Type`.
9656
+ * The kind of instance the type *describes* lives on `[SchemaKindId]`
9657
+ * (Object / Relation / Type). Lets `Obj.isObject` / `Relation.isRelation`
9658
+ * reject type entities by a single `[KindId]` check.
9659
+ */
9660
+ readonly [KindId]: EntityKind.Type;
9661
+ /**
9662
+ * Object id. Like all ECHO entities, type entities always carry an id —
9663
+ * stamped at construction for in-memory (static) declarations and assigned by
9664
+ * the database once persisted. The id does NOT determine the entity's URI:
9665
+ * static types resolve to their typename DXN, persisted types to `echo:/<id>`
9666
+ * (see `getTypeURIFromSpecifier`).
9667
+ */
9668
+ readonly id: ObjectId;
9669
+ readonly name?: string;
9670
+ readonly jsonSchema: JsonSchemaType;
9671
+ readonly [InstancePhantomId$1]?: A$1;
9672
+ }
9673
+ /**
9674
+ * TypeScript type for an ECHO object type — a `Type.Type<A>` entity.
9675
+ *
9676
+ * `T` is the instance type produced by `Obj.make(Foo, props)`. `Fields` is
9677
+ * retained as a structural hint (the runtime value still carries `.fields`),
9678
+ * but consumers should derive instance/encoded types via `Type.InstanceType`.
9679
+ *
9680
+ * **Not a `Schema.Schema`.** `Foo.ast` / `Schema.Schema.Type<typeof Foo>` /
9681
+ * `Schema.extend(Foo)` no longer typecheck — extract the Effect Schema via
9682
+ * `Type.getSchema(Foo)` first, or derive instance types via
9683
+ * `Type.InstanceType<typeof Foo>`.
9684
+ *
9685
+ * @example
9686
+ * ```ts
9687
+ * const Person = Schema.Struct({
9688
+ * name: Schema.String,
9689
+ * }).pipe(Type.makeObject(DXN.make('com.example.type.person', '0.1.0')));
9690
+ *
9691
+ * type Person = Type.InstanceType<typeof Person>;
9692
+ * ```
9693
+ */
9694
+ interface Obj$1<T$1, Fields extends Struct.Fields = Struct.Fields> extends BaseTypeEntity<T$1 & OfKind<typeof Kind.Object>> {
9695
+ /** Schema-kind brand (object). */
9696
+ readonly [SchemaKindId]: EntityKind.Object;
9697
+ /** Source Effect Schema — used internally by `Type.getSchema(self)`. */
9698
+ readonly [StaticTypeSchemaSlot]: Schema.AnyNoContext;
9699
+ /**
9700
+ * The fields defined in the original struct schema.
9701
+ * Allows accessing field definitions for introspection.
9702
+ */
9703
+ readonly fields: Fields;
9704
+ }
9705
+ /**
9706
+ * Type that represents any ECHO object type — a `Type.Type` entity branded
9707
+ * with the object entity kind, i.e. what `Type.makeObject(dxn)` produces.
9708
+ */
9709
+ type AnyObj = Obj$1<unknown>;
9710
+ /**
9711
+ * ECHO meta-schema entity — stores `{ name?, typename, version, jsonSchema }`.
9712
+ * Type-kind sibling of `Type.makeObject(...)` / `Type.makeRelation(...)` outputs.
9713
+ * Stored types live under this entity; filter via `Filter.type(Type.Type)`.
9714
+ */
9715
+ declare const Type$1: Type$1<TypeSchema>;
9716
+ /**
9717
+ * TypeScript type for an ECHO relation type — a `Type.Type<A>` entity.
9718
+ *
9719
+ * `T` is the instance-property type produced by `Relation.make(...)` (excluding
9720
+ * source/target endpoints). `Source` and `Target` are the endpoint types.
9721
+ *
9722
+ * **Not a `Schema.Schema`.** See {@link Obj}'s note.
9723
+ */
9724
+ interface Relation<T$1, Source$1, Target$2, Fields extends Struct.Fields = Struct.Fields> extends BaseTypeEntity<Endpoints$1<Source$1, Target$2> & T$1 & OfKind<typeof Kind.Relation>> {
9725
+ /** Schema-kind brand (relation). */
9726
+ readonly [SchemaKindId]: EntityKind.Relation;
9727
+ /** Source Effect Schema — used internally by `Type.getSchema(self)`. */
9728
+ readonly [StaticTypeSchemaSlot]: Schema.AnyNoContext;
9729
+ /**
9730
+ * The fields defined in the original struct schema.
9731
+ * Allows accessing field definitions for introspection.
9732
+ */
9733
+ readonly fields: Fields;
9734
+ }
9735
+ /**
9736
+ * Type that represents any ECHO relation type — a `Type.Type` entity branded
9737
+ * with the relation entity kind, i.e. what `Type.makeRelation(...)` produces.
9738
+ */
9739
+ type AnyRelation = Relation<unknown, unknown, unknown>;
9740
+ /**
9741
+ * Type that represents any ECHO type-kind entity — a `Type.Type` meta-schema
9742
+ * value (static `Type.Type` or a persisted draft from `db.add(...)`).
9743
+ * Mirrors {@link AnyObj} / {@link AnyRelation} for the third sibling kind.
9744
+ */
9745
+ type AnyType = Type$1<unknown>;
9746
+ /**
9747
+ * Any ECHO type-entity — one of the three sibling kinds: object-kind, relation-kind,
9748
+ * or type-kind (the meta-schema). APIs that want "any ECHO type" use this union;
9749
+ * the underlying Effect Schema is retrieved via `Type.getSchema`.
9750
+ */
9751
+ type AnyEntity$1 = AnyObj | AnyRelation | AnyType;
9752
+ /**
9753
+ * String key used to phantom-carry the instance type produced by a `Type.Type`.
9754
+ * Used by `Type.InstanceType<typeof Foo>` to recover the schema instance type
9755
+ * since `Type.makeObject(dxn)` does not return a `Schema.Schema`.
9756
+ *
9757
+ * Re-exported from the internal types layer so both `Type.ts` and internal
9758
+ * helpers (`makeObject`, `createObject`) reference the same phantom key.
9759
+ */
9760
+ declare const InstancePhantomId$1: "~@dxos/echo/Type.Instance";
9761
+ type InstancePhantomId$1 = InstancePhantomId;
9762
+ /**
9763
+ * Sibling of {@link Obj} / {@link Relation} for the third ECHO entity kind:
9764
+ * **type-kind** entities (meta-schemas). The singleton {@link Type} const is
9765
+ * the canonical example — it describes stored type definitions themselves.
9766
+ *
9767
+ * Not a `Schema.Schema`. Use `Type.getSchema(value)` to obtain the underlying
9768
+ * Effect Schema and `Type.update(value, draft => ...)` to mutate.
9769
+ *
9770
+ * `A` is the instance-type phantom — what `Obj.make(value, ...)` would produce.
9771
+ * Merged with the `Type` const value via TypeScript declaration merging.
9772
+ */
9773
+ interface Type$1<A$1 = unknown> extends BaseTypeEntity<A$1 & OfKind<typeof Kind.Type>> {
9774
+ /** Schema-kind brand (type — the meta-schema kind). */
9775
+ readonly [SchemaKindId]: EntityKind.Type;
9776
+ /** Source Effect Schema — used internally by `Type.getSchema(self)`. */
9777
+ readonly [StaticTypeSchemaSlot]: Schema.AnyNoContext;
9778
+ }
9779
+ /**
9780
+ * Instance type produced by a Type entity.
9781
+ *
9782
+ * Accepts ONLY {@link AnyEntity} inputs — `Type.Obj`, `Type.Relation`, or
9783
+ * `Type.Type`. Raw Effect `Schema.Schema` values are rejected: for those, use
9784
+ * `Schema.Schema.Type<typeof Foo>` directly. This separation keeps the type
9785
+ * system honest about which values represent ECHO entities versus plain
9786
+ * Effect schemas.
9787
+ *
9788
+ * Dispatches on the entity kind:
9789
+ * - `Relation<Props, S, T>` → `Endpoints<S,T> & Props & OfKind<Relation>`
9790
+ * - `Obj<A>` → `A & OfKind<Object>`
9791
+ * - `Type<A>` → `A & OfKind<Type>`
9792
+ */
9793
+ type InstanceType$1<T$1 extends AnyEntity$1> = T$1 extends Relation<infer Props, infer Source, infer Target, any> ? Endpoints$1<Source, Target> & Props & OfKind<typeof Kind.Relation> : T$1 extends Obj$1<infer A, any> ? A & OfKind<typeof Kind.Object> : T$1 extends Type$1<infer A> ? A & OfKind<typeof Kind.Type> : never;
9794
+ //#endregion
9795
+ //#region ../echo/dist/types/src/internal/Entity/entity.d.ts
9796
+ type EchoTypeSchemaProps<T$1, ExtraFields = {}> = Simplify$1<AnyEntity & ToMutable<T$1> & ExtraFields>;
9797
+ /**
9798
+ * In-memory `Type.Type` entity shape produced by `Type.makeObject(dxn)` /
9799
+ * `Type.makeRelation({...})`. A live reactive `TypeSchema` instance —
9800
+ * identical to a persisted `Type.Type` except for database attachment.
9801
+ *
9802
+ * NOT a `Schema.Schema`. The underlying Effect Schema is cached on the hidden
9803
+ * `StaticTypeSchemaSlot` slot — retrieve it via `Type.getSchema(...)`.
9804
+ */
9805
+ interface EchoTypeSchema<Self extends Schema.Any, ExtraFields = {}, K$1 extends EntityKind = EntityKind, Fields extends Struct.Fields = Struct.Fields> {
9806
+ /**
9807
+ * Entity-kind brand. Type entities are their own kind (`Type`) regardless of
9808
+ * the kind of instance they describe — `[SchemaKindId]` carries the latter.
9809
+ * This lets predicates like `Obj.isObject` / `Relation.isRelation` cleanly
9810
+ * reject type entities without also having to inspect `[SchemaKindId]`.
9811
+ */
9812
+ readonly [KindId]: EntityKind.Type;
9813
+ /** Schema-kind brand indicating what kind of instance this type describes. */
9814
+ readonly [SchemaKindId]: K$1;
9815
+ /**
9816
+ * Entity id. Always present — stamped at construction — but NOT the type's
9817
+ * identity while in-memory: an unattached type resolves its URI to the typename
9818
+ * DXN, switching to `echo:/<id>` only once attached to a database (see
9819
+ * `getTypeURIFromSpecifier`, which discriminates by database attachment).
9820
+ */
9821
+ readonly id: ObjectId;
9822
+ /** Source Effect Schema (kept on a hidden slot for `Type.getSchema`). */
9823
+ readonly [StaticTypeSchemaSlot]: Schema.AnyNoContext;
9824
+ readonly jsonSchema: JsonSchemaType;
9825
+ /** Struct fields for introspection. */
9826
+ readonly fields: Fields;
9827
+ /** Phantom — instance type produced by `Obj.make(self, ...)`. */
9828
+ readonly _instance?: EchoTypeSchemaProps<Schema.Type<Self>, ExtraFields>;
9829
+ /**
9830
+ * Phantom slot mirroring `Type<A>` so internal helpers (`makeObject`,
9831
+ * `createObject`, `Ref.make`) infer the instance type uniformly whether
9832
+ * the caller passes an `EchoTypeSchema` or a top-level `Type.Type` entity.
9833
+ *
9834
+ * Includes the instance-kind brand (`[KindId]`) so the phantom is assignable
9835
+ * to the matching public-side interface in `Type.ts` (`Type.Obj` /
9836
+ * `Type.Relation` / `Type.Type`). Each kind projects identity: instances of
9837
+ * an object-kind schema are object-kind entities, type-kind schemas produce
9838
+ * type-kind (persisted Type.Type) entities — the latter additionally carry
9839
+ * the `[SchemaKindId]` / `[StaticTypeSchemaSlot]` brands the echo-handler
9840
+ * proxy exposes on persisted Type entities.
9841
+ */
9842
+ readonly [InstancePhantomId]?: EchoTypeSchemaProps<Schema.Type<Self>, ExtraFields> & {
9843
+ readonly [KindId]: K$1;
9844
+ } & (K$1 extends EntityKind.Type ? {
9845
+ readonly [SchemaKindId]: EntityKind.Type;
9846
+ readonly [StaticTypeSchemaSlot]: Schema.AnyNoContext;
9847
+ } : {});
9848
+ }
9849
+ //#endregion
9850
+ //#region ../echo/dist/types/src/internal/Entity/type-kind.d.ts
9851
+ /**
9852
+ * Type-kind schema marker — produced by {@link EchoTypeKindSchema}.
9853
+ *
9854
+ * Distinguishes meta-schemas (entities of `EntityKind.Type`, such as the
9855
+ * built-in `Type.Type` TypeSchema) from object and relation types.
9856
+ */
9857
+ type EchoTypeKindSchema<Self extends Schema.Any, Fields extends Struct.Fields = Struct.Fields> = EchoTypeSchema<Self, {}, EntityKind.Type, Fields>;
9858
+ /**
9859
+ * Pipeable that brands a schema as a type-kind ECHO entity. Mirrors
9860
+ * {@link EchoObjectSchema} / {@link EchoRelationSchema}, but stamps the
9861
+ * resulting entity with `[SchemaKindId]: EntityKind.Type` and a matching
9862
+ * `TypeAnnotation.kind = 'type'` so meta-schemas surface uniformly through
9863
+ * `Type.isTypeKindSchema`, `Filter.type`, etc.
9864
+ */
9865
+ declare const EchoTypeKindSchema: {
9866
+ (dxn: DXN): <Self extends Schema.Any, Fields extends Struct.Fields = Struct.Fields>(self: Self & {
9867
+ fields?: Fields;
9868
+ }) => EchoTypeKindSchema<Self, Fields>;
9869
+ };
9870
+ //#endregion
9871
+ //#region ../echo/dist/types/src/Entity.d.ts
9872
+ declare const KindId$1: "~@dxos/echo/Kind";
9873
+ type KindId$1 = typeof KindId;
9874
+ declare const Kind: typeof EntityKind;
9875
+ type Kind = EntityKind;
9876
+ /**
9877
+ * Assigns a kind to an Object or Relation instance.
9878
+ * NOTE: Needed to make `isRelation` and `isObject` checks work.
9879
+ */
9880
+ interface OfKind<K$1 extends Kind> {
9881
+ readonly [KindId$1]: K$1;
9882
+ readonly id: ObjectId;
9883
+ }
9884
+ /**
9885
+ * Unknown Obj or Relation (reactive).
9886
+ */
9887
+ interface Unknown extends OfKind<Kind> {}
9888
+ /**
9889
+ * Effect Schema for any ECHO entity (object or relation).
9890
+ *
9891
+ * Kind-agnostic counterpart to `Obj.Unknown` / `Relation.Unknown` — validates
9892
+ * the structural shape (id + properties) without constraining `[KindId]`. Used
9893
+ * in operation input schemas that accept any entity flavour (e.g.
9894
+ * `Schema.Array(Entity.Unknown)`).
9895
+ *
9896
+ * The cast bridges the runtime structural schema to the branded `Unknown` type:
9897
+ * `[KindId]` is a symbol brand that can't be expressed in a runtime `Struct`,
9898
+ * so the entity guarantee is carried at the type level only (same approach as
9899
+ * `Obj.Unknown` / `Relation.Unknown`). Unlike those, this is kind-agnostic so it
9900
+ * isn't an `UnknownTypeSchema<_, K>` (there's no single `K`) and carries no
9901
+ * `TypeAnnotation`.
9902
+ */
9903
+ declare const Unknown: Schema<Unknown>;
9904
+ //#endregion
9905
+ //#region ../echo/dist/types/src/internal/common/types/base.d.ts
9906
+ /**
9907
+ * Base type for all data objects (reactive, ECHO, and other raw objects).
9908
+ * NOTE: This describes the base type for all database objects.
9909
+ * It is stricter than `T extends {}` or `T extends object`.
9910
+ */
9911
+ type AnyProperties = Record<string, any>;
9912
+ /**
9913
+ * Canonical type for all ECHO entities (objects and relations).
9914
+ * @depreacted Remove, use Entity.Unknown instead.
9915
+ */
9916
+ interface AnyEntity {
9917
+ readonly id: ObjectId;
9918
+ }
9919
+ //#endregion
9920
+ //#region ../echo/dist/types/src/internal/common/types/entity.d.ts
9921
+ /**
9922
+ * String key used to identify the kind of an entity instance (object or relation).
9923
+ */
9924
+ declare const KindId: '~@dxos/echo/Kind';
9925
+ type KindId = typeof KindId;
9926
+ /**
9927
+ * String key used to identify the kind of a schema (object schema or relation schema).
9928
+ * Parallels KindId which identifies instance kinds.
9929
+ */
9930
+ declare const SchemaKindId: '~@dxos/echo/SchemaKind';
9931
+ type SchemaKindId = typeof SchemaKindId;
9932
+ /**
9933
+ * Hidden slot on a static `Type.Type` entity that holds the source Effect
9934
+ * Schema. `Type.getSchema(...)` reads this for static types; persisted types
9935
+ * rebuild from `jsonSchema` instead. Stored as a string key for declaration
9936
+ * portability (see KindId comment above).
9937
+ */
9938
+ declare const StaticTypeSchemaSlot: '~@dxos/echo/Type.StaticSchema';
9939
+ type StaticTypeSchemaSlot = typeof StaticTypeSchemaSlot;
9940
+ /**
9941
+ * Phantom string key on `Type<A>` entities that carries the instance type `A`.
9942
+ * Lets internal helpers (`makeObject`, `createObject`, etc.) pattern-match the
9943
+ * instance type from an entity input without importing from the top-level
9944
+ * `Type` module. Mirrors `Type.InstancePhantomId` (declared in `Type.ts`).
9945
+ *
9946
+ * Stored as a string key so declarations remain portable across packages
9947
+ * (see KindId comment above).
9948
+ */
9949
+ declare const InstancePhantomId: '~@dxos/echo/Type.Instance';
9950
+ type InstancePhantomId = typeof InstancePhantomId;
9951
+ /**
9952
+ * Nominal brand carried by the well-known "any object" / "any relation"
9953
+ * schemas (`Obj.Unknown`, `Relation.Unknown`). The brand lets `Ref.Ref`,
9954
+ * `Filter.type`, and `Query.type` accept these schemas in addition to
9955
+ * `Type.Type` entities, without opening the door to arbitrary raw schemas.
9956
+ *
9957
+ * Stored as a string key so declarations remain portable across packages
9958
+ * (see KindId comment above).
9959
+ */
9960
+ declare const UnknownTypeSchemaBrandId: '~@dxos/echo/UnknownTypeSchemaBrand';
9961
+ type UnknownTypeSchemaBrandId = typeof UnknownTypeSchemaBrandId;
9962
+ /**
9963
+ * Schema-side companion to `Type.Type` entities for the "any object" /
9964
+ * "any relation" cases. Branded so `Ref.Ref` / `Filter.type` / `Query.type`
9965
+ * can pattern-match on it; arbitrary `Schema.Schema` values do not satisfy
9966
+ * this shape.
9967
+ */
9968
+ interface UnknownTypeSchema<A$1, K$1 extends EntityKind> extends Schema<A$1, any, never> {
9969
+ readonly [UnknownTypeSchemaBrandId]: K$1;
9970
+ }
9971
+ /**
9972
+ * Kinds of entities stored in ECHO: objects, relations, and types.
9973
+ */
9974
+ declare enum EntityKind {
9975
+ Object = "object",
9976
+ Relation = "relation",
9977
+ Type = "type",
9978
+ }
8792
9979
  //#endregion
8793
9980
  //#region src/query-lite/query-lite.d.ts
8794
9981
  declare const Order2: typeof Order_d_exports;