@semiont/core 0.5.17 → 0.5.18

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
@@ -1693,22 +1693,6 @@ interface components {
1693
1693
  updatedAt: string;
1694
1694
  };
1695
1695
  };
1696
- AdminUsersListResponse: {
1697
- success: boolean;
1698
- users: {
1699
- id: string;
1700
- email: string;
1701
- name: string | null;
1702
- image: string | null;
1703
- domain: string;
1704
- provider: string;
1705
- isAdmin: boolean;
1706
- isActive: boolean;
1707
- lastLogin: string | null;
1708
- created: string;
1709
- updatedAt: string;
1710
- }[];
1711
- };
1712
1696
  AdminUserStatsResponse: {
1713
1697
  success: boolean;
1714
1698
  stats: {
@@ -1728,6 +1712,22 @@ interface components {
1728
1712
  }[];
1729
1713
  };
1730
1714
  };
1715
+ AdminUsersListResponse: {
1716
+ success: boolean;
1717
+ users: {
1718
+ id: string;
1719
+ email: string;
1720
+ name: string | null;
1721
+ image: string | null;
1722
+ domain: string;
1723
+ provider: string;
1724
+ isAdmin: boolean;
1725
+ isActive: boolean;
1726
+ lastLogin: string | null;
1727
+ created: string;
1728
+ updatedAt: string;
1729
+ }[];
1730
+ };
1731
1731
  /** @description Web Annotation / W3C PROV Agent. Discriminated by @type — Person, Organization, or Software. Each branch carries fields appropriate to its kind. Software peers are first-class participants, not a sub-class of Person. */
1732
1732
  Agent: ({
1733
1733
  /** @constant */
@@ -1803,8 +1803,19 @@ interface components {
1803
1803
  /** @description PROV-O wasAttributedTo — all parties responsible for this annotation. For human-prompted AI work this combines `creator` (the Person) and `generator` (the Software). For purely manual annotations it equals `[creator]`; for autonomous-agent work it equals `[generator]` (and `creator` may be the same Software). */
1804
1804
  wasAttributedTo?: components["schemas"]["Agent"] | components["schemas"]["Agent"][];
1805
1805
  };
1806
+ /** @description Payload for mark:added domain event */
1807
+ AnnotationAddedPayload: {
1808
+ annotation: components["schemas"]["Annotation"];
1809
+ /** @description SHA-256 of resource content at annotation time */
1810
+ contentChecksum?: string;
1811
+ };
1806
1812
  /** @description Phase 2: Body can be TextualBody (for entity tags, descriptions) or SpecificResource (for links) */
1807
1813
  AnnotationBody: components["schemas"]["TextualBody"] | components["schemas"]["SpecificResource"];
1814
+ /** @description Payload for mark:body-updated domain event */
1815
+ AnnotationBodyUpdatedPayload: {
1816
+ annotationId: string;
1817
+ operations: (components["schemas"]["BodyOperationAdd"] | components["schemas"]["BodyOperationRemove"] | components["schemas"]["BodyOperationReplace"])[];
1818
+ };
1808
1819
  AnnotationContextResponse: {
1809
1820
  annotation: components["schemas"]["Annotation"];
1810
1821
  context: {
@@ -1814,6 +1825,10 @@ interface components {
1814
1825
  };
1815
1826
  resource: components["schemas"]["ResourceDescriptor"];
1816
1827
  };
1828
+ /** @description Payload for mark:removed domain event */
1829
+ AnnotationRemovedPayload: {
1830
+ annotationId: string;
1831
+ };
1817
1832
  /** @description W3C Web Annotation target object - source is required, selector is optional */
1818
1833
  AnnotationTarget: {
1819
1834
  /** @description IRI of the resource being annotated */
@@ -1837,96 +1852,59 @@ interface components {
1837
1852
  refreshToken: string;
1838
1853
  isNewUser: boolean;
1839
1854
  };
1840
- BrowseFilesResponse: {
1841
- /** @description The directory path that was listed, relative to project root */
1842
- path: string;
1843
- entries: components["schemas"]["DirectoryEntry"][];
1844
- };
1845
- /** @description Emit an event on the Semiont bus. Channel names come from bus-protocol.ts; payload shape is validated against the channel's registered schema (CHANNEL_SCHEMAS). An optional scope routes resource-scoped broadcasts (e.g. mark:added, job:complete) to per-resource subscribers via eventBus.scope(scope); leave it unset for unscoped/global events. */
1846
- BusEmitRequest: {
1847
- /** @description Channel name from bus-protocol.ts EventMap */
1848
- channel: string;
1849
- /** @description Channel-specific payload, validated against CHANNEL_SCHEMAS */
1850
- payload: {
1851
- [key: string]: unknown;
1852
- };
1853
- /** @description Optional resource scope for broadcast channels (e.g. resourceId). Publishers only — frontends must never set this. */
1854
- scope?: string;
1855
- };
1856
- /** @description User's cookie consent preferences. `necessary` is always true — necessary cookies cannot be disabled. Timestamps and version are stamped server-side. */
1857
- CookieConsent: {
1858
- /** @enum {boolean} */
1859
- necessary: true;
1860
- analytics: boolean;
1861
- marketing: boolean;
1862
- preferences: boolean;
1863
- /** Format: date-time */
1864
- timestamp: string;
1865
- version: string;
1855
+ /** @description Emitted when an annotation receives focus for beckoning */
1856
+ BeckonFocusEvent: {
1857
+ annotationId?: string;
1858
+ resourceId?: string;
1866
1859
  };
1867
- /** @description Request body for POST /api/cookies/consent. All four preference fields must be booleans; `necessary` must be true. */
1868
- CookieConsentRequest: {
1869
- /** @enum {boolean} */
1870
- necessary: true;
1871
- analytics: boolean;
1872
- marketing: boolean;
1873
- preferences: boolean;
1860
+ /** @description Emitted when an annotation is hovered over for beckoning */
1861
+ BeckonHoverEvent: {
1862
+ annotationId: string | null;
1874
1863
  };
1875
- /** @description Standard envelope for cookie consent endpoints. On success `success: true` and `consent` carries the current preferences; on error `success: false` and `error` carries a human-readable message. */
1876
- CookieConsentResponse: {
1877
- success: boolean;
1878
- consent?: components["schemas"]["CookieConsent"];
1879
- error?: string;
1864
+ /** @description Emitted when a sparkle effect is triggered on an annotation */
1865
+ BeckonSparkleEvent: {
1866
+ annotationId: string;
1880
1867
  };
1881
- /** @description GDPR data export of a user's cookie-related data. The response is returned as a file download (Content-Disposition: attachment). */
1882
- CookieExportResponse: {
1883
- user: {
1884
- id: string;
1885
- email: string;
1886
- };
1887
- consent: components["schemas"]["CookieConsent"];
1888
- /** Format: date-time */
1889
- exportDate: string;
1890
- dataRetentionPolicy: string;
1868
+ /** @description Void success reply emitted on the bind:body-updated channel after bind:update-body has been applied, matched to the originating command by correlationId. */
1869
+ BindBodyUpdated: {
1870
+ /** @description Correlation id echoed from the originating bind:update-body command so busRequest can match the reply. */
1871
+ correlationId: string;
1891
1872
  };
1892
- DirectoryEntry: components["schemas"]["FileEntry"] | components["schemas"]["DirEntry"];
1893
- FileEntry: {
1894
- /** @enum {string} */
1895
- type: "file";
1896
- /** @description Entry name (basename) */
1897
- name: string;
1898
- /** @description Path relative to project root */
1899
- path: string;
1900
- /** @description File size in bytes */
1901
- size: number;
1902
- /**
1903
- * Format: date-time
1904
- * @description Last modified time (ISO 8601)
1905
- */
1906
- mtime: string;
1907
- /** @description True if this file is a tracked resource in the Knowledge Base */
1908
- tracked: boolean;
1909
- /** @description Resource ID (only when tracked is true) */
1910
- resourceId?: string;
1911
- /** @description Entity types assigned to this resource (only when tracked is true) */
1912
- entityTypes?: string[];
1913
- /** @description Number of annotations on this resource (only when tracked is true) */
1914
- annotationCount?: number;
1915
- /** @description DID of the user who created the resource (only when tracked is true) */
1916
- creator?: string;
1873
+ /** @description Command payload sent on the bind:initiate bus channel to start a bind flow. */
1874
+ BindInitiateCommand: {
1875
+ /** @description Branded AnnotationId of the annotation being bound */
1876
+ annotationId: string;
1877
+ /** @description Branded ResourceId of the resource being bound to */
1878
+ resourceId: string;
1879
+ /** @description Default title for the bound annotation */
1880
+ defaultTitle: string;
1881
+ /** @description Entity types to associate with the annotation */
1882
+ entityTypes: string[];
1917
1883
  };
1918
- DirEntry: {
1919
- /** @enum {string} */
1920
- type: "dir";
1921
- /** @description Entry name (basename) */
1922
- name: string;
1923
- /** @description Path relative to project root */
1924
- path: string;
1925
- /**
1926
- * Format: date-time
1927
- * @description Last modified time (ISO 8601)
1928
- */
1929
- mtime: string;
1884
+ /** @description Command payload sent on the bind:update-body bus channel to modify annotation bodies. */
1885
+ BindUpdateBodyCommand: {
1886
+ /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
1887
+ _userId?: string;
1888
+ /** @description Client-supplied id used to match this command to its result event(s) on the events-stream. Generated by the route handler if absent. */
1889
+ correlationId: string;
1890
+ /** @description Branded AnnotationId of the annotation whose body is being updated */
1891
+ annotationId: string;
1892
+ /** @description Branded ResourceId of the resource the annotation belongs to */
1893
+ resourceId: string;
1894
+ /** @description List of body mutation operations to apply */
1895
+ operations: {
1896
+ /**
1897
+ * @description The type of body operation
1898
+ * @enum {string}
1899
+ */
1900
+ op: "add" | "remove" | "replace";
1901
+ /** @description Body item for add operations */
1902
+ item?: components["schemas"]["AnnotationBody"];
1903
+ /** @description Previous body item for replace operations */
1904
+ oldItem?: components["schemas"]["AnnotationBody"];
1905
+ /** @description Replacement body item for replace operations */
1906
+ newItem?: components["schemas"]["AnnotationBody"];
1907
+ }[];
1930
1908
  };
1931
1909
  BodyOperationAdd: {
1932
1910
  /** @enum {string} */
@@ -1944,731 +1922,38 @@ interface components {
1944
1922
  oldItem: components["schemas"]["TextualBody"] | components["schemas"]["SpecificResource"];
1945
1923
  newItem: components["schemas"]["TextualBody"] | components["schemas"]["SpecificResource"];
1946
1924
  };
1947
- CloneResourceWithTokenResponse: {
1948
- /** @description Generated clone token */
1949
- token: string;
1950
- /** @description ISO 8601 timestamp when token expires */
1951
- expiresAt: string;
1952
- resource: components["schemas"]["ResourceDescriptor"];
1953
- };
1954
- /** @description Error response for failed bus commands. Replaces native Error objects on the EventBus so payloads are serializable and OpenAPI-typed. */
1955
- CommandError: {
1956
- /** @description Optional correlation id echoed from the originating command. When present, the failure event can be matched back to the specific command that failed. */
1957
- correlationId?: string;
1958
- /** @description Human-readable error message */
1959
- message: string;
1960
- /** @description Optional additional context (stack trace, field name, etc.) */
1961
- details?: string;
1962
- };
1963
- /**
1964
- * @description Content format as a MIME type, optionally with parameters. The base type (everything before the first ';') MUST be a SupportedMediaType; parameters such as charset are preserved as metadata. Semantic validation happens in code at the create/yield boundary — there is deliberately no pattern here, the vocabulary lives in SupportedMediaType. Examples: text/plain, text/plain; charset=iso-8859-1, text/markdown; charset=windows-1252, image/png, application/pdf
1965
- * @example text/plain; charset=utf-8
1966
- */
1967
- ContentFormat: string;
1968
1925
  /**
1969
- * @description Base MIME types (no parameters) admitted by Semiont. Membership is the create/yield gate — every member is storable, nameable, and uploadable. What more the system can do with a type (render, annotate, extract text, author) is curated per type in @semiont/core's media-type registry, which is keyed by this enum.
1926
+ * @description W3C Web Annotation body purpose vocabulary - https://www.w3.org/TR/annotation-vocab/#motivation
1970
1927
  * @enum {string}
1971
1928
  */
1972
- SupportedMediaType: "text/plain" | "text/markdown" | "text/html" | "text/css" | "text/csv" | "text/xml" | "application/json" | "application/xml" | "application/yaml" | "application/x-yaml" | "application/pdf" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/zip" | "application/gzip" | "application/x-tar" | "application/x-7z-compressed" | "application/octet-stream" | "application/wasm" | "image/png" | "image/jpeg" | "image/gif" | "image/webp" | "image/svg+xml" | "image/bmp" | "image/tiff" | "image/x-icon" | "video/mp4" | "video/mpeg" | "video/webm" | "video/ogg" | "video/quicktime" | "video/x-msvideo" | "audio/mpeg" | "audio/wav" | "audio/ogg" | "audio/webm" | "audio/aac" | "audio/flac" | "text/javascript" | "application/javascript" | "text/x-typescript" | "application/typescript" | "text/x-python" | "text/x-java" | "text/x-c" | "text/x-c++" | "text/x-csharp" | "text/x-go" | "text/x-rust" | "text/x-ruby" | "text/x-php" | "text/x-swift" | "text/x-kotlin" | "text/x-shell" | "font/woff" | "font/woff2" | "font/ttf" | "font/otf";
1973
- ContextualSummaryResponse: {
1974
- summary: string;
1975
- relevantFields: {
1976
- [key: string]: unknown;
1977
- };
1978
- context: {
1979
- before?: string;
1980
- selected: string;
1981
- after?: string;
1982
- };
1929
+ BodyPurpose: "assessing" | "bookmarking" | "classifying" | "commenting" | "describing" | "editing" | "highlighting" | "identifying" | "linking" | "moderating" | "questioning" | "replying" | "tagging";
1930
+ /** @description Request to browse the KB's collaborator directory (its declared Agents) */
1931
+ BrowseAgentsRequest: {
1932
+ correlationId: string;
1983
1933
  };
1984
- CreateAnnotationRequest: {
1985
- motivation: components["schemas"]["Motivation"];
1986
- target: components["schemas"]["AnnotationTarget"];
1987
- /** @description Optional body. Omit for annotations whose motivation alone is meaningful (highlighting) or whose user-supplied content is empty. Shape matches Annotation.body. */
1988
- body?: components["schemas"]["AnnotationBody"] | components["schemas"]["AnnotationBody"][];
1934
+ /** @description Result of browsing the collaborator directory */
1935
+ BrowseAgentsResult: {
1936
+ correlationId: string;
1937
+ response: {
1938
+ agents: components["schemas"]["CollaboratorEntry"][];
1939
+ };
1989
1940
  };
1990
- /** @description Response body for POST /resources (202 Accepted). Resource creation is asynchronous — the backend writes content to disk, emits yield:create on the bus, and returns the newly-minted resourceId immediately. Consumers watch SSE domain events (yield:created) to observe the fully-persisted state. */
1991
- CreateResourceResponse: {
1992
- /** @description The id of the newly-created resource. Assigned by Stower when it persists yield:create. */
1941
+ /** @description Request to get contextual text around an annotation */
1942
+ BrowseAnnotationContextRequest: {
1943
+ correlationId: string;
1944
+ annotationId: string;
1993
1945
  resourceId: string;
1946
+ contextBefore?: number;
1947
+ contextAfter?: number;
1994
1948
  };
1995
- DeleteUserResponse: {
1996
- success: boolean;
1997
- message: string;
1998
- };
1999
- /** @description Progress payload emitted on the gather:annotation-progress SSE channel during LLM context gathering. */
2000
- GatherProgress: {
2001
- message?: string;
2002
- percentage?: number;
1949
+ /** @description Request to browse the history of an annotation */
1950
+ BrowseAnnotationHistoryRequest: {
1951
+ correlationId: string;
1952
+ resourceId: string;
1953
+ annotationId: string;
2003
1954
  };
2004
- /** @description Search results payload emitted on match:search-results SSE channel. */
2005
- MatchSearchResult: {
2006
- correlationId: string;
2007
- referenceId: string;
2008
- response: (components["schemas"]["ResourceDescriptor"] & {
2009
- /** @description Relevance score */
2010
- score?: number;
2011
- /** @description Human-readable reason for the match */
2012
- matchReason?: string;
2013
- })[];
2014
- };
2015
- /** @description Error payload emitted on match:search-failed SSE channel. */
2016
- MatchSearchFailed: {
2017
- correlationId: string;
2018
- referenceId: string;
2019
- error: string;
2020
- };
2021
- /** @description Metadata added at persistence time. Part of every StoredEvent. Integrity is provided by git at the commit level (when gitSync is enabled), not by in-event metadata fields. */
2022
- EventMetadata: {
2023
- /** @description Monotonic position in the event log (ordering authority) */
2024
- sequenceNumber: number;
2025
- /** @description Optional correlation id propagated from a command. Lets clients match command-result events back to the POST that initiated them. Set by EventStore.appendEvent's options when a route handler passes one through. */
2026
- correlationId?: string;
2027
- };
2028
- /** @description Selection data for user-initiated annotations. Captures the text range and optional selector information from a user's highlight in the UI. */
2029
- SelectionData: {
2030
- /** @description The exact selected text */
2031
- exact: string;
2032
- /** @description Start character offset */
2033
- start: number;
2034
- /** @description End character offset */
2035
- end: number;
2036
- /** @description SVG selector for non-text selections (e.g. PDF regions) */
2037
- svgSelector?: string;
2038
- /** @description Fragment selector (e.g. page=2) */
2039
- fragmentSelector?: string;
2040
- /** @description Specification the fragment selector conforms to */
2041
- conformsTo?: string;
2042
- /** @description Text before the selection (for disambiguation) */
2043
- prefix?: string;
2044
- /** @description Text after the selection (for disambiguation) */
2045
- suffix?: string;
2046
- };
2047
- /** @description A persisted domain event with metadata. Flat shape — event fields and metadata are peers. */
2048
- StoredEventResponse: {
2049
- /** @description Unique event ID (UUID) */
2050
- id: string;
2051
- /** @description Event type (flow verb name, e.g. mark:added) */
2052
- type: string;
2053
- /**
2054
- * Format: date-time
2055
- * @description When the event occurred
2056
- */
2057
- timestamp: string;
2058
- /** @description DID of the user who triggered the event */
2059
- userId: string;
2060
- /** @description Resource this event affects (absent for system events) */
2061
- resourceId?: string;
2062
- /** @description Event schema version */
2063
- version: number;
2064
- /** @description Event-type-specific payload */
2065
- payload: {
2066
- [key: string]: unknown;
2067
- };
2068
- metadata: components["schemas"]["EventMetadata"];
2069
- };
2070
- /** @description Wire format emitted by GET /resources/:id/events/stream. Extends StoredEventResponse with optional enrichment fields populated from the materialized view at SSE-write time. Subscribers can read the enrichment fields directly to update local caches without an additional fetch. */
2071
- EnrichedResourceEvent: components["schemas"]["StoredEventResponse"] & {
2072
- /** @description Populated for events that mutate an annotation (mark:added, mark:body-updated, mark:removed). Carries the post-materialization annotation as it exists in the view, so subscribers can update local caches in-place without refetching. Absent for events that don't touch annotations. */
2073
- annotation?: components["schemas"]["Annotation"];
2074
- };
2075
- /** @description Payload for yield:created domain event */
2076
- ResourceCreatedPayload: {
2077
- name: string;
2078
- format: components["schemas"]["ContentFormat"];
2079
- /** @description SHA-256 of content */
2080
- contentChecksum: string;
2081
- contentByteSize?: number;
2082
- entityTypes?: string[];
2083
- /** @description Working-tree URI (e.g. file://docs/overview.md) */
2084
- storageUri?: string;
2085
- language?: string;
2086
- isDraft?: boolean;
2087
- generatedFrom?: {
2088
- resourceId: string;
2089
- annotationId: string;
2090
- };
2091
- generationPrompt?: string;
2092
- generator?: components["schemas"]["Agent"] | components["schemas"]["Agent"][];
2093
- };
2094
- /** @description Payload for yield:cloned domain event */
2095
- ResourceClonedPayload: {
2096
- name: string;
2097
- format: components["schemas"]["ContentFormat"];
2098
- contentChecksum: string;
2099
- contentByteSize?: number;
2100
- parentResourceId: string;
2101
- entityTypes?: string[];
2102
- language?: string;
2103
- };
2104
- /** @description Payload for yield:updated domain event */
2105
- ResourceUpdatedPayload: {
2106
- /** @description SHA-256 of new content */
2107
- contentChecksum: string;
2108
- contentByteSize?: number;
2109
- };
2110
- /** @description Payload for yield:moved domain event */
2111
- ResourceMovedPayload: {
2112
- /** @description Previous file:// URI */
2113
- fromUri: string;
2114
- /** @description New file:// URI */
2115
- toUri: string;
2116
- };
2117
- /** @description Payload for mark:archived domain event */
2118
- ResourceArchivedPayload: {
2119
- reason?: string;
2120
- };
2121
- /** @description Payload for mark:unarchived domain event (empty payload) */
2122
- ResourceUnarchivedPayload: Record<string, never>;
2123
- /** @description Payload for yield:representation-added domain event */
2124
- RepresentationAddedPayload: {
2125
- representation: components["schemas"]["Representation"];
2126
- };
2127
- /** @description Payload for yield:representation-removed domain event */
2128
- RepresentationRemovedPayload: {
2129
- /** @description Checksum of the representation to remove */
2130
- checksum: string;
2131
- };
2132
- /** @description Payload for mark:added domain event */
2133
- AnnotationAddedPayload: {
2134
- annotation: components["schemas"]["Annotation"];
2135
- /** @description SHA-256 of resource content at annotation time */
2136
- contentChecksum?: string;
2137
- };
2138
- /** @description Payload for mark:removed domain event */
2139
- AnnotationRemovedPayload: {
2140
- annotationId: string;
2141
- };
2142
- /** @description Payload for mark:body-updated domain event */
2143
- AnnotationBodyUpdatedPayload: {
2144
- annotationId: string;
2145
- operations: (components["schemas"]["BodyOperationAdd"] | components["schemas"]["BodyOperationRemove"] | components["schemas"]["BodyOperationReplace"])[];
2146
- };
2147
- /** @description Payload for frame:entity-type-added domain event (system-level, no resourceId — fan-out is global) */
2148
- EntityTypeAddedPayload: {
2149
- entityType: string;
2150
- };
2151
- /** @description Payload for frame:tag-schema-added domain event (system-level, no resourceId — fan-out is global to the KB). */
2152
- TagSchemaAddedPayload: {
2153
- schema: components["schemas"]["TagSchema"];
2154
- };
2155
- /** @description Payload for mark:entity-tag-added and mark:entity-tag-removed domain events */
2156
- EntityTagChangedPayload: {
2157
- entityType: string;
2158
- };
2159
- /**
2160
- * @description Type of background job
2161
- * @enum {string}
2162
- */
2163
- JobType: "reference-annotation" | "generation" | "highlight-annotation" | "assessment-annotation" | "comment-annotation" | "tag-annotation";
2164
- /** @description Payload for job:started domain event */
2165
- JobStartedPayload: {
2166
- jobId: string;
2167
- jobType: components["schemas"]["JobType"];
2168
- /** @description Annotation this job is attached to, when applicable */
2169
- annotationId?: string;
2170
- totalSteps?: number;
2171
- };
2172
- /** @description Payload for job:progress domain event */
2173
- JobProgressPayload: {
2174
- jobId: string;
2175
- jobType: components["schemas"]["JobType"];
2176
- percentage: number;
2177
- /** @description Human-readable current step */
2178
- currentStep?: string;
2179
- processedSteps?: number;
2180
- totalSteps?: number;
2181
- /** @description For detection: entities found so far */
2182
- foundCount?: number;
2183
- message?: string;
2184
- /** @description Full progress object for extensibility */
2185
- progress?: {
2186
- [key: string]: unknown;
2187
- };
2188
- };
2189
- /** @description Payload for job:completed domain event */
2190
- JobCompletedPayload: {
2191
- jobId: string;
2192
- jobType: components["schemas"]["JobType"];
2193
- /** @description Annotation this job was attached to, when applicable */
2194
- annotationId?: string;
2195
- totalSteps?: number;
2196
- /** @description For detection: total entities found */
2197
- foundCount?: number;
2198
- /** @description For generation: ID of generated resource */
2199
- resultResourceId?: string;
2200
- /** @description For generation: URI of annotation that triggered generation */
2201
- annotationUri?: string;
2202
- message?: string;
2203
- /** @description Full result object for extensibility */
2204
- result?: {
2205
- [key: string]: unknown;
2206
- };
2207
- };
2208
- /** @description Payload for job:failed domain event */
2209
- JobFailedPayload: {
2210
- jobId: string;
2211
- jobType: components["schemas"]["JobType"];
2212
- /** @description Annotation this job was attached to, when applicable */
2213
- annotationId?: string;
2214
- error: string;
2215
- details?: string;
2216
- };
2217
- ErrorResponse: {
2218
- error: string;
2219
- code?: string;
2220
- details?: unknown;
2221
- };
2222
- EventStreamResponse: {
2223
- event: string;
2224
- data: string;
2225
- id?: string;
2226
- };
2227
- GetAnnotationHistoryResponse: {
2228
- events: components["schemas"]["StoredEventResponse"][];
2229
- total: number;
2230
- annotationId: string;
2231
- resourceId: string;
2232
- };
2233
- GetAnnotationResponse: {
2234
- annotation: components["schemas"]["Annotation"];
2235
- resource: components["schemas"]["ResourceDescriptor"] | null;
2236
- resolvedResource: components["schemas"]["ResourceDescriptor"] | null;
2237
- };
2238
- GetAnnotationsResponse: {
2239
- annotations: components["schemas"]["Annotation"][];
2240
- /** @description Total number of annotations */
2241
- total: number;
2242
- /** @description Motivation filter applied (if any) */
2243
- motivation?: components["schemas"]["Motivation"] | null;
2244
- };
2245
- GetEntityTypesResponse: {
2246
- entityTypes: string[];
2247
- };
2248
- GetEventsResponse: {
2249
- events: components["schemas"]["StoredEventResponse"][];
2250
- total: number;
2251
- resourceId: string;
2252
- };
2253
- GetReferencedByResponse: {
2254
- referencedBy: {
2255
- /** @description Reference annotation ID */
2256
- id: string;
2257
- /** @description Name of resource containing the reference */
2258
- resourceName: string;
2259
- target: {
2260
- /** @description ID of resource containing the reference */
2261
- source: string;
2262
- selector: {
2263
- /** @description The selected text that references this resource */
2264
- exact: string;
2265
- };
2266
- };
2267
- }[];
2268
- };
2269
- GetResourceByTokenResponse: {
2270
- sourceResource: components["schemas"]["ResourceDescriptor"];
2271
- /** @description ISO 8601 timestamp when token expires */
2272
- expiresAt: string;
2273
- };
2274
- GetResourceResponse: {
2275
- resource: components["schemas"]["ResourceDescriptor"];
2276
- /** @description All annotations for the resource (highlights, references, assessments, etc.) */
2277
- annotations: components["schemas"]["Annotation"][];
2278
- /** @description Annotations that reference this resource from other resources */
2279
- entityReferences: components["schemas"]["Annotation"][];
2280
- };
2281
- GetTagSchemasResponse: {
2282
- tagSchemas: components["schemas"]["TagSchema"][];
2283
- };
2284
- GoogleAuthRequest: {
2285
- access_token: string;
2286
- };
2287
- HealthResponse: {
2288
- status: string;
2289
- message: string;
2290
- version: string;
2291
- timestamp: string;
2292
- /** @enum {string} */
2293
- database: "connected" | "disconnected" | "unknown";
2294
- environment: string;
2295
- };
2296
- JobStatusResponse: {
2297
- jobId: string;
2298
- type: components["schemas"]["JobType"];
2299
- /** @enum {string} */
2300
- status: "pending" | "running" | "complete" | "failed" | "cancelled";
2301
- userId: string;
2302
- created: string;
2303
- startedAt?: string;
2304
- completedAt?: string;
2305
- error?: string;
2306
- progress?: unknown;
2307
- result?: unknown;
2308
- };
2309
- /** @description Knowledge graph gathered for an LLM context — a shared backbone in which resources AND annotations are typed nodes, connected by typed (optionally bidirectional) edges. Flattened views the matcher/generation read (connections, citedBy, siblings) are derived from these nodes/edges. */
2310
- KnowledgeGraph: {
2311
- nodes: {
2312
- /** @description Node identifier — a ResourceId or AnnotationId */
2313
- id: string;
2314
- /**
2315
- * @description Whether this node is a resource or an annotation
2316
- * @enum {string}
2317
- */
2318
- type: "resource" | "annotation";
2319
- label: string;
2320
- /** @description Entity types on the node (resources) or carried by the annotation */
2321
- entityTypes?: string[];
2322
- metadata?: {
2323
- [key: string]: unknown;
2324
- };
2325
- }[];
2326
- edges: {
2327
- source: string;
2328
- target: string;
2329
- /** @description Edge kind (e.g. citation, annotation-of, sibling) */
2330
- type: string;
2331
- /** @description Whether the connection goes both ways */
2332
- bidirectional?: boolean;
2333
- metadata?: {
2334
- [key: string]: unknown;
2335
- };
2336
- }[];
2337
- };
2338
- ListResourcesResponse: {
2339
- resources: components["schemas"]["ResourceDescriptor"][];
2340
- total: number;
2341
- offset: number;
2342
- limit: number;
2343
- };
2344
- PasswordAuthRequest: {
2345
- /**
2346
- * Format: email
2347
- * @description User email address
2348
- */
2349
- email: string;
2350
- /** @description User password (minimum 8 characters) */
2351
- password: string;
2352
- };
2353
- /**
2354
- * @description Semiont-supported W3C Web Annotation motivations - https://www.w3.org/TR/annotation-vocab/#motivation
2355
- * @enum {string}
2356
- */
2357
- Motivation: "assessing" | "commenting" | "highlighting" | "linking" | "tagging";
2358
- OAuthConfigResponse: {
2359
- providers: {
2360
- name: string;
2361
- isConfigured: boolean;
2362
- clientId: string;
2363
- }[];
2364
- allowedDomains: string[];
2365
- };
2366
- /** @description A specific, byte-addressable rendition of a resource (file/asset/variant). */
2367
- Representation: {
2368
- /**
2369
- * Format: uri
2370
- * @description Stable ID for this representation.
2371
- */
2372
- "@id"?: string;
2373
- /** @description Type(s), e.g., schema:MediaObject. */
2374
- "@type"?: string | string[];
2375
- /** @description MIME/media type (e.g., text/markdown, image/png). */
2376
- mediaType: string;
2377
- /** @description Working-tree URI identifying where the bytes live. Only file:// is supported (e.g. file://docs/overview.md). */
2378
- storageUri?: string;
2379
- filename?: string;
2380
- /** @description Size of the payload in bytes. */
2381
- byteSize?: number;
2382
- /** @description Integrity hash (e.g., sha256:abcd…). */
2383
- checksum?: string;
2384
- /** @description Compression/transfer encoding if applicable. */
2385
- encoding?: string;
2386
- /** @description IETF BCP 47 language tag (e.g., en, es-ES). */
2387
- language?: string;
2388
- /** @description Pixels (images/video). */
2389
- width?: number;
2390
- /** @description Pixels (images/video). */
2391
- height?: number;
2392
- /** @description Seconds (audio/video). */
2393
- duration?: number;
2394
- /** Format: date-time */
2395
- created?: string;
2396
- /** Format: date-time */
2397
- modified?: string;
2398
- /** @description Profile/shape the bytes conform to (e.g., a JSON profile or SVG profile). */
2399
- conformsTo?: string | string[];
2400
- tags?: string[];
2401
- /**
2402
- * @description Semantics of this rendition relative to the resource (e.g., original, thumbnail, preview, derived).
2403
- * @enum {string}
2404
- */
2405
- rel?: "original" | "thumbnail" | "preview" | "optimized" | "derived" | "other";
2406
- } & {
2407
- [key: string]: unknown;
2408
- };
2409
- /** @description Metadata about a resource (1:1 with its URI). JSON-LD subject is @id. Link to concrete bytes via representations. */
2410
- ResourceDescriptor: {
2411
- /** @description JSON-LD context; URI, object, or array of these. */
2412
- "@context": string | {
2413
- [key: string]: unknown;
2414
- } | (string | {
2415
- [key: string]: unknown;
2416
- })[];
2417
- /** @description Canonical URI/URN of the resource being described. */
2418
- "@id": string;
2419
- /** @description Type(s) of the resource (IRIs/CURIEs via @context). */
2420
- "@type"?: string | string[];
2421
- name: string;
2422
- description?: string;
2423
- /** @description Persistent identifiers (e.g., DOI, URN). */
2424
- identifier?: string | string[] | ({
2425
- /** Format: uri */
2426
- "@id"?: string;
2427
- value?: string;
2428
- scheme?: string;
2429
- } & {
2430
- [key: string]: unknown;
2431
- });
2432
- /** @description Topics (IRIs or strings). */
2433
- about?: string | string[];
2434
- /** @description Equivalent/authoritative references. */
2435
- sameAs?: string[];
2436
- isPartOf?: string[];
2437
- hasPart?: string[];
2438
- /** Format: uri */
2439
- license?: string;
2440
- version?: string;
2441
- /** Format: date-time */
2442
- dateCreated?: string;
2443
- /** Format: date-time */
2444
- dateModified?: string;
2445
- /** @description W3C PROV - source resources this was derived from */
2446
- wasDerivedFrom?: string | string[];
2447
- /** @description W3C PROV - agents responsible for this resource */
2448
- wasAttributedTo?: components["schemas"]["Agent"] | components["schemas"]["Agent"][];
2449
- /** @description Software agent that produced or processed this resource (W3C Web Annotation model) */
2450
- generator?: components["schemas"]["Agent"] | components["schemas"]["Agent"][];
2451
- /** @description Profile/shape URI this resource description conforms to. */
2452
- conformsTo?: string | string[];
2453
- /** @description Convenience set summarizing media types across representations. */
2454
- availableFormats?: string[];
2455
- /** @description Managed or referenced byte-level renditions of this resource. */
2456
- representations: components["schemas"]["Representation"] | components["schemas"]["Representation"][];
2457
- /** @description Application-specific: Whether this resource is archived */
2458
- archived?: boolean;
2459
- /** @description Application-specific: Entity types for this resource */
2460
- entityTypes?: string[];
2461
- /** @description Application-specific: Whether this resource is a draft */
2462
- isDraft?: boolean;
2463
- /** @description Application-specific: ID of annotation that triggered generation */
2464
- sourceAnnotationId?: string;
2465
- /** @description Application-specific: ID of source resource for clones/derivatives */
2466
- sourceResourceId?: string;
2467
- /**
2468
- * Format: uri
2469
- * @description Original URI from a source knowledge base when this resource was imported
2470
- */
2471
- originatedFrom?: string;
2472
- /** @description Working-tree URI for this resource (e.g. file://docs/overview.md). Stable across updates and moves. */
2473
- storageUri?: string;
2474
- /** @description SHA-256 hex hash of the current content. Updated on resource.created, resource.updated, resource.cloned events. */
2475
- currentChecksum?: string;
2476
- } & {
2477
- [key: string]: unknown;
2478
- };
2479
- SemanticMatch: {
2480
- /** @description The chunk text that matched */
2481
- text: string;
2482
- /** @description Source resource ID */
2483
- resourceId: string;
2484
- /** @description Source annotation ID, if the match is from an annotation */
2485
- annotationId?: string;
2486
- /** @description Cosine similarity score (0-1) */
2487
- score: number;
2488
- /** @description Entity types on the matched passage */
2489
- entityTypes?: string[];
2490
- };
2491
- SpecificResource: {
2492
- /** @enum {string} */
2493
- type: "SpecificResource";
2494
- /** @description IRI of the target resource */
2495
- source: string;
2496
- /** @description Why this body is included */
2497
- purpose?: components["schemas"]["BodyPurpose"];
2498
- };
2499
- StatusResponse: {
2500
- status: string;
2501
- version: string;
2502
- features: {
2503
- semanticContent: string;
2504
- collaboration: string;
2505
- rbac: string;
2506
- };
2507
- message: string;
2508
- authenticatedAs?: string;
2509
- /** @description Name of the knowledge base project */
2510
- projectName?: string;
2511
- /** @description Current git branch of the knowledge base repository */
2512
- gitBranch?: string;
2513
- };
2514
- TextPositionSelector: {
2515
- /** @enum {string} */
2516
- type: "TextPositionSelector";
2517
- /** @description Character offset from resource start */
2518
- start: number;
2519
- /** @description Character offset from resource start */
2520
- end: number;
2521
- };
2522
- TextQuoteSelector: {
2523
- /** @enum {string} */
2524
- type: "TextQuoteSelector";
2525
- exact: string;
2526
- prefix?: string;
2527
- suffix?: string;
2528
- };
2529
- TextualBody: {
2530
- /** @enum {string} */
2531
- type: "TextualBody";
2532
- /** @description The text content (e.g., entity type name) */
2533
- value: string;
2534
- /** @description Why this body is included */
2535
- purpose?: components["schemas"]["BodyPurpose"];
2536
- /** @description MIME type (defaults to text/plain) */
2537
- format?: string;
2538
- /** @description BCP 47 language tag */
2539
- language?: string;
2540
- };
2541
- TokenRefreshRequest: {
2542
- /**
2543
- * @description Refresh token obtained during login
2544
- * @example eyJhbGciOiJIUzI1NiIs...
2545
- */
2546
- refreshToken: string;
2547
- };
2548
- TokenRefreshResponse: {
2549
- access_token: string;
2550
- };
2551
- UpdateAnnotationBodyRequest: {
2552
- /** @description Resource ID containing the annotation (required for O(1) Layer 3 lookup) */
2553
- resourceId: string;
2554
- /** @description Array of body modification operations to apply */
2555
- operations: (components["schemas"]["BodyOperationAdd"] | components["schemas"]["BodyOperationRemove"] | components["schemas"]["BodyOperationReplace"])[];
2556
- };
2557
- UpdateUserRequest: {
2558
- isAdmin?: boolean;
2559
- isActive?: boolean;
2560
- name?: string;
2561
- };
2562
- UpdateUserResponse: {
2563
- success: boolean;
2564
- user: {
2565
- id: string;
2566
- email: string;
2567
- name?: string | null;
2568
- image?: string | null;
2569
- domain: string;
2570
- provider: string;
2571
- isAdmin: boolean;
2572
- isActive: boolean;
2573
- lastLogin?: string | null;
2574
- created: string;
2575
- updatedAt: string;
2576
- };
2577
- };
2578
- UserResponse: {
2579
- id: string;
2580
- email: string;
2581
- name: string | null;
2582
- image: string | null;
2583
- domain: string;
2584
- provider: string;
2585
- isAdmin: boolean;
2586
- isModerator: boolean;
2587
- isActive: boolean;
2588
- termsAcceptedAt: string | null;
2589
- lastLogin: string | null;
2590
- created: string;
2591
- /** @description The validated JWT token string for the current session */
2592
- token: string;
2593
- };
2594
- /** @description Emitted when an annotation receives focus for beckoning */
2595
- BeckonFocusEvent: {
2596
- annotationId?: string;
2597
- resourceId?: string;
2598
- };
2599
- /** @description Emitted when an annotation is hovered over for beckoning */
2600
- BeckonHoverEvent: {
2601
- annotationId: string | null;
2602
- };
2603
- /** @description Emitted when a sparkle effect is triggered on an annotation */
2604
- BeckonSparkleEvent: {
2605
- annotationId: string;
2606
- };
2607
- /** @description Void success reply emitted on the bind:body-updated channel after bind:update-body has been applied, matched to the originating command by correlationId. */
2608
- BindBodyUpdated: {
2609
- /** @description Correlation id echoed from the originating bind:update-body command so busRequest can match the reply. */
2610
- correlationId: string;
2611
- };
2612
- /** @description Command payload sent on the bind:initiate bus channel to start a bind flow. */
2613
- BindInitiateCommand: {
2614
- /** @description Branded AnnotationId of the annotation being bound */
2615
- annotationId: string;
2616
- /** @description Branded ResourceId of the resource being bound to */
2617
- resourceId: string;
2618
- /** @description Default title for the bound annotation */
2619
- defaultTitle: string;
2620
- /** @description Entity types to associate with the annotation */
2621
- entityTypes: string[];
2622
- };
2623
- /** @description Command payload sent on the bind:update-body bus channel to modify annotation bodies. */
2624
- BindUpdateBodyCommand: {
2625
- /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
2626
- _userId?: string;
2627
- /** @description Client-supplied id used to match this command to its result event(s) on the events-stream. Generated by the route handler if absent. */
2628
- correlationId: string;
2629
- /** @description Branded AnnotationId of the annotation whose body is being updated */
2630
- annotationId: string;
2631
- /** @description Branded ResourceId of the resource the annotation belongs to */
2632
- resourceId: string;
2633
- /** @description List of body mutation operations to apply */
2634
- operations: {
2635
- /**
2636
- * @description The type of body operation
2637
- * @enum {string}
2638
- */
2639
- op: "add" | "remove" | "replace";
2640
- /** @description Body item for add operations */
2641
- item?: components["schemas"]["AnnotationBody"];
2642
- /** @description Previous body item for replace operations */
2643
- oldItem?: components["schemas"]["AnnotationBody"];
2644
- /** @description Replacement body item for replace operations */
2645
- newItem?: components["schemas"]["AnnotationBody"];
2646
- }[];
2647
- };
2648
- /**
2649
- * @description W3C Web Annotation body purpose vocabulary - https://www.w3.org/TR/annotation-vocab/#motivation
2650
- * @enum {string}
2651
- */
2652
- BodyPurpose: "assessing" | "bookmarking" | "classifying" | "commenting" | "describing" | "editing" | "highlighting" | "identifying" | "linking" | "moderating" | "questioning" | "replying" | "tagging";
2653
- /** @description Request to browse the KB's collaborator directory (its declared Agents) */
2654
- BrowseAgentsRequest: {
2655
- correlationId: string;
2656
- };
2657
- /** @description Result of browsing the collaborator directory */
2658
- BrowseAgentsResult: {
2659
- correlationId: string;
2660
- response: {
2661
- agents: components["schemas"]["CollaboratorEntry"][];
2662
- };
2663
- };
2664
- /** @description Request to browse the history of an annotation */
2665
- BrowseAnnotationHistoryRequest: {
2666
- correlationId: string;
2667
- resourceId: string;
2668
- annotationId: string;
2669
- };
2670
- /** @description Result of browsing annotation history */
2671
- BrowseAnnotationHistoryResult: {
1955
+ /** @description Result of browsing annotation history */
1956
+ BrowseAnnotationHistoryResult: {
2672
1957
  correlationId: string;
2673
1958
  response: components["schemas"]["GetAnnotationHistoryResponse"];
2674
1959
  };
@@ -2683,14 +1968,6 @@ interface components {
2683
1968
  correlationId: string;
2684
1969
  response: components["schemas"]["GetAnnotationResponse"];
2685
1970
  };
2686
- /** @description Request to get contextual text around an annotation */
2687
- BrowseAnnotationContextRequest: {
2688
- correlationId: string;
2689
- annotationId: string;
2690
- resourceId: string;
2691
- contextBefore?: number;
2692
- contextAfter?: number;
2693
- };
2694
1971
  /** @description Request to browse annotations for a resource */
2695
1972
  BrowseAnnotationsRequest: {
2696
1973
  correlationId: string;
@@ -2752,6 +2029,11 @@ interface components {
2752
2029
  url: string;
2753
2030
  resourceId?: string;
2754
2031
  };
2032
+ BrowseFilesResponse: {
2033
+ /** @description The directory path that was listed, relative to project root */
2034
+ path: string;
2035
+ entries: components["schemas"]["DirectoryEntry"][];
2036
+ };
2755
2037
  /** @description Emitted when a link is clicked in the browse panel */
2756
2038
  BrowseLinkClickedEvent: {
2757
2039
  href: string;
@@ -2767,6 +2049,10 @@ interface components {
2767
2049
  BrowsePanelToggleEvent: {
2768
2050
  panel: string;
2769
2051
  };
2052
+ /** @description Emitted when navigation to a reference resource is requested */
2053
+ BrowseReferenceNavigateEvent: {
2054
+ resourceId: string;
2055
+ };
2770
2056
  /** @description Request to browse annotations that reference a resource */
2771
2057
  BrowseReferencedByRequest: {
2772
2058
  correlationId: string;
@@ -2778,10 +2064,6 @@ interface components {
2778
2064
  correlationId: string;
2779
2065
  response: components["schemas"]["GetReferencedByResponse"];
2780
2066
  };
2781
- /** @description Emitted when navigation to a reference resource is requested */
2782
- BrowseReferenceNavigateEvent: {
2783
- resourceId: string;
2784
- };
2785
2067
  /** @description Emitted when a resource is closed in the browse panel */
2786
2068
  BrowseResourceCloseEvent: {
2787
2069
  resourceId: string;
@@ -2829,12 +2111,211 @@ interface components {
2829
2111
  correlationId: string;
2830
2112
  response: components["schemas"]["GetTagSchemasResponse"];
2831
2113
  };
2114
+ /** @description Emit an event on the Semiont bus. Channel names come from bus-protocol.ts; payload shape is validated against the channel's registered schema (CHANNEL_SCHEMAS). An optional scope routes resource-scoped broadcasts (e.g. mark:added, job:complete) to per-resource subscribers via eventBus.scope(scope); leave it unset for unscoped/global events. */
2115
+ BusEmitRequest: {
2116
+ /** @description Channel name from bus-protocol.ts EventMap */
2117
+ channel: string;
2118
+ /** @description Channel-specific payload, validated against CHANNEL_SCHEMAS */
2119
+ payload: {
2120
+ [key: string]: unknown;
2121
+ };
2122
+ /** @description Optional resource scope for broadcast channels (e.g. resourceId). Publishers only — frontends must never set this. */
2123
+ scope?: string;
2124
+ };
2125
+ CloneResourceWithTokenResponse: {
2126
+ /** @description Generated clone token */
2127
+ token: string;
2128
+ /** @description ISO 8601 timestamp when token expires */
2129
+ expiresAt: string;
2130
+ resource: components["schemas"]["ResourceDescriptor"];
2131
+ };
2832
2132
  /** @description One collaborator in the KB's directory: a W3C Agent plus, for software agents declared in the KB's worker inference config, the job types it serves. Actor-role-only agents (gatherer/matcher) and Persons omit servesJobTypes. */
2833
2133
  CollaboratorEntry: {
2834
2134
  agent: components["schemas"]["Agent"];
2835
2135
  /** @description Job types this agent is declared to serve (from the KB's workers.* config sections). Absent for Persons and for agents declared only under actor roles. */
2836
2136
  servesJobTypes?: components["schemas"]["JobType"][];
2837
2137
  };
2138
+ /** @description Error response for failed bus commands. Replaces native Error objects on the EventBus so payloads are serializable and OpenAPI-typed. */
2139
+ CommandError: {
2140
+ /** @description Optional correlation id echoed from the originating command. When present, the failure event can be matched back to the specific command that failed. */
2141
+ correlationId?: string;
2142
+ /** @description Human-readable error message */
2143
+ message: string;
2144
+ /** @description Optional additional context (stack trace, field name, etc.) */
2145
+ details?: string;
2146
+ };
2147
+ /**
2148
+ * @description Content format as a MIME type, optionally with parameters. The base type (everything before the first ';') MUST be a SupportedMediaType; parameters such as charset are preserved as metadata. Semantic validation happens in code at the create/yield boundary — there is deliberately no pattern here, the vocabulary lives in SupportedMediaType. Examples: text/plain, text/plain; charset=iso-8859-1, text/markdown; charset=windows-1252, image/png, application/pdf
2149
+ * @example text/plain; charset=utf-8
2150
+ */
2151
+ ContentFormat: string;
2152
+ ContextualSummaryResponse: {
2153
+ summary: string;
2154
+ relevantFields: {
2155
+ [key: string]: unknown;
2156
+ };
2157
+ context: {
2158
+ before?: string;
2159
+ selected: string;
2160
+ after?: string;
2161
+ };
2162
+ };
2163
+ /** @description User's cookie consent preferences. `necessary` is always true — necessary cookies cannot be disabled. Timestamps and version are stamped server-side. */
2164
+ CookieConsent: {
2165
+ /** @enum {boolean} */
2166
+ necessary: true;
2167
+ analytics: boolean;
2168
+ marketing: boolean;
2169
+ preferences: boolean;
2170
+ /** Format: date-time */
2171
+ timestamp: string;
2172
+ version: string;
2173
+ };
2174
+ /** @description Request body for POST /api/cookies/consent. All four preference fields must be booleans; `necessary` must be true. */
2175
+ CookieConsentRequest: {
2176
+ /** @enum {boolean} */
2177
+ necessary: true;
2178
+ analytics: boolean;
2179
+ marketing: boolean;
2180
+ preferences: boolean;
2181
+ };
2182
+ /** @description Standard envelope for cookie consent endpoints. On success `success: true` and `consent` carries the current preferences; on error `success: false` and `error` carries a human-readable message. */
2183
+ CookieConsentResponse: {
2184
+ success: boolean;
2185
+ consent?: components["schemas"]["CookieConsent"];
2186
+ error?: string;
2187
+ };
2188
+ /** @description GDPR data export of a user's cookie-related data. The response is returned as a file download (Content-Disposition: attachment). */
2189
+ CookieExportResponse: {
2190
+ user: {
2191
+ id: string;
2192
+ email: string;
2193
+ };
2194
+ consent: components["schemas"]["CookieConsent"];
2195
+ /** Format: date-time */
2196
+ exportDate: string;
2197
+ dataRetentionPolicy: string;
2198
+ };
2199
+ CreateAnnotationRequest: {
2200
+ motivation: components["schemas"]["Motivation"];
2201
+ target: components["schemas"]["AnnotationTarget"];
2202
+ /** @description Optional body. Omit for annotations whose motivation alone is meaningful (highlighting) or whose user-supplied content is empty. Shape matches Annotation.body. */
2203
+ body?: components["schemas"]["AnnotationBody"] | components["schemas"]["AnnotationBody"][];
2204
+ };
2205
+ /** @description Response body for POST /resources (202 Accepted). Resource creation is asynchronous — the backend writes content to disk, emits yield:create on the bus, and returns the newly-minted resourceId immediately. Consumers watch SSE domain events (yield:created) to observe the fully-persisted state. */
2206
+ CreateResourceResponse: {
2207
+ /** @description The id of the newly-created resource. Assigned by Stower when it persists yield:create. */
2208
+ resourceId: string;
2209
+ };
2210
+ DeleteUserResponse: {
2211
+ success: boolean;
2212
+ message: string;
2213
+ };
2214
+ DirEntry: {
2215
+ /** @enum {string} */
2216
+ type: "dir";
2217
+ /** @description Entry name (basename) */
2218
+ name: string;
2219
+ /** @description Path relative to project root */
2220
+ path: string;
2221
+ /**
2222
+ * Format: date-time
2223
+ * @description Last modified time (ISO 8601)
2224
+ */
2225
+ mtime: string;
2226
+ };
2227
+ DirectoryEntry: components["schemas"]["FileEntry"] | components["schemas"]["DirEntry"];
2228
+ /**
2229
+ * DiscoveredKB
2230
+ * @description One knowledge base the Semiont launcher manages on this machine, as published in the discovery document (see DiscoveryDocument). Endpoints and identity only — never credentials; login remains the consumer's per-KB business.
2231
+ */
2232
+ DiscoveredKB: {
2233
+ /** @description Hostname the KB is reachable on from this machine (today always "localhost" — local stacks bind locally and codespace KBs arrive through a local port forward) */
2234
+ host: string;
2235
+ /** @description Local TCP port of the KB's API (the backend port for a local stack; the allocated forward port for a codespace stack) */
2236
+ port: number;
2237
+ /**
2238
+ * @description Where the stack actually runs. "local": containers on this machine. "codespace": a GitHub-hosted VM whose KB is port-forwarded here.
2239
+ * @enum {string}
2240
+ */
2241
+ placement: "local" | "codespace";
2242
+ /** @description owner/name GitHub slug — present for codespace placements, where the repo is the stack's identity */
2243
+ repo?: string;
2244
+ /** @description The KB's did:web identifier as recorded from its committed .semiont/config — the permanent identity stamped into its event log. Prefer this as a merge key: ports are reallocated across restarts; the did follows the KB. */
2245
+ did?: string;
2246
+ /** @description Human-readable site name from the KB's .semiont/config, for display */
2247
+ siteName?: string;
2248
+ /** @description The agent that owns this entry's lifecycle (the launcher writes "semiont-launcher"). Consumers treat managed entries as authoritative for themselves — upsert on appearance, remove on disappearance — and never touch entries they did not write. */
2249
+ managedBy: string;
2250
+ };
2251
+ /**
2252
+ * DiscoveryDocument
2253
+ * @description The launcher's KB discovery document — the schema authority for <stateDir>/discovery/kbs.json, which the semiont launcher (Go, apps/launcher) regenerates on every stack mutation and the frontend container mounts read-only at /discovery. NOT an API endpoint: a static document fetched same-origin by browsers (via the frontend's static server) or read from disk by local Node consumers. An empty kbs list is meaningful ("the launcher manages nothing right now") and distinct from an absent file. Design record: .plans/BROWSER-KB-DISCOVERY.md.
2254
+ */
2255
+ DiscoveryDocument: {
2256
+ /**
2257
+ * @description Document schema version. Consumers MUST check it and ignore documents they do not understand.
2258
+ * @enum {integer}
2259
+ */
2260
+ version: 1;
2261
+ /** @description Every KB the launcher currently manages, local and forwarded */
2262
+ kbs: components["schemas"]["DiscoveredKB"][];
2263
+ };
2264
+ /** @description Wire format emitted by GET /resources/:id/events/stream. Extends StoredEventResponse with optional enrichment fields populated from the materialized view at SSE-write time. Subscribers can read the enrichment fields directly to update local caches without an additional fetch. */
2265
+ EnrichedResourceEvent: components["schemas"]["StoredEventResponse"] & {
2266
+ /** @description Populated for events that mutate an annotation (mark:added, mark:body-updated, mark:removed). Carries the post-materialization annotation as it exists in the view, so subscribers can update local caches in-place without refetching. Absent for events that don't touch annotations. */
2267
+ annotation?: components["schemas"]["Annotation"];
2268
+ };
2269
+ /** @description Payload for mark:entity-tag-added and mark:entity-tag-removed domain events */
2270
+ EntityTagChangedPayload: {
2271
+ entityType: string;
2272
+ };
2273
+ /** @description Payload for frame:entity-type-added domain event (system-level, no resourceId — fan-out is global) */
2274
+ EntityTypeAddedPayload: {
2275
+ entityType: string;
2276
+ };
2277
+ ErrorResponse: {
2278
+ error: string;
2279
+ code?: string;
2280
+ details?: unknown;
2281
+ };
2282
+ /** @description Metadata added at persistence time. Part of every StoredEvent. Integrity is provided by git at the commit level (when gitSync is enabled), not by in-event metadata fields. */
2283
+ EventMetadata: {
2284
+ /** @description Monotonic position in the event log (ordering authority) */
2285
+ sequenceNumber: number;
2286
+ /** @description Optional correlation id propagated from a command. Lets clients match command-result events back to the POST that initiated them. Set by EventStore.appendEvent's options when a route handler passes one through. */
2287
+ correlationId?: string;
2288
+ };
2289
+ EventStreamResponse: {
2290
+ event: string;
2291
+ data: string;
2292
+ id?: string;
2293
+ };
2294
+ FileEntry: {
2295
+ /** @enum {string} */
2296
+ type: "file";
2297
+ /** @description Entry name (basename) */
2298
+ name: string;
2299
+ /** @description Path relative to project root */
2300
+ path: string;
2301
+ /** @description File size in bytes */
2302
+ size: number;
2303
+ /**
2304
+ * Format: date-time
2305
+ * @description Last modified time (ISO 8601)
2306
+ */
2307
+ mtime: string;
2308
+ /** @description True if this file is a tracked resource in the Knowledge Base */
2309
+ tracked: boolean;
2310
+ /** @description Resource ID (only when tracked is true) */
2311
+ resourceId?: string;
2312
+ /** @description Entity types assigned to this resource (only when tracked is true) */
2313
+ entityTypes?: string[];
2314
+ /** @description Number of annotations on this resource (only when tracked is true) */
2315
+ annotationCount?: number;
2316
+ /** @description DID of the user who created the resource (only when tracked is true) */
2317
+ creator?: string;
2318
+ };
2838
2319
  /** @description W3C Web Annotation FragmentSelector for media fragment identifiers (RFC 3778 for PDFs) */
2839
2320
  FragmentSelector: {
2840
2321
  /** @enum {string} */
@@ -2850,6 +2331,22 @@ interface components {
2850
2331
  */
2851
2332
  conformsTo?: string;
2852
2333
  };
2334
+ /** @description Bus command to add a new entity type to the KB's vocabulary. Carried on the `frame:add-entity-type` channel — Frame is the schema-layer flow that owns vocabulary writes. */
2335
+ FrameAddEntityTypeCommand: {
2336
+ /** @description Correlation id for request/reply matching, set by the SDK's busRequest so the confirmed-write ack/failure routes back. Absent for in-process (bootstrap/replay/import) emits, which race the frame:entity-type-added domain event instead. */
2337
+ correlationId?: string;
2338
+ tag: string;
2339
+ /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
2340
+ _userId?: string;
2341
+ };
2342
+ /** @description Bus command to register a tag schema with the KB's runtime registry. Carried on the `frame:add-tag-schema` channel — Frame is the schema-layer flow that owns vocabulary writes. Most-recent registration of a given `schema.id` wins; the projection reflects the latest content. Identical re-registrations are silent; differing content overwrites and logs a warning. */
2343
+ FrameAddTagSchemaCommand: {
2344
+ /** @description Correlation id for request/reply matching, set by the SDK's busRequest so the confirmed-write ack/failure routes back. Absent for in-process emits. */
2345
+ correlationId?: string;
2346
+ schema: components["schemas"]["TagSchema"];
2347
+ /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
2348
+ _userId?: string;
2349
+ };
2853
2350
  /** @description Completion payload emitted on the gather:annotation-complete bus channel when annotation context gathering finishes. */
2854
2351
  GatherAnnotationComplete: {
2855
2352
  /** @description Client-generated correlation ID to thread the response back to the originating request */
@@ -2877,6 +2374,46 @@ interface components {
2877
2374
  contextWindow?: number;
2878
2375
  };
2879
2376
  };
2377
+ /** @description Progress payload emitted on the gather:annotation-progress SSE channel during LLM context gathering. */
2378
+ GatherProgress: {
2379
+ message?: string;
2380
+ percentage?: number;
2381
+ };
2382
+ /** @description Completion payload emitted on the gather:resource-complete bus channel when resource context gathering finishes. */
2383
+ GatherResourceComplete: {
2384
+ /** @description Client-generated correlation ID to thread the response back to the originating request */
2385
+ correlationId: string;
2386
+ /** @description Branded ResourceId of the resource whose context was gathered */
2387
+ resourceId: string;
2388
+ /** @description The gathered resource context (unified GatheredContext, focus.kind:'resource') */
2389
+ response: components["schemas"]["GatheredContext"];
2390
+ };
2391
+ /** @description Request payload sent on the gather:resource-requested bus channel to gather context for a resource. */
2392
+ GatherResourceRequest: {
2393
+ /** @description Client-generated correlation ID to thread the response back to the originating request */
2394
+ correlationId: string;
2395
+ /** @description Branded ResourceId of the resource to gather context for */
2396
+ resourceId: string;
2397
+ /** @description Gathering configuration */
2398
+ options: {
2399
+ /** @description Depth of resource graph traversal */
2400
+ depth: number;
2401
+ /** @description Maximum number of related resources to include */
2402
+ maxResources: number;
2403
+ /** @description Whether to include resource content in the gathered result */
2404
+ includeContent: boolean;
2405
+ /** @description Whether to include resource summaries in the gathered result */
2406
+ includeSummary: boolean;
2407
+ /** @description Entity types to exclude from the semantic recall built into this context (caller-supplied; e.g. a chat consumer passes ['Question'] so prior questions never ground answer generation). Optional; default none. */
2408
+ excludeEntityTypes?: string[];
2409
+ };
2410
+ };
2411
+ /** @description Request to generate an AI summary of an annotation */
2412
+ GatherSummaryRequest: {
2413
+ correlationId: string;
2414
+ annotationId: string;
2415
+ resourceId: string;
2416
+ };
2880
2417
  /** @description Context gathered for a gather.* call — consumed by yield.* (generation) and the matcher. A shared base (graph, semanticContext, metadata, inferredRelationshipSummary) plus a discriminated `focus` that names the anchor: an annotation or a whole resource. */
2881
2418
  GatheredContext: {
2882
2419
  /** @description The gather anchor. Discriminated on `kind`. */
@@ -2947,41 +2484,75 @@ interface components {
2947
2484
  /** @description LLM-generated summary of the focal anchor's relationships in the knowledge graph */
2948
2485
  inferredRelationshipSummary?: string;
2949
2486
  };
2950
- /** @description Completion payload emitted on the gather:resource-complete bus channel when resource context gathering finishes. */
2951
- GatherResourceComplete: {
2952
- /** @description Client-generated correlation ID to thread the response back to the originating request */
2953
- correlationId: string;
2954
- /** @description Branded ResourceId of the resource whose context was gathered */
2487
+ GetAnnotationHistoryResponse: {
2488
+ events: components["schemas"]["StoredEventResponse"][];
2489
+ total: number;
2490
+ annotationId: string;
2955
2491
  resourceId: string;
2956
- /** @description The gathered resource context (unified GatheredContext, focus.kind:'resource') */
2957
- response: components["schemas"]["GatheredContext"];
2958
2492
  };
2959
- /** @description Request payload sent on the gather:resource-requested bus channel to gather context for a resource. */
2960
- GatherResourceRequest: {
2961
- /** @description Client-generated correlation ID to thread the response back to the originating request */
2962
- correlationId: string;
2963
- /** @description Branded ResourceId of the resource to gather context for */
2964
- resourceId: string;
2965
- /** @description Gathering configuration */
2966
- options: {
2967
- /** @description Depth of resource graph traversal */
2968
- depth: number;
2969
- /** @description Maximum number of related resources to include */
2970
- maxResources: number;
2971
- /** @description Whether to include resource content in the gathered result */
2972
- includeContent: boolean;
2973
- /** @description Whether to include resource summaries in the gathered result */
2974
- includeSummary: boolean;
2975
- /** @description Entity types to exclude from the semantic recall built into this context (caller-supplied; e.g. a chat consumer passes ['Question'] so prior questions never ground answer generation). Optional; default none. */
2976
- excludeEntityTypes?: string[];
2977
- };
2493
+ GetAnnotationResponse: {
2494
+ annotation: components["schemas"]["Annotation"];
2495
+ resource: components["schemas"]["ResourceDescriptor"] | null;
2496
+ resolvedResource: components["schemas"]["ResourceDescriptor"] | null;
2978
2497
  };
2979
- /** @description Request to generate an AI summary of an annotation */
2980
- GatherSummaryRequest: {
2981
- correlationId: string;
2982
- annotationId: string;
2498
+ GetAnnotationsResponse: {
2499
+ annotations: components["schemas"]["Annotation"][];
2500
+ /** @description Total number of annotations */
2501
+ total: number;
2502
+ /** @description Motivation filter applied (if any) */
2503
+ motivation?: components["schemas"]["Motivation"] | null;
2504
+ };
2505
+ GetEntityTypesResponse: {
2506
+ entityTypes: string[];
2507
+ };
2508
+ GetEventsResponse: {
2509
+ events: components["schemas"]["StoredEventResponse"][];
2510
+ total: number;
2983
2511
  resourceId: string;
2984
2512
  };
2513
+ GetReferencedByResponse: {
2514
+ referencedBy: {
2515
+ /** @description Reference annotation ID */
2516
+ id: string;
2517
+ /** @description Name of resource containing the reference */
2518
+ resourceName: string;
2519
+ target: {
2520
+ /** @description ID of resource containing the reference */
2521
+ source: string;
2522
+ selector: {
2523
+ /** @description The selected text that references this resource */
2524
+ exact: string;
2525
+ };
2526
+ };
2527
+ }[];
2528
+ };
2529
+ GetResourceByTokenResponse: {
2530
+ sourceResource: components["schemas"]["ResourceDescriptor"];
2531
+ /** @description ISO 8601 timestamp when token expires */
2532
+ expiresAt: string;
2533
+ };
2534
+ GetResourceResponse: {
2535
+ resource: components["schemas"]["ResourceDescriptor"];
2536
+ /** @description All annotations for the resource (highlights, references, assessments, etc.) */
2537
+ annotations: components["schemas"]["Annotation"][];
2538
+ /** @description Annotations that reference this resource from other resources */
2539
+ entityReferences: components["schemas"]["Annotation"][];
2540
+ };
2541
+ GetTagSchemasResponse: {
2542
+ tagSchemas: components["schemas"]["TagSchema"][];
2543
+ };
2544
+ GoogleAuthRequest: {
2545
+ access_token: string;
2546
+ };
2547
+ HealthResponse: {
2548
+ status: string;
2549
+ message: string;
2550
+ version: string;
2551
+ timestamp: string;
2552
+ /** @enum {string} */
2553
+ database: "connected" | "disconnected" | "unknown";
2554
+ environment: string;
2555
+ };
2985
2556
  /** @description Result of a completed assessment-annotation job. */
2986
2557
  JobAssessmentAnnotationResult: {
2987
2558
  assessmentsFound: number;
@@ -2999,6 +2570,41 @@ interface components {
2999
2570
  correlationId: string;
3000
2571
  jobId: string;
3001
2572
  };
2573
+ /** @description Result of a completed comment-annotation job. */
2574
+ JobCommentAnnotationResult: {
2575
+ commentsFound: number;
2576
+ commentsCreated: number;
2577
+ };
2578
+ /** @description Command to mark a job as complete */
2579
+ JobCompleteCommand: {
2580
+ /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
2581
+ _userId?: string;
2582
+ resourceId: string;
2583
+ jobId: string;
2584
+ jobType: components["schemas"]["JobType"];
2585
+ /** @description Annotation this job is attached to, when applicable. Lets the UI route completion feedback (toast, resolve state) to a specific annotation. */
2586
+ annotationId?: string;
2587
+ result?: components["schemas"]["JobResult"];
2588
+ };
2589
+ /** @description Payload for job:completed domain event */
2590
+ JobCompletedPayload: {
2591
+ jobId: string;
2592
+ jobType: components["schemas"]["JobType"];
2593
+ /** @description Annotation this job was attached to, when applicable */
2594
+ annotationId?: string;
2595
+ totalSteps?: number;
2596
+ /** @description For detection: total entities found */
2597
+ foundCount?: number;
2598
+ /** @description For generation: ID of generated resource */
2599
+ resultResourceId?: string;
2600
+ /** @description For generation: URI of annotation that triggered generation */
2601
+ annotationUri?: string;
2602
+ message?: string;
2603
+ /** @description Full result object for extensibility */
2604
+ result?: {
2605
+ [key: string]: unknown;
2606
+ };
2607
+ };
3002
2608
  /** @description Command to create a new job via the event bus */
3003
2609
  JobCreateCommand: {
3004
2610
  correlationId: string;
@@ -3017,32 +2623,25 @@ interface components {
3017
2623
  jobId: string;
3018
2624
  };
3019
2625
  };
3020
- /** @description Result of a completed comment-annotation job. */
3021
- JobCommentAnnotationResult: {
3022
- commentsFound: number;
3023
- commentsCreated: number;
3024
- };
3025
- /** @description Command to mark a job as complete */
3026
- JobCompleteCommand: {
2626
+ /** @description Command to mark a job as failed */
2627
+ JobFailCommand: {
3027
2628
  /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
3028
2629
  _userId?: string;
3029
2630
  resourceId: string;
3030
2631
  jobId: string;
3031
2632
  jobType: components["schemas"]["JobType"];
3032
- /** @description Annotation this job is attached to, when applicable. Lets the UI route completion feedback (toast, resolve state) to a specific annotation. */
2633
+ /** @description Annotation this job is attached to, when applicable. Lets the UI route failure feedback (error toast, revert state) to a specific annotation. */
3033
2634
  annotationId?: string;
3034
- result?: components["schemas"]["JobResult"];
2635
+ error: string;
3035
2636
  };
3036
- /** @description Command to mark a job as failed */
3037
- JobFailCommand: {
3038
- /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
3039
- _userId?: string;
3040
- resourceId: string;
2637
+ /** @description Payload for job:failed domain event */
2638
+ JobFailedPayload: {
3041
2639
  jobId: string;
3042
2640
  jobType: components["schemas"]["JobType"];
3043
- /** @description Annotation this job is attached to, when applicable. Lets the UI route failure feedback (error toast, revert state) to a specific annotation. */
2641
+ /** @description Annotation this job was attached to, when applicable */
3044
2642
  annotationId?: string;
3045
2643
  error: string;
2644
+ details?: string;
3046
2645
  };
3047
2646
  /** @description Result of a completed generation job. resourceId is assigned by Stower when yield:create is processed; the worker emits job:complete with only resourceName, and Stower populates resourceId on the persisted payload. */
3048
2647
  JobGenerationResult: {
@@ -3093,6 +2692,23 @@ interface components {
3093
2692
  value: string;
3094
2693
  }[];
3095
2694
  };
2695
+ /** @description Payload for job:progress domain event */
2696
+ JobProgressPayload: {
2697
+ jobId: string;
2698
+ jobType: components["schemas"]["JobType"];
2699
+ percentage: number;
2700
+ /** @description Human-readable current step */
2701
+ currentStep?: string;
2702
+ processedSteps?: number;
2703
+ totalSteps?: number;
2704
+ /** @description For detection: entities found so far */
2705
+ foundCount?: number;
2706
+ message?: string;
2707
+ /** @description Full progress object for extensibility */
2708
+ progress?: {
2709
+ [key: string]: unknown;
2710
+ };
2711
+ };
3096
2712
  /** @description Event indicating a job has been queued */
3097
2713
  JobQueuedEvent: {
3098
2714
  jobId: string;
@@ -3134,11 +2750,32 @@ interface components {
3134
2750
  /** @description Annotation this job is attached to, when applicable. Set for annotation-scoped jobs like generation (from a specific reference). Unset for resource-scoped jobs like bulk reference/tag/highlight detection. */
3135
2751
  annotationId?: string;
3136
2752
  };
2753
+ /** @description Payload for job:started domain event */
2754
+ JobStartedPayload: {
2755
+ jobId: string;
2756
+ jobType: components["schemas"]["JobType"];
2757
+ /** @description Annotation this job is attached to, when applicable */
2758
+ annotationId?: string;
2759
+ totalSteps?: number;
2760
+ };
3137
2761
  /** @description Request to check the status of a job */
3138
2762
  JobStatusRequest: {
3139
2763
  correlationId: string;
3140
2764
  jobId: string;
3141
2765
  };
2766
+ JobStatusResponse: {
2767
+ jobId: string;
2768
+ type: components["schemas"]["JobType"];
2769
+ /** @enum {string} */
2770
+ status: "pending" | "running" | "complete" | "failed" | "cancelled";
2771
+ userId: string;
2772
+ created: string;
2773
+ startedAt?: string;
2774
+ completedAt?: string;
2775
+ error?: string;
2776
+ progress?: unknown;
2777
+ result?: unknown;
2778
+ };
3142
2779
  /** @description Result of a job status request */
3143
2780
  JobStatusResult: {
3144
2781
  correlationId: string;
@@ -3153,21 +2790,45 @@ interface components {
3153
2790
  [key: string]: number;
3154
2791
  };
3155
2792
  };
3156
- /** @description Bus command to add a new entity type to the KB's vocabulary. Carried on the `frame:add-entity-type` channel — Frame is the schema-layer flow that owns vocabulary writes. */
3157
- FrameAddEntityTypeCommand: {
3158
- /** @description Correlation id for request/reply matching, set by the SDK's busRequest so the confirmed-write ack/failure routes back. Absent for in-process (bootstrap/replay/import) emits, which race the frame:entity-type-added domain event instead. */
3159
- correlationId?: string;
3160
- tag: string;
3161
- /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
3162
- _userId?: string;
2793
+ /**
2794
+ * @description Type of background job
2795
+ * @enum {string}
2796
+ */
2797
+ JobType: "reference-annotation" | "generation" | "highlight-annotation" | "assessment-annotation" | "comment-annotation" | "tag-annotation";
2798
+ /** @description Knowledge graph gathered for an LLM context — a shared backbone in which resources AND annotations are typed nodes, connected by typed (optionally bidirectional) edges. Flattened views the matcher/generation read (connections, citedBy, siblings) are derived from these nodes/edges. */
2799
+ KnowledgeGraph: {
2800
+ nodes: {
2801
+ /** @description Node identifier — a ResourceId or AnnotationId */
2802
+ id: string;
2803
+ /**
2804
+ * @description Whether this node is a resource or an annotation
2805
+ * @enum {string}
2806
+ */
2807
+ type: "resource" | "annotation";
2808
+ label: string;
2809
+ /** @description Entity types on the node (resources) or carried by the annotation */
2810
+ entityTypes?: string[];
2811
+ metadata?: {
2812
+ [key: string]: unknown;
2813
+ };
2814
+ }[];
2815
+ edges: {
2816
+ source: string;
2817
+ target: string;
2818
+ /** @description Edge kind (e.g. citation, annotation-of, sibling) */
2819
+ type: string;
2820
+ /** @description Whether the connection goes both ways */
2821
+ bidirectional?: boolean;
2822
+ metadata?: {
2823
+ [key: string]: unknown;
2824
+ };
2825
+ }[];
3163
2826
  };
3164
- /** @description Bus command to register a tag schema with the KB's runtime registry. Carried on the `frame:add-tag-schema` channel — Frame is the schema-layer flow that owns vocabulary writes. Most-recent registration of a given `schema.id` wins; the projection reflects the latest content. Identical re-registrations are silent; differing content overwrites and logs a warning. */
3165
- FrameAddTagSchemaCommand: {
3166
- /** @description Correlation id for request/reply matching, set by the SDK's busRequest so the confirmed-write ack/failure routes back. Absent for in-process emits. */
3167
- correlationId?: string;
3168
- schema: components["schemas"]["TagSchema"];
3169
- /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
3170
- _userId?: string;
2827
+ ListResourcesResponse: {
2828
+ resources: components["schemas"]["ResourceDescriptor"][];
2829
+ total: number;
2830
+ offset: number;
2831
+ limit: number;
3171
2832
  };
3172
2833
  /** @description Bus command to archive a resource and optionally remove its file. */
3173
2834
  MarkArchiveCommand: {
@@ -3266,48 +2927,288 @@ interface components {
3266
2927
  resourceId: string;
3267
2928
  storageUri?: string;
3268
2929
  };
3269
- /** @description Bus command to update an annotation's body with patch operations. */
3270
- MarkUpdateBodyCommand: {
3271
- /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
3272
- _userId?: string;
3273
- /** @description Correlation id threaded from the originating route through to event metadata. Lets the events-stream deliver matched results to the client that initiated the bind. */
3274
- correlationId?: string;
3275
- annotationId: string;
3276
- resourceId: string;
3277
- operations: (components["schemas"]["BodyOperationAdd"] | components["schemas"]["BodyOperationRemove"] | components["schemas"]["BodyOperationReplace"])[];
2930
+ /** @description Bus command to update an annotation's body with patch operations. */
2931
+ MarkUpdateBodyCommand: {
2932
+ /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
2933
+ _userId?: string;
2934
+ /** @description Correlation id threaded from the originating route through to event metadata. Lets the events-stream deliver matched results to the client that initiated the bind. */
2935
+ correlationId?: string;
2936
+ annotationId: string;
2937
+ resourceId: string;
2938
+ operations: (components["schemas"]["BodyOperationAdd"] | components["schemas"]["BodyOperationRemove"] | components["schemas"]["BodyOperationReplace"])[];
2939
+ };
2940
+ /** @description Bus command to replace the entity types on a resource. */
2941
+ MarkUpdateEntityTypesCommand: {
2942
+ /** @description Correlation id for request/reply matching, set by the SDK's busRequest so the confirmed-write ack/failure routes back. */
2943
+ correlationId?: string;
2944
+ resourceId: string;
2945
+ /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
2946
+ _userId?: string;
2947
+ currentEntityTypes: string[];
2948
+ updatedEntityTypes: string[];
2949
+ };
2950
+ /** @description Error payload emitted on match:search-failed SSE channel. */
2951
+ MatchSearchFailed: {
2952
+ correlationId: string;
2953
+ referenceId: string;
2954
+ error: string;
2955
+ };
2956
+ /** @description Request payload sent on the match:search-request bus channel to find candidate matches. */
2957
+ MatchSearchRequest: {
2958
+ /** @description Client-generated correlation ID to thread the response back to the originating request */
2959
+ correlationId: string;
2960
+ /** @description Resource ID the reference annotation belongs to. Used to scope result events on the EventBus so the events-stream delivers them to participants viewing this resource. */
2961
+ resourceId: string;
2962
+ /** @description Annotation ID of the reference to search candidates for */
2963
+ referenceId: string;
2964
+ /** @description Gathered context for the reference annotation */
2965
+ context: components["schemas"]["GatheredContext"];
2966
+ /** @description Maximum number of candidate results to return */
2967
+ limit?: number;
2968
+ /** @description Enable semantic similarity scoring in addition to keyword matching */
2969
+ useSemanticScoring?: boolean;
2970
+ };
2971
+ /** @description Search results payload emitted on match:search-results SSE channel. */
2972
+ MatchSearchResult: {
2973
+ correlationId: string;
2974
+ referenceId: string;
2975
+ response: (components["schemas"]["ResourceDescriptor"] & {
2976
+ /** @description Relevance score */
2977
+ score?: number;
2978
+ /** @description Human-readable reason for the match */
2979
+ matchReason?: string;
2980
+ })[];
2981
+ };
2982
+ MediaTokenRequest: {
2983
+ /** @description The resource ID to generate a media token for */
2984
+ resourceId: string;
2985
+ };
2986
+ MediaTokenResponse: {
2987
+ /** @description Short-lived media token for use as ?token= query parameter on resource URLs */
2988
+ token: string;
2989
+ };
2990
+ /**
2991
+ * @description Semiont-supported W3C Web Annotation motivations - https://www.w3.org/TR/annotation-vocab/#motivation
2992
+ * @enum {string}
2993
+ */
2994
+ Motivation: "assessing" | "commenting" | "highlighting" | "linking" | "tagging";
2995
+ OAuthConfigResponse: {
2996
+ providers: {
2997
+ name: string;
2998
+ isConfigured: boolean;
2999
+ clientId: string;
3000
+ }[];
3001
+ allowedDomains: string[];
3002
+ };
3003
+ PasswordAuthRequest: {
3004
+ /**
3005
+ * Format: email
3006
+ * @description User email address
3007
+ */
3008
+ email: string;
3009
+ /** @description User password (minimum 8 characters) */
3010
+ password: string;
3011
+ };
3012
+ /** @description A specific, byte-addressable rendition of a resource (file/asset/variant). */
3013
+ Representation: {
3014
+ /**
3015
+ * Format: uri
3016
+ * @description Stable ID for this representation.
3017
+ */
3018
+ "@id"?: string;
3019
+ /** @description Type(s), e.g., schema:MediaObject. */
3020
+ "@type"?: string | string[];
3021
+ /** @description MIME/media type (e.g., text/markdown, image/png). */
3022
+ mediaType: string;
3023
+ /** @description Working-tree URI identifying where the bytes live. Only file:// is supported (e.g. file://docs/overview.md). */
3024
+ storageUri?: string;
3025
+ filename?: string;
3026
+ /** @description Size of the payload in bytes. */
3027
+ byteSize?: number;
3028
+ /** @description Integrity hash (e.g., sha256:abcd…). */
3029
+ checksum?: string;
3030
+ /** @description Compression/transfer encoding if applicable. */
3031
+ encoding?: string;
3032
+ /** @description IETF BCP 47 language tag (e.g., en, es-ES). */
3033
+ language?: string;
3034
+ /** @description Pixels (images/video). */
3035
+ width?: number;
3036
+ /** @description Pixels (images/video). */
3037
+ height?: number;
3038
+ /** @description Seconds (audio/video). */
3039
+ duration?: number;
3040
+ /** Format: date-time */
3041
+ created?: string;
3042
+ /** Format: date-time */
3043
+ modified?: string;
3044
+ /** @description Profile/shape the bytes conform to (e.g., a JSON profile or SVG profile). */
3045
+ conformsTo?: string | string[];
3046
+ tags?: string[];
3047
+ /**
3048
+ * @description Semantics of this rendition relative to the resource (e.g., original, thumbnail, preview, derived).
3049
+ * @enum {string}
3050
+ */
3051
+ rel?: "original" | "thumbnail" | "preview" | "optimized" | "derived" | "other";
3052
+ } & {
3053
+ [key: string]: unknown;
3054
+ };
3055
+ /** @description Payload for yield:representation-added domain event */
3056
+ RepresentationAddedPayload: {
3057
+ representation: components["schemas"]["Representation"];
3058
+ };
3059
+ /** @description Payload for yield:representation-removed domain event */
3060
+ RepresentationRemovedPayload: {
3061
+ /** @description Checksum of the representation to remove */
3062
+ checksum: string;
3063
+ };
3064
+ /** @description Payload for mark:archived domain event */
3065
+ ResourceArchivedPayload: {
3066
+ reason?: string;
3067
+ };
3068
+ /** @description Payload for yield:cloned domain event */
3069
+ ResourceClonedPayload: {
3070
+ name: string;
3071
+ format: components["schemas"]["ContentFormat"];
3072
+ contentChecksum: string;
3073
+ contentByteSize?: number;
3074
+ parentResourceId: string;
3075
+ entityTypes?: string[];
3076
+ language?: string;
3077
+ };
3078
+ /** @description Payload for yield:created domain event */
3079
+ ResourceCreatedPayload: {
3080
+ name: string;
3081
+ format: components["schemas"]["ContentFormat"];
3082
+ /** @description SHA-256 of content */
3083
+ contentChecksum: string;
3084
+ contentByteSize?: number;
3085
+ entityTypes?: string[];
3086
+ /** @description Working-tree URI (e.g. file://docs/overview.md) */
3087
+ storageUri?: string;
3088
+ language?: string;
3089
+ isDraft?: boolean;
3090
+ generatedFrom?: {
3091
+ resourceId: string;
3092
+ annotationId: string;
3093
+ };
3094
+ generationPrompt?: string;
3095
+ generator?: components["schemas"]["Agent"] | components["schemas"]["Agent"][];
3096
+ };
3097
+ /** @description Metadata about a resource (1:1 with its URI). JSON-LD subject is @id. Link to concrete bytes via representations. */
3098
+ ResourceDescriptor: {
3099
+ /** @description JSON-LD context; URI, object, or array of these. */
3100
+ "@context": string | {
3101
+ [key: string]: unknown;
3102
+ } | (string | {
3103
+ [key: string]: unknown;
3104
+ })[];
3105
+ /** @description Canonical URI/URN of the resource being described. */
3106
+ "@id": string;
3107
+ /** @description Type(s) of the resource (IRIs/CURIEs via @context). */
3108
+ "@type"?: string | string[];
3109
+ name: string;
3110
+ description?: string;
3111
+ /** @description Persistent identifiers (e.g., DOI, URN). */
3112
+ identifier?: string | string[] | ({
3113
+ /** Format: uri */
3114
+ "@id"?: string;
3115
+ value?: string;
3116
+ scheme?: string;
3117
+ } & {
3118
+ [key: string]: unknown;
3119
+ });
3120
+ /** @description Topics (IRIs or strings). */
3121
+ about?: string | string[];
3122
+ /** @description Equivalent/authoritative references. */
3123
+ sameAs?: string[];
3124
+ isPartOf?: string[];
3125
+ hasPart?: string[];
3126
+ /** Format: uri */
3127
+ license?: string;
3128
+ version?: string;
3129
+ /** Format: date-time */
3130
+ dateCreated?: string;
3131
+ /** Format: date-time */
3132
+ dateModified?: string;
3133
+ /** @description W3C PROV - source resources this was derived from */
3134
+ wasDerivedFrom?: string | string[];
3135
+ /** @description W3C PROV - agents responsible for this resource */
3136
+ wasAttributedTo?: components["schemas"]["Agent"] | components["schemas"]["Agent"][];
3137
+ /** @description Software agent that produced or processed this resource (W3C Web Annotation model) */
3138
+ generator?: components["schemas"]["Agent"] | components["schemas"]["Agent"][];
3139
+ /** @description Profile/shape URI this resource description conforms to. */
3140
+ conformsTo?: string | string[];
3141
+ /** @description Convenience set summarizing media types across representations. */
3142
+ availableFormats?: string[];
3143
+ /** @description Managed or referenced byte-level renditions of this resource. */
3144
+ representations: components["schemas"]["Representation"] | components["schemas"]["Representation"][];
3145
+ /** @description Application-specific: Whether this resource is archived */
3146
+ archived?: boolean;
3147
+ /** @description Application-specific: Entity types for this resource */
3148
+ entityTypes?: string[];
3149
+ /** @description Application-specific: Whether this resource is a draft */
3150
+ isDraft?: boolean;
3151
+ /** @description Application-specific: ID of annotation that triggered generation */
3152
+ sourceAnnotationId?: string;
3153
+ /** @description Application-specific: ID of source resource for clones/derivatives */
3154
+ sourceResourceId?: string;
3155
+ /**
3156
+ * Format: uri
3157
+ * @description Original URI from a source knowledge base when this resource was imported
3158
+ */
3159
+ originatedFrom?: string;
3160
+ /** @description Working-tree URI for this resource (e.g. file://docs/overview.md). Stable across updates and moves. */
3161
+ storageUri?: string;
3162
+ /** @description SHA-256 hex hash of the current content. Updated on resource.created, resource.updated, resource.cloned events. */
3163
+ currentChecksum?: string;
3164
+ } & {
3165
+ [key: string]: unknown;
3166
+ };
3167
+ /** @description Payload for yield:moved domain event */
3168
+ ResourceMovedPayload: {
3169
+ /** @description Previous file:// URI */
3170
+ fromUri: string;
3171
+ /** @description New file:// URI */
3172
+ toUri: string;
3278
3173
  };
3279
- /** @description Bus command to replace the entity types on a resource. */
3280
- MarkUpdateEntityTypesCommand: {
3281
- /** @description Correlation id for request/reply matching, set by the SDK's busRequest so the confirmed-write ack/failure routes back. */
3282
- correlationId?: string;
3283
- resourceId: string;
3284
- /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
3285
- _userId?: string;
3286
- currentEntityTypes: string[];
3287
- updatedEntityTypes: string[];
3174
+ /** @description Payload for mark:unarchived domain event (empty payload) */
3175
+ ResourceUnarchivedPayload: Record<string, never>;
3176
+ /** @description Payload for yield:updated domain event */
3177
+ ResourceUpdatedPayload: {
3178
+ /** @description SHA-256 of new content */
3179
+ contentChecksum: string;
3180
+ contentByteSize?: number;
3288
3181
  };
3289
- /** @description Request payload sent on the match:search-request bus channel to find candidate matches. */
3290
- MatchSearchRequest: {
3291
- /** @description Client-generated correlation ID to thread the response back to the originating request */
3292
- correlationId: string;
3293
- /** @description Resource ID the reference annotation belongs to. Used to scope result events on the EventBus so the events-stream delivers them to participants viewing this resource. */
3294
- resourceId: string;
3295
- /** @description Annotation ID of the reference to search candidates for */
3296
- referenceId: string;
3297
- /** @description Gathered context for the reference annotation */
3298
- context: components["schemas"]["GatheredContext"];
3299
- /** @description Maximum number of candidate results to return */
3300
- limit?: number;
3301
- /** @description Enable semantic similarity scoring in addition to keyword matching */
3302
- useSemanticScoring?: boolean;
3182
+ /** @description Selection data for user-initiated annotations. Captures the text range and optional selector information from a user's highlight in the UI. */
3183
+ SelectionData: {
3184
+ /** @description The exact selected text */
3185
+ exact: string;
3186
+ /** @description Start character offset */
3187
+ start: number;
3188
+ /** @description End character offset */
3189
+ end: number;
3190
+ /** @description SVG selector for non-text selections (e.g. PDF regions) */
3191
+ svgSelector?: string;
3192
+ /** @description Fragment selector (e.g. page=2) */
3193
+ fragmentSelector?: string;
3194
+ /** @description Specification the fragment selector conforms to */
3195
+ conformsTo?: string;
3196
+ /** @description Text before the selection (for disambiguation) */
3197
+ prefix?: string;
3198
+ /** @description Text after the selection (for disambiguation) */
3199
+ suffix?: string;
3303
3200
  };
3304
- MediaTokenRequest: {
3305
- /** @description The resource ID to generate a media token for */
3201
+ SemanticMatch: {
3202
+ /** @description The chunk text that matched */
3203
+ text: string;
3204
+ /** @description Source resource ID */
3306
3205
  resourceId: string;
3307
- };
3308
- MediaTokenResponse: {
3309
- /** @description Short-lived media token for use as ?token= query parameter on resource URLs */
3310
- token: string;
3206
+ /** @description Source annotation ID, if the match is from an annotation */
3207
+ annotationId?: string;
3208
+ /** @description Cosine similarity score (0-1) */
3209
+ score: number;
3210
+ /** @description Entity types on the matched passage */
3211
+ entityTypes?: string[];
3311
3212
  };
3312
3213
  /** @description Emitted when the hover delay setting changes */
3313
3214
  SettingsHoverDelayChangedEvent: {
@@ -3322,6 +3223,57 @@ interface components {
3322
3223
  /** @enum {string} */
3323
3224
  theme: "light" | "dark" | "system";
3324
3225
  };
3226
+ SpecificResource: {
3227
+ /** @enum {string} */
3228
+ type: "SpecificResource";
3229
+ /** @description IRI of the target resource */
3230
+ source: string;
3231
+ /** @description Why this body is included */
3232
+ purpose?: components["schemas"]["BodyPurpose"];
3233
+ };
3234
+ StatusResponse: {
3235
+ status: string;
3236
+ version: string;
3237
+ features: {
3238
+ semanticContent: string;
3239
+ collaboration: string;
3240
+ rbac: string;
3241
+ };
3242
+ message: string;
3243
+ authenticatedAs?: string;
3244
+ /** @description Name of the knowledge base project */
3245
+ projectName?: string;
3246
+ /** @description Current git branch of the knowledge base repository */
3247
+ gitBranch?: string;
3248
+ };
3249
+ /** @description A persisted domain event with metadata. Flat shape — event fields and metadata are peers. */
3250
+ StoredEventResponse: {
3251
+ /** @description Unique event ID (UUID) */
3252
+ id: string;
3253
+ /** @description Event type (flow verb name, e.g. mark:added) */
3254
+ type: string;
3255
+ /**
3256
+ * Format: date-time
3257
+ * @description When the event occurred
3258
+ */
3259
+ timestamp: string;
3260
+ /** @description DID of the user who triggered the event */
3261
+ userId: string;
3262
+ /** @description Resource this event affects (absent for system events) */
3263
+ resourceId?: string;
3264
+ /** @description Event schema version */
3265
+ version: number;
3266
+ /** @description Event-type-specific payload */
3267
+ payload: {
3268
+ [key: string]: unknown;
3269
+ };
3270
+ metadata: components["schemas"]["EventMetadata"];
3271
+ };
3272
+ /**
3273
+ * @description Base MIME types (no parameters) admitted by Semiont. Membership is the create/yield gate — every member is storable, nameable, and uploadable. What more the system can do with a type (render, annotate, extract text, author) is curated per type in @semiont/core's media-type registry, which is keyed by this enum.
3274
+ * @enum {string}
3275
+ */
3276
+ SupportedMediaType: "text/plain" | "text/markdown" | "text/html" | "text/css" | "text/csv" | "text/xml" | "application/json" | "application/xml" | "application/yaml" | "application/x-yaml" | "application/pdf" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/zip" | "application/gzip" | "application/x-tar" | "application/x-7z-compressed" | "application/octet-stream" | "application/wasm" | "image/png" | "image/jpeg" | "image/gif" | "image/webp" | "image/svg+xml" | "image/bmp" | "image/tiff" | "image/x-icon" | "video/mp4" | "video/mpeg" | "video/webm" | "video/ogg" | "video/quicktime" | "video/x-msvideo" | "audio/mpeg" | "audio/wav" | "audio/ogg" | "audio/webm" | "audio/aac" | "audio/flac" | "text/javascript" | "application/javascript" | "text/x-typescript" | "application/typescript" | "text/x-python" | "text/x-java" | "text/x-c" | "text/x-c++" | "text/x-csharp" | "text/x-go" | "text/x-rust" | "text/x-ruby" | "text/x-php" | "text/x-swift" | "text/x-kotlin" | "text/x-shell" | "font/woff" | "font/woff2" | "font/ttf" | "font/otf";
3325
3277
  SvgSelector: {
3326
3278
  /** @enum {string} */
3327
3279
  type: "SvgSelector";
@@ -3343,6 +3295,90 @@ interface components {
3343
3295
  domain: string;
3344
3296
  tags: components["schemas"]["TagCategory"][];
3345
3297
  };
3298
+ /** @description Payload for frame:tag-schema-added domain event (system-level, no resourceId — fan-out is global to the KB). */
3299
+ TagSchemaAddedPayload: {
3300
+ schema: components["schemas"]["TagSchema"];
3301
+ };
3302
+ TextPositionSelector: {
3303
+ /** @enum {string} */
3304
+ type: "TextPositionSelector";
3305
+ /** @description Character offset from resource start */
3306
+ start: number;
3307
+ /** @description Character offset from resource start */
3308
+ end: number;
3309
+ };
3310
+ TextQuoteSelector: {
3311
+ /** @enum {string} */
3312
+ type: "TextQuoteSelector";
3313
+ exact: string;
3314
+ prefix?: string;
3315
+ suffix?: string;
3316
+ };
3317
+ TextualBody: {
3318
+ /** @enum {string} */
3319
+ type: "TextualBody";
3320
+ /** @description The text content (e.g., entity type name) */
3321
+ value: string;
3322
+ /** @description Why this body is included */
3323
+ purpose?: components["schemas"]["BodyPurpose"];
3324
+ /** @description MIME type (defaults to text/plain) */
3325
+ format?: string;
3326
+ /** @description BCP 47 language tag */
3327
+ language?: string;
3328
+ };
3329
+ TokenRefreshRequest: {
3330
+ /**
3331
+ * @description Refresh token obtained during login
3332
+ * @example eyJhbGciOiJIUzI1NiIs...
3333
+ */
3334
+ refreshToken: string;
3335
+ };
3336
+ TokenRefreshResponse: {
3337
+ access_token: string;
3338
+ };
3339
+ UpdateAnnotationBodyRequest: {
3340
+ /** @description Resource ID containing the annotation (required for O(1) Layer 3 lookup) */
3341
+ resourceId: string;
3342
+ /** @description Array of body modification operations to apply */
3343
+ operations: (components["schemas"]["BodyOperationAdd"] | components["schemas"]["BodyOperationRemove"] | components["schemas"]["BodyOperationReplace"])[];
3344
+ };
3345
+ UpdateUserRequest: {
3346
+ isAdmin?: boolean;
3347
+ isActive?: boolean;
3348
+ name?: string;
3349
+ };
3350
+ UpdateUserResponse: {
3351
+ success: boolean;
3352
+ user: {
3353
+ id: string;
3354
+ email: string;
3355
+ name?: string | null;
3356
+ image?: string | null;
3357
+ domain: string;
3358
+ provider: string;
3359
+ isAdmin: boolean;
3360
+ isActive: boolean;
3361
+ lastLogin?: string | null;
3362
+ created: string;
3363
+ updatedAt: string;
3364
+ };
3365
+ };
3366
+ UserResponse: {
3367
+ id: string;
3368
+ email: string;
3369
+ name: string | null;
3370
+ image: string | null;
3371
+ domain: string;
3372
+ provider: string;
3373
+ isAdmin: boolean;
3374
+ isModerator: boolean;
3375
+ isActive: boolean;
3376
+ termsAcceptedAt: string | null;
3377
+ lastLogin: string | null;
3378
+ created: string;
3379
+ /** @description The validated JWT token string for the current session */
3380
+ token: string;
3381
+ };
3346
3382
  /** @description Bus command to rebuild the graph projection from the event log — the whole graph when resourceId is absent, one resource when present. Served by the Weaver; replaces direct rebuild access, which does not survive the Weaver's container split. */
3347
3383
  WeaveRebuildCommand: {
3348
3384
  /** @description Correlation id for request/reply matching, set by busRequest so the ok/failed reply routes back. */
@@ -4386,6 +4422,13 @@ type JobType = components['schemas']['JobType'];
4386
4422
  * `servesJobTypes`. See .plans/COLLABORATOR-DIRECTORY.md.
4387
4423
  */
4388
4424
  type CollaboratorEntry = components['schemas']['CollaboratorEntry'];
4425
+ /**
4426
+ * The launcher's published KB-discovery view (BROWSER-KB-DISCOVERY): the
4427
+ * document at `DISCOVERY_URL_PATH` and its entries. Endpoints and identity
4428
+ * only — never credentials.
4429
+ */
4430
+ type DiscoveryDocument = components['schemas']['DiscoveryDocument'];
4431
+ type DiscoveredKB = components['schemas']['DiscoveredKB'];
4389
4432
 
4390
4433
  /**
4391
4434
  * Event Type Guards and Extraction Utilities
@@ -7267,5 +7310,18 @@ declare function isTransientFetchError(error: unknown): boolean;
7267
7310
  */
7268
7311
  declare function retryWithBackoff<T>(fn: () => Promise<T>, isRetryable: (error: unknown) => boolean, policy: RetryPolicy, onRetry?: (info: RetryAttemptInfo) => void): Promise<T>;
7269
7312
 
7270
- export { AUTHORABLE_MEDIA_TYPES, BRIDGED_CHANNELS, BusRequestError, CHANNEL_SCHEMAS, CONTEXT_FULL_WEIGHT, CONTEXT_PARTIAL_WEIGHT, ConfigurationError, ConflictError, EMBEDDABLE_MEDIA_TYPES, EventBus, JWTTokenSchema, LOCALES, MEDIA_TYPES, NotFoundError, PERSISTED_EVENT_TYPES, POSITION_WEIGHT_MAX, POSITION_WINDOW, RESOURCE_BROADCAST_TYPES, STARTUP_FETCH_RETRY, ScopedEventBus, ScriptError, SemiontError, UnauthorizedError, ValidationError, accessToken, agentToDid, anchorAnnotation, annotationId, annotationUri, applyBodyOperations, assembleAnnotation, authCode, baseMediaType, baseUrl, buildContentCache, burstBuffer, busLog, busLogEnabled, busRequest, capabilitiesOf, cloneToken, createCircleSvg, createFragmentSelector, createPolygonSvg, createRectangleSvg, createTomlConfigLoader, decodeRepresentation, decodeWithCharset, deriveViews, didToAgent, email, entityType, errField, extensionForMediaType, extractBoundingBox, extractCharset, extractContext, findBestTextMatch, findBodyItem, formatLocaleDisplay, generateUuid, getAllLocaleCodes, getAllPlatformTypes, getAnnotationExactText, getAnnotationUriFromEvent, getBodySource, getBodyType, getChecksum, getCommentText, getCreator, getDerivedFrom, getExactText, getFragmentSelector, getLanguage, getLocaleEnglishName, getLocaleInfo, getLocaleNativeName, getNodeEncoding, getPageFromFragment, getPrimaryMediaType, getPrimaryRepresentation, getPrimarySelector, getResourceEntityTypes, getResourceId, getStorageUri, getSvgSelector, getTargetSelector, getTargetSource, getTextPositionSelector, getTextQuoteSelector, googleCredential, hasTargetSelector, isAnnotationId, isArchived, isArray, isAssessment, isBodyResolved, isBoolean, isComment, isDefined, isDraft, isEventRelatedToAnnotation, isFunction, isHighlight, isNull, isNullish, isNumber, isObject, isReference, isResolvedReference, isResourceId, isStoredEvent, isString, isStubReference, isSupportedMediaType, isTag, isTransientFetchError, isUndefined, isValidEmail, isValidPlatformType, jobId, loadTomlConfig, mcpToken, mediaTypeForExtension, normalizeCoordinates, normalizeText, parseEnvironment, parseFragmentSelector, parseSvgSelector, reconcileSelector, refreshToken, resourceAnnotationUri, resourceId, resourceUri, retryWithBackoff, scaleSvgToNative, searchQuery, serializePerKey, setBusLogTraceIdProvider, softwareToAgent, textExtractionOf, userDID, userId, userToAgent, userToDid, validateData, validateEnvironment, validateSvgMarkup, verifyPosition };
7271
- export type { AccessToken, AnchorConfidence, AnchorMethod, AnchorRect, AnchorSelectors, AnchorStrategy, AnchoringModel, Annotation, AnnotationCategory, AnnotationId, AnnotationUri, AnthropicProviderConfig, AppConfig, AssembledAnnotation, AuthCode, BackendDownload, BackendServiceConfig, BaseUrl, BodyItem, BodyItemIdentity, BodyOperation, BoundingBox, Brand, BridgedChannel, BurstBufferOptions, BusOp, BusRequestErrorCode, BusRequestPrimitive, CloneToken, CollaboratorEntry, ConnectionState, ContentCache, ContentFormat, CreateAnnotationInternal, DatabaseServiceConfig, Email, EmbeddingServiceConfig, EmittableChannel, EntityType, EntityTypeStats, Environment, EnvironmentConfig, EventBase, EventInput, EventMap, EventMetadata, EventName, EventOfType, EventQuery, EventSignature, FragmentSelector, FrontendServiceConfig, GatheredContext, GoogleAuthRequest, GoogleCredential, GraphConnection, GraphDatabaseType, GraphPath, GraphServiceConfig, GraphViews, HealthCheckResponse, IBackendOperations, IContentTransport, ITransport, InferenceProvidersConfig, JobId, JobType, ListUsersResponse, LlmSelectorInput, LocaleInfo, Logger, MCPToken, MatchQuality, McpServiceConfig, MediaTypeCapabilities, Motivation, OllamaProviderConfig, PdfCoordinate, PersistedEvent, PersistedEventType, PlatformType, Point, ProgressCallback, ProgressEvent, PutBinaryOptions, PutBinaryProgress, PutBinaryRequest, ReconciledSelector, RefreshToken, RenderMode, RenderedAnchor, ResourceAnnotationUri, ResourceAnnotations, ResourceBroadcastType, ResourceDescriptor, ResourceFilter, ResourceId, ResourceUri, RetryAttemptInfo, RetryPolicy, SearchQuery, SelectionData, Selector, SemiontConfig, ServicePlatformConfig, ServicesConfig, SiteConfig, StateUnit, StatusResponse, StoredEvent, StoredEventLike, SupportedMediaType, SvgSelector, TagCategory, TagSchema, TextExtraction, TextPosition, TextPositionSelector, TextQuoteSelector, ActorInferenceConfig as TomlActorInferenceConfig, TomlFileReader, InferenceConfig as TomlInferenceConfig, WorkerInferenceConfig as TomlWorkerInferenceConfig, TransportErrorCode, UpdateResourceInput, UpdateUserRequest, UpdateUserResponse, UserDID, UserId, UserResponse, ValidationFailure, ValidationResult, ValidationSuccess, VectorsServiceConfig, components, operations, paths };
7313
+ /**
7314
+ * Browser launcher KB discovery (BROWSER-KB-DISCOVERY).
7315
+ *
7316
+ * The launcher publishes its export view at `<stateDir>/discovery/kbs.json`,
7317
+ * mounted read-only into the frontend container at `/discovery` and served
7318
+ * by the frontend image at this URL path. One TS-side name for that URL: the
7319
+ * frontend server's tests fetch this constant, so prefix/filename drift
7320
+ * between the server and consumers is a failing test — mirroring for the URL
7321
+ * what the DiscoveryDocument schema does for the payload. (The launcher's Go
7322
+ * side keeps its own constant; the plan doc is the cross-language record.)
7323
+ */
7324
+ declare const DISCOVERY_URL_PATH = "/discovery/kbs.json";
7325
+
7326
+ export { AUTHORABLE_MEDIA_TYPES, BRIDGED_CHANNELS, BusRequestError, CHANNEL_SCHEMAS, CONTEXT_FULL_WEIGHT, CONTEXT_PARTIAL_WEIGHT, ConfigurationError, ConflictError, DISCOVERY_URL_PATH, EMBEDDABLE_MEDIA_TYPES, EventBus, JWTTokenSchema, LOCALES, MEDIA_TYPES, NotFoundError, PERSISTED_EVENT_TYPES, POSITION_WEIGHT_MAX, POSITION_WINDOW, RESOURCE_BROADCAST_TYPES, STARTUP_FETCH_RETRY, ScopedEventBus, ScriptError, SemiontError, UnauthorizedError, ValidationError, accessToken, agentToDid, anchorAnnotation, annotationId, annotationUri, applyBodyOperations, assembleAnnotation, authCode, baseMediaType, baseUrl, buildContentCache, burstBuffer, busLog, busLogEnabled, busRequest, capabilitiesOf, cloneToken, createCircleSvg, createFragmentSelector, createPolygonSvg, createRectangleSvg, createTomlConfigLoader, decodeRepresentation, decodeWithCharset, deriveViews, didToAgent, email, entityType, errField, extensionForMediaType, extractBoundingBox, extractCharset, extractContext, findBestTextMatch, findBodyItem, formatLocaleDisplay, generateUuid, getAllLocaleCodes, getAllPlatformTypes, getAnnotationExactText, getAnnotationUriFromEvent, getBodySource, getBodyType, getChecksum, getCommentText, getCreator, getDerivedFrom, getExactText, getFragmentSelector, getLanguage, getLocaleEnglishName, getLocaleInfo, getLocaleNativeName, getNodeEncoding, getPageFromFragment, getPrimaryMediaType, getPrimaryRepresentation, getPrimarySelector, getResourceEntityTypes, getResourceId, getStorageUri, getSvgSelector, getTargetSelector, getTargetSource, getTextPositionSelector, getTextQuoteSelector, googleCredential, hasTargetSelector, isAnnotationId, isArchived, isArray, isAssessment, isBodyResolved, isBoolean, isComment, isDefined, isDraft, isEventRelatedToAnnotation, isFunction, isHighlight, isNull, isNullish, isNumber, isObject, isReference, isResolvedReference, isResourceId, isStoredEvent, isString, isStubReference, isSupportedMediaType, isTag, isTransientFetchError, isUndefined, isValidEmail, isValidPlatformType, jobId, loadTomlConfig, mcpToken, mediaTypeForExtension, normalizeCoordinates, normalizeText, parseEnvironment, parseFragmentSelector, parseSvgSelector, reconcileSelector, refreshToken, resourceAnnotationUri, resourceId, resourceUri, retryWithBackoff, scaleSvgToNative, searchQuery, serializePerKey, setBusLogTraceIdProvider, softwareToAgent, textExtractionOf, userDID, userId, userToAgent, userToDid, validateData, validateEnvironment, validateSvgMarkup, verifyPosition };
7327
+ export type { AccessToken, AnchorConfidence, AnchorMethod, AnchorRect, AnchorSelectors, AnchorStrategy, AnchoringModel, Annotation, AnnotationCategory, AnnotationId, AnnotationUri, AnthropicProviderConfig, AppConfig, AssembledAnnotation, AuthCode, BackendDownload, BackendServiceConfig, BaseUrl, BodyItem, BodyItemIdentity, BodyOperation, BoundingBox, Brand, BridgedChannel, BurstBufferOptions, BusOp, BusRequestErrorCode, BusRequestPrimitive, CloneToken, CollaboratorEntry, ConnectionState, ContentCache, ContentFormat, CreateAnnotationInternal, DatabaseServiceConfig, DiscoveredKB, DiscoveryDocument, Email, EmbeddingServiceConfig, EmittableChannel, EntityType, EntityTypeStats, Environment, EnvironmentConfig, EventBase, EventInput, EventMap, EventMetadata, EventName, EventOfType, EventQuery, EventSignature, FragmentSelector, FrontendServiceConfig, GatheredContext, GoogleAuthRequest, GoogleCredential, GraphConnection, GraphDatabaseType, GraphPath, GraphServiceConfig, GraphViews, HealthCheckResponse, IBackendOperations, IContentTransport, ITransport, InferenceProvidersConfig, JobId, JobType, ListUsersResponse, LlmSelectorInput, LocaleInfo, Logger, MCPToken, MatchQuality, McpServiceConfig, MediaTypeCapabilities, Motivation, OllamaProviderConfig, PdfCoordinate, PersistedEvent, PersistedEventType, PlatformType, Point, ProgressCallback, ProgressEvent, PutBinaryOptions, PutBinaryProgress, PutBinaryRequest, ReconciledSelector, RefreshToken, RenderMode, RenderedAnchor, ResourceAnnotationUri, ResourceAnnotations, ResourceBroadcastType, ResourceDescriptor, ResourceFilter, ResourceId, ResourceUri, RetryAttemptInfo, RetryPolicy, SearchQuery, SelectionData, Selector, SemiontConfig, ServicePlatformConfig, ServicesConfig, SiteConfig, StateUnit, StatusResponse, StoredEvent, StoredEventLike, SupportedMediaType, SvgSelector, TagCategory, TagSchema, TextExtraction, TextPosition, TextPositionSelector, TextQuoteSelector, ActorInferenceConfig as TomlActorInferenceConfig, TomlFileReader, InferenceConfig as TomlInferenceConfig, WorkerInferenceConfig as TomlWorkerInferenceConfig, TransportErrorCode, UpdateResourceInput, UpdateUserRequest, UpdateUserResponse, UserDID, UserId, UserResponse, ValidationFailure, ValidationResult, ValidationSuccess, VectorsServiceConfig, components, operations, paths };