@vertesia/client 0.79.0 → 0.79.2
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/lib/cjs/InteractionCatalogApi.js +64 -0
- package/lib/cjs/InteractionCatalogApi.js.map +1 -0
- package/lib/cjs/InteractionOutput.js +300 -0
- package/lib/cjs/InteractionOutput.js.map +1 -0
- package/lib/cjs/InteractionResult.example.js +57 -0
- package/lib/cjs/InteractionResult.example.js.map +1 -0
- package/lib/cjs/InteractionsApi.js +20 -6
- package/lib/cjs/InteractionsApi.js.map +1 -1
- package/lib/cjs/ProjectsApi.js +5 -0
- package/lib/cjs/ProjectsApi.js.map +1 -1
- package/lib/cjs/RunsApi.js +12 -4
- package/lib/cjs/RunsApi.js.map +1 -1
- package/lib/cjs/client.js +105 -38
- package/lib/cjs/client.js.map +1 -1
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/store/CollectionsApi.js +30 -0
- package/lib/cjs/store/CollectionsApi.js.map +1 -1
- package/lib/cjs/store/FilesApi.js +9 -8
- package/lib/cjs/store/FilesApi.js.map +1 -1
- package/lib/cjs/store/ObjectsApi.js +5 -4
- package/lib/cjs/store/ObjectsApi.js.map +1 -1
- package/lib/cjs/store/TypesApi.js +1 -1
- package/lib/cjs/store/TypesApi.js.map +1 -1
- package/lib/cjs/store/WorkflowsApi.js +151 -2
- package/lib/cjs/store/WorkflowsApi.js.map +1 -1
- package/lib/cjs/store/client.js.map +1 -1
- package/lib/esm/InteractionCatalogApi.js +60 -0
- package/lib/esm/InteractionCatalogApi.js.map +1 -0
- package/lib/esm/InteractionOutput.js +293 -0
- package/lib/esm/InteractionOutput.js.map +1 -0
- package/lib/esm/InteractionResult.example.js +55 -0
- package/lib/esm/InteractionResult.example.js.map +1 -0
- package/lib/esm/InteractionsApi.js +20 -6
- package/lib/esm/InteractionsApi.js.map +1 -1
- package/lib/esm/ProjectsApi.js +5 -0
- package/lib/esm/ProjectsApi.js.map +1 -1
- package/lib/esm/RunsApi.js +12 -4
- package/lib/esm/RunsApi.js.map +1 -1
- package/lib/esm/client.js +105 -38
- package/lib/esm/client.js.map +1 -1
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/store/CollectionsApi.js +30 -0
- package/lib/esm/store/CollectionsApi.js.map +1 -1
- package/lib/esm/store/FilesApi.js +9 -8
- package/lib/esm/store/FilesApi.js.map +1 -1
- package/lib/esm/store/ObjectsApi.js +5 -4
- package/lib/esm/store/ObjectsApi.js.map +1 -1
- package/lib/esm/store/TypesApi.js +1 -1
- package/lib/esm/store/TypesApi.js.map +1 -1
- package/lib/esm/store/WorkflowsApi.js +151 -2
- package/lib/esm/store/WorkflowsApi.js.map +1 -1
- package/lib/esm/store/client.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/InteractionCatalogApi.d.ts +36 -0
- package/lib/types/InteractionCatalogApi.d.ts.map +1 -0
- package/lib/types/InteractionOutput.d.ts +174 -0
- package/lib/types/InteractionOutput.d.ts.map +1 -0
- package/lib/types/InteractionResult.example.d.ts +6 -0
- package/lib/types/InteractionResult.example.d.ts.map +1 -0
- package/lib/types/InteractionsApi.d.ts +9 -6
- package/lib/types/InteractionsApi.d.ts.map +1 -1
- package/lib/types/ProjectsApi.d.ts +2 -1
- package/lib/types/ProjectsApi.d.ts.map +1 -1
- package/lib/types/RunsApi.d.ts +6 -4
- package/lib/types/RunsApi.d.ts.map +1 -1
- package/lib/types/client.d.ts +8 -4
- package/lib/types/client.d.ts.map +1 -1
- package/lib/types/index.d.ts +2 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/store/CollectionsApi.d.ts +18 -2
- package/lib/types/store/CollectionsApi.d.ts.map +1 -1
- package/lib/types/store/FilesApi.d.ts +3 -2
- package/lib/types/store/FilesApi.d.ts.map +1 -1
- package/lib/types/store/ObjectsApi.d.ts +6 -11
- package/lib/types/store/ObjectsApi.d.ts.map +1 -1
- package/lib/types/store/WorkflowsApi.d.ts +12 -0
- package/lib/types/store/WorkflowsApi.d.ts.map +1 -1
- package/lib/types/store/client.d.ts +1 -0
- package/lib/types/store/client.d.ts.map +1 -1
- package/lib/vertesia-client.js +1 -1
- package/lib/vertesia-client.js.map +1 -1
- package/package.json +4 -4
- package/src/InteractionOutput.test.ts +305 -0
- package/src/InteractionOutput.ts +328 -0
- package/src/InteractionResult.example.ts +72 -0
- package/src/InteractionsApi.ts +18 -9
- package/src/RunsApi.ts +7 -4
- package/src/index.ts +1 -0
- package/src/store/CollectionsApi.ts +24 -0
- package/src/store/TypesApi.ts +1 -1
- package/src/store/WorkflowsApi.ts +5 -2
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InteractionCatalogApi = void 0;
|
|
4
|
+
const api_fetch_client_1 = require("@vertesia/api-fetch-client");
|
|
5
|
+
class InteractionCatalogApi extends api_fetch_client_1.ApiTopic {
|
|
6
|
+
constructor(parent) {
|
|
7
|
+
super(parent, "/api/v1/interactions/catalog");
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* List all project interactions
|
|
11
|
+
*/
|
|
12
|
+
list(query = {}) {
|
|
13
|
+
return this.get("/", {
|
|
14
|
+
query
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* List all stored interactions
|
|
19
|
+
*/
|
|
20
|
+
listStoredInteractions(query = {}) {
|
|
21
|
+
return this.get("/stored", {
|
|
22
|
+
query
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* List sys interactions
|
|
27
|
+
*/
|
|
28
|
+
listSysInteractions(tag) {
|
|
29
|
+
return this.get(`/sys`, {
|
|
30
|
+
query: {
|
|
31
|
+
tag
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* List sys interactions
|
|
37
|
+
*/
|
|
38
|
+
listAppInteractions(appName, tag) {
|
|
39
|
+
return this.get(`/apps/${appName}`, {
|
|
40
|
+
query: {
|
|
41
|
+
tag
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* List all app interactions
|
|
47
|
+
*/
|
|
48
|
+
listAllAppInteractions(tag) {
|
|
49
|
+
return this.get(`/apps`, {
|
|
50
|
+
query: {
|
|
51
|
+
tag
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Resolve an interaction given its id to a InCodeInteraction
|
|
57
|
+
* @param id Interaction id
|
|
58
|
+
*/
|
|
59
|
+
resolve(id) {
|
|
60
|
+
return this.get(`/resolve/${id}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.InteractionCatalogApi = InteractionCatalogApi;
|
|
64
|
+
//# sourceMappingURL=InteractionCatalogApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InteractionCatalogApi.js","sourceRoot":"","sources":["../../src/InteractionCatalogApi.ts"],"names":[],"mappings":";;;AAAA,iEAAkE;AAQlE,MAAa,qBAAsB,SAAQ,2BAAQ;IAC/C,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,8BAA8B,CAAC,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,QAAsD,EAAE;QACzD,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;YACjB,KAAK;SACR,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACH,sBAAsB,CAAC,QAAsD,EAAE;QAC3E,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE;YACvB,KAAK;SACR,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACH,mBAAmB,CAAC,GAAY;QAC5B,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE;YACpB,KAAK,EAAE;gBACH,GAAG;aACN;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACH,mBAAmB,CAAC,OAAe,EAAE,GAAY;QAC7C,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,OAAO,EAAE,EAAE;YAChC,KAAK,EAAE;gBACH,GAAG;aACN;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACH,sBAAsB,CAAC,GAAY;QAC/B,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE;YACrB,KAAK,EAAE;gBACH,GAAG;aACN;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;;OAGG;IACH,OAAO,CAAC,EAAU;QACd,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IACtC,CAAC;CACJ;AA/DD,sDA+DC"}
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InteractionOutput = exports.IS_INTERACTION_OUTPUT = void 0;
|
|
4
|
+
exports.enhanceInteractionExecutionResult = enhanceInteractionExecutionResult;
|
|
5
|
+
exports.enhanceExecutionRun = enhanceExecutionRun;
|
|
6
|
+
exports.createInteractionOutput = createInteractionOutput;
|
|
7
|
+
/**
|
|
8
|
+
* Symbol used to mark InteractionOutputArray instances.
|
|
9
|
+
* This allows us to detect if a CompletionResult[] has already been wrapped.
|
|
10
|
+
*/
|
|
11
|
+
exports.IS_INTERACTION_OUTPUT = Symbol('InteractionOutput');
|
|
12
|
+
function enhanceInteractionExecutionResult(r) {
|
|
13
|
+
r.result = InteractionOutput.from(r.result);
|
|
14
|
+
return r;
|
|
15
|
+
}
|
|
16
|
+
function enhanceExecutionRun(r) {
|
|
17
|
+
r.result = InteractionOutput.from(r.result);
|
|
18
|
+
return r;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A convenient wrapper around CompletionResult[] that provides ergonomic accessors
|
|
22
|
+
* for different result types (text, JSON/objects, images) from interaction executions.
|
|
23
|
+
*
|
|
24
|
+
* Use the static from() method to create a proxied array that acts as both
|
|
25
|
+
* an array and has these convenience methods.
|
|
26
|
+
*
|
|
27
|
+
* @template T - The expected type of JSON/object results. Defaults to any.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* // Recommended: Using the static from() method
|
|
32
|
+
* const output = InteractionOutput.from<MyResponse>(run.result);
|
|
33
|
+
* output[0]; // CompletionResult (array access)
|
|
34
|
+
* output.length; // number (array property)
|
|
35
|
+
* const obj = output.object(); // MyResponse (custom method)
|
|
36
|
+
* const text = output.text(); // string (custom getter)
|
|
37
|
+
*
|
|
38
|
+
* // Alternative: Using the class directly (less common)
|
|
39
|
+
* const output = new InteractionOutput<MyResponse>(run.result);
|
|
40
|
+
* const obj = output.object(); // Returns MyResponse
|
|
41
|
+
* const objs = output.objects(); // Returns MyResponse[]
|
|
42
|
+
*
|
|
43
|
+
* // Override type for specific objects
|
|
44
|
+
* interface OtherType { title: string; }
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
class InteractionOutput {
|
|
48
|
+
results;
|
|
49
|
+
/**
|
|
50
|
+
* The raw completion results array.
|
|
51
|
+
* Access this when you need to work with the underlying CompletionResult[] directly.
|
|
52
|
+
*/
|
|
53
|
+
constructor(results) {
|
|
54
|
+
this.results = results;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Create an interaction output that acts as both an array and has convenience methods.
|
|
58
|
+
* This is the recommended way to work with interaction execution results.
|
|
59
|
+
*
|
|
60
|
+
* @template T - The expected type of JSON/object results. Defaults to any.
|
|
61
|
+
* @param results - The raw CompletionResult array from an interaction execution
|
|
62
|
+
* @returns A proxied array with convenience methods
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* interface MyResponse { name: string; age: number; }
|
|
67
|
+
* const output = InteractionOutput.from<MyResponse>(run.result);
|
|
68
|
+
*
|
|
69
|
+
* // Array access
|
|
70
|
+
* output[0]; // CompletionResult
|
|
71
|
+
* output.length; // number
|
|
72
|
+
*
|
|
73
|
+
* // Convenience methods
|
|
74
|
+
* const obj = output.object(); // MyResponse
|
|
75
|
+
* const text = output.text(); // string
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
static from(results) {
|
|
79
|
+
if (!results) {
|
|
80
|
+
return createInteractionOutput([]);
|
|
81
|
+
}
|
|
82
|
+
// Check if already wrapped using the symbol marker
|
|
83
|
+
if (results[exports.IS_INTERACTION_OUTPUT]) {
|
|
84
|
+
return results;
|
|
85
|
+
}
|
|
86
|
+
if (Array.isArray(results)) {
|
|
87
|
+
return createInteractionOutput(results);
|
|
88
|
+
}
|
|
89
|
+
else if (typeof results === 'object') {
|
|
90
|
+
return createInteractionOutput([{ type: 'json', value: results }]);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
return createInteractionOutput([{ type: 'text', value: String(results) }]);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
static isInteractionOutputArray(obj) {
|
|
97
|
+
return obj && obj[exports.IS_INTERACTION_OUTPUT] === true;
|
|
98
|
+
}
|
|
99
|
+
get isEmpty() {
|
|
100
|
+
return this.results.length === 0;
|
|
101
|
+
}
|
|
102
|
+
hasObject() {
|
|
103
|
+
return this.results.some(r => r.type === 'json');
|
|
104
|
+
}
|
|
105
|
+
hasText() {
|
|
106
|
+
return this.results.some(r => r.type === 'text');
|
|
107
|
+
}
|
|
108
|
+
hasImage() {
|
|
109
|
+
return this.results.some(r => r.type === 'image');
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Get the concatenated text from all text results.
|
|
113
|
+
* Returns an empty string if no text results exist.
|
|
114
|
+
*/
|
|
115
|
+
text(delimiter = '\n') {
|
|
116
|
+
return this.results
|
|
117
|
+
.filter(r => r.type === 'text')
|
|
118
|
+
.map(r => r.value)
|
|
119
|
+
.join(delimiter);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Get an array of all text values from text results.
|
|
123
|
+
*/
|
|
124
|
+
texts() {
|
|
125
|
+
return this.results
|
|
126
|
+
.filter(r => r.type === 'text')
|
|
127
|
+
.map(r => r.value);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Get the first JSON result as a parsed object.
|
|
131
|
+
* If no JSON result exists, attempts to parse the concatenated text as JSON.
|
|
132
|
+
* @returns The first JSON result typed as T (the class generic type)
|
|
133
|
+
* @throws Error if no JSON result found and text cannot be parsed as JSON
|
|
134
|
+
*/
|
|
135
|
+
object() {
|
|
136
|
+
const jsonResult = this.results.find(r => r.type === 'json');
|
|
137
|
+
if (jsonResult) {
|
|
138
|
+
return jsonResult.value;
|
|
139
|
+
}
|
|
140
|
+
// Fallback: try to parse the other text parts as JSON
|
|
141
|
+
return parseCompletionResultAsJson(this.results);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Get all JSON results as parsed objects.
|
|
145
|
+
* @returns An array of all JSON results typed as T[] (the class generic type)
|
|
146
|
+
*/
|
|
147
|
+
objects() {
|
|
148
|
+
return this.results
|
|
149
|
+
.filter(r => r.type === 'json')
|
|
150
|
+
.map(r => r.value);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Get a specific JSON result by index as a parsed object.
|
|
154
|
+
* @template U - The type of the object at this index. Defaults to T (the class generic).
|
|
155
|
+
* @param index - The zero-based index of the JSON result
|
|
156
|
+
* @returns The JSON result at the specified index typed as U
|
|
157
|
+
* @throws Error if the index is out of bounds
|
|
158
|
+
*/
|
|
159
|
+
objectAt(index) {
|
|
160
|
+
let i = 0;
|
|
161
|
+
for (const result of this.results) {
|
|
162
|
+
if (result.type === 'json') {
|
|
163
|
+
if (i === index) {
|
|
164
|
+
return result.value;
|
|
165
|
+
}
|
|
166
|
+
i++;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
throw new Error(`Object at index ${index} not found`);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Get the first image result (base64 data URL or URL).
|
|
173
|
+
* @throws Error if no image result exists
|
|
174
|
+
*/
|
|
175
|
+
image() {
|
|
176
|
+
const imageResult = this.results.find(r => r.type === 'image');
|
|
177
|
+
if (!imageResult) {
|
|
178
|
+
throw new Error('No image result found');
|
|
179
|
+
}
|
|
180
|
+
return imageResult.value;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Get an array of all image values (base64 data URLs or URLs).
|
|
184
|
+
*/
|
|
185
|
+
images() {
|
|
186
|
+
return this.results
|
|
187
|
+
.filter(r => r.type === 'image')
|
|
188
|
+
.map(r => r.value);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Convert all results to a string representation.
|
|
192
|
+
* Text and image results are used as-is, JSON results are stringified with the specified indent.
|
|
193
|
+
* All parts are joined using the specified separator.
|
|
194
|
+
*
|
|
195
|
+
* @param separator - The separator to use between parts (default: '\n')
|
|
196
|
+
* @param indent - The indentation to use for JSON.stringify (default: 0 = no formatting)
|
|
197
|
+
* @returns A string representation of all results
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* ```typescript
|
|
201
|
+
* const output = InteractionOutput.from(results);
|
|
202
|
+
* output.stringify(); // Each part on a new line, compact JSON
|
|
203
|
+
* output.stringify('\n\n', 2); // Double newlines between parts, formatted JSON
|
|
204
|
+
* output.stringify(' '); // Space-separated, compact JSON
|
|
205
|
+
* ```
|
|
206
|
+
*/
|
|
207
|
+
stringify(separator = '\n', indent = 2) {
|
|
208
|
+
return this.results
|
|
209
|
+
.map(r => {
|
|
210
|
+
switch (r.type) {
|
|
211
|
+
case 'json':
|
|
212
|
+
return JSON.stringify(r.value, null, indent);
|
|
213
|
+
default:
|
|
214
|
+
return String(r.value);
|
|
215
|
+
}
|
|
216
|
+
})
|
|
217
|
+
.join(separator);
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Convert to string representation (concatenated text).
|
|
221
|
+
* Useful for template literals or string coercion.
|
|
222
|
+
*/
|
|
223
|
+
toString() {
|
|
224
|
+
return this.text();
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Convert to JSON representation.
|
|
228
|
+
* Attempts to return the first JSON object, falls back to concatenated text.
|
|
229
|
+
*/
|
|
230
|
+
toJSON() {
|
|
231
|
+
return this.results;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
exports.InteractionOutput = InteractionOutput;
|
|
235
|
+
/**
|
|
236
|
+
* Creates a proxied array that acts as both a CompletionResult[] and has InteractionOutput convenience methods.
|
|
237
|
+
* Note: It's recommended to use InteractionOutput.from() instead of calling this function directly.
|
|
238
|
+
*
|
|
239
|
+
* @template T - The expected type of JSON/object results. Defaults to any.
|
|
240
|
+
* @param results - The raw CompletionResult array from the interaction execution
|
|
241
|
+
* @returns A proxy that behaves as both an array and has convenience methods
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* ```typescript
|
|
245
|
+
* interface MyResponse { name: string; age: number; }
|
|
246
|
+
* const output = createInteractionOutput<MyResponse>(run.result);
|
|
247
|
+
*
|
|
248
|
+
* // Array access
|
|
249
|
+
* output[0]; // CompletionResult
|
|
250
|
+
* output.length; // number
|
|
251
|
+
* output.map(r => r.type) // string[]
|
|
252
|
+
*
|
|
253
|
+
* // Convenience methods
|
|
254
|
+
* const obj = output.object(); // MyResponse
|
|
255
|
+
* const text = output.text(); // string
|
|
256
|
+
* const img = output.image(); // string
|
|
257
|
+
* ```
|
|
258
|
+
*/
|
|
259
|
+
function createInteractionOutput(results) {
|
|
260
|
+
const wrapper = new InteractionOutput(results);
|
|
261
|
+
return new Proxy(results, {
|
|
262
|
+
get(target, prop, receiver) {
|
|
263
|
+
// Return the marker symbol to identify wrapped arrays
|
|
264
|
+
if (prop === exports.IS_INTERACTION_OUTPUT) {
|
|
265
|
+
return true;
|
|
266
|
+
}
|
|
267
|
+
// Check if the wrapper has this property/method
|
|
268
|
+
if (prop in wrapper) {
|
|
269
|
+
const value = wrapper[prop];
|
|
270
|
+
// If it's a function, bind it to the wrapper so 'this' works correctly
|
|
271
|
+
if (typeof value === 'function') {
|
|
272
|
+
return value.bind(wrapper);
|
|
273
|
+
}
|
|
274
|
+
// For getters and regular properties, just return the value
|
|
275
|
+
return value;
|
|
276
|
+
}
|
|
277
|
+
// Otherwise delegate to the array
|
|
278
|
+
return Reflect.get(target, prop, receiver);
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
function parseCompletionResultAsJson(data) {
|
|
283
|
+
let lastError;
|
|
284
|
+
for (const part of data) {
|
|
285
|
+
if (part.type === "text") {
|
|
286
|
+
const text = part.value.trim();
|
|
287
|
+
try {
|
|
288
|
+
return JSON.parse(text);
|
|
289
|
+
}
|
|
290
|
+
catch (error) {
|
|
291
|
+
lastError = error;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
if (!lastError) {
|
|
296
|
+
lastError = new Error("No JSON result found and no text available to parse");
|
|
297
|
+
}
|
|
298
|
+
throw lastError;
|
|
299
|
+
}
|
|
300
|
+
//# sourceMappingURL=InteractionOutput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InteractionOutput.js","sourceRoot":"","sources":["../../src/InteractionOutput.ts"],"names":[],"mappings":";;;AASA,8EAGC;AAED,kDAGC;AA2QD,0DAwBC;AAjTD;;;GAGG;AACU,QAAA,qBAAqB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAEjE,SAAgB,iCAAiC,CAA+B,CAAsC;IACjH,CAAS,CAAC,MAAM,GAAG,iBAAiB,CAAC,IAAI,CAAU,CAAC,CAAC,MAAM,CAAC,CAAC;IAC9D,OAAO,CAAyD,CAAC;AACrE,CAAC;AAED,SAAgB,mBAAmB,CAA+B,CAAwB;IACrF,CAAS,CAAC,MAAM,GAAG,iBAAiB,CAAC,IAAI,CAAU,CAAC,CAAC,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AI,IAAI,EAAE,CAAC;QACtB,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACvB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YAC/B,IAAI,CAAC;gBACD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC5B,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBAClB,SAAS,GAAG,KAAK,CAAC;YACtB,CAAC;QACL,CAAC;IACL,CAAC;IACD,IAAI,CAAC,SAAS,EAAE,CAAC;QACb,SAAS,GAAG,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACjF,CAAC;IACD,MAAM,SAAS,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Example usage of InteractionOutput
|
|
4
|
+
* This file demonstrates the Proxy-based approach where the result acts as both
|
|
5
|
+
* an array and has convenience methods.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
const InteractionOutput_js_1 = require("./InteractionOutput.js");
|
|
9
|
+
// Sample data
|
|
10
|
+
const sampleResults = [
|
|
11
|
+
{ type: 'text', value: 'Hello, ' },
|
|
12
|
+
{ type: 'text', value: 'World!' },
|
|
13
|
+
{ type: 'json', value: { name: 'Alice', age: 30 } },
|
|
14
|
+
{ type: 'json', value: { title: 'Engineer', level: 'Senior' } },
|
|
15
|
+
{ type: 'image', value: 'data:image/png;base64,iVBORw0K...' }
|
|
16
|
+
];
|
|
17
|
+
// Example 1: Using InteractionOutput.from() (Proxy approach - RECOMMENDED)
|
|
18
|
+
console.log('=== Example 1: Proxy Approach ===');
|
|
19
|
+
const output = InteractionOutput_js_1.InteractionOutput.from(sampleResults);
|
|
20
|
+
// Works as an array
|
|
21
|
+
console.log('Array length:', output.length); // 5
|
|
22
|
+
console.log('First item:', output[0]); // { type: 'text', value: 'Hello, ' }
|
|
23
|
+
console.log('Types:', output.map(r => r.type)); // ['text', 'text', 'json', 'json', 'image']
|
|
24
|
+
// Has convenience methods
|
|
25
|
+
console.log('All text:', output.text); // 'Hello, World!'
|
|
26
|
+
console.log('First object:', output.object()); // { name: 'Alice', age: 30 } (typed as Person)
|
|
27
|
+
console.log('All objects:', output.objects()); // [{ name: 'Alice', age: 30 }, { title: 'Engineer', level: 'Senior' }]
|
|
28
|
+
console.log('First image:', output.image); // 'data:image/png;base64,iVBORw0K...'
|
|
29
|
+
console.log('Second object:', output.objectAt(1)); // { title: 'Engineer', level: 'Senior' } (typed as Job)
|
|
30
|
+
// Example 2: Using InteractionOutput class directly
|
|
31
|
+
console.log('\n=== Example 2: Class Approach ===');
|
|
32
|
+
const wrapper = new InteractionOutput_js_1.InteractionOutput(sampleResults);
|
|
33
|
+
// Access through wrapper properties (no array access)
|
|
34
|
+
console.log('All text:', wrapper.text);
|
|
35
|
+
console.log('Raw results:', wrapper.results); // Original array
|
|
36
|
+
console.log('First object:', wrapper.object());
|
|
37
|
+
// Example 3: Type safety demonstration
|
|
38
|
+
console.log('\n=== Example 3: Type Safety ===');
|
|
39
|
+
const contractResults = [
|
|
40
|
+
{ type: 'json', value: { title: 'Sales Agreement', parties: ['Alice', 'Bob'] } }
|
|
41
|
+
];
|
|
42
|
+
const contractOutput = InteractionOutput_js_1.InteractionOutput.from(contractResults);
|
|
43
|
+
const contract = contractOutput.object(); // TypeScript knows this is Contract
|
|
44
|
+
console.log('Contract title:', contract.title);
|
|
45
|
+
console.log('Parties:', contract.parties.join(', '));
|
|
46
|
+
// Example 4: Mixed content
|
|
47
|
+
console.log('\n=== Example 4: Mixed Content ===');
|
|
48
|
+
const mixedResults = [
|
|
49
|
+
{ type: 'text', value: 'Analysis complete. Results: ' },
|
|
50
|
+
{ type: 'json', value: { score: 0.95, confidence: 'high' } },
|
|
51
|
+
{ type: 'text', value: '\nThank you!' }
|
|
52
|
+
];
|
|
53
|
+
const mixed = InteractionOutput_js_1.InteractionOutput.from(mixedResults);
|
|
54
|
+
console.log('Full text:', mixed.text); // 'Analysis complete. Results: \nThank you!'
|
|
55
|
+
console.log('Analysis:', mixed.object()); // { score: 0.95, confidence: 'high' }
|
|
56
|
+
console.log('Text parts:', mixed.texts); // ['Analysis complete. Results: ', '\nThank you!']
|
|
57
|
+
//# sourceMappingURL=InteractionResult.example.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InteractionResult.example.js","sourceRoot":"","sources":["../../src/InteractionResult.example.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAGH,iEAA2D;AAE3D,cAAc;AACd,MAAM,aAAa,GAAuB;IACtC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE;IAClC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE;IACjC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE;IACnD,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;IAC/D,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,mCAAmC,EAAE;CAChE,CAAC;AAEF,2EAA2E;AAC3E,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;AAEjD,MAAM,MAAM,GAAG,wCAAiB,CAAC,IAAI,CAAS,aAAa,CAAC,CAAC;AAE7D,oBAAoB;AACpB,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAW,IAAI;AAC3D,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAiB,qCAAqC;AAC5F,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,GA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IAAI,CAAW,eAAe,CAAC,CAAC;AACzE,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,oCAAoC;AAC9E,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC/C,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAErD,2BAA2B;AAC3B,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;AAClD,MAAM,YAAY,GAAuB;IACrC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B,EAAE;IACvD,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE;IAC5D,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE;CAC1C,CAAC;AAEF,MAAM,KAAK,GAAG,wCAAiB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AACnD,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAiB,6CAA6C;AACpG,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAc,sCAAsC;AAC7F,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAe,mDAAmD"}
|
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const api_fetch_client_1 = require("@vertesia/api-fetch-client");
|
|
4
4
|
const execute_js_1 = require("./execute.js");
|
|
5
|
+
const InteractionCatalogApi_js_1 = require("./InteractionCatalogApi.js");
|
|
6
|
+
const InteractionOutput_js_1 = require("./InteractionOutput.js");
|
|
5
7
|
class InteractionsApi extends api_fetch_client_1.ApiTopic {
|
|
8
|
+
catalog;
|
|
6
9
|
constructor(parent) {
|
|
7
10
|
super(parent, "/api/v1/interactions");
|
|
11
|
+
this.catalog = new InteractionCatalogApi_js_1.InteractionCatalogApi(parent);
|
|
8
12
|
}
|
|
9
13
|
/**
|
|
10
14
|
* Get the list of all interactions in the current project
|
|
@@ -111,8 +115,8 @@ class InteractionsApi extends api_fetch_client_1.ApiTopic {
|
|
|
111
115
|
* @throws 500 if interaction execution fails
|
|
112
116
|
* @throws 500 if interaction execution times out
|
|
113
117
|
**/
|
|
114
|
-
execute(id, payload = {}, onChunk) {
|
|
115
|
-
|
|
118
|
+
async execute(id, payload = {}, onChunk) {
|
|
119
|
+
const r = await (0, execute_js_1.executeInteraction)(this.client, id, payload, onChunk).catch(err => {
|
|
116
120
|
if (err instanceof api_fetch_client_1.ServerError && err.payload?.id) {
|
|
117
121
|
throw err.updateDetails({ run_id: err.payload.id });
|
|
118
122
|
}
|
|
@@ -120,6 +124,7 @@ class InteractionsApi extends api_fetch_client_1.ApiTopic {
|
|
|
120
124
|
throw err;
|
|
121
125
|
}
|
|
122
126
|
});
|
|
127
|
+
return (0, InteractionOutput_js_1.enhanceInteractionExecutionResult)(r);
|
|
123
128
|
}
|
|
124
129
|
/**
|
|
125
130
|
* Same as execute but uses the interaction name selector instead of the id.
|
|
@@ -136,8 +141,8 @@ class InteractionsApi extends api_fetch_client_1.ApiTopic {
|
|
|
136
141
|
* @param onChunk
|
|
137
142
|
* @returns
|
|
138
143
|
*/
|
|
139
|
-
executeByName(nameWithTag, payload = {}, onChunk) {
|
|
140
|
-
|
|
144
|
+
async executeByName(nameWithTag, payload = {}, onChunk) {
|
|
145
|
+
const r = await (0, execute_js_1.executeInteractionByName)(this.client, nameWithTag, payload, onChunk).catch(err => {
|
|
141
146
|
if (err instanceof api_fetch_client_1.ServerError && err.payload?.id) {
|
|
142
147
|
throw err.updateDetails({ run_id: err.payload.id });
|
|
143
148
|
}
|
|
@@ -145,6 +150,7 @@ class InteractionsApi extends api_fetch_client_1.ApiTopic {
|
|
|
145
150
|
throw err;
|
|
146
151
|
}
|
|
147
152
|
});
|
|
153
|
+
return (0, InteractionOutput_js_1.enhanceInteractionExecutionResult)(r);
|
|
148
154
|
}
|
|
149
155
|
/**
|
|
150
156
|
* Execute an interaction in an workflow
|
|
@@ -182,11 +188,19 @@ class InteractionsApi extends api_fetch_client_1.ApiTopic {
|
|
|
182
188
|
}
|
|
183
189
|
/**
|
|
184
190
|
* Suggest Improvement for a prompt
|
|
191
|
+
* @deprecated use suggestPromptImprovements instead
|
|
185
192
|
*/
|
|
186
|
-
suggestImprovements(id, payload) {
|
|
187
|
-
|
|
193
|
+
async suggestImprovements(id, payload) {
|
|
194
|
+
const r = await this.post(`${id}/suggest-prompt-improvements`, {
|
|
188
195
|
payload
|
|
189
196
|
});
|
|
197
|
+
return (0, InteractionOutput_js_1.enhanceExecutionRun)(r);
|
|
198
|
+
}
|
|
199
|
+
async suggestPromptImprovements(payload) {
|
|
200
|
+
const r = await this.post(`/improve`, {
|
|
201
|
+
payload
|
|
202
|
+
});
|
|
203
|
+
return (0, InteractionOutput_js_1.enhanceInteractionExecutionResult)(r);
|
|
190
204
|
}
|
|
191
205
|
/**
|
|
192
206
|
* List the versions of the interaction. Returns an empty array if no versions are found
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionsApi.js","sourceRoot":"","sources":["../../src/InteractionsApi.ts"],"names":[],"mappings":";;AAAA,iEAA+E;
|
|
1
|
+
{"version":3,"file":"InteractionsApi.js","sourceRoot":"","sources":["../../src/InteractionsApi.ts"],"names":[],"mappings":";;AAAA,iEAA+E;AAW/E,6CAAqH;AACrH,yEAAmE;AACnE,iEAA0J;AAY1J,MAAqB,eAAgB,SAAQ,2BAAQ;IACjD,OAAO,CAAwB;IAE/B,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;QACtC,IAAI,CAAC,OAAO,GA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AC;IACvC,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,EAAU;QAChB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACpC,CAAC;IAED;;;;OAIG;IACH,WAAW,CAAC,OAAgC;QACxC,OAAO,IAAA,2BAAc,EAAC,IAAI,CAAC,MAAwB,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;CAEJ;AAzPD,kCAyPC"}
|
package/lib/cjs/ProjectsApi.js
CHANGED
|
@@ -21,6 +21,11 @@ class ProjectsApi extends api_fetch_client_1.ApiTopic {
|
|
|
21
21
|
payload
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
+
updateConfiguration(projectId, payload) {
|
|
25
|
+
return this.put(`/${projectId}/configuration`, {
|
|
26
|
+
payload
|
|
27
|
+
});
|
|
28
|
+
}
|
|
24
29
|
integrations = new IntegrationsConfigurationApi(this);
|
|
25
30
|
}
|
|
26
31
|
exports.default = ProjectsApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectsApi.js","sourceRoot":"","sources":["../../src/ProjectsApi.ts"],"names":[],"mappings":";;AAAA,iEAAkE;AAGlE,MAAqB,WAAY,SAAQ,2BAAQ;IAC7C,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,CAAC,OAAkB;QACnB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,QAAQ,CAAC,SAAiB;QACtB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,CAAC,OAA8B;QACjC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;YAClB,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED,MAAM,CAAC,SAAiB,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;IAED,IAAI,CAAC,SAAiB;QAClB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAChF,CAAC;IAED,QAAQ,CAAC,SAAiB,EAAE,aAAoC;QAC5D,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,iBAAiB,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;YACvE,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBACrB,OAAO,SAAS,CAAC;YACrB,CAAC;YACD,MAAM,GAAG,CAAC;QACd,CAAC,CAAC,CAAC;IACP,CAAC;IAED,MAAM,CAAC,SAAiB,EAAE,aAAqB,EAAE,OAAY;QACzD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,iBAAiB,aAAa,EAAE,EAAE;YAC3D,OAAO;SACV,CAAC,CAAC;IACP,CAAC;CAEJ"}
|
package/lib/cjs/RunsApi.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RunsApi = void 0;
|
|
4
4
|
const api_fetch_client_1 = require("@vertesia/api-fetch-client");
|
|
5
|
+
const InteractionOutput_js_1 = require("./InteractionOutput.js");
|
|
5
6
|
class RunsApi extends api_fetch_client_1.ApiTopic {
|
|
6
7
|
constructor(parent) {
|
|
7
8
|
super(parent, "/api/v1/runs");
|
|
@@ -31,8 +32,14 @@ class RunsApi extends api_fetch_client_1.ApiTopic {
|
|
|
31
32
|
* @param id
|
|
32
33
|
* @returns InteractionResult
|
|
33
34
|
**/
|
|
34
|
-
retrieve(id) {
|
|
35
|
-
|
|
35
|
+
async retrieve(id) {
|
|
36
|
+
const r = await this.get("/" + id);
|
|
37
|
+
return (0, InteractionOutput_js_1.enhanceExecutionRun)(r);
|
|
38
|
+
}
|
|
39
|
+
retrievePopulated(id) {
|
|
40
|
+
return this.get("/" + id, {
|
|
41
|
+
query: { populate: "true" },
|
|
42
|
+
});
|
|
36
43
|
}
|
|
37
44
|
/**
|
|
38
45
|
* Get filter options for a field
|
|
@@ -44,7 +51,7 @@ class RunsApi extends api_fetch_client_1.ApiTopic {
|
|
|
44
51
|
};
|
|
45
52
|
return this.get(`/filter-options/${field}`, { query });
|
|
46
53
|
}
|
|
47
|
-
create(payload) {
|
|
54
|
+
async create(payload) {
|
|
48
55
|
const sessionTags = this.client.sessionTags;
|
|
49
56
|
if (sessionTags) {
|
|
50
57
|
let tags = Array.isArray(sessionTags) ? sessionTags : [sessionTags];
|
|
@@ -56,9 +63,10 @@ class RunsApi extends api_fetch_client_1.ApiTopic {
|
|
|
56
63
|
}
|
|
57
64
|
payload = { ...payload, tags };
|
|
58
65
|
}
|
|
59
|
-
|
|
66
|
+
const r = await this.post("/", {
|
|
60
67
|
payload,
|
|
61
68
|
});
|
|
69
|
+
return (0, InteractionOutput_js_1.enhanceExecutionRun)(r);
|
|
62
70
|
}
|
|
63
71
|
/**
|
|
64
72
|
* Send tool results and continues the conversation
|
package/lib/cjs/RunsApi.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RunsApi.js","sourceRoot":"","sources":["../../src/RunsApi.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"RunsApi.js","sourceRoot":"","sources":["../../src/RunsApi.ts"],"names":[],"mappings":";;;AACA,iEAAkE;AAgBlE,iEAAmF;AAiBnF,MAAa,OAAQ,SAAQ,2BAAQ;IACjC,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAClC,CAAC;IAED;;;;;QAKI;IACJ,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAA0B;QACnD,MAAM,KAAK,GAAG;YACV,KAAK;YACL,MAAM;YACN,GAAG,OAAO;SACb,CAAC;QAEF,OAA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