@agentuity/core 0.0.42 → 0.0.44
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/README.md +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +59 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +2 -0
- package/dist/logger.js.map +1 -0
- package/dist/services/_util.d.ts +2 -2
- package/dist/services/_util.d.ts.map +1 -1
- package/dist/services/_util.js +10 -10
- package/dist/services/_util.js.map +1 -1
- package/dist/services/evalrun.d.ts +51 -0
- package/dist/services/evalrun.d.ts.map +1 -0
- package/dist/services/evalrun.js +21 -0
- package/dist/services/evalrun.js.map +1 -0
- package/dist/services/exception.d.ts +2 -1
- package/dist/services/exception.d.ts.map +1 -1
- package/dist/services/exception.js +3 -1
- package/dist/services/exception.js.map +1 -1
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +2 -0
- package/dist/services/index.js.map +1 -1
- package/dist/services/keyvalue.js +3 -3
- package/dist/services/keyvalue.js.map +1 -1
- package/dist/services/objectstore.js +4 -4
- package/dist/services/objectstore.js.map +1 -1
- package/dist/services/session.d.ts +77 -0
- package/dist/services/session.d.ts.map +1 -0
- package/dist/services/session.js +32 -0
- package/dist/services/session.js.map +1 -0
- package/dist/services/stream.js +19 -19
- package/dist/services/stream.js.map +1 -1
- package/dist/services/vector.js +4 -4
- package/dist/services/vector.js.map +1 -1
- package/package.json +6 -2
- package/src/index.ts +1 -0
- package/src/logger.ts +65 -0
- package/src/services/_util.ts +13 -10
- package/src/services/evalrun.ts +53 -0
- package/src/services/exception.ts +3 -1
- package/src/services/index.ts +2 -0
- package/src/services/keyvalue.ts +3 -3
- package/src/services/objectstore.ts +4 -4
- package/src/services/session.ts +64 -0
- package/src/services/stream.ts +19 -19
- package/src/services/vector.ts +4 -4
package/src/services/stream.ts
CHANGED
|
@@ -188,10 +188,10 @@ const encoder = new TextEncoder();
|
|
|
188
188
|
class StreamImpl extends WritableStream implements Stream {
|
|
189
189
|
public readonly id: string;
|
|
190
190
|
public readonly url: string;
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
191
|
+
#activeWriter: WritableStreamDefaultWriter<Uint8Array> | null = null;
|
|
192
|
+
#compressed: boolean;
|
|
193
|
+
#adapter: FetchAdapter;
|
|
194
|
+
#sink: UnderlyingSink;
|
|
195
195
|
|
|
196
196
|
constructor(
|
|
197
197
|
id: string,
|
|
@@ -203,17 +203,17 @@ class StreamImpl extends WritableStream implements Stream {
|
|
|
203
203
|
super(underlyingSink);
|
|
204
204
|
this.id = id;
|
|
205
205
|
this.url = url;
|
|
206
|
-
this
|
|
207
|
-
this
|
|
208
|
-
this
|
|
206
|
+
this.#compressed = compressed;
|
|
207
|
+
this.#adapter = adapter;
|
|
208
|
+
this.#sink = underlyingSink;
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
get bytesWritten(): number {
|
|
212
|
-
return this.
|
|
212
|
+
return this.#sink.total;
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
get compressed(): boolean {
|
|
216
|
-
return this
|
|
216
|
+
return this.#compressed;
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
/**
|
|
@@ -233,10 +233,10 @@ class StreamImpl extends WritableStream implements Stream {
|
|
|
233
233
|
binaryChunk = encoder.encode(String(chunk));
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
if (!this
|
|
237
|
-
this
|
|
236
|
+
if (!this.#activeWriter) {
|
|
237
|
+
this.#activeWriter = this.getWriter();
|
|
238
238
|
}
|
|
239
|
-
await this
|
|
239
|
+
await this.#activeWriter.write(binaryChunk);
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
/**
|
|
@@ -246,9 +246,9 @@ class StreamImpl extends WritableStream implements Stream {
|
|
|
246
246
|
async close(): Promise<void> {
|
|
247
247
|
try {
|
|
248
248
|
// If we have an active writer from write() calls, use that
|
|
249
|
-
if (this
|
|
250
|
-
const writer = this
|
|
251
|
-
this
|
|
249
|
+
if (this.#activeWriter) {
|
|
250
|
+
const writer = this.#activeWriter;
|
|
251
|
+
this.#activeWriter = null;
|
|
252
252
|
await writer.close();
|
|
253
253
|
return;
|
|
254
254
|
}
|
|
@@ -288,7 +288,7 @@ class StreamImpl extends WritableStream implements Stream {
|
|
|
288
288
|
*/
|
|
289
289
|
getReader(): ReadableStream<Uint8Array> {
|
|
290
290
|
const url = this.url;
|
|
291
|
-
const adapter = this
|
|
291
|
+
const adapter = this.#adapter;
|
|
292
292
|
let ac: AbortController | null = null;
|
|
293
293
|
return new ReadableStream({
|
|
294
294
|
async start(controller) {
|
|
@@ -537,7 +537,7 @@ export class StreamStorageService implements StreamStorage {
|
|
|
537
537
|
|
|
538
538
|
return stream;
|
|
539
539
|
}
|
|
540
|
-
throw await toServiceException(res.response);
|
|
540
|
+
throw await toServiceException(url, res.response);
|
|
541
541
|
}
|
|
542
542
|
|
|
543
543
|
async list(params?: ListStreamsParams): Promise<ListStreamsResponse> {
|
|
@@ -587,7 +587,7 @@ export class StreamStorageService implements StreamStorage {
|
|
|
587
587
|
if (res.ok) {
|
|
588
588
|
return res.data;
|
|
589
589
|
}
|
|
590
|
-
throw await toServiceException(res.response);
|
|
590
|
+
throw await toServiceException(url, res.response);
|
|
591
591
|
}
|
|
592
592
|
|
|
593
593
|
async delete(id: string): Promise<void> {
|
|
@@ -609,6 +609,6 @@ export class StreamStorageService implements StreamStorage {
|
|
|
609
609
|
if (res.ok) {
|
|
610
610
|
return;
|
|
611
611
|
}
|
|
612
|
-
throw await toServiceException(res.response);
|
|
612
|
+
throw await toServiceException(url, res.response);
|
|
613
613
|
}
|
|
614
614
|
}
|
package/src/services/vector.ts
CHANGED
|
@@ -367,7 +367,7 @@ export class VectorStorageService implements VectorStorage {
|
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
|
|
370
|
-
throw await toServiceException(res.response);
|
|
370
|
+
throw await toServiceException(url, res.response);
|
|
371
371
|
}
|
|
372
372
|
|
|
373
373
|
async get<T extends Record<string, unknown> = Record<string, unknown>>(
|
|
@@ -416,7 +416,7 @@ export class VectorStorageService implements VectorStorage {
|
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
418
|
|
|
419
|
-
throw await toServiceException(res.response);
|
|
419
|
+
throw await toServiceException(url, res.response);
|
|
420
420
|
}
|
|
421
421
|
|
|
422
422
|
async getMany<T extends Record<string, unknown> = Record<string, unknown>>(
|
|
@@ -521,7 +521,7 @@ export class VectorStorageService implements VectorStorage {
|
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
523
|
|
|
524
|
-
throw await toServiceException(res.response);
|
|
524
|
+
throw await toServiceException(url, res.response);
|
|
525
525
|
}
|
|
526
526
|
|
|
527
527
|
async delete(name: string, ...keys: string[]): Promise<number> {
|
|
@@ -575,7 +575,7 @@ export class VectorStorageService implements VectorStorage {
|
|
|
575
575
|
}
|
|
576
576
|
}
|
|
577
577
|
|
|
578
|
-
throw await toServiceException(res.response);
|
|
578
|
+
throw await toServiceException(url, res.response);
|
|
579
579
|
}
|
|
580
580
|
|
|
581
581
|
async exists(name: string): Promise<boolean> {
|