@semiont/make-meaning 0.4.19 → 0.4.20
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/index.d.ts +28 -0
- package/dist/index.js +20 -21
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -72,6 +72,15 @@ interface MakeMeaningConfig {
|
|
|
72
72
|
* BURST_WINDOW_MS = 50 — debounce window before flushing a batch
|
|
73
73
|
* MAX_BATCH_SIZE = 500 — force flush to bound memory
|
|
74
74
|
* IDLE_TIMEOUT_MS = 200 — silence before returning to passthrough
|
|
75
|
+
*
|
|
76
|
+
* ## Per-resource serialization
|
|
77
|
+
*
|
|
78
|
+
* `groupBy(resourceId) + concatMap(...)` is the stream-consumer flavor of
|
|
79
|
+
* per-resource serialization — the same invariant enforced by `Smelter`,
|
|
80
|
+
* `Gatherer`, and (in a different shape) `ViewManager`. See
|
|
81
|
+
* `packages/core/src/serialize-per-key.ts` for the shared primitive used
|
|
82
|
+
* by RPC-style services, and `.plans/PerResourceSerializer.md` for the
|
|
83
|
+
* broader design that would unify the two shapes.
|
|
75
84
|
*/
|
|
76
85
|
|
|
77
86
|
declare class GraphDBConsumer {
|
|
@@ -224,6 +233,16 @@ declare class EmbeddingStore {
|
|
|
224
233
|
* 5. Index vectors into the VectorStore (Qdrant) for fast similarity search
|
|
225
234
|
*
|
|
226
235
|
* Uses the same burst-buffer RxJS pipeline as GraphDBConsumer.
|
|
236
|
+
*
|
|
237
|
+
* ## Per-resource serialization
|
|
238
|
+
*
|
|
239
|
+
* Smelter processes events strictly in order per resourceId via
|
|
240
|
+
* `groupBy(resourceId) + concatMap(...)`. This is the stream-consumer
|
|
241
|
+
* flavor of per-resource serialization — the same invariant enforced by
|
|
242
|
+
* `GraphDBConsumer`, `Gatherer`, and (in a different shape) `ViewManager`.
|
|
243
|
+
* See `packages/core/src/serialize-per-key.ts` for the shared primitive
|
|
244
|
+
* used by RPC-style services, and `.plans/PerResourceSerializer.md` for
|
|
245
|
+
* the broader design that would unify the two shapes.
|
|
227
246
|
*/
|
|
228
247
|
|
|
229
248
|
declare class Smelter {
|
|
@@ -400,6 +419,15 @@ declare class Stower {
|
|
|
400
419
|
* - gather:resource-requested — resource-level LLM context assembly
|
|
401
420
|
*
|
|
402
421
|
* RxJS pipeline uses groupBy(resourceId) + concatMap for per-resource isolation.
|
|
422
|
+
*
|
|
423
|
+
* ## Per-resource serialization
|
|
424
|
+
*
|
|
425
|
+
* `groupBy(resourceId) + concatMap(...)` is the stream-consumer flavor of
|
|
426
|
+
* per-resource serialization — the same invariant enforced by `Smelter`,
|
|
427
|
+
* `GraphDBConsumer`, and (in a different shape) `ViewManager`. See
|
|
428
|
+
* `packages/core/src/serialize-per-key.ts` for the shared primitive used
|
|
429
|
+
* by RPC-style services, and `.plans/PerResourceSerializer.md` for the
|
|
430
|
+
* broader design that would unify the two shapes.
|
|
403
431
|
*/
|
|
404
432
|
|
|
405
433
|
declare class Gatherer {
|
package/dist/index.js
CHANGED
|
@@ -10000,7 +10000,7 @@ import { WorkingTreeStore } from "@semiont/content";
|
|
|
10000
10000
|
var import_rxjs = __toESM(require_cjs(), 1);
|
|
10001
10001
|
var import_operators = __toESM(require_operators(), 1);
|
|
10002
10002
|
import { EventQuery } from "@semiont/event-sourcing";
|
|
10003
|
-
import { didToAgent, burstBuffer } from "@semiont/core";
|
|
10003
|
+
import { didToAgent, burstBuffer, errField } from "@semiont/core";
|
|
10004
10004
|
import { resourceId as makeResourceId, annotationId as makeAnnotationId, findBodyItem } from "@semiont/core";
|
|
10005
10005
|
|
|
10006
10006
|
// src/batch-utils.ts
|
|
@@ -10109,7 +10109,7 @@ var GraphDBConsumer = class _GraphDBConsumer {
|
|
|
10109
10109
|
this.logger.error("Failed to apply event to graph", {
|
|
10110
10110
|
eventType: storedEvent.type,
|
|
10111
10111
|
resourceId: storedEvent.resourceId,
|
|
10112
|
-
error
|
|
10112
|
+
error: errField(error)
|
|
10113
10113
|
});
|
|
10114
10114
|
}
|
|
10115
10115
|
}
|
|
@@ -10148,7 +10148,7 @@ var GraphDBConsumer = class _GraphDBConsumer {
|
|
|
10148
10148
|
this.logger.error("Failed to process batch run", {
|
|
10149
10149
|
eventType: run[0].type,
|
|
10150
10150
|
runSize: run.length,
|
|
10151
|
-
error
|
|
10151
|
+
error: errField(error)
|
|
10152
10152
|
});
|
|
10153
10153
|
}
|
|
10154
10154
|
const last = run[run.length - 1];
|
|
@@ -10305,8 +10305,7 @@ var GraphDBConsumer = class _GraphDBConsumer {
|
|
|
10305
10305
|
} catch (error) {
|
|
10306
10306
|
this.logger.error("Error in annotation.body.updated handler", {
|
|
10307
10307
|
annotationId: event.payload.annotationId,
|
|
10308
|
-
error
|
|
10309
|
-
stack: error instanceof Error ? error.stack : void 0
|
|
10308
|
+
error: errField(error)
|
|
10310
10309
|
});
|
|
10311
10310
|
}
|
|
10312
10311
|
break;
|
|
@@ -10418,7 +10417,7 @@ var GraphDBConsumer = class _GraphDBConsumer {
|
|
|
10418
10417
|
// src/smelter.ts
|
|
10419
10418
|
var import_rxjs2 = __toESM(require_cjs(), 1);
|
|
10420
10419
|
var import_operators2 = __toESM(require_operators(), 1);
|
|
10421
|
-
import { burstBuffer as burstBuffer2 } from "@semiont/core";
|
|
10420
|
+
import { burstBuffer as burstBuffer2, errField as errField2 } from "@semiont/core";
|
|
10422
10421
|
import { resourceId as makeResourceId2, annotationId as makeAnnotationId2 } from "@semiont/core";
|
|
10423
10422
|
import { chunkText, DEFAULT_CHUNKING_CONFIG } from "@semiont/vectors";
|
|
10424
10423
|
import { getExactText, getTargetSelector } from "@semiont/api-client";
|
|
@@ -10617,7 +10616,7 @@ var Smelter = class _Smelter {
|
|
|
10617
10616
|
this.logger.error("Smelter failed to process batch run", {
|
|
10618
10617
|
eventType: run[0].type,
|
|
10619
10618
|
runSize: run.length,
|
|
10620
|
-
error
|
|
10619
|
+
error: errField2(error)
|
|
10621
10620
|
});
|
|
10622
10621
|
}
|
|
10623
10622
|
}
|
|
@@ -11092,7 +11091,7 @@ async function createKnowledgeBase(eventStore, project, graphDb, eventBus, logge
|
|
|
11092
11091
|
// src/gatherer.ts
|
|
11093
11092
|
var import_rxjs3 = __toESM(require_cjs(), 1);
|
|
11094
11093
|
var import_operators3 = __toESM(require_operators(), 1);
|
|
11095
|
-
import { annotationId as makeAnnotationId3, resourceId } from "@semiont/core";
|
|
11094
|
+
import { annotationId as makeAnnotationId3, resourceId, errField as errField3 } from "@semiont/core";
|
|
11096
11095
|
|
|
11097
11096
|
// src/generation/resource-generation.ts
|
|
11098
11097
|
async function generateResourceSummary(resourceName, content, entityTypes, client) {
|
|
@@ -11880,7 +11879,7 @@ var Gatherer = class {
|
|
|
11880
11879
|
} catch (error) {
|
|
11881
11880
|
this.logger.error("Gather annotation context failed", {
|
|
11882
11881
|
annotationId: event.annotationId,
|
|
11883
|
-
error
|
|
11882
|
+
error: errField3(error)
|
|
11884
11883
|
});
|
|
11885
11884
|
resultBus.get("gather:failed").next({
|
|
11886
11885
|
correlationId: event.correlationId,
|
|
@@ -11909,7 +11908,7 @@ var Gatherer = class {
|
|
|
11909
11908
|
} catch (error) {
|
|
11910
11909
|
this.logger.error("Gather resource context failed", {
|
|
11911
11910
|
resourceId: event.resourceId,
|
|
11912
|
-
error
|
|
11911
|
+
error: errField3(error)
|
|
11913
11912
|
});
|
|
11914
11913
|
resultBus.get("gather:resource-failed").next({
|
|
11915
11914
|
correlationId: event.correlationId,
|
|
@@ -11938,7 +11937,7 @@ var Gatherer = class {
|
|
|
11938
11937
|
// src/matcher.ts
|
|
11939
11938
|
var import_rxjs4 = __toESM(require_cjs(), 1);
|
|
11940
11939
|
var import_operators4 = __toESM(require_operators(), 1);
|
|
11941
|
-
import { resourceId as resourceId2 } from "@semiont/core";
|
|
11940
|
+
import { resourceId as resourceId2, errField as errField4 } from "@semiont/core";
|
|
11942
11941
|
import { getResourceId as getResourceId4, getResourceEntityTypes as getResourceEntityTypes4 } from "@semiont/api-client";
|
|
11943
11942
|
var Matcher = class {
|
|
11944
11943
|
constructor(kb, eventBus, logger, inferenceClient, embeddingProvider) {
|
|
@@ -11987,7 +11986,7 @@ var Matcher = class {
|
|
|
11987
11986
|
} catch (error) {
|
|
11988
11987
|
this.logger.error("Bind search failed", {
|
|
11989
11988
|
referenceId: event.referenceId,
|
|
11990
|
-
error
|
|
11989
|
+
error: errField4(error)
|
|
11991
11990
|
});
|
|
11992
11991
|
this.eventBus.scope(event.resourceId).get("match:search-failed").next({
|
|
11993
11992
|
correlationId: event.correlationId,
|
|
@@ -12601,7 +12600,7 @@ var import_rxjs6 = __toESM(require_cjs(), 1);
|
|
|
12601
12600
|
var import_operators6 = __toESM(require_operators(), 1);
|
|
12602
12601
|
import { promises as fs4 } from "fs";
|
|
12603
12602
|
import * as path3 from "path";
|
|
12604
|
-
import { resourceId as resourceId4, annotationId } from "@semiont/core";
|
|
12603
|
+
import { resourceId as resourceId4, annotationId, errField as errField5 } from "@semiont/core";
|
|
12605
12604
|
import { getExactText as getExactText2, getTargetSource as getTargetSource2, getTargetSelector as getTargetSelector3, getResourceEntityTypes as getResourceEntityTypes5, getBodySource as getBodySource2 } from "@semiont/api-client";
|
|
12606
12605
|
import { EventQuery as EventQuery2 } from "@semiont/event-sourcing";
|
|
12607
12606
|
import { getEntityTypes as getEntityTypes2 } from "@semiont/ontology";
|
|
@@ -12684,7 +12683,7 @@ var Browser = class {
|
|
|
12684
12683
|
}
|
|
12685
12684
|
});
|
|
12686
12685
|
} catch (error) {
|
|
12687
|
-
this.logger.error("Browse resource failed", { resourceId: event.resourceId, error });
|
|
12686
|
+
this.logger.error("Browse resource failed", { resourceId: event.resourceId, error: errField5(error) });
|
|
12688
12687
|
this.eventBus.get("browse:resource-failed").next({
|
|
12689
12688
|
correlationId: event.correlationId,
|
|
12690
12689
|
message: error instanceof Error ? error.message : String(error)
|
|
@@ -12714,7 +12713,7 @@ var Browser = class {
|
|
|
12714
12713
|
}
|
|
12715
12714
|
});
|
|
12716
12715
|
} catch (error) {
|
|
12717
|
-
this.logger.error("Browse resources failed", { error });
|
|
12716
|
+
this.logger.error("Browse resources failed", { error: errField5(error) });
|
|
12718
12717
|
this.eventBus.get("browse:resources-failed").next({
|
|
12719
12718
|
correlationId: event.correlationId,
|
|
12720
12719
|
message: error instanceof Error ? error.message : String(error)
|
|
@@ -12732,7 +12731,7 @@ var Browser = class {
|
|
|
12732
12731
|
}
|
|
12733
12732
|
});
|
|
12734
12733
|
} catch (error) {
|
|
12735
|
-
this.logger.error("Browse annotations failed", { resourceId: event.resourceId, error });
|
|
12734
|
+
this.logger.error("Browse annotations failed", { resourceId: event.resourceId, error: errField5(error) });
|
|
12736
12735
|
this.eventBus.get("browse:annotations-failed").next({
|
|
12737
12736
|
correlationId: event.correlationId,
|
|
12738
12737
|
message: error instanceof Error ? error.message : String(error)
|
|
@@ -12764,7 +12763,7 @@ var Browser = class {
|
|
|
12764
12763
|
}
|
|
12765
12764
|
});
|
|
12766
12765
|
} catch (error) {
|
|
12767
|
-
this.logger.error("Browse annotation failed", { resourceId: event.resourceId, annotationId: event.annotationId, error });
|
|
12766
|
+
this.logger.error("Browse annotation failed", { resourceId: event.resourceId, annotationId: event.annotationId, error: errField5(error) });
|
|
12768
12767
|
this.eventBus.get("browse:annotation-failed").next({
|
|
12769
12768
|
correlationId: event.correlationId,
|
|
12770
12769
|
message: error instanceof Error ? error.message : String(error)
|
|
@@ -12796,7 +12795,7 @@ var Browser = class {
|
|
|
12796
12795
|
}
|
|
12797
12796
|
});
|
|
12798
12797
|
} catch (error) {
|
|
12799
|
-
this.logger.error("Browse events failed", { resourceId: event.resourceId, error });
|
|
12798
|
+
this.logger.error("Browse events failed", { resourceId: event.resourceId, error: errField5(error) });
|
|
12800
12799
|
this.eventBus.get("browse:events-failed").next({
|
|
12801
12800
|
correlationId: event.correlationId,
|
|
12802
12801
|
message: error instanceof Error ? error.message : String(error)
|
|
@@ -12832,7 +12831,7 @@ var Browser = class {
|
|
|
12832
12831
|
}
|
|
12833
12832
|
});
|
|
12834
12833
|
} catch (error) {
|
|
12835
|
-
this.logger.error("Browse annotation history failed", { resourceId: event.resourceId, annotationId: event.annotationId, error });
|
|
12834
|
+
this.logger.error("Browse annotation history failed", { resourceId: event.resourceId, annotationId: event.annotationId, error: errField5(error) });
|
|
12836
12835
|
this.eventBus.get("browse:annotation-history-failed").next({
|
|
12837
12836
|
correlationId: event.correlationId,
|
|
12838
12837
|
message: error instanceof Error ? error.message : String(error)
|
|
@@ -12874,7 +12873,7 @@ var Browser = class {
|
|
|
12874
12873
|
response: { referencedBy }
|
|
12875
12874
|
});
|
|
12876
12875
|
} catch (error) {
|
|
12877
|
-
this.logger.error("Referenced-by query failed", { resourceId: event.resourceId, error });
|
|
12876
|
+
this.logger.error("Referenced-by query failed", { resourceId: event.resourceId, error: errField5(error) });
|
|
12878
12877
|
this.eventBus.get("browse:referenced-by-failed").next({
|
|
12879
12878
|
correlationId: event.correlationId,
|
|
12880
12879
|
message: error instanceof Error ? error.message : String(error)
|
|
@@ -12889,7 +12888,7 @@ var Browser = class {
|
|
|
12889
12888
|
response: { entityTypes }
|
|
12890
12889
|
});
|
|
12891
12890
|
} catch (error) {
|
|
12892
|
-
this.logger.error("Entity types read failed", { error });
|
|
12891
|
+
this.logger.error("Entity types read failed", { error: errField5(error) });
|
|
12893
12892
|
this.eventBus.get("browse:entity-types-failed").next({
|
|
12894
12893
|
correlationId: event.correlationId,
|
|
12895
12894
|
message: error instanceof Error ? error.message : String(error)
|