@pyxmate/memory 0.15.0 → 0.15.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/dist/{chunk-W4LB326D.mjs → chunk-DR7UBO3Y.mjs} +4 -3
- package/dist/{chunk-K7JZXUBN.mjs → chunk-ZEX65TA5.mjs} +1 -1
- package/dist/dashboard.mjs +2 -2
- package/dist/index.d.ts +12 -0
- package/dist/index.mjs +1 -1
- package/dist/react.mjs +2 -2
- package/package.json +1 -1
- package/skills/pyx-memory/reference/sdk-guide.md +12 -1
|
@@ -365,7 +365,7 @@ var MemoryClient = class {
|
|
|
365
365
|
result.totalCharacters += descriptions.reduce((sum, d) => sum + d.description.length, 0);
|
|
366
366
|
yield { schemaVersion: 1, type: "result", stage: "complete", ...result };
|
|
367
367
|
} catch (err) {
|
|
368
|
-
yield this.ingestErrorEvent(err, "enrichment");
|
|
368
|
+
yield this.ingestErrorEvent(err, "enrichment", result);
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
371
|
/**
|
|
@@ -429,7 +429,7 @@ var MemoryClient = class {
|
|
|
429
429
|
const { schemaVersion: _v, type: _t, stage: _s, message: _m, ...result } = event;
|
|
430
430
|
return result;
|
|
431
431
|
}
|
|
432
|
-
ingestErrorEvent(error, stage) {
|
|
432
|
+
ingestErrorEvent(error, stage, partialResult) {
|
|
433
433
|
const status = error instanceof MemoryServerError ? error.status : error instanceof Error && error.name === "AbortError" ? 499 : void 0;
|
|
434
434
|
const message = error instanceof Error ? error.message : String(error);
|
|
435
435
|
return {
|
|
@@ -438,7 +438,8 @@ var MemoryClient = class {
|
|
|
438
438
|
stage,
|
|
439
439
|
error: message,
|
|
440
440
|
message,
|
|
441
|
-
...status != null ? { status, code: status } : {}
|
|
441
|
+
...status != null ? { status, code: status } : {},
|
|
442
|
+
...partialResult ? { partialResult } : {}
|
|
442
443
|
};
|
|
443
444
|
}
|
|
444
445
|
/**
|
package/dist/dashboard.mjs
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -614,6 +614,18 @@ interface IngestErrorEvent {
|
|
|
614
614
|
message?: string;
|
|
615
615
|
code?: string | number;
|
|
616
616
|
status?: number;
|
|
617
|
+
/**
|
|
618
|
+
* Server's pre-enrichment {@link FileIngestResult}, present when the error
|
|
619
|
+
* fired during the SDK's enrichment phase (after the server already emitted
|
|
620
|
+
* a successful result and the file's chunks/entryIds are durably stored).
|
|
621
|
+
*
|
|
622
|
+
* Lets consumers persist the catalog entry id, per-chunk entry ids, and
|
|
623
|
+
* character/chunk counts before surfacing the error — so a 401 storm during
|
|
624
|
+
* entity extraction no longer loses the search-ready chunks. Absent for
|
|
625
|
+
* errors that happen before the server's terminal result (parsing/storing
|
|
626
|
+
* stage failures, transport errors, abort).
|
|
627
|
+
*/
|
|
628
|
+
partialResult?: FileIngestResult;
|
|
617
629
|
}
|
|
618
630
|
type IngestEvent = IngestProgressEvent | IngestHeartbeatEvent | IngestResultEvent | IngestErrorEvent;
|
|
619
631
|
|
package/dist/index.mjs
CHANGED
package/dist/react.mjs
CHANGED
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
toGraphologyFormat,
|
|
12
12
|
transformGraphData,
|
|
13
13
|
unreachableHealth
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-ZEX65TA5.mjs";
|
|
15
|
+
import "./chunk-DR7UBO3Y.mjs";
|
|
16
16
|
|
|
17
17
|
// ../dashboard/src/hooks/use-consolidation-log.ts
|
|
18
18
|
import { useCallback as useCallback2, useMemo } from "react";
|
package/package.json
CHANGED
|
@@ -210,7 +210,18 @@ for await (const event of memory.ingestFileEvents(pdfFile, { enrichment })) {
|
|
|
210
210
|
console.log(`[${event.stage}] ${event.message ?? ''}`);
|
|
211
211
|
continue;
|
|
212
212
|
}
|
|
213
|
-
if (event.type === 'error')
|
|
213
|
+
if (event.type === 'error') {
|
|
214
|
+
// Enrichment-stage errors (e.g. extractEntitiesV2 throws on a 401 storm)
|
|
215
|
+
// carry the server's pre-enrichment FileIngestResult under
|
|
216
|
+
// `partialResult` — the chunks/entryIds/catalog are durably stored.
|
|
217
|
+
// Persist them BEFORE surfacing the error so vector retrieval keeps
|
|
218
|
+
// working on the file. Parsing/storing/transport errors do not set it.
|
|
219
|
+
if (event.partialResult) {
|
|
220
|
+
result = event.partialResult;
|
|
221
|
+
// surface a "partial" status to the user, then throw to mark failure
|
|
222
|
+
}
|
|
223
|
+
throw new Error(event.message ?? event.error);
|
|
224
|
+
}
|
|
214
225
|
if (event.type === 'result') {
|
|
215
226
|
const { schemaVersion: _v, type: _t, stage: _s, message: _m, ...payload } = event;
|
|
216
227
|
result = payload;
|