@dxos/assistant 0.8.2-main.12df754 → 0.8.2-main.2f9c567
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-DEIGOD4U.mjs → chunk-OLO6SVOL.mjs} +21 -21
- package/dist/lib/browser/chunk-OLO6SVOL.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +272 -152
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +82 -86
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node/{chunk-7VH7NMIM.cjs → chunk-CI5Q7FBG.cjs} +6 -6
- package/dist/lib/node/chunk-CI5Q7FBG.cjs.map +7 -0
- package/dist/lib/node/index.cjs +300 -183
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +72 -77
- package/dist/lib/node/testing/index.cjs.map +3 -3
- package/dist/lib/node-esm/{chunk-7JI4MDGL.mjs → chunk-Y3SYOFFJ.mjs} +21 -21
- package/dist/lib/node-esm/chunk-Y3SYOFFJ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +272 -152
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +82 -86
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/types/src/ai-service/types.d.ts +133 -133
- package/dist/types/src/ai-service/types.d.ts.map +1 -1
- package/dist/types/src/conversation/types.d.ts +9 -9
- package/dist/types/src/conversation/types.d.ts.map +1 -1
- package/dist/types/src/cypher/echo-data-source.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/session.d.ts +32 -7
- package/dist/types/src/session/session.d.ts.map +1 -1
- package/dist/types/src/session/version-pin.d.ts +17 -0
- package/dist/types/src/session/version-pin.d.ts.map +1 -0
- package/dist/types/src/session/version-pin.test.d.ts +2 -0
- package/dist/types/src/session/version-pin.test.d.ts.map +1 -0
- package/dist/types/src/testing/query-promts.d.ts +3 -3
- package/dist/types/src/testing/query-promts.d.ts.map +1 -1
- package/dist/types/src/testing/test-data.d.ts +4 -4
- package/dist/types/src/testing/test-data.d.ts.map +1 -1
- package/dist/types/src/testing/test-schema.d.ts +25 -23
- package/dist/types/src/testing/test-schema.d.ts.map +1 -1
- package/package.json +15 -14
- package/src/ai-service/client.test.ts +5 -5
- package/src/ai-service/ollama-client.ts +7 -7
- package/src/ai-service/types.ts +14 -14
- package/src/bin/chat.ts +2 -2
- package/src/conversation/conversation.test.ts +3 -3
- package/src/conversation/types.ts +10 -10
- package/src/cypher/combinators.test.ts +4 -4
- package/src/cypher/echo-data-source.ts +7 -5
- package/src/cypher/execution-plan.test.ts +1 -1
- package/src/cypher/query-executor.test.ts +1 -1
- package/src/cypher/schema.test.ts +3 -3
- package/src/session/index.ts +1 -0
- package/src/session/session.test.ts +24 -17
- package/src/session/session.ts +285 -149
- package/src/session/version-pin.test.ts +26 -0
- package/src/session/version-pin.ts +43 -0
- package/src/testing/artifacts.test.ts +22 -22
- package/src/testing/query-promts.ts +5 -5
- package/src/testing/query.test.ts +3 -3
- package/src/testing/test-data.ts +62 -55
- package/src/testing/test-schema.ts +28 -29
- package/dist/lib/browser/chunk-DEIGOD4U.mjs.map +0 -7
- package/dist/lib/node/chunk-7VH7NMIM.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-7JI4MDGL.mjs.map +0 -7
|
@@ -1,178 +1,178 @@
|
|
|
1
|
-
import { Schema
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
2
|
import { Message, type MessageContentBlock } from '@dxos/artifact';
|
|
3
3
|
import { type ObjectId } from '@dxos/echo-schema';
|
|
4
4
|
export declare const createArtifactElement: (id: ObjectId) => string;
|
|
5
|
-
export declare const LLMModel:
|
|
6
|
-
export type LLMModel =
|
|
5
|
+
export declare const LLMModel: Schema.Literal<["@anthropic/claude-3-5-haiku-20241022", "@anthropic/claude-3-5-sonnet-20241022", "@anthropic/claude-3-7-sonnet-20250219", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@hf/nousresearch/hermes-2-pro-mistral-7b", "@ollama/llama-3-1-nemotron-70b-instruct", "@ollama/llama-3-1-nemotron-mini-4b-instruct", "@ollama/llama-3-2-3b", "llama3.2:1b", "llama3:70b", "deepseek-r1:latest"]>;
|
|
6
|
+
export type LLMModel = Schema.Schema.Type<typeof LLMModel>;
|
|
7
7
|
export declare const ToolTypes: Readonly<{
|
|
8
8
|
TextToImage: "text_to_image";
|
|
9
9
|
}>;
|
|
10
10
|
/**
|
|
11
11
|
* Client GPT request.
|
|
12
12
|
*/
|
|
13
|
-
export declare const GenerateRequest:
|
|
13
|
+
export declare const GenerateRequest: Schema.Struct<{
|
|
14
14
|
/**
|
|
15
15
|
* Preferred model or system default.
|
|
16
16
|
*/
|
|
17
|
-
model:
|
|
17
|
+
model: Schema.optional<Schema.Literal<["@anthropic/claude-3-5-haiku-20241022", "@anthropic/claude-3-5-sonnet-20241022", "@anthropic/claude-3-7-sonnet-20250219", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@hf/nousresearch/hermes-2-pro-mistral-7b", "@ollama/llama-3-1-nemotron-70b-instruct", "@ollama/llama-3-1-nemotron-mini-4b-instruct", "@ollama/llama-3-2-3b", "llama3.2:1b", "llama3:70b", "deepseek-r1:latest"]>>;
|
|
18
18
|
/**
|
|
19
19
|
* Tools available for the LLM.
|
|
20
20
|
*/
|
|
21
|
-
tools:
|
|
22
|
-
name: typeof
|
|
23
|
-
namespace:
|
|
24
|
-
function:
|
|
25
|
-
type:
|
|
26
|
-
caption:
|
|
27
|
-
description:
|
|
28
|
-
parameters:
|
|
29
|
-
options:
|
|
21
|
+
tools: Schema.optional<Schema.mutable<Schema.Array$<Schema.Struct<{
|
|
22
|
+
name: typeof Schema.String;
|
|
23
|
+
namespace: Schema.optional<typeof Schema.String>;
|
|
24
|
+
function: Schema.optional<typeof Schema.String>;
|
|
25
|
+
type: Schema.optional<typeof Schema.String>;
|
|
26
|
+
caption: Schema.optional<typeof Schema.String>;
|
|
27
|
+
description: Schema.optional<typeof Schema.String>;
|
|
28
|
+
parameters: Schema.optional<Schema.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
|
|
29
|
+
options: Schema.optional<typeof Schema.Any>;
|
|
30
30
|
}>>>>;
|
|
31
31
|
/**
|
|
32
32
|
* System instructions to the LLM.
|
|
33
33
|
*/
|
|
34
|
-
systemPrompt:
|
|
34
|
+
systemPrompt: Schema.optional<typeof Schema.String>;
|
|
35
35
|
/**
|
|
36
36
|
* History of messages to include in the context window.
|
|
37
37
|
*/
|
|
38
|
-
history:
|
|
38
|
+
history: Schema.optional<Schema.Array$<import("@dxos/echo-schema").EchoTypeSchema<Schema.Struct<{
|
|
39
39
|
id: import("@dxos/echo-schema").ObjectIdClass;
|
|
40
|
-
role:
|
|
41
|
-
content:
|
|
42
|
-
pending:
|
|
43
|
-
}>,
|
|
44
|
-
type:
|
|
45
|
-
disposition:
|
|
46
|
-
text: typeof
|
|
47
|
-
}>>>,
|
|
48
|
-
pending:
|
|
49
|
-
}>,
|
|
50
|
-
type:
|
|
51
|
-
disposition:
|
|
52
|
-
json: typeof
|
|
53
|
-
}>>>,
|
|
54
|
-
pending:
|
|
55
|
-
}>,
|
|
56
|
-
type:
|
|
57
|
-
id:
|
|
58
|
-
source:
|
|
59
|
-
type:
|
|
60
|
-
mediaType: typeof
|
|
61
|
-
data: typeof
|
|
40
|
+
role: Schema.refine<"user" | "assistant", Schema.Schema<string, string, never>>;
|
|
41
|
+
content: Schema.mutable<Schema.Array$<Schema.Union<[Schema.mutable<Schema.extend<Schema.Struct<{
|
|
42
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
43
|
+
}>, Schema.Struct<{
|
|
44
|
+
type: Schema.Literal<["text"]>;
|
|
45
|
+
disposition: Schema.optional<typeof Schema.String>;
|
|
46
|
+
text: typeof Schema.String;
|
|
47
|
+
}>>>, Schema.mutable<Schema.extend<Schema.Struct<{
|
|
48
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
49
|
+
}>, Schema.Struct<{
|
|
50
|
+
type: Schema.Literal<["json"]>;
|
|
51
|
+
disposition: Schema.optional<typeof Schema.String>;
|
|
52
|
+
json: typeof Schema.String;
|
|
53
|
+
}>>>, Schema.mutable<Schema.extend<Schema.Struct<{
|
|
54
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
55
|
+
}>, Schema.Struct<{
|
|
56
|
+
type: Schema.Literal<["image"]>;
|
|
57
|
+
id: Schema.optional<typeof Schema.String>;
|
|
58
|
+
source: Schema.optional<Schema.mutable<Schema.Struct<{
|
|
59
|
+
type: Schema.Literal<["base64"]>;
|
|
60
|
+
mediaType: typeof Schema.String;
|
|
61
|
+
data: typeof Schema.String;
|
|
62
62
|
}>>>;
|
|
63
|
-
}>>>,
|
|
64
|
-
pending:
|
|
65
|
-
}>,
|
|
66
|
-
type:
|
|
67
|
-
id: typeof
|
|
68
|
-
name: typeof
|
|
69
|
-
input: typeof
|
|
70
|
-
}>>>,
|
|
71
|
-
pending:
|
|
72
|
-
}>,
|
|
73
|
-
type:
|
|
74
|
-
toolUseId: typeof
|
|
75
|
-
content: typeof
|
|
76
|
-
isError:
|
|
63
|
+
}>>>, Schema.mutable<Schema.extend<Schema.Struct<{
|
|
64
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
65
|
+
}>, Schema.Struct<{
|
|
66
|
+
type: Schema.Literal<["tool_use"]>;
|
|
67
|
+
id: typeof Schema.String;
|
|
68
|
+
name: typeof Schema.String;
|
|
69
|
+
input: typeof Schema.Unknown;
|
|
70
|
+
}>>>, Schema.mutable<Schema.extend<Schema.Struct<{
|
|
71
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
72
|
+
}>, Schema.Struct<{
|
|
73
|
+
type: Schema.Literal<["tool_result"]>;
|
|
74
|
+
toolUseId: typeof Schema.String;
|
|
75
|
+
content: typeof Schema.String;
|
|
76
|
+
isError: Schema.optional<typeof Schema.Boolean>;
|
|
77
77
|
}>>>]>>>;
|
|
78
|
-
}
|
|
78
|
+
}>, {}>>>;
|
|
79
79
|
/**
|
|
80
80
|
* Current request.
|
|
81
81
|
*/
|
|
82
|
-
prompt:
|
|
82
|
+
prompt: Schema.optional<import("@dxos/echo-schema").EchoTypeSchema<Schema.Struct<{
|
|
83
83
|
id: import("@dxos/echo-schema").ObjectIdClass;
|
|
84
|
-
role:
|
|
85
|
-
content:
|
|
86
|
-
pending:
|
|
87
|
-
}>,
|
|
88
|
-
type:
|
|
89
|
-
disposition:
|
|
90
|
-
text: typeof
|
|
91
|
-
}>>>,
|
|
92
|
-
pending:
|
|
93
|
-
}>,
|
|
94
|
-
type:
|
|
95
|
-
disposition:
|
|
96
|
-
json: typeof
|
|
97
|
-
}>>>,
|
|
98
|
-
pending:
|
|
99
|
-
}>,
|
|
100
|
-
type:
|
|
101
|
-
id:
|
|
102
|
-
source:
|
|
103
|
-
type:
|
|
104
|
-
mediaType: typeof
|
|
105
|
-
data: typeof
|
|
84
|
+
role: Schema.refine<"user" | "assistant", Schema.Schema<string, string, never>>;
|
|
85
|
+
content: Schema.mutable<Schema.Array$<Schema.Union<[Schema.mutable<Schema.extend<Schema.Struct<{
|
|
86
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
87
|
+
}>, Schema.Struct<{
|
|
88
|
+
type: Schema.Literal<["text"]>;
|
|
89
|
+
disposition: Schema.optional<typeof Schema.String>;
|
|
90
|
+
text: typeof Schema.String;
|
|
91
|
+
}>>>, Schema.mutable<Schema.extend<Schema.Struct<{
|
|
92
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
93
|
+
}>, Schema.Struct<{
|
|
94
|
+
type: Schema.Literal<["json"]>;
|
|
95
|
+
disposition: Schema.optional<typeof Schema.String>;
|
|
96
|
+
json: typeof Schema.String;
|
|
97
|
+
}>>>, Schema.mutable<Schema.extend<Schema.Struct<{
|
|
98
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
99
|
+
}>, Schema.Struct<{
|
|
100
|
+
type: Schema.Literal<["image"]>;
|
|
101
|
+
id: Schema.optional<typeof Schema.String>;
|
|
102
|
+
source: Schema.optional<Schema.mutable<Schema.Struct<{
|
|
103
|
+
type: Schema.Literal<["base64"]>;
|
|
104
|
+
mediaType: typeof Schema.String;
|
|
105
|
+
data: typeof Schema.String;
|
|
106
106
|
}>>>;
|
|
107
|
-
}>>>,
|
|
108
|
-
pending:
|
|
109
|
-
}>,
|
|
110
|
-
type:
|
|
111
|
-
id: typeof
|
|
112
|
-
name: typeof
|
|
113
|
-
input: typeof
|
|
114
|
-
}>>>,
|
|
115
|
-
pending:
|
|
116
|
-
}>,
|
|
117
|
-
type:
|
|
118
|
-
toolUseId: typeof
|
|
119
|
-
content: typeof
|
|
120
|
-
isError:
|
|
107
|
+
}>>>, Schema.mutable<Schema.extend<Schema.Struct<{
|
|
108
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
109
|
+
}>, Schema.Struct<{
|
|
110
|
+
type: Schema.Literal<["tool_use"]>;
|
|
111
|
+
id: typeof Schema.String;
|
|
112
|
+
name: typeof Schema.String;
|
|
113
|
+
input: typeof Schema.Unknown;
|
|
114
|
+
}>>>, Schema.mutable<Schema.extend<Schema.Struct<{
|
|
115
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
116
|
+
}>, Schema.Struct<{
|
|
117
|
+
type: Schema.Literal<["tool_result"]>;
|
|
118
|
+
toolUseId: typeof Schema.String;
|
|
119
|
+
content: typeof Schema.String;
|
|
120
|
+
isError: Schema.optional<typeof Schema.Boolean>;
|
|
121
121
|
}>>>]>>>;
|
|
122
|
-
}
|
|
122
|
+
}>, {}>>;
|
|
123
123
|
}>;
|
|
124
|
-
export type GenerateRequest =
|
|
124
|
+
export type GenerateRequest = Schema.Schema.Type<typeof GenerateRequest>;
|
|
125
125
|
/**
|
|
126
126
|
* Non-streaming response.
|
|
127
127
|
*/
|
|
128
|
-
export declare const GenerateResponse:
|
|
129
|
-
messages:
|
|
128
|
+
export declare const GenerateResponse: Schema.Struct<{
|
|
129
|
+
messages: Schema.Array$<import("@dxos/echo-schema").EchoTypeSchema<Schema.Struct<{
|
|
130
130
|
id: import("@dxos/echo-schema").ObjectIdClass;
|
|
131
|
-
role:
|
|
132
|
-
content:
|
|
133
|
-
pending:
|
|
134
|
-
}>,
|
|
135
|
-
type:
|
|
136
|
-
disposition:
|
|
137
|
-
text: typeof
|
|
138
|
-
}>>>,
|
|
139
|
-
pending:
|
|
140
|
-
}>,
|
|
141
|
-
type:
|
|
142
|
-
disposition:
|
|
143
|
-
json: typeof
|
|
144
|
-
}>>>,
|
|
145
|
-
pending:
|
|
146
|
-
}>,
|
|
147
|
-
type:
|
|
148
|
-
id:
|
|
149
|
-
source:
|
|
150
|
-
type:
|
|
151
|
-
mediaType: typeof
|
|
152
|
-
data: typeof
|
|
131
|
+
role: Schema.refine<"user" | "assistant", Schema.Schema<string, string, never>>;
|
|
132
|
+
content: Schema.mutable<Schema.Array$<Schema.Union<[Schema.mutable<Schema.extend<Schema.Struct<{
|
|
133
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
134
|
+
}>, Schema.Struct<{
|
|
135
|
+
type: Schema.Literal<["text"]>;
|
|
136
|
+
disposition: Schema.optional<typeof Schema.String>;
|
|
137
|
+
text: typeof Schema.String;
|
|
138
|
+
}>>>, Schema.mutable<Schema.extend<Schema.Struct<{
|
|
139
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
140
|
+
}>, Schema.Struct<{
|
|
141
|
+
type: Schema.Literal<["json"]>;
|
|
142
|
+
disposition: Schema.optional<typeof Schema.String>;
|
|
143
|
+
json: typeof Schema.String;
|
|
144
|
+
}>>>, Schema.mutable<Schema.extend<Schema.Struct<{
|
|
145
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
146
|
+
}>, Schema.Struct<{
|
|
147
|
+
type: Schema.Literal<["image"]>;
|
|
148
|
+
id: Schema.optional<typeof Schema.String>;
|
|
149
|
+
source: Schema.optional<Schema.mutable<Schema.Struct<{
|
|
150
|
+
type: Schema.Literal<["base64"]>;
|
|
151
|
+
mediaType: typeof Schema.String;
|
|
152
|
+
data: typeof Schema.String;
|
|
153
153
|
}>>>;
|
|
154
|
-
}>>>,
|
|
155
|
-
pending:
|
|
156
|
-
}>,
|
|
157
|
-
type:
|
|
158
|
-
id: typeof
|
|
159
|
-
name: typeof
|
|
160
|
-
input: typeof
|
|
161
|
-
}>>>,
|
|
162
|
-
pending:
|
|
163
|
-
}>,
|
|
164
|
-
type:
|
|
165
|
-
toolUseId: typeof
|
|
166
|
-
content: typeof
|
|
167
|
-
isError:
|
|
154
|
+
}>>>, Schema.mutable<Schema.extend<Schema.Struct<{
|
|
155
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
156
|
+
}>, Schema.Struct<{
|
|
157
|
+
type: Schema.Literal<["tool_use"]>;
|
|
158
|
+
id: typeof Schema.String;
|
|
159
|
+
name: typeof Schema.String;
|
|
160
|
+
input: typeof Schema.Unknown;
|
|
161
|
+
}>>>, Schema.mutable<Schema.extend<Schema.Struct<{
|
|
162
|
+
pending: Schema.optional<typeof Schema.Boolean>;
|
|
163
|
+
}>, Schema.Struct<{
|
|
164
|
+
type: Schema.Literal<["tool_result"]>;
|
|
165
|
+
toolUseId: typeof Schema.String;
|
|
166
|
+
content: typeof Schema.String;
|
|
167
|
+
isError: Schema.optional<typeof Schema.Boolean>;
|
|
168
168
|
}>>>]>>>;
|
|
169
|
-
}
|
|
169
|
+
}>, {}>>;
|
|
170
170
|
/**
|
|
171
171
|
* Number of tokens used in the response.
|
|
172
172
|
*/
|
|
173
|
-
tokenCount:
|
|
173
|
+
tokenCount: Schema.optional<typeof Schema.Number>;
|
|
174
174
|
}>;
|
|
175
|
-
export type GenerateResponse =
|
|
175
|
+
export type GenerateResponse = Schema.Schema.Type<typeof GenerateResponse>;
|
|
176
176
|
/**
|
|
177
177
|
* Server-Sent Events (SSE) stream from the AI service.
|
|
178
178
|
* https://docs.anthropic.com/en/api/streaming
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAQ,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAIlD,eAAO,MAAM,qBAAqB,OAAQ,QAAQ,WAA4B,CAAC;AAE/E,eAAO,MAAM,QAAQ,6YAAmE,CAAC;AAEzF,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC,CAAC;AAE3D,eAAO,MAAM,SAAS;;EAIpB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;IAC1B;;OAEG;;IAGH;;OAEG;;qBAmC+B,OAAQ,MAAM;mBACxC,OAAQ,QAAQ,QAAO,OAAQ,MACzC;kBAAgB,OAAQ,QAAQ,QAAO,OAAQ,MAAM;cAW7C,OAAQ,QAAQ,QAClB,OAAI,MACT;iBAIW,OAAQ,QACpB,QACE,OACI,MAAG;qBAEuB,OAC5B,QAEJ,QAAO,OAAQ,MAAM;oBAOb,OACI,QAAA,CAAC,OAAO,MAAM;iBAQtB,OAAQ,QAAQ,QAAO,OAAQ,GAAG;;IA3EpC;;OAEG;;IAGH;;OAEG;;mBAoEi/E,mBAAmB;cAA0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Q,OAAO,CAAC,OAAO,MAAM,CAAC,OAAO,MAAM;qBAAmB,OAAQ,QAAQ,QAAO,OAAQ,OAAO;YAAU,OAAQ,MAAM;kBAAgB,OAAQ,OAAO;8BAA4C,OAAQ,MAAM;4BAAyB,OAAQ,MAAM;qBAAkB,OAAQ,QAAQ,QAAO,OAAQ,OAAO;;;IAnD39I;;OAEG;;EAEH,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE3E;;;;;GAKG;AAEH,MAAM,MAAM,qBAAqB,GAC7B;IAEE,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,UAAU,CAAC,CAAC;CAChD,GACD;IACE,IAAI,EAAE,eAAe,CAAC;IACtB,KAAK,EAAE;QACL,UAAU,EAAE,UAAU,GAAG,UAAU,CAAC;KACrC,CAAC;CACH,GACD;IACE,IAAI,EAAE,cAAc,CAAC;CACtB,GACD;IACE,IAAI,EAAE,qBAAqB,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,mBAAmB,CAAC;CAC9B,GACD;IACE,IAAI,EAAE,qBAAqB,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EACD;QACE,IAAI,EAAE,YAAY,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;KACd,GACD;QACE,IAAI,EAAE,kBAAkB,CAAC;QACzB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;CACP,GACD;IACE,IAAI,EAAE,oBAAoB,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Schema
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
2
|
import { type Message, type MessageContentBlock } from '@dxos/artifact';
|
|
3
3
|
import { JsonSchemaType } from '@dxos/echo-schema';
|
|
4
4
|
export declare const createUserMessage: (text: string) => Message;
|
|
5
5
|
/**
|
|
6
6
|
* @deprecated Use {@link LLMTool} instead.
|
|
7
7
|
*/
|
|
8
|
-
export declare const ToolDefinition:
|
|
9
|
-
name: typeof
|
|
10
|
-
description: typeof
|
|
11
|
-
parameters:
|
|
12
|
-
execute: typeof
|
|
8
|
+
export declare const ToolDefinition: Schema.Struct<{
|
|
9
|
+
name: typeof Schema.String;
|
|
10
|
+
description: typeof Schema.String;
|
|
11
|
+
parameters: Schema.Schema<JsonSchemaType, JsonSchemaType, never>;
|
|
12
|
+
execute: typeof Schema.Any;
|
|
13
13
|
}>;
|
|
14
14
|
/**
|
|
15
15
|
* @deprecated Use {@link LLMTool} instead.
|
|
@@ -68,11 +68,11 @@ export declare const ToolResult: Readonly<{
|
|
|
68
68
|
*/
|
|
69
69
|
Break: (result: unknown) => ToolResult;
|
|
70
70
|
}>;
|
|
71
|
-
export type DefineToolParams<Params extends
|
|
71
|
+
export type DefineToolParams<Params extends Schema.Schema.AnyNoContext> = {
|
|
72
72
|
name: string;
|
|
73
73
|
description: string;
|
|
74
74
|
schema: Params;
|
|
75
|
-
execute: (params:
|
|
75
|
+
execute: (params: Schema.Schema.Type<Params>, context: ToolExecutionContext) => Promise<ToolResult>;
|
|
76
76
|
};
|
|
77
|
-
export declare const defineTool: <Params extends
|
|
77
|
+
export declare const defineTool: <Params extends Schema.Schema.AnyNoContext>({ name, description, schema, execute, }: DefineToolParams<Params>) => ToolDefinition;
|
|
78
78
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/conversation/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/conversation/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EA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AM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,oBAAoB,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CACrG,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,MAAM,SAAS,MAAM,CAAC,MAAM,CAAC,YAAY,2CAKjE,gBAAgB,CAAC,MAAM,CAAC,KAAG,cAU7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"echo-data-source.d.ts","sourceRoot":"","sources":["../../../../src/cypher/echo-data-source.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"echo-data-source.d.ts","sourceRoot":"","sources":["../../../../src/cypher/echo-data-source.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,YAAY,EAA8B,MAAM,eAAe,CAAC;AAI9E,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGvE,qBAAa,cAAe,YAAW,UAAU;IACnC,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,YAAY;IAGxC,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAiBxD,gBAAgB,CAAC,EAAE,KAAK,EAAE,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;YA+BhE,aAAa;IAQ3B,OAAO,CAAC,aAAa;YAUP,uBAAuB;CAqBtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/session/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/session/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { Schema
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
2
|
import { Message, type ArtifactDefinition, type Tool } from '@dxos/artifact';
|
|
3
3
|
import { Event } from '@dxos/async';
|
|
4
|
+
import { ObjectVersion } from '@dxos/echo-db';
|
|
5
|
+
import { type ObjectId } from '@dxos/echo-schema';
|
|
4
6
|
import { type AIServiceClient, type GenerateRequest } from '../ai-service';
|
|
5
7
|
/**
|
|
6
8
|
* Contains message history, tools, current context.
|
|
@@ -12,6 +14,19 @@ import { type AIServiceClient, type GenerateRequest } from '../ai-service';
|
|
|
12
14
|
* Could be run locally in the app or remotely.
|
|
13
15
|
* Could be personal or shared.
|
|
14
16
|
*/
|
|
17
|
+
/**
|
|
18
|
+
* Resolves artifact ids to their versions.
|
|
19
|
+
* Used to give the model a sense of the changes to the artifacts made by users during the conversation.
|
|
20
|
+
* The artifacts versions are pinned in the history, and whenever the artifact changes in-between assistant's steps,
|
|
21
|
+
* a diff is inserted into the conversation.
|
|
22
|
+
*/
|
|
23
|
+
export type ArtifactDiffResolver = (artifacts: {
|
|
24
|
+
id: ObjectId;
|
|
25
|
+
lastVersion: ObjectVersion;
|
|
26
|
+
}[]) => Promise<Map<ObjectId, {
|
|
27
|
+
version: ObjectVersion;
|
|
28
|
+
diff?: string;
|
|
29
|
+
}>>;
|
|
15
30
|
export type SessionRunOptions = {
|
|
16
31
|
client: AIServiceClient;
|
|
17
32
|
artifacts: ArtifactDefinition[];
|
|
@@ -28,13 +43,19 @@ export type SessionRunOptions = {
|
|
|
28
43
|
* Pre-require artifacts.
|
|
29
44
|
*/
|
|
30
45
|
requiredArtifactIds?: string[];
|
|
46
|
+
/**
|
|
47
|
+
* @see ArtifactDiffResolver
|
|
48
|
+
*/
|
|
49
|
+
artifactDiffResolver?: ArtifactDiffResolver;
|
|
31
50
|
};
|
|
32
|
-
type OperationModel = 'planning' | '
|
|
51
|
+
type OperationModel = 'planning' | 'importing' | 'configured';
|
|
33
52
|
export type AiSessionOptions = {
|
|
34
53
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
54
|
+
* Determines the agent's handling of the artifacts definitions:
|
|
55
|
+
*
|
|
56
|
+
* - `planning`: The model will create a plan with required artifacts for each step.
|
|
57
|
+
* - `importing`: The model can query registry and only pull in the artifacts that are required to complete the task.
|
|
58
|
+
* - `configured`: The available artifacts are pre-selected and the model cannot select additional artifacts.
|
|
38
59
|
*/
|
|
39
60
|
operationModel: OperationModel;
|
|
40
61
|
};
|
|
@@ -199,10 +220,14 @@ export declare class AISession {
|
|
|
199
220
|
}>;
|
|
200
221
|
constructor(_options: AiSessionOptions);
|
|
201
222
|
run(options: SessionRunOptions): Promise<Message[]>;
|
|
223
|
+
private _formatUserPrompt;
|
|
224
|
+
private _createQueryArtifactsTool;
|
|
225
|
+
private _createRequireTool;
|
|
226
|
+
private _createPlanningTool;
|
|
202
227
|
abort(): void;
|
|
203
228
|
}
|
|
204
|
-
declare const AIServiecOverloadedError_base:
|
|
205
|
-
readonly _tag:
|
|
229
|
+
declare const AIServiecOverloadedError_base: Schema.TaggedErrorClass<AIServiecOverloadedError, "AIServiecOverloadedError", {
|
|
230
|
+
readonly _tag: Schema.tag<"AIServiecOverloadedError">;
|
|
206
231
|
}>;
|
|
207
232
|
export declare class AIServiecOverloadedError extends AIServiecOverloadedError_base {
|
|
208
233
|
}
|
|
@@ -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,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAExC,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C;CAChC,CAAC;AAEF,qBAAa,SAAS;IAmCR,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAlCrC,yBAAyB;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA2B;IAEnD,yDAAyD;IACzD,OAAO,CAAC,QAAQ,CAAiB;IAEjC,kCAAkC;IAClC,OAAO,CAAC,OAAO,CAA+B;IAE9C,gCAAgC;IAChC,OAAO,CAAC,QAAQ,CAAiB;IAEjC;;OAEG;IACH,SAAgB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAwB;IAE/C;;OAEG;IACH,SAAgB,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAsB;IAE3C;;OAEG;IACH,SAAgB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAuB;IAE7C,SAAgB,WAAW,4CAA4B;IAEvD;;OAEG;IACH,SAAgB,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAwB;gBAEtB,QAAQ,EAAE,gBAAgB;IAQjD,GAAG,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;YA6G3C,iBAAiB;IAsC/B,OAAO,CAAC,yBAAyB;IAiBjC,OAAO,CAAC,kBAAkB;IA+B1B,OAAO,CAAC,mBAAmB;IAoF3B,KAAK;CAGN;;;;AAuDD,qBAAa,wBAAyB,SAAQ,6BAG7C;CAAG"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
import type { MessageContentBlock } from '@dxos/artifact';
|
|
3
|
+
import type { ObjectVersion } from '@dxos/echo-db';
|
|
4
|
+
import { type BaseEchoObject } from '@dxos/echo-schema';
|
|
5
|
+
declare const VersionPinSchema: Schema.Struct<{
|
|
6
|
+
objectId: import("@dxos/echo-schema").ObjectIdClass;
|
|
7
|
+
version: Schema.Schema<ObjectVersion, ObjectVersion, never>;
|
|
8
|
+
}>;
|
|
9
|
+
export interface VersionPin extends Schema.Schema.Type<typeof VersionPinSchema> {
|
|
10
|
+
}
|
|
11
|
+
export declare const VersionPin: typeof VersionPinSchema & {
|
|
12
|
+
DISPOSITION: 'version-pin';
|
|
13
|
+
fromObject: (object: BaseEchoObject) => VersionPin;
|
|
14
|
+
createBlock: (pin: VersionPin) => MessageContentBlock;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=version-pin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-pin.d.ts","sourceRoot":"","sources":["../../../../src/session/version-pin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKlE,QAAA,MAAM,gBAAgB;;;EAKpB,CAAC;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,cAAc,KAAK,UAAU,CAAC;IACnD,WAAW,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK,mBAAmB,CAAC;CAiBvD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-pin.test.d.ts","sourceRoot":"","sources":["../../../../src/session/version-pin.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Schema
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
2
|
import { type DataSource } from '../cypher';
|
|
3
|
-
export declare const createCypherTool: (dataSource: DataSource, schemaTypes?:
|
|
4
|
-
export declare const createSystemPrompt: (schemaTypes:
|
|
3
|
+
export declare const createCypherTool: (dataSource: DataSource, schemaTypes?: Schema.Schema.Any[]) => import("@dxos/artifact").Tool;
|
|
4
|
+
export declare const createSystemPrompt: (schemaTypes: Schema.Schema.Any[]) => string;
|
|
5
5
|
//# sourceMappingURL=query-promts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-promts.d.ts","sourceRoot":"","sources":["../../../../src/testing/query-promts.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"query-promts.d.ts","sourceRoot":"","sources":["../../../../src/testing/query-promts.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAMhC,OAAO,EAAwC,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAGlF,eAAO,MAAM,gBAAgB,eAAgB,UAAU,gBAAe,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,kCA0CrF,CAAC;AAEL,eAAO,MAAM,kBAAkB,gBAAiB,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,WAiBlE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Schema
|
|
1
|
+
import { type Schema } from 'effect';
|
|
2
2
|
import type { EchoDatabase } from '@dxos/echo-db';
|
|
3
3
|
import { type JsonSchemaType } from '@dxos/echo-schema';
|
|
4
4
|
import { type DataSource, type Node, type Relationship } from '../cypher';
|
|
@@ -6,14 +6,14 @@ export declare const seedTestData: (db: EchoDatabase) => void;
|
|
|
6
6
|
export declare const createTestData: () => MockDataSource;
|
|
7
7
|
export declare class MockDataSource implements DataSource {
|
|
8
8
|
objects: Record<string, {
|
|
9
|
-
schema:
|
|
9
|
+
schema: Schema.Schema.All;
|
|
10
10
|
typeDxn: string;
|
|
11
11
|
id: string;
|
|
12
12
|
data: unknown;
|
|
13
13
|
}>;
|
|
14
14
|
schema: Record<string, {
|
|
15
15
|
json: JsonSchemaType;
|
|
16
|
-
instance:
|
|
16
|
+
instance: Schema.Schema.All;
|
|
17
17
|
}>;
|
|
18
18
|
nodes: Node[];
|
|
19
19
|
relationships: Relationship[];
|
|
@@ -23,7 +23,7 @@ export declare class MockDataSource implements DataSource {
|
|
|
23
23
|
getRelationships({ label }: {
|
|
24
24
|
label?: string;
|
|
25
25
|
}): Promise<Relationship[]>;
|
|
26
|
-
add<S extends
|
|
26
|
+
add<S extends Schema.Schema.All>(schema: S, data: Schema.Schema.Type<S>): Schema.Schema.Type<S>;
|
|
27
27
|
computeGraph(): void;
|
|
28
28
|
}
|
|
29
29
|
//# sourceMappingURL=test-data.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-data.d.ts","sourceRoot":"","sources":["../../../../src/testing/test-data.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"test-data.d.ts","sourceRoot":"","sources":["../../../../src/testing/test-data.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAIL,KAAK,cAAc,EAGpB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EACL,KAAK,UAAU,EACf,KAAK,IAAI,EACT,KAAK,YAAY,EAGlB,MAAM,WAAW,CAAC;AAGnB,eAAO,MAAM,YAAY,OAAQ,YAAY,SAoH5C,CAAC;AAGF,eAAO,MAAM,cAAc,QAAO,cAuGjC,CAAC;AAEF,qBAAa,cAAe,YAAW,UAAU;IAC/C,OAAO,EAAE,MAAM,CACb,MAAM,EACN;QACE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC;QAC1B,OAAO,EAAE,MAAM,CAAC;QAChB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAA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