@sanity/client 8.3.0 → 8.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +80 -4
  2. package/dist/{browserUpload-2tz6Sdqp.js → browserUpload-C7PwCs-C.js} +6 -9
  3. package/dist/browserUpload-C7PwCs-C.js.map +1 -0
  4. package/dist/{browserUpload-CwpNx7Vl.js → browserUpload-D-2Rmfjo.js} +6 -9
  5. package/dist/browserUpload-D-2Rmfjo.js.map +1 -0
  6. package/dist/{config-3wiPP-sZ.js → config-CgJ16jET.js} +4 -2
  7. package/dist/config-CgJ16jET.js.map +1 -0
  8. package/dist/csm.js +1 -1
  9. package/dist/{dist-C9ExSk2R.js → dist-C5K_YcEU.js} +3 -2
  10. package/dist/{dist-C9ExSk2R.js.map → dist-C5K_YcEU.js.map} +1 -1
  11. package/dist/index.d.ts +2 -2
  12. package/dist/index.js +1111 -80
  13. package/dist/index.js.map +1 -1
  14. package/dist/index.node.d.ts +3561 -53
  15. package/dist/index.node.js +983 -30
  16. package/dist/index.node.js.map +1 -1
  17. package/dist/media-library.d.ts +1 -1
  18. package/dist/rolldown-runtime-4YWMqDIC.js +9 -0
  19. package/dist/stega.js +2 -2
  20. package/dist/{dist-Z8cIRxoB.js → stegaClean-YZRATV86.js} +19 -2
  21. package/dist/stegaClean-YZRATV86.js.map +1 -0
  22. package/dist/{stegaEncodeSourceMap-DbM2fTN4.js → stegaEncodeSourceMap-CO1HKnm2.js} +2 -2
  23. package/dist/{stegaEncodeSourceMap-DbM2fTN4.js.map → stegaEncodeSourceMap-CO1HKnm2.js.map} +1 -1
  24. package/dist/{stegaEncodeSourceMap-YR3NQ3iz.js → stegaEncodeSourceMap-Dj29aWKG.js} +2 -2
  25. package/dist/{stegaEncodeSourceMap-YR3NQ3iz.js.map → stegaEncodeSourceMap-Dj29aWKG.js.map} +1 -1
  26. package/dist/{types-0x2hPfhJ.d.ts → types-CtHEe8SF.d.ts} +3562 -54
  27. package/package.json +18 -15
  28. package/src/SanityClient.ts +183 -9
  29. package/src/agent/actions/AgentActionsClient.ts +8 -2
  30. package/src/assets/AssetsClient.ts +13 -2
  31. package/src/config.ts +1 -0
  32. package/src/context/ContextClient.ts +1006 -0
  33. package/src/context/openapi.json +5345 -0
  34. package/src/context/reads.ts +206 -0
  35. package/src/context/store.ts +100 -0
  36. package/src/context/types.gen.ts +2428 -0
  37. package/src/context/types.ts +228 -0
  38. package/src/data/dataMethods.ts +4 -1
  39. package/src/data/live.ts +1 -0
  40. package/src/datasets/DatasetsClient.ts +8 -2
  41. package/src/defineCreateClient.ts +1 -0
  42. package/src/http/browserUpload.ts +0 -12
  43. package/src/mediaLibrary/MediaLibraryVideoClient.ts +8 -2
  44. package/src/projects/ProjectsClient.ts +8 -2
  45. package/src/releases/ReleasesClient.ts +8 -2
  46. package/src/types.ts +68 -4
  47. package/src/users/UsersClient.ts +8 -2
  48. package/src/validators.ts +1 -0
  49. package/dist/browserUpload-2tz6Sdqp.js.map +0 -1
  50. package/dist/browserUpload-CwpNx7Vl.js.map +0 -1
  51. package/dist/config-3wiPP-sZ.js.map +0 -1
  52. package/dist/dist-Z8cIRxoB.js.map +0 -1
  53. package/dist/stegaClean-C18wLWau.js +0 -21
  54. package/dist/stegaClean-C18wLWau.js.map +0 -1
@@ -1043,7 +1043,10 @@ type TranslateDocumentSync<T extends Record<string, Any> = Record<string, Any>>
1043
1043
  type TranslateDocumentAsync = TranslateRequestBase & AgentActionAsync;
1044
1044
  /** @beta */
1045
1045
  type TranslateDocument<T extends Record<string, Any> = Record<string, Any>> = TranslateDocumentSync<T> | TranslateDocumentAsync;
1046
- /** @public */
1046
+ /**
1047
+ * @public
1048
+ * @inline
1049
+ */
1047
1050
  declare class ObservableAgentsActionClient {
1048
1051
  #private;
1049
1052
  constructor(client: ObservableSanityClient, httpRequest: HttpRequest);
@@ -1069,7 +1072,10 @@ declare class ObservableAgentsActionClient {
1069
1072
  _id: string;
1070
1073
  } : IdentifiedSanityDocumentStub & DocumentShape>;
1071
1074
  }
1072
- /** @public */
1075
+ /**
1076
+ * @public
1077
+ * @inline
1078
+ */
1073
1079
  declare class AgentActionsClient {
1074
1080
  #private;
1075
1081
  constructor(client: SanityClient, httpRequest: HttpRequest);
@@ -1108,7 +1114,10 @@ declare class AgentActionsClient {
1108
1114
  _id: string;
1109
1115
  } : IdentifiedSanityDocumentStub & DocumentShape>;
1110
1116
  }
1111
- /** @internal */
1117
+ /**
1118
+ * @internal
1119
+ * @inline
1120
+ */
1112
1121
  declare class ObservableAssetsClient {
1113
1122
  #private;
1114
1123
  constructor(client: ObservableSanityClient, httpRequest: HttpRequest);
@@ -1143,7 +1152,10 @@ declare class ObservableAssetsClient {
1143
1152
  document: SanityAssetDocument | SanityImageAssetDocument;
1144
1153
  }>>;
1145
1154
  }
1146
- /** @internal */
1155
+ /**
1156
+ * @internal
1157
+ * @inline
1158
+ */
1147
1159
  declare class AssetsClient {
1148
1160
  #private;
1149
1161
  constructor(client: SanityClient, httpRequest: HttpRequest);
@@ -1684,50 +1696,3280 @@ declare class CollaborationCommentsClient {
1684
1696
  * )
1685
1697
  * ```
1686
1698
  *
1687
- * @param documentId - Document ID, in published, draft or version form
1688
- * @returns Global document reference, of the form `resourceType:resourceId:documentId`
1699
+ * @param documentId - Document ID, in published, draft or version form
1700
+ * @returns Global document reference, of the form `resourceType:resourceId:documentId`
1701
+ */
1702
+ getTargetDocumentRef(documentId: string): CollaborationCommentDocument['target']['document']['_ref'];
1703
+ /**
1704
+ * Fetch comments on the configured resource.
1705
+ *
1706
+ * Takes the same `query` and `params` as `client.fetch`, and switches from a
1707
+ * GET to a POST for queries too large for the request URL in the same way,
1708
+ * but queries the comments endpoint, which accepts none of the query options
1709
+ * `client.fetch` does (`perspective`, `useCdn`, `filterResponse`,
1710
+ * `resultSourceMap`, stega).
1711
+ *
1712
+ * The query runs against the organization store, which is not scoped to
1713
+ * comments, so filter on `_type == "sanity.comment"`.
1714
+ *
1715
+ * @param query - GROQ-query to perform
1716
+ * @param params - Optional query parameters
1717
+ * @param options - Optional request options
1718
+ */
1719
+ fetch<R = unknown>(query: string, params?: QueryParams, options?: CollaborationCommentsRequestOptions): Promise<R>;
1720
+ /**
1721
+ * Listen for changes to comments on the configured resource.
1722
+ *
1723
+ * Mirrors `client.listen(query, params)`, and emits mutation events.
1724
+ *
1725
+ * @param query - GROQ-filter to listen to changes for
1726
+ * @param params - Optional query parameters
1727
+ */
1728
+ listen(query: string, params?: QueryParams): Observable<MutationEvent<CollaborationCommentDocument>>;
1729
+ /**
1730
+ * Listen for changes to comments on the configured resource.
1731
+ *
1732
+ * Mirrors `client.listen(query, params, options)`.
1733
+ *
1734
+ * @param query - GROQ-filter to listen to changes for
1735
+ * @param params - Optional query parameters
1736
+ * @param options - The same listener options `client.listen` takes, forwarded
1737
+ * to the organization store's listener
1738
+ */
1739
+ listen<Opts extends CollaborationCommentsListenOptions>(query: string, params: QueryParams | undefined, options: Opts): Observable<ListenEventFromOptions<CollaborationCommentDocument, Opts>>;
1740
+ }
1741
+ /**
1742
+ * This file was auto-generated by openapi-typescript.
1743
+ * Do not make direct changes to the file.
1744
+ */
1745
+ interface paths {
1746
+ '/{apiVersion}/context/knowledge-bases': {
1747
+ parameters: {
1748
+ query?: never;
1749
+ header?: never;
1750
+ path?: never;
1751
+ cookie?: never;
1752
+ };
1753
+ /**
1754
+ * List knowledge bases
1755
+ * @description Returns the organization's knowledge bases visible to the caller, cursor-paginated.
1756
+ */
1757
+ get: operations['listKnowledgeBases'];
1758
+ put?: never;
1759
+ /**
1760
+ * Create a knowledge base
1761
+ * @description Creates a knowledge base bound to a Sanity dataset, where its content documents will be stored.
1762
+ */
1763
+ post: operations['createKnowledgeBase'];
1764
+ delete?: never;
1765
+ options?: never;
1766
+ head?: never;
1767
+ patch?: never;
1768
+ trace?: never;
1769
+ };
1770
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}': {
1771
+ parameters: {
1772
+ query?: never;
1773
+ header?: never;
1774
+ path?: never;
1775
+ cookie?: never;
1776
+ };
1777
+ /**
1778
+ * Get a knowledge base
1779
+ * @description Returns the knowledge base object: metadata and state. Resolves from the id alone, the public id (`kb...`) or the uuid; access is decided against the knowledge base's own organization, and an id the caller cannot read returns 404. For the built content, use the outline or entries endpoints.
1780
+ */
1781
+ get: operations['getKnowledgeBase'];
1782
+ put?: never;
1783
+ post?: never;
1784
+ /**
1785
+ * Delete a knowledge base
1786
+ * @description Removes the knowledge base and everything it owns: sources, imports, and revisions. Content documents in the bound dataset are deleted best-effort, and stored source files are reclaimed by a separate cleanup.
1787
+ */
1788
+ delete: operations['deleteKnowledgeBase'];
1789
+ options?: never;
1790
+ head?: never;
1791
+ /**
1792
+ * Update a knowledge base
1793
+ * @description Edits the name and description, or the recurring refresh controls (`refreshEnabled`, `refreshFrequency`). Refresh fields return 422 for knowledge bases with no web or dataset source. Disabling pauses the schedule; manual refresh still works.
1794
+ */
1795
+ patch: operations['updateKnowledgeBase'];
1796
+ trace?: never;
1797
+ };
1798
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/build': {
1799
+ parameters: {
1800
+ query?: never;
1801
+ header?: never;
1802
+ path?: never;
1803
+ cookie?: never;
1804
+ };
1805
+ get?: never;
1806
+ put?: never;
1807
+ /**
1808
+ * Trigger a knowledge base build
1809
+ * @description Queues a build over the current corpus and returns a job id right away. If a build is already running, you get that job instead of a second one.
1810
+ */
1811
+ post: operations['buildKnowledgeBase'];
1812
+ delete?: never;
1813
+ options?: never;
1814
+ head?: never;
1815
+ patch?: never;
1816
+ trace?: never;
1817
+ };
1818
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/build/cancel': {
1819
+ parameters: {
1820
+ query?: never;
1821
+ header?: never;
1822
+ path?: never;
1823
+ cookie?: never;
1824
+ };
1825
+ get?: never;
1826
+ put?: never;
1827
+ /**
1828
+ * Cancel an in-progress build
1829
+ * @description Cancels the running build and resets the knowledge base so it can be rebuilt.
1830
+ */
1831
+ post: operations['cancelKnowledgeBaseBuild'];
1832
+ delete?: never;
1833
+ options?: never;
1834
+ head?: never;
1835
+ patch?: never;
1836
+ trace?: never;
1837
+ };
1838
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/entries/{entryPath}/rebuild': {
1839
+ parameters: {
1840
+ query?: never;
1841
+ header?: never;
1842
+ path?: never;
1843
+ cookie?: never;
1844
+ };
1845
+ get?: never;
1846
+ put?: never;
1847
+ /**
1848
+ * Rebuild an entry from its sources
1849
+ * @description Queues a re-write of the entry at this path from its cited sources and the active instructions, and returns a job id right away. The response also names the other entries citing any of the same sources: a source-tied rule affects every page citing that source, so those may change too.
1850
+ */
1851
+ post: operations['rebuildEntry'];
1852
+ delete?: never;
1853
+ options?: never;
1854
+ head?: never;
1855
+ patch?: never;
1856
+ trace?: never;
1857
+ };
1858
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/imports': {
1859
+ parameters: {
1860
+ query?: never;
1861
+ header?: never;
1862
+ path?: never;
1863
+ cookie?: never;
1864
+ };
1865
+ /**
1866
+ * List imports
1867
+ * @description Everything added to this knowledge base, one row per import: a file upload, web crawl, dataset bind, or inline text. Cursor-paginated. The sources each import produced live under `/sources`.
1868
+ */
1869
+ get: operations['listImports'];
1870
+ put?: never;
1871
+ /**
1872
+ * Create an import (text, crawl, or dataset)
1873
+ * @description Adds content, discriminated on `type`: `text` for inline content, `crawl` for a website, `dataset` for a GROQ-filtered Sanity dataset. Each variant queues processing and returns a job id to poll. For files, use `POST .../imports/uploads` instead. Re-adding an existing crawl url returns 409 `webSourceRootConflict`; exceeding the crawl root limit returns 409 `webSourceRootLimitExceeded`. Supports the `Idempotency-Key` header.
1874
+ */
1875
+ post: operations['createImport'];
1876
+ delete?: never;
1877
+ options?: never;
1878
+ head?: never;
1879
+ patch?: never;
1880
+ trace?: never;
1881
+ };
1882
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/imports/uploads': {
1883
+ parameters: {
1884
+ query?: never;
1885
+ header?: never;
1886
+ path?: never;
1887
+ cookie?: never;
1888
+ };
1889
+ get?: never;
1890
+ put?: never;
1891
+ /**
1892
+ * Start a file-upload import
1893
+ * @description Creates a file-upload import and returns a single-use signed upload URL. PUT the file bytes to it, then call `POST .../imports/uploads/{importId}/complete` to start ingestion. The bytes never pass through this API. Supports the `Idempotency-Key` header.
1894
+ */
1895
+ post: operations['startUpload'];
1896
+ delete?: never;
1897
+ options?: never;
1898
+ head?: never;
1899
+ patch?: never;
1900
+ trace?: never;
1901
+ };
1902
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/imports/uploads/{importId}/complete': {
1903
+ parameters: {
1904
+ query?: never;
1905
+ header?: never;
1906
+ path?: never;
1907
+ cookie?: never;
1908
+ };
1909
+ get?: never;
1910
+ put?: never;
1911
+ /**
1912
+ * Complete a file-upload import
1913
+ * @description Call after the file bytes are uploaded to the signed URL. Starts processing and returns a job id to poll.
1914
+ */
1915
+ post: operations['completeUpload'];
1916
+ delete?: never;
1917
+ options?: never;
1918
+ head?: never;
1919
+ patch?: never;
1920
+ trace?: never;
1921
+ };
1922
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/imports/{importId}': {
1923
+ parameters: {
1924
+ query?: never;
1925
+ header?: never;
1926
+ path?: never;
1927
+ cookie?: never;
1928
+ };
1929
+ /**
1930
+ * Get a single import
1931
+ * @description Returns one import with its kind and processing status.
1932
+ */
1933
+ get: operations['getImport'];
1934
+ put?: never;
1935
+ post?: never;
1936
+ /**
1937
+ * Delete an import
1938
+ * @description Removes the import and every source it produced, and cancels its ingest if one is still running. Use it to discard something added by mistake.
1939
+ */
1940
+ delete: operations['deleteImport'];
1941
+ options?: never;
1942
+ head?: never;
1943
+ patch?: never;
1944
+ trace?: never;
1945
+ };
1946
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/imports/{importId}/download': {
1947
+ parameters: {
1948
+ query?: never;
1949
+ header?: never;
1950
+ path?: never;
1951
+ cookie?: never;
1952
+ };
1953
+ /**
1954
+ * Get a download URL for an import
1955
+ * @description Mints a short-lived signed URL serving the import's original bytes as an attachment. Use it before `expiresAt`; the bytes never pass through this API. Only file and text imports carry original bytes; crawls and dataset binds return 409 `importInvalidState`.
1956
+ */
1957
+ get: operations['downloadImport'];
1958
+ put?: never;
1959
+ post?: never;
1960
+ delete?: never;
1961
+ options?: never;
1962
+ head?: never;
1963
+ patch?: never;
1964
+ trace?: never;
1965
+ };
1966
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/instructions': {
1967
+ parameters: {
1968
+ query?: never;
1969
+ header?: never;
1970
+ path?: never;
1971
+ cookie?: never;
1972
+ };
1973
+ get?: never;
1974
+ put?: never;
1975
+ /**
1976
+ * Author a human instruction
1977
+ * @description Creates a standing rule that every future build honors. Tie it to one or more sources with `scopeSourceIds`, or leave it null to apply knowledge-base-wide. Pass `rebuildPaths` to immediately rebuild those entries under the new rule; the response carries the rebuild job id, or null when the rebuild could not start (the rule is saved either way). Pass `verified` after a completed synchronous contradiction check to skip the background one; if the requested rebuild fails to start, the background check runs anyway so the contradicting pages get filed as issues.
1978
+ */
1979
+ post: operations['createInstruction'];
1980
+ delete?: never;
1981
+ options?: never;
1982
+ head?: never;
1983
+ patch?: never;
1984
+ trace?: never;
1985
+ };
1986
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/instructions/{instructionId}': {
1987
+ parameters: {
1988
+ query?: never;
1989
+ header?: never;
1990
+ path?: never;
1991
+ cookie?: never;
1992
+ };
1993
+ get?: never;
1994
+ put?: never;
1995
+ post?: never;
1996
+ /**
1997
+ * Delete an instruction
1998
+ * @description Deletes the rule. Builds stop honoring it from the next run.
1999
+ */
2000
+ delete: operations['deleteInstruction'];
2001
+ options?: never;
2002
+ head?: never;
2003
+ /**
2004
+ * Edit an instruction
2005
+ * @description Edits the statement or scope. The change applies from the next build. Any edit re-affirms the rule: an archived rule returns to active, re-anchored to the sources' current content.
2006
+ */
2007
+ patch: operations['updateInstruction'];
2008
+ trace?: never;
2009
+ };
2010
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/issues/apply': {
2011
+ parameters: {
2012
+ query?: never;
2013
+ header?: never;
2014
+ path?: never;
2015
+ cookie?: never;
2016
+ };
2017
+ get?: never;
2018
+ put?: never;
2019
+ /**
2020
+ * Apply accepted issues to a Context
2021
+ * @description Queues a job that applies accepted issues, rewrites the affected entries, and commits a new revision. Returns a job id. Issue ids that no longer exist are skipped.
2022
+ */
2023
+ post: operations['applyIssues'];
2024
+ delete?: never;
2025
+ options?: never;
2026
+ head?: never;
2027
+ patch?: never;
2028
+ trace?: never;
2029
+ };
2030
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/issues/{issueId}/dismiss': {
2031
+ parameters: {
2032
+ query?: never;
2033
+ header?: never;
2034
+ path?: never;
2035
+ cookie?: never;
2036
+ };
2037
+ get?: never;
2038
+ put?: never;
2039
+ /**
2040
+ * Dismiss an issue
2041
+ * @description Marks the issue rejected. Idempotent: dismissing an issue that already left the queue returns it as-is. 422 `issueDocumentInvalid` when the document was hand-edited into an unverifiable shape; 409 `issueTransitionConflict` on a concurrent edit, safe to retry.
2042
+ */
2043
+ post: operations['dismissIssue'];
2044
+ delete?: never;
2045
+ options?: never;
2046
+ head?: never;
2047
+ patch?: never;
2048
+ trace?: never;
2049
+ };
2050
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/issues/{issueId}/reopen': {
2051
+ parameters: {
2052
+ query?: never;
2053
+ header?: never;
2054
+ path?: never;
2055
+ cookie?: never;
2056
+ };
2057
+ get?: never;
2058
+ put?: never;
2059
+ /**
2060
+ * Reopen an accepted conflict
2061
+ * @description Returns an accepted conflict to triage, clearing its resolution and deleting the instruction it minted. Idempotent for issues that are not accepted conflicts.
2062
+ */
2063
+ post: operations['reopenIssue'];
2064
+ delete?: never;
2065
+ options?: never;
2066
+ head?: never;
2067
+ patch?: never;
2068
+ trace?: never;
2069
+ };
2070
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/issues/{issueId}/resolve': {
2071
+ parameters: {
2072
+ query?: never;
2073
+ header?: never;
2074
+ path?: never;
2075
+ cookie?: never;
2076
+ };
2077
+ get?: never;
2078
+ put?: never;
2079
+ /**
2080
+ * Resolve a conflict issue
2081
+ * @description Settles a conflict with one of two choices: `keep_existing` or `accept_new` (rewrites the entry; the returned `jobId` tracks it). Only conflict issues are resolvable, and a dismissed issue must be reopened first. The decision becomes a standing instruction for every future build; `resolvedBy` records who decided.
2082
+ */
2083
+ post: operations['resolveIssue'];
2084
+ delete?: never;
2085
+ options?: never;
2086
+ head?: never;
2087
+ patch?: never;
2088
+ trace?: never;
2089
+ };
2090
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/jobs/{jobId}': {
2091
+ parameters: {
2092
+ query?: never;
2093
+ header?: never;
2094
+ path?: never;
2095
+ cookie?: never;
2096
+ };
2097
+ /**
2098
+ * Get a job by id
2099
+ * @description Returns the status of a job, such as a build or an import. Job ids come from the endpoint that queued the work.
2100
+ */
2101
+ get: operations['getJob'];
2102
+ put?: never;
2103
+ post?: never;
2104
+ delete?: never;
2105
+ options?: never;
2106
+ head?: never;
2107
+ patch?: never;
2108
+ trace?: never;
2109
+ };
2110
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/refresh': {
2111
+ parameters: {
2112
+ query?: never;
2113
+ header?: never;
2114
+ path?: never;
2115
+ cookie?: never;
2116
+ };
2117
+ get?: never;
2118
+ put?: never;
2119
+ /**
2120
+ * Trigger an incremental refresh
2121
+ * @description Queues a refresh: recrawls each web source, diffs the corpus against the last build, and files change issues. Returns a job id, with `started: false` when a refresh was already in flight. Supports the `Idempotency-Key` header.
2122
+ */
2123
+ post: operations['refreshKnowledgeBase'];
2124
+ delete?: never;
2125
+ options?: never;
2126
+ head?: never;
2127
+ patch?: never;
2128
+ trace?: never;
2129
+ };
2130
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/sources': {
2131
+ parameters: {
2132
+ query?: never;
2133
+ header?: never;
2134
+ path?: never;
2135
+ cookie?: never;
2136
+ };
2137
+ /**
2138
+ * List sources
2139
+ * @description The distilled units builds cite: the pages, files, and documents your imports expanded into. Read-only; add content via `/imports`. Cursor-paginated, filter by `status`.
2140
+ */
2141
+ get: operations['listSources'];
2142
+ put?: never;
2143
+ post?: never;
2144
+ delete?: never;
2145
+ options?: never;
2146
+ head?: never;
2147
+ patch?: never;
2148
+ trace?: never;
2149
+ };
2150
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/sources/{sourceId}': {
2151
+ parameters: {
2152
+ query?: never;
2153
+ header?: never;
2154
+ path?: never;
2155
+ cookie?: never;
2156
+ };
2157
+ /**
2158
+ * Get a single source
2159
+ * @description Returns one source with its metadata and processing status.
2160
+ */
2161
+ get: operations['getSource'];
2162
+ put?: never;
2163
+ post?: never;
2164
+ /**
2165
+ * Delete a source
2166
+ * @description Removes the source immediately. Entries are not modified here — citations to it are cleaned up by the next build or check for changes, where entries left without sources become removal proposals. Human-edited entries are never modified.
2167
+ */
2168
+ delete: operations['deleteSource'];
2169
+ options?: never;
2170
+ head?: never;
2171
+ patch?: never;
2172
+ trace?: never;
2173
+ };
2174
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/sources/{sourceId}/content': {
2175
+ parameters: {
2176
+ query?: never;
2177
+ header?: never;
2178
+ path?: never;
2179
+ cookie?: never;
2180
+ };
2181
+ /**
2182
+ * Read a source's distilled content
2183
+ * @description The distilled markdown builds cite, the same text the pipeline itself reads. Use it to verify an issue's claims against the sources its `citedSourceIds` name. Optional `startLine` and `endLine` (1-indexed, inclusive) fetch just a span. JSON by default; `?format=markdown` returns the raw text. 409 `sourceNotDistilled` until distillation has produced content.
2184
+ */
2185
+ get: operations['getSourceContent'];
2186
+ put?: never;
2187
+ post?: never;
2188
+ delete?: never;
2189
+ options?: never;
2190
+ head?: never;
2191
+ patch?: never;
2192
+ trace?: never;
2193
+ };
2194
+ '/{apiVersion}/context/organizations/{organizationId}/conversations/{threadId}': {
2195
+ parameters: {
2196
+ query?: never;
2197
+ header?: never;
2198
+ path?: never;
2199
+ cookie?: never;
2200
+ };
2201
+ get?: never;
2202
+ /**
2203
+ * Record a conversation
2204
+ * @description Upserts the conversation telemetry for one thread. `threadId` identifies the conversation within your organization — reuse means the same conversation. Messages replace the stored transcript wholesale; `metadata` and model fields only overwrite when present. Last write per thread wins — retries are safe.
2205
+ */
2206
+ put: operations['saveConversation'];
2207
+ post?: never;
2208
+ delete?: never;
2209
+ options?: never;
2210
+ head?: never;
2211
+ /**
2212
+ * Record a classification verdict
2213
+ * @description Records the classification your own model produced for one thread: exactly one of `coreMetrics` (a verdict — the server stamps `classifiedAt` and clears any recorded failure) or `classificationError` (why classification failed; an earlier verdict stays untouched). No revision guard — like the ingest upsert the writer is an automated classifier, so last write wins and a re-classification simply overwrites.
2214
+ */
2215
+ patch: operations['classifyConversation'];
2216
+ trace?: never;
2217
+ };
2218
+ }
2219
+ interface components {
2220
+ schemas: {
2221
+ /** @description A `sanity.context.conversation` document, one agent conversation transcript with its classification, stored in the organization store. Not returned by any endpoint raw; published so GROQ reads can be typed. Write through the conversation ingest and classify endpoints, never with a raw client. */
2222
+ ConversationDoc: {
2223
+ _id: string;
2224
+ _rev: string;
2225
+ /** Format: date-time */
2226
+ _createdAt: string;
2227
+ /** Format: date-time */
2228
+ _updatedAt: string;
2229
+ /** @enum {string} */
2230
+ _type: 'sanity.context.conversation';
2231
+ /** @enum {number} */
2232
+ schemaVersion: 1;
2233
+ organizationId: string;
2234
+ threadId: string;
2235
+ /** @description ConversationMetadata */
2236
+ metadata: {
2237
+ [key: string]: string | string[];
2238
+ } | null;
2239
+ /** Format: date-time */
2240
+ startedAt: string;
2241
+ /** Format: date-time */
2242
+ messagesUpdatedAt: string;
2243
+ messages: {
2244
+ /** @enum {string} */
2245
+ role: 'user' | 'assistant' | 'system' | 'tool';
2246
+ /** @default null */
2247
+ content: string | null;
2248
+ /** @default null */
2249
+ toolName: string | null;
2250
+ /**
2251
+ * @default null
2252
+ * @enum {string|null}
2253
+ */
2254
+ toolType: 'call' | 'result' | null;
2255
+ }[];
2256
+ modelProvider: string | null;
2257
+ modelId: string | null;
2258
+ /** @description ConversationTokenUsage */
2259
+ tokenUsage: {
2260
+ inputTokens?: number;
2261
+ outputTokens?: number;
2262
+ totalTokens?: number;
2263
+ } | null;
2264
+ /** @description ConversationCoreMetrics */
2265
+ coreMetrics: {
2266
+ successScore?: number;
2267
+ /** @enum {string} */
2268
+ sentiment?: 'positive' | 'neutral' | 'negative';
2269
+ contentGaps?: string[];
2270
+ } | null;
2271
+ /** Format: date-time */
2272
+ classifiedAt: string | null;
2273
+ classificationError: string | null;
2274
+ };
2275
+ /** @description A `sanity.context.entry` document, one outline node stored in the bound dataset. Not returned by any endpoint; published so GROQ reads against the dataset can be typed. The entries endpoints serve the validated wire view. */
2276
+ EntryDoc: {
2277
+ _id: string;
2278
+ _rev: string;
2279
+ /** Format: date-time */
2280
+ _createdAt: string;
2281
+ /** Format: date-time */
2282
+ _updatedAt: string;
2283
+ knowledgeBaseId: string;
2284
+ /** @enum {string} */
2285
+ _type: 'sanity.context.entry';
2286
+ schemaVersion: number;
2287
+ revisionId: string;
2288
+ path: string;
2289
+ title: string;
2290
+ tldr?: {
2291
+ scope: string;
2292
+ excludes: string;
2293
+ neighbors?: string[];
2294
+ /** @enum {string} */
2295
+ centrality: 'core' | 'standard' | 'peripheral';
2296
+ };
2297
+ body?: string;
2298
+ topicHeadings?: string[];
2299
+ citations?: {
2300
+ sourceId: string;
2301
+ supports?: string;
2302
+ spans?: {
2303
+ sourceLineStart: number;
2304
+ sourceLineEnd: number;
2305
+ quote: string;
2306
+ }[];
2307
+ claim?: {
2308
+ exact: string;
2309
+ prefix?: string;
2310
+ suffix?: string;
2311
+ };
2312
+ /** @enum {string} */
2313
+ groundingState?: 'drifted';
2314
+ _key: string;
2315
+ /** @enum {string} */
2316
+ _type: 'sanity.context.citation';
2317
+ filename: string;
2318
+ mime?: string;
2319
+ excerpt?: string;
2320
+ }[];
2321
+ /** @enum {string} */
2322
+ status: 'virtual' | 'outlined' | 'filled' | 'stale' | 'generation_failed';
2323
+ generatedAt: string;
2324
+ };
2325
+ /** @description A `sanity.context.instruction` document, a standing decision steering every build, stored in the bound dataset. Not returned by any endpoint; published so GROQ reads against the dataset can be typed. Write through the instructions endpoints, never with a raw client. */
2326
+ InstructionDoc: {
2327
+ _id: string;
2328
+ _rev: string;
2329
+ /** Format: date-time */
2330
+ _createdAt: string;
2331
+ /** Format: date-time */
2332
+ _updatedAt: string;
2333
+ knowledgeBaseId: string;
2334
+ /** @enum {string} */
2335
+ _type: 'sanity.context.instruction';
2336
+ /** @enum {number} */
2337
+ schemaVersion: 1;
2338
+ statement: string;
2339
+ scopeSources: {
2340
+ _key: string;
2341
+ sourceId: string;
2342
+ contentHash: string;
2343
+ }[] | null;
2344
+ /** @enum {string} */
2345
+ status: 'active' | 'archived';
2346
+ archivedAt: string | null;
2347
+ archivedReason: string | null;
2348
+ /** @enum {string} */
2349
+ origin: 'conflict';
2350
+ sourceIssueId: string;
2351
+ } | {
2352
+ _id: string;
2353
+ _rev: string;
2354
+ /** Format: date-time */
2355
+ _createdAt: string;
2356
+ /** Format: date-time */
2357
+ _updatedAt: string;
2358
+ knowledgeBaseId: string;
2359
+ /** @enum {string} */
2360
+ _type: 'sanity.context.instruction';
2361
+ /** @enum {number} */
2362
+ schemaVersion: 1;
2363
+ statement: string;
2364
+ scopeSources: {
2365
+ _key: string;
2366
+ sourceId: string;
2367
+ contentHash: string;
2368
+ }[] | null;
2369
+ /** @enum {string} */
2370
+ status: 'active' | 'archived';
2371
+ archivedAt: string | null;
2372
+ archivedReason: string | null;
2373
+ /** @enum {string} */
2374
+ origin: 'human';
2375
+ /** @enum {string|null} */
2376
+ sourceIssueId: null;
2377
+ };
2378
+ /** @description A `sanity.context.issue` document, a build finding awaiting triage, stored in the bound dataset. Not returned by any endpoint; published so GROQ reads and trigger filters can be typed. Status transitions flow through the issues endpoints, which own the state machine. One invariant the schema cannot express: only a `conflict` issue ever carries a non-null `resolution`. */
2379
+ IssueDoc: {
2380
+ _id: string;
2381
+ _rev: string;
2382
+ /** Format: date-time */
2383
+ _createdAt: string;
2384
+ /** Format: date-time */
2385
+ _updatedAt: string;
2386
+ knowledgeBaseId: string;
2387
+ /** @enum {string} */
2388
+ _type: 'sanity.context.issue';
2389
+ /** @enum {number} */
2390
+ schemaVersion: 1;
2391
+ /** @description IssueContent */
2392
+ content: {
2393
+ /** @enum {string} */
2394
+ kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
2395
+ /** @enum {string} */
2396
+ severity: 'critical' | 'suggestion';
2397
+ scopePath: string;
2398
+ issue: string;
2399
+ suggestedFix: string;
2400
+ citedSourceIds?: string[];
2401
+ claimKey?: string;
2402
+ involvedScopes?: string[];
2403
+ currentClaim?: string;
2404
+ alternativeClaim?: string;
2405
+ /** @enum {string} */
2406
+ currentAuthority?: 'primary' | 'secondary' | 'community';
2407
+ /** @enum {string} */
2408
+ alternativeAuthority?: 'primary' | 'secondary' | 'community';
2409
+ /** @enum {string} */
2410
+ suggestedResolution?: 'keep_existing' | 'accept_new';
2411
+ };
2412
+ fingerprint: string;
2413
+ revisionId: string | null;
2414
+ /** @enum {string} */
2415
+ status: 'open';
2416
+ /** @enum {string|null} */
2417
+ resolution: null;
2418
+ /** @enum {string|null} */
2419
+ resolvedAt: null;
2420
+ /** @enum {string|null} */
2421
+ resolvedBy: null;
2422
+ } | {
2423
+ _id: string;
2424
+ _rev: string;
2425
+ /** Format: date-time */
2426
+ _createdAt: string;
2427
+ /** Format: date-time */
2428
+ _updatedAt: string;
2429
+ knowledgeBaseId: string;
2430
+ /** @enum {string} */
2431
+ _type: 'sanity.context.issue';
2432
+ /** @enum {number} */
2433
+ schemaVersion: 1;
2434
+ /** @description IssueContent */
2435
+ content: {
2436
+ /** @enum {string} */
2437
+ kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
2438
+ /** @enum {string} */
2439
+ severity: 'critical' | 'suggestion';
2440
+ scopePath: string;
2441
+ issue: string;
2442
+ suggestedFix: string;
2443
+ citedSourceIds?: string[];
2444
+ claimKey?: string;
2445
+ involvedScopes?: string[];
2446
+ currentClaim?: string;
2447
+ alternativeClaim?: string;
2448
+ /** @enum {string} */
2449
+ currentAuthority?: 'primary' | 'secondary' | 'community';
2450
+ /** @enum {string} */
2451
+ alternativeAuthority?: 'primary' | 'secondary' | 'community';
2452
+ /** @enum {string} */
2453
+ suggestedResolution?: 'keep_existing' | 'accept_new';
2454
+ };
2455
+ fingerprint: string;
2456
+ revisionId: string | null;
2457
+ /** @enum {string} */
2458
+ status: 'accepted';
2459
+ /** Format: date-time */
2460
+ resolvedAt: string;
2461
+ resolvedBy: {
2462
+ id: string;
2463
+ /** @enum {string} */
2464
+ kind: 'user' | 'robot';
2465
+ } | null;
2466
+ /** @enum {string|null} */
2467
+ resolution: 'keep_existing' | 'accept_new' | null;
2468
+ } | {
2469
+ _id: string;
2470
+ _rev: string;
2471
+ /** Format: date-time */
2472
+ _createdAt: string;
2473
+ /** Format: date-time */
2474
+ _updatedAt: string;
2475
+ knowledgeBaseId: string;
2476
+ /** @enum {string} */
2477
+ _type: 'sanity.context.issue';
2478
+ /** @enum {number} */
2479
+ schemaVersion: 1;
2480
+ /** @description IssueContent */
2481
+ content: {
2482
+ /** @enum {string} */
2483
+ kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
2484
+ /** @enum {string} */
2485
+ severity: 'critical' | 'suggestion';
2486
+ scopePath: string;
2487
+ issue: string;
2488
+ suggestedFix: string;
2489
+ citedSourceIds?: string[];
2490
+ claimKey?: string;
2491
+ involvedScopes?: string[];
2492
+ currentClaim?: string;
2493
+ alternativeClaim?: string;
2494
+ /** @enum {string} */
2495
+ currentAuthority?: 'primary' | 'secondary' | 'community';
2496
+ /** @enum {string} */
2497
+ alternativeAuthority?: 'primary' | 'secondary' | 'community';
2498
+ /** @enum {string} */
2499
+ suggestedResolution?: 'keep_existing' | 'accept_new';
2500
+ };
2501
+ fingerprint: string;
2502
+ revisionId: string | null;
2503
+ /** @enum {string} */
2504
+ status: 'rejected';
2505
+ /** Format: date-time */
2506
+ resolvedAt: string;
2507
+ resolvedBy: {
2508
+ id: string;
2509
+ /** @enum {string} */
2510
+ kind: 'user' | 'robot';
2511
+ } | null;
2512
+ /** @enum {string|null} */
2513
+ resolution: null;
2514
+ };
2515
+ /** @description A `sanity.context.mcp` document, an org-owned MCP endpoint configuration stored in the organization store. Not returned by any endpoint raw; published so GROQ reads and trigger filters can be typed. Write through the mcp endpoints, never with a raw client. The mcp endpoints serve the validated wire view. */
2516
+ McpDoc: {
2517
+ _id: string;
2518
+ _rev: string;
2519
+ /** Format: date-time */
2520
+ _createdAt: string;
2521
+ /** Format: date-time */
2522
+ _updatedAt: string;
2523
+ /** @enum {string} */
2524
+ _type: 'sanity.context.mcp';
2525
+ /** @enum {number} */
2526
+ schemaVersion: 1;
2527
+ organizationId: string;
2528
+ publicId: string;
2529
+ title: string;
2530
+ name: string;
2531
+ sources: ({
2532
+ /** @enum {string} */
2533
+ type: 'knowledge-base';
2534
+ id: string;
2535
+ } | {
2536
+ /** @enum {string} */
2537
+ type: 'dataset';
2538
+ id: string;
2539
+ })[];
2540
+ instructions: string | null;
2541
+ groqFilter: string | null;
2542
+ };
2543
+ };
2544
+ responses: never;
2545
+ parameters: never;
2546
+ requestBodies: never;
2547
+ headers: never;
2548
+ pathItems: never;
2549
+ }
2550
+ interface operations {
2551
+ listKnowledgeBases: {
2552
+ parameters: {
2553
+ query: {
2554
+ cursor?: string;
2555
+ limit?: number;
2556
+ organizationId: string;
2557
+ };
2558
+ header?: never;
2559
+ path: {
2560
+ apiVersion: string;
2561
+ };
2562
+ cookie?: never;
2563
+ };
2564
+ requestBody?: never;
2565
+ responses: {
2566
+ /** @description Default Response */
2567
+ 200: {
2568
+ headers: {
2569
+ [name: string]: unknown;
2570
+ };
2571
+ content: {
2572
+ 'application/json': {
2573
+ data: {
2574
+ /** Format: uuid */
2575
+ id: string;
2576
+ publicId: string;
2577
+ organizationId: string;
2578
+ title: string;
2579
+ description: string;
2580
+ /** @enum {string} */
2581
+ state: 'created' | 'building' | 'ready' | 'review' | 'stale' | 'paused';
2582
+ activeJobId: string | null;
2583
+ isBuilding: boolean;
2584
+ buildStageState: {
2585
+ jobId: string;
2586
+ stages: {
2587
+ /** @enum {string} */
2588
+ id: 'tldr' | 'map' | 'triage' | 'plan' | 'organize' | 'arrange' | 'write' | 'review' | 'polish';
2589
+ /** @enum {string} */
2590
+ status: 'pending' | 'running' | 'done' | 'failed';
2591
+ units?: {
2592
+ /** @enum {string} */
2593
+ unit: 'sources' | 'groups' | 'entries' | 'rounds';
2594
+ done: number;
2595
+ total?: number;
2596
+ };
2597
+ }[];
2598
+ } | null;
2599
+ /** Format: date-time */
2600
+ lastCheckedAt: string | null;
2601
+ /** Format: date-time */
2602
+ lastChangedAt: string | null;
2603
+ hasPendingChanges: boolean;
2604
+ pendingChanges: {
2605
+ added: number;
2606
+ changed: number;
2607
+ removed: number;
2608
+ } | null;
2609
+ pipelineOutdated: boolean;
2610
+ rebuildRecommended: {
2611
+ reason: string;
2612
+ /** Format: date-time */
2613
+ at: string;
2614
+ } | null;
2615
+ hasWebSource: boolean;
2616
+ hasDatasetSource: boolean;
2617
+ sourceUsage: {
2618
+ used: number;
2619
+ limit: number;
2620
+ } | null;
2621
+ refreshEnabled: boolean;
2622
+ /** @enum {string} */
2623
+ refreshFrequency: 'weekly' | 'monthly';
2624
+ /** Format: date-time */
2625
+ refreshNextRunAt: string | null;
2626
+ refreshInFlight: boolean;
2627
+ openIssueCount: number;
2628
+ instructionCount: number;
2629
+ /** Format: date-time */
2630
+ createdAt: string;
2631
+ /** Format: date-time */
2632
+ updatedAt: string;
2633
+ }[];
2634
+ nextCursor: string | null;
2635
+ };
2636
+ };
2637
+ };
2638
+ };
2639
+ };
2640
+ createKnowledgeBase: {
2641
+ parameters: {
2642
+ query?: never;
2643
+ header?: never;
2644
+ path: {
2645
+ apiVersion: string;
2646
+ };
2647
+ cookie?: never;
2648
+ };
2649
+ requestBody: {
2650
+ content: {
2651
+ 'application/json': {
2652
+ organizationId: string;
2653
+ title: string;
2654
+ description: string;
2655
+ };
2656
+ };
2657
+ };
2658
+ responses: {
2659
+ /** @description KnowledgeBase */
2660
+ 201: {
2661
+ headers: {
2662
+ [name: string]: unknown;
2663
+ };
2664
+ content: {
2665
+ 'application/json': {
2666
+ /** Format: uuid */
2667
+ id: string;
2668
+ publicId: string;
2669
+ organizationId: string;
2670
+ title: string;
2671
+ description: string;
2672
+ /** @enum {string} */
2673
+ state: 'created' | 'building' | 'ready' | 'review' | 'stale' | 'paused';
2674
+ activeJobId: string | null;
2675
+ isBuilding: boolean;
2676
+ buildStageState: {
2677
+ jobId: string;
2678
+ stages: {
2679
+ /** @enum {string} */
2680
+ id: 'tldr' | 'map' | 'triage' | 'plan' | 'organize' | 'arrange' | 'write' | 'review' | 'polish';
2681
+ /** @enum {string} */
2682
+ status: 'pending' | 'running' | 'done' | 'failed';
2683
+ units?: {
2684
+ /** @enum {string} */
2685
+ unit: 'sources' | 'groups' | 'entries' | 'rounds';
2686
+ done: number;
2687
+ total?: number;
2688
+ };
2689
+ }[];
2690
+ } | null;
2691
+ /** Format: date-time */
2692
+ lastCheckedAt: string | null;
2693
+ /** Format: date-time */
2694
+ lastChangedAt: string | null;
2695
+ hasPendingChanges: boolean;
2696
+ pendingChanges: {
2697
+ added: number;
2698
+ changed: number;
2699
+ removed: number;
2700
+ } | null;
2701
+ pipelineOutdated: boolean;
2702
+ rebuildRecommended: {
2703
+ reason: string;
2704
+ /** Format: date-time */
2705
+ at: string;
2706
+ } | null;
2707
+ hasWebSource: boolean;
2708
+ hasDatasetSource: boolean;
2709
+ sourceUsage: {
2710
+ used: number;
2711
+ limit: number;
2712
+ } | null;
2713
+ refreshEnabled: boolean;
2714
+ /** @enum {string} */
2715
+ refreshFrequency: 'weekly' | 'monthly';
2716
+ /** Format: date-time */
2717
+ refreshNextRunAt: string | null;
2718
+ refreshInFlight: boolean;
2719
+ openIssueCount: number;
2720
+ instructionCount: number;
2721
+ /** Format: date-time */
2722
+ createdAt: string;
2723
+ /** Format: date-time */
2724
+ updatedAt: string;
2725
+ };
2726
+ };
2727
+ };
2728
+ };
2729
+ };
2730
+ getKnowledgeBase: {
2731
+ parameters: {
2732
+ query?: never;
2733
+ header?: never;
2734
+ path: {
2735
+ knowledgeBaseId: string;
2736
+ };
2737
+ cookie?: never;
2738
+ };
2739
+ requestBody?: never;
2740
+ responses: {
2741
+ /** @description KnowledgeBase */
2742
+ 200: {
2743
+ headers: {
2744
+ [name: string]: unknown;
2745
+ };
2746
+ content: {
2747
+ 'application/json': {
2748
+ /** Format: uuid */
2749
+ id: string;
2750
+ publicId: string;
2751
+ organizationId: string;
2752
+ title: string;
2753
+ description: string;
2754
+ /** @enum {string} */
2755
+ state: 'created' | 'building' | 'ready' | 'review' | 'stale' | 'paused';
2756
+ activeJobId: string | null;
2757
+ isBuilding: boolean;
2758
+ buildStageState: {
2759
+ jobId: string;
2760
+ stages: {
2761
+ /** @enum {string} */
2762
+ id: 'tldr' | 'map' | 'triage' | 'plan' | 'organize' | 'arrange' | 'write' | 'review' | 'polish';
2763
+ /** @enum {string} */
2764
+ status: 'pending' | 'running' | 'done' | 'failed';
2765
+ units?: {
2766
+ /** @enum {string} */
2767
+ unit: 'sources' | 'groups' | 'entries' | 'rounds';
2768
+ done: number;
2769
+ total?: number;
2770
+ };
2771
+ }[];
2772
+ } | null;
2773
+ /** Format: date-time */
2774
+ lastCheckedAt: string | null;
2775
+ /** Format: date-time */
2776
+ lastChangedAt: string | null;
2777
+ hasPendingChanges: boolean;
2778
+ pendingChanges: {
2779
+ added: number;
2780
+ changed: number;
2781
+ removed: number;
2782
+ } | null;
2783
+ pipelineOutdated: boolean;
2784
+ rebuildRecommended: {
2785
+ reason: string;
2786
+ /** Format: date-time */
2787
+ at: string;
2788
+ } | null;
2789
+ hasWebSource: boolean;
2790
+ hasDatasetSource: boolean;
2791
+ sourceUsage: {
2792
+ used: number;
2793
+ limit: number;
2794
+ } | null;
2795
+ refreshEnabled: boolean;
2796
+ /** @enum {string} */
2797
+ refreshFrequency: 'weekly' | 'monthly';
2798
+ /** Format: date-time */
2799
+ refreshNextRunAt: string | null;
2800
+ refreshInFlight: boolean;
2801
+ openIssueCount: number;
2802
+ instructionCount: number;
2803
+ /** Format: date-time */
2804
+ createdAt: string;
2805
+ /** Format: date-time */
2806
+ updatedAt: string;
2807
+ };
2808
+ };
2809
+ };
2810
+ };
2811
+ };
2812
+ deleteKnowledgeBase: {
2813
+ parameters: {
2814
+ query?: never;
2815
+ header?: never;
2816
+ path: {
2817
+ knowledgeBaseId: string;
2818
+ };
2819
+ cookie?: never;
2820
+ };
2821
+ requestBody?: never;
2822
+ responses: {
2823
+ /** @description Default Response */
2824
+ 204: {
2825
+ headers: {
2826
+ [name: string]: unknown;
2827
+ };
2828
+ content: {
2829
+ 'application/json': null;
2830
+ };
2831
+ };
2832
+ };
2833
+ };
2834
+ updateKnowledgeBase: {
2835
+ parameters: {
2836
+ query?: never;
2837
+ header?: never;
2838
+ path: {
2839
+ knowledgeBaseId: string;
2840
+ };
2841
+ cookie?: never;
2842
+ };
2843
+ requestBody: {
2844
+ content: {
2845
+ 'application/json': {
2846
+ title?: string;
2847
+ description?: string;
2848
+ refreshEnabled?: boolean;
2849
+ /** @enum {string} */
2850
+ refreshFrequency?: 'weekly' | 'monthly';
2851
+ };
2852
+ };
2853
+ };
2854
+ responses: {
2855
+ /** @description KnowledgeBase */
2856
+ 200: {
2857
+ headers: {
2858
+ [name: string]: unknown;
2859
+ };
2860
+ content: {
2861
+ 'application/json': {
2862
+ /** Format: uuid */
2863
+ id: string;
2864
+ publicId: string;
2865
+ organizationId: string;
2866
+ title: string;
2867
+ description: string;
2868
+ /** @enum {string} */
2869
+ state: 'created' | 'building' | 'ready' | 'review' | 'stale' | 'paused';
2870
+ activeJobId: string | null;
2871
+ isBuilding: boolean;
2872
+ buildStageState: {
2873
+ jobId: string;
2874
+ stages: {
2875
+ /** @enum {string} */
2876
+ id: 'tldr' | 'map' | 'triage' | 'plan' | 'organize' | 'arrange' | 'write' | 'review' | 'polish';
2877
+ /** @enum {string} */
2878
+ status: 'pending' | 'running' | 'done' | 'failed';
2879
+ units?: {
2880
+ /** @enum {string} */
2881
+ unit: 'sources' | 'groups' | 'entries' | 'rounds';
2882
+ done: number;
2883
+ total?: number;
2884
+ };
2885
+ }[];
2886
+ } | null;
2887
+ /** Format: date-time */
2888
+ lastCheckedAt: string | null;
2889
+ /** Format: date-time */
2890
+ lastChangedAt: string | null;
2891
+ hasPendingChanges: boolean;
2892
+ pendingChanges: {
2893
+ added: number;
2894
+ changed: number;
2895
+ removed: number;
2896
+ } | null;
2897
+ pipelineOutdated: boolean;
2898
+ rebuildRecommended: {
2899
+ reason: string;
2900
+ /** Format: date-time */
2901
+ at: string;
2902
+ } | null;
2903
+ hasWebSource: boolean;
2904
+ hasDatasetSource: boolean;
2905
+ sourceUsage: {
2906
+ used: number;
2907
+ limit: number;
2908
+ } | null;
2909
+ refreshEnabled: boolean;
2910
+ /** @enum {string} */
2911
+ refreshFrequency: 'weekly' | 'monthly';
2912
+ /** Format: date-time */
2913
+ refreshNextRunAt: string | null;
2914
+ refreshInFlight: boolean;
2915
+ openIssueCount: number;
2916
+ instructionCount: number;
2917
+ /** Format: date-time */
2918
+ createdAt: string;
2919
+ /** Format: date-time */
2920
+ updatedAt: string;
2921
+ };
2922
+ };
2923
+ };
2924
+ };
2925
+ };
2926
+ buildKnowledgeBase: {
2927
+ parameters: {
2928
+ query?: never;
2929
+ header?: never;
2930
+ path: {
2931
+ knowledgeBaseId: string;
2932
+ };
2933
+ cookie?: never;
2934
+ };
2935
+ requestBody?: never;
2936
+ responses: {
2937
+ /** @description JobAccepted */
2938
+ 202: {
2939
+ headers: {
2940
+ [name: string]: unknown;
2941
+ };
2942
+ content: {
2943
+ 'application/json': {
2944
+ jobId: string;
2945
+ };
2946
+ };
2947
+ };
2948
+ };
2949
+ };
2950
+ cancelKnowledgeBaseBuild: {
2951
+ parameters: {
2952
+ query?: never;
2953
+ header?: never;
2954
+ path: {
2955
+ knowledgeBaseId: string;
2956
+ };
2957
+ cookie?: never;
2958
+ };
2959
+ requestBody?: never;
2960
+ responses: {
2961
+ /** @description Default Response */
2962
+ 200: {
2963
+ headers: {
2964
+ [name: string]: unknown;
2965
+ };
2966
+ content: {
2967
+ 'application/json': {
2968
+ cancelled: boolean;
2969
+ };
2970
+ };
2971
+ };
2972
+ };
2973
+ };
2974
+ rebuildEntry: {
2975
+ parameters: {
2976
+ query?: never;
2977
+ header?: never;
2978
+ path: {
2979
+ knowledgeBaseId: string;
2980
+ entryPath: string;
2981
+ };
2982
+ cookie?: never;
2983
+ };
2984
+ requestBody?: never;
2985
+ responses: {
2986
+ /** @description RebuildEntryResponse */
2987
+ 202: {
2988
+ headers: {
2989
+ [name: string]: unknown;
2990
+ };
2991
+ content: {
2992
+ 'application/json': {
2993
+ jobId: string;
2994
+ affectedEntries: {
2995
+ id: string;
2996
+ path: string;
2997
+ title: string;
2998
+ }[];
2999
+ };
3000
+ };
3001
+ };
3002
+ };
3003
+ };
3004
+ listImports: {
3005
+ parameters: {
3006
+ query?: {
3007
+ cursor?: string;
3008
+ limit?: number;
3009
+ };
3010
+ header?: never;
3011
+ path: {
3012
+ knowledgeBaseId: string;
3013
+ };
3014
+ cookie?: never;
3015
+ };
3016
+ requestBody?: never;
3017
+ responses: {
3018
+ /** @description Default Response */
3019
+ 200: {
3020
+ headers: {
3021
+ [name: string]: unknown;
3022
+ };
3023
+ content: {
3024
+ 'application/json': {
3025
+ data: {
3026
+ /** Format: uuid */
3027
+ id: string;
3028
+ /** Format: uuid */
3029
+ knowledgeBaseId: string;
3030
+ name: string | null;
3031
+ sizeBytes: number | null;
3032
+ /** @enum {string} */
3033
+ status: 'uploading' | 'processing' | 'complete' | 'failed';
3034
+ /** @enum {string} */
3035
+ sourceKind: 'web' | 'file' | 'dataset';
3036
+ /** Format: date-time */
3037
+ lastCheckedAt: string | null;
3038
+ sourceCount: number;
3039
+ totalDistillableCount: number;
3040
+ distilledCount: number;
3041
+ unsupportedCount: number;
3042
+ statusDetail: string | null;
3043
+ error: string | null;
3044
+ /** @description CrawlOptions */
3045
+ crawlOptions: {
3046
+ includePaths?: string[];
3047
+ excludePaths?: string[];
3048
+ maxDepth?: number;
3049
+ sitemapOnly?: boolean;
3050
+ ignoreQueryParameters?: boolean;
3051
+ pageLimit?: number;
3052
+ } | null;
3053
+ /** @description DatasetSourceBinding */
3054
+ datasetSource: {
3055
+ sanityProjectId: string;
3056
+ sanityDatasetId: string;
3057
+ query: string;
3058
+ } | null;
3059
+ /** @description Actor */
3060
+ createdBy: {
3061
+ id: string | null;
3062
+ displayName: string | null;
3063
+ } | null;
3064
+ /** Format: date-time */
3065
+ createdAt: string;
3066
+ /** Format: date-time */
3067
+ completedAt: string | null;
3068
+ }[];
3069
+ nextCursor: string | null;
3070
+ };
3071
+ };
3072
+ };
3073
+ };
3074
+ };
3075
+ createImport: {
3076
+ parameters: {
3077
+ query?: never;
3078
+ header?: never;
3079
+ path: {
3080
+ knowledgeBaseId: string;
3081
+ };
3082
+ cookie?: never;
3083
+ };
3084
+ /** @description CreateImportInput */
3085
+ requestBody: {
3086
+ content: {
3087
+ 'application/json': {
3088
+ /** @enum {string} */
3089
+ type: 'text';
3090
+ title: string;
3091
+ content: string;
3092
+ /**
3093
+ * @default text/markdown
3094
+ * @enum {string}
3095
+ */
3096
+ contentType?: 'text/markdown' | 'text/plain';
3097
+ } | {
3098
+ /** Format: uri */
3099
+ url: string;
3100
+ /** @description CrawlOptions */
3101
+ options?: {
3102
+ includePaths?: string[];
3103
+ excludePaths?: string[];
3104
+ maxDepth?: number;
3105
+ sitemapOnly?: boolean;
3106
+ ignoreQueryParameters?: boolean;
3107
+ pageLimit?: number;
3108
+ };
3109
+ /** @enum {string} */
3110
+ type: 'crawl';
3111
+ } | {
3112
+ sanityProjectId: string;
3113
+ sanityDatasetId: string;
3114
+ query: string;
3115
+ /** @enum {string} */
3116
+ type: 'dataset';
3117
+ };
3118
+ };
3119
+ };
3120
+ responses: {
3121
+ /** @description JobAccepted */
3122
+ 202: {
3123
+ headers: {
3124
+ [name: string]: unknown;
3125
+ };
3126
+ content: {
3127
+ 'application/json': {
3128
+ jobId: string;
3129
+ };
3130
+ };
3131
+ };
3132
+ };
3133
+ };
3134
+ startUpload: {
3135
+ parameters: {
3136
+ query?: never;
3137
+ header?: never;
3138
+ path: {
3139
+ knowledgeBaseId: string;
3140
+ };
3141
+ cookie?: never;
3142
+ };
3143
+ requestBody: {
3144
+ content: {
3145
+ 'application/json': {
3146
+ filename: string;
3147
+ contentType?: string;
3148
+ };
3149
+ };
3150
+ };
3151
+ responses: {
3152
+ /** @description Default Response */
3153
+ 201: {
3154
+ headers: {
3155
+ [name: string]: unknown;
3156
+ };
3157
+ content: {
3158
+ 'application/json': {
3159
+ /** Format: uuid */
3160
+ importId: string;
3161
+ /** Format: uri */
3162
+ uploadUrl: string;
3163
+ };
3164
+ };
3165
+ };
3166
+ };
3167
+ };
3168
+ completeUpload: {
3169
+ parameters: {
3170
+ query?: never;
3171
+ header?: never;
3172
+ path: {
3173
+ knowledgeBaseId: string;
3174
+ importId: string;
3175
+ };
3176
+ cookie?: never;
3177
+ };
3178
+ requestBody?: never;
3179
+ responses: {
3180
+ /** @description JobAccepted */
3181
+ 202: {
3182
+ headers: {
3183
+ [name: string]: unknown;
3184
+ };
3185
+ content: {
3186
+ 'application/json': {
3187
+ jobId: string;
3188
+ };
3189
+ };
3190
+ };
3191
+ };
3192
+ };
3193
+ getImport: {
3194
+ parameters: {
3195
+ query?: never;
3196
+ header?: never;
3197
+ path: {
3198
+ knowledgeBaseId: string;
3199
+ importId: string;
3200
+ };
3201
+ cookie?: never;
3202
+ };
3203
+ requestBody?: never;
3204
+ responses: {
3205
+ /** @description Import */
3206
+ 200: {
3207
+ headers: {
3208
+ [name: string]: unknown;
3209
+ };
3210
+ content: {
3211
+ 'application/json': {
3212
+ /** Format: uuid */
3213
+ id: string;
3214
+ /** Format: uuid */
3215
+ knowledgeBaseId: string;
3216
+ name: string | null;
3217
+ sizeBytes: number | null;
3218
+ /** @enum {string} */
3219
+ status: 'uploading' | 'processing' | 'complete' | 'failed';
3220
+ /** @enum {string} */
3221
+ sourceKind: 'web' | 'file' | 'dataset';
3222
+ /** Format: date-time */
3223
+ lastCheckedAt: string | null;
3224
+ sourceCount: number;
3225
+ totalDistillableCount: number;
3226
+ distilledCount: number;
3227
+ unsupportedCount: number;
3228
+ statusDetail: string | null;
3229
+ error: string | null;
3230
+ /** @description CrawlOptions */
3231
+ crawlOptions: {
3232
+ includePaths?: string[];
3233
+ excludePaths?: string[];
3234
+ maxDepth?: number;
3235
+ sitemapOnly?: boolean;
3236
+ ignoreQueryParameters?: boolean;
3237
+ pageLimit?: number;
3238
+ } | null;
3239
+ /** @description DatasetSourceBinding */
3240
+ datasetSource: {
3241
+ sanityProjectId: string;
3242
+ sanityDatasetId: string;
3243
+ query: string;
3244
+ } | null;
3245
+ /** @description Actor */
3246
+ createdBy: {
3247
+ id: string | null;
3248
+ displayName: string | null;
3249
+ } | null;
3250
+ /** Format: date-time */
3251
+ createdAt: string;
3252
+ /** Format: date-time */
3253
+ completedAt: string | null;
3254
+ };
3255
+ };
3256
+ };
3257
+ };
3258
+ };
3259
+ deleteImport: {
3260
+ parameters: {
3261
+ query?: never;
3262
+ header?: never;
3263
+ path: {
3264
+ knowledgeBaseId: string;
3265
+ importId: string;
3266
+ };
3267
+ cookie?: never;
3268
+ };
3269
+ requestBody?: never;
3270
+ responses: {
3271
+ /** @description Default Response */
3272
+ 204: {
3273
+ headers: {
3274
+ [name: string]: unknown;
3275
+ };
3276
+ content: {
3277
+ 'application/json': null;
3278
+ };
3279
+ };
3280
+ };
3281
+ };
3282
+ downloadImport: {
3283
+ parameters: {
3284
+ query?: never;
3285
+ header?: never;
3286
+ path: {
3287
+ knowledgeBaseId: string;
3288
+ importId: string;
3289
+ };
3290
+ cookie?: never;
3291
+ };
3292
+ requestBody?: never;
3293
+ responses: {
3294
+ /** @description Default Response */
3295
+ 200: {
3296
+ headers: {
3297
+ [name: string]: unknown;
3298
+ };
3299
+ content: {
3300
+ 'application/json': {
3301
+ /** Format: uri */
3302
+ url: string;
3303
+ /** Format: date-time */
3304
+ expiresAt: string;
3305
+ };
3306
+ };
3307
+ };
3308
+ };
3309
+ };
3310
+ createInstruction: {
3311
+ parameters: {
3312
+ query?: never;
3313
+ header?: never;
3314
+ path: {
3315
+ knowledgeBaseId: string;
3316
+ };
3317
+ cookie?: never;
3318
+ };
3319
+ /** @description CreateInstructionInput */
3320
+ requestBody: {
3321
+ content: {
3322
+ 'application/json': {
3323
+ statement: string;
3324
+ scopeSourceIds?: string[] | null;
3325
+ rebuildPaths?: string[];
3326
+ verified?: boolean;
3327
+ };
3328
+ };
3329
+ };
3330
+ responses: {
3331
+ /** @description CreateInstructionResponse */
3332
+ 201: {
3333
+ headers: {
3334
+ [name: string]: unknown;
3335
+ };
3336
+ content: {
3337
+ 'application/json': {
3338
+ /** @description Instruction */
3339
+ instruction: {
3340
+ id: string;
3341
+ knowledgeBaseId: string;
3342
+ /** @enum {string} */
3343
+ origin: 'conflict' | 'human';
3344
+ /** @enum {string} */
3345
+ status: 'active' | 'archived';
3346
+ statement: string;
3347
+ scopeSourceIds: string[] | null;
3348
+ /** Format: date-time */
3349
+ archivedAt: string | null;
3350
+ archivedReason: string | null;
3351
+ sourceIssueId: string | null;
3352
+ /** @description Actor */
3353
+ createdBy: {
3354
+ id: string | null;
3355
+ displayName: string | null;
3356
+ } | null;
3357
+ /** @description Actor */
3358
+ updatedBy: {
3359
+ id: string | null;
3360
+ displayName: string | null;
3361
+ } | null;
3362
+ /** Format: date-time */
3363
+ createdAt: string;
3364
+ /** Format: date-time */
3365
+ updatedAt: string | null;
3366
+ };
3367
+ rebuildJobId: string | null;
3368
+ };
3369
+ };
3370
+ };
3371
+ };
3372
+ };
3373
+ deleteInstruction: {
3374
+ parameters: {
3375
+ query?: never;
3376
+ header?: never;
3377
+ path: {
3378
+ knowledgeBaseId: string;
3379
+ instructionId: string;
3380
+ };
3381
+ cookie?: never;
3382
+ };
3383
+ requestBody?: never;
3384
+ responses: {
3385
+ /** @description Default Response */
3386
+ 204: {
3387
+ headers: {
3388
+ [name: string]: unknown;
3389
+ };
3390
+ content: {
3391
+ 'application/json': null;
3392
+ };
3393
+ };
3394
+ };
3395
+ };
3396
+ updateInstruction: {
3397
+ parameters: {
3398
+ query?: never;
3399
+ header?: never;
3400
+ path: {
3401
+ knowledgeBaseId: string;
3402
+ instructionId: string;
3403
+ };
3404
+ cookie?: never;
3405
+ };
3406
+ /** @description UpdateInstructionInput */
3407
+ requestBody: {
3408
+ content: {
3409
+ 'application/json': {
3410
+ statement?: string;
3411
+ scopeSourceIds?: string[] | null;
3412
+ };
3413
+ };
3414
+ };
3415
+ responses: {
3416
+ /** @description Instruction */
3417
+ 200: {
3418
+ headers: {
3419
+ [name: string]: unknown;
3420
+ };
3421
+ content: {
3422
+ 'application/json': {
3423
+ id: string;
3424
+ knowledgeBaseId: string;
3425
+ /** @enum {string} */
3426
+ origin: 'conflict' | 'human';
3427
+ /** @enum {string} */
3428
+ status: 'active' | 'archived';
3429
+ statement: string;
3430
+ scopeSourceIds: string[] | null;
3431
+ /** Format: date-time */
3432
+ archivedAt: string | null;
3433
+ archivedReason: string | null;
3434
+ sourceIssueId: string | null;
3435
+ /** @description Actor */
3436
+ createdBy: {
3437
+ id: string | null;
3438
+ displayName: string | null;
3439
+ } | null;
3440
+ /** @description Actor */
3441
+ updatedBy: {
3442
+ id: string | null;
3443
+ displayName: string | null;
3444
+ } | null;
3445
+ /** Format: date-time */
3446
+ createdAt: string;
3447
+ /** Format: date-time */
3448
+ updatedAt: string | null;
3449
+ };
3450
+ };
3451
+ };
3452
+ };
3453
+ };
3454
+ applyIssues: {
3455
+ parameters: {
3456
+ query?: never;
3457
+ header?: never;
3458
+ path: {
3459
+ knowledgeBaseId: string;
3460
+ };
3461
+ cookie?: never;
3462
+ };
3463
+ requestBody: {
3464
+ content: {
3465
+ 'application/json': {
3466
+ issueIds: string[];
3467
+ };
3468
+ };
3469
+ };
3470
+ responses: {
3471
+ /** @description JobAccepted */
3472
+ 202: {
3473
+ headers: {
3474
+ [name: string]: unknown;
3475
+ };
3476
+ content: {
3477
+ 'application/json': {
3478
+ jobId: string;
3479
+ };
3480
+ };
3481
+ };
3482
+ };
3483
+ };
3484
+ dismissIssue: {
3485
+ parameters: {
3486
+ query?: never;
3487
+ header?: never;
3488
+ path: {
3489
+ knowledgeBaseId: string;
3490
+ issueId: string;
3491
+ };
3492
+ cookie?: never;
3493
+ };
3494
+ requestBody?: never;
3495
+ responses: {
3496
+ /** @description Issue */
3497
+ 200: {
3498
+ headers: {
3499
+ [name: string]: unknown;
3500
+ };
3501
+ content: {
3502
+ 'application/json': {
3503
+ id: string;
3504
+ knowledgeBaseId: string;
3505
+ /** @description IssueContent */
3506
+ content: {
3507
+ /** @enum {string} */
3508
+ kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
3509
+ /** @enum {string} */
3510
+ severity: 'critical' | 'suggestion';
3511
+ scopePath: string;
3512
+ issue: string;
3513
+ suggestedFix: string;
3514
+ citedSourceIds?: string[];
3515
+ claimKey?: string;
3516
+ involvedScopes?: string[];
3517
+ currentClaim?: string;
3518
+ alternativeClaim?: string;
3519
+ /** @enum {string} */
3520
+ currentAuthority?: 'primary' | 'secondary' | 'community';
3521
+ /** @enum {string} */
3522
+ alternativeAuthority?: 'primary' | 'secondary' | 'community';
3523
+ /** @enum {string} */
3524
+ suggestedResolution?: 'keep_existing' | 'accept_new';
3525
+ };
3526
+ /** @enum {string} */
3527
+ status: 'open' | 'accepted' | 'rejected';
3528
+ /** @enum {string|null} */
3529
+ resolution: 'keep_existing' | 'accept_new' | null;
3530
+ /** @description IssueResolvedBy */
3531
+ resolvedBy: {
3532
+ id: string;
3533
+ /** @enum {string} */
3534
+ kind: 'user' | 'robot';
3535
+ } | null;
3536
+ /** Format: date-time */
3537
+ createdAt: string;
3538
+ /** Format: date-time */
3539
+ resolvedAt: string | null;
3540
+ };
3541
+ };
3542
+ };
3543
+ };
3544
+ };
3545
+ reopenIssue: {
3546
+ parameters: {
3547
+ query?: never;
3548
+ header?: never;
3549
+ path: {
3550
+ knowledgeBaseId: string;
3551
+ issueId: string;
3552
+ };
3553
+ cookie?: never;
3554
+ };
3555
+ requestBody?: never;
3556
+ responses: {
3557
+ /** @description Issue */
3558
+ 200: {
3559
+ headers: {
3560
+ [name: string]: unknown;
3561
+ };
3562
+ content: {
3563
+ 'application/json': {
3564
+ id: string;
3565
+ knowledgeBaseId: string;
3566
+ /** @description IssueContent */
3567
+ content: {
3568
+ /** @enum {string} */
3569
+ kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
3570
+ /** @enum {string} */
3571
+ severity: 'critical' | 'suggestion';
3572
+ scopePath: string;
3573
+ issue: string;
3574
+ suggestedFix: string;
3575
+ citedSourceIds?: string[];
3576
+ claimKey?: string;
3577
+ involvedScopes?: string[];
3578
+ currentClaim?: string;
3579
+ alternativeClaim?: string;
3580
+ /** @enum {string} */
3581
+ currentAuthority?: 'primary' | 'secondary' | 'community';
3582
+ /** @enum {string} */
3583
+ alternativeAuthority?: 'primary' | 'secondary' | 'community';
3584
+ /** @enum {string} */
3585
+ suggestedResolution?: 'keep_existing' | 'accept_new';
3586
+ };
3587
+ /** @enum {string} */
3588
+ status: 'open' | 'accepted' | 'rejected';
3589
+ /** @enum {string|null} */
3590
+ resolution: 'keep_existing' | 'accept_new' | null;
3591
+ /** @description IssueResolvedBy */
3592
+ resolvedBy: {
3593
+ id: string;
3594
+ /** @enum {string} */
3595
+ kind: 'user' | 'robot';
3596
+ } | null;
3597
+ /** Format: date-time */
3598
+ createdAt: string;
3599
+ /** Format: date-time */
3600
+ resolvedAt: string | null;
3601
+ };
3602
+ };
3603
+ };
3604
+ };
3605
+ };
3606
+ resolveIssue: {
3607
+ parameters: {
3608
+ query?: never;
3609
+ header?: never;
3610
+ path: {
3611
+ knowledgeBaseId: string;
3612
+ issueId: string;
3613
+ };
3614
+ cookie?: never;
3615
+ };
3616
+ requestBody: {
3617
+ content: {
3618
+ 'application/json': {
3619
+ /** @enum {string} */
3620
+ resolution: 'keep_existing' | 'accept_new';
3621
+ };
3622
+ };
3623
+ };
3624
+ responses: {
3625
+ /** @description ResolveIssueResponse */
3626
+ 200: {
3627
+ headers: {
3628
+ [name: string]: unknown;
3629
+ };
3630
+ content: {
3631
+ 'application/json': {
3632
+ /** @description Issue */
3633
+ issue: {
3634
+ id: string;
3635
+ knowledgeBaseId: string;
3636
+ /** @description IssueContent */
3637
+ content: {
3638
+ /** @enum {string} */
3639
+ kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
3640
+ /** @enum {string} */
3641
+ severity: 'critical' | 'suggestion';
3642
+ scopePath: string;
3643
+ issue: string;
3644
+ suggestedFix: string;
3645
+ citedSourceIds?: string[];
3646
+ claimKey?: string;
3647
+ involvedScopes?: string[];
3648
+ currentClaim?: string;
3649
+ alternativeClaim?: string;
3650
+ /** @enum {string} */
3651
+ currentAuthority?: 'primary' | 'secondary' | 'community';
3652
+ /** @enum {string} */
3653
+ alternativeAuthority?: 'primary' | 'secondary' | 'community';
3654
+ /** @enum {string} */
3655
+ suggestedResolution?: 'keep_existing' | 'accept_new';
3656
+ };
3657
+ /** @enum {string} */
3658
+ status: 'open' | 'accepted' | 'rejected';
3659
+ /** @enum {string|null} */
3660
+ resolution: 'keep_existing' | 'accept_new' | null;
3661
+ /** @description IssueResolvedBy */
3662
+ resolvedBy: {
3663
+ id: string;
3664
+ /** @enum {string} */
3665
+ kind: 'user' | 'robot';
3666
+ } | null;
3667
+ /** Format: date-time */
3668
+ createdAt: string;
3669
+ /** Format: date-time */
3670
+ resolvedAt: string | null;
3671
+ };
3672
+ jobId: string | null;
3673
+ };
3674
+ };
3675
+ };
3676
+ };
3677
+ };
3678
+ getJob: {
3679
+ parameters: {
3680
+ query?: never;
3681
+ header?: never;
3682
+ path: {
3683
+ knowledgeBaseId: string;
3684
+ jobId: string;
3685
+ };
3686
+ cookie?: never;
3687
+ };
3688
+ requestBody?: never;
3689
+ responses: {
3690
+ /** @description Job */
3691
+ 200: {
3692
+ headers: {
3693
+ [name: string]: unknown;
3694
+ };
3695
+ content: {
3696
+ 'application/json': {
3697
+ id: string;
3698
+ /** @enum {string} */
3699
+ status: 'pending' | 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled';
3700
+ /** Format: date-time */
3701
+ startedAt: string | null;
3702
+ /** Format: date-time */
3703
+ completedAt: string | null;
3704
+ result?: unknown;
3705
+ error?: string | null;
3706
+ };
3707
+ };
3708
+ };
3709
+ };
3710
+ };
3711
+ refreshKnowledgeBase: {
3712
+ parameters: {
3713
+ query?: never;
3714
+ header?: never;
3715
+ path: {
3716
+ knowledgeBaseId: string;
3717
+ };
3718
+ cookie?: never;
3719
+ };
3720
+ requestBody?: never;
3721
+ responses: {
3722
+ /** @description RefreshAccepted */
3723
+ 202: {
3724
+ headers: {
3725
+ [name: string]: unknown;
3726
+ };
3727
+ content: {
3728
+ 'application/json': {
3729
+ jobId: string;
3730
+ started: boolean;
3731
+ };
3732
+ };
3733
+ };
3734
+ };
3735
+ };
3736
+ listSources: {
3737
+ parameters: {
3738
+ query?: {
3739
+ cursor?: string;
3740
+ limit?: number;
3741
+ status?: 'pending' | 'processing' | 'ready' | 'failed' | 'skipped';
3742
+ importId?: string;
3743
+ ids?: string;
3744
+ };
3745
+ header?: never;
3746
+ path: {
3747
+ knowledgeBaseId: string;
3748
+ };
3749
+ cookie?: never;
3750
+ };
3751
+ requestBody?: never;
3752
+ responses: {
3753
+ /** @description Default Response */
3754
+ 200: {
3755
+ headers: {
3756
+ [name: string]: unknown;
3757
+ };
3758
+ content: {
3759
+ 'application/json': {
3760
+ data: {
3761
+ /** Format: uuid */
3762
+ id: string;
3763
+ /** Format: uuid */
3764
+ knowledgeBaseId: string;
3765
+ filename: string;
3766
+ /** @enum {string} */
3767
+ kind: 'web' | 'file' | 'dataset';
3768
+ sizeBytes: number;
3769
+ /** @enum {string} */
3770
+ status: 'pending' | 'processing' | 'ready' | 'failed' | 'skipped';
3771
+ tldr: string | null;
3772
+ topics: string[] | null;
3773
+ canonicalUrl: string | null;
3774
+ /** Format: date-time */
3775
+ fetchedAt: string | null;
3776
+ /** Format: date-time */
3777
+ distilledAt: string | null;
3778
+ /** Format: date-time */
3779
+ createdAt: string;
3780
+ }[];
3781
+ nextCursor: string | null;
3782
+ };
3783
+ };
3784
+ };
3785
+ };
3786
+ };
3787
+ getSource: {
3788
+ parameters: {
3789
+ query?: never;
3790
+ header?: never;
3791
+ path: {
3792
+ knowledgeBaseId: string;
3793
+ sourceId: string;
3794
+ };
3795
+ cookie?: never;
3796
+ };
3797
+ requestBody?: never;
3798
+ responses: {
3799
+ /** @description Source */
3800
+ 200: {
3801
+ headers: {
3802
+ [name: string]: unknown;
3803
+ };
3804
+ content: {
3805
+ 'application/json': {
3806
+ /** Format: uuid */
3807
+ id: string;
3808
+ /** Format: uuid */
3809
+ knowledgeBaseId: string;
3810
+ filename: string;
3811
+ /** @enum {string} */
3812
+ kind: 'web' | 'file' | 'dataset';
3813
+ sizeBytes: number;
3814
+ /** @enum {string} */
3815
+ status: 'pending' | 'processing' | 'ready' | 'failed' | 'skipped';
3816
+ tldr: string | null;
3817
+ topics: string[] | null;
3818
+ canonicalUrl: string | null;
3819
+ /** Format: date-time */
3820
+ fetchedAt: string | null;
3821
+ /** Format: date-time */
3822
+ distilledAt: string | null;
3823
+ /** Format: date-time */
3824
+ createdAt: string;
3825
+ };
3826
+ };
3827
+ };
3828
+ };
3829
+ };
3830
+ deleteSource: {
3831
+ parameters: {
3832
+ query?: never;
3833
+ header?: never;
3834
+ path: {
3835
+ knowledgeBaseId: string;
3836
+ sourceId: string;
3837
+ };
3838
+ cookie?: never;
3839
+ };
3840
+ requestBody?: never;
3841
+ responses: {
3842
+ /** @description Default Response */
3843
+ 204: {
3844
+ headers: {
3845
+ [name: string]: unknown;
3846
+ };
3847
+ content: {
3848
+ 'application/json': null;
3849
+ };
3850
+ };
3851
+ };
3852
+ };
3853
+ getSourceContent: {
3854
+ parameters: {
3855
+ query?: {
3856
+ /** @description Output representation. `json` (default) returns the structured resource; `markdown` / `plain` return the rendered, LLM-ready text. */
3857
+ format?: 'json' | 'markdown' | 'plain';
3858
+ startLine?: number;
3859
+ endLine?: number;
3860
+ };
3861
+ header?: never;
3862
+ path: {
3863
+ knowledgeBaseId: string;
3864
+ sourceId: string;
3865
+ };
3866
+ cookie?: never;
3867
+ };
3868
+ requestBody?: never;
3869
+ responses: {
3870
+ /** @description SourceContent */
3871
+ 200: {
3872
+ headers: {
3873
+ [name: string]: unknown;
3874
+ };
3875
+ content: {
3876
+ 'application/json': {
3877
+ /** Format: uuid */
3878
+ sourceId: string;
3879
+ content: string;
3880
+ totalLines: number;
3881
+ slice: {
3882
+ start: number;
3883
+ end: number;
3884
+ };
3885
+ };
3886
+ 'text/markdown': string;
3887
+ 'text/plain': string;
3888
+ };
3889
+ };
3890
+ };
3891
+ };
3892
+ saveConversation: {
3893
+ parameters: {
3894
+ query?: never;
3895
+ header?: never;
3896
+ path: {
3897
+ threadId: string;
3898
+ };
3899
+ cookie?: never;
3900
+ };
3901
+ /** @description SaveConversationInput */
3902
+ requestBody: {
3903
+ content: {
3904
+ 'application/json': {
3905
+ messages: {
3906
+ /** @enum {string} */
3907
+ role: 'user' | 'assistant' | 'system' | 'tool';
3908
+ /** @default null */
3909
+ content?: string | null;
3910
+ /** @default null */
3911
+ toolName?: string | null;
3912
+ /**
3913
+ * @default null
3914
+ * @enum {string|null}
3915
+ */
3916
+ toolType?: 'call' | 'result' | null;
3917
+ }[];
3918
+ modelProvider?: string;
3919
+ modelId?: string;
3920
+ /** @description ConversationTokenUsage */
3921
+ tokenUsage?: {
3922
+ inputTokens?: number;
3923
+ outputTokens?: number;
3924
+ totalTokens?: number;
3925
+ };
3926
+ /** @description ConversationMetadata */
3927
+ metadata?: {
3928
+ [key: string]: string | string[];
3929
+ };
3930
+ };
3931
+ };
3932
+ };
3933
+ responses: {
3934
+ /** @description Conversation */
3935
+ 200: {
3936
+ headers: {
3937
+ [name: string]: unknown;
3938
+ };
3939
+ content: {
3940
+ 'application/json': {
3941
+ id: string;
3942
+ threadId: string;
3943
+ /** @description ConversationMetadata */
3944
+ metadata: {
3945
+ [key: string]: string | string[];
3946
+ } | null;
3947
+ /** Format: date-time */
3948
+ startedAt: string;
3949
+ /** Format: date-time */
3950
+ messagesUpdatedAt: string;
3951
+ messages: {
3952
+ /** @enum {string} */
3953
+ role: 'user' | 'assistant' | 'system' | 'tool';
3954
+ /** @default null */
3955
+ content: string | null;
3956
+ /** @default null */
3957
+ toolName: string | null;
3958
+ /**
3959
+ * @default null
3960
+ * @enum {string|null}
3961
+ */
3962
+ toolType: 'call' | 'result' | null;
3963
+ }[];
3964
+ modelProvider: string | null;
3965
+ modelId: string | null;
3966
+ /** @description ConversationTokenUsage */
3967
+ tokenUsage: {
3968
+ inputTokens?: number;
3969
+ outputTokens?: number;
3970
+ totalTokens?: number;
3971
+ } | null;
3972
+ /** @description ConversationCoreMetrics */
3973
+ coreMetrics: {
3974
+ successScore?: number;
3975
+ /** @enum {string} */
3976
+ sentiment?: 'positive' | 'neutral' | 'negative';
3977
+ contentGaps?: string[];
3978
+ } | null;
3979
+ /** Format: date-time */
3980
+ classifiedAt: string | null;
3981
+ classificationError: string | null;
3982
+ /** Format: date-time */
3983
+ createdAt: string;
3984
+ /** Format: date-time */
3985
+ updatedAt: string;
3986
+ };
3987
+ };
3988
+ };
3989
+ };
3990
+ };
3991
+ classifyConversation: {
3992
+ parameters: {
3993
+ query?: never;
3994
+ header?: never;
3995
+ path: {
3996
+ threadId: string;
3997
+ };
3998
+ cookie?: never;
3999
+ };
4000
+ /** @description ClassifyConversationInput */
4001
+ requestBody: {
4002
+ content: {
4003
+ 'application/json': {
4004
+ coreMetrics?: {
4005
+ successScore: number;
4006
+ /** @enum {string} */
4007
+ sentiment: 'positive' | 'neutral' | 'negative';
4008
+ contentGaps: string[];
4009
+ };
4010
+ classificationError?: string;
4011
+ };
4012
+ };
4013
+ };
4014
+ responses: {
4015
+ /** @description Conversation */
4016
+ 200: {
4017
+ headers: {
4018
+ [name: string]: unknown;
4019
+ };
4020
+ content: {
4021
+ 'application/json': {
4022
+ id: string;
4023
+ threadId: string;
4024
+ /** @description ConversationMetadata */
4025
+ metadata: {
4026
+ [key: string]: string | string[];
4027
+ } | null;
4028
+ /** Format: date-time */
4029
+ startedAt: string;
4030
+ /** Format: date-time */
4031
+ messagesUpdatedAt: string;
4032
+ messages: {
4033
+ /** @enum {string} */
4034
+ role: 'user' | 'assistant' | 'system' | 'tool';
4035
+ /** @default null */
4036
+ content: string | null;
4037
+ /** @default null */
4038
+ toolName: string | null;
4039
+ /**
4040
+ * @default null
4041
+ * @enum {string|null}
4042
+ */
4043
+ toolType: 'call' | 'result' | null;
4044
+ }[];
4045
+ modelProvider: string | null;
4046
+ modelId: string | null;
4047
+ /** @description ConversationTokenUsage */
4048
+ tokenUsage: {
4049
+ inputTokens?: number;
4050
+ outputTokens?: number;
4051
+ totalTokens?: number;
4052
+ } | null;
4053
+ /** @description ConversationCoreMetrics */
4054
+ coreMetrics: {
4055
+ successScore?: number;
4056
+ /** @enum {string} */
4057
+ sentiment?: 'positive' | 'neutral' | 'negative';
4058
+ contentGaps?: string[];
4059
+ } | null;
4060
+ /** Format: date-time */
4061
+ classifiedAt: string | null;
4062
+ classificationError: string | null;
4063
+ /** Format: date-time */
4064
+ createdAt: string;
4065
+ /** Format: date-time */
4066
+ updatedAt: string;
4067
+ };
4068
+ };
4069
+ };
4070
+ };
4071
+ };
4072
+ }
4073
+ declare namespace types_d_exports {
4074
+ export { ApplyIssuesParams, ApplyIssuesResponse, ClassifyConversationParams, ContextListenOptions, ContextRequestOptions, Conversation, ConversationDoc, CreateFileImportParams, CreateImportParams, CreateInstructionParams, CreateInstructionResponse, CreateKnowledgeBaseParams, DismissIssueResponse, EditInstructionParams, EditKnowledgeBaseParams, Entry, EntryDoc, Import, ImportDetail, ImportDownloadResponse, ImportsResponse, Instruction, InstructionDoc, IssueDoc, Job, JobAccepted, KnowledgeBase, KnowledgeBasesResponse, McpDoc, RebuildEntryResponse, ReopenIssueResponse, RequestOptions$2 as RequestOptions, ResolveIssueParams, ResolveIssueResponse, SaveConversationParams, Source, SourceContentResponse, SourceDetail, SourcesResponse, StagedUpload, possibleStoreRequestOptions };
4075
+ }
4076
+ /** Options accepted by every Context method. @beta */
4077
+ type RequestOptions$2 = {
4078
+ signal?: AbortSignal;
4079
+ tag?: string;
4080
+ };
4081
+ /** @internal */
4082
+ declare const possibleStoreRequestOptions: readonly ['headers', 'signal', 'tag', 'timeout', 'token'];
4083
+ /**
4084
+ * Request options honored by `context.fetch`.
4085
+ *
4086
+ * @beta
4087
+ */
4088
+ type ContextRequestOptions = Pick<RequestOptions, (typeof possibleStoreRequestOptions)[number]>;
4089
+ /**
4090
+ * Listener options for `context.listen`.
4091
+ *
4092
+ * `includeAllVersions` is left out: Context documents are written by the
4093
+ * Context API with no drafts or versions, so it would never make a
4094
+ * difference.
4095
+ *
4096
+ * @beta
4097
+ */
4098
+ type ContextListenOptions = Omit<ListenOptions, 'includeAllVersions'> | Omit<ResumableListenOptions, 'includeAllVersions'>;
4099
+ /**
4100
+ * A file import. The client stages the upload, PUTs the bytes straight to
4101
+ * storage with a signed URL, and confirms. The Context API never holds the
4102
+ * file content.
4103
+ * @beta
4104
+ */
4105
+ type CreateFileImportParams = {
4106
+ type: 'file';
4107
+ /** Same shapes `assets.upload` accepts, minus node streams: the bytes go
4108
+ * out through `fetch`, which has no portable stream support. */
4109
+ file: Exclude<UploadBody, NodeJS.ReadableStream>;
4110
+ filename: string;
4111
+ contentType?: string;
4112
+ };
4113
+ type KnowledgeBasesPath = '/{apiVersion}/context/knowledge-bases';
4114
+ type ConversationPath = '/{apiVersion}/context/organizations/{organizationId}/conversations/{threadId}';
4115
+ type KnowledgeBasePath = '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}';
4116
+ type ImportsPath = `${KnowledgeBasePath}/imports`;
4117
+ type ImportPath = `${KnowledgeBasePath}/imports/{importId}`;
4118
+ type UploadsPath = `${KnowledgeBasePath}/imports/uploads`;
4119
+ type EntryRebuildPath = `${KnowledgeBasePath}/entries/{entryPath}/rebuild`;
4120
+ type SourcesPath = `${KnowledgeBasePath}/sources`;
4121
+ type SourcePath = `${KnowledgeBasePath}/sources/{sourceId}`;
4122
+ type SourceContentPath = `${KnowledgeBasePath}/sources/{sourceId}/content`;
4123
+ type IssuesApplyPath = `${KnowledgeBasePath}/issues/apply`;
4124
+ type InstructionPath = `${KnowledgeBasePath}/instructions/{instructionId}`;
4125
+ type JobPath = `${KnowledgeBasePath}/jobs/{jobId}`;
4126
+ type IssueResolvePath = `${KnowledgeBasePath}/issues/{issueId}/resolve`;
4127
+ type IssueDismissPath = `${KnowledgeBasePath}/issues/{issueId}/dismiss`;
4128
+ type IssueReopenPath = `${KnowledgeBasePath}/issues/{issueId}/reopen`;
4129
+ type InstructionsPath = `${KnowledgeBasePath}/instructions`;
4130
+ type JsonResponse<T> = T extends {
4131
+ content: {
4132
+ 'application/json': infer R;
4133
+ };
4134
+ } ? R : never;
4135
+ type JsonBody<T> = T extends {
4136
+ requestBody: {
4137
+ content: {
4138
+ 'application/json': infer R;
4139
+ };
4140
+ };
4141
+ } ? R : never;
4142
+ /**
4143
+ * A knowledge base: one buildable body of knowledge inside Context.
4144
+ * @beta
4145
+ */
4146
+ type KnowledgeBase = JsonResponse<paths[KnowledgeBasePath]['get']['responses']['200']>;
4147
+ /**
4148
+ * Parameters for creating a knowledge base.
4149
+ * @beta
4150
+ */
4151
+ type CreateKnowledgeBaseParams = JsonBody<paths[KnowledgeBasesPath]['post']>;
4152
+ /** @beta */
4153
+ type EditKnowledgeBaseParams = JsonBody<paths[KnowledgeBasePath]['patch']>;
4154
+ /**
4155
+ * Parameters for importing content. Discriminated on `type`:
4156
+ * inline text, a website crawl, or a Sanity dataset bind.
4157
+ * @beta
4158
+ */
4159
+ type CreateImportParams = JsonBody<paths[ImportsPath]['post']>;
4160
+ /**
4161
+ * Accepted async work. Poll the job with `jobs.get` until it reaches a
4162
+ * terminal state.
4163
+ * @beta
4164
+ */
4165
+ type JobAccepted = JsonResponse<paths[`${KnowledgeBasePath}/build`]['post']['responses']['202']>;
4166
+ /** @beta */
4167
+ type Job = JsonResponse<paths[JobPath]['get']['responses']['200']>;
4168
+ /**
4169
+ * Accepted entry rebuild: the job to poll plus every entry the rebuild
4170
+ * touches.
4171
+ * @beta
4172
+ */
4173
+ type RebuildEntryResponse = JsonResponse<paths[EntryRebuildPath]['post']['responses']['202']>;
4174
+ /** @beta */
4175
+ type ApplyIssuesParams = JsonBody<paths[IssuesApplyPath]['post']>;
4176
+ /** @beta */
4177
+ type ApplyIssuesResponse = JsonResponse<paths[IssuesApplyPath]['post']['responses']['202']>;
4178
+ /** @beta */
4179
+ type ResolveIssueParams = JsonBody<paths[IssueResolvePath]['post']>;
4180
+ /** @beta */
4181
+ type ResolveIssueResponse = JsonResponse<paths[IssueResolvePath]['post']['responses']['200']>;
4182
+ /** @beta */
4183
+ type DismissIssueResponse = JsonResponse<paths[IssueDismissPath]['post']['responses']['200']>;
4184
+ /** @beta */
4185
+ type ReopenIssueResponse = JsonResponse<paths[IssueReopenPath]['post']['responses']['200']>;
4186
+ /** @beta */
4187
+ type CreateInstructionParams = JsonBody<paths[InstructionsPath]['post']>;
4188
+ /**
4189
+ * A standing instruction, as the instruction endpoints return it.
4190
+ * @beta
4191
+ */
4192
+ type Instruction = JsonResponse<paths[InstructionPath]['patch']['responses']['200']>;
4193
+ /** The created instruction, wrapped the way the create endpoint returns it. @beta */
4194
+ type CreateInstructionResponse = JsonResponse<paths[InstructionsPath]['post']['responses']['201']>;
4195
+ /** @beta */
4196
+ type EditInstructionParams = JsonBody<paths[InstructionPath]['patch']>;
4197
+ /** @beta */
4198
+ type KnowledgeBasesResponse = JsonResponse<paths[KnowledgeBasesPath]['get']['responses']['200']>;
4199
+ /** @beta */
4200
+ type ImportsResponse = JsonResponse<paths[ImportsPath]['get']['responses']['200']>;
4201
+ /** @beta */
4202
+ type Import = ImportsResponse['data'][number];
4203
+ /** @beta */
4204
+ type ImportDetail = JsonResponse<paths[ImportPath]['get']['responses']['200']>;
4205
+ /** @beta */
4206
+ type ImportDownloadResponse = JsonResponse<paths[`${ImportPath}/download`]['get']['responses']['200']>;
4207
+ /**
4208
+ * The staged half of a file upload: PUT the bytes to `uploadUrl`, then
4209
+ * confirm with the complete endpoint. `imports.create({type: 'file'})` does
4210
+ * all of this in one call.
4211
+ * @beta
4212
+ */
4213
+ type StagedUpload = JsonResponse<paths[UploadsPath]['post']['responses']['201']>;
4214
+ /** @beta */
4215
+ type SourcesResponse = JsonResponse<paths[SourcesPath]['get']['responses']['200']>;
4216
+ /** @beta */
4217
+ type Source = SourcesResponse['data'][number];
4218
+ /** @beta */
4219
+ type SourceDetail = JsonResponse<paths[SourcePath]['get']['responses']['200']>;
4220
+ /** @beta */
4221
+ type SourceContentResponse = JsonResponse<paths[SourceContentPath]['get']['responses']['200']>;
4222
+ /**
4223
+ * A recorded conversation: one agent thread's transcript plus the
4224
+ * classification recorded on it. Standalone org-level telemetry — dimensions
4225
+ * (MCP endpoints, app, the customer's own keys) live in the `metadata` bag.
4226
+ * @beta
4227
+ */
4228
+ type Conversation = JsonResponse<paths[ConversationPath]['put']['responses']['200']>;
4229
+ /**
4230
+ * Body for the conversation ingest upsert. Messages replace the stored
4231
+ * transcript wholesale; `metadata` and model fields only overwrite when
4232
+ * present.
4233
+ * @beta
4234
+ */
4235
+ type SaveConversationParams = JsonBody<paths[ConversationPath]['put']>;
4236
+ /** Exactly one of a verdict (`coreMetrics`) or a failure (`classificationError`). @beta */
4237
+ type ClassifyConversationParams = JsonBody<paths[ConversationPath]['patch']>;
4238
+ /**
4239
+ * The raw `sanity.context.entry` document shape, as stored in the
4240
+ * organization's document store. For typing GROQ reads.
4241
+ * @beta
4242
+ */
4243
+ type EntryDoc = components['schemas']['EntryDoc'];
4244
+ /** @beta */
4245
+ type IssueDoc = components['schemas']['IssueDoc'];
4246
+ /** @beta */
4247
+ type InstructionDoc = components['schemas']['InstructionDoc'];
4248
+ /**
4249
+ * The raw `sanity.context.mcp` document shape (an MCP endpoint
4250
+ * configuration), as stored in the organization's document store. For
4251
+ * typing GROQ reads.
4252
+ * @beta
4253
+ */
4254
+ type McpDoc = components['schemas']['McpDoc'];
4255
+ /**
4256
+ * The metadata view of an entry, as `entries.list` projects it. Bodies stay
4257
+ * behind `entries.get` (or a GROQ read through `context.fetch`).
4258
+ * @beta
4259
+ */
4260
+ type Entry = Pick<EntryDoc, '_id' | 'path' | 'title' | 'tldr' | 'status'>;
4261
+ /**
4262
+ * The raw `sanity.context.conversation` document shape, as stored in the
4263
+ * organization's document store. For typing GROQ reads.
4264
+ * @beta
4265
+ */
4266
+ type ConversationDoc = components['schemas']['ConversationDoc'];
4267
+ type ListOptions$1 = RequestOptions$2 & {
4268
+ cursor?: string;
4269
+ limit?: number;
4270
+ };
4271
+ /**
4272
+ * `client.context` — knowledge bases and everything scoped to them.
4273
+ *
4274
+ * Collection-level management (create, list, get, edit, delete) addresses
4275
+ * knowledge bases per call, like `client.projects`. Everything scoped to one
4276
+ * knowledge base (imports, builds, issues, entries, ...) operates on the
4277
+ * client's configured `resource`, like media libraries:
4278
+ *
4279
+ * @example Full lifecycle
4280
+ * ```ts
4281
+ * const created = await client.context.knowledgeBases.create({
4282
+ * organizationId: 'org123',
4283
+ * title: 'Support docs',
4284
+ * description: 'Product docs and troubleshooting guides',
4285
+ * })
4286
+ *
4287
+ * const kb = createClient({
4288
+ * apiVersion: '2026-08-25',
4289
+ * token,
4290
+ * resource: {type: 'knowledge-base', id: created.publicId},
4291
+ * })
4292
+ *
4293
+ * await kb.context.imports.create({type: 'text', title: 'Refund policy', content: refundMd})
4294
+ * const {jobId} = await kb.context.build()
4295
+ * ```
4296
+ *
4297
+ * @beta
4298
+ */
4299
+ declare class ContextClient {
4300
+ #private;
4301
+ constructor(client: SanityClient, httpRequest: HttpRequest);
4302
+ /** The knowledge base collection: management addressed per call. */
4303
+ knowledgeBases: {
4304
+ /** Create a knowledge base. Requires the org-level knowledge-base create grant. */
4305
+ create: (params: CreateKnowledgeBaseParams, options?: RequestOptions$2) => Promise<KnowledgeBase>;
4306
+ /** List the organization's knowledge bases. */
4307
+ list: (params: {
4308
+ organizationId: string;
4309
+ } & ListOptions$1) => Promise<KnowledgeBasesResponse>;
4310
+ /** Fetch a knowledge base by its id. */
4311
+ get: (knowledgeBaseId: string, options?: RequestOptions$2) => Promise<KnowledgeBase>;
4312
+ /** Edit a knowledge base's configuration. */
4313
+ edit: (knowledgeBaseId: string, params: EditKnowledgeBaseParams, options?: RequestOptions$2) => Promise<KnowledgeBase>;
4314
+ /** Delete a knowledge base and its generated content. */
4315
+ delete: (knowledgeBaseId: string, options?: RequestOptions$2) => Promise<void>;
4316
+ };
4317
+ /**
4318
+ * GROQ over the organization's Context documents (conversation telemetry
4319
+ * today; the store holds every Context family and the caller's access
4320
+ * decides what a query returns, so filter on `_type`).
4321
+ *
4322
+ * Requires `context.organizationId` in the client configuration.
4323
+ */
4324
+ fetch<R = unknown>(query: string, params?: QueryParams, options?: ContextRequestOptions): Promise<R>;
4325
+ /**
4326
+ * Listen for changes to the organization's Context documents. Mirrors
4327
+ * `client.listen(query, params, options)` and emits mutation events by
4328
+ * default.
4329
+ */
4330
+ listen<Opts extends ContextListenOptions | undefined = undefined>(query: string, params?: QueryParams, options?: Opts): Observable<ListenEventFromOptions<SanityDocument, Opts>>;
4331
+ /**
4332
+ * Conversation telemetry. `threadId` identifies the conversation within
4333
+ * the organization — reuse means the same conversation. Beyond the canned
4334
+ * `get`, reads go through {@link fetch} and {@link listen} with GROQ
4335
+ * (`_type == "sanity.context.conversation"`).
4336
+ *
4337
+ * Requires `context.organizationId` in the client configuration.
4338
+ */
4339
+ conversations: {
4340
+ /**
4341
+ * Record a conversation. Messages replace the stored transcript
4342
+ * wholesale; `metadata` and model fields only overwrite when present.
4343
+ * Last write per thread wins — retries are safe.
4344
+ */
4345
+ save: (params: {
4346
+ threadId: string;
4347
+ } & SaveConversationParams, options?: RequestOptions$2) => Promise<Conversation>;
4348
+ /**
4349
+ * Record the classification your own model produced for one thread:
4350
+ * exactly one of `coreMetrics` (a verdict) or `classificationError`
4351
+ * (why classification failed).
4352
+ */
4353
+ classify: (params: {
4354
+ threadId: string;
4355
+ } & ClassifyConversationParams, options?: RequestOptions$2) => Promise<Conversation>;
4356
+ /**
4357
+ * One recorded conversation by its thread id, or `null` when the thread
4358
+ * was never recorded. Runs:
4359
+ *
4360
+ * `*[_type == "sanity.context.conversation" && organizationId == $org && threadId == $threadId][0]`
4361
+ *
4362
+ * For anything more, use {@link fetch}.
4363
+ */
4364
+ get: (params: {
4365
+ threadId: string;
4366
+ }, options?: ContextRequestOptions) => Promise<ConversationDoc | null>;
4367
+ };
4368
+ /**
4369
+ * Build the configured knowledge base. The server waits for pending import
4370
+ * processing before assembling, so importing and building back to back is
4371
+ * safe. Track the returned job with {@link jobs}.
4372
+ */
4373
+ build(options?: RequestOptions$2): Promise<JobAccepted>;
4374
+ /** Cancel the running build, if any. */
4375
+ cancelBuild(options?: RequestOptions$2): Promise<{
4376
+ cancelled: boolean;
4377
+ }>;
4378
+ /** Run an incremental refresh: re-check sources and apply what changed. */
4379
+ refresh(options?: RequestOptions$2): Promise<{
4380
+ jobId: string;
4381
+ started: boolean;
4382
+ }>;
4383
+ /** Imports: feed content into the configured knowledge base. */
4384
+ imports: {
4385
+ /**
4386
+ * Import content. One entry point, discriminated on `type`: inline
4387
+ * `text`, a website `crawl`, a Sanity `dataset` bind, or a `file`
4388
+ * upload. Processing queues automatically. The file variant stages the
4389
+ * upload, PUTs the bytes to a signed storage URL, and confirms; the
4390
+ * bytes never pass through the Context API.
4391
+ */
4392
+ create: (params: CreateImportParams | CreateFileImportParams, options?: RequestOptions$2) => Promise<JobAccepted>;
4393
+ list: (params?: ListOptions$1) => Promise<{
4394
+ data: {
4395
+ id: string;
4396
+ knowledgeBaseId: string;
4397
+ name: string | null;
4398
+ sizeBytes: number | null;
4399
+ status: 'uploading' | 'processing' | 'complete' | 'failed';
4400
+ sourceKind: 'web' | 'file' | 'dataset';
4401
+ lastCheckedAt: string | null;
4402
+ sourceCount: number;
4403
+ totalDistillableCount: number;
4404
+ distilledCount: number;
4405
+ unsupportedCount: number;
4406
+ statusDetail: string | null;
4407
+ error: string | null;
4408
+ crawlOptions: {
4409
+ includePaths?: string[];
4410
+ excludePaths?: string[];
4411
+ maxDepth?: number;
4412
+ sitemapOnly?: boolean;
4413
+ ignoreQueryParameters?: boolean;
4414
+ pageLimit?: number;
4415
+ } | null;
4416
+ datasetSource: {
4417
+ sanityProjectId: string;
4418
+ sanityDatasetId: string;
4419
+ query: string;
4420
+ } | null;
4421
+ createdBy: {
4422
+ id: string | null;
4423
+ displayName: string | null;
4424
+ } | null;
4425
+ createdAt: string;
4426
+ completedAt: string | null;
4427
+ }[];
4428
+ nextCursor: string | null;
4429
+ }>;
4430
+ get: (params: {
4431
+ importId: string;
4432
+ }, options?: RequestOptions$2) => Promise<{
4433
+ id: string;
4434
+ knowledgeBaseId: string;
4435
+ name: string | null;
4436
+ sizeBytes: number | null;
4437
+ status: 'uploading' | 'processing' | 'complete' | 'failed';
4438
+ sourceKind: 'web' | 'file' | 'dataset';
4439
+ lastCheckedAt: string | null;
4440
+ sourceCount: number;
4441
+ totalDistillableCount: number;
4442
+ distilledCount: number;
4443
+ unsupportedCount: number;
4444
+ statusDetail: string | null;
4445
+ error: string | null;
4446
+ crawlOptions: {
4447
+ includePaths?: string[];
4448
+ excludePaths?: string[];
4449
+ maxDepth?: number;
4450
+ sitemapOnly?: boolean;
4451
+ ignoreQueryParameters?: boolean;
4452
+ pageLimit?: number;
4453
+ } | null;
4454
+ datasetSource: {
4455
+ sanityProjectId: string;
4456
+ sanityDatasetId: string;
4457
+ query: string;
4458
+ } | null;
4459
+ createdBy: {
4460
+ id: string | null;
4461
+ displayName: string | null;
4462
+ } | null;
4463
+ createdAt: string;
4464
+ completedAt: string | null;
4465
+ }>;
4466
+ /** A short-lived signed URL for the original uploaded bytes. */
4467
+ download: (params: {
4468
+ importId: string;
4469
+ }, options?: RequestOptions$2) => Promise<{
4470
+ url: string;
4471
+ expiresAt: string;
4472
+ }>;
4473
+ delete: (params: {
4474
+ importId: string;
4475
+ }, options?: RequestOptions$2) => Promise<void>;
4476
+ };
4477
+ /** Jobs: poll async work (builds, imports) to a terminal state. */
4478
+ jobs: {
4479
+ get: (params: {
4480
+ jobId: string;
4481
+ }, options?: RequestOptions$2) => Promise<{
4482
+ id: string;
4483
+ status: 'pending' | 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled';
4484
+ startedAt: string | null;
4485
+ completedAt: string | null;
4486
+ result?: unknown;
4487
+ error?: string | null;
4488
+ }>;
4489
+ };
4490
+ /**
4491
+ * Issues: findings from builds awaiting triage. Reads are canned GROQ
4492
+ * queries against the organization's document store; for anything more,
4493
+ * use {@link fetch}. Reads require `context.organizationId` alongside the
4494
+ * knowledge-base `resource` in the client configuration.
4495
+ */
4496
+ issues: {
4497
+ /**
4498
+ * Every issue on the knowledge base, oldest first, optionally narrowed
4499
+ * to one status. Drains keyset pages internally and resolves with the
4500
+ * complete set. Runs:
4501
+ *
4502
+ * `*[_type == "sanity.context.issue" && knowledgeBaseId == $kb && status == $status] | order(_createdAt asc, _id asc)`
4503
+ *
4504
+ * (the status clause only when given). For anything more, use {@link fetch}.
4505
+ */
4506
+ list: (params?: {
4507
+ status?: 'open' | 'accepted' | 'rejected';
4508
+ }, options?: ContextRequestOptions) => Promise<IssueDoc[]>;
4509
+ /**
4510
+ * One issue by its document id, or `null` when it does not exist. Runs:
4511
+ *
4512
+ * `*[_type == "sanity.context.issue" && knowledgeBaseId == $kb && _id == $id][0]`
4513
+ *
4514
+ * For anything more, use {@link fetch}.
4515
+ */
4516
+ get: (params: {
4517
+ issueId: string;
4518
+ }, options?: ContextRequestOptions) => Promise<IssueDoc | null>;
4519
+ /** Resolve a conflict issue. Mints the standing instruction, same as the dashboard. */
4520
+ resolve: (params: {
4521
+ issueId: string;
4522
+ } & ResolveIssueParams, options?: RequestOptions$2) => Promise<{
4523
+ issue: {
4524
+ id: string;
4525
+ knowledgeBaseId: string;
4526
+ content: {
4527
+ kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
4528
+ severity: 'critical' | 'suggestion';
4529
+ scopePath: string;
4530
+ issue: string;
4531
+ suggestedFix: string;
4532
+ citedSourceIds?: string[];
4533
+ claimKey?: string;
4534
+ involvedScopes?: string[];
4535
+ currentClaim?: string;
4536
+ alternativeClaim?: string;
4537
+ currentAuthority?: 'primary' | 'secondary' | 'community';
4538
+ alternativeAuthority?: 'primary' | 'secondary' | 'community';
4539
+ suggestedResolution?: 'keep_existing' | 'accept_new';
4540
+ };
4541
+ status: 'open' | 'accepted' | 'rejected';
4542
+ resolution: 'keep_existing' | 'accept_new' | null;
4543
+ resolvedBy: {
4544
+ id: string;
4545
+ kind: 'user' | 'robot';
4546
+ } | null;
4547
+ createdAt: string;
4548
+ resolvedAt: string | null;
4549
+ };
4550
+ jobId: string | null;
4551
+ }>;
4552
+ dismiss: (params: {
4553
+ issueId: string;
4554
+ }, options?: RequestOptions$2) => Promise<{
4555
+ id: string;
4556
+ knowledgeBaseId: string;
4557
+ content: {
4558
+ kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
4559
+ severity: 'critical' | 'suggestion';
4560
+ scopePath: string;
4561
+ issue: string;
4562
+ suggestedFix: string;
4563
+ citedSourceIds?: string[];
4564
+ claimKey?: string;
4565
+ involvedScopes?: string[];
4566
+ currentClaim?: string;
4567
+ alternativeClaim?: string;
4568
+ currentAuthority?: 'primary' | 'secondary' | 'community';
4569
+ alternativeAuthority?: 'primary' | 'secondary' | 'community';
4570
+ suggestedResolution?: 'keep_existing' | 'accept_new';
4571
+ };
4572
+ status: 'open' | 'accepted' | 'rejected';
4573
+ resolution: 'keep_existing' | 'accept_new' | null;
4574
+ resolvedBy: {
4575
+ id: string;
4576
+ kind: 'user' | 'robot';
4577
+ } | null;
4578
+ createdAt: string;
4579
+ resolvedAt: string | null;
4580
+ }>;
4581
+ reopen: (params: {
4582
+ issueId: string;
4583
+ }, options?: RequestOptions$2) => Promise<{
4584
+ id: string;
4585
+ knowledgeBaseId: string;
4586
+ content: {
4587
+ kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
4588
+ severity: 'critical' | 'suggestion';
4589
+ scopePath: string;
4590
+ issue: string;
4591
+ suggestedFix: string;
4592
+ citedSourceIds?: string[];
4593
+ claimKey?: string;
4594
+ involvedScopes?: string[];
4595
+ currentClaim?: string;
4596
+ alternativeClaim?: string;
4597
+ currentAuthority?: 'primary' | 'secondary' | 'community';
4598
+ alternativeAuthority?: 'primary' | 'secondary' | 'community';
4599
+ suggestedResolution?: 'keep_existing' | 'accept_new';
4600
+ };
4601
+ status: 'open' | 'accepted' | 'rejected';
4602
+ resolution: 'keep_existing' | 'accept_new' | null;
4603
+ resolvedBy: {
4604
+ id: string;
4605
+ kind: 'user' | 'robot';
4606
+ } | null;
4607
+ createdAt: string;
4608
+ resolvedAt: string | null;
4609
+ }>;
4610
+ /** Apply already-accepted issues to the knowledge base in one batch. */
4611
+ apply: (params: ApplyIssuesParams, options?: RequestOptions$2) => Promise<{
4612
+ jobId: string;
4613
+ }>;
4614
+ };
4615
+ /** Instructions: standing decisions that steer every build. */
4616
+ instructions: {
4617
+ create: (params: CreateInstructionParams, options?: RequestOptions$2) => Promise<CreateInstructionResponse>;
4618
+ /**
4619
+ * Every current-schema instruction on the knowledge base, oldest first.
4620
+ * Drains keyset pages internally and resolves with the complete set.
4621
+ * Runs:
4622
+ *
4623
+ * `*[_type == "sanity.context.instruction" && knowledgeBaseId == $kb && schemaVersion == 1] | order(_createdAt asc, _id asc)`
4624
+ *
4625
+ * For anything more, use {@link fetch}. Requires `context.organizationId`
4626
+ * alongside the knowledge-base `resource` in the client configuration.
4627
+ */
4628
+ list: (options?: ContextRequestOptions) => Promise<InstructionDoc[]>;
4629
+ edit: (params: {
4630
+ instructionId: string;
4631
+ } & EditInstructionParams, options?: RequestOptions$2) => Promise<{
4632
+ id: string;
4633
+ knowledgeBaseId: string;
4634
+ origin: 'conflict' | 'human';
4635
+ status: 'active' | 'archived';
4636
+ statement: string;
4637
+ scopeSourceIds: string[] | null;
4638
+ archivedAt: string | null;
4639
+ archivedReason: string | null;
4640
+ sourceIssueId: string | null;
4641
+ createdBy: {
4642
+ id: string | null;
4643
+ displayName: string | null;
4644
+ } | null;
4645
+ updatedBy: {
4646
+ id: string | null;
4647
+ displayName: string | null;
4648
+ } | null;
4649
+ createdAt: string;
4650
+ updatedAt: string | null;
4651
+ }>;
4652
+ delete: (params: {
4653
+ instructionId: string;
4654
+ }, options?: RequestOptions$2) => Promise<void>;
4655
+ };
4656
+ /**
4657
+ * Entries: the built outline, one entry per node. Reads are canned GROQ
4658
+ * queries against the organization's document store; for anything more,
4659
+ * use {@link fetch}. Requires `context.organizationId` alongside the
4660
+ * knowledge-base `resource` in the client configuration.
4661
+ */
4662
+ entries: {
4663
+ /**
4664
+ * Every entry, path-ordered, as a metadata view (`_id`, `path`,
4665
+ * `title`, `tldr`, `status`) with bodies excluded. Drains keyset pages
4666
+ * internally and resolves with the complete set. Runs:
4667
+ *
4668
+ * `*[_type == "sanity.context.entry" && knowledgeBaseId == $kb && path > $after] | order(path asc) [0...200] {_id, path, title, tldr, status}`
4669
+ *
4670
+ * For bodies, use `entries.get` or {@link fetch}.
4671
+ */
4672
+ list: (options?: ContextRequestOptions) => Promise<Entry[]>;
4673
+ /**
4674
+ * One entry with its full body and citations, by outline path (e.g.
4675
+ * `billing/refunds`), or `null` when no entry sits at that path. Runs:
4676
+ *
4677
+ * `*[_type == "sanity.context.entry" && knowledgeBaseId == $kb && path == $path][0]`
4678
+ *
4679
+ * For anything more, use {@link fetch}.
4680
+ */
4681
+ get: (params: {
4682
+ path: string;
4683
+ }, options?: ContextRequestOptions) => Promise<EntryDoc | null>;
4684
+ /**
4685
+ * Rebuild one entry from its already-placed sources, by outline path.
4686
+ * Poll the returned job with {@link jobs}; `affectedEntries` lists every
4687
+ * entry the rebuild touches.
4688
+ */
4689
+ rebuild: (params: {
4690
+ path: string;
4691
+ }, options?: RequestOptions$2) => Promise<RebuildEntryResponse>;
4692
+ };
4693
+ /**
4694
+ * MCP endpoint configurations, org-owned documents read with canned GROQ
4695
+ * queries. Requires `context.organizationId` in the client configuration.
4696
+ */
4697
+ mcpEndpoints: {
4698
+ /**
4699
+ * The organization's MCP endpoint configurations, oldest first. Runs:
4700
+ *
4701
+ * `*[_type == "sanity.context.mcp" && organizationId == $org] | order(_createdAt asc, _id asc) [0...500]`
4702
+ *
4703
+ * For anything more, use {@link fetch}.
4704
+ */
4705
+ list: (options?: ContextRequestOptions) => Promise<McpDoc[]>;
4706
+ /**
4707
+ * One MCP endpoint configuration by its URL name, or `null` when none
4708
+ * carries that name. Runs:
4709
+ *
4710
+ * `*[_type == "sanity.context.mcp" && organizationId == $org && name == $name][0]`
4711
+ *
4712
+ * For anything more, use {@link fetch}.
4713
+ */
4714
+ get: (params: {
4715
+ name: string;
4716
+ }, options?: ContextRequestOptions) => Promise<McpDoc | null>;
4717
+ };
4718
+ /** Sources: the distilled units builds cite. */
4719
+ sources: {
4720
+ /**
4721
+ * List sources, optionally filtered by `status` or the `importId` they
4722
+ * came from. `ids` is a lookup mode: it resolves those exact sources
4723
+ * (e.g. from an entry's citations) and overrides `status` and `cursor`.
4724
+ */
4725
+ list: (params?: {
4726
+ status?: Source['status'];
4727
+ importId?: string;
4728
+ ids?: string[];
4729
+ } & ListOptions$1) => Promise<{
4730
+ data: {
4731
+ id: string;
4732
+ knowledgeBaseId: string;
4733
+ filename: string;
4734
+ kind: 'web' | 'file' | 'dataset';
4735
+ sizeBytes: number;
4736
+ status: 'pending' | 'processing' | 'ready' | 'failed' | 'skipped';
4737
+ tldr: string | null;
4738
+ topics: string[] | null;
4739
+ canonicalUrl: string | null;
4740
+ fetchedAt: string | null;
4741
+ distilledAt: string | null;
4742
+ createdAt: string;
4743
+ }[];
4744
+ nextCursor: string | null;
4745
+ }>;
4746
+ get: (params: {
4747
+ sourceId: string;
4748
+ }, options?: RequestOptions$2) => Promise<{
4749
+ id: string;
4750
+ knowledgeBaseId: string;
4751
+ filename: string;
4752
+ kind: 'web' | 'file' | 'dataset';
4753
+ sizeBytes: number;
4754
+ status: 'pending' | 'processing' | 'ready' | 'failed' | 'skipped';
4755
+ tldr: string | null;
4756
+ topics: string[] | null;
4757
+ canonicalUrl: string | null;
4758
+ fetchedAt: string | null;
4759
+ distilledAt: string | null;
4760
+ createdAt: string;
4761
+ }>;
4762
+ /**
4763
+ * Distilled source content, optionally a line range: the evidence behind
4764
+ * a citation or an issue.
4765
+ */
4766
+ content: (params: {
4767
+ sourceId: string;
4768
+ startLine?: number;
4769
+ endLine?: number;
4770
+ }, options?: RequestOptions$2) => Promise<{
4771
+ sourceId: string;
4772
+ content: string;
4773
+ totalLines: number;
4774
+ slice: {
4775
+ start: number;
4776
+ end: number;
4777
+ };
4778
+ }>;
4779
+ delete: (params: {
4780
+ sourceId: string;
4781
+ }, options?: RequestOptions$2) => Promise<void>;
4782
+ };
4783
+ }
4784
+ /**
4785
+ * Observable counterpart of {@link ContextClient}. Collection-level
4786
+ * methods and the GROQ-backed reads; knowledge-base scoped write
4787
+ * operations are promise-based, so use the promise client
4788
+ * (`client.context`) for those.
4789
+ *
4790
+ * @beta
4791
+ */
4792
+ declare class ObservableContextClient {
4793
+ #private;
4794
+ constructor(client: ObservableSanityClient, httpRequest: HttpRequest);
4795
+ /** The knowledge base collection: management addressed per call. */
4796
+ knowledgeBases: {
4797
+ /** Create a knowledge base. Requires the org-level knowledge-base create grant. */
4798
+ create: (params: CreateKnowledgeBaseParams, options?: RequestOptions$2) => Observable<KnowledgeBase>;
4799
+ /** List the organization's knowledge bases. */
4800
+ list: (params: {
4801
+ organizationId: string;
4802
+ } & ListOptions$1) => Observable<KnowledgeBasesResponse>;
4803
+ /** Fetch a knowledge base by its id. */
4804
+ get: (knowledgeBaseId: string, options?: RequestOptions$2) => Observable<KnowledgeBase>;
4805
+ /** Edit a knowledge base's configuration. */
4806
+ edit: (knowledgeBaseId: string, params: EditKnowledgeBaseParams, options?: RequestOptions$2) => Observable<KnowledgeBase>;
4807
+ /** Delete a knowledge base and its generated content. */
4808
+ delete: (knowledgeBaseId: string, options?: RequestOptions$2) => Observable<void>;
4809
+ };
4810
+ /**
4811
+ * GROQ over the organization's Context documents (conversation telemetry
4812
+ * today; the store holds every Context family and the caller's access
4813
+ * decides what a query returns, so filter on `_type`).
4814
+ *
4815
+ * Requires `context.organizationId` in the client configuration.
1689
4816
  */
1690
- getTargetDocumentRef(documentId: string): CollaborationCommentDocument['target']['document']['_ref'];
4817
+ fetch<R = unknown>(query: string, params?: QueryParams, options?: ContextRequestOptions): Observable<R>;
1691
4818
  /**
1692
- * Fetch comments on the configured resource.
1693
- *
1694
- * Takes the same `query` and `params` as `client.fetch`, and switches from a
1695
- * GET to a POST for queries too large for the request URL in the same way,
1696
- * but queries the comments endpoint, which accepts none of the query options
1697
- * `client.fetch` does (`perspective`, `useCdn`, `filterResponse`,
1698
- * `resultSourceMap`, stega).
1699
- *
1700
- * The query runs against the organization store, which is not scoped to
1701
- * comments, so filter on `_type == "sanity.comment"`.
1702
- *
1703
- * @param query - GROQ-query to perform
1704
- * @param params - Optional query parameters
1705
- * @param options - Optional request options
4819
+ * Listen for changes to the organization's Context documents. Mirrors
4820
+ * `client.listen(query, params, options)` and emits mutation events by
4821
+ * default.
1706
4822
  */
1707
- fetch<R = unknown>(query: string, params?: QueryParams, options?: CollaborationCommentsRequestOptions): Promise<R>;
4823
+ listen<Opts extends ContextListenOptions | undefined = undefined>(query: string, params?: QueryParams, options?: Opts): Observable<ListenEventFromOptions<SanityDocument, Opts>>;
1708
4824
  /**
1709
- * Listen for changes to comments on the configured resource.
1710
- *
1711
- * Mirrors `client.listen(query, params)`, and emits mutation events.
4825
+ * Conversation telemetry. `threadId` identifies the conversation within
4826
+ * the organization — reuse means the same conversation. Beyond the canned
4827
+ * `get`, reads go through {@link fetch} and {@link listen} with GROQ
4828
+ * (`_type == "sanity.context.conversation"`).
1712
4829
  *
1713
- * @param query - GROQ-filter to listen to changes for
1714
- * @param params - Optional query parameters
4830
+ * Requires `context.organizationId` in the client configuration.
1715
4831
  */
1716
- listen(query: string, params?: QueryParams): Observable<MutationEvent<CollaborationCommentDocument>>;
4832
+ conversations: {
4833
+ /**
4834
+ * Record a conversation. Messages replace the stored transcript
4835
+ * wholesale; `metadata` and model fields only overwrite when present.
4836
+ * Last write per thread wins — retries are safe.
4837
+ */
4838
+ save: (params: {
4839
+ threadId: string;
4840
+ } & SaveConversationParams, options?: RequestOptions$2) => Observable<Conversation>;
4841
+ /**
4842
+ * Record the classification your own model produced for one thread:
4843
+ * exactly one of `coreMetrics` (a verdict) or `classificationError`
4844
+ * (why classification failed).
4845
+ */
4846
+ classify: (params: {
4847
+ threadId: string;
4848
+ } & ClassifyConversationParams, options?: RequestOptions$2) => Observable<Conversation>;
4849
+ /**
4850
+ * One recorded conversation by its thread id, or `null` when the thread
4851
+ * was never recorded. Runs:
4852
+ *
4853
+ * `*[_type == "sanity.context.conversation" && organizationId == $org && threadId == $threadId][0]`
4854
+ *
4855
+ * For anything more, use {@link fetch}.
4856
+ */
4857
+ get: (params: {
4858
+ threadId: string;
4859
+ }, options?: ContextRequestOptions) => Observable<ConversationDoc | null>;
4860
+ };
1717
4861
  /**
1718
- * Listen for changes to comments on the configured resource.
1719
- *
1720
- * Mirrors `client.listen(query, params, options)`.
1721
- *
1722
- * @param query - GROQ-filter to listen to changes for
1723
- * @param params - Optional query parameters
1724
- * @param options - The same listener options `client.listen` takes, forwarded
1725
- * to the organization store's listener
4862
+ * Entries: the built outline, one entry per node. Reads are canned GROQ
4863
+ * queries against the organization's document store; for anything more,
4864
+ * use {@link fetch}. Requires `context.organizationId` alongside the
4865
+ * knowledge-base `resource` in the client configuration.
1726
4866
  */
1727
- listen<Opts extends CollaborationCommentsListenOptions>(query: string, params: QueryParams | undefined, options: Opts): Observable<ListenEventFromOptions<CollaborationCommentDocument, Opts>>;
4867
+ entries: {
4868
+ /**
4869
+ * Every entry, path-ordered, as a metadata view (`_id`, `path`,
4870
+ * `title`, `tldr`, `status`) with bodies excluded. Drains keyset pages
4871
+ * internally and emits the complete set. Runs:
4872
+ *
4873
+ * `*[_type == "sanity.context.entry" && knowledgeBaseId == $kb && path > $after] | order(path asc) [0...200] {_id, path, title, tldr, status}`
4874
+ *
4875
+ * For bodies, use `entries.get` or {@link fetch}.
4876
+ */
4877
+ list: (options?: ContextRequestOptions) => Observable<Entry[]>;
4878
+ /**
4879
+ * One entry with its full body and citations, by outline path (e.g.
4880
+ * `billing/refunds`), or `null` when no entry sits at that path. Runs:
4881
+ *
4882
+ * `*[_type == "sanity.context.entry" && knowledgeBaseId == $kb && path == $path][0]`
4883
+ *
4884
+ * For anything more, use {@link fetch}.
4885
+ */
4886
+ get: (params: {
4887
+ path: string;
4888
+ }, options?: ContextRequestOptions) => Observable<EntryDoc | null>;
4889
+ /**
4890
+ * Rebuild one entry from its already-placed sources, by outline path.
4891
+ * Poll the returned job with the promise client's `jobs`;
4892
+ * `affectedEntries` lists every entry the rebuild touches.
4893
+ */
4894
+ rebuild: (params: {
4895
+ path: string;
4896
+ }, options?: RequestOptions$2) => Observable<RebuildEntryResponse>;
4897
+ };
4898
+ /**
4899
+ * Issues: findings from builds awaiting triage. Reads are canned GROQ
4900
+ * queries against the organization's document store; for anything more,
4901
+ * use {@link fetch}. Requires `context.organizationId` alongside the
4902
+ * knowledge-base `resource` in the client configuration.
4903
+ */
4904
+ issues: {
4905
+ /**
4906
+ * Every issue on the knowledge base, oldest first, optionally narrowed
4907
+ * to one status. Drains keyset pages internally and emits the complete
4908
+ * set. Runs:
4909
+ *
4910
+ * `*[_type == "sanity.context.issue" && knowledgeBaseId == $kb && status == $status] | order(_createdAt asc, _id asc)`
4911
+ *
4912
+ * (the status clause only when given). For anything more, use {@link fetch}.
4913
+ */
4914
+ list: (params?: {
4915
+ status?: 'open' | 'accepted' | 'rejected';
4916
+ }, options?: ContextRequestOptions) => Observable<IssueDoc[]>;
4917
+ /**
4918
+ * One issue by its document id, or `null` when it does not exist. Runs:
4919
+ *
4920
+ * `*[_type == "sanity.context.issue" && knowledgeBaseId == $kb && _id == $id][0]`
4921
+ *
4922
+ * For anything more, use {@link fetch}.
4923
+ */
4924
+ get: (params: {
4925
+ issueId: string;
4926
+ }, options?: ContextRequestOptions) => Observable<IssueDoc | null>;
4927
+ };
4928
+ /**
4929
+ * Instructions: standing decisions that steer every build. The canned
4930
+ * GROQ read; writes are promise-based on `client.context`.
4931
+ */
4932
+ instructions: {
4933
+ /**
4934
+ * Every current-schema instruction on the knowledge base, oldest first.
4935
+ * Drains keyset pages internally and emits the complete set. Runs:
4936
+ *
4937
+ * `*[_type == "sanity.context.instruction" && knowledgeBaseId == $kb && schemaVersion == 1] | order(_createdAt asc, _id asc)`
4938
+ *
4939
+ * For anything more, use {@link fetch}. Requires `context.organizationId`
4940
+ * alongside the knowledge-base `resource` in the client configuration.
4941
+ */
4942
+ list: (options?: ContextRequestOptions) => Observable<InstructionDoc[]>;
4943
+ };
4944
+ /**
4945
+ * MCP endpoint configurations, org-owned documents read with canned GROQ
4946
+ * queries. Requires `context.organizationId` in the client configuration.
4947
+ */
4948
+ mcpEndpoints: {
4949
+ /**
4950
+ * The organization's MCP endpoint configurations, oldest first. Runs:
4951
+ *
4952
+ * `*[_type == "sanity.context.mcp" && organizationId == $org] | order(_createdAt asc, _id asc) [0...500]`
4953
+ *
4954
+ * For anything more, use {@link fetch}.
4955
+ */
4956
+ list: (options?: ContextRequestOptions) => Observable<McpDoc[]>;
4957
+ /**
4958
+ * One MCP endpoint configuration by its URL name, or `null` when none
4959
+ * carries that name. Runs:
4960
+ *
4961
+ * `*[_type == "sanity.context.mcp" && organizationId == $org && name == $name][0]`
4962
+ *
4963
+ * For anything more, use {@link fetch}.
4964
+ */
4965
+ get: (params: {
4966
+ name: string;
4967
+ }, options?: ContextRequestOptions) => Observable<McpDoc | null>;
4968
+ };
1728
4969
  }
1729
4970
  /**
1730
4971
  * @public
4972
+ * @inline
1731
4973
  */
1732
4974
  declare class LiveClient {
1733
4975
  #private;
@@ -2105,7 +5347,10 @@ declare class ObservableTransaction extends BaseTransaction {
2105
5347
  */
2106
5348
  patch(patch: ObservablePatch): this;
2107
5349
  }
2108
- /** @internal */
5350
+ /**
5351
+ * @internal
5352
+ * @inline
5353
+ */
2109
5354
  declare class ObservableDatasetsClient {
2110
5355
  #private;
2111
5356
  constructor(client: ObservableSanityClient, httpRequest: HttpRequest);
@@ -2149,7 +5394,10 @@ declare class ObservableDatasetsClient {
2149
5394
  */
2150
5395
  editEmbeddingsSettings(name: string, settings: EmbeddingsSettingsBody): Observable<void>;
2151
5396
  }
2152
- /** @internal */
5397
+ /**
5398
+ * @internal
5399
+ * @inline
5400
+ */
2153
5401
  declare class DatasetsClient {
2154
5402
  #private;
2155
5403
  constructor(client: SanityClient, httpRequest: HttpRequest);
@@ -2289,7 +5537,10 @@ declare class FunctionsClient {
2289
5537
  }): Promise<R>;
2290
5538
  invoke<R = unknown>(functionName: string, request?: InvokeFunctionRequest, options?: InvokeFunctionOptions): Promise<R | undefined>;
2291
5539
  }
2292
- /** @internal */
5540
+ /**
5541
+ * @internal
5542
+ * @inline
5543
+ */
2293
5544
  declare class ObservableMediaLibraryVideoClient {
2294
5545
  #private;
2295
5546
  constructor(client: ObservableSanityClient, httpRequest: HttpRequest);
@@ -2301,7 +5552,10 @@ declare class ObservableMediaLibraryVideoClient {
2301
5552
  */
2302
5553
  getPlaybackInfo(assetIdentifier: MediaLibraryAssetInstanceIdentifier, options?: MediaLibraryPlaybackInfoOptions): Observable<VideoPlaybackInfo>;
2303
5554
  }
2304
- /** @internal */
5555
+ /**
5556
+ * @internal
5557
+ * @inline
5558
+ */
2305
5559
  declare class MediaLibraryVideoClient {
2306
5560
  #private;
2307
5561
  constructor(client: SanityClient, httpRequest: HttpRequest);
@@ -2324,7 +5578,10 @@ type OmittedProjectFields<T extends ListOptions | undefined> = (T extends {
2324
5578
  } ? 'members' : never) | (T extends {
2325
5579
  includeFeatures: false;
2326
5580
  } ? 'features' : never);
2327
- /** @internal */
5581
+ /**
5582
+ * @internal
5583
+ * @inline
5584
+ */
2328
5585
  declare class ObservableProjectsClient {
2329
5586
  #private;
2330
5587
  constructor(client: ObservableSanityClient, httpRequest: HttpRequest);
@@ -2345,7 +5602,10 @@ declare class ObservableProjectsClient {
2345
5602
  */
2346
5603
  getById(projectId: string): Observable<SanityProject>;
2347
5604
  }
2348
- /** @internal */
5605
+ /**
5606
+ * @internal
5607
+ * @inline
5608
+ */
2349
5609
  declare class ProjectsClient {
2350
5610
  #private;
2351
5611
  constructor(client: SanityClient, httpRequest: HttpRequest);
@@ -2366,7 +5626,10 @@ declare class ProjectsClient {
2366
5626
  */
2367
5627
  getById(projectId: string): Promise<SanityProject>;
2368
5628
  }
2369
- /** @public */
5629
+ /**
5630
+ * @public
5631
+ * @inline
5632
+ */
2370
5633
  declare class ObservableReleasesClient {
2371
5634
  #private;
2372
5635
  constructor(client: ObservableSanityClient, httpRequest: HttpRequest);
@@ -2611,7 +5874,10 @@ declare class ObservableReleasesClient {
2611
5874
  releaseId: string;
2612
5875
  }, options?: BaseMutationOptions): Observable<RawQueryResponse<SanityDocument[]>>;
2613
5876
  }
2614
- /** @public */
5877
+ /**
5878
+ * @public
5879
+ * @inline
5880
+ */
2615
5881
  declare class ReleasesClient {
2616
5882
  #private;
2617
5883
  constructor(client: SanityClient, httpRequest: HttpRequest);
@@ -2847,7 +6113,10 @@ declare class ReleasesClient {
2847
6113
  releaseId: string;
2848
6114
  }, options?: BaseMutationOptions): Promise<RawQueryResponse<SanityDocument[]>>;
2849
6115
  }
2850
- /** @public */
6116
+ /**
6117
+ * @public
6118
+ * @inline
6119
+ */
2851
6120
  declare class ObservableUsersClient {
2852
6121
  #private;
2853
6122
  constructor(client: ObservableSanityClient, httpRequest: HttpRequest);
@@ -2858,7 +6127,10 @@ declare class ObservableUsersClient {
2858
6127
  */
2859
6128
  getById<T extends string>(id: T): Observable<T extends 'me' ? CurrentSanityUser : SanityUser>;
2860
6129
  }
2861
- /** @public */
6130
+ /**
6131
+ * @public
6132
+ * @inline
6133
+ */
2862
6134
  declare class UsersClient {
2863
6135
  #private;
2864
6136
  constructor(client: SanityClient, httpRequest: HttpRequest);
@@ -2872,15 +6144,52 @@ declare class UsersClient {
2872
6144
  /** @public */
2873
6145
  declare class ObservableSanityClient {
2874
6146
  #private;
6147
+ /**
6148
+ * Upload, fetch and delete assets (images and files) in the configured dataset
6149
+ *
6150
+ * @category Assets
6151
+ */
2875
6152
  assets: ObservableAssetsClient;
6153
+ /**
6154
+ * Create, list, edit and delete datasets in the configured project
6155
+ *
6156
+ * @category Projects & Datasets
6157
+ */
2876
6158
  datasets: ObservableDatasetsClient;
6159
+ /**
6160
+ * Subscribe to live content updates through the Live Content API
6161
+ *
6162
+ * @category Real-time
6163
+ */
2877
6164
  live: LiveClient;
6165
+ /**
6166
+ * Interact with Media Library assets
6167
+ *
6168
+ * @category Assets
6169
+ */
2878
6170
  mediaLibrary: {
6171
+ /** Upload and manage Media Library video assets */
2879
6172
  video: ObservableMediaLibraryVideoClient;
2880
6173
  };
6174
+ /**
6175
+ * Fetch information about the projects the authenticated user has access to
6176
+ *
6177
+ * @category Projects & Datasets
6178
+ */
2881
6179
  projects: ObservableProjectsClient;
6180
+ /**
6181
+ * Fetch information about users in the configured project
6182
+ *
6183
+ * @category Projects & Datasets
6184
+ */
2882
6185
  users: ObservableUsersClient;
6186
+ /**
6187
+ * Run Agent Actions - AI-powered operations to generate, transform, translate, prompt and patch documents
6188
+ *
6189
+ * @category Agent Actions
6190
+ */
2883
6191
  agent: {
6192
+ /** Run individual Agent Action operations */
2884
6193
  action: ObservableAgentsActionClient;
2885
6194
  };
2886
6195
  collaboration: {
@@ -2888,18 +6197,31 @@ declare class ObservableSanityClient {
2888
6197
  comments: ObservableCollaborationCommentsClient;
2889
6198
  };
2890
6199
  functions: ObservableFunctionsClient;
6200
+ /**
6201
+ * Create and manage content releases and their scheduled publishing
6202
+ *
6203
+ * @category Releases
6204
+ */
2891
6205
  releases: ObservableReleasesClient;
6206
+ /** @beta */
6207
+ context: ObservableContextClient;
2892
6208
  /**
2893
- * Instance properties
6209
+ * Listen to document changes matching a GROQ query, delivered as server-sent events
6210
+ *
6211
+ * @category Real-time
2894
6212
  */
2895
6213
  listen: typeof _listen;
2896
6214
  constructor(httpRequest: HttpRequest, config?: ClientConfig);
2897
6215
  /**
2898
6216
  * Clone the client - returns a new instance
6217
+ *
6218
+ * @category Configuration
2899
6219
  */
2900
6220
  clone(): ObservableSanityClient;
2901
6221
  /**
2902
6222
  * Returns the current client configuration
6223
+ *
6224
+ * @category Configuration
2903
6225
  */
2904
6226
  config(): InitializedClientConfig;
2905
6227
  /**
@@ -2909,12 +6231,16 @@ declare class ObservableSanityClient {
2909
6231
  /**
2910
6232
  * Clone the client with a new (partial) configuration.
2911
6233
  *
6234
+ * @category Configuration
6235
+ *
2912
6236
  * @param newConfig - New client configuration properties, shallowly merged with existing configuration
2913
6237
  */
2914
6238
  withConfig(newConfig?: Partial<ClientConfig>): ObservableSanityClient;
2915
6239
  /**
2916
6240
  * Perform a GROQ-query against the configured dataset.
2917
6241
  *
6242
+ * @category Querying
6243
+ *
2918
6244
  * @param query - GROQ-query to perform
2919
6245
  */
2920
6246
  fetch<R = Any, Q extends QueryWithoutParams = QueryWithoutParams, const G extends string = string>(query: G, params?: Q | QueryWithoutParams): Observable<ClientReturn<G, R>>;
@@ -2945,6 +6271,8 @@ declare class ObservableSanityClient {
2945
6271
  /**
2946
6272
  * Fetch a single document with the given ID.
2947
6273
  *
6274
+ * @category Querying
6275
+ *
2948
6276
  * @param id - Document ID to fetch
2949
6277
  * @param options - Request options
2950
6278
  */
@@ -2972,6 +6300,8 @@ declare class ObservableSanityClient {
2972
6300
  * The order/position of documents is preserved based on the original array of IDs.
2973
6301
  * If any of the documents are missing, they will be replaced by a `null` entry in the returned array
2974
6302
  *
6303
+ * @category Querying
6304
+ *
2975
6305
  * @param ids - Document IDs to fetch
2976
6306
  * @param options - Request options
2977
6307
  */
@@ -2982,6 +6312,8 @@ declare class ObservableSanityClient {
2982
6312
  * Convenient and bandwidth efficient method of checking wether a set of document IDs exists.
2983
6313
  * Returns a set of the IDs that exist.
2984
6314
  *
6315
+ * @category Querying
6316
+ *
2985
6317
  * @param ids - Document IDs to check
2986
6318
  * @param options - Request options
2987
6319
  */
@@ -2993,6 +6325,8 @@ declare class ObservableSanityClient {
2993
6325
  * Create a document. Requires a `_type` property. If no `_id` is provided, it will be generated by the database.
2994
6326
  * Returns an observable that resolves to the created document.
2995
6327
  *
6328
+ * @category Mutations
6329
+ *
2996
6330
  * @param document - Document to create
2997
6331
  * @param options - Mutation options
2998
6332
  */
@@ -3033,6 +6367,8 @@ declare class ObservableSanityClient {
3033
6367
  * Create a document if no document with the same ID already exists.
3034
6368
  * Returns an observable that resolves to the created document.
3035
6369
  *
6370
+ * @category Mutations
6371
+ *
3036
6372
  * @param document - Document to create
3037
6373
  * @param options - Mutation options
3038
6374
  */
@@ -3073,6 +6409,8 @@ declare class ObservableSanityClient {
3073
6409
  * Create a document if it does not exist, or replace a document with the same document ID
3074
6410
  * Returns an observable that resolves to the created document.
3075
6411
  *
6412
+ * @category Mutations
6413
+ *
3076
6414
  * @param document - Document to either create or replace
3077
6415
  * @param options - Mutation options
3078
6416
  */
@@ -3197,6 +6535,8 @@ declare class ObservableSanityClient {
3197
6535
  * Deletes a document with the given document ID.
3198
6536
  * Returns an observable that resolves to the deleted document.
3199
6537
  *
6538
+ * @category Mutations
6539
+ *
3200
6540
  * @param id - Document ID to delete
3201
6541
  * @param options - Options for the mutation
3202
6542
  */
@@ -3282,6 +6622,8 @@ declare class ObservableSanityClient {
3282
6622
  * * Discarding a version with no `releaseId` will discard the draft version of the published document.
3283
6623
  * * If the draft or release version does not exist, any error will throw.
3284
6624
  *
6625
+ * @category Versions
6626
+ *
3285
6627
  * @param params - Version action parameters:
3286
6628
  * - `releaseId` - The ID of the release to discard the document from.
3287
6629
  * - `publishedId` - The published ID of the document to discard.
@@ -3317,6 +6659,8 @@ declare class ObservableSanityClient {
3317
6659
  * * Replacing a version with no `releaseId` will replace the draft version of the published document.
3318
6660
  * * At least one of the **version** or **published** documents must exist.
3319
6661
  *
6662
+ * @category Versions
6663
+ *
3320
6664
  * @param params - Version action parameters:
3321
6665
  * - `document` - The new document to replace the version with.
3322
6666
  * - `releaseId` - The ID of the release where the document version is replaced.
@@ -3389,6 +6733,8 @@ declare class ObservableSanityClient {
3389
6733
  * @remarks
3390
6734
  * * If the published document does not exist, an error will be thrown.
3391
6735
  *
6736
+ * @category Versions
6737
+ *
3392
6738
  * @param params - Version action parameters:
3393
6739
  * - `releaseId` - The ID of the release to unpublish the document from.
3394
6740
  * - `publishedId` - The published ID of the document to unpublish.
@@ -3409,6 +6755,8 @@ declare class ObservableSanityClient {
3409
6755
  * Perform mutation operations against the configured dataset
3410
6756
  * Returns an observable that resolves to the first mutated document.
3411
6757
  *
6758
+ * @category Mutations
6759
+ *
3412
6760
  * @param operations - Mutation operations to execute
3413
6761
  * @param options - Mutation options
3414
6762
  */
@@ -3448,6 +6796,8 @@ declare class ObservableSanityClient {
3448
6796
  /**
3449
6797
  * Create a new buildable patch of operations to perform
3450
6798
  *
6799
+ * @category Mutations
6800
+ *
3451
6801
  * @param documentId - Document ID to patch
3452
6802
  * @param operations - Optional object of patch operations to initialize the patch instance with
3453
6803
  * @returns Patch instance - call `.commit()` to perform the operations defined
@@ -3472,12 +6822,16 @@ declare class ObservableSanityClient {
3472
6822
  /**
3473
6823
  * Create a new transaction of mutations
3474
6824
  *
6825
+ * @category Mutations
6826
+ *
3475
6827
  * @param operations - Optional array of mutation operations to initialize the transaction instance with
3476
6828
  */
3477
6829
  transaction<R extends Record<string, Any> = Record<string, Any>>(operations?: Mutation<R>[]): ObservableTransaction;
3478
6830
  /**
3479
6831
  * Perform action operations against the configured dataset
3480
6832
  *
6833
+ * @category Mutations
6834
+ *
3481
6835
  * @param operations - Action operation(s) to execute
3482
6836
  * @param options - Action options
3483
6837
  */
@@ -3485,12 +6839,16 @@ declare class ObservableSanityClient {
3485
6839
  /**
3486
6840
  * Perform an HTTP request against the Sanity API
3487
6841
  *
6842
+ * @category HTTP
6843
+ *
3488
6844
  * @param options - Request options
3489
6845
  */
3490
6846
  request<R = Any>(options: RawRequestOptions): Observable<R>;
3491
6847
  /**
3492
6848
  * Get a Sanity API URL for the URI provided
3493
6849
  *
6850
+ * @category HTTP
6851
+ *
3494
6852
  * @param uri - URI/path to build URL for
3495
6853
  * @param canUseCdn - Whether or not to allow using the API CDN for this route
3496
6854
  */
@@ -3498,6 +6856,8 @@ declare class ObservableSanityClient {
3498
6856
  /**
3499
6857
  * Get a Sanity API URL for the data operation and path provided
3500
6858
  *
6859
+ * @category HTTP
6860
+ *
3501
6861
  * @param operation - Data operation (eg `query`, `mutate`, `listen` or similar)
3502
6862
  * @param path - Path to append after the operation
3503
6863
  */
@@ -3506,15 +6866,52 @@ declare class ObservableSanityClient {
3506
6866
  /** @public */
3507
6867
  declare class SanityClient {
3508
6868
  #private;
6869
+ /**
6870
+ * Upload, fetch and delete assets (images and files) in the configured dataset
6871
+ *
6872
+ * @category Assets
6873
+ */
3509
6874
  assets: AssetsClient;
6875
+ /**
6876
+ * Create, list, edit and delete datasets in the configured project
6877
+ *
6878
+ * @category Projects & Datasets
6879
+ */
3510
6880
  datasets: DatasetsClient;
6881
+ /**
6882
+ * Subscribe to live content updates through the Live Content API
6883
+ *
6884
+ * @category Real-time
6885
+ */
3511
6886
  live: LiveClient;
6887
+ /**
6888
+ * Interact with Media Library assets
6889
+ *
6890
+ * @category Assets
6891
+ */
3512
6892
  mediaLibrary: {
6893
+ /** Upload and manage Media Library video assets */
3513
6894
  video: MediaLibraryVideoClient;
3514
6895
  };
6896
+ /**
6897
+ * Fetch information about the projects the authenticated user has access to
6898
+ *
6899
+ * @category Projects & Datasets
6900
+ */
3515
6901
  projects: ProjectsClient;
6902
+ /**
6903
+ * Fetch information about users in the configured project
6904
+ *
6905
+ * @category Projects & Datasets
6906
+ */
3516
6907
  users: UsersClient;
6908
+ /**
6909
+ * Run Agent Actions - AI-powered operations to generate, transform, translate, prompt and patch documents
6910
+ *
6911
+ * @category Agent Actions
6912
+ */
3517
6913
  agent: {
6914
+ /** Run individual Agent Action operations */
3518
6915
  action: AgentActionsClient;
3519
6916
  };
3520
6917
  collaboration: {
@@ -3522,22 +6919,37 @@ declare class SanityClient {
3522
6919
  comments: CollaborationCommentsClient;
3523
6920
  };
3524
6921
  functions: FunctionsClient;
6922
+ /**
6923
+ * Create and manage content releases and their scheduled publishing
6924
+ *
6925
+ * @category Releases
6926
+ */
3525
6927
  releases: ReleasesClient;
6928
+ /** @beta */
6929
+ context: ContextClient;
3526
6930
  /**
3527
6931
  * Observable version of the Sanity client, with the same configuration as the promise-based one
6932
+ *
6933
+ * @category Configuration
3528
6934
  */
3529
6935
  observable: ObservableSanityClient;
3530
6936
  /**
3531
- * Instance properties
6937
+ * Listen to document changes matching a GROQ query, delivered as server-sent events
6938
+ *
6939
+ * @category Real-time
3532
6940
  */
3533
6941
  listen: typeof _listen;
3534
6942
  constructor(httpRequest: HttpRequest, config?: ClientConfig);
3535
6943
  /**
3536
6944
  * Clone the client - returns a new instance
6945
+ *
6946
+ * @category Configuration
3537
6947
  */
3538
6948
  clone(): SanityClient;
3539
6949
  /**
3540
6950
  * Returns the current client configuration
6951
+ *
6952
+ * @category Configuration
3541
6953
  */
3542
6954
  config(): InitializedClientConfig;
3543
6955
  /**
@@ -3547,12 +6959,16 @@ declare class SanityClient {
3547
6959
  /**
3548
6960
  * Clone the client with a new (partial) configuration.
3549
6961
  *
6962
+ * @category Configuration
6963
+ *
3550
6964
  * @param newConfig - New client configuration properties, shallowly merged with existing configuration
3551
6965
  */
3552
6966
  withConfig(newConfig?: Partial<ClientConfig>): SanityClient;
3553
6967
  /**
3554
6968
  * Perform a GROQ-query against the configured dataset.
3555
6969
  *
6970
+ * @category Querying
6971
+ *
3556
6972
  * @param query - GROQ-query to perform
3557
6973
  */
3558
6974
  fetch<R = Any, Q extends QueryWithoutParams = QueryWithoutParams, const G extends string = string>(query: G, params?: Q | QueryWithoutParams): Promise<ClientReturn<G, R>>;
@@ -3583,6 +6999,8 @@ declare class SanityClient {
3583
6999
  /**
3584
7000
  * Fetch a single document with the given ID.
3585
7001
  *
7002
+ * @category Querying
7003
+ *
3586
7004
  * @param id - Document ID to fetch
3587
7005
  * @param options - Request options
3588
7006
  */
@@ -3610,6 +7028,8 @@ declare class SanityClient {
3610
7028
  * The order/position of documents is preserved based on the original array of IDs.
3611
7029
  * If any of the documents are missing, they will be replaced by a `null` entry in the returned array
3612
7030
  *
7031
+ * @category Querying
7032
+ *
3613
7033
  * @param ids - Document IDs to fetch
3614
7034
  * @param options - Request options
3615
7035
  */
@@ -3621,6 +7041,8 @@ declare class SanityClient {
3621
7041
  * Convenient and bandwidth efficient method of checking wether a set of document IDs exists.
3622
7042
  * Returns a set of the IDs that exist.
3623
7043
  *
7044
+ * @category Querying
7045
+ *
3624
7046
  * @param ids - Document IDs to check
3625
7047
  * @param options - Request options
3626
7048
  */
@@ -3632,6 +7054,8 @@ declare class SanityClient {
3632
7054
  * Create a document. Requires a `_type` property. If no `_id` is provided, it will be generated by the database.
3633
7055
  * Returns a promise that resolves to the created document.
3634
7056
  *
7057
+ * @category Mutations
7058
+ *
3635
7059
  * @param document - Document to create
3636
7060
  * @param options - Mutation options
3637
7061
  */
@@ -3672,6 +7096,8 @@ declare class SanityClient {
3672
7096
  * Create a document if no document with the same ID already exists.
3673
7097
  * Returns a promise that resolves to the created document.
3674
7098
  *
7099
+ * @category Mutations
7100
+ *
3675
7101
  * @param document - Document to create
3676
7102
  * @param options - Mutation options
3677
7103
  */
@@ -3712,6 +7138,8 @@ declare class SanityClient {
3712
7138
  * Create a document if it does not exist, or replace a document with the same document ID
3713
7139
  * Returns a promise that resolves to the created document.
3714
7140
  *
7141
+ * @category Mutations
7142
+ *
3715
7143
  * @param document - Document to either create or replace
3716
7144
  * @param options - Mutation options
3717
7145
  */
@@ -3824,6 +7252,8 @@ declare class SanityClient {
3824
7252
  * Deletes a document with the given document ID.
3825
7253
  * Returns a promise that resolves to the deleted document.
3826
7254
  *
7255
+ * @category Mutations
7256
+ *
3827
7257
  * @param id - Document ID to delete
3828
7258
  * @param options - Options for the mutation
3829
7259
  */
@@ -3909,6 +7339,8 @@ declare class SanityClient {
3909
7339
  * * Discarding a version with no `releaseId` will discard the draft version of the published document.
3910
7340
  * * If the draft or release version does not exist, any error will throw.
3911
7341
  *
7342
+ * @category Versions
7343
+ *
3912
7344
  * @param params - Version action parameters:
3913
7345
  * - `releaseId` - The ID of the release to discard the document from.
3914
7346
  * - `publishedId` - The published ID of the document to discard.
@@ -3944,6 +7376,8 @@ declare class SanityClient {
3944
7376
  * * Replacing a version with no `releaseId` will replace the draft version of the published document.
3945
7377
  * * At least one of the **version** or **published** documents must exist.
3946
7378
  *
7379
+ * @category Versions
7380
+ *
3947
7381
  * @param params - Version action parameters:
3948
7382
  * - `document` - The new document to replace the version with.
3949
7383
  * - `releaseId` - The ID of the release where the document version is replaced.
@@ -4016,6 +7450,8 @@ declare class SanityClient {
4016
7450
  * @remarks
4017
7451
  * * If the published document does not exist, an error will be thrown.
4018
7452
  *
7453
+ * @category Versions
7454
+ *
4019
7455
  * @param params - Version action parameters:
4020
7456
  * - `releaseId` - The ID of the release to unpublish the document from.
4021
7457
  * - `publishedId` - The published ID of the document to unpublish.
@@ -4036,6 +7472,8 @@ declare class SanityClient {
4036
7472
  * Perform mutation operations against the configured dataset
4037
7473
  * Returns a promise that resolves to the first mutated document.
4038
7474
  *
7475
+ * @category Mutations
7476
+ *
4039
7477
  * @param operations - Mutation operations to execute
4040
7478
  * @param options - Mutation options
4041
7479
  */
@@ -4075,6 +7513,8 @@ declare class SanityClient {
4075
7513
  /**
4076
7514
  * Create a new buildable patch of operations to perform
4077
7515
  *
7516
+ * @category Mutations
7517
+ *
4078
7518
  * @param documentId - Document ID to patch
4079
7519
  * @param operations - Optional object of patch operations to initialize the patch instance with
4080
7520
  * @returns Patch instance - call `.commit()` to perform the operations defined
@@ -4099,6 +7539,8 @@ declare class SanityClient {
4099
7539
  /**
4100
7540
  * Create a new transaction of mutations
4101
7541
  *
7542
+ * @category Mutations
7543
+ *
4102
7544
  * @param operations - Optional array of mutation operations to initialize the transaction instance with
4103
7545
  */
4104
7546
  transaction<R extends Record<string, Any> = Record<string, Any>>(operations?: Mutation<R>[]): Transaction;
@@ -4106,6 +7548,8 @@ declare class SanityClient {
4106
7548
  * Perform action operations against the configured dataset
4107
7549
  * Returns a promise that resolves to the transaction result
4108
7550
  *
7551
+ * @category Mutations
7552
+ *
4109
7553
  * @param operations - Action operation(s) to execute
4110
7554
  * @param options - Action options
4111
7555
  */
@@ -4114,6 +7558,8 @@ declare class SanityClient {
4114
7558
  * Perform a request against the Sanity API
4115
7559
  * NOTE: Only use this for Sanity API endpoints, not for your own APIs!
4116
7560
  *
7561
+ * @category HTTP
7562
+ *
4117
7563
  * @param options - Request options
4118
7564
  * @returns Promise resolving to the response body
4119
7565
  */
@@ -4132,6 +7578,8 @@ declare class SanityClient {
4132
7578
  /**
4133
7579
  * Get a Sanity API URL for the URI provided
4134
7580
  *
7581
+ * @category HTTP
7582
+ *
4135
7583
  * @param uri - URI/path to build URL for
4136
7584
  * @param canUseCdn - Whether or not to allow using the API CDN for this route
4137
7585
  */
@@ -4139,6 +7587,8 @@ declare class SanityClient {
4139
7587
  /**
4140
7588
  * Get a Sanity API URL for the data operation and path provided
4141
7589
  *
7590
+ * @category HTTP
7591
+ *
4142
7592
  * @param operation - Data operation (eg `query`, `mutate`, `listen` or similar)
4143
7593
  * @param path - Path to append after the operation
4144
7594
  */
@@ -4472,6 +7922,9 @@ type ClientVariant = ClientVariantConditions | string;
4472
7922
  type ClientConfigResource = {
4473
7923
  type: 'canvas';
4474
7924
  id: string;
7925
+ } | {
7926
+ type: 'knowledge-base';
7927
+ id: string;
4475
7928
  } | {
4476
7929
  type: 'media-library';
4477
7930
  id: string;
@@ -4659,6 +8112,16 @@ interface ClientConfig {
4659
8112
  collaboration?: {
4660
8113
  organizationId?: string;
4661
8114
  };
8115
+ /**
8116
+ * Organization-scoped configuration for Context APIs.
8117
+ *
8118
+ * Currently this is used by `context.insights` methods.
8119
+ *
8120
+ * @beta
8121
+ */
8122
+ context?: {
8123
+ organizationId?: string;
8124
+ };
4662
8125
  }
4663
8126
  /** @public */
4664
8127
  interface InitializedClientConfig extends ClientConfig {
@@ -4924,6 +8387,7 @@ type DatasetAclMode = 'public' | 'private' | 'custom';
4924
8387
  /** @public */
4925
8388
  type DatasetCreateOptions = {
4926
8389
  aclMode?: DatasetAclMode;
8390
+ description?: string | null;
4927
8391
  embeddings?: {
4928
8392
  enabled: boolean;
4929
8393
  projection?: string;
@@ -4932,6 +8396,7 @@ type DatasetCreateOptions = {
4932
8396
  /** @public */
4933
8397
  type DatasetEditOptions = {
4934
8398
  aclMode?: DatasetAclMode;
8399
+ description?: string | null;
4935
8400
  };
4936
8401
  /** @public */
4937
8402
  type EmbeddingsSettings = {
@@ -4948,17 +8413,22 @@ type EmbeddingsSettingsBody = {
4948
8413
  type DatasetResponse = {
4949
8414
  datasetName: string;
4950
8415
  aclMode: DatasetAclMode;
8416
+ description: string | null;
4951
8417
  };
4952
8418
  /** @public */
4953
8419
  type DatasetsResponse = {
4954
8420
  name: string;
4955
8421
  aclMode: DatasetAclMode;
8422
+ description?: string;
4956
8423
  createdAt: string;
4957
8424
  createdByUserId: string;
4958
8425
  addonFor: string | null;
4959
8426
  datasetProfile: string;
4960
8427
  features: string[];
4961
- tags: string[];
8428
+ tags: {
8429
+ name: string;
8430
+ title: string;
8431
+ }[];
4962
8432
  }[];
4963
8433
  /** @public */
4964
8434
  interface SanityProjectMember {
@@ -6325,8 +9795,46 @@ interface LiveEventGoAway {
6325
9795
  }
6326
9796
  /** @public */
6327
9797
  type LiveEvent = LiveEventRestart | LiveEventReconnect | LiveEventMessage | LiveEventWelcome | LiveEventGoAway;
6328
- /** @public */
6329
- interface SanityQueries {}
9798
+ declare global {
9799
+ /**
9800
+ * Query result types, keyed by GROQ query string. Empty by default, `sanity typegen` registers
9801
+ * the queries it finds:
9802
+ * ```ts
9803
+ * declare global {
9804
+ * interface SanityQueries {
9805
+ * '*[_type == "post"]': PostsQueryResult
9806
+ * }
9807
+ * }
9808
+ * ```
9809
+ * `client.fetch(query)` and `ClientReturn<typeof query>` then resolve to the registered type.
9810
+ *
9811
+ * The registry is a global rather than a module augmentation of `@sanity/client` so that it
9812
+ * does not depend on module resolution: it resolves the same whether `@sanity/client` is a
9813
+ * direct dependency, how many copies of it are installed, and from every subpath export.
9814
+ */
9815
+ interface SanityQueries {}
9816
+ }
9817
+ /**
9818
+ * The query registry as seen from `@sanity/client`. Inherits every query registered on the global
9819
+ * `SanityQueries` interface, and still accepts the older module augmentation form:
9820
+ * ```ts
9821
+ * declare module '@sanity/client' {
9822
+ * interface SanityQueries {
9823
+ * '*[_type == "post"]': PostsQueryResult
9824
+ * }
9825
+ * }
9826
+ * ```
9827
+ * `@sanity/client` releases that predate the global registry only read this interface, so a
9828
+ * generated file that registers queries globally can bridge them with an augmentation that adds
9829
+ * the global as a base type. It is harmless on releases that already inherit it:
9830
+ * ```ts
9831
+ * declare module '@sanity/client' {
9832
+ * interface SanityQueries extends globalThis.SanityQueries {}
9833
+ * }
9834
+ * ```
9835
+ * @public
9836
+ */
9837
+ interface SanityQueries extends globalThis.SanityQueries {}
6330
9838
  /** @public */
6331
9839
  type ClientReturn<GroqString extends string, Fallback = Any> = GroqString extends keyof SanityQueries ? SanityQueries[GroqString] : Fallback;
6332
9840
  /**
@@ -6722,5 +10230,5 @@ declare const createClient: (config: ClientConfig) => SanityClient;
6722
10230
  * @deprecated Use the named export `createClient` instead of the `default` export
6723
10231
  */
6724
10232
  declare const deprecatedCreateClient: (config: ClientConfig) => SanityClient;
6725
- export { Action, ActionError, ActionErrorItem, type AgentActionParam, type AgentActionParams, type AgentActionPath, type AgentActionPathSegment, type AgentActionTarget, AllDocumentIdsMutationOptions, AllDocumentsMutationOptions, AnimatedImageFormat, AnimatedTransformOptions, Any, ApiError, ArchiveReleaseAction, AssetMetadataType, type AssetsClient, AttributeSet, AuthProvider, AuthProviderResponse, BaseActionOptions, BaseMutationOptions, BasePatch, BaseTransaction, ChannelError, ChannelErrorEvent, ClientConfig, ClientError, ClientPerspective, ClientReturn, ClientVariant, ClientVariantConditions, type CollaborationCommentCreate, type CollaborationCommentDocument, type CollaborationCommentFieldValue, type CollaborationCommentMessage, type CollaborationCommentPortableTextBlock, type CollaborationCommentRange, type CollaborationCommentReactionShortName, type CollaborationCommentSelection, type CollaborationCommentStatus, type CollaborationCommentTarget, type CollaborationCommentUpdate, type CollaborationCommentsClient, type CollaborationCommentsListenOptions, type CollaborationCommentsRequestOptions, type CollaborationCommentsWriteOptions, ConnectionFailedError, type ConstantAgentActionParam, ContentSourceMap, ContentSourceMapDocument, ContentSourceMapDocumentBase, ContentSourceMapDocumentValueSource, ContentSourceMapDocuments, ContentSourceMapLiteralSource, ContentSourceMapMapping, ContentSourceMapMappings, type ContentSourceMapParsedPath, type ContentSourceMapParsedPathKeyedSegment, ContentSourceMapPaths, ContentSourceMapRemoteDocument, ContentSourceMapSource, ContentSourceMapUnknownSource, ContentSourceMapValueMapping, CorsOriginError, CreateAction, CreateReleaseAction, CreateVariantAction, CreateVariantDefinitionAction, CreateVersionAction, CurrentSanityUser, DatasetAclMode, DatasetCreateOptions, DatasetEditOptions, DatasetResponse, type DatasetsClient, DatasetsResponse, DeleteAction, DeleteReleaseAction, DeleteVariantAction, DeleteVariantDefinitionAction, DiscardAction, DiscardVersionAction, DisconnectError, DisconnectEvent, type DocumentAgentActionParam, EXPERIMENTAL_API_WARNING, EditAction, EditReleaseAction, EditVariantAction, EditVariantDefinitionAction, EditableReleaseDocument, EmbeddingsSettings, EmbeddingsSettingsBody, ErrorProps, type EventSourceEvent, type EventSourceInstance, type FieldAgentActionParam, type FilterDefault, FilteredResponseQueryOptions, FirstDocumentIdMutationOptions, FirstDocumentMutationOptions, FitMode, type GenerateInstruction, type GenerateOperation, type GenerateTarget, type GenerateTargetDocument, type GenerateTargetInclude, type GroqAgentActionParam, type HttpError, HttpRequest, IdentifiedSanityDocumentStub, type ImageDescriptionOperation, ImportReleaseAction, InitializedClientConfig, type InitializedStegaConfig, InsertPatch, type InvokeFunctionEvent, type InvokeFunctionOptions, type InvokeFunctionRequest, ListenEvent, ListenEventName, ListenOptions, ListenParams, type LiveClient, LiveEvent, LiveEventGoAway, LiveEventMessage, LiveEventReconnect, LiveEventRestart, LiveEventWelcome, type Logger, MediaLibraryAssetDocument, MediaLibraryAssetInstanceIdentifier, MediaLibraryAssetVersion, MediaLibraryPlaybackInfoOptions, type MediaLibraryVideoClient, MediaLibraryVideoPlaybackTransformations, MessageError, MessageParseError, MultipleActionResult, MultipleMutationResult, Mutation, MutationError, MutationErrorItem, MutationEvent, MutationOperation, MutationSelection, MutationSelectionQueryParams, type ObservableAssetsClient, type ObservableCollaborationCommentsClient, type ObservableDatasetsClient, type ObservableMediaLibraryVideoClient, ObservablePatch, ObservablePatchBuilder, type ObservableProjectsClient, ObservableSanityClient, ObservableTransaction, type ObservableUsersClient, OpenEvent, PartialExcept, Patch, PatchBuilder, type PatchDocument, PatchMutationOperation, type PatchOperation, PatchOperations, PatchSelection, type PatchTarget, type ProjectsClient, type PromptRequest, PublishAction, PublishReleaseAction, PublishVariantAction, QueryOptions, QueryParams, QueryParseError, QueryWithoutParams, RawQueryResponse, RawQuerylessQueryResponse, RawRequestOptions, ReconnectEvent, ReleaseAction, ReleaseCardinality, ReleaseDocument, ReleaseId, ReleaseState, ReleaseType, ReplaceDraftAction, ReplaceVersionAction, RequestHandler, RequestHandlerOptions, RequestObservableOptions, RequestOptions, RequestUrlOptions, Requester, ResetEvent, type ResolveStudioUrl, ResponseQueryOptions, ResumableListenEventNames, ResumableListenOptions, SanityAssetDocument, SanityClient, SanityDocument, SanityDocumentStub, SanityImageAssetDocument, SanityImagePalette, SanityProject, SanityProjectMember, SanityQueries, SanityReference, SanityUser, ScheduleReleaseAction, ServerError, type ServerSentEvent, SingleActionResult, SingleMutationResult, StackablePerspective, type StegaConfig, type StegaConfigRequiredKeys, StillImageFormat, StoryboardTransformOptions, type StudioBaseRoute, type StudioBaseUrl, type StudioUrl, SyncTag, ThumbnailTransformOptions, type TimeoutErrorLike, Transaction, TransactionAllDocumentIdsMutationOptions, TransactionAllDocumentsMutationOptions, TransactionFirstDocumentIdMutationOptions, TransactionFirstDocumentMutationOptions, TransactionMutationOptions, type TransformDocument, type TransformOperation, type TransformTarget, type TransformTargetDocument, type TransformTargetInclude, type TranslateDocument, type TranslateTarget, type TranslateTargetInclude, UnarchiveReleaseAction, UnfilteredResponseQueryOptions, UnfilteredResponseWithoutQuery, UnpublishAction, UnpublishVariantAction, UnpublishVersionAction, UnscheduleReleaseAction, UploadBody, UploadClientConfig, UploadEvent, UploadProgressEvent, UploadResponseEvent, type UsersClient, VariantAction, VariantDefinitionAction, VersionAction, VideoPlaybackInfo, VideoPlaybackInfoItem, VideoPlaybackInfoItemPublic, VideoPlaybackInfoItemSigned, VideoPlaybackInfoPublic, VideoPlaybackInfoSigned, VideoPlaybackTokens, VideoRenditionInfo, VideoRenditionInfoPublic, VideoRenditionInfoSigned, VideoSubtitleInfo, VideoSubtitleInfoPublic, VideoSubtitleInfoSigned, WelcomeBackEvent, WelcomeEvent, type _listen, connectEventSource, createClient, deprecatedCreateClient as default, formatQueryParseError, isHttpError, isQueryParseError, isTimeoutError, requester, validateApiPerspective };
10233
+ export { Action, ActionError, ActionErrorItem, type AgentActionParam, type AgentActionParams, type AgentActionPath, type AgentActionPathSegment, type AgentActionTarget, AllDocumentIdsMutationOptions, AllDocumentsMutationOptions, AnimatedImageFormat, AnimatedTransformOptions, Any, ApiError, ArchiveReleaseAction, AssetMetadataType, type AssetsClient, AttributeSet, AuthProvider, AuthProviderResponse, BaseActionOptions, BaseMutationOptions, BasePatch, BaseTransaction, ChannelError, ChannelErrorEvent, ClientConfig, ClientError, ClientPerspective, ClientReturn, ClientVariant, ClientVariantConditions, type CollaborationCommentCreate, type CollaborationCommentDocument, type CollaborationCommentFieldValue, type CollaborationCommentMessage, type CollaborationCommentPortableTextBlock, type CollaborationCommentRange, type CollaborationCommentReactionShortName, type CollaborationCommentSelection, type CollaborationCommentStatus, type CollaborationCommentTarget, type CollaborationCommentUpdate, type CollaborationCommentsClient, type CollaborationCommentsListenOptions, type CollaborationCommentsRequestOptions, type CollaborationCommentsWriteOptions, ConnectionFailedError, type ConstantAgentActionParam, ContentSourceMap, ContentSourceMapDocument, ContentSourceMapDocumentBase, ContentSourceMapDocumentValueSource, ContentSourceMapDocuments, ContentSourceMapLiteralSource, ContentSourceMapMapping, ContentSourceMapMappings, type ContentSourceMapParsedPath, type ContentSourceMapParsedPathKeyedSegment, ContentSourceMapPaths, ContentSourceMapRemoteDocument, ContentSourceMapSource, ContentSourceMapUnknownSource, ContentSourceMapValueMapping, types_d_exports as Context, CorsOriginError, CreateAction, CreateReleaseAction, CreateVariantAction, CreateVariantDefinitionAction, CreateVersionAction, CurrentSanityUser, DatasetAclMode, DatasetCreateOptions, DatasetEditOptions, DatasetResponse, type DatasetsClient, DatasetsResponse, DeleteAction, DeleteReleaseAction, DeleteVariantAction, DeleteVariantDefinitionAction, DiscardAction, DiscardVersionAction, DisconnectError, DisconnectEvent, type DocumentAgentActionParam, EXPERIMENTAL_API_WARNING, EditAction, EditReleaseAction, EditVariantAction, EditVariantDefinitionAction, EditableReleaseDocument, EmbeddingsSettings, EmbeddingsSettingsBody, ErrorProps, type EventSourceEvent, type EventSourceInstance, type FieldAgentActionParam, type FilterDefault, FilteredResponseQueryOptions, FirstDocumentIdMutationOptions, FirstDocumentMutationOptions, FitMode, type GenerateInstruction, type GenerateOperation, type GenerateTarget, type GenerateTargetDocument, type GenerateTargetInclude, type GroqAgentActionParam, type HttpError, HttpRequest, IdentifiedSanityDocumentStub, type ImageDescriptionOperation, ImportReleaseAction, InitializedClientConfig, type InitializedStegaConfig, InsertPatch, type InvokeFunctionEvent, type InvokeFunctionOptions, type InvokeFunctionRequest, ListenEvent, ListenEventName, ListenOptions, ListenParams, type LiveClient, LiveEvent, LiveEventGoAway, LiveEventMessage, LiveEventReconnect, LiveEventRestart, LiveEventWelcome, type Logger, MediaLibraryAssetDocument, MediaLibraryAssetInstanceIdentifier, MediaLibraryAssetVersion, MediaLibraryPlaybackInfoOptions, type MediaLibraryVideoClient, MediaLibraryVideoPlaybackTransformations, MessageError, MessageParseError, MultipleActionResult, MultipleMutationResult, Mutation, MutationError, MutationErrorItem, MutationEvent, MutationOperation, MutationSelection, MutationSelectionQueryParams, type ObservableAssetsClient, type ObservableCollaborationCommentsClient, type ObservableDatasetsClient, type ObservableMediaLibraryVideoClient, ObservablePatch, ObservablePatchBuilder, type ObservableProjectsClient, ObservableSanityClient, ObservableTransaction, type ObservableUsersClient, OpenEvent, PartialExcept, Patch, PatchBuilder, type PatchDocument, PatchMutationOperation, type PatchOperation, PatchOperations, PatchSelection, type PatchTarget, type ProjectsClient, type PromptRequest, PublishAction, PublishReleaseAction, PublishVariantAction, QueryOptions, QueryParams, QueryParseError, QueryWithoutParams, RawQueryResponse, RawQuerylessQueryResponse, RawRequestOptions, ReconnectEvent, ReleaseAction, ReleaseCardinality, ReleaseDocument, ReleaseId, ReleaseState, ReleaseType, ReplaceDraftAction, ReplaceVersionAction, RequestHandler, RequestHandlerOptions, RequestObservableOptions, RequestOptions, RequestUrlOptions, Requester, ResetEvent, type ResolveStudioUrl, ResponseQueryOptions, ResumableListenEventNames, ResumableListenOptions, SanityAssetDocument, SanityClient, SanityDocument, SanityDocumentStub, SanityImageAssetDocument, SanityImagePalette, SanityProject, SanityProjectMember, SanityQueries, SanityReference, SanityUser, ScheduleReleaseAction, ServerError, type ServerSentEvent, SingleActionResult, SingleMutationResult, StackablePerspective, type StegaConfig, type StegaConfigRequiredKeys, StillImageFormat, StoryboardTransformOptions, type StudioBaseRoute, type StudioBaseUrl, type StudioUrl, SyncTag, ThumbnailTransformOptions, type TimeoutErrorLike, Transaction, TransactionAllDocumentIdsMutationOptions, TransactionAllDocumentsMutationOptions, TransactionFirstDocumentIdMutationOptions, TransactionFirstDocumentMutationOptions, TransactionMutationOptions, type TransformDocument, type TransformOperation, type TransformTarget, type TransformTargetDocument, type TransformTargetInclude, type TranslateDocument, type TranslateTarget, type TranslateTargetInclude, UnarchiveReleaseAction, UnfilteredResponseQueryOptions, UnfilteredResponseWithoutQuery, UnpublishAction, UnpublishVariantAction, UnpublishVersionAction, UnscheduleReleaseAction, UploadBody, UploadClientConfig, UploadEvent, UploadProgressEvent, UploadResponseEvent, type UsersClient, VariantAction, VariantDefinitionAction, VersionAction, VideoPlaybackInfo, VideoPlaybackInfoItem, VideoPlaybackInfoItemPublic, VideoPlaybackInfoItemSigned, VideoPlaybackInfoPublic, VideoPlaybackInfoSigned, VideoPlaybackTokens, VideoRenditionInfo, VideoRenditionInfoPublic, VideoRenditionInfoSigned, VideoSubtitleInfo, VideoSubtitleInfoPublic, VideoSubtitleInfoSigned, WelcomeBackEvent, WelcomeEvent, type _listen, connectEventSource, createClient, deprecatedCreateClient as default, formatQueryParseError, isHttpError, isQueryParseError, isTimeoutError, requester, validateApiPerspective };
6726
10234
  //# sourceMappingURL=index.node.d.ts.map