@dxos/assistant 0.8.4-main.fffef41 → 0.9.0
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/LICENSE +102 -5
- package/README.md +2 -1
- package/dist/lib/{browser → neutral}/extraction/index.mjs +42 -59
- package/dist/lib/neutral/extraction/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +1886 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/types/src/extraction/extraction-ner-function/index.d.ts +0 -1
- package/dist/types/src/extraction/extraction-ner-function/index.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 +1649 -317
- package/dist/types/src/extraction/extraction.d.ts.map +1 -1
- package/dist/types/src/extraction/index.d.ts +0 -1
- package/dist/types/src/extraction/index.d.ts.map +1 -1
- package/dist/types/src/extraction/quotes.d.ts +2 -2
- package/dist/types/src/extraction/quotes.d.ts.map +1 -1
- package/dist/types/src/functions/services.d.ts +14 -16
- package/dist/types/src/functions/services.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -5
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/request/AiRequest.d.ts +308 -0
- package/dist/types/src/request/AiRequest.d.ts.map +1 -0
- package/dist/types/src/{session → request}/artifact-diff.d.ts +4 -4
- package/dist/types/src/request/artifact-diff.d.ts.map +1 -0
- package/dist/types/src/request/format.d.ts +15 -0
- package/dist/types/src/request/format.d.ts.map +1 -0
- package/dist/types/src/request/index.d.ts +4 -0
- package/dist/types/src/request/index.d.ts.map +1 -0
- package/dist/types/src/{session → request}/observer.d.ts +4 -3
- package/dist/types/src/request/observer.d.ts.map +1 -0
- package/dist/types/src/{session → request}/version-pin.d.ts +4 -4
- package/dist/types/src/request/version-pin.d.ts.map +1 -0
- package/dist/types/src/session/AiContext.d.ts +178 -0
- package/dist/types/src/session/AiContext.d.ts.map +1 -0
- package/dist/types/src/session/AiContext.test.d.ts +2 -0
- package/dist/types/src/session/AiContext.test.d.ts.map +1 -0
- package/dist/types/src/session/AiSession.d.ts +79 -0
- package/dist/types/src/session/AiSession.d.ts.map +1 -0
- package/dist/types/src/session/AiSession.test.d.ts +2 -0
- package/dist/types/src/session/AiSession.test.d.ts.map +1 -0
- package/dist/types/src/session/SessionLink.d.ts +17 -0
- package/dist/types/src/session/SessionLink.d.ts.map +1 -0
- package/dist/types/src/session/SessionLoader.d.ts +15 -0
- package/dist/types/src/session/SessionLoader.d.ts.map +1 -0
- package/dist/types/src/session/SessionLoader.test.d.ts +2 -0
- package/dist/types/src/session/SessionLoader.test.d.ts.map +1 -0
- package/dist/types/src/session/index.d.ts +4 -5
- package/dist/types/src/session/index.d.ts.map +1 -1
- package/dist/types/src/session/toolkit.d.ts +10 -9
- package/dist/types/src/session/toolkit.d.ts.map +1 -1
- package/dist/types/src/templates/system.d.ts +12 -3
- package/dist/types/src/templates/system.d.ts.map +1 -1
- package/dist/types/src/util/artifact.d.ts +18 -0
- package/dist/types/src/util/artifact.d.ts.map +1 -0
- package/dist/types/src/{diff.d.ts → util/diff.d.ts} +4 -2
- package/dist/types/src/util/diff.d.ts.map +1 -0
- package/dist/types/src/{diff.test.d.ts.map → util/diff.test.d.ts.map} +1 -1
- package/dist/types/src/util/error-handling.d.ts.map +1 -0
- package/dist/types/src/{errors.d.ts → util/errors.d.ts} +24 -28
- package/dist/types/src/util/errors.d.ts.map +1 -0
- package/dist/types/src/{execution-graph.d.ts → util/execution-graph.d.ts} +2 -2
- package/dist/types/src/util/execution-graph.d.ts.map +1 -0
- package/dist/types/src/util/execution-graph.test.d.ts.map +1 -0
- package/dist/types/src/util/index.d.ts +7 -0
- package/dist/types/src/util/index.d.ts.map +1 -0
- package/dist/types/src/util/tracing.d.ts +296 -0
- package/dist/types/src/util/tracing.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +36 -44
- package/src/extraction/extraction-ner-function/index.ts +0 -1
- package/src/extraction/extraction.ts +47 -18
- package/src/extraction/index.ts +0 -1
- package/src/extraction/quotes.test.ts +2 -2
- package/src/extraction/quotes.ts +6 -8
- package/src/functions/services.ts +129 -63
- package/src/index.ts +2 -5
- package/src/request/AiRequest.ts +387 -0
- package/src/{session → request}/artifact-diff.ts +4 -4
- package/src/{session → request}/format.ts +28 -25
- package/src/request/index.ts +8 -0
- package/src/{session → request}/observer.ts +4 -1
- package/src/{session → request}/version-pin.ts +6 -5
- package/src/session/AiContext.test.ts +49 -0
- package/src/session/AiContext.ts +420 -0
- package/src/session/AiSession.test.ts +111 -0
- package/src/session/AiSession.ts +328 -0
- package/src/session/SessionLink.ts +23 -0
- package/src/session/SessionLoader.test.ts +115 -0
- package/src/session/SessionLoader.ts +55 -0
- package/src/session/index.ts +4 -5
- package/src/session/toolkit.ts +27 -28
- package/src/templates/instructions/format.tpl +0 -4
- package/src/templates/instructions/system.tpl +50 -2
- package/src/templates/system.ts +7 -6
- package/src/util/artifact.ts +96 -0
- package/src/util/diff.test.ts +74 -0
- package/src/{diff.ts → util/diff.ts} +14 -5
- package/src/{session → util}/error-handling.ts +3 -2
- package/src/util/errors.ts +15 -0
- package/src/{execution-graph.test.ts → util/execution-graph.test.ts} +4 -4
- package/src/{execution-graph.ts → util/execution-graph.ts} +30 -19
- package/src/util/index.ts +10 -0
- package/src/util/tracing.ts +60 -0
- package/dist/lib/browser/extraction/index.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -1290
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +0 -7
- package/dist/lib/node-esm/extraction/index.mjs +0 -226
- package/dist/lib/node-esm/extraction/index.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -1291
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/types/src/conversation/context.d.ts +0 -103
- package/dist/types/src/conversation/context.d.ts.map +0 -1
- package/dist/types/src/conversation/conversation.d.ts +0 -41
- package/dist/types/src/conversation/conversation.d.ts.map +0 -1
- package/dist/types/src/conversation/index.d.ts +0 -3
- package/dist/types/src/conversation/index.d.ts.map +0 -1
- package/dist/types/src/diff.d.ts.map +0 -1
- package/dist/types/src/errors.d.ts.map +0 -1
- package/dist/types/src/execution-graph.d.ts.map +0 -1
- package/dist/types/src/execution-graph.test.d.ts.map +0 -1
- package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts +0 -4
- package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.d.ts.map +0 -1
- package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.test.d.ts +0 -2
- package/dist/types/src/extraction/extraction-llm-function/extraction-llm-function.test.d.ts.map +0 -1
- package/dist/types/src/extraction/extraction-llm-function/index.d.ts +0 -2
- package/dist/types/src/extraction/extraction-llm-function/index.d.ts.map +0 -1
- package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts +0 -345
- package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.d.ts.map +0 -1
- package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.test.d.ts +0 -2
- package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.test.d.ts.map +0 -1
- package/dist/types/src/session/GenericToolkit.d.ts +0 -84
- package/dist/types/src/session/GenericToolkit.d.ts.map +0 -1
- package/dist/types/src/session/artifact-diff.d.ts.map +0 -1
- package/dist/types/src/session/error-handling.d.ts.map +0 -1
- package/dist/types/src/session/format.d.ts +0 -12
- package/dist/types/src/session/format.d.ts.map +0 -1
- package/dist/types/src/session/format.test.d.ts +0 -2
- package/dist/types/src/session/format.test.d.ts.map +0 -1
- package/dist/types/src/session/observer.d.ts.map +0 -1
- package/dist/types/src/session/session.d.ts +0 -51
- package/dist/types/src/session/session.d.ts.map +0 -1
- package/dist/types/src/session/session.test.d.ts +0 -2
- package/dist/types/src/session/session.test.d.ts.map +0 -1
- package/dist/types/src/session/version-pin.d.ts.map +0 -1
- package/dist/types/src/types/artifact.d.ts +0 -20
- package/dist/types/src/types/artifact.d.ts.map +0 -1
- package/dist/types/src/types/index.d.ts +0 -2
- package/dist/types/src/types/index.d.ts.map +0 -1
- package/src/conversation/context.ts +0 -186
- package/src/conversation/conversation.ts +0 -128
- package/src/conversation/index.ts +0 -6
- package/src/diff.test.ts +0 -43
- package/src/errors.ts +0 -15
- package/src/extraction/extraction-llm-function/extraction-llm-function.test.ts +0 -84
- package/src/extraction/extraction-llm-function/extraction-llm-function.ts +0 -62
- package/src/extraction/extraction-llm-function/index.ts +0 -5
- package/src/extraction/extraction-ner-function/extraction-ner-function.test.ts +0 -116
- package/src/extraction/extraction-ner-function/extraction-ner-function.ts +0 -56
- package/src/session/GenericToolkit.ts +0 -130
- package/src/session/format.test.ts +0 -61
- package/src/session/session.conversations.json +0 -1
- package/src/session/session.test.ts +0 -149
- package/src/session/session.ts +0 -213
- package/src/types/artifact.ts +0 -71
- package/src/types/index.ts +0 -5
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
- /package/dist/types/src/{diff.test.d.ts → util/diff.test.d.ts} +0 -0
- /package/dist/types/src/{session → util}/error-handling.d.ts +0 -0
- /package/dist/types/src/{execution-graph.test.d.ts → util/execution-graph.test.d.ts} +0 -0
|
@@ -1,345 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Named Entity Recognition model
|
|
3
|
-
*/
|
|
4
|
-
export declare const extractionNerFunction: import("@dxos/functions").FunctionDefinition<{
|
|
5
|
-
readonly options?: {
|
|
6
|
-
readonly timeout?: number | undefined;
|
|
7
|
-
readonly fallbackToRaw?: boolean | undefined;
|
|
8
|
-
} | undefined;
|
|
9
|
-
readonly message: import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
10
|
-
id: string;
|
|
11
|
-
parentMessage?: string | undefined;
|
|
12
|
-
created: string;
|
|
13
|
-
sender: {
|
|
14
|
-
name?: string | undefined;
|
|
15
|
-
contact?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
16
|
-
image?: string | undefined;
|
|
17
|
-
fullName?: string | undefined;
|
|
18
|
-
preferredName?: string | undefined;
|
|
19
|
-
nickname?: string | undefined;
|
|
20
|
-
organization?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
21
|
-
description?: string | undefined;
|
|
22
|
-
id: string;
|
|
23
|
-
name?: string | undefined;
|
|
24
|
-
status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
|
|
25
|
-
image?: string | undefined;
|
|
26
|
-
website?: string | undefined;
|
|
27
|
-
location?: readonly [number, number, (number | undefined)?] | undefined;
|
|
28
|
-
}> | undefined;
|
|
29
|
-
jobTitle?: string | undefined;
|
|
30
|
-
department?: string | undefined;
|
|
31
|
-
notes?: string | undefined;
|
|
32
|
-
emails?: {
|
|
33
|
-
readonly value: string;
|
|
34
|
-
readonly label?: string | undefined;
|
|
35
|
-
}[] | undefined;
|
|
36
|
-
identities?: {
|
|
37
|
-
readonly value: string;
|
|
38
|
-
readonly label?: string | undefined;
|
|
39
|
-
}[] | undefined;
|
|
40
|
-
phoneNumbers?: {
|
|
41
|
-
readonly value: string;
|
|
42
|
-
readonly label?: string | undefined;
|
|
43
|
-
}[] | undefined;
|
|
44
|
-
addresses?: {
|
|
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
|
-
readonly label?: string | undefined;
|
|
55
|
-
}[] | undefined;
|
|
56
|
-
urls?: {
|
|
57
|
-
readonly value: string;
|
|
58
|
-
readonly label?: string | undefined;
|
|
59
|
-
}[] | undefined;
|
|
60
|
-
birthday?: string | undefined;
|
|
61
|
-
fields?: {
|
|
62
|
-
readonly value: string;
|
|
63
|
-
readonly label: string;
|
|
64
|
-
readonly category?: string | undefined;
|
|
65
|
-
}[] | undefined;
|
|
66
|
-
location?: readonly [number, number, (number | undefined)?] | undefined;
|
|
67
|
-
}> | undefined;
|
|
68
|
-
identityDid?: string | undefined;
|
|
69
|
-
identityKey?: string | undefined;
|
|
70
|
-
email?: string | undefined;
|
|
71
|
-
role?: "user" | "assistant" | "tool" | undefined;
|
|
72
|
-
};
|
|
73
|
-
blocks: ({
|
|
74
|
-
version: unknown;
|
|
75
|
-
_tag: "anchor";
|
|
76
|
-
pending?: boolean | undefined;
|
|
77
|
-
objectId: string;
|
|
78
|
-
} | {
|
|
79
|
-
_tag: "file";
|
|
80
|
-
pending?: boolean | undefined;
|
|
81
|
-
url: string;
|
|
82
|
-
name?: string | undefined;
|
|
83
|
-
mediaType?: string | undefined;
|
|
84
|
-
} | {
|
|
85
|
-
id?: string | undefined;
|
|
86
|
-
_tag: "image";
|
|
87
|
-
pending?: boolean | undefined;
|
|
88
|
-
source?: {
|
|
89
|
-
mediaType: string;
|
|
90
|
-
type: "base64";
|
|
91
|
-
data: string;
|
|
92
|
-
} | {
|
|
93
|
-
url: string;
|
|
94
|
-
type: "http";
|
|
95
|
-
} | undefined;
|
|
96
|
-
} | {
|
|
97
|
-
_tag: "json";
|
|
98
|
-
pending?: boolean | undefined;
|
|
99
|
-
data: string;
|
|
100
|
-
disposition?: string | undefined;
|
|
101
|
-
} | {
|
|
102
|
-
text: string;
|
|
103
|
-
_tag: "proposal";
|
|
104
|
-
pending?: boolean | undefined;
|
|
105
|
-
} | {
|
|
106
|
-
_tag: "reasoning";
|
|
107
|
-
pending?: boolean | undefined;
|
|
108
|
-
reasoningText?: string | undefined;
|
|
109
|
-
redactedText?: string | undefined;
|
|
110
|
-
signature?: string | undefined;
|
|
111
|
-
} | {
|
|
112
|
-
reference: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").Expando>;
|
|
113
|
-
_tag: "reference";
|
|
114
|
-
pending?: boolean | undefined;
|
|
115
|
-
} | {
|
|
116
|
-
_tag: "select";
|
|
117
|
-
pending?: boolean | undefined;
|
|
118
|
-
options: readonly string[];
|
|
119
|
-
} | {
|
|
120
|
-
_tag: "status";
|
|
121
|
-
pending?: boolean | undefined;
|
|
122
|
-
statusText: string;
|
|
123
|
-
} | {
|
|
124
|
-
text: string;
|
|
125
|
-
_tag: "suggestion";
|
|
126
|
-
pending?: boolean | undefined;
|
|
127
|
-
} | {
|
|
128
|
-
_tag: "summary";
|
|
129
|
-
pending?: boolean | undefined;
|
|
130
|
-
mimeType?: string | undefined;
|
|
131
|
-
message?: string | undefined;
|
|
132
|
-
model?: string | undefined;
|
|
133
|
-
usage?: {
|
|
134
|
-
readonly inputTokens?: number | undefined;
|
|
135
|
-
readonly outputTokens?: number | undefined;
|
|
136
|
-
readonly totalTokens?: number | undefined;
|
|
137
|
-
} | undefined;
|
|
138
|
-
toolCalls?: number | undefined;
|
|
139
|
-
errors?: number | undefined;
|
|
140
|
-
duration?: number | undefined;
|
|
141
|
-
} | {
|
|
142
|
-
text: string;
|
|
143
|
-
_tag: "text";
|
|
144
|
-
pending?: boolean | undefined;
|
|
145
|
-
disposition?: string | undefined;
|
|
146
|
-
mimeType?: string | undefined;
|
|
147
|
-
} | {
|
|
148
|
-
_tag: "toolkit";
|
|
149
|
-
pending?: boolean | undefined;
|
|
150
|
-
} | {
|
|
151
|
-
_tag: "toolCall";
|
|
152
|
-
pending?: boolean | undefined;
|
|
153
|
-
name: string;
|
|
154
|
-
toolCallId: string;
|
|
155
|
-
input: string;
|
|
156
|
-
providerExecuted: boolean;
|
|
157
|
-
} | {
|
|
158
|
-
_tag: "toolResult";
|
|
159
|
-
pending?: boolean | undefined;
|
|
160
|
-
name: string;
|
|
161
|
-
toolCallId: string;
|
|
162
|
-
providerExecuted: boolean;
|
|
163
|
-
result?: string | undefined;
|
|
164
|
-
error?: string | undefined;
|
|
165
|
-
} | {
|
|
166
|
-
text: string;
|
|
167
|
-
_tag: "transcript";
|
|
168
|
-
pending?: boolean | undefined;
|
|
169
|
-
started: string;
|
|
170
|
-
})[];
|
|
171
|
-
properties?: {
|
|
172
|
-
[x: string]: any;
|
|
173
|
-
} | undefined;
|
|
174
|
-
};
|
|
175
|
-
readonly objects?: readonly import("@dxos/echo/internal").Expando[] | undefined;
|
|
176
|
-
}, {
|
|
177
|
-
readonly message: import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
178
|
-
id: string;
|
|
179
|
-
parentMessage?: string | undefined;
|
|
180
|
-
created: string;
|
|
181
|
-
sender: {
|
|
182
|
-
name?: string | undefined;
|
|
183
|
-
contact?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
184
|
-
image?: string | undefined;
|
|
185
|
-
fullName?: string | undefined;
|
|
186
|
-
preferredName?: string | undefined;
|
|
187
|
-
nickname?: string | undefined;
|
|
188
|
-
organization?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
189
|
-
description?: string | undefined;
|
|
190
|
-
id: string;
|
|
191
|
-
name?: string | undefined;
|
|
192
|
-
status?: "prospect" | "qualified" | "active" | "commit" | "reject" | undefined;
|
|
193
|
-
image?: string | undefined;
|
|
194
|
-
website?: string | undefined;
|
|
195
|
-
location?: readonly [number, number, (number | undefined)?] | undefined;
|
|
196
|
-
}> | undefined;
|
|
197
|
-
jobTitle?: string | undefined;
|
|
198
|
-
department?: string | undefined;
|
|
199
|
-
notes?: string | undefined;
|
|
200
|
-
emails?: {
|
|
201
|
-
readonly value: string;
|
|
202
|
-
readonly label?: string | undefined;
|
|
203
|
-
}[] | undefined;
|
|
204
|
-
identities?: {
|
|
205
|
-
readonly value: string;
|
|
206
|
-
readonly label?: string | undefined;
|
|
207
|
-
}[] | undefined;
|
|
208
|
-
phoneNumbers?: {
|
|
209
|
-
readonly value: string;
|
|
210
|
-
readonly label?: string | undefined;
|
|
211
|
-
}[] | undefined;
|
|
212
|
-
addresses?: {
|
|
213
|
-
readonly value: {
|
|
214
|
-
readonly street?: string | undefined;
|
|
215
|
-
readonly extended?: string | undefined;
|
|
216
|
-
readonly locality?: string | undefined;
|
|
217
|
-
readonly region?: string | undefined;
|
|
218
|
-
readonly postalCode?: string | undefined;
|
|
219
|
-
readonly postOfficeBoxNumber?: string | undefined;
|
|
220
|
-
readonly country?: string | undefined;
|
|
221
|
-
};
|
|
222
|
-
readonly label?: string | undefined;
|
|
223
|
-
}[] | undefined;
|
|
224
|
-
urls?: {
|
|
225
|
-
readonly value: string;
|
|
226
|
-
readonly label?: string | undefined;
|
|
227
|
-
}[] | undefined;
|
|
228
|
-
birthday?: string | undefined;
|
|
229
|
-
fields?: {
|
|
230
|
-
readonly value: string;
|
|
231
|
-
readonly label: string;
|
|
232
|
-
readonly category?: string | undefined;
|
|
233
|
-
}[] | undefined;
|
|
234
|
-
location?: readonly [number, number, (number | undefined)?] | undefined;
|
|
235
|
-
}> | undefined;
|
|
236
|
-
identityDid?: string | undefined;
|
|
237
|
-
identityKey?: string | undefined;
|
|
238
|
-
email?: string | undefined;
|
|
239
|
-
role?: "user" | "assistant" | "tool" | undefined;
|
|
240
|
-
};
|
|
241
|
-
blocks: ({
|
|
242
|
-
version: unknown;
|
|
243
|
-
_tag: "anchor";
|
|
244
|
-
pending?: boolean | undefined;
|
|
245
|
-
objectId: string;
|
|
246
|
-
} | {
|
|
247
|
-
_tag: "file";
|
|
248
|
-
pending?: boolean | undefined;
|
|
249
|
-
url: string;
|
|
250
|
-
name?: string | undefined;
|
|
251
|
-
mediaType?: string | undefined;
|
|
252
|
-
} | {
|
|
253
|
-
id?: string | undefined;
|
|
254
|
-
_tag: "image";
|
|
255
|
-
pending?: boolean | undefined;
|
|
256
|
-
source?: {
|
|
257
|
-
mediaType: string;
|
|
258
|
-
type: "base64";
|
|
259
|
-
data: string;
|
|
260
|
-
} | {
|
|
261
|
-
url: string;
|
|
262
|
-
type: "http";
|
|
263
|
-
} | undefined;
|
|
264
|
-
} | {
|
|
265
|
-
_tag: "json";
|
|
266
|
-
pending?: boolean | undefined;
|
|
267
|
-
data: string;
|
|
268
|
-
disposition?: string | undefined;
|
|
269
|
-
} | {
|
|
270
|
-
text: string;
|
|
271
|
-
_tag: "proposal";
|
|
272
|
-
pending?: boolean | undefined;
|
|
273
|
-
} | {
|
|
274
|
-
_tag: "reasoning";
|
|
275
|
-
pending?: boolean | undefined;
|
|
276
|
-
reasoningText?: string | undefined;
|
|
277
|
-
redactedText?: string | undefined;
|
|
278
|
-
signature?: string | undefined;
|
|
279
|
-
} | {
|
|
280
|
-
reference: import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").Expando>;
|
|
281
|
-
_tag: "reference";
|
|
282
|
-
pending?: boolean | undefined;
|
|
283
|
-
} | {
|
|
284
|
-
_tag: "select";
|
|
285
|
-
pending?: boolean | undefined;
|
|
286
|
-
options: readonly string[];
|
|
287
|
-
} | {
|
|
288
|
-
_tag: "status";
|
|
289
|
-
pending?: boolean | undefined;
|
|
290
|
-
statusText: string;
|
|
291
|
-
} | {
|
|
292
|
-
text: string;
|
|
293
|
-
_tag: "suggestion";
|
|
294
|
-
pending?: boolean | undefined;
|
|
295
|
-
} | {
|
|
296
|
-
_tag: "summary";
|
|
297
|
-
pending?: boolean | undefined;
|
|
298
|
-
mimeType?: string | undefined;
|
|
299
|
-
message?: string | undefined;
|
|
300
|
-
model?: string | undefined;
|
|
301
|
-
usage?: {
|
|
302
|
-
readonly inputTokens?: number | undefined;
|
|
303
|
-
readonly outputTokens?: number | undefined;
|
|
304
|
-
readonly totalTokens?: number | undefined;
|
|
305
|
-
} | undefined;
|
|
306
|
-
toolCalls?: number | undefined;
|
|
307
|
-
errors?: number | undefined;
|
|
308
|
-
duration?: number | undefined;
|
|
309
|
-
} | {
|
|
310
|
-
text: string;
|
|
311
|
-
_tag: "text";
|
|
312
|
-
pending?: boolean | undefined;
|
|
313
|
-
disposition?: string | undefined;
|
|
314
|
-
mimeType?: string | undefined;
|
|
315
|
-
} | {
|
|
316
|
-
_tag: "toolkit";
|
|
317
|
-
pending?: boolean | undefined;
|
|
318
|
-
} | {
|
|
319
|
-
_tag: "toolCall";
|
|
320
|
-
pending?: boolean | undefined;
|
|
321
|
-
name: string;
|
|
322
|
-
toolCallId: string;
|
|
323
|
-
input: string;
|
|
324
|
-
providerExecuted: boolean;
|
|
325
|
-
} | {
|
|
326
|
-
_tag: "toolResult";
|
|
327
|
-
pending?: boolean | undefined;
|
|
328
|
-
name: string;
|
|
329
|
-
toolCallId: string;
|
|
330
|
-
providerExecuted: boolean;
|
|
331
|
-
result?: string | undefined;
|
|
332
|
-
error?: string | undefined;
|
|
333
|
-
} | {
|
|
334
|
-
text: string;
|
|
335
|
-
_tag: "transcript";
|
|
336
|
-
pending?: boolean | undefined;
|
|
337
|
-
started: string;
|
|
338
|
-
})[];
|
|
339
|
-
properties?: {
|
|
340
|
-
[x: string]: any;
|
|
341
|
-
} | undefined;
|
|
342
|
-
};
|
|
343
|
-
readonly timeElapsed: number;
|
|
344
|
-
}, import("@dxos/functions").FunctionServices>;
|
|
345
|
-
//# sourceMappingURL=extraction-ner-function.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extraction-ner-function.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-ner-function/extraction-ner-function.ts"],"names":[],"mappings":"AAQA;;GAEG;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8CA2ChC,CAAC"}
|
package/dist/types/src/extraction/extraction-ner-function/extraction-ner-function.test.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extraction-ner-function.test.d.ts","sourceRoot":"","sources":["../../../../../src/extraction/extraction-ner-function/extraction-ner-function.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,84 +0,0 @@
|
|
|
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 * as Layer from 'effect/Layer';
|
|
5
|
-
import * as Pipeable from 'effect/Pipeable';
|
|
6
|
-
import type * as Schema from 'effect/Schema';
|
|
7
|
-
import type * as SchemaAST from 'effect/SchemaAST';
|
|
8
|
-
/**
|
|
9
|
-
* Unique identifier for generic toolkit instances.
|
|
10
|
-
*/
|
|
11
|
-
export declare const TypeId = "~@dxos/assistant/GenericToolkit";
|
|
12
|
-
/**
|
|
13
|
-
* Type-level representation of the generic toolkit identifier.
|
|
14
|
-
*/
|
|
15
|
-
export type TypeId = typeof TypeId;
|
|
16
|
-
/**
|
|
17
|
-
* Type-safe way to define toolkits where we don't know specific types of tools,
|
|
18
|
-
* and we want to bundle definition and handlers together.
|
|
19
|
-
*
|
|
20
|
-
* Usefull for plugin-based systems, where tools are dynamically added.
|
|
21
|
-
*
|
|
22
|
-
* @param TR requirements type to the tool invocation.
|
|
23
|
-
* @param E failure type to the handlers layer.
|
|
24
|
-
* @param R requirements type to the handlers layer.
|
|
25
|
-
*/
|
|
26
|
-
export interface GenericToolkit<TR = never, E = never, R = never> extends Pipeable.Pipeable {
|
|
27
|
-
readonly [TypeId]: TypeId;
|
|
28
|
-
/**
|
|
29
|
-
* Toolkit definition.
|
|
30
|
-
*/
|
|
31
|
-
readonly toolkit: Toolkit.Toolkit<GenericTools<TR>>;
|
|
32
|
-
/**
|
|
33
|
-
* Handlers layer.
|
|
34
|
-
*/
|
|
35
|
-
readonly layer: Layer.Layer<unknown, E, R>;
|
|
36
|
-
/**
|
|
37
|
-
* Handlers effect.
|
|
38
|
-
*/
|
|
39
|
-
readonly handlers: Effect.Effect<Toolkit.WithHandler<GenericTools<TR>>, E, R>;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Generic constraint.
|
|
43
|
-
*
|
|
44
|
-
* NOTE: Only use in place of `T extends PortableToolkit.Any`. Not suitable for standalone use.
|
|
45
|
-
*/
|
|
46
|
-
export interface Any {
|
|
47
|
-
readonly [TypeId]: TypeId;
|
|
48
|
-
readonly toolkit: Toolkit.Toolkit<any>;
|
|
49
|
-
readonly layer: Layer.Layer<unknown, any, any>;
|
|
50
|
-
}
|
|
51
|
-
export type InvocationRequirements<T extends Any> = T extends GenericToolkit<infer TR, infer _E, infer _R> ? TR : never;
|
|
52
|
-
export type Failure<T extends Any> = T extends GenericToolkit<infer _TR, infer E, infer _R> ? E : never;
|
|
53
|
-
export type Requirements<T extends Any> = T extends GenericToolkit<infer _TR, infer _E, infer R> ? R : never;
|
|
54
|
-
/**
|
|
55
|
-
* Creates a portable toolkit from toolkit definition and handlers layer.
|
|
56
|
-
*/
|
|
57
|
-
export declare const make: <Tools extends Record<string, Tool.Any>, E, R>(toolkit: Toolkit.Toolkit<Tools>, layer: Layer.Layer<Tool.HandlersFor<Tools>, E, R>) => GenericToolkit<E, R>;
|
|
58
|
-
/**
|
|
59
|
-
* Merges multiple portable toolkits into a single portable toolkit.
|
|
60
|
-
*/
|
|
61
|
-
export declare const merge: <const Toolkits extends ReadonlyArray<Any>>(
|
|
62
|
-
/**
|
|
63
|
-
* The toolkits to merge together.
|
|
64
|
-
*/
|
|
65
|
-
...toolkits: Toolkits) => GenericToolkit<InvocationRequirements<Toolkits[number]>, Failure<Toolkits[number]>, Requirements<Toolkits[number]>>;
|
|
66
|
-
/**
|
|
67
|
-
* Generic tools type where we cannot statically enumerate individual tools.
|
|
68
|
-
*/
|
|
69
|
-
export type GenericTools<R = never> = Record<string, Tool.Tool<string, {
|
|
70
|
-
readonly parameters: AnyStructSchemaNoContext;
|
|
71
|
-
readonly success: Schema.Schema.AnyNoContext;
|
|
72
|
-
readonly failure: typeof Schema.Never;
|
|
73
|
-
}, R>>;
|
|
74
|
-
export interface AnyStructSchemaNoContext extends Pipeable.Pipeable {
|
|
75
|
-
readonly [Schema.TypeId]: any;
|
|
76
|
-
readonly make: any;
|
|
77
|
-
readonly Type: any;
|
|
78
|
-
readonly Encoded: any;
|
|
79
|
-
readonly Context: never;
|
|
80
|
-
readonly ast: SchemaAST.AST;
|
|
81
|
-
readonly fields: Schema.Struct.Fields;
|
|
82
|
-
readonly annotations: any;
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=GenericToolkit.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GenericToolkit.d.ts","sourceRoot":"","sources":["../../../../src/session/GenericToolkit.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,KAAK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CAAC;CACvC,EACD,CAAC,CACF,CACF,CAAC;AAEF,MAAM,WAAW,wBAAyB,SAAQ,QAAQ,CAAC,QAAQ;IACjE,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC;IACnB,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC;IACnB,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;IACtC,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC;CAC3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"artifact-diff.d.ts","sourceRoot":"","sources":["../../../../src/session/artifact-diff.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;;AAEnD;;;;;;;GAOG;AAEH,qBAAa,oBAAqB,SAAQ,yBAGvC;CAAG;AAEN,yBAAiB,oBAAoB,CAAC;IACpC,KAAY,OAAO,GAAG;QACpB,OAAO,EAAE,CACP,SAAS,EAAE;YACT,EAAE,EAAE,QAAQ,CAAC;YACb,WAAW,EAAE,aAAa,CAAC;SAC5B,EAAE,KACA,OAAO,CACV,GAAG,CACD,QAAQ,EACR;YACE,OAAO,EAAE,aAAa,CAAC;YACvB,IAAI,CAAC,EAAE,MAAM,CAAC;SACf,CACF,CACF,CAAC;KACH,CAAC;CACH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-handling.d.ts","sourceRoot":"","sources":["../../../../src/session/error-handling.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAE9C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAcxC,eAAO,MAAM,UAAU,GAAI,KAAK,OAAO,CAAC,OAAO,KAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAoB1B,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as Effect from 'effect/Effect';
|
|
2
|
-
import { Message } from '@dxos/types';
|
|
3
|
-
import { type AiSessionRunError, type AiSessionRunParams } from './session';
|
|
4
|
-
/**
|
|
5
|
-
* Formats the system prompt.
|
|
6
|
-
*/
|
|
7
|
-
export declare const formatSystemPrompt: ({ system, blueprints, objects, }: Pick<AiSessionRunParams<any>, "system" | "blueprints" | "objects">) => Effect.Effect<string, never, never>;
|
|
8
|
-
/**
|
|
9
|
-
* Formats the user prompt.
|
|
10
|
-
*/
|
|
11
|
-
export declare const formatUserPrompt: ({ prompt, history, }: Pick<AiSessionRunParams<any>, "prompt" | "history">) => Effect.Effect<Message.Message, AiSessionRunError>;
|
|
12
|
-
//# sourceMappingURL=format.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format.test.d.ts","sourceRoot":"","sources":["../../../../src/session/format.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
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,51 +0,0 @@
|
|
|
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';
|
|
8
|
-
import { type Blueprint } from '@dxos/blueprints';
|
|
9
|
-
import { Obj } from '@dxos/echo';
|
|
10
|
-
import { TracingService } from '@dxos/functions';
|
|
11
|
-
import { Message } from '@dxos/types';
|
|
12
|
-
import { type AiAssistantError } from '../errors';
|
|
13
|
-
import { GenerationObserver } from './observer';
|
|
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>> = {
|
|
17
|
-
prompt: string;
|
|
18
|
-
system?: string;
|
|
19
|
-
history?: Message.Message[];
|
|
20
|
-
objects?: Obj.Any[];
|
|
21
|
-
blueprints?: Blueprint.Blueprint[];
|
|
22
|
-
toolkit?: Toolkit.WithHandler<Tools>;
|
|
23
|
-
observer?: GenerationObserver;
|
|
24
|
-
};
|
|
25
|
-
export type AiSessionOptions = {};
|
|
26
|
-
/**
|
|
27
|
-
* Contains message history, tools, current context.
|
|
28
|
-
* Current context means the state of the app, time of day, and other contextual information.
|
|
29
|
-
* It makes requests to the model, its a state machine.
|
|
30
|
-
* It keeps track of the current goal.
|
|
31
|
-
* It manages the context window.
|
|
32
|
-
* Tracks the success criteria of reaching the goal, exposing metrics (stretch).
|
|
33
|
-
* Could be run locally in the app or remotely.
|
|
34
|
-
* Could be personal or shared.
|
|
35
|
-
*/
|
|
36
|
-
export declare class AiSession {
|
|
37
|
-
private readonly _options;
|
|
38
|
-
/** Prevents concurrent execution of session. */
|
|
39
|
-
private readonly _semaphore;
|
|
40
|
-
/** Message history from queue. */
|
|
41
|
-
private _history;
|
|
42
|
-
/** Pending messages for this session (incl. the current prompt). */
|
|
43
|
-
private _pending;
|
|
44
|
-
constructor(_options?: AiSessionOptions);
|
|
45
|
-
run: <Tools extends Record<string, Tool.Any>>({ prompt, system: systemTemplate, history, objects, blueprints, toolkit, observer, }: AiSessionRunParams<Tools>) => Effect.Effect<Message.Message[], AiSessionRunError, AiSessionRunRequirements>;
|
|
46
|
-
/**
|
|
47
|
-
* @deprecated
|
|
48
|
-
*/
|
|
49
|
-
runStructured<S extends Schema.Schema.AnyNoContext>(_schema: S, _options: AiSessionRunParams<any>): Promise<Schema.Schema.Type<S>>;
|
|
50
|
-
}
|
|
51
|
-
//# sourceMappingURL=session.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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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version":3,"file":"session.test.d.ts","sourceRoot":"","sources":["../../../../src/session/session.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC"}
|