@semiont/make-meaning 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/index.d.ts +57 -42
- package/dist/index.js +1669 -2034
- package/dist/index.js.map +1 -1
- package/dist/smelter-main.d.ts +2 -0
- package/dist/smelter-main.js +10088 -0
- package/dist/smelter-main.js.map +1 -0
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -115,14 +115,14 @@ graph TB
|
|
|
115
115
|
CTM -->|query| KB
|
|
116
116
|
end
|
|
117
117
|
|
|
118
|
-
BUS -->|"yield:create, yield:update, yield:mv<br/>mark:create, mark:delete, mark:update-body<br/>
|
|
118
|
+
BUS -->|"yield:create, yield:update, yield:mv<br/>mark:create, mark:delete, mark:update-body<br/>frame:add-entity-type, mark:archive, mark:unarchive<br/>mark:update-entity-types, job:start, job:*"| STOWER
|
|
119
119
|
BUS -->|"browse:resource-requested, browse:resources-requested<br/>browse:annotations-requested, browse:annotation-requested<br/>browse:events-requested, browse:annotation-history-requested<br/>browse:referenced-by-requested, browse:entity-types-requested<br/>browse:directory-requested"| BROWSER
|
|
120
120
|
BUS -->|"gather:requested<br/>gather:resource-requested"| GATHERER
|
|
121
121
|
BUS -->|"match:search-requested"| MATCHER
|
|
122
122
|
BUS -->|"yield:created, mark:created,<br/>mark:body-updated"| SMELTER
|
|
123
123
|
BUS -->|"yield:clone-token-requested<br/>yield:clone-resource-requested<br/>yield:clone-create"| CTM
|
|
124
124
|
|
|
125
|
-
STOWER -->|"yield:created, yield:updated, yield:moved<br/>mark:created, mark:deleted, mark:body-updated<br/>
|
|
125
|
+
STOWER -->|"yield:created, yield:updated, yield:moved<br/>mark:created, mark:deleted, mark:body-updated<br/>frame:entity-type-added, ..."| BUS
|
|
126
126
|
BROWSER -->|"browse:resource-result, browse:resources-result<br/>browse:annotations-result, browse:annotation-result<br/>browse:events-result, browse:annotation-history-result<br/>browse:referenced-by-result, browse:entity-types-result<br/>browse:directory-result"| BUS
|
|
127
127
|
GATHERER -->|"gather:complete, gather:failed<br/>gather:resource-complete, gather:resource-failed"| BUS
|
|
128
128
|
MATCHER -->|"match:search-results, match:search-failed"| BUS
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JobQueue } from '@semiont/jobs';
|
|
2
2
|
import { SemiontProject } from '@semiont/core/node';
|
|
3
|
-
import { GraphServiceConfig, VectorsServiceConfig, EmbeddingServiceConfig, EventBus, Logger, StoredEvent, ResourceId, ResourceDescriptor, AnnotationId, components, ITransport, BaseUrl, ConnectionState, UserDID, EventMap,
|
|
3
|
+
import { GraphServiceConfig, VectorsServiceConfig, EmbeddingServiceConfig, EventBus, Logger, StoredEvent, ResourceId, ResourceDescriptor, AnnotationId, components, ITransport, BaseUrl, ConnectionState, SemiontError, UserDID, EventMap, IContentTransport, PutBinaryRequest, PutBinaryOptions, ContentFormat as ContentFormat$1, AccessToken, Annotation, UserId, CreationMethod, ResourceAnnotations, AnnotationCategory, GraphPath, GraphConnection } from '@semiont/core';
|
|
4
4
|
export { AssembledAnnotation, applyBodyOperations, assembleAnnotation } from '@semiont/core';
|
|
5
5
|
import { EventStore, ViewStorage } from '@semiont/event-sourcing';
|
|
6
6
|
import { WorkingTreeStore } from '@semiont/content';
|
|
@@ -8,6 +8,7 @@ import { GraphDatabase } from '@semiont/graph';
|
|
|
8
8
|
import { VectorStore, EmbeddingProvider } from '@semiont/vectors';
|
|
9
9
|
import { InferenceClient } from '@semiont/inference';
|
|
10
10
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
11
|
+
import { StateUnit, WorkerBus } from '@semiont/sdk';
|
|
11
12
|
import { Writable, Readable } from 'node:stream';
|
|
12
13
|
|
|
13
14
|
/**
|
|
@@ -170,8 +171,8 @@ declare class GraphDBConsumer {
|
|
|
170
171
|
* - Vectors (semantic search) — via VectorStore (optional, read-only)
|
|
171
172
|
*
|
|
172
173
|
* The Smelter (event-to-vector projection) runs as an external actor
|
|
173
|
-
* via @semiont/
|
|
174
|
-
* the EventBus gateway, embeds content, and writes to Qdrant directly.
|
|
174
|
+
* via @semiont/make-meaning/smelter-main. It subscribes to domain events
|
|
175
|
+
* via the EventBus gateway, embeds content, and writes to Qdrant directly.
|
|
175
176
|
*/
|
|
176
177
|
|
|
177
178
|
interface KnowledgeBase {
|
|
@@ -213,7 +214,7 @@ declare function createKnowledgeBase(eventStore: EventStore, project: SemiontPro
|
|
|
213
214
|
* - mark:update-body → annotation.body.updated → (no result event yet)
|
|
214
215
|
* - mark:archive → resource.archived (+ file removal) (resource-scoped, no result event)
|
|
215
216
|
* - mark:unarchive → resource.unarchived (resource-scoped, no result event)
|
|
216
|
-
* -
|
|
217
|
+
* - frame:add-entity-type → entitytype.added → frame:entity-type-added / frame:entity-type-add-failed
|
|
217
218
|
* - mark:update-entity-types → entitytag.added / entitytag.removed
|
|
218
219
|
* - job:start → job.started
|
|
219
220
|
* - job:complete → job.completed
|
|
@@ -474,15 +475,13 @@ declare function startMakeMeaning(project: SemiontProject, config: MakeMeaningCo
|
|
|
474
475
|
* and forwards each onto `clientBus`.
|
|
475
476
|
* - The bus reference flows client → transport, never the other way.
|
|
476
477
|
*
|
|
477
|
-
* Auth, admin, and exchange
|
|
478
|
-
*
|
|
479
|
-
*
|
|
478
|
+
* LocalTransport implements `ITransport` only. Auth, admin, and exchange
|
|
479
|
+
* (`IBackendOperations`) are HTTP-shaped concepts that don't apply
|
|
480
|
+
* in-process — local mode runs as a single host-process identity supplied
|
|
481
|
+
* at construction, with no token/credential lifecycle. A `SemiontClient`
|
|
482
|
+
* built over this transport has no `.auth` / `.admin` namespaces.
|
|
480
483
|
*/
|
|
481
484
|
|
|
482
|
-
type AuthResponse = components['schemas']['AuthResponse'];
|
|
483
|
-
type TokenRefreshResponse = components['schemas']['TokenRefreshResponse'];
|
|
484
|
-
type AdminUserStatsResponse = components['schemas']['AdminUserStatsResponse'];
|
|
485
|
-
type OAuthConfigResponse = components['schemas']['OAuthConfigResponse'];
|
|
486
485
|
interface LocalTransportConfig {
|
|
487
486
|
/**
|
|
488
487
|
* The in-process knowledge system. Lifetime is owned by the caller —
|
|
@@ -512,6 +511,18 @@ interface LocalTransportConfig {
|
|
|
512
511
|
declare class LocalTransport implements ITransport {
|
|
513
512
|
readonly baseUrl: BaseUrl;
|
|
514
513
|
readonly state$: BehaviorSubject<ConnectionState>;
|
|
514
|
+
private readonly errorsSubject;
|
|
515
|
+
/**
|
|
516
|
+
* Stream of `SemiontError` instances surfaced from transport-mediated
|
|
517
|
+
* round-trips (typed-wire methods on this transport that fail). The
|
|
518
|
+
* in-process implementation does not currently surface errors through
|
|
519
|
+
* this stream — most failures here originate inside the make-meaning
|
|
520
|
+
* actors and surface through bus channels (correlation-ID failures via
|
|
521
|
+
* `busRequest`). The Subject exists to satisfy the `ITransport`
|
|
522
|
+
* contract; future expansion (e.g. transport-level guard failures)
|
|
523
|
+
* can publish into it.
|
|
524
|
+
*/
|
|
525
|
+
readonly errors$: Observable<SemiontError>;
|
|
515
526
|
private readonly bus;
|
|
516
527
|
private readonly userId;
|
|
517
528
|
private readonly bridges;
|
|
@@ -523,30 +534,6 @@ declare class LocalTransport implements ITransport {
|
|
|
523
534
|
stream<K extends keyof EventMap>(channel: K): Observable<EventMap[K]>;
|
|
524
535
|
subscribeToResource(_resourceId: ResourceId): () => void;
|
|
525
536
|
bridgeInto(bus: EventBus): void;
|
|
526
|
-
authenticatePassword(_email: Email, _password: string): Promise<AuthResponse>;
|
|
527
|
-
authenticateGoogle(_credential: GoogleCredential): Promise<AuthResponse>;
|
|
528
|
-
refreshAccessToken(_token: RefreshToken): Promise<TokenRefreshResponse>;
|
|
529
|
-
logout(): Promise<void>;
|
|
530
|
-
acceptTerms(): Promise<void>;
|
|
531
|
-
getCurrentUser(): Promise<UserResponse>;
|
|
532
|
-
generateMcpToken(): Promise<{
|
|
533
|
-
token: string;
|
|
534
|
-
}>;
|
|
535
|
-
getMediaToken(_resourceId: ResourceId): Promise<{
|
|
536
|
-
token: string;
|
|
537
|
-
}>;
|
|
538
|
-
listUsers(): Promise<ListUsersResponse>;
|
|
539
|
-
getUserStats(): Promise<AdminUserStatsResponse>;
|
|
540
|
-
updateUser(_id: UserDID, _data: UpdateUserRequest): Promise<UpdateUserResponse>;
|
|
541
|
-
getOAuthConfig(): Promise<OAuthConfigResponse>;
|
|
542
|
-
backupKnowledgeBase(): Promise<Response>;
|
|
543
|
-
restoreKnowledgeBase(_file: File, _onProgress?: ProgressCallback): Promise<ProgressEvent>;
|
|
544
|
-
exportKnowledgeBase(_params?: {
|
|
545
|
-
includeArchived?: boolean;
|
|
546
|
-
}): Promise<Response>;
|
|
547
|
-
importKnowledgeBase(_file: File, _onProgress?: ProgressCallback): Promise<ProgressEvent>;
|
|
548
|
-
healthCheck(): Promise<HealthCheckResponse>;
|
|
549
|
-
getStatus(): Promise<StatusResponse>;
|
|
550
537
|
dispose(): void;
|
|
551
538
|
}
|
|
552
539
|
|
|
@@ -568,9 +555,7 @@ declare class LocalTransport implements ITransport {
|
|
|
568
555
|
declare class LocalContentTransport implements IContentTransport {
|
|
569
556
|
private readonly ks;
|
|
570
557
|
constructor(ks: KnowledgeSystem);
|
|
571
|
-
putBinary(_request: PutBinaryRequest, _options?: {
|
|
572
|
-
auth?: AccessToken;
|
|
573
|
-
}): Promise<{
|
|
558
|
+
putBinary(_request: PutBinaryRequest, _options?: PutBinaryOptions): Promise<{
|
|
574
559
|
resourceId: ResourceId;
|
|
575
560
|
}>;
|
|
576
561
|
getBinary(resourceId: ResourceId, options?: {
|
|
@@ -657,7 +642,7 @@ declare function registerBusHandlers(eventBus: EventBus, knowledgeSystem: Knowle
|
|
|
657
642
|
* Entity Types Bootstrap
|
|
658
643
|
*
|
|
659
644
|
* On startup, seeds the KB with DEFAULT_ENTITY_TYPES by emitting
|
|
660
|
-
*
|
|
645
|
+
* frame:add-entity-type for each missing type. Reads the __system__ event
|
|
661
646
|
* stream (the durable source of truth in .semiont/events/) to determine
|
|
662
647
|
* which types already exist.
|
|
663
648
|
*
|
|
@@ -673,7 +658,7 @@ declare function registerBusHandlers(eventBus: EventBus, knowledgeSystem: Knowle
|
|
|
673
658
|
|
|
674
659
|
/**
|
|
675
660
|
* Bootstrap entity types if any are missing from the event log.
|
|
676
|
-
* Reads the __system__ stream to find existing
|
|
661
|
+
* Reads the __system__ stream to find existing frame:entity-type-added events,
|
|
677
662
|
* then emits only the missing ones.
|
|
678
663
|
*/
|
|
679
664
|
declare function bootstrapEntityTypes(eventBus: EventBus, eventStore: EventStore, logger?: Logger): Promise<void>;
|
|
@@ -690,6 +675,36 @@ declare function bootstrapEntityTypes(eventBus: EventBus, eventStore: EventStore
|
|
|
690
675
|
*/
|
|
691
676
|
declare function readEntityTypesProjection(project: SemiontProject): Promise<string[]>;
|
|
692
677
|
|
|
678
|
+
/**
|
|
679
|
+
* SmelterActorStateUnit — domain-event fan-in for the Smelter worker.
|
|
680
|
+
*
|
|
681
|
+
* Subscribes to the six smelter-relevant channels on a shared bus and
|
|
682
|
+
* exposes them as a single typed `events$` stream. Transport-neutral —
|
|
683
|
+
* the caller passes a `WorkerBus` (HTTP `ActorStateUnit` today, an in-process
|
|
684
|
+
* bus shim if/when one exists). The state unit does not own the bus and does
|
|
685
|
+
* not dispose it.
|
|
686
|
+
*
|
|
687
|
+
* `start()` widens the bus's channel-subscription set to include the
|
|
688
|
+
* smelter channels. On HTTP this extends the SSE subscription URL;
|
|
689
|
+
* on an in-process bus this is a no-op (the underlying `EventBus`
|
|
690
|
+
* already delivers every emit).
|
|
691
|
+
*/
|
|
692
|
+
|
|
693
|
+
interface SmelterEvent {
|
|
694
|
+
type: string;
|
|
695
|
+
resourceId?: string;
|
|
696
|
+
payload: Record<string, unknown>;
|
|
697
|
+
}
|
|
698
|
+
interface SmelterActorStateUnitOptions {
|
|
699
|
+
bus: WorkerBus;
|
|
700
|
+
}
|
|
701
|
+
interface SmelterActorStateUnit extends StateUnit {
|
|
702
|
+
events$: Observable<SmelterEvent>;
|
|
703
|
+
emit(channel: string, payload: Record<string, unknown>): Promise<void>;
|
|
704
|
+
start(): void;
|
|
705
|
+
}
|
|
706
|
+
declare function createSmelterActorStateUnit(options: SmelterActorStateUnitOptions): SmelterActorStateUnit;
|
|
707
|
+
|
|
693
708
|
/**
|
|
694
709
|
* Exchange Format Manifest Types
|
|
695
710
|
*
|
|
@@ -901,7 +916,7 @@ interface LinkedDataImportResult {
|
|
|
901
916
|
* 1. Stream and decompress tar.gz entries
|
|
902
917
|
* 2. Parse .semiont/manifest.jsonld → validate format
|
|
903
918
|
* 3. Build blob resolver over root-level content entries
|
|
904
|
-
* 4. Add entity types from manifest via
|
|
919
|
+
* 4. Add entity types from manifest via frame:add-entity-type
|
|
905
920
|
* 5. For each .semiont/resources/{id}.jsonld:
|
|
906
921
|
* a. Parse JSON-LD document
|
|
907
922
|
* b. Resolve content blob by checksum from representations
|
|
@@ -1222,4 +1237,4 @@ declare function generateReferenceSuggestions(referenceTitle: string, client: In
|
|
|
1222
1237
|
declare const PACKAGE_NAME = "@semiont/make-meaning";
|
|
1223
1238
|
declare const VERSION = "0.1.0";
|
|
1224
1239
|
|
|
1225
|
-
export { AnnotationContext, AnnotationOperations, BACKUP_FORMAT, type BackupContentReader, type BackupEventStoreReader, type BackupExporterOptions, type BackupImportResult, type BackupImporterOptions, type BackupManifestHeader, type BackupStreamSummary, Browser, type BuildContextOptions, CloneTokenManager, type ContentBlobResolver, type CreateAnnotationResult, type CreateResourceInput, type CreateResourceResult, FORMAT_VERSION, Gatherer$1 as Gatherer, GraphContext, type GraphEdge, type GraphNode, type GraphRepresentation, type KnowledgeBase, type KnowledgeSystem, LLMContext, type LLMContextOptions, type LinkedDataContentReader, type LinkedDataExporterOptions, type LinkedDataImportResult, type LinkedDataImporterOptions, type LinkedDataViewReader, type ListResourcesFilters, LocalContentTransport, LocalTransport, type LocalTransportConfig, type MakeMeaningConfig, type MakeMeaningService, Matcher, PACKAGE_NAME, type ReplayStats, ResourceContext, ResourceOperations, Stower, type UpdateAnnotationBodyResult, VERSION, bootstrapEntityTypes, createKnowledgeBase, exportBackup, exportLinkedData, generateReferenceSuggestions, generateResourceSummary, importBackup, importLinkedData, isBackupManifest, readEntityTypesProjection, registerAnnotationAssemblyHandler, registerAnnotationLookupHandlers, registerBindUpdateBodyHandler, registerBusHandlers, registerJobCommandHandlers, startMakeMeaning, stopKnowledgeSystem, validateManifestVersion };
|
|
1240
|
+
export { AnnotationContext, AnnotationOperations, BACKUP_FORMAT, type BackupContentReader, type BackupEventStoreReader, type BackupExporterOptions, type BackupImportResult, type BackupImporterOptions, type BackupManifestHeader, type BackupStreamSummary, Browser, type BuildContextOptions, CloneTokenManager, type ContentBlobResolver, type CreateAnnotationResult, type CreateResourceInput, type CreateResourceResult, FORMAT_VERSION, Gatherer$1 as Gatherer, GraphContext, type GraphEdge, type GraphNode, type GraphRepresentation, type KnowledgeBase, type KnowledgeSystem, LLMContext, type LLMContextOptions, type LinkedDataContentReader, type LinkedDataExporterOptions, type LinkedDataImportResult, type LinkedDataImporterOptions, type LinkedDataViewReader, type ListResourcesFilters, LocalContentTransport, LocalTransport, type LocalTransportConfig, type MakeMeaningConfig, type MakeMeaningService, Matcher, PACKAGE_NAME, type ReplayStats, ResourceContext, ResourceOperations, type SmelterActorStateUnit, type SmelterActorStateUnitOptions, type SmelterEvent, Stower, type UpdateAnnotationBodyResult, VERSION, bootstrapEntityTypes, createKnowledgeBase, createSmelterActorStateUnit, exportBackup, exportLinkedData, generateReferenceSuggestions, generateResourceSummary, importBackup, importLinkedData, isBackupManifest, readEntityTypesProjection, registerAnnotationAssemblyHandler, registerAnnotationLookupHandlers, registerBindUpdateBodyHandler, registerBusHandlers, registerJobCommandHandlers, startMakeMeaning, stopKnowledgeSystem, validateManifestVersion };
|