@dxos/assistant 0.8.4-main.5ea62a8 → 0.8.4-main.72ec0f3
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 +121 -164
- package/dist/lib/browser/extraction/index.mjs.map +4 -4
- package/dist/lib/browser/index.mjs +978 -157
- 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 +121 -164
- package/dist/lib/node-esm/extraction/index.mjs.map +4 -4
- package/dist/lib/node-esm/index.mjs +978 -157
- 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 +14 -7
- 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 +64 -53
- 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 +24 -13
- 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 +3 -3
- package/dist/types/src/session/version-pin.d.ts.map +1 -1
- package/dist/types/src/types/artifact.d.ts +20 -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 +49 -17
- 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 +16 -16
- 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 +7 -6
- 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 +4 -5
- 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 -3
- 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,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import { Message } from '@dxos/types';
|
|
3
|
+
import { type AiSessionRunError, type AiSessionRunParams } from './session';
|
|
3
4
|
/**
|
|
4
5
|
* Formats the system prompt.
|
|
5
6
|
*/
|
|
@@ -7,176 +8,5 @@ export declare const formatSystemPrompt: ({ system, blueprints, objects, }: Pick
|
|
|
7
8
|
/**
|
|
8
9
|
* Formats the user prompt.
|
|
9
10
|
*/
|
|
10
|
-
export declare const formatUserPrompt: ({ prompt, history }: Pick<AiSessionRunParams<any>, "prompt" | "history">) => Effect.Effect<
|
|
11
|
-
id: string;
|
|
12
|
-
parentMessage?: string | undefined;
|
|
13
|
-
created: string;
|
|
14
|
-
sender: {
|
|
15
|
-
name?: string | undefined;
|
|
16
|
-
contact?: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
17
|
-
fields?: {
|
|
18
|
-
readonly value: string;
|
|
19
|
-
readonly category?: string | undefined;
|
|
20
|
-
readonly label: string;
|
|
21
|
-
}[] | undefined;
|
|
22
|
-
image?: string | undefined;
|
|
23
|
-
fullName?: string | undefined;
|
|
24
|
-
preferredName?: string | undefined;
|
|
25
|
-
nickname?: string | undefined;
|
|
26
|
-
organization?: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
27
|
-
id: string;
|
|
28
|
-
name?: string | undefined;
|
|
29
|
-
description?: string | undefined;
|
|
30
|
-
status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
|
|
31
|
-
image?: string | undefined;
|
|
32
|
-
website?: string | undefined;
|
|
33
|
-
}> | undefined;
|
|
34
|
-
jobTitle?: string | undefined;
|
|
35
|
-
department?: string | undefined;
|
|
36
|
-
notes?: string | undefined;
|
|
37
|
-
emails?: {
|
|
38
|
-
readonly value: string;
|
|
39
|
-
readonly label?: string | undefined;
|
|
40
|
-
}[] | undefined;
|
|
41
|
-
identities?: {
|
|
42
|
-
readonly value: string;
|
|
43
|
-
readonly label?: string | undefined;
|
|
44
|
-
}[] | undefined;
|
|
45
|
-
phoneNumbers?: {
|
|
46
|
-
readonly value: string;
|
|
47
|
-
readonly label?: string | undefined;
|
|
48
|
-
}[] | undefined;
|
|
49
|
-
addresses?: {
|
|
50
|
-
readonly value: {
|
|
51
|
-
readonly street?: string | undefined;
|
|
52
|
-
readonly extended?: string | undefined;
|
|
53
|
-
readonly locality?: string | undefined;
|
|
54
|
-
readonly region?: string | undefined;
|
|
55
|
-
readonly postalCode?: string | undefined;
|
|
56
|
-
readonly postOfficeBoxNumber?: string | undefined;
|
|
57
|
-
readonly country?: string | undefined;
|
|
58
|
-
};
|
|
59
|
-
readonly label?: string | undefined;
|
|
60
|
-
}[] | undefined;
|
|
61
|
-
urls?: {
|
|
62
|
-
readonly value: string;
|
|
63
|
-
readonly label?: string | undefined;
|
|
64
|
-
}[] | undefined;
|
|
65
|
-
birthday?: string | undefined;
|
|
66
|
-
}> | undefined;
|
|
67
|
-
identityDid?: string | undefined;
|
|
68
|
-
identityKey?: string | undefined;
|
|
69
|
-
email?: string | undefined;
|
|
70
|
-
role?: "user" | "assistant" | undefined;
|
|
71
|
-
};
|
|
72
|
-
blocks: ({
|
|
73
|
-
version: unknown;
|
|
74
|
-
_tag: "anchor";
|
|
75
|
-
pending?: boolean | undefined;
|
|
76
|
-
objectId: string;
|
|
77
|
-
} | {
|
|
78
|
-
name?: string | undefined;
|
|
79
|
-
_tag: "file";
|
|
80
|
-
url: string;
|
|
81
|
-
pending?: boolean | undefined;
|
|
82
|
-
mediaType?: string | undefined;
|
|
83
|
-
} | {
|
|
84
|
-
id?: string | undefined;
|
|
85
|
-
source?: {
|
|
86
|
-
type: "base64";
|
|
87
|
-
mediaType: string;
|
|
88
|
-
data: string;
|
|
89
|
-
} | {
|
|
90
|
-
type: "http";
|
|
91
|
-
url: string;
|
|
92
|
-
} | undefined;
|
|
93
|
-
_tag: "image";
|
|
94
|
-
pending?: boolean | undefined;
|
|
95
|
-
} | {
|
|
96
|
-
_tag: "json";
|
|
97
|
-
pending?: boolean | undefined;
|
|
98
|
-
data: string;
|
|
99
|
-
disposition?: string | undefined;
|
|
100
|
-
} | {
|
|
101
|
-
text: string;
|
|
102
|
-
_tag: "proposal";
|
|
103
|
-
pending?: boolean | undefined;
|
|
104
|
-
} | {
|
|
105
|
-
_tag: "reasoning";
|
|
106
|
-
reasoningText?: string | undefined;
|
|
107
|
-
signature?: string | undefined;
|
|
108
|
-
redactedText?: string | undefined;
|
|
109
|
-
pending?: boolean | undefined;
|
|
110
|
-
} | {
|
|
111
|
-
_tag: "reference";
|
|
112
|
-
reference: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").Expando>;
|
|
113
|
-
pending?: boolean | undefined;
|
|
114
|
-
} | {
|
|
115
|
-
_tag: "select";
|
|
116
|
-
pending?: boolean | undefined;
|
|
117
|
-
options: readonly string[];
|
|
118
|
-
} | {
|
|
119
|
-
_tag: "status";
|
|
120
|
-
pending?: boolean | undefined;
|
|
121
|
-
statusText: string;
|
|
122
|
-
} | {
|
|
123
|
-
text: string;
|
|
124
|
-
_tag: "suggestion";
|
|
125
|
-
pending?: boolean | undefined;
|
|
126
|
-
} | {
|
|
127
|
-
_tag: "summary";
|
|
128
|
-
model?: string | undefined;
|
|
129
|
-
usage?: {
|
|
130
|
-
readonly inputTokens?: number | undefined;
|
|
131
|
-
readonly outputTokens?: number | undefined;
|
|
132
|
-
readonly totalTokens?: number | undefined;
|
|
133
|
-
} | undefined;
|
|
134
|
-
pending?: boolean | undefined;
|
|
135
|
-
mimeType?: string | undefined;
|
|
136
|
-
message?: string | undefined;
|
|
137
|
-
toolCalls?: number | undefined;
|
|
138
|
-
errors?: number | undefined;
|
|
139
|
-
duration?: number | undefined;
|
|
140
|
-
} | {
|
|
141
|
-
text: string;
|
|
142
|
-
_tag: "text";
|
|
143
|
-
pending?: boolean | undefined;
|
|
144
|
-
disposition?: string | undefined;
|
|
145
|
-
mimeType?: string | undefined;
|
|
146
|
-
} | {
|
|
147
|
-
_tag: "toolkit";
|
|
148
|
-
pending?: boolean | undefined;
|
|
149
|
-
} | {
|
|
150
|
-
name: string;
|
|
151
|
-
_tag: "toolCall";
|
|
152
|
-
pending?: boolean | undefined;
|
|
153
|
-
toolCallId: string;
|
|
154
|
-
input: string;
|
|
155
|
-
} | {
|
|
156
|
-
name: string;
|
|
157
|
-
_tag: "toolResult";
|
|
158
|
-
error?: string | undefined;
|
|
159
|
-
pending?: boolean | undefined;
|
|
160
|
-
toolCallId: string;
|
|
161
|
-
result?: string | undefined;
|
|
162
|
-
} | {
|
|
163
|
-
text: string;
|
|
164
|
-
_tag: "transcript";
|
|
165
|
-
pending?: boolean | undefined;
|
|
166
|
-
started: string;
|
|
167
|
-
})[];
|
|
168
|
-
properties?: {
|
|
169
|
-
[x: string]: any;
|
|
170
|
-
} | undefined;
|
|
171
|
-
}>, {
|
|
172
|
-
#code: "AI_ASSISTANT_ERROR";
|
|
173
|
-
#context: Record<string, unknown>;
|
|
174
|
-
readonly name: "AI_ASSISTANT_ERROR";
|
|
175
|
-
readonly code: "AI_ASSISTANT_ERROR";
|
|
176
|
-
readonly _tag: "AI_ASSISTANT_ERROR";
|
|
177
|
-
readonly context: Record<string, unknown>;
|
|
178
|
-
message: string;
|
|
179
|
-
stack?: string;
|
|
180
|
-
cause?: unknown;
|
|
181
|
-
}, never>;
|
|
11
|
+
export declare const formatUserPrompt: ({ prompt, history, }: Pick<AiSessionRunParams<any>, "prompt" | "history">) => Effect.Effect<Message.Message, AiSessionRunError>;
|
|
182
12
|
//# sourceMappingURL=format.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/session/format.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/session/format.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AASxC,OAAO,EAAqB,OAAO,EAAE,MAAM,aAAa,CAAC;AAMzD,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE5E;;GAEG;AAEH,eAAO,MAAM,kBAAkB,GAAI,kCAIhC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAC,wCAsCjE,CAAC;AAEL;;GAEG;AAGH,eAAO,MAAM,gBAAgB,GAAI,sBAG9B,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,iBAAiB,CAoCrG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/session/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/session/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAE9B,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
2
|
import { type AiParser, type ConsolePrinter } from '@dxos/ai';
|
|
3
|
-
import { type
|
|
3
|
+
import { type Message } from '@dxos/types';
|
|
4
4
|
/**
|
|
5
5
|
* Live observer of the generation process.
|
|
6
6
|
*/
|
|
@@ -9,7 +9,7 @@ export interface GenerationObserver extends AiParser.ParseResponseCallbacks {
|
|
|
9
9
|
* Complete messages fired during the session, both from the model and from the user.
|
|
10
10
|
* This message will contain all message blocks emitted through the `onBlock` callback.
|
|
11
11
|
*/
|
|
12
|
-
onMessage: (message:
|
|
12
|
+
onMessage: (message: Message.Message) => Effect.Effect<void>;
|
|
13
13
|
}
|
|
14
14
|
export declare const GenerationObserver: Readonly<{
|
|
15
15
|
make: ({ onBegin, onPart, onBlock, onEnd, onMessage, }?: Partial<GenerationObserver>) => GenerationObserver;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observer.d.ts","sourceRoot":"","sources":["../../../../src/session/observer.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"observer.d.ts","sourceRoot":"","sources":["../../../../src/session/observer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,QAAQ,CAAC,sBAAsB;IACzE;;;OAGG;IACH,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CAC9D;AAED,eAAO,MAAM,kBAAkB;6DAO1B,OAAO,CAAC,kBAAkB,CAAC,KAAQ,kBAAkB;;IAUxD;;OAEG;2BACoB,cAAc;EAiBrC,CAAC"}
|
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import type * as AiError from '@effect/ai/AiError';
|
|
2
|
+
import * as LanguageModel from '@effect/ai/LanguageModel';
|
|
3
|
+
import type * as Tool from '@effect/ai/Tool';
|
|
4
|
+
import type * as Toolkit from '@effect/ai/Toolkit';
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import type * as Schema from 'effect/Schema';
|
|
7
|
+
import { type AiToolNotFoundError, type PromptPreprocessingError, type ToolExecutionService, type ToolResolverService } from '@dxos/ai';
|
|
4
8
|
import { type Blueprint } from '@dxos/blueprints';
|
|
5
9
|
import { Obj } from '@dxos/echo';
|
|
6
10
|
import { TracingService } from '@dxos/functions';
|
|
7
|
-
import {
|
|
11
|
+
import { Message } from '@dxos/types';
|
|
8
12
|
import { type AiAssistantError } from '../errors';
|
|
9
13
|
import { GenerationObserver } from './observer';
|
|
10
|
-
export type AiSessionRunError = AiError.AiError |
|
|
11
|
-
export type AiSessionRunRequirements =
|
|
12
|
-
export type AiSessionRunParams<Tools extends
|
|
14
|
+
export type AiSessionRunError = AiError.AiError | PromptPreprocessingError | AiToolNotFoundError | AiAssistantError;
|
|
15
|
+
export type AiSessionRunRequirements = LanguageModel.LanguageModel | ToolExecutionService | ToolResolverService | TracingService;
|
|
16
|
+
export type AiSessionRunParams<Tools extends Record<string, Tool.Any>> = {
|
|
13
17
|
prompt: string;
|
|
14
18
|
system?: string;
|
|
15
|
-
history?:
|
|
19
|
+
history?: Message.Message[];
|
|
16
20
|
objects?: Obj.Any[];
|
|
17
21
|
blueprints?: Blueprint.Blueprint[];
|
|
18
|
-
toolkit?:
|
|
22
|
+
toolkit?: Toolkit.WithHandler<Tools>;
|
|
19
23
|
observer?: GenerationObserver;
|
|
20
24
|
};
|
|
21
25
|
export type AiSessionOptions = {};
|
|
@@ -38,10 +42,10 @@ export declare class AiSession {
|
|
|
38
42
|
/** Pending messages for this session (incl. the current prompt). */
|
|
39
43
|
private _pending;
|
|
40
44
|
constructor(_options?: AiSessionOptions);
|
|
41
|
-
run: <Tools extends
|
|
45
|
+
run: <Tools extends Record<string, Tool.Any>>({ prompt, system: systemTemplate, history, objects, blueprints, toolkit, observer, }: AiSessionRunParams<Tools>) => Effect.Effect<Message.Message[], AiSessionRunError, AiSessionRunRequirements>;
|
|
42
46
|
/**
|
|
43
47
|
* @deprecated
|
|
44
48
|
*/
|
|
45
|
-
runStructured<S extends Schema.Schema.AnyNoContext>(_schema: S, _options: AiSessionRunParams<
|
|
49
|
+
runStructured<S extends Schema.Schema.AnyNoContext>(_schema: S, _options: AiSessionRunParams<any>): Promise<Schema.Schema.Type<S>>;
|
|
46
50
|
}
|
|
47
51
|
//# sourceMappingURL=session.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../src/session/session.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../src/session/session.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,OAAO,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,aAAa,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAEnD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAG7C,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EAGzB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAGlD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,OAAO,GAAG,wBAAwB,GAAG,mBAAmB,GAAG,gBAAgB,CAAC;AAEpH,MAAM,MAAM,wBAAwB,GAChC,aAAa,CAAC,aAAa,GAC3B,oBAAoB,GACpB,mBAAmB,GACnB,cAAc,CAAC;AAEnB,MAAM,MAAM,kBAAkB,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI;IACvE,MAAM,EAAE,MAAM,CAAC;IAEf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,EAAE,CAAC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACrC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC;;;;;;;;;GASG;AACH,qBAAa,SAAS;IAWR,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAVrC,gDAAgD;IAChD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA2C;IAEtE,kCAAkC;IAElC,OAAO,CAAC,QAAQ,CAAyB;IAEzC,oEAAoE;IACpE,OAAO,CAAC,QAAQ,CAAyB;gBAEZ,QAAQ,GAAE,gBAAqB;IAE5D,GAAG,GAAI,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,sFAQ5C,kBAAkB,CAAC,KAAK,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,iBAAiB,EAAE,wBAAwB,CAAC,CA+FhC;IAE5E;;OAEG;IAEG,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,YAAY,EACtD,OAAO,EAAE,CAAC,EACV,QAAQ,EAAE,kBAAkB,CAAC,GAAG,CAAC,GAChC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CASlC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import type * as Tool from '@effect/ai/Tool';
|
|
2
|
+
import * as Toolkit from '@effect/ai/Toolkit';
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
import { type AiToolNotFoundError, ToolExecutionService, type ToolId, ToolResolverService } from '@dxos/ai';
|
|
4
5
|
import { type Blueprint } from '@dxos/blueprints';
|
|
5
|
-
export type ToolkitParams<Tools extends
|
|
6
|
-
toolkit?:
|
|
6
|
+
export type ToolkitParams<Tools extends Record<string, Tool.Any>> = {
|
|
7
|
+
toolkit?: Toolkit.Toolkit<Tools>;
|
|
7
8
|
toolIds?: ToolId[];
|
|
8
9
|
blueprints?: Blueprint.Blueprint[];
|
|
9
10
|
};
|
|
10
11
|
/**
|
|
11
12
|
* Build a combined toolkit from the blueprint tools and the provided toolkit.
|
|
12
13
|
*/
|
|
13
|
-
export declare const createToolkit: <Tools extends
|
|
14
|
+
export declare const createToolkit: <Tools extends Record<string, Tool.Any> = {}>({ toolkit: toolkitParam, toolIds, blueprints, }: ToolkitParams<Tools>) => Effect.Effect<Toolkit.WithHandler<any>, AiToolNotFoundError, ToolResolverService | ToolExecutionService | Tool.HandlersFor<Tools>>;
|
|
14
15
|
//# sourceMappingURL=toolkit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolkit.d.ts","sourceRoot":"","sources":["../../../../src/session/toolkit.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"toolkit.d.ts","sourceRoot":"","sources":["../../../../src/session/toolkit.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAE9C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,mBAAmB,EAAE,oBAAoB,EAAE,KAAK,MAAM,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC5G,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAGlD,MAAM,MAAM,aAAa,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI;IAClE,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,EAAE,CAAC;CACpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,iDAIxE,aAAa,CAAC,KAAK,CAAC,KAAG,MAAM,CAAC,MAAM,CACrC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,EACxB,mBAAmB,EACnB,mBAAmB,GAAG,oBAAoB,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAkBlE,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
import { type AnyEchoObject } from '@dxos/echo/internal';
|
|
2
3
|
import { type ObjectVersion } from '@dxos/echo-db';
|
|
3
|
-
import { type
|
|
4
|
-
import { type ContentBlock } from '@dxos/schema';
|
|
4
|
+
import { type ContentBlock } from '@dxos/types';
|
|
5
5
|
declare const VersionPinSchema: Schema.Struct<{
|
|
6
6
|
objectId: import("@dxos/keys").ObjectIdClass;
|
|
7
7
|
version: Schema.Schema<ObjectVersion, ObjectVersion, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-pin.d.ts","sourceRoot":"","sources":["../../../../src/session/version-pin.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"version-pin.d.ts","sourceRoot":"","sources":["../../../../src/session/version-pin.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,aAAa,EAAY,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,KAAK,aAAa,EAAc,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAKhD,QAAA,MAAM,gBAAgB;;;EAKpB,CAAC;AAEH;;;GAGG;AACH,MAAM,WAAW,UAAW,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC;CAAG;AAElF,eAAO,MAAM,UAAU,EAAE,OAAO,gBAAgB,GAAG;IACjD,WAAW,EAAE,aAAa,CAAC;IAC3B,UAAU,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,UAAU,CAAC;IAClD,WAAW,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK,YAAY,CAAC,GAAG,CAAC;CAiBpD,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type * as Effect from 'effect/Effect';
|
|
2
|
+
import * as Schema from 'effect/Schema';
|
|
3
|
+
import { type ObjectNotFoundError, type Type } from '@dxos/echo';
|
|
4
|
+
import { type ObjectId } from '@dxos/echo/internal';
|
|
5
|
+
import { DatabaseService } from '@dxos/echo-db';
|
|
6
|
+
import { DXN, type SpaceId } from '@dxos/keys';
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated
|
|
9
|
+
*/
|
|
10
|
+
export declare const createArtifactElement: (id: ObjectId) => string;
|
|
11
|
+
/**
|
|
12
|
+
* A model-friendly way to reference an object.
|
|
13
|
+
* Supports vairous formats that will be normalized to a DXN.
|
|
14
|
+
*/
|
|
15
|
+
export declare const ArtifactId: Schema.Schema<string> & {
|
|
16
|
+
toDXN: (reference: ArtifactId, owningSpaceId?: SpaceId) => DXN;
|
|
17
|
+
resolve: <S extends Type.Obj.Any | Type.Relation.Any>(schema: S, ref: ArtifactId) => Effect.Effect<Schema.Schema.Type<S>, ObjectNotFoundError, DatabaseService>;
|
|
18
|
+
};
|
|
19
|
+
export type ArtifactId = Schema.Schema.Type<typeof ArtifactId>;
|
|
20
|
+
//# sourceMappingURL=artifact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact.d.ts","sourceRoot":"","sources":["../../../../src/types/artifact.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,GAAG,EAAmB,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAGhE;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAI,IAAI,QAAQ,WAA4B,CAAC;AAE/E;;;GAGG;AAEH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG;IAC/C,KAAK,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,GAAG,CAAC;IAC/D,OAAO,EAAE,CAAC,CAAC,SAAS,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,EAClD,MAAM,EAAE,CAAC,EACT,GAAG,EAAE,UAAU,KACZ,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,mBAAmB,EAAE,eAAe,CAAC,CAAC;CAwCjF,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC"}
|