@semiont/core 0.2.34-build.91 → 0.2.34-build.92

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
@@ -1157,7 +1157,7 @@ interface paths {
1157
1157
  patch?: never;
1158
1158
  trace?: never;
1159
1159
  };
1160
- "/resources/{id}/detect-annotations-stream": {
1160
+ "/resources/{id}/annotate-references-stream": {
1161
1161
  parameters: {
1162
1162
  query?: never;
1163
1163
  header?: never;
@@ -1167,8 +1167,8 @@ interface paths {
1167
1167
  get?: never;
1168
1168
  put?: never;
1169
1169
  /**
1170
- * Detect Annotations with Progress (SSE)
1171
- * @description Stream real-time entity detection progress via Server-Sent Events
1170
+ * Annotate References with Progress (SSE)
1171
+ * @description Stream real-time reference annotation progress via Server-Sent Events
1172
1172
  */
1173
1173
  post: {
1174
1174
  parameters: {
@@ -1181,7 +1181,7 @@ interface paths {
1181
1181
  };
1182
1182
  requestBody?: {
1183
1183
  content: {
1184
- "application/json": components["schemas"]["DetectReferencesStreamRequest"];
1184
+ "application/json": components["schemas"]["AnnotateReferencesStreamRequest"];
1185
1185
  };
1186
1186
  };
1187
1187
  responses: {
@@ -1216,7 +1216,7 @@ interface paths {
1216
1216
  patch?: never;
1217
1217
  trace?: never;
1218
1218
  };
1219
- "/resources/{id}/detect-highlights-stream": {
1219
+ "/resources/{id}/annotate-highlights-stream": {
1220
1220
  parameters: {
1221
1221
  query?: never;
1222
1222
  header?: never;
@@ -1226,8 +1226,8 @@ interface paths {
1226
1226
  get?: never;
1227
1227
  put?: never;
1228
1228
  /**
1229
- * Detect Highlights with Progress (SSE)
1230
- * @description Stream real-time highlight detection progress via Server-Sent Events
1229
+ * Annotate Highlights with Progress (SSE)
1230
+ * @description Stream real-time highlight annotation progress via Server-Sent Events
1231
1231
  */
1232
1232
  post: {
1233
1233
  parameters: {
@@ -1240,7 +1240,7 @@ interface paths {
1240
1240
  };
1241
1241
  requestBody?: {
1242
1242
  content: {
1243
- "application/json": components["schemas"]["DetectHighlightsStreamRequest"];
1243
+ "application/json": components["schemas"]["AnnotateHighlightsStreamRequest"];
1244
1244
  };
1245
1245
  };
1246
1246
  responses: {
@@ -1275,7 +1275,7 @@ interface paths {
1275
1275
  patch?: never;
1276
1276
  trace?: never;
1277
1277
  };
1278
- "/resources/{id}/detect-assessments-stream": {
1278
+ "/resources/{id}/annotate-assessments-stream": {
1279
1279
  parameters: {
1280
1280
  query?: never;
1281
1281
  header?: never;
@@ -1285,8 +1285,8 @@ interface paths {
1285
1285
  get?: never;
1286
1286
  put?: never;
1287
1287
  /**
1288
- * Detect Assessments with Progress (SSE)
1289
- * @description Stream real-time assessment detection progress via Server-Sent Events
1288
+ * Annotate Assessments with Progress (SSE)
1289
+ * @description Stream real-time assessment annotation progress via Server-Sent Events
1290
1290
  */
1291
1291
  post: {
1292
1292
  parameters: {
@@ -1299,7 +1299,7 @@ interface paths {
1299
1299
  };
1300
1300
  requestBody?: {
1301
1301
  content: {
1302
- "application/json": components["schemas"]["DetectAssessmentsStreamRequest"];
1302
+ "application/json": components["schemas"]["AnnotateAssessmentsStreamRequest"];
1303
1303
  };
1304
1304
  };
1305
1305
  responses: {
@@ -1334,7 +1334,7 @@ interface paths {
1334
1334
  patch?: never;
1335
1335
  trace?: never;
1336
1336
  };
1337
- "/resources/{id}/detect-comments-stream": {
1337
+ "/resources/{id}/annotate-comments-stream": {
1338
1338
  parameters: {
1339
1339
  query?: never;
1340
1340
  header?: never;
@@ -1344,8 +1344,8 @@ interface paths {
1344
1344
  get?: never;
1345
1345
  put?: never;
1346
1346
  /**
1347
- * Detect Comments with Progress (SSE)
1348
- * @description Stream real-time comment detection progress via Server-Sent Events
1347
+ * Annotate Comments with Progress (SSE)
1348
+ * @description Stream real-time comment annotation progress via Server-Sent Events
1349
1349
  */
1350
1350
  post: {
1351
1351
  parameters: {
@@ -1358,7 +1358,7 @@ interface paths {
1358
1358
  };
1359
1359
  requestBody?: {
1360
1360
  content: {
1361
- "application/json": components["schemas"]["DetectCommentsStreamRequest"];
1361
+ "application/json": components["schemas"]["AnnotateCommentsStreamRequest"];
1362
1362
  };
1363
1363
  };
1364
1364
  responses: {
@@ -1393,7 +1393,7 @@ interface paths {
1393
1393
  patch?: never;
1394
1394
  trace?: never;
1395
1395
  };
1396
- "/resources/{id}/detect-tags-stream": {
1396
+ "/resources/{id}/annotate-tags-stream": {
1397
1397
  parameters: {
1398
1398
  query?: never;
1399
1399
  header?: never;
@@ -1403,8 +1403,8 @@ interface paths {
1403
1403
  get?: never;
1404
1404
  put?: never;
1405
1405
  /**
1406
- * Detect Tags with Progress (SSE)
1407
- * @description Stream real-time tag detection progress via Server-Sent Events. Identifies passages serving specific structural roles (IRAC, IMRAD, Toulmin frameworks).
1406
+ * Annotate Tags with Progress (SSE)
1407
+ * @description Stream real-time tag annotation progress via Server-Sent Events. Identifies passages serving specific structural roles (IRAC, IMRAD, Toulmin frameworks).
1408
1408
  */
1409
1409
  post: {
1410
1410
  parameters: {
@@ -1417,7 +1417,7 @@ interface paths {
1417
1417
  };
1418
1418
  requestBody?: {
1419
1419
  content: {
1420
- "application/json": components["schemas"]["DetectTagsStreamRequest"];
1420
+ "application/json": components["schemas"]["AnnotateTagsStreamRequest"];
1421
1421
  };
1422
1422
  };
1423
1423
  responses: {
@@ -2440,7 +2440,7 @@ interface components {
2440
2440
  /** @enum {string} */
2441
2441
  status: "pending" | "running" | "complete" | "failed" | "cancelled";
2442
2442
  /** @enum {string} */
2443
- type: "detection" | "generation";
2443
+ type: "reference-annotation" | "generation";
2444
2444
  created: string;
2445
2445
  };
2446
2446
  AuthResponse: {
@@ -2547,7 +2547,7 @@ interface components {
2547
2547
  CreateJobResponse: {
2548
2548
  jobId: string;
2549
2549
  /** @enum {string} */
2550
- type: "detection" | "generation";
2550
+ type: "reference-annotation" | "generation";
2551
2551
  /** @enum {string} */
2552
2552
  status: "pending" | "running" | "complete" | "failed" | "cancelled";
2553
2553
  created: string;
@@ -2613,20 +2613,20 @@ interface components {
2613
2613
  success: boolean;
2614
2614
  message: string;
2615
2615
  };
2616
- DetectReferencesStreamRequest: {
2617
- /** @description Entity types to detect (e.g., 'Person', 'Organization', 'Location') */
2616
+ AnnotateReferencesStreamRequest: {
2617
+ /** @description Entity types to annotate (e.g., 'Person', 'Organization', 'Location') */
2618
2618
  entityTypes: string[];
2619
2619
  /** @description Include anaphoric/cataphoric references (e.g., 'the CEO', 'the tech giant') in addition to direct mentions */
2620
2620
  includeDescriptiveReferences?: boolean;
2621
2621
  };
2622
- DetectHighlightsStreamRequest: {
2623
- /** @description Optional instructions to guide AI highlight detection */
2622
+ AnnotateHighlightsStreamRequest: {
2623
+ /** @description Optional instructions to guide AI highlight annotation */
2624
2624
  instructions?: string;
2625
2625
  /** @description Optional density: desired number of highlights per 2000 words of text (1-15) */
2626
2626
  density?: number;
2627
2627
  };
2628
- DetectAssessmentsStreamRequest: {
2629
- /** @description Optional instructions to guide AI assessment detection */
2628
+ AnnotateAssessmentsStreamRequest: {
2629
+ /** @description Optional instructions to guide AI assessment annotation */
2630
2630
  instructions?: string;
2631
2631
  /**
2632
2632
  * @description Optional tone/style for generated assessments
@@ -2636,8 +2636,8 @@ interface components {
2636
2636
  /** @description Optional density: desired number of assessments per 2000 words of text (1-10) */
2637
2637
  density?: number;
2638
2638
  };
2639
- DetectCommentsStreamRequest: {
2640
- /** @description Optional instructions to guide AI comment detection */
2639
+ AnnotateCommentsStreamRequest: {
2640
+ /** @description Optional instructions to guide AI comment annotation */
2641
2641
  instructions?: string;
2642
2642
  /**
2643
2643
  * @description Optional tone/style for generated comments
@@ -2647,10 +2647,10 @@ interface components {
2647
2647
  /** @description Optional density: desired number of comments per 2000 words of text (2-12) */
2648
2648
  density?: number;
2649
2649
  };
2650
- DetectTagsStreamRequest: {
2650
+ AnnotateTagsStreamRequest: {
2651
2651
  /** @description Tag schema ID (e.g., 'legal-irac', 'scientific-imrad', 'argument-toulmin') */
2652
2652
  schemaId: string;
2653
- /** @description Categories to detect from the selected schema (e.g., ['Issue', 'Rule', 'Application', 'Conclusion']) */
2653
+ /** @description Categories to annotate from the selected schema (e.g., ['Issue', 'Rule', 'Application', 'Conclusion']) */
2654
2654
  categories: string[];
2655
2655
  };
2656
2656
  ErrorResponse: {
@@ -2835,7 +2835,7 @@ interface components {
2835
2835
  JobStatusResponse: {
2836
2836
  jobId: string;
2837
2837
  /** @enum {string} */
2838
- type: "detection" | "generation" | "highlight-detection" | "assessment-detection" | "comment-detection" | "tag-detection";
2838
+ type: "reference-annotation" | "generation" | "highlight-annotation" | "assessment-annotation" | "comment-annotation" | "tag-annotation";
2839
2839
  /** @enum {string} */
2840
2840
  status: "pending" | "running" | "complete" | "failed" | "cancelled";
2841
2841
  userId: string;
@@ -3550,7 +3550,7 @@ interface JobStartedEvent extends BaseEvent {
3550
3550
  resourceId: ResourceId;
3551
3551
  payload: {
3552
3552
  jobId: JobId;
3553
- jobType: 'detection' | 'generation' | 'highlight-detection' | 'assessment-detection' | 'comment-detection' | 'tag-detection';
3553
+ jobType: 'reference-annotation' | 'generation' | 'highlight-annotation' | 'assessment-annotation' | 'comment-annotation' | 'tag-annotation';
3554
3554
  totalSteps?: number;
3555
3555
  };
3556
3556
  }
@@ -3559,7 +3559,7 @@ interface JobProgressEvent extends BaseEvent {
3559
3559
  resourceId: ResourceId;
3560
3560
  payload: {
3561
3561
  jobId: JobId;
3562
- jobType: 'detection' | 'generation' | 'highlight-detection' | 'assessment-detection' | 'comment-detection' | 'tag-detection';
3562
+ jobType: 'reference-annotation' | 'generation' | 'highlight-annotation' | 'assessment-annotation' | 'comment-annotation' | 'tag-annotation';
3563
3563
  percentage: number;
3564
3564
  currentStep?: string;
3565
3565
  processedSteps?: number;
@@ -3574,7 +3574,7 @@ interface JobCompletedEvent extends BaseEvent {
3574
3574
  resourceId: ResourceId;
3575
3575
  payload: {
3576
3576
  jobId: JobId;
3577
- jobType: 'detection' | 'generation' | 'highlight-detection' | 'assessment-detection' | 'comment-detection' | 'tag-detection';
3577
+ jobType: 'reference-annotation' | 'generation' | 'highlight-annotation' | 'assessment-annotation' | 'comment-annotation' | 'tag-annotation';
3578
3578
  totalSteps?: number;
3579
3579
  foundCount?: number;
3580
3580
  resultResourceId?: ResourceId;
@@ -3588,7 +3588,7 @@ interface JobFailedEvent extends BaseEvent {
3588
3588
  resourceId: ResourceId;
3589
3589
  payload: {
3590
3590
  jobId: JobId;
3591
- jobType: 'detection' | 'generation' | 'highlight-detection' | 'assessment-detection' | 'comment-detection' | 'tag-detection';
3591
+ jobType: 'reference-annotation' | 'generation' | 'highlight-annotation' | 'assessment-annotation' | 'comment-annotation' | 'tag-annotation';
3592
3592
  error: string;
3593
3593
  details?: string;
3594
3594
  };
@@ -3691,21 +3691,17 @@ declare function isResourceEvent(event: any): event is StoredEvent;
3691
3691
  /**
3692
3692
  * Event Protocol Types
3693
3693
  *
3694
- * Unified event map for all application events.
3695
- * This is the single source of truth for event types across backend, frontend, and CLI.
3696
- *
3697
- * Consolidates events from:
3698
- * - Backend events (SSE streams, job progress, resource operations)
3699
- * - User interaction events (selection, annotation hover/click, panels, toolbar)
3700
- * - Navigation events (sidebar, routing, links)
3701
- * - Settings events (theme, line numbers, locale)
3702
- * - API operation events (CRUD, detection, generation)
3694
+ * Type definitions for the application's event-driven architecture.
3695
+ * Single source of truth for all EventBus event types.
3703
3696
  */
3704
3697
 
3705
3698
  type Selector = components['schemas']['TextPositionSelector'] | components['schemas']['TextQuoteSelector'] | components['schemas']['SvgSelector'] | components['schemas']['FragmentSelector'];
3706
3699
  type GenerationContext = components['schemas']['GenerationContext'];
3707
3700
  type Annotation$2 = components['schemas']['Annotation'];
3708
3701
  type Motivation = components['schemas']['Motivation'];
3702
+ /**
3703
+ * Progress state for resource generation workflow
3704
+ */
3709
3705
  interface GenerationProgress {
3710
3706
  status: 'started' | 'fetching' | 'generating' | 'creating' | 'complete' | 'error';
3711
3707
  referenceId: string;
@@ -3729,19 +3725,18 @@ interface SelectionData {
3729
3725
  suffix?: string;
3730
3726
  }
3731
3727
  /**
3732
- * Common detection progress fields shared across all motivation types.
3728
+ * Progress state for annotation workflows (manual and assisted)
3733
3729
  *
3734
- * The five motivations have different SSE progress shapes
3735
- * (ReferenceDetectionProgress uses entity-type steps; the others use percentage).
3736
- * This type captures the subset of fields used by the detection UI
3737
- * (DetectionProgressWidget, useDetectionFlow).
3730
+ * Unified progress interface supporting different annotation strategies:
3731
+ * - Reference annotation: entity-type steps
3732
+ * - Other motivations: percentage-based progress
3738
3733
  */
3739
- interface DetectionProgress {
3734
+ interface AnnotationProgress {
3740
3735
  status: string;
3741
3736
  message?: string;
3742
- /** Reference detection: currently scanning entity type */
3737
+ /** Reference annotation: currently scanning entity type */
3743
3738
  currentEntityType?: string;
3744
- /** Reference detection: completed entity types with counts (frontend-only) */
3739
+ /** Reference annotation: completed entity types with counts (frontend-only) */
3745
3740
  completedEntityTypes?: Array<{
3746
3741
  entityType: string;
3747
3742
  foundCount: number;
@@ -3762,96 +3757,68 @@ interface DetectionProgress {
3762
3757
  * Unified event map for all application events
3763
3758
  *
3764
3759
  * Organized by workflow ("flows"):
3765
- * 1. AttentionFlow - Annotation hover/focus/sparkle coordination
3766
- * 2. DetectionFlow - Manual + AI annotation detection (all motivations)
3767
- * 3. GenerationFlow - Document generation from references
3768
- * 4. ResolutionFlow - Reference linking/resolution (search modal)
3769
- * 5. ContextRetrievalFlow - LLM context fetching from annotations
3760
+ * 1. Attention Flow - Annotation hover/focus/sparkle coordination
3761
+ * 2. Annotation Flow - Manual + AI-assisted annotation (all motivations)
3762
+ * 3. Context Retrieval Flow - LLM context fetching from annotations
3763
+ * 4. Generation Flow - Resource generation from references
3764
+ * 5. Resolution Flow - Reference linking/resolution (search modal)
3770
3765
  *
3771
3766
  * Plus infrastructure events (domain events, SSE, resource operations, navigation, settings)
3772
3767
  */
3773
3768
  type EventMap = {
3774
- 'annotation.added': Extract<ResourceEvent, {
3775
- type: 'annotation.added';
3776
- }>;
3777
- 'annotation.removed': Extract<ResourceEvent, {
3778
- type: 'annotation.removed';
3779
- }>;
3780
- 'annotation.body.updated': Extract<ResourceEvent, {
3781
- type: 'annotation.body.updated';
3782
- }>;
3783
- 'entitytag.added': Extract<ResourceEvent, {
3784
- type: 'entitytag.added';
3785
- }>;
3786
- 'entitytag.removed': Extract<ResourceEvent, {
3787
- type: 'entitytag.removed';
3788
- }>;
3789
- 'resource.archived': Extract<ResourceEvent, {
3790
- type: 'resource.archived';
3791
- }>;
3792
- 'resource.unarchived': Extract<ResourceEvent, {
3793
- type: 'resource.unarchived';
3794
- }>;
3795
- 'job.started': Extract<ResourceEvent, {
3796
- type: 'job.started';
3797
- }>;
3798
- 'job.completed': Extract<ResourceEvent, {
3799
- type: 'job.completed';
3800
- }>;
3801
- 'job.failed': Extract<ResourceEvent, {
3802
- type: 'job.failed';
3803
- }>;
3804
- 'representation.added': Extract<ResourceEvent, {
3805
- type: 'representation.added';
3806
- }>;
3807
- 'representation.removed': Extract<ResourceEvent, {
3808
- type: 'representation.removed';
3809
- }>;
3810
3769
  'make-meaning:event': ResourceEvent;
3811
- 'stream-connected': void;
3812
- 'annotation:hover': {
3770
+ 'attend:hover': {
3813
3771
  annotationId: string | null;
3814
3772
  };
3815
- 'annotation:click': {
3773
+ 'attend:click': {
3816
3774
  annotationId: string;
3817
3775
  motivation: Motivation;
3818
3776
  };
3819
- 'annotation:focus': {
3777
+ 'attend:focus': {
3820
3778
  annotationId: string | null;
3821
3779
  };
3822
- 'annotation:sparkle': {
3780
+ 'attend:sparkle': {
3823
3781
  annotationId: string;
3824
3782
  };
3825
- 'selection:comment-requested': SelectionData;
3826
- 'selection:tag-requested': SelectionData;
3827
- 'selection:assessment-requested': SelectionData;
3828
- 'selection:reference-requested': SelectionData;
3829
- 'annotation:requested': {
3783
+ 'attend:panel-toggle': {
3784
+ panel: string;
3785
+ };
3786
+ 'attend:panel-open': {
3787
+ panel: string;
3788
+ scrollToAnnotationId?: string;
3789
+ motivation?: string;
3790
+ };
3791
+ 'attend:panel-close': void;
3792
+ 'annotate:select-comment': SelectionData;
3793
+ 'annotate:select-tag': SelectionData;
3794
+ 'annotate:select-assessment': SelectionData;
3795
+ 'annotate:select-reference': SelectionData;
3796
+ 'annotate:requested': {
3830
3797
  selector: Selector | Selector[];
3831
3798
  motivation: Motivation;
3832
3799
  };
3833
- 'annotation:cancel-pending': void;
3834
- 'annotation:create': {
3800
+ 'annotate:cancel-pending': void;
3801
+ 'annotate:create': {
3835
3802
  motivation: Motivation;
3836
3803
  selector: Selector | Selector[];
3837
3804
  body: components['schemas']['AnnotationBody'][];
3838
3805
  };
3839
- 'annotation:created': {
3806
+ 'annotate:created': {
3840
3807
  annotation: Annotation$2;
3841
3808
  };
3842
- 'annotation:create-failed': {
3809
+ 'annotate:create-failed': {
3843
3810
  error: Error;
3844
3811
  };
3845
- 'annotation:delete': {
3812
+ 'annotate:delete': {
3846
3813
  annotationId: string;
3847
3814
  };
3848
- 'annotation:deleted': {
3815
+ 'annotate:deleted': {
3849
3816
  annotationId: string;
3850
3817
  };
3851
- 'annotation:delete-failed': {
3818
+ 'annotate:delete-failed': {
3852
3819
  error: Error;
3853
3820
  };
3854
- 'detection:start': {
3821
+ 'annotate:assist-request': {
3855
3822
  motivation: Motivation;
3856
3823
  options: {
3857
3824
  instructions?: string;
@@ -3863,68 +3830,56 @@ type EventMap = {
3863
3830
  categories?: string[];
3864
3831
  };
3865
3832
  };
3866
- 'detection:started': Extract<ResourceEvent, {
3867
- type: 'job.started';
3868
- }>;
3869
- 'detection:progress': DetectionProgress;
3870
- 'detection:entity-found': Extract<ResourceEvent, {
3871
- type: 'annotation.added';
3872
- }>;
3873
- 'detection:complete': {
3833
+ 'annotate:progress': AnnotationProgress;
3834
+ 'annotate:assist-finished': {
3874
3835
  motivation?: Motivation;
3875
3836
  resourceUri?: ResourceUri;
3876
- progress?: DetectionProgress;
3837
+ progress?: AnnotationProgress;
3877
3838
  };
3878
- 'detection:completed': Extract<ResourceEvent, {
3879
- type: 'job.completed';
3880
- }>;
3881
- 'detection:failed': Extract<ResourceEvent, {
3839
+ 'annotate:assist-failed': Extract<ResourceEvent, {
3882
3840
  type: 'job.failed';
3883
3841
  }>;
3884
- 'detection:cancelled': void;
3885
- 'detection:dismiss-progress': void;
3886
- 'generation:modal-open': {
3887
- annotationUri: string;
3888
- resourceUri: string;
3889
- defaultTitle: string;
3842
+ 'annotate:assist-cancelled': void;
3843
+ 'annotate:progress-dismiss': void;
3844
+ 'annotate:mode-toggled': void;
3845
+ 'annotate:selection-changed': {
3846
+ motivation: string | null;
3890
3847
  };
3891
- 'generation:start': {
3892
- annotationUri: string;
3893
- resourceUri: string;
3894
- options: {
3895
- title: string;
3896
- prompt?: string;
3897
- language?: string;
3898
- temperature?: number;
3899
- maxTokens?: number;
3900
- context: GenerationContext;
3901
- };
3848
+ 'annotate:click-changed': {
3849
+ action: string;
3902
3850
  };
3903
- 'generation:started': Extract<ResourceEvent, {
3904
- type: 'job.started';
3851
+ 'annotate:shape-changed': {
3852
+ shape: string;
3853
+ };
3854
+ 'annotate:added': Extract<ResourceEvent, {
3855
+ type: 'annotation.added';
3905
3856
  }>;
3906
- 'generation:progress': GenerationProgress;
3907
- 'generation:complete': GenerationProgress;
3908
- 'generation:completed': Extract<ResourceEvent, {
3909
- type: 'job.completed';
3857
+ 'annotate:removed': Extract<ResourceEvent, {
3858
+ type: 'annotation.removed';
3910
3859
  }>;
3911
- 'generation:failed': {
3912
- error: Error;
3913
- };
3914
- 'reference:create-manual': {
3860
+ 'annotate:body-updated': Extract<ResourceEvent, {
3861
+ type: 'annotation.body.updated';
3862
+ }>;
3863
+ 'annotate:entity-tag-added': Extract<ResourceEvent, {
3864
+ type: 'entitytag.added';
3865
+ }>;
3866
+ 'annotate:entity-tag-removed': Extract<ResourceEvent, {
3867
+ type: 'entitytag.removed';
3868
+ }>;
3869
+ 'resolve:create-manual': {
3915
3870
  annotationUri: string;
3916
3871
  title: string;
3917
3872
  entityTypes: string[];
3918
3873
  };
3919
- 'reference:link': {
3874
+ 'resolve:link': {
3920
3875
  annotationUri: string;
3921
3876
  searchTerm: string;
3922
3877
  };
3923
- 'resolution:search-requested': {
3878
+ 'resolve:search-requested': {
3924
3879
  referenceId: string;
3925
3880
  searchTerm: string;
3926
3881
  };
3927
- 'annotation:update-body': {
3882
+ 'resolve:update-body': {
3928
3883
  annotationUri: string;
3929
3884
  resourceId: string;
3930
3885
  operations: Array<{
@@ -3934,74 +3889,77 @@ type EventMap = {
3934
3889
  newItem?: components['schemas']['AnnotationBody'];
3935
3890
  }>;
3936
3891
  };
3937
- 'annotation:body-updated': {
3892
+ 'resolve:body-updated': {
3938
3893
  annotationUri: string;
3939
3894
  };
3940
- 'annotation:body-update-failed': {
3895
+ 'resolve:body-update-failed': {
3941
3896
  error: Error;
3942
3897
  };
3943
- 'context:retrieval-requested': {
3898
+ 'correlate:requested': {
3944
3899
  annotationUri: string;
3945
3900
  resourceUri: string;
3946
3901
  };
3947
- 'context:retrieval-complete': {
3902
+ 'correlate:complete': {
3948
3903
  annotationUri: string;
3949
3904
  context: GenerationContext;
3950
3905
  };
3951
- 'context:retrieval-failed': {
3906
+ 'correlate:failed': {
3952
3907
  annotationUri: string;
3953
3908
  error: Error;
3954
3909
  };
3955
- 'annotation:added': Extract<ResourceEvent, {
3956
- type: 'annotation.added';
3957
- }>;
3958
- 'annotation:removed': Extract<ResourceEvent, {
3959
- type: 'annotation.removed';
3960
- }>;
3961
- 'annotation:updated': Extract<ResourceEvent, {
3962
- type: 'annotation.body.updated';
3963
- }>;
3964
- 'entity-tag:added': Extract<ResourceEvent, {
3965
- type: 'entitytag.added';
3910
+ 'generate:modal-open': {
3911
+ annotationUri: string;
3912
+ resourceUri: string;
3913
+ defaultTitle: string;
3914
+ };
3915
+ 'generate:request': {
3916
+ annotationUri: string;
3917
+ resourceUri: string;
3918
+ options: {
3919
+ title: string;
3920
+ prompt?: string;
3921
+ language?: string;
3922
+ temperature?: number;
3923
+ maxTokens?: number;
3924
+ context: GenerationContext;
3925
+ };
3926
+ };
3927
+ 'generate:progress': GenerationProgress;
3928
+ 'generate:finished': GenerationProgress;
3929
+ 'generate:failed': {
3930
+ error: Error;
3931
+ };
3932
+ 'generate:representation-added': Extract<ResourceEvent, {
3933
+ type: 'representation.added';
3966
3934
  }>;
3967
- 'entity-tag:removed': Extract<ResourceEvent, {
3968
- type: 'entitytag.removed';
3935
+ 'generate:representation-removed': Extract<ResourceEvent, {
3936
+ type: 'representation.removed';
3969
3937
  }>;
3938
+ 'generate:clone': void;
3939
+ 'resource:archive': void;
3970
3940
  'resource:archived': Extract<ResourceEvent, {
3971
3941
  type: 'resource.archived';
3972
3942
  }>;
3943
+ 'resource:unarchive': void;
3973
3944
  'resource:unarchived': Extract<ResourceEvent, {
3974
3945
  type: 'resource.unarchived';
3975
3946
  }>;
3976
- 'resource:archive': void;
3977
- 'resource:unarchive': void;
3978
- 'resource:clone': void;
3947
+ 'job:started': Extract<ResourceEvent, {
3948
+ type: 'job.started';
3949
+ }>;
3950
+ 'job:completed': Extract<ResourceEvent, {
3951
+ type: 'job.completed';
3952
+ }>;
3953
+ 'job:failed': Extract<ResourceEvent, {
3954
+ type: 'job.failed';
3955
+ }>;
3979
3956
  'job:queued': {
3980
3957
  jobId: string;
3981
3958
  jobType: string;
3982
3959
  resourceId: string;
3983
3960
  };
3984
3961
  'job:cancel-requested': {
3985
- jobType: 'detection' | 'generation';
3986
- };
3987
- 'panel:toggle': {
3988
- panel: string;
3989
- };
3990
- 'panel:open': {
3991
- panel: string;
3992
- scrollToAnnotationId?: string;
3993
- motivation?: string;
3994
- };
3995
- 'panel:close': void;
3996
- 'view:mode-toggled': void;
3997
- 'toolbar:selection-changed': {
3998
- motivation: string | null;
3999
- };
4000
- 'toolbar:click-changed': {
4001
- action: string;
4002
- };
4003
- 'toolbar:shape-changed': {
4004
- shape: string;
3962
+ jobType: 'annotation' | 'generation';
4005
3963
  };
4006
3964
  'navigation:sidebar-toggle': void;
4007
3965
  'navigation:resource-close': {
@@ -4037,6 +3995,9 @@ type EventMap = {
4037
3995
  'settings:locale-changed': {
4038
3996
  locale: string;
4039
3997
  };
3998
+ 'settings:hover-delay-changed': {
3999
+ hoverDelayMs: number;
4000
+ };
4040
4001
  };
4041
4002
  /**
4042
4003
  * Union type of all valid event names
@@ -4063,16 +4024,16 @@ type EventName = keyof EventMap;
4063
4024
  * const eventBus = new EventBus();
4064
4025
  *
4065
4026
  * // Emit events
4066
- * eventBus.get('annotation:hover').next({ annotationId: 'ann-1' });
4027
+ * eventBus.get('attend:hover').next({ annotationId: 'ann-1' });
4067
4028
  *
4068
4029
  * // Subscribe to events
4069
- * const subscription = eventBus.get('annotation:hover').subscribe(({ annotationId }) => {
4030
+ * const subscription = eventBus.get('attend:hover').subscribe(({ annotationId }) => {
4070
4031
  * console.log('Hover:', annotationId);
4071
4032
  * });
4072
4033
  *
4073
4034
  * // Use RxJS operators
4074
4035
  * import { debounceTime } from 'rxjs/operators';
4075
- * eventBus.get('annotation:hover')
4036
+ * eventBus.get('attend:hover')
4076
4037
  * .pipe(debounceTime(100))
4077
4038
  * .subscribe(handleHover);
4078
4039
  *
@@ -4097,13 +4058,13 @@ declare class EventBus {
4097
4058
  * @example
4098
4059
  * ```typescript
4099
4060
  * // Emit
4100
- * eventBus.get('annotation:hover').next({ annotationId: 'ann-1' });
4061
+ * eventBus.get('attend:hover').next({ annotationId: 'ann-1' });
4101
4062
  *
4102
4063
  * // Subscribe
4103
- * const sub = eventBus.get('annotation:hover').subscribe(handleHover);
4064
+ * const sub = eventBus.get('attend:hover').subscribe(handleHover);
4104
4065
  *
4105
4066
  * // With operators
4106
- * eventBus.get('annotation:hover')
4067
+ * eventBus.get('attend:hover')
4107
4068
  * .pipe(debounceTime(100), distinctUntilChanged())
4108
4069
  * .subscribe(handleHover);
4109
4070
  * ```
@@ -4172,6 +4133,32 @@ declare class ScopedEventBus {
4172
4133
  scope(subScope: string): ScopedEventBus;
4173
4134
  }
4174
4135
 
4136
+ /**
4137
+ * Logger interface for observability
4138
+ *
4139
+ * This interface is intentionally framework-agnostic to work with any logger
4140
+ * (winston, pino, bunyan, or simple console).
4141
+ *
4142
+ * Example usage:
4143
+ * ```typescript
4144
+ * import winston from 'winston';
4145
+ *
4146
+ * const logger = winston.createLogger({
4147
+ * level: 'debug',
4148
+ * transports: [new winston.transports.Console()]
4149
+ * });
4150
+ *
4151
+ * const service = new MyService(logger);
4152
+ * ```
4153
+ */
4154
+ interface Logger {
4155
+ debug(message: string, meta?: any): void;
4156
+ info(message: string, meta?: any): void;
4157
+ warn(message: string, meta?: any): void;
4158
+ error(message: string, meta?: any): void;
4159
+ child(meta: Record<string, any>): Logger;
4160
+ }
4161
+
4175
4162
  /**
4176
4163
  * Backend-specific annotation utility functions
4177
4164
  */
@@ -5214,4 +5201,4 @@ declare class ConfigurationError extends Error {
5214
5201
  declare const CORE_TYPES_VERSION = "0.1.0";
5215
5202
  declare const SDK_VERSION = "0.1.0";
5216
5203
 
5217
- export { APIError, type AWSConfig, type AccessToken, type AnnotationAddedEvent, type AnnotationBodyUpdatedEvent, type AnnotationCategory, type AnnotationId, type AnnotationRemovedEvent, type AnnotationUri, type AppConfig, type AuthCode, type BackendServiceConfig, type BaseEvent, type BaseUrl, type BodyItem, type BodyOperation, CORE_TYPES_VERSION, CREATION_METHODS, type CloneToken, type ConfigFileReader, ConfigurationError, ConflictError, type ContentFormat$1 as ContentFormat, type CreateAnnotationInternal, type CreationMethod, type DatabaseServiceConfig, type DetectionProgress, type Email, type EntityTagAddedEvent, type EntityTagRemovedEvent, type EntityType, type EntityTypeStats, type Environment, type EnvironmentConfig, EventBus, type EventMap, type EventMetadata, type EventName, type EventQuery, type EventSignature, type FilesystemServiceConfig, type FrontendServiceConfig, type GenerationContext, type GenerationProgress, type GoogleAuthRequest, type GoogleCredential, type GraphConnection, type GraphDatabaseType, type GraphPath, type GraphServiceConfig, type InferenceServiceConfig, type JobCompletedEvent, type JobFailedEvent, type JobId, type JobProgressEvent, type JobStartedEvent, type MCPToken, type McpServiceConfig, type Motivation$2 as Motivation, NotFoundError, type PlatformType, type ProxyServiceConfig, type RefreshToken, type RepresentationAddedEvent, type RepresentationRemovedEvent, type ResourceAnnotationUri, type ResourceAnnotations, type ResourceArchivedEvent, type ResourceClonedEvent, type ResourceCreatedEvent, type ResourceEvent, type ResourceEventType, type ResourceFilter, type ResourceId, type ResourceScopedEvent, type ResourceUnarchivedEvent, type ResourceUri, SDK_VERSION, ScopedEventBus, ScriptError, type SearchQuery, type SelectionData, type Selector, type SemiontConfig, SemiontError, type ServiceConfig, type ServicePlatformConfig, type ServicesConfig, type SiteConfig, type StoredEvent, type SystemEvent, UnauthorizedError, type UpdateResourceInput, type UserDID, type UserId, ValidationError, type ValidationResult, accessToken, annotationId, annotationIdToURI, annotationUri, authCode, baseUrl, cloneToken, type components, createConfigLoader, deepMerge, didToAgent, displayConfiguration, email, entityType, extractResourceUriFromAnnotationUri, findBodyItem, formatErrors, getAllPlatformTypes, getAnnotationUriFromEvent, getEventType, getNodeEnvForEnvironment, googleCredential, hasAWSConfig, isAnnotationId, isArray, isBoolean, isDefined, isEventRelatedToAnnotation, isFunction, isNull, isNullish, isNumber, isObject, isResourceEvent$1 as isResourceEvent, isResourceId, isResourceScopedEvent, isResourceEvent as isStoredEvent, isString, isSystemEvent, isUndefined, isValidPlatformType, jobId, listEnvironmentNames, mcpToken, type operations, parseAndMergeConfigs, parseEnvironment, type paths, refreshToken, resolveEnvVars, resourceAnnotationUri, resourceId, resourceIdToURI, resourceUri, searchQuery, uriToAnnotationId, uriToAnnotationIdOrPassthrough, uriToResourceId, userDID, userId, userToAgent, userToDid, validateEnvironment, validateEnvironmentConfig, validateSemiontConfig, validateSiteConfig };
5204
+ export { APIError, type AWSConfig, type AccessToken, type AnnotationAddedEvent, type AnnotationBodyUpdatedEvent, type AnnotationCategory, type AnnotationId, type AnnotationProgress, type AnnotationRemovedEvent, type AnnotationUri, type AppConfig, type AuthCode, type BackendServiceConfig, type BaseEvent, type BaseUrl, type BodyItem, type BodyOperation, CORE_TYPES_VERSION, CREATION_METHODS, type CloneToken, type ConfigFileReader, ConfigurationError, ConflictError, type ContentFormat$1 as ContentFormat, type CreateAnnotationInternal, type CreationMethod, type DatabaseServiceConfig, type Email, type EntityTagAddedEvent, type EntityTagRemovedEvent, type EntityType, type EntityTypeStats, type Environment, type EnvironmentConfig, EventBus, type EventMap, type EventMetadata, type EventName, type EventQuery, type EventSignature, type FilesystemServiceConfig, type FrontendServiceConfig, type GenerationContext, type GenerationProgress, type GoogleAuthRequest, type GoogleCredential, type GraphConnection, type GraphDatabaseType, type GraphPath, type GraphServiceConfig, type InferenceServiceConfig, type JobCompletedEvent, type JobFailedEvent, type JobId, type JobProgressEvent, type JobStartedEvent, type Logger, type MCPToken, type McpServiceConfig, type Motivation$2 as Motivation, NotFoundError, type PlatformType, type ProxyServiceConfig, type RefreshToken, type RepresentationAddedEvent, type RepresentationRemovedEvent, type ResourceAnnotationUri, type ResourceAnnotations, type ResourceArchivedEvent, type ResourceClonedEvent, type ResourceCreatedEvent, type ResourceEvent, type ResourceEventType, type ResourceFilter, type ResourceId, type ResourceScopedEvent, type ResourceUnarchivedEvent, type ResourceUri, SDK_VERSION, ScopedEventBus, ScriptError, type SearchQuery, type SelectionData, type Selector, type SemiontConfig, SemiontError, type ServiceConfig, type ServicePlatformConfig, type ServicesConfig, type SiteConfig, type StoredEvent, type SystemEvent, UnauthorizedError, type UpdateResourceInput, type UserDID, type UserId, ValidationError, type ValidationResult, accessToken, annotationId, annotationIdToURI, annotationUri, authCode, baseUrl, cloneToken, type components, createConfigLoader, deepMerge, didToAgent, displayConfiguration, email, entityType, extractResourceUriFromAnnotationUri, findBodyItem, formatErrors, getAllPlatformTypes, getAnnotationUriFromEvent, getEventType, getNodeEnvForEnvironment, googleCredential, hasAWSConfig, isAnnotationId, isArray, isBoolean, isDefined, isEventRelatedToAnnotation, isFunction, isNull, isNullish, isNumber, isObject, isResourceEvent$1 as isResourceEvent, isResourceId, isResourceScopedEvent, isResourceEvent as isStoredEvent, isString, isSystemEvent, isUndefined, isValidPlatformType, jobId, listEnvironmentNames, mcpToken, type operations, parseAndMergeConfigs, parseEnvironment, type paths, refreshToken, resolveEnvVars, resourceAnnotationUri, resourceId, resourceIdToURI, resourceUri, searchQuery, uriToAnnotationId, uriToAnnotationIdOrPassthrough, uriToResourceId, userDID, userId, userToAgent, userToDid, validateEnvironment, validateEnvironmentConfig, validateSemiontConfig, validateSiteConfig };