@dxos/assistant 0.8.4-main.5ea62a8 → 0.8.4-main.66e292d
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.
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/extraction/index.mjs +122 -165
- package/dist/lib/browser/extraction/index.mjs.map +4 -4
- package/dist/lib/browser/index.mjs +980 -160
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/extraction/index.mjs +122 -165
- package/dist/lib/node-esm/extraction/index.mjs.map +4 -4
- package/dist/lib/node-esm/index.mjs +980 -160
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/conversation/context.d.ts +47 -46
- package/dist/types/src/conversation/context.d.ts.map +1 -1
- package/dist/types/src/conversation/conversation.d.ts +11 -12
- package/dist/types/src/conversation/conversation.d.ts.map +1 -1
- package/dist/types/src/diff.d.ts.map +1 -1
- package/dist/types/src/errors.d.ts +38 -42
- package/dist/types/src/errors.d.ts.map +1 -1
- package/dist/types/src/execution-graph.d.ts +85 -0
- package/dist/types/src/execution-graph.d.ts.map +1 -0
- package/dist/types/src/execution-graph.test.d.ts +2 -0
- package/dist/types/src/execution-graph.test.d.ts.map +1 -0
- package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts +1 -1
- package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts.map +1 -1
- package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts +67 -55
- package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +1 -1
- package/dist/types/src/extraction/extraction-ner-function/named-entity-recognition.d.ts.map +1 -1
- package/dist/types/src/extraction/extraction.d.ts +111 -110
- package/dist/types/src/extraction/extraction.d.ts.map +1 -1
- package/dist/types/src/extraction/quotes.d.ts +1 -1
- package/dist/types/src/extraction/quotes.d.ts.map +1 -1
- package/dist/types/src/functions/services.d.ts +18 -5
- package/dist/types/src/functions/services.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/session/GenericToolkit.d.ts +84 -0
- package/dist/types/src/session/GenericToolkit.d.ts.map +1 -0
- package/dist/types/src/session/artifact-diff.d.ts +2 -2
- package/dist/types/src/session/artifact-diff.d.ts.map +1 -1
- package/dist/types/src/session/error-handling.d.ts +2 -2
- package/dist/types/src/session/error-handling.d.ts.map +1 -1
- package/dist/types/src/session/format.d.ts +4 -174
- package/dist/types/src/session/format.d.ts.map +1 -1
- package/dist/types/src/session/index.d.ts +1 -0
- package/dist/types/src/session/index.d.ts.map +1 -1
- package/dist/types/src/session/observer.d.ts +3 -3
- package/dist/types/src/session/observer.d.ts.map +1 -1
- package/dist/types/src/session/session.d.ts +15 -11
- package/dist/types/src/session/session.d.ts.map +1 -1
- package/dist/types/src/session/toolkit.d.ts +7 -6
- package/dist/types/src/session/toolkit.d.ts.map +1 -1
- package/dist/types/src/session/version-pin.d.ts +4 -4
- package/dist/types/src/session/version-pin.d.ts.map +1 -1
- package/dist/types/src/types/artifact.d.ts +19 -0
- package/dist/types/src/types/artifact.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +29 -32
- package/src/conversation/context.ts +54 -23
- package/src/conversation/conversation.ts +30 -25
- package/src/diff.test.ts +3 -3
- package/src/diff.ts +7 -0
- package/src/errors.ts +4 -4
- package/src/execution-graph.test.ts +740 -0
- package/src/execution-graph.ts +509 -0
- package/src/extraction/extraction-llm-function/extraction-llm-function.test.ts +9 -9
- package/src/extraction/extraction-llm-function/extraction-llm-function.ts +47 -55
- package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +17 -17
- package/src/extraction/extraction-ner-function/extraction-ner-function.ts +42 -43
- package/src/extraction/extraction-ner-function/named-entity-recognition.test.ts +12 -6
- package/src/extraction/extraction-ner-function/named-entity-recognition.ts +2 -0
- package/src/extraction/extraction.ts +8 -7
- package/src/extraction/quotes.test.ts +2 -2
- package/src/extraction/quotes.ts +3 -3
- package/src/functions/services.ts +93 -50
- package/src/index.ts +2 -1
- package/src/session/GenericToolkit.ts +130 -0
- package/src/session/artifact-diff.ts +2 -2
- package/src/session/error-handling.ts +11 -6
- package/src/session/format.test.ts +5 -4
- package/src/session/format.ts +19 -14
- package/src/session/index.ts +2 -0
- package/src/session/observer.ts +4 -3
- package/src/session/session.conversations.json +1 -0
- package/src/session/session.test.ts +51 -210
- package/src/session/session.ts +41 -29
- package/src/session/toolkit.ts +19 -13
- package/src/session/version-pin.ts +7 -7
- package/src/templates/{format.tpl → instructions/format.tpl} +4 -2
- package/src/templates/{system.tpl → instructions/system.tpl} +10 -12
- package/src/templates/system.ts +2 -2
- package/src/{types.ts → types/artifact.ts} +22 -4
- package/src/types/index.ts +5 -0
- package/dist/lib/browser/chunk-6WRGDEMH.mjs +0 -89
- package/dist/lib/browser/chunk-6WRGDEMH.mjs.map +0 -7
- package/dist/lib/browser/chunk-N4O3C3T5.mjs +0 -396
- package/dist/lib/browser/chunk-N4O3C3T5.mjs.map +0 -7
- package/dist/lib/browser/named-entity-recognition-O46UTCLR.mjs +0 -13
- package/dist/lib/node-esm/chunk-3UU5V4FS.mjs +0 -91
- package/dist/lib/node-esm/chunk-3UU5V4FS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QVJ7EAM2.mjs +0 -398
- package/dist/lib/node-esm/chunk-QVJ7EAM2.mjs.map +0 -7
- package/dist/lib/node-esm/named-entity-recognition-W4VMRCH6.mjs +0 -14
- package/dist/types/src/session/version-pin.test.d.ts +0 -2
- package/dist/types/src/session/version-pin.test.d.ts.map +0 -1
- package/dist/types/src/summarization/summarization.test.d.ts +0 -2
- package/dist/types/src/summarization/summarization.test.d.ts.map +0 -1
- package/dist/types/src/types.d.ts +0 -16
- package/dist/types/src/types.d.ts.map +0 -1
- package/src/session/__snapshots__/session.test.ts.snap +0 -32
- package/src/session/version-pin.test.ts +0 -7
- package/src/summarization/summarization.test.ts +0 -197
- /package/dist/lib/browser/{named-entity-recognition-O46UTCLR.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/node-esm/{named-entity-recognition-W4VMRCH6.mjs.map → chunk-HSLMI22Q.mjs.map} +0 -0
- /package/src/extraction/extraction-llm-function/{instructions.tpl → transcription-instructions.tpl} +0 -0
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type ReadonlySignal } from '@preact/signals-core';
|
|
2
|
-
import
|
|
2
|
+
import * as Context from 'effect/Context';
|
|
3
|
+
import * as Schema from 'effect/Schema';
|
|
3
4
|
import { Blueprint } from '@dxos/blueprints';
|
|
4
|
-
import {
|
|
5
|
+
import { Resource } from '@dxos/context';
|
|
6
|
+
import { DXN, type Entity, Obj, type Ref, Type } from '@dxos/echo';
|
|
5
7
|
import { type Queue } from '@dxos/echo-db';
|
|
6
8
|
import { ComplexSet } from '@dxos/util';
|
|
7
9
|
/**
|
|
@@ -9,59 +11,53 @@ import { ComplexSet } from '@dxos/util';
|
|
|
9
11
|
*/
|
|
10
12
|
export declare const ContextBinding: Type.obj<Schema.Struct<{
|
|
11
13
|
blueprints: Schema.Struct<{
|
|
12
|
-
added: Schema.Array$<
|
|
13
|
-
key:
|
|
14
|
-
name:
|
|
15
|
-
description
|
|
16
|
-
instructions:
|
|
17
|
-
source:
|
|
14
|
+
added: Schema.Array$<import("@dxos/echo/internal").RefSchema<Entity.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
15
|
+
key: string;
|
|
16
|
+
name: string;
|
|
17
|
+
description?: string | undefined;
|
|
18
|
+
instructions: {
|
|
19
|
+
source: import("@dxos/echo/internal").Ref<Entity.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
18
20
|
content: string;
|
|
19
|
-
}
|
|
20
|
-
inputs
|
|
21
|
-
name:
|
|
22
|
-
kind
|
|
23
|
-
default
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
tools:
|
|
27
|
-
}
|
|
28
|
-
removed: Schema.Array$<
|
|
29
|
-
key:
|
|
30
|
-
name:
|
|
31
|
-
description
|
|
32
|
-
instructions:
|
|
33
|
-
source:
|
|
21
|
+
}>;
|
|
22
|
+
inputs?: {
|
|
23
|
+
name: string;
|
|
24
|
+
kind?: "function" | "value" | "pass-through" | "retriever" | "query" | "resolver" | "context" | "schema" | undefined;
|
|
25
|
+
default?: any;
|
|
26
|
+
}[] | undefined;
|
|
27
|
+
};
|
|
28
|
+
tools: (string & import("effect/Brand").Brand<"ToolId">)[];
|
|
29
|
+
}>>;
|
|
30
|
+
removed: Schema.Array$<import("@dxos/echo/internal").RefSchema<Entity.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
31
|
+
key: string;
|
|
32
|
+
name: string;
|
|
33
|
+
description?: string | undefined;
|
|
34
|
+
instructions: {
|
|
35
|
+
source: import("@dxos/echo/internal").Ref<Entity.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
34
36
|
content: string;
|
|
35
|
-
}
|
|
36
|
-
inputs
|
|
37
|
-
name:
|
|
38
|
-
kind
|
|
39
|
-
default
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
tools:
|
|
43
|
-
}
|
|
37
|
+
}>;
|
|
38
|
+
inputs?: {
|
|
39
|
+
name: string;
|
|
40
|
+
kind?: "function" | "value" | "pass-through" | "retriever" | "query" | "resolver" | "context" | "schema" | undefined;
|
|
41
|
+
default?: any;
|
|
42
|
+
}[] | undefined;
|
|
43
|
+
};
|
|
44
|
+
tools: (string & import("effect/Brand").Brand<"ToolId">)[];
|
|
45
|
+
}>>;
|
|
44
46
|
}>;
|
|
45
47
|
objects: Schema.Struct<{
|
|
46
|
-
added: Schema.Array$<
|
|
47
|
-
|
|
48
|
-
id: string;
|
|
49
|
-
}, never>>>;
|
|
50
|
-
removed: Schema.Array$<Type.ref<Schema.Schema<Type.Expando, {
|
|
51
|
-
[x: string]: any;
|
|
52
|
-
id: string;
|
|
53
|
-
}, never>>>;
|
|
48
|
+
added: Schema.Array$<import("@dxos/echo/internal").RefSchema<Entity.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {}>>;
|
|
49
|
+
removed: Schema.Array$<import("@dxos/echo/internal").RefSchema<Entity.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {}>>;
|
|
54
50
|
}>;
|
|
55
51
|
}>>;
|
|
56
52
|
export interface ContextBinding extends Schema.Schema.Type<typeof ContextBinding> {
|
|
57
53
|
}
|
|
58
54
|
export type BindingProps = Partial<{
|
|
59
55
|
blueprints: Ref.Ref<Blueprint.Blueprint>[];
|
|
60
|
-
objects: Ref.Ref<
|
|
56
|
+
objects: Ref.Ref<Obj.Any>[];
|
|
61
57
|
}>;
|
|
62
58
|
export declare class Bindings {
|
|
63
59
|
readonly blueprints: ComplexSet<Ref.Ref<Blueprint.Blueprint>>;
|
|
64
|
-
readonly objects: ComplexSet<Ref.Ref<
|
|
60
|
+
readonly objects: ComplexSet<Ref.Ref<Obj.Any>>;
|
|
65
61
|
toJSON(): {
|
|
66
62
|
blueprints: DXN.String[];
|
|
67
63
|
objects: DXN.String[];
|
|
@@ -70,15 +66,20 @@ export declare class Bindings {
|
|
|
70
66
|
/**
|
|
71
67
|
* Manages bindings of blueprints and objects to a conversation.
|
|
72
68
|
*/
|
|
73
|
-
export declare class AiContextBinder {
|
|
69
|
+
export declare class AiContextBinder extends Resource {
|
|
74
70
|
private readonly _queue;
|
|
75
71
|
/**
|
|
76
72
|
* Reactive query of all bindings.
|
|
77
73
|
*/
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
private _bindings?;
|
|
75
|
+
private _blueprints?;
|
|
76
|
+
private _objects?;
|
|
81
77
|
constructor(_queue: Queue);
|
|
78
|
+
get bindings(): ReadonlySignal<Bindings>;
|
|
79
|
+
get blueprints(): ReadonlySignal<Ref.Ref<Blueprint.Blueprint>[]>;
|
|
80
|
+
get objects(): ReadonlySignal<Ref.Ref<Obj.Any>[]>;
|
|
81
|
+
protected _open(): Promise<void>;
|
|
82
|
+
protected _close(): Promise<void>;
|
|
82
83
|
/**
|
|
83
84
|
* Asynchronous query of all bindings.
|
|
84
85
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/conversation/context.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAY,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/conversation/context.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAY,MAAM,sBAAsB,CAAC;AAErE,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAE1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,KAAK,MAAM,EAAU,GAAG,EAAS,KAAK,GAAG,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClF,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC;;GAEG;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAe1B,CAAC;AAEF,MAAM,WAAW,cAAe,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,cAAc,CAAC;CAAG;AAEpF,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC;IACjC,UAAU,EAAE,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC;IAC3C,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;CAC7B,CAAC,CAAC;AAEH,qBAAa,QAAQ;IACnB,QAAQ,CAAC,UAAU,2CAA6E;IAEhG,QAAQ,CAAC,OAAO,+BAA0E;IAE1F,MAAM;;;;CAMP;AAED;;GAEG;AAEH,qBAAa,eAAgB,SAAQ,QAAQ;IAS/B,OAAO,CAAC,QAAQ,CAAC,MAAM;IARnC;;OAEG;IAEH,OAAO,CAAC,SAAS,CAAC,CAA2B;IAC7C,OAAO,CAAC,WAAW,CAAC,CAAiD;IACrE,OAAO,CAAC,QAAQ,CAAC,CAAqC;gBAEzB,MAAM,EAAE,KAAK;IAI1C,IAAI,QAAQ,6BAGX;IAED,IAAI,UAAU,mDAGb;IAED,IAAI,OAAO,uCAGV;cAGwB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;cAQtB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAMhD;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC;IAM1B,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAyBxC,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBhD,OAAO,CAAC,OAAO;CAmBhB;;YAKW,eAAe;;AAH3B,qBAAa,gBAAiB,SAAQ,qBAKnC;CAAG"}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import type * as Toolkit from '@effect/ai/Toolkit';
|
|
2
|
+
import * as Effect from 'effect/Effect';
|
|
3
|
+
import { Resource } from '@dxos/context';
|
|
3
4
|
import { type Queue } from '@dxos/echo-db';
|
|
4
|
-
import {
|
|
5
|
+
import { Message } from '@dxos/types';
|
|
5
6
|
import { type AiSessionRunError, type AiSessionRunRequirements, type GenerationObserver } from '../session';
|
|
6
7
|
import { AiContextBinder, type ContextBinding } from './context';
|
|
7
|
-
export type AiConversationRunRequirements<Tools extends AiTool.Any> = AiSessionRunRequirements | AiTool.ToHandler<Tools>;
|
|
8
8
|
export interface AiConversationRunParams {
|
|
9
9
|
prompt: string;
|
|
10
10
|
system?: string;
|
|
11
11
|
observer?: GenerationObserver;
|
|
12
12
|
}
|
|
13
|
-
export type AiConversationOptions = {
|
|
14
|
-
queue: Queue<DataType.Message | ContextBinding>;
|
|
15
|
-
};
|
|
16
13
|
/**
|
|
17
14
|
* Durable conversation state (initiated by users and agents) backed by a Queue.
|
|
18
15
|
* Executes tools based on AI responses and supports cancellation of in-progress requests.
|
|
19
16
|
*/
|
|
20
|
-
export declare class AiConversation {
|
|
17
|
+
export declare class AiConversation extends Resource {
|
|
21
18
|
/**
|
|
22
19
|
* Message and binding queue.
|
|
23
20
|
*/
|
|
@@ -30,13 +27,15 @@ export declare class AiConversation {
|
|
|
30
27
|
* Toolkit from the current session request.
|
|
31
28
|
*/
|
|
32
29
|
private _toolkit;
|
|
33
|
-
constructor(
|
|
30
|
+
constructor(queue: Queue<Message.Message | ContextBinding>);
|
|
31
|
+
protected _open(): Promise<void>;
|
|
32
|
+
protected _close(): Promise<void>;
|
|
34
33
|
get context(): AiContextBinder;
|
|
35
|
-
get toolkit():
|
|
36
|
-
getHistory(): Promise<
|
|
34
|
+
get toolkit(): Toolkit.WithHandler<any> | undefined;
|
|
35
|
+
getHistory(): Promise<Message.Message[]>;
|
|
37
36
|
/**
|
|
38
37
|
* Creates a new cancelable request effect.
|
|
39
38
|
*/
|
|
40
|
-
createRequest
|
|
39
|
+
createRequest(params: AiConversationRunParams): Effect.Effect<Message.Message[], AiSessionRunError, AiSessionRunRequirements>;
|
|
41
40
|
}
|
|
42
41
|
//# sourceMappingURL=conversation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../src/conversation/conversation.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
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;AAGxC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EAExB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,eAAe,EAAoB,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAEnF,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B;AAED;;;GAGG;AACH,qBAAa,cAAe,SAAQ,QAAQ;IAC1C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0C;IAEjE;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAE3C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAuC;gBAEpC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,GAAG,cAAc,CAAC;cAMxC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;cAKtB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAIhD,IAAW,OAAO,oBAEjB;IAED,IAAW,OAAO,yCAEjB;IAEY,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;IAKrD;;OAEG;IACH,aAAa,CACX,MAAM,EAAE,uBAAuB,GAC9B,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,iBAAiB,EAAE,wBAAwB,CAAC;CA0CjF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../src/diff.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAiB,MAAM,eAAe,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,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,75 +1,71 @@
|
|
|
1
1
|
import { BaseError } from '@dxos/errors';
|
|
2
|
-
declare const
|
|
3
|
-
new (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
readonly name: "
|
|
7
|
-
readonly
|
|
8
|
-
readonly _tag: "
|
|
9
|
-
readonly context: Record<string, unknown>;
|
|
10
|
-
message: string;
|
|
2
|
+
declare const AiModelError_base: {
|
|
3
|
+
new (options?: import("@dxos/errors").BaseErrorOptions): {
|
|
4
|
+
code: "AI_MODEL_ERROR";
|
|
5
|
+
context: Record<string, unknown>;
|
|
6
|
+
readonly name: "AI_MODEL_ERROR";
|
|
7
|
+
readonly message: string;
|
|
8
|
+
readonly _tag: "AI_MODEL_ERROR";
|
|
11
9
|
stack?: string;
|
|
12
10
|
cause?: unknown;
|
|
13
11
|
};
|
|
14
|
-
code: "
|
|
12
|
+
code: "AI_MODEL_ERROR";
|
|
15
13
|
is(error: unknown): error is BaseError;
|
|
16
|
-
wrap(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
readonly
|
|
22
|
-
readonly
|
|
23
|
-
|
|
14
|
+
wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, "cause"> & {
|
|
15
|
+
ifTypeDiffers?: boolean;
|
|
16
|
+
}): (error: unknown) => {
|
|
17
|
+
code: "AI_MODEL_ERROR";
|
|
18
|
+
context: Record<string, unknown>;
|
|
19
|
+
readonly name: "AI_MODEL_ERROR";
|
|
20
|
+
readonly message: string;
|
|
21
|
+
readonly _tag: "AI_MODEL_ERROR";
|
|
24
22
|
stack?: string;
|
|
25
23
|
cause?: unknown;
|
|
26
24
|
};
|
|
27
|
-
extend<Code extends string>(code: Code): any;
|
|
25
|
+
extend<Code extends string = string>(code: Code, message?: string): any;
|
|
28
26
|
isError(error: unknown): error is Error;
|
|
29
27
|
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
30
28
|
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
31
29
|
stackTraceLimit: number;
|
|
32
30
|
};
|
|
33
31
|
/**
|
|
34
|
-
* Generic error
|
|
32
|
+
* Generic error from AI model.
|
|
35
33
|
*/
|
|
36
|
-
export declare class
|
|
34
|
+
export declare class AiModelError extends AiModelError_base {
|
|
37
35
|
}
|
|
38
|
-
declare const
|
|
39
|
-
new (
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
readonly name: "
|
|
43
|
-
readonly
|
|
44
|
-
readonly _tag: "
|
|
45
|
-
readonly context: Record<string, unknown>;
|
|
46
|
-
message: string;
|
|
36
|
+
declare const AiAssistantError_base: {
|
|
37
|
+
new (options?: import("@dxos/errors").BaseErrorOptions): {
|
|
38
|
+
code: "AI_ASSISTANT_ERROR";
|
|
39
|
+
context: Record<string, unknown>;
|
|
40
|
+
readonly name: "AI_ASSISTANT_ERROR";
|
|
41
|
+
readonly message: string;
|
|
42
|
+
readonly _tag: "AI_ASSISTANT_ERROR";
|
|
47
43
|
stack?: string;
|
|
48
44
|
cause?: unknown;
|
|
49
45
|
};
|
|
50
|
-
code: "
|
|
46
|
+
code: "AI_ASSISTANT_ERROR";
|
|
51
47
|
is(error: unknown): error is BaseError;
|
|
52
|
-
wrap(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
readonly
|
|
58
|
-
readonly
|
|
59
|
-
|
|
48
|
+
wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, "cause"> & {
|
|
49
|
+
ifTypeDiffers?: boolean;
|
|
50
|
+
}): (error: unknown) => {
|
|
51
|
+
code: "AI_ASSISTANT_ERROR";
|
|
52
|
+
context: Record<string, unknown>;
|
|
53
|
+
readonly name: "AI_ASSISTANT_ERROR";
|
|
54
|
+
readonly message: string;
|
|
55
|
+
readonly _tag: "AI_ASSISTANT_ERROR";
|
|
60
56
|
stack?: string;
|
|
61
57
|
cause?: unknown;
|
|
62
58
|
};
|
|
63
|
-
extend<Code extends string>(code: Code): any;
|
|
59
|
+
extend<Code extends string = string>(code: Code, message?: string): any;
|
|
64
60
|
isError(error: unknown): error is Error;
|
|
65
61
|
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
66
62
|
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
67
63
|
stackTraceLimit: number;
|
|
68
64
|
};
|
|
69
65
|
/**
|
|
70
|
-
*
|
|
66
|
+
* Generic error for AI agent execution.
|
|
71
67
|
*/
|
|
72
|
-
export declare class
|
|
68
|
+
export declare class AiAssistantError extends AiAssistantError_base {
|
|
73
69
|
}
|
|
74
70
|
export {};
|
|
75
71
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/errors.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/errors.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;;;;;;;;;;;;;;qBAWivB,CAAC;;;;;;;;;;;;;;;;AAT3xB;;GAEG;AACH,qBAAa,YAAa,SAAQ,iBAAoD;CAAG;;;;;;;;;;;;;;qBAMisB,CAAC;;;;;;;;;;;;;;;;AAJ3xB;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,qBAA4D;CAAG"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { type Entity } from '@dxos/echo';
|
|
2
|
+
import { LogLevel } from '@dxos/log';
|
|
3
|
+
import { ContentBlock } from '@dxos/types';
|
|
4
|
+
/**
|
|
5
|
+
* Mercurial-style Commit.
|
|
6
|
+
*/
|
|
7
|
+
export type Commit = {
|
|
8
|
+
id: string;
|
|
9
|
+
parents: string[];
|
|
10
|
+
branch: string;
|
|
11
|
+
icon?: string;
|
|
12
|
+
level?: LogLevel;
|
|
13
|
+
message: string;
|
|
14
|
+
timestamp?: Date;
|
|
15
|
+
tags?: string[];
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Models the execution graph based on a stream of events.
|
|
19
|
+
*/
|
|
20
|
+
export declare class ExecutionGraph {
|
|
21
|
+
private readonly _skipBlocks;
|
|
22
|
+
private _commits;
|
|
23
|
+
private _branchNames;
|
|
24
|
+
private _lastBlockId;
|
|
25
|
+
private _toolCallCommitIds;
|
|
26
|
+
private _lastCommitByBranch;
|
|
27
|
+
private _pendingToolResults;
|
|
28
|
+
constructor(_skipBlocks?: ContentBlock.Any['_tag'][]);
|
|
29
|
+
/**
|
|
30
|
+
* Adds events to the graph.
|
|
31
|
+
*/
|
|
32
|
+
addEvents(events: Entity.Unknown[]): void;
|
|
33
|
+
/**
|
|
34
|
+
* Processes a message event and creates commits for its blocks.
|
|
35
|
+
*/
|
|
36
|
+
private _processMessage;
|
|
37
|
+
/**
|
|
38
|
+
* Processes an AgentStatus event.
|
|
39
|
+
*/
|
|
40
|
+
private _processAgentStatus;
|
|
41
|
+
/**
|
|
42
|
+
* Stable sort: objects with 'created' field are sorted by it, others remain in place.
|
|
43
|
+
*/
|
|
44
|
+
private sortObjectsByCreated;
|
|
45
|
+
/**
|
|
46
|
+
* Returns the current state of the graph.
|
|
47
|
+
*/
|
|
48
|
+
getGraph(lastRequest?: boolean): {
|
|
49
|
+
branches: string[];
|
|
50
|
+
commits: Commit[];
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Tracks tool calls and handles pending tool result updates.
|
|
54
|
+
*/
|
|
55
|
+
private _trackToolCalls;
|
|
56
|
+
/**
|
|
57
|
+
* Updates pending tool results to point to an AgentStatus event.
|
|
58
|
+
*/
|
|
59
|
+
private _updatePendingToolResults;
|
|
60
|
+
/**
|
|
61
|
+
* Handles late updates when AgentStatus is processed before tool result.
|
|
62
|
+
*/
|
|
63
|
+
private _handleLateToolResultUpdate;
|
|
64
|
+
/**
|
|
65
|
+
* Gets the branch name for a tool call.
|
|
66
|
+
*/
|
|
67
|
+
private _getToolCallBranch;
|
|
68
|
+
/**
|
|
69
|
+
* Gets the parents for an AgentStatus commit.
|
|
70
|
+
*/
|
|
71
|
+
private _getAgentStatusParents;
|
|
72
|
+
/**
|
|
73
|
+
* Checks if a commit is a tool call commit.
|
|
74
|
+
*/
|
|
75
|
+
private _isToolCallCommit;
|
|
76
|
+
/**
|
|
77
|
+
* Checks if a commit is a tool result commit.
|
|
78
|
+
*/
|
|
79
|
+
private _isToolResultCommit;
|
|
80
|
+
/**
|
|
81
|
+
* Extracts tool call ID from a commit ID.
|
|
82
|
+
*/
|
|
83
|
+
private _extractToolCallId;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=execution-graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-graph.d.ts","sourceRoot":"","sources":["../../../src/execution-graph.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,MAAM,EAAiB,MAAM,YAAY,CAAC;AAGxD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,YAAY,EAAW,MAAM,aAAa,CAAC;AAKpD;;GAEG;AAEH,MAAM,MAAM,MAAM,GAAG;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAqBF;;GAEG;AACH,qBAAa,cAAc;IAWb,OAAO,CAAC,QAAQ,CAAC,WAAW;IATxC,OAAO,CAAC,QAAQ,CAAgB;IAChC,OAAO,CAAC,YAAY,CAAqB;IACzC,OAAO,CAAC,YAAY,CAAqB;IAGzC,OAAO,CAAC,kBAAkB,CAA6B;IACvD,OAAO,CAAC,mBAAmB,CAA6B;IACxD,OAAO,CAAC,mBAAmB,CAA6B;gBAE3B,WAAW,GAAE,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,EAAgB;IAElF;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE;IAWlC;;OAEG;IACH,OAAO,CAAC,eAAe;IAsBvB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAyB3B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAyB5B;;OAEG;IACH,QAAQ,CAAC,WAAW,UAAQ,GAAG;QAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE;IAUxE;;OAEG;IACH,OAAO,CAAC,eAAe;IAqBvB;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAmBjC;;OAEG;IACH,OAAO,CAAC,2BAA2B;IAoBnC;;OAEG;IACH,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-graph.test.d.ts","sourceRoot":"","sources":["../../../src/execution-graph.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type FunctionDefinition } from '@dxos/functions';
|
|
2
2
|
import { ExtractionInput, ExtractionOutput } from '../extraction';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const extractionAnthropicFunction: FunctionDefinition<ExtractionInput, ExtractionOutput>;
|
|
4
4
|
//# sourceMappingURL=extraction-llm-function.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extraction-llm-function.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-llm-function/extraction-llm-function.ts"],"names":[],"mappings":"
|
|
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"}
|