{
  "version": 3,
  "sources": ["../../../src/document-structure.ts", "../../../src/reference.ts", "../../../src/edge-peer.ts", "../../../src/echo-feed-codec.ts", "../../../src/foreign-key.ts", "../../../src/query/ast.ts", "../../../src/space-doc-version.ts", "../../../src/space-id.ts"],
  "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { invariant } from '@dxos/invariant';\nimport type { EntityId, URI } from '@dxos/keys';\nimport { visitValues } from '@dxos/util';\n\nimport { type RawString } from './automerge';\nimport type { ForeignKey } from './foreign-key';\nimport { type EncodedReference, isEncodedReference } from './reference';\nimport { type SpaceDocVersion } from './space-doc-version';\n\nexport type SpaceState = {\n  // Url of the root automerge document.\n  rootUrl?: string;\n};\n\n/**\n * Array indexes get converted to strings.\n */\nexport type EntityProp = string;\nexport type EntityPropPath = EntityProp[];\n\n/**\n * Link to all documents that hold objects in the space.\n */\nexport interface DatabaseDirectory {\n  version?: SpaceDocVersion;\n\n  access?: {\n    spaceKey: string;\n  };\n  /**\n   * Objects inlined in the current document.\n   */\n  objects?: {\n    [id: string]: EntityStructure;\n  };\n  /**\n   * Object id points to an automerge doc url where the object is embedded.\n   */\n  links?: {\n    [echoUri: string]: string | RawString;\n  };\n\n  /**\n   * @deprecated\n   * For backward compatibility.\n   */\n  experimental_spaceKey?: string;\n}\n\nexport const DatabaseDirectory = Object.freeze({\n  /**\n   * @returns Space key in hex of the space that owns the document. In hex format. Without 0x prefix.\n   */\n  getSpaceKey: (doc: DatabaseDirectory): string | null => {\n    // experimental_spaceKey is set on old documents, new ones are created with doc.access.spaceKey\n    const rawSpaceKey = doc.access?.spaceKey ?? doc.experimental_spaceKey;\n    if (rawSpaceKey == null) {\n      return null;\n    }\n\n    const rawKey = String(rawSpaceKey);\n    invariant(!rawKey.startsWith('0x'), 'Space key must not start with 0x');\n    return rawKey;\n  },\n\n  getInlineObject: (doc: DatabaseDirectory, id: EntityId): EntityStructure | undefined => {\n    return doc.objects?.[id];\n  },\n\n  getLink: (doc: DatabaseDirectory, id: EntityId): string | undefined => {\n    return doc.links?.[id]?.toString();\n  },\n\n  make: ({\n    spaceKey,\n    objects,\n    links,\n  }: {\n    spaceKey: string;\n    objects?: Record<string, EntityStructure>;\n    links?: Record<string, RawString>;\n  }): DatabaseDirectory => ({\n    access: {\n      spaceKey,\n    },\n    objects: objects ?? {},\n    links: links ?? {},\n  }),\n});\n\n/**\n * Representation of an ECHO object in an AM document.\n */\nexport type EntityStructure = {\n  // TODO(dmaretskyi): Missing in some cases.\n  system?: EntitySystem;\n\n  meta: EntityMeta;\n  /**\n   * User-defined data.\n   * Adheres to schema in `system.type`\n   */\n  data: Record<string, any>;\n};\n\n// Helper methods to interact with the {@link EntityStructure}.\nexport const EntityStructure = Object.freeze({\n  /**\n   * @throws On invalid object structure.\n   */\n  getTypeReference: (object: EntityStructure): EncodedReference | undefined => {\n    return object.system?.type;\n  },\n\n  /**\n   * @throws On invalid object structure.\n   */\n  getEntityKind: (object: EntityStructure): 'object' | 'relation' | 'type' => {\n    const kind = object.system?.kind ?? 'object';\n    invariant(kind === 'object' || kind === 'relation' || kind === 'type', 'Invalid kind');\n    return kind;\n  },\n\n  isDeleted: (object: EntityStructure): boolean => {\n    return object.system?.deleted ?? false;\n  },\n\n  getRelationSource: (object: EntityStructure): EncodedReference | undefined => {\n    return object.system?.source;\n  },\n\n  getRelationTarget: (object: EntityStructure): EncodedReference | undefined => {\n    return object.system?.target;\n  },\n\n  getParent: (object: EntityStructure): EncodedReference | undefined => {\n    return object.system?.parent;\n  },\n\n  /**\n   * @returns All references in the data section of the object.\n   */\n  getAllOutgoingReferences: (object: EntityStructure): { path: EntityPropPath; reference: EncodedReference }[] => {\n    const references: { path: EntityPropPath; reference: EncodedReference }[] = [];\n    const visit = (path: EntityPropPath, value: unknown) => {\n      if (isEncodedReference(value)) {\n        references.push({ path, reference: value });\n      } else {\n        visitValues(value, (value, key) => visit([...path, String(key)], value));\n      }\n    };\n    visitValues(object.data, (value, key) => visit([String(key)], value));\n    return references;\n  },\n\n  getTags: (object: EntityStructure): (EncodedReference | string)[] => {\n    return object.meta.tags ?? [];\n  },\n\n  makeObject: ({\n    type,\n    data,\n    keys,\n  }: {\n    type: URI.URI;\n    deleted?: boolean;\n    keys?: ForeignKey[];\n    data?: unknown;\n  }): EntityStructure => {\n    return {\n      system: {\n        kind: 'object',\n        type: { '/': type },\n      },\n      meta: {\n        keys: keys ?? [],\n      },\n      data: data ?? {},\n    };\n  },\n\n  makeRelation: ({\n    type,\n    source,\n    target,\n    deleted,\n    keys,\n    data,\n  }: {\n    type: URI.URI;\n    source: EncodedReference;\n    target: EncodedReference;\n    deleted?: boolean;\n    keys?: ForeignKey[];\n    data?: unknown;\n  }): EntityStructure => {\n    return {\n      system: {\n        kind: 'relation',\n        type: { '/': type },\n        source,\n        target,\n        deleted: deleted ?? false,\n      },\n      meta: {\n        keys: keys ?? [],\n      },\n      data: data ?? {},\n    };\n  },\n\n  makeType: ({ type, keys, data }: { type: URI.URI; keys?: ForeignKey[]; data?: unknown }): EntityStructure => {\n    return {\n      system: {\n        kind: 'type',\n        type: { '/': type },\n      },\n      meta: {\n        keys: keys ?? [],\n      },\n      data: data ?? {},\n    };\n  },\n});\n\n/**\n * Echo object metadata.\n */\nexport type EntityMeta = {\n  /**\n   * Foreign keys.\n   */\n  keys: ForeignKey[];\n\n  /**\n   * Tags.\n   * Encoded references to Tag objects within the space.\n   *\n   * NOTE: Optional for backwards compatibility; legacy data may store bare DXN strings, which are\n   * upgraded to encoded references on read (see `object-core.ts`).\n   */\n  tags?: (EncodedReference | string)[];\n\n  /**\n   * Fully-qualified registry key for the object (FQN format, e.g. `org.example.type.foo`).\n   * Identifies the canonical registry entry the object instance was created from.\n   */\n  key?: string;\n\n  /**\n   * Semantic version of the registry entry the object was created from.\n   * Must be a valid semver string (e.g. `1.2.3`).\n   */\n  version?: string;\n\n  /**\n   * Dictionary of annotations to this entity.\n   *\n   * NOTE: Optional for backwards compatibility. Values are arbitrary decoded automerge primitives;\n   * typed as `any` so `EntityStructure` stays assignable to `DecodedAutomergePrimaryValue`.\n   */\n  annotations?: { readonly [key: string]: any };\n};\n\n/**\n * Automerge object system properties.\n * (Is automerge specific.)\n */\nexport type EntitySystem = {\n  /**\n   * Entity kind. `'type'` covers persisted ECHO type definitions (instances of\n   * the `Type.Type` meta-schema); `'object'` / `'relation'` cover regular ECHO\n   * instances.\n   */\n  kind?: 'object' | 'relation' | 'type';\n\n  /**\n   * Object reference ('protobuf' protocol) type — DXN of the schema this\n   * entity instantiates.\n   *\n   * - For `kind === 'object'` / `'relation'` instances, this is the URI of the\n   *   user-defined schema the entity was created from (e.g. `dxn:org.example.Person:1.0.0`).\n   * - For `kind === 'type'` entities (persisted Type.Type meta-instances) this\n   *   is always the URI of the `TypeSchema` meta-schema itself\n   *   (`dxn:org.dxos.type.schema:0.1.0`). The kind that the meta-instance\n   *   _describes_ (object/relation/type) lives in `data.jsonSchema.entityKind`.\n   */\n  type?: EncodedReference;\n\n  /**\n   * Deletion marker.\n   */\n  deleted?: boolean;\n\n  /**\n   * Object parent.\n   * Objects with no parent are at the top level of the object hierarchy in the space.\n   */\n  parent?: EncodedReference;\n\n  /**\n   * Only for relations.\n   */\n  source?: EncodedReference;\n\n  /**\n   * Only for relations.\n   */\n  target?: EncodedReference;\n\n  /**\n   * Unix ms timestamp recorded at object creation time.\n   * Set once when the ObjectStructure is first written; never modified after that.\n   * Survives compaction / migrations (unlike automerge change timestamps).\n   */\n  createdAt?: number;\n};\n\n/**\n * Id property name.\n */\nexport const PROPERTY_ID = 'id';\n\n/**\n * Data namespace.\n * The key on {@link EntityStructure} that contains the user-defined data.\n */\nexport const DATA_NAMESPACE = 'data';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { assertArgument } from '@dxos/invariant';\nimport { URI } from '@dxos/keys';\n\n// TODO(dmaretskyi): Is this used anywhere?\nexport const REFERENCE_TYPE_TAG = 'dxos.echo.model.document.Reference';\n\n/**\n * Reference as it is stored in Automerge document.\n */\nexport type EncodedReference = {\n  '/': URI.URI;\n};\n\nexport const isEncodedReference = (value: any): value is EncodedReference =>\n  typeof value === 'object' && value !== null && Object.keys(value).length === 1 && typeof value['/'] === 'string';\n\nexport const EncodedReference = Object.freeze({\n  isEncodedReference,\n  /**\n   * Returns the opaque URI stored in the encoded reference (any scheme: `echo:` or `dxn:`).\n   * Consumers can narrow with `EID.isEID(uri)` / `DXN.isDXN(uri)`.\n   */\n  toURI: (value: EncodedReference): URI.URI => {\n    assertArgument(isEncodedReference(value), 'value', 'invalid reference');\n    return value['/'];\n  },\n  /**\n   * Creates an encoded reference from an opaque URI.\n   */\n  fromURI: (uri: URI.URI): EncodedReference => {\n    return { '/': uri };\n  },\n});\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { type SpaceId } from '@dxos/keys';\nimport { EdgeService } from '@dxos/protocols';\nimport { compositeKey } from '@dxos/util';\n\n/**\n * Returns true if the given peerId belongs to an EDGE replicator (Automerge or Subduction).\n *\n * When `spaceId` is provided, the match is scoped to that space (peerId must start with\n * `<service>:<spaceId>`). When omitted, only the leading service segment is checked\n * (peerId must start with `<service>:`), which is useful when the caller doesn't have a\n * spaceId on hand or wants to match any edge replicator regardless of space.\n */\nexport const isEdgePeerId = (peerId: string, spaceId?: SpaceId): boolean => {\n  const automergePrefix =\n    spaceId !== undefined\n      ? compositeKey(EdgeService.AUTOMERGE_REPLICATOR, spaceId)\n      : `${EdgeService.AUTOMERGE_REPLICATOR}:`;\n  const subductionPrefix =\n    spaceId !== undefined\n      ? compositeKey(EdgeService.SUBDUCTION_REPLICATOR, spaceId)\n      : `${EdgeService.SUBDUCTION_REPLICATOR}:`;\n  return peerId.startsWith(automergePrefix) || peerId.startsWith(subductionPrefix);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { FeedProtocol } from '@dxos/protocols';\n\nimport type { ForeignKey } from './foreign-key';\n\n/** Property name for meta when object is serialized to JSON. Matches @dxos/echo/internal ATTR_META. */\nconst ATTR_META = '@meta';\n\n/**\n * Codec for ECHO objects in feed block payload: JSON object ↔ UTF-8 bytes.\n * Encodes with queue position stripped; decodes with optional position injection.\n */\nexport class EchoFeedCodec {\n  static readonly #encoder = new TextEncoder();\n  static readonly #decoder = new TextDecoder();\n\n  /**\n   * Prepares a value for feed storage (strips queue position from metadata) and encodes to bytes.\n   */\n  static encode(value: Record<string, unknown>): Uint8Array {\n    const prepared = EchoFeedCodec.#stripQueuePosition(value);\n    return EchoFeedCodec.#encoder.encode(JSON.stringify(prepared));\n  }\n\n  /**\n   * Decodes feed block bytes to a JSON value.\n   * If position is provided, injects queue position into the decoded object's metadata.\n   */\n  static decode(data: Uint8Array, position?: number): Record<string, unknown> {\n    const decoded = JSON.parse(EchoFeedCodec.#decoder.decode(data));\n    if (position !== undefined && typeof decoded === 'object' && decoded !== null) {\n      EchoFeedCodec.#setQueuePosition(decoded, position);\n    }\n    return decoded;\n  }\n\n  static #stripQueuePosition(value: Record<string, unknown>): Record<string, unknown> {\n    if (typeof value !== 'object' || value === null) {\n      return value;\n    }\n    const obj = structuredClone(value);\n    const meta = obj[ATTR_META] as { keys?: ForeignKey[] } | undefined;\n    if (meta?.keys?.some((key: ForeignKey) => key.source === FeedProtocol.KEY_QUEUE_POSITION)) {\n      meta.keys = meta.keys.filter((key: ForeignKey) => key.source !== FeedProtocol.KEY_QUEUE_POSITION);\n    }\n    return obj;\n  }\n\n  static #setQueuePosition(obj: Record<string, any>, position: number): void {\n    obj[ATTR_META] ??= { keys: [] };\n    obj[ATTR_META]!.keys ??= [];\n    const keys = obj[ATTR_META]!.keys!;\n    for (let i = 0; i < keys.length; i++) {\n      if (keys[i].source === FeedProtocol.KEY_QUEUE_POSITION) {\n        keys.splice(i, 1);\n        i--;\n      }\n    }\n    keys.push({\n      source: FeedProtocol.KEY_QUEUE_POSITION,\n      id: position.toString(),\n    });\n  }\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\nimport * as SchemaAST from 'effect/SchemaAST';\n\nconst ForeignKey_ = Schema.Struct({\n  /**\n   * Name of the foreign database/system.\n   * E.g., `github.com`.\n   */\n  source: Schema.String,\n\n  /**\n   * Id within the foreign database.\n   */\n  // TODO(wittjosiah): This annotation is currently used to ensure id field shows up in forms.\n  // TODO(dmaretskyi): `false` is not a valid value for the annotation. Use a different annotation.\n  id: Schema.String.annotations({ [SchemaAST.IdentifierAnnotationId]: 'false' }),\n});\n\nexport type ForeignKey = Schema.Schema.Type<typeof ForeignKey_>;\n\n/**\n * Reference to an object in a foreign database.\n */\nexport const ForeignKey: Schema.Schema<ForeignKey> = ForeignKey_;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Match from 'effect/Match';\nimport * as Schema from 'effect/Schema';\n\nimport { EID, EntityId, URI } from '@dxos/keys';\n\nimport { ForeignKey } from '../foreign-key';\n\n// Type identifier URI — either a DXN (typename) or an EID (stored-schema-as-object).\n// Matches the URI written into an object's `system.type` (see `getSchemaURI`). Null\n// matches any type.\nconst TypenameSpecifier = Schema.Union(URI.Schema, Schema.Null);\n\n// NOTE: This pattern with 3 definitions per schema is need to make the types opaque, and circular references in AST to not cause compiler errors.\n\n/**\n * Filter by object type and properties.\n *\n * Clauses are combined using logical AND.\n */\n// TODO(burdon): Filter object vs. relation.\nconst FilterObject_ = Schema.Struct({\n  type: Schema.Literal('object'),\n\n  typename: TypenameSpecifier,\n\n  id: Schema.optional(Schema.Array(EntityId)),\n\n  /**\n   * Filter by property.\n   * Must not include object ID.\n   */\n  props: Schema.Record({\n    key: Schema.String.annotations({ description: 'Property name' }),\n    value: Schema.suspend(() => Filter),\n  }),\n\n  /**\n   * Objects that have any of the given foreign keys.\n   */\n  foreignKeys: Schema.optional(Schema.Array(ForeignKey)),\n\n  /**\n   * Match objects whose meta `key` equals this fully-qualified registry key (FQN format).\n   */\n  metaKey: Schema.optional(Schema.String),\n\n  /**\n   * Semver range matched against the object's meta `version`.\n   * Only consulted when {@link metaKey} is set. Objects with no `version` do not satisfy a version-constrained filter.\n   */\n  metaVersion: Schema.optional(Schema.String),\n\n  // NOTE: Make sure to update `FilterStep.isNoop` if you change this.\n});\nexport interface FilterObject extends Schema.Schema.Type<typeof FilterObject_> {}\nexport const FilterObject: Schema.Schema<FilterObject> = FilterObject_;\n\n/**\n * Compare.\n */\nconst FilterCompare_ = Schema.Struct({\n  type: Schema.Literal('compare'),\n  operator: Schema.Literal('eq', 'neq', 'gt', 'gte', 'lt', 'lte'),\n  value: Schema.Unknown,\n});\nexport interface FilterCompare extends Schema.Schema.Type<typeof FilterCompare_> {}\nexport const FilterCompare: Schema.Schema<FilterCompare> = FilterCompare_;\n\n/**\n * In.\n */\nconst FilterIn_ = Schema.Struct({\n  type: Schema.Literal('in'),\n  values: Schema.Array(Schema.Any),\n});\nexport interface FilterIn extends Schema.Schema.Type<typeof FilterIn_> {}\nexport const FilterIn: Schema.Schema<FilterIn> = FilterIn_;\n\n/**\n * Contains.\n */\nconst FilterContains_ = Schema.Struct({\n  type: Schema.Literal('contains'),\n  value: Schema.Any,\n});\n\nexport interface FilterContains extends Schema.Schema.Type<typeof FilterContains_> {}\n\n/**\n * Predicate for an array property to contain the provided value.\n * Nested objects are matched using strict structural matching.\n */\nexport const FilterContains: Schema.Schema<FilterContains> = FilterContains_;\n\n/**\n * Filters objects that have certain tag.\n */\nconst FilterTag_ = Schema.Struct({\n  type: Schema.Literal('tag'),\n  tag: Schema.String, // TODO(burdon): Make OR-collection?\n});\n\nexport interface FilterTag extends Schema.Schema.Type<typeof FilterTag_> {}\nexport const FilterTag: Schema.Schema<FilterTag> = FilterTag_;\n\n/**\n * Range.\n */\nconst FilterRange_ = Schema.Struct({\n  type: Schema.Literal('range'),\n  from: Schema.Any,\n  to: Schema.Any,\n});\n\nexport interface FilterRange extends Schema.Schema.Type<typeof FilterRange_> {}\nexport const FilterRange: Schema.Schema<FilterRange> = FilterRange_;\n\n/**\n * Filter by system timestamp (createdAt / updatedAt).\n * Timestamps are unix milliseconds stored in the object meta index.\n */\nconst FilterTimestamp_ = Schema.Struct({\n  type: Schema.Literal('timestamp'),\n  field: Schema.Literal('createdAt', 'updatedAt'),\n  operator: Schema.Literal('gt', 'gte', 'lt', 'lte'),\n  value: Schema.Number,\n});\n\nexport interface FilterTimestamp extends Schema.Schema.Type<typeof FilterTimestamp_> {}\nexport const FilterTimestamp: Schema.Schema<FilterTimestamp> = FilterTimestamp_;\n\n/**\n * Text search.\n */\nconst FilterTextSearch_ = Schema.Struct({\n  type: Schema.Literal('text-search'),\n  text: Schema.String,\n  searchKind: Schema.optional(Schema.Literal('full-text', 'vector')),\n});\n\nexport interface FilterTextSearch extends Schema.Schema.Type<typeof FilterTextSearch_> {}\nexport const FilterTextSearch: Schema.Schema<FilterTextSearch> = FilterTextSearch_;\n\n/**\n * Not.\n */\nconst FilterNot_ = Schema.Struct({\n  type: Schema.Literal('not'),\n  filter: Schema.suspend(() => Filter),\n});\n\nexport interface FilterNot extends Schema.Schema.Type<typeof FilterNot_> {}\nexport const FilterNot: Schema.Schema<FilterNot> = FilterNot_;\n\n/**\n * And.\n */\nconst FilterAnd_ = Schema.Struct({\n  type: Schema.Literal('and'),\n  filters: Schema.Array(Schema.suspend(() => Filter)),\n});\n\nexport interface FilterAnd extends Schema.Schema.Type<typeof FilterAnd_> {}\nexport const FilterAnd: Schema.Schema<FilterAnd> = FilterAnd_;\n\n/**\n * Or.\n */\nconst FilterOr_ = Schema.Struct({\n  type: Schema.Literal('or'),\n  filters: Schema.Array(Schema.suspend(() => Filter)),\n});\n\nexport interface FilterOr extends Schema.Schema.Type<typeof FilterOr_> {}\nexport const FilterOr: Schema.Schema<FilterOr> = FilterOr_;\n\n/**\n * Filter objects that are children of the specified parents.\n * With transitive=true (default), matches grandchildren and beyond.\n */\nconst FilterChildOf_ = Schema.Struct({\n  type: Schema.Literal('child-of'),\n  /** Parent DXNs to match children of. */\n  parents: Schema.Array(EID.Schema),\n  /** Whether to match transitively (grandchildren, etc.). Defaults to true. */\n  transitive: Schema.Boolean,\n});\n\nexport interface FilterChildOf extends Schema.Schema.Type<typeof FilterChildOf_> {}\nexport const FilterChildOf: Schema.Schema<FilterChildOf> = FilterChildOf_;\n\n/**\n * Union of filters.\n */\nexport const Filter = Schema.Union(\n  FilterObject,\n  FilterCompare,\n  FilterIn,\n  FilterContains,\n  FilterTag,\n  FilterRange,\n  FilterTimestamp,\n  FilterTextSearch,\n  FilterChildOf,\n  FilterNot,\n  FilterAnd,\n  FilterOr,\n).annotations({ identifier: 'org.dxos.schema.filter' });\n\nexport type Filter = Schema.Schema.Type<typeof Filter>;\n\n/**\n * Query objects by type, id, and/or predicates.\n */\nconst QuerySelectClause_ = Schema.Struct({\n  type: Schema.Literal('select'),\n  filter: Schema.suspend(() => Filter),\n});\n\nexport interface QuerySelectClause extends Schema.Schema.Type<typeof QuerySelectClause_> {}\nexport const QuerySelectClause: Schema.Schema<QuerySelectClause> = QuerySelectClause_;\n\n/**\n * Filter objects from selection.\n */\nconst QueryFilterClause_ = Schema.Struct({\n  type: Schema.Literal('filter'),\n  selection: Schema.suspend(() => Query),\n  filter: Schema.suspend(() => Filter),\n});\n\nexport interface QueryFilterClause extends Schema.Schema.Type<typeof QueryFilterClause_> {}\nexport const QueryFilterClause: Schema.Schema<QueryFilterClause> = QueryFilterClause_;\n\n/**\n * Traverse references from an anchor object.\n */\nconst QueryReferenceTraversalClause_ = Schema.Struct({\n  type: Schema.Literal('reference-traversal'),\n  anchor: Schema.suspend(() => Query),\n  property: Schema.String, // TODO(dmaretskyi): Change to EscapedPropPath.\n});\n\nexport interface QueryReferenceTraversalClause extends Schema.Schema.Type<typeof QueryReferenceTraversalClause_> {}\nexport const QueryReferenceTraversalClause: Schema.Schema<QueryReferenceTraversalClause> =\n  QueryReferenceTraversalClause_;\n\n/**\n * Traverse incoming references to an anchor object.\n */\nconst QueryIncomingReferencesClause_ = Schema.Struct({\n  type: Schema.Literal('incoming-references'),\n  anchor: Schema.suspend(() => Query),\n  /**\n   * Property path where the reference is located.\n   * If null, matches references from any property.\n   */\n  property: Schema.NullOr(Schema.String),\n  typename: TypenameSpecifier,\n});\n\nexport interface QueryIncomingReferencesClause extends Schema.Schema.Type<typeof QueryIncomingReferencesClause_> {}\nexport const QueryIncomingReferencesClause: Schema.Schema<QueryIncomingReferencesClause> =\n  QueryIncomingReferencesClause_;\n\n/**\n * Traverse relations connecting to an anchor object.\n */\nconst QueryRelationClause_ = Schema.Struct({\n  type: Schema.Literal('relation'),\n  anchor: Schema.suspend(() => Query),\n  /**\n   * outgoing: anchor is the source of the relation.\n   * incoming: anchor is the target of the relation.\n   * both: anchor is either the source or target of the relation.\n   */\n  direction: Schema.Literal('outgoing', 'incoming', 'both'),\n  filter: Schema.optional(Schema.suspend(() => Filter)),\n});\n\nexport interface QueryRelationClause extends Schema.Schema.Type<typeof QueryRelationClause_> {}\nexport const QueryRelationClause: Schema.Schema<QueryRelationClause> = QueryRelationClause_;\n\n/**\n * Traverse into the source or target of a relation.\n */\nconst QueryRelationTraversalClause_ = Schema.Struct({\n  type: Schema.Literal('relation-traversal'),\n  anchor: Schema.suspend(() => Query),\n  direction: Schema.Literal('source', 'target', 'both'),\n});\n\nexport interface QueryRelationTraversalClause extends Schema.Schema.Type<typeof QueryRelationTraversalClause_> {}\nexport const QueryRelationTraversalClause: Schema.Schema<QueryRelationTraversalClause> = QueryRelationTraversalClause_;\n\n/**\n * Traverse parent-child hierarchy.\n */\nconst QueryHierarchyTraversalClause_ = Schema.Struct({\n  type: Schema.Literal('hierarchy-traversal'),\n  anchor: Schema.suspend(() => Query),\n  /**\n   * to-parent: traverse from child to parent.\n   * to-children: traverse from parent to children.\n   */\n  direction: Schema.Literal('to-parent', 'to-children'),\n});\n\nexport interface QueryHierarchyTraversalClause extends Schema.Schema.Type<typeof QueryHierarchyTraversalClause_> {}\nexport const QueryHierarchyTraversalClause: Schema.Schema<QueryHierarchyTraversalClause> =\n  QueryHierarchyTraversalClause_;\n\n/**\n * Union of multiple queries.\n */\nconst QueryUnionClause_ = Schema.Struct({\n  type: Schema.Literal('union'),\n  queries: Schema.Array(Schema.suspend(() => Query)),\n});\n\nexport interface QueryUnionClause extends Schema.Schema.Type<typeof QueryUnionClause_> {}\nexport const QueryUnionClause: Schema.Schema<QueryUnionClause> = QueryUnionClause_;\n\n/**\n * Set difference of two queries.\n */\nconst QuerySetDifferenceClause_ = Schema.Struct({\n  type: Schema.Literal('set-difference'),\n  source: Schema.suspend(() => Query),\n  exclude: Schema.suspend(() => Query),\n});\n\nexport interface QuerySetDifferenceClause extends Schema.Schema.Type<typeof QuerySetDifferenceClause_> {}\nexport const QuerySetDifferenceClause: Schema.Schema<QuerySetDifferenceClause> = QuerySetDifferenceClause_;\n\nexport const OrderDirection = Schema.Literal('asc', 'desc');\nexport type OrderDirection = Schema.Schema.Type<typeof OrderDirection>;\n\nconst Order_ = Schema.Union(\n  Schema.Struct({\n    // How database wants to order them (in practice - by id).\n    kind: Schema.Literal('natural'),\n  }),\n  Schema.Struct({\n    kind: Schema.Literal('property'),\n    property: Schema.String,\n    direction: OrderDirection,\n  }),\n  Schema.Struct({\n    // Order by relevance rank (for FTS/vector search results).\n    // Default direction is 'desc' (higher rank = better match first).\n    kind: Schema.Literal('rank'),\n    direction: OrderDirection,\n  }),\n  Schema.Struct({\n    // Order by system timestamp (createdAt / updatedAt) from the object meta index.\n    kind: Schema.Literal('timestamp'),\n    field: Schema.Literal('createdAt', 'updatedAt'),\n    direction: OrderDirection,\n  }),\n);\n\nexport type Order = Schema.Schema.Type<typeof Order_>;\nexport const Order: Schema.Schema<Order> = Order_;\n\n/**\n * Order the query results.\n * Left-to-right the orders dominate.\n */\nconst QueryOrderClause_ = Schema.Struct({\n  type: Schema.Literal('order'),\n  query: Schema.suspend(() => Query),\n  order: Schema.Array(Order),\n});\n\nexport interface QueryOrderClause extends Schema.Schema.Type<typeof QueryOrderClause_> {}\nexport const QueryOrderClause: Schema.Schema<QueryOrderClause> = QueryOrderClause_;\n\n/**\n * Add options to a query.\n */\nconst QueryOptionsClause_ = Schema.Struct({\n  type: Schema.Literal('options'),\n  query: Schema.suspend(() => Query),\n  options: Schema.suspend(() => QueryOptions),\n});\n\nexport interface QueryOptionsClause extends Schema.Schema.Type<typeof QueryOptionsClause_> {}\nexport const QueryOptionsClause: Schema.Schema<QueryOptionsClause> = QueryOptionsClause_;\n\n/**\n * Limit the number of results.\n */\nconst QueryLimitClause_ = Schema.Struct({\n  type: Schema.Literal('limit'),\n  query: Schema.suspend(() => Query),\n  limit: Schema.Number,\n});\n\nexport interface QueryLimitClause extends Schema.Schema.Type<typeof QueryLimitClause_> {}\nexport const QueryLimitClause: Schema.Schema<QueryLimitClause> = QueryLimitClause_;\n\nexport const QueryFromClause_ = Schema.Struct({\n  type: Schema.Literal('from'),\n  query: Schema.suspend(() => Query),\n  from: Schema.Union(\n    Schema.TaggedStruct('scope', {\n      scopes: Schema.Array(Schema.suspend(() => Scope)),\n    }),\n    Schema.TaggedStruct('query', {\n      query: Schema.suspend(() => Query),\n    }),\n  ),\n});\nexport interface QueryFromClause extends Schema.Schema.Type<typeof QueryFromClause_> {}\nexport const QueryFromClause: Schema.Schema<QueryFromClause> = QueryFromClause_;\n\nconst Query_ = Schema.Union(\n  QuerySelectClause,\n  QueryFilterClause,\n  QueryReferenceTraversalClause,\n  QueryIncomingReferencesClause,\n  QueryRelationClause,\n  QueryRelationTraversalClause,\n  QueryHierarchyTraversalClause,\n  QueryUnionClause,\n  QuerySetDifferenceClause,\n  QueryOrderClause,\n  QueryOptionsClause,\n  QueryLimitClause,\n  QueryFromClause,\n).annotations({ identifier: 'org.dxos.schema.query' });\n\nexport type Query = Schema.Schema.Type<typeof Query_>;\nexport const Query: Schema.Schema<Query> = Query_;\n\nexport const QueryOptions = Schema.Struct({\n  /**\n   * Nested select statements will use this option to filter deleted objects.\n   */\n  deleted: Schema.optional(Schema.Literal('include', 'exclude', 'only')),\n\n  /**\n   * Diagnostics-only label for logs / tooling (not used by execution semantics).\n   */\n  debugLabel: Schema.optional(Schema.String),\n});\n\nexport interface QueryOptions extends Schema.Schema.Type<typeof QueryOptions> {}\n\n/**\n * Selects from a space (automerge documents).\n * When `spaceId` is omitted, targets the owning space — i.e. the space of whichever\n * database executes the query. This lets callers reference \"this space\" without\n * having to look up its id.\n * When `includeAllFeeds` is true, also selects from all feeds belonging to that space.\n */\nexport const SpaceScope = Schema.TaggedStruct('space', {\n  spaceId: Schema.optional(Schema.String),\n  includeAllFeeds: Schema.optional(Schema.Boolean),\n});\nexport interface SpaceScope extends Schema.Schema.Type<typeof SpaceScope> {}\n\n/**\n * Selects from a specific feed (by its underlying queue DXN).\n */\nexport const FeedScope = Schema.TaggedStruct('feed', {\n  feedUri: Schema.String,\n});\nexport interface FeedScope extends Schema.Schema.Type<typeof FeedScope> {}\n\n/**\n * Selects from a code-shipped object registry.\n *\n * - `'local'`  — the in-process registry attached to the hypergraph.\n * - `'remote'` — a future remote registry service (not yet implemented).\n *\n * To include both, add two separate `RegistryScope` entries to the `scopes` array.\n */\nexport const RegistryScope = Schema.TaggedStruct('registry', {\n  location: Schema.Literal('local', 'remote'),\n});\nexport interface RegistryScope extends Schema.Schema.Type<typeof RegistryScope> {}\n\n/**\n * Specifies the scope of the data to query from.\n * A `from` clause may carry multiple scopes; results are unioned across them.\n */\nexport const Scope = Schema.Union(SpaceScope, FeedScope, RegistryScope);\nexport type Scope = Schema.Schema.Type<typeof Scope>;\n\nexport const visit = (query: Query, visitor: (node: Query) => void) => {\n  visitor(query);\n\n  Match.value(query).pipe(\n    Match.when({ type: 'filter' }, ({ selection }) => visit(selection, visitor)),\n    Match.when({ type: 'reference-traversal' }, ({ anchor }) => visit(anchor, visitor)),\n    Match.when({ type: 'incoming-references' }, ({ anchor }) => visit(anchor, visitor)),\n    Match.when({ type: 'relation' }, ({ anchor }) => visit(anchor, visitor)),\n    Match.when({ type: 'options' }, ({ query }) => visit(query, visitor)),\n    Match.when({ type: 'relation-traversal' }, ({ anchor }) => visit(anchor, visitor)),\n    Match.when({ type: 'hierarchy-traversal' }, ({ anchor }) => visit(anchor, visitor)),\n    Match.when({ type: 'union' }, ({ queries }) => queries.forEach((q) => visit(q, visitor))),\n    Match.when({ type: 'set-difference' }, ({ source, exclude }) => {\n      visit(source, visitor);\n      visit(exclude, visitor);\n    }),\n    Match.when({ type: 'order' }, ({ query }) => visit(query, visitor)),\n    Match.when({ type: 'limit' }, ({ query }) => visit(query, visitor)),\n    Match.when({ type: 'from' }, (node) => {\n      visit(node.query, visitor);\n      if (node.from._tag === 'query') {\n        visit(node.from.query, visitor);\n      }\n    }),\n    Match.when({ type: 'select' }, () => {}),\n    Match.exhaustive,\n  );\n};\n\n/**\n * Recursively transforms a query tree bottom-up.\n * The mapper receives each node with its children already transformed.\n */\nexport const map = (query: Query, mapper: (node: Query) => Query): Query => {\n  const mapped: Query = Match.value(query).pipe(\n    Match.when({ type: 'filter' }, (node) => ({ ...node, selection: map(node.selection, mapper) })),\n    Match.when({ type: 'reference-traversal' }, (node) => ({ ...node, anchor: map(node.anchor, mapper) })),\n    Match.when({ type: 'incoming-references' }, (node) => ({ ...node, anchor: map(node.anchor, mapper) })),\n    Match.when({ type: 'relation' }, (node) => ({ ...node, anchor: map(node.anchor, mapper) })),\n    Match.when({ type: 'relation-traversal' }, (node) => ({ ...node, anchor: map(node.anchor, mapper) })),\n    Match.when({ type: 'hierarchy-traversal' }, (node) => ({ ...node, anchor: map(node.anchor, mapper) })),\n    Match.when({ type: 'options' }, (node) => ({ ...node, query: map(node.query, mapper) })),\n    Match.when({ type: 'order' }, (node) => ({ ...node, query: map(node.query, mapper) })),\n    Match.when({ type: 'limit' }, (node) => ({ ...node, query: map(node.query, mapper) })),\n    Match.when({ type: 'from' }, (node) => ({\n      ...node,\n      query: map(node.query, mapper),\n      ...(node.from._tag === 'query' ? { from: { _tag: 'query' as const, query: map(node.from.query, mapper) } } : {}),\n    })),\n    Match.when({ type: 'union' }, (node) => ({ ...node, queries: node.queries.map((q) => map(q, mapper)) })),\n    Match.when({ type: 'set-difference' }, (node) => ({\n      ...node,\n      source: map(node.source, mapper),\n      exclude: map(node.exclude, mapper),\n    })),\n    Match.when({ type: 'select' }, (node) => node),\n    Match.exhaustive,\n  );\n  return mapper(mapped);\n};\n\nexport const fold = <T>(query: Query, reducer: (node: Query) => T): T[] => {\n  return Match.value(query).pipe(\n    Match.withReturnType<T[]>(),\n    Match.when({ type: 'filter' }, ({ selection }) => fold(selection, reducer)),\n    Match.when({ type: 'reference-traversal' }, ({ anchor }) => fold(anchor, reducer)),\n    Match.when({ type: 'incoming-references' }, ({ anchor }) => fold(anchor, reducer)),\n    Match.when({ type: 'relation' }, ({ anchor }) => fold(anchor, reducer)),\n    Match.when({ type: 'options' }, ({ query }) => fold(query, reducer)),\n    Match.when({ type: 'relation-traversal' }, ({ anchor }) => fold(anchor, reducer)),\n    Match.when({ type: 'hierarchy-traversal' }, ({ anchor }) => fold(anchor, reducer)),\n    Match.when({ type: 'union' }, ({ queries }) => queries.flatMap((q) => fold(q, reducer))),\n    Match.when({ type: 'set-difference' }, ({ source, exclude }) =>\n      fold(source, reducer).concat(fold(exclude, reducer)),\n    ),\n    Match.when({ type: 'order' }, ({ query }) => fold(query, reducer)),\n    Match.when({ type: 'limit' }, ({ query }) => fold(query, reducer)),\n    Match.when({ type: 'from' }, (node) => {\n      const results = fold(node.query, reducer);\n      if (node.from._tag === 'query') {\n        return results.concat(fold(node.from.query, reducer));\n      }\n      return results;\n    }),\n    Match.when({ type: 'select' }, () => []),\n    Match.exhaustive,\n  );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\n/**\n * Denotes the data version of the space automerge document as well as the leaf documents for each individual ECHO object.\n */\nexport type SpaceDocVersion = number & { __type: 'SpaceDocVersion' };\n\nexport const SpaceDocVersion = Object.freeze({\n  /**\n   * For the documents created before the versioning was introduced.\n   */\n  LEGACY: 0 as SpaceDocVersion,\n\n  /**\n   * Current version.\n   */\n  CURRENT: 1 as SpaceDocVersion,\n});\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { subtleCrypto } from '@dxos/crypto';\nimport { PublicKey, SpaceId } from '@dxos/keys';\nimport { ComplexMap } from '@dxos/util';\n\nconst SPACE_IDS_CACHE = new ComplexMap<PublicKey, SpaceId>(PublicKey.hash);\n\n/**\n * Space keys are generated by creating a keypair, and then taking the first 20 bytes of the SHA-256 hash of the public key and encoding them to multibase RFC4648 base-32 format (prefixed with B, see Multibase Table).\n * Inspired by how ethereum addresses are derived.\n */\nexport const createIdFromSpaceKey = async (spaceKey: PublicKey): Promise<SpaceId> => {\n  const cachedValue = SPACE_IDS_CACHE.get(spaceKey);\n  if (cachedValue !== undefined) {\n    return cachedValue;\n  }\n\n  const digest = await subtleCrypto.digest('SHA-256', spaceKey.asUint8Array() as Uint8Array<ArrayBuffer>);\n\n  const bytes = new Uint8Array(digest).slice(0, SpaceId.byteLength);\n  const spaceId = SpaceId.encode(bytes);\n  SPACE_IDS_CACHE.set(spaceKey, spaceId);\n  return spaceId;\n};\n"],
  "mappings": ";;;;;;;AAIA,SAASA,iBAAiB;AAE1B,SAASC,mBAAmB;;;ACF5B,SAASC,sBAAsB;AAIxB,IAAMC,qBAAqB;AAS3B,IAAMC,qBAAqB,CAACC,WACjC,OAAOA,WAAU,YAAYA,WAAU,QAAQC,OAAOC,KAAKF,MAAAA,EAAOG,WAAW,KAAK,OAAOH,OAAM,GAAA,MAAS;AAEnG,IAAMI,mBAAmBH,OAAOI,OAAO;EAC5CN;;;;;EAKAO,OAAO,CAACN,WAAAA;AACNH,mBAAeE,mBAAmBC,MAAAA,GAAQ,SAAS,mBAAA;AACnD,WAAOA,OAAM,GAAA;EACf;;;;EAIAO,SAAS,CAACC,QAAAA;AACR,WAAO;MAAE,KAAKA;IAAI;EACpB;AACF,CAAA;;;ADiBA,IAAA,eAAaC;;;;;eAMHC,CAAAA,QAAAA;UAEJ,cAAO,IAAA,QAAA,YAAA,IAAA;AACT,QAAA,eAAA,MAAA;AAEA,aAAMC;IACNC;AACA,UAAA,S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OAAOuC,OAAAA,CAAAA;IAC9C;AACA,WAAOI;EACT,CAAA,GACMd,WAAK;IAAE1H,MAAM;EAAS,GAAG,MAAM,CAAA,CAAE,GACjC+H,gBAAU;AAEpB;;;AC7jBO,IAAMU,kBAAkBC,OAAOC,OAAO;;;;EAI3CC,QAAQ;;;;EAKRC,SAAS;AACX,CAAA;;;ACfA,SAASC,oBAAoB;AAC7B,SAASC,WAAWC,eAAe;AACnC,SAASC,kBAAkB;AAE3B,IAAMC,kBAAkB,IAAID,WAA+BF,UAAUI,IAAI;AAMlE,IAAMC,uBAAuB,OAAOC,aAAAA;AACzC,QAAMC,cAAcJ,gBAAgBK,IAAIF,QAAAA;AACxC,MAAIC,gBAAgBE,QAAW;AAC7B,WAAOF;EACT;AAEA,QAAMG,SAAS,MAAMX,aAAaW,OAAO,WAAWJ,SAASK,aAAY,CAAA;AAEzE,QAAMC,QAAQ,IAAIC,WAAWH,MAAAA,EAAQI,MAAM,GAAGb,QAAQc,UAAU;AAChE,QAAMC,UAAUf,QAAQgB,OAAOL,KAAAA;AAC/BT,kBAAgBe,IAAIZ,UAAUU,OAAAA;AAC9B,SAAOA;AACT;",
  "names": ["invariant", "visitValues", "assertArgument", "REFERENCE_TYPE_TAG", "isEncodedReference", "value", "Object", "keys", "length", "EncodedReference", "freeze", "toURI", "fromURI", "uri", "DatabaseDirectory", "rawSpaceKey", "rawKey", "invariant", "getInlineObject", "getLink", "doc", "id", "make", "spaceKey", "objects", "links", "kind", "isDeleted", "getRelationSource", "object", "getRelationTarget", "getParent", "value", "isEncodedReference", "references", "push", "path", "reference", "visitValues", "String", "key", "getTags", "makeObject", "type", "data", "system", "meta", "makeRelation", "source", "target", "deleted", "makeType", "EdgeService", "compositeKey", "isEdgePeerId", "peerId", "spaceId", "automergePrefix", "undefined", "AUTOMERGE_REPLICATOR", "subductionPrefix", "SUBDUCTION_REPLICATOR", "startsWith", "FeedProtocol", "ATTR_META", "EchoFeedCodec", "TextEncoder", "TextDecoder", "encode", "value", "prepared", "JSON", "stringify", "decode", "data", "position", "decoded", "parse", "undefined", "obj", "structuredClone", "meta", "keys", "some", "key", "source", "KEY_QUEUE_POSITION", "filter", "i", "length", "splice", "push", "id", "toString", "Schema", "SchemaAST", "ForeignKey_", "Struct", "source", "String", "id", "annotations", "IdentifierAnnotationId", "ForeignKey", "Match", "Schema", "EID", "EntityId", "URI", "TypenameSpecifier", "Union", "URI", "Schema", "Null", "FilterObject_", "Struct", "type", "Literal", "typename", "id", "optional", "Array", "EntityId", "props", "Record", "key", "String", "annotations", "description", "value", "suspend", "Filter", "foreignKeys", "ForeignKey", "metaKey", "metaVersion", "FilterObject", "FilterCompare_", "operator", "Unknown", "FilterCompare", "FilterIn_", "values", "Any", "FilterIn", "FilterContains_", "FilterContains", "FilterTag_", "tag", "FilterTag", "FilterRange_", "from", "to", "FilterRange", "FilterTimestamp_", "field", "Number", "FilterTimestamp", "FilterTextSearch_", "text", "searchKind", "FilterTextSearch", "FilterNot_", "filter", "FilterNot", "FilterAnd_", "filters", "FilterAnd", "FilterOr_", "FilterOr", "FilterChildOf_", "parents", "EID", "transitive", "Boolean", "FilterChildOf", "identifier", "QuerySelectClause_", "QuerySelectClause", "QueryFilterClause_", "selection", "Query", "QueryFilterClause", "QueryReferenceTraversalClause_", "anchor", "property", "QueryReferenceTraversalClause", "QueryIncomingReferencesClause_", "NullOr", "QueryIncomingReferencesClause", "QueryRelationClause_", "direction", "QueryRelationClause", "QueryRelationTraversalClause_", "QueryRelationTraversalClause", "QueryHierarchyTraversalClause_", "QueryHierarchyTraversalClause", "QueryUnionClause_", "queries", "QueryUnionClause", "QuerySetDifferenceClause_", "source", "exclude", "QuerySetDifferenceClause", "OrderDirection", "Order_", "kind", "Order", "QueryOrderClause_", "query", "order", "QueryOrderClause", "QueryOptionsClause_", "options", "QueryOptions", "QueryOptionsClause", "QueryLimitClause_", "limit", "QueryLimitClause", "QueryFromClause_", "TaggedStruct", "scopes", "Scope", "QueryFromClause", "Query_", "deleted", "debugLabel", "SpaceScope", "spaceId", "includeAllFeeds", "FeedScope", "feedUri", "RegistryScope", "location", "visit", "visitor", "Match", "pipe", "when", "forEach", "q", "node", "_tag", "exhaustive", "map", "mapper", "mapped", "fold", "reducer", "withReturnType", "flatMap", "concat", "results", "SpaceDocVersion", "Object", "freeze", "LEGACY", "CURRENT", "subtleCrypto", "PublicKey", "SpaceId", "ComplexMap", "SPACE_IDS_CACHE", "hash", "createIdFromSpaceKey", "spaceKey", "cachedValue", "get", "undefined", "digest", "asUint8Array", "bytes", "Uint8Array", "slice", "byteLength", "spaceId", "encode", "set"]
}
