@dxos/assistant 0.8.4-main.84f28bd → 0.8.4-main.a4bbb77
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-ILL2CN3G.mjs +374 -0
- package/dist/lib/browser/chunk-ILL2CN3G.mjs.map +7 -0
- package/dist/lib/browser/chunk-UB26N5UF.mjs +89 -0
- package/dist/lib/browser/chunk-UB26N5UF.mjs.map +7 -0
- package/dist/lib/browser/extraction/index.mjs +272 -0
- package/dist/lib/browser/extraction/index.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +712 -1870
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/named-entity-recognition-QPYHML66.mjs +13 -0
- package/dist/lib/browser/named-entity-recognition-QPYHML66.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-BCFXTNSK.mjs +91 -0
- package/dist/lib/node-esm/chunk-BCFXTNSK.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-GVKA7VL3.mjs +376 -0
- package/dist/lib/node-esm/chunk-GVKA7VL3.mjs.map +7 -0
- package/dist/lib/node-esm/extraction/index.mjs +273 -0
- package/dist/lib/node-esm/extraction/index.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +712 -1871
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/named-entity-recognition-2HDF46YX.mjs +14 -0
- package/dist/lib/node-esm/named-entity-recognition-2HDF46YX.mjs.map +7 -0
- package/dist/types/src/conversation/context.d.ts +96 -0
- package/dist/types/src/conversation/context.d.ts.map +1 -0
- package/dist/types/src/conversation/conversation.d.ts +28 -31
- package/dist/types/src/conversation/conversation.d.ts.map +1 -1
- package/dist/types/src/conversation/index.d.ts +1 -0
- package/dist/types/src/conversation/index.d.ts.map +1 -1
- package/dist/types/src/diff.d.ts +15 -0
- package/dist/types/src/diff.d.ts.map +1 -0
- package/dist/types/src/diff.test.d.ts +2 -0
- package/dist/types/src/diff.test.d.ts.map +1 -0
- package/dist/types/src/errors.d.ts +75 -0
- package/dist/types/src/errors.d.ts.map +1 -0
- package/dist/types/src/execution-graph.d.ts +82 -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 +198 -65
- 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 +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 +254 -162
- package/dist/types/src/extraction/extraction.d.ts.map +1 -1
- package/dist/types/src/functions/index.d.ts +2 -0
- package/dist/types/src/functions/index.d.ts.map +1 -0
- package/dist/types/src/functions/services.d.ts +18 -0
- package/dist/types/src/functions/services.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +5 -5
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/session/artifact-diff.d.ts +27 -0
- package/dist/types/src/session/artifact-diff.d.ts.map +1 -0
- package/dist/types/src/session/error-handling.d.ts +4 -0
- package/dist/types/src/session/error-handling.d.ts.map +1 -0
- package/dist/types/src/session/format.d.ts +184 -0
- package/dist/types/src/session/format.d.ts.map +1 -0
- package/dist/types/src/session/format.test.d.ts +2 -0
- package/dist/types/src/session/format.test.d.ts.map +1 -0
- package/dist/types/src/session/index.d.ts +3 -0
- package/dist/types/src/session/index.d.ts.map +1 -1
- package/dist/types/src/session/observer.d.ts +22 -0
- package/dist/types/src/session/observer.d.ts.map +1 -0
- package/dist/types/src/session/session.d.ts +32 -268
- package/dist/types/src/session/session.d.ts.map +1 -1
- package/dist/types/src/session/toolkit.d.ts +14 -0
- package/dist/types/src/session/toolkit.d.ts.map +1 -0
- 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/templates/index.d.ts +2 -0
- package/dist/types/src/templates/index.d.ts.map +1 -0
- package/dist/types/src/templates/system.d.ts +18 -0
- package/dist/types/src/templates/system.d.ts.map +1 -0
- package/dist/types/src/types.d.ts +13 -0
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +50 -24
- package/src/conversation/context.ts +154 -0
- package/src/conversation/conversation.ts +89 -73
- package/src/conversation/index.ts +1 -0
- package/src/diff.test.ts +43 -0
- package/src/diff.ts +79 -0
- package/src/errors.ts +15 -0
- package/src/execution-graph.test.ts +738 -0
- package/src/execution-graph.ts +500 -0
- package/src/extraction/extraction-llm-function/extraction-llm-function.test.ts +13 -24
- package/src/extraction/extraction-llm-function/extraction-llm-function.ts +27 -21
- package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +9 -9
- package/src/extraction/extraction-ner-function/extraction-ner-function.ts +17 -7
- package/src/extraction/extraction-ner-function/named-entity-recognition.test.ts +4 -3
- package/src/extraction/extraction-ner-function/named-entity-recognition.ts +3 -1
- package/src/extraction/quotes.test.ts +3 -3
- package/src/extraction/quotes.ts +2 -2
- package/src/functions/index.ts +5 -0
- package/src/functions/services.ts +153 -0
- package/src/index.ts +5 -5
- package/src/session/artifact-diff.ts +41 -0
- package/src/session/error-handling.ts +40 -0
- package/src/session/format.test.ts +60 -0
- package/src/session/format.ts +139 -0
- package/src/session/index.ts +3 -0
- package/src/session/observer.ts +58 -0
- package/src/session/session.conversations.json +1 -0
- package/src/session/session.test.ts +86 -215
- package/src/session/session.ts +163 -539
- package/src/session/toolkit.ts +46 -0
- package/src/session/version-pin.ts +9 -9
- package/src/summarization/summarization.test.ts +86 -106
- package/src/templates/format.tpl +60 -0
- package/src/templates/index.ts +5 -0
- package/src/templates/system.tpl +48 -0
- package/src/templates/system.ts +41 -0
- package/src/types.ts +45 -1
- package/src/typings.d.ts +5 -0
- package/dist/types/bin/chat.d.ts +0 -2
- package/dist/types/bin/chat.d.ts.map +0 -1
- package/dist/types/src/blueprint/blueprint.d.ts +0 -41
- package/dist/types/src/blueprint/blueprint.d.ts.map +0 -1
- package/dist/types/src/blueprint/index.d.ts +0 -3
- package/dist/types/src/blueprint/index.d.ts.map +0 -1
- package/dist/types/src/blueprint/registry.d.ts +0 -7
- package/dist/types/src/blueprint/registry.d.ts.map +0 -1
- package/dist/types/src/context/binder.d.ts +0 -34
- package/dist/types/src/context/binder.d.ts.map +0 -1
- package/dist/types/src/context/binding.d.ts +0 -38
- package/dist/types/src/context/binding.d.ts.map +0 -1
- package/dist/types/src/context/index.d.ts +0 -3
- package/dist/types/src/context/index.d.ts.map +0 -1
- package/dist/types/src/research/exa.d.ts +0 -7
- package/dist/types/src/research/exa.d.ts.map +0 -1
- package/dist/types/src/research/graph.d.ts +0 -41
- package/dist/types/src/research/graph.d.ts.map +0 -1
- package/dist/types/src/research/graph.test.d.ts +0 -2
- package/dist/types/src/research/graph.test.d.ts.map +0 -1
- package/dist/types/src/research/index.d.ts +0 -4
- package/dist/types/src/research/index.d.ts.map +0 -1
- package/dist/types/src/research/research.d.ts +0 -10
- package/dist/types/src/research/research.d.ts.map +0 -1
- package/dist/types/src/research/research.test.d.ts +0 -2
- package/dist/types/src/research/research.test.d.ts.map +0 -1
- 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/testing/exa-search-1748337321991.d.ts +0 -38
- package/dist/types/src/testing/exa-search-1748337321991.d.ts.map +0 -1
- package/dist/types/src/testing/exa-search-1748337331526.d.ts +0 -37
- package/dist/types/src/testing/exa-search-1748337331526.d.ts.map +0 -1
- package/dist/types/src/testing/exa-search-1748337344119.d.ts +0 -58
- package/dist/types/src/testing/exa-search-1748337344119.d.ts.map +0 -1
- package/dist/types/src/testing/index.d.ts +0 -3
- package/dist/types/src/testing/index.d.ts.map +0 -1
- package/src/blueprint/blueprint.ts +0 -75
- package/src/blueprint/index.ts +0 -6
- package/src/blueprint/registry.ts +0 -15
- package/src/context/binder.ts +0 -101
- package/src/context/binding.ts +0 -31
- package/src/context/index.ts +0 -6
- package/src/research/exa.ts +0 -100
- package/src/research/graph.test.ts +0 -15
- package/src/research/graph.ts +0 -337
- package/src/research/index.ts +0 -7
- package/src/research/instructions-research.tpl +0 -97
- package/src/research/research.test.ts +0 -190
- package/src/research/research.ts +0 -90
- package/src/session/version-pin.test.ts +0 -26
- package/src/testing/exa-search-1748337321991.ts +0 -131
- package/src/testing/exa-search-1748337331526.ts +0 -144
- package/src/testing/exa-search-1748337344119.ts +0 -133
- package/src/testing/index.ts +0 -11
- package/src/typedefs.d.ts +0 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-handling.d.ts","sourceRoot":"","sources":["../../../../src/session/error-handling.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AAaxC,eAAO,MAAM,UAAU,GAAI,KAAK,OAAO,CAAC,OAAO,KAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAoB1B,CAAC"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { type AiSessionRunParams } from './session';
|
|
3
|
+
/**
|
|
4
|
+
* Formats the system prompt.
|
|
5
|
+
*/
|
|
6
|
+
export declare const formatSystemPrompt: ({ system, blueprints, objects, }: Pick<AiSessionRunParams<any>, "system" | "blueprints" | "objects">) => Effect.Effect<string, never, never>;
|
|
7
|
+
/**
|
|
8
|
+
* Formats the user prompt.
|
|
9
|
+
*/
|
|
10
|
+
export declare const formatUserPrompt: ({ prompt, history }: Pick<AiSessionRunParams<any>, "prompt" | "history">) => Effect.Effect<import("@dxos/live-object").Live<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
11
|
+
id: string;
|
|
12
|
+
parentMessage?: string | undefined;
|
|
13
|
+
created: string;
|
|
14
|
+
sender: {
|
|
15
|
+
contact?: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
16
|
+
fullName?: string | undefined;
|
|
17
|
+
preferredName?: string | undefined;
|
|
18
|
+
nickname?: string | undefined;
|
|
19
|
+
image?: string | undefined;
|
|
20
|
+
organization?: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
21
|
+
id: string;
|
|
22
|
+
description?: string | undefined;
|
|
23
|
+
name?: string | undefined;
|
|
24
|
+
status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
|
|
25
|
+
image?: string | undefined;
|
|
26
|
+
website?: string | undefined;
|
|
27
|
+
}> | undefined;
|
|
28
|
+
jobTitle?: string | undefined;
|
|
29
|
+
department?: string | undefined;
|
|
30
|
+
notes?: string | undefined;
|
|
31
|
+
emails?: {
|
|
32
|
+
readonly label?: string | undefined;
|
|
33
|
+
readonly value: string;
|
|
34
|
+
}[] | undefined;
|
|
35
|
+
identities?: {
|
|
36
|
+
readonly label?: string | undefined;
|
|
37
|
+
readonly value: string;
|
|
38
|
+
}[] | undefined;
|
|
39
|
+
phoneNumbers?: {
|
|
40
|
+
readonly label?: string | undefined;
|
|
41
|
+
readonly value: string;
|
|
42
|
+
}[] | undefined;
|
|
43
|
+
addresses?: {
|
|
44
|
+
readonly label?: string | undefined;
|
|
45
|
+
readonly value: {
|
|
46
|
+
readonly street?: string | undefined;
|
|
47
|
+
readonly extended?: string | undefined;
|
|
48
|
+
readonly locality?: string | undefined;
|
|
49
|
+
readonly region?: string | undefined;
|
|
50
|
+
readonly postalCode?: string | undefined;
|
|
51
|
+
readonly postOfficeBoxNumber?: string | undefined;
|
|
52
|
+
readonly country?: string | undefined;
|
|
53
|
+
};
|
|
54
|
+
}[] | undefined;
|
|
55
|
+
urls?: {
|
|
56
|
+
readonly label?: string | undefined;
|
|
57
|
+
readonly value: string;
|
|
58
|
+
}[] | undefined;
|
|
59
|
+
birthday?: string | undefined;
|
|
60
|
+
fields?: {
|
|
61
|
+
readonly label: string;
|
|
62
|
+
readonly value: string;
|
|
63
|
+
readonly category?: string | undefined;
|
|
64
|
+
}[] | undefined;
|
|
65
|
+
}> | undefined;
|
|
66
|
+
identityDid?: string | undefined;
|
|
67
|
+
identityKey?: string | undefined;
|
|
68
|
+
email?: string | undefined;
|
|
69
|
+
name?: string | undefined;
|
|
70
|
+
role?: "user" | "assistant" | "tool" | 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
|
+
pending?: boolean | undefined;
|
|
81
|
+
url: string;
|
|
82
|
+
mediaType?: string | undefined;
|
|
83
|
+
} | {
|
|
84
|
+
id?: string | undefined;
|
|
85
|
+
_tag: "image";
|
|
86
|
+
pending?: boolean | undefined;
|
|
87
|
+
source?: {
|
|
88
|
+
mediaType: string;
|
|
89
|
+
type: "base64";
|
|
90
|
+
data: string;
|
|
91
|
+
} | {
|
|
92
|
+
url: string;
|
|
93
|
+
type: "http";
|
|
94
|
+
} | 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
|
+
pending?: boolean | undefined;
|
|
107
|
+
reasoningText?: string | undefined;
|
|
108
|
+
redactedText?: string | undefined;
|
|
109
|
+
signature?: string | undefined;
|
|
110
|
+
} | {
|
|
111
|
+
reference: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").Expando>;
|
|
112
|
+
_tag: "reference";
|
|
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
|
+
pending?: boolean | undefined;
|
|
129
|
+
mimeType?: string | undefined;
|
|
130
|
+
message?: string | undefined;
|
|
131
|
+
model?: string | undefined;
|
|
132
|
+
usage?: {
|
|
133
|
+
readonly inputTokens?: number | undefined;
|
|
134
|
+
readonly outputTokens?: number | undefined;
|
|
135
|
+
readonly totalTokens?: number | undefined;
|
|
136
|
+
} | 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
|
+
providerExecuted: boolean;
|
|
156
|
+
} | {
|
|
157
|
+
name: string;
|
|
158
|
+
_tag: "toolResult";
|
|
159
|
+
pending?: boolean | undefined;
|
|
160
|
+
toolCallId: string;
|
|
161
|
+
providerExecuted: boolean;
|
|
162
|
+
result?: string | undefined;
|
|
163
|
+
error?: string | undefined;
|
|
164
|
+
} | {
|
|
165
|
+
text: string;
|
|
166
|
+
_tag: "transcript";
|
|
167
|
+
pending?: boolean | undefined;
|
|
168
|
+
started: string;
|
|
169
|
+
})[];
|
|
170
|
+
properties?: {
|
|
171
|
+
[x: string]: any;
|
|
172
|
+
} | undefined;
|
|
173
|
+
}>, {
|
|
174
|
+
"__#private@#code": "AI_ASSISTANT_ERROR";
|
|
175
|
+
"__#private@#context": Record<string, unknown>;
|
|
176
|
+
readonly name: "AI_ASSISTANT_ERROR";
|
|
177
|
+
readonly message: string;
|
|
178
|
+
readonly code: "AI_ASSISTANT_ERROR";
|
|
179
|
+
readonly _tag: "AI_ASSISTANT_ERROR";
|
|
180
|
+
readonly context: Record<string, unknown>;
|
|
181
|
+
stack?: string;
|
|
182
|
+
cause?: unknown;
|
|
183
|
+
}, never>;
|
|
184
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/session/format.ts"],"names":[],"mappings":"AAIA,OAAO,EAAS,MAAM,EAAgB,MAAM,QAAQ,CAAC;AAcrD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD;;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,qBAA0B,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAoC1G,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.test.d.ts","sourceRoot":"","sources":["../../../../src/session/format.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/session/index.ts"],"names":[],"mappings":"AAIA,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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { type AiParser, type ConsolePrinter } from '@dxos/ai';
|
|
3
|
+
import { type DataType } from '@dxos/schema';
|
|
4
|
+
/**
|
|
5
|
+
* Live observer of the generation process.
|
|
6
|
+
*/
|
|
7
|
+
export interface GenerationObserver extends AiParser.ParseResponseCallbacks {
|
|
8
|
+
/**
|
|
9
|
+
* Complete messages fired during the session, both from the model and from the user.
|
|
10
|
+
* This message will contain all message blocks emitted through the `onBlock` callback.
|
|
11
|
+
*/
|
|
12
|
+
onMessage: (message: DataType.Message) => Effect.Effect<void>;
|
|
13
|
+
}
|
|
14
|
+
export declare const GenerationObserver: Readonly<{
|
|
15
|
+
make: ({ onBegin, onPart, onBlock, onEnd, onMessage, }?: Partial<GenerationObserver>) => GenerationObserver;
|
|
16
|
+
noop: () => GenerationObserver;
|
|
17
|
+
/**
|
|
18
|
+
* Debug printer to be used in unit-tests and browser devtools.
|
|
19
|
+
*/
|
|
20
|
+
fromPrinter: (printer: ConsolePrinter) => GenerationObserver;
|
|
21
|
+
}>;
|
|
22
|
+
//# sourceMappingURL=observer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observer.d.ts","sourceRoot":"","sources":["../../../../src/session/observer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAY,MAAM,QAAQ,CAAC;AAE1C,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,QAAQ,CAAC,sBAAsB;IACzE;;;OAGG;IACH,SAAS,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CAC/D;AAED,eAAO,MAAM,kBAAkB;6DAO1B,OAAO,CAAC,kBAAkB,CAAC,KAAQ,kBAAkB;;IAUxD;;OAEG;2BACoB,cAAc;EAiBrC,CAAC"}
|
|
@@ -1,283 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { type
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { type AiError, LanguageModel, type Tool, type Toolkit } from '@effect/ai';
|
|
2
|
+
import { Effect, type Schema } from 'effect';
|
|
3
|
+
import { type AiToolNotFoundError, type PromptPreprocessingError, type ToolExecutionService, type ToolResolverService } from '@dxos/ai';
|
|
4
|
+
import { type Blueprint } from '@dxos/blueprints';
|
|
5
|
+
import { Obj } from '@dxos/echo';
|
|
6
|
+
import { TracingService } from '@dxos/functions';
|
|
7
|
+
import { DataType } from '@dxos/schema';
|
|
8
|
+
import { type AiAssistantError } from '../errors';
|
|
9
|
+
import { GenerationObserver } from './observer';
|
|
10
|
+
export type AiSessionRunError = AiError.AiError | PromptPreprocessingError | AiToolNotFoundError | AiAssistantError;
|
|
11
|
+
export type AiSessionRunRequirements = LanguageModel.LanguageModel | ToolExecutionService | ToolResolverService | TracingService;
|
|
12
|
+
export type AiSessionRunParams<Tools extends Record<string, Tool.Any>> = {
|
|
13
|
+
prompt: string;
|
|
14
|
+
system?: string;
|
|
15
|
+
history?: DataType.Message[];
|
|
16
|
+
objects?: Obj.Any[];
|
|
17
|
+
blueprints?: Blueprint.Blueprint[];
|
|
18
|
+
toolkit?: Toolkit.WithHandler<Tools>;
|
|
19
|
+
observer?: GenerationObserver;
|
|
20
|
+
};
|
|
21
|
+
export type AiSessionOptions = {};
|
|
7
22
|
/**
|
|
8
23
|
* Contains message history, tools, current context.
|
|
9
24
|
* Current context means the state of the app, time of day, and other contextual information.
|
|
10
25
|
* It makes requests to the model, its a state machine.
|
|
11
26
|
* It keeps track of the current goal.
|
|
12
27
|
* It manages the context window.
|
|
13
|
-
* Tracks the success criteria of reaching the goal, exposing metrics (stretch)
|
|
28
|
+
* Tracks the success criteria of reaching the goal, exposing metrics (stretch).
|
|
14
29
|
* Could be run locally in the app or remotely.
|
|
15
30
|
* Could be personal or shared.
|
|
16
31
|
*/
|
|
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
|
-
}>>;
|
|
30
|
-
export type SessionRunOptions = {
|
|
31
|
-
artifacts: ArtifactDefinition[];
|
|
32
|
-
/**
|
|
33
|
-
* Non-artifact specific tools.
|
|
34
|
-
*/
|
|
35
|
-
tools: ToolId[];
|
|
36
|
-
history: Message[];
|
|
37
|
-
prompt: string;
|
|
38
|
-
generationOptions?: Pick<GenerateRequest, 'model'>;
|
|
39
|
-
extensions?: ToolContextExtensions;
|
|
40
|
-
systemPrompt?: string;
|
|
41
|
-
/**
|
|
42
|
-
* Pre-require artifacts.
|
|
43
|
-
*/
|
|
44
|
-
requiredArtifactIds?: string[];
|
|
45
|
-
client: AiServiceClient;
|
|
46
|
-
toolResolver: ToolResolver;
|
|
47
|
-
/**
|
|
48
|
-
* Executable tools that do not go through the tool resolver.
|
|
49
|
-
*/
|
|
50
|
-
executableTools?: ExecutableTool[];
|
|
51
|
-
/**
|
|
52
|
-
* @see ArtifactDiffResolver
|
|
53
|
-
*/
|
|
54
|
-
artifactDiffResolver?: ArtifactDiffResolver;
|
|
55
|
-
};
|
|
56
|
-
type OperationModel = 'planning' | 'importing' | 'configured';
|
|
57
|
-
export type AiSessionOptions = {
|
|
58
|
-
/**
|
|
59
|
-
* Determines the agent's handling of the artifacts definitions:
|
|
60
|
-
*
|
|
61
|
-
* - `planning`: The model will create a plan with required artifacts for each step.
|
|
62
|
-
* - `importing`: The model can query registry and only pull in the artifacts that are required to complete the task.
|
|
63
|
-
* - `configured`: The available artifacts are pre-selected and the model cannot select additional artifacts.
|
|
64
|
-
*/
|
|
65
|
-
operationModel: OperationModel;
|
|
66
|
-
};
|
|
67
|
-
export declare class AISession {
|
|
32
|
+
export declare class AiSession {
|
|
68
33
|
private readonly _options;
|
|
69
|
-
/**
|
|
70
|
-
private readonly
|
|
71
|
-
/**
|
|
72
|
-
private _pending;
|
|
73
|
-
/** Current streaming response. */
|
|
74
|
-
private _stream;
|
|
75
|
-
/** Prior history from queue. */
|
|
34
|
+
/** Prevents concurrent execution of session. */
|
|
35
|
+
private readonly _semaphore;
|
|
36
|
+
/** Message history from queue. */
|
|
76
37
|
private _history;
|
|
38
|
+
/** Pending messages for this session (incl. the current prompt). */
|
|
39
|
+
private _pending;
|
|
40
|
+
constructor(_options?: AiSessionOptions);
|
|
41
|
+
run: <Tools extends Record<string, Tool.Any>>({ prompt, system: systemTemplate, history, objects, blueprints, toolkit, observer, }: AiSessionRunParams<Tools>) => Effect.Effect<DataType.Message[], AiSessionRunError, AiSessionRunRequirements>;
|
|
77
42
|
/**
|
|
78
|
-
*
|
|
79
|
-
*/
|
|
80
|
-
readonly message: Event<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
81
|
-
id: string;
|
|
82
|
-
content: ({
|
|
83
|
-
pending?: boolean | undefined;
|
|
84
|
-
type: "text";
|
|
85
|
-
text: string;
|
|
86
|
-
disposition?: string | undefined;
|
|
87
|
-
} | {
|
|
88
|
-
pending?: boolean | undefined;
|
|
89
|
-
type: "json";
|
|
90
|
-
disposition?: string | undefined;
|
|
91
|
-
json: string;
|
|
92
|
-
} | {
|
|
93
|
-
pending?: boolean | undefined;
|
|
94
|
-
id?: string | undefined;
|
|
95
|
-
type: "image";
|
|
96
|
-
source?: {
|
|
97
|
-
type: "base64";
|
|
98
|
-
mediaType: string;
|
|
99
|
-
data: string;
|
|
100
|
-
} | undefined;
|
|
101
|
-
} | {
|
|
102
|
-
pending?: boolean | undefined;
|
|
103
|
-
id: string;
|
|
104
|
-
type: "tool_use";
|
|
105
|
-
name: string;
|
|
106
|
-
input: unknown;
|
|
107
|
-
currentStatus?: {
|
|
108
|
-
readonly id: string;
|
|
109
|
-
message: string;
|
|
110
|
-
} | undefined;
|
|
111
|
-
} | {
|
|
112
|
-
pending?: boolean | undefined;
|
|
113
|
-
type: "tool_result";
|
|
114
|
-
toolUseId: string;
|
|
115
|
-
content: string;
|
|
116
|
-
isError?: boolean | undefined;
|
|
117
|
-
})[];
|
|
118
|
-
role: "user" | "assistant";
|
|
119
|
-
}>;
|
|
120
|
-
/**
|
|
121
|
-
* Complete block added to Message.
|
|
122
|
-
*/
|
|
123
|
-
readonly block: Event<{
|
|
124
|
-
pending?: boolean | undefined;
|
|
125
|
-
type: "text";
|
|
126
|
-
text: string;
|
|
127
|
-
disposition?: string | undefined;
|
|
128
|
-
} | {
|
|
129
|
-
pending?: boolean | undefined;
|
|
130
|
-
type: "json";
|
|
131
|
-
disposition?: string | undefined;
|
|
132
|
-
json: string;
|
|
133
|
-
} | {
|
|
134
|
-
pending?: boolean | undefined;
|
|
135
|
-
id?: string | undefined;
|
|
136
|
-
type: "image";
|
|
137
|
-
source?: {
|
|
138
|
-
type: "base64";
|
|
139
|
-
mediaType: string;
|
|
140
|
-
data: string;
|
|
141
|
-
} | undefined;
|
|
142
|
-
} | {
|
|
143
|
-
pending?: boolean | undefined;
|
|
144
|
-
id: string;
|
|
145
|
-
type: "tool_use";
|
|
146
|
-
name: string;
|
|
147
|
-
input: unknown;
|
|
148
|
-
currentStatus?: {
|
|
149
|
-
readonly id: string;
|
|
150
|
-
message: string;
|
|
151
|
-
} | undefined;
|
|
152
|
-
} | {
|
|
153
|
-
pending?: boolean | undefined;
|
|
154
|
-
type: "tool_result";
|
|
155
|
-
toolUseId: string;
|
|
156
|
-
content: string;
|
|
157
|
-
isError?: boolean | undefined;
|
|
158
|
-
}>;
|
|
159
|
-
/**
|
|
160
|
-
* Update partial block (while streaming).
|
|
161
|
-
*/
|
|
162
|
-
readonly update: Event<{
|
|
163
|
-
pending?: boolean | undefined;
|
|
164
|
-
type: "text";
|
|
165
|
-
text: string;
|
|
166
|
-
disposition?: string | undefined;
|
|
167
|
-
} | {
|
|
168
|
-
pending?: boolean | undefined;
|
|
169
|
-
type: "json";
|
|
170
|
-
disposition?: string | undefined;
|
|
171
|
-
json: string;
|
|
172
|
-
} | {
|
|
173
|
-
pending?: boolean | undefined;
|
|
174
|
-
id?: string | undefined;
|
|
175
|
-
type: "image";
|
|
176
|
-
source?: {
|
|
177
|
-
type: "base64";
|
|
178
|
-
mediaType: string;
|
|
179
|
-
data: string;
|
|
180
|
-
} | undefined;
|
|
181
|
-
} | {
|
|
182
|
-
pending?: boolean | undefined;
|
|
183
|
-
id: string;
|
|
184
|
-
type: "tool_use";
|
|
185
|
-
name: string;
|
|
186
|
-
input: unknown;
|
|
187
|
-
currentStatus?: {
|
|
188
|
-
readonly id: string;
|
|
189
|
-
message: string;
|
|
190
|
-
} | undefined;
|
|
191
|
-
} | {
|
|
192
|
-
pending?: boolean | undefined;
|
|
193
|
-
type: "tool_result";
|
|
194
|
-
toolUseId: string;
|
|
195
|
-
content: string;
|
|
196
|
-
isError?: boolean | undefined;
|
|
197
|
-
}>;
|
|
198
|
-
/**
|
|
199
|
-
* Unparsed events from the underlying generation stream.
|
|
200
|
-
*/
|
|
201
|
-
readonly streamEvent: Event<import("@dxos/ai").GenerationStreamEvent>;
|
|
202
|
-
/**
|
|
203
|
-
* User prompt or tool result.
|
|
204
|
-
*/
|
|
205
|
-
readonly userMessage: Event<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
206
|
-
id: string;
|
|
207
|
-
role: "user" | "assistant";
|
|
208
|
-
content: ({
|
|
209
|
-
pending?: boolean | undefined;
|
|
210
|
-
type: "text";
|
|
211
|
-
disposition?: string | undefined;
|
|
212
|
-
text: string;
|
|
213
|
-
} | {
|
|
214
|
-
pending?: boolean | undefined;
|
|
215
|
-
type: "json";
|
|
216
|
-
disposition?: string | undefined;
|
|
217
|
-
json: string;
|
|
218
|
-
} | {
|
|
219
|
-
pending?: boolean | undefined;
|
|
220
|
-
id?: string | undefined;
|
|
221
|
-
type: "image";
|
|
222
|
-
source?: {
|
|
223
|
-
type: "base64";
|
|
224
|
-
mediaType: string;
|
|
225
|
-
data: string;
|
|
226
|
-
} | undefined;
|
|
227
|
-
} | {
|
|
228
|
-
pending?: boolean | undefined;
|
|
229
|
-
id: string;
|
|
230
|
-
name: string;
|
|
231
|
-
type: "tool_use";
|
|
232
|
-
input: unknown;
|
|
233
|
-
currentStatus?: {
|
|
234
|
-
readonly id: string;
|
|
235
|
-
message: string;
|
|
236
|
-
} | undefined;
|
|
237
|
-
} | {
|
|
238
|
-
pending?: boolean | undefined;
|
|
239
|
-
type: "tool_result";
|
|
240
|
-
content: string;
|
|
241
|
-
toolUseId: string;
|
|
242
|
-
isError?: boolean | undefined;
|
|
243
|
-
})[];
|
|
244
|
-
}>;
|
|
245
|
-
/**
|
|
246
|
-
* Agent self-reporting its status.
|
|
247
|
-
* Triggered by the model.
|
|
248
|
-
*/
|
|
249
|
-
readonly statusReport: Event<AgentStatus>;
|
|
250
|
-
/**
|
|
251
|
-
* Emits when the session is done.
|
|
252
|
-
*/
|
|
253
|
-
readonly done: Event<void>;
|
|
254
|
-
/**
|
|
255
|
-
* Emits when the tool reports its status.
|
|
256
|
-
* Triggered by the tool execution function.
|
|
257
|
-
*/
|
|
258
|
-
readonly toolStatusReport: Event<{
|
|
259
|
-
message: Message;
|
|
260
|
-
status: AgentStatus;
|
|
261
|
-
}>;
|
|
262
|
-
constructor(_options: AiSessionOptions);
|
|
263
|
-
/**
|
|
264
|
-
* Runs the AI model loop interacting with tools and artifacts.
|
|
265
|
-
* @param options - The session options.
|
|
266
|
-
* @returns The messages generated by the session, including the user's prompt.
|
|
43
|
+
* @deprecated
|
|
267
44
|
*/
|
|
268
|
-
|
|
269
|
-
runStructured<S extends Schema.Schema.AnyNoContext>(schema: S, options: SessionRunOptions): Promise<Schema.Schema.Type<S>>;
|
|
270
|
-
private _formatUserPrompt;
|
|
271
|
-
private _createQueryArtifactsTool;
|
|
272
|
-
private _createRequireTool;
|
|
273
|
-
private _createPlanningTool;
|
|
274
|
-
private _onToolStatusReport;
|
|
275
|
-
abort(): void;
|
|
276
|
-
}
|
|
277
|
-
declare const AIServiecOverloadedError_base: Schema.TaggedErrorClass<AIServiecOverloadedError, "AIServiecOverloadedError", {
|
|
278
|
-
readonly _tag: Schema.tag<"AIServiecOverloadedError">;
|
|
279
|
-
}>;
|
|
280
|
-
export declare class AIServiecOverloadedError extends AIServiecOverloadedError_base {
|
|
45
|
+
runStructured<S extends Schema.Schema.AnyNoContext>(_schema: S, _options: AiSessionRunParams<any>): Promise<Schema.Schema.Type<S>>;
|
|
281
46
|
}
|
|
282
|
-
export {};
|
|
283
47
|
//# 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,EAAE,KAAK,OAAO,EAAE,aAAa,EAAE,KAAK,IAAI,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAClF,OAAO,EAAS,MAAM,EAAE,KAAK,MAAM,EAAU,MAAM,QAAQ,CAAC;AAE5D,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,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,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;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;IAC7B,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,CAA0B;IAE1C,oEAAoE;IACpE,OAAO,CAAC,QAAQ,CAA0B;gBAEb,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,QAAQ,CAAC,OAAO,EAAE,EAAE,iBAAiB,EAAE,wBAAwB,CAAC,CA+FjC;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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Tool, Toolkit } from '@effect/ai';
|
|
2
|
+
import { Effect } from 'effect';
|
|
3
|
+
import { type AiToolNotFoundError, ToolExecutionService, type ToolId, ToolResolverService } from '@dxos/ai';
|
|
4
|
+
import { type Blueprint } from '@dxos/blueprints';
|
|
5
|
+
export type ToolkitParams<Tools extends Record<string, Tool.Any>> = {
|
|
6
|
+
toolkit?: Toolkit.Toolkit<Tools>;
|
|
7
|
+
toolIds?: ToolId[];
|
|
8
|
+
blueprints?: Blueprint.Blueprint[];
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Build a combined toolkit from the blueprint tools and the provided toolkit.
|
|
12
|
+
*/
|
|
13
|
+
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
|
+
//# sourceMappingURL=toolkit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolkit.d.ts","sourceRoot":"","sources":["../../../../src/session/toolkit.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAgB,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE9C,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
1
|
import { Schema } from 'effect';
|
|
2
|
-
import { type MessageContentBlock } from '@dxos/ai';
|
|
3
2
|
import { type ObjectVersion } from '@dxos/echo-db';
|
|
4
|
-
import { type
|
|
3
|
+
import { type AnyEchoObject } from '@dxos/echo-schema';
|
|
4
|
+
import { type ContentBlock } from '@dxos/schema';
|
|
5
5
|
declare const VersionPinSchema: Schema.Struct<{
|
|
6
6
|
objectId: import("@dxos/keys").ObjectIdClass;
|
|
7
7
|
version: Schema.Schema<ObjectVersion, ObjectVersion, never>;
|
|
@@ -14,8 +14,8 @@ export interface VersionPin extends Schema.Schema.Type<typeof VersionPinSchema>
|
|
|
14
14
|
}
|
|
15
15
|
export declare const VersionPin: typeof VersionPinSchema & {
|
|
16
16
|
DISPOSITION: 'version-pin';
|
|
17
|
-
fromObject: (object:
|
|
18
|
-
createBlock: (pin: VersionPin) =>
|
|
17
|
+
fromObject: (object: AnyEchoObject) => VersionPin;
|
|
18
|
+
createBlock: (pin: VersionPin) => ContentBlock.Any;
|
|
19
19
|
};
|
|
20
20
|
export {};
|
|
21
21
|
//# sourceMappingURL=version-pin.d.ts.map
|
|
@@ -1 +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,EAAE,KAAK,
|
|
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,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,KAAK,aAAa,EAAY,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAKjD,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 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/templates/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ModelCapabilities } from '@dxos/ai';
|
|
2
|
+
import { Template } from '@dxos/blueprints';
|
|
3
|
+
/**
|
|
4
|
+
* System template variables.
|
|
5
|
+
*/
|
|
6
|
+
export type SystemPromptOptions = ModelCapabilities & {
|
|
7
|
+
DATETIME: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Base system prompt.
|
|
11
|
+
* NOTE: This contains protocol instructions that can not be dynamically edited.
|
|
12
|
+
*/
|
|
13
|
+
export declare const createSystemPrompt: (options?: Partial<SystemPromptOptions>) => string;
|
|
14
|
+
export declare const templates: {
|
|
15
|
+
/** Editable system prompt.*/
|
|
16
|
+
system: Template.Template;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=system.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../../src/templates/system.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAK5C;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,GAAG;IACpD,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,UAAS,OAAO,CAAC,mBAAmB,CAAM,WAM1E,CAAC;AAEJ,eAAO,MAAM,SAAS;IACpB,6BAA6B;;CAQ9B,CAAC"}
|