@dxos/assistant 0.8.4-main.72ec0f3 → 0.8.4-main.7ace549

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 (37) hide show
  1. package/dist/lib/browser/extraction/index.mjs +3 -3
  2. package/dist/lib/browser/extraction/index.mjs.map +3 -3
  3. package/dist/lib/browser/index.mjs +6 -7
  4. package/dist/lib/browser/index.mjs.map +3 -3
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/node-esm/extraction/index.mjs +3 -3
  7. package/dist/lib/node-esm/extraction/index.mjs.map +3 -3
  8. package/dist/lib/node-esm/index.mjs +6 -7
  9. package/dist/lib/node-esm/index.mjs.map +3 -3
  10. package/dist/lib/node-esm/meta.json +1 -1
  11. package/dist/types/src/conversation/context.d.ts +36 -42
  12. package/dist/types/src/conversation/context.d.ts.map +1 -1
  13. package/dist/types/src/execution-graph.d.ts +2 -2
  14. package/dist/types/src/execution-graph.d.ts.map +1 -1
  15. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts +24 -23
  16. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +1 -1
  17. package/dist/types/src/extraction/extraction.d.ts +100 -110
  18. package/dist/types/src/extraction/extraction.d.ts.map +1 -1
  19. package/dist/types/src/extraction/quotes.d.ts.map +1 -1
  20. package/dist/types/src/session/artifact-diff.d.ts +1 -1
  21. package/dist/types/src/session/artifact-diff.d.ts.map +1 -1
  22. package/dist/types/src/session/version-pin.d.ts +2 -2
  23. package/dist/types/src/session/version-pin.d.ts.map +1 -1
  24. package/dist/types/src/types/artifact.d.ts +2 -3
  25. package/dist/types/src/types/artifact.d.ts.map +1 -1
  26. package/dist/types/tsconfig.tsbuildinfo +1 -1
  27. package/package.json +22 -22
  28. package/src/conversation/context.ts +7 -8
  29. package/src/execution-graph.test.ts +1 -1
  30. package/src/execution-graph.ts +2 -2
  31. package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +3 -3
  32. package/src/extraction/extraction.ts +2 -2
  33. package/src/extraction/quotes.ts +1 -1
  34. package/src/session/artifact-diff.ts +1 -1
  35. package/src/session/format.ts +1 -1
  36. package/src/session/version-pin.ts +4 -3
  37. package/src/types/artifact.ts +3 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/assistant",
3
- "version": "0.8.4-main.72ec0f3",
3
+ "version": "0.8.4-main.7ace549",
4
4
  "description": "Natural language interface to DXOS",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -45,27 +45,27 @@
45
45
  "@preact/signals-core": "^1.12.1",
46
46
  "@xenova/transformers": "^2.17.2",
47
47
  "lodash.defaultsdeep": "^4.6.1",
48
- "@dxos/ai": "0.8.4-main.72ec0f3",
49
- "@dxos/async": "0.8.4-main.72ec0f3",
50
- "@dxos/blueprints": "0.8.4-main.72ec0f3",
51
- "@dxos/debug": "0.8.4-main.72ec0f3",
52
- "@dxos/echo-db": "0.8.4-main.72ec0f3",
53
- "@dxos/echo": "0.8.4-main.72ec0f3",
54
- "@dxos/context": "0.8.4-main.72ec0f3",
55
- "@dxos/echo-protocol": "0.8.4-main.72ec0f3",
56
- "@dxos/effect": "0.8.4-main.72ec0f3",
57
- "@dxos/errors": "0.8.4-main.72ec0f3",
58
- "@dxos/functions-runtime": "0.8.4-main.72ec0f3",
59
- "@dxos/keys": "0.8.4-main.72ec0f3",
60
- "@dxos/graph": "0.8.4-main.72ec0f3",
61
- "@dxos/live-object": "0.8.4-main.72ec0f3",
62
- "@dxos/log": "0.8.4-main.72ec0f3",
63
- "@dxos/node-std": "0.8.4-main.72ec0f3",
64
- "@dxos/functions": "0.8.4-main.72ec0f3",
65
- "@dxos/schema": "0.8.4-main.72ec0f3",
66
- "@dxos/invariant": "0.8.4-main.72ec0f3",
67
- "@dxos/types": "0.8.4-main.72ec0f3",
68
- "@dxos/util": "0.8.4-main.72ec0f3"
48
+ "@dxos/ai": "0.8.4-main.7ace549",
49
+ "@dxos/async": "0.8.4-main.7ace549",
50
+ "@dxos/blueprints": "0.8.4-main.7ace549",
51
+ "@dxos/context": "0.8.4-main.7ace549",
52
+ "@dxos/echo": "0.8.4-main.7ace549",
53
+ "@dxos/debug": "0.8.4-main.7ace549",
54
+ "@dxos/echo-db": "0.8.4-main.7ace549",
55
+ "@dxos/echo-protocol": "0.8.4-main.7ace549",
56
+ "@dxos/effect": "0.8.4-main.7ace549",
57
+ "@dxos/functions-runtime": "0.8.4-main.7ace549",
58
+ "@dxos/graph": "0.8.4-main.7ace549",
59
+ "@dxos/functions": "0.8.4-main.7ace549",
60
+ "@dxos/invariant": "0.8.4-main.7ace549",
61
+ "@dxos/keys": "0.8.4-main.7ace549",
62
+ "@dxos/live-object": "0.8.4-main.7ace549",
63
+ "@dxos/node-std": "0.8.4-main.7ace549",
64
+ "@dxos/log": "0.8.4-main.7ace549",
65
+ "@dxos/schema": "0.8.4-main.7ace549",
66
+ "@dxos/util": "0.8.4-main.7ace549",
67
+ "@dxos/types": "0.8.4-main.7ace549",
68
+ "@dxos/errors": "0.8.4-main.7ace549"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@types/lodash.defaultsdeep": "^4.6.6",
@@ -10,7 +10,7 @@ import * as Schema from 'effect/Schema';
10
10
 
11
11
  import { Blueprint } from '@dxos/blueprints';
12
12
  import { Resource } from '@dxos/context';
13
- import { DXN, Filter, Obj, Query, type Ref, type Relation, Type } from '@dxos/echo';
13
+ import { DXN, type Entity, Filter, Obj, Query, type Ref, Type } from '@dxos/echo';
14
14
  import { type Queue } from '@dxos/echo-db';
15
15
  import { invariant } from '@dxos/invariant';
16
16
  import { ComplexSet } from '@dxos/util';
@@ -25,10 +25,9 @@ export const ContextBinding = Schema.Struct({
25
25
  removed: Schema.Array(Type.Ref(Blueprint.Blueprint)),
26
26
  }),
27
27
 
28
- // TODO(burdon): Type.Expando => Type.Obj (or Obj.Any?)
29
28
  objects: Schema.Struct({
30
- added: Schema.Array(Type.Ref(Type.Expando)),
31
- removed: Schema.Array(Type.Ref(Type.Expando)),
29
+ added: Schema.Array(Type.Ref(Obj.Any)),
30
+ removed: Schema.Array(Type.Ref(Obj.Any)),
32
31
  }),
33
32
  }).pipe(
34
33
  Type.Obj({
@@ -41,13 +40,13 @@ export interface ContextBinding extends Schema.Schema.Type<typeof ContextBinding
41
40
 
42
41
  export type BindingProps = Partial<{
43
42
  blueprints: Ref.Ref<Blueprint.Blueprint>[];
44
- objects: Ref.Ref<Type.Expando>[];
43
+ objects: Ref.Ref<Obj.Any>[];
45
44
  }>;
46
45
 
47
46
  export class Bindings {
48
47
  readonly blueprints = new ComplexSet<Ref.Ref<Blueprint.Blueprint>>((ref) => ref.dxn.toString());
49
48
  // TODO(burdon): Some DXNs have the Space prefix so only compare the object ID.
50
- readonly objects = new ComplexSet<Ref.Ref<Type.Expando>>((ref) => ref.dxn.asEchoDXN()?.echoId);
49
+ readonly objects = new ComplexSet<Ref.Ref<Obj.Any>>((ref) => ref.dxn.asEchoDXN()?.echoId);
51
50
 
52
51
  toJSON() {
53
52
  return {
@@ -68,7 +67,7 @@ export class AiContextBinder extends Resource {
68
67
  // TODO(burdon): Cache value?
69
68
  private _bindings?: ReadonlySignal<Bindings>;
70
69
  private _blueprints?: ReadonlySignal<Ref.Ref<Blueprint.Blueprint>[]>;
71
- private _objects?: ReadonlySignal<Ref.Ref<Type.Expando>[]>;
70
+ private _objects?: ReadonlySignal<Ref.Ref<Obj.Any>[]>;
72
71
 
73
72
  constructor(private readonly _queue: Queue) {
74
73
  super();
@@ -157,7 +156,7 @@ export class AiContextBinder extends Resource {
157
156
  ]);
158
157
  }
159
158
 
160
- private _reduce(items: (Obj.Any | Relation.Any)[]): Bindings {
159
+ private _reduce(items: Entity.Unknown[]): Bindings {
161
160
  return Function.pipe(
162
161
  items,
163
162
  Array.filter(Obj.instanceOf(ContextBinding)),
@@ -6,7 +6,7 @@ import { describe, expect, it } from '@effect/vitest';
6
6
 
7
7
  import { AgentStatus } from '@dxos/ai';
8
8
  import { Obj } from '@dxos/echo';
9
- import { ObjectId } from '@dxos/echo/internal';
9
+ import { ObjectId } from '@dxos/keys';
10
10
  import { log } from '@dxos/log';
11
11
  import { type ContentBlock, Message } from '@dxos/types';
12
12
 
@@ -3,7 +3,7 @@
3
3
  //
4
4
 
5
5
  import { AgentStatus } from '@dxos/ai';
6
- import { Obj, type Ref } from '@dxos/echo';
6
+ import { type Entity, Obj, type Ref } from '@dxos/echo';
7
7
  import { MESSAGE_PROPERTY_TOOL_CALL_ID } from '@dxos/functions';
8
8
  import { type ObjectId } from '@dxos/keys';
9
9
  import { LogLevel } from '@dxos/log';
@@ -65,7 +65,7 @@ export class ExecutionGraph {
65
65
  /**
66
66
  * Adds events to the graph.
67
67
  */
68
- addEvents(events: Obj.Any[]) {
68
+ addEvents(events: Entity.Unknown[]) {
69
69
  const sortedEvents = this.sortObjectsByCreated(events);
70
70
  for (const event of sortedEvents) {
71
71
  if (Obj.instanceOf(Message.Message, event)) {
@@ -8,7 +8,7 @@ import { type EchoDatabase } from '@dxos/echo-db';
8
8
  import { EchoTestBuilder } from '@dxos/echo-db/testing';
9
9
  import { FunctionExecutor, ServiceContainer } from '@dxos/functions-runtime';
10
10
  import { log } from '@dxos/log';
11
- import { Testing } from '@dxos/schema/testing';
11
+ import { TestSchema } from '@dxos/schema/testing';
12
12
  import { type Message, Organization, Person } from '@dxos/types';
13
13
  import { createTestData } from '@dxos/types/testing';
14
14
  import { range } from '@dxos/util';
@@ -25,12 +25,12 @@ describe.skip('NER EntityExtraction', () => {
25
25
  transcriptJosiah: Message.Message[];
26
26
  transcriptWoflram: Message.Message[];
27
27
  transcriptMessages: Message.Message[];
28
- documents: Testing.DocumentType[];
28
+ documents: TestSchema.DocumentType[];
29
29
  contacts: Record<string, Person.Person>;
30
30
  organizations: Record<string, Organization.Organization>;
31
31
  };
32
32
 
33
- const TYPES = [Organization.Organization, Person.Person, Testing.Person, Testing.DocumentType];
33
+ const TYPES = [Organization.Organization, Person.Person, TestSchema.Person, TestSchema.DocumentType];
34
34
 
35
35
  beforeAll(async () => {
36
36
  // TODO(dmaretskyi): Helper to scaffold this from a config.
@@ -5,7 +5,7 @@
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
7
  import { asyncTimeout } from '@dxos/async';
8
- import { Expando } from '@dxos/echo/internal';
8
+ import { Type } from '@dxos/echo';
9
9
  import { type FunctionDefinition } from '@dxos/functions';
10
10
  import { type FunctionExecutor } from '@dxos/functions-runtime';
11
11
  import { log } from '@dxos/log';
@@ -13,7 +13,7 @@ import { Message } from '@dxos/types';
13
13
 
14
14
  export const ExtractionInput = Schema.Struct({
15
15
  message: Message.Message,
16
- objects: Schema.optional(Schema.Array(Expando)),
16
+ objects: Schema.optional(Schema.Array(Type.Expando)),
17
17
  options: Schema.optional(
18
18
  Schema.Struct({
19
19
  timeout: Schema.optional(Schema.Number),
@@ -5,8 +5,8 @@
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
7
  import { Filter, Query } from '@dxos/echo';
8
- import { ObjectId } from '@dxos/echo/internal';
9
8
  import { type EchoDatabase } from '@dxos/echo-db';
9
+ import { ObjectId } from '@dxos/keys';
10
10
  import { DXN } from '@dxos/keys';
11
11
  import { log } from '@dxos/log';
12
12
 
@@ -4,8 +4,8 @@
4
4
 
5
5
  import * as Context from 'effect/Context';
6
6
 
7
- import { type ObjectId } from '@dxos/echo/internal';
8
7
  import { type ObjectVersion } from '@dxos/echo-db';
8
+ import { type ObjectId } from '@dxos/keys';
9
9
 
10
10
  /**
11
11
  * Resolves artifact ids to their versions.
@@ -9,8 +9,8 @@ import * as Option from 'effect/Option';
9
9
 
10
10
  import { Template } from '@dxos/blueprints';
11
11
  import { Obj } from '@dxos/echo';
12
- import { type ObjectId } from '@dxos/echo/internal';
13
12
  import { DatabaseService, ObjectVersion } from '@dxos/echo-db';
13
+ import { type ObjectId } from '@dxos/keys';
14
14
  import { log } from '@dxos/log';
15
15
  import { type ContentBlock, Message } from '@dxos/types';
16
16
  import { trim } from '@dxos/util';
@@ -4,8 +4,9 @@
4
4
 
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
- import { type AnyEchoObject, ObjectId } from '@dxos/echo/internal';
7
+ import { type Obj } from '@dxos/echo';
8
8
  import { type ObjectVersion, getVersion } from '@dxos/echo-db';
9
+ import { ObjectId } from '@dxos/keys';
9
10
  import { type ContentBlock } from '@dxos/types';
10
11
 
11
12
  // TODO(dmaretskyi): Extract.
@@ -26,11 +27,11 @@ export interface VersionPin extends Schema.Schema.Type<typeof VersionPinSchema>
26
27
 
27
28
  export const VersionPin: typeof VersionPinSchema & {
28
29
  DISPOSITION: 'version-pin';
29
- fromObject: (object: AnyEchoObject) => VersionPin;
30
+ fromObject: (object: Obj.Any) => VersionPin;
30
31
  createBlock: (pin: VersionPin) => ContentBlock.Any;
31
32
  } = class extends VersionPinSchema {
32
33
  static readonly DISPOSITION = 'version-pin';
33
- static fromObject(object: AnyEchoObject): VersionPin {
34
+ static fromObject(object: Obj.Any): VersionPin {
34
35
  return VersionPin.make({
35
36
  objectId: object.id,
36
37
  version: getVersion(object),
@@ -6,9 +6,8 @@ import type * as Effect from 'effect/Effect';
6
6
  import * as Schema from 'effect/Schema';
7
7
 
8
8
  import { type ObjectNotFoundError, type Type } from '@dxos/echo';
9
- import { type ObjectId } from '@dxos/echo/internal';
10
9
  import { DatabaseService } from '@dxos/echo-db';
11
- import { DXN, LOCAL_SPACE_TAG, type SpaceId } from '@dxos/keys';
10
+ import { DXN, LOCAL_SPACE_TAG, type ObjectId, type SpaceId } from '@dxos/keys';
12
11
  import { trim } from '@dxos/util';
13
12
 
14
13
  /**
@@ -23,7 +22,7 @@ export const createArtifactElement = (id: ObjectId) => `<artifact id=${id} />`;
23
22
  // TODO(burdon): Rename RefFromLLM?
24
23
  export const ArtifactId: Schema.Schema<string> & {
25
24
  toDXN: (reference: ArtifactId, owningSpaceId?: SpaceId) => DXN;
26
- resolve: <S extends Type.Obj.Any | Type.Relation.Any>(
25
+ resolve: <S extends Type.Entity.Any>(
27
26
  schema: S,
28
27
  ref: ArtifactId,
29
28
  ) => Effect.Effect<Schema.Schema.Type<S>, ObjectNotFoundError, DatabaseService>;
@@ -59,7 +58,7 @@ export const ArtifactId: Schema.Schema<string> & {
59
58
  /**
60
59
  * Resolves an artifact ID to an object.
61
60
  */
62
- static resolve<S extends Type.Obj.Any | Type.Relation.Any>(
61
+ static resolve<S extends Type.Entity.Any>(
63
62
  schema: S,
64
63
  ref: ArtifactId,
65
64
  ): Effect.Effect<Schema.Schema.Type<S>, ObjectNotFoundError, DatabaseService> {