@semiont/core 0.2.43 → 0.2.46

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
@@ -84,14 +84,12 @@ interface paths {
84
84
  };
85
85
  };
86
86
  responses: {
87
- /** @description Resource updated successfully */
88
- 200: {
87
+ /** @description Update accepted */
88
+ 202: {
89
89
  headers: {
90
90
  [name: string]: unknown;
91
91
  };
92
- content: {
93
- "application/json": components["schemas"]["GetResourceResponse"];
94
- };
92
+ content?: never;
95
93
  };
96
94
  /** @description Resource not found */
97
95
  404: {
@@ -1140,13 +1138,15 @@ interface paths {
1140
1138
  };
1141
1139
  };
1142
1140
  responses: {
1143
- /** @description Resource created successfully */
1144
- 201: {
1141
+ /** @description Resource creation accepted */
1142
+ 202: {
1145
1143
  headers: {
1146
1144
  [name: string]: unknown;
1147
1145
  };
1148
1146
  content: {
1149
- "application/json": components["schemas"]["CreateResourceResponse"];
1147
+ "application/json": {
1148
+ resourceId: string;
1149
+ };
1150
1150
  };
1151
1151
  };
1152
1152
  };
@@ -1655,13 +1655,15 @@ interface paths {
1655
1655
  };
1656
1656
  };
1657
1657
  responses: {
1658
- /** @description Resource created successfully */
1659
- 201: {
1658
+ /** @description Resource creation accepted */
1659
+ 202: {
1660
1660
  headers: {
1661
1661
  [name: string]: unknown;
1662
1662
  };
1663
1663
  content: {
1664
- "application/json": components["schemas"]["CreateResourceResponse"];
1664
+ "application/json": {
1665
+ resourceId: string;
1666
+ };
1665
1667
  };
1666
1668
  };
1667
1669
  };
@@ -1767,13 +1769,15 @@ interface paths {
1767
1769
  };
1768
1770
  };
1769
1771
  responses: {
1770
- /** @description Annotation created successfully */
1771
- 201: {
1772
+ /** @description Annotation creation accepted */
1773
+ 202: {
1772
1774
  headers: {
1773
1775
  [name: string]: unknown;
1774
1776
  };
1775
1777
  content: {
1776
- "application/json": components["schemas"]["CreateAnnotationResponse"];
1778
+ "application/json": {
1779
+ annotationId: string;
1780
+ };
1777
1781
  };
1778
1782
  };
1779
1783
  };
@@ -1933,15 +1937,8 @@ interface paths {
1933
1937
  };
1934
1938
  requestBody?: never;
1935
1939
  responses: {
1936
- /** @description Annotation deleted successfully */
1937
- 204: {
1938
- headers: {
1939
- [name: string]: unknown;
1940
- };
1941
- content?: never;
1942
- };
1943
- /** @description Annotation not found */
1944
- 404: {
1940
+ /** @description Annotation deletion accepted */
1941
+ 202: {
1945
1942
  headers: {
1946
1943
  [name: string]: unknown;
1947
1944
  };
@@ -1984,14 +1981,12 @@ interface paths {
1984
1981
  };
1985
1982
  };
1986
1983
  responses: {
1987
- /** @description Annotation body updated successfully */
1988
- 200: {
1984
+ /** @description Annotation body update accepted */
1985
+ 202: {
1989
1986
  headers: {
1990
1987
  [name: string]: unknown;
1991
1988
  };
1992
- content: {
1993
- "application/json": components["schemas"]["UpdateAnnotationBodyResponse"];
1994
- };
1989
+ content?: never;
1995
1990
  };
1996
1991
  };
1997
1992
  };
@@ -2162,14 +2157,12 @@ interface paths {
2162
2157
  };
2163
2158
  };
2164
2159
  responses: {
2165
- /** @description Entity type added successfully */
2166
- 200: {
2160
+ /** @description Entity type addition accepted */
2161
+ 202: {
2167
2162
  headers: {
2168
2163
  [name: string]: unknown;
2169
2164
  };
2170
- content: {
2171
- "application/json": components["schemas"]["AddEntityTypeResponse"];
2172
- };
2165
+ content?: never;
2173
2166
  };
2174
2167
  /** @description Forbidden - Moderator or Admin access required */
2175
2168
  403: {
@@ -2214,14 +2207,12 @@ interface paths {
2214
2207
  };
2215
2208
  };
2216
2209
  responses: {
2217
- /** @description Entity types added successfully */
2218
- 200: {
2210
+ /** @description Entity types addition accepted */
2211
+ 202: {
2219
2212
  headers: {
2220
2213
  [name: string]: unknown;
2221
2214
  };
2222
- content: {
2223
- "application/json": components["schemas"]["AddEntityTypeResponse"];
2224
- };
2215
+ content?: never;
2225
2216
  };
2226
2217
  /** @description Forbidden - Moderator or Admin access required */
2227
2218
  403: {
@@ -2240,6 +2231,45 @@ interface paths {
2240
2231
  patch?: never;
2241
2232
  trace?: never;
2242
2233
  };
2234
+ "/api/events/stream": {
2235
+ parameters: {
2236
+ query?: never;
2237
+ header?: never;
2238
+ path?: never;
2239
+ cookie?: never;
2240
+ };
2241
+ /**
2242
+ * Subscribe to Global Events (SSE)
2243
+ * @description Open a Server-Sent Events stream to receive real-time system-level events (e.g., entity type changes). Events not scoped to a specific resource are delivered on this channel.
2244
+ */
2245
+ get: {
2246
+ parameters: {
2247
+ query?: never;
2248
+ header?: never;
2249
+ path?: never;
2250
+ cookie?: never;
2251
+ };
2252
+ requestBody?: never;
2253
+ responses: {
2254
+ /** @description SSE stream opened successfully */
2255
+ 200: {
2256
+ headers: {
2257
+ [name: string]: unknown;
2258
+ };
2259
+ content: {
2260
+ "text/event-stream": components["schemas"]["EventStreamResponse"];
2261
+ };
2262
+ };
2263
+ };
2264
+ };
2265
+ put?: never;
2266
+ post?: never;
2267
+ delete?: never;
2268
+ options?: never;
2269
+ head?: never;
2270
+ patch?: never;
2271
+ trace?: never;
2272
+ };
2243
2273
  "/api/jobs/{id}": {
2244
2274
  parameters: {
2245
2275
  query?: never;
@@ -2298,10 +2328,6 @@ interface components {
2298
2328
  AddEntityTypeRequest: {
2299
2329
  tag: string;
2300
2330
  };
2301
- AddEntityTypeResponse: {
2302
- success: boolean;
2303
- entityTypes: string[];
2304
- };
2305
2331
  AdminUpdateUserResponse: {
2306
2332
  success: boolean;
2307
2333
  user: {
@@ -2523,9 +2549,6 @@ interface components {
2523
2549
  };
2524
2550
  body: unknown[] | components["schemas"]["AnnotationBody"] | components["schemas"]["AnnotationBody"][];
2525
2551
  };
2526
- CreateAnnotationResponse: {
2527
- annotation: components["schemas"]["Annotation"];
2528
- };
2529
2552
  CreateFromAnnotationRequest: {
2530
2553
  /** @description ID of the resource containing the annotation */
2531
2554
  resourceId: string;
@@ -2577,10 +2600,6 @@ interface components {
2577
2600
  /** @description Whether to archive the original resource */
2578
2601
  archiveOriginal?: boolean;
2579
2602
  };
2580
- CreateResourceFromTokenResponse: {
2581
- resource: components["schemas"]["ResourceDescriptor"];
2582
- annotations: components["schemas"]["Annotation"][];
2583
- };
2584
2603
  CreateResourceRequest: {
2585
2604
  name: string;
2586
2605
  content: string;
@@ -3087,9 +3106,6 @@ interface components {
3087
3106
  /** @description Array of body modification operations to apply */
3088
3107
  operations: (components["schemas"]["BodyOperationAdd"] | components["schemas"]["BodyOperationRemove"] | components["schemas"]["BodyOperationReplace"])[];
3089
3108
  };
3090
- UpdateAnnotationBodyResponse: {
3091
- annotation: components["schemas"]["Annotation"];
3092
- };
3093
3109
  UpdateResourceRequest: {
3094
3110
  entityTypes?: string[];
3095
3111
  archived?: boolean;
@@ -3383,13 +3399,13 @@ declare function extractResourceUriFromAnnotationUri(annotationUri: ResourceAnno
3383
3399
  */
3384
3400
 
3385
3401
  type ResourceDescriptor = components['schemas']['ResourceDescriptor'];
3386
- type Annotation$4 = components['schemas']['Annotation'];
3402
+ type Annotation$5 = components['schemas']['Annotation'];
3387
3403
  /**
3388
3404
  * Represents a connection between resources through annotations
3389
3405
  */
3390
3406
  interface GraphConnection {
3391
3407
  targetResource: ResourceDescriptor;
3392
- annotations: Annotation$4[];
3408
+ annotations: Annotation$5[];
3393
3409
  relationshipType?: string;
3394
3410
  bidirectional: boolean;
3395
3411
  }
@@ -3398,7 +3414,7 @@ interface GraphConnection {
3398
3414
  */
3399
3415
  interface GraphPath {
3400
3416
  resources: ResourceDescriptor[];
3401
- annotations: Annotation$4[];
3417
+ annotations: Annotation$5[];
3402
3418
  }
3403
3419
  /**
3404
3420
  * Statistics about entity types in the graph
@@ -3421,7 +3437,7 @@ interface EntityTypeStats {
3421
3437
  * - Optional signatures for cross-org verification
3422
3438
  */
3423
3439
 
3424
- type Annotation$3 = components['schemas']['Annotation'];
3440
+ type Annotation$4 = components['schemas']['Annotation'];
3425
3441
  type ContentFormat = components['schemas']['ContentFormat'];
3426
3442
  type Motivation$1 = components['schemas']['Motivation'];
3427
3443
  interface BaseEvent {
@@ -3499,7 +3515,7 @@ interface RepresentationRemovedEvent extends BaseEvent {
3499
3515
  interface AnnotationAddedEvent extends BaseEvent {
3500
3516
  type: 'annotation.added';
3501
3517
  payload: {
3502
- annotation: Omit<Annotation$3, 'creator' | 'created'>;
3518
+ annotation: Annotation$4;
3503
3519
  };
3504
3520
  }
3505
3521
  interface AnnotationRemovedEvent extends BaseEvent {
@@ -3651,7 +3667,7 @@ interface EventQuery {
3651
3667
  }
3652
3668
  interface ResourceAnnotations {
3653
3669
  resourceId: ResourceId;
3654
- annotations: Annotation$3[];
3670
+ annotations: Annotation$4[];
3655
3671
  version: number;
3656
3672
  updatedAt: string;
3657
3673
  }
@@ -3689,7 +3705,7 @@ declare function isResourceEvent(event: any): event is StoredEvent;
3689
3705
 
3690
3706
  type Selector = components['schemas']['TextPositionSelector'] | components['schemas']['TextQuoteSelector'] | components['schemas']['SvgSelector'] | components['schemas']['FragmentSelector'];
3691
3707
  type YieldContext = components['schemas']['YieldContext'];
3692
- type Annotation$2 = components['schemas']['Annotation'];
3708
+ type Annotation$3 = components['schemas']['Annotation'];
3693
3709
  type Motivation = components['schemas']['Motivation'];
3694
3710
  /**
3695
3711
  * Progress state for resource yield workflow
@@ -3788,7 +3804,68 @@ type EventMap = {
3788
3804
  'yield:representation-removed': Extract<ResourceEvent, {
3789
3805
  type: 'representation.removed';
3790
3806
  }>;
3807
+ 'yield:create': {
3808
+ name: string;
3809
+ content: Buffer;
3810
+ format: components['schemas']['ContentFormat'];
3811
+ userId: UserId;
3812
+ language?: string;
3813
+ entityTypes?: string[];
3814
+ creationMethod?: CreationMethod;
3815
+ isDraft?: boolean;
3816
+ generatedFrom?: string;
3817
+ generationPrompt?: string;
3818
+ };
3819
+ 'yield:created': {
3820
+ resourceId: ResourceId;
3821
+ resource: components['schemas']['ResourceDescriptor'];
3822
+ };
3823
+ 'yield:create-failed': {
3824
+ error: Error;
3825
+ };
3791
3826
  'yield:clone': void;
3827
+ 'yield:clone-token-requested': {
3828
+ correlationId: string;
3829
+ resourceId: ResourceId;
3830
+ };
3831
+ 'yield:clone-token-generated': {
3832
+ correlationId: string;
3833
+ response: components['schemas']['CloneResourceWithTokenResponse'];
3834
+ };
3835
+ 'yield:clone-token-failed': {
3836
+ correlationId: string;
3837
+ error: Error;
3838
+ };
3839
+ 'yield:clone-resource-requested': {
3840
+ correlationId: string;
3841
+ token: string;
3842
+ };
3843
+ 'yield:clone-resource-result': {
3844
+ correlationId: string;
3845
+ response: components['schemas']['GetResourceByTokenResponse'];
3846
+ };
3847
+ 'yield:clone-resource-failed': {
3848
+ correlationId: string;
3849
+ error: Error;
3850
+ };
3851
+ 'yield:clone-create': {
3852
+ correlationId: string;
3853
+ token: string;
3854
+ name: string;
3855
+ content: string;
3856
+ userId: UserId;
3857
+ archiveOriginal?: boolean;
3858
+ };
3859
+ 'yield:clone-created': {
3860
+ correlationId: string;
3861
+ response: {
3862
+ resourceId: ResourceId;
3863
+ };
3864
+ };
3865
+ 'yield:clone-create-failed': {
3866
+ correlationId: string;
3867
+ error: Error;
3868
+ };
3792
3869
  'mark:select-comment': SelectionData;
3793
3870
  'mark:select-tag': SelectionData;
3794
3871
  'mark:select-assessment': SelectionData;
@@ -3798,26 +3875,42 @@ type EventMap = {
3798
3875
  motivation: Motivation;
3799
3876
  };
3800
3877
  'mark:cancel-pending': void;
3801
- 'mark:create': {
3878
+ 'mark:submit': {
3802
3879
  motivation: Motivation;
3803
3880
  selector: Selector | Selector[];
3804
3881
  body: components['schemas']['AnnotationBody'][];
3805
3882
  };
3883
+ 'mark:create': {
3884
+ annotation: Annotation$3;
3885
+ userId: UserId;
3886
+ resourceId: ResourceId;
3887
+ };
3806
3888
  'mark:created': {
3807
- annotation: Annotation$2;
3889
+ annotationId: AnnotationId;
3808
3890
  };
3809
3891
  'mark:create-failed': {
3810
3892
  error: Error;
3811
3893
  };
3812
3894
  'mark:delete': {
3813
- annotationId: string;
3895
+ annotationId: AnnotationId;
3896
+ userId?: UserId;
3897
+ resourceId?: ResourceId;
3814
3898
  };
3815
3899
  'mark:deleted': {
3816
- annotationId: string;
3900
+ annotationId: AnnotationId;
3817
3901
  };
3818
3902
  'mark:delete-failed': {
3819
3903
  error: Error;
3820
3904
  };
3905
+ 'mark:update-body': {
3906
+ annotationId: AnnotationId;
3907
+ userId: UserId;
3908
+ resourceId: ResourceId;
3909
+ operations: BodyOperation[];
3910
+ };
3911
+ 'mark:body-update-failed': {
3912
+ error: Error;
3913
+ };
3821
3914
  'mark:assist-request': {
3822
3915
  motivation: Motivation;
3823
3916
  options: {
@@ -3866,11 +3959,44 @@ type EventMap = {
3866
3959
  'mark:entity-tag-removed': Extract<ResourceEvent, {
3867
3960
  type: 'entitytag.removed';
3868
3961
  }>;
3869
- 'mark:archive': void;
3962
+ 'mark:update-entity-types': {
3963
+ resourceId: ResourceId;
3964
+ userId: UserId;
3965
+ currentEntityTypes: string[];
3966
+ updatedEntityTypes: string[];
3967
+ };
3968
+ 'mark:add-entity-type': {
3969
+ tag: string;
3970
+ userId: UserId;
3971
+ };
3972
+ 'mark:entity-type-added': {
3973
+ tag: string;
3974
+ };
3975
+ 'mark:entity-type-add-failed': {
3976
+ error: Error;
3977
+ };
3978
+ 'mark:entity-types-requested': {
3979
+ correlationId: string;
3980
+ };
3981
+ 'mark:entity-types-result': {
3982
+ correlationId: string;
3983
+ response: components['schemas']['GetEntityTypesResponse'];
3984
+ };
3985
+ 'mark:entity-types-failed': {
3986
+ correlationId: string;
3987
+ error: Error;
3988
+ };
3989
+ 'mark:archive': void | {
3990
+ userId: UserId;
3991
+ resourceId?: ResourceId;
3992
+ };
3870
3993
  'mark:archived': Extract<ResourceEvent, {
3871
3994
  type: 'resource.archived';
3872
3995
  }>;
3873
- 'mark:unarchive': void;
3996
+ 'mark:unarchive': void | {
3997
+ userId: UserId;
3998
+ resourceId?: ResourceId;
3999
+ };
3874
4000
  'mark:unarchived': Extract<ResourceEvent, {
3875
4001
  type: 'resource.unarchived';
3876
4002
  }>;
@@ -3884,12 +4010,15 @@ type EventMap = {
3884
4010
  searchTerm: string;
3885
4011
  };
3886
4012
  'bind:search-requested': {
4013
+ correlationId?: string;
3887
4014
  referenceId: string;
3888
4015
  searchTerm: string;
3889
4016
  };
3890
4017
  'bind:update-body': {
3891
4018
  annotationUri: string;
3892
4019
  resourceId: string;
4020
+ userId?: UserId;
4021
+ annotationId?: AnnotationId;
3893
4022
  operations: Array<{
3894
4023
  op: 'add' | 'remove' | 'replace';
3895
4024
  item?: components['schemas']['AnnotationBody'];
@@ -3903,18 +4032,70 @@ type EventMap = {
3903
4032
  'bind:body-update-failed': {
3904
4033
  error: Error;
3905
4034
  };
4035
+ 'bind:search-results': {
4036
+ referenceId: string;
4037
+ searchTerm: string;
4038
+ results: components['schemas']['ResourceDescriptor'][];
4039
+ correlationId?: string;
4040
+ };
4041
+ 'bind:search-failed': {
4042
+ referenceId: string;
4043
+ error: Error;
4044
+ correlationId?: string;
4045
+ };
4046
+ 'bind:referenced-by-requested': {
4047
+ correlationId: string;
4048
+ resourceId: ResourceId;
4049
+ motivation?: string;
4050
+ };
4051
+ 'bind:referenced-by-result': {
4052
+ correlationId: string;
4053
+ response: components['schemas']['GetReferencedByResponse'];
4054
+ };
4055
+ 'bind:referenced-by-failed': {
4056
+ correlationId: string;
4057
+ error: Error;
4058
+ };
3906
4059
  'gather:requested': {
4060
+ correlationId?: string;
3907
4061
  annotationUri: string;
3908
4062
  resourceUri: string;
4063
+ options?: {
4064
+ includeSourceContext?: boolean;
4065
+ includeTargetContext?: boolean;
4066
+ contextWindow?: number;
4067
+ };
3909
4068
  };
3910
4069
  'gather:complete': {
4070
+ correlationId?: string;
3911
4071
  annotationUri: string;
3912
- context: YieldContext;
4072
+ response: components['schemas']['AnnotationLLMContextResponse'];
3913
4073
  };
3914
4074
  'gather:failed': {
4075
+ correlationId?: string;
3915
4076
  annotationUri: string;
3916
4077
  error: Error;
3917
4078
  };
4079
+ 'gather:resource-requested': {
4080
+ correlationId?: string;
4081
+ resourceUri: string;
4082
+ options: {
4083
+ depth: number;
4084
+ maxResources: number;
4085
+ includeContent: boolean;
4086
+ includeSummary: boolean;
4087
+ };
4088
+ };
4089
+ 'gather:resource-complete': {
4090
+ correlationId?: string;
4091
+ resourceUri: string;
4092
+ context: components['schemas']['ResourceLLMContextResponse'];
4093
+ };
4094
+ 'gather:resource-failed': {
4095
+ correlationId?: string;
4096
+ resourceUri: string;
4097
+ error: Error;
4098
+ };
3918
4099
  'browse:click': {
3919
4100
  annotationId: string;
3920
4101
  motivation: Motivation;
@@ -3955,6 +4136,87 @@ type EventMap = {
3955
4136
  'browse:entity-type-clicked': {
3956
4137
  entityType: string;
3957
4138
  };
4139
+ 'browse:resource-requested': {
4140
+ correlationId: string;
4141
+ resourceId: ResourceId;
4142
+ };
4143
+ 'browse:resource-result': {
4144
+ correlationId: string;
4145
+ response: components['schemas']['GetResourceResponse'];
4146
+ };
4147
+ 'browse:resource-failed': {
4148
+ correlationId: string;
4149
+ error: Error;
4150
+ };
4151
+ 'browse:resources-requested': {
4152
+ correlationId: string;
4153
+ search?: string;
4154
+ archived?: boolean;
4155
+ entityType?: string;
4156
+ offset?: number;
4157
+ limit?: number;
4158
+ };
4159
+ 'browse:resources-result': {
4160
+ correlationId: string;
4161
+ response: components['schemas']['ListResourcesResponse'];
4162
+ };
4163
+ 'browse:resources-failed': {
4164
+ correlationId: string;
4165
+ error: Error;
4166
+ };
4167
+ 'browse:annotations-requested': {
4168
+ correlationId: string;
4169
+ resourceId: ResourceId;
4170
+ };
4171
+ 'browse:annotations-result': {
4172
+ correlationId: string;
4173
+ response: components['schemas']['GetAnnotationsResponse'];
4174
+ };
4175
+ 'browse:annotations-failed': {
4176
+ correlationId: string;
4177
+ error: Error;
4178
+ };
4179
+ 'browse:annotation-requested': {
4180
+ correlationId: string;
4181
+ resourceId: ResourceId;
4182
+ annotationId: AnnotationId;
4183
+ };
4184
+ 'browse:annotation-result': {
4185
+ correlationId: string;
4186
+ response: components['schemas']['GetAnnotationResponse'];
4187
+ };
4188
+ 'browse:annotation-failed': {
4189
+ correlationId: string;
4190
+ error: Error;
4191
+ };
4192
+ 'browse:events-requested': {
4193
+ correlationId: string;
4194
+ resourceId: ResourceId;
4195
+ type?: string;
4196
+ userId?: string;
4197
+ limit?: number;
4198
+ };
4199
+ 'browse:events-result': {
4200
+ correlationId: string;
4201
+ response: components['schemas']['GetEventsResponse'];
4202
+ };
4203
+ 'browse:events-failed': {
4204
+ correlationId: string;
4205
+ error: Error;
4206
+ };
4207
+ 'browse:annotation-history-requested': {
4208
+ correlationId: string;
4209
+ resourceId: ResourceId;
4210
+ annotationId: AnnotationId;
4211
+ };
4212
+ 'browse:annotation-history-result': {
4213
+ correlationId: string;
4214
+ response: components['schemas']['GetAnnotationHistoryResponse'];
4215
+ };
4216
+ 'browse:annotation-history-failed': {
4217
+ correlationId: string;
4218
+ error: Error;
4219
+ };
3958
4220
  'beckon:hover': {
3959
4221
  annotationId: string | null;
3960
4222
  };
@@ -3964,6 +4226,34 @@ type EventMap = {
3964
4226
  'beckon:sparkle': {
3965
4227
  annotationId: string;
3966
4228
  };
4229
+ 'job:start': {
4230
+ resourceId: ResourceId;
4231
+ userId: UserId;
4232
+ jobId: JobId;
4233
+ jobType: 'reference-annotation' | 'generation' | 'highlight-annotation' | 'assessment-annotation' | 'comment-annotation' | 'tag-annotation';
4234
+ };
4235
+ 'job:report-progress': {
4236
+ resourceId: ResourceId;
4237
+ userId: UserId;
4238
+ jobId: JobId;
4239
+ jobType: 'reference-annotation' | 'generation' | 'highlight-annotation' | 'assessment-annotation' | 'comment-annotation' | 'tag-annotation';
4240
+ percentage: number;
4241
+ progress?: any;
4242
+ };
4243
+ 'job:complete': {
4244
+ resourceId: ResourceId;
4245
+ userId: UserId;
4246
+ jobId: JobId;
4247
+ jobType: 'reference-annotation' | 'generation' | 'highlight-annotation' | 'assessment-annotation' | 'comment-annotation' | 'tag-annotation';
4248
+ result?: any;
4249
+ };
4250
+ 'job:fail': {
4251
+ resourceId: ResourceId;
4252
+ userId: UserId;
4253
+ jobId: JobId;
4254
+ jobType: 'reference-annotation' | 'generation' | 'highlight-annotation' | 'assessment-annotation' | 'comment-annotation' | 'tag-annotation';
4255
+ error: string;
4256
+ };
3967
4257
  'job:started': Extract<ResourceEvent, {
3968
4258
  type: 'job.started';
3969
4259
  }>;
@@ -3984,6 +4274,18 @@ type EventMap = {
3984
4274
  'job:cancel-requested': {
3985
4275
  jobType: 'annotation' | 'generation';
3986
4276
  };
4277
+ 'job:status-requested': {
4278
+ correlationId: string;
4279
+ jobId: JobId;
4280
+ };
4281
+ 'job:status-result': {
4282
+ correlationId: string;
4283
+ response: components['schemas']['JobStatusResponse'];
4284
+ };
4285
+ 'job:status-failed': {
4286
+ correlationId: string;
4287
+ error: Error;
4288
+ };
3987
4289
  'settings:theme-changed': {
3988
4290
  theme: 'light' | 'dark' | 'system';
3989
4291
  };
@@ -4220,12 +4522,62 @@ interface Logger {
4220
4522
  * Backend-specific annotation utility functions
4221
4523
  */
4222
4524
 
4223
- type Annotation$1 = components['schemas']['Annotation'];
4525
+ type Annotation$2 = components['schemas']['Annotation'];
4224
4526
  /**
4225
4527
  * Find a body item in an array
4226
4528
  * Returns the index of the first matching item, or -1 if not found
4227
4529
  */
4228
- declare function findBodyItem(body: Annotation$1['body'], targetItem: BodyItem): number;
4530
+ declare function findBodyItem(body: Annotation$2['body'], targetItem: BodyItem): number;
4531
+
4532
+ /**
4533
+ * Annotation Assembly
4534
+ *
4535
+ * Pure functions for building W3C Annotations and applying body operations.
4536
+ * No EventBus, no persistence — just data transformation.
4537
+ */
4538
+
4539
+ type Agent$1 = components['schemas']['Agent'];
4540
+ type Annotation$1 = components['schemas']['Annotation'];
4541
+ type AnnotationBody = components['schemas']['AnnotationBody'];
4542
+ type CreateAnnotationRequest = components['schemas']['CreateAnnotationRequest'];
4543
+ type UpdateAnnotationBodyRequest = components['schemas']['UpdateAnnotationBodyRequest'];
4544
+ type TextPositionSelector = components['schemas']['TextPositionSelector'];
4545
+ type SvgSelector = components['schemas']['SvgSelector'];
4546
+ type FragmentSelector = components['schemas']['FragmentSelector'];
4547
+ interface AssembledAnnotation {
4548
+ annotation: Annotation$1;
4549
+ bodyArray: AnnotationBody[];
4550
+ }
4551
+ /**
4552
+ * Get TextPositionSelector from a selector (single or array)
4553
+ */
4554
+ declare function getTextPositionSelector(selector: Selector | Selector[] | undefined): TextPositionSelector | null;
4555
+ /**
4556
+ * Get SvgSelector from a selector (single or array)
4557
+ */
4558
+ declare function getSvgSelector(selector: Selector | Selector[] | undefined): SvgSelector | null;
4559
+ /**
4560
+ * Get FragmentSelector from a selector (single or array)
4561
+ */
4562
+ declare function getFragmentSelector(selector: Selector | Selector[] | undefined): FragmentSelector | null;
4563
+ /**
4564
+ * Validate SVG markup for W3C compliance
4565
+ *
4566
+ * @returns null if valid, error message if invalid
4567
+ */
4568
+ declare function validateSvgMarkup(svg: string): string | null;
4569
+ /**
4570
+ * Build a complete W3C Annotation from a CreateAnnotationRequest.
4571
+ *
4572
+ * Generates ID, validates selectors, constructs the full annotation object.
4573
+ * Throws on invalid input (missing selector, missing motivation, invalid SVG).
4574
+ */
4575
+ declare function assembleAnnotation(request: CreateAnnotationRequest, creator: Agent$1, publicURL: string): AssembledAnnotation;
4576
+ /**
4577
+ * Apply body operations (add/remove/replace) to an annotation's body array.
4578
+ * Returns a new array — does not mutate the input.
4579
+ */
4580
+ declare function applyBodyOperations(body: Annotation$1['body'], operations: UpdateAnnotationBodyRequest['operations']): AnnotationBody[];
4229
4581
 
4230
4582
  /**
4231
4583
  * Resource input/output types
@@ -4264,6 +4616,14 @@ interface GoogleAuthRequest {
4264
4616
  termsAccepted: boolean;
4265
4617
  }
4266
4618
 
4619
+ /**
4620
+ * ID generation utilities
4621
+ */
4622
+ /**
4623
+ * Generate a UUID v4-like ID (without dashes)
4624
+ */
4625
+ declare function generateUuid(): string;
4626
+
4267
4627
  /**
4268
4628
  * Common type guard utilities
4269
4629
  */
@@ -5258,4 +5618,4 @@ declare class ConfigurationError extends Error {
5258
5618
  declare const CORE_TYPES_VERSION = "0.1.0";
5259
5619
  declare const SDK_VERSION = "0.1.0";
5260
5620
 
5261
- 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, type BurstBufferOptions, 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 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 MarkProgress, 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, type YieldContext, type YieldProgress, accessToken, annotationId, annotationIdToURI, annotationUri, authCode, baseUrl, burstBuffer, 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 };
5621
+ export { APIError, type AWSConfig, type AccessToken, type AnnotationAddedEvent, type AnnotationBodyUpdatedEvent, type AnnotationCategory, type AnnotationId, type AnnotationRemovedEvent, type AnnotationUri, type AppConfig, type AssembledAnnotation, type AuthCode, type BackendServiceConfig, type BaseEvent, type BaseUrl, type BodyItem, type BodyOperation, type BurstBufferOptions, 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 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 MarkProgress, 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, type YieldContext, type YieldProgress, accessToken, annotationId, annotationIdToURI, annotationUri, applyBodyOperations, assembleAnnotation, authCode, baseUrl, burstBuffer, cloneToken, type components, createConfigLoader, deepMerge, didToAgent, displayConfiguration, email, entityType, extractResourceUriFromAnnotationUri, findBodyItem, formatErrors, generateUuid, getAllPlatformTypes, getAnnotationUriFromEvent, getEventType, getFragmentSelector, getNodeEnvForEnvironment, getSvgSelector, getTextPositionSelector, 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, validateSvgMarkup };