@dxos/assistant 0.8.4-main.c4373fc → 0.8.4-main.c85a9c8dae

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 (123) hide show
  1. package/README.md +1 -0
  2. package/dist/lib/neutral/chunk-BE6SRJ4N.mjs +193 -0
  3. package/dist/lib/neutral/chunk-BE6SRJ4N.mjs.map +7 -0
  4. package/dist/lib/neutral/extraction/index.mjs +223 -0
  5. package/dist/lib/neutral/extraction/index.mjs.map +7 -0
  6. package/dist/lib/neutral/index.mjs +1328 -0
  7. package/dist/lib/neutral/index.mjs.map +7 -0
  8. package/dist/lib/neutral/meta.json +1 -0
  9. package/dist/lib/neutral/testing/index.mjs +38 -0
  10. package/dist/lib/neutral/testing/index.mjs.map +7 -0
  11. package/dist/types/src/conversation/context.d.ts +109 -60
  12. package/dist/types/src/conversation/context.d.ts.map +1 -1
  13. package/dist/types/src/conversation/context.test.d.ts +2 -0
  14. package/dist/types/src/conversation/context.test.d.ts.map +1 -0
  15. package/dist/types/src/conversation/conversation.d.ts +41 -16
  16. package/dist/types/src/conversation/conversation.d.ts.map +1 -1
  17. package/dist/types/src/conversation/conversation.test.d.ts +2 -0
  18. package/dist/types/src/conversation/conversation.test.d.ts.map +1 -0
  19. package/dist/types/src/diff.d.ts +3 -1
  20. package/dist/types/src/diff.d.ts.map +1 -1
  21. package/dist/types/src/errors.d.ts +22 -30
  22. package/dist/types/src/errors.d.ts.map +1 -1
  23. package/dist/types/src/execution-graph.d.ts +5 -2
  24. package/dist/types/src/execution-graph.d.ts.map +1 -1
  25. package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts.map +1 -1
  26. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts +282 -268
  27. package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +1 -1
  28. package/dist/types/src/extraction/extraction.d.ts +348 -303
  29. package/dist/types/src/extraction/extraction.d.ts.map +1 -1
  30. package/dist/types/src/extraction/quotes.d.ts +2 -2
  31. package/dist/types/src/extraction/quotes.d.ts.map +1 -1
  32. package/dist/types/src/functions/services.d.ts +6 -6
  33. package/dist/types/src/functions/services.d.ts.map +1 -1
  34. package/dist/types/src/functions.test.d.ts +2 -0
  35. package/dist/types/src/functions.test.d.ts.map +1 -0
  36. package/dist/types/src/session/artifact-diff.d.ts +1 -1
  37. package/dist/types/src/session/artifact-diff.d.ts.map +1 -1
  38. package/dist/types/src/session/format.d.ts +4 -176
  39. package/dist/types/src/session/format.d.ts.map +1 -1
  40. package/dist/types/src/session/index.d.ts +1 -0
  41. package/dist/types/src/session/index.d.ts.map +1 -1
  42. package/dist/types/src/session/observer.d.ts +6 -5
  43. package/dist/types/src/session/observer.d.ts.map +1 -1
  44. package/dist/types/src/session/session.d.ts +25 -15
  45. package/dist/types/src/session/session.d.ts.map +1 -1
  46. package/dist/types/src/session/toolkit.d.ts +9 -6
  47. package/dist/types/src/session/toolkit.d.ts.map +1 -1
  48. package/dist/types/src/session/version-pin.d.ts +3 -3
  49. package/dist/types/src/session/version-pin.d.ts.map +1 -1
  50. package/dist/types/src/testing/index.d.ts +2 -0
  51. package/dist/types/src/testing/index.d.ts.map +1 -0
  52. package/dist/types/src/testing/layer.d.ts +22 -0
  53. package/dist/types/src/testing/layer.d.ts.map +1 -0
  54. package/dist/types/src/types/artifact.d.ts +28 -0
  55. package/dist/types/src/types/artifact.d.ts.map +1 -0
  56. package/dist/types/src/types/index.d.ts +2 -0
  57. package/dist/types/src/types/index.d.ts.map +1 -0
  58. package/dist/types/tsconfig.tsbuildinfo +1 -1
  59. package/package.json +41 -31
  60. package/src/conversation/context.test.ts +46 -0
  61. package/src/conversation/context.ts +223 -49
  62. package/src/conversation/conversation.test.ts +65 -0
  63. package/src/conversation/conversation.ts +179 -53
  64. package/src/diff.test.ts +37 -6
  65. package/src/diff.ts +18 -4
  66. package/src/errors.ts +2 -2
  67. package/src/execution-graph.test.ts +46 -44
  68. package/src/execution-graph.ts +25 -16
  69. package/src/extraction/extraction-llm-function/extraction-llm-function.test.ts +2 -2
  70. package/src/extraction/extraction-llm-function/extraction-llm-function.ts +44 -54
  71. package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +15 -14
  72. package/src/extraction/extraction-ner-function/extraction-ner-function.ts +36 -44
  73. package/src/extraction/extraction-ner-function/named-entity-recognition.test.ts +10 -5
  74. package/src/extraction/extraction.ts +9 -8
  75. package/src/extraction/quotes.ts +4 -5
  76. package/src/functions/services.ts +88 -37
  77. package/src/functions.conversations.json +1 -0
  78. package/src/functions.test.ts +74 -0
  79. package/src/session/artifact-diff.ts +1 -1
  80. package/src/session/format.test.ts +103 -39
  81. package/src/session/format.ts +17 -16
  82. package/src/session/index.ts +1 -0
  83. package/src/session/observer.ts +6 -3
  84. package/src/session/session.conversations.json +1 -1
  85. package/src/session/session.test.ts +60 -18
  86. package/src/session/session.ts +99 -60
  87. package/src/session/toolkit.ts +21 -25
  88. package/src/session/version-pin.ts +6 -6
  89. package/src/templates/{format.tpl → instructions/format.tpl} +1 -4
  90. package/src/templates/system.ts +2 -2
  91. package/src/testing/index.ts +5 -0
  92. package/src/testing/layer.ts +85 -0
  93. package/src/{types.ts → types/artifact.ts} +43 -6
  94. package/src/types/index.ts +5 -0
  95. package/dist/lib/browser/chunk-CWGVG235.mjs +0 -380
  96. package/dist/lib/browser/chunk-CWGVG235.mjs.map +0 -7
  97. package/dist/lib/browser/chunk-UB26N5UF.mjs +0 -89
  98. package/dist/lib/browser/chunk-UB26N5UF.mjs.map +0 -7
  99. package/dist/lib/browser/extraction/index.mjs +0 -272
  100. package/dist/lib/browser/extraction/index.mjs.map +0 -7
  101. package/dist/lib/browser/index.mjs +0 -869
  102. package/dist/lib/browser/index.mjs.map +0 -7
  103. package/dist/lib/browser/meta.json +0 -1
  104. package/dist/lib/browser/named-entity-recognition-QPYHML66.mjs +0 -13
  105. package/dist/lib/browser/named-entity-recognition-QPYHML66.mjs.map +0 -7
  106. package/dist/lib/node-esm/chunk-BCFXTNSK.mjs +0 -91
  107. package/dist/lib/node-esm/chunk-BCFXTNSK.mjs.map +0 -7
  108. package/dist/lib/node-esm/chunk-OV5PMQPB.mjs +0 -382
  109. package/dist/lib/node-esm/chunk-OV5PMQPB.mjs.map +0 -7
  110. package/dist/lib/node-esm/extraction/index.mjs +0 -273
  111. package/dist/lib/node-esm/extraction/index.mjs.map +0 -7
  112. package/dist/lib/node-esm/index.mjs +0 -870
  113. package/dist/lib/node-esm/index.mjs.map +0 -7
  114. package/dist/lib/node-esm/meta.json +0 -1
  115. package/dist/lib/node-esm/named-entity-recognition-2HDF46YX.mjs +0 -14
  116. package/dist/lib/node-esm/named-entity-recognition-2HDF46YX.mjs.map +0 -7
  117. package/dist/types/src/summarization/summarization.test.d.ts +0 -2
  118. package/dist/types/src/summarization/summarization.test.d.ts.map +0 -1
  119. package/dist/types/src/types.d.ts +0 -16
  120. package/dist/types/src/types.d.ts.map +0 -1
  121. package/src/summarization/summarization.test.ts +0 -202
  122. /package/src/extraction/extraction-llm-function/{instructions.tpl → transcription-instructions.tpl} +0 -0
  123. /package/src/templates/{system.tpl → instructions/system.tpl} +0 -0
@@ -1,97 +1,146 @@
1
- import { type ReadonlySignal } from '@preact/signals-core';
1
+ import { Atom, Registry } from '@effect-atom/atom-react';
2
2
  import * as Context from 'effect/Context';
3
+ import * as Effect from 'effect/Effect';
3
4
  import * as Schema from 'effect/Schema';
4
5
  import { Blueprint } from '@dxos/blueprints';
5
- import { DXN, type Ref, Type } from '@dxos/echo';
6
+ import { Resource } from '@dxos/context';
7
+ import { DXN, Obj, Ref, Type } from '@dxos/echo';
6
8
  import { type Queue } from '@dxos/echo-db';
7
9
  import { ComplexSet } from '@dxos/util';
8
10
  /**
9
11
  * Thread message that binds or unbinds contextual objects to a conversation.
10
12
  */
11
- export declare const ContextBinding: Type.obj<Schema.Struct<{
12
- blueprints: Schema.Struct<{
13
- added: Schema.Array$<Type.ref<Type.obj<Schema.Struct<{
14
- key: Schema.SchemaClass<string, string, never>;
15
- name: Schema.SchemaClass<string, string, never>;
16
- description: Schema.optional<typeof Schema.String>;
17
- instructions: Schema.mutable<Schema.Struct<{
18
- source: Schema.SchemaClass<import("@dxos/echo/internal").Ref<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
19
- content: string;
20
- }>, import("@dxos/echo-protocol").EncodedReference, never>;
21
- inputs: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
22
- name: typeof Schema.String;
23
- kind: Schema.optional<Schema.Literal<["value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema"]>>;
24
- default: Schema.optional<typeof Schema.Any>;
25
- }>>>>>;
26
- }>>;
27
- tools: Schema.Array$<Schema.brand<typeof Schema.String, "ToolId">>;
28
- }>>>>;
29
- removed: Schema.Array$<Type.ref<Type.obj<Schema.Struct<{
30
- key: Schema.SchemaClass<string, string, never>;
31
- name: Schema.SchemaClass<string, string, never>;
32
- description: Schema.optional<typeof Schema.String>;
33
- instructions: Schema.mutable<Schema.Struct<{
34
- source: Schema.SchemaClass<import("@dxos/echo/internal").Ref<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
35
- content: string;
36
- }>, import("@dxos/echo-protocol").EncodedReference, never>;
37
- inputs: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
38
- name: typeof Schema.String;
39
- kind: Schema.optional<Schema.Literal<["value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema"]>>;
40
- default: Schema.optional<typeof Schema.Any>;
41
- }>>>>>;
42
- }>>;
43
- tools: Schema.Array$<Schema.brand<typeof Schema.String, "ToolId">>;
44
- }>>>>;
45
- }>;
46
- objects: Schema.Struct<{
47
- added: Schema.Array$<Type.ref<Schema.Schema<Type.Expando, {
48
- [x: string]: any;
49
- id: string;
50
- }, never>>>;
51
- removed: Schema.Array$<Type.ref<Schema.Schema<Type.Expando, {
52
- [x: string]: any;
53
- id: string;
54
- }, never>>>;
55
- }>;
56
- }>>;
13
+ export declare const ContextBinding: Type.Obj<{
14
+ readonly blueprints: {
15
+ readonly added: readonly import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
16
+ readonly description?: string | undefined;
17
+ readonly name: string;
18
+ readonly key: string;
19
+ readonly instructions: {
20
+ readonly source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
21
+ readonly content: string;
22
+ }>;
23
+ readonly inputs?: readonly {
24
+ readonly function?: string | undefined;
25
+ readonly name: string;
26
+ readonly kind?: "function" | "value" | "pass-through" | "retriever" | "query" | "resolver" | "context" | "schema" | undefined;
27
+ readonly default?: any;
28
+ }[] | undefined;
29
+ };
30
+ readonly tools: readonly (string & import("effect/Brand").Brand<"ToolId">)[];
31
+ readonly mcpServers?: readonly {
32
+ readonly url: string;
33
+ readonly protocol: "sse" | "http";
34
+ }[] | undefined;
35
+ }>[];
36
+ readonly removed: readonly import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
37
+ readonly description?: string | undefined;
38
+ readonly name: string;
39
+ readonly key: string;
40
+ readonly instructions: {
41
+ readonly source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
42
+ readonly content: string;
43
+ }>;
44
+ readonly inputs?: readonly {
45
+ readonly function?: string | undefined;
46
+ readonly name: string;
47
+ readonly kind?: "function" | "value" | "pass-through" | "retriever" | "query" | "resolver" | "context" | "schema" | undefined;
48
+ readonly default?: any;
49
+ }[] | undefined;
50
+ };
51
+ readonly tools: readonly (string & import("effect/Brand").Brand<"ToolId">)[];
52
+ readonly mcpServers?: readonly {
53
+ readonly url: string;
54
+ readonly protocol: "sse" | "http";
55
+ }[] | undefined;
56
+ }>[];
57
+ };
58
+ readonly objects: {
59
+ readonly added: readonly import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>[];
60
+ readonly removed: readonly import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>[];
61
+ };
62
+ }, Schema.Struct.Fields>;
57
63
  export interface ContextBinding extends Schema.Schema.Type<typeof ContextBinding> {
58
64
  }
59
65
  export type BindingProps = Partial<{
60
66
  blueprints: Ref.Ref<Blueprint.Blueprint>[];
61
- objects: Ref.Ref<Type.Expando>[];
67
+ objects: Ref.Ref<Obj.Unknown>[];
62
68
  }>;
63
69
  export declare class Bindings {
64
70
  readonly blueprints: ComplexSet<Ref.Ref<Blueprint.Blueprint>>;
65
- readonly objects: ComplexSet<Ref.Ref<Type.Expando>>;
71
+ readonly objects: ComplexSet<Ref.Ref<Obj.Unknown>>;
66
72
  toJSON(): {
67
73
  blueprints: DXN.String[];
68
74
  objects: DXN.String[];
69
75
  };
70
76
  }
77
+ export type AiContextBinderOptions = {
78
+ queue: Queue;
79
+ registry?: Registry.Registry;
80
+ };
71
81
  /**
72
82
  * Manages bindings of blueprints and objects to a conversation.
73
83
  */
74
- export declare class AiContextBinder {
84
+ export declare class AiContextBinder extends Resource {
85
+ private readonly _blueprints;
86
+ private readonly _objects;
87
+ private readonly _registry;
75
88
  private readonly _queue;
89
+ constructor(options: AiContextBinderOptions);
90
+ /**
91
+ * Returns the blueprints atom for subscription.
92
+ */
93
+ get blueprints(): Atom.Atom<Blueprint.Blueprint[]>;
94
+ /**
95
+ * Returns the objects atom for subscription.
96
+ */
97
+ get objects(): Atom.Atom<Obj.Unknown[]>;
98
+ /**
99
+ * Gets the current blueprints value.
100
+ */
101
+ getBlueprints(): Blueprint.Blueprint[];
102
+ /**
103
+ * Gets the current objects value.
104
+ */
105
+ getObjects(): Obj.Unknown[];
106
+ /**
107
+ * Subscribe to changes in blueprints.
108
+ */
109
+ subscribeBlueprints(cb: (blueprints: Blueprint.Blueprint[]) => void): () => void;
110
+ /**
111
+ * Subscribe to changes in objects.
112
+ */
113
+ subscribeObjects(cb: (objects: Obj.Unknown[]) => void): () => void;
114
+ protected _open(): Promise<void>;
115
+ private _updateBindings;
116
+ protected _close(): Promise<void>;
117
+ bind({ blueprints, objects }: BindingProps): Promise<void>;
118
+ unbind({ blueprints, objects }: BindingProps): Promise<void>;
76
119
  /**
77
- * Reactive query of all bindings.
120
+ * Process bindings to filter duplicates and determine next state.
78
121
  */
79
- readonly bindings: ReadonlySignal<Bindings>;
80
- readonly blueprints: ReadonlySignal<Ref.Ref<Blueprint.Blueprint>[]>;
81
- readonly objects: ReadonlySignal<Ref.Ref<Type.Expando>[]>;
82
- constructor(_queue: Queue);
122
+ private _processBindings;
83
123
  /**
84
- * Asynchronous query of all bindings.
124
+ * Reduce results into sets of blueprints and objects.
85
125
  */
86
- query(): Promise<Bindings>;
87
- bind(props: BindingProps): Promise<void>;
88
- unbind(props: BindingProps): Promise<void>;
89
126
  private _reduce;
127
+ /**
128
+ * Resolve references to objects, loading them first if needed and falling back to existing objects.
129
+ */
130
+ private _resolve;
90
131
  }
91
132
  declare const AiContextService_base: Context.TagClass<AiContextService, "@dxos/assistant/AiContextService", {
92
133
  binder: AiContextBinder;
93
134
  }>;
94
135
  export declare class AiContextService extends AiContextService_base {
136
+ static bindContext: ({ blueprints, objects }: BindingProps) => Effect.Effect<void, never, AiContextService>;
137
+ static findObjects: <T extends Type.AnyEntity>(type: T) => Effect.Effect<Schema.Schema.Type<T>[], never, AiContextService>;
138
+ /**
139
+ * Glorified type cast until we figure out function service typing.
140
+ * For context, the AiContextService is provided to functions called from tool calls, but it's not implemented in types yet.
141
+ * @deprecated
142
+ */
143
+ static fixFunctionHandlerType: <A, E, R>(eff: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, AiContextService>>;
95
144
  }
96
145
  export {};
97
146
  //# sourceMappingURL=context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","s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names":[],"mappings":""}
@@ -1,41 +1,66 @@
1
+ import type * as Tool from '@effect/ai/Tool';
1
2
  import type * as Toolkit from '@effect/ai/Toolkit';
3
+ import type { Registry } from '@effect-atom/atom-react';
4
+ import * as Context from 'effect/Context';
2
5
  import * as Effect from 'effect/Effect';
6
+ import * as Layer from 'effect/Layer';
7
+ import { type ToolExecutionService, type ToolResolverService } from '@dxos/ai';
8
+ import { Resource } from '@dxos/context';
3
9
  import { type Queue } from '@dxos/echo-db';
4
- import { DataType } from '@dxos/schema';
10
+ import { QueueService } from '@dxos/functions';
11
+ import { Message } from '@dxos/types';
5
12
  import { type AiSessionRunError, type AiSessionRunRequirements, type GenerationObserver } from '../session';
6
- import { AiContextBinder, type ContextBinding } from './context';
7
- export interface AiConversationRunParams {
13
+ import { AiContextBinder, AiContextService, type ContextBinding } from './context';
14
+ export interface AiConversationRunProps {
8
15
  prompt: string;
9
16
  system?: string;
10
17
  observer?: GenerationObserver;
11
18
  }
12
19
  export type AiConversationOptions = {
13
- queue: Queue<DataType.Message | ContextBinding>;
20
+ queue: Queue<Message.Message | ContextBinding>;
21
+ toolkit?: Toolkit.Any;
22
+ registry?: Registry.Registry;
14
23
  };
15
24
  /**
16
25
  * Durable conversation state (initiated by users and agents) backed by a Queue.
17
26
  * Executes tools based on AI responses and supports cancellation of in-progress requests.
18
27
  */
19
- export declare class AiConversation {
28
+ export declare class AiConversation extends Resource {
20
29
  /**
21
- * Message and binding queue.
30
+ * Blueprints and objects bound to the conversation.
22
31
  */
32
+ private readonly _binder;
23
33
  private readonly _queue;
34
+ private readonly _toolkit?;
35
+ constructor(options: AiConversationOptions);
36
+ protected _open(): Promise<void>;
37
+ get queue(): Queue<Message.Message | ContextBinding>;
38
+ get context(): AiContextBinder;
39
+ get toolkit(): Toolkit.Any | undefined;
40
+ getHistory(): Promise<Message.Message[]>;
41
+ getTools(): Effect.Effect<Record<string, Tool.Any>, never, ToolExecutionService | ToolResolverService>;
24
42
  /**
25
- * Blueprints bound to the conversation.
43
+ * Creates a new cancelable request effect.
26
44
  */
27
- private readonly _context;
45
+ createRequest(params: AiConversationRunProps): Effect.Effect<Message.Message[], AiSessionRunError, AiSessionRunRequirements>;
46
+ }
47
+ declare const AiConversationService_base: Context.TagClass<AiConversationService, "@dxos/assistant/AiConversationService", AiConversation>;
48
+ /**
49
+ * Gives access to the ai conversation.
50
+ */
51
+ export declare class AiConversationService extends AiConversationService_base {
28
52
  /**
29
- * Toolkit from the current session request.
53
+ * Create a new conversation layer from options.
30
54
  */
31
- private _toolkit;
32
- constructor(options: AiConversationOptions);
33
- get context(): AiContextBinder;
34
- get toolkit(): Toolkit.WithHandler<any> | undefined;
35
- getHistory(): Promise<DataType.Message[]>;
55
+ static layer: (options: AiConversationOptions) => Layer.Layer<AiConversationService | AiContextService>;
36
56
  /**
37
- * Creates a new cancelable request effect.
57
+ * Create a new conversation with a new queue.
58
+ */
59
+ static layerNewQueue: (options?: Omit<AiConversationOptions, "queue">) => Layer.Layer<AiConversationService | AiContextService, never, QueueService>;
60
+ /**
61
+ * Run a prompt in the current conversation.
38
62
  */
39
- createRequest(params: AiConversationRunParams): Effect.Effect<DataType.Message[], AiSessionRunError, AiSessionRunRequirements>;
63
+ static run: (params: AiConversationRunProps) => Effect.Effect<Message.Message[], AiSessionRunError, AiSessionRunRequirements | AiConversationService>;
40
64
  }
65
+ export {};
41
66
  //# sourceMappingURL=conversation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../src/conversation/conversation.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAEnD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,K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Q,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,oBAAoB,GAAG,mBAAmB,CAAC;IAQtG;;OAEG;IACI,aAAa,CAClB,MAAM,EAAE,sBAAsB,GAC7B,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,iBAAiB,EAAE,wBAAwB,CAAC;CA0DjF;;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,0BAGxC;IACD;;OAEG;IACH,MAAM,CAAC,KAAK,GAAI,SAAS,qBAAqB,KAAG,KAAK,CAAC,KAAK,CAAC,qBAAqB,GAAG,gBAAgB,CAAC,CAWlG;IAEJ;;OAEG;IACH,MAAM,CAAC,aAAa,GAClB,UAAU,IAAI,CAAC,qBAAqB,EAAE,OAAO,CAAC,KAC7C,KAAK,CAAC,KAAK,CAAC,qBAAqB,GAAG,gBAAgB,EAAE,KAAK,EAAE,YAAY,CAAC,CAQzE;IAEJ;;OAEG;IACH,MAAM,CAAC,GAAG,GACR,QAAQ,sBAAsB,KAC7B,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,iBAAiB,EAAE,wBAAwB,GAAG,qBAAqB,CAAC,CAInG;CACN"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=conversation.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation.test.d.ts","sourceRoot":"","sources":["../../../../src/conversation/conversation.test.ts"],"names":[],"mappings":""}
@@ -11,5 +11,7 @@ export declare const computeDiffsWithCursors: <T>(accessor: DocAccessor<T>, diff
11
11
  cursor: string;
12
12
  text: string;
13
13
  }[];
14
- export declare const applyDiffs: <T>(accessor: DocAccessor<T>, diffs: readonly string[]) => string;
14
+ export declare const applyDiffs: <T>(accessor: DocAccessor<T>, diffs: readonly string[], { errorOnNotFound }?: {
15
+ errorOnNotFound?: boolean;
16
+ }) => string;
15
17
  //# sourceMappingURL=diff.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../src/diff.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAiB,MAAM,eAAe,CAAC;AAS3D,MAAM,MAAM,IAAI,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,SAAS,MAAM,EAAE,KAAG,IAAI,EAyB1D,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,CAAC,EAAE,UAAU,WAAW,CAAC,CAAC,CAAC,EAAE,OAAO,SAAS,MAAM,EAAE;;;GAU5F,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,CAAC,EAAE,UAAU,WAAW,CAAC,CAAC,CAAC,EAAE,OAAO,SAAS,MAAM,EAAE,KAAG,MAgBlF,CAAC"}
1
+ {"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../src/diff.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAiB,MAAM,eAAe,CAAC;AAc3D,MAAM,MAAM,IAAI,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,SAAS,MAAM,EAAE,KAAG,IAAI,EA0B1D,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,CAAC,EAAE,UAAU,WAAW,CAAC,CAAC,CAAC,EAAE,OAAO,SAAS,MAAM,EAAE;;;GAU5F,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,CAAC,EAC1B,UAAU,WAAW,CAAC,CAAC,CAAC,EACxB,OAAO,SAAS,MAAM,EAAE,EACxB,sBAA6B;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAO,KAC9D,MAoBF,CAAC"}
@@ -1,30 +1,26 @@
1
1
  import { BaseError } from '@dxos/errors';
2
2
  declare const AiModelError_base: {
3
3
  new (options?: import("@dxos/errors").BaseErrorOptions): {
4
- "__#private@#code": "AI_MODEL_ERROR";
5
- "__#private@#context": Record<string, unknown>;
6
- readonly name: "AI_MODEL_ERROR";
4
+ name: "AiModelError";
5
+ context: Record<string, unknown>;
7
6
  readonly message: string;
8
- readonly code: "AI_MODEL_ERROR";
9
- readonly _tag: "AI_MODEL_ERROR";
10
- readonly context: Record<string, unknown>;
7
+ readonly _tag: "AiModelError";
11
8
  stack?: string;
12
9
  cause?: unknown;
13
10
  };
14
- code: "AI_MODEL_ERROR";
11
+ name: "AiModelError";
15
12
  is(error: unknown): error is BaseError;
16
- wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, "cause">): (error: unknown) => {
17
- "__#private@#code": "AI_MODEL_ERROR";
18
- "__#private@#context": Record<string, unknown>;
19
- readonly name: "AI_MODEL_ERROR";
13
+ wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, "cause"> & {
14
+ ifTypeDiffers?: boolean;
15
+ }): (error: unknown) => {
16
+ name: "AiModelError";
17
+ context: Record<string, unknown>;
20
18
  readonly message: string;
21
- readonly code: "AI_MODEL_ERROR";
22
- readonly _tag: "AI_MODEL_ERROR";
23
- readonly context: Record<string, unknown>;
19
+ readonly _tag: "AiModelError";
24
20
  stack?: string;
25
21
  cause?: unknown;
26
22
  };
27
- extend<Code extends string = string>(code: Code, message?: string): any;
23
+ extend<Name extends string = string>(name: Name, message?: string): any;
28
24
  isError(error: unknown): error is Error;
29
25
  captureStackTrace(targetObject: object, constructorOpt?: Function): void;
30
26
  prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
@@ -37,30 +33,26 @@ export declare class AiModelError extends AiModelError_base {
37
33
  }
38
34
  declare const AiAssistantError_base: {
39
35
  new (options?: import("@dxos/errors").BaseErrorOptions): {
40
- "__#private@#code": "AI_ASSISTANT_ERROR";
41
- "__#private@#context": Record<string, unknown>;
42
- readonly name: "AI_ASSISTANT_ERROR";
36
+ name: "AiAssistantError";
37
+ context: Record<string, unknown>;
43
38
  readonly message: string;
44
- readonly code: "AI_ASSISTANT_ERROR";
45
- readonly _tag: "AI_ASSISTANT_ERROR";
46
- readonly context: Record<string, unknown>;
39
+ readonly _tag: "AiAssistantError";
47
40
  stack?: string;
48
41
  cause?: unknown;
49
42
  };
50
- code: "AI_ASSISTANT_ERROR";
43
+ name: "AiAssistantError";
51
44
  is(error: unknown): error is BaseError;
52
- wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, "cause">): (error: unknown) => {
53
- "__#private@#code": "AI_ASSISTANT_ERROR";
54
- "__#private@#context": Record<string, unknown>;
55
- readonly name: "AI_ASSISTANT_ERROR";
45
+ wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, "cause"> & {
46
+ ifTypeDiffers?: boolean;
47
+ }): (error: unknown) => {
48
+ name: "AiAssistantError";
49
+ context: Record<string, unknown>;
56
50
  readonly message: string;
57
- readonly code: "AI_ASSISTANT_ERROR";
58
- readonly _tag: "AI_ASSISTANT_ERROR";
59
- readonly context: Record<string, unknown>;
51
+ readonly _tag: "AiAssistantError";
60
52
  stack?: string;
61
53
  cause?: unknown;
62
54
  };
63
- extend<Code extends string = string>(code: Code, message?: string): any;
55
+ extend<Name extends string = string>(name: Name, message?: string): any;
64
56
  isError(error: unknown): error is Error;
65
57
  captureStackTrace(targetObject: object, constructorOpt?: Function): void;
66
58
  prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/errors.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzC;;GAEG;AACH,qBAAa,YAAa,SAAQ,iBAAoD;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzF;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,qBAA4D;CAAG"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/errors.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;;;;;;;;;;;;;qBAWutB,CAAC;;;;;;;;;;;;;;;AATjwB;;GAEG;AACH,qBAAa,YAAa,SAAQ,iBAAkD;CAAG;;;;;;;;;;;;;qBAMyqB,CAAC;;;;;;;;;;;;;;;AAJjwB;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,qBAA0D;CAAG"}
@@ -1,5 +1,6 @@
1
- import { Obj } from '@dxos/echo';
1
+ import { type Entity } from '@dxos/echo';
2
2
  import { LogLevel } from '@dxos/log';
3
+ import { ContentBlock } from '@dxos/types';
3
4
  /**
4
5
  * Mercurial-style Commit.
5
6
  */
@@ -17,16 +18,18 @@ export type Commit = {
17
18
  * Models the execution graph based on a stream of events.
18
19
  */
19
20
  export declare class ExecutionGraph {
21
+ private readonly _skipBlocks;
20
22
  private _commits;
21
23
  private _branchNames;
22
24
  private _lastBlockId;
23
25
  private _toolCallCommitIds;
24
26
  private _lastCommitByBranch;
25
27
  private _pendingToolResults;
28
+ constructor(_skipBlocks?: ContentBlock.Any['_tag'][]);
26
29
  /**
27
30
  * Adds events to the graph.
28
31
  */
29
- addEvents(events: Obj.Any[]): void;
32
+ addEvents(events: Entity.Unknown[]): void;
30
33
  /**
31
34
  * Processes a message event and creates commits for its blocks.
32
35
  */
@@ -1 +1 @@
1
- {"version":3,"file":"execution-graph.d.ts","sourceRoot":"","sources":["../../../src/execution-graph.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,GAAG,EAAY,MAAM,YAAY,CAAC;AAG3C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAIrC;;GAEG;AAEH,MAAM,MAAM,MAAM,GAAG;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,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H,OAAO,CAAC,kBAAkB;IAO1B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAO9B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAIzB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAI3B;;OAEG;IACH,OAAO,CAAC,kBAAkB;CAK3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"extraction-llm-function.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-llm-function/extraction-llm-function.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,kBAAkB,EAAkB,MAAM,iBAAiB,CAAC;AAI1E,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAKlE,eAAO,MAAM,2BAA2B,EAAE,kBAAkB,CAAC,eAAe,EAAE,gBAAgB,CAoD5F,CAAC"}
1
+ {"version":3,"file":"extraction-llm-function.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-llm-function/extraction-llm-function.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,kBAAkB,EAAkB,MAAM,iBAAiB,CAAC;AAE1E,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAElE,eAAO,MAAM,2BAA2B,EAAE,kBAAkB,CAAC,eAAe,EAAE,gBAAgB,CAqD5F,CAAC"}