@semiont/make-meaning 0.5.4 → 0.5.5
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 +1244 -37
- package/dist/index.js +1325 -1325
- package/dist/index.js.map +1 -1
- package/dist/smelter-main.d.ts +2 -16
- package/dist/smelter-main.js +1325 -1325
- package/dist/smelter-main.js.map +1 -1
- package/package.json +5 -3
- package/dist/annotation-assembly.d.ts +0 -8
- package/dist/annotation-assembly.d.ts.map +0 -1
- package/dist/annotation-context.d.ts +0 -104
- package/dist/annotation-context.d.ts.map +0 -1
- package/dist/annotation-operations.d.ts +0 -41
- package/dist/annotation-operations.d.ts.map +0 -1
- package/dist/batch-utils.d.ts +0 -14
- package/dist/batch-utils.d.ts.map +0 -1
- package/dist/bootstrap/entity-types.d.ts +0 -26
- package/dist/bootstrap/entity-types.d.ts.map +0 -1
- package/dist/browser.d.ts +0 -45
- package/dist/browser.d.ts.map +0 -1
- package/dist/clone-token-manager.d.ts +0 -31
- package/dist/clone-token-manager.d.ts.map +0 -1
- package/dist/config.d.ts +0 -55
- package/dist/config.d.ts.map +0 -1
- package/dist/embedding-store.d.ts +0 -63
- package/dist/embedding-store.d.ts.map +0 -1
- package/dist/event-enrichment.d.ts +0 -5
- package/dist/event-enrichment.d.ts.map +0 -1
- package/dist/exchange/backup-exporter.d.ts +0 -43
- package/dist/exchange/backup-exporter.d.ts.map +0 -1
- package/dist/exchange/backup-importer.d.ts +0 -41
- package/dist/exchange/backup-importer.d.ts.map +0 -1
- package/dist/exchange/index.d.ts +0 -10
- package/dist/exchange/index.d.ts.map +0 -1
- package/dist/exchange/linked-data-exporter.d.ts +0 -42
- package/dist/exchange/linked-data-exporter.d.ts.map +0 -1
- package/dist/exchange/linked-data-importer.d.ts +0 -44
- package/dist/exchange/linked-data-importer.d.ts.map +0 -1
- package/dist/exchange/manifest.d.ts +0 -42
- package/dist/exchange/manifest.d.ts.map +0 -1
- package/dist/exchange/replay.d.ts +0 -37
- package/dist/exchange/replay.d.ts.map +0 -1
- package/dist/exchange/tar.d.ts +0 -34
- package/dist/exchange/tar.d.ts.map +0 -1
- package/dist/gatherer.d.ts +0 -45
- package/dist/gatherer.d.ts.map +0 -1
- package/dist/generation/resource-generation.d.ts +0 -20
- package/dist/generation/resource-generation.d.ts.map +0 -1
- package/dist/graph/consumer.d.ts +0 -104
- package/dist/graph/consumer.d.ts.map +0 -1
- package/dist/graph-context.d.ts +0 -56
- package/dist/graph-context.d.ts.map +0 -1
- package/dist/handlers/annotation-assembly.d.ts +0 -19
- package/dist/handlers/annotation-assembly.d.ts.map +0 -1
- package/dist/handlers/annotation-lookups.d.ts +0 -8
- package/dist/handlers/annotation-lookups.d.ts.map +0 -1
- package/dist/handlers/bind-update-body.d.ts +0 -19
- package/dist/handlers/bind-update-body.d.ts.map +0 -1
- package/dist/handlers/index.d.ts +0 -27
- package/dist/handlers/index.d.ts.map +0 -1
- package/dist/handlers/job-commands.d.ts +0 -5
- package/dist/handlers/job-commands.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/knowledge-base.d.ts +0 -40
- package/dist/knowledge-base.d.ts.map +0 -1
- package/dist/knowledge-system.d.ts +0 -32
- package/dist/knowledge-system.d.ts.map +0 -1
- package/dist/llm-context.d.ts +0 -26
- package/dist/llm-context.d.ts.map +0 -1
- package/dist/local-content-transport.d.ts +0 -41
- package/dist/local-content-transport.d.ts.map +0 -1
- package/dist/local-transport.d.ts +0 -80
- package/dist/local-transport.d.ts.map +0 -1
- package/dist/matcher.d.ts +0 -60
- package/dist/matcher.d.ts.map +0 -1
- package/dist/resource-context.d.ts +0 -44
- package/dist/resource-context.d.ts.map +0 -1
- package/dist/resource-operations.d.ts +0 -38
- package/dist/resource-operations.d.ts.map +0 -1
- package/dist/service.d.ts +0 -21
- package/dist/service.d.ts.map +0 -1
- package/dist/smelter-actor-state-unit.d.ts +0 -31
- package/dist/smelter-actor-state-unit.d.ts.map +0 -1
- package/dist/smelter-main.d.ts.map +0 -1
- package/dist/smelter.d.ts +0 -95
- package/dist/smelter.d.ts.map +0 -1
- package/dist/stower.d.ts +0 -69
- package/dist/stower.d.ts.map +0 -1
- package/dist/views/entity-types-reader.d.ts +0 -12
- package/dist/views/entity-types-reader.d.ts.map +0 -1
- package/dist/views/projection-validators.d.ts +0 -80
- package/dist/views/projection-validators.d.ts.map +0 -1
- package/dist/views/tag-schemas-reader.d.ts +0 -14
- package/dist/views/tag-schemas-reader.d.ts.map +0 -1
package/dist/llm-context.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LLM Context
|
|
3
|
-
*
|
|
4
|
-
* Builds comprehensive context for LLM processing of resources
|
|
5
|
-
* Orchestrates: ResourceContext, GraphContext, AnnotationContext, and generation functions
|
|
6
|
-
*/
|
|
7
|
-
import type { InferenceClient } from '@semiont/inference';
|
|
8
|
-
import { type ResourceId } from '@semiont/core';
|
|
9
|
-
import type { components } from '@semiont/core';
|
|
10
|
-
import type { KnowledgeBase } from './knowledge-base';
|
|
11
|
-
type ResourceLLMContextResponse = components['schemas']['ResourceLLMContextResponse'];
|
|
12
|
-
export interface LLMContextOptions {
|
|
13
|
-
depth: number;
|
|
14
|
-
maxResources: number;
|
|
15
|
-
includeContent: boolean;
|
|
16
|
-
includeSummary: boolean;
|
|
17
|
-
}
|
|
18
|
-
export declare class LLMContext {
|
|
19
|
-
/**
|
|
20
|
-
* Get comprehensive LLM context for a resource
|
|
21
|
-
* Includes: main resource, related resources, annotations, graph, content, summary, references
|
|
22
|
-
*/
|
|
23
|
-
static getResourceContext(resourceId: ResourceId, options: LLMContextOptions, kb: KnowledgeBase, inferenceClient: InferenceClient): Promise<ResourceLLMContextResponse>;
|
|
24
|
-
}
|
|
25
|
-
export {};
|
|
26
|
-
//# sourceMappingURL=llm-context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"llm-context.d.ts","sourceRoot":"","sources":["../src/llm-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGtD,KAAK,0BAA0B,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,4BAA4B,CAAC,CAAC;AAEtF,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,qBAAa,UAAU;IACrB;;;OAGG;WACU,kBAAkB,CAC7B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,iBAAiB,EAC1B,EAAE,EAAE,aAAa,EACjB,eAAe,EAAE,eAAe,GAC/B,OAAO,CAAC,0BAA0B,CAAC;CA4EvC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LocalContentTransport — `IContentTransport` for an in-process
|
|
3
|
-
* `KnowledgeSystem`.
|
|
4
|
-
*
|
|
5
|
-
* Reads go straight to `kb.views` (resource lookup) + `kb.content`
|
|
6
|
-
* (byte retrieval). No network, no auth — local mode runs as a single
|
|
7
|
-
* host-process identity.
|
|
8
|
-
*
|
|
9
|
-
* `putBinary` is intentionally not implemented in Phase 2: in-process
|
|
10
|
-
* resource creation is exercised through bus emits (mark/yield
|
|
11
|
-
* namespaces), not multipart upload. If a future caller needs raw
|
|
12
|
-
* binary upload from a local context, wire it through the same
|
|
13
|
-
* resource-creation pipeline the HTTP `/resources` handler uses.
|
|
14
|
-
*/
|
|
15
|
-
import type { AccessToken, ContentFormat, ResourceId } from '@semiont/core';
|
|
16
|
-
import type { IContentTransport, PutBinaryRequest, PutBinaryOptions } from '@semiont/core';
|
|
17
|
-
import type { KnowledgeSystem } from './knowledge-system.js';
|
|
18
|
-
export declare class LocalContentTransport implements IContentTransport {
|
|
19
|
-
private readonly ks;
|
|
20
|
-
constructor(ks: KnowledgeSystem);
|
|
21
|
-
putBinary(_request: PutBinaryRequest, _options?: PutBinaryOptions): Promise<{
|
|
22
|
-
resourceId: ResourceId;
|
|
23
|
-
}>;
|
|
24
|
-
getBinary(resourceId: ResourceId, options?: {
|
|
25
|
-
accept?: ContentFormat | string;
|
|
26
|
-
auth?: AccessToken;
|
|
27
|
-
}): Promise<{
|
|
28
|
-
data: ArrayBuffer;
|
|
29
|
-
contentType: string;
|
|
30
|
-
}>;
|
|
31
|
-
getBinaryStream(resourceId: ResourceId, options?: {
|
|
32
|
-
accept?: ContentFormat | string;
|
|
33
|
-
auth?: AccessToken;
|
|
34
|
-
}): Promise<{
|
|
35
|
-
stream: ReadableStream<Uint8Array>;
|
|
36
|
-
contentType: string;
|
|
37
|
-
}>;
|
|
38
|
-
private loadBinary;
|
|
39
|
-
dispose(): void;
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=local-content-transport.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local-content-transport.d.ts","sourceRoot":"","sources":["../src/local-content-transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAc,MAAM,eAAe,CAAC;AAGxF,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAE3F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAW7D,qBAAa,qBAAsB,YAAW,iBAAiB;IACjD,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,eAAe;IAE1C,SAAS,CACb,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,CAAC,EAAE,gBAAgB,GAC1B,OAAO,CAAC;QAAE,UAAU,EAAE,UAAU,CAAA;KAAE,CAAC;IAUhC,SAAS,CACb,UAAU,EAAE,UAAU,EACtB,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,aAAa,GAAG,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,WAAW,CAAA;KAAE,GAChE,OAAO,CAAC;QAAE,IAAI,EAAE,WAAW,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IAShD,eAAe,CACnB,UAAU,EAAE,UAAU,EACtB,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,aAAa,GAAG,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,WAAW,CAAA;KAAE,GAChE,OAAO,CAAC;QAAE,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;YAyBzD,UAAU;IAcxB,OAAO,IAAI,IAAI;CAGhB"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LocalTransport — `ITransport` for an in-process `KnowledgeSystem`.
|
|
3
|
-
*
|
|
4
|
-
* Bus-ownership pattern (see `docs/protocol/TRANSPORT-CONTRACT.md`):
|
|
5
|
-
* - The caller owns a make-meaning `EventBus` and passes it to both
|
|
6
|
-
* `startMakeMeaning` and `LocalTransport` so the transport can publish
|
|
7
|
-
* directly onto the bus the `KnowledgeSystem` actors are listening on.
|
|
8
|
-
* - `SemiontClient` constructs its own `clientBus` and calls
|
|
9
|
-
* `bridgeInto(clientBus)` during construction. `LocalTransport`
|
|
10
|
-
* subscribes to every `BRIDGED_CHANNELS` entry on the make-meaning bus
|
|
11
|
-
* and forwards each onto `clientBus`.
|
|
12
|
-
* - The bus reference flows client → transport, never the other way.
|
|
13
|
-
*
|
|
14
|
-
* LocalTransport implements `ITransport` only. Auth, admin, and exchange
|
|
15
|
-
* (`IBackendOperations`) are HTTP-shaped concepts that don't apply
|
|
16
|
-
* in-process — local mode runs as a single host-process identity supplied
|
|
17
|
-
* at construction, with no token/credential lifecycle. A `SemiontClient`
|
|
18
|
-
* built over this transport has no `.auth` / `.admin` namespaces.
|
|
19
|
-
*/
|
|
20
|
-
import type { Observable } from 'rxjs';
|
|
21
|
-
import { BehaviorSubject } from 'rxjs';
|
|
22
|
-
import type { SemiontError } from '@semiont/core';
|
|
23
|
-
import type { BaseUrl, EventBus, EventMap, ResourceId, UserDID } from '@semiont/core';
|
|
24
|
-
import { type ConnectionState, type ITransport } from '@semiont/core';
|
|
25
|
-
import type { KnowledgeSystem } from './knowledge-system.js';
|
|
26
|
-
export interface LocalTransportConfig {
|
|
27
|
-
/**
|
|
28
|
-
* The in-process knowledge system. Lifetime is owned by the caller —
|
|
29
|
-
* `dispose()` on this transport does not stop the KnowledgeSystem.
|
|
30
|
-
*/
|
|
31
|
-
knowledgeSystem: KnowledgeSystem;
|
|
32
|
-
/**
|
|
33
|
-
* The make-meaning `EventBus`. Must be the same instance passed to
|
|
34
|
-
* `startMakeMeaning` so that emits land on the bus KnowledgeSystem
|
|
35
|
-
* actors are subscribed to.
|
|
36
|
-
*/
|
|
37
|
-
eventBus: EventBus;
|
|
38
|
-
/**
|
|
39
|
-
* Host-process identity. Stamped onto every emit as `_userId`, mirroring
|
|
40
|
-
* the gateway-injection convention used by `HttpTransport` (where the
|
|
41
|
-
* `/bus/emit` gateway reads the JWT subject and injects `_userId`).
|
|
42
|
-
* Handlers downstream trust nothing else.
|
|
43
|
-
*/
|
|
44
|
-
userId: UserDID;
|
|
45
|
-
/**
|
|
46
|
-
* Cosmetic base URL for diagnostics and URL composition. Defaults to
|
|
47
|
-
* `local://in-process`. Local code never makes outgoing HTTP requests
|
|
48
|
-
* with it.
|
|
49
|
-
*/
|
|
50
|
-
baseUrl?: BaseUrl;
|
|
51
|
-
}
|
|
52
|
-
export declare class LocalTransport implements ITransport {
|
|
53
|
-
readonly baseUrl: BaseUrl;
|
|
54
|
-
readonly state$: BehaviorSubject<ConnectionState>;
|
|
55
|
-
private readonly errorsSubject;
|
|
56
|
-
/**
|
|
57
|
-
* Stream of `SemiontError` instances surfaced from transport-mediated
|
|
58
|
-
* round-trips (typed-wire methods on this transport that fail). The
|
|
59
|
-
* in-process implementation does not currently surface errors through
|
|
60
|
-
* this stream — most failures here originate inside the make-meaning
|
|
61
|
-
* actors and surface through bus channels (correlation-ID failures via
|
|
62
|
-
* `busRequest`). The Subject exists to satisfy the `ITransport`
|
|
63
|
-
* contract; future expansion (e.g. transport-level guard failures)
|
|
64
|
-
* can publish into it.
|
|
65
|
-
*/
|
|
66
|
-
readonly errors$: Observable<SemiontError>;
|
|
67
|
-
private readonly bus;
|
|
68
|
-
private readonly userId;
|
|
69
|
-
private readonly bridges;
|
|
70
|
-
private readonly bridgeSubs;
|
|
71
|
-
private disposed;
|
|
72
|
-
constructor(cfg: LocalTransportConfig);
|
|
73
|
-
emit<K extends keyof EventMap>(channel: K, payload: EventMap[K], resourceScope?: ResourceId): Promise<void>;
|
|
74
|
-
on<K extends keyof EventMap>(channel: K, handler: (payload: EventMap[K]) => void): () => void;
|
|
75
|
-
stream<K extends keyof EventMap>(channel: K): Observable<EventMap[K]>;
|
|
76
|
-
subscribeToResource(_resourceId: ResourceId): () => void;
|
|
77
|
-
bridgeInto(bus: EventBus): void;
|
|
78
|
-
dispose(): void;
|
|
79
|
-
}
|
|
80
|
-
//# sourceMappingURL=local-transport.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local-transport.d.ts","sourceRoot":"","sources":["../src/local-transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAgB,MAAM,MAAM,CAAC;AACrD,OAAO,EAAE,eAAe,EAAW,MAAM,MAAM,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EACV,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,OAAO,EACR,MAAM,eAAe,CAAC;AAGvB,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,UAAU,EAChB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,eAAe,EAAE,eAAe,CAAC;IACjC;;;;OAIG;IACH,QAAQ,EAAE,QAAQ,CAAC;IACnB;;;;;OAKG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,qBAAa,cAAe,YAAW,UAAU;IAC/C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;IAClD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAsD;IACpF;;;;;;;;;OASG;IACH,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,YAAY,CAAC,CAAqC;IAE/E,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAW;IAC/B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAU;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkB;IAC1C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAsB;IACjD,OAAO,CAAC,QAAQ,CAAS;gBAEb,GAAG,EAAE,oBAAoB;IAU/B,IAAI,CAAC,CAAC,SAAS,MAAM,QAAQ,EACjC,OAAO,EAAE,CAAC,EACV,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,EACpB,aAAa,CAAC,EAAE,UAAU,GACzB,OAAO,CAAC,IAAI,CAAC;IAyBhB,EAAE,CAAC,CAAC,SAAS,MAAM,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,MAAM,IAAI;IAK7F,MAAM,CAAC,CAAC,SAAS,MAAM,QAAQ,EAAE,OAAO,EAAE,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAIrE,mBAAmB,CAAC,WAAW,EAAE,UAAU,GAAG,MAAM,IAAI;IAOxD,UAAU,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI;IA8B/B,OAAO,IAAI,IAAI;CAUhB"}
|
package/dist/matcher.d.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Matcher Actor
|
|
3
|
-
*
|
|
4
|
-
* Candidate search for the bind flow. Subscribes to match:search-requested,
|
|
5
|
-
* queries the KB graph for matching resources, scores them, and emits results.
|
|
6
|
-
*
|
|
7
|
-
* Handles:
|
|
8
|
-
* - match:search-requested — multi-source retrieval + composite scoring
|
|
9
|
-
*
|
|
10
|
-
* The write side (annotation.body.updated) stays in the route where userId
|
|
11
|
-
* is available from auth context.
|
|
12
|
-
*/
|
|
13
|
-
import type { Logger } from '@semiont/core';
|
|
14
|
-
import { type EventBus } from '@semiont/core';
|
|
15
|
-
import type { InferenceClient } from '@semiont/inference';
|
|
16
|
-
import type { EmbeddingProvider } from '@semiont/vectors';
|
|
17
|
-
import type { KnowledgeBase } from './knowledge-base';
|
|
18
|
-
export declare class Matcher {
|
|
19
|
-
private kb;
|
|
20
|
-
private eventBus;
|
|
21
|
-
private inferenceClient;
|
|
22
|
-
private embeddingProvider?;
|
|
23
|
-
private subscriptions;
|
|
24
|
-
private readonly logger;
|
|
25
|
-
constructor(kb: KnowledgeBase, eventBus: EventBus, logger: Logger, inferenceClient: InferenceClient, embeddingProvider?: EmbeddingProvider | undefined);
|
|
26
|
-
initialize(): Promise<void>;
|
|
27
|
-
private handleSearch;
|
|
28
|
-
/**
|
|
29
|
-
* Context-driven search: multi-source retrieval + composite scoring
|
|
30
|
-
*
|
|
31
|
-
* Retrieval sources:
|
|
32
|
-
* 1. Name match — graph.searchResources(searchTerm)
|
|
33
|
-
* 2. Entity type match — graph.listResources({ entityTypes })
|
|
34
|
-
* 3. Graph neighborhood — connections from GatheredContext
|
|
35
|
-
*
|
|
36
|
-
* Ranking signals:
|
|
37
|
-
* - Entity type overlap (Jaccard similarity)
|
|
38
|
-
* - Bidirectionality (already connected both ways)
|
|
39
|
-
* - Citation weight (well-connected = important)
|
|
40
|
-
* - Name match quality (exact > prefix > contains)
|
|
41
|
-
* - Recency (newer resources scored higher)
|
|
42
|
-
*/
|
|
43
|
-
private contextDrivenSearch;
|
|
44
|
-
/**
|
|
45
|
-
* LLM-based semantic relevance scoring (GraphRAG-style)
|
|
46
|
-
*
|
|
47
|
-
* Batches candidates into a single prompt asking the LLM to score
|
|
48
|
-
* each candidate's semantic relevance given the passage and graph context.
|
|
49
|
-
*
|
|
50
|
-
* @returns Map of resourceId → score (0-1)
|
|
51
|
-
*/
|
|
52
|
-
private inferenceSemanticScore;
|
|
53
|
-
/**
|
|
54
|
-
* Search vectors for semantically similar resources.
|
|
55
|
-
* Returns empty array if vectors or embedding provider are not configured.
|
|
56
|
-
*/
|
|
57
|
-
private searchVectors;
|
|
58
|
-
stop(): Promise<void>;
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=matcher.d.ts.map
|
package/dist/matcher.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"matcher.d.ts","sourceRoot":"","sources":["../src/matcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAA6B,MAAM,EAAsB,MAAM,eAAe,CAAC;AAC3F,OAAO,EAAE,KAAK,QAAQ,EAAwB,MAAM,eAAe,CAAC;AAGpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAsB,MAAM,kBAAkB,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,qBAAa,OAAO;IAKhB,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,QAAQ;IAEhB,OAAO,CAAC,eAAe;IACvB,OAAO,CAAC,iBAAiB,CAAC;IAR5B,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAGtB,EAAE,EAAE,aAAa,EACjB,QAAQ,EAAE,QAAQ,EAC1B,MAAM,EAAE,MAAM,EACN,eAAe,EAAE,eAAe,EAChC,iBAAiB,CAAC,EAAE,iBAAiB,YAAA;IAKzC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;YAgBnB,YAAY;IAwC1B;;;;;;;;;;;;;;OAcG;YACW,mBAAmB;IAgMjC;;;;;;;OAOG;YACW,sBAAsB;IA6EpC;;;OAGG;YACW,aAAa;IAwBrB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAO5B"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resource Context
|
|
3
|
-
*
|
|
4
|
-
* Assembles resource context from view storage and content store
|
|
5
|
-
* Does NOT touch the graph - graph queries go through GraphContext
|
|
6
|
-
*/
|
|
7
|
-
import type { ResourceId } from '@semiont/core';
|
|
8
|
-
import type { KnowledgeBase } from './knowledge-base';
|
|
9
|
-
import type { ResourceDescriptor } from '@semiont/core';
|
|
10
|
-
export interface ListResourcesFilters {
|
|
11
|
-
search?: string;
|
|
12
|
-
archived?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare class ResourceContext {
|
|
15
|
-
/**
|
|
16
|
-
* Get resource metadata from view storage
|
|
17
|
-
*/
|
|
18
|
-
static getResourceMetadata(resourceId: ResourceId, kb: KnowledgeBase): Promise<ResourceDescriptor | null>;
|
|
19
|
-
/**
|
|
20
|
-
* List resources, optionally filtered.
|
|
21
|
-
*
|
|
22
|
-
* When `search` is set, delegates to `kb.graph.searchResources`, which runs
|
|
23
|
-
* the name match in the graph engine instead of scanning every view in JS.
|
|
24
|
-
* The graph result is then narrowed by `archived` if requested.
|
|
25
|
-
*
|
|
26
|
-
* When `search` is unset, falls back to scanning all materialized views.
|
|
27
|
-
* (TODO: also push the listing path through the graph for large KBs.)
|
|
28
|
-
*/
|
|
29
|
-
static listResources(filters: ListResourcesFilters | undefined, kb: KnowledgeBase): Promise<ResourceDescriptor[]>;
|
|
30
|
-
private static sortByDateDesc;
|
|
31
|
-
/**
|
|
32
|
-
* Add content previews to resources (for search results)
|
|
33
|
-
* Retrieves and decodes the first 200 characters of each resource's primary representation
|
|
34
|
-
*/
|
|
35
|
-
static addContentPreviews(resources: ResourceDescriptor[], kb: KnowledgeBase): Promise<Array<ResourceDescriptor & {
|
|
36
|
-
content: string;
|
|
37
|
-
}>>;
|
|
38
|
-
/**
|
|
39
|
-
* Get full content for a resource
|
|
40
|
-
* Retrieves and decodes the primary representation
|
|
41
|
-
*/
|
|
42
|
-
static getResourceContent(resource: ResourceDescriptor, kb: KnowledgeBase): Promise<string | undefined>;
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=resource-context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resource-context.d.ts","sourceRoot":"","sources":["../src/resource-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,qBAAa,eAAe;IAC1B;;OAEG;WACU,mBAAmB,CAAC,UAAU,EAAE,UAAU,EAAE,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAS/G;;;;;;;;;OASG;WACU,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,SAAS,EAAE,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAuBvH,OAAO,CAAC,MAAM,CAAC,cAAc;IAQ7B;;;OAGG;WACU,kBAAkB,CAC7B,SAAS,EAAE,kBAAkB,EAAE,EAC/B,EAAE,EAAE,aAAa,GAChB,OAAO,CAAC,KAAK,CAAC,kBAAkB,GAAG;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAkB3D;;;OAGG;WACU,kBAAkB,CAC7B,QAAQ,EAAE,kBAAkB,EAC5B,EAAE,EAAE,aAAa,GAChB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;CAQ/B"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resource Operations
|
|
3
|
-
*
|
|
4
|
-
* Business logic for resource operations. All writes go through the EventBus
|
|
5
|
-
* — the Stower actor subscribes and handles persistence.
|
|
6
|
-
*
|
|
7
|
-
* For create: emits yield:create, awaits yield:created / yield:create-failed.
|
|
8
|
-
*/
|
|
9
|
-
import type { UserId, ResourceId } from '@semiont/core';
|
|
10
|
-
import type { components } from '@semiont/core';
|
|
11
|
-
import { EventBus } from '@semiont/core';
|
|
12
|
-
type ContentFormat = components['schemas']['ContentFormat'];
|
|
13
|
-
type Agent = components['schemas']['Agent'];
|
|
14
|
-
export interface CreateResourceInput {
|
|
15
|
-
name: string;
|
|
16
|
-
storageUri: string;
|
|
17
|
-
contentChecksum: string;
|
|
18
|
-
byteSize: number;
|
|
19
|
-
format: ContentFormat;
|
|
20
|
-
language?: string;
|
|
21
|
-
entityTypes?: string[];
|
|
22
|
-
/** Provenance for AI-generated resources: source resource + annotation. */
|
|
23
|
-
generatedFrom?: {
|
|
24
|
-
resourceId?: string;
|
|
25
|
-
annotationId?: string;
|
|
26
|
-
};
|
|
27
|
-
generationPrompt?: string;
|
|
28
|
-
generator?: Agent | Agent[];
|
|
29
|
-
isDraft?: boolean;
|
|
30
|
-
}
|
|
31
|
-
export declare class ResourceOperations {
|
|
32
|
-
/**
|
|
33
|
-
* Create a new resource via EventBus → Stower
|
|
34
|
-
*/
|
|
35
|
-
static createResource(input: CreateResourceInput, userId: UserId, eventBus: EventBus): Promise<ResourceId>;
|
|
36
|
-
}
|
|
37
|
-
export {};
|
|
38
|
-
//# sourceMappingURL=resource-operations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resource-operations.d.ts","sourceRoot":"","sources":["../src/resource-operations.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EACV,MAAM,EACN,UAAU,EACX,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAgC,MAAM,eAAe,CAAC;AAEvE,KAAK,aAAa,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,eAAe,CAAC,CAAC;AAC5D,KAAK,KAAK,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC;AAE5C,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,2EAA2E;IAC3E,aAAa,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,KAAK,GAAG,KAAK,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,qBAAa,kBAAkB;IAC7B;;OAEG;WACU,cAAc,CACzB,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,UAAU,CAAC;CAwCvB"}
|
package/dist/service.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Make-Meaning Service
|
|
3
|
-
*
|
|
4
|
-
* Provides a clean interface:
|
|
5
|
-
* const makeMeaning = await startMakeMeaning(project, config, eventBus, logger);
|
|
6
|
-
*/
|
|
7
|
-
import { type JobQueue } from '@semiont/jobs';
|
|
8
|
-
import type { SemiontProject } from '@semiont/core/node';
|
|
9
|
-
import { EventBus, type Logger } from '@semiont/core';
|
|
10
|
-
import { type MakeMeaningConfig } from './config';
|
|
11
|
-
import { type KnowledgeSystem } from './knowledge-system';
|
|
12
|
-
export type { MakeMeaningConfig } from './config';
|
|
13
|
-
export interface MakeMeaningService {
|
|
14
|
-
knowledgeSystem: KnowledgeSystem;
|
|
15
|
-
jobQueue: JobQueue;
|
|
16
|
-
stop: () => Promise<void>;
|
|
17
|
-
}
|
|
18
|
-
export declare function startMakeMeaning(project: SemiontProject, config: MakeMeaningConfig, eventBus: EventBus, logger: Logger, options?: {
|
|
19
|
-
skipRebuild?: boolean;
|
|
20
|
-
}): Promise<MakeMeaningService>;
|
|
21
|
-
//# sourceMappingURL=service.d.ts.map
|
package/dist/service.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,KAAK,MAAM,EAAS,MAAM,eAAe,CAAC;AAE7D,OAAO,EAAyB,KAAK,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAazE,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAI/E,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,WAAW,kBAAkB;IACjC,eAAe,EAAE,eAAe,CAAC;IACjC,QAAQ,EAAS,QAAQ,CAAC;IAC1B,IAAI,EAAa,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AAoID,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,iBAAiB,EACzB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,GAClC,OAAO,CAAC,kBAAkB,CAAC,CA2B7B"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SmelterActorStateUnit — domain-event fan-in for the Smelter worker.
|
|
3
|
-
*
|
|
4
|
-
* Subscribes to the six smelter-relevant channels on a shared bus and
|
|
5
|
-
* exposes them as a single typed `events$` stream. Transport-neutral —
|
|
6
|
-
* the caller passes a `WorkerBus` (HTTP `ActorStateUnit` today, an in-process
|
|
7
|
-
* bus shim if/when one exists). The state unit does not own the bus and does
|
|
8
|
-
* not dispose it.
|
|
9
|
-
*
|
|
10
|
-
* `start()` widens the bus's channel-subscription set to include the
|
|
11
|
-
* smelter channels. On HTTP this extends the SSE subscription URL;
|
|
12
|
-
* on an in-process bus this is a no-op (the underlying `EventBus`
|
|
13
|
-
* already delivers every emit).
|
|
14
|
-
*/
|
|
15
|
-
import { Observable } from 'rxjs';
|
|
16
|
-
import type { StateUnit, WorkerBus } from '@semiont/sdk';
|
|
17
|
-
export interface SmelterEvent {
|
|
18
|
-
type: string;
|
|
19
|
-
resourceId?: string;
|
|
20
|
-
payload: Record<string, unknown>;
|
|
21
|
-
}
|
|
22
|
-
export interface SmelterActorStateUnitOptions {
|
|
23
|
-
bus: WorkerBus;
|
|
24
|
-
}
|
|
25
|
-
export interface SmelterActorStateUnit extends StateUnit {
|
|
26
|
-
events$: Observable<SmelterEvent>;
|
|
27
|
-
emit(channel: string, payload: Record<string, unknown>): Promise<void>;
|
|
28
|
-
start(): void;
|
|
29
|
-
}
|
|
30
|
-
export declare function createSmelterActorStateUnit(options: SmelterActorStateUnitOptions): SmelterActorStateUnit;
|
|
31
|
-
//# sourceMappingURL=smelter-actor-state-unit.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"smelter-actor-state-unit.d.ts","sourceRoot":"","sources":["../src/smelter-actor-state-unit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAS,MAAM,MAAM,CAAC;AAEzC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,4BAA4B;IAC3C,GAAG,EAAE,SAAS,CAAC;CAChB;AAWD,MAAM,WAAW,qBAAsB,SAAQ,SAAS;IACtD,OAAO,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IAClC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvE,KAAK,IAAI,IAAI,CAAC;CACf;AAED,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,4BAA4B,GAAG,qBAAqB,CA8BxG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"smelter-main.d.ts","sourceRoot":"","sources":["../src/smelter-main.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
|
package/dist/smelter.d.ts
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Smelter Actor
|
|
3
|
-
*
|
|
4
|
-
* Takes raw content, refines it into embedding vectors, persists them to the
|
|
5
|
-
* EmbeddingStore (.semiont/embeddings/), and indexes them into the VectorStore
|
|
6
|
-
* (Qdrant). Peer to the Graph Consumer.
|
|
7
|
-
*
|
|
8
|
-
* Pipeline:
|
|
9
|
-
* 1. Subscribe to resource and annotation events from the EventStore
|
|
10
|
-
* 2. Chunk resource text into overlapping passages
|
|
11
|
-
* 3. Embed each chunk via the configured EmbeddingProvider
|
|
12
|
-
* 4. Write vectors to EmbeddingStore (overwrite-in-place, git-durable)
|
|
13
|
-
* 5. Index vectors into the VectorStore (Qdrant) for fast similarity search
|
|
14
|
-
*
|
|
15
|
-
* Uses the same burst-buffer RxJS pipeline as GraphDBConsumer.
|
|
16
|
-
*
|
|
17
|
-
* ## Per-resource serialization
|
|
18
|
-
*
|
|
19
|
-
* Smelter processes events strictly in order per resourceId via
|
|
20
|
-
* `groupBy(resourceId) + concatMap(...)`. This is the stream-consumer
|
|
21
|
-
* flavor of per-resource serialization — the same invariant enforced by
|
|
22
|
-
* `GraphDBConsumer`, `Gatherer`, and (in a different shape) `ViewManager`.
|
|
23
|
-
* See `packages/core/src/serialize-per-key.ts` for the shared primitive
|
|
24
|
-
* used by RPC-style services.
|
|
25
|
-
*/
|
|
26
|
-
import { type EventStore, type ViewStorage } from '@semiont/event-sourcing';
|
|
27
|
-
import type { Logger } from '@semiont/core';
|
|
28
|
-
import type { EventBus } from '@semiont/core';
|
|
29
|
-
import type { VectorStore } from '@semiont/vectors';
|
|
30
|
-
import type { EmbeddingProvider } from '@semiont/vectors';
|
|
31
|
-
import type { ChunkingConfig } from '@semiont/vectors';
|
|
32
|
-
import type { WorkingTreeStore } from '@semiont/content';
|
|
33
|
-
import type { EmbeddingStore } from './embedding-store.js';
|
|
34
|
-
export declare class Smelter {
|
|
35
|
-
private eventBus;
|
|
36
|
-
private vectorStore;
|
|
37
|
-
private embeddingProvider;
|
|
38
|
-
private contentStore;
|
|
39
|
-
private embeddingStore;
|
|
40
|
-
private viewStorage;
|
|
41
|
-
private static readonly SMELTER_RELEVANT_EVENTS;
|
|
42
|
-
private static readonly BURST_WINDOW_MS;
|
|
43
|
-
private static readonly MAX_BATCH_SIZE;
|
|
44
|
-
private static readonly IDLE_TIMEOUT_MS;
|
|
45
|
-
private _globalSubscriptions;
|
|
46
|
-
private eventSubject;
|
|
47
|
-
private pipelineSubscription;
|
|
48
|
-
private readonly logger;
|
|
49
|
-
private readonly chunkingConfig;
|
|
50
|
-
constructor(_eventStore: EventStore, eventBus: EventBus, vectorStore: VectorStore, embeddingProvider: EmbeddingProvider, contentStore: WorkingTreeStore, embeddingStore: EmbeddingStore, viewStorage: ViewStorage, logger: Logger, chunkingConfig?: ChunkingConfig);
|
|
51
|
-
initialize(): Promise<void>;
|
|
52
|
-
stop(): Promise<void>;
|
|
53
|
-
/**
|
|
54
|
-
* Rebuild the vector store from the EmbeddingStore (.semiont/embeddings/).
|
|
55
|
-
*
|
|
56
|
-
* For each stored file, checks whether the model matches the configured
|
|
57
|
-
* provider. On mismatch, re-embeds from the stored text and overwrites the
|
|
58
|
-
* file before upserting into Qdrant. On match, loads the stored vectors
|
|
59
|
-
* directly — no embedding provider calls needed.
|
|
60
|
-
*/
|
|
61
|
-
rebuildAll(): Promise<void>;
|
|
62
|
-
private processBatch;
|
|
63
|
-
/**
|
|
64
|
-
* Batch-optimized processing for consecutive events of the same type.
|
|
65
|
-
*/
|
|
66
|
-
private applyBatchByType;
|
|
67
|
-
/**
|
|
68
|
-
* Batch-embed chunks from multiple yield:created events in a single
|
|
69
|
-
* embedBatch() call, then write to EmbeddingStore and index per resource.
|
|
70
|
-
*/
|
|
71
|
-
private batchResourceCreated;
|
|
72
|
-
/**
|
|
73
|
-
* Batch-embed exact texts from multiple mark:added events in a single
|
|
74
|
-
* embedBatch() call, then write to EmbeddingStore and index per annotation.
|
|
75
|
-
*/
|
|
76
|
-
private batchAnnotationAdded;
|
|
77
|
-
private safeProcessEvent;
|
|
78
|
-
private processEvent;
|
|
79
|
-
private handleResourceCreated;
|
|
80
|
-
/**
|
|
81
|
-
* Re-embed a resource whose content has changed in-place.
|
|
82
|
-
*
|
|
83
|
-
* Used by yield:updated and yield:representation-added handlers. Reads the
|
|
84
|
-
* current storageUri from the materialized view (which is updated before the
|
|
85
|
-
* EventBus fires), deletes stale Qdrant vectors, and overwrites the
|
|
86
|
-
* EmbeddingStore file with fresh chunks.
|
|
87
|
-
*/
|
|
88
|
-
private reembedResource;
|
|
89
|
-
private handleResourceUpdated;
|
|
90
|
-
private handleRepresentationAdded;
|
|
91
|
-
private handleResourceArchived;
|
|
92
|
-
private handleAnnotationAdded;
|
|
93
|
-
private handleAnnotationRemoved;
|
|
94
|
-
}
|
|
95
|
-
//# sourceMappingURL=smelter.d.ts.map
|
package/dist/smelter.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"smelter.d.ts","sourceRoot":"","sources":["../src/smelter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE5E,OAAO,KAAK,EAAE,MAAM,EAA4C,MAAM,eAAe,CAAC;AAEtF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAqC,MAAM,kBAAkB,CAAC;AACvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAI3D,qBAAa,OAAO;IAkBhB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,iBAAiB;IACzB,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,WAAW;IAtBrB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,uBAAuB,CAG5C;IAEH,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,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;gBAG9C,WAAW,EAAE,UAAU,EACf,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,iBAAiB,EACpC,YAAY,EAAE,gBAAgB,EAC9B,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,WAAW,EAChC,MAAM,EAAE,MAAM,EACd,cAAc,CAAC,EAAE,cAAc;IAM3B,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAyC3B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ3B;;;;;;;OAOG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;YAwInB,YAAY;IAoB1B;;OAEG;YACW,gBAAgB;IAiB9B;;;OAGG;YACW,oBAAoB;IA6ClC;;;OAGG;YACW,oBAAoB;YAqDpB,gBAAgB;YAahB,YAAY;YAuBZ,qBAAqB;IAqDnC;;;;;;;OAOG;YACW,eAAe;YAgCf,qBAAqB;YAIrB,yBAAyB;YAIzB,sBAAsB;YAOtB,qBAAqB;YAsCrB,uBAAuB;CAWtC"}
|
package/dist/stower.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Stower Actor
|
|
3
|
-
*
|
|
4
|
-
* The single write gateway to the Knowledge Base. Subscribes to command
|
|
5
|
-
* events on the EventBus and translates them into domain events on the
|
|
6
|
-
* EventStore + content writes to the RepresentationStore.
|
|
7
|
-
*
|
|
8
|
-
* From ARCHITECTURE.md:
|
|
9
|
-
* The Knowledge Base has exactly three actor interfaces:
|
|
10
|
-
* - Stower (write) — this actor
|
|
11
|
-
* - Gatherer (read context)
|
|
12
|
-
* - Matcher (read search)
|
|
13
|
-
*
|
|
14
|
-
* No other code should call eventStore.appendEvent() or repStore.store().
|
|
15
|
-
*
|
|
16
|
-
* Subscriptions:
|
|
17
|
-
* - yield:create → resource.created (+ content store) → yield:created / yield:create-failed
|
|
18
|
-
* - yield:update → resource.updated (+ content store) → yield:updated / yield:update-failed
|
|
19
|
-
* - yield:mv → resource.moved (+ working tree move) → yield:moved / yield:move-failed
|
|
20
|
-
* - mark:create → annotation.added → mark:created / mark:create-failed
|
|
21
|
-
* - mark:delete → annotation.removed → mark:deleted / mark:delete-failed
|
|
22
|
-
* - mark:update-body → annotation.body.updated → (no result event yet)
|
|
23
|
-
* - mark:archive → resource.archived (+ file removal) (resource-scoped, no result event)
|
|
24
|
-
* - mark:unarchive → resource.unarchived (resource-scoped, no result event)
|
|
25
|
-
* - frame:add-entity-type → entitytype.added → frame:entity-type-added / frame:entity-type-add-failed
|
|
26
|
-
* - frame:add-tag-schema → tagschema.added → frame:tag-schema-added / frame:tag-schema-add-failed
|
|
27
|
-
* - mark:update-entity-types → entitytag.added / entitytag.removed
|
|
28
|
-
* - job:start → job.started
|
|
29
|
-
* - job:complete → job.completed
|
|
30
|
-
* - job:fail → job.failed
|
|
31
|
-
*
|
|
32
|
-
* Note: `job:report-progress` is intentionally NOT persisted. Progress
|
|
33
|
-
* events are ephemeral UI feedback and would clutter the event log
|
|
34
|
-
* (historical logs show ~3× as many progress entries as start+complete
|
|
35
|
-
* combined). UI consumers subscribe to the bus directly for live
|
|
36
|
-
* progress; the event log keeps only the durable lifecycle boundaries.
|
|
37
|
-
*/
|
|
38
|
-
import type { Logger, ResourceDescriptor } from '@semiont/core';
|
|
39
|
-
import { EventBus } from '@semiont/core';
|
|
40
|
-
import type { ResourceId } from '@semiont/core';
|
|
41
|
-
import type { KnowledgeBase } from './knowledge-base';
|
|
42
|
-
export interface CreateResourceResult {
|
|
43
|
-
resourceId: ResourceId;
|
|
44
|
-
resource: ResourceDescriptor;
|
|
45
|
-
}
|
|
46
|
-
export declare class Stower {
|
|
47
|
-
private kb;
|
|
48
|
-
private eventBus;
|
|
49
|
-
private subscription;
|
|
50
|
-
private readonly logger;
|
|
51
|
-
constructor(kb: KnowledgeBase, eventBus: EventBus, logger: Logger);
|
|
52
|
-
initialize(): Promise<void>;
|
|
53
|
-
private handleYieldCreate;
|
|
54
|
-
private handleYieldUpdate;
|
|
55
|
-
private handleYieldMv;
|
|
56
|
-
private handleMarkCreate;
|
|
57
|
-
private handleMarkDelete;
|
|
58
|
-
private handleMarkUpdateBody;
|
|
59
|
-
private handleMarkArchive;
|
|
60
|
-
private handleMarkUnarchive;
|
|
61
|
-
private handleAddEntityType;
|
|
62
|
-
private handleAddTagSchema;
|
|
63
|
-
private handleUpdateEntityTypes;
|
|
64
|
-
private handleJobStart;
|
|
65
|
-
private handleJobComplete;
|
|
66
|
-
private handleJobFail;
|
|
67
|
-
stop(): Promise<void>;
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=stower.d.ts.map
|
package/dist/stower.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stower.d.ts","sourceRoot":"","sources":["../src/stower.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAKH,OAAO,KAAK,EAAwB,MAAM,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACtF,OAAO,EAAE,QAAQ,EAA0E,MAAM,eAAe,CAAC;AACjH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,EAAE,kBAAkB,CAAC;CAC9B;AAED,qBAAa,MAAM;IAKf,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,QAAQ;IALlB,OAAO,CAAC,YAAY,CAA6B;IACjD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAGtB,EAAE,EAAE,aAAa,EACjB,QAAQ,EAAE,QAAQ,EAC1B,MAAM,EAAE,MAAM;IAKV,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;YAkCnB,iBAAiB;YAqGjB,iBAAiB;YA4BjB,aAAa;YAuCb,gBAAgB;YA2BhB,gBAAgB;YAwBhB,oBAAoB;YA2BpB,iBAAiB;YAgBjB,mBAAmB;YAuBnB,mBAAmB;YAoBnB,kBAAkB;YAoBlB,uBAAuB;YA6BvB,cAAc;YAiBd,iBAAiB;YAkBjB,aAAa;IAkBrB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAK5B"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Entity Types Projection Reader
|
|
3
|
-
*
|
|
4
|
-
* Reads entity types from the view storage projection file.
|
|
5
|
-
* This file is maintained by ViewMaterializer in response to entitytype.added events.
|
|
6
|
-
*/
|
|
7
|
-
import type { SemiontProject } from '@semiont/core/node';
|
|
8
|
-
/**
|
|
9
|
-
* Read entity types from view storage projection
|
|
10
|
-
*/
|
|
11
|
-
export declare function readEntityTypesProjection(project: SemiontProject): Promise<string[]>;
|
|
12
|
-
//# sourceMappingURL=entity-types-reader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entity-types-reader.d.ts","sourceRoot":"","sources":["../../src/views/entity-types-reader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD;;GAEG;AACH,wBAAsB,yBAAyB,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAsB1F"}
|