@semiont/core 0.2.46 → 0.3.0
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 +346 -131
- package/dist/index.js +3 -50
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
package/dist/index.d.ts
CHANGED
|
@@ -1061,6 +1061,275 @@ interface paths {
|
|
|
1061
1061
|
patch?: never;
|
|
1062
1062
|
trace?: never;
|
|
1063
1063
|
};
|
|
1064
|
+
"/api/admin/exchange/backup": {
|
|
1065
|
+
parameters: {
|
|
1066
|
+
query?: never;
|
|
1067
|
+
header?: never;
|
|
1068
|
+
path?: never;
|
|
1069
|
+
cookie?: never;
|
|
1070
|
+
};
|
|
1071
|
+
get?: never;
|
|
1072
|
+
put?: never;
|
|
1073
|
+
/**
|
|
1074
|
+
* Backup Knowledge Base
|
|
1075
|
+
* @description Create a lossless backup of the knowledge base as a streaming tar.gz archive
|
|
1076
|
+
*/
|
|
1077
|
+
post: {
|
|
1078
|
+
parameters: {
|
|
1079
|
+
query?: never;
|
|
1080
|
+
header?: never;
|
|
1081
|
+
path?: never;
|
|
1082
|
+
cookie?: never;
|
|
1083
|
+
};
|
|
1084
|
+
requestBody?: never;
|
|
1085
|
+
responses: {
|
|
1086
|
+
/** @description Streaming backup archive */
|
|
1087
|
+
200: {
|
|
1088
|
+
headers: {
|
|
1089
|
+
[name: string]: unknown;
|
|
1090
|
+
};
|
|
1091
|
+
content: {
|
|
1092
|
+
"application/gzip": string;
|
|
1093
|
+
};
|
|
1094
|
+
};
|
|
1095
|
+
/** @description Unauthorized */
|
|
1096
|
+
401: {
|
|
1097
|
+
headers: {
|
|
1098
|
+
[name: string]: unknown;
|
|
1099
|
+
};
|
|
1100
|
+
content: {
|
|
1101
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
1102
|
+
};
|
|
1103
|
+
};
|
|
1104
|
+
/** @description Forbidden - Admin access required */
|
|
1105
|
+
403: {
|
|
1106
|
+
headers: {
|
|
1107
|
+
[name: string]: unknown;
|
|
1108
|
+
};
|
|
1109
|
+
content: {
|
|
1110
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
1111
|
+
};
|
|
1112
|
+
};
|
|
1113
|
+
};
|
|
1114
|
+
};
|
|
1115
|
+
delete?: never;
|
|
1116
|
+
options?: never;
|
|
1117
|
+
head?: never;
|
|
1118
|
+
patch?: never;
|
|
1119
|
+
trace?: never;
|
|
1120
|
+
};
|
|
1121
|
+
"/api/admin/exchange/restore": {
|
|
1122
|
+
parameters: {
|
|
1123
|
+
query?: never;
|
|
1124
|
+
header?: never;
|
|
1125
|
+
path?: never;
|
|
1126
|
+
cookie?: never;
|
|
1127
|
+
};
|
|
1128
|
+
get?: never;
|
|
1129
|
+
put?: never;
|
|
1130
|
+
/**
|
|
1131
|
+
* Restore Knowledge Base
|
|
1132
|
+
* @description Restore knowledge base from a backup archive. Returns SSE progress events.
|
|
1133
|
+
*/
|
|
1134
|
+
post: {
|
|
1135
|
+
parameters: {
|
|
1136
|
+
query?: never;
|
|
1137
|
+
header?: never;
|
|
1138
|
+
path?: never;
|
|
1139
|
+
cookie?: never;
|
|
1140
|
+
};
|
|
1141
|
+
requestBody: {
|
|
1142
|
+
content: {
|
|
1143
|
+
"multipart/form-data": {
|
|
1144
|
+
/**
|
|
1145
|
+
* Format: binary
|
|
1146
|
+
* @description Backup archive (.tar.gz)
|
|
1147
|
+
*/
|
|
1148
|
+
file: string;
|
|
1149
|
+
};
|
|
1150
|
+
};
|
|
1151
|
+
};
|
|
1152
|
+
responses: {
|
|
1153
|
+
/** @description SSE stream of restore progress events */
|
|
1154
|
+
200: {
|
|
1155
|
+
headers: {
|
|
1156
|
+
[name: string]: unknown;
|
|
1157
|
+
};
|
|
1158
|
+
content: {
|
|
1159
|
+
"text/event-stream": string;
|
|
1160
|
+
};
|
|
1161
|
+
};
|
|
1162
|
+
/** @description Invalid file format */
|
|
1163
|
+
400: {
|
|
1164
|
+
headers: {
|
|
1165
|
+
[name: string]: unknown;
|
|
1166
|
+
};
|
|
1167
|
+
content: {
|
|
1168
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
1169
|
+
};
|
|
1170
|
+
};
|
|
1171
|
+
/** @description Unauthorized */
|
|
1172
|
+
401: {
|
|
1173
|
+
headers: {
|
|
1174
|
+
[name: string]: unknown;
|
|
1175
|
+
};
|
|
1176
|
+
content: {
|
|
1177
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
1178
|
+
};
|
|
1179
|
+
};
|
|
1180
|
+
/** @description Forbidden - Admin access required */
|
|
1181
|
+
403: {
|
|
1182
|
+
headers: {
|
|
1183
|
+
[name: string]: unknown;
|
|
1184
|
+
};
|
|
1185
|
+
content: {
|
|
1186
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
1187
|
+
};
|
|
1188
|
+
};
|
|
1189
|
+
};
|
|
1190
|
+
};
|
|
1191
|
+
delete?: never;
|
|
1192
|
+
options?: never;
|
|
1193
|
+
head?: never;
|
|
1194
|
+
patch?: never;
|
|
1195
|
+
trace?: never;
|
|
1196
|
+
};
|
|
1197
|
+
"/api/admin/exchange/export": {
|
|
1198
|
+
parameters: {
|
|
1199
|
+
query?: never;
|
|
1200
|
+
header?: never;
|
|
1201
|
+
path?: never;
|
|
1202
|
+
cookie?: never;
|
|
1203
|
+
};
|
|
1204
|
+
get?: never;
|
|
1205
|
+
put?: never;
|
|
1206
|
+
/**
|
|
1207
|
+
* Export Knowledge Base as JSON-LD
|
|
1208
|
+
* @description Export the knowledge base as a JSON-LD Linked Data tar.gz archive
|
|
1209
|
+
*/
|
|
1210
|
+
post: {
|
|
1211
|
+
parameters: {
|
|
1212
|
+
query?: {
|
|
1213
|
+
/** @description Include archived resources in export */
|
|
1214
|
+
includeArchived?: boolean;
|
|
1215
|
+
};
|
|
1216
|
+
header?: never;
|
|
1217
|
+
path?: never;
|
|
1218
|
+
cookie?: never;
|
|
1219
|
+
};
|
|
1220
|
+
requestBody?: never;
|
|
1221
|
+
responses: {
|
|
1222
|
+
/** @description Streaming JSON-LD archive */
|
|
1223
|
+
200: {
|
|
1224
|
+
headers: {
|
|
1225
|
+
[name: string]: unknown;
|
|
1226
|
+
};
|
|
1227
|
+
content: {
|
|
1228
|
+
"application/gzip": string;
|
|
1229
|
+
};
|
|
1230
|
+
};
|
|
1231
|
+
/** @description Unauthorized */
|
|
1232
|
+
401: {
|
|
1233
|
+
headers: {
|
|
1234
|
+
[name: string]: unknown;
|
|
1235
|
+
};
|
|
1236
|
+
content: {
|
|
1237
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
1238
|
+
};
|
|
1239
|
+
};
|
|
1240
|
+
/** @description Forbidden - Admin access required */
|
|
1241
|
+
403: {
|
|
1242
|
+
headers: {
|
|
1243
|
+
[name: string]: unknown;
|
|
1244
|
+
};
|
|
1245
|
+
content: {
|
|
1246
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
1247
|
+
};
|
|
1248
|
+
};
|
|
1249
|
+
};
|
|
1250
|
+
};
|
|
1251
|
+
delete?: never;
|
|
1252
|
+
options?: never;
|
|
1253
|
+
head?: never;
|
|
1254
|
+
patch?: never;
|
|
1255
|
+
trace?: never;
|
|
1256
|
+
};
|
|
1257
|
+
"/api/admin/exchange/import": {
|
|
1258
|
+
parameters: {
|
|
1259
|
+
query?: never;
|
|
1260
|
+
header?: never;
|
|
1261
|
+
path?: never;
|
|
1262
|
+
cookie?: never;
|
|
1263
|
+
};
|
|
1264
|
+
get?: never;
|
|
1265
|
+
put?: never;
|
|
1266
|
+
/**
|
|
1267
|
+
* Import Knowledge Base from JSON-LD
|
|
1268
|
+
* @description Import resources from a JSON-LD Linked Data archive. Returns SSE progress events.
|
|
1269
|
+
*/
|
|
1270
|
+
post: {
|
|
1271
|
+
parameters: {
|
|
1272
|
+
query?: never;
|
|
1273
|
+
header?: never;
|
|
1274
|
+
path?: never;
|
|
1275
|
+
cookie?: never;
|
|
1276
|
+
};
|
|
1277
|
+
requestBody: {
|
|
1278
|
+
content: {
|
|
1279
|
+
"multipart/form-data": {
|
|
1280
|
+
/**
|
|
1281
|
+
* Format: binary
|
|
1282
|
+
* @description JSON-LD archive (.tar.gz)
|
|
1283
|
+
*/
|
|
1284
|
+
file: string;
|
|
1285
|
+
};
|
|
1286
|
+
};
|
|
1287
|
+
};
|
|
1288
|
+
responses: {
|
|
1289
|
+
/** @description SSE stream of import progress events */
|
|
1290
|
+
200: {
|
|
1291
|
+
headers: {
|
|
1292
|
+
[name: string]: unknown;
|
|
1293
|
+
};
|
|
1294
|
+
content: {
|
|
1295
|
+
"text/event-stream": string;
|
|
1296
|
+
};
|
|
1297
|
+
};
|
|
1298
|
+
/** @description Invalid file format */
|
|
1299
|
+
400: {
|
|
1300
|
+
headers: {
|
|
1301
|
+
[name: string]: unknown;
|
|
1302
|
+
};
|
|
1303
|
+
content: {
|
|
1304
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
1305
|
+
};
|
|
1306
|
+
};
|
|
1307
|
+
/** @description Unauthorized */
|
|
1308
|
+
401: {
|
|
1309
|
+
headers: {
|
|
1310
|
+
[name: string]: unknown;
|
|
1311
|
+
};
|
|
1312
|
+
content: {
|
|
1313
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
1314
|
+
};
|
|
1315
|
+
};
|
|
1316
|
+
/** @description Forbidden - Admin access required */
|
|
1317
|
+
403: {
|
|
1318
|
+
headers: {
|
|
1319
|
+
[name: string]: unknown;
|
|
1320
|
+
};
|
|
1321
|
+
content: {
|
|
1322
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
1323
|
+
};
|
|
1324
|
+
};
|
|
1325
|
+
};
|
|
1326
|
+
};
|
|
1327
|
+
delete?: never;
|
|
1328
|
+
options?: never;
|
|
1329
|
+
head?: never;
|
|
1330
|
+
patch?: never;
|
|
1331
|
+
trace?: never;
|
|
1332
|
+
};
|
|
1064
1333
|
"/resources": {
|
|
1065
1334
|
parameters: {
|
|
1066
1335
|
query?: never;
|
|
@@ -2435,8 +2704,8 @@ interface components {
|
|
|
2435
2704
|
annotation: components["schemas"]["Annotation"];
|
|
2436
2705
|
sourceResource: components["schemas"]["ResourceDescriptor"];
|
|
2437
2706
|
targetResource?: components["schemas"]["ResourceDescriptor"] | null;
|
|
2438
|
-
/** @description
|
|
2439
|
-
context?: components["schemas"]["
|
|
2707
|
+
/** @description Gathered context for this annotation */
|
|
2708
|
+
context?: components["schemas"]["GatheredContext"];
|
|
2440
2709
|
/** @description DEPRECATED: Use 'context' instead. Legacy source context format. */
|
|
2441
2710
|
sourceContext?: {
|
|
2442
2711
|
before: string;
|
|
@@ -2707,8 +2976,8 @@ interface components {
|
|
|
2707
2976
|
prompt?: string;
|
|
2708
2977
|
/** @description Language locale for generated content (e.g., "es", "fr", "ja") */
|
|
2709
2978
|
language?: string;
|
|
2710
|
-
/** @description
|
|
2711
|
-
context: components["schemas"]["
|
|
2979
|
+
/** @description Gathered context including source document excerpts, metadata, and graph context */
|
|
2980
|
+
context: components["schemas"]["GatheredContext"];
|
|
2712
2981
|
/** @description Inference temperature (0.0 = focused, 1.0 = creative) */
|
|
2713
2982
|
temperature?: number;
|
|
2714
2983
|
/** @description Maximum tokens to generate */
|
|
@@ -2954,10 +3223,7 @@ interface components {
|
|
|
2954
3223
|
} | (string | {
|
|
2955
3224
|
[key: string]: unknown;
|
|
2956
3225
|
})[];
|
|
2957
|
-
/**
|
|
2958
|
-
* Format: uri
|
|
2959
|
-
* @description Canonical URI/URN of the resource being described.
|
|
2960
|
-
*/
|
|
3226
|
+
/** @description Canonical URI/URN of the resource being described. */
|
|
2961
3227
|
"@id": string;
|
|
2962
3228
|
/** @description Type(s) of the resource (IRIs/CURIEs via @context). */
|
|
2963
3229
|
"@type"?: string | string[];
|
|
@@ -3010,6 +3276,11 @@ interface components {
|
|
|
3010
3276
|
sourceAnnotationId?: string;
|
|
3011
3277
|
/** @description Application-specific: ID of source resource for clones/derivatives */
|
|
3012
3278
|
sourceResourceId?: string;
|
|
3279
|
+
/**
|
|
3280
|
+
* Format: uri
|
|
3281
|
+
* @description Original URI from a source knowledge base when this resource was imported
|
|
3282
|
+
*/
|
|
3283
|
+
originatedFrom?: string;
|
|
3013
3284
|
} & {
|
|
3014
3285
|
[key: string]: unknown;
|
|
3015
3286
|
};
|
|
@@ -3165,8 +3436,12 @@ interface components {
|
|
|
3165
3436
|
*/
|
|
3166
3437
|
conformsTo?: string;
|
|
3167
3438
|
};
|
|
3168
|
-
/** @description Context
|
|
3169
|
-
|
|
3439
|
+
/** @description Context gathered for an annotation. Includes source document excerpts, metadata, and graph-derived context. Used by both Find (bind) and Generate (yield) flows. */
|
|
3440
|
+
GatheredContext: {
|
|
3441
|
+
/** @description The annotation this context was gathered for */
|
|
3442
|
+
annotation: components["schemas"]["Annotation"];
|
|
3443
|
+
/** @description The resource containing the annotation */
|
|
3444
|
+
sourceResource: components["schemas"]["ResourceDescriptor"];
|
|
3170
3445
|
/** @description Text context from the source document */
|
|
3171
3446
|
sourceContext: {
|
|
3172
3447
|
/** @description Text appearing before the selected passage */
|
|
@@ -3176,7 +3451,7 @@ interface components {
|
|
|
3176
3451
|
/** @description Text appearing after the selected passage */
|
|
3177
3452
|
after?: string;
|
|
3178
3453
|
};
|
|
3179
|
-
/** @description
|
|
3454
|
+
/** @description Context metadata about the annotation and its source */
|
|
3180
3455
|
metadata?: {
|
|
3181
3456
|
/** @description Type of source resource (e.g., 'document', 'image', 'video') */
|
|
3182
3457
|
resourceType?: string;
|
|
@@ -3185,6 +3460,35 @@ interface components {
|
|
|
3185
3460
|
/** @description Entity types associated with the annotation */
|
|
3186
3461
|
entityTypes?: string[];
|
|
3187
3462
|
};
|
|
3463
|
+
/** @description Graph-derived context from the knowledge base */
|
|
3464
|
+
graphContext?: {
|
|
3465
|
+
/** @description Resources connected to the source resource via annotations */
|
|
3466
|
+
connections?: {
|
|
3467
|
+
/** @description ID of the connected resource */
|
|
3468
|
+
resourceId: string;
|
|
3469
|
+
/** @description Name of the connected resource */
|
|
3470
|
+
resourceName: string;
|
|
3471
|
+
/** @description Entity types on the connected resource */
|
|
3472
|
+
entityTypes?: string[];
|
|
3473
|
+
/** @description Whether the connection goes both ways */
|
|
3474
|
+
bidirectional: boolean;
|
|
3475
|
+
}[];
|
|
3476
|
+
/** @description Number of other resources that reference the source resource */
|
|
3477
|
+
citedByCount?: number;
|
|
3478
|
+
/** @description Resources that reference the source resource */
|
|
3479
|
+
citedBy?: {
|
|
3480
|
+
resourceId: string;
|
|
3481
|
+
resourceName: string;
|
|
3482
|
+
}[];
|
|
3483
|
+
/** @description Entity types from other annotations on the same resource */
|
|
3484
|
+
siblingEntityTypes?: string[];
|
|
3485
|
+
/** @description Global frequency counts for entity types (for IDF-like weighting) */
|
|
3486
|
+
entityTypeFrequencies?: {
|
|
3487
|
+
[key: string]: number;
|
|
3488
|
+
};
|
|
3489
|
+
/** @description LLM-generated summary of the annotation's relationships in the knowledge graph */
|
|
3490
|
+
inferredRelationshipSummary?: string;
|
|
3491
|
+
};
|
|
3188
3492
|
};
|
|
3189
3493
|
};
|
|
3190
3494
|
responses: never;
|
|
@@ -3308,92 +3612,6 @@ declare function resourceId(id: string): ResourceId;
|
|
|
3308
3612
|
declare function annotationId(id: string): AnnotationId;
|
|
3309
3613
|
declare function userId(id: string): UserId;
|
|
3310
3614
|
|
|
3311
|
-
/**
|
|
3312
|
-
* URI utilities for W3C annotations
|
|
3313
|
-
*
|
|
3314
|
-
* Converts between short resource/annotation IDs and full URIs.
|
|
3315
|
-
* Full URIs are required by W3C Web Annotation Data Model.
|
|
3316
|
-
*/
|
|
3317
|
-
|
|
3318
|
-
/**
|
|
3319
|
-
* Convert resource ID to full URI
|
|
3320
|
-
*
|
|
3321
|
-
* @param id - Short resource ID (e.g., "doc-abc123")
|
|
3322
|
-
* @param publicURL - Backend base URL
|
|
3323
|
-
* @returns Full URI (e.g., "https://api.semiont.app/resources/doc-abc123")
|
|
3324
|
-
*
|
|
3325
|
-
* @example
|
|
3326
|
-
* resourceIdToURI("doc-abc123", "https://api.semiont.app")
|
|
3327
|
-
* // => "https://api.semiont.app/resources/doc-abc123"
|
|
3328
|
-
*/
|
|
3329
|
-
declare function resourceIdToURI(id: ResourceId, publicURL: string): ResourceUri;
|
|
3330
|
-
/**
|
|
3331
|
-
* Extract resource ID from full URI
|
|
3332
|
-
*
|
|
3333
|
-
* @param uri - Full resource URI (e.g., "https://api.semiont.app/resources/doc-abc123")
|
|
3334
|
-
* @returns Short resource ID (e.g., "doc-abc123")
|
|
3335
|
-
* @throws Error if URI format is invalid
|
|
3336
|
-
*
|
|
3337
|
-
* @example
|
|
3338
|
-
* uriToResourceId("https://api.semiont.app/resources/doc-abc123")
|
|
3339
|
-
* // => "doc-abc123"
|
|
3340
|
-
*/
|
|
3341
|
-
declare function uriToResourceId(uri: string): ResourceId;
|
|
3342
|
-
/**
|
|
3343
|
-
* Convert annotation ID to full URI
|
|
3344
|
-
*
|
|
3345
|
-
* @param id - Short annotation ID (e.g., "anno-xyz789")
|
|
3346
|
-
* @param publicURL - Backend base URL
|
|
3347
|
-
* @returns Full URI (e.g., "https://api.semiont.app/annotations/anno-xyz789")
|
|
3348
|
-
*
|
|
3349
|
-
* @example
|
|
3350
|
-
* annotationIdToURI("anno-xyz789", "https://api.semiont.app")
|
|
3351
|
-
* // => "https://api.semiont.app/annotations/anno-xyz789"
|
|
3352
|
-
*/
|
|
3353
|
-
declare function annotationIdToURI(id: AnnotationId, publicURL: string): AnnotationUri;
|
|
3354
|
-
/**
|
|
3355
|
-
* Extract annotation ID from full URI
|
|
3356
|
-
*
|
|
3357
|
-
* @param uri - Full annotation URI (e.g., "https://api.semiont.app/annotations/anno-xyz789")
|
|
3358
|
-
* @returns Short annotation ID (e.g., "anno-xyz789")
|
|
3359
|
-
* @throws Error if URI format is invalid
|
|
3360
|
-
*
|
|
3361
|
-
* @example
|
|
3362
|
-
* uriToAnnotationId("https://api.semiont.app/annotations/anno-xyz789")
|
|
3363
|
-
* // => "anno-xyz789"
|
|
3364
|
-
*/
|
|
3365
|
-
declare function uriToAnnotationId(uri: string): AnnotationId;
|
|
3366
|
-
/**
|
|
3367
|
-
* Extract annotation ID from URI or pass through if already an ID
|
|
3368
|
-
*
|
|
3369
|
-
* Defensive version of uriToAnnotationId that handles both:
|
|
3370
|
-
* - Full URIs: "https://api.semiont.app/annotations/anno-xyz789" → "anno-xyz789"
|
|
3371
|
-
* - Already IDs: "anno-xyz789" → "anno-xyz789"
|
|
3372
|
-
*
|
|
3373
|
-
* @param uriOrId - Full annotation URI or short ID
|
|
3374
|
-
* @returns Short annotation ID
|
|
3375
|
-
*
|
|
3376
|
-
* @example
|
|
3377
|
-
* uriToAnnotationIdOrPassthrough("https://api.semiont.app/annotations/anno-xyz789")
|
|
3378
|
-
* // => "anno-xyz789"
|
|
3379
|
-
*
|
|
3380
|
-
* uriToAnnotationIdOrPassthrough("anno-xyz789")
|
|
3381
|
-
* // => "anno-xyz789"
|
|
3382
|
-
*/
|
|
3383
|
-
declare function uriToAnnotationIdOrPassthrough(uriOrId: string): AnnotationId;
|
|
3384
|
-
/**
|
|
3385
|
-
* Extract resource URI from nested annotation URI
|
|
3386
|
-
*
|
|
3387
|
-
* @param annotationUri - Nested ResourceAnnotationUri (e.g., "https://api.semiont.app/resources/doc-123/annotations/anno-456")
|
|
3388
|
-
* @returns Resource URI (e.g., "https://api.semiont.app/resources/doc-123")
|
|
3389
|
-
* @throws Error if URI format is invalid
|
|
3390
|
-
*
|
|
3391
|
-
* @example
|
|
3392
|
-
* extractResourceUriFromAnnotationUri("https://api.semiont.app/resources/doc-123/annotations/anno-456")
|
|
3393
|
-
* // => "https://api.semiont.app/resources/doc-123"
|
|
3394
|
-
*/
|
|
3395
|
-
declare function extractResourceUriFromAnnotationUri(annotationUri: ResourceAnnotationUri): ResourceUri;
|
|
3396
|
-
|
|
3397
3615
|
/**
|
|
3398
3616
|
* Graph types - Models for graph connections and relationships
|
|
3399
3617
|
*/
|
|
@@ -3704,7 +3922,7 @@ declare function isResourceEvent(event: any): event is StoredEvent;
|
|
|
3704
3922
|
*/
|
|
3705
3923
|
|
|
3706
3924
|
type Selector = components['schemas']['TextPositionSelector'] | components['schemas']['TextQuoteSelector'] | components['schemas']['SvgSelector'] | components['schemas']['FragmentSelector'];
|
|
3707
|
-
type
|
|
3925
|
+
type GatheredContext = components['schemas']['GatheredContext'];
|
|
3708
3926
|
type Annotation$3 = components['schemas']['Annotation'];
|
|
3709
3927
|
type Motivation = components['schemas']['Motivation'];
|
|
3710
3928
|
/**
|
|
@@ -3776,21 +3994,16 @@ interface MarkProgress {
|
|
|
3776
3994
|
*/
|
|
3777
3995
|
type EventMap = {
|
|
3778
3996
|
'make-meaning:event': ResourceEvent;
|
|
3779
|
-
'yield:modal-open': {
|
|
3780
|
-
annotationUri: string;
|
|
3781
|
-
resourceUri: string;
|
|
3782
|
-
defaultTitle: string;
|
|
3783
|
-
};
|
|
3784
3997
|
'yield:request': {
|
|
3785
|
-
|
|
3786
|
-
|
|
3998
|
+
annotationId: AnnotationId;
|
|
3999
|
+
resourceId: ResourceId;
|
|
3787
4000
|
options: {
|
|
3788
4001
|
title: string;
|
|
3789
4002
|
prompt?: string;
|
|
3790
4003
|
language?: string;
|
|
3791
4004
|
temperature?: number;
|
|
3792
4005
|
maxTokens?: number;
|
|
3793
|
-
context:
|
|
4006
|
+
context: GatheredContext;
|
|
3794
4007
|
};
|
|
3795
4008
|
};
|
|
3796
4009
|
'yield:progress': YieldProgress;
|
|
@@ -3926,7 +4139,7 @@ type EventMap = {
|
|
|
3926
4139
|
'mark:progress': MarkProgress;
|
|
3927
4140
|
'mark:assist-finished': {
|
|
3928
4141
|
motivation?: Motivation;
|
|
3929
|
-
|
|
4142
|
+
resourceId?: ResourceId;
|
|
3930
4143
|
progress?: MarkProgress;
|
|
3931
4144
|
};
|
|
3932
4145
|
'mark:assist-failed': Extract<ResourceEvent, {
|
|
@@ -4000,25 +4213,23 @@ type EventMap = {
|
|
|
4000
4213
|
'mark:unarchived': Extract<ResourceEvent, {
|
|
4001
4214
|
type: 'resource.unarchived';
|
|
4002
4215
|
}>;
|
|
4003
|
-
'bind:
|
|
4004
|
-
|
|
4005
|
-
|
|
4216
|
+
'bind:initiate': {
|
|
4217
|
+
annotationId: AnnotationId;
|
|
4218
|
+
resourceId: ResourceId;
|
|
4219
|
+
defaultTitle: string;
|
|
4006
4220
|
entityTypes: string[];
|
|
4007
4221
|
};
|
|
4008
|
-
'bind:link': {
|
|
4009
|
-
annotationUri: string;
|
|
4010
|
-
searchTerm: string;
|
|
4011
|
-
};
|
|
4012
4222
|
'bind:search-requested': {
|
|
4013
4223
|
correlationId?: string;
|
|
4014
4224
|
referenceId: string;
|
|
4015
|
-
|
|
4225
|
+
context: GatheredContext;
|
|
4226
|
+
limit?: number;
|
|
4227
|
+
useSemanticScoring?: boolean;
|
|
4016
4228
|
};
|
|
4017
4229
|
'bind:update-body': {
|
|
4018
|
-
|
|
4019
|
-
resourceId:
|
|
4230
|
+
annotationId: AnnotationId;
|
|
4231
|
+
resourceId: ResourceId;
|
|
4020
4232
|
userId?: UserId;
|
|
4021
|
-
annotationId?: AnnotationId;
|
|
4022
4233
|
operations: Array<{
|
|
4023
4234
|
op: 'add' | 'remove' | 'replace';
|
|
4024
4235
|
item?: components['schemas']['AnnotationBody'];
|
|
@@ -4027,15 +4238,17 @@ type EventMap = {
|
|
|
4027
4238
|
}>;
|
|
4028
4239
|
};
|
|
4029
4240
|
'bind:body-updated': {
|
|
4030
|
-
|
|
4241
|
+
annotationId: AnnotationId;
|
|
4031
4242
|
};
|
|
4032
4243
|
'bind:body-update-failed': {
|
|
4033
4244
|
error: Error;
|
|
4034
4245
|
};
|
|
4035
4246
|
'bind:search-results': {
|
|
4036
4247
|
referenceId: string;
|
|
4037
|
-
|
|
4038
|
-
|
|
4248
|
+
results: Array<components['schemas']['ResourceDescriptor'] & {
|
|
4249
|
+
score?: number;
|
|
4250
|
+
matchReason?: string;
|
|
4251
|
+
}>;
|
|
4039
4252
|
correlationId?: string;
|
|
4040
4253
|
};
|
|
4041
4254
|
'bind:search-failed': {
|
|
@@ -4058,8 +4271,8 @@ type EventMap = {
|
|
|
4058
4271
|
};
|
|
4059
4272
|
'gather:requested': {
|
|
4060
4273
|
correlationId?: string;
|
|
4061
|
-
|
|
4062
|
-
|
|
4274
|
+
annotationId: AnnotationId;
|
|
4275
|
+
resourceId: ResourceId;
|
|
4063
4276
|
options?: {
|
|
4064
4277
|
includeSourceContext?: boolean;
|
|
4065
4278
|
includeTargetContext?: boolean;
|
|
@@ -4068,17 +4281,17 @@ type EventMap = {
|
|
|
4068
4281
|
};
|
|
4069
4282
|
'gather:complete': {
|
|
4070
4283
|
correlationId?: string;
|
|
4071
|
-
|
|
4284
|
+
annotationId: AnnotationId;
|
|
4072
4285
|
response: components['schemas']['AnnotationLLMContextResponse'];
|
|
4073
4286
|
};
|
|
4074
4287
|
'gather:failed': {
|
|
4075
4288
|
correlationId?: string;
|
|
4076
|
-
|
|
4289
|
+
annotationId: AnnotationId;
|
|
4077
4290
|
error: Error;
|
|
4078
4291
|
};
|
|
4079
4292
|
'gather:resource-requested': {
|
|
4080
4293
|
correlationId?: string;
|
|
4081
|
-
|
|
4294
|
+
resourceId: ResourceId;
|
|
4082
4295
|
options: {
|
|
4083
4296
|
depth: number;
|
|
4084
4297
|
maxResources: number;
|
|
@@ -4088,12 +4301,12 @@ type EventMap = {
|
|
|
4088
4301
|
};
|
|
4089
4302
|
'gather:resource-complete': {
|
|
4090
4303
|
correlationId?: string;
|
|
4091
|
-
|
|
4304
|
+
resourceId: ResourceId;
|
|
4092
4305
|
context: components['schemas']['ResourceLLMContextResponse'];
|
|
4093
4306
|
};
|
|
4094
4307
|
'gather:resource-failed': {
|
|
4095
4308
|
correlationId?: string;
|
|
4096
|
-
|
|
4309
|
+
resourceId: ResourceId;
|
|
4097
4310
|
error: Error;
|
|
4098
4311
|
};
|
|
4099
4312
|
'browse:click': {
|
|
@@ -4569,10 +4782,12 @@ declare function validateSvgMarkup(svg: string): string | null;
|
|
|
4569
4782
|
/**
|
|
4570
4783
|
* Build a complete W3C Annotation from a CreateAnnotationRequest.
|
|
4571
4784
|
*
|
|
4572
|
-
* Generates ID
|
|
4785
|
+
* Generates a bare annotation ID (no URL prefix). URIs are constructed
|
|
4786
|
+
* at the API boundary when returning responses to clients.
|
|
4787
|
+
*
|
|
4573
4788
|
* Throws on invalid input (missing selector, missing motivation, invalid SVG).
|
|
4574
4789
|
*/
|
|
4575
|
-
declare function assembleAnnotation(request: CreateAnnotationRequest, creator: Agent$1
|
|
4790
|
+
declare function assembleAnnotation(request: CreateAnnotationRequest, creator: Agent$1): AssembledAnnotation;
|
|
4576
4791
|
/**
|
|
4577
4792
|
* Apply body operations (add/remove/replace) to an annotation's body array.
|
|
4578
4793
|
* Returns a new array — does not mutate the input.
|
|
@@ -5618,4 +5833,4 @@ declare class ConfigurationError extends Error {
|
|
|
5618
5833
|
declare const CORE_TYPES_VERSION = "0.1.0";
|
|
5619
5834
|
declare const SDK_VERSION = "0.1.0";
|
|
5620
5835
|
|
|
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
|
|
5836
|
+
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 GatheredContext, 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 YieldProgress, accessToken, annotationId, annotationUri, applyBodyOperations, assembleAnnotation, authCode, baseUrl, burstBuffer, cloneToken, type components, createConfigLoader, deepMerge, didToAgent, displayConfiguration, email, entityType, 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, resourceUri, searchQuery, userDID, userId, userToAgent, userToDid, validateEnvironment, validateEnvironmentConfig, validateSemiontConfig, validateSiteConfig, validateSvgMarkup };
|