@dxos/echo 0.8.2-main.fbd8ed0 → 0.8.2-staging.4d6ad0f

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.
Files changed (44) hide show
  1. package/README.md +116 -0
  2. package/dist/lib/browser/index.mjs +224 -65
  3. package/dist/lib/browser/index.mjs.map +4 -4
  4. package/dist/lib/browser/meta.json +1 -1
  5. package/dist/lib/node/index.cjs +223 -60
  6. package/dist/lib/node/index.cjs.map +4 -4
  7. package/dist/lib/node/meta.json +1 -1
  8. package/dist/lib/node-esm/index.mjs +224 -65
  9. package/dist/lib/node-esm/index.mjs.map +4 -4
  10. package/dist/lib/node-esm/meta.json +1 -1
  11. package/dist/types/src/Obj.d.ts +39 -0
  12. package/dist/types/src/Obj.d.ts.map +1 -0
  13. package/dist/types/src/Ref.d.ts +11 -0
  14. package/dist/types/src/Ref.d.ts.map +1 -0
  15. package/dist/types/src/Relation.d.ts +19 -0
  16. package/dist/types/src/Relation.d.ts.map +1 -0
  17. package/dist/types/src/Type.d.ts +87 -0
  18. package/dist/types/src/Type.d.ts.map +1 -0
  19. package/dist/types/src/index.d.ts +6 -3
  20. package/dist/types/src/index.d.ts.map +1 -1
  21. package/dist/types/src/{type → test}/api.test.d.ts.map +1 -1
  22. package/package.json +13 -14
  23. package/src/Obj.ts +86 -0
  24. package/src/Ref.ts +21 -0
  25. package/src/Relation.ts +45 -0
  26. package/src/Type.ts +127 -0
  27. package/src/index.ts +6 -3
  28. package/src/{type → test}/api.test.ts +14 -14
  29. package/dist/types/src/type/Obj.d.ts +0 -12
  30. package/dist/types/src/type/Obj.d.ts.map +0 -1
  31. package/dist/types/src/type/Ref.d.ts +0 -3
  32. package/dist/types/src/type/Ref.d.ts.map +0 -1
  33. package/dist/types/src/type/Relation.d.ts +0 -16
  34. package/dist/types/src/type/Relation.d.ts.map +0 -1
  35. package/dist/types/src/type/Type.d.ts +0 -77
  36. package/dist/types/src/type/Type.d.ts.map +0 -1
  37. package/dist/types/src/type/index.d.ts +0 -5
  38. package/dist/types/src/type/index.d.ts.map +0 -1
  39. package/src/type/Obj.ts +0 -18
  40. package/src/type/Ref.ts +0 -7
  41. package/src/type/Relation.ts +0 -17
  42. package/src/type/Type.ts +0 -134
  43. package/src/type/index.ts +0 -8
  44. /package/dist/types/src/{type → test}/api.test.d.ts +0 -0
package/README.md CHANGED
@@ -19,3 +19,119 @@ pnpm i @dxos/echo
19
19
  Your ideas, issues, and code are most welcome. Please take a look at our [community code of conduct](https://github.com/dxos/dxos/blob/main/CODE_OF_CONDUCT.md), the [issue guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-issues), and the [PR contribution guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-prs).
20
20
 
21
21
  License: [MIT](./LICENSE) Copyright 2022 © DXOS
22
+
23
+ ## API
24
+
25
+ ```ts
26
+ import { Type, Obj, Relation, Ref, Query, Filter } from '@dxos/echo';
27
+ ```
28
+
29
+ | | Object | Relation | Ref |
30
+ | ----------------------------- | ------------------------------- | ------------------------------------------- | --------------- |
31
+ | **SCHEMA API** |
32
+ | Define schema | `Type.Obj()` | `Type.Relation()` | `Type.Ref()` |
33
+ | Any schema type | `Type.Obj.Any` | `Type.Relation.Any` | `Type.Ref.Any` |
34
+ | Get DXN (of schema) | `Type.getDXN(schema)` | `Type.getDXN(schema)` | |
35
+ | Get typename (of schema) | `Type.getTypename(schema)` | `Type.getTypename(schema)` | |
36
+ | Get type metadata (of schema) | `Type.getMeta(schema)` | `Type.getMeta(schema)` | |
37
+ | Is mutable schema | `Type.isMutable(schema)` | `Type.isMutable(schema)` |
38
+ | **DATA API** |
39
+ | Any instance type | `Obj.Any` | `Relation.Any` | `Ref.Any` |
40
+ | Create object | `Obj.make(Schema, { ... })` | `Relation.make(Schema, { ... })` | `Ref.make(obj)` |
41
+ | Check kind | `Obj.isObject(x): x is Obj.Any` | `Relation.isRelation(x): x is Relation.Any` | `Ref.isRef(x)` |
42
+ | Check instance of | `Obj.instanceOf(Schema, obj)` | `Obj.instanceOf(Schema, rel)` | |
43
+ | Get schema | `Obj.getSchema(obj)` | `Obj.getSchema(obj)` | |
44
+ | Get DXN (of instance) | `Obj.getDXN(obj)` | `Obj.getDXN(obj)` | |
45
+ | Get typename (of instance) | `Obj.getTypename(obj)` | `Obj.getTypename(obj)` | |
46
+ | Get Meta | `Obj.getMeta(obj)` | `Obj.getMeta(relation)` | |
47
+ | Is deleted | `Obj.isDeleted(obj)` | `Obj.isDeleted(obj)` | |
48
+ | Get relation source | | `Relation.getSource(relation)` |
49
+ | Get relation target | | `Relation.getTarget(relation)` | |
50
+ | Expando | `Expando` |
51
+
52
+ ```ts
53
+ Type.getDXN(schema) == DXN.parse('dxn:type:example.com/type/Person:0.1.0');
54
+ Type.getMeta(schema) == { typename: }
55
+ Type.getTypename(schema) === 'example.com/type/Person'
56
+ Type.getVersion(schema) === '0.1.0'
57
+
58
+ Obj.getDXN(obj) === DXN.parse('dxn:echo:SSSSSSSSSS:XXXXXXXXXXXXX')
59
+
60
+ // We need this for objects that have typename defined, but their schema can't be resolved (Obj.getSchema(obj) === undefined)
61
+ Obj.getSchemaDXN(obj) === DXN.parse('dxn:type:example.com/type/Person:0.1.0');
62
+
63
+ /**
64
+ * @deprecated
65
+ **/
66
+ // TODO(dmaretskyi): Consider keeping it as a shorthand for zType.getTypename(Obj.getSchema(obj)) ?? Obj.getSchemaDXN(obj)?.asTypeDXN()?.type`
67
+ Obj.getTypename(obj) === 'example.com/type/Person'
68
+ ```
69
+
70
+ ISSUE: Create vs live: Is it fundamentally the same thing?
71
+
72
+ ## Object construction
73
+
74
+ Option 1:
75
+
76
+ ```ts
77
+ Relation.make(EmployeeOf, {
78
+ [Relation.Source]: cyberdyne,
79
+ [Relation.Target]: bill,
80
+ [Obj.Meta]: {
81
+ keys: [{ url: 'acme.com', id: '123' }],
82
+ },
83
+ since: '2022',
84
+ });
85
+ ```
86
+
87
+ Option 2:
88
+
89
+ ```ts
90
+ Obj.make(Contact, {
91
+ name: 'Bill',
92
+ });
93
+
94
+ Relation.make(
95
+ Employee,
96
+ {
97
+ source: cyberdyne,
98
+ target: bill,
99
+ meta: {
100
+ keys: [{ url: 'acme.com', id: '123' }],
101
+ },
102
+ },
103
+ {
104
+ since: '2022',
105
+ },
106
+ );
107
+ ```
108
+
109
+ ## Object model representation.
110
+
111
+ ### JSON serialization
112
+
113
+ ```ts
114
+ Obj.toJSON(obj);
115
+ Obj.fromJSON(json, { graph, db });
116
+ ```
117
+
118
+ Defines attributes and encoding placed on objects.
119
+
120
+ | | Optional | Runtime prop | Runtime type | JSON prop | JSON type | Description |
121
+ | ---------------- | ---------------------- | ----------------------------------- | ---------------------- | --------------------------- | --------- | ------------------------------------ |
122
+ | Id | No | `id` | `ObjectID` ULID string | `id` | string | Unique object ID |
123
+ | Self DXN | Yes | `Symbol(@dxos/echo/Self)` | `DXN` | `@self` | string | DXN to the object itself |
124
+ | Typename | No | `Symbol(@dxos/echo/Typename)` | `DXN` | `@type` | string | DXN to the object type |
125
+ | Tombstone marker | Yes | `Symbol(@dxos/echo/Deleted)` | `boolean` | `@deleted` | boolean | Deletion marker |
126
+ | Metadata | Yes | `Symbol(@dxos/echo/Meta)` | Metadata object | `@meta` | object | Metadata section |
127
+ | Entity kind | No | `Symbol(@dxos/echo/EntityKind)` | `EntityKind` | (inferred from other props) | string | Obj vs Relation |
128
+ | Relation Source | No (only on relations) | `Symbol(@dxos/echo/RelationSource)` | `DXN` | `@relationSource` | string | Relation source DXN |
129
+ | Relation Target | No (only on relations) | `Symbol(@dxos/echo/RelationTarget)` | `DXN` | `@relationTarget` | string | Relation target DXN |
130
+ | Hypergraph | Yes | `Symbol(@dxos/echo/Hypergraph)` | `Hypergraph` | - | - | Pointer to runtime hypergraph object |
131
+ | Database | Yes | `Symbol(@dxos/echo/Database)` | `Database` | - | - | Pointer to runtime database object |
132
+
133
+ ### Value representation
134
+
135
+ | | Runtime | JSON |
136
+ | --------- | ------- | -------------------- |
137
+ | Reference | `Ref` | `{ "/": "dxn:..." }` |
@@ -5,93 +5,252 @@ var __export = (target, all) => {
5
5
  __defProp(target, name, { get: all[name], enumerable: true });
6
6
  };
7
7
 
8
- // packages/core/echo/echo/src/index.ts
9
- import { Format, FormatEnum } from "@dxos/echo-schema";
10
- import { DXN } from "@dxos/keys";
11
-
12
- // packages/core/echo/echo/src/type/Obj.ts
13
- var Obj_exports = {};
14
- __export(Obj_exports, {
15
- create: () => create,
16
- getSchema: () => getSchema
17
- });
18
- import { getSchema as getSchema$ } from "@dxos/echo-schema";
19
- import { live as live$ } from "@dxos/live-object";
20
- var create = live$;
21
- var getSchema = getSchema$;
22
-
23
- // packages/core/echo/echo/src/type/Ref.ts
24
- var Ref_exports = {};
25
- __export(Ref_exports, {
26
- make: () => make
27
- });
28
- import { Ref as Ref$ } from "@dxos/echo-schema";
29
- var make = Ref$.make;
30
-
31
- // packages/core/echo/echo/src/type/Relation.ts
32
- var Relation_exports = {};
33
- __export(Relation_exports, {
34
- def: () => def
35
- });
36
- import { EchoRelation } from "@dxos/echo-schema";
37
- var def = EchoRelation;
38
-
39
- // packages/core/echo/echo/src/type/Type.ts
8
+ // packages/core/echo/echo/src/Type.ts
40
9
  var Type_exports = {};
41
10
  __export(Type_exports, {
11
+ DXN: () => DXN,
42
12
  Expando: () => Expando,
43
- Kind: () => Kind,
13
+ Format: () => Format,
14
+ JsonSchema: () => JsonSchemaType,
15
+ Kind: () => EntityKind,
16
+ Obj: () => Obj,
44
17
  ObjectId: () => ObjectId,
45
- Ref: () => Ref,
18
+ Ref: () => Ref2,
19
+ Relation: () => Relation,
46
20
  SpaceId: () => SpaceId,
47
- create: () => create2,
48
- def: () => def2,
49
21
  getDXN: () => getDXN,
50
22
  getMeta: () => getMeta,
51
- getSchema: () => getSchema2,
52
23
  getTypename: () => getTypename,
53
24
  getVersion: () => getVersion,
54
- instanceOf: () => instanceOf,
55
- isMutable: () => isMutable,
25
+ isMutable: () => isMutable2,
56
26
  toJsonSchema: () => toJsonSchema
57
27
  });
58
- import { EchoObject, EntityKind, Expando as Expando$, ObjectId as ObjectId$, Ref as Ref$2, getTypeAnnotation, getSchema as getSchema$2, getSchemaDXN, getSchemaTypename, getSchemaVersion, isInstanceOf, isMutable as isMutable$, toJsonSchema as toJsonSchema$ } from "@dxos/echo-schema";
28
+ import * as EchoSchema from "@dxos/echo-schema";
59
29
  import { invariant } from "@dxos/invariant";
60
- import { SpaceId as SpaceId$ } from "@dxos/keys";
61
- import { live as live$2 } from "@dxos/live-object";
62
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/echo/echo/src/type/Type.ts";
63
- var SpaceId = SpaceId$;
64
- var ObjectId = ObjectId$;
65
- var Ref = (self) => Ref$2(self);
66
- var Kind = EntityKind;
67
- var Expando = Expando$;
68
- var def2 = (meta) => EchoObject(meta);
69
- var create2 = live$2;
70
- var getSchema2 = getSchema$2;
71
- var instanceOf = isInstanceOf;
72
- var getDXN = getSchemaDXN;
73
- var getMeta = getTypeAnnotation;
30
+ import { EntityKind } from "@dxos/echo-schema";
31
+ import { SpaceId, ObjectId, DXN } from "@dxos/keys";
32
+ import {
33
+ Expando,
34
+ JsonSchemaType,
35
+ toJsonSchema,
36
+ Format
37
+ } from "@dxos/echo-schema";
38
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/echo/echo/src/Type.ts";
39
+ var Obj = EchoSchema.EchoObject;
40
+ var Relation = EchoSchema.EchoRelation;
41
+ var Ref2 = EchoSchema.Ref;
42
+ var getDXN = (schema) => {
43
+ return EchoSchema.getSchemaDXN(schema);
44
+ };
74
45
  var getTypename = (schema) => {
75
- const typename = getSchemaTypename(schema);
76
- invariant(typename, "Invalid object", {
46
+ const typename = EchoSchema.getSchemaTypename(schema);
47
+ invariant(typeof typename === "string" && !typename.startsWith("dxn:"), "Invalid typename", {
77
48
  F: __dxlog_file,
78
- L: 129,
49
+ L: 84,
79
50
  S: void 0,
80
51
  A: [
81
- "typename",
82
- "'Invalid object'"
52
+ "typeof typename === 'string' && !typename.startsWith('dxn:')",
53
+ "'Invalid typename'"
83
54
  ]
84
55
  });
85
56
  return typename;
86
57
  };
87
- var getVersion = getSchemaVersion;
88
- var isMutable = isMutable$;
89
- var toJsonSchema = toJsonSchema$;
58
+ var getVersion = (schema) => {
59
+ const version = EchoSchema.getSchemaVersion(schema);
60
+ invariant(typeof version === "string" && version.match(/^\d+\.\d+\.\d+$/), "Invalid version", {
61
+ F: __dxlog_file,
62
+ L: 94,
63
+ S: void 0,
64
+ A: [
65
+ "typeof version === 'string' && version.match(/^\\d+\\.\\d+\\.\\d+$/)",
66
+ "'Invalid version'"
67
+ ]
68
+ });
69
+ return version;
70
+ };
71
+ var getMeta = (schema) => {
72
+ return EchoSchema.getTypeAnnotation(schema);
73
+ };
74
+ var isMutable2 = (schema) => {
75
+ return EchoSchema.isMutable(schema);
76
+ };
77
+
78
+ // packages/core/echo/echo/src/Obj.ts
79
+ var Obj_exports = {};
80
+ __export(Obj_exports, {
81
+ getDXN: () => getDXN3,
82
+ getMeta: () => getMeta3,
83
+ getSchema: () => getSchema2,
84
+ getSchemaDXN: () => getSchemaDXN2,
85
+ getTypename: () => getTypename3,
86
+ instanceOf: () => instanceOf,
87
+ isDeleted: () => isDeleted2,
88
+ isObject: () => isObject,
89
+ make: () => make
90
+ });
91
+ import { Schema } from "effect";
92
+ import * as EchoSchema2 from "@dxos/echo-schema";
93
+ import { assertArgument, invariant as invariant2 } from "@dxos/invariant";
94
+ import * as LiveObject from "@dxos/live-object";
95
+ var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/core/echo/echo/src/Obj.ts";
96
+ var make = LiveObject.live;
97
+ var isObject = (obj) => {
98
+ return LiveObject.isLiveObject(obj);
99
+ };
100
+ var instanceOf = (...args) => {
101
+ if (args.length === 1) {
102
+ return (obj) => EchoSchema2.isInstanceOf(args[0], obj);
103
+ }
104
+ return EchoSchema2.isInstanceOf(args[0], args[1]);
105
+ };
106
+ var getSchema2 = EchoSchema2.getSchema;
107
+ var getDXN3 = (obj) => {
108
+ assertArgument(!Schema.isSchema(obj), "Object should not be a schema.");
109
+ const dxn = EchoSchema2.getDXN(obj);
110
+ invariant2(dxn != null, "Invalid object.", {
111
+ F: __dxlog_file2,
112
+ L: 48,
113
+ S: void 0,
114
+ A: [
115
+ "dxn != null",
116
+ "'Invalid object.'"
117
+ ]
118
+ });
119
+ return dxn;
120
+ };
121
+ var getSchemaDXN2 = (obj) => {
122
+ const type = EchoSchema2.getType(obj);
123
+ invariant2(type != null, "Invalid object.", {
124
+ F: __dxlog_file2,
125
+ L: 58,
126
+ S: void 0,
127
+ A: [
128
+ "type != null",
129
+ "'Invalid object.'"
130
+ ]
131
+ });
132
+ return type;
133
+ };
134
+ var getTypename3 = (obj) => {
135
+ const schema = getSchema2(obj);
136
+ if (schema == null) {
137
+ return getSchemaDXN2(obj)?.asTypeDXN()?.type;
138
+ }
139
+ return EchoSchema2.getTypename(schema);
140
+ };
141
+ var getMeta3 = (obj) => {
142
+ const meta = EchoSchema2.getMeta(obj);
143
+ invariant2(meta != null, "Invalid object.", {
144
+ F: __dxlog_file2,
145
+ L: 78,
146
+ S: void 0,
147
+ A: [
148
+ "meta != null",
149
+ "'Invalid object.'"
150
+ ]
151
+ });
152
+ return meta;
153
+ };
154
+ var isDeleted2 = (obj) => {
155
+ const deleted = EchoSchema2.isDeleted(obj);
156
+ invariant2(typeof deleted === "boolean", "Invalid object.", {
157
+ F: __dxlog_file2,
158
+ L: 84,
159
+ S: void 0,
160
+ A: [
161
+ "typeof deleted === 'boolean'",
162
+ "'Invalid object.'"
163
+ ]
164
+ });
165
+ return deleted;
166
+ };
167
+
168
+ // packages/core/echo/echo/src/Relation.ts
169
+ var Relation_exports = {};
170
+ __export(Relation_exports, {
171
+ getSource: () => getSource,
172
+ getTarget: () => getTarget,
173
+ isRelation: () => isRelation,
174
+ make: () => make2
175
+ });
176
+ import * as EchoSchema3 from "@dxos/echo-schema";
177
+ import { invariant as invariant3 } from "@dxos/invariant";
178
+ import * as LiveObject2 from "@dxos/live-object";
179
+ var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/core/echo/echo/src/Relation.ts";
180
+ var make2 = LiveObject2.live;
181
+ var isRelation = (value) => {
182
+ if (typeof value !== "object" || value === null) {
183
+ return false;
184
+ }
185
+ if (EchoSchema3.ATTR_RELATION_SOURCE in value || EchoSchema3.ATTR_RELATION_TARGET in value) {
186
+ return true;
187
+ }
188
+ const kind = value[EchoSchema3.EntityKindPropertyId];
189
+ return kind === EchoSchema3.EntityKind.Relation;
190
+ };
191
+ var getSource = (relation) => {
192
+ invariant3(isRelation(relation), void 0, {
193
+ F: __dxlog_file3,
194
+ L: 30,
195
+ S: void 0,
196
+ A: [
197
+ "isRelation(relation)",
198
+ ""
199
+ ]
200
+ });
201
+ const obj = relation[EchoSchema3.RelationSourceId];
202
+ invariant3(obj !== void 0, `Invalid source: ${relation.id}`, {
203
+ F: __dxlog_file3,
204
+ L: 32,
205
+ S: void 0,
206
+ A: [
207
+ "obj !== undefined",
208
+ "`Invalid source: ${relation.id}`"
209
+ ]
210
+ });
211
+ return obj;
212
+ };
213
+ var getTarget = (relation) => {
214
+ invariant3(isRelation(relation), void 0, {
215
+ F: __dxlog_file3,
216
+ L: 41,
217
+ S: void 0,
218
+ A: [
219
+ "isRelation(relation)",
220
+ ""
221
+ ]
222
+ });
223
+ const obj = relation[EchoSchema3.RelationTargetId];
224
+ invariant3(obj !== void 0, `Invalid target: ${relation.id}`, {
225
+ F: __dxlog_file3,
226
+ L: 43,
227
+ S: void 0,
228
+ A: [
229
+ "obj !== undefined",
230
+ "`Invalid target: ${relation.id}`"
231
+ ]
232
+ });
233
+ return obj;
234
+ };
235
+
236
+ // packages/core/echo/echo/src/Ref.ts
237
+ var Ref_exports = {};
238
+ __export(Ref_exports, {
239
+ fromDXN: () => fromDXN,
240
+ isRef: () => isRef,
241
+ make: () => make3
242
+ });
243
+ import * as EchoSchema4 from "@dxos/echo-schema";
244
+ var make3 = EchoSchema4.Ref.make;
245
+ var isRef = EchoSchema4.Ref.isRef;
246
+ var fromDXN = EchoSchema4.Ref.fromDXN;
247
+
248
+ // packages/core/echo/echo/src/index.ts
249
+ import { Filter, Query } from "@dxos/echo-schema";
90
250
  export {
91
- DXN,
92
- Format,
93
- FormatEnum,
251
+ Filter,
94
252
  Obj_exports as Obj,
253
+ Query,
95
254
  Ref_exports as Ref,
96
255
  Relation_exports as Relation,
97
256
  Type_exports as Type
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/index.ts", "../../../src/type/Obj.ts", "../../../src/type/Ref.ts", "../../../src/type/Relation.ts", "../../../src/type/Type.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nexport { Format, FormatEnum } from '@dxos/echo-schema';\nexport { DXN } from '@dxos/keys';\n\nexport * from './type';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type AnyLiveObject as AnyLiveObject$ } from '@dxos/echo-db';\nimport { type BaseEchoObject, type BaseObject, getSchema as getSchema$ } from '@dxos/echo-schema';\nimport { live as live$ } from '@dxos/live-object';\n\n// TODO(burdon): Remove from Type?\n\nexport declare namespace Obj {\n export type Any = BaseEchoObject;\n export type Live<T extends BaseObject> = AnyLiveObject$<T>;\n}\n\nexport const create = live$;\n\nexport const getSchema = getSchema$;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Ref as Ref$ } from '@dxos/echo-schema';\n\nexport const make = Ref$.make;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { EchoRelation, type RelationSourceTargetRefs } from '@dxos/echo-schema';\n\nexport const def = EchoRelation;\n\n/**\n * Get relation target type.\n */\nexport type Target<A> = A extends RelationSourceTargetRefs<infer T, infer _S> ? T : never;\n\n/**\n * Get relation source type.\n */\nexport type Source<A> = A extends RelationSourceTargetRefs<infer _T, infer S> ? S : never;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Schema } from 'effect';\n\nimport { type AnyLiveObject as AnyLiveObject$ } from '@dxos/echo-db';\nimport {\n type BaseEchoObject,\n type BaseObject,\n type BaseSchema,\n type EchoSchema,\n EchoObject,\n EntityKind,\n Expando as Expando$,\n type ImmutableSchema,\n type JsonSchemaType,\n ObjectId as ObjectId$,\n Ref as Ref$,\n type StoredSchema,\n type TypeMeta,\n getTypeAnnotation,\n getSchema as getSchema$,\n getSchemaDXN,\n getSchemaTypename,\n getSchemaVersion,\n isInstanceOf,\n isMutable as isMutable$,\n toJsonSchema as toJsonSchema$,\n} from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport { SpaceId as SpaceId$ } from '@dxos/keys';\nimport { live as live$ } from '@dxos/live-object';\n\n/**\n * Type System API.\n *\n * @category api namespace\n * @since 0.9.0\n */\n\n//\n// Keys\n//\n\nexport const SpaceId = SpaceId$;\nexport type SpaceId = SpaceId$;\n\nexport const ObjectId = ObjectId$;\nexport type ObjectId = ObjectId$;\n\n/**\n * Defines a reference to an ECHO object.\n *\n * @example\n * ```ts\n * import { Type } from '@dxos/echo';\n * const Person = Schema.Struct({\n * name: Schema.String,\n * organization: Type.Ref(Organization),\n * }).pipe(Type.def({\n * typename: 'example.com/type/Person',\n * version: '0.1.0',\n * }));\n * ```\n */\nexport const Ref = <S extends Schema.Schema.AnyNoContext>(self: S) => Ref$<Schema.Schema.Type<S>>(self);\n\n//\n// Objects\n//\n\nexport const Kind = EntityKind;\nexport type AnyObject = BaseEchoObject;\nexport type AnyLiveObject<T extends BaseObject> = AnyLiveObject$<T>;\n\n//\n// Schema\n//\n\nexport type JsonSchema = JsonSchemaType;\n\n/**\n * A schema that can be extended with arbitrary properties.\n */\nexport const Expando = Expando$;\nexport type Expando = Expando$;\n\n// TODO(burdon): Review/remove.\nexport type Abstract<T = any> = BaseSchema<T>;\nexport type ImmutableType<T> = ImmutableSchema<T>;\nexport type MutableType<T> = EchoSchema<T>;\nexport type StoredType = StoredSchema;\n\n/**\n * Defines an ECHO type.\n *\n * @example\n * ```ts\n * import { Type } from '@dxos/echo';\n * const Organization = Schema.Struct({\n * name: Schema.String,\n * }).pipe(Type.def({\n * typename: 'example.com/type/Organization',\n * version: '0.1.0',\n * }));\n * ```\n */\nexport const def = (meta: TypeMeta) => EchoObject(meta);\n\n//\n// Object utils\n//\n\nexport const create = live$;\n\nexport const getSchema = getSchema$;\nexport const instanceOf = isInstanceOf;\n\n//\n// Type utils\n//\n\n// TODO(burdon): Reconcile getDXN and getTypename.\nexport const getDXN = getSchemaDXN;\nexport const getMeta = getTypeAnnotation;\nexport const getTypename = (schema: Schema.Schema.AnyNoContext): string => {\n const typename = getSchemaTypename(schema);\n invariant(typename, 'Invalid object');\n return typename;\n};\nexport const getVersion = getSchemaVersion;\nexport const isMutable = isMutable$;\nexport const toJsonSchema = toJsonSchema$;\n"],
5
- "mappings": ";;;;;;;;AAIA,SAASA,QAAQC,kBAAkB;AACnC,SAASC,WAAW;;;ACLpB;;;;;AAKA,SAA+CC,aAAaC,kBAAkB;AAC9E,SAASC,QAAQC,aAAa;AASvB,IAAMC,SAASC;AAEf,IAAMC,YAAYC;;;ACjBzB;;;;AAIA,SAASC,OAAOC,YAAY;AAErB,IAAMC,OAAOC,KAAKD;;;ACNzB;;;;AAIA,SAASE,oBAAmD;AAErD,IAAMC,MAAMC;;;ACNnB;;;;;;;gBAAAC;EAAA,WAAAC;EAAA;;mBAAAC;EAAA;;;;;;AAOA,SAKEC,YACAC,YACAC,WAAWC,UAGXC,YAAYC,WACZC,OAAOC,OAGPC,mBACAT,aAAaU,aACbC,cACAC,mBACAC,kBACAC,cACAC,aAAaC,YACbC,gBAAgBC,qBACX;AACP,SAASC,iBAAiB;AAC1B,SAASC,WAAWC,gBAAgB;AACpC,SAASC,QAAQC,cAAa;;AAavB,IAAMH,UAAUC;AAGhB,IAAMhB,WAAWC;AAkBjB,IAAMC,MAAM,CAAuCiB,SAAYhB,MAA4BgB,IAAAA;AAM3F,IAAMC,OAAOvB;AAab,IAAMC,UAAUC;AAuBhB,IAAML,OAAM,CAAC2B,SAAmBzB,WAAWyB,IAAAA;AAM3C,IAAM5B,UAASyB;AAEf,IAAMvB,aAAYU;AAClB,IAAMiB,aAAab;AAOnB,IAAMc,SAASjB;AACf,IAAMkB,UAAUpB;AAChB,IAAMqB,cAAc,CAACC,WAAAA;AAC1B,QAAMC,WAAWpB,kBAAkBmB,MAAAA;AACnCZ,YAAUa,UAAU,kBAAA;;;;;;;;;AACpB,SAAOA;AACT;AACO,IAAMC,aAAapB;AACnB,IAAME,YAAYC;AAClB,IAAMC,eAAeC;",
6
- "names": ["Format", "FormatEnum", "DXN", "getSchema", "getSchema$", "live", "live$", "create", "live$", "getSchema", "getSchema$", "Ref", "Ref$", "make", "Ref$", "EchoRelation", "def", "EchoRelation", "create", "def", "getSchema", "EchoObject", "EntityKind", "Expando", "Expando$", "ObjectId", "ObjectId$", "Ref", "Ref$", "getTypeAnnotation", "getSchema$", "getSchemaDXN", "getSchemaTypename", "getSchemaVersion", "isInstanceOf", "isMutable", "isMutable$", "toJsonSchema", "toJsonSchema$", "invariant", "SpaceId", "SpaceId$", "live", "live$", "self", "Kind", "meta", "instanceOf", "getDXN", "getMeta", "getTypename", "schema", "typename", "getVersion"]
3
+ "sources": ["../../../src/Type.ts", "../../../src/Obj.ts", "../../../src/Relation.ts", "../../../src/Ref.ts", "../../../src/index.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Schema } from 'effect';\n\nimport type { EncodedReference } from '@dxos/echo-protocol';\nimport * as EchoSchema from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport type * as Keys from '@dxos/keys';\n\n/**\n * ECHO schema.\n */\nexport type Schema = EchoSchema.EchoSchema;\n\n/**\n * EchoObject schema.\n */\nexport const Obj = EchoSchema.EchoObject;\n\n/**\n * EchoRelation schema.\n */\nexport const Relation = EchoSchema.EchoRelation;\n\n/**\n * Ref schema.\n */\nexport const Ref: <S extends Obj.Any>(schema: S) => EchoSchema.Ref$<Schema.Schema.Type<S>> = EchoSchema.Ref;\n\nexport namespace Obj {\n /**\n * Type that represents an arbitrary schema type of an object.\n * NOTE: This is not an instance type.\n */\n // TODO(dmaretskyi): If schema was covariant, we could specify props in here, like `id: ObjectId`.\n export type Any = Schema.Schema.AnyNoContext;\n}\n\nexport namespace Relation {\n /**\n * Type that represents an arbitrary schema type of a relation.\n * NOTE: This is not an instance type.\n */\n // TODO(dmaretskyi): If schema was covariant, we could specify props in here, like `id: ObjectId`.\n export type Any = Schema.Schema.AnyNoContext;\n\n /**\n * Get relation target type.\n */\n export type Target<A> = A extends EchoSchema.RelationSourceTargetRefs<infer T, infer _S> ? T : never;\n\n /**\n * Get relation source type.\n */\n export type Source<A> = A extends EchoSchema.RelationSourceTargetRefs<infer _T, infer S> ? S : never;\n}\n\nexport namespace Ref {\n /**\n * Type that represents an arbitrary schema type of a reference.\n * NOTE: This is not an instance type.\n */\n export type Any = Schema.Schema<EchoSchema.Ref<any>, EncodedReference>;\n}\n\n/**\n * Gets the full DXN of the schema.\n * Will include the version if it's a `type` DXN.\n * @example \"dxn:example.com/type/Person:0.1.0\"\n * @example \"dxn:echo:SSSSSSSSSS:XXXXXXXXXXXXX\"\n */\nexport const getDXN = (schema: Obj.Any | Relation.Any): Keys.DXN | undefined => {\n return EchoSchema.getSchemaDXN(schema);\n};\n\n/**\n * @param schema - Schema to get the typename from.\n * @returns The typename of the schema. Example: `example.com/type/Person`.\n */\nexport const getTypename = (schema: Obj.Any | Relation.Any): string => {\n const typename = EchoSchema.getSchemaTypename(schema);\n invariant(typeof typename === 'string' && !typename.startsWith('dxn:'), 'Invalid typename');\n return typename;\n};\n\n/**\n * Gets the version of the schema.\n * @example 0.1.0\n */\nexport const getVersion = (schema: Obj.Any | Relation.Any): string => {\n const version = EchoSchema.getSchemaVersion(schema);\n invariant(typeof version === 'string' && version.match(/^\\d+\\.\\d+\\.\\d+$/), 'Invalid version');\n return version;\n};\n\n/**\n * ECHO type metadata.\n */\nexport type Meta = EchoSchema.TypeAnnotation;\n\n/**\n * Gets the meta data of the schema.\n */\nexport const getMeta = (schema: Obj.Any | Relation.Any): Meta | undefined => {\n return EchoSchema.getTypeAnnotation(schema);\n};\n\nexport { EntityKind as Kind } from '@dxos/echo-schema';\n\n/**\n * @returns True if the schema is mutable.\n */\nexport const isMutable = (schema: Obj.Any | Relation.Any): boolean => {\n return EchoSchema.isMutable(schema);\n};\n\nexport { SpaceId, ObjectId, DXN } from '@dxos/keys';\n\nexport {\n //\n Expando,\n JsonSchemaType as JsonSchema,\n toJsonSchema,\n Format,\n} from '@dxos/echo-schema';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport * as EchoSchema from '@dxos/echo-schema';\nimport { assertArgument, invariant } from '@dxos/invariant';\nimport type { DXN } from '@dxos/keys';\nimport * as LiveObject from '@dxos/live-object';\n\nimport type * as Type from './Type';\n\nexport type Any = EchoSchema.AnyEchoObject;\n\nexport const make = LiveObject.live;\n\n// TODO(dmaretskyi): Currently broken\nexport const isObject = (obj: unknown): obj is Any => {\n return LiveObject.isLiveObject(obj);\n};\n\n/**\n * Check that object or relation is an instance of a schema.\n * @example\n * ```ts\n * const person = Obj.make(Person, { name: 'John' });\n * const isPerson = Obj.instanceOf(Person);\n * isPerson(person); // true\n * ```\n */\nexport const instanceOf: {\n <S extends Type.Relation.Any | Type.Obj.Any>(schema: S): (value: unknown) => value is S;\n <S extends Type.Relation.Any | Type.Obj.Any>(schema: S, value: unknown): value is S;\n} = ((...args: any[]) => {\n if (args.length === 1) {\n return (obj: unknown) => EchoSchema.isInstanceOf(args[0], obj);\n }\n\n return EchoSchema.isInstanceOf(args[0], args[1]);\n}) as any;\n\nexport const getSchema = EchoSchema.getSchema;\n\nexport const getDXN = (obj: Any): DXN => {\n assertArgument(!Schema.isSchema(obj), 'Object should not be a schema.');\n const dxn = EchoSchema.getDXN(obj);\n invariant(dxn != null, 'Invalid object.');\n return dxn;\n};\n\n/**\n * @returns The DXN of the object's type.\n * @example dxn:example.com/type/Contact:1.0.0\n */\nexport const getSchemaDXN = (obj: Any): DXN => {\n const type = EchoSchema.getType(obj);\n invariant(type != null, 'Invalid object.');\n return type;\n};\n\n/**\n * @returns The typename of the object's type.\n * @example `example.com/type/Contact`\n */\nexport const getTypename = (obj: Any): string | undefined => {\n const schema = getSchema(obj);\n if (schema == null) {\n // Try to extract typename from DXN.\n return getSchemaDXN(obj)?.asTypeDXN()?.type;\n }\n\n return EchoSchema.getTypename(schema);\n};\n\nexport const getMeta = (obj: Any): EchoSchema.ObjectMeta => {\n const meta = EchoSchema.getMeta(obj);\n invariant(meta != null, 'Invalid object.');\n return meta;\n};\n\nexport const isDeleted = (obj: Any): boolean => {\n const deleted = EchoSchema.isDeleted(obj);\n invariant(typeof deleted === 'boolean', 'Invalid object.');\n return deleted;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as EchoSchema from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport * as LiveObject from '@dxos/live-object';\n\nexport type Any = EchoSchema.AnyEchoObject & EchoSchema.RelationSourceTargetRefs;\n\nexport const make = LiveObject.live;\n\nexport const isRelation = (value: unknown): value is Any => {\n if (typeof value !== 'object' || value === null) {\n return false;\n }\n if (EchoSchema.ATTR_RELATION_SOURCE in value || EchoSchema.ATTR_RELATION_TARGET in value) {\n return true;\n }\n\n const kind = (value as any)[EchoSchema.EntityKindPropertyId];\n return kind === EchoSchema.EntityKind.Relation;\n};\n\n/**\n * @returns Relation source.\n * @throws If the object is not a relation.\n */\nexport const getSource = <T extends Any>(relation: T): EchoSchema.RelationSource<T> => {\n invariant(isRelation(relation));\n const obj = relation[EchoSchema.RelationSourceId];\n invariant(obj !== undefined, `Invalid source: ${relation.id}`);\n return obj;\n};\n\n/**\n * @returns Relation target.\n * @throws If the object is not a relation.\n */\nexport const getTarget = <T extends Any>(relation: T): EchoSchema.RelationTarget<T> => {\n invariant(isRelation(relation));\n const obj = relation[EchoSchema.RelationTargetId];\n invariant(obj !== undefined, `Invalid target: ${relation.id}`);\n return obj;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as EchoSchema from '@dxos/echo-schema';\n\nimport type * as Obj from './Obj';\n\nexport type Any = EchoSchema.Ref<Obj.Any>;\n\nexport const make = EchoSchema.Ref.make;\n\nexport const isRef: (value: unknown) => value is Any = EchoSchema.Ref.isRef;\n\n// TODO(dmaretskyi): Consider just allowing `make` to accept DXN.\nexport const fromDXN = EchoSchema.Ref.fromDXN;\n\n/**\n * Extract reference target.\n */\nexport type Target<R extends Any> = R extends EchoSchema.Ref<infer T> ? T : never;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nexport * as Type from './Type';\nexport * as Obj from './Obj';\nexport * as Relation from './Relation';\nexport * as Ref from './Ref';\n\nexport { type Live } from '@dxos/live-object';\nexport { Filter, Query } from '@dxos/echo-schema';\n"],
5
+ "mappings": ";;;;;;;;AAAA;;;;;;;;;aAAAA;EAAA;;;;;;mBAAAC;EAAA;;AAOA,YAAYC,gBAAgB;AAC5B,SAASC,iBAAiB;AAqG1B,SAAuBC,kBAAY;AASnC,SAASC,SAASC,UAAUC,WAAW;AAEvC;EAEEC;EACkBC;EAClBC;EACAC;OACK;;AA3GA,IAAMC,MAAiBC;AAKvB,IAAMC,WAAsBC;AAK5B,IAAMf,OAA2FA;AA4CjG,IAAMgB,SAAS,CAACC,WAAAA;AACrB,SAAkBC,wBAAaD,MAAAA;AACjC;AAMO,IAAME,cAAc,CAACF,WAAAA;AAC1B,QAAMG,WAAsBC,6BAAkBJ,MAAAA;AAC9Cd,YAAU,OAAOiB,aAAa,YAAY,CAACA,SAASE,WAAW,MAAA,GAAS,oBAAA;;;;;;;;;AACxE,SAAOF;AACT;AAMO,IAAMG,aAAa,CAACN,WAAAA;AACzB,QAAMO,UAAqBC,4BAAiBR,MAAAA;AAC5Cd,YAAU,OAAOqB,YAAY,YAAYA,QAAQE,MAAM,iBAAA,GAAoB,mBAAA;;;;;;;;;AAC3E,SAAOF;AACT;AAUO,IAAMG,UAAU,CAACV,WAAAA;AACtB,SAAkBW,6BAAkBX,MAAAA;AACtC;AAOO,IAAMhB,aAAY,CAACgB,WAAAA;AACxB,SAAkBhB,qBAAUgB,MAAAA;AAC9B;;;ACpHA;;gBAAAY;EAAA,eAAAC;EAAA,iBAAAC;EAAA,oBAAAC;EAAA,mBAAAC;EAAA;mBAAAC;EAAA;;;AAIA,SAASC,cAAc;AAEvB,YAAYC,iBAAgB;AAC5B,SAASC,gBAAgBC,aAAAA,kBAAiB;AAE1C,YAAYC,gBAAgB;;AAMrB,IAAMC,OAAkBC;AAGxB,IAAMC,WAAW,CAACC,QAAAA;AACvB,SAAkBC,wBAAaD,GAAAA;AACjC;AAWO,IAAME,aAGR,IAAIC,SAAAA;AACP,MAAIA,KAAKC,WAAW,GAAG;AACrB,WAAO,CAACJ,QAA4BK,yBAAaF,KAAK,CAAA,GAAIH,GAAAA;EAC5D;AAEA,SAAkBK,yBAAaF,KAAK,CAAA,GAAIA,KAAK,CAAA,CAAE;AACjD;AAEO,IAAMf,aAAuBA;AAE7B,IAAMF,UAAS,CAACc,QAAAA;AACrBN,iBAAe,CAACF,OAAOc,SAASN,GAAAA,GAAM,gCAAA;AACtC,QAAMO,MAAiBrB,mBAAOc,GAAAA;AAC9BL,EAAAA,WAAUY,OAAO,MAAM,mBAAA;;;;;;;;;AACvB,SAAOA;AACT;AAMO,IAAMlB,gBAAe,CAACW,QAAAA;AAC3B,QAAMQ,OAAkBC,oBAAQT,GAAAA;AAChCL,EAAAA,WAAUa,QAAQ,MAAM,mBAAA;;;;;;;;;AACxB,SAAOA;AACT;AAMO,IAAMlB,eAAc,CAACU,QAAAA;AAC1B,QAAMU,SAAStB,WAAUY,GAAAA;AACzB,MAAIU,UAAU,MAAM;AAElB,WAAOrB,cAAaW,GAAAA,GAAMW,UAAAA,GAAaH;EACzC;AAEA,SAAkBlB,wBAAYoB,MAAAA;AAChC;AAEO,IAAMvB,WAAU,CAACa,QAAAA;AACtB,QAAMY,OAAkBzB,oBAAQa,GAAAA;AAChCL,EAAAA,WAAUiB,QAAQ,MAAM,mBAAA;;;;;;;;;AACxB,SAAOA;AACT;AAEO,IAAMrB,aAAY,CAACS,QAAAA;AACxB,QAAMa,UAAqBtB,sBAAUS,GAAAA;AACrCL,EAAAA,WAAU,OAAOkB,YAAY,WAAW,mBAAA;;;;;;;;;AACxC,SAAOA;AACT;;;ACrFA;;;;;cAAAC;;AAIA,YAAYC,iBAAgB;AAC5B,SAASC,aAAAA,kBAAiB;AAC1B,YAAYC,iBAAgB;;AAIrB,IAAMH,QAAkBI;AAExB,IAAMC,aAAa,CAACC,UAAAA;AACzB,MAAI,OAAOA,UAAU,YAAYA,UAAU,MAAM;AAC/C,WAAO;EACT;AACA,MAAeC,oCAAwBD,SAAoBE,oCAAwBF,OAAO;AACxF,WAAO;EACT;AAEA,QAAMG,OAAQH,MAAyBI,gCAAoB;AAC3D,SAAOD,SAAoBE,uBAAWC;AACxC;AAMO,IAAMC,YAAY,CAAgBC,aAAAA;AACvCZ,EAAAA,WAAUG,WAAWS,QAAAA,GAAAA,QAAAA;;;;;;;;;AACrB,QAAMC,MAAMD,SAAoBE,4BAAgB;AAChDd,EAAAA,WAAUa,QAAQE,QAAW,mBAAmBH,SAASI,EAAE,IAAE;;;;;;;;;AAC7D,SAAOH;AACT;AAMO,IAAMI,YAAY,CAAgBL,aAAAA;AACvCZ,EAAAA,WAAUG,WAAWS,QAAAA,GAAAA,QAAAA;;;;;;;;;AACrB,QAAMC,MAAMD,SAAoBM,4BAAgB;AAChDlB,EAAAA,WAAUa,QAAQE,QAAW,mBAAmBH,SAASI,EAAE,IAAE;;;;;;;;;AAC7D,SAAOH;AACT;;;AC5CA;;;;cAAAM;;AAIA,YAAYC,iBAAgB;AAMrB,IAAMC,QAAkBC,gBAAID;AAE5B,IAAME,QAAqDD,gBAAIC;AAG/D,IAAMC,UAAqBF,gBAAIE;;;ACLtC,SAASC,QAAQC,aAAa;",
6
+ "names": ["Ref", "isMutable", "EchoSchema", "invariant", "Kind", "SpaceId", "ObjectId", "DXN", "Expando", "JsonSchema", "toJsonSchema", "Format", "Obj", "EchoObject", "Relation", "EchoRelation", "getDXN", "schema", "getSchemaDXN", "getTypename", "typename", "getSchemaTypename", "startsWith", "getVersion", "version", "getSchemaVersion", "match", "getMeta", "getTypeAnnotation", "getDXN", "getMeta", "getSchema", "getSchemaDXN", "getTypename", "isDeleted", "Schema", "EchoSchema", "assertArgument", "invariant", "LiveObject", "make", "live", "isObject", "obj", "isLiveObject", "instanceOf", "args", "length", "isInstanceOf", "isSchema", "dxn", "type", "getType", "schema", "asTypeDXN", "meta", "deleted", "make", "EchoSchema", "invariant", "LiveObject", "live", "isRelation", "value", "ATTR_RELATION_SOURCE", "ATTR_RELATION_TARGET", "kind", "EntityKindPropertyId", "EntityKind", "Relation", "getSource", "relation", "obj", "RelationSourceId", "undefined", "id", "getTarget", "RelationTargetId", "make", "EchoSchema", "make", "Ref", "isRef", "fromDXN", "Filter", "Query"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"packages/core/echo/echo/src/type/Obj.ts":{"bytes":1448,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo/src/type/Ref.ts":{"bytes":726,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo/src/type/Relation.ts":{"bytes":1122,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo/src/type/Type.ts":{"bytes":8579,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo/src/type/index.ts":{"bytes":940,"imports":[{"path":"packages/core/echo/echo/src/type/Obj.ts","kind":"import-statement","original":"./Obj"},{"path":"packages/core/echo/echo/src/type/Ref.ts","kind":"import-statement","original":"./Ref"},{"path":"packages/core/echo/echo/src/type/Relation.ts","kind":"import-statement","original":"./Relation"},{"path":"packages/core/echo/echo/src/type/Type.ts","kind":"import-statement","original":"./Type"}],"format":"esm"},"packages/core/echo/echo/src/index.ts":{"bytes":829,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"packages/core/echo/echo/src/type/index.ts","kind":"import-statement","original":"./type"}],"format":"esm"}},"outputs":{"packages/core/echo/echo/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6065},"packages/core/echo/echo/dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["DXN","Format","FormatEnum","Obj","Ref","Relation","Type"],"entryPoint":"packages/core/echo/echo/src/index.ts","inputs":{"packages/core/echo/echo/src/index.ts":{"bytesInOutput":90},"packages/core/echo/echo/src/type/Obj.ts":{"bytesInOutput":263},"packages/core/echo/echo/src/type/index.ts":{"bytesInOutput":0},"packages/core/echo/echo/src/type/Ref.ts":{"bytesInOutput":140},"packages/core/echo/echo/src/type/Relation.ts":{"bytesInOutput":151},"packages/core/echo/echo/src/type/Type.ts":{"bytesInOutput":1643}},"bytes":2887}}}
1
+ {"inputs":{"packages/core/echo/echo/src/Type.ts":{"bytes":8839,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo/src/Obj.ts":{"bytes":8124,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo/src/Relation.ts":{"bytes":5369,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo/src/Ref.ts":{"bytes":1595,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo/src/index.ts":{"bytes":1162,"imports":[{"path":"packages/core/echo/echo/src/Type.ts","kind":"import-statement","original":"./Type"},{"path":"packages/core/echo/echo/src/Obj.ts","kind":"import-statement","original":"./Obj"},{"path":"packages/core/echo/echo/src/Relation.ts","kind":"import-statement","original":"./Relation"},{"path":"packages/core/echo/echo/src/Ref.ts","kind":"import-statement","original":"./Ref"},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"packages/core/echo/echo/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":12154},"packages/core/echo/echo/dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["Filter","Obj","Query","Ref","Relation","Type"],"entryPoint":"packages/core/echo/echo/src/index.ts","inputs":{"packages/core/echo/echo/src/Type.ts":{"bytesInOutput":1927},"packages/core/echo/echo/src/index.ts":{"bytesInOutput":51},"packages/core/echo/echo/src/Obj.ts":{"bytesInOutput":2226},"packages/core/echo/echo/src/Relation.ts":{"bytesInOutput":1700},"packages/core/echo/echo/src/Ref.ts":{"bytesInOutput":276}},"bytes":6748}}}