@semiont/core 0.2.46 → 0.3.1
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 +349 -132
- 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,10 +3436,14 @@ 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
|
-
sourceContext
|
|
3446
|
+
sourceContext?: {
|
|
3172
3447
|
/** @description Text appearing before the selected passage */
|
|
3173
3448
|
before?: string;
|
|
3174
3449
|
/** @description The selected text passage (the annotation target) */
|
|
@@ -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,37 @@ interface components {
|
|
|
3185
3460
|
/** @description Entity types associated with the annotation */
|
|
3186
3461
|
entityTypes?: string[];
|
|
3187
3462
|
};
|
|
3463
|
+
/** @description User-provided textual hint to supplement or replace the selected text for search and generation */
|
|
3464
|
+
userHint?: string;
|
|
3465
|
+
/** @description Graph-derived context from the knowledge base */
|
|
3466
|
+
graphContext?: {
|
|
3467
|
+
/** @description Resources connected to the source resource via annotations */
|
|
3468
|
+
connections?: {
|
|
3469
|
+
/** @description ID of the connected resource */
|
|
3470
|
+
resourceId: string;
|
|
3471
|
+
/** @description Name of the connected resource */
|
|
3472
|
+
resourceName: string;
|
|
3473
|
+
/** @description Entity types on the connected resource */
|
|
3474
|
+
entityTypes?: string[];
|
|
3475
|
+
/** @description Whether the connection goes both ways */
|
|
3476
|
+
bidirectional: boolean;
|
|
3477
|
+
}[];
|
|
3478
|
+
/** @description Number of other resources that reference the source resource */
|
|
3479
|
+
citedByCount?: number;
|
|
3480
|
+
/** @description Resources that reference the source resource */
|
|
3481
|
+
citedBy?: {
|
|
3482
|
+
resourceId: string;
|
|
3483
|
+
resourceName: string;
|
|
3484
|
+
}[];
|
|
3485
|
+
/** @description Entity types from other annotations on the same resource */
|
|
3486
|
+
siblingEntityTypes?: string[];
|
|
3487
|
+
/** @description Global frequency counts for entity types (for IDF-like weighting) */
|
|
3488
|
+
entityTypeFrequencies?: {
|
|
3489
|
+
[key: string]: number;
|
|
3490
|
+
};
|
|
3491
|
+
/** @description LLM-generated summary of the annotation's relationships in the knowledge graph */
|
|
3492
|
+
inferredRelationshipSummary?: string;
|
|
3493
|
+
};
|
|
3188
3494
|
};
|
|
3189
3495
|
};
|
|
3190
3496
|
responses: never;
|
|
@@ -3308,92 +3614,6 @@ declare function resourceId(id: string): ResourceId;
|
|
|
3308
3614
|
declare function annotationId(id: string): AnnotationId;
|
|
3309
3615
|
declare function userId(id: string): UserId;
|
|
3310
3616
|
|
|
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
3617
|
/**
|
|
3398
3618
|
* Graph types - Models for graph connections and relationships
|
|
3399
3619
|
*/
|
|
@@ -3704,7 +3924,7 @@ declare function isResourceEvent(event: any): event is StoredEvent;
|
|
|
3704
3924
|
*/
|
|
3705
3925
|
|
|
3706
3926
|
type Selector = components['schemas']['TextPositionSelector'] | components['schemas']['TextQuoteSelector'] | components['schemas']['SvgSelector'] | components['schemas']['FragmentSelector'];
|
|
3707
|
-
type
|
|
3927
|
+
type GatheredContext = components['schemas']['GatheredContext'];
|
|
3708
3928
|
type Annotation$3 = components['schemas']['Annotation'];
|
|
3709
3929
|
type Motivation = components['schemas']['Motivation'];
|
|
3710
3930
|
/**
|
|
@@ -3776,21 +3996,16 @@ interface MarkProgress {
|
|
|
3776
3996
|
*/
|
|
3777
3997
|
type EventMap = {
|
|
3778
3998
|
'make-meaning:event': ResourceEvent;
|
|
3779
|
-
'yield:modal-open': {
|
|
3780
|
-
annotationUri: string;
|
|
3781
|
-
resourceUri: string;
|
|
3782
|
-
defaultTitle: string;
|
|
3783
|
-
};
|
|
3784
3999
|
'yield:request': {
|
|
3785
|
-
|
|
3786
|
-
|
|
4000
|
+
annotationId: AnnotationId;
|
|
4001
|
+
resourceId: ResourceId;
|
|
3787
4002
|
options: {
|
|
3788
4003
|
title: string;
|
|
3789
4004
|
prompt?: string;
|
|
3790
4005
|
language?: string;
|
|
3791
4006
|
temperature?: number;
|
|
3792
4007
|
maxTokens?: number;
|
|
3793
|
-
context:
|
|
4008
|
+
context: GatheredContext;
|
|
3794
4009
|
};
|
|
3795
4010
|
};
|
|
3796
4011
|
'yield:progress': YieldProgress;
|
|
@@ -3926,7 +4141,7 @@ type EventMap = {
|
|
|
3926
4141
|
'mark:progress': MarkProgress;
|
|
3927
4142
|
'mark:assist-finished': {
|
|
3928
4143
|
motivation?: Motivation;
|
|
3929
|
-
|
|
4144
|
+
resourceId?: ResourceId;
|
|
3930
4145
|
progress?: MarkProgress;
|
|
3931
4146
|
};
|
|
3932
4147
|
'mark:assist-failed': Extract<ResourceEvent, {
|
|
@@ -4000,25 +4215,23 @@ type EventMap = {
|
|
|
4000
4215
|
'mark:unarchived': Extract<ResourceEvent, {
|
|
4001
4216
|
type: 'resource.unarchived';
|
|
4002
4217
|
}>;
|
|
4003
|
-
'bind:
|
|
4004
|
-
|
|
4005
|
-
|
|
4218
|
+
'bind:initiate': {
|
|
4219
|
+
annotationId: AnnotationId;
|
|
4220
|
+
resourceId: ResourceId;
|
|
4221
|
+
defaultTitle: string;
|
|
4006
4222
|
entityTypes: string[];
|
|
4007
4223
|
};
|
|
4008
|
-
'bind:link': {
|
|
4009
|
-
annotationUri: string;
|
|
4010
|
-
searchTerm: string;
|
|
4011
|
-
};
|
|
4012
4224
|
'bind:search-requested': {
|
|
4013
4225
|
correlationId?: string;
|
|
4014
4226
|
referenceId: string;
|
|
4015
|
-
|
|
4227
|
+
context: GatheredContext;
|
|
4228
|
+
limit?: number;
|
|
4229
|
+
useSemanticScoring?: boolean;
|
|
4016
4230
|
};
|
|
4017
4231
|
'bind:update-body': {
|
|
4018
|
-
|
|
4019
|
-
resourceId:
|
|
4232
|
+
annotationId: AnnotationId;
|
|
4233
|
+
resourceId: ResourceId;
|
|
4020
4234
|
userId?: UserId;
|
|
4021
|
-
annotationId?: AnnotationId;
|
|
4022
4235
|
operations: Array<{
|
|
4023
4236
|
op: 'add' | 'remove' | 'replace';
|
|
4024
4237
|
item?: components['schemas']['AnnotationBody'];
|
|
@@ -4027,15 +4240,17 @@ type EventMap = {
|
|
|
4027
4240
|
}>;
|
|
4028
4241
|
};
|
|
4029
4242
|
'bind:body-updated': {
|
|
4030
|
-
|
|
4243
|
+
annotationId: AnnotationId;
|
|
4031
4244
|
};
|
|
4032
4245
|
'bind:body-update-failed': {
|
|
4033
4246
|
error: Error;
|
|
4034
4247
|
};
|
|
4035
4248
|
'bind:search-results': {
|
|
4036
4249
|
referenceId: string;
|
|
4037
|
-
|
|
4038
|
-
|
|
4250
|
+
results: Array<components['schemas']['ResourceDescriptor'] & {
|
|
4251
|
+
score?: number;
|
|
4252
|
+
matchReason?: string;
|
|
4253
|
+
}>;
|
|
4039
4254
|
correlationId?: string;
|
|
4040
4255
|
};
|
|
4041
4256
|
'bind:search-failed': {
|
|
@@ -4058,8 +4273,8 @@ type EventMap = {
|
|
|
4058
4273
|
};
|
|
4059
4274
|
'gather:requested': {
|
|
4060
4275
|
correlationId?: string;
|
|
4061
|
-
|
|
4062
|
-
|
|
4276
|
+
annotationId: AnnotationId;
|
|
4277
|
+
resourceId: ResourceId;
|
|
4063
4278
|
options?: {
|
|
4064
4279
|
includeSourceContext?: boolean;
|
|
4065
4280
|
includeTargetContext?: boolean;
|
|
@@ -4068,17 +4283,17 @@ type EventMap = {
|
|
|
4068
4283
|
};
|
|
4069
4284
|
'gather:complete': {
|
|
4070
4285
|
correlationId?: string;
|
|
4071
|
-
|
|
4286
|
+
annotationId: AnnotationId;
|
|
4072
4287
|
response: components['schemas']['AnnotationLLMContextResponse'];
|
|
4073
4288
|
};
|
|
4074
4289
|
'gather:failed': {
|
|
4075
4290
|
correlationId?: string;
|
|
4076
|
-
|
|
4291
|
+
annotationId: AnnotationId;
|
|
4077
4292
|
error: Error;
|
|
4078
4293
|
};
|
|
4079
4294
|
'gather:resource-requested': {
|
|
4080
4295
|
correlationId?: string;
|
|
4081
|
-
|
|
4296
|
+
resourceId: ResourceId;
|
|
4082
4297
|
options: {
|
|
4083
4298
|
depth: number;
|
|
4084
4299
|
maxResources: number;
|
|
@@ -4088,12 +4303,12 @@ type EventMap = {
|
|
|
4088
4303
|
};
|
|
4089
4304
|
'gather:resource-complete': {
|
|
4090
4305
|
correlationId?: string;
|
|
4091
|
-
|
|
4306
|
+
resourceId: ResourceId;
|
|
4092
4307
|
context: components['schemas']['ResourceLLMContextResponse'];
|
|
4093
4308
|
};
|
|
4094
4309
|
'gather:resource-failed': {
|
|
4095
4310
|
correlationId?: string;
|
|
4096
|
-
|
|
4311
|
+
resourceId: ResourceId;
|
|
4097
4312
|
error: Error;
|
|
4098
4313
|
};
|
|
4099
4314
|
'browse:click': {
|
|
@@ -4569,10 +4784,12 @@ declare function validateSvgMarkup(svg: string): string | null;
|
|
|
4569
4784
|
/**
|
|
4570
4785
|
* Build a complete W3C Annotation from a CreateAnnotationRequest.
|
|
4571
4786
|
*
|
|
4572
|
-
* Generates ID
|
|
4787
|
+
* Generates a bare annotation ID (no URL prefix). URIs are constructed
|
|
4788
|
+
* at the API boundary when returning responses to clients.
|
|
4789
|
+
*
|
|
4573
4790
|
* Throws on invalid input (missing selector, missing motivation, invalid SVG).
|
|
4574
4791
|
*/
|
|
4575
|
-
declare function assembleAnnotation(request: CreateAnnotationRequest, creator: Agent$1
|
|
4792
|
+
declare function assembleAnnotation(request: CreateAnnotationRequest, creator: Agent$1): AssembledAnnotation;
|
|
4576
4793
|
/**
|
|
4577
4794
|
* Apply body operations (add/remove/replace) to an annotation's body array.
|
|
4578
4795
|
* Returns a new array — does not mutate the input.
|
|
@@ -5618,4 +5835,4 @@ declare class ConfigurationError extends Error {
|
|
|
5618
5835
|
declare const CORE_TYPES_VERSION = "0.1.0";
|
|
5619
5836
|
declare const SDK_VERSION = "0.1.0";
|
|
5620
5837
|
|
|
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
|
|
5838
|
+
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 };
|