@semiont/core 0.5.27 → 0.5.29

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
@@ -848,275 +848,6 @@ interface paths {
848
848
  patch?: never;
849
849
  trace?: never;
850
850
  };
851
- "/api/admin/exchange/backup": {
852
- parameters: {
853
- query?: never;
854
- header?: never;
855
- path?: never;
856
- cookie?: never;
857
- };
858
- get?: never;
859
- put?: never;
860
- /**
861
- * Backup Knowledge Base
862
- * @description Create a lossless backup of the knowledge base as a streaming tar.gz archive
863
- */
864
- post: {
865
- parameters: {
866
- query?: never;
867
- header?: never;
868
- path?: never;
869
- cookie?: never;
870
- };
871
- requestBody?: never;
872
- responses: {
873
- /** @description Streaming backup archive */
874
- 200: {
875
- headers: {
876
- [name: string]: unknown;
877
- };
878
- content: {
879
- "application/gzip": string;
880
- };
881
- };
882
- /** @description Unauthorized */
883
- 401: {
884
- headers: {
885
- [name: string]: unknown;
886
- };
887
- content: {
888
- "application/json": components["schemas"]["ErrorResponse"];
889
- };
890
- };
891
- /** @description Forbidden - Admin access required */
892
- 403: {
893
- headers: {
894
- [name: string]: unknown;
895
- };
896
- content: {
897
- "application/json": components["schemas"]["ErrorResponse"];
898
- };
899
- };
900
- };
901
- };
902
- delete?: never;
903
- options?: never;
904
- head?: never;
905
- patch?: never;
906
- trace?: never;
907
- };
908
- "/api/admin/exchange/restore": {
909
- parameters: {
910
- query?: never;
911
- header?: never;
912
- path?: never;
913
- cookie?: never;
914
- };
915
- get?: never;
916
- put?: never;
917
- /**
918
- * Restore Knowledge Base
919
- * @description Restore knowledge base from a backup archive. Returns SSE progress events.
920
- */
921
- post: {
922
- parameters: {
923
- query?: never;
924
- header?: never;
925
- path?: never;
926
- cookie?: never;
927
- };
928
- requestBody: {
929
- content: {
930
- "multipart/form-data": {
931
- /**
932
- * Format: binary
933
- * @description Backup archive (.tar.gz)
934
- */
935
- file: string;
936
- };
937
- };
938
- };
939
- responses: {
940
- /** @description SSE stream of restore progress events */
941
- 200: {
942
- headers: {
943
- [name: string]: unknown;
944
- };
945
- content: {
946
- "text/event-stream": string;
947
- };
948
- };
949
- /** @description Invalid file format */
950
- 400: {
951
- headers: {
952
- [name: string]: unknown;
953
- };
954
- content: {
955
- "application/json": components["schemas"]["ErrorResponse"];
956
- };
957
- };
958
- /** @description Unauthorized */
959
- 401: {
960
- headers: {
961
- [name: string]: unknown;
962
- };
963
- content: {
964
- "application/json": components["schemas"]["ErrorResponse"];
965
- };
966
- };
967
- /** @description Forbidden - Admin access required */
968
- 403: {
969
- headers: {
970
- [name: string]: unknown;
971
- };
972
- content: {
973
- "application/json": components["schemas"]["ErrorResponse"];
974
- };
975
- };
976
- };
977
- };
978
- delete?: never;
979
- options?: never;
980
- head?: never;
981
- patch?: never;
982
- trace?: never;
983
- };
984
- "/api/moderate/exchange/export": {
985
- parameters: {
986
- query?: never;
987
- header?: never;
988
- path?: never;
989
- cookie?: never;
990
- };
991
- get?: never;
992
- put?: never;
993
- /**
994
- * Export Knowledge Base as JSON-LD
995
- * @description Export the knowledge base as a JSON-LD Linked Data tar.gz archive
996
- */
997
- post: {
998
- parameters: {
999
- query?: {
1000
- /** @description Include archived resources in export */
1001
- includeArchived?: boolean;
1002
- };
1003
- header?: never;
1004
- path?: never;
1005
- cookie?: never;
1006
- };
1007
- requestBody?: never;
1008
- responses: {
1009
- /** @description Streaming JSON-LD archive */
1010
- 200: {
1011
- headers: {
1012
- [name: string]: unknown;
1013
- };
1014
- content: {
1015
- "application/gzip": string;
1016
- };
1017
- };
1018
- /** @description Unauthorized */
1019
- 401: {
1020
- headers: {
1021
- [name: string]: unknown;
1022
- };
1023
- content: {
1024
- "application/json": components["schemas"]["ErrorResponse"];
1025
- };
1026
- };
1027
- /** @description Forbidden - moderator or admin role required */
1028
- 403: {
1029
- headers: {
1030
- [name: string]: unknown;
1031
- };
1032
- content: {
1033
- "application/json": components["schemas"]["ErrorResponse"];
1034
- };
1035
- };
1036
- };
1037
- };
1038
- delete?: never;
1039
- options?: never;
1040
- head?: never;
1041
- patch?: never;
1042
- trace?: never;
1043
- };
1044
- "/api/moderate/exchange/import": {
1045
- parameters: {
1046
- query?: never;
1047
- header?: never;
1048
- path?: never;
1049
- cookie?: never;
1050
- };
1051
- get?: never;
1052
- put?: never;
1053
- /**
1054
- * Import Knowledge Base from JSON-LD
1055
- * @description Import resources from a JSON-LD Linked Data archive. Returns SSE progress events.
1056
- */
1057
- post: {
1058
- parameters: {
1059
- query?: never;
1060
- header?: never;
1061
- path?: never;
1062
- cookie?: never;
1063
- };
1064
- requestBody: {
1065
- content: {
1066
- "multipart/form-data": {
1067
- /**
1068
- * Format: binary
1069
- * @description JSON-LD archive (.tar.gz)
1070
- */
1071
- file: string;
1072
- };
1073
- };
1074
- };
1075
- responses: {
1076
- /** @description SSE stream of import progress events */
1077
- 200: {
1078
- headers: {
1079
- [name: string]: unknown;
1080
- };
1081
- content: {
1082
- "text/event-stream": string;
1083
- };
1084
- };
1085
- /** @description Invalid file format */
1086
- 400: {
1087
- headers: {
1088
- [name: string]: unknown;
1089
- };
1090
- content: {
1091
- "application/json": components["schemas"]["ErrorResponse"];
1092
- };
1093
- };
1094
- /** @description Unauthorized */
1095
- 401: {
1096
- headers: {
1097
- [name: string]: unknown;
1098
- };
1099
- content: {
1100
- "application/json": components["schemas"]["ErrorResponse"];
1101
- };
1102
- };
1103
- /** @description Forbidden - moderator or admin role required */
1104
- 403: {
1105
- headers: {
1106
- [name: string]: unknown;
1107
- };
1108
- content: {
1109
- "application/json": components["schemas"]["ErrorResponse"];
1110
- };
1111
- };
1112
- };
1113
- };
1114
- delete?: never;
1115
- options?: never;
1116
- head?: never;
1117
- patch?: never;
1118
- trace?: never;
1119
- };
1120
851
  "/api/cookies/consent": {
1121
852
  parameters: {
1122
853
  query?: never;
@@ -1399,7 +1130,7 @@ interface paths {
1399
1130
  put?: never;
1400
1131
  /**
1401
1132
  * Create a resource
1402
- * @description Upload binary content + metadata as multipart/form-data. The backend writes content to disk, then emits yield:create on the bus; Stower persists it and returns a 202 with the new resourceId. Full reconciliation happens via SSE domain events (yield:created).
1133
+ * @description Upload binary content + metadata as multipart/form-data. The gateway writes content to disk, then emits yield:create on the bus; Stower persists it and returns a 202 with the new resourceId. Full reconciliation happens via SSE domain events (yield:created).
1403
1134
  *
1404
1135
  * Generation workers and the /know/compose page both hit this route — bytes always travel on the HTTP wire, never on the bus.
1405
1136
  */
@@ -1542,242 +1273,6 @@ interface paths {
1542
1273
  patch?: never;
1543
1274
  trace?: never;
1544
1275
  };
1545
- "/resources/{id}/anchored-text": {
1546
- parameters: {
1547
- query?: never;
1548
- header?: never;
1549
- path?: never;
1550
- cookie?: never;
1551
- };
1552
- /**
1553
- * Get a resource's anchored text
1554
- * @description The coordinate map derived from a resource's bytes: its recovered text plus the positioned runs that index it. Assembled via the bus gateway.
1555
- *
1556
- * Whole-resource, not paginated — a producer iterates page by page, but every consumer wants one map: a browser quoting the text under a hand-drawn rectangle, a headless client analysing a document.
1557
- *
1558
- * This endpoint never runs recognition. The Smelter is the sole producer and publishes at ingest; a read that finds nothing waits for that resource's content generation to settle and then answers 204. A 204 is the common case and not an error — a native text layer is read in the browser, and a media type with no extractor never produces a map at all. Callers degrade: for a PDF annotation that means geometry with no quoted text.
1559
- */
1560
- get: {
1561
- parameters: {
1562
- query?: never;
1563
- header?: never;
1564
- path: {
1565
- id: string;
1566
- };
1567
- cookie?: never;
1568
- };
1569
- requestBody?: never;
1570
- responses: {
1571
- /** @description The stored extraction outcome: the coordinate map with its provenance (method, PDF class, OCR confidence, unread pages), or a named decline. */
1572
- 200: {
1573
- headers: {
1574
- [name: string]: unknown;
1575
- };
1576
- content: {
1577
- "application/json": components["schemas"]["ExtractionOutcome"];
1578
- };
1579
- };
1580
- /** @description No map has been derived for this resource. The ordinary answer for a native text layer or a media type with no extractor — not an error, and distinct from 404, which means the resource itself is absent. Carried as an empty body rather than a JSON `null` body so that a generated client's typed 200 field stays absent: unmarshalling `null` into a struct is a no-op in several languages, which would make "no map" indistinguishable from an empty one. */
1581
- 204: {
1582
- headers: {
1583
- [name: string]: unknown;
1584
- };
1585
- content?: never;
1586
- };
1587
- /** @description Resource not found */
1588
- 404: {
1589
- headers: {
1590
- [name: string]: unknown;
1591
- };
1592
- content: {
1593
- "application/json": components["schemas"]["ErrorResponse"];
1594
- };
1595
- };
1596
- /** @description Request timed out (bus gateway) */
1597
- 504: {
1598
- headers: {
1599
- [name: string]: unknown;
1600
- };
1601
- content: {
1602
- "application/json": components["schemas"]["ErrorResponse"];
1603
- };
1604
- };
1605
- };
1606
- };
1607
- put?: never;
1608
- post?: never;
1609
- delete?: never;
1610
- options?: never;
1611
- head?: never;
1612
- patch?: never;
1613
- trace?: never;
1614
- };
1615
- "/anchored-text/keys": {
1616
- parameters: {
1617
- query?: never;
1618
- header?: never;
1619
- path?: never;
1620
- cookie?: never;
1621
- };
1622
- /**
1623
- * List the keys under which anchored text is currently stored
1624
- * @description The anchored-text store's would-hit keys — the reconcile planner's bulk existence read (PERSIST-ANCHORS P0). The Smelter diffs this against the catalog to find resources whose derived coordinate map was lost (a transient store, a failed publish) and plans re-derivation; one request per reconcile, keys only, because each map is ~32 KB per scanned page and only presence is being asked.
1625
- *
1626
- * Keys are resource ids today; after PERSIST-ANCHORS P1 they are content checksums. Only entries a read would actually serve are listed — stale-stamped or unreadable entries are excluded, exactly as a read would exclude them.
1627
- *
1628
- * Agents only: this is projection-maintenance planning data, same trust boundary as publishing a map.
1629
- */
1630
- get: {
1631
- parameters: {
1632
- query?: never;
1633
- header?: never;
1634
- path?: never;
1635
- cookie?: never;
1636
- };
1637
- requestBody?: never;
1638
- responses: {
1639
- /** @description Every key under which anchored text would currently be served. */
1640
- 200: {
1641
- headers: {
1642
- [name: string]: unknown;
1643
- };
1644
- content: {
1645
- "application/json": {
1646
- keys: string[];
1647
- };
1648
- };
1649
- };
1650
- /** @description Caller is not an agent */
1651
- 403: {
1652
- headers: {
1653
- [name: string]: unknown;
1654
- };
1655
- content: {
1656
- "application/json": components["schemas"]["ErrorResponse"];
1657
- };
1658
- };
1659
- };
1660
- };
1661
- put?: never;
1662
- post?: never;
1663
- delete?: never;
1664
- options?: never;
1665
- head?: never;
1666
- patch?: never;
1667
- trace?: never;
1668
- };
1669
- "/anchored-text/{checksum}": {
1670
- parameters: {
1671
- query?: never;
1672
- header?: never;
1673
- path?: never;
1674
- cookie?: never;
1675
- };
1676
- /**
1677
- * Read a representation's stored extraction outcome by content checksum
1678
- * @description The cache-consult read (PERSIST-ANCHORS P2c): the extraction seam asks "has this exact byte content already been extracted?" — and every cache consumer runs out of process (the smelter worker, the detection workers), so the consult must cross the wire or the cache is write-only from exactly the processes it exists to serve.
1679
- *
1680
- * Checksum-addressed and barrier-free, deliberately: presence at this instant is the question, the same semantics as the keys listing. The read-your-writes settle barrier belongs to the resource-addressed reader (GET /resources/{id}/anchored-text), which resolves a mutable resource id through the view index; a caller holding the checksum already holds the content identity and needs no resolution and no wait.
1681
- *
1682
- * Agents only — projection-maintenance traffic, the same trust boundary as the PUT beside it.
1683
- */
1684
- get: {
1685
- parameters: {
1686
- query?: never;
1687
- header?: never;
1688
- path: {
1689
- /** @description Hex SHA-256 checksum of the representation bytes. */
1690
- checksum: string;
1691
- };
1692
- cookie?: never;
1693
- };
1694
- requestBody?: never;
1695
- responses: {
1696
- /** @description The stored extraction outcome — a success with provenance, or a cached decline. */
1697
- 200: {
1698
- headers: {
1699
- [name: string]: unknown;
1700
- };
1701
- content: {
1702
- "application/json": components["schemas"]["ExtractionOutcome"];
1703
- };
1704
- };
1705
- /** @description No entry under this checksum. The ordinary cache miss — carried as an empty body rather than a JSON null for the same generated-client reason as the resource-addressed GET. */
1706
- 204: {
1707
- headers: {
1708
- [name: string]: unknown;
1709
- };
1710
- content?: never;
1711
- };
1712
- /** @description Caller is not an agent */
1713
- 403: {
1714
- headers: {
1715
- [name: string]: unknown;
1716
- };
1717
- content: {
1718
- "application/json": components["schemas"]["ErrorResponse"];
1719
- };
1720
- };
1721
- };
1722
- };
1723
- /**
1724
- * Publish anchored text for a representation, keyed by its content checksum
1725
- * @description Store the coordinate map derived from a representation's bytes, under the SHA-256 checksum of those bytes (PERSIST-ANCHORS decision A: one artifact per representation, and a representation is its bytes). The producer supplies the checksum because it alone knows which bytes it actually read — deriving the key server-side from the resource's current representation would file old geometry under a new checksum when a byte change races the publish, and that entry would read as present to the reconcile planner forever. Reads remain resource-addressed (GET /resources/{id}/anchored-text); the server resolves the resource to its current representation's checksum.
1726
- *
1727
- * The Smelter is the sole producer: it is the only process that reads those bytes at ingest, so it is the only one positioned to derive a map cheaply, and it runs separately from the backend.
1728
- *
1729
- * Agents only. A map is derived data every consumer trusts to place annotation geometry, so a browser session must not be able to write one.
1730
- */
1731
- put: {
1732
- parameters: {
1733
- query?: never;
1734
- header?: never;
1735
- path: {
1736
- /** @description Hex SHA-256 checksum of the representation bytes the map was derived from. */
1737
- checksum: string;
1738
- };
1739
- cookie?: never;
1740
- };
1741
- requestBody: {
1742
- content: {
1743
- "application/json": components["schemas"]["ExtractionOutcome"];
1744
- };
1745
- };
1746
- responses: {
1747
- /** @description Stored */
1748
- 204: {
1749
- headers: {
1750
- [name: string]: unknown;
1751
- };
1752
- content?: never;
1753
- };
1754
- /** @description Body is not a valid ExtractionOutcome */
1755
- 400: {
1756
- headers: {
1757
- [name: string]: unknown;
1758
- };
1759
- content: {
1760
- "application/json": components["schemas"]["ErrorResponse"];
1761
- };
1762
- };
1763
- /** @description Caller is not an agent */
1764
- 403: {
1765
- headers: {
1766
- [name: string]: unknown;
1767
- };
1768
- content: {
1769
- "application/json": components["schemas"]["ErrorResponse"];
1770
- };
1771
- };
1772
- };
1773
- };
1774
- post?: never;
1775
- delete?: never;
1776
- options?: never;
1777
- head?: never;
1778
- patch?: never;
1779
- trace?: never;
1780
- };
1781
1276
  "/resources/{id}/jsonld": {
1782
1277
  parameters: {
1783
1278
  query?: never;
@@ -1960,9 +1455,28 @@ interface components {
1960
1455
  updatedAt: string;
1961
1456
  }[];
1962
1457
  };
1963
- /** @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. */
1964
- Agent: ({
1965
- /** @constant */
1458
+ /** @description Web Annotation / W3C PROV Agent. Discriminated by @type — Person, Organization, or Software (named member schemas: AgentPerson, AgentOrganization, AgentSoftware). Software peers are first-class participants, not a sub-class of Person. */
1459
+ Agent: components["schemas"]["AgentPerson"] | components["schemas"]["AgentOrganization"] | components["schemas"]["AgentSoftware"];
1460
+ /** @description An organization — the Organization branch of Agent. */
1461
+ AgentOrganization: {
1462
+ /**
1463
+ * @description discriminator enum property added by openapi-typescript
1464
+ * @enum {string}
1465
+ */
1466
+ "@type": "Organization";
1467
+ /** Format: uri */
1468
+ "@id"?: string;
1469
+ name: string;
1470
+ homepage?: string;
1471
+ } & {
1472
+ [key: string]: unknown;
1473
+ };
1474
+ /** @description A human participant — the Person branch of Agent. */
1475
+ AgentPerson: {
1476
+ /**
1477
+ * @description discriminator enum property added by openapi-typescript
1478
+ * @enum {string}
1479
+ */
1966
1480
  "@type": "Person";
1967
1481
  /**
1968
1482
  * Format: uri
@@ -1977,17 +1491,13 @@ interface components {
1977
1491
  homepage?: string;
1978
1492
  } & {
1979
1493
  [key: string]: unknown;
1980
- }) | ({
1981
- /** @constant */
1982
- "@type": "Organization";
1983
- /** Format: uri */
1984
- "@id"?: string;
1985
- name: string;
1986
- homepage?: string;
1987
- } & {
1988
- [key: string]: unknown;
1989
- }) | ({
1990
- /** @constant */
1494
+ };
1495
+ /** @description A software peer (an inference model acting as a first-class participant) — the Software branch of Agent. Carries structured provider + model. */
1496
+ AgentSoftware: {
1497
+ /**
1498
+ * @description discriminator enum property added by openapi-typescript
1499
+ * @enum {string}
1500
+ */
1991
1501
  "@type": "Software";
1992
1502
  /**
1993
1503
  * Format: uri
@@ -2006,7 +1516,7 @@ interface components {
2006
1516
  };
2007
1517
  } & {
2008
1518
  [key: string]: unknown;
2009
- });
1519
+ };
2010
1520
  Annotation: {
2011
1521
  /**
2012
1522
  * @description W3C Web Annotation JSON-LD context
@@ -2041,7 +1551,7 @@ interface components {
2041
1551
  /** @description SHA-256 of resource content at annotation time */
2042
1552
  contentChecksum?: string;
2043
1553
  };
2044
- /** @description Phase 2: Body can be TextualBody (for entity tags, descriptions) or SpecificResource (for links) */
1554
+ /** @description An annotation's body: a TextualBody carries text the annotation states (entity tags, descriptions, comments), a SpecificResource points at what it links to. Tell them apart by `type`, which is required on both and single-valued — a consumer never has to probe for which fields happen to be present. */
2045
1555
  AnnotationBody: components["schemas"]["TextualBody"] | components["schemas"]["SpecificResource"];
2046
1556
  /** @description Payload for mark:body-updated domain event */
2047
1557
  AnnotationBodyUpdatedPayload: {
@@ -2339,7 +1849,12 @@ interface components {
2339
1849
  /** @description A resource's stored extraction outcome — the coordinate map with its provenance, or a named decline — or null when none has been derived. Null is the common case and not an error: a native text layer is read in the browser, and a media type with no extractor never produces one. */
2340
1850
  BrowseAnchoredTextResult: {
2341
1851
  correlationId: string;
2342
- response: components["schemas"]["ExtractionOutcome"] | null;
1852
+ response: Omit<components["schemas"]["ExtractionOutcome"], "kind"> | null;
1853
+ };
1854
+ /** @description Request the stored extraction outcome for a content identity the caller already holds — the detection workers' read-through cache consult (ANCHORED-TEXT-TO-SMELTER P2). A hit — success or decline — is served whole and the caller skips extraction; null is a miss and the caller extracts locally. Read-only: the Smelter is the sole writer and never answers over this channel. */
1855
+ BrowseAnchoredTextByChecksumRequest: {
1856
+ correlationId: string;
1857
+ checksum: string;
2343
1858
  };
2344
1859
  /** @description Request to browse a single resource */
2345
1860
  BrowseResourceRequest: {
@@ -2392,7 +1907,7 @@ interface components {
2392
1907
  payload: {
2393
1908
  [key: string]: unknown;
2394
1909
  };
2395
- /** @description Optional resource scope for broadcast channels (e.g. resourceId). Publishers only — frontends must never set this. */
1910
+ /** @description Optional resource scope for broadcast channels (e.g. resourceId). Publishers only — clients must never set this. */
2396
1911
  scope?: string;
2397
1912
  };
2398
1913
  /** @description Subscription matrix for the bus SSE stream (MULTI-RESOURCE-SCOPE). `global` channels are delivered unscoped; each `scoped` entry subscribes the connection to one resource scope's channels, optionally resuming replay from that scope's last-seen persisted event id. At least one global channel or one scoped entry is required. */
@@ -2493,7 +2008,7 @@ interface components {
2493
2008
  /** @description Optional body. Omit for annotations whose motivation alone is meaningful (highlighting) or whose user-supplied content is empty. Shape matches Annotation.body. */
2494
2009
  body?: components["schemas"]["AnnotationBody"] | components["schemas"]["AnnotationBody"][];
2495
2010
  };
2496
- /** @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. */
2011
+ /** @description Response body for POST /resources (202 Accepted). The route writes content to disk, emits yield:create, and AWAITS the confirmed-write reply so the returned resourceId is the one Stower minted, and the resource's event is persisted before this response is sent. What remains asynchronous is downstream projection: graph, views and vectors settle after the 202. */
2497
2012
  CreateResourceResponse: {
2498
2013
  /** @description The id of the newly-created resource. Assigned by Stower when it persists yield:create. */
2499
2014
  resourceId: string;
@@ -2503,7 +2018,10 @@ interface components {
2503
2018
  message: string;
2504
2019
  };
2505
2020
  DirEntry: {
2506
- /** @enum {string} */
2021
+ /**
2022
+ * @description discriminator enum property added by openapi-typescript
2023
+ * @enum {string}
2024
+ */
2507
2025
  type: "dir";
2508
2026
  /** @description Entry name (basename) */
2509
2027
  name: string;
@@ -2515,6 +2033,7 @@ interface components {
2515
2033
  */
2516
2034
  mtime: string;
2517
2035
  };
2036
+ /** @description One entry in a directory listing: a file, which may carry the resource it was ingested as, or a subdirectory. Tell them apart by `type`, which is required on both and single-valued. */
2518
2037
  DirectoryEntry: components["schemas"]["FileEntry"] | components["schemas"]["DirEntry"];
2519
2038
  /**
2520
2039
  * DiscoveredKB
@@ -2523,7 +2042,7 @@ interface components {
2523
2042
  DiscoveredKB: {
2524
2043
  /** @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) */
2525
2044
  host: string;
2526
- /** @description Local TCP port of the KB's API (the backend port for a local stack; the allocated forward port for a codespace stack) */
2045
+ /** @description Local TCP port of the KB's API (the gateway port for a local stack; the allocated forward port for a codespace stack) */
2527
2046
  port: number;
2528
2047
  /**
2529
2048
  * @description Where the stack actually runs. "local": containers on this machine. "codespace": a GitHub-hosted VM whose KB is port-forwarded here.
@@ -2541,7 +2060,7 @@ interface components {
2541
2060
  };
2542
2061
  /**
2543
2062
  * DiscoveryDocument
2544
- * @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.
2063
+ * @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 Browser container mounts read-only at /discovery. NOT an API endpoint: a static document fetched same-origin by browsers (via the Browser'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.
2545
2064
  */
2546
2065
  DiscoveryDocument: {
2547
2066
  /**
@@ -2552,7 +2071,7 @@ interface components {
2552
2071
  /** @description Every KB the launcher currently manages, local and forwarded */
2553
2072
  kbs: components["schemas"]["DiscoveredKB"][];
2554
2073
  };
2555
- /** @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. */
2074
+ /** @description Wire format for persisted events delivered over the bus SSE stream (GET /bus/subscribe). Extends StoredEventResponse with optional enrichment fields the EventStore populates from the materialized view at publish time (persistence → view → enrich → notification). Subscribers read the enrichment fields directly to update local caches without an additional fetch. */
2556
2075
  EnrichedResourceEvent: components["schemas"]["StoredEventResponse"] & {
2557
2076
  /** @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. */
2558
2077
  annotation?: components["schemas"]["Annotation"];
@@ -2582,8 +2101,13 @@ interface components {
2582
2101
  data: string;
2583
2102
  id?: string;
2584
2103
  };
2585
- /** @description The full outcome of text extraction for one representation — the record the anchored-text store holds and the wire serves (PERSIST-ANCHORS decision D1). Either a success (the anchored text plus its provenance: how it was extracted, what class of PDF it came from, how confident OCR was, which pages could not be read) or a named decline. A decline is a first-class, cacheable outcome: 'we ran and there was nothing' costs a full recognition pass to discover. ocrConfidence is extraction quality for operators, deliberately not anchor confidence. */
2586
- ExtractionOutcome: (components["schemas"]["AnchoredText"] & {
2104
+ /** @description A successful extraction: the anchored text plus its provenance (WIRE-UNION-DISCRIMINANTS P5c named this member; PERSIST-ANCHORS D1 made it the stored record). */
2105
+ ExtractedText: components["schemas"]["AnchoredText"] & {
2106
+ /**
2107
+ * @description Discriminant — both ExtractionOutcome members carry `kind`, single-valued (D6: category here, detail in `method`).
2108
+ * @enum {string}
2109
+ */
2110
+ kind: "extracted";
2587
2111
  /**
2588
2112
  * @description How the text was extracted.
2589
2113
  * @enum {string}
@@ -2604,15 +2128,33 @@ interface components {
2604
2128
  };
2605
2129
  /** @description 1-indexed pages this extraction could not read — present only for partially covered documents (class C). */
2606
2130
  unreadPages?: number[];
2607
- }) | {
2131
+ } & {
2132
+ /**
2133
+ * @description discriminator enum property added by openapi-typescript
2134
+ * @enum {string}
2135
+ */
2136
+ kind: "extracted";
2137
+ };
2138
+ /** @description A named decline: extraction ran and yielded nothing, by class. A first-class, cacheable outcome — 'we ran and there was nothing' costs a full recognition pass to discover. */
2139
+ ExtractionDeclined: {
2140
+ /**
2141
+ * @description Discriminant — both ExtractionOutcome members carry `kind`, single-valued (D6: category here, detail in `declined`). (enum property replaced by openapi-typescript)
2142
+ * @enum {string}
2143
+ */
2144
+ kind: "declined";
2608
2145
  /**
2609
2146
  * @description Why extraction yielded nothing, by class.
2610
2147
  * @enum {string}
2611
2148
  */
2612
2149
  declined: "no-text-layer" | "encrypted" | "corrupt" | "too-large";
2613
2150
  };
2151
+ /** @description The full outcome of text extraction for one representation — the record the anchored-text store holds and the wire serves (PERSIST-ANCHORS decision D1). Discriminated on `kind` (WIRE-UNION-DISCRIMINANTS P5c/D6): 'extracted' — the anchored text with its provenance; 'declined' — a named decline. ocrConfidence is extraction quality for operators, deliberately not anchor confidence. */
2152
+ ExtractionOutcome: components["schemas"]["ExtractedText"] | components["schemas"]["ExtractionDeclined"];
2614
2153
  FileEntry: {
2615
- /** @enum {string} */
2154
+ /**
2155
+ * @description discriminator enum property added by openapi-typescript
2156
+ * @enum {string}
2157
+ */
2616
2158
  type: "file";
2617
2159
  /** @description Entry name (basename) */
2618
2160
  name: string;
@@ -2807,11 +2349,11 @@ interface components {
2807
2349
  };
2808
2350
  /** @description Params bag for `job:create` with `jobType: 'generation'` — exactly the shape yield.fromContext(context, options) takes: options + the gathered context. The job's ids are DERIVED from context.focus at the dispatcher (resource focus → focus.resource; annotation focus → focus.sourceResource, with the worker auto-binding to focus.annotation); a caller-supplied referenceId is rejected. Carried inside JobCreateCommand.params; this schema is the generation shape's contract, including its requiredness. */
2809
2351
  GenerationJobParams: {
2810
- /** @description Title of the generated resource. */
2352
+ /** @description Title of the generated resource. Non-empty: the dispatcher and worker both reject an empty title via isGenerationJobParams. NOTE minLength is documentation here — JobCreateCommand.params is additionalProperties:true, so /bus/emit's generated validator never sees this field (GENERATION-OUTPUT-FORMAT D9b). */
2811
2353
  title: string;
2812
- /** @description Storage URI for the generated resource's content. */
2354
+ /** @description Storage URI for the generated resource's content — AUTHORITATIVE: the worker writes exactly here and never derives a location from the title. Non-empty, and there is no fallback; the dispatcher and worker both reject an empty value via isGenerationJobParams. NOTE minLength is documentation here — JobCreateCommand.params is additionalProperties:true, so /bus/emit's generated validator never sees this field (GENERATION-OUTPUT-FORMAT D6/D9). */
2813
2355
  storageUri: string;
2814
- /** @description The gathered context that grounds the generation. Its `focus` names the anchor (the sdk derives the job's resourceId and referenceId, for annotation focus from it); under `cite`, the ids its embedding carries are the only valid citation targets. */
2356
+ /** @description The gathered context that grounds the generation. Its `focus` names the anchor: the DISPATCHER derives the job's resourceId from it (resource focus → focus.resource; annotation focus focus.sourceResource, with the worker auto-binding to focus.annotation) and REJECTS a caller-supplied id — the context is authoritative. Under `cite`, the ids its embedding carries are the only valid citation targets. */
2815
2357
  context: components["schemas"]["GatheredContext"];
2816
2358
  /** @description Refining instruction, composed with `task` (task = what, prompt = how). */
2817
2359
  prompt?: string;
@@ -2910,8 +2452,48 @@ interface components {
2910
2452
  /** @description Maximum output tokens per generation. Equal to contextTokens when the provider has a single shared window. */
2911
2453
  maxOutputTokens: number;
2912
2454
  };
2455
+ /** @description An annotation's graph presence. The node IS the annotation, so the full W3C object is required — selectors and body included, which is what lets a client place context annotations without a second fetch. Citations ride here too: an inbound reference is its linking annotation, anchored by an `annotation-of` edge to the resource it lives on and a `cites` edge to the focal resource. */
2456
+ GraphAnnotationNode: {
2457
+ /** @description The AnnotationId — the same value as annotation.id */
2458
+ id: string;
2459
+ /**
2460
+ * @description discriminator enum property added by openapi-typescript
2461
+ * @enum {string}
2462
+ */
2463
+ type: "annotation";
2464
+ /** @description The annotation's motivation, as a display label */
2465
+ label: string;
2466
+ /** @description Entity types carried by the annotation */
2467
+ entityTypes?: string[];
2468
+ annotation: components["schemas"]["Annotation"];
2469
+ metadata?: {
2470
+ [key: string]: unknown;
2471
+ };
2472
+ };
2473
+ /** @description A resource's presence in the gathered knowledge graph. */
2474
+ GraphResourceNode: {
2475
+ /** @description The resource's ResourceId */
2476
+ id: string;
2477
+ /**
2478
+ * @description discriminator enum property added by openapi-typescript
2479
+ * @enum {string}
2480
+ */
2481
+ type: "resource";
2482
+ /** @description The resource's display name — its raw id when the resource's view was missing at build time */
2483
+ label: string;
2484
+ /** @description Entity types on the resource */
2485
+ entityTypes?: string[];
2486
+ metadata?: {
2487
+ [key: string]: unknown;
2488
+ };
2489
+ };
2913
2490
  /** @description Result of a completed assessment-annotation job. */
2914
2491
  JobAssessmentAnnotationResult: {
2492
+ /**
2493
+ * @description Discriminant — every JobResult member carries `kind`, single-valued, so a consumer holding only the result can tell what it is (WIRE-UNION-DISCRIMINANTS D1). (enum property replaced by openapi-typescript)
2494
+ * @enum {string}
2495
+ */
2496
+ kind: "assessment-annotation";
2915
2497
  assessmentsFound: number;
2916
2498
  assessmentsCreated: number;
2917
2499
  };
@@ -2929,6 +2511,11 @@ interface components {
2929
2511
  };
2930
2512
  /** @description Result of a completed comment-annotation job. */
2931
2513
  JobCommentAnnotationResult: {
2514
+ /**
2515
+ * @description Discriminant — every JobResult member carries `kind`, single-valued, so a consumer holding only the result can tell what it is (WIRE-UNION-DISCRIMINANTS D1). (enum property replaced by openapi-typescript)
2516
+ * @enum {string}
2517
+ */
2518
+ kind: "comment-annotation";
2932
2519
  commentsFound: number;
2933
2520
  commentsCreated: number;
2934
2521
  };
@@ -2993,13 +2580,18 @@ interface components {
2993
2580
  };
2994
2581
  /** @description Result of a job that completed without doing its work because the resource could not be read. Distinct from a failure: nothing went wrong, there was simply no text to work with — an encrypted or damaged PDF, a scan whose text could not be recognized, or a document that yielded nothing. The reasons are the extraction vocabulary the Smelter reports on `smelt:settled`, MINUS `no-extractor`: a media type that can never yield text (a zip, an image) is a bad request rather than a decline, so a worker asked to detect over one throws and the job reports `job:fail`. Everything here is a resource-specific outcome — the same media type would have succeeded on a different document. */
2995
2582
  JobDeclinedResult: {
2583
+ /**
2584
+ * @description Discriminant — every JobResult member carries `kind`, single-valued, so a consumer holding only the result can tell what it is (WIRE-UNION-DISCRIMINANTS D1). (enum property replaced by openapi-typescript)
2585
+ * @enum {string}
2586
+ */
2587
+ kind: "declined";
2996
2588
  /**
2997
2589
  * @description Discriminant. Always true — a job that did its work reports one of the other result shapes.
2998
2590
  * @enum {boolean}
2999
2591
  */
3000
2592
  declined: true;
3001
2593
  /**
3002
- * @description Why the resource could not be read. A CODE, not a sentence: the client owns the wording, so a browser renders it in the user's language and the CLI renders English terminal copy from the same value. The prose `message` this schema used to carry was composed backend-side and was therefore English everywhere (ASSIST-PROGRESS-CONSOLIDATION P5).
2594
+ * @description Why the resource could not be read. A CODE, not a sentence: the client owns the wording, so a browser renders it in the user's language and the CLI renders English terminal copy from the same value. The prose `message` this schema used to carry was composed gateway-side and was therefore English everywhere (ASSIST-PROGRESS-CONSOLIDATION P5).
3003
2595
  * @enum {string}
3004
2596
  */
3005
2597
  reason: "no-text-layer" | "encrypted" | "corrupt" | "too-large" | "empty";
@@ -3013,15 +2605,27 @@ interface components {
3013
2605
  error: string;
3014
2606
  details?: string;
3015
2607
  };
3016
- /** @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. */
2608
+ /** @description Result of a completed generation job. The worker creates the resource first (the yield:create round-trip returns the id), then emits job:complete carrying it so resourceId is always present on the wire. */
3017
2609
  JobGenerationResult: {
3018
- /** @description ID of the generated resource (populated by Stower, not by the worker) */
3019
- resourceId?: string;
2610
+ /**
2611
+ * @description Discriminant — every JobResult member carries `kind`, single-valued, so a consumer holding only the result can tell what it is (WIRE-UNION-DISCRIMINANTS D1). (enum property replaced by openapi-typescript)
2612
+ * @enum {string}
2613
+ */
2614
+ kind: "generation";
2615
+ /** @description ID of the generated resource, obtained by the worker from the create round-trip before job:complete is emitted */
2616
+ resourceId: string;
3020
2617
  /** @description Name of the generated resource */
3021
2618
  resourceName: string;
2619
+ /** @description True when the model stopped at the maxTokens ceiling — the artifact is cut off, not complete. Derived at the producer from the provider's stopReason ('max_tokens' → true); required because the worker always knows (GENERATE-FROM-RESOURCE D6/P3a). */
2620
+ truncated: boolean;
3022
2621
  };
3023
2622
  /** @description Result of a completed highlight-annotation job. */
3024
2623
  JobHighlightAnnotationResult: {
2624
+ /**
2625
+ * @description Discriminant — every JobResult member carries `kind`, single-valued, so a consumer holding only the result can tell what it is (WIRE-UNION-DISCRIMINANTS D1). (enum property replaced by openapi-typescript)
2626
+ * @enum {string}
2627
+ */
2628
+ kind: "highlight-annotation";
3025
2629
  highlightsFound: number;
3026
2630
  highlightsCreated: number;
3027
2631
  };
@@ -3069,22 +2673,30 @@ interface components {
3069
2673
  value: string;
3070
2674
  }[];
3071
2675
  };
3072
- /** @description What a running job is doing right now, as a code plus typed params — never a prose sentence. The producer reports what happened; each client renders it in the user's language (react-ui from its translations, the Go launcher from its English map). The vocabulary is the census of every onProgress call site in @semiont/jobs (.plans/ASSIST-PROGRESS-CONSOLIDATION.md P1, 2026-08-12); extending it means adding a variant here and copy in every client, gated by the locale-completeness check. */
3073
- JobProgressMessage: {
3074
- /** @enum {string} */
3075
- code: "loading" | "analyzing" | "analyzing-tags" | "generating-resource" | "creating-resource";
3076
- } | {
3077
- /** @enum {string} */
3078
- code: "detecting-entities";
3079
- /** @description Entity type currently being detected */
3080
- entityType: string;
3081
- } | {
3082
- /** @enum {string} */
3083
- code: "creating-annotations" | "creating-tag-annotations";
3084
- /** @description How many annotations are being created */
3085
- count: number;
3086
- } | {
3087
- /** @enum {string} */
2676
+ /** @description What a running job is doing right now, as a code plus typed params — never a prose sentence. The producer reports what happened; each client renders it in the user's language (react-ui from its translations, the Go launcher from its English map). One named schema per code, discriminated on `code` (WIRE-UNION-DISCRIMINANTS P5b), so generated clients get typed variants and copy-map completeness is statically checkable. The vocabulary is the census of every onProgress call site in @semiont/jobs (.plans/ASSIST-PROGRESS-CONSOLIDATION.md P1); extending it means adding a named variant here and copy in every client, gated by the locale-completeness check. */
2677
+ JobProgressMessage: components["schemas"]["JobProgressLoading"] | components["schemas"]["JobProgressAnalyzing"] | components["schemas"]["JobProgressAnalyzingTags"] | components["schemas"]["JobProgressGeneratingResource"] | components["schemas"]["JobProgressCreatingResource"] | components["schemas"]["JobProgressCompleteGenerated"] | components["schemas"]["JobProgressDetectingEntities"] | components["schemas"]["JobProgressCreatingAnnotations"] | components["schemas"]["JobProgressCreatingTagAnnotations"] | components["schemas"]["JobProgressCompleteCreated"];
2678
+ /** @description Analyzing the content. */
2679
+ JobProgressAnalyzing: {
2680
+ /**
2681
+ * @description discriminator enum property added by openapi-typescript
2682
+ * @enum {string}
2683
+ */
2684
+ code: "analyzing";
2685
+ };
2686
+ /** @description Analyzing the content against the tag schema. */
2687
+ JobProgressAnalyzingTags: {
2688
+ /**
2689
+ * @description discriminator enum property added by openapi-typescript
2690
+ * @enum {string}
2691
+ */
2692
+ code: "analyzing-tags";
2693
+ };
2694
+ /** @description Terminal success summary. */
2695
+ JobProgressCompleteCreated: {
2696
+ /**
2697
+ * @description discriminator enum property added by openapi-typescript
2698
+ * @enum {string}
2699
+ */
3088
2700
  code: "complete-created";
3089
2701
  /** @description How many annotations were created */
3090
2702
  count: number;
@@ -3094,6 +2706,70 @@ interface components {
3094
2706
  */
3095
2707
  kind: "highlight" | "comment" | "assessment" | "reference" | "tag";
3096
2708
  };
2709
+ /** @description Generation's terminal success. Deliberately generic — the client already holds the title it typed, and the outcome (name + resource link) travels on job:complete, not on progress (GENERATE-FROM-RESOURCE D7/D8). `truncated` qualifies the completion (D6): the same bit `JobGenerationResult.truncated` carries, so the two surfaces cannot drift. */
2710
+ JobProgressCompleteGenerated: {
2711
+ /**
2712
+ * @description discriminator enum property added by openapi-typescript
2713
+ * @enum {string}
2714
+ */
2715
+ code: "complete-generated";
2716
+ /** @description True when the model stopped at the maxTokens ceiling — the artifact is cut off, not complete. */
2717
+ truncated: boolean;
2718
+ };
2719
+ /** @description Writing detected annotations back to the resource. */
2720
+ JobProgressCreatingAnnotations: {
2721
+ /**
2722
+ * @description discriminator enum property added by openapi-typescript
2723
+ * @enum {string}
2724
+ */
2725
+ code: "creating-annotations";
2726
+ /** @description How many annotations are being created */
2727
+ count: number;
2728
+ };
2729
+ /** @description Writing the generated resource. */
2730
+ JobProgressCreatingResource: {
2731
+ /**
2732
+ * @description discriminator enum property added by openapi-typescript
2733
+ * @enum {string}
2734
+ */
2735
+ code: "creating-resource";
2736
+ };
2737
+ /** @description Writing detected tag annotations back to the resource. */
2738
+ JobProgressCreatingTagAnnotations: {
2739
+ /**
2740
+ * @description discriminator enum property added by openapi-typescript
2741
+ * @enum {string}
2742
+ */
2743
+ code: "creating-tag-annotations";
2744
+ /** @description How many annotations are being created */
2745
+ count: number;
2746
+ };
2747
+ /** @description Entity detection, one entity type at a time. */
2748
+ JobProgressDetectingEntities: {
2749
+ /**
2750
+ * @description discriminator enum property added by openapi-typescript
2751
+ * @enum {string}
2752
+ */
2753
+ code: "detecting-entities";
2754
+ /** @description Entity type currently being detected */
2755
+ entityType: string;
2756
+ };
2757
+ /** @description The model is generating the resource. */
2758
+ JobProgressGeneratingResource: {
2759
+ /**
2760
+ * @description discriminator enum property added by openapi-typescript
2761
+ * @enum {string}
2762
+ */
2763
+ code: "generating-resource";
2764
+ };
2765
+ /** @description Loading the resource content. */
2766
+ JobProgressLoading: {
2767
+ /**
2768
+ * @description discriminator enum property added by openapi-typescript
2769
+ * @enum {string}
2770
+ */
2771
+ code: "loading";
2772
+ };
3097
2773
  /** @description Event indicating a job has been queued */
3098
2774
  JobQueuedEvent: {
3099
2775
  jobId: string;
@@ -3104,6 +2780,11 @@ interface components {
3104
2780
  };
3105
2781
  /** @description Result of a completed reference-annotation job. */
3106
2782
  JobReferenceAnnotationResult: {
2783
+ /**
2784
+ * @description Discriminant — every JobResult member carries `kind`, single-valued, so a consumer holding only the result can tell what it is (WIRE-UNION-DISCRIMINANTS D1). (enum property replaced by openapi-typescript)
2785
+ * @enum {string}
2786
+ */
2787
+ kind: "reference-annotation";
3107
2788
  /** @description Total entities found */
3108
2789
  totalFound: number;
3109
2790
  /** @description Total annotations emitted */
@@ -3123,7 +2804,7 @@ interface components {
3123
2804
  percentage: number;
3124
2805
  progress?: components["schemas"]["JobProgress"];
3125
2806
  };
3126
- /** @description Discriminated union of all job result types. */
2807
+ /** @description Discriminated union of all job result types — every member carries a single-valued `kind` (WIRE-UNION-DISCRIMINANTS D1/D2). Consumers switch on `kind`; generated clients get typed variants. */
3127
2808
  JobResult: components["schemas"]["JobGenerationResult"] | components["schemas"]["JobReferenceAnnotationResult"] | components["schemas"]["JobHighlightAnnotationResult"] | components["schemas"]["JobAssessmentAnnotationResult"] | components["schemas"]["JobCommentAnnotationResult"] | components["schemas"]["JobTagAnnotationResult"] | components["schemas"]["JobDeclinedResult"];
3128
2809
  /** @description Command to start a job */
3129
2810
  JobStartCommand: {
@@ -3159,7 +2840,7 @@ interface components {
3159
2840
  completedAt?: string;
3160
2841
  error?: string;
3161
2842
  progress?: unknown;
3162
- result?: unknown;
2843
+ result?: components["schemas"]["JobResult"];
3163
2844
  };
3164
2845
  /** @description Result of a job status request */
3165
2846
  JobStatusResult: {
@@ -3168,6 +2849,11 @@ interface components {
3168
2849
  };
3169
2850
  /** @description Result of a completed tag-annotation job. */
3170
2851
  JobTagAnnotationResult: {
2852
+ /**
2853
+ * @description Discriminant — every JobResult member carries `kind`, single-valued, so a consumer holding only the result can tell what it is (WIRE-UNION-DISCRIMINANTS D1). (enum property replaced by openapi-typescript)
2854
+ * @enum {string}
2855
+ */
2856
+ kind: "tag-annotation";
3171
2857
  tagsFound: number;
3172
2858
  tagsCreated: number;
3173
2859
  /** @description Count of tags created per category */
@@ -3182,25 +2868,11 @@ interface components {
3182
2868
  JobType: "reference-annotation" | "generation" | "highlight-annotation" | "assessment-annotation" | "comment-annotation" | "tag-annotation";
3183
2869
  /** @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. */
3184
2870
  KnowledgeGraph: {
3185
- nodes: {
3186
- /** @description Node identifier — a ResourceId or AnnotationId */
3187
- id: string;
3188
- /**
3189
- * @description Whether this node is a resource or an annotation
3190
- * @enum {string}
3191
- */
3192
- type: "resource" | "annotation";
3193
- label: string;
3194
- /** @description Entity types on the node (resources) or carried by the annotation */
3195
- entityTypes?: string[];
3196
- metadata?: {
3197
- [key: string]: unknown;
3198
- };
3199
- }[];
2871
+ nodes: (components["schemas"]["GraphResourceNode"] | components["schemas"]["GraphAnnotationNode"])[];
3200
2872
  edges: {
3201
2873
  source: string;
3202
2874
  target: string;
3203
- /** @description Edge kind (e.g. citation, annotation-of, sibling) */
2875
+ /** @description Edge kind: `annotation-of` (an annotation → the resource it lives on), `cites` (a citing linking annotation → the focal resource), or a peer connection's own relationshipType (free-form; `link` when unnamed) */
3204
2876
  type: string;
3205
2877
  /** @description Whether the connection goes both ways */
3206
2878
  bidirectional?: boolean;
@@ -3227,6 +2899,7 @@ interface components {
3227
2899
  /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
3228
2900
  _userId?: string;
3229
2901
  resourceId: string;
2902
+ /** @description Optional: where the resource's bytes live, so the archive can act on the file. An instruction to this handler, not a copy of the stored fact (that lives on the primary Representation). Working-tree URI, only file:// is supported. */
3230
2903
  storageUri?: string;
3231
2904
  keepFile?: boolean;
3232
2905
  noGit?: boolean;
@@ -3315,6 +2988,7 @@ interface components {
3315
2988
  /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
3316
2989
  _userId?: string;
3317
2990
  resourceId: string;
2991
+ /** @description Optional: where the resource's bytes are expected to be. When present the handler VERIFIES the file exists and fails loudly if it does not, rather than succeeding as a no-op. An instruction, not a copy of the stored fact (that lives on the primary Representation). Working-tree URI, only file:// is supported. */
3318
2992
  storageUri?: string;
3319
2993
  };
3320
2994
  /** @description Bus command to update an annotation's body with patch operations. */
@@ -3406,7 +3080,7 @@ interface components {
3406
3080
  "@type"?: string | string[];
3407
3081
  /** @description MIME/media type (e.g., text/markdown, image/png). */
3408
3082
  mediaType: string;
3409
- /** @description Working-tree URI identifying where the bytes live. Only file:// is supported (e.g. file://docs/overview.md). */
3083
+ /** @description Working-tree URI identifying where this rendition's bytes live. Only file:// is supported (e.g. file://docs/overview.md). The single home of the storage location: maintained across moves (yield:moved relocates it), absent when the resource has no stored bytes. */
3410
3084
  storageUri?: string;
3411
3085
  filename?: string;
3412
3086
  /** @description Size of the payload in bytes. */
@@ -3457,6 +3131,8 @@ interface components {
3457
3131
  format: components["schemas"]["ContentFormat"];
3458
3132
  contentChecksum: string;
3459
3133
  contentByteSize?: number;
3134
+ /** @description Where the clone's bytes are, on the resource's primary Representation — the same single home `yield:created` writes to (STORAGE-URI-ONE-HOME). */
3135
+ storageUri?: string;
3460
3136
  parentResourceId: string;
3461
3137
  entityTypes?: string[];
3462
3138
  language?: string;
@@ -3469,7 +3145,7 @@ interface components {
3469
3145
  contentChecksum: string;
3470
3146
  contentByteSize?: number;
3471
3147
  entityTypes?: string[];
3472
- /** @description Working-tree URI (e.g. file://docs/overview.md) */
3148
+ /** @description The creating instruction's URI, recorded on the event. Append-only, so this value never changes — the LOCATION the projection serves is maintained across moves and lives on the resource's primary Representation, relocated by yield:moved. Optional: a resource may have no bytes. Working-tree URI, only file:// is supported (e.g. file://docs/overview.md). */
3473
3149
  storageUri?: string;
3474
3150
  language?: string;
3475
3151
  isDraft?: boolean;
@@ -3543,10 +3219,6 @@ interface components {
3543
3219
  * @description Original URI from a source knowledge base when this resource was imported
3544
3220
  */
3545
3221
  originatedFrom?: string;
3546
- /** @description Working-tree URI for this resource (e.g. file://docs/overview.md). Stable across updates and moves. */
3547
- storageUri?: string;
3548
- /** @description SHA-256 hex hash of the current content. Updated on resource.created, resource.updated, resource.cloned events. */
3549
- currentChecksum?: string;
3550
3222
  } & {
3551
3223
  [key: string]: unknown;
3552
3224
  };
@@ -3596,6 +3268,8 @@ interface components {
3596
3268
  text: string;
3597
3269
  /** @description Source resource ID */
3598
3270
  resourceId: string;
3271
+ /** @description The source resource's display name, resolved from its view at gather time. Required: a match card must name its source, and corpus matches routinely come from outside the graph neighborhood, so there is no node to borrow a name from. A match whose source no longer resolves to a view is dropped by the producer rather than served nameless. */
3272
+ resourceName: string;
3599
3273
  /** @description Source annotation ID, if the match is from an annotation */
3600
3274
  annotationId?: string;
3601
3275
  /** @description Cosine similarity score (0-1) */
@@ -3633,7 +3307,10 @@ interface components {
3633
3307
  theme: "light" | "dark" | "system";
3634
3308
  };
3635
3309
  SpecificResource: {
3636
- /** @enum {string} */
3310
+ /**
3311
+ * @description discriminator enum property added by openapi-typescript
3312
+ * @enum {string}
3313
+ */
3637
3314
  type: "SpecificResource";
3638
3315
  /** @description IRI of the target resource */
3639
3316
  source: string;
@@ -3654,7 +3331,7 @@ interface components {
3654
3331
  projectName?: string;
3655
3332
  /** @description Current git branch of the knowledge base repository */
3656
3333
  gitBranch?: string;
3657
- /** @description The knowledge base's did:web identity — 'did:web:' + the committed [site] domain, byte-identical to the string the launcher publishes in its discovery document. REQUIRED: a KB that declares no domain does not run (the launcher refuses to start it, and the backend refuses to boot), so a response without this field means the caller reached something that bypassed both. Identifies WHICH knowledge base this is; it does NOT identify which running copy — one KB reachable at two addresses (a local clone and a codespace of one repo) reports the same did at both. Use it to verify what you connected to, not to select among discovered entries. */
3334
+ /** @description The knowledge base's did:web identity — 'did:web:' + the committed [site] domain, byte-identical to the string the launcher publishes in its discovery document. REQUIRED: a KB that declares no domain does not run (the launcher refuses to start it, and the gateway refuses to boot), so a response without this field means the caller reached something that bypassed both. Identifies WHICH knowledge base this is; it does NOT identify which running copy — one KB reachable at two addresses (a local clone and a codespace of one repo) reports the same did at both. Use it to verify what you connected to, not to select among discovered entries. */
3658
3335
  did: string;
3659
3336
  };
3660
3337
  /** @description A persisted domain event with metadata. Flat shape — event fields and metadata are peers. */
@@ -3726,7 +3403,10 @@ interface components {
3726
3403
  suffix?: string;
3727
3404
  };
3728
3405
  TextualBody: {
3729
- /** @enum {string} */
3406
+ /**
3407
+ * @description discriminator enum property added by openapi-typescript
3408
+ * @enum {string}
3409
+ */
3730
3410
  type: "TextualBody";
3731
3411
  /** @description The text content (e.g., entity type name) */
3732
3412
  value: string;
@@ -3808,14 +3488,18 @@ interface components {
3808
3488
  /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
3809
3489
  _userId?: string;
3810
3490
  };
3811
- /** @description Bus command to create a cloned resource from a clone token. */
3491
+ /** @description Bus command to create a cloned resource from a clone token. Bytes are stored gateway-side BEFORE this command is emitted (GATEWAY.md D4a: the Archivist serves no bytes) — the command carries the storage coordinates, never content. */
3812
3492
  YieldCloneCreateCommand: {
3813
3493
  correlationId: string;
3814
3494
  /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
3815
3495
  _userId?: string;
3816
3496
  token: string;
3817
3497
  name: string;
3818
- content: string;
3498
+ /** @description Where the caller already wrote the clone's bytes — an instruction, not a copy of the stored fact (that lives on the primary Representation). Bytes are stored through the byte door BEFORE this command is sent, so this names an existing file. Working-tree URI, only file:// is supported. */
3499
+ storageUri: string;
3500
+ contentChecksum: string;
3501
+ byteSize: number;
3502
+ format: components["schemas"]["ContentFormat"];
3819
3503
  archiveOriginal?: boolean;
3820
3504
  };
3821
3505
  /** @description Success response after creating a cloned resource. */
@@ -3842,6 +3526,7 @@ interface components {
3842
3526
  /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
3843
3527
  _userId?: string;
3844
3528
  name: string;
3529
+ /** @description The caller's instruction for WHERE the bytes are — not a copy of the stored fact. The stored location lives on the resource's primary Representation (`Representation.storageUri`), which is its single home; this field is the message that puts it there. Working-tree URI, only file:// is supported (e.g. file://docs/overview.md). */
3845
3530
  storageUri: string;
3846
3531
  contentChecksum: string;
3847
3532
  byteSize: number;
@@ -3857,6 +3542,34 @@ interface components {
3857
3542
  generator?: components["schemas"]["Agent"] | components["schemas"]["Agent"][];
3858
3543
  noGit?: boolean;
3859
3544
  };
3545
+ /**
3546
+ * @description Command: stow an already-uploaded clone's bytes and append `yield:cloned`.
3547
+ *
3548
+ * The INNER half of the clone flow. `yield:clone-create` reaches the CloneTokenManager, which alone can validate the token and read the source's entity types; it then emits this so the Stower — the only appendEvent caller — writes the domain event.
3549
+ *
3550
+ * Distinct from `yield:create` because a clone is a distinct operation, not a creation with an extra field. It REQUIRES a parent, and that requirement is what a separate command expresses: an optional `parentResourceId` on the create command could not say that a clone without a parent is not a clone. `ResourceClonedPayload` requires it for the same reason.
3551
+ *
3552
+ * Generated resources are NOT clones: they carry provenance in `generatedFrom` and stay on `yield:create`.
3553
+ */
3554
+ YieldClonePersistCommand: {
3555
+ /** @description Correlation id so busRequest can match the reply. */
3556
+ correlationId: string;
3557
+ /** @description Injected by the gateway from the authenticated principal; never supplied by a wire caller. */
3558
+ _userId?: string;
3559
+ name: string;
3560
+ /** @description The caller's instruction for WHERE the bytes are — the uploader wrote them before emitting this. The stored location lives on the clone's primary Representation (STORAGE-URI-ONE-HOME). */
3561
+ storageUri: string;
3562
+ contentChecksum: string;
3563
+ byteSize: number;
3564
+ format: components["schemas"]["ContentFormat"];
3565
+ language?: string;
3566
+ /** @description Inherited from the source resource by the CloneTokenManager, which is the only party that knows the token is valid. */
3567
+ entityTypes?: string[];
3568
+ /** @description The resource this one is cloned FROM. Required: it is what makes this a clone rather than a creation. */
3569
+ parentResourceId: string;
3570
+ /** @description The bytes were already written by the uploader; the Stower's register does the one `git add` on apply (GATEWAY.md D4b). */
3571
+ noGit?: boolean;
3572
+ };
3860
3573
  /** @description Success reply after creating a yielded resource, matched to the originating command by correlationId. */
3861
3574
  YieldCreateOk: {
3862
3575
  /** @description Correlation id echoed from the yield:create command so busRequest can match the reply. */
@@ -3866,6 +3579,15 @@ interface components {
3866
3579
  resourceId: string;
3867
3580
  };
3868
3581
  };
3582
+ /** @description Success reply after cloning a resource, matched to the originating command by correlationId. */
3583
+ YieldClonePersistOk: {
3584
+ /** @description Correlation id echoed from the yield:clone-persist command so busRequest can match the reply. */
3585
+ correlationId?: string;
3586
+ /** @description The clone's identity — a new resource, distinct from its parent. */
3587
+ response: {
3588
+ resourceId: string;
3589
+ };
3590
+ };
3869
3591
  /** @description Bus command to move (rename) a yielded resource. */
3870
3592
  YieldMvCommand: {
3871
3593
  /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
@@ -3881,6 +3603,7 @@ interface components {
3881
3603
  /** @description Authenticated user's DID, injected by the /bus/emit gateway. Clients do not set this. */
3882
3604
  _userId?: string;
3883
3605
  resourceId: string;
3606
+ /** @description The caller's instruction for WHERE the bytes are — not a copy of the stored fact. The stored location lives on the resource's primary Representation (`Representation.storageUri`), which is its single home; this field is the message that puts it there. Working-tree URI, only file:// is supported (e.g. file://docs/overview.md). */
3884
3607
  storageUri: string;
3885
3608
  contentChecksum: string;
3886
3609
  byteSize: number;
@@ -4228,7 +3951,7 @@ interface AnchorRect {
4228
3951
  *
4229
3952
  * The complete EventMap for the RxJS EventBus. Every channel name and
4230
3953
  * its payload type is defined here — domain events, commands, reads,
4231
- * results, SSE stream payloads, and frontend UI events.
3954
+ * results, SSE stream payloads, and Browser UI events.
4232
3955
  *
4233
3956
  * Identifier discipline: where a payload carries an annotation or
4234
3957
  * resource id, the TypeScript layer narrows the OpenAPI `string` to the
@@ -4274,6 +3997,7 @@ type EventMap = {
4274
3997
  'yield:representation-added': StoredEvent<EventOfType<'yield:representation-added'>>;
4275
3998
  'yield:representation-removed': StoredEvent<EventOfType<'yield:representation-removed'>>;
4276
3999
  'yield:create': components['schemas']['YieldCreateCommand'];
4000
+ 'yield:clone-persist': components['schemas']['YieldClonePersistCommand'];
4277
4001
  'yield:update': components['schemas']['YieldUpdateCommand'];
4278
4002
  'yield:mv': components['schemas']['YieldMvCommand'];
4279
4003
  'yield:clone': void;
@@ -4282,6 +4006,10 @@ type EventMap = {
4282
4006
  'yield:clone-create': components['schemas']['YieldCloneCreateCommand'];
4283
4007
  'yield:create-ok': components['schemas']['YieldCreateOk'];
4284
4008
  'yield:create-failed': components['schemas']['CommandError'];
4009
+ 'yield:clone-persist-ok': components['schemas']['YieldClonePersistOk'];
4010
+ 'yield:clone-persist-failed': {
4011
+ correlationId: string;
4012
+ } & components['schemas']['CommandError'];
4285
4013
  'yield:update-ok': components['schemas']['YieldUpdateOk'];
4286
4014
  'yield:update-failed': components['schemas']['CommandError'];
4287
4015
  'yield:move-failed': {
@@ -4421,6 +4149,14 @@ type EventMap = {
4421
4149
  'browse:anchored-text-failed': {
4422
4150
  correlationId: string;
4423
4151
  } & components['schemas']['CommandError'];
4152
+ 'browse:anchored-text-by-checksum-requested': components['schemas']['BrowseAnchoredTextByChecksumRequest'];
4153
+ 'browse:anchored-text-by-checksum-result': {
4154
+ correlationId: string;
4155
+ response: components['schemas']['ExtractionOutcome'] | null;
4156
+ };
4157
+ 'browse:anchored-text-by-checksum-failed': {
4158
+ correlationId: string;
4159
+ } & components['schemas']['CommandError'];
4424
4160
  'browse:resources-requested': components['schemas']['BrowseResourcesRequest'];
4425
4161
  'browse:resources-result': {
4426
4162
  correlationId: string;
@@ -4557,7 +4293,7 @@ type EventMap = {
4557
4293
  * Emitted by the Weaver after applying an event (or a batch's last event)
4558
4294
  * for a resource to the graph. `sequenceNumber` is the resource-stream
4559
4295
  * sequence of the last applied event. Folded by `WeaveProgress`
4560
- * (make-meaning) into the backend-local applied map that the
4296
+ * (make-meaning) into the gateway-local applied map that the
4561
4297
  * `whenApplied` barrier awaits. In-process signal today; crosses the
4562
4298
  * bus gateway after WEAVER-ISOLATION.
4563
4299
  */
@@ -4687,6 +4423,7 @@ declare const CHANNEL_SCHEMAS: {
4687
4423
  readonly 'yield:representation-added': null;
4688
4424
  readonly 'yield:representation-removed': null;
4689
4425
  readonly 'yield:create': "YieldCreateCommand";
4426
+ readonly 'yield:clone-persist': "YieldClonePersistCommand";
4690
4427
  readonly 'yield:update': "YieldUpdateCommand";
4691
4428
  readonly 'yield:mv': "YieldMvCommand";
4692
4429
  readonly 'yield:clone': null;
@@ -4695,6 +4432,8 @@ declare const CHANNEL_SCHEMAS: {
4695
4432
  readonly 'yield:clone-create': "YieldCloneCreateCommand";
4696
4433
  readonly 'yield:create-ok': "YieldCreateOk";
4697
4434
  readonly 'yield:create-failed': "CommandError";
4435
+ readonly 'yield:clone-persist-ok': "YieldClonePersistOk";
4436
+ readonly 'yield:clone-persist-failed': null;
4698
4437
  readonly 'yield:update-ok': "YieldUpdateOk";
4699
4438
  readonly 'yield:update-failed': null;
4700
4439
  readonly 'yield:move-failed': null;
@@ -4773,6 +4512,9 @@ declare const CHANNEL_SCHEMAS: {
4773
4512
  readonly 'browse:anchored-text-requested': "BrowseAnchoredTextRequest";
4774
4513
  readonly 'browse:anchored-text-result': "BrowseAnchoredTextResult";
4775
4514
  readonly 'browse:anchored-text-failed': null;
4515
+ readonly 'browse:anchored-text-by-checksum-requested': "BrowseAnchoredTextByChecksumRequest";
4516
+ readonly 'browse:anchored-text-by-checksum-result': "BrowseAnchoredTextResult";
4517
+ readonly 'browse:anchored-text-by-checksum-failed': null;
4776
4518
  readonly 'browse:resources-requested': "BrowseResourcesRequest";
4777
4519
  readonly 'browse:resources-result': "BrowseResourcesResult";
4778
4520
  readonly 'browse:resources-failed': null;
@@ -5018,6 +4760,13 @@ declare class EventBus {
5018
4760
  * using runtime `PersistedEventType` strings.
5019
4761
  */
5020
4762
  getDomainEvent(eventType: PersistedEventType): Subject<StoredEvent>;
4763
+ /**
4764
+ * Channel names with at least one live observer right now. Introspection
4765
+ * for composition-parity gates: `get()` creates subjects lazily, so mere
4766
+ * access does not count — only real subscriptions do. Scoped channels
4767
+ * appear under their namespaced key (`<scope>:<channel>`).
4768
+ */
4769
+ observedChannels(): string[];
5021
4770
  /**
5022
4771
  * Destroy the event bus and complete all subjects
5023
4772
  *
@@ -5254,7 +5003,7 @@ declare function errField(error: unknown): unknown;
5254
5003
  * Bus logging — runtime-toggleable cross-wire visibility.
5255
5004
  *
5256
5005
  * One line per event that crosses a process boundary, in a grep-able
5257
- * format that's symmetric across frontend and backend:
5006
+ * format that's symmetric across frontend and gateway:
5258
5007
  *
5259
5008
  * [bus EMIT] <channel> [scope=X] [cid=<first8>] <payload>
5260
5009
  * [bus RECV] <channel> [scope=X] [cid=<first8>] <payload>
@@ -5744,7 +5493,11 @@ declare function getChecksum(resource: ResourceDescriptor | undefined): string |
5744
5493
  */
5745
5494
  declare function getLanguage(resource: ResourceDescriptor | undefined): string | undefined;
5746
5495
  /**
5747
- * Get storage URI from primary representation
5496
+ * Get the storage URI from the primary representation — the field's ONE home
5497
+ * (STORAGE-URI-ONE-HOME): bytes are a fact about a rendition, so their
5498
+ * location lives on the Representation, never on the descriptor. This is the
5499
+ * accessor every descriptor-holding read goes through; `undefined` means the
5500
+ * resource has no stored bytes.
5748
5501
  *
5749
5502
  * @param resource - ResourceDescriptor
5750
5503
  * @returns Storage URI or undefined
@@ -5834,7 +5587,7 @@ declare function decodeRepresentation(buffer: Buffer, mediaType: string): string
5834
5587
  * - `not-found` — resource missing (HTTP 404)
5835
5588
  * - `conflict` — concurrent modification, duplicate, etc. (HTTP 409)
5836
5589
  * - `bad-request` — request malformed (HTTP 400)
5837
- * - `unavailable` — backend unreachable, network error, 5xx
5590
+ * - `unavailable` — gateway unreachable, network error, 5xx
5838
5591
  * - `error` — unclassified fallback
5839
5592
  */
5840
5593
  type TransportErrorCode = 'unauthorized' | 'forbidden' | 'not-found' | 'conflict' | 'bad-request' | 'unavailable' | 'error';
@@ -5870,11 +5623,11 @@ declare class ConflictError extends SemiontError {
5870
5623
  *
5871
5624
  * ITransport — bus primitives + lifecycle. Universal: every
5872
5625
  * concrete transport implements this.
5873
- * IBackendOperations — auth, admin, exchange, system endpoints.
5626
+ * IGatewayOperations — auth, admin, and system endpoints.
5874
5627
  * HTTP-shaped today; an in-process transport may
5875
5628
  * implement none, some, or a different set.
5876
5629
  * Optional on `SemiontClient` — passed only when
5877
- * the host has a backend that supports them.
5630
+ * the host has a gateway that supports them.
5878
5631
  * IContentTransport — binary I/O (putBinary / getBinary). Narrow by
5879
5632
  * design because binary has different backpressure
5880
5633
  * and streaming characteristics.
@@ -5943,27 +5696,6 @@ type UserResponse = ResponseContent<paths['/api/users/me']['get']>;
5943
5696
  type UpdateUserRequest = RequestContent<paths['/api/admin/users/{id}']['patch']>;
5944
5697
  type UpdateUserResponse = ResponseContent<paths['/api/admin/users/{id}']['patch']>;
5945
5698
  type ListUsersResponse = ResponseContent<paths['/api/admin/users']['get']>;
5946
- type ProgressEvent = {
5947
- phase: string;
5948
- message?: string;
5949
- result?: Record<string, unknown>;
5950
- };
5951
- type ProgressCallback = (event: ProgressEvent) => void;
5952
- /**
5953
- * Stream-shaped return type for backend download operations
5954
- * (`backupKnowledgeBase`, `exportKnowledgeBase`). Transport-neutral —
5955
- * any implementation can produce a `ReadableStream<Uint8Array>` without
5956
- * fabricating a fetch `Response`. HTTP wraps `response.body` and
5957
- * `response.headers`; in-process implementations return their own stream.
5958
- *
5959
- * The same shape `IContentTransport.getBinaryStream` already uses for
5960
- * binary downloads.
5961
- */
5962
- interface BackendDownload {
5963
- stream: ReadableStream<Uint8Array>;
5964
- contentType: string;
5965
- filename?: string;
5966
- }
5967
5699
  interface ITransport {
5968
5700
  /**
5969
5701
  * Base URL the transport speaks to. For HTTP this is `https://host[:port]`;
@@ -5979,7 +5711,7 @@ interface ITransport {
5979
5711
  *
5980
5712
  * Resolves with the number of subscribers the emit reached
5981
5713
  * (`/bus/emit` responds `{subscribers: n}`; GUIDED-TOUR P1), or `-1`
5982
- * when the count is unknown — an older backend, an unreadable body, or
5714
+ * when the count is unknown — an older gateway, an unreadable body, or
5983
5715
  * an in-process transport where the question does not apply. `-1` is
5984
5716
  * the same sentinel the Go client uses: a parse failure must stay
5985
5717
  * distinguishable from a genuine empty room.
@@ -6048,9 +5780,9 @@ interface ITransport {
6048
5780
  dispose(): void;
6049
5781
  }
6050
5782
  /**
6051
- * Auth, admin, exchange, and system endpoints. HTTP-shaped today —
5783
+ * Auth, admin, and system endpoints. HTTP-shaped today —
6052
5784
  * `HttpTransport` implements both this and `ITransport`; the
6053
- * `SemiontClient` constructor takes a `IBackendOperations` argument
5785
+ * `SemiontClient` constructor takes a `IGatewayOperations` argument
6054
5786
  * separately from the bus transport so non-HTTP transports
6055
5787
  * (`LocalTransport`) can implement just the bus surface and the
6056
5788
  * SemiontClient cleanly omits `client.auth` / `client.admin`.
@@ -6059,7 +5791,7 @@ interface ITransport {
6059
5791
  * `TransportErrorCode` (see `errors.ts`) so the routing layer
6060
5792
  * (`SemiontBrowser`) stays transport-neutral.
6061
5793
  */
6062
- interface IBackendOperations {
5794
+ interface IGatewayOperations {
6063
5795
  authenticatePassword(email: Email, password: string): Promise<AuthResponse>;
6064
5796
  authenticateGoogle(credential: GoogleCredential): Promise<AuthResponse>;
6065
5797
  refreshAccessToken(token: RefreshToken): Promise<TokenRefreshResponse>;
@@ -6073,22 +5805,6 @@ interface IBackendOperations {
6073
5805
  getUserStats(): Promise<AdminUserStatsResponse>;
6074
5806
  updateUser(id: UserDID, data: UpdateUserRequest): Promise<UpdateUserResponse>;
6075
5807
  getOAuthConfig(): Promise<OAuthConfigResponse>;
6076
- backupKnowledgeBase(): Promise<BackendDownload>;
6077
- /**
6078
- * Stream of `ProgressEvent`s for a restore/import operation. The
6079
- * Observable emits each progress event in order and completes when
6080
- * the operation is done; the final event carries `phase: 'complete'`
6081
- * (or `'error'` / `'failed'` followed by an Observable error).
6082
- *
6083
- * The SDK wraps the contract's `Observable<ProgressEvent>` as a
6084
- * `StreamObservable<ProgressEvent>` so consumers can `await` for the
6085
- * final event or `.subscribe(...)` to render every step.
6086
- */
6087
- restoreKnowledgeBase(file: File): Observable<ProgressEvent>;
6088
- exportKnowledgeBase(params?: {
6089
- includeArchived?: boolean;
6090
- }): Promise<BackendDownload>;
6091
- importKnowledgeBase(file: File): Observable<ProgressEvent>;
6092
5808
  healthCheck(): Promise<HealthCheckResponse>;
6093
5809
  getStatus(): Promise<StatusResponse>;
6094
5810
  }
@@ -6104,6 +5820,15 @@ interface PutBinaryRequest {
6104
5820
  generationPrompt?: string;
6105
5821
  generator?: Agent$1 | Agent$1[];
6106
5822
  isDraft?: boolean;
5823
+ /**
5824
+ * Clone provenance (EXTRACT-ARCHIVIST P3): when set, the gateway stores
5825
+ * the bytes and routes creation through `yield:clone-create` — the
5826
+ * CloneTokenManager validates the token and inherits source metadata.
5827
+ * Bytes never ride the bus (D4a).
5828
+ */
5829
+ cloneToken?: string;
5830
+ /** Clone-only: archive the source resource after a successful clone. */
5831
+ archiveOriginal?: boolean;
6107
5832
  }
6108
5833
  /**
6109
5834
  * Optional byte-progress hook for `putBinary`. Receives raw byte counts;
@@ -6159,85 +5884,6 @@ interface IContentTransport {
6159
5884
  getResourceGraph(resourceId: ResourceId, options?: {
6160
5885
  auth?: AccessToken;
6161
5886
  }): Promise<GetResourceResponse>;
6162
- /**
6163
- * Store anchored text — the coordinate map a producer derived from a
6164
- * representation's bytes (OCR, a native text layer, a table or form
6165
- * reader) — under **the content checksum of those bytes** (PERSIST-ANCHORS
6166
- * decision A: one artifact per representation, and a representation IS its
6167
- * bytes).
6168
- *
6169
- * The producer supplies the checksum because it alone knows which bytes it
6170
- * actually read. That is a correctness rule, not a convenience: if the
6171
- * store derived the key from the resource's CURRENT representation at
6172
- * write time, a byte change racing the publish would file old geometry
6173
- * under the new checksum — wrong quotes served, and the reconcile diff
6174
- * sees "artifact present" so it never heals. Producer-supplied, the same
6175
- * race files the map under the OLD checksum: an unreachable orphan, and
6176
- * the new checksum's missing artifact is exactly what the third drift
6177
- * class re-derives (SMELTER-AXIOMS S15).
6178
- *
6179
- * Its own method rather than a `putBinary` of some derived media type: a
6180
- * coordinate map is not a *representation* of the resource, and dressing it
6181
- * as one would make a derived artifact indistinguishable from content a user
6182
- * uploaded.
6183
- *
6184
- * Whole-representation, like `getResourceGraph` is whole-resource. The
6185
- * producer iterates page by page; every consumer wants one map.
6186
- */
6187
- putAnchoredText(checksum: string, outcome: ExtractionOutcome, options?: {
6188
- auth?: AccessToken;
6189
- }): Promise<void>;
6190
- /**
6191
- * The resource's anchored text, or `null` when none has been derived.
6192
- *
6193
- * Deliberately resource-addressed while `putAnchoredText` is
6194
- * checksum-addressed: readers hold a resource id, and the server resolves
6195
- * it to the current representation's checksum through the view — the
6196
- * `resourceId → checksum` index of PERSIST-ANCHORS decision A. A reader
6197
- * therefore can never receive geometry for bytes the resource no longer
6198
- * has: the pointer moves, the artifacts stay, the index always follows
6199
- * the pointer.
6200
- *
6201
- * `null` is not an error and is the common case: a native text layer is read
6202
- * in the browser, and a resource whose media type has no extractor never
6203
- * produces a map at all. Callers degrade — for a PDF annotation that means
6204
- * geometry with no quoted text, which is the behaviour that shipped before
6205
- * any of this existed.
6206
- */
6207
- getAnchoredText(resourceId: ResourceId, options?: {
6208
- auth?: AccessToken;
6209
- }): Promise<ExtractionOutcome | null>;
6210
- /**
6211
- * The stored extraction outcome for exactly this byte content, or `null`
6212
- * for a miss — the cache-consult read (PERSIST-ANCHORS P2c). Every cache
6213
- * consumer runs out of process (the smelter worker, the detection
6214
- * workers), so the `extract()` seam's consult crosses the wire through
6215
- * this method; without it the cache would be write-only from exactly the
6216
- * processes it exists to serve.
6217
- *
6218
- * Checksum-addressed and barrier-free, unlike `getAnchoredText`:
6219
- * presence at this instant is the question (the keys listing's
6220
- * semantics), and a caller holding the checksum already holds the
6221
- * content identity — nothing to resolve, nothing to wait for.
6222
- */
6223
- getAnchoredTextByChecksum(checksum: string, options?: {
6224
- auth?: AccessToken;
6225
- }): Promise<ExtractionOutcome | null>;
6226
- /**
6227
- * Every key under which anchored text would currently be served — the
6228
- * reconcile planner's bulk existence read (PERSIST-ANCHORS P0). The
6229
- * Smelter diffs this against the catalog to find resources whose artifact
6230
- * was lost (a transient store, a failed publish) and plans re-derivation;
6231
- * one call per reconcile, never a `getAnchoredText` probe per resource,
6232
- * because each map is ~32 KB per scanned page and only presence is asked.
6233
- *
6234
- * Keys are resource ids today; after PERSIST-ANCHORS P1 they are content
6235
- * checksums. Callers compare against whichever handle the store is keyed
6236
- * by — the diff moves with the rekey, this contract does not.
6237
- */
6238
- listAnchoredTextKeys(options?: {
6239
- auth?: AccessToken;
6240
- }): Promise<string[]>;
6241
5887
  dispose(): void;
6242
5888
  }
6243
5889
 
@@ -6281,6 +5927,10 @@ declare const BUS_OPERATIONS: {
6281
5927
  readonly result: "browse:anchored-text-result";
6282
5928
  readonly failure: "browse:anchored-text-failed";
6283
5929
  };
5930
+ readonly 'browse:anchored-text-by-checksum-requested': {
5931
+ readonly result: "browse:anchored-text-by-checksum-result";
5932
+ readonly failure: "browse:anchored-text-by-checksum-failed";
5933
+ };
6284
5934
  readonly 'browse:resources-requested': {
6285
5935
  readonly result: "browse:resources-result";
6286
5936
  readonly failure: "browse:resources-failed";
@@ -6398,6 +6048,10 @@ declare const BUS_OPERATIONS: {
6398
6048
  readonly result: "yield:create-ok";
6399
6049
  readonly failure: "yield:create-failed";
6400
6050
  };
6051
+ readonly 'yield:clone-persist': {
6052
+ readonly result: "yield:clone-persist-ok";
6053
+ readonly failure: "yield:clone-persist-failed";
6054
+ };
6401
6055
  readonly 'yield:update': {
6402
6056
  readonly result: "yield:update-ok";
6403
6057
  readonly failure: "yield:update-failed";
@@ -6837,7 +6491,7 @@ declare function reconcileSelector(content: string, llm: LlmSelectorInput): Reco
6837
6491
  /**
6838
6492
  * Text encoding utilities for consistent charset handling
6839
6493
  *
6840
- * Ensures frontend decoding matches backend decoding by respecting
6494
+ * Ensures frontend decoding matches gateway decoding by respecting
6841
6495
  * charset parameters in mediaType (e.g., "text/plain; charset=iso-8859-1")
6842
6496
  */
6843
6497
  /**
@@ -6856,7 +6510,7 @@ declare function extractCharset(mediaType: string): string;
6856
6510
  *
6857
6511
  * Uses TextDecoder with the charset extracted from mediaType parameter.
6858
6512
  * This ensures the same character space is used for both annotation creation
6859
- * (backend) and rendering (frontend).
6513
+ * (gateway) and rendering (frontend).
6860
6514
  *
6861
6515
  * @param buffer - Binary data to decode
6862
6516
  * @param mediaType - Media type with optional charset parameter
@@ -6940,11 +6594,16 @@ declare function isValidEmail(email: string): boolean;
6940
6594
  * embedding, never mojibake)
6941
6595
  * - `authorable` — offered in the compose editor's format dropdown
6942
6596
  * - `uploadable` — big tent: true for every registry member
6597
+ * - `generatable` — the generation worker can produce it as a yield artifact
6943
6598
  *
6944
6599
  * Capabilities are orthogonal strategies, not a ladder: images render but
6945
6600
  * yield no text; PDFs yield text but aren't authorable. A "tier" is a
6946
6601
  * derived reading, not a stored fact.
6947
6602
  *
6603
+ * Questions ANSWERABLE from those rows get a helper, never a row of their own —
6604
+ * `isAnnotatable` reads `anchoring`, and a second stored field would be a fact
6605
+ * that can contradict the one it was derived from.
6606
+ *
6948
6607
  * Import-leniency invariant: restore/import preserves archive mediaTypes
6949
6608
  * verbatim, so "every stored mediaType is registry-valid" holds only for
6950
6609
  * content that entered through the validated create/yield gate. No code
@@ -7121,6 +6780,15 @@ declare function baseMediaType(format: string): string;
7121
6780
  declare function isSupportedMediaType(format: string): format is SupportedMediaType;
7122
6781
  /** Capabilities for a format (parameters tolerated), or undefined on registry miss. */
7123
6782
  declare function capabilitiesOf(format: string): MediaTypeCapabilities | undefined;
6783
+ /**
6784
+ * The clone-format gate (MEDIA-TYPES.md Phase 5, moved here for
6785
+ * EXTRACT-ARCHIVIST's clone wire-shape change): a clone opens in the
6786
+ * compose editor, so authorable sources keep their base media type and
6787
+ * everything else falls back to text/plain. Lives beside the registry it
6788
+ * reads; the SDK applies it when deriving a clone upload's format and the
6789
+ * CloneTokenManager's tests pin it.
6790
+ */
6791
+ declare function cloneFormat(sourceMediaType: string | undefined): SupportedMediaType;
7124
6792
  /**
7125
6793
  * Lenient extension lookup for naming foreign/imported content: '.dat' on
7126
6794
  * registry miss. Exporters use this — a vocabulary change must never
@@ -7141,6 +6809,19 @@ declare function mediaTypeForExtension(ext: string): SupportedMediaType | undefi
7141
6809
  * unregistered text subtypes embed too), everything else is 'none'.
7142
6810
  */
7143
6811
  declare function textExtractionOf(format: string): TextExtraction;
6812
+ /**
6813
+ * WHETHER a type can carry annotations — `anchoring` remains the authority on
6814
+ * HOW. Derived rather than stored: a parallel `annotatable` row field would be
6815
+ * two facts that can disagree, with nothing to adjudicate
6816
+ * `{ annotatable: true, anchoring: 'none' }`.
6817
+ *
6818
+ * Strict on a registry miss, where `textExtractionOf` above is lenient. The
6819
+ * asymmetry is deliberate. Extracting the wrong bytes costs one bad vector,
6820
+ * and refusing to extract costs a resource nobody can find, so extraction
6821
+ * guesses; an annotation is a durable write against a coordinate model the
6822
+ * system does not have for an unknown type, so it refuses.
6823
+ */
6824
+ declare function isAnnotatable(format: string): boolean;
7144
6825
  /** Types offered in the compose editor's format dropdown. */
7145
6826
  declare const AUTHORABLE_MEDIA_TYPES: readonly SupportedMediaType[];
7146
6827
  /** Registry rows whose text the Smelter can extract. Rows only — the
@@ -7282,6 +6963,61 @@ interface StateUnit {
7282
6963
  dispose(): void;
7283
6964
  }
7284
6965
 
6966
+ /**
6967
+ * Storage URI Derivation
6968
+ *
6969
+ * Builds the name a resource's content lives under in the working tree, from
6970
+ * its title and validated media type. Extensions come from the media-type
6971
+ * registry; formats are validated upstream at the create/yield boundary, so
6972
+ * the lookup is strict — no fallback.
6973
+ *
6974
+ * Lives in `@semiont/core` rather than `@semiont/content` (moved
6975
+ * 2026-08-24, GENERATION-OUTPUT-FORMAT D10) because the generation form
6976
+ * proposes a default path and react-ui cannot depend on the node-flavoured
6977
+ * content package. This module imports only the registry, so it is
6978
+ * browser-safe.
6979
+ */
6980
+
6981
+ /**
6982
+ * The FILENAME a resource's content takes: slug + the registry's extension.
6983
+ *
6984
+ * The name is lowercased, runs of non-alphanumeric characters collapse to
6985
+ * single hyphens, and leading/trailing hyphens are stripped.
6986
+ *
6987
+ * This is the fragment form, for callers composing a path themselves — the
6988
+ * generation form's input sits beside a `file://` prefix chip, so it must not
6989
+ * strip a prefix this helper just added.
6990
+ *
6991
+ * @example
6992
+ * storageFileName("My Document", "text/markdown") // => "my-document.md"
6993
+ */
6994
+ declare function storageFileName(name: string, format: SupportedMediaType): string;
6995
+ /**
6996
+ * Derive a full `file://` storage URI from a resource name and media type.
6997
+ *
6998
+ * @example
6999
+ * deriveStorageUri("My Document", "text/markdown") // => "file://my-document.md"
7000
+ */
7001
+ declare function deriveStorageUri(name: string, format: SupportedMediaType): string;
7002
+ /**
7003
+ * The folder a resource lives in, WITHOUT a trailing slash — `''` when it sits
7004
+ * at the tree root. Accepts a `file://` URI or a bare path.
7005
+ */
7006
+ declare function folderOf(storageUri: string | undefined): string;
7007
+ /**
7008
+ * The Save location a form PROPOSES: beside the source resource, named for the
7009
+ * title, extended for the chosen format (GENERATION-OUTPUT-FORMAT D11).
7010
+ *
7011
+ * Deriving the whole filename — extension included — has a happy consequence:
7012
+ * while untouched, switching format rewrites the extension too, so D7's
7013
+ * mismatch refusal becomes unreachable except on hand-edited paths. It guards
7014
+ * deliberate edits rather than trapping ordinary use.
7015
+ *
7016
+ * Returns `''` for an empty title: a bare extension (".md") reads as a hidden
7017
+ * file and is nobody's intent.
7018
+ */
7019
+ declare function proposeStoragePath(folder: string, title: string, format: SupportedMediaType): string;
7020
+
7285
7021
  /**
7286
7022
  * Common type guard utilities
7287
7023
  */
@@ -7581,9 +7317,9 @@ interface BuildRequirements {
7581
7317
  }
7582
7318
  /**
7583
7319
  * This interface was referenced by `HttpsSemiontOrgSchemasConfigJson`'s JSON-Schema
7584
- * via the `definition` "BackendServiceConfig".
7320
+ * via the `definition` "GatewayServiceConfig".
7585
7321
  */
7586
- interface BackendServiceConfig {
7322
+ interface GatewayServiceConfig {
7587
7323
  platform: ServicePlatformConfig;
7588
7324
  devMode?: boolean;
7589
7325
  command?: string;
@@ -7632,58 +7368,6 @@ interface BackendServiceConfig {
7632
7368
  [k: string]: string;
7633
7369
  };
7634
7370
  }
7635
- /**
7636
- * This interface was referenced by `HttpsSemiontOrgSchemasConfigJson`'s JSON-Schema
7637
- * via the `definition` "FrontendServiceConfig".
7638
- */
7639
- interface FrontendServiceConfig {
7640
- platform: ServicePlatformConfig;
7641
- devMode?: boolean;
7642
- command?: string;
7643
- port: number;
7644
- siteName: string;
7645
- image?: string;
7646
- projectRoot?: string;
7647
- databaseUrl?: string;
7648
- timeout?: number;
7649
- wait?: number;
7650
- logsEndpoint?: string;
7651
- tag?: string;
7652
- resources?: ResourceRequirements;
7653
- security?: SecurityRequirements;
7654
- build?: boolean | BuildRequirements;
7655
- dockerfile?: string;
7656
- buildContext?: string;
7657
- buildArgs?: {
7658
- [k: string]: string;
7659
- };
7660
- buildTarget?: string;
7661
- prebuilt?: boolean;
7662
- noCache?: boolean;
7663
- secrets?: string[];
7664
- labels?: {
7665
- [k: string]: string;
7666
- };
7667
- annotations?: {
7668
- [k: string]: string;
7669
- };
7670
- dependencies?: string[];
7671
- externalDependencies?: (string | {
7672
- name?: string;
7673
- url?: string;
7674
- required?: boolean;
7675
- healthCheck?: string;
7676
- [k: string]: unknown;
7677
- })[];
7678
- environment?: {
7679
- [k: string]: string;
7680
- };
7681
- env?: {
7682
- [k: string]: string;
7683
- };
7684
- publicURL?: string;
7685
- allowedOrigins?: string[];
7686
- }
7687
7371
  /**
7688
7372
  * This interface was referenced by `HttpsSemiontOrgSchemasConfigJson`'s JSON-Schema
7689
7373
  * via the `definition` "VectorsServiceConfig".
@@ -7854,13 +7538,26 @@ interface McpServiceConfig {
7854
7538
  * via the `definition` "ServicesConfig".
7855
7539
  */
7856
7540
  interface ServicesConfig {
7857
- backend?: BackendServiceConfig;
7858
- frontend?: FrontendServiceConfig;
7541
+ gateway?: GatewayServiceConfig;
7859
7542
  database?: DatabaseServiceConfig;
7860
7543
  graph?: GraphServiceConfig;
7861
7544
  mcp?: McpServiceConfig;
7862
7545
  vectors: VectorsServiceConfig;
7863
7546
  embedding: EmbeddingServiceConfig;
7547
+ archivist?: ArchivistServiceConfig;
7548
+ [k: string]: unknown;
7549
+ }
7550
+ /**
7551
+ * The Archivist service — the out-of-process keeper of the record (EXTRACT-ARCHIVIST). Internal-only: the gateway dials host:port for the D1 sequence-ranged event read path; nothing public.
7552
+ *
7553
+ * This interface was referenced by `HttpsSemiontOrgSchemasConfigJson`'s JSON-Schema
7554
+ * via the `definition` "ArchivistServiceConfig".
7555
+ */
7556
+ interface ArchivistServiceConfig {
7557
+ platform?: ServicePlatformConfig;
7558
+ host?: string;
7559
+ port?: number;
7560
+ image?: string;
7864
7561
  [k: string]: unknown;
7865
7562
  }
7866
7563
  /**
@@ -7875,7 +7572,7 @@ interface SiteConfig {
7875
7572
  /**
7876
7573
  * Primary domain for the site
7877
7574
  */
7878
- domain: string;
7575
+ domain?: string;
7879
7576
  /**
7880
7577
  * Administrator email address
7881
7578
  */
@@ -7950,6 +7647,17 @@ interface EnvironmentConfig {
7950
7647
  * Environment name
7951
7648
  */
7952
7649
  name?: string;
7650
+ /**
7651
+ * The KB's committed identity, staged by the launcher (SINGLE-KB-MOUNT D4). Top-level in the staged file, out of any environment section's reach; never overridable.
7652
+ */
7653
+ kb?: {
7654
+ name: string;
7655
+ domain?: string;
7656
+ /**
7657
+ * Sign-in policy committed in the KB's .semiont/config, staged alongside the identity because the gateway no longer mounts the tree that holds it.
7658
+ */
7659
+ oauthAllowedDomains?: string[];
7660
+ };
7953
7661
  platform?: {
7954
7662
  default?: PlatformType$1;
7955
7663
  [k: string]: unknown;
@@ -8142,11 +7850,16 @@ declare function getAllPlatformTypes(): PlatformType[];
8142
7850
  * and `@semiont/jobs` (the generation prompt builder) can share one derivation. `buildKnowledgeGraph`
8143
7851
  * — which queries the graph DB — stays in make-meaning; this only transforms an already-built graph.
8144
7852
  *
8145
- * Reports the graph as-is (Option A): missing-view citers are kept (the citation edge reflects a real
8146
- * reference event); the only filter is excluding the focal annotation from siblings (an annotation
8147
- * isn't its own sibling). Peer connections are edges out of `mainResourceId`; citations and
8148
- * `annotation-of` edges point INTO it. The graph is a projection of the event log (the system of
8149
- * record), read here because it is the queryable projection at gather time.
7853
+ * Reports the graph as-is (Option A): missing-view citers are kept (the citing annotation reflects a
7854
+ * real reference event; its resource label falls back to the raw id). A citation is its linking
7855
+ * ANNOTATION: an annotation node with `annotation-of` the citing resource and `cites` the focal
7856
+ * resource so citedBy resolves through that pair, deduped per citing resource (several citations
7857
+ * from one document are one citer). Siblings are annotations ON the focal resource
7858
+ * (`annotation-of` → main), excluding the focal annotation — an annotation isn't its own sibling,
7859
+ * and a CITING annotation lives on another resource, so it never was one. Peer connections are
7860
+ * edges out of `mainResourceId`; derivation is structural (endpoints), never a match on the
7861
+ * free-form relationshipType. The graph is a projection of the event log (the system of record),
7862
+ * read here because it is the queryable projection at gather time.
8150
7863
  */
8151
7864
 
8152
7865
  type KnowledgeGraph = components['schemas']['KnowledgeGraph'];
@@ -8171,8 +7884,8 @@ declare function deriveViews(graph: KnowledgeGraph, mainResourceId: string, foca
8171
7884
  *
8172
7885
  * Exists for startup-critical network calls in long-running peers (worker,
8173
7886
  * smelter, weaver): each authenticates against the KS the moment its
8174
- * container starts, and the backend may not be reachable for a few seconds
8175
- * (backend restart, container-network warm-up). Orchestration runs these
7887
+ * container starts, and the gateway may not be reachable for a few seconds
7888
+ * (gateway restart, container-network warm-up). Orchestration runs these
8176
7889
  * processes with `--rm` and no restart policy, so a process that dies on
8177
7890
  * the first `TypeError: fetch failed` is dead for good — the retry window
8178
7891
  * here is the only recovery it gets.
@@ -8195,7 +7908,7 @@ interface RetryAttemptInfo {
8195
7908
  error: unknown;
8196
7909
  }
8197
7910
  /**
8198
- * Default policy for startup connections to the backend: 8 attempts with
7911
+ * Default policy for startup connections to the gateway: 8 attempts with
8199
7912
  * delays 1s, 2s, 4s, then capped at 8s — ~39s of patience before giving up.
8200
7913
  */
8201
7914
  declare const STARTUP_FETCH_RETRY: RetryPolicy;
@@ -8203,7 +7916,7 @@ declare const STARTUP_FETCH_RETRY: RetryPolicy;
8203
7916
  * True for the errors `fetch` throws when the connection itself fails —
8204
7917
  * undici's `TypeError: fetch failed` (ECONNREFUSED, ENOTFOUND, reset,
8205
7918
  * timeout — the socket error rides in `cause`). Deliberately false for
8206
- * HTTP-level failures (a 401 means the backend is UP and rejected us;
7919
+ * HTTP-level failures (a 401 means the gateway is UP and rejected us;
8207
7920
  * retrying won't change its mind) and for programming errors.
8208
7921
  */
8209
7922
  declare function isTransientFetchError(error: unknown): boolean;
@@ -8281,5 +7994,5 @@ declare function getShardPath(key: string, numBuckets?: number): [string, string
8281
7994
  */
8282
7995
  declare const DISCOVERY_URL_PATH = "/discovery/kbs.json";
8283
7996
 
8284
- export { AUTHORABLE_MEDIA_TYPES, BRIDGED_CHANNELS, BUS_OPERATIONS, BusRequestError, CHANNEL_SCHEMAS, CONTEXT_FULL_WEIGHT, CONTEXT_PARTIAL_WEIGHT, ConfigurationError, ConflictError, DEFAULT_CHUNKING_CONFIG, DISCOVERY_URL_PATH, EMBEDDABLE_MEDIA_TYPES, EventBus, GENERATABLE_MEDIA_TYPES, 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, anchorRuns, annotationId, annotationUri, applyBodyOperations, assembleAnnotation, authCode, baseMediaType, baseUrl, buildContentCache, burstBuffer, busLog, busLogEnabled, busRequest, capabilitiesOf, chunkText, cloneToken, createCircleSvg, createFragmentSelector, createPolygonSvg, createRectangleSvg, createTomlConfigLoader, decodeRepresentation, decodeWithCharset, deriveViews, didToAgent, email, entityType, errField, estimateTokens, extensionForMediaType, extractBoundingBox, extractCharset, extractContext, findBestTextMatch, findBodyItem, findClaimSpan, 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, getShardPath, getStorageUri, getSvgSelector, getTargetSelector, getTargetSource, getTextPositionSelector, getTextQuoteSelector, googleCredential, hasTargetSelector, isAnnotationId, isArchived, isArray, isAssessment, isBodyResolved, isBoolean, isComment, isDefined, isDraft, isEventRelatedToAnnotation, isFunction, isGatheredContext, isGenerationJobParams, isHighlight, isNull, isNullish, isNumber, isObject, isReference, isResolvedReference, isResourceId, isStoredEvent, isString, isStubReference, isSupportedMediaType, isTag, isTextRun, isTransientFetchError, isUndefined, isValidEmail, isValidPlatformType, jobId, jumpConsistentHash, kbDid, loadTomlConfig, locate, mcpToken, mediaTypeForExtension, normalizeCoordinates, normalizeText, parseEnvironment, parseFragmentSelector, parseSvgSelector, reconcileSelector, refreshToken, resourceAnnotationUri, resourceId, resourceUri, retryWithBackoff, scaleSvgToNative, searchQuery, serializePerKey, setBusLogTraceIdProvider, softwareToAgent, textExtractionOf, textUnder, userDID, userId, userToAgent, userToDid, uuidV4, validateData, validateEnvironment, validateSvgMarkup, verifyPosition };
8285
- export type { AccessToken, AnchorConfidence, AnchorMethod, AnchorRect, AnchorSelectors, AnchorStrategy, AnchoredText, AnchoringModel, Annotation, AnnotationCategory, AnnotationId, AnnotationUri, AnthropicProviderConfig, AppConfig, AssembledAnnotation, AuthCode, BackendDownload, BackendServiceConfig, BaseUrl, BodyItem, BodyItemIdentity, BodyOperation, BoundingBox, Brand, BridgedChannel, BurstBufferOptions, BusOp, BusOperationKey, BusOperationSpec, BusRequestErrorCode, BusRequestPrimitive, ChunkingConfig, CloneToken, CollaboratorEntry, ConnectionState, ContentCache, ContentFormat, CreateAnnotationInternal, DatabaseServiceConfig, DiscoveredKB, DiscoveryDocument, Email, EmbeddingServiceConfig, EmittableChannel, EntityType, EntityTypeStats, Environment, EnvironmentConfig, EventBase, EventInput, EventMap, EventMetadata, EventName, EventOfType, EventQuery, EventSignature, ExtractionOutcome, FragmentSelector, FrontendServiceConfig, GatheredContext, GenerationJobParams, 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, PdfTextItem, PdfTextRun, 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 };
7997
+ export { AUTHORABLE_MEDIA_TYPES, BRIDGED_CHANNELS, BUS_OPERATIONS, BusRequestError, CHANNEL_SCHEMAS, CONTEXT_FULL_WEIGHT, CONTEXT_PARTIAL_WEIGHT, ConfigurationError, ConflictError, DEFAULT_CHUNKING_CONFIG, DISCOVERY_URL_PATH, EMBEDDABLE_MEDIA_TYPES, EventBus, GENERATABLE_MEDIA_TYPES, 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, anchorRuns, annotationId, annotationUri, applyBodyOperations, assembleAnnotation, authCode, baseMediaType, baseUrl, buildContentCache, burstBuffer, busLog, busLogEnabled, busRequest, capabilitiesOf, chunkText, cloneFormat, cloneToken, createCircleSvg, createFragmentSelector, createPolygonSvg, createRectangleSvg, createTomlConfigLoader, decodeRepresentation, decodeWithCharset, deriveStorageUri, deriveViews, didToAgent, email, entityType, errField, estimateTokens, extensionForMediaType, extractBoundingBox, extractCharset, extractContext, findBestTextMatch, findBodyItem, findClaimSpan, folderOf, 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, getShardPath, getStorageUri, getSvgSelector, getTargetSelector, getTargetSource, getTextPositionSelector, getTextQuoteSelector, googleCredential, hasTargetSelector, isAnnotatable, isAnnotationId, isArchived, isArray, isAssessment, isBodyResolved, isBoolean, isComment, isDefined, isDraft, isEventRelatedToAnnotation, isFunction, isGatheredContext, isGenerationJobParams, isHighlight, isNull, isNullish, isNumber, isObject, isReference, isResolvedReference, isResourceId, isStoredEvent, isString, isStubReference, isSupportedMediaType, isTag, isTextRun, isTransientFetchError, isUndefined, isValidEmail, isValidPlatformType, jobId, jumpConsistentHash, kbDid, loadTomlConfig, locate, mcpToken, mediaTypeForExtension, normalizeCoordinates, normalizeText, parseEnvironment, parseFragmentSelector, parseSvgSelector, proposeStoragePath, reconcileSelector, refreshToken, resourceAnnotationUri, resourceId, resourceUri, retryWithBackoff, scaleSvgToNative, searchQuery, serializePerKey, setBusLogTraceIdProvider, softwareToAgent, storageFileName, textExtractionOf, textUnder, userDID, userId, userToAgent, userToDid, uuidV4, validateData, validateEnvironment, validateSvgMarkup, verifyPosition };
7998
+ export type { AccessToken, AnchorConfidence, AnchorMethod, AnchorRect, AnchorSelectors, AnchorStrategy, AnchoredText, AnchoringModel, Annotation, AnnotationCategory, AnnotationId, AnnotationUri, AnthropicProviderConfig, AppConfig, ArchivistServiceConfig, AssembledAnnotation, AuthCode, BaseUrl, BodyItem, BodyItemIdentity, BodyOperation, BoundingBox, Brand, BridgedChannel, BurstBufferOptions, BusOp, BusOperationKey, BusOperationSpec, BusRequestErrorCode, BusRequestPrimitive, ChunkingConfig, CloneToken, CollaboratorEntry, ConnectionState, ContentCache, ContentFormat, CreateAnnotationInternal, DatabaseServiceConfig, DiscoveredKB, DiscoveryDocument, Email, EmbeddingServiceConfig, EmittableChannel, EntityType, EntityTypeStats, Environment, EnvironmentConfig, EventBase, EventInput, EventMap, EventMetadata, EventName, EventOfType, EventQuery, EventSignature, ExtractionOutcome, FragmentSelector, GatewayServiceConfig, GatheredContext, GenerationJobParams, GoogleAuthRequest, GoogleCredential, GraphConnection, GraphDatabaseType, GraphPath, GraphServiceConfig, GraphViews, HealthCheckResponse, IContentTransport, IGatewayOperations, ITransport, InferenceProvidersConfig, JobId, JobType, ListUsersResponse, LlmSelectorInput, LocaleInfo, Logger, MCPToken, MatchQuality, McpServiceConfig, MediaTypeCapabilities, Motivation, OllamaProviderConfig, PdfCoordinate, PdfTextItem, PdfTextRun, PersistedEvent, PersistedEventType, PlatformType, Point, 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 };