@semiont/core 0.4.1 → 0.4.3
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 +339 -5
- package/package.json +2 -4
package/dist/index.d.ts
CHANGED
|
@@ -1768,6 +1768,65 @@ interface paths {
|
|
|
1768
1768
|
patch?: never;
|
|
1769
1769
|
trace?: never;
|
|
1770
1770
|
};
|
|
1771
|
+
"/resources/{id}/gather-resource-stream": {
|
|
1772
|
+
parameters: {
|
|
1773
|
+
query?: never;
|
|
1774
|
+
header?: never;
|
|
1775
|
+
path?: never;
|
|
1776
|
+
cookie?: never;
|
|
1777
|
+
};
|
|
1778
|
+
get?: never;
|
|
1779
|
+
put?: never;
|
|
1780
|
+
/**
|
|
1781
|
+
* Gather Resource LLM Context (SSE Stream)
|
|
1782
|
+
* @description Stream real-time resource LLM context gathering progress via Server-Sent Events
|
|
1783
|
+
*/
|
|
1784
|
+
post: {
|
|
1785
|
+
parameters: {
|
|
1786
|
+
query?: never;
|
|
1787
|
+
header?: never;
|
|
1788
|
+
path: {
|
|
1789
|
+
id: string;
|
|
1790
|
+
};
|
|
1791
|
+
cookie?: never;
|
|
1792
|
+
};
|
|
1793
|
+
requestBody?: {
|
|
1794
|
+
content: {
|
|
1795
|
+
"application/json": components["schemas"]["GatherResourceStreamRequest"];
|
|
1796
|
+
};
|
|
1797
|
+
};
|
|
1798
|
+
responses: {
|
|
1799
|
+
/** @description SSE stream opened successfully */
|
|
1800
|
+
200: {
|
|
1801
|
+
headers: {
|
|
1802
|
+
[name: string]: unknown;
|
|
1803
|
+
};
|
|
1804
|
+
content: {
|
|
1805
|
+
"text/event-stream": components["schemas"]["EventStreamResponse"];
|
|
1806
|
+
};
|
|
1807
|
+
};
|
|
1808
|
+
/** @description Authentication required */
|
|
1809
|
+
401: {
|
|
1810
|
+
headers: {
|
|
1811
|
+
[name: string]: unknown;
|
|
1812
|
+
};
|
|
1813
|
+
content?: never;
|
|
1814
|
+
};
|
|
1815
|
+
/** @description Resource not found */
|
|
1816
|
+
404: {
|
|
1817
|
+
headers: {
|
|
1818
|
+
[name: string]: unknown;
|
|
1819
|
+
};
|
|
1820
|
+
content?: never;
|
|
1821
|
+
};
|
|
1822
|
+
};
|
|
1823
|
+
};
|
|
1824
|
+
delete?: never;
|
|
1825
|
+
options?: never;
|
|
1826
|
+
head?: never;
|
|
1827
|
+
patch?: never;
|
|
1828
|
+
trace?: never;
|
|
1829
|
+
};
|
|
1771
1830
|
"/resources/{resourceId}/annotations/{annotationId}/llm-context": {
|
|
1772
1831
|
parameters: {
|
|
1773
1832
|
query?: never;
|
|
@@ -1814,6 +1873,130 @@ interface paths {
|
|
|
1814
1873
|
patch?: never;
|
|
1815
1874
|
trace?: never;
|
|
1816
1875
|
};
|
|
1876
|
+
"/resources/{resourceId}/annotations/{annotationId}/gather-annotation-stream": {
|
|
1877
|
+
parameters: {
|
|
1878
|
+
query?: never;
|
|
1879
|
+
header?: never;
|
|
1880
|
+
path?: never;
|
|
1881
|
+
cookie?: never;
|
|
1882
|
+
};
|
|
1883
|
+
get?: never;
|
|
1884
|
+
put?: never;
|
|
1885
|
+
/**
|
|
1886
|
+
* Gather Annotation LLM Context (SSE Stream)
|
|
1887
|
+
* @description Stream real-time annotation LLM context gathering progress via Server-Sent Events
|
|
1888
|
+
*/
|
|
1889
|
+
post: {
|
|
1890
|
+
parameters: {
|
|
1891
|
+
query?: never;
|
|
1892
|
+
header?: never;
|
|
1893
|
+
path: {
|
|
1894
|
+
/** @description Resource ID */
|
|
1895
|
+
resourceId: string;
|
|
1896
|
+
/** @description Annotation ID */
|
|
1897
|
+
annotationId: string;
|
|
1898
|
+
};
|
|
1899
|
+
cookie?: never;
|
|
1900
|
+
};
|
|
1901
|
+
requestBody?: {
|
|
1902
|
+
content: {
|
|
1903
|
+
"application/json": components["schemas"]["GatherAnnotationStreamRequest"];
|
|
1904
|
+
};
|
|
1905
|
+
};
|
|
1906
|
+
responses: {
|
|
1907
|
+
/** @description SSE stream opened successfully */
|
|
1908
|
+
200: {
|
|
1909
|
+
headers: {
|
|
1910
|
+
[name: string]: unknown;
|
|
1911
|
+
};
|
|
1912
|
+
content: {
|
|
1913
|
+
"text/event-stream": components["schemas"]["EventStreamResponse"];
|
|
1914
|
+
};
|
|
1915
|
+
};
|
|
1916
|
+
/** @description Authentication required */
|
|
1917
|
+
401: {
|
|
1918
|
+
headers: {
|
|
1919
|
+
[name: string]: unknown;
|
|
1920
|
+
};
|
|
1921
|
+
content?: never;
|
|
1922
|
+
};
|
|
1923
|
+
/** @description Annotation not found */
|
|
1924
|
+
404: {
|
|
1925
|
+
headers: {
|
|
1926
|
+
[name: string]: unknown;
|
|
1927
|
+
};
|
|
1928
|
+
content?: never;
|
|
1929
|
+
};
|
|
1930
|
+
};
|
|
1931
|
+
};
|
|
1932
|
+
delete?: never;
|
|
1933
|
+
options?: never;
|
|
1934
|
+
head?: never;
|
|
1935
|
+
patch?: never;
|
|
1936
|
+
trace?: never;
|
|
1937
|
+
};
|
|
1938
|
+
"/resources/{resourceId}/annotations/{annotationId}/bind-stream": {
|
|
1939
|
+
parameters: {
|
|
1940
|
+
query?: never;
|
|
1941
|
+
header?: never;
|
|
1942
|
+
path?: never;
|
|
1943
|
+
cookie?: never;
|
|
1944
|
+
};
|
|
1945
|
+
get?: never;
|
|
1946
|
+
put?: never;
|
|
1947
|
+
/**
|
|
1948
|
+
* Bind Annotation Body (SSE Stream)
|
|
1949
|
+
* @description Apply annotation body operations and stream completion via Server-Sent Events
|
|
1950
|
+
*/
|
|
1951
|
+
post: {
|
|
1952
|
+
parameters: {
|
|
1953
|
+
query?: never;
|
|
1954
|
+
header?: never;
|
|
1955
|
+
path: {
|
|
1956
|
+
/** @description Resource ID */
|
|
1957
|
+
resourceId: string;
|
|
1958
|
+
/** @description Annotation ID */
|
|
1959
|
+
annotationId: string;
|
|
1960
|
+
};
|
|
1961
|
+
cookie?: never;
|
|
1962
|
+
};
|
|
1963
|
+
requestBody?: {
|
|
1964
|
+
content: {
|
|
1965
|
+
"application/json": components["schemas"]["BindAnnotationStreamRequest"];
|
|
1966
|
+
};
|
|
1967
|
+
};
|
|
1968
|
+
responses: {
|
|
1969
|
+
/** @description SSE stream opened successfully */
|
|
1970
|
+
200: {
|
|
1971
|
+
headers: {
|
|
1972
|
+
[name: string]: unknown;
|
|
1973
|
+
};
|
|
1974
|
+
content: {
|
|
1975
|
+
"text/event-stream": components["schemas"]["EventStreamResponse"];
|
|
1976
|
+
};
|
|
1977
|
+
};
|
|
1978
|
+
/** @description Authentication required */
|
|
1979
|
+
401: {
|
|
1980
|
+
headers: {
|
|
1981
|
+
[name: string]: unknown;
|
|
1982
|
+
};
|
|
1983
|
+
content?: never;
|
|
1984
|
+
};
|
|
1985
|
+
/** @description Annotation not found */
|
|
1986
|
+
404: {
|
|
1987
|
+
headers: {
|
|
1988
|
+
[name: string]: unknown;
|
|
1989
|
+
};
|
|
1990
|
+
content?: never;
|
|
1991
|
+
};
|
|
1992
|
+
};
|
|
1993
|
+
};
|
|
1994
|
+
delete?: never;
|
|
1995
|
+
options?: never;
|
|
1996
|
+
head?: never;
|
|
1997
|
+
patch?: never;
|
|
1998
|
+
trace?: never;
|
|
1999
|
+
};
|
|
1817
2000
|
"/resources/{id}/referenced-by": {
|
|
1818
2001
|
parameters: {
|
|
1819
2002
|
query?: never;
|
|
@@ -2588,6 +2771,91 @@ interface paths {
|
|
|
2588
2771
|
patch?: never;
|
|
2589
2772
|
trace?: never;
|
|
2590
2773
|
};
|
|
2774
|
+
"/api/participants/{id}/attention": {
|
|
2775
|
+
parameters: {
|
|
2776
|
+
query?: never;
|
|
2777
|
+
header?: never;
|
|
2778
|
+
path?: never;
|
|
2779
|
+
cookie?: never;
|
|
2780
|
+
};
|
|
2781
|
+
get?: never;
|
|
2782
|
+
put?: never;
|
|
2783
|
+
/**
|
|
2784
|
+
* Beckon Participant
|
|
2785
|
+
* @description Direct a participant's attention to a resource or annotation. Produces no persistent annotations — attention signal only. The participant may be a human username or an agent identifier.
|
|
2786
|
+
*/
|
|
2787
|
+
post: {
|
|
2788
|
+
parameters: {
|
|
2789
|
+
query?: never;
|
|
2790
|
+
header?: never;
|
|
2791
|
+
path: {
|
|
2792
|
+
/** @description Participant username or agent identifier */
|
|
2793
|
+
id: string;
|
|
2794
|
+
};
|
|
2795
|
+
cookie?: never;
|
|
2796
|
+
};
|
|
2797
|
+
requestBody: {
|
|
2798
|
+
content: {
|
|
2799
|
+
"application/json": components["schemas"]["BeckonRequest"];
|
|
2800
|
+
};
|
|
2801
|
+
};
|
|
2802
|
+
responses: {
|
|
2803
|
+
/** @description Attention signal accepted */
|
|
2804
|
+
202: {
|
|
2805
|
+
headers: {
|
|
2806
|
+
[name: string]: unknown;
|
|
2807
|
+
};
|
|
2808
|
+
content: {
|
|
2809
|
+
"application/json": components["schemas"]["BeckonResponse"];
|
|
2810
|
+
};
|
|
2811
|
+
};
|
|
2812
|
+
};
|
|
2813
|
+
};
|
|
2814
|
+
delete?: never;
|
|
2815
|
+
options?: never;
|
|
2816
|
+
head?: never;
|
|
2817
|
+
patch?: never;
|
|
2818
|
+
trace?: never;
|
|
2819
|
+
};
|
|
2820
|
+
"/api/participants/me/attention-stream": {
|
|
2821
|
+
parameters: {
|
|
2822
|
+
query?: never;
|
|
2823
|
+
header?: never;
|
|
2824
|
+
path?: never;
|
|
2825
|
+
cookie?: never;
|
|
2826
|
+
};
|
|
2827
|
+
/**
|
|
2828
|
+
* Participant Attention Stream
|
|
2829
|
+
* @description Open a persistent SSE connection to receive beckon signals directed at the authenticated participant. Signals are ephemeral — delivered if connected, dropped if not. No queue, no replay.
|
|
2830
|
+
*/
|
|
2831
|
+
get: {
|
|
2832
|
+
parameters: {
|
|
2833
|
+
query?: never;
|
|
2834
|
+
header?: never;
|
|
2835
|
+
path?: never;
|
|
2836
|
+
cookie?: never;
|
|
2837
|
+
};
|
|
2838
|
+
requestBody?: never;
|
|
2839
|
+
responses: {
|
|
2840
|
+
/** @description SSE stream of beckon:focus events */
|
|
2841
|
+
200: {
|
|
2842
|
+
headers: {
|
|
2843
|
+
[name: string]: unknown;
|
|
2844
|
+
};
|
|
2845
|
+
content: {
|
|
2846
|
+
"text/event-stream": string;
|
|
2847
|
+
};
|
|
2848
|
+
};
|
|
2849
|
+
};
|
|
2850
|
+
};
|
|
2851
|
+
put?: never;
|
|
2852
|
+
post?: never;
|
|
2853
|
+
delete?: never;
|
|
2854
|
+
options?: never;
|
|
2855
|
+
head?: never;
|
|
2856
|
+
patch?: never;
|
|
2857
|
+
trace?: never;
|
|
2858
|
+
};
|
|
2591
2859
|
}
|
|
2592
2860
|
interface components {
|
|
2593
2861
|
schemas: {
|
|
@@ -2773,6 +3041,22 @@ interface components {
|
|
|
2773
3041
|
* @enum {string}
|
|
2774
3042
|
*/
|
|
2775
3043
|
BodyType: "TextualBody" | "SpecificResource";
|
|
3044
|
+
BeckonRequest: {
|
|
3045
|
+
/** @description Resource to direct attention at */
|
|
3046
|
+
resourceId: string;
|
|
3047
|
+
/** @description Specific annotation within the resource (optional) */
|
|
3048
|
+
annotationId?: string;
|
|
3049
|
+
/** @description Human-readable context for the participant (max 500 chars) */
|
|
3050
|
+
message?: string;
|
|
3051
|
+
};
|
|
3052
|
+
BeckonResponse: {
|
|
3053
|
+
/** @description Username or agent identifier that was beckoned */
|
|
3054
|
+
participant: string;
|
|
3055
|
+
/** @description Resource the attention was directed at */
|
|
3056
|
+
resourceId: string;
|
|
3057
|
+
/** @description Annotation the attention was directed at (if provided) */
|
|
3058
|
+
annotationId?: string;
|
|
3059
|
+
};
|
|
2776
3060
|
BulkAddEntityTypesRequest: {
|
|
2777
3061
|
tags: string[];
|
|
2778
3062
|
};
|
|
@@ -2901,6 +3185,26 @@ interface components {
|
|
|
2901
3185
|
/** @description Include anaphoric/cataphoric references (e.g., 'the CEO', 'the tech giant') in addition to direct mentions */
|
|
2902
3186
|
includeDescriptiveReferences?: boolean;
|
|
2903
3187
|
};
|
|
3188
|
+
GatherResourceStreamRequest: {
|
|
3189
|
+
/** @description Graph traversal depth (default: 2) */
|
|
3190
|
+
depth?: number;
|
|
3191
|
+
/** @description Maximum related resources to include (default: 10) */
|
|
3192
|
+
maxResources?: number;
|
|
3193
|
+
/** @description Include full resource content (default: true) */
|
|
3194
|
+
includeContent?: boolean;
|
|
3195
|
+
/** @description Include AI-generated summary (default: false) */
|
|
3196
|
+
includeSummary?: boolean;
|
|
3197
|
+
};
|
|
3198
|
+
GatherAnnotationStreamRequest: {
|
|
3199
|
+
/** @description Characters of surrounding text context (default: 1000) */
|
|
3200
|
+
contextWindow?: number;
|
|
3201
|
+
};
|
|
3202
|
+
BindAnnotationStreamRequest: {
|
|
3203
|
+
/** @description Resource ID containing the annotation (required for O(1) Layer 3 lookup) */
|
|
3204
|
+
resourceId: string;
|
|
3205
|
+
/** @description Array of body modification operations to apply */
|
|
3206
|
+
operations: (components["schemas"]["BodyOperationAdd"] | components["schemas"]["BodyOperationRemove"] | components["schemas"]["BodyOperationReplace"])[];
|
|
3207
|
+
};
|
|
2904
3208
|
AnnotateHighlightsStreamRequest: {
|
|
2905
3209
|
/** @description Optional instructions to guide AI highlight annotation */
|
|
2906
3210
|
instructions?: string;
|
|
@@ -3155,10 +3459,10 @@ interface components {
|
|
|
3155
3459
|
refresh_token: string;
|
|
3156
3460
|
};
|
|
3157
3461
|
/**
|
|
3158
|
-
* @description W3C Web Annotation
|
|
3462
|
+
* @description Semiont-supported W3C Web Annotation motivations - https://www.w3.org/TR/annotation-vocab/#motivation
|
|
3159
3463
|
* @enum {string}
|
|
3160
3464
|
*/
|
|
3161
|
-
Motivation: "assessing" | "
|
|
3465
|
+
Motivation: "assessing" | "commenting" | "highlighting" | "linking" | "tagging";
|
|
3162
3466
|
OAuthConfigResponse: {
|
|
3163
3467
|
providers: {
|
|
3164
3468
|
name: string;
|
|
@@ -3328,7 +3632,7 @@ interface components {
|
|
|
3328
3632
|
/** @description IRI of the target resource */
|
|
3329
3633
|
source: string;
|
|
3330
3634
|
/** @description Why this body is included */
|
|
3331
|
-
purpose?: components["schemas"]["
|
|
3635
|
+
purpose?: components["schemas"]["BodyPurpose"];
|
|
3332
3636
|
};
|
|
3333
3637
|
StatusResponse: {
|
|
3334
3638
|
status: string;
|
|
@@ -3362,7 +3666,7 @@ interface components {
|
|
|
3362
3666
|
/** @description The text content (e.g., entity type name) */
|
|
3363
3667
|
value: string;
|
|
3364
3668
|
/** @description Why this body is included */
|
|
3365
|
-
purpose?: components["schemas"]["
|
|
3669
|
+
purpose?: components["schemas"]["BodyPurpose"];
|
|
3366
3670
|
/** @description MIME type (defaults to text/plain) */
|
|
3367
3671
|
format?: string;
|
|
3368
3672
|
/** @description BCP 47 language tag */
|
|
@@ -3443,6 +3747,11 @@ interface components {
|
|
|
3443
3747
|
*/
|
|
3444
3748
|
conformsTo?: string;
|
|
3445
3749
|
};
|
|
3750
|
+
/**
|
|
3751
|
+
* @description W3C Web Annotation body purpose vocabulary - https://www.w3.org/TR/annotation-vocab/#motivation
|
|
3752
|
+
* @enum {string}
|
|
3753
|
+
*/
|
|
3754
|
+
BodyPurpose: "assessing" | "bookmarking" | "classifying" | "commenting" | "describing" | "editing" | "highlighting" | "identifying" | "linking" | "moderating" | "questioning" | "replying" | "tagging";
|
|
3446
3755
|
/** @description Context gathered for an annotation. Includes source document excerpts, metadata, and graph-derived context. Used by both Find (bind) and Generate (yield) flows. */
|
|
3447
3756
|
GatheredContext: {
|
|
3448
3757
|
/** @description The annotation this context was gathered for */
|
|
@@ -4306,6 +4615,12 @@ type EventMap = {
|
|
|
4306
4615
|
'bind:body-update-failed': {
|
|
4307
4616
|
error: Error;
|
|
4308
4617
|
};
|
|
4618
|
+
'bind:finished': {
|
|
4619
|
+
annotationId: AnnotationId;
|
|
4620
|
+
};
|
|
4621
|
+
'bind:failed': {
|
|
4622
|
+
error: Error;
|
|
4623
|
+
};
|
|
4309
4624
|
'bind:search-results': {
|
|
4310
4625
|
referenceId: string;
|
|
4311
4626
|
results: Array<components['schemas']['ResourceDescriptor'] & {
|
|
@@ -4352,6 +4667,15 @@ type EventMap = {
|
|
|
4352
4667
|
annotationId: AnnotationId;
|
|
4353
4668
|
error: Error;
|
|
4354
4669
|
};
|
|
4670
|
+
'gather:annotation-progress': {
|
|
4671
|
+
message?: string;
|
|
4672
|
+
percentage?: number;
|
|
4673
|
+
};
|
|
4674
|
+
'gather:annotation-finished': {
|
|
4675
|
+
correlationId?: string;
|
|
4676
|
+
annotationId: AnnotationId;
|
|
4677
|
+
response: components['schemas']['AnnotationLLMContextResponse'];
|
|
4678
|
+
};
|
|
4355
4679
|
'gather:resource-requested': {
|
|
4356
4680
|
correlationId?: string;
|
|
4357
4681
|
resourceId: ResourceId;
|
|
@@ -4372,6 +4696,15 @@ type EventMap = {
|
|
|
4372
4696
|
resourceId: ResourceId;
|
|
4373
4697
|
error: Error;
|
|
4374
4698
|
};
|
|
4699
|
+
'gather:progress': {
|
|
4700
|
+
message?: string;
|
|
4701
|
+
percentage?: number;
|
|
4702
|
+
};
|
|
4703
|
+
'gather:finished': {
|
|
4704
|
+
correlationId?: string;
|
|
4705
|
+
resourceId: ResourceId;
|
|
4706
|
+
context: components['schemas']['ResourceLLMContextResponse'];
|
|
4707
|
+
};
|
|
4375
4708
|
'browse:click': {
|
|
4376
4709
|
annotationId: string;
|
|
4377
4710
|
motivation: Motivation;
|
|
@@ -4497,7 +4830,8 @@ type EventMap = {
|
|
|
4497
4830
|
annotationId: string | null;
|
|
4498
4831
|
};
|
|
4499
4832
|
'beckon:focus': {
|
|
4500
|
-
annotationId
|
|
4833
|
+
annotationId?: string;
|
|
4834
|
+
resourceId?: string;
|
|
4501
4835
|
};
|
|
4502
4836
|
'beckon:sparkle': {
|
|
4503
4837
|
annotationId: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semiont/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "Core domain types for Semiont - Document, Annotation, and Graph models",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -64,11 +64,9 @@
|
|
|
64
64
|
"openapi-typescript": "^7.10.1",
|
|
65
65
|
"tsup": "^8.5.1",
|
|
66
66
|
"tsx": "^4.19.2",
|
|
67
|
-
"typescript": "^5.6.3"
|
|
68
|
-
"vitest": "^4.0.18"
|
|
67
|
+
"typescript": "^5.6.3"
|
|
69
68
|
},
|
|
70
69
|
"dependencies": {
|
|
71
|
-
"@vitest/ui": "4.0.18",
|
|
72
70
|
"ajv": "^8.17.1",
|
|
73
71
|
"ajv-formats": "^2.1.1",
|
|
74
72
|
"rxjs": "^7.8.1",
|