@semiont/core 0.5.9 → 0.5.10

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 CHANGED
@@ -1814,17 +1814,6 @@ interface components {
1814
1814
  };
1815
1815
  resource: components["schemas"]["ResourceDescriptor"];
1816
1816
  };
1817
- AnnotationLLMContextResponse: {
1818
- annotation: components["schemas"]["Annotation"];
1819
- sourceResource: components["schemas"]["ResourceDescriptor"];
1820
- targetResource?: components["schemas"]["ResourceDescriptor"] | null;
1821
- /** @description Gathered context for this annotation */
1822
- context?: components["schemas"]["GatheredContext"];
1823
- targetContext?: {
1824
- content: string;
1825
- summary?: string;
1826
- };
1827
- };
1828
1817
  /** @description W3C Web Annotation target object - source is required, selector is optional */
1829
1818
  AnnotationTarget: {
1830
1819
  /** @description IRI of the resource being annotated */
@@ -1994,22 +1983,7 @@ interface components {
1994
1983
  };
1995
1984
  CreateAnnotationRequest: {
1996
1985
  motivation: components["schemas"]["Motivation"];
1997
- target: {
1998
- source: string;
1999
- selector: components["schemas"]["TextPositionSelector"] | {
2000
- /** @enum {string} */
2001
- type: "TextQuoteSelector";
2002
- exact: string;
2003
- prefix?: string;
2004
- suffix?: string;
2005
- } | components["schemas"]["SvgSelector"] | components["schemas"]["FragmentSelector"] | (components["schemas"]["TextPositionSelector"] | {
2006
- /** @enum {string} */
2007
- type: "TextQuoteSelector";
2008
- exact: string;
2009
- prefix?: string;
2010
- suffix?: string;
2011
- } | components["schemas"]["SvgSelector"] | components["schemas"]["FragmentSelector"])[];
2012
- };
1986
+ target: components["schemas"]["AnnotationTarget"];
2013
1987
  /** @description Optional body. Omit for annotations whose motivation alone is meaningful (highlighting) or whose user-supplied content is empty. Shape matches Annotation.body. */
2014
1988
  body?: components["schemas"]["AnnotationBody"] | components["schemas"]["AnnotationBody"][];
2015
1989
  };
@@ -2022,23 +1996,11 @@ interface components {
2022
1996
  success: boolean;
2023
1997
  message: string;
2024
1998
  };
2025
- /** @description Progress payload emitted on gather:annotation-progress and gather:progress SSE channels during LLM context gathering. */
1999
+ /** @description Progress payload emitted on the gather:annotation-progress SSE channel during LLM context gathering. */
2026
2000
  GatherProgress: {
2027
2001
  message?: string;
2028
2002
  percentage?: number;
2029
2003
  };
2030
- /** @description Completion payload emitted on gather:annotation-finished SSE channel. */
2031
- GatherAnnotationFinished: {
2032
- correlationId: string;
2033
- annotationId: string;
2034
- response: components["schemas"]["AnnotationLLMContextResponse"];
2035
- };
2036
- /** @description Completion payload emitted on gather:finished SSE channel for resource-level context gathering. */
2037
- GatherFinished: {
2038
- correlationId: string;
2039
- resourceId: string;
2040
- response: components["schemas"]["ResourceLLMContextResponse"];
2041
- };
2042
2004
  /** @description Search results payload emitted on match:search-results SSE channel. */
2043
2005
  MatchSearchResult: {
2044
2006
  correlationId: string;
@@ -2345,6 +2307,35 @@ interface components {
2345
2307
  progress?: unknown;
2346
2308
  result?: unknown;
2347
2309
  };
2310
+ /** @description Knowledge graph gathered for an LLM context — a shared backbone in which resources AND annotations are typed nodes, connected by typed (optionally bidirectional) edges. Flattened views the matcher/generation read (connections, citedBy, siblings) are derived from these nodes/edges. */
2311
+ KnowledgeGraph: {
2312
+ nodes: {
2313
+ /** @description Node identifier — a ResourceId or AnnotationId */
2314
+ id: string;
2315
+ /**
2316
+ * @description Whether this node is a resource or an annotation
2317
+ * @enum {string}
2318
+ */
2319
+ type: "resource" | "annotation";
2320
+ label: string;
2321
+ /** @description Entity types on the node (resources) or carried by the annotation */
2322
+ entityTypes?: string[];
2323
+ metadata?: {
2324
+ [key: string]: unknown;
2325
+ };
2326
+ }[];
2327
+ edges: {
2328
+ source: string;
2329
+ target: string;
2330
+ /** @description Edge kind (e.g. citation, annotation-of, sibling) */
2331
+ type: string;
2332
+ /** @description Whether the connection goes both ways */
2333
+ bidirectional?: boolean;
2334
+ metadata?: {
2335
+ [key: string]: unknown;
2336
+ };
2337
+ }[];
2338
+ };
2348
2339
  ListResourcesResponse: {
2349
2340
  resources: components["schemas"]["ResourceDescriptor"][];
2350
2341
  total: number;
@@ -2498,37 +2489,6 @@ interface components {
2498
2489
  /** @description Entity types on the matched passage */
2499
2490
  entityTypes?: string[];
2500
2491
  };
2501
- ResourceLLMContextResponse: {
2502
- mainResource: components["schemas"]["ResourceDescriptor"];
2503
- relatedResources: components["schemas"]["ResourceDescriptor"][];
2504
- annotations: components["schemas"]["Annotation"][];
2505
- graph: {
2506
- nodes: {
2507
- id: string;
2508
- type: string;
2509
- label: string;
2510
- metadata: {
2511
- [key: string]: unknown;
2512
- };
2513
- }[];
2514
- edges: {
2515
- source: string;
2516
- target: string;
2517
- type: string;
2518
- metadata: {
2519
- [key: string]: unknown;
2520
- };
2521
- }[];
2522
- };
2523
- summary?: string;
2524
- suggestedReferences?: string[];
2525
- /** @description The content of the main resource (included if includeContent=true) */
2526
- mainResourceContent?: string;
2527
- /** @description Map of resource IDs to their content (included if includeContent=true) */
2528
- relatedResourcesContent?: {
2529
- [key: string]: string;
2530
- };
2531
- };
2532
2492
  SpecificResource: {
2533
2493
  /** @enum {string} */
2534
2494
  type: "SpecificResource";
@@ -2645,12 +2605,10 @@ interface components {
2645
2605
  BeckonSparkleEvent: {
2646
2606
  annotationId: string;
2647
2607
  };
2648
- /** @description Success result emitted on the bind:body-updated bus channel after bind:update-body has been applied. */
2608
+ /** @description Void success reply emitted on the bind:body-updated channel after bind:update-body has been applied, matched to the originating command by correlationId. */
2649
2609
  BindBodyUpdated: {
2650
- /** @description Correlation ID echoed from the originating bind:update-body command */
2610
+ /** @description Correlation id echoed from the originating bind:update-body command so busRequest can match the reply. */
2651
2611
  correlationId: string;
2652
- /** @description Branded AnnotationId of the annotation whose body was updated */
2653
- annotationId: string;
2654
2612
  };
2655
2613
  /** @description Command payload sent on the bind:initiate bus channel to start a bind flow. */
2656
2614
  BindInitiateCommand: {
@@ -2882,8 +2840,8 @@ interface components {
2882
2840
  correlationId: string;
2883
2841
  /** @description Branded AnnotationId of the annotation whose context was gathered */
2884
2842
  annotationId: string;
2885
- /** @description The gathered annotation context */
2886
- response: components["schemas"]["AnnotationLLMContextResponse"];
2843
+ /** @description The gathered annotation context (unified GatheredContext, focus.kind:'annotation') */
2844
+ response: components["schemas"]["GatheredContext"];
2887
2845
  };
2888
2846
  /** @description Request payload sent on the gather:requested bus channel to gather context for an annotation. */
2889
2847
  GatherAnnotationRequest: {
@@ -2903,66 +2861,75 @@ interface components {
2903
2861
  contextWindow?: number;
2904
2862
  };
2905
2863
  };
2906
- /** @description Context gathered for an annotation. Includes source document excerpts, metadata, and graph-derived context. Used by both Find (bind) and Generate (yield) flows. */
2864
+ /** @description Context gathered for a gather.* call — consumed by yield.* (generation) and the matcher. A shared base (graph, semanticContext, metadata, inferredRelationshipSummary) plus a discriminated `focus` that names the anchor: an annotation or a whole resource. */
2907
2865
  GatheredContext: {
2908
- /** @description The annotation this context was gathered for */
2909
- annotation: components["schemas"]["Annotation"];
2910
- /** @description The resource containing the annotation */
2911
- sourceResource: components["schemas"]["ResourceDescriptor"];
2912
- /** @description Text context from the source document */
2913
- sourceContext?: {
2914
- /** @description Text appearing before the selected passage */
2915
- before?: string;
2916
- /** @description The selected text passage (the annotation target) */
2917
- selected: string;
2918
- /** @description Text appearing after the selected passage */
2919
- after?: string;
2866
+ /** @description The gather anchor. Discriminated on `kind`. */
2867
+ focus: {
2868
+ /** @enum {string} */
2869
+ kind: "annotation";
2870
+ /** @description The annotation this context was gathered for */
2871
+ annotation: components["schemas"]["Annotation"];
2872
+ /** @description The resource containing the annotation */
2873
+ sourceResource: components["schemas"]["ResourceDescriptor"];
2874
+ /** @description Text context around the annotation target */
2875
+ selected?: {
2876
+ /** @description Text appearing before the selected passage */
2877
+ before?: string;
2878
+ /** @description The selected text passage (the annotation target) */
2879
+ text: string;
2880
+ /** @description Text appearing after the selected passage */
2881
+ after?: string;
2882
+ };
2883
+ /** @description User-provided hint to supplement or replace the selected text for search and generation */
2884
+ userHint?: string;
2885
+ /** @description The resource the annotation links to, if it is a resolved reference. Dormant capability — produced/exposed but not yet consumed (see LINK-TARGET-CONTEXT.md). */
2886
+ targetResource?: components["schemas"]["ResourceDescriptor"];
2887
+ /** @description Context about the annotation's link target. Dormant — see LINK-TARGET-CONTEXT.md. */
2888
+ targetContext?: {
2889
+ content: string;
2890
+ summary?: string;
2891
+ };
2892
+ } | {
2893
+ /** @enum {string} */
2894
+ kind: "resource";
2895
+ /** @description The resource this context was gathered for */
2896
+ resource: components["schemas"]["ResourceDescriptor"];
2897
+ summary?: string;
2898
+ suggestedReferences?: string[];
2899
+ /** @description Resource content (included when requested) */
2900
+ content?: {
2901
+ /** @description Content of the focal resource */
2902
+ main?: string;
2903
+ /** @description Map of related resource IDs to their content */
2904
+ related?: {
2905
+ [key: string]: string;
2906
+ };
2907
+ };
2908
+ };
2909
+ /** @description Knowledge graph backbone — resources AND annotations as typed nodes. The flattened views (connections, citedBy, siblings) are derived from this. */
2910
+ graph: components["schemas"]["KnowledgeGraph"];
2911
+ /** @description Semantically similar passages from across the knowledge base, found via vector search */
2912
+ semanticContext?: {
2913
+ /** @description Passages ranked by cosine similarity to the focal text */
2914
+ similar: components["schemas"]["SemanticMatch"][];
2915
+ /** @description Entity types excluded from this recall — a record of how `similar` was filtered (e.g. ['Question'] so answer-generation never surfaces prior questions). Absent when no exclusion was applied. */
2916
+ excludedEntityTypes?: string[];
2920
2917
  };
2921
- /** @description Context metadata about the annotation and its source */
2922
- metadata?: {
2918
+ /** @description Context metadata about the focal anchor and its source */
2919
+ metadata: {
2923
2920
  /** @description Type of source resource (e.g., 'document', 'image', 'video') */
2924
2921
  resourceType?: string;
2925
2922
  /** @description BCP 47 language tag of source content */
2926
2923
  language?: string;
2927
- /** @description Entity types associated with the annotation */
2924
+ /** @description Entity types associated with the focal anchor */
2928
2925
  entityTypes?: string[];
2929
- };
2930
- /** @description User-provided textual hint to supplement or replace the selected text for search and generation */
2931
- userHint?: string;
2932
- /** @description Graph-derived context from the knowledge base */
2933
- graphContext?: {
2934
- /** @description Resources connected to the source resource via annotations */
2935
- connections?: {
2936
- /** @description ID of the connected resource */
2937
- resourceId: string;
2938
- /** @description Name of the connected resource */
2939
- resourceName: string;
2940
- /** @description Entity types on the connected resource */
2941
- entityTypes?: string[];
2942
- /** @description Whether the connection goes both ways */
2943
- bidirectional: boolean;
2944
- }[];
2945
- /** @description Number of other resources that reference the source resource */
2946
- citedByCount?: number;
2947
- /** @description Resources that reference the source resource */
2948
- citedBy?: {
2949
- resourceId: string;
2950
- resourceName: string;
2951
- }[];
2952
- /** @description Entity types from other annotations on the same resource */
2953
- siblingEntityTypes?: string[];
2954
- /** @description Global frequency counts for entity types (for IDF-like weighting) */
2926
+ /** @description Global frequency counts for entity types (for IDF-like weighting). A KB-wide statistic, not a neighborhood property — kept here rather than on the graph. */
2955
2927
  entityTypeFrequencies?: {
2956
2928
  [key: string]: number;
2957
2929
  };
2958
- /** @description LLM-generated summary of the annotation's relationships in the knowledge graph */
2959
- inferredRelationshipSummary?: string;
2960
- };
2961
- /** @description Semantically similar passages from across the knowledge base, found via vector search */
2962
- semanticContext?: {
2963
- /** @description Passages ranked by cosine similarity to the focal text */
2964
- similar: components["schemas"]["SemanticMatch"][];
2965
2930
  };
2931
+ /** @description LLM-generated summary of the focal anchor's relationships in the knowledge graph */
2932
+ inferredRelationshipSummary?: string;
2966
2933
  };
2967
2934
  /** @description Completion payload emitted on the gather:resource-complete bus channel when resource context gathering finishes. */
2968
2935
  GatherResourceComplete: {
@@ -2970,8 +2937,8 @@ interface components {
2970
2937
  correlationId: string;
2971
2938
  /** @description Branded ResourceId of the resource whose context was gathered */
2972
2939
  resourceId: string;
2973
- /** @description The gathered resource context */
2974
- response: components["schemas"]["ResourceLLMContextResponse"];
2940
+ /** @description The gathered resource context (unified GatheredContext, focus.kind:'resource') */
2941
+ response: components["schemas"]["GatheredContext"];
2975
2942
  };
2976
2943
  /** @description Request payload sent on the gather:resource-requested bus channel to gather context for a resource. */
2977
2944
  GatherResourceRequest: {
@@ -2989,6 +2956,8 @@ interface components {
2989
2956
  includeContent: boolean;
2990
2957
  /** @description Whether to include resource summaries in the gathered result */
2991
2958
  includeSummary: boolean;
2959
+ /** @description Entity types to exclude from the semantic recall built into this context (caller-supplied; e.g. a chat consumer passes ['Question'] so prior questions never ground answer generation). Optional; default none. */
2960
+ excludeEntityTypes?: string[];
2992
2961
  };
2993
2962
  };
2994
2963
  /** @description Request to generate an AI summary of an annotation */
@@ -3004,6 +2973,8 @@ interface components {
3004
2973
  };
3005
2974
  /** @description Request to cancel a job */
3006
2975
  JobCancelRequest: {
2976
+ /** @description Correlation id for request/reply matching, set by the SDK's busRequest so the confirmed-write ack/failure routes back. Absent for the local cancelRequest UI signal. */
2977
+ correlationId?: string;
3007
2978
  /** @enum {string} */
3008
2979
  jobType: "annotation" | "generation";
3009
2980
  };
@@ -3015,6 +2986,8 @@ interface components {
3015
2986
  /** @description Command to create a new job via the event bus */
3016
2987
  JobCreateCommand: {
3017
2988
  correlationId: string;
2989
+ /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
2990
+ _userId?: string;
3018
2991
  /** @enum {string} */
3019
2992
  jobType: "reference-annotation" | "highlight-annotation" | "assessment-annotation" | "comment-annotation" | "tag-annotation" | "generation";
3020
2993
  resourceId: string;
@@ -3167,18 +3140,24 @@ interface components {
3167
3140
  };
3168
3141
  /** @description Bus command to add a new entity type to the KB's vocabulary. Carried on the `frame:add-entity-type` channel — Frame is the schema-layer flow that owns vocabulary writes. */
3169
3142
  FrameAddEntityTypeCommand: {
3143
+ /** @description Correlation id for request/reply matching, set by the SDK's busRequest so the confirmed-write ack/failure routes back. Absent for in-process (bootstrap/replay/import) emits, which race the frame:entity-type-added domain event instead. */
3144
+ correlationId?: string;
3170
3145
  tag: string;
3171
3146
  /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
3172
3147
  _userId?: string;
3173
3148
  };
3174
3149
  /** @description Bus command to register a tag schema with the KB's runtime registry. Carried on the `frame:add-tag-schema` channel — Frame is the schema-layer flow that owns vocabulary writes. Most-recent registration of a given `schema.id` wins; the projection reflects the latest content. Identical re-registrations are silent; differing content overwrites and logs a warning. */
3175
3150
  FrameAddTagSchemaCommand: {
3151
+ /** @description Correlation id for request/reply matching, set by the SDK's busRequest so the confirmed-write ack/failure routes back. Absent for in-process emits. */
3152
+ correlationId?: string;
3176
3153
  schema: components["schemas"]["TagSchema"];
3177
3154
  /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
3178
3155
  _userId?: string;
3179
3156
  };
3180
3157
  /** @description Bus command to archive a resource and optionally remove its file. */
3181
3158
  MarkArchiveCommand: {
3159
+ /** @description Correlation id for request/reply matching, set by the SDK's busRequest so the confirmed-write ack/failure routes back. */
3160
+ correlationId?: string;
3182
3161
  /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
3183
3162
  _userId?: string;
3184
3163
  resourceId: string;
@@ -3216,9 +3195,14 @@ interface components {
3216
3195
  annotation: components["schemas"]["Annotation"];
3217
3196
  resourceId: string;
3218
3197
  };
3219
- /** @description Success response after creating an annotation. */
3198
+ /** @description Success reply after creating an annotation, matched to the originating command by correlationId. */
3220
3199
  MarkCreateOk: {
3221
- annotationId: string;
3200
+ /** @description Correlation id echoed from the mark:create-request command so busRequest can match the reply. */
3201
+ correlationId?: string;
3202
+ /** @description The created annotation's identity. */
3203
+ response: {
3204
+ annotationId: string;
3205
+ };
3222
3206
  };
3223
3207
  /** @description Raw annotation creation intent — bus handler assembles the W3C annotation */
3224
3208
  MarkCreateRequest: {
@@ -3228,14 +3212,21 @@ interface components {
3228
3212
  };
3229
3213
  /** @description Bus command to delete an annotation. */
3230
3214
  MarkDeleteCommand: {
3215
+ /** @description Correlation id for request/reply matching, set by the SDK's busRequest so the confirmed-write ack/failure routes back. */
3216
+ correlationId?: string;
3231
3217
  /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
3232
3218
  _userId?: string;
3233
3219
  annotationId: string;
3234
3220
  resourceId?: string;
3235
3221
  };
3236
- /** @description Success response after deleting an annotation. */
3222
+ /** @description Success reply after deleting an annotation, matched to the originating command by correlationId. */
3237
3223
  MarkDeleteOk: {
3238
- annotationId: string;
3224
+ /** @description Correlation id echoed from the mark:delete command so busRequest can match the reply. */
3225
+ correlationId?: string;
3226
+ /** @description The deleted annotation's identity. */
3227
+ response: {
3228
+ annotationId: string;
3229
+ };
3239
3230
  };
3240
3231
  /** @description Emitted when the user requests a new mark (annotation) on a resource */
3241
3232
  MarkRequestedEvent: {
@@ -3261,6 +3252,8 @@ interface components {
3261
3252
  };
3262
3253
  /** @description Bus command to unarchive a previously archived resource. */
3263
3254
  MarkUnarchiveCommand: {
3255
+ /** @description Correlation id for request/reply matching, set by the SDK's busRequest so the confirmed-write ack/failure routes back. */
3256
+ correlationId?: string;
3264
3257
  /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
3265
3258
  _userId?: string;
3266
3259
  resourceId: string;
@@ -3355,7 +3348,7 @@ interface components {
3355
3348
  YieldCloneCreated: {
3356
3349
  correlationId: string;
3357
3350
  response: {
3358
- resourceId?: string;
3351
+ resourceId: string;
3359
3352
  };
3360
3353
  };
3361
3354
  /** @description Bus command to request cloning a resource using a clone token. */
@@ -3370,6 +3363,8 @@ interface components {
3370
3363
  };
3371
3364
  /** @description Bus command to create a yielded resource in the knowledge base. */
3372
3365
  YieldCreateCommand: {
3366
+ /** @description Correlation id for request/reply matching, set by busRequest so the yield:create-ok / yield:create-failed reply routes back to the awaiting caller. */
3367
+ correlationId?: string;
3373
3368
  /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
3374
3369
  _userId?: string;
3375
3370
  name: string;
@@ -3388,14 +3383,14 @@ interface components {
3388
3383
  generator?: components["schemas"]["Agent"] | components["schemas"]["Agent"][];
3389
3384
  noGit?: boolean;
3390
3385
  };
3391
- /** @description Success response after creating a yielded resource. */
3386
+ /** @description Success reply after creating a yielded resource, matched to the originating command by correlationId. */
3392
3387
  YieldCreateOk: {
3393
- resourceId: string;
3394
- resource: components["schemas"]["ResourceDescriptor"];
3395
- };
3396
- /** @description Success response after moving a yielded resource. */
3397
- YieldMoveOk: {
3398
- resourceId: string;
3388
+ /** @description Correlation id echoed from the yield:create command so busRequest can match the reply. */
3389
+ correlationId?: string;
3390
+ /** @description The created resource's identity. */
3391
+ response: {
3392
+ resourceId: string;
3393
+ };
3399
3394
  };
3400
3395
  /** @description Bus command to move (rename) a yielded resource. */
3401
3396
  YieldMvCommand: {
@@ -3407,6 +3402,8 @@ interface components {
3407
3402
  };
3408
3403
  /** @description Bus command to update a yielded resource's storage content. */
3409
3404
  YieldUpdateCommand: {
3405
+ /** @description Correlation id for request/reply matching, set by busRequest so the yield:update-ok / yield:update-failed reply routes back to the awaiting caller. */
3406
+ correlationId?: string;
3410
3407
  /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
3411
3408
  _userId?: string;
3412
3409
  resourceId: string;
@@ -3415,9 +3412,14 @@ interface components {
3415
3412
  byteSize: number;
3416
3413
  noGit?: boolean;
3417
3414
  };
3418
- /** @description Success response after updating a yielded resource. */
3415
+ /** @description Success reply after updating a yielded resource, matched to the originating command by correlationId. */
3419
3416
  YieldUpdateOk: {
3420
- resourceId: string;
3417
+ /** @description Correlation id echoed from the yield:update command so busRequest can match the reply. */
3418
+ correlationId?: string;
3419
+ /** @description The updated resource's identity. */
3420
+ response: {
3421
+ resourceId: string;
3422
+ };
3421
3423
  };
3422
3424
  };
3423
3425
  responses: never;
@@ -3791,8 +3793,7 @@ type EventMap = {
3791
3793
  'yield:create-ok': components['schemas']['YieldCreateOk'];
3792
3794
  'yield:create-failed': components['schemas']['CommandError'];
3793
3795
  'yield:update-ok': components['schemas']['YieldUpdateOk'];
3794
- 'yield:update-failed': components['schemas']['YieldUpdateOk'] & components['schemas']['CommandError'];
3795
- 'yield:move-ok': components['schemas']['YieldMoveOk'];
3796
+ 'yield:update-failed': components['schemas']['CommandError'];
3796
3797
  'yield:move-failed': {
3797
3798
  fromUri: string;
3798
3799
  } & components['schemas']['CommandError'];
@@ -3832,6 +3833,14 @@ type EventMap = {
3832
3833
  'mark:create-failed': components['schemas']['CommandError'];
3833
3834
  'mark:delete-ok': components['schemas']['MarkDeleteOk'];
3834
3835
  'mark:delete-failed': components['schemas']['CommandError'];
3836
+ 'mark:archive-ok': {
3837
+ correlationId?: string;
3838
+ };
3839
+ 'mark:archive-failed': components['schemas']['CommandError'];
3840
+ 'mark:unarchive-ok': {
3841
+ correlationId?: string;
3842
+ };
3843
+ 'mark:unarchive-failed': components['schemas']['CommandError'];
3835
3844
  'mark:body-update-failed': components['schemas']['CommandError'];
3836
3845
  'mark:select-comment': components['schemas']['SelectionData'];
3837
3846
  'mark:select-tag': components['schemas']['SelectionData'];
@@ -3851,7 +3860,13 @@ type EventMap = {
3851
3860
  'frame:tag-schema-added': StoredEvent<EventOfType<'frame:tag-schema-added'>>;
3852
3861
  'frame:add-entity-type': components['schemas']['FrameAddEntityTypeCommand'];
3853
3862
  'frame:add-tag-schema': components['schemas']['FrameAddTagSchemaCommand'];
3863
+ 'frame:entity-type-add-ok': {
3864
+ correlationId?: string;
3865
+ };
3854
3866
  'frame:entity-type-add-failed': components['schemas']['CommandError'];
3867
+ 'frame:tag-schema-add-ok': {
3868
+ correlationId?: string;
3869
+ };
3855
3870
  'frame:tag-schema-add-failed': components['schemas']['CommandError'];
3856
3871
  'bind:initiate': BindInitiateCommand;
3857
3872
  'bind:update-body': BindUpdateBodyCommand;
@@ -3881,9 +3896,6 @@ type EventMap = {
3881
3896
  correlationId: string;
3882
3897
  } & components['schemas']['CommandError'];
3883
3898
  'gather:annotation-progress': components['schemas']['GatherProgress'];
3884
- 'gather:annotation-finished': components['schemas']['GatherAnnotationFinished'];
3885
- 'gather:progress': components['schemas']['GatherProgress'];
3886
- 'gather:finished': components['schemas']['GatherFinished'];
3887
3899
  'browse:resource-requested': components['schemas']['BrowseResourceRequest'];
3888
3900
  'browse:resource-result': components['schemas']['BrowseResourceResult'];
3889
3901
  'browse:resource-failed': {
@@ -3988,6 +4000,13 @@ type EventMap = {
3988
4000
  'job:claim-failed': {
3989
4001
  correlationId: string;
3990
4002
  } & components['schemas']['CommandError'];
4003
+ 'job:cancel-ok': {
4004
+ correlationId?: string;
4005
+ response: {
4006
+ cancelled: number;
4007
+ };
4008
+ };
4009
+ 'job:cancel-failed': components['schemas']['CommandError'];
3991
4010
  'settings:theme-changed': components['schemas']['SettingsThemeChangedEvent'];
3992
4011
  'settings:line-numbers-toggled': void;
3993
4012
  'settings:locale-changed': components['schemas']['SettingsLocaleChangedEvent'];
@@ -4021,7 +4040,22 @@ type EventMap = {
4021
4040
  reason: string;
4022
4041
  };
4023
4042
  };
4024
- /** Any valid channel name on the EventBus. */
4043
+ /**
4044
+ * Any valid channel name on the EventBus — `keyof EventMap`, the root channel
4045
+ * type. Two subsets matter, and confusing them is a silent-failure trap:
4046
+ *
4047
+ * - `EmittableChannel` (below) — channels with a non-null `CHANNEL_SCHEMAS`
4048
+ * entry; what you EMIT (the `/bus/emit` gateway validates the payload).
4049
+ * - `BridgedChannel` (`bridged-channels.ts`) — the transport fan-in set; the
4050
+ * only channels a client can SUBSCRIBE to over a concrete transport.
4051
+ *
4052
+ * Request/reply (`busRequest`) emits on an `EmittableChannel` and subscribes on
4053
+ * `BridgedChannel` replies. A reply channel that is a valid `EventName` but NOT
4054
+ * in `BRIDGED_CHANNELS` is never delivered → the request times out with no
4055
+ * compile or runtime error (see
4056
+ * `.plans/bugs/gather-resource-complete-not-bridged.md`). `busRequest` now types
4057
+ * its reply params `BridgedChannel` so that omission is a compile error.
4058
+ */
4025
4059
  type EventName = keyof EventMap;
4026
4060
  /**
4027
4061
  * Genuine resource-bound broadcast event types.
@@ -4080,7 +4114,6 @@ declare const CHANNEL_SCHEMAS: {
4080
4114
  readonly 'yield:create-failed': "CommandError";
4081
4115
  readonly 'yield:update-ok': "YieldUpdateOk";
4082
4116
  readonly 'yield:update-failed': null;
4083
- readonly 'yield:move-ok': "YieldMoveOk";
4084
4117
  readonly 'yield:move-failed': null;
4085
4118
  readonly 'yield:clone-token-generated': null;
4086
4119
  readonly 'yield:clone-token-failed': null;
@@ -4110,8 +4143,14 @@ declare const CHANNEL_SCHEMAS: {
4110
4143
  readonly 'mark:create-failed': "CommandError";
4111
4144
  readonly 'mark:delete-ok': "MarkDeleteOk";
4112
4145
  readonly 'mark:delete-failed': "CommandError";
4146
+ readonly 'mark:archive-ok': null;
4147
+ readonly 'mark:archive-failed': "CommandError";
4148
+ readonly 'mark:unarchive-ok': null;
4149
+ readonly 'mark:unarchive-failed': "CommandError";
4113
4150
  readonly 'mark:body-update-failed': "CommandError";
4151
+ readonly 'frame:entity-type-add-ok': null;
4114
4152
  readonly 'frame:entity-type-add-failed': "CommandError";
4153
+ readonly 'frame:tag-schema-add-ok': null;
4115
4154
  readonly 'frame:tag-schema-add-failed': "CommandError";
4116
4155
  readonly 'mark:select-comment': "SelectionData";
4117
4156
  readonly 'mark:select-tag': "SelectionData";
@@ -4144,9 +4183,6 @@ declare const CHANNEL_SCHEMAS: {
4144
4183
  readonly 'gather:summary-result': null;
4145
4184
  readonly 'gather:summary-failed': null;
4146
4185
  readonly 'gather:annotation-progress': "GatherProgress";
4147
- readonly 'gather:annotation-finished': "GatherAnnotationFinished";
4148
- readonly 'gather:progress': "GatherProgress";
4149
- readonly 'gather:finished': "GatherFinished";
4150
4186
  readonly 'browse:resource-requested': "BrowseResourceRequest";
4151
4187
  readonly 'browse:resource-result': "BrowseResourceResult";
4152
4188
  readonly 'browse:resource-failed': null;
@@ -4214,6 +4250,8 @@ declare const CHANNEL_SCHEMAS: {
4214
4250
  readonly 'job:create-failed': null;
4215
4251
  readonly 'job:claimed': null;
4216
4252
  readonly 'job:claim-failed': null;
4253
+ readonly 'job:cancel-ok': null;
4254
+ readonly 'job:cancel-failed': "CommandError";
4217
4255
  readonly 'settings:theme-changed': "SettingsThemeChangedEvent";
4218
4256
  readonly 'settings:line-numbers-toggled': null;
4219
4257
  readonly 'settings:locale-changed': "SettingsLocaleChangedEvent";
@@ -4699,7 +4737,9 @@ declare function validateSvgMarkup(svg: string): string | null;
4699
4737
  * Generates a bare annotation ID (no URL prefix). URIs are constructed
4700
4738
  * at the API boundary when returning responses to clients.
4701
4739
  *
4702
- * Throws on invalid input (missing selector, missing motivation, invalid SVG).
4740
+ * Throws on invalid input (missing motivation, invalid SVG markup). The target
4741
+ * selector is OPTIONAL — a source-only target annotates the whole resource (W3C;
4742
+ * e.g. resource-level edges), per RESOURCE-LEVEL-ANCHOR.
4703
4743
  */
4704
4744
  declare function assembleAnnotation(request: CreateAnnotationRequest, creator: Agent$2): AssembledAnnotation;
4705
4745
  /**
@@ -5320,23 +5360,221 @@ interface IContentTransport {
5320
5360
  dispose(): void;
5321
5361
  }
5322
5362
 
5363
+ declare const BUS_OPERATIONS: {
5364
+ readonly 'bind:update-body': {
5365
+ readonly result: "bind:body-updated";
5366
+ readonly failure: "bind:body-update-failed";
5367
+ };
5368
+ readonly 'browse:resource-requested': {
5369
+ readonly result: "browse:resource-result";
5370
+ readonly failure: "browse:resource-failed";
5371
+ };
5372
+ readonly 'browse:resources-requested': {
5373
+ readonly result: "browse:resources-result";
5374
+ readonly failure: "browse:resources-failed";
5375
+ };
5376
+ readonly 'browse:annotation-requested': {
5377
+ readonly result: "browse:annotation-result";
5378
+ readonly failure: "browse:annotation-failed";
5379
+ };
5380
+ readonly 'browse:annotations-requested': {
5381
+ readonly result: "browse:annotations-result";
5382
+ readonly failure: "browse:annotations-failed";
5383
+ };
5384
+ readonly 'browse:annotation-history-requested': {
5385
+ readonly result: "browse:annotation-history-result";
5386
+ readonly failure: "browse:annotation-history-failed";
5387
+ };
5388
+ readonly 'browse:events-requested': {
5389
+ readonly result: "browse:events-result";
5390
+ readonly failure: "browse:events-failed";
5391
+ };
5392
+ readonly 'browse:referenced-by-requested': {
5393
+ readonly result: "browse:referenced-by-result";
5394
+ readonly failure: "browse:referenced-by-failed";
5395
+ };
5396
+ readonly 'browse:entity-types-requested': {
5397
+ readonly result: "browse:entity-types-result";
5398
+ readonly failure: "browse:entity-types-failed";
5399
+ };
5400
+ readonly 'browse:tag-schemas-requested': {
5401
+ readonly result: "browse:tag-schemas-result";
5402
+ readonly failure: "browse:tag-schemas-failed";
5403
+ };
5404
+ readonly 'browse:directory-requested': {
5405
+ readonly result: "browse:directory-result";
5406
+ readonly failure: "browse:directory-failed";
5407
+ };
5408
+ readonly 'browse:annotation-context-requested': {
5409
+ readonly result: "browse:annotation-context-result";
5410
+ readonly failure: "browse:annotation-context-failed";
5411
+ };
5412
+ readonly 'frame:add-entity-type': {
5413
+ readonly result: "frame:entity-type-add-ok";
5414
+ readonly failure: "frame:entity-type-add-failed";
5415
+ };
5416
+ readonly 'frame:add-tag-schema': {
5417
+ readonly result: "frame:tag-schema-add-ok";
5418
+ readonly failure: "frame:tag-schema-add-failed";
5419
+ };
5420
+ readonly 'gather:requested': {
5421
+ readonly result: "gather:complete";
5422
+ readonly failure: "gather:failed";
5423
+ readonly progress: "gather:annotation-progress";
5424
+ };
5425
+ readonly 'gather:resource-requested': {
5426
+ readonly result: "gather:resource-complete";
5427
+ readonly failure: "gather:resource-failed";
5428
+ };
5429
+ readonly 'gather:summary-requested': {
5430
+ readonly result: "gather:summary-result";
5431
+ readonly failure: "gather:summary-failed";
5432
+ };
5433
+ readonly 'job:create': {
5434
+ readonly result: "job:created";
5435
+ readonly failure: "job:create-failed";
5436
+ };
5437
+ readonly 'job:status-requested': {
5438
+ readonly result: "job:status-result";
5439
+ readonly failure: "job:status-failed";
5440
+ };
5441
+ readonly 'job:cancel-requested': {
5442
+ readonly result: "job:cancel-ok";
5443
+ readonly failure: "job:cancel-failed";
5444
+ };
5445
+ readonly 'job:claim': {
5446
+ readonly result: "job:claimed";
5447
+ readonly failure: "job:claim-failed";
5448
+ };
5449
+ readonly 'mark:create-request': {
5450
+ readonly result: "mark:create-ok";
5451
+ readonly failure: "mark:create-failed";
5452
+ };
5453
+ readonly 'mark:delete': {
5454
+ readonly result: "mark:delete-ok";
5455
+ readonly failure: "mark:delete-failed";
5456
+ };
5457
+ readonly 'mark:archive': {
5458
+ readonly result: "mark:archive-ok";
5459
+ readonly failure: "mark:archive-failed";
5460
+ };
5461
+ readonly 'mark:unarchive': {
5462
+ readonly result: "mark:unarchive-ok";
5463
+ readonly failure: "mark:unarchive-failed";
5464
+ };
5465
+ readonly 'match:search-requested': {
5466
+ readonly result: "match:search-results";
5467
+ readonly failure: "match:search-failed";
5468
+ };
5469
+ readonly 'yield:create': {
5470
+ readonly result: "yield:create-ok";
5471
+ readonly failure: "yield:create-failed";
5472
+ };
5473
+ readonly 'yield:update': {
5474
+ readonly result: "yield:update-ok";
5475
+ readonly failure: "yield:update-failed";
5476
+ };
5477
+ readonly 'yield:clone-create': {
5478
+ readonly result: "yield:clone-created";
5479
+ readonly failure: "yield:clone-create-failed";
5480
+ };
5481
+ readonly 'yield:clone-resource-requested': {
5482
+ readonly result: "yield:clone-resource-result";
5483
+ readonly failure: "yield:clone-resource-failed";
5484
+ };
5485
+ readonly 'yield:clone-token-requested': {
5486
+ readonly result: "yield:clone-token-generated";
5487
+ readonly failure: "yield:clone-token-failed";
5488
+ };
5489
+ };
5490
+ /** The request-channel key of a registered operation — what `busRequest` takes. */
5491
+ type BusOperationKey = keyof typeof BUS_OPERATIONS;
5492
+
5323
5493
  /**
5324
5494
  * BRIDGED_CHANNELS
5325
5495
  *
5326
5496
  * The set of bus channels that any concrete transport bridges into the
5327
5497
  * caller-supplied bus via `bridgeInto`. Transport-neutral: every concrete
5328
- * `ITransport` shares the same set; HTTP delivers them via SSE,
5329
- * in-process transports forward them directly from the local actor bus.
5498
+ * `ITransport` shares the same set; HTTP delivers them via SSE, in-process
5499
+ * transports forward them directly from the local actor bus.
5500
+ *
5501
+ * This is the *fan-in* set — channels for events the transport receives and
5502
+ * pushes onto the client's bus. It is not the same as the channels the client
5503
+ * emits (which is open-ended).
5504
+ *
5505
+ * It is DERIVED, not hand-listed: the request/reply replies come from
5506
+ * `BUS_OPERATIONS` (bus-operations.ts), so no operation's reply can be
5507
+ * forgotten here — that was the recurring unbridged-reply bug class. The only
5508
+ * hand-maintained part is `BRIDGED_BROADCASTS`: the genuine non-request/reply
5509
+ * minority (lifecycle events and UI/infra signals that no single requester
5510
+ * owns). See .plans/BUS-OPERATIONS-REGISTRY.md.
5511
+ *
5512
+ * Resource-scoped channels (joined/left via `subscribeToResource`) are tracked
5513
+ * separately by transports that care about scope (HTTP).
5514
+ */
5515
+ /**
5516
+ * Bridged channels with no owning operation: job-lifecycle events (multi-viewer,
5517
+ * no single requester owns the reply), KB-global frame domain events, UI signals,
5518
+ * and SSE infrastructure. A reply channel must NOT go here — declare its
5519
+ * operation in `BUS_OPERATIONS` instead.
5520
+ */
5521
+ declare const BRIDGED_BROADCASTS: readonly ["job:report-progress", "job:complete", "job:fail", "frame:entity-type-added", "frame:tag-schema-added", "beckon:focus", "beckon:sparkle", "bus:resume-gap"];
5522
+ type OpSpecs = (typeof BUS_OPERATIONS)[keyof typeof BUS_OPERATIONS];
5523
+ type ProgressChannel<O> = O extends {
5524
+ progress: infer P extends EventName;
5525
+ } ? P : never;
5526
+ /** The union of every reply channel declared in the registry. */
5527
+ type RegistryReply = OpSpecs['result'] | OpSpecs['failure'] | ProgressChannel<OpSpecs>;
5528
+ declare const BRIDGED_CHANNELS: readonly BridgedChannel[];
5529
+ /**
5530
+ * The SUBSCRIBE-side subset of `EventName` — the channels a client can receive
5531
+ * over a concrete transport. See the family note on `EventName` in
5532
+ * bus-protocol.ts (emit on an `EmittableChannel`, subscribe on a `BridgedChannel`).
5533
+ */
5534
+ type BridgedChannel = RegistryReply | (typeof BRIDGED_BROADCASTS)[number];
5535
+
5536
+ /**
5537
+ * The value a registered operation resolves to: the `response` field of its
5538
+ * result channel's payload, or `void` for a result channel that carries no
5539
+ * `response` (a confirmed-write ack with no data). Inferred from the registry,
5540
+ * so callers never annotate `busRequest`'s return type. Relies on the reply-shape
5541
+ * standard — see .plans/REPLY-SHAPE-STANDARD.md.
5542
+ */
5543
+ type BusReply<Op extends BusOperationKey> = EventMap[(typeof BUS_OPERATIONS)[Op]['result'] & EventName] extends {
5544
+ response: infer R;
5545
+ } ? R : void;
5546
+ type BusRequestErrorCode = 'bus.timeout' | 'bus.rejected' | 'bus.closed' | 'bus.bad-payload' | 'bus.unauthorized' | 'bus.forbidden' | 'bus.not-found';
5547
+ declare class BusRequestError extends SemiontError {
5548
+ code: BusRequestErrorCode;
5549
+ constructor(message: string, code: BusRequestErrorCode, details?: Record<string, unknown>);
5550
+ }
5551
+ /**
5552
+ * Subset of ITransport that `busRequest` needs: a way to send a command and
5553
+ * a way to observe channels. Generic enough that an in-process transport
5554
+ * can satisfy it without round-tripping through HTTP.
5555
+ */
5556
+ interface BusRequestPrimitive {
5557
+ emit<K extends keyof EventMap>(channel: K, payload: EventMap[K]): Promise<void>;
5558
+ stream<K extends keyof EventMap>(channel: K): Observable<EventMap[K]>;
5559
+ }
5560
+ /**
5561
+ * Request/reply over the bus, keyed by the operation's request channel.
5330
5562
  *
5331
- * Note: this is the *fan-in* set channels for events the transport
5332
- * receives and pushes onto the client's bus. It is not the same as the
5333
- * channels the client emits (which is open-ended).
5563
+ * The `operation` is a `BusOperationKey` (a request channel declared in
5564
+ * `BUS_OPERATIONS`); the matching `result`/`failure` reply channels are looked
5565
+ * up from the registry, so a caller cannot pass a mismatched or unbridged reply
5566
+ * pair — the recurring unbridged-reply bug class is unrepresentable. Every
5567
+ * registry reply derives into `BRIDGED_CHANNELS` (see bridged-channels.ts), so
5568
+ * the transport always subscribes to it (cf.
5569
+ * .plans/bugs/gather-resource-complete-not-bridged.md, where the `gather:resource-*`
5570
+ * pair shipped unbridged with no compile/runtime signal).
5334
5571
  *
5335
- * Resource-scoped channels (joined/left via `subscribeToResource`) are
5336
- * tracked separately by transports that care about scope (HTTP).
5572
+ * The return type is INFERRED from the registry (`BusReply<Op>` = the result
5573
+ * channel's `response` type, or `void`) callers never annotate it. Every reply
5574
+ * is `{ correlationId, response: T }` (data) or `{ correlationId }` (void); see
5575
+ * .plans/REPLY-SHAPE-STANDARD.md. `busRequest` reads `e.response`.
5337
5576
  */
5338
- declare const BRIDGED_CHANNELS: readonly ["browse:resources-result", "browse:resources-failed", "browse:resource-result", "browse:resource-failed", "browse:annotations-result", "browse:annotations-failed", "browse:annotation-result", "browse:annotation-failed", "browse:annotation-history-result", "browse:annotation-history-failed", "browse:events-result", "browse:events-failed", "browse:referenced-by-result", "browse:referenced-by-failed", "browse:entity-types-result", "browse:entity-types-failed", "browse:tag-schemas-result", "browse:tag-schemas-failed", "browse:directory-result", "browse:directory-failed", "browse:annotation-context-result", "browse:annotation-context-failed", "mark:delete-ok", "mark:delete-failed", "mark:create-ok", "mark:create-failed", "match:search-results", "match:search-failed", "gather:complete", "gather:failed", "gather:annotation-progress", "gather:annotation-finished", "gather:summary-result", "gather:summary-failed", "bind:body-updated", "bind:body-update-failed", "job:report-progress", "job:complete", "job:fail", "job:status-result", "job:status-failed", "job:created", "job:create-failed", "job:claimed", "job:claim-failed", "yield:create-ok", "yield:create-failed", "yield:update-ok", "yield:update-failed", "yield:clone-token-generated", "yield:clone-token-failed", "yield:clone-resource-result", "yield:clone-resource-failed", "yield:clone-created", "yield:clone-create-failed", "frame:entity-type-added", "frame:tag-schema-added", "beckon:focus", "beckon:sparkle", "bus:resume-gap"];
5339
- type BridgedChannel = typeof BRIDGED_CHANNELS[number];
5577
+ declare function busRequest<Op extends BusOperationKey>(bus: BusRequestPrimitive, operation: Op, payload: Record<string, unknown>, timeoutMs?: number): Promise<BusReply<Op>>;
5340
5578
 
5341
5579
  /**
5342
5580
  * Fuzzy Anchoring for W3C Web Annotation TextQuoteSelector
@@ -6003,6 +6241,33 @@ interface GoogleAuthRequest {
6003
6241
  */
6004
6242
  declare function generateUuid(): string;
6005
6243
 
6244
+ /**
6245
+ * Marker for the state-unit pattern: a stateful, lifecycled object with an
6246
+ * RxJS-shaped public surface, constructed by a factory function
6247
+ * (`createFooStateUnit`), with internal state held in a closure.
6248
+ *
6249
+ * The structural contract is `dispose()` — the rest of the pattern
6250
+ * (closure-based identity, Observable public surface, internal Subjects
6251
+ * exposed as `.asObservable()` views, no leaked subscriptions, composition
6252
+ * by parameter rather than ownership) is convention, made executable by the
6253
+ * axiom harness in `@semiont/core/testing` (`assertStateUnitAxioms`).
6254
+ *
6255
+ * Lives in `@semiont/core` (not sdk) so every layer can share one definition
6256
+ * without dependency cycles — `http-transport`'s `ActorStateUnit` sits below
6257
+ * sdk and would otherwise have to re-declare it. See
6258
+ * `packages/sdk/docs/STATE-UNITS.md` for the full pattern and rationale, and
6259
+ * `.plans/STATE-UNIT-AXIOMS.md` for the axiom ledger.
6260
+ */
6261
+ interface StateUnit {
6262
+ /**
6263
+ * Idempotent, total teardown. Completes every Subject the unit owns,
6264
+ * unsubscribes every internal subscription, releases timers / abort
6265
+ * controllers / network handles. Safe to call multiple times — the
6266
+ * second call is a no-op.
6267
+ */
6268
+ dispose(): void;
6269
+ }
6270
+
6006
6271
  /**
6007
6272
  * Common type guard utilities
6008
6273
  */
@@ -6805,5 +7070,36 @@ declare function isValidPlatformType(value: string): value is PlatformType;
6805
7070
  */
6806
7071
  declare function getAllPlatformTypes(): PlatformType[];
6807
7072
 
6808
- export { AUTHORABLE_MEDIA_TYPES, BRIDGED_CHANNELS, CHANNEL_SCHEMAS, CONTEXT_FULL_WEIGHT, CONTEXT_PARTIAL_WEIGHT, ConfigurationError, ConflictError, EMBEDDABLE_MEDIA_TYPES, EventBus, JWTTokenSchema, LOCALES, MEDIA_TYPES, NotFoundError, PERSISTED_EVENT_TYPES, POSITION_WEIGHT_MAX, POSITION_WINDOW, RESOURCE_BROADCAST_TYPES, ScopedEventBus, ScriptError, SemiontError, UnauthorizedError, ValidationError, accessToken, agentToDid, anchorAnnotation, annotationId, annotationUri, applyBodyOperations, assembleAnnotation, authCode, baseMediaType, baseUrl, buildContentCache, burstBuffer, busLog, busLogEnabled, capabilitiesOf, cloneToken, createCircleSvg, createFragmentSelector, createPolygonSvg, createRectangleSvg, createTomlConfigLoader, decodeRepresentation, decodeWithCharset, didToAgent, email, entityType, errField, extensionForMediaType, extractBoundingBox, extractCharset, extractContext, findBestTextMatch, findBodyItem, formatLocaleDisplay, generateUuid, getAllLocaleCodes, getAllPlatformTypes, getAnnotationExactText, getAnnotationUriFromEvent, getBodySource, getBodyType, getChecksum, getCommentText, getCreator, getDerivedFrom, getExactText, getFragmentSelector, getLanguage, getLocaleEnglishName, getLocaleInfo, getLocaleNativeName, getNodeEncoding, getPageFromFragment, getPrimaryMediaType, getPrimaryRepresentation, getPrimarySelector, getResourceEntityTypes, getResourceId, getStorageUri, getSvgSelector, getTargetSelector, getTargetSource, getTextPositionSelector, getTextQuoteSelector, googleCredential, hasTargetSelector, isAnnotationId, isArchived, isArray, isAssessment, isBodyResolved, isBoolean, isComment, isDefined, isDraft, isEventRelatedToAnnotation, isFunction, isHighlight, isNull, isNullish, isNumber, isObject, isReference, isResolvedReference, isResourceId, isStoredEvent, isString, isStubReference, isSupportedMediaType, isTag, isUndefined, isValidEmail, isValidPlatformType, jobId, loadTomlConfig, mcpToken, mediaTypeForExtension, normalizeCoordinates, normalizeText, parseEnvironment, parseFragmentSelector, parseSvgSelector, reconcileSelector, refreshToken, resourceAnnotationUri, resourceId, resourceUri, scaleSvgToNative, searchQuery, serializePerKey, setBusLogTraceIdProvider, softwareToAgent, textExtractionOf, userDID, userId, userToAgent, userToDid, validateData, validateEnvironment, validateSvgMarkup, verifyPosition };
6809
- export type { AccessToken, AnchorConfidence, AnchorMethod, AnchorSelectors, AnchorStrategy, AnchoringModel, Annotation, AnnotationCategory, AnnotationId, AnnotationUri, AnthropicProviderConfig, AppConfig, AssembledAnnotation, AuthCode, BackendDownload, BackendServiceConfig, BaseUrl, BodyItem, BodyItemIdentity, BodyOperation, BoundingBox, Brand, BridgedChannel, BurstBufferOptions, BusOp, CloneToken, ConnectionState, ContentCache, ContentFormat, CreateAnnotationInternal, DatabaseServiceConfig, Email, EmbeddingServiceConfig, EmittableChannel, EntityType, EntityTypeStats, Environment, EnvironmentConfig, EventBase, EventInput, EventMap, EventMetadata, EventName, EventOfType, EventQuery, EventSignature, FragmentSelector, FrontendServiceConfig, GatheredContext, GoogleAuthRequest, GoogleCredential, GraphConnection, GraphDatabaseType, GraphPath, GraphServiceConfig, HealthCheckResponse, IBackendOperations, IContentTransport, ITransport, InferenceProvidersConfig, JobId, ListUsersResponse, LlmSelectorInput, LocaleInfo, Logger, MCPToken, MatchQuality, McpServiceConfig, MediaTypeCapabilities, Motivation, OllamaProviderConfig, PdfCoordinate, PersistedEvent, PersistedEventType, PlatformType, Point, ProgressCallback, ProgressEvent, PutBinaryOptions, PutBinaryProgress, PutBinaryRequest, ReconciledSelector, RefreshToken, RenderMode, RenderedAnchor, ResourceAnnotationUri, ResourceAnnotations, ResourceBroadcastType, ResourceDescriptor, ResourceFilter, ResourceId, ResourceUri, SearchQuery, SelectionData, Selector, SemiontConfig, ServicePlatformConfig, ServicesConfig, SiteConfig, StatusResponse, StoredEvent, StoredEventLike, SupportedMediaType, SvgSelector, TagCategory, TagSchema, TextExtraction, TextPosition, TextPositionSelector, TextQuoteSelector, ActorInferenceConfig as TomlActorInferenceConfig, TomlFileReader, InferenceConfig as TomlInferenceConfig, WorkerInferenceConfig as TomlWorkerInferenceConfig, TransportErrorCode, UpdateResourceInput, UpdateUserRequest, UpdateUserResponse, UserDID, UserId, UserResponse, ValidationFailure, ValidationResult, ValidationSuccess, VectorsServiceConfig, components, operations, paths };
7073
+ /**
7074
+ * Knowledge-graph view derivation (CONTEXT-UNIFICATION P3, Q1=A).
7075
+ *
7076
+ * A pure function over the core `KnowledgeGraph` type, so both `@semiont/make-meaning` (the matcher)
7077
+ * and `@semiont/jobs` (the generation prompt builder) can share one derivation. `buildKnowledgeGraph`
7078
+ * — which queries the graph DB — stays in make-meaning; this only transforms an already-built graph.
7079
+ *
7080
+ * Reports the graph as-is (Option A): missing-view citers are kept (the citation edge reflects a real
7081
+ * reference event); the only filter is excluding the focal annotation from siblings (an annotation
7082
+ * isn't its own sibling). Peer connections are edges out of `mainResourceId`; citations and
7083
+ * `annotation-of` edges point INTO it. The graph is a projection of the event log (the system of
7084
+ * record), read here because it is the queryable projection at gather time.
7085
+ */
7086
+
7087
+ type KnowledgeGraph = components['schemas']['KnowledgeGraph'];
7088
+ interface GraphViews {
7089
+ connections: {
7090
+ resourceId: string;
7091
+ resourceName: string;
7092
+ entityTypes: string[];
7093
+ bidirectional: boolean;
7094
+ }[];
7095
+ citedBy: {
7096
+ resourceId: string;
7097
+ resourceName: string;
7098
+ }[];
7099
+ citedByCount: number;
7100
+ siblingEntityTypes: string[];
7101
+ }
7102
+ declare function deriveViews(graph: KnowledgeGraph, mainResourceId: string, focalAnnotationId?: string): GraphViews;
7103
+
7104
+ export { AUTHORABLE_MEDIA_TYPES, BRIDGED_CHANNELS, BusRequestError, CHANNEL_SCHEMAS, CONTEXT_FULL_WEIGHT, CONTEXT_PARTIAL_WEIGHT, ConfigurationError, ConflictError, EMBEDDABLE_MEDIA_TYPES, EventBus, JWTTokenSchema, LOCALES, MEDIA_TYPES, NotFoundError, PERSISTED_EVENT_TYPES, POSITION_WEIGHT_MAX, POSITION_WINDOW, RESOURCE_BROADCAST_TYPES, ScopedEventBus, ScriptError, SemiontError, UnauthorizedError, ValidationError, accessToken, agentToDid, anchorAnnotation, annotationId, annotationUri, applyBodyOperations, assembleAnnotation, authCode, baseMediaType, baseUrl, buildContentCache, burstBuffer, busLog, busLogEnabled, busRequest, capabilitiesOf, cloneToken, createCircleSvg, createFragmentSelector, createPolygonSvg, createRectangleSvg, createTomlConfigLoader, decodeRepresentation, decodeWithCharset, deriveViews, didToAgent, email, entityType, errField, extensionForMediaType, extractBoundingBox, extractCharset, extractContext, findBestTextMatch, findBodyItem, formatLocaleDisplay, generateUuid, getAllLocaleCodes, getAllPlatformTypes, getAnnotationExactText, getAnnotationUriFromEvent, getBodySource, getBodyType, getChecksum, getCommentText, getCreator, getDerivedFrom, getExactText, getFragmentSelector, getLanguage, getLocaleEnglishName, getLocaleInfo, getLocaleNativeName, getNodeEncoding, getPageFromFragment, getPrimaryMediaType, getPrimaryRepresentation, getPrimarySelector, getResourceEntityTypes, getResourceId, getStorageUri, getSvgSelector, getTargetSelector, getTargetSource, getTextPositionSelector, getTextQuoteSelector, googleCredential, hasTargetSelector, isAnnotationId, isArchived, isArray, isAssessment, isBodyResolved, isBoolean, isComment, isDefined, isDraft, isEventRelatedToAnnotation, isFunction, isHighlight, isNull, isNullish, isNumber, isObject, isReference, isResolvedReference, isResourceId, isStoredEvent, isString, isStubReference, isSupportedMediaType, isTag, isUndefined, isValidEmail, isValidPlatformType, jobId, loadTomlConfig, mcpToken, mediaTypeForExtension, normalizeCoordinates, normalizeText, parseEnvironment, parseFragmentSelector, parseSvgSelector, reconcileSelector, refreshToken, resourceAnnotationUri, resourceId, resourceUri, scaleSvgToNative, searchQuery, serializePerKey, setBusLogTraceIdProvider, softwareToAgent, textExtractionOf, userDID, userId, userToAgent, userToDid, validateData, validateEnvironment, validateSvgMarkup, verifyPosition };
7105
+ export type { AccessToken, AnchorConfidence, AnchorMethod, AnchorSelectors, AnchorStrategy, AnchoringModel, Annotation, AnnotationCategory, AnnotationId, AnnotationUri, AnthropicProviderConfig, AppConfig, AssembledAnnotation, AuthCode, BackendDownload, BackendServiceConfig, BaseUrl, BodyItem, BodyItemIdentity, BodyOperation, BoundingBox, Brand, BridgedChannel, BurstBufferOptions, BusOp, BusRequestErrorCode, BusRequestPrimitive, CloneToken, ConnectionState, ContentCache, ContentFormat, CreateAnnotationInternal, DatabaseServiceConfig, Email, EmbeddingServiceConfig, EmittableChannel, EntityType, EntityTypeStats, Environment, EnvironmentConfig, EventBase, EventInput, EventMap, EventMetadata, EventName, EventOfType, EventQuery, EventSignature, FragmentSelector, FrontendServiceConfig, GatheredContext, GoogleAuthRequest, GoogleCredential, GraphConnection, GraphDatabaseType, GraphPath, GraphServiceConfig, GraphViews, HealthCheckResponse, IBackendOperations, IContentTransport, ITransport, InferenceProvidersConfig, JobId, ListUsersResponse, LlmSelectorInput, LocaleInfo, Logger, MCPToken, MatchQuality, McpServiceConfig, MediaTypeCapabilities, Motivation, OllamaProviderConfig, PdfCoordinate, PersistedEvent, PersistedEventType, PlatformType, Point, ProgressCallback, ProgressEvent, PutBinaryOptions, PutBinaryProgress, PutBinaryRequest, ReconciledSelector, RefreshToken, RenderMode, RenderedAnchor, ResourceAnnotationUri, ResourceAnnotations, ResourceBroadcastType, ResourceDescriptor, ResourceFilter, ResourceId, ResourceUri, SearchQuery, SelectionData, Selector, SemiontConfig, ServicePlatformConfig, ServicesConfig, SiteConfig, StateUnit, StatusResponse, StoredEvent, StoredEventLike, SupportedMediaType, SvgSelector, TagCategory, TagSchema, TextExtraction, TextPosition, TextPositionSelector, TextQuoteSelector, ActorInferenceConfig as TomlActorInferenceConfig, TomlFileReader, InferenceConfig as TomlInferenceConfig, WorkerInferenceConfig as TomlWorkerInferenceConfig, TransportErrorCode, UpdateResourceInput, UpdateUserRequest, UpdateUserResponse, UserDID, UserId, UserResponse, ValidationFailure, ValidationResult, ValidationSuccess, VectorsServiceConfig, components, operations, paths };