@semiont/core 0.4.2 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1722,92 +1722,183 @@ interface paths {
1722
1722
  patch?: never;
1723
1723
  trace?: never;
1724
1724
  };
1725
- "/resources/{id}/llm-context": {
1725
+ "/resources/{id}/gather-resource-stream": {
1726
1726
  parameters: {
1727
1727
  query?: never;
1728
1728
  header?: never;
1729
1729
  path?: never;
1730
1730
  cookie?: never;
1731
1731
  };
1732
+ get?: never;
1733
+ put?: never;
1732
1734
  /**
1733
- * Get Resource LLM Context
1734
- * @description Get resource with full context for LLM processing
1735
+ * Gather Resource LLM Context (SSE Stream)
1736
+ * @description Stream real-time resource LLM context gathering progress via Server-Sent Events
1735
1737
  */
1736
- get: {
1738
+ post: {
1737
1739
  parameters: {
1738
- query?: {
1739
- depth?: number;
1740
- maxResources?: number;
1741
- includeContent?: "true" | "false" | boolean;
1742
- includeSummary?: "true" | "false" | boolean;
1743
- };
1740
+ query?: never;
1744
1741
  header?: never;
1745
1742
  path: {
1746
1743
  id: string;
1747
1744
  };
1748
1745
  cookie?: never;
1749
1746
  };
1750
- requestBody?: never;
1747
+ requestBody?: {
1748
+ content: {
1749
+ "application/json": components["schemas"]["GatherResourceStreamRequest"];
1750
+ };
1751
+ };
1751
1752
  responses: {
1752
- /** @description LLM context */
1753
+ /** @description SSE stream opened successfully */
1753
1754
  200: {
1754
1755
  headers: {
1755
1756
  [name: string]: unknown;
1756
1757
  };
1757
1758
  content: {
1758
- "application/json": components["schemas"]["ResourceLLMContextResponse"];
1759
+ "text/event-stream": components["schemas"]["EventStreamResponse"];
1759
1760
  };
1760
1761
  };
1762
+ /** @description Authentication required */
1763
+ 401: {
1764
+ headers: {
1765
+ [name: string]: unknown;
1766
+ };
1767
+ content?: never;
1768
+ };
1769
+ /** @description Resource not found */
1770
+ 404: {
1771
+ headers: {
1772
+ [name: string]: unknown;
1773
+ };
1774
+ content?: never;
1775
+ };
1761
1776
  };
1762
1777
  };
1763
- put?: never;
1764
- post?: never;
1765
1778
  delete?: never;
1766
1779
  options?: never;
1767
1780
  head?: never;
1768
1781
  patch?: never;
1769
1782
  trace?: never;
1770
1783
  };
1771
- "/resources/{resourceId}/annotations/{annotationId}/llm-context": {
1784
+ "/resources/{resourceId}/annotations/{annotationId}/gather-annotation-stream": {
1772
1785
  parameters: {
1773
1786
  query?: never;
1774
1787
  header?: never;
1775
1788
  path?: never;
1776
1789
  cookie?: never;
1777
1790
  };
1791
+ get?: never;
1792
+ put?: never;
1778
1793
  /**
1779
- * Get Annotation LLM Context
1780
- * @description Get annotation with full context for LLM processing
1794
+ * Gather Annotation LLM Context (SSE Stream)
1795
+ * @description Stream real-time annotation LLM context gathering progress via Server-Sent Events
1781
1796
  */
1782
- get: {
1797
+ post: {
1783
1798
  parameters: {
1784
- query?: {
1785
- includeSourceContext?: "true" | "false" | boolean;
1786
- includeTargetContext?: "true" | "false" | boolean;
1787
- contextWindow?: number;
1788
- };
1799
+ query?: never;
1789
1800
  header?: never;
1790
1801
  path: {
1802
+ /** @description Resource ID */
1791
1803
  resourceId: string;
1804
+ /** @description Annotation ID */
1792
1805
  annotationId: string;
1793
1806
  };
1794
1807
  cookie?: never;
1795
1808
  };
1796
- requestBody?: never;
1809
+ requestBody?: {
1810
+ content: {
1811
+ "application/json": components["schemas"]["GatherAnnotationStreamRequest"];
1812
+ };
1813
+ };
1797
1814
  responses: {
1798
- /** @description Annotation LLM context */
1815
+ /** @description SSE stream opened successfully */
1799
1816
  200: {
1800
1817
  headers: {
1801
1818
  [name: string]: unknown;
1802
1819
  };
1803
1820
  content: {
1804
- "application/json": components["schemas"]["AnnotationLLMContextResponse"];
1821
+ "text/event-stream": components["schemas"]["EventStreamResponse"];
1822
+ };
1823
+ };
1824
+ /** @description Authentication required */
1825
+ 401: {
1826
+ headers: {
1827
+ [name: string]: unknown;
1805
1828
  };
1829
+ content?: never;
1830
+ };
1831
+ /** @description Annotation not found */
1832
+ 404: {
1833
+ headers: {
1834
+ [name: string]: unknown;
1835
+ };
1836
+ content?: never;
1806
1837
  };
1807
1838
  };
1808
1839
  };
1840
+ delete?: never;
1841
+ options?: never;
1842
+ head?: never;
1843
+ patch?: never;
1844
+ trace?: never;
1845
+ };
1846
+ "/resources/{resourceId}/annotations/{annotationId}/bind-stream": {
1847
+ parameters: {
1848
+ query?: never;
1849
+ header?: never;
1850
+ path?: never;
1851
+ cookie?: never;
1852
+ };
1853
+ get?: never;
1809
1854
  put?: never;
1810
- post?: never;
1855
+ /**
1856
+ * Bind Annotation Body (SSE Stream)
1857
+ * @description Apply annotation body operations and stream completion via Server-Sent Events
1858
+ */
1859
+ post: {
1860
+ parameters: {
1861
+ query?: never;
1862
+ header?: never;
1863
+ path: {
1864
+ /** @description Resource ID */
1865
+ resourceId: string;
1866
+ /** @description Annotation ID */
1867
+ annotationId: string;
1868
+ };
1869
+ cookie?: never;
1870
+ };
1871
+ requestBody?: {
1872
+ content: {
1873
+ "application/json": components["schemas"]["BindAnnotationStreamRequest"];
1874
+ };
1875
+ };
1876
+ responses: {
1877
+ /** @description SSE stream opened successfully */
1878
+ 200: {
1879
+ headers: {
1880
+ [name: string]: unknown;
1881
+ };
1882
+ content: {
1883
+ "text/event-stream": components["schemas"]["EventStreamResponse"];
1884
+ };
1885
+ };
1886
+ /** @description Authentication required */
1887
+ 401: {
1888
+ headers: {
1889
+ [name: string]: unknown;
1890
+ };
1891
+ content?: never;
1892
+ };
1893
+ /** @description Annotation not found */
1894
+ 404: {
1895
+ headers: {
1896
+ [name: string]: unknown;
1897
+ };
1898
+ content?: never;
1899
+ };
1900
+ };
1901
+ };
1811
1902
  delete?: never;
1812
1903
  options?: never;
1813
1904
  head?: never;
@@ -2588,6 +2679,153 @@ interface paths {
2588
2679
  patch?: never;
2589
2680
  trace?: never;
2590
2681
  };
2682
+ "/api/participants/{id}/attention": {
2683
+ parameters: {
2684
+ query?: never;
2685
+ header?: never;
2686
+ path?: never;
2687
+ cookie?: never;
2688
+ };
2689
+ get?: never;
2690
+ put?: never;
2691
+ /**
2692
+ * Beckon Participant
2693
+ * @description Direct a participant's attention to a resource or annotation. Produces no persistent annotations — attention signal only. The participant may be a human username or an agent identifier.
2694
+ */
2695
+ post: {
2696
+ parameters: {
2697
+ query?: never;
2698
+ header?: never;
2699
+ path: {
2700
+ /** @description Participant username or agent identifier */
2701
+ id: string;
2702
+ };
2703
+ cookie?: never;
2704
+ };
2705
+ requestBody: {
2706
+ content: {
2707
+ "application/json": components["schemas"]["BeckonRequest"];
2708
+ };
2709
+ };
2710
+ responses: {
2711
+ /** @description Attention signal accepted */
2712
+ 202: {
2713
+ headers: {
2714
+ [name: string]: unknown;
2715
+ };
2716
+ content: {
2717
+ "application/json": components["schemas"]["BeckonResponse"];
2718
+ };
2719
+ };
2720
+ };
2721
+ };
2722
+ delete?: never;
2723
+ options?: never;
2724
+ head?: never;
2725
+ patch?: never;
2726
+ trace?: never;
2727
+ };
2728
+ "/api/participants/me/attention-stream": {
2729
+ parameters: {
2730
+ query?: never;
2731
+ header?: never;
2732
+ path?: never;
2733
+ cookie?: never;
2734
+ };
2735
+ /**
2736
+ * Participant Attention Stream
2737
+ * @description Open a persistent SSE connection to receive beckon signals directed at the authenticated participant. Signals are ephemeral — delivered if connected, dropped if not. No queue, no replay.
2738
+ */
2739
+ get: {
2740
+ parameters: {
2741
+ query?: never;
2742
+ header?: never;
2743
+ path?: never;
2744
+ cookie?: never;
2745
+ };
2746
+ requestBody?: never;
2747
+ responses: {
2748
+ /** @description SSE stream of beckon:focus events */
2749
+ 200: {
2750
+ headers: {
2751
+ [name: string]: unknown;
2752
+ };
2753
+ content: {
2754
+ "text/event-stream": string;
2755
+ };
2756
+ };
2757
+ };
2758
+ };
2759
+ put?: never;
2760
+ post?: never;
2761
+ delete?: never;
2762
+ options?: never;
2763
+ head?: never;
2764
+ patch?: never;
2765
+ trace?: never;
2766
+ };
2767
+ "/api/browse/files": {
2768
+ parameters: {
2769
+ query?: never;
2770
+ header?: never;
2771
+ path?: never;
2772
+ cookie?: never;
2773
+ };
2774
+ /**
2775
+ * Browse project directory
2776
+ * @description List files and directories in a project directory, merged with Knowledge Base metadata for tracked resources.
2777
+ */
2778
+ get: {
2779
+ parameters: {
2780
+ query?: {
2781
+ /** @description Directory path relative to project root. Empty string or omit for project root. */
2782
+ path?: string;
2783
+ /** @description Sort order for directory entries. */
2784
+ sort?: "name" | "mtime" | "annotationCount";
2785
+ };
2786
+ header?: never;
2787
+ path?: never;
2788
+ cookie?: never;
2789
+ };
2790
+ requestBody?: never;
2791
+ responses: {
2792
+ /** @description Directory listing with KB metadata merged */
2793
+ 200: {
2794
+ headers: {
2795
+ [name: string]: unknown;
2796
+ };
2797
+ content: {
2798
+ "application/json": components["schemas"]["BrowseFilesResponse"];
2799
+ };
2800
+ };
2801
+ /** @description Invalid path (e.g. path escapes project root) */
2802
+ 400: {
2803
+ headers: {
2804
+ [name: string]: unknown;
2805
+ };
2806
+ content: {
2807
+ "application/json": components["schemas"]["ErrorResponse"];
2808
+ };
2809
+ };
2810
+ /** @description Directory not found */
2811
+ 404: {
2812
+ headers: {
2813
+ [name: string]: unknown;
2814
+ };
2815
+ content: {
2816
+ "application/json": components["schemas"]["ErrorResponse"];
2817
+ };
2818
+ };
2819
+ };
2820
+ };
2821
+ put?: never;
2822
+ post?: never;
2823
+ delete?: never;
2824
+ options?: never;
2825
+ head?: never;
2826
+ patch?: never;
2827
+ trace?: never;
2828
+ };
2591
2829
  }
2592
2830
  interface components {
2593
2831
  schemas: {
@@ -2752,6 +2990,50 @@ interface components {
2752
2990
  token: string;
2753
2991
  isNewUser: boolean;
2754
2992
  };
2993
+ BrowseFilesResponse: {
2994
+ /** @description The directory path that was listed, relative to project root */
2995
+ path: string;
2996
+ entries: components["schemas"]["DirectoryEntry"][];
2997
+ };
2998
+ DirectoryEntry: components["schemas"]["FileEntry"] | components["schemas"]["DirEntry"];
2999
+ FileEntry: {
3000
+ /** @enum {string} */
3001
+ type: "file";
3002
+ /** @description Entry name (basename) */
3003
+ name: string;
3004
+ /** @description Path relative to project root */
3005
+ path: string;
3006
+ /** @description File size in bytes */
3007
+ size: number;
3008
+ /**
3009
+ * Format: date-time
3010
+ * @description Last modified time (ISO 8601)
3011
+ */
3012
+ mtime: string;
3013
+ /** @description True if this file is a tracked resource in the Knowledge Base */
3014
+ tracked: boolean;
3015
+ /** @description Resource ID (only when tracked is true) */
3016
+ resourceId?: string;
3017
+ /** @description Entity types assigned to this resource (only when tracked is true) */
3018
+ entityTypes?: string[];
3019
+ /** @description Number of annotations on this resource (only when tracked is true) */
3020
+ annotationCount?: number;
3021
+ /** @description DID of the user who created the resource (only when tracked is true) */
3022
+ creator?: string;
3023
+ };
3024
+ DirEntry: {
3025
+ /** @enum {string} */
3026
+ type: "dir";
3027
+ /** @description Entry name (basename) */
3028
+ name: string;
3029
+ /** @description Path relative to project root */
3030
+ path: string;
3031
+ /**
3032
+ * Format: date-time
3033
+ * @description Last modified time (ISO 8601)
3034
+ */
3035
+ mtime: string;
3036
+ };
2755
3037
  BodyOperationAdd: {
2756
3038
  /** @enum {string} */
2757
3039
  op: "add";
@@ -2773,6 +3055,22 @@ interface components {
2773
3055
  * @enum {string}
2774
3056
  */
2775
3057
  BodyType: "TextualBody" | "SpecificResource";
3058
+ BeckonRequest: {
3059
+ /** @description Resource to direct attention at */
3060
+ resourceId: string;
3061
+ /** @description Specific annotation within the resource (optional) */
3062
+ annotationId?: string;
3063
+ /** @description Human-readable context for the participant (max 500 chars) */
3064
+ message?: string;
3065
+ };
3066
+ BeckonResponse: {
3067
+ /** @description Username or agent identifier that was beckoned */
3068
+ participant: string;
3069
+ /** @description Resource the attention was directed at */
3070
+ resourceId: string;
3071
+ /** @description Annotation the attention was directed at (if provided) */
3072
+ annotationId?: string;
3073
+ };
2776
3074
  BulkAddEntityTypesRequest: {
2777
3075
  tags: string[];
2778
3076
  };
@@ -2901,6 +3199,26 @@ interface components {
2901
3199
  /** @description Include anaphoric/cataphoric references (e.g., 'the CEO', 'the tech giant') in addition to direct mentions */
2902
3200
  includeDescriptiveReferences?: boolean;
2903
3201
  };
3202
+ GatherResourceStreamRequest: {
3203
+ /** @description Graph traversal depth (default: 2) */
3204
+ depth?: number;
3205
+ /** @description Maximum related resources to include (default: 10) */
3206
+ maxResources?: number;
3207
+ /** @description Include full resource content (default: true) */
3208
+ includeContent?: boolean;
3209
+ /** @description Include AI-generated summary (default: false) */
3210
+ includeSummary?: boolean;
3211
+ };
3212
+ GatherAnnotationStreamRequest: {
3213
+ /** @description Characters of surrounding text context (default: 1000) */
3214
+ contextWindow?: number;
3215
+ };
3216
+ BindAnnotationStreamRequest: {
3217
+ /** @description Resource ID containing the annotation (required for O(1) Layer 3 lookup) */
3218
+ resourceId: string;
3219
+ /** @description Array of body modification operations to apply */
3220
+ operations: (components["schemas"]["BodyOperationAdd"] | components["schemas"]["BodyOperationRemove"] | components["schemas"]["BodyOperationReplace"])[];
3221
+ };
2904
3222
  AnnotateHighlightsStreamRequest: {
2905
3223
  /** @description Optional instructions to guide AI highlight annotation */
2906
3224
  instructions?: string;
@@ -2917,6 +3235,8 @@ interface components {
2917
3235
  tone?: "analytical" | "critical" | "balanced" | "constructive";
2918
3236
  /** @description Optional density: desired number of assessments per 2000 words of text (1-10) */
2919
3237
  density?: number;
3238
+ /** @description BCP 47 language tag for the generated assessment text (e.g. "en", "fr", "de") */
3239
+ language?: string;
2920
3240
  };
2921
3241
  AnnotateCommentsStreamRequest: {
2922
3242
  /** @description Optional instructions to guide AI comment annotation */
@@ -2928,6 +3248,8 @@ interface components {
2928
3248
  tone?: "scholarly" | "explanatory" | "conversational" | "technical";
2929
3249
  /** @description Optional density: desired number of comments per 2000 words of text (2-12) */
2930
3250
  density?: number;
3251
+ /** @description BCP 47 language tag for the generated comment text (e.g. 'en', 'fr', 'de') */
3252
+ language?: string;
2931
3253
  };
2932
3254
  AnnotateTagsStreamRequest: {
2933
3255
  /** @description Tag schema ID (e.g., 'legal-irac', 'scientific-imrad', 'argument-toulmin') */
@@ -3155,10 +3477,10 @@ interface components {
3155
3477
  refresh_token: string;
3156
3478
  };
3157
3479
  /**
3158
- * @description W3C Web Annotation motivation vocabulary - https://www.w3.org/TR/annotation-vocab/#motivation
3480
+ * @description Semiont-supported W3C Web Annotation motivations - https://www.w3.org/TR/annotation-vocab/#motivation
3159
3481
  * @enum {string}
3160
3482
  */
3161
- Motivation: "assessing" | "bookmarking" | "classifying" | "commenting" | "describing" | "editing" | "highlighting" | "identifying" | "linking" | "moderating" | "questioning" | "replying" | "tagging";
3483
+ Motivation: "assessing" | "commenting" | "highlighting" | "linking" | "tagging";
3162
3484
  OAuthConfigResponse: {
3163
3485
  providers: {
3164
3486
  name: string;
@@ -3258,6 +3580,8 @@ interface components {
3258
3580
  wasDerivedFrom?: string | string[];
3259
3581
  /** @description W3C PROV - agents responsible for this resource */
3260
3582
  wasAttributedTo?: components["schemas"]["Agent"] | components["schemas"]["Agent"][];
3583
+ /** @description Software agent that produced or processed this resource (W3C Web Annotation model) */
3584
+ generator?: components["schemas"]["Agent"] | components["schemas"]["Agent"][];
3261
3585
  /** @description Profile/shape URI this resource description conforms to. */
3262
3586
  conformsTo?: string | string[];
3263
3587
  /** @description Convenience set summarizing media types across representations. */
@@ -3328,7 +3652,7 @@ interface components {
3328
3652
  /** @description IRI of the target resource */
3329
3653
  source: string;
3330
3654
  /** @description Why this body is included */
3331
- purpose?: components["schemas"]["Motivation"];
3655
+ purpose?: components["schemas"]["BodyPurpose"];
3332
3656
  };
3333
3657
  StatusResponse: {
3334
3658
  status: string;
@@ -3362,7 +3686,7 @@ interface components {
3362
3686
  /** @description The text content (e.g., entity type name) */
3363
3687
  value: string;
3364
3688
  /** @description Why this body is included */
3365
- purpose?: components["schemas"]["Motivation"];
3689
+ purpose?: components["schemas"]["BodyPurpose"];
3366
3690
  /** @description MIME type (defaults to text/plain) */
3367
3691
  format?: string;
3368
3692
  /** @description BCP 47 language tag */
@@ -3443,6 +3767,11 @@ interface components {
3443
3767
  */
3444
3768
  conformsTo?: string;
3445
3769
  };
3770
+ /**
3771
+ * @description W3C Web Annotation body purpose vocabulary - https://www.w3.org/TR/annotation-vocab/#motivation
3772
+ * @enum {string}
3773
+ */
3774
+ BodyPurpose: "assessing" | "bookmarking" | "classifying" | "commenting" | "describing" | "editing" | "highlighting" | "identifying" | "linking" | "moderating" | "questioning" | "replying" | "tagging";
3446
3775
  /** @description Context gathered for an annotation. Includes source document excerpts, metadata, and graph-derived context. Used by both Find (bind) and Generate (yield) flows. */
3447
3776
  GatheredContext: {
3448
3777
  /** @description The annotation this context was gathered for */
@@ -3686,8 +4015,12 @@ interface ResourceCreatedEvent extends BaseEvent {
3686
4015
  storageUri?: string;
3687
4016
  language?: string;
3688
4017
  isDraft?: boolean;
3689
- generatedFrom?: string;
4018
+ generatedFrom?: {
4019
+ resourceId: string;
4020
+ annotationId: string;
4021
+ };
3690
4022
  generationPrompt?: string;
4023
+ generator?: components['schemas']['Agent'] | components['schemas']['Agent'][];
3691
4024
  };
3692
4025
  }
3693
4026
  interface ResourceClonedEvent extends BaseEvent {
@@ -4009,13 +4342,14 @@ interface MarkProgress {
4009
4342
  /**
4010
4343
  * Unified event map for all application events
4011
4344
  *
4012
- * Organized by workflow ("flows"):
4345
+ * Organized by workflow ("flows") and actor sections:
4013
4346
  * 1. Yield Flow - Resource generation from references
4014
4347
  * 2. Mark Flow - Manual + AI-assisted annotation (all motivations)
4015
4348
  * 3. Bind Flow - Reference linking/resolution (search modal)
4016
- * 4. Gather Flow - LLM context fetching from annotations
4017
- * 5. Browse Flow - Panel, sidebar, and application routing
4018
- * 6. Beckon Flow - Annotation hover/focus/sparkle coordination
4349
+ * 4. Matcher Flow - Candidate search for bind/link operations
4350
+ * 5. Gather Flow - LLM context fetching from annotations
4351
+ * 6. Browse Flow - Panel, sidebar, and application routing
4352
+ * 7. Beckon Flow - Annotation hover/focus/sparkle coordination
4019
4353
  *
4020
4354
  * Plus infrastructure events (domain events, SSE, resource operations, settings)
4021
4355
  */
@@ -4056,8 +4390,12 @@ type EventMap = {
4056
4390
  entityTypes?: string[];
4057
4391
  creationMethod?: CreationMethod;
4058
4392
  isDraft?: boolean;
4059
- generatedFrom?: string;
4393
+ generatedFrom?: {
4394
+ resourceId: string;
4395
+ annotationId: string;
4396
+ };
4060
4397
  generationPrompt?: string;
4398
+ generator?: components['schemas']['Agent'] | components['schemas']['Agent'][];
4061
4399
  noGit?: boolean;
4062
4400
  };
4063
4401
  'yield:created': {
@@ -4189,6 +4527,7 @@ type EventMap = {
4189
4527
  instructions?: string;
4190
4528
  tone?: 'scholarly' | 'explanatory' | 'conversational' | 'technical' | 'analytical' | 'critical' | 'balanced' | 'constructive';
4191
4529
  density?: number;
4530
+ language?: string;
4192
4531
  entityTypes?: string[];
4193
4532
  includeDescriptiveReferences?: boolean;
4194
4533
  schemaId?: string;
@@ -4247,17 +4586,6 @@ type EventMap = {
4247
4586
  'mark:entity-type-add-failed': {
4248
4587
  error: Error;
4249
4588
  };
4250
- 'mark:entity-types-requested': {
4251
- correlationId: string;
4252
- };
4253
- 'mark:entity-types-result': {
4254
- correlationId: string;
4255
- response: components['schemas']['GetEntityTypesResponse'];
4256
- };
4257
- 'mark:entity-types-failed': {
4258
- correlationId: string;
4259
- error: Error;
4260
- };
4261
4589
  'mark:archive': void | {
4262
4590
  userId: UserId;
4263
4591
  resourceId?: ResourceId;
@@ -4282,13 +4610,6 @@ type EventMap = {
4282
4610
  defaultTitle: string;
4283
4611
  entityTypes: string[];
4284
4612
  };
4285
- 'bind:search-requested': {
4286
- correlationId?: string;
4287
- referenceId: string;
4288
- context: GatheredContext;
4289
- limit?: number;
4290
- useSemanticScoring?: boolean;
4291
- };
4292
4613
  'bind:update-body': {
4293
4614
  annotationId: AnnotationId;
4294
4615
  resourceId: ResourceId;
@@ -4306,7 +4627,20 @@ type EventMap = {
4306
4627
  'bind:body-update-failed': {
4307
4628
  error: Error;
4308
4629
  };
4309
- 'bind:search-results': {
4630
+ 'bind:finished': {
4631
+ annotationId: AnnotationId;
4632
+ };
4633
+ 'bind:failed': {
4634
+ error: Error;
4635
+ };
4636
+ 'match:search-requested': {
4637
+ correlationId?: string;
4638
+ referenceId: string;
4639
+ context: GatheredContext;
4640
+ limit?: number;
4641
+ useSemanticScoring?: boolean;
4642
+ };
4643
+ 'match:search-results': {
4310
4644
  referenceId: string;
4311
4645
  results: Array<components['schemas']['ResourceDescriptor'] & {
4312
4646
  score?: number;
@@ -4314,24 +4648,11 @@ type EventMap = {
4314
4648
  }>;
4315
4649
  correlationId?: string;
4316
4650
  };
4317
- 'bind:search-failed': {
4651
+ 'match:search-failed': {
4318
4652
  referenceId: string;
4319
4653
  error: Error;
4320
4654
  correlationId?: string;
4321
4655
  };
4322
- 'bind:referenced-by-requested': {
4323
- correlationId: string;
4324
- resourceId: ResourceId;
4325
- motivation?: string;
4326
- };
4327
- 'bind:referenced-by-result': {
4328
- correlationId: string;
4329
- response: components['schemas']['GetReferencedByResponse'];
4330
- };
4331
- 'bind:referenced-by-failed': {
4332
- correlationId: string;
4333
- error: Error;
4334
- };
4335
4656
  'gather:requested': {
4336
4657
  correlationId?: string;
4337
4658
  annotationId: AnnotationId;
@@ -4352,6 +4673,15 @@ type EventMap = {
4352
4673
  annotationId: AnnotationId;
4353
4674
  error: Error;
4354
4675
  };
4676
+ 'gather:annotation-progress': {
4677
+ message?: string;
4678
+ percentage?: number;
4679
+ };
4680
+ 'gather:annotation-finished': {
4681
+ correlationId?: string;
4682
+ annotationId: AnnotationId;
4683
+ response: components['schemas']['AnnotationLLMContextResponse'];
4684
+ };
4355
4685
  'gather:resource-requested': {
4356
4686
  correlationId?: string;
4357
4687
  resourceId: ResourceId;
@@ -4372,6 +4702,15 @@ type EventMap = {
4372
4702
  resourceId: ResourceId;
4373
4703
  error: Error;
4374
4704
  };
4705
+ 'gather:progress': {
4706
+ message?: string;
4707
+ percentage?: number;
4708
+ };
4709
+ 'gather:finished': {
4710
+ correlationId?: string;
4711
+ resourceId: ResourceId;
4712
+ context: components['schemas']['ResourceLLMContextResponse'];
4713
+ };
4375
4714
  'browse:click': {
4376
4715
  annotationId: string;
4377
4716
  motivation: Motivation;
@@ -4407,7 +4746,7 @@ type EventMap = {
4407
4746
  cancelFallback: () => void;
4408
4747
  };
4409
4748
  'browse:reference-navigate': {
4410
- documentId: string;
4749
+ resourceId: string;
4411
4750
  };
4412
4751
  'browse:entity-type-clicked': {
4413
4752
  entityType: string;
@@ -4493,11 +4832,53 @@ type EventMap = {
4493
4832
  correlationId: string;
4494
4833
  error: Error;
4495
4834
  };
4835
+ 'browse:referenced-by-requested': {
4836
+ correlationId: string;
4837
+ resourceId: ResourceId;
4838
+ motivation?: string;
4839
+ };
4840
+ 'browse:referenced-by-result': {
4841
+ correlationId: string;
4842
+ response: components['schemas']['GetReferencedByResponse'];
4843
+ };
4844
+ 'browse:referenced-by-failed': {
4845
+ correlationId: string;
4846
+ error: Error;
4847
+ };
4848
+ 'browse:entity-types-requested': {
4849
+ correlationId: string;
4850
+ };
4851
+ 'browse:entity-types-result': {
4852
+ correlationId: string;
4853
+ response: components['schemas']['GetEntityTypesResponse'];
4854
+ };
4855
+ 'browse:entity-types-failed': {
4856
+ correlationId: string;
4857
+ error: Error;
4858
+ };
4859
+ 'browse:directory-requested': {
4860
+ correlationId: string;
4861
+ path: string;
4862
+ sort?: 'name' | 'mtime' | 'annotationCount';
4863
+ };
4864
+ 'browse:directory-result': {
4865
+ correlationId: string;
4866
+ response: {
4867
+ path: string;
4868
+ entries: components['schemas']['DirectoryEntry'][];
4869
+ };
4870
+ };
4871
+ 'browse:directory-failed': {
4872
+ correlationId: string;
4873
+ path: string;
4874
+ error: Error;
4875
+ };
4496
4876
  'beckon:hover': {
4497
4877
  annotationId: string | null;
4498
4878
  };
4499
4879
  'beckon:focus': {
4500
- annotationId: string | null;
4880
+ annotationId?: string;
4881
+ resourceId?: string;
4501
4882
  };
4502
4883
  'beckon:sparkle': {
4503
4884
  annotationId: string;
@@ -5008,16 +5389,17 @@ type Agent = components['schemas']['Agent'];
5008
5389
  /**
5009
5390
  * Convert a user object to a DID:WEB identifier
5010
5391
  *
5011
- * Format: did:web:domain.com:users:userId
5012
- * Example: did:web:example.com:users:abc123
5392
+ * Format: did:web:domain.com:users:email%40domain.com
5393
+ * Example: did:web:example.com:users:alice%40example.com
5013
5394
  *
5395
+ * Email is used as the stable, human-readable identifier (URI-encoded).
5014
5396
  * This is used for W3C Web Annotation compliance and federation readiness.
5015
5397
  *
5016
- * @param user - User object with id and domain
5398
+ * @param user - User object with email and domain
5017
5399
  * @returns DID:WEB identifier string
5018
5400
  */
5019
5401
  declare function userToDid(user: {
5020
- id: string;
5402
+ email: string;
5021
5403
  domain: string;
5022
5404
  }): string;
5023
5405
  /**