@semiont/make-meaning 0.5.3 → 0.5.4
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/annotation-assembly.d.ts +8 -0
- package/dist/annotation-assembly.d.ts.map +1 -0
- package/dist/annotation-context.d.ts +104 -0
- package/dist/annotation-context.d.ts.map +1 -0
- package/dist/annotation-operations.d.ts +41 -0
- package/dist/annotation-operations.d.ts.map +1 -0
- package/dist/batch-utils.d.ts +14 -0
- package/dist/batch-utils.d.ts.map +1 -0
- package/dist/bootstrap/entity-types.d.ts +26 -0
- package/dist/bootstrap/entity-types.d.ts.map +1 -0
- package/dist/browser.d.ts +45 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/clone-token-manager.d.ts +31 -0
- package/dist/clone-token-manager.d.ts.map +1 -0
- package/dist/config.d.ts +55 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/embedding-store.d.ts +63 -0
- package/dist/embedding-store.d.ts.map +1 -0
- package/dist/event-enrichment.d.ts +5 -0
- package/dist/event-enrichment.d.ts.map +1 -0
- package/dist/exchange/backup-exporter.d.ts +43 -0
- package/dist/exchange/backup-exporter.d.ts.map +1 -0
- package/dist/exchange/backup-importer.d.ts +41 -0
- package/dist/exchange/backup-importer.d.ts.map +1 -0
- package/dist/exchange/index.d.ts +10 -0
- package/dist/exchange/index.d.ts.map +1 -0
- package/dist/exchange/linked-data-exporter.d.ts +42 -0
- package/dist/exchange/linked-data-exporter.d.ts.map +1 -0
- package/dist/exchange/linked-data-importer.d.ts +44 -0
- package/dist/exchange/linked-data-importer.d.ts.map +1 -0
- package/dist/exchange/manifest.d.ts +42 -0
- package/dist/exchange/manifest.d.ts.map +1 -0
- package/dist/exchange/replay.d.ts +37 -0
- package/dist/exchange/replay.d.ts.map +1 -0
- package/dist/exchange/tar.d.ts +34 -0
- package/dist/exchange/tar.d.ts.map +1 -0
- package/dist/gatherer.d.ts +45 -0
- package/dist/gatherer.d.ts.map +1 -0
- package/dist/generation/resource-generation.d.ts +20 -0
- package/dist/generation/resource-generation.d.ts.map +1 -0
- package/dist/graph/consumer.d.ts +104 -0
- package/dist/graph/consumer.d.ts.map +1 -0
- package/dist/graph-context.d.ts +56 -0
- package/dist/graph-context.d.ts.map +1 -0
- package/dist/handlers/annotation-assembly.d.ts +19 -0
- package/dist/handlers/annotation-assembly.d.ts.map +1 -0
- package/dist/handlers/annotation-lookups.d.ts +8 -0
- package/dist/handlers/annotation-lookups.d.ts.map +1 -0
- package/dist/handlers/bind-update-body.d.ts +19 -0
- package/dist/handlers/bind-update-body.d.ts.map +1 -0
- package/dist/handlers/index.d.ts +27 -0
- package/dist/handlers/index.d.ts.map +1 -0
- package/dist/handlers/job-commands.d.ts +5 -0
- package/dist/handlers/job-commands.d.ts.map +1 -0
- package/dist/index.d.ts +37 -1244
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -16
- package/dist/index.js.map +1 -1
- package/dist/knowledge-base.d.ts +40 -0
- package/dist/knowledge-base.d.ts.map +1 -0
- package/dist/knowledge-system.d.ts +32 -0
- package/dist/knowledge-system.d.ts.map +1 -0
- package/dist/llm-context.d.ts +26 -0
- package/dist/llm-context.d.ts.map +1 -0
- package/dist/local-content-transport.d.ts +41 -0
- package/dist/local-content-transport.d.ts.map +1 -0
- package/dist/local-transport.d.ts +80 -0
- package/dist/local-transport.d.ts.map +1 -0
- package/dist/matcher.d.ts +60 -0
- package/dist/matcher.d.ts.map +1 -0
- package/dist/resource-context.d.ts +44 -0
- package/dist/resource-context.d.ts.map +1 -0
- package/dist/resource-operations.d.ts +38 -0
- package/dist/resource-operations.d.ts.map +1 -0
- package/dist/service.d.ts +21 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/smelter-actor-state-unit.d.ts +31 -0
- package/dist/smelter-actor-state-unit.d.ts.map +1 -0
- package/dist/smelter-main.d.ts +16 -2
- package/dist/smelter-main.d.ts.map +1 -0
- package/dist/smelter-main.js +6 -2
- package/dist/smelter-main.js.map +1 -1
- package/dist/smelter.d.ts +95 -0
- package/dist/smelter.d.ts.map +1 -0
- package/dist/stower.d.ts +69 -0
- package/dist/stower.d.ts.map +1 -0
- package/dist/views/entity-types-reader.d.ts +12 -0
- package/dist/views/entity-types-reader.d.ts.map +1 -0
- package/dist/views/projection-validators.d.ts +80 -0
- package/dist/views/projection-validators.d.ts.map +1 -0
- package/dist/views/tag-schemas-reader.d.ts +14 -0
- package/dist/views/tag-schemas-reader.d.ts.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Linked Data Importer
|
|
3
|
+
*
|
|
4
|
+
* Creates resources from a JSON-LD tar.gz archive exported by the linked-data exporter.
|
|
5
|
+
* Unlike the backup importer, this is lossy — new resources are created (new IDs),
|
|
6
|
+
* no event history is preserved. Entity types are restored from the manifest.
|
|
7
|
+
*
|
|
8
|
+
* Parses .semiont/manifest.jsonld for format validation and entity types,
|
|
9
|
+
* then processes each .semiont/resources/{resourceId}.jsonld to create
|
|
10
|
+
* resources and annotations via the EventBus → Stower pipeline.
|
|
11
|
+
*/
|
|
12
|
+
import type { Readable } from 'node:stream';
|
|
13
|
+
import type { Logger, UserId } from '@semiont/core';
|
|
14
|
+
import { EventBus } from '@semiont/core';
|
|
15
|
+
import type { WorkingTreeStore } from '@semiont/content';
|
|
16
|
+
import { type LinkedDataManifest } from './manifest';
|
|
17
|
+
export interface LinkedDataImporterOptions {
|
|
18
|
+
eventBus: EventBus;
|
|
19
|
+
contentStore: WorkingTreeStore;
|
|
20
|
+
userId: UserId;
|
|
21
|
+
logger?: Logger;
|
|
22
|
+
}
|
|
23
|
+
export interface LinkedDataImportResult {
|
|
24
|
+
manifest: LinkedDataManifest;
|
|
25
|
+
resourcesCreated: number;
|
|
26
|
+
annotationsCreated: number;
|
|
27
|
+
entityTypesAdded: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Import a JSON-LD archive by creating resources through the EventBus.
|
|
31
|
+
*
|
|
32
|
+
* Flow:
|
|
33
|
+
* 1. Stream and decompress tar.gz entries
|
|
34
|
+
* 2. Parse .semiont/manifest.jsonld → validate format
|
|
35
|
+
* 3. Build blob resolver over root-level content entries
|
|
36
|
+
* 4. Add entity types from manifest via frame:add-entity-type
|
|
37
|
+
* 5. For each .semiont/resources/{id}.jsonld:
|
|
38
|
+
* a. Parse JSON-LD document
|
|
39
|
+
* b. Resolve content blob by checksum from representations
|
|
40
|
+
* c. Emit yield:create → await yield:created
|
|
41
|
+
* d. For each annotation: emit mark:create → await mark:created
|
|
42
|
+
*/
|
|
43
|
+
export declare function importLinkedData(archive: Readable, options: LinkedDataImporterOptions): Promise<LinkedDataImportResult>;
|
|
44
|
+
//# sourceMappingURL=linked-data-importer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linked-data-importer.d.ts","sourceRoot":"","sources":["../../src/exchange/linked-data-importer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C,OAAO,KAAK,EAAE,MAAM,EAAc,MAAM,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAqE,MAAM,eAAe,CAAC;AAE5G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGzD,OAAO,EAEL,KAAK,kBAAkB,EAGxB,MAAM,YAAY,CAAC;AAKpB,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,EAAE,gBAAgB,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAmFD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,sBAAsB,CAAC,CAoEjC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exchange Format Manifest Types
|
|
3
|
+
*
|
|
4
|
+
* Defines the metadata structures for backup archives.
|
|
5
|
+
* The manifest is the first entry in an archive and describes its contents.
|
|
6
|
+
*/
|
|
7
|
+
export declare const BACKUP_FORMAT: "semiont-backup";
|
|
8
|
+
export declare const FORMAT_VERSION = 1;
|
|
9
|
+
export interface BackupManifestHeader {
|
|
10
|
+
format: typeof BACKUP_FORMAT;
|
|
11
|
+
version: number;
|
|
12
|
+
exportedAt: string;
|
|
13
|
+
sourceUrl: string;
|
|
14
|
+
stats: {
|
|
15
|
+
streams: number;
|
|
16
|
+
events: number;
|
|
17
|
+
blobs: number;
|
|
18
|
+
contentBytes: number;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export interface BackupStreamSummary {
|
|
22
|
+
stream: string;
|
|
23
|
+
eventCount: number;
|
|
24
|
+
}
|
|
25
|
+
export declare const LINKED_DATA_FORMAT: "semiont-linked-data";
|
|
26
|
+
export interface LinkedDataManifest {
|
|
27
|
+
'@context': Record<string, string>;
|
|
28
|
+
'@type': string;
|
|
29
|
+
'semiont:format': typeof LINKED_DATA_FORMAT;
|
|
30
|
+
'semiont:version': number;
|
|
31
|
+
'dct:created': string;
|
|
32
|
+
'prov:wasGeneratedBy': {
|
|
33
|
+
'@type': string;
|
|
34
|
+
'prov:used': string;
|
|
35
|
+
};
|
|
36
|
+
'semiont:entityTypes': string[];
|
|
37
|
+
'void:entities': number;
|
|
38
|
+
}
|
|
39
|
+
export declare function isLinkedDataManifest(obj: unknown): obj is LinkedDataManifest;
|
|
40
|
+
export declare function isBackupManifest(obj: unknown): obj is BackupManifestHeader;
|
|
41
|
+
export declare function validateManifestVersion(version: number): void;
|
|
42
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/exchange/manifest.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,aAAa,EAAG,gBAAyB,CAAC;AAEvD,eAAO,MAAM,cAAc,IAAI,CAAC;AAIhC,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,OAAO,aAAa,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE;QACL,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AAID,eAAO,MAAM,kBAAkB,EAAG,qBAA8B,CAAC;AAEjE,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,OAAO,kBAAkB,CAAC;IAC5C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,qBAAqB,EAAE;QACrB,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,kBAAkB,CAM5E;AAID,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,oBAAoB,CAM1E;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAM7D"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event Replay
|
|
3
|
+
*
|
|
4
|
+
* Replays parsed JSONL event streams through the EventBus.
|
|
5
|
+
* Each domain event is translated to the corresponding command event
|
|
6
|
+
* (e.g. yield:created → yield:create), emitted, and the result
|
|
7
|
+
* event is awaited before proceeding (backpressure).
|
|
8
|
+
*
|
|
9
|
+
* Content blobs are resolved lazily via a lookup function so that
|
|
10
|
+
* the caller controls memory strategy (streaming, on-disk, etc.).
|
|
11
|
+
*/
|
|
12
|
+
import type { Logger } from '@semiont/core';
|
|
13
|
+
import { EventBus } from '@semiont/core';
|
|
14
|
+
import type { WorkingTreeStore } from '@semiont/content';
|
|
15
|
+
/**
|
|
16
|
+
* Resolves a content blob by its checksum.
|
|
17
|
+
* Returned by the caller so replay doesn't dictate memory strategy.
|
|
18
|
+
*/
|
|
19
|
+
export type ContentBlobResolver = (checksum: string) => Buffer | undefined;
|
|
20
|
+
export interface ReplayStats {
|
|
21
|
+
eventsReplayed: number;
|
|
22
|
+
resourcesCreated: number;
|
|
23
|
+
annotationsCreated: number;
|
|
24
|
+
entityTypesAdded: number;
|
|
25
|
+
}
|
|
26
|
+
export interface ReplayResult {
|
|
27
|
+
stats: ReplayStats;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Replay a JSONL event stream through the EventBus.
|
|
31
|
+
*
|
|
32
|
+
* Events are emitted sequentially — each command event waits for
|
|
33
|
+
* its result before the next is emitted. This matches the Stower's
|
|
34
|
+
* concatMap processing guarantee.
|
|
35
|
+
*/
|
|
36
|
+
export declare function replayEventStream(jsonl: string, eventBus: EventBus, resolveBlob: ContentBlobResolver, contentStore: WorkingTreeStore, logger?: Logger): Promise<ReplayResult>;
|
|
37
|
+
//# sourceMappingURL=replay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../src/exchange/replay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAyD,MAAM,eAAe,CAAC;AACnG,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAMzD;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;AAE3E,MAAM,WAAW,WAAW;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,WAAW,CAAC;CACpB;AAID;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,mBAAmB,EAChC,YAAY,EAAE,gBAAgB,EAC9B,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,YAAY,CAAC,CAkBvB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal Streaming Tar Writer/Reader
|
|
3
|
+
*
|
|
4
|
+
* Creates and reads POSIX tar archives without external dependencies.
|
|
5
|
+
* Tar format: 512-byte header blocks followed by data padded to 512 bytes.
|
|
6
|
+
*
|
|
7
|
+
* The reader accepts a Readable stream so callers can pipe from disk
|
|
8
|
+
* or network without buffering the entire archive in memory first.
|
|
9
|
+
*/
|
|
10
|
+
import { Readable, Writable } from 'node:stream';
|
|
11
|
+
export interface TarEntry {
|
|
12
|
+
name: string;
|
|
13
|
+
data: Buffer;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Write tar entries to a gzipped stream.
|
|
17
|
+
* Entries are written sequentially as they're yielded.
|
|
18
|
+
*/
|
|
19
|
+
export declare function writeTarGz(entries: AsyncIterable<TarEntry>, output: Writable): Promise<void>;
|
|
20
|
+
export interface TarReadEntry {
|
|
21
|
+
name: string;
|
|
22
|
+
size: number;
|
|
23
|
+
data: Buffer;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Read tar entries from a gzipped Readable stream.
|
|
27
|
+
* Yields entries one at a time.
|
|
28
|
+
*
|
|
29
|
+
* The stream is decompressed incrementally via pipe, then tar entries
|
|
30
|
+
* are parsed from the decompressed result. This avoids requiring the
|
|
31
|
+
* caller to buffer the entire gzipped archive before calling.
|
|
32
|
+
*/
|
|
33
|
+
export declare function readTarGz(input: Readable): AsyncIterable<TarReadEntry>;
|
|
34
|
+
//# sourceMappingURL=tar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tar.d.ts","sourceRoot":"","sources":["../../src/exchange/tar.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAY,MAAM,aAAa,CAAC;AAiD3D,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAC9B,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC,EAChC,MAAM,EAAE,QAAQ,GACf,OAAO,CAAC,IAAI,CAAC,CAsBf;AAID,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAoDD;;;;;;;GAOG;AACH,wBAAuB,SAAS,CAAC,KAAK,EAAE,QAAQ,GAAG,aAAa,CAAC,YAAY,CAAC,CAG7E"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gatherer Actor
|
|
3
|
+
*
|
|
4
|
+
* LLM context assembly for the Knowledge System. Subscribes to gather events,
|
|
5
|
+
* queries KB stores via context modules, and emits results back to the bus.
|
|
6
|
+
*
|
|
7
|
+
* From ARCHITECTURE.md:
|
|
8
|
+
* "When a Generator Agent or Linker Agent emits a gather event, the Gatherer
|
|
9
|
+
* receives it from the bus, queries the relevant KB stores, and assembles
|
|
10
|
+
* the context needed for downstream work."
|
|
11
|
+
*
|
|
12
|
+
* Handles:
|
|
13
|
+
* - gather:requested — annotation-level LLM context assembly
|
|
14
|
+
* - gather:resource-requested — resource-level LLM context assembly
|
|
15
|
+
*
|
|
16
|
+
* RxJS pipeline uses groupBy(resourceId) + concatMap for per-resource isolation.
|
|
17
|
+
*
|
|
18
|
+
* ## Per-resource serialization
|
|
19
|
+
*
|
|
20
|
+
* `groupBy(resourceId) + concatMap(...)` is the stream-consumer flavor of
|
|
21
|
+
* per-resource serialization — the same invariant enforced by `Smelter`,
|
|
22
|
+
* `GraphDBConsumer`, and (in a different shape) `ViewManager`. See
|
|
23
|
+
* `packages/core/src/serialize-per-key.ts` for the shared primitive used
|
|
24
|
+
* by RPC-style services.
|
|
25
|
+
*/
|
|
26
|
+
import type { Logger, components, AnnotationId, ResourceId } from '@semiont/core';
|
|
27
|
+
import { EventBus } from '@semiont/core';
|
|
28
|
+
import type { InferenceClient } from '@semiont/inference';
|
|
29
|
+
import type { EmbeddingProvider } from '@semiont/vectors';
|
|
30
|
+
import type { KnowledgeBase } from './knowledge-base';
|
|
31
|
+
export declare class Gatherer {
|
|
32
|
+
private kb;
|
|
33
|
+
private eventBus;
|
|
34
|
+
private inferenceClient;
|
|
35
|
+
private embeddingProvider?;
|
|
36
|
+
private subscriptions;
|
|
37
|
+
private readonly logger;
|
|
38
|
+
constructor(kb: KnowledgeBase, eventBus: EventBus, inferenceClient: InferenceClient, logger: Logger, embeddingProvider?: EmbeddingProvider | undefined);
|
|
39
|
+
initialize(): Promise<void>;
|
|
40
|
+
private handleAnnotationGather;
|
|
41
|
+
private handleResourceGather;
|
|
42
|
+
generateAnnotationSummary(annotationId: AnnotationId, resourceId: ResourceId): Promise<components['schemas']['ContextualSummaryResponse']>;
|
|
43
|
+
stop(): Promise<void>;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=gatherer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gatherer.d.ts","sourceRoot":"","sources":["../src/gatherer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH,OAAO,KAAK,EAAY,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAA0D,MAAM,eAAe,CAAC;AAEjG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAItD,qBAAa,QAAQ;IAKjB,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,eAAe;IAEvB,OAAO,CAAC,iBAAiB,CAAC;IAR5B,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAGtB,EAAE,EAAE,aAAa,EACjB,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EACxC,MAAM,EAAE,MAAM,EACN,iBAAiB,CAAC,EAAE,iBAAiB,YAAA;IAKzC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;YAuCnB,sBAAsB;YAmCtB,oBAAoB;IA+B5B,yBAAyB,CAC7B,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,GACrB,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,2BAA2B,CAAC,CAAC;IASxD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAO5B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resource Generation Functions
|
|
3
|
+
*
|
|
4
|
+
* Application-specific resource generation logic:
|
|
5
|
+
* - Resource summary generation
|
|
6
|
+
* - Reference suggestion generation
|
|
7
|
+
*
|
|
8
|
+
* NOTE: generateResourceFromTopic lives in @semiont/jobs (canonical location)
|
|
9
|
+
* because make-meaning depends on jobs, not vice versa.
|
|
10
|
+
*/
|
|
11
|
+
import type { InferenceClient } from '@semiont/inference';
|
|
12
|
+
/**
|
|
13
|
+
* Generate an intelligent summary for a resource
|
|
14
|
+
*/
|
|
15
|
+
export declare function generateResourceSummary(resourceName: string, content: string, entityTypes: string[], client: InferenceClient): Promise<string>;
|
|
16
|
+
/**
|
|
17
|
+
* Generate smart suggestions for a reference
|
|
18
|
+
*/
|
|
19
|
+
export declare function generateReferenceSuggestions(referenceTitle: string, client: InferenceClient, entityType?: string, currentContent?: string): Promise<string[] | null>;
|
|
20
|
+
//# sourceMappingURL=resource-generation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-generation.d.ts","sourceRoot":"","sources":["../../src/generation/resource-generation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EAAE,EACrB,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,MAAM,CAAC,CAejB;AAED;;GAEG;AACH,wBAAsB,4BAA4B,CAChD,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,eAAe,EACvB,UAAU,CAAC,EAAE,MAAM,EACnB,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAgB1B"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GraphDB Consumer
|
|
3
|
+
*
|
|
4
|
+
* Subscribes to resource events and updates GraphDB accordingly.
|
|
5
|
+
* Makes GraphDB a projection of Event Store events (single source of truth).
|
|
6
|
+
*
|
|
7
|
+
* Uses an RxJS pipeline with adaptive burst buffering:
|
|
8
|
+
* - First event after idle passes through immediately (zero latency)
|
|
9
|
+
* - Subsequent events in a burst are batched and flushed together
|
|
10
|
+
* - After idle, returns to passthrough mode
|
|
11
|
+
*
|
|
12
|
+
* Per-resource ordering is preserved via groupBy(resourceId) + concatMap.
|
|
13
|
+
* Cross-resource parallelism is provided via mergeMap over groups.
|
|
14
|
+
*
|
|
15
|
+
* Burst buffer thresholds (see BATCH-GRAPH-CONSUMER-RX.md for tuning guidance):
|
|
16
|
+
* BURST_WINDOW_MS = 50 — debounce window before flushing a batch
|
|
17
|
+
* MAX_BATCH_SIZE = 500 — force flush to bound memory
|
|
18
|
+
* IDLE_TIMEOUT_MS = 200 — silence before returning to passthrough
|
|
19
|
+
*
|
|
20
|
+
* ## Per-resource serialization
|
|
21
|
+
*
|
|
22
|
+
* `groupBy(resourceId) + concatMap(...)` is the stream-consumer flavor of
|
|
23
|
+
* per-resource serialization — the same invariant enforced by `Smelter`,
|
|
24
|
+
* `Gatherer`, and (in a different shape) `ViewManager`. See
|
|
25
|
+
* `packages/core/src/serialize-per-key.ts` for the shared primitive used
|
|
26
|
+
* by RPC-style services.
|
|
27
|
+
*/
|
|
28
|
+
import { type EventStore } from '@semiont/event-sourcing';
|
|
29
|
+
import { EventBus } from '@semiont/core';
|
|
30
|
+
import type { GraphDatabase } from '@semiont/graph';
|
|
31
|
+
import type { StoredEvent, ResourceId, Logger } from '@semiont/core';
|
|
32
|
+
export declare class GraphDBConsumer {
|
|
33
|
+
private eventStore;
|
|
34
|
+
private graphDb;
|
|
35
|
+
private coreEventBus;
|
|
36
|
+
private static readonly GRAPH_RELEVANT_EVENTS;
|
|
37
|
+
private static readonly BURST_WINDOW_MS;
|
|
38
|
+
private static readonly MAX_BATCH_SIZE;
|
|
39
|
+
private static readonly IDLE_TIMEOUT_MS;
|
|
40
|
+
private _globalSubscriptions;
|
|
41
|
+
private eventSubject;
|
|
42
|
+
private pipelineSubscription;
|
|
43
|
+
private lastProcessed;
|
|
44
|
+
private readonly logger;
|
|
45
|
+
constructor(eventStore: EventStore, graphDb: GraphDatabase, coreEventBus: EventBus, logger: Logger);
|
|
46
|
+
initialize(): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Subscribe globally to ALL events, pre-filter to graph-relevant types,
|
|
49
|
+
* and wire through the RxJS burst-buffered pipeline.
|
|
50
|
+
*/
|
|
51
|
+
private subscribeToGlobalEvents;
|
|
52
|
+
/**
|
|
53
|
+
* Wrap applyEventToGraph in try/catch so one failed event doesn't kill the pipeline.
|
|
54
|
+
*/
|
|
55
|
+
private safeApplyEvent;
|
|
56
|
+
private ensureInitialized;
|
|
57
|
+
/**
|
|
58
|
+
* Stop the consumer, flush remaining buffered events, and unsubscribe.
|
|
59
|
+
*/
|
|
60
|
+
stop(): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Process a batch of events for the same resource.
|
|
63
|
+
* Partitions into consecutive same-type runs for batch optimization.
|
|
64
|
+
*/
|
|
65
|
+
private processBatch;
|
|
66
|
+
/**
|
|
67
|
+
* Batch-optimized processing for consecutive events of the same type.
|
|
68
|
+
* Uses batch graph methods where available, falls back to sequential.
|
|
69
|
+
*/
|
|
70
|
+
private applyBatchByType;
|
|
71
|
+
/**
|
|
72
|
+
* Build a ResourceDescriptor from a resource.created event.
|
|
73
|
+
* Extracted for reuse by both applyEventToGraph and applyBatchByType.
|
|
74
|
+
*/
|
|
75
|
+
private buildResourceDescriptor;
|
|
76
|
+
/**
|
|
77
|
+
* Apply a single event to GraphDB.
|
|
78
|
+
*/
|
|
79
|
+
protected applyEventToGraph(storedEvent: StoredEvent): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Rebuild entire resource from events.
|
|
82
|
+
* Bypasses the live pipeline — reads directly from event store.
|
|
83
|
+
*/
|
|
84
|
+
rebuildResource(resourceId: ResourceId): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Rebuild entire GraphDB from all events.
|
|
87
|
+
* Uses two-pass approach to ensure all resources exist before creating REFERENCES edges.
|
|
88
|
+
* Bypasses the live pipeline — reads directly from event store.
|
|
89
|
+
*/
|
|
90
|
+
rebuildAll(): Promise<void>;
|
|
91
|
+
/**
|
|
92
|
+
* Get consumer health metrics.
|
|
93
|
+
*/
|
|
94
|
+
getHealthMetrics(): {
|
|
95
|
+
subscriptions: number;
|
|
96
|
+
lastProcessed: Record<string, number>;
|
|
97
|
+
pipelineActive: boolean;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Shutdown consumer.
|
|
101
|
+
*/
|
|
102
|
+
shutdown(): Promise<void>;
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=consumer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consumer.d.ts","sourceRoot":"","sources":["../../src/graph/consumer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAIH,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAA2B,QAAQ,EAAY,MAAM,eAAe,CAAC;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAkB,WAAW,EAAe,UAAU,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AAOjG,qBAAa,eAAe;IAoBxB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,YAAY;IApBtB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAI1C;IAGH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAM;IAC7C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAO;IAC7C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAO;IAE9C,OAAO,CAAC,oBAAoB,CAAsB;IAClD,OAAO,CAAC,YAAY,CAA8B;IAClD,OAAO,CAAC,oBAAoB,CAA6B;IACzD,OAAO,CAAC,aAAa,CAAkC;IACvD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAGtB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,aAAa,EACtB,YAAY,EAAE,QAAQ,EAC9B,MAAM,EAAE,MAAM;IAKV,UAAU;IAKhB;;;OAGG;YACW,uBAAuB;IAoDrC;;OAEG;YACW,cAAc;IAc5B,OAAO,CAAC,iBAAiB;IAIzB;;OAEG;IACG,IAAI;IAsBV;;;OAGG;YACW,YAAY;IA6B1B;;;OAGG;YACW,gBAAgB;IA+B9B;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IA0B/B;;OAEG;cACa,iBAAiB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAwI1E;;;OAGG;IACG,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAoB5D;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IA0CjC;;OAEG;IACH,gBAAgB,IAAI;QAClB,aAAa,EAAE,MAAM,CAAC;QACtB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACtC,cAAc,EAAE,OAAO,CAAC;KACzB;IAQD;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAIhC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graph Context
|
|
3
|
+
*
|
|
4
|
+
* Provides graph database operations for resources and annotations.
|
|
5
|
+
* All methods require graph traversal - must use graph database.
|
|
6
|
+
*/
|
|
7
|
+
import type { ResourceId, GraphConnection, GraphPath } from '@semiont/core';
|
|
8
|
+
import type { KnowledgeBase } from './knowledge-base';
|
|
9
|
+
import type { Annotation } from '@semiont/core';
|
|
10
|
+
import type { ResourceDescriptor } from '@semiont/core';
|
|
11
|
+
export interface GraphNode {
|
|
12
|
+
id: string;
|
|
13
|
+
type: string;
|
|
14
|
+
label: string;
|
|
15
|
+
metadata: {
|
|
16
|
+
entityTypes: string[];
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface GraphEdge {
|
|
20
|
+
source: string;
|
|
21
|
+
target: string;
|
|
22
|
+
type: string;
|
|
23
|
+
metadata: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
export interface GraphRepresentation {
|
|
26
|
+
nodes: GraphNode[];
|
|
27
|
+
edges: GraphEdge[];
|
|
28
|
+
}
|
|
29
|
+
export declare class GraphContext {
|
|
30
|
+
/**
|
|
31
|
+
* Get all resources referencing this resource (backlinks)
|
|
32
|
+
* Requires graph traversal - must use graph database
|
|
33
|
+
*/
|
|
34
|
+
static getBacklinks(resourceId: ResourceId, kb: KnowledgeBase): Promise<Annotation[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Find shortest path between two resources
|
|
37
|
+
* Requires graph traversal - must use graph database
|
|
38
|
+
*/
|
|
39
|
+
static findPath(fromResourceId: ResourceId, toResourceId: ResourceId, kb: KnowledgeBase, maxDepth?: number): Promise<GraphPath[]>;
|
|
40
|
+
/**
|
|
41
|
+
* Get resource connections (graph edges)
|
|
42
|
+
* Requires graph traversal - must use graph database
|
|
43
|
+
*/
|
|
44
|
+
static getResourceConnections(resourceId: ResourceId, kb: KnowledgeBase): Promise<GraphConnection[]>;
|
|
45
|
+
/**
|
|
46
|
+
* Search resources by name (cross-resource query)
|
|
47
|
+
* Requires full-text search - must use graph database
|
|
48
|
+
*/
|
|
49
|
+
static searchResources(query: string, kb: KnowledgeBase, limit?: number): Promise<ResourceDescriptor[]>;
|
|
50
|
+
/**
|
|
51
|
+
* Build graph representation with nodes and edges for a resource and its connections
|
|
52
|
+
* Retrieves connections from graph and builds visualization-ready structure
|
|
53
|
+
*/
|
|
54
|
+
static buildGraphRepresentation(resourceId: ResourceId, maxRelated: number, kb: KnowledgeBase): Promise<GraphRepresentation>;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=graph-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-context.d.ts","sourceRoot":"","sources":["../src/graph-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EACf,SAAS,EACV,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE;QAAE,WAAW,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CACrC;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,KAAK,EAAE,SAAS,EAAE,CAAC;CACpB;AAED,qBAAa,YAAY;IACvB;;;OAGG;WACU,YAAY,CAAC,UAAU,EAAE,UAAU,EAAE,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAI3F;;;OAGG;WACU,QAAQ,CACnB,cAAc,EAAE,UAAU,EAC1B,YAAY,EAAE,UAAU,EACxB,EAAE,EAAE,aAAa,EACjB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,SAAS,EAAE,CAAC;IAIvB;;;OAGG;WACU,sBAAsB,CAAC,UAAU,EAAE,UAAU,EAAE,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAI1G;;;OAGG;WACU,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,aAAa,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAI7G;;;OAGG;WACU,wBAAwB,CACnC,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,MAAM,EAClB,EAAE,EAAE,aAAa,GAChB,OAAO,CAAC,mBAAmB,CAAC;CAwChC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { EventBus, Logger } from '@semiont/core';
|
|
2
|
+
/**
|
|
3
|
+
* Handles `mark:create-request` — the bus command for creating an annotation.
|
|
4
|
+
*
|
|
5
|
+
* Flow:
|
|
6
|
+
* 1. Assemble the W3C annotation from the request using the injected user DID.
|
|
7
|
+
* 2. Emit `mark:create` with the correlationId threaded through.
|
|
8
|
+
* 3. Stower picks up `mark:create`, appends to the event store (threading
|
|
9
|
+
* correlationId into event metadata), and publishes `mark:added` on the
|
|
10
|
+
* core EventBus.
|
|
11
|
+
* 4. This handler subscribes to `mark:added` and `mark:create-failed`,
|
|
12
|
+
* matches by correlationId, and emits `mark:create-ok` / `mark:create-failed`
|
|
13
|
+
* to the caller only after persistence has actually completed.
|
|
14
|
+
*
|
|
15
|
+
* This is a deferred-ack pattern: the result event attests that Stower has
|
|
16
|
+
* persisted the annotation, not merely that the command was well-formed.
|
|
17
|
+
*/
|
|
18
|
+
export declare function registerAnnotationAssemblyHandler(eventBus: EventBus, parentLogger: Logger): void;
|
|
19
|
+
//# sourceMappingURL=annotation-assembly.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotation-assembly.d.ts","sourceRoot":"","sources":["../../src/handlers/annotation-assembly.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAc,MAAM,eAAe,CAAC;AAIlE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CA8DhG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AnnotationId, ResourceId, EventBus, Logger } from '@semiont/core';
|
|
2
|
+
import type { KnowledgeBase } from '../knowledge-base.js';
|
|
3
|
+
interface Gatherer {
|
|
4
|
+
generateAnnotationSummary(annId: AnnotationId, resId: ResourceId): Promise<Record<string, unknown>>;
|
|
5
|
+
}
|
|
6
|
+
export declare function registerAnnotationLookupHandlers(eventBus: EventBus, kb: KnowledgeBase, gatherer: Gatherer, parentLogger: Logger): void;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=annotation-lookups.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotation-lookups.d.ts","sourceRoot":"","sources":["../../src/handlers/annotation-lookups.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAGhF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,UAAU,QAAQ;IAChB,yBAAyB,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACrG;AAED,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,aAAa,EACjB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,MAAM,GACnB,IAAI,CAuDN"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { EventBus, Logger } from '@semiont/core';
|
|
2
|
+
/**
|
|
3
|
+
* Handles `bind:update-body` — the Bind flow's authoritative "apply body
|
|
4
|
+
* operations to an annotation" command. Bind remains a first-class flow
|
|
5
|
+
* despite delegating persistence to Mark — the semantic distinction (Bind =
|
|
6
|
+
* reference linking, Mark = annotation CRUD) is meaningful at the UX and
|
|
7
|
+
* agent-reasoning layers even when the downstream storage event is shared.
|
|
8
|
+
*
|
|
9
|
+
* Flow:
|
|
10
|
+
* 1. Receive bind:update-body with correlationId.
|
|
11
|
+
* 2. Forward to mark:update-body with correlationId threaded through.
|
|
12
|
+
* 3. Stower persists (via EventStore.appendEvent) and publishes mark:body-updated
|
|
13
|
+
* with correlationId in metadata.
|
|
14
|
+
* 4. This handler subscribes to mark:body-updated and mark:body-update-failed,
|
|
15
|
+
* matches by correlationId, and emits bind:body-updated / bind:body-update-failed
|
|
16
|
+
* so the caller learns the real outcome — not an optimistic ack.
|
|
17
|
+
*/
|
|
18
|
+
export declare function registerBindUpdateBodyHandler(eventBus: EventBus, parentLogger: Logger): void;
|
|
19
|
+
//# sourceMappingURL=bind-update-body.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bind-update-body.d.ts","sourceRoot":"","sources":["../../src/handlers/bind-update-body.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAC;AAErE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAkE5F"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bus command handlers — pure bus-event translators that bridge the
|
|
3
|
+
* "request" channels callers emit (`mark:create-request`, `bind:update-body`,
|
|
4
|
+
* `job:create`, `browse:annotation-context-requested`,
|
|
5
|
+
* `gather:summary-requested`) to the underlying make-meaning pipeline
|
|
6
|
+
* (Stower, Browser, Gatherer, JobQueue).
|
|
7
|
+
*
|
|
8
|
+
* These ran in `apps/backend` historically because the HTTP gateway was
|
|
9
|
+
* the only consumer that needed them. They are not HTTP-specific — moving
|
|
10
|
+
* them here means `LocalTransport` consumers (and any future transport)
|
|
11
|
+
* get the same contract automatically.
|
|
12
|
+
*/
|
|
13
|
+
import type { EventBus, Logger } from '@semiont/core';
|
|
14
|
+
import type { SemiontProject } from '@semiont/core/node';
|
|
15
|
+
import type { JobQueue } from '@semiont/jobs';
|
|
16
|
+
import type { KnowledgeSystem } from '../knowledge-system.js';
|
|
17
|
+
import { registerAnnotationAssemblyHandler } from './annotation-assembly.js';
|
|
18
|
+
import { registerAnnotationLookupHandlers } from './annotation-lookups.js';
|
|
19
|
+
import { registerBindUpdateBodyHandler } from './bind-update-body.js';
|
|
20
|
+
import { registerJobCommandHandlers } from './job-commands.js';
|
|
21
|
+
export { registerAnnotationAssemblyHandler, registerAnnotationLookupHandlers, registerBindUpdateBodyHandler, registerJobCommandHandlers, };
|
|
22
|
+
/**
|
|
23
|
+
* Register all bus command handlers on the make-meaning EventBus. Called
|
|
24
|
+
* during `startMakeMeaning` after the JobQueue and KnowledgeSystem exist.
|
|
25
|
+
*/
|
|
26
|
+
export declare function registerBusHandlers(eventBus: EventBus, knowledgeSystem: KnowledgeSystem, jobQueue: JobQueue, project: SemiontProject, logger: Logger): void;
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/handlers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,iCAAiC,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EACL,iCAAiC,EACjC,gCAAgC,EAChC,6BAA6B,EAC7B,0BAA0B,GAC3B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,MAAM,GACb,IAAI,CAKN"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { EventBus, Logger } from '@semiont/core';
|
|
2
|
+
import type { SemiontProject } from '@semiont/core/node';
|
|
3
|
+
import type { JobQueue } from '@semiont/jobs';
|
|
4
|
+
export declare function registerJobCommandHandlers(eventBus: EventBus, jobQueue: JobQueue, project: SemiontProject, parentLogger: Logger): void;
|
|
5
|
+
//# sourceMappingURL=job-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"job-commands.d.ts","sourceRoot":"","sources":["../../src/handlers/job-commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAiB9C,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,cAAc,EACvB,YAAY,EAAE,MAAM,GACnB,IAAI,CAgIN"}
|