@semiont/make-meaning 0.4.21 → 0.4.22
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 +215 -41
- package/dist/index.js +758 -257
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { JobQueue } from '@semiont/jobs';
|
|
2
2
|
import { SemiontProject } from '@semiont/core/node';
|
|
3
|
-
import { GraphServiceConfig, VectorsServiceConfig, EmbeddingServiceConfig, EventBus, Logger, StoredEvent, ResourceId,
|
|
3
|
+
import { GraphServiceConfig, VectorsServiceConfig, EmbeddingServiceConfig, EventBus, Logger, StoredEvent, ResourceId, ResourceDescriptor, AnnotationId, components, ITransport, BaseUrl, ConnectionState, UserDID, EventMap, Email, GoogleCredential, RefreshToken, UserResponse, ListUsersResponse, UpdateUserRequest, UpdateUserResponse, ProgressCallback, ProgressEvent, HealthCheckResponse, StatusResponse, IContentTransport, PutBinaryRequest, AccessToken, ContentFormat as ContentFormat$1, 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';
|
|
7
7
|
import { GraphDatabase } from '@semiont/graph';
|
|
8
8
|
import { VectorStore, EmbeddingProvider } from '@semiont/vectors';
|
|
9
9
|
import { InferenceClient } from '@semiont/inference';
|
|
10
|
+
import { BehaviorSubject, Observable } from 'rxjs';
|
|
10
11
|
import { Writable, Readable } from 'node:stream';
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -225,10 +226,9 @@ declare function createKnowledgeBase(eventStore: EventStore, project: SemiontPro
|
|
|
225
226
|
* progress; the event log keeps only the durable lifecycle boundaries.
|
|
226
227
|
*/
|
|
227
228
|
|
|
228
|
-
type ResourceDescriptor$3 = components['schemas']['ResourceDescriptor'];
|
|
229
229
|
interface CreateResourceResult {
|
|
230
230
|
resourceId: ResourceId;
|
|
231
|
-
resource: ResourceDescriptor
|
|
231
|
+
resource: ResourceDescriptor;
|
|
232
232
|
}
|
|
233
233
|
declare class Stower {
|
|
234
234
|
private kb;
|
|
@@ -279,7 +279,7 @@ declare class Stower {
|
|
|
279
279
|
* by RPC-style services.
|
|
280
280
|
*/
|
|
281
281
|
|
|
282
|
-
declare class Gatherer {
|
|
282
|
+
declare class Gatherer$1 {
|
|
283
283
|
private kb;
|
|
284
284
|
private eventBus;
|
|
285
285
|
private inferenceClient;
|
|
@@ -437,7 +437,7 @@ declare class CloneTokenManager {
|
|
|
437
437
|
interface KnowledgeSystem {
|
|
438
438
|
kb: KnowledgeBase;
|
|
439
439
|
stower: Stower;
|
|
440
|
-
gatherer: Gatherer;
|
|
440
|
+
gatherer: Gatherer$1;
|
|
441
441
|
matcher: Matcher;
|
|
442
442
|
browser: Browser;
|
|
443
443
|
cloneTokenManager: CloneTokenManager;
|
|
@@ -461,6 +461,198 @@ declare function startMakeMeaning(project: SemiontProject, config: MakeMeaningCo
|
|
|
461
461
|
skipRebuild?: boolean;
|
|
462
462
|
}): Promise<MakeMeaningService>;
|
|
463
463
|
|
|
464
|
+
/**
|
|
465
|
+
* LocalTransport — `ITransport` for an in-process `KnowledgeSystem`.
|
|
466
|
+
*
|
|
467
|
+
* Bus-ownership pattern (see `packages/core/docs/TRANSPORT-CONTRACT.md`):
|
|
468
|
+
* - The caller owns a make-meaning `EventBus` and passes it to both
|
|
469
|
+
* `startMakeMeaning` and `LocalTransport` so the transport can publish
|
|
470
|
+
* directly onto the bus the `KnowledgeSystem` actors are listening on.
|
|
471
|
+
* - `SemiontClient` constructs its own `clientBus` and calls
|
|
472
|
+
* `bridgeInto(clientBus)` during construction. `LocalTransport`
|
|
473
|
+
* subscribes to every `BRIDGED_CHANNELS` entry on the make-meaning bus
|
|
474
|
+
* and forwards each onto `clientBus`.
|
|
475
|
+
* - The bus reference flows client → transport, never the other way.
|
|
476
|
+
*
|
|
477
|
+
* Auth, admin, and exchange methods are not implemented in Phase 2 — local
|
|
478
|
+
* mode runs as a single host-process identity supplied at construction.
|
|
479
|
+
* Calling them throws.
|
|
480
|
+
*/
|
|
481
|
+
|
|
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
|
+
interface LocalTransportConfig {
|
|
487
|
+
/**
|
|
488
|
+
* The in-process knowledge system. Lifetime is owned by the caller —
|
|
489
|
+
* `dispose()` on this transport does not stop the KnowledgeSystem.
|
|
490
|
+
*/
|
|
491
|
+
knowledgeSystem: KnowledgeSystem;
|
|
492
|
+
/**
|
|
493
|
+
* The make-meaning `EventBus`. Must be the same instance passed to
|
|
494
|
+
* `startMakeMeaning` so that emits land on the bus KnowledgeSystem
|
|
495
|
+
* actors are subscribed to.
|
|
496
|
+
*/
|
|
497
|
+
eventBus: EventBus;
|
|
498
|
+
/**
|
|
499
|
+
* Host-process identity. Stamped onto every emit as `_userId`, mirroring
|
|
500
|
+
* the gateway-injection convention used by `HttpTransport` (where the
|
|
501
|
+
* `/bus/emit` gateway reads the JWT subject and injects `_userId`).
|
|
502
|
+
* Handlers downstream trust nothing else.
|
|
503
|
+
*/
|
|
504
|
+
userId: UserDID;
|
|
505
|
+
/**
|
|
506
|
+
* Cosmetic base URL for diagnostics and URL composition. Defaults to
|
|
507
|
+
* `local://in-process`. Local code never makes outgoing HTTP requests
|
|
508
|
+
* with it.
|
|
509
|
+
*/
|
|
510
|
+
baseUrl?: BaseUrl;
|
|
511
|
+
}
|
|
512
|
+
declare class LocalTransport implements ITransport {
|
|
513
|
+
readonly baseUrl: BaseUrl;
|
|
514
|
+
readonly state$: BehaviorSubject<ConnectionState>;
|
|
515
|
+
private readonly bus;
|
|
516
|
+
private readonly userId;
|
|
517
|
+
private readonly bridges;
|
|
518
|
+
private readonly bridgeSubs;
|
|
519
|
+
private disposed;
|
|
520
|
+
constructor(cfg: LocalTransportConfig);
|
|
521
|
+
emit<K extends keyof EventMap>(channel: K, payload: EventMap[K], resourceScope?: ResourceId): Promise<void>;
|
|
522
|
+
on<K extends keyof EventMap>(channel: K, handler: (payload: EventMap[K]) => void): () => void;
|
|
523
|
+
stream<K extends keyof EventMap>(channel: K): Observable<EventMap[K]>;
|
|
524
|
+
subscribeToResource(_resourceId: ResourceId): () => void;
|
|
525
|
+
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
|
+
dispose(): void;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* LocalContentTransport — `IContentTransport` for an in-process
|
|
555
|
+
* `KnowledgeSystem`.
|
|
556
|
+
*
|
|
557
|
+
* Reads go straight to `kb.views` (resource lookup) + `kb.content`
|
|
558
|
+
* (byte retrieval). No network, no auth — local mode runs as a single
|
|
559
|
+
* host-process identity.
|
|
560
|
+
*
|
|
561
|
+
* `putBinary` is intentionally not implemented in Phase 2: in-process
|
|
562
|
+
* resource creation is exercised through bus emits (mark/yield
|
|
563
|
+
* namespaces), not multipart upload. If a future caller needs raw
|
|
564
|
+
* binary upload from a local context, wire it through the same
|
|
565
|
+
* resource-creation pipeline the HTTP `/resources` handler uses.
|
|
566
|
+
*/
|
|
567
|
+
|
|
568
|
+
declare class LocalContentTransport implements IContentTransport {
|
|
569
|
+
private readonly ks;
|
|
570
|
+
constructor(ks: KnowledgeSystem);
|
|
571
|
+
putBinary(_request: PutBinaryRequest, _options?: {
|
|
572
|
+
auth?: AccessToken;
|
|
573
|
+
}): Promise<{
|
|
574
|
+
resourceId: ResourceId;
|
|
575
|
+
}>;
|
|
576
|
+
getBinary(resourceId: ResourceId, options?: {
|
|
577
|
+
accept?: ContentFormat$1 | string;
|
|
578
|
+
auth?: AccessToken;
|
|
579
|
+
}): Promise<{
|
|
580
|
+
data: ArrayBuffer;
|
|
581
|
+
contentType: string;
|
|
582
|
+
}>;
|
|
583
|
+
getBinaryStream(resourceId: ResourceId, options?: {
|
|
584
|
+
accept?: ContentFormat$1 | string;
|
|
585
|
+
auth?: AccessToken;
|
|
586
|
+
}): Promise<{
|
|
587
|
+
stream: ReadableStream<Uint8Array>;
|
|
588
|
+
contentType: string;
|
|
589
|
+
}>;
|
|
590
|
+
private loadBinary;
|
|
591
|
+
dispose(): void;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* Handles `mark:create-request` — the bus command for creating an annotation.
|
|
596
|
+
*
|
|
597
|
+
* Flow:
|
|
598
|
+
* 1. Assemble the W3C annotation from the request using the injected user DID.
|
|
599
|
+
* 2. Emit `mark:create` with the correlationId threaded through.
|
|
600
|
+
* 3. Stower picks up `mark:create`, appends to the event store (threading
|
|
601
|
+
* correlationId into event metadata), and publishes `mark:added` on the
|
|
602
|
+
* core EventBus.
|
|
603
|
+
* 4. This handler subscribes to `mark:added` and `mark:create-failed`,
|
|
604
|
+
* matches by correlationId, and emits `mark:create-ok` / `mark:create-failed`
|
|
605
|
+
* to the caller only after persistence has actually completed.
|
|
606
|
+
*
|
|
607
|
+
* This is a deferred-ack pattern: the result event attests that Stower has
|
|
608
|
+
* persisted the annotation, not merely that the command was well-formed.
|
|
609
|
+
*/
|
|
610
|
+
declare function registerAnnotationAssemblyHandler(eventBus: EventBus, parentLogger: Logger): void;
|
|
611
|
+
|
|
612
|
+
interface Gatherer {
|
|
613
|
+
generateAnnotationSummary(annId: AnnotationId, resId: ResourceId): Promise<Record<string, unknown>>;
|
|
614
|
+
}
|
|
615
|
+
declare function registerAnnotationLookupHandlers(eventBus: EventBus, kb: KnowledgeBase, gatherer: Gatherer, parentLogger: Logger): void;
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* Handles `bind:update-body` — the Bind flow's authoritative "apply body
|
|
619
|
+
* operations to an annotation" command. Bind remains a first-class flow
|
|
620
|
+
* despite delegating persistence to Mark — the semantic distinction (Bind =
|
|
621
|
+
* reference linking, Mark = annotation CRUD) is meaningful at the UX and
|
|
622
|
+
* agent-reasoning layers even when the downstream storage event is shared.
|
|
623
|
+
*
|
|
624
|
+
* Flow:
|
|
625
|
+
* 1. Receive bind:update-body with correlationId.
|
|
626
|
+
* 2. Forward to mark:update-body with correlationId threaded through.
|
|
627
|
+
* 3. Stower persists (via EventStore.appendEvent) and publishes mark:body-updated
|
|
628
|
+
* with correlationId in metadata.
|
|
629
|
+
* 4. This handler subscribes to mark:body-updated and mark:body-update-failed,
|
|
630
|
+
* matches by correlationId, and emits bind:body-updated / bind:body-update-failed
|
|
631
|
+
* so the caller learns the real outcome — not an optimistic ack.
|
|
632
|
+
*/
|
|
633
|
+
declare function registerBindUpdateBodyHandler(eventBus: EventBus, parentLogger: Logger): void;
|
|
634
|
+
|
|
635
|
+
declare function registerJobCommandHandlers(eventBus: EventBus, jobQueue: JobQueue, parentLogger: Logger): void;
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* Bus command handlers — pure bus-event translators that bridge the
|
|
639
|
+
* "request" channels callers emit (`mark:create-request`, `bind:update-body`,
|
|
640
|
+
* `job:create`, `browse:annotation-context-requested`,
|
|
641
|
+
* `gather:summary-requested`) to the underlying make-meaning pipeline
|
|
642
|
+
* (Stower, Browser, Gatherer, JobQueue).
|
|
643
|
+
*
|
|
644
|
+
* These ran in `apps/backend` historically because the HTTP gateway was
|
|
645
|
+
* the only consumer that needed them. They are not HTTP-specific — moving
|
|
646
|
+
* them here means `LocalTransport` consumers (and any future transport)
|
|
647
|
+
* get the same contract automatically.
|
|
648
|
+
*/
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* Register all bus command handlers on the make-meaning EventBus. Called
|
|
652
|
+
* during `startMakeMeaning` after the JobQueue and KnowledgeSystem exist.
|
|
653
|
+
*/
|
|
654
|
+
declare function registerBusHandlers(eventBus: EventBus, knowledgeSystem: KnowledgeSystem, jobQueue: JobQueue, logger: Logger): void;
|
|
655
|
+
|
|
464
656
|
/**
|
|
465
657
|
* Entity Types Bootstrap
|
|
466
658
|
*
|
|
@@ -652,14 +844,12 @@ declare function importBackup(archive: Readable, options: BackupImporterOptions)
|
|
|
652
844
|
* {checksum}.{ext} - Content blobs (root level)
|
|
653
845
|
*/
|
|
654
846
|
|
|
655
|
-
type ResourceDescriptor$2 = components['schemas']['ResourceDescriptor'];
|
|
656
|
-
type Annotation$3 = components['schemas']['Annotation'];
|
|
657
847
|
/** Subset of ViewStorage used by the linked-data exporter. */
|
|
658
848
|
interface LinkedDataViewReader {
|
|
659
849
|
getAll(): Promise<Array<{
|
|
660
|
-
resource: ResourceDescriptor
|
|
850
|
+
resource: ResourceDescriptor;
|
|
661
851
|
annotations: {
|
|
662
|
-
annotations: Annotation
|
|
852
|
+
annotations: Annotation[];
|
|
663
853
|
};
|
|
664
854
|
}>>;
|
|
665
855
|
}
|
|
@@ -727,20 +917,10 @@ declare function importLinkedData(archive: Readable, options: LinkedDataImporter
|
|
|
727
917
|
* — the Stower actor subscribes and handles persistence.
|
|
728
918
|
*
|
|
729
919
|
* For create: emits yield:create, awaits yield:created / yield:create-failed.
|
|
730
|
-
* For archive/unarchive: emits mark:archive / mark:unarchive on scoped bus.
|
|
731
|
-
* For entity type updates: emits mark:update-entity-types.
|
|
732
920
|
*/
|
|
733
921
|
|
|
734
922
|
type ContentFormat = components['schemas']['ContentFormat'];
|
|
735
923
|
type Agent$1 = components['schemas']['Agent'];
|
|
736
|
-
interface UpdateResourceInput {
|
|
737
|
-
resourceId: ResourceId;
|
|
738
|
-
userId: UserId;
|
|
739
|
-
currentArchived?: boolean;
|
|
740
|
-
updatedArchived?: boolean;
|
|
741
|
-
currentEntityTypes?: string[];
|
|
742
|
-
updatedEntityTypes?: string[];
|
|
743
|
-
}
|
|
744
924
|
interface CreateResourceInput {
|
|
745
925
|
name: string;
|
|
746
926
|
storageUri: string;
|
|
@@ -764,10 +944,6 @@ declare class ResourceOperations {
|
|
|
764
944
|
* Create a new resource via EventBus → Stower
|
|
765
945
|
*/
|
|
766
946
|
static createResource(input: CreateResourceInput, userId: UserId, eventBus: EventBus): Promise<ResourceId>;
|
|
767
|
-
/**
|
|
768
|
-
* Update resource metadata via EventBus → Stower
|
|
769
|
-
*/
|
|
770
|
-
static updateResource(input: UpdateResourceInput, eventBus: EventBus): Promise<void>;
|
|
771
947
|
}
|
|
772
948
|
|
|
773
949
|
/**
|
|
@@ -776,20 +952,21 @@ declare class ResourceOperations {
|
|
|
776
952
|
* Business logic for annotation CRUD operations. All writes go through the
|
|
777
953
|
* EventBus — the Stower actor subscribes and handles persistence.
|
|
778
954
|
*
|
|
779
|
-
* -
|
|
780
|
-
*
|
|
781
|
-
*
|
|
955
|
+
* In-process callers pass a `UserId` to these operations; the
|
|
956
|
+
* EventBus emits stamp it onto the gateway-injection field `_userId`,
|
|
957
|
+
* matching the wire-side convention so Stower handlers see one shape
|
|
958
|
+
* regardless of where the command originated.
|
|
782
959
|
*/
|
|
783
960
|
|
|
784
961
|
type Agent = components['schemas']['Agent'];
|
|
785
|
-
|
|
962
|
+
|
|
786
963
|
type CreateAnnotationRequest = components['schemas']['CreateAnnotationRequest'];
|
|
787
964
|
type UpdateAnnotationBodyRequest = components['schemas']['UpdateAnnotationBodyRequest'];
|
|
788
965
|
interface CreateAnnotationResult {
|
|
789
|
-
annotation: Annotation
|
|
966
|
+
annotation: Annotation;
|
|
790
967
|
}
|
|
791
968
|
interface UpdateAnnotationBodyResult {
|
|
792
|
-
annotation: Annotation
|
|
969
|
+
annotation: Annotation;
|
|
793
970
|
}
|
|
794
971
|
declare class AnnotationOperations {
|
|
795
972
|
/**
|
|
@@ -813,7 +990,6 @@ declare class AnnotationOperations {
|
|
|
813
990
|
* Does NOT touch the graph - graph queries go through GraphContext
|
|
814
991
|
*/
|
|
815
992
|
|
|
816
|
-
type ResourceDescriptor$1 = components['schemas']['ResourceDescriptor'];
|
|
817
993
|
interface ListResourcesFilters {
|
|
818
994
|
search?: string;
|
|
819
995
|
archived?: boolean;
|
|
@@ -822,7 +998,7 @@ declare class ResourceContext {
|
|
|
822
998
|
/**
|
|
823
999
|
* Get resource metadata from view storage
|
|
824
1000
|
*/
|
|
825
|
-
static getResourceMetadata(resourceId: ResourceId, kb: KnowledgeBase): Promise<ResourceDescriptor
|
|
1001
|
+
static getResourceMetadata(resourceId: ResourceId, kb: KnowledgeBase): Promise<ResourceDescriptor | null>;
|
|
826
1002
|
/**
|
|
827
1003
|
* List resources, optionally filtered.
|
|
828
1004
|
*
|
|
@@ -833,20 +1009,20 @@ declare class ResourceContext {
|
|
|
833
1009
|
* When `search` is unset, falls back to scanning all materialized views.
|
|
834
1010
|
* (TODO: also push the listing path through the graph for large KBs.)
|
|
835
1011
|
*/
|
|
836
|
-
static listResources(filters: ListResourcesFilters | undefined, kb: KnowledgeBase): Promise<ResourceDescriptor
|
|
1012
|
+
static listResources(filters: ListResourcesFilters | undefined, kb: KnowledgeBase): Promise<ResourceDescriptor[]>;
|
|
837
1013
|
private static sortByDateDesc;
|
|
838
1014
|
/**
|
|
839
1015
|
* Add content previews to resources (for search results)
|
|
840
1016
|
* Retrieves and decodes the first 200 characters of each resource's primary representation
|
|
841
1017
|
*/
|
|
842
|
-
static addContentPreviews(resources: ResourceDescriptor
|
|
1018
|
+
static addContentPreviews(resources: ResourceDescriptor[], kb: KnowledgeBase): Promise<Array<ResourceDescriptor & {
|
|
843
1019
|
content: string;
|
|
844
1020
|
}>>;
|
|
845
1021
|
/**
|
|
846
1022
|
* Get full content for a resource
|
|
847
1023
|
* Retrieves and decodes the primary representation
|
|
848
1024
|
*/
|
|
849
|
-
static getResourceContent(resource: ResourceDescriptor
|
|
1025
|
+
static getResourceContent(resource: ResourceDescriptor, kb: KnowledgeBase): Promise<string | undefined>;
|
|
850
1026
|
}
|
|
851
1027
|
|
|
852
1028
|
/**
|
|
@@ -861,7 +1037,7 @@ declare class ResourceContext {
|
|
|
861
1037
|
*/
|
|
862
1038
|
|
|
863
1039
|
type AnnotationLLMContextResponse = components['schemas']['AnnotationLLMContextResponse'];
|
|
864
|
-
|
|
1040
|
+
|
|
865
1041
|
type AnnotationContextResponse = components['schemas']['AnnotationContextResponse'];
|
|
866
1042
|
type ContextualSummaryResponse = components['schemas']['ContextualSummaryResponse'];
|
|
867
1043
|
interface BuildContextOptions {
|
|
@@ -891,7 +1067,7 @@ declare class AnnotationContext {
|
|
|
891
1067
|
* Get all annotations
|
|
892
1068
|
* @returns Array of all annotation objects
|
|
893
1069
|
*/
|
|
894
|
-
static getAllAnnotations(resourceId: ResourceId, kb: KnowledgeBase): Promise<Annotation
|
|
1070
|
+
static getAllAnnotations(resourceId: ResourceId, kb: KnowledgeBase): Promise<Annotation[]>;
|
|
895
1071
|
/**
|
|
896
1072
|
* Enrich reference annotations with resolved document names
|
|
897
1073
|
* Adds _resolvedDocumentName property to annotations that link to documents
|
|
@@ -915,7 +1091,7 @@ declare class AnnotationContext {
|
|
|
915
1091
|
* Get a single annotation by ID
|
|
916
1092
|
* O(1) lookup using resource ID to access view storage
|
|
917
1093
|
*/
|
|
918
|
-
static getAnnotation(annotationId: AnnotationId, resourceId: ResourceId, kb: KnowledgeBase): Promise<Annotation
|
|
1094
|
+
static getAnnotation(annotationId: AnnotationId, resourceId: ResourceId, kb: KnowledgeBase): Promise<Annotation | null>;
|
|
919
1095
|
/**
|
|
920
1096
|
* List annotations with optional filtering
|
|
921
1097
|
* @param filters - Optional filters like resourceId and type
|
|
@@ -924,7 +1100,7 @@ declare class AnnotationContext {
|
|
|
924
1100
|
static listAnnotations(filters: {
|
|
925
1101
|
resourceId?: ResourceId;
|
|
926
1102
|
type?: AnnotationCategory;
|
|
927
|
-
} | undefined, kb: KnowledgeBase): Promise<Annotation
|
|
1103
|
+
} | undefined, kb: KnowledgeBase): Promise<Annotation[]>;
|
|
928
1104
|
/**
|
|
929
1105
|
* Get annotation context (selected text with surrounding context)
|
|
930
1106
|
*/
|
|
@@ -955,8 +1131,6 @@ declare class AnnotationContext {
|
|
|
955
1131
|
* All methods require graph traversal - must use graph database.
|
|
956
1132
|
*/
|
|
957
1133
|
|
|
958
|
-
type Annotation = components['schemas']['Annotation'];
|
|
959
|
-
type ResourceDescriptor = components['schemas']['ResourceDescriptor'];
|
|
960
1134
|
interface GraphNode {
|
|
961
1135
|
id: string;
|
|
962
1136
|
type: string;
|
|
@@ -1048,4 +1222,4 @@ declare function generateReferenceSuggestions(referenceTitle: string, client: In
|
|
|
1048
1222
|
declare const PACKAGE_NAME = "@semiont/make-meaning";
|
|
1049
1223
|
declare const VERSION = "0.1.0";
|
|
1050
1224
|
|
|
1051
|
-
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, 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, type MakeMeaningConfig, type MakeMeaningService, Matcher, PACKAGE_NAME, type ReplayStats, ResourceContext, ResourceOperations, Stower, type UpdateAnnotationBodyResult,
|
|
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 };
|