@sanity/client 8.8.0 → 8.9.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.
- package/dist/collaboration.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.node.d.ts +1630 -359
- package/dist/index.node.js +1 -1
- package/dist/media-library.d.ts +1 -1
- package/dist/{types-Cov8gzNZ.d.ts → types-KoKIKv8Z.d.ts} +1631 -360
- package/package.json +1 -1
- package/src/context/openapi.json +1638 -805
- package/src/context/types.gen.ts +1630 -359
|
@@ -1762,13 +1762,13 @@ interface paths {
|
|
|
1762
1762
|
};
|
|
1763
1763
|
/**
|
|
1764
1764
|
* List knowledge bases
|
|
1765
|
-
* @description Returns the
|
|
1765
|
+
* @description Returns the knowledge bases you can access in the organization set by `organizationId`. Results are cursor-paginated.
|
|
1766
1766
|
*/
|
|
1767
1767
|
get: operations['listKnowledgeBases'];
|
|
1768
1768
|
put?: never;
|
|
1769
1769
|
/**
|
|
1770
1770
|
* Create a knowledge base
|
|
1771
|
-
* @description Creates a knowledge base
|
|
1771
|
+
* @description Creates a knowledge base in your organization. To add content to it, create an import.
|
|
1772
1772
|
*/
|
|
1773
1773
|
post: operations['createKnowledgeBase'];
|
|
1774
1774
|
delete?: never;
|
|
@@ -1786,21 +1786,21 @@ interface paths {
|
|
|
1786
1786
|
};
|
|
1787
1787
|
/**
|
|
1788
1788
|
* Get a knowledge base
|
|
1789
|
-
* @description Returns
|
|
1789
|
+
* @description Returns a knowledge base's metadata and state. `knowledgeBaseId` accepts the public ID (`kb...`) or the UUID, and you don't need to pass an organization. If you can't read the knowledge base, the request returns `404`. To read the built entries, query `sanity.context.entry` documents with GROQ from your organization's document store.
|
|
1790
1790
|
*/
|
|
1791
1791
|
get: operations['getKnowledgeBase'];
|
|
1792
1792
|
put?: never;
|
|
1793
1793
|
post?: never;
|
|
1794
1794
|
/**
|
|
1795
1795
|
* Delete a knowledge base
|
|
1796
|
-
* @description
|
|
1796
|
+
* @description Deletes the knowledge base and everything it owns: its sources, imports, revisions, stored source files, and its documents in your organization's document store. While a build, refresh, apply, or import is running, the request returns `409` with code `buildInFlight`. Retry after that work finishes.
|
|
1797
1797
|
*/
|
|
1798
1798
|
delete: operations['deleteKnowledgeBase'];
|
|
1799
1799
|
options?: never;
|
|
1800
1800
|
head?: never;
|
|
1801
1801
|
/**
|
|
1802
1802
|
* Update a knowledge base
|
|
1803
|
-
* @description
|
|
1803
|
+
* @description Updates the title, the description, or the recurring refresh settings (`refreshEnabled` and `refreshFrequency`). Setting a refresh field on a knowledge base with no website or dataset source returns `422` with code `refreshControlsUnavailable`. Setting `refreshEnabled` to `false` pauses the schedule, and you can still start a refresh manually.
|
|
1804
1804
|
*/
|
|
1805
1805
|
patch: operations['updateKnowledgeBase'];
|
|
1806
1806
|
trace?: never;
|
|
@@ -1815,8 +1815,8 @@ interface paths {
|
|
|
1815
1815
|
get?: never;
|
|
1816
1816
|
put?: never;
|
|
1817
1817
|
/**
|
|
1818
|
-
*
|
|
1819
|
-
* @description Queues a build over the current
|
|
1818
|
+
* Start a knowledge base build
|
|
1819
|
+
* @description Queues a build over the knowledge base's current sources and returns a job ID immediately. If a build is already running, the response returns that build's job ID instead of starting a second build.
|
|
1820
1820
|
*/
|
|
1821
1821
|
post: operations['buildKnowledgeBase'];
|
|
1822
1822
|
delete?: never;
|
|
@@ -1835,8 +1835,8 @@ interface paths {
|
|
|
1835
1835
|
get?: never;
|
|
1836
1836
|
put?: never;
|
|
1837
1837
|
/**
|
|
1838
|
-
* Cancel
|
|
1839
|
-
* @description Cancels the running build and resets the knowledge base so
|
|
1838
|
+
* Cancel a knowledge base build
|
|
1839
|
+
* @description Cancels the running build and resets the knowledge base so you can build it again. Returns `cancelled: false` when no build is running.
|
|
1840
1840
|
*/
|
|
1841
1841
|
post: operations['cancelKnowledgeBaseBuild'];
|
|
1842
1842
|
delete?: never;
|
|
@@ -1856,7 +1856,7 @@ interface paths {
|
|
|
1856
1856
|
put?: never;
|
|
1857
1857
|
/**
|
|
1858
1858
|
* Rebuild an entry from its sources
|
|
1859
|
-
* @description Queues a
|
|
1859
|
+
* @description Queues a rewrite of the entry at `entryPath` from its cited sources and the active instructions, and returns a job ID immediately. The response also lists the other entries that cite any of the same sources. An instruction applies to every entry that cites its sources, so those entries can change too.
|
|
1860
1860
|
*/
|
|
1861
1861
|
post: operations['rebuildEntry'];
|
|
1862
1862
|
delete?: never;
|
|
@@ -1874,13 +1874,21 @@ interface paths {
|
|
|
1874
1874
|
};
|
|
1875
1875
|
/**
|
|
1876
1876
|
* List imports
|
|
1877
|
-
* @description
|
|
1877
|
+
* @description Lists everything added to a knowledge base, one item per import: a file upload, website crawl, Sanity dataset, or inline text. Results are cursor-paginated. To list the sources each import produced, use `GET .../sources`.
|
|
1878
1878
|
*/
|
|
1879
1879
|
get: operations['listImports'];
|
|
1880
1880
|
put?: never;
|
|
1881
1881
|
/**
|
|
1882
|
-
* Create
|
|
1883
|
-
* @description Adds content
|
|
1882
|
+
* Create a text, crawl, or dataset import
|
|
1883
|
+
* @description Adds content to a knowledge base. Set `type` to choose what to import:
|
|
1884
|
+
*
|
|
1885
|
+
* - `text`: inline content
|
|
1886
|
+
* - `crawl`: a website
|
|
1887
|
+
* - `dataset`: documents from a Sanity dataset, selected by a GROQ filter
|
|
1888
|
+
*
|
|
1889
|
+
* Each import queues processing and returns a job ID to poll. To import a file, use `POST .../imports/uploads` instead.
|
|
1890
|
+
*
|
|
1891
|
+
* Adding a crawl URL that already exists returns `409` with code `webSourceRootConflict`. Adding more crawl URLs than your limit allows returns `409` with code `webSourceRootLimitExceeded`. Supports the `Idempotency-Key` header.
|
|
1884
1892
|
*/
|
|
1885
1893
|
post: operations['createImport'];
|
|
1886
1894
|
delete?: never;
|
|
@@ -1899,8 +1907,13 @@ interface paths {
|
|
|
1899
1907
|
get?: never;
|
|
1900
1908
|
put?: never;
|
|
1901
1909
|
/**
|
|
1902
|
-
* Start a file
|
|
1903
|
-
* @description Creates a file
|
|
1910
|
+
* Start a file upload
|
|
1911
|
+
* @description Creates a file import and returns a single-use signed upload URL that's valid for one hour. To finish the upload:
|
|
1912
|
+
*
|
|
1913
|
+
* 1. Send the file in a `PUT` request to the upload URL.
|
|
1914
|
+
* 2. Call `POST .../imports/uploads/{importId}/complete` to start processing.
|
|
1915
|
+
*
|
|
1916
|
+
* If you set `contentType`, the `PUT` request must send the same `Content-Type` header. If you omit it, the `PUT` request can send any `Content-Type` header or none. An import that isn't completed within 24 hours is deleted. Supports the `Idempotency-Key` header.
|
|
1904
1917
|
*/
|
|
1905
1918
|
post: operations['startUpload'];
|
|
1906
1919
|
delete?: never;
|
|
@@ -1919,8 +1932,8 @@ interface paths {
|
|
|
1919
1932
|
get?: never;
|
|
1920
1933
|
put?: never;
|
|
1921
1934
|
/**
|
|
1922
|
-
* Complete a file
|
|
1923
|
-
* @description
|
|
1935
|
+
* Complete a file upload
|
|
1936
|
+
* @description Starts processing a file after you upload it to the signed URL from `POST .../imports/uploads`. Returns a job ID to poll.
|
|
1924
1937
|
*/
|
|
1925
1938
|
post: operations['completeUpload'];
|
|
1926
1939
|
delete?: never;
|
|
@@ -1937,15 +1950,15 @@ interface paths {
|
|
|
1937
1950
|
cookie?: never;
|
|
1938
1951
|
};
|
|
1939
1952
|
/**
|
|
1940
|
-
* Get
|
|
1941
|
-
* @description Returns
|
|
1953
|
+
* Get an import
|
|
1954
|
+
* @description Returns an import with its `sourceKind` and processing `status`.
|
|
1942
1955
|
*/
|
|
1943
1956
|
get: operations['getImport'];
|
|
1944
1957
|
put?: never;
|
|
1945
1958
|
post?: never;
|
|
1946
1959
|
/**
|
|
1947
1960
|
* Delete an import
|
|
1948
|
-
* @description
|
|
1961
|
+
* @description Deletes the import and every source it produced, and cancels its processing if it is still running. Use it to remove content you added by mistake.
|
|
1949
1962
|
*/
|
|
1950
1963
|
delete: operations['deleteImport'];
|
|
1951
1964
|
options?: never;
|
|
@@ -1962,7 +1975,7 @@ interface paths {
|
|
|
1962
1975
|
};
|
|
1963
1976
|
/**
|
|
1964
1977
|
* Get a download URL for an import
|
|
1965
|
-
* @description
|
|
1978
|
+
* @description Returns a short-lived signed URL that downloads the import's original content. Use the URL before `expiresAt`. Only file and text imports keep their original content. For crawl and dataset imports, the request returns `409` with code `importInvalidState`.
|
|
1966
1979
|
*/
|
|
1967
1980
|
get: operations['downloadImport'];
|
|
1968
1981
|
put?: never;
|
|
@@ -1983,8 +1996,8 @@ interface paths {
|
|
|
1983
1996
|
get?: never;
|
|
1984
1997
|
put?: never;
|
|
1985
1998
|
/**
|
|
1986
|
-
*
|
|
1987
|
-
* @description Creates a standing
|
|
1999
|
+
* Create an instruction
|
|
2000
|
+
* @description Creates a standing instruction for how entries that cite its sources are written. Every instruction applies to specific sources, set in `scopeSourceIds`. To rebuild entries under the new instruction right away, pass their paths in `rebuildPaths`. The response includes the rebuild job ID, or `null` if the rebuild could not start. The instruction is saved either way. After the instruction is saved, a background check files issues for entries that contradict it. If you already checked the instruction for contradictions, set `verified` to skip the background check. If the requested rebuild does not start, the background check runs even when `verified` is set.
|
|
1988
2001
|
*/
|
|
1989
2002
|
post: operations['createInstruction'];
|
|
1990
2003
|
delete?: never;
|
|
@@ -2005,14 +2018,14 @@ interface paths {
|
|
|
2005
2018
|
post?: never;
|
|
2006
2019
|
/**
|
|
2007
2020
|
* Delete an instruction
|
|
2008
|
-
* @description Deletes the
|
|
2021
|
+
* @description Deletes the instruction. Builds stop applying it from the next run.
|
|
2009
2022
|
*/
|
|
2010
2023
|
delete: operations['deleteInstruction'];
|
|
2011
2024
|
options?: never;
|
|
2012
2025
|
head?: never;
|
|
2013
2026
|
/**
|
|
2014
|
-
*
|
|
2015
|
-
* @description
|
|
2027
|
+
* Update an instruction
|
|
2028
|
+
* @description Updates the instruction's statement or sources. The change applies from the next build. Any update also reactivates an archived instruction and ties it to the current content of its sources.
|
|
2016
2029
|
*/
|
|
2017
2030
|
patch: operations['updateInstruction'];
|
|
2018
2031
|
trace?: never;
|
|
@@ -2027,8 +2040,8 @@ interface paths {
|
|
|
2027
2040
|
get?: never;
|
|
2028
2041
|
put?: never;
|
|
2029
2042
|
/**
|
|
2030
|
-
*
|
|
2031
|
-
* @description
|
|
2043
|
+
* Accept and apply issues
|
|
2044
|
+
* @description Accepts the issues in `issueIds`, then queues a job that applies them, rewrites the affected entries, and saves a new revision. Returns a job ID. IDs of issues that no longer exist are skipped.
|
|
2032
2045
|
*/
|
|
2033
2046
|
post: operations['applyIssues'];
|
|
2034
2047
|
delete?: never;
|
|
@@ -2048,7 +2061,7 @@ interface paths {
|
|
|
2048
2061
|
put?: never;
|
|
2049
2062
|
/**
|
|
2050
2063
|
* Dismiss an issue
|
|
2051
|
-
* @description Marks the issue rejected.
|
|
2064
|
+
* @description Marks the issue as rejected. If the issue already left triage, the request returns it unchanged. Returns `422` with code `issueDocumentInvalid` if the issue document was edited into a shape the API cannot verify. Returns `409` with code `issueTransitionConflict` if another change to the issue happened at the same time. You can safely retry a `409`.
|
|
2052
2065
|
*/
|
|
2053
2066
|
post: operations['dismissIssue'];
|
|
2054
2067
|
delete?: never;
|
|
@@ -2068,7 +2081,7 @@ interface paths {
|
|
|
2068
2081
|
put?: never;
|
|
2069
2082
|
/**
|
|
2070
2083
|
* Reopen an accepted conflict
|
|
2071
|
-
* @description Returns an accepted conflict to triage,
|
|
2084
|
+
* @description Returns an accepted conflict issue to triage, clears its resolution, and deletes the instruction the resolution created. Reopening an open or dismissed conflict returns it unchanged. Other issue types return `422` with code `issueNotResolvable`.
|
|
2072
2085
|
*/
|
|
2073
2086
|
post: operations['reopenIssue'];
|
|
2074
2087
|
delete?: never;
|
|
@@ -2088,7 +2101,7 @@ interface paths {
|
|
|
2088
2101
|
put?: never;
|
|
2089
2102
|
/**
|
|
2090
2103
|
* Resolve a conflict issue
|
|
2091
|
-
* @description
|
|
2104
|
+
* @description Resolves a conflict issue by choosing one of its sides. Set `resolution` to the index of a side in `content.sides`. For a conflict on a single entry, index `0` is the entry's current content, so choosing it keeps the entry as it is. Choosing any other side rewrites the entry, and the returned `jobId` tracks the rewrite. The decision becomes a standing instruction for every future build, and `resolvedBy` records who made it. To change a decision, resolve the accepted conflict again. Other issue types, dismissed conflicts, and out-of-range indexes return `422` with code `issueNotResolvable`.
|
|
2092
2105
|
*/
|
|
2093
2106
|
post: operations['resolveIssue'];
|
|
2094
2107
|
delete?: never;
|
|
@@ -2105,8 +2118,8 @@ interface paths {
|
|
|
2105
2118
|
cookie?: never;
|
|
2106
2119
|
};
|
|
2107
2120
|
/**
|
|
2108
|
-
* Get a job
|
|
2109
|
-
* @description Returns the status of a job, such as a build,
|
|
2121
|
+
* Get a job
|
|
2122
|
+
* @description Returns the status of a background job, such as a build, import, or refresh. The endpoint that starts the work returns the job ID.
|
|
2110
2123
|
*/
|
|
2111
2124
|
get: operations['getJob'];
|
|
2112
2125
|
put?: never;
|
|
@@ -2127,8 +2140,8 @@ interface paths {
|
|
|
2127
2140
|
get?: never;
|
|
2128
2141
|
put?: never;
|
|
2129
2142
|
/**
|
|
2130
|
-
*
|
|
2131
|
-
* @description Queues a refresh
|
|
2143
|
+
* Refresh a knowledge base
|
|
2144
|
+
* @description Queues a refresh that recrawls website sources, re-syncs dataset sources, compares the result with the last build, and files issues for what changed. Returns a job ID. If a refresh is already running, the response has `started: false` and that refresh's job ID. Supports the `Idempotency-Key` header.
|
|
2132
2145
|
*/
|
|
2133
2146
|
post: operations['refreshKnowledgeBase'];
|
|
2134
2147
|
delete?: never;
|
|
@@ -2146,7 +2159,7 @@ interface paths {
|
|
|
2146
2159
|
};
|
|
2147
2160
|
/**
|
|
2148
2161
|
* List sources
|
|
2149
|
-
* @description
|
|
2162
|
+
* @description Lists the sources in a knowledge base: the pages, files, and documents that imports produce and builds cite. Sources are read-only. To add content, create an import. Results are cursor-paginated, and you can filter them by `status`.
|
|
2150
2163
|
*/
|
|
2151
2164
|
get: operations['listSources'];
|
|
2152
2165
|
put?: never;
|
|
@@ -2165,15 +2178,15 @@ interface paths {
|
|
|
2165
2178
|
cookie?: never;
|
|
2166
2179
|
};
|
|
2167
2180
|
/**
|
|
2168
|
-
* Get a
|
|
2169
|
-
* @description Returns
|
|
2181
|
+
* Get a source
|
|
2182
|
+
* @description Returns a source with its metadata and processing status.
|
|
2170
2183
|
*/
|
|
2171
2184
|
get: operations['getSource'];
|
|
2172
2185
|
put?: never;
|
|
2173
2186
|
post?: never;
|
|
2174
2187
|
/**
|
|
2175
2188
|
* Delete a source
|
|
2176
|
-
* @description
|
|
2189
|
+
* @description Deletes the source immediately. Entries that cite it stay the same until the next build or refresh, which removes the citations and proposes removing any entry left with no sources.
|
|
2177
2190
|
*/
|
|
2178
2191
|
delete: operations['deleteSource'];
|
|
2179
2192
|
options?: never;
|
|
@@ -2189,8 +2202,8 @@ interface paths {
|
|
|
2189
2202
|
cookie?: never;
|
|
2190
2203
|
};
|
|
2191
2204
|
/**
|
|
2192
|
-
*
|
|
2193
|
-
* @description
|
|
2205
|
+
* Get a source's distilled content
|
|
2206
|
+
* @description Returns the source's distilled content: the markdown extracted from the original page, file, or document, which is the text builds cite. Use it to check an issue's claims against the sources listed in its `citedSourceIds`. To fetch a range of lines, set `startLine` and `endLine` (1-indexed, inclusive). The response is JSON by default. Set `format` to `markdown` or `plain` to get the text alone. Until the source finishes processing, the request returns `409` with code `sourceNotDistilled`.
|
|
2194
2207
|
*/
|
|
2195
2208
|
get: operations['getSourceContent'];
|
|
2196
2209
|
put?: never;
|
|
@@ -2211,7 +2224,13 @@ interface paths {
|
|
|
2211
2224
|
get?: never;
|
|
2212
2225
|
/**
|
|
2213
2226
|
* Record a conversation
|
|
2214
|
-
* @description
|
|
2227
|
+
* @description Creates or updates the recorded conversation for one thread. `threadId` identifies the conversation within your organization, so saving with the same `threadId` updates the same conversation. Requires Context Editor access or higher.
|
|
2228
|
+
*
|
|
2229
|
+
* Each save replaces the stored messages. `metadata`, `sharing`, and the model fields change only when you include them. `tokenUsage` is cumulative: send the usage for one generation call, and the API adds it to the conversation total. Usage is added only when the save changes the messages, so retries don't count it twice.
|
|
2230
|
+
*
|
|
2231
|
+
* To report a failure, set `error` on the message where it happened: the tool result for a failed tool call, or the assistant message for a turn that failed instead of answering. The Insights dashboard highlights conversations with a failed turn and counts failed tool calls separately, because agents often recover from them.
|
|
2232
|
+
*
|
|
2233
|
+
* The last write for a thread wins, so retries are safe. `sharing` records whether you share telemetry with Sanity: metrics only, or full transcripts.
|
|
2215
2234
|
*/
|
|
2216
2235
|
put: operations['saveConversation'];
|
|
2217
2236
|
post?: never;
|
|
@@ -2219,8 +2238,13 @@ interface paths {
|
|
|
2219
2238
|
options?: never;
|
|
2220
2239
|
head?: never;
|
|
2221
2240
|
/**
|
|
2222
|
-
* Record a classification
|
|
2223
|
-
* @description Records the classification your own model produced for one thread
|
|
2241
|
+
* Record a conversation classification
|
|
2242
|
+
* @description Records the classification your own model produced for one thread. Send exactly one of these fields:
|
|
2243
|
+
*
|
|
2244
|
+
* - `coreMetrics`: the classification result. The API sets `classifiedAt` and clears any recorded failure.
|
|
2245
|
+
* - `classificationError`: why classification failed. Any earlier result stays unchanged.
|
|
2246
|
+
*
|
|
2247
|
+
* Requires the same access as recording a conversation. The last write wins, so a new classification replaces the previous one.
|
|
2224
2248
|
*/
|
|
2225
2249
|
patch: operations['classifyConversation'];
|
|
2226
2250
|
trace?: never;
|
|
@@ -2228,91 +2252,162 @@ interface paths {
|
|
|
2228
2252
|
}
|
|
2229
2253
|
interface components {
|
|
2230
2254
|
schemas: {
|
|
2231
|
-
/** @description A `sanity.context.conversation` document
|
|
2255
|
+
/** @description A `sanity.context.conversation` document: one agent conversation and its classification, stored in your organization's document store. No endpoint returns this document. Use this schema to type GROQ query results. To record conversations, use the conversations endpoints. */
|
|
2232
2256
|
ConversationDoc: {
|
|
2257
|
+
/** @description The document ID. */
|
|
2233
2258
|
_id: string;
|
|
2259
|
+
/** @description The document revision. It changes on every write. */
|
|
2234
2260
|
_rev: string;
|
|
2235
|
-
/**
|
|
2261
|
+
/**
|
|
2262
|
+
* Format: date-time
|
|
2263
|
+
* @description When the document was created, as an ISO 8601 timestamp.
|
|
2264
|
+
*/
|
|
2236
2265
|
_createdAt: string;
|
|
2237
|
-
/**
|
|
2266
|
+
/**
|
|
2267
|
+
* Format: date-time
|
|
2268
|
+
* @description When the document was last changed, as an ISO 8601 timestamp.
|
|
2269
|
+
*/
|
|
2238
2270
|
_updatedAt: string;
|
|
2239
|
-
/**
|
|
2271
|
+
/**
|
|
2272
|
+
* @description The document type. Always `sanity.context.conversation`.
|
|
2273
|
+
* @enum {string}
|
|
2274
|
+
*/
|
|
2240
2275
|
_type: 'sanity.context.conversation';
|
|
2241
|
-
/**
|
|
2276
|
+
/**
|
|
2277
|
+
* @description The version of the document shape. Currently `1`.
|
|
2278
|
+
* @enum {number}
|
|
2279
|
+
*/
|
|
2242
2280
|
schemaVersion: 1;
|
|
2281
|
+
/** @description The ID of the organization that owns the conversation. Filter on it in every query, because the document store also holds documents from other features. */
|
|
2243
2282
|
organizationId: string;
|
|
2283
|
+
/** @description Your identifier for the conversation thread, unique within the organization. It is the `threadId` in the conversations endpoint path and determines the document `_id`. */
|
|
2244
2284
|
threadId: string;
|
|
2245
|
-
/** @description
|
|
2285
|
+
/** @description Tags that describe the conversation, such as `mcpEndpoints`, `app`, and `environment`. Filter on them in GROQ queries. `null` until a save includes `metadata`. */
|
|
2246
2286
|
metadata: {
|
|
2247
2287
|
[key: string]: string | string[];
|
|
2248
2288
|
} | null;
|
|
2249
|
-
/**
|
|
2289
|
+
/**
|
|
2290
|
+
* Format: date-time
|
|
2291
|
+
* @description When the API received the first save for this thread, as an ISO 8601 timestamp.
|
|
2292
|
+
*/
|
|
2250
2293
|
startedAt: string;
|
|
2251
|
-
/**
|
|
2294
|
+
/**
|
|
2295
|
+
* Format: date-time
|
|
2296
|
+
* @description When the conversation was last saved, as an ISO 8601 timestamp.
|
|
2297
|
+
*/
|
|
2252
2298
|
messagesUpdatedAt: string;
|
|
2299
|
+
/** @description The conversation transcript, in order. Each save replaces it. */
|
|
2253
2300
|
messages: {
|
|
2254
|
-
/**
|
|
2301
|
+
/**
|
|
2302
|
+
* @description Who sent the message. `user` is the person talking to the agent, `assistant` is the agent, `system` is a system prompt, and `tool` is a tool call or tool result.
|
|
2303
|
+
* @enum {string}
|
|
2304
|
+
*/
|
|
2255
2305
|
role: 'user' | 'assistant' | 'system' | 'tool';
|
|
2256
|
-
/**
|
|
2306
|
+
/**
|
|
2307
|
+
* @description The message text. `null` when the message has no text, such as a tool call.
|
|
2308
|
+
* @default null
|
|
2309
|
+
*/
|
|
2257
2310
|
content: string | null;
|
|
2258
|
-
/**
|
|
2311
|
+
/**
|
|
2312
|
+
* @description The name of the tool for a `tool` message. `null` on other messages.
|
|
2313
|
+
* @default null
|
|
2314
|
+
*/
|
|
2259
2315
|
toolName: string | null;
|
|
2260
2316
|
/**
|
|
2317
|
+
* @description The kind of `tool` message. `call` is the agent calling the tool, and `result` is what the tool returned. `null` on other messages.
|
|
2261
2318
|
* @default null
|
|
2262
2319
|
* @enum {string|null}
|
|
2263
2320
|
*/
|
|
2264
2321
|
toolType: 'call' | 'result' | null;
|
|
2265
|
-
/**
|
|
2322
|
+
/**
|
|
2323
|
+
* @description Why this step failed, including any stack trace. Set it on the tool result for a failed tool call, or on the assistant message for a turn that failed instead of answering. `null` when the step succeeded.
|
|
2324
|
+
* @default null
|
|
2325
|
+
*/
|
|
2266
2326
|
error: string | null;
|
|
2267
2327
|
/**
|
|
2268
2328
|
* Format: date-time
|
|
2329
|
+
* @description When the API first received this message, as an ISO 8601 timestamp. The API sets it. Resending an unchanged message at the same position keeps its timestamp. `null` for messages recorded before timestamps existed.
|
|
2269
2330
|
* @default null
|
|
2270
2331
|
*/
|
|
2271
2332
|
timestamp: string | null;
|
|
2272
2333
|
}[];
|
|
2334
|
+
/** @description The provider of the model the agent used. `null` until a save includes `modelProvider`. */
|
|
2273
2335
|
modelProvider: string | null;
|
|
2336
|
+
/** @description The ID of the model the agent used. `null` until a save includes `modelId`. */
|
|
2274
2337
|
modelId: string | null;
|
|
2275
|
-
/** @description
|
|
2338
|
+
/** @description The running total of token usage for the conversation. `null` until a save includes `tokenUsage`. */
|
|
2276
2339
|
tokenUsage: {
|
|
2340
|
+
/** @description The number of input tokens. */
|
|
2277
2341
|
inputTokens?: number;
|
|
2342
|
+
/** @description The number of output tokens. */
|
|
2278
2343
|
outputTokens?: number;
|
|
2344
|
+
/** @description The total number of tokens. */
|
|
2279
2345
|
totalTokens?: number;
|
|
2280
2346
|
} | null;
|
|
2281
|
-
/** @description
|
|
2347
|
+
/** @description The latest classification result. `null` until you record one. */
|
|
2282
2348
|
coreMetrics: {
|
|
2349
|
+
/** @description How well the agent resolved the user's needs, from 1 to 10. */
|
|
2283
2350
|
successScore?: number;
|
|
2284
|
-
/**
|
|
2351
|
+
/**
|
|
2352
|
+
* @description The overall sentiment of the conversation.
|
|
2353
|
+
* @enum {string}
|
|
2354
|
+
*/
|
|
2285
2355
|
sentiment?: 'positive' | 'neutral' | 'negative';
|
|
2356
|
+
/** @description Topics the agent couldn't answer because it lacked content. */
|
|
2286
2357
|
contentGaps?: string[];
|
|
2287
2358
|
} | null;
|
|
2288
|
-
/**
|
|
2359
|
+
/**
|
|
2360
|
+
* Format: date-time
|
|
2361
|
+
* @description When the latest classification result was recorded, as an ISO 8601 timestamp. The API sets it. `null` until you record a result.
|
|
2362
|
+
*/
|
|
2289
2363
|
classifiedAt: string | null;
|
|
2364
|
+
/** @description Why your classifier couldn't classify the conversation. `null` when no failure is recorded. Recording a result clears it. */
|
|
2290
2365
|
classificationError: string | null;
|
|
2291
2366
|
/**
|
|
2292
|
-
* @description
|
|
2367
|
+
* @description Your choice to share conversation telemetry with Sanity. `null` until a save includes `sharing`.
|
|
2293
2368
|
* @default null
|
|
2294
2369
|
*/
|
|
2295
2370
|
sharing: {
|
|
2371
|
+
/** @description Whether to share classification metrics with Sanity: scores, sentiment, content gap counts, message counts and sizes, tool names, and model and token usage. Message content is not included. */
|
|
2296
2372
|
metrics?: boolean;
|
|
2373
|
+
/** @description Whether to share full conversation transcripts with Sanity. When `true`, the API also sets `metrics` to `true`. */
|
|
2297
2374
|
conversations?: boolean;
|
|
2375
|
+
/** @description How the Sanity team can reach you about your agent, such as an email address or a Discord handle. */
|
|
2298
2376
|
contact?: string;
|
|
2299
2377
|
} | null;
|
|
2300
2378
|
};
|
|
2301
|
-
/** @description A `sanity.context.entry` document
|
|
2379
|
+
/** @description A `sanity.context.entry` document: one entry in a knowledge base outline, stored in your organization's document store. No endpoint returns this document. Use this schema to type GROQ query results. */
|
|
2302
2380
|
EntryDoc: {
|
|
2381
|
+
/** @description The document ID. */
|
|
2303
2382
|
_id: string;
|
|
2383
|
+
/** @description The document revision. It changes on every write. */
|
|
2304
2384
|
_rev: string;
|
|
2305
|
-
/**
|
|
2385
|
+
/**
|
|
2386
|
+
* Format: date-time
|
|
2387
|
+
* @description When the document was created, as an ISO 8601 timestamp.
|
|
2388
|
+
*/
|
|
2306
2389
|
_createdAt: string;
|
|
2307
|
-
/**
|
|
2390
|
+
/**
|
|
2391
|
+
* Format: date-time
|
|
2392
|
+
* @description When the document was last changed, as an ISO 8601 timestamp.
|
|
2393
|
+
*/
|
|
2308
2394
|
_updatedAt: string;
|
|
2395
|
+
/** @description The ID (`kb…`) of the knowledge base this document belongs to. */
|
|
2309
2396
|
knowledgeBaseId: string;
|
|
2310
|
-
/**
|
|
2397
|
+
/**
|
|
2398
|
+
* @description The document type. Always `sanity.context.entry`.
|
|
2399
|
+
* @enum {string}
|
|
2400
|
+
*/
|
|
2311
2401
|
_type: 'sanity.context.entry';
|
|
2402
|
+
/** @description The version of the document shape. Currently `1`. */
|
|
2312
2403
|
schemaVersion: number;
|
|
2404
|
+
/** @description The ID of the build that last wrote this entry's content. An unchanged entry keeps its earlier value across builds. */
|
|
2313
2405
|
revisionId: string;
|
|
2406
|
+
/** @description The entry's slash-delimited path, such as `docs/api/webhooks`. Order entries by `path` to get the knowledge base outline. */
|
|
2314
2407
|
path: string;
|
|
2408
|
+
/** @description The entry title. */
|
|
2315
2409
|
title: string;
|
|
2410
|
+
/** @description A summary of the entry. `scope` is what the entry covers, and `excludes` is what it does not cover. `neighbors` lists the paths of related entries. `centrality` is how important the entry is: `core`, `standard`, or `peripheral`. */
|
|
2316
2411
|
tldr?: {
|
|
2317
2412
|
scope: string;
|
|
2318
2413
|
excludes: string;
|
|
@@ -2320,297 +2415,599 @@ interface components {
|
|
|
2320
2415
|
/** @enum {string} */
|
|
2321
2416
|
centrality: 'core' | 'standard' | 'peripheral';
|
|
2322
2417
|
};
|
|
2418
|
+
/** @description The entry content in Markdown, with inline `[N]` citation markers. Absent when the entry has no content of its own, such as a `virtual` entry. */
|
|
2323
2419
|
body?: string;
|
|
2420
|
+
/** @description The H2 and H3 heading titles in `body`. Absent when the entry has no `body`. */
|
|
2324
2421
|
topicHeadings?: string[];
|
|
2422
|
+
/** @description The sources that back this entry, one item per source. */
|
|
2325
2423
|
citations?: {
|
|
2424
|
+
/** @description ID of the cited source. */
|
|
2326
2425
|
sourceId: string;
|
|
2426
|
+
/** @description Which facts in the entry body this source backs, in a short phrase. */
|
|
2327
2427
|
supports?: string;
|
|
2428
|
+
/** @description Line ranges in the source's distilled content that back those facts, with the quoted text. */
|
|
2328
2429
|
spans?: {
|
|
2430
|
+
/** @description First line of the range, counting from 1. Line numbers match `GET .../sources/{sourceId}/content`. */
|
|
2329
2431
|
sourceLineStart: number;
|
|
2432
|
+
/** @description Last line of the range, inclusive. */
|
|
2330
2433
|
sourceLineEnd: number;
|
|
2434
|
+
/** @description The exact text of the line range in the source. */
|
|
2331
2435
|
quote: string;
|
|
2332
2436
|
}[];
|
|
2437
|
+
/** @description The text in the entry body that this citation backs. */
|
|
2333
2438
|
claim?: {
|
|
2439
|
+
/** @description The exact entry text the citation backs. */
|
|
2334
2440
|
exact: string;
|
|
2441
|
+
/** @description Text immediately before `exact`, to tell apart repeated phrases. */
|
|
2335
2442
|
prefix?: string;
|
|
2443
|
+
/** @description Text immediately after `exact`, to tell apart repeated phrases. */
|
|
2336
2444
|
suffix?: string;
|
|
2337
2445
|
};
|
|
2338
2446
|
/** @enum {string} */
|
|
2339
2447
|
groundingState?: 'drifted';
|
|
2448
|
+
/** @description A unique key for this item in the `citations` array. */
|
|
2340
2449
|
_key: string;
|
|
2341
|
-
/**
|
|
2450
|
+
/**
|
|
2451
|
+
* @description The citation type. Always `sanity.context.citation`.
|
|
2452
|
+
* @enum {string}
|
|
2453
|
+
*/
|
|
2342
2454
|
_type: 'sanity.context.citation';
|
|
2455
|
+
/** @description A display name for the cited source. Builds currently set it to the `sourceId`. */
|
|
2343
2456
|
filename: string;
|
|
2344
2457
|
mime?: string;
|
|
2345
2458
|
excerpt?: string;
|
|
2346
2459
|
}[];
|
|
2347
|
-
/**
|
|
2460
|
+
/**
|
|
2461
|
+
* @description The entry state. Builds currently write only two values: `virtual` for an entry that groups child entries and has no `body`, and `filled` for an entry with a written `body`. The other values are reserved.
|
|
2462
|
+
* @enum {string}
|
|
2463
|
+
*/
|
|
2348
2464
|
status: 'virtual' | 'outlined' | 'filled' | 'stale' | 'generation_failed';
|
|
2465
|
+
/** @description When the build that last wrote this entry's content ran, as an ISO 8601 timestamp. */
|
|
2349
2466
|
generatedAt: string;
|
|
2350
2467
|
};
|
|
2351
|
-
/** @description A `sanity.context.instruction` document
|
|
2468
|
+
/** @description A `sanity.context.instruction` document: a standing instruction that steers every build, stored in your organization's document store. No endpoint returns this document. Use this schema to type GROQ query results. To change instructions, use the instructions endpoints. */
|
|
2352
2469
|
InstructionDoc: {
|
|
2470
|
+
/** @description The document ID. */
|
|
2353
2471
|
_id: string;
|
|
2472
|
+
/** @description The document revision. It changes on every write. */
|
|
2354
2473
|
_rev: string;
|
|
2355
|
-
/**
|
|
2474
|
+
/**
|
|
2475
|
+
* Format: date-time
|
|
2476
|
+
* @description When the document was created, as an ISO 8601 timestamp.
|
|
2477
|
+
*/
|
|
2356
2478
|
_createdAt: string;
|
|
2357
|
-
/**
|
|
2479
|
+
/**
|
|
2480
|
+
* Format: date-time
|
|
2481
|
+
* @description When the document was last changed, as an ISO 8601 timestamp.
|
|
2482
|
+
*/
|
|
2358
2483
|
_updatedAt: string;
|
|
2484
|
+
/** @description The ID (`kb…`) of the knowledge base this document belongs to. */
|
|
2359
2485
|
knowledgeBaseId: string;
|
|
2360
|
-
/**
|
|
2486
|
+
/**
|
|
2487
|
+
* @description The document type. Always `sanity.context.instruction`.
|
|
2488
|
+
* @enum {string}
|
|
2489
|
+
*/
|
|
2361
2490
|
_type: 'sanity.context.instruction';
|
|
2362
|
-
/**
|
|
2491
|
+
/**
|
|
2492
|
+
* @description The version of the document shape. Currently `1`. An instruction without the current version doesn't appear in lists and doesn't affect builds.
|
|
2493
|
+
* @enum {number}
|
|
2494
|
+
*/
|
|
2363
2495
|
schemaVersion: 1;
|
|
2496
|
+
/** @description The instruction, in plain language. Builds follow it over the raw sources. */
|
|
2364
2497
|
statement: string;
|
|
2498
|
+
/** @description The sources the instruction is tied to. The instruction affects the entries that cite these sources. The API always sets at least one source. When `null`, the instruction isn't tied to any source and doesn't affect builds. */
|
|
2365
2499
|
scopeSources: {
|
|
2500
|
+
/** @description A unique key for this item in the array. It matches `sourceId`. */
|
|
2366
2501
|
_key: string;
|
|
2502
|
+
/** @description The ID of the source the instruction is tied to. */
|
|
2367
2503
|
sourceId: string;
|
|
2504
|
+
/** @description The source's content hash when the instruction was last checked against it. When the source content changes, the instruction is checked again. */
|
|
2368
2505
|
contentHash: string;
|
|
2369
2506
|
}[] | null;
|
|
2370
|
-
/**
|
|
2507
|
+
/**
|
|
2508
|
+
* @description The instruction state. `active` instructions apply to every build. `archived` instructions don't apply: a source changed and no longer supports the instruction. Editing an archived instruction makes it `active` again.
|
|
2509
|
+
* @enum {string}
|
|
2510
|
+
*/
|
|
2371
2511
|
status: 'active' | 'archived';
|
|
2512
|
+
/** @description When the instruction was archived, as an ISO 8601 timestamp. `null` while `active`. */
|
|
2372
2513
|
archivedAt: string | null;
|
|
2514
|
+
/** @description Why the instruction was archived. `null` while `active`. */
|
|
2373
2515
|
archivedReason: string | null;
|
|
2374
|
-
/**
|
|
2516
|
+
/**
|
|
2517
|
+
* @description Where the instruction came from. `conflict` means it was created when you resolved a conflict issue.
|
|
2518
|
+
* @enum {string}
|
|
2519
|
+
*/
|
|
2375
2520
|
origin: 'conflict';
|
|
2521
|
+
/** @description The `_id` of the conflict issue this instruction resolved. Reopening that issue deletes this instruction. */
|
|
2376
2522
|
sourceIssueId: string;
|
|
2377
2523
|
} | {
|
|
2524
|
+
/** @description The document ID. */
|
|
2378
2525
|
_id: string;
|
|
2526
|
+
/** @description The document revision. It changes on every write. */
|
|
2379
2527
|
_rev: string;
|
|
2380
|
-
/**
|
|
2528
|
+
/**
|
|
2529
|
+
* Format: date-time
|
|
2530
|
+
* @description When the document was created, as an ISO 8601 timestamp.
|
|
2531
|
+
*/
|
|
2381
2532
|
_createdAt: string;
|
|
2382
|
-
/**
|
|
2533
|
+
/**
|
|
2534
|
+
* Format: date-time
|
|
2535
|
+
* @description When the document was last changed, as an ISO 8601 timestamp.
|
|
2536
|
+
*/
|
|
2383
2537
|
_updatedAt: string;
|
|
2538
|
+
/** @description The ID (`kb…`) of the knowledge base this document belongs to. */
|
|
2384
2539
|
knowledgeBaseId: string;
|
|
2385
|
-
/**
|
|
2540
|
+
/**
|
|
2541
|
+
* @description The document type. Always `sanity.context.instruction`.
|
|
2542
|
+
* @enum {string}
|
|
2543
|
+
*/
|
|
2386
2544
|
_type: 'sanity.context.instruction';
|
|
2387
|
-
/**
|
|
2545
|
+
/**
|
|
2546
|
+
* @description The version of the document shape. Currently `1`. An instruction without the current version doesn't appear in lists and doesn't affect builds.
|
|
2547
|
+
* @enum {number}
|
|
2548
|
+
*/
|
|
2388
2549
|
schemaVersion: 1;
|
|
2550
|
+
/** @description The instruction, in plain language. Builds follow it over the raw sources. */
|
|
2389
2551
|
statement: string;
|
|
2552
|
+
/** @description The sources the instruction is tied to. The instruction affects the entries that cite these sources. The API always sets at least one source. When `null`, the instruction isn't tied to any source and doesn't affect builds. */
|
|
2390
2553
|
scopeSources: {
|
|
2554
|
+
/** @description A unique key for this item in the array. It matches `sourceId`. */
|
|
2391
2555
|
_key: string;
|
|
2556
|
+
/** @description The ID of the source the instruction is tied to. */
|
|
2392
2557
|
sourceId: string;
|
|
2558
|
+
/** @description The source's content hash when the instruction was last checked against it. When the source content changes, the instruction is checked again. */
|
|
2393
2559
|
contentHash: string;
|
|
2394
2560
|
}[] | null;
|
|
2395
|
-
/**
|
|
2561
|
+
/**
|
|
2562
|
+
* @description The instruction state. `active` instructions apply to every build. `archived` instructions don't apply: a source changed and no longer supports the instruction. Editing an archived instruction makes it `active` again.
|
|
2563
|
+
* @enum {string}
|
|
2564
|
+
*/
|
|
2396
2565
|
status: 'active' | 'archived';
|
|
2566
|
+
/** @description When the instruction was archived, as an ISO 8601 timestamp. `null` while `active`. */
|
|
2397
2567
|
archivedAt: string | null;
|
|
2568
|
+
/** @description Why the instruction was archived. `null` while `active`. */
|
|
2398
2569
|
archivedReason: string | null;
|
|
2399
|
-
/**
|
|
2570
|
+
/**
|
|
2571
|
+
* @description Where the instruction came from. `human` means it was created directly through the API or the dashboard.
|
|
2572
|
+
* @enum {string}
|
|
2573
|
+
*/
|
|
2400
2574
|
origin: 'human';
|
|
2401
|
-
/**
|
|
2575
|
+
/**
|
|
2576
|
+
* @description Always `null` for a `human` instruction.
|
|
2577
|
+
* @enum {string|null}
|
|
2578
|
+
*/
|
|
2402
2579
|
sourceIssueId: null;
|
|
2403
2580
|
};
|
|
2404
|
-
/** @description A `sanity.context.issue` document
|
|
2581
|
+
/** @description A `sanity.context.issue` document: a build finding waiting for triage, stored in your organization's document store. No endpoint returns this document. Use this schema to type GROQ query results and Sanity Function filters. To change an issue's status, use the issues endpoints. Only a `conflict` issue can have a non-null `resolution`. */
|
|
2405
2582
|
IssueDoc: {
|
|
2583
|
+
/** @description The document ID. */
|
|
2406
2584
|
_id: string;
|
|
2585
|
+
/** @description The document revision. It changes on every write. */
|
|
2407
2586
|
_rev: string;
|
|
2408
|
-
/**
|
|
2587
|
+
/**
|
|
2588
|
+
* Format: date-time
|
|
2589
|
+
* @description When the document was created, as an ISO 8601 timestamp.
|
|
2590
|
+
*/
|
|
2409
2591
|
_createdAt: string;
|
|
2410
|
-
/**
|
|
2592
|
+
/**
|
|
2593
|
+
* Format: date-time
|
|
2594
|
+
* @description When the document was last changed, as an ISO 8601 timestamp.
|
|
2595
|
+
*/
|
|
2411
2596
|
_updatedAt: string;
|
|
2597
|
+
/** @description The ID (`kb…`) of the knowledge base this document belongs to. */
|
|
2412
2598
|
knowledgeBaseId: string;
|
|
2413
|
-
/**
|
|
2599
|
+
/**
|
|
2600
|
+
* @description The document type. Always `sanity.context.issue`.
|
|
2601
|
+
* @enum {string}
|
|
2602
|
+
*/
|
|
2414
2603
|
_type: 'sanity.context.issue';
|
|
2415
|
-
/**
|
|
2604
|
+
/**
|
|
2605
|
+
* @description The version of the document shape. Currently `1`.
|
|
2606
|
+
* @enum {number}
|
|
2607
|
+
*/
|
|
2416
2608
|
schemaVersion: 1;
|
|
2417
|
-
/** @description
|
|
2609
|
+
/** @description What an issue found. The shape depends on `kind`. */
|
|
2418
2610
|
content: {
|
|
2419
|
-
/**
|
|
2611
|
+
/**
|
|
2612
|
+
* @description How serious the issue is. `critical`: content is wrong or missing in a way that can mislead an agent. `suggestion`: a change that improves quality.
|
|
2613
|
+
* @enum {string}
|
|
2614
|
+
*/
|
|
2420
2615
|
severity: 'critical' | 'suggestion';
|
|
2616
|
+
/** @description Path of the entry the issue is about, or `*` when it applies to the whole knowledge base. For `add_entry`, the path of the proposed entry. */
|
|
2421
2617
|
scopePath: string;
|
|
2618
|
+
/** @description What the problem is, in one or two sentences. */
|
|
2422
2619
|
issue: string;
|
|
2620
|
+
/** @description What to do to fix the issue. */
|
|
2423
2621
|
suggestedFix: string;
|
|
2424
|
-
/**
|
|
2622
|
+
/**
|
|
2623
|
+
* @description The issue type. `conflict` means two or more positions disagree on the same fact, and you choose which one is correct.
|
|
2624
|
+
* @enum {string}
|
|
2625
|
+
*/
|
|
2425
2626
|
kind: 'conflict';
|
|
2627
|
+
/** @description A key naming the disputed fact, such as `free_tier.request_limit`. It never includes the disputed value, so every side shares it. */
|
|
2426
2628
|
claimKey: string;
|
|
2629
|
+
/** @description The conflicting positions, at least two. To resolve the conflict, pass the index of one side as `resolution`. */
|
|
2427
2630
|
sides: {
|
|
2631
|
+
/** @description The position as a self-contained sentence. This is the option you choose from. */
|
|
2428
2632
|
claim: string;
|
|
2633
|
+
/** @description The disputed value on its own, such as `10,000/month`, without the sentence. */
|
|
2429
2634
|
value?: string;
|
|
2635
|
+
/** @description Paths of the entries that state this position. */
|
|
2430
2636
|
entryPaths?: string[];
|
|
2637
|
+
/** @description IDs of the sources that directly back this position. */
|
|
2431
2638
|
sourceIds?: string[];
|
|
2432
|
-
/** @description
|
|
2639
|
+
/** @description Where in a source this position was read. */
|
|
2433
2640
|
span?: {
|
|
2641
|
+
/** @description ID of the source the position was read from. */
|
|
2434
2642
|
sourceId: string;
|
|
2643
|
+
/** @description First line of the range, counting from 1. Line numbers match `GET .../sources/{sourceId}/content`. */
|
|
2435
2644
|
lineStart: number;
|
|
2645
|
+
/** @description Last line of the range, inclusive. */
|
|
2436
2646
|
lineEnd: number;
|
|
2437
2647
|
};
|
|
2438
|
-
/**
|
|
2648
|
+
/**
|
|
2649
|
+
* @description How much weight the sources behind this position carry. `primary`: your own content, such as uploaded files and pages on your own site. `secondary`: other sources. `community`: forums and Q&A sites.
|
|
2650
|
+
* @enum {string}
|
|
2651
|
+
*/
|
|
2439
2652
|
authority?: 'primary' | 'secondary' | 'community';
|
|
2440
2653
|
}[];
|
|
2654
|
+
/** @description Index in `sides` of the suggested side, when there is one. It is only a hint: nothing is chosen until you resolve the issue. */
|
|
2441
2655
|
suggested?: number;
|
|
2442
2656
|
} | {
|
|
2443
|
-
/**
|
|
2657
|
+
/**
|
|
2658
|
+
* @description How serious the issue is. `critical`: content is wrong or missing in a way that can mislead an agent. `suggestion`: a change that improves quality.
|
|
2659
|
+
* @enum {string}
|
|
2660
|
+
*/
|
|
2444
2661
|
severity: 'critical' | 'suggestion';
|
|
2662
|
+
/** @description Path of the entry the issue is about, or `*` when it applies to the whole knowledge base. For `add_entry`, the path of the proposed entry. */
|
|
2445
2663
|
scopePath: string;
|
|
2664
|
+
/** @description What the problem is, in one or two sentences. */
|
|
2446
2665
|
issue: string;
|
|
2666
|
+
/** @description What to do to fix the issue. */
|
|
2447
2667
|
suggestedFix: string;
|
|
2448
|
-
/**
|
|
2668
|
+
/**
|
|
2669
|
+
* @description The issue type. `gap`: your sources cover material that entries leave out. `update_required`: an entry is out of date with its sources or contradicts an instruction, and needs a rewrite. `add_entry`: your sources cover a topic that no entry covers. `remove_entry`: an entry has lost its sources or its topic no longer applies. `split_entry`: an entry covers several distinct topics and should become child entries. `merge_entry`: an entry has too few sources to stand alone, so merge it into a nearby entry or keep it as it is.
|
|
2670
|
+
* @enum {string}
|
|
2671
|
+
*/
|
|
2449
2672
|
kind: 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
2673
|
+
/** @description IDs of the sources that led to the issue. For `add_entry`, the sources the new entry would cite. */
|
|
2450
2674
|
citedSourceIds?: string[];
|
|
2675
|
+
/** @description A key naming the specific finding, when the check that found it sets one. */
|
|
2451
2676
|
claimKey?: string;
|
|
2677
|
+
/** @description Paths of the entries the issue involves, when it spans more than one entry. */
|
|
2452
2678
|
involvedScopes?: string[];
|
|
2453
2679
|
};
|
|
2680
|
+
/** @description An identity for the finding that doesn't depend on its wording. It determines the issue's `_id`, so a reworded finding updates the same issue. */
|
|
2454
2681
|
fingerprint: string;
|
|
2682
|
+
/** @description The ID of the build that filed this issue. `null` when the issue was filed outside a build, such as when removing a source leaves an entry without sources. */
|
|
2455
2683
|
revisionId: string | null;
|
|
2456
|
-
/**
|
|
2684
|
+
/**
|
|
2685
|
+
* @description The issue status. `open` means it is waiting for triage.
|
|
2686
|
+
* @enum {string}
|
|
2687
|
+
*/
|
|
2457
2688
|
status: 'open';
|
|
2458
|
-
/**
|
|
2689
|
+
/**
|
|
2690
|
+
* @description Always `null` while the issue is `open`.
|
|
2691
|
+
* @enum {string|null}
|
|
2692
|
+
*/
|
|
2459
2693
|
resolution: null;
|
|
2460
|
-
/**
|
|
2694
|
+
/**
|
|
2695
|
+
* @description Always `null` while the issue is `open`.
|
|
2696
|
+
* @enum {string|null}
|
|
2697
|
+
*/
|
|
2461
2698
|
resolvedAt: null;
|
|
2462
|
-
/**
|
|
2699
|
+
/**
|
|
2700
|
+
* @description Always `null` while the issue is `open`.
|
|
2701
|
+
* @enum {string|null}
|
|
2702
|
+
*/
|
|
2463
2703
|
resolvedBy: null;
|
|
2464
2704
|
} | {
|
|
2705
|
+
/** @description The document ID. */
|
|
2465
2706
|
_id: string;
|
|
2707
|
+
/** @description The document revision. It changes on every write. */
|
|
2466
2708
|
_rev: string;
|
|
2467
|
-
/**
|
|
2709
|
+
/**
|
|
2710
|
+
* Format: date-time
|
|
2711
|
+
* @description When the document was created, as an ISO 8601 timestamp.
|
|
2712
|
+
*/
|
|
2468
2713
|
_createdAt: string;
|
|
2469
|
-
/**
|
|
2714
|
+
/**
|
|
2715
|
+
* Format: date-time
|
|
2716
|
+
* @description When the document was last changed, as an ISO 8601 timestamp.
|
|
2717
|
+
*/
|
|
2470
2718
|
_updatedAt: string;
|
|
2719
|
+
/** @description The ID (`kb…`) of the knowledge base this document belongs to. */
|
|
2471
2720
|
knowledgeBaseId: string;
|
|
2472
|
-
/**
|
|
2721
|
+
/**
|
|
2722
|
+
* @description The document type. Always `sanity.context.issue`.
|
|
2723
|
+
* @enum {string}
|
|
2724
|
+
*/
|
|
2473
2725
|
_type: 'sanity.context.issue';
|
|
2474
|
-
/**
|
|
2726
|
+
/**
|
|
2727
|
+
* @description The version of the document shape. Currently `1`.
|
|
2728
|
+
* @enum {number}
|
|
2729
|
+
*/
|
|
2475
2730
|
schemaVersion: 1;
|
|
2476
|
-
/** @description
|
|
2731
|
+
/** @description What an issue found. The shape depends on `kind`. */
|
|
2477
2732
|
content: {
|
|
2478
|
-
/**
|
|
2733
|
+
/**
|
|
2734
|
+
* @description How serious the issue is. `critical`: content is wrong or missing in a way that can mislead an agent. `suggestion`: a change that improves quality.
|
|
2735
|
+
* @enum {string}
|
|
2736
|
+
*/
|
|
2479
2737
|
severity: 'critical' | 'suggestion';
|
|
2738
|
+
/** @description Path of the entry the issue is about, or `*` when it applies to the whole knowledge base. For `add_entry`, the path of the proposed entry. */
|
|
2480
2739
|
scopePath: string;
|
|
2740
|
+
/** @description What the problem is, in one or two sentences. */
|
|
2481
2741
|
issue: string;
|
|
2742
|
+
/** @description What to do to fix the issue. */
|
|
2482
2743
|
suggestedFix: string;
|
|
2483
|
-
/**
|
|
2744
|
+
/**
|
|
2745
|
+
* @description The issue type. `conflict` means two or more positions disagree on the same fact, and you choose which one is correct.
|
|
2746
|
+
* @enum {string}
|
|
2747
|
+
*/
|
|
2484
2748
|
kind: 'conflict';
|
|
2749
|
+
/** @description A key naming the disputed fact, such as `free_tier.request_limit`. It never includes the disputed value, so every side shares it. */
|
|
2485
2750
|
claimKey: string;
|
|
2751
|
+
/** @description The conflicting positions, at least two. To resolve the conflict, pass the index of one side as `resolution`. */
|
|
2486
2752
|
sides: {
|
|
2753
|
+
/** @description The position as a self-contained sentence. This is the option you choose from. */
|
|
2487
2754
|
claim: string;
|
|
2755
|
+
/** @description The disputed value on its own, such as `10,000/month`, without the sentence. */
|
|
2488
2756
|
value?: string;
|
|
2757
|
+
/** @description Paths of the entries that state this position. */
|
|
2489
2758
|
entryPaths?: string[];
|
|
2759
|
+
/** @description IDs of the sources that directly back this position. */
|
|
2490
2760
|
sourceIds?: string[];
|
|
2491
|
-
/** @description
|
|
2761
|
+
/** @description Where in a source this position was read. */
|
|
2492
2762
|
span?: {
|
|
2763
|
+
/** @description ID of the source the position was read from. */
|
|
2493
2764
|
sourceId: string;
|
|
2765
|
+
/** @description First line of the range, counting from 1. Line numbers match `GET .../sources/{sourceId}/content`. */
|
|
2494
2766
|
lineStart: number;
|
|
2767
|
+
/** @description Last line of the range, inclusive. */
|
|
2495
2768
|
lineEnd: number;
|
|
2496
2769
|
};
|
|
2497
|
-
/**
|
|
2770
|
+
/**
|
|
2771
|
+
* @description How much weight the sources behind this position carry. `primary`: your own content, such as uploaded files and pages on your own site. `secondary`: other sources. `community`: forums and Q&A sites.
|
|
2772
|
+
* @enum {string}
|
|
2773
|
+
*/
|
|
2498
2774
|
authority?: 'primary' | 'secondary' | 'community';
|
|
2499
2775
|
}[];
|
|
2776
|
+
/** @description Index in `sides` of the suggested side, when there is one. It is only a hint: nothing is chosen until you resolve the issue. */
|
|
2500
2777
|
suggested?: number;
|
|
2501
2778
|
} | {
|
|
2502
|
-
/**
|
|
2779
|
+
/**
|
|
2780
|
+
* @description How serious the issue is. `critical`: content is wrong or missing in a way that can mislead an agent. `suggestion`: a change that improves quality.
|
|
2781
|
+
* @enum {string}
|
|
2782
|
+
*/
|
|
2503
2783
|
severity: 'critical' | 'suggestion';
|
|
2784
|
+
/** @description Path of the entry the issue is about, or `*` when it applies to the whole knowledge base. For `add_entry`, the path of the proposed entry. */
|
|
2504
2785
|
scopePath: string;
|
|
2786
|
+
/** @description What the problem is, in one or two sentences. */
|
|
2505
2787
|
issue: string;
|
|
2788
|
+
/** @description What to do to fix the issue. */
|
|
2506
2789
|
suggestedFix: string;
|
|
2507
|
-
/**
|
|
2790
|
+
/**
|
|
2791
|
+
* @description The issue type. `gap`: your sources cover material that entries leave out. `update_required`: an entry is out of date with its sources or contradicts an instruction, and needs a rewrite. `add_entry`: your sources cover a topic that no entry covers. `remove_entry`: an entry has lost its sources or its topic no longer applies. `split_entry`: an entry covers several distinct topics and should become child entries. `merge_entry`: an entry has too few sources to stand alone, so merge it into a nearby entry or keep it as it is.
|
|
2792
|
+
* @enum {string}
|
|
2793
|
+
*/
|
|
2508
2794
|
kind: 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
2795
|
+
/** @description IDs of the sources that led to the issue. For `add_entry`, the sources the new entry would cite. */
|
|
2509
2796
|
citedSourceIds?: string[];
|
|
2797
|
+
/** @description A key naming the specific finding, when the check that found it sets one. */
|
|
2510
2798
|
claimKey?: string;
|
|
2799
|
+
/** @description Paths of the entries the issue involves, when it spans more than one entry. */
|
|
2511
2800
|
involvedScopes?: string[];
|
|
2512
2801
|
};
|
|
2802
|
+
/** @description An identity for the finding that doesn't depend on its wording. It determines the issue's `_id`, so a reworded finding updates the same issue. */
|
|
2513
2803
|
fingerprint: string;
|
|
2804
|
+
/** @description The ID of the build that filed this issue. `null` when the issue was filed outside a build, such as when removing a source leaves an entry without sources. */
|
|
2514
2805
|
revisionId: string | null;
|
|
2515
|
-
/**
|
|
2806
|
+
/**
|
|
2807
|
+
* @description The issue status. `accepted` means the issue was resolved or its fix applied.
|
|
2808
|
+
* @enum {string}
|
|
2809
|
+
*/
|
|
2516
2810
|
status: 'accepted';
|
|
2517
|
-
/**
|
|
2811
|
+
/**
|
|
2812
|
+
* Format: date-time
|
|
2813
|
+
* @description When the issue left `open`, as an ISO 8601 timestamp.
|
|
2814
|
+
*/
|
|
2518
2815
|
resolvedAt: string;
|
|
2816
|
+
/** @description Who triaged the issue. `null` while the issue is open, or when the caller could not be identified. */
|
|
2519
2817
|
resolvedBy: {
|
|
2818
|
+
/** @description The ID of the Sanity user or robot token that triaged the issue. */
|
|
2520
2819
|
id: string;
|
|
2521
|
-
/**
|
|
2820
|
+
/**
|
|
2821
|
+
* @description What triaged the issue. `user` is a person, and `robot` is a robot token.
|
|
2822
|
+
* @enum {string}
|
|
2823
|
+
*/
|
|
2522
2824
|
kind: 'user' | 'robot';
|
|
2523
2825
|
} | null;
|
|
2826
|
+
/** @description The index of the chosen side in `content.sides`. For a conflict on one entry, index `0` is the entry's own position. `null` when the fix was applied without choosing a side. */
|
|
2524
2827
|
resolution: number | null;
|
|
2525
2828
|
} | {
|
|
2829
|
+
/** @description The document ID. */
|
|
2526
2830
|
_id: string;
|
|
2831
|
+
/** @description The document revision. It changes on every write. */
|
|
2527
2832
|
_rev: string;
|
|
2528
|
-
/**
|
|
2833
|
+
/**
|
|
2834
|
+
* Format: date-time
|
|
2835
|
+
* @description When the document was created, as an ISO 8601 timestamp.
|
|
2836
|
+
*/
|
|
2529
2837
|
_createdAt: string;
|
|
2530
|
-
/**
|
|
2838
|
+
/**
|
|
2839
|
+
* Format: date-time
|
|
2840
|
+
* @description When the document was last changed, as an ISO 8601 timestamp.
|
|
2841
|
+
*/
|
|
2531
2842
|
_updatedAt: string;
|
|
2843
|
+
/** @description The ID (`kb…`) of the knowledge base this document belongs to. */
|
|
2532
2844
|
knowledgeBaseId: string;
|
|
2533
|
-
/**
|
|
2845
|
+
/**
|
|
2846
|
+
* @description The document type. Always `sanity.context.issue`.
|
|
2847
|
+
* @enum {string}
|
|
2848
|
+
*/
|
|
2534
2849
|
_type: 'sanity.context.issue';
|
|
2535
|
-
/**
|
|
2850
|
+
/**
|
|
2851
|
+
* @description The version of the document shape. Currently `1`.
|
|
2852
|
+
* @enum {number}
|
|
2853
|
+
*/
|
|
2536
2854
|
schemaVersion: 1;
|
|
2537
|
-
/** @description
|
|
2855
|
+
/** @description What an issue found. The shape depends on `kind`. */
|
|
2538
2856
|
content: {
|
|
2539
|
-
/**
|
|
2857
|
+
/**
|
|
2858
|
+
* @description How serious the issue is. `critical`: content is wrong or missing in a way that can mislead an agent. `suggestion`: a change that improves quality.
|
|
2859
|
+
* @enum {string}
|
|
2860
|
+
*/
|
|
2540
2861
|
severity: 'critical' | 'suggestion';
|
|
2862
|
+
/** @description Path of the entry the issue is about, or `*` when it applies to the whole knowledge base. For `add_entry`, the path of the proposed entry. */
|
|
2541
2863
|
scopePath: string;
|
|
2864
|
+
/** @description What the problem is, in one or two sentences. */
|
|
2542
2865
|
issue: string;
|
|
2866
|
+
/** @description What to do to fix the issue. */
|
|
2543
2867
|
suggestedFix: string;
|
|
2544
|
-
/**
|
|
2868
|
+
/**
|
|
2869
|
+
* @description The issue type. `conflict` means two or more positions disagree on the same fact, and you choose which one is correct.
|
|
2870
|
+
* @enum {string}
|
|
2871
|
+
*/
|
|
2545
2872
|
kind: 'conflict';
|
|
2873
|
+
/** @description A key naming the disputed fact, such as `free_tier.request_limit`. It never includes the disputed value, so every side shares it. */
|
|
2546
2874
|
claimKey: string;
|
|
2875
|
+
/** @description The conflicting positions, at least two. To resolve the conflict, pass the index of one side as `resolution`. */
|
|
2547
2876
|
sides: {
|
|
2877
|
+
/** @description The position as a self-contained sentence. This is the option you choose from. */
|
|
2548
2878
|
claim: string;
|
|
2879
|
+
/** @description The disputed value on its own, such as `10,000/month`, without the sentence. */
|
|
2549
2880
|
value?: string;
|
|
2881
|
+
/** @description Paths of the entries that state this position. */
|
|
2550
2882
|
entryPaths?: string[];
|
|
2883
|
+
/** @description IDs of the sources that directly back this position. */
|
|
2551
2884
|
sourceIds?: string[];
|
|
2552
|
-
/** @description
|
|
2885
|
+
/** @description Where in a source this position was read. */
|
|
2553
2886
|
span?: {
|
|
2887
|
+
/** @description ID of the source the position was read from. */
|
|
2554
2888
|
sourceId: string;
|
|
2889
|
+
/** @description First line of the range, counting from 1. Line numbers match `GET .../sources/{sourceId}/content`. */
|
|
2555
2890
|
lineStart: number;
|
|
2891
|
+
/** @description Last line of the range, inclusive. */
|
|
2556
2892
|
lineEnd: number;
|
|
2557
2893
|
};
|
|
2558
|
-
/**
|
|
2894
|
+
/**
|
|
2895
|
+
* @description How much weight the sources behind this position carry. `primary`: your own content, such as uploaded files and pages on your own site. `secondary`: other sources. `community`: forums and Q&A sites.
|
|
2896
|
+
* @enum {string}
|
|
2897
|
+
*/
|
|
2559
2898
|
authority?: 'primary' | 'secondary' | 'community';
|
|
2560
2899
|
}[];
|
|
2900
|
+
/** @description Index in `sides` of the suggested side, when there is one. It is only a hint: nothing is chosen until you resolve the issue. */
|
|
2561
2901
|
suggested?: number;
|
|
2562
2902
|
} | {
|
|
2563
|
-
/**
|
|
2903
|
+
/**
|
|
2904
|
+
* @description How serious the issue is. `critical`: content is wrong or missing in a way that can mislead an agent. `suggestion`: a change that improves quality.
|
|
2905
|
+
* @enum {string}
|
|
2906
|
+
*/
|
|
2564
2907
|
severity: 'critical' | 'suggestion';
|
|
2908
|
+
/** @description Path of the entry the issue is about, or `*` when it applies to the whole knowledge base. For `add_entry`, the path of the proposed entry. */
|
|
2565
2909
|
scopePath: string;
|
|
2910
|
+
/** @description What the problem is, in one or two sentences. */
|
|
2566
2911
|
issue: string;
|
|
2912
|
+
/** @description What to do to fix the issue. */
|
|
2567
2913
|
suggestedFix: string;
|
|
2568
|
-
/**
|
|
2914
|
+
/**
|
|
2915
|
+
* @description The issue type. `gap`: your sources cover material that entries leave out. `update_required`: an entry is out of date with its sources or contradicts an instruction, and needs a rewrite. `add_entry`: your sources cover a topic that no entry covers. `remove_entry`: an entry has lost its sources or its topic no longer applies. `split_entry`: an entry covers several distinct topics and should become child entries. `merge_entry`: an entry has too few sources to stand alone, so merge it into a nearby entry or keep it as it is.
|
|
2916
|
+
* @enum {string}
|
|
2917
|
+
*/
|
|
2569
2918
|
kind: 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
2919
|
+
/** @description IDs of the sources that led to the issue. For `add_entry`, the sources the new entry would cite. */
|
|
2570
2920
|
citedSourceIds?: string[];
|
|
2921
|
+
/** @description A key naming the specific finding, when the check that found it sets one. */
|
|
2571
2922
|
claimKey?: string;
|
|
2923
|
+
/** @description Paths of the entries the issue involves, when it spans more than one entry. */
|
|
2572
2924
|
involvedScopes?: string[];
|
|
2573
2925
|
};
|
|
2926
|
+
/** @description An identity for the finding that doesn't depend on its wording. It determines the issue's `_id`, so a reworded finding updates the same issue. */
|
|
2574
2927
|
fingerprint: string;
|
|
2928
|
+
/** @description The ID of the build that filed this issue. `null` when the issue was filed outside a build, such as when removing a source leaves an entry without sources. */
|
|
2575
2929
|
revisionId: string | null;
|
|
2576
|
-
/**
|
|
2930
|
+
/**
|
|
2931
|
+
* @description The issue status. `rejected` means the issue was dismissed. Dismissal is final.
|
|
2932
|
+
* @enum {string}
|
|
2933
|
+
*/
|
|
2577
2934
|
status: 'rejected';
|
|
2578
|
-
/**
|
|
2935
|
+
/**
|
|
2936
|
+
* Format: date-time
|
|
2937
|
+
* @description When the issue left `open`, as an ISO 8601 timestamp.
|
|
2938
|
+
*/
|
|
2579
2939
|
resolvedAt: string;
|
|
2940
|
+
/** @description Who triaged the issue. `null` while the issue is open, or when the caller could not be identified. */
|
|
2580
2941
|
resolvedBy: {
|
|
2942
|
+
/** @description The ID of the Sanity user or robot token that triaged the issue. */
|
|
2581
2943
|
id: string;
|
|
2582
|
-
/**
|
|
2944
|
+
/**
|
|
2945
|
+
* @description What triaged the issue. `user` is a person, and `robot` is a robot token.
|
|
2946
|
+
* @enum {string}
|
|
2947
|
+
*/
|
|
2583
2948
|
kind: 'user' | 'robot';
|
|
2584
2949
|
} | null;
|
|
2585
|
-
/**
|
|
2950
|
+
/**
|
|
2951
|
+
* @description Always `null`, because a dismissal chooses no side.
|
|
2952
|
+
* @enum {string|null}
|
|
2953
|
+
*/
|
|
2586
2954
|
resolution: null;
|
|
2587
2955
|
};
|
|
2588
|
-
/** @description A `sanity.context.mcp` document
|
|
2956
|
+
/** @description A `sanity.context.mcp` document: the configuration of one MCP endpoint, stored in your organization's document store. No endpoint returns this document. Use this schema to type GROQ query results and Sanity Function filters. Manage MCP endpoints in the Context dashboard. */
|
|
2589
2957
|
McpDoc: {
|
|
2958
|
+
/** @description The document ID. */
|
|
2590
2959
|
_id: string;
|
|
2960
|
+
/** @description The document revision. It changes on every write. */
|
|
2591
2961
|
_rev: string;
|
|
2592
|
-
/**
|
|
2962
|
+
/**
|
|
2963
|
+
* Format: date-time
|
|
2964
|
+
* @description When the document was created, as an ISO 8601 timestamp.
|
|
2965
|
+
*/
|
|
2593
2966
|
_createdAt: string;
|
|
2594
|
-
/**
|
|
2967
|
+
/**
|
|
2968
|
+
* Format: date-time
|
|
2969
|
+
* @description When the document was last changed, as an ISO 8601 timestamp.
|
|
2970
|
+
*/
|
|
2595
2971
|
_updatedAt: string;
|
|
2596
|
-
/**
|
|
2972
|
+
/**
|
|
2973
|
+
* @description The document type. Always `sanity.context.mcp`.
|
|
2974
|
+
* @enum {string}
|
|
2975
|
+
*/
|
|
2597
2976
|
_type: 'sanity.context.mcp';
|
|
2598
|
-
/**
|
|
2977
|
+
/**
|
|
2978
|
+
* @description The version of the document shape. Currently `1`.
|
|
2979
|
+
* @enum {number}
|
|
2980
|
+
*/
|
|
2599
2981
|
schemaVersion: 1;
|
|
2982
|
+
/** @description The ID of the organization that owns the MCP endpoint. Filter on it in every query, because the document store also holds documents from other features. */
|
|
2600
2983
|
organizationId: string;
|
|
2984
|
+
/** @description The MCP endpoint's public ID (`mcp…`). It is set once at creation, never changes, and determines the document `_id`. */
|
|
2601
2985
|
publicId: string;
|
|
2986
|
+
/** @description The MCP endpoint's display name. You can change it at any time. */
|
|
2602
2987
|
title: string;
|
|
2988
|
+
/** @description The MCP endpoint's name in its URL, in lowercase kebab case such as `my-endpoint`. It is unique within the organization and can't change after creation. */
|
|
2603
2989
|
name: string;
|
|
2990
|
+
/** @description The content sources the MCP endpoint serves. Each source appears once, and the order has no meaning. */
|
|
2604
2991
|
sources: ({
|
|
2605
|
-
/**
|
|
2992
|
+
/**
|
|
2993
|
+
* @description The source type. `knowledge-base` serves a whole knowledge base.
|
|
2994
|
+
* @enum {string}
|
|
2995
|
+
*/
|
|
2606
2996
|
type: 'knowledge-base';
|
|
2997
|
+
/** @description The knowledge base ID (`kb…`). */
|
|
2607
2998
|
id: string;
|
|
2608
2999
|
} | {
|
|
2609
|
-
/**
|
|
3000
|
+
/**
|
|
3001
|
+
* @description The source type. `dataset` serves documents from a Sanity dataset, limited by the MCP endpoint's `groqFilter` when set.
|
|
3002
|
+
* @enum {string}
|
|
3003
|
+
*/
|
|
2610
3004
|
type: 'dataset';
|
|
3005
|
+
/** @description The dataset, as `<projectId>.<datasetName>`. */
|
|
2611
3006
|
id: string;
|
|
2612
3007
|
})[];
|
|
3008
|
+
/** @description Prompt text the MCP endpoint serves to connecting agents. `null` when unset. */
|
|
2613
3009
|
instructions: string | null;
|
|
3010
|
+
/** @description A GROQ filter that limits what the MCP endpoint's `dataset` sources serve. It has no effect on `knowledge-base` sources. `null` when unset. */
|
|
2614
3011
|
groqFilter: string | null;
|
|
2615
3012
|
};
|
|
2616
3013
|
};
|
|
@@ -2624,8 +3021,11 @@ interface operations {
|
|
|
2624
3021
|
listKnowledgeBases: {
|
|
2625
3022
|
parameters: {
|
|
2626
3023
|
query: {
|
|
3024
|
+
/** @description The `nextCursor` value from the previous page. Omit it to get the first page. */
|
|
2627
3025
|
cursor?: string;
|
|
3026
|
+
/** @description The maximum number of items to return. */
|
|
2628
3027
|
limit?: number;
|
|
3028
|
+
/** @description The organization to list knowledge bases for. */
|
|
2629
3029
|
organizationId: string;
|
|
2630
3030
|
};
|
|
2631
3031
|
header?: never;
|
|
@@ -2636,84 +3036,155 @@ interface operations {
|
|
|
2636
3036
|
};
|
|
2637
3037
|
requestBody?: never;
|
|
2638
3038
|
responses: {
|
|
2639
|
-
/** @description
|
|
3039
|
+
/** @description A page of knowledge bases. */
|
|
2640
3040
|
200: {
|
|
2641
3041
|
headers: {
|
|
2642
3042
|
[name: string]: unknown;
|
|
2643
3043
|
};
|
|
2644
3044
|
content: {
|
|
2645
3045
|
'application/json': {
|
|
3046
|
+
/** @description The items on this page. */
|
|
2646
3047
|
data: {
|
|
2647
|
-
/**
|
|
3048
|
+
/**
|
|
3049
|
+
* Format: uuid
|
|
3050
|
+
* @description The knowledge base's unique ID, a UUID. Accepted anywhere a `knowledgeBaseId` is expected.
|
|
3051
|
+
*/
|
|
2648
3052
|
id: string;
|
|
3053
|
+
/** @description The knowledge base ID to show users, such as `kb3do82whm`. Accepted anywhere a `knowledgeBaseId` is expected. Treat it as an opaque string. */
|
|
2649
3054
|
publicId: string;
|
|
3055
|
+
/** @description The ID of the organization that owns the knowledge base. */
|
|
2650
3056
|
organizationId: string;
|
|
3057
|
+
/** @description The knowledge base's title. */
|
|
2651
3058
|
title: string;
|
|
3059
|
+
/** @description A short description of what the knowledge base covers. */
|
|
2652
3060
|
description: string;
|
|
2653
|
-
/**
|
|
3061
|
+
/**
|
|
3062
|
+
* @description The knowledge base's build state. `created`: not built yet. `ready`: built, with no open issues. `review`: built, with open issues to review. A failed build doesn't change the state. `building`, `stale`, and `paused` aren't currently returned. To check for a running build, use `isBuilding`.
|
|
3063
|
+
* @enum {string}
|
|
3064
|
+
*/
|
|
2654
3065
|
state: 'created' | 'building' | 'ready' | 'review' | 'stale' | 'paused';
|
|
3066
|
+
/** @description The job ID of the most recent build, or `null` if no build has started. Check its progress with `GET .../jobs/{jobId}`. */
|
|
2655
3067
|
activeJobId: string | null;
|
|
3068
|
+
/** @description Whether a build is running now. */
|
|
2656
3069
|
isBuilding: boolean;
|
|
3070
|
+
/** @description Progress of the most recent build, by stage. `null` until a build reports progress. It can briefly belong to an earlier build, so use it only when its `jobId` matches `activeJobId`. */
|
|
2657
3071
|
buildStageState: {
|
|
3072
|
+
/** @description The ID of the build job this progress belongs to. */
|
|
2658
3073
|
jobId: string;
|
|
3074
|
+
/** @description The build's stages and their progress. Stages that haven't reported yet can be missing. */
|
|
2659
3075
|
stages: {
|
|
2660
|
-
/**
|
|
3076
|
+
/**
|
|
3077
|
+
* @description The stage's ID. The values are listed in the order stages run.
|
|
3078
|
+
* @enum {string}
|
|
3079
|
+
*/
|
|
2661
3080
|
id: 'tldr' | 'map' | 'triage' | 'plan' | 'organize' | 'arrange' | 'write' | 'review' | 'polish';
|
|
2662
|
-
/**
|
|
3081
|
+
/**
|
|
3082
|
+
* @description The stage's status. `pending`: not started. `running`: in progress. `done`: finished. `failed`: the build ended before the stage finished.
|
|
3083
|
+
* @enum {string}
|
|
3084
|
+
*/
|
|
2663
3085
|
status: 'pending' | 'running' | 'done' | 'failed';
|
|
3086
|
+
/** @description The stage's progress counts. Absent when the stage hasn't reported counts. */
|
|
2664
3087
|
units?: {
|
|
2665
|
-
/**
|
|
3088
|
+
/**
|
|
3089
|
+
* @description What `done` and `total` count: `sources`, `groups` of related content, `entries`, or `rounds` of final fixes. A `rounds` stage has no `total`.
|
|
3090
|
+
* @enum {string}
|
|
3091
|
+
*/
|
|
2666
3092
|
unit: 'sources' | 'groups' | 'entries' | 'rounds';
|
|
3093
|
+
/** @description How many units the stage has finished. */
|
|
2667
3094
|
done: number;
|
|
3095
|
+
/** @description How many units the stage will process. Absent when `unit` is `rounds`. */
|
|
2668
3096
|
total?: number;
|
|
2669
3097
|
};
|
|
2670
3098
|
}[];
|
|
2671
3099
|
} | null;
|
|
2672
|
-
/**
|
|
3100
|
+
/**
|
|
3101
|
+
* Format: date-time
|
|
3102
|
+
* @description When a refresh last checked the knowledge base for changes, whether or not anything changed. `null` until the first refresh.
|
|
3103
|
+
*/
|
|
2673
3104
|
lastCheckedAt: string | null;
|
|
2674
|
-
/**
|
|
3105
|
+
/**
|
|
3106
|
+
* Format: date-time
|
|
3107
|
+
* @description When the content last changed: the time of the most recent successful build. `null` if the knowledge base has never built.
|
|
3108
|
+
*/
|
|
2675
3109
|
lastChangedAt: string | null;
|
|
3110
|
+
/** @description Whether sources were added, changed, or removed since the last successful build. Always `false` before the first build. */
|
|
2676
3111
|
hasPendingChanges: boolean;
|
|
3112
|
+
/** @description Counts of sources added, changed, and removed since the last successful build. Only `GET .../knowledge-bases/{knowledgeBaseId}` computes it. `null` in list responses and before the first build. */
|
|
2677
3113
|
pendingChanges: {
|
|
3114
|
+
/** @description Sources added since the last successful build, including sources no successful build has included yet. */
|
|
2678
3115
|
added: number;
|
|
3116
|
+
/** @description Sources whose content changed since the last successful build. */
|
|
2679
3117
|
changed: number;
|
|
3118
|
+
/** @description Sources that recent refreshes no longer find. */
|
|
2680
3119
|
removed: number;
|
|
2681
3120
|
} | null;
|
|
3121
|
+
/** @description Whether Sanity Context has improved how it builds knowledge bases since the last successful build. Rebuild to apply the improvements. Always `false` before the first build. */
|
|
2682
3122
|
pipelineOutdated: boolean;
|
|
3123
|
+
/** @description A recommendation to rebuild, because new or changed content doesn't fit the current outline. `null` when there's no recommendation. A refresh where the content fits again, a successful build, or adding or removing sources clears it. */
|
|
2683
3124
|
rebuildRecommended: {
|
|
3125
|
+
/** @description Why a rebuild is recommended, written to show to users. */
|
|
2684
3126
|
reason: string;
|
|
2685
|
-
/**
|
|
3127
|
+
/**
|
|
3128
|
+
* Format: date-time
|
|
3129
|
+
* @description When the recommendation was made.
|
|
3130
|
+
*/
|
|
2686
3131
|
at: string;
|
|
2687
3132
|
} | null;
|
|
3133
|
+
/** @description Whether the knowledge base has at least one website source. */
|
|
2688
3134
|
hasWebSource: boolean;
|
|
3135
|
+
/** @description Whether the knowledge base has at least one Sanity dataset source. */
|
|
2689
3136
|
hasDatasetSource: boolean;
|
|
3137
|
+
/** @description How many sources the knowledge base uses, and its source limit. */
|
|
2690
3138
|
sourceUsage: {
|
|
3139
|
+
/** @description The number of sources counted toward the limit, including parts split from large sources. */
|
|
2691
3140
|
used: number;
|
|
3141
|
+
/** @description The maximum number of sources the knowledge base can have. */
|
|
2692
3142
|
limit: number;
|
|
2693
3143
|
} | null;
|
|
2694
|
-
/** @description
|
|
3144
|
+
/** @description Why a build request would be denied right now, or `null` if you can build. Only `GET .../knowledge-bases/{knowledgeBaseId}` checks it. List and create responses always return `null`. */
|
|
2695
3145
|
buildRestriction: {
|
|
3146
|
+
/** @description A stable code for the restriction, such as `planLimitReached`. */
|
|
2696
3147
|
code: string;
|
|
3148
|
+
/** @description A readable explanation that you can show to users. */
|
|
2697
3149
|
message: string;
|
|
2698
3150
|
} | null;
|
|
3151
|
+
/** @description Whether scheduled refresh is on. Only applies to knowledge bases with a website or dataset source. */
|
|
2699
3152
|
refreshEnabled: boolean;
|
|
2700
|
-
/**
|
|
3153
|
+
/**
|
|
3154
|
+
* @description How often scheduled refresh runs: `weekly` (the default) or `monthly`.
|
|
3155
|
+
* @enum {string}
|
|
3156
|
+
*/
|
|
2701
3157
|
refreshFrequency: 'weekly' | 'monthly';
|
|
2702
|
-
/**
|
|
3158
|
+
/**
|
|
3159
|
+
* Format: date-time
|
|
3160
|
+
* @description When the next scheduled refresh runs. `null` when scheduled refresh is off or not scheduled yet. Only `GET .../knowledge-bases/{knowledgeBaseId}` computes it, so list responses return `null`.
|
|
3161
|
+
*/
|
|
2703
3162
|
refreshNextRunAt: string | null;
|
|
3163
|
+
/** @description Whether a refresh is running now. While it's `true`, a new refresh request doesn't start another one. Only `GET .../knowledge-bases/{knowledgeBaseId}` computes it, so list responses return `false`. */
|
|
2704
3164
|
refreshInFlight: boolean;
|
|
3165
|
+
/** @description The number of open issues waiting for review. Always `0` before the first build. */
|
|
2705
3166
|
openIssueCount: number;
|
|
3167
|
+
/** @description The number of active instructions for the knowledge base. */
|
|
2706
3168
|
instructionCount: number;
|
|
2707
|
-
/** @description
|
|
3169
|
+
/** @description Who created the knowledge base. `null` if unknown. */
|
|
2708
3170
|
createdBy: {
|
|
3171
|
+
/** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
|
|
2709
3172
|
id: string | null;
|
|
3173
|
+
/** @description The user's name when the action happened. `null` if unknown. For the current name, look up the user by `id`. */
|
|
2710
3174
|
displayName: string | null;
|
|
2711
3175
|
} | null;
|
|
2712
|
-
/**
|
|
3176
|
+
/**
|
|
3177
|
+
* Format: date-time
|
|
3178
|
+
* @description When the knowledge base was created.
|
|
3179
|
+
*/
|
|
2713
3180
|
createdAt: string;
|
|
2714
|
-
/**
|
|
3181
|
+
/**
|
|
3182
|
+
* Format: date-time
|
|
3183
|
+
* @description When the knowledge base was last updated.
|
|
3184
|
+
*/
|
|
2715
3185
|
updatedAt: string;
|
|
2716
3186
|
}[];
|
|
3187
|
+
/** @description The cursor for the next page. Pass it as `cursor` to get more results. `null` when there are no more pages. */
|
|
2717
3188
|
nextCursor: string | null;
|
|
2718
3189
|
};
|
|
2719
3190
|
};
|
|
@@ -2732,88 +3203,160 @@ interface operations {
|
|
|
2732
3203
|
requestBody: {
|
|
2733
3204
|
content: {
|
|
2734
3205
|
'application/json': {
|
|
3206
|
+
/** @description The ID of the organization to create the knowledge base in. */
|
|
2735
3207
|
organizationId: string;
|
|
3208
|
+
/** @description The knowledge base's title. */
|
|
2736
3209
|
title: string;
|
|
3210
|
+
/** @description A short description of what the knowledge base covers. */
|
|
2737
3211
|
description: string;
|
|
2738
3212
|
};
|
|
2739
3213
|
};
|
|
2740
3214
|
};
|
|
2741
3215
|
responses: {
|
|
2742
|
-
/** @description
|
|
3216
|
+
/** @description A knowledge base and its current state. */
|
|
2743
3217
|
201: {
|
|
2744
3218
|
headers: {
|
|
2745
3219
|
[name: string]: unknown;
|
|
2746
3220
|
};
|
|
2747
3221
|
content: {
|
|
2748
3222
|
'application/json': {
|
|
2749
|
-
/**
|
|
3223
|
+
/**
|
|
3224
|
+
* Format: uuid
|
|
3225
|
+
* @description The knowledge base's unique ID, a UUID. Accepted anywhere a `knowledgeBaseId` is expected.
|
|
3226
|
+
*/
|
|
2750
3227
|
id: string;
|
|
3228
|
+
/** @description The knowledge base ID to show users, such as `kb3do82whm`. Accepted anywhere a `knowledgeBaseId` is expected. Treat it as an opaque string. */
|
|
2751
3229
|
publicId: string;
|
|
3230
|
+
/** @description The ID of the organization that owns the knowledge base. */
|
|
2752
3231
|
organizationId: string;
|
|
3232
|
+
/** @description The knowledge base's title. */
|
|
2753
3233
|
title: string;
|
|
3234
|
+
/** @description A short description of what the knowledge base covers. */
|
|
2754
3235
|
description: string;
|
|
2755
|
-
/**
|
|
3236
|
+
/**
|
|
3237
|
+
* @description The knowledge base's build state. `created`: not built yet. `ready`: built, with no open issues. `review`: built, with open issues to review. A failed build doesn't change the state. `building`, `stale`, and `paused` aren't currently returned. To check for a running build, use `isBuilding`.
|
|
3238
|
+
* @enum {string}
|
|
3239
|
+
*/
|
|
2756
3240
|
state: 'created' | 'building' | 'ready' | 'review' | 'stale' | 'paused';
|
|
3241
|
+
/** @description The job ID of the most recent build, or `null` if no build has started. Check its progress with `GET .../jobs/{jobId}`. */
|
|
2757
3242
|
activeJobId: string | null;
|
|
3243
|
+
/** @description Whether a build is running now. */
|
|
2758
3244
|
isBuilding: boolean;
|
|
3245
|
+
/** @description Progress of the most recent build, by stage. `null` until a build reports progress. It can briefly belong to an earlier build, so use it only when its `jobId` matches `activeJobId`. */
|
|
2759
3246
|
buildStageState: {
|
|
3247
|
+
/** @description The ID of the build job this progress belongs to. */
|
|
2760
3248
|
jobId: string;
|
|
3249
|
+
/** @description The build's stages and their progress. Stages that haven't reported yet can be missing. */
|
|
2761
3250
|
stages: {
|
|
2762
|
-
/**
|
|
3251
|
+
/**
|
|
3252
|
+
* @description The stage's ID. The values are listed in the order stages run.
|
|
3253
|
+
* @enum {string}
|
|
3254
|
+
*/
|
|
2763
3255
|
id: 'tldr' | 'map' | 'triage' | 'plan' | 'organize' | 'arrange' | 'write' | 'review' | 'polish';
|
|
2764
|
-
/**
|
|
3256
|
+
/**
|
|
3257
|
+
* @description The stage's status. `pending`: not started. `running`: in progress. `done`: finished. `failed`: the build ended before the stage finished.
|
|
3258
|
+
* @enum {string}
|
|
3259
|
+
*/
|
|
2765
3260
|
status: 'pending' | 'running' | 'done' | 'failed';
|
|
3261
|
+
/** @description The stage's progress counts. Absent when the stage hasn't reported counts. */
|
|
2766
3262
|
units?: {
|
|
2767
|
-
/**
|
|
3263
|
+
/**
|
|
3264
|
+
* @description What `done` and `total` count: `sources`, `groups` of related content, `entries`, or `rounds` of final fixes. A `rounds` stage has no `total`.
|
|
3265
|
+
* @enum {string}
|
|
3266
|
+
*/
|
|
2768
3267
|
unit: 'sources' | 'groups' | 'entries' | 'rounds';
|
|
3268
|
+
/** @description How many units the stage has finished. */
|
|
2769
3269
|
done: number;
|
|
3270
|
+
/** @description How many units the stage will process. Absent when `unit` is `rounds`. */
|
|
2770
3271
|
total?: number;
|
|
2771
3272
|
};
|
|
2772
3273
|
}[];
|
|
2773
3274
|
} | null;
|
|
2774
|
-
/**
|
|
3275
|
+
/**
|
|
3276
|
+
* Format: date-time
|
|
3277
|
+
* @description When a refresh last checked the knowledge base for changes, whether or not anything changed. `null` until the first refresh.
|
|
3278
|
+
*/
|
|
2775
3279
|
lastCheckedAt: string | null;
|
|
2776
|
-
/**
|
|
3280
|
+
/**
|
|
3281
|
+
* Format: date-time
|
|
3282
|
+
* @description When the content last changed: the time of the most recent successful build. `null` if the knowledge base has never built.
|
|
3283
|
+
*/
|
|
2777
3284
|
lastChangedAt: string | null;
|
|
3285
|
+
/** @description Whether sources were added, changed, or removed since the last successful build. Always `false` before the first build. */
|
|
2778
3286
|
hasPendingChanges: boolean;
|
|
3287
|
+
/** @description Counts of sources added, changed, and removed since the last successful build. Only `GET .../knowledge-bases/{knowledgeBaseId}` computes it. `null` in list responses and before the first build. */
|
|
2779
3288
|
pendingChanges: {
|
|
3289
|
+
/** @description Sources added since the last successful build, including sources no successful build has included yet. */
|
|
2780
3290
|
added: number;
|
|
3291
|
+
/** @description Sources whose content changed since the last successful build. */
|
|
2781
3292
|
changed: number;
|
|
3293
|
+
/** @description Sources that recent refreshes no longer find. */
|
|
2782
3294
|
removed: number;
|
|
2783
3295
|
} | null;
|
|
3296
|
+
/** @description Whether Sanity Context has improved how it builds knowledge bases since the last successful build. Rebuild to apply the improvements. Always `false` before the first build. */
|
|
2784
3297
|
pipelineOutdated: boolean;
|
|
3298
|
+
/** @description A recommendation to rebuild, because new or changed content doesn't fit the current outline. `null` when there's no recommendation. A refresh where the content fits again, a successful build, or adding or removing sources clears it. */
|
|
2785
3299
|
rebuildRecommended: {
|
|
3300
|
+
/** @description Why a rebuild is recommended, written to show to users. */
|
|
2786
3301
|
reason: string;
|
|
2787
|
-
/**
|
|
3302
|
+
/**
|
|
3303
|
+
* Format: date-time
|
|
3304
|
+
* @description When the recommendation was made.
|
|
3305
|
+
*/
|
|
2788
3306
|
at: string;
|
|
2789
3307
|
} | null;
|
|
3308
|
+
/** @description Whether the knowledge base has at least one website source. */
|
|
2790
3309
|
hasWebSource: boolean;
|
|
3310
|
+
/** @description Whether the knowledge base has at least one Sanity dataset source. */
|
|
2791
3311
|
hasDatasetSource: boolean;
|
|
3312
|
+
/** @description How many sources the knowledge base uses, and its source limit. */
|
|
2792
3313
|
sourceUsage: {
|
|
3314
|
+
/** @description The number of sources counted toward the limit, including parts split from large sources. */
|
|
2793
3315
|
used: number;
|
|
3316
|
+
/** @description The maximum number of sources the knowledge base can have. */
|
|
2794
3317
|
limit: number;
|
|
2795
3318
|
} | null;
|
|
2796
|
-
/** @description
|
|
3319
|
+
/** @description Why a build request would be denied right now, or `null` if you can build. Only `GET .../knowledge-bases/{knowledgeBaseId}` checks it. List and create responses always return `null`. */
|
|
2797
3320
|
buildRestriction: {
|
|
3321
|
+
/** @description A stable code for the restriction, such as `planLimitReached`. */
|
|
2798
3322
|
code: string;
|
|
3323
|
+
/** @description A readable explanation that you can show to users. */
|
|
2799
3324
|
message: string;
|
|
2800
3325
|
} | null;
|
|
3326
|
+
/** @description Whether scheduled refresh is on. Only applies to knowledge bases with a website or dataset source. */
|
|
2801
3327
|
refreshEnabled: boolean;
|
|
2802
|
-
/**
|
|
3328
|
+
/**
|
|
3329
|
+
* @description How often scheduled refresh runs: `weekly` (the default) or `monthly`.
|
|
3330
|
+
* @enum {string}
|
|
3331
|
+
*/
|
|
2803
3332
|
refreshFrequency: 'weekly' | 'monthly';
|
|
2804
|
-
/**
|
|
3333
|
+
/**
|
|
3334
|
+
* Format: date-time
|
|
3335
|
+
* @description When the next scheduled refresh runs. `null` when scheduled refresh is off or not scheduled yet. Only `GET .../knowledge-bases/{knowledgeBaseId}` computes it, so list responses return `null`.
|
|
3336
|
+
*/
|
|
2805
3337
|
refreshNextRunAt: string | null;
|
|
3338
|
+
/** @description Whether a refresh is running now. While it's `true`, a new refresh request doesn't start another one. Only `GET .../knowledge-bases/{knowledgeBaseId}` computes it, so list responses return `false`. */
|
|
2806
3339
|
refreshInFlight: boolean;
|
|
3340
|
+
/** @description The number of open issues waiting for review. Always `0` before the first build. */
|
|
2807
3341
|
openIssueCount: number;
|
|
3342
|
+
/** @description The number of active instructions for the knowledge base. */
|
|
2808
3343
|
instructionCount: number;
|
|
2809
|
-
/** @description
|
|
3344
|
+
/** @description Who created the knowledge base. `null` if unknown. */
|
|
2810
3345
|
createdBy: {
|
|
3346
|
+
/** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
|
|
2811
3347
|
id: string | null;
|
|
3348
|
+
/** @description The user's name when the action happened. `null` if unknown. For the current name, look up the user by `id`. */
|
|
2812
3349
|
displayName: string | null;
|
|
2813
3350
|
} | null;
|
|
2814
|
-
/**
|
|
3351
|
+
/**
|
|
3352
|
+
* Format: date-time
|
|
3353
|
+
* @description When the knowledge base was created.
|
|
3354
|
+
*/
|
|
2815
3355
|
createdAt: string;
|
|
2816
|
-
/**
|
|
3356
|
+
/**
|
|
3357
|
+
* Format: date-time
|
|
3358
|
+
* @description When the knowledge base was last updated.
|
|
3359
|
+
*/
|
|
2817
3360
|
updatedAt: string;
|
|
2818
3361
|
};
|
|
2819
3362
|
};
|
|
@@ -2825,87 +3368,157 @@ interface operations {
|
|
|
2825
3368
|
query?: never;
|
|
2826
3369
|
header?: never;
|
|
2827
3370
|
path: {
|
|
3371
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
2828
3372
|
knowledgeBaseId: string;
|
|
2829
3373
|
};
|
|
2830
3374
|
cookie?: never;
|
|
2831
3375
|
};
|
|
2832
3376
|
requestBody?: never;
|
|
2833
3377
|
responses: {
|
|
2834
|
-
/** @description
|
|
3378
|
+
/** @description A knowledge base and its current state. */
|
|
2835
3379
|
200: {
|
|
2836
3380
|
headers: {
|
|
2837
3381
|
[name: string]: unknown;
|
|
2838
3382
|
};
|
|
2839
3383
|
content: {
|
|
2840
3384
|
'application/json': {
|
|
2841
|
-
/**
|
|
3385
|
+
/**
|
|
3386
|
+
* Format: uuid
|
|
3387
|
+
* @description The knowledge base's unique ID, a UUID. Accepted anywhere a `knowledgeBaseId` is expected.
|
|
3388
|
+
*/
|
|
2842
3389
|
id: string;
|
|
3390
|
+
/** @description The knowledge base ID to show users, such as `kb3do82whm`. Accepted anywhere a `knowledgeBaseId` is expected. Treat it as an opaque string. */
|
|
2843
3391
|
publicId: string;
|
|
3392
|
+
/** @description The ID of the organization that owns the knowledge base. */
|
|
2844
3393
|
organizationId: string;
|
|
3394
|
+
/** @description The knowledge base's title. */
|
|
2845
3395
|
title: string;
|
|
3396
|
+
/** @description A short description of what the knowledge base covers. */
|
|
2846
3397
|
description: string;
|
|
2847
|
-
/**
|
|
3398
|
+
/**
|
|
3399
|
+
* @description The knowledge base's build state. `created`: not built yet. `ready`: built, with no open issues. `review`: built, with open issues to review. A failed build doesn't change the state. `building`, `stale`, and `paused` aren't currently returned. To check for a running build, use `isBuilding`.
|
|
3400
|
+
* @enum {string}
|
|
3401
|
+
*/
|
|
2848
3402
|
state: 'created' | 'building' | 'ready' | 'review' | 'stale' | 'paused';
|
|
3403
|
+
/** @description The job ID of the most recent build, or `null` if no build has started. Check its progress with `GET .../jobs/{jobId}`. */
|
|
2849
3404
|
activeJobId: string | null;
|
|
3405
|
+
/** @description Whether a build is running now. */
|
|
2850
3406
|
isBuilding: boolean;
|
|
3407
|
+
/** @description Progress of the most recent build, by stage. `null` until a build reports progress. It can briefly belong to an earlier build, so use it only when its `jobId` matches `activeJobId`. */
|
|
2851
3408
|
buildStageState: {
|
|
3409
|
+
/** @description The ID of the build job this progress belongs to. */
|
|
2852
3410
|
jobId: string;
|
|
3411
|
+
/** @description The build's stages and their progress. Stages that haven't reported yet can be missing. */
|
|
2853
3412
|
stages: {
|
|
2854
|
-
/**
|
|
3413
|
+
/**
|
|
3414
|
+
* @description The stage's ID. The values are listed in the order stages run.
|
|
3415
|
+
* @enum {string}
|
|
3416
|
+
*/
|
|
2855
3417
|
id: 'tldr' | 'map' | 'triage' | 'plan' | 'organize' | 'arrange' | 'write' | 'review' | 'polish';
|
|
2856
|
-
/**
|
|
3418
|
+
/**
|
|
3419
|
+
* @description The stage's status. `pending`: not started. `running`: in progress. `done`: finished. `failed`: the build ended before the stage finished.
|
|
3420
|
+
* @enum {string}
|
|
3421
|
+
*/
|
|
2857
3422
|
status: 'pending' | 'running' | 'done' | 'failed';
|
|
3423
|
+
/** @description The stage's progress counts. Absent when the stage hasn't reported counts. */
|
|
2858
3424
|
units?: {
|
|
2859
|
-
/**
|
|
3425
|
+
/**
|
|
3426
|
+
* @description What `done` and `total` count: `sources`, `groups` of related content, `entries`, or `rounds` of final fixes. A `rounds` stage has no `total`.
|
|
3427
|
+
* @enum {string}
|
|
3428
|
+
*/
|
|
2860
3429
|
unit: 'sources' | 'groups' | 'entries' | 'rounds';
|
|
3430
|
+
/** @description How many units the stage has finished. */
|
|
2861
3431
|
done: number;
|
|
3432
|
+
/** @description How many units the stage will process. Absent when `unit` is `rounds`. */
|
|
2862
3433
|
total?: number;
|
|
2863
3434
|
};
|
|
2864
3435
|
}[];
|
|
2865
3436
|
} | null;
|
|
2866
|
-
/**
|
|
3437
|
+
/**
|
|
3438
|
+
* Format: date-time
|
|
3439
|
+
* @description When a refresh last checked the knowledge base for changes, whether or not anything changed. `null` until the first refresh.
|
|
3440
|
+
*/
|
|
2867
3441
|
lastCheckedAt: string | null;
|
|
2868
|
-
/**
|
|
3442
|
+
/**
|
|
3443
|
+
* Format: date-time
|
|
3444
|
+
* @description When the content last changed: the time of the most recent successful build. `null` if the knowledge base has never built.
|
|
3445
|
+
*/
|
|
2869
3446
|
lastChangedAt: string | null;
|
|
3447
|
+
/** @description Whether sources were added, changed, or removed since the last successful build. Always `false` before the first build. */
|
|
2870
3448
|
hasPendingChanges: boolean;
|
|
3449
|
+
/** @description Counts of sources added, changed, and removed since the last successful build. Only `GET .../knowledge-bases/{knowledgeBaseId}` computes it. `null` in list responses and before the first build. */
|
|
2871
3450
|
pendingChanges: {
|
|
3451
|
+
/** @description Sources added since the last successful build, including sources no successful build has included yet. */
|
|
2872
3452
|
added: number;
|
|
3453
|
+
/** @description Sources whose content changed since the last successful build. */
|
|
2873
3454
|
changed: number;
|
|
3455
|
+
/** @description Sources that recent refreshes no longer find. */
|
|
2874
3456
|
removed: number;
|
|
2875
3457
|
} | null;
|
|
3458
|
+
/** @description Whether Sanity Context has improved how it builds knowledge bases since the last successful build. Rebuild to apply the improvements. Always `false` before the first build. */
|
|
2876
3459
|
pipelineOutdated: boolean;
|
|
3460
|
+
/** @description A recommendation to rebuild, because new or changed content doesn't fit the current outline. `null` when there's no recommendation. A refresh where the content fits again, a successful build, or adding or removing sources clears it. */
|
|
2877
3461
|
rebuildRecommended: {
|
|
3462
|
+
/** @description Why a rebuild is recommended, written to show to users. */
|
|
2878
3463
|
reason: string;
|
|
2879
|
-
/**
|
|
3464
|
+
/**
|
|
3465
|
+
* Format: date-time
|
|
3466
|
+
* @description When the recommendation was made.
|
|
3467
|
+
*/
|
|
2880
3468
|
at: string;
|
|
2881
3469
|
} | null;
|
|
3470
|
+
/** @description Whether the knowledge base has at least one website source. */
|
|
2882
3471
|
hasWebSource: boolean;
|
|
3472
|
+
/** @description Whether the knowledge base has at least one Sanity dataset source. */
|
|
2883
3473
|
hasDatasetSource: boolean;
|
|
3474
|
+
/** @description How many sources the knowledge base uses, and its source limit. */
|
|
2884
3475
|
sourceUsage: {
|
|
3476
|
+
/** @description The number of sources counted toward the limit, including parts split from large sources. */
|
|
2885
3477
|
used: number;
|
|
3478
|
+
/** @description The maximum number of sources the knowledge base can have. */
|
|
2886
3479
|
limit: number;
|
|
2887
3480
|
} | null;
|
|
2888
|
-
/** @description
|
|
3481
|
+
/** @description Why a build request would be denied right now, or `null` if you can build. Only `GET .../knowledge-bases/{knowledgeBaseId}` checks it. List and create responses always return `null`. */
|
|
2889
3482
|
buildRestriction: {
|
|
3483
|
+
/** @description A stable code for the restriction, such as `planLimitReached`. */
|
|
2890
3484
|
code: string;
|
|
3485
|
+
/** @description A readable explanation that you can show to users. */
|
|
2891
3486
|
message: string;
|
|
2892
3487
|
} | null;
|
|
3488
|
+
/** @description Whether scheduled refresh is on. Only applies to knowledge bases with a website or dataset source. */
|
|
2893
3489
|
refreshEnabled: boolean;
|
|
2894
|
-
/**
|
|
3490
|
+
/**
|
|
3491
|
+
* @description How often scheduled refresh runs: `weekly` (the default) or `monthly`.
|
|
3492
|
+
* @enum {string}
|
|
3493
|
+
*/
|
|
2895
3494
|
refreshFrequency: 'weekly' | 'monthly';
|
|
2896
|
-
/**
|
|
3495
|
+
/**
|
|
3496
|
+
* Format: date-time
|
|
3497
|
+
* @description When the next scheduled refresh runs. `null` when scheduled refresh is off or not scheduled yet. Only `GET .../knowledge-bases/{knowledgeBaseId}` computes it, so list responses return `null`.
|
|
3498
|
+
*/
|
|
2897
3499
|
refreshNextRunAt: string | null;
|
|
3500
|
+
/** @description Whether a refresh is running now. While it's `true`, a new refresh request doesn't start another one. Only `GET .../knowledge-bases/{knowledgeBaseId}` computes it, so list responses return `false`. */
|
|
2898
3501
|
refreshInFlight: boolean;
|
|
3502
|
+
/** @description The number of open issues waiting for review. Always `0` before the first build. */
|
|
2899
3503
|
openIssueCount: number;
|
|
3504
|
+
/** @description The number of active instructions for the knowledge base. */
|
|
2900
3505
|
instructionCount: number;
|
|
2901
|
-
/** @description
|
|
3506
|
+
/** @description Who created the knowledge base. `null` if unknown. */
|
|
2902
3507
|
createdBy: {
|
|
3508
|
+
/** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
|
|
2903
3509
|
id: string | null;
|
|
3510
|
+
/** @description The user's name when the action happened. `null` if unknown. For the current name, look up the user by `id`. */
|
|
2904
3511
|
displayName: string | null;
|
|
2905
3512
|
} | null;
|
|
2906
|
-
/**
|
|
3513
|
+
/**
|
|
3514
|
+
* Format: date-time
|
|
3515
|
+
* @description When the knowledge base was created.
|
|
3516
|
+
*/
|
|
2907
3517
|
createdAt: string;
|
|
2908
|
-
/**
|
|
3518
|
+
/**
|
|
3519
|
+
* Format: date-time
|
|
3520
|
+
* @description When the knowledge base was last updated.
|
|
3521
|
+
*/
|
|
2909
3522
|
updatedAt: string;
|
|
2910
3523
|
};
|
|
2911
3524
|
};
|
|
@@ -2917,13 +3530,14 @@ interface operations {
|
|
|
2917
3530
|
query?: never;
|
|
2918
3531
|
header?: never;
|
|
2919
3532
|
path: {
|
|
3533
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
2920
3534
|
knowledgeBaseId: string;
|
|
2921
3535
|
};
|
|
2922
3536
|
cookie?: never;
|
|
2923
3537
|
};
|
|
2924
3538
|
requestBody?: never;
|
|
2925
3539
|
responses: {
|
|
2926
|
-
/** @description
|
|
3540
|
+
/** @description The knowledge base was deleted. */
|
|
2927
3541
|
204: {
|
|
2928
3542
|
headers: {
|
|
2929
3543
|
[name: string]: unknown;
|
|
@@ -2939,6 +3553,7 @@ interface operations {
|
|
|
2939
3553
|
query?: never;
|
|
2940
3554
|
header?: never;
|
|
2941
3555
|
path: {
|
|
3556
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
2942
3557
|
knowledgeBaseId: string;
|
|
2943
3558
|
};
|
|
2944
3559
|
cookie?: never;
|
|
@@ -2946,90 +3561,165 @@ interface operations {
|
|
|
2946
3561
|
requestBody: {
|
|
2947
3562
|
content: {
|
|
2948
3563
|
'application/json': {
|
|
3564
|
+
/** @description The knowledge base's new title. */
|
|
2949
3565
|
title?: string;
|
|
3566
|
+
/** @description The knowledge base's new description. */
|
|
2950
3567
|
description?: string;
|
|
3568
|
+
/** @description Whether scheduled refresh is on. Turning it off stops only scheduled refreshes, so you can still start a refresh yourself. Turning it on requires a plan that includes scheduled refresh. Requires a website or dataset source. */
|
|
2951
3569
|
refreshEnabled?: boolean;
|
|
2952
|
-
/**
|
|
3570
|
+
/**
|
|
3571
|
+
* @description How often scheduled refresh runs: `weekly` or `monthly`. Requires a website or dataset source and a plan that includes scheduled refresh.
|
|
3572
|
+
* @enum {string}
|
|
3573
|
+
*/
|
|
2953
3574
|
refreshFrequency?: 'weekly' | 'monthly';
|
|
2954
3575
|
};
|
|
2955
3576
|
};
|
|
2956
3577
|
};
|
|
2957
3578
|
responses: {
|
|
2958
|
-
/** @description
|
|
3579
|
+
/** @description A knowledge base and its current state. */
|
|
2959
3580
|
200: {
|
|
2960
3581
|
headers: {
|
|
2961
3582
|
[name: string]: unknown;
|
|
2962
3583
|
};
|
|
2963
3584
|
content: {
|
|
2964
3585
|
'application/json': {
|
|
2965
|
-
/**
|
|
3586
|
+
/**
|
|
3587
|
+
* Format: uuid
|
|
3588
|
+
* @description The knowledge base's unique ID, a UUID. Accepted anywhere a `knowledgeBaseId` is expected.
|
|
3589
|
+
*/
|
|
2966
3590
|
id: string;
|
|
3591
|
+
/** @description The knowledge base ID to show users, such as `kb3do82whm`. Accepted anywhere a `knowledgeBaseId` is expected. Treat it as an opaque string. */
|
|
2967
3592
|
publicId: string;
|
|
3593
|
+
/** @description The ID of the organization that owns the knowledge base. */
|
|
2968
3594
|
organizationId: string;
|
|
3595
|
+
/** @description The knowledge base's title. */
|
|
2969
3596
|
title: string;
|
|
3597
|
+
/** @description A short description of what the knowledge base covers. */
|
|
2970
3598
|
description: string;
|
|
2971
|
-
/**
|
|
3599
|
+
/**
|
|
3600
|
+
* @description The knowledge base's build state. `created`: not built yet. `ready`: built, with no open issues. `review`: built, with open issues to review. A failed build doesn't change the state. `building`, `stale`, and `paused` aren't currently returned. To check for a running build, use `isBuilding`.
|
|
3601
|
+
* @enum {string}
|
|
3602
|
+
*/
|
|
2972
3603
|
state: 'created' | 'building' | 'ready' | 'review' | 'stale' | 'paused';
|
|
3604
|
+
/** @description The job ID of the most recent build, or `null` if no build has started. Check its progress with `GET .../jobs/{jobId}`. */
|
|
2973
3605
|
activeJobId: string | null;
|
|
3606
|
+
/** @description Whether a build is running now. */
|
|
2974
3607
|
isBuilding: boolean;
|
|
3608
|
+
/** @description Progress of the most recent build, by stage. `null` until a build reports progress. It can briefly belong to an earlier build, so use it only when its `jobId` matches `activeJobId`. */
|
|
2975
3609
|
buildStageState: {
|
|
3610
|
+
/** @description The ID of the build job this progress belongs to. */
|
|
2976
3611
|
jobId: string;
|
|
3612
|
+
/** @description The build's stages and their progress. Stages that haven't reported yet can be missing. */
|
|
2977
3613
|
stages: {
|
|
2978
|
-
/**
|
|
3614
|
+
/**
|
|
3615
|
+
* @description The stage's ID. The values are listed in the order stages run.
|
|
3616
|
+
* @enum {string}
|
|
3617
|
+
*/
|
|
2979
3618
|
id: 'tldr' | 'map' | 'triage' | 'plan' | 'organize' | 'arrange' | 'write' | 'review' | 'polish';
|
|
2980
|
-
/**
|
|
3619
|
+
/**
|
|
3620
|
+
* @description The stage's status. `pending`: not started. `running`: in progress. `done`: finished. `failed`: the build ended before the stage finished.
|
|
3621
|
+
* @enum {string}
|
|
3622
|
+
*/
|
|
2981
3623
|
status: 'pending' | 'running' | 'done' | 'failed';
|
|
3624
|
+
/** @description The stage's progress counts. Absent when the stage hasn't reported counts. */
|
|
2982
3625
|
units?: {
|
|
2983
|
-
/**
|
|
3626
|
+
/**
|
|
3627
|
+
* @description What `done` and `total` count: `sources`, `groups` of related content, `entries`, or `rounds` of final fixes. A `rounds` stage has no `total`.
|
|
3628
|
+
* @enum {string}
|
|
3629
|
+
*/
|
|
2984
3630
|
unit: 'sources' | 'groups' | 'entries' | 'rounds';
|
|
3631
|
+
/** @description How many units the stage has finished. */
|
|
2985
3632
|
done: number;
|
|
3633
|
+
/** @description How many units the stage will process. Absent when `unit` is `rounds`. */
|
|
2986
3634
|
total?: number;
|
|
2987
3635
|
};
|
|
2988
3636
|
}[];
|
|
2989
3637
|
} | null;
|
|
2990
|
-
/**
|
|
3638
|
+
/**
|
|
3639
|
+
* Format: date-time
|
|
3640
|
+
* @description When a refresh last checked the knowledge base for changes, whether or not anything changed. `null` until the first refresh.
|
|
3641
|
+
*/
|
|
2991
3642
|
lastCheckedAt: string | null;
|
|
2992
|
-
/**
|
|
3643
|
+
/**
|
|
3644
|
+
* Format: date-time
|
|
3645
|
+
* @description When the content last changed: the time of the most recent successful build. `null` if the knowledge base has never built.
|
|
3646
|
+
*/
|
|
2993
3647
|
lastChangedAt: string | null;
|
|
3648
|
+
/** @description Whether sources were added, changed, or removed since the last successful build. Always `false` before the first build. */
|
|
2994
3649
|
hasPendingChanges: boolean;
|
|
3650
|
+
/** @description Counts of sources added, changed, and removed since the last successful build. Only `GET .../knowledge-bases/{knowledgeBaseId}` computes it. `null` in list responses and before the first build. */
|
|
2995
3651
|
pendingChanges: {
|
|
3652
|
+
/** @description Sources added since the last successful build, including sources no successful build has included yet. */
|
|
2996
3653
|
added: number;
|
|
3654
|
+
/** @description Sources whose content changed since the last successful build. */
|
|
2997
3655
|
changed: number;
|
|
3656
|
+
/** @description Sources that recent refreshes no longer find. */
|
|
2998
3657
|
removed: number;
|
|
2999
3658
|
} | null;
|
|
3659
|
+
/** @description Whether Sanity Context has improved how it builds knowledge bases since the last successful build. Rebuild to apply the improvements. Always `false` before the first build. */
|
|
3000
3660
|
pipelineOutdated: boolean;
|
|
3661
|
+
/** @description A recommendation to rebuild, because new or changed content doesn't fit the current outline. `null` when there's no recommendation. A refresh where the content fits again, a successful build, or adding or removing sources clears it. */
|
|
3001
3662
|
rebuildRecommended: {
|
|
3663
|
+
/** @description Why a rebuild is recommended, written to show to users. */
|
|
3002
3664
|
reason: string;
|
|
3003
|
-
/**
|
|
3665
|
+
/**
|
|
3666
|
+
* Format: date-time
|
|
3667
|
+
* @description When the recommendation was made.
|
|
3668
|
+
*/
|
|
3004
3669
|
at: string;
|
|
3005
3670
|
} | null;
|
|
3671
|
+
/** @description Whether the knowledge base has at least one website source. */
|
|
3006
3672
|
hasWebSource: boolean;
|
|
3673
|
+
/** @description Whether the knowledge base has at least one Sanity dataset source. */
|
|
3007
3674
|
hasDatasetSource: boolean;
|
|
3675
|
+
/** @description How many sources the knowledge base uses, and its source limit. */
|
|
3008
3676
|
sourceUsage: {
|
|
3677
|
+
/** @description The number of sources counted toward the limit, including parts split from large sources. */
|
|
3009
3678
|
used: number;
|
|
3679
|
+
/** @description The maximum number of sources the knowledge base can have. */
|
|
3010
3680
|
limit: number;
|
|
3011
3681
|
} | null;
|
|
3012
|
-
/** @description
|
|
3682
|
+
/** @description Why a build request would be denied right now, or `null` if you can build. Only `GET .../knowledge-bases/{knowledgeBaseId}` checks it. List and create responses always return `null`. */
|
|
3013
3683
|
buildRestriction: {
|
|
3684
|
+
/** @description A stable code for the restriction, such as `planLimitReached`. */
|
|
3014
3685
|
code: string;
|
|
3686
|
+
/** @description A readable explanation that you can show to users. */
|
|
3015
3687
|
message: string;
|
|
3016
3688
|
} | null;
|
|
3689
|
+
/** @description Whether scheduled refresh is on. Only applies to knowledge bases with a website or dataset source. */
|
|
3017
3690
|
refreshEnabled: boolean;
|
|
3018
|
-
/**
|
|
3691
|
+
/**
|
|
3692
|
+
* @description How often scheduled refresh runs: `weekly` (the default) or `monthly`.
|
|
3693
|
+
* @enum {string}
|
|
3694
|
+
*/
|
|
3019
3695
|
refreshFrequency: 'weekly' | 'monthly';
|
|
3020
|
-
/**
|
|
3696
|
+
/**
|
|
3697
|
+
* Format: date-time
|
|
3698
|
+
* @description When the next scheduled refresh runs. `null` when scheduled refresh is off or not scheduled yet. Only `GET .../knowledge-bases/{knowledgeBaseId}` computes it, so list responses return `null`.
|
|
3699
|
+
*/
|
|
3021
3700
|
refreshNextRunAt: string | null;
|
|
3701
|
+
/** @description Whether a refresh is running now. While it's `true`, a new refresh request doesn't start another one. Only `GET .../knowledge-bases/{knowledgeBaseId}` computes it, so list responses return `false`. */
|
|
3022
3702
|
refreshInFlight: boolean;
|
|
3703
|
+
/** @description The number of open issues waiting for review. Always `0` before the first build. */
|
|
3023
3704
|
openIssueCount: number;
|
|
3705
|
+
/** @description The number of active instructions for the knowledge base. */
|
|
3024
3706
|
instructionCount: number;
|
|
3025
|
-
/** @description
|
|
3707
|
+
/** @description Who created the knowledge base. `null` if unknown. */
|
|
3026
3708
|
createdBy: {
|
|
3709
|
+
/** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
|
|
3027
3710
|
id: string | null;
|
|
3711
|
+
/** @description The user's name when the action happened. `null` if unknown. For the current name, look up the user by `id`. */
|
|
3028
3712
|
displayName: string | null;
|
|
3029
3713
|
} | null;
|
|
3030
|
-
/**
|
|
3714
|
+
/**
|
|
3715
|
+
* Format: date-time
|
|
3716
|
+
* @description When the knowledge base was created.
|
|
3717
|
+
*/
|
|
3031
3718
|
createdAt: string;
|
|
3032
|
-
/**
|
|
3719
|
+
/**
|
|
3720
|
+
* Format: date-time
|
|
3721
|
+
* @description When the knowledge base was last updated.
|
|
3722
|
+
*/
|
|
3033
3723
|
updatedAt: string;
|
|
3034
3724
|
};
|
|
3035
3725
|
};
|
|
@@ -3041,19 +3731,21 @@ interface operations {
|
|
|
3041
3731
|
query?: never;
|
|
3042
3732
|
header?: never;
|
|
3043
3733
|
path: {
|
|
3734
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3044
3735
|
knowledgeBaseId: string;
|
|
3045
3736
|
};
|
|
3046
3737
|
cookie?: never;
|
|
3047
3738
|
};
|
|
3048
3739
|
requestBody?: never;
|
|
3049
3740
|
responses: {
|
|
3050
|
-
/** @description
|
|
3741
|
+
/** @description A queued job that you can poll for progress. */
|
|
3051
3742
|
202: {
|
|
3052
3743
|
headers: {
|
|
3053
3744
|
[name: string]: unknown;
|
|
3054
3745
|
};
|
|
3055
3746
|
content: {
|
|
3056
3747
|
'application/json': {
|
|
3748
|
+
/** @description The queued job's ID. Check its progress with `GET .../jobs/{jobId}`. */
|
|
3057
3749
|
jobId: string;
|
|
3058
3750
|
};
|
|
3059
3751
|
};
|
|
@@ -3065,19 +3757,21 @@ interface operations {
|
|
|
3065
3757
|
query?: never;
|
|
3066
3758
|
header?: never;
|
|
3067
3759
|
path: {
|
|
3760
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3068
3761
|
knowledgeBaseId: string;
|
|
3069
3762
|
};
|
|
3070
3763
|
cookie?: never;
|
|
3071
3764
|
};
|
|
3072
3765
|
requestBody?: never;
|
|
3073
3766
|
responses: {
|
|
3074
|
-
/** @description
|
|
3767
|
+
/** @description The result of the cancel request. */
|
|
3075
3768
|
200: {
|
|
3076
3769
|
headers: {
|
|
3077
3770
|
[name: string]: unknown;
|
|
3078
3771
|
};
|
|
3079
3772
|
content: {
|
|
3080
3773
|
'application/json': {
|
|
3774
|
+
/** @description Whether a running build was cancelled. `false` when no build was running. */
|
|
3081
3775
|
cancelled: boolean;
|
|
3082
3776
|
};
|
|
3083
3777
|
};
|
|
@@ -3089,24 +3783,31 @@ interface operations {
|
|
|
3089
3783
|
query?: never;
|
|
3090
3784
|
header?: never;
|
|
3091
3785
|
path: {
|
|
3786
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3092
3787
|
knowledgeBaseId: string;
|
|
3788
|
+
/** @description The entry's slash-delimited path, such as `pricing/plans/free`, URL-encoded. */
|
|
3093
3789
|
entryPath: string;
|
|
3094
3790
|
};
|
|
3095
3791
|
cookie?: never;
|
|
3096
3792
|
};
|
|
3097
3793
|
requestBody?: never;
|
|
3098
3794
|
responses: {
|
|
3099
|
-
/** @description
|
|
3795
|
+
/** @description The job that rebuilds the entry, and the other entries that share its sources. */
|
|
3100
3796
|
202: {
|
|
3101
3797
|
headers: {
|
|
3102
3798
|
[name: string]: unknown;
|
|
3103
3799
|
};
|
|
3104
3800
|
content: {
|
|
3105
3801
|
'application/json': {
|
|
3802
|
+
/** @description ID of the job that rebuilds the entry. Poll it with `GET .../jobs/{jobId}`. */
|
|
3106
3803
|
jobId: string;
|
|
3804
|
+
/** @description Other entries that cite any of this entry's sources. An instruction applies to every entry that cites its sources, so these entries can change when they are next rebuilt. */
|
|
3107
3805
|
affectedEntries: {
|
|
3806
|
+
/** @description The entry's document ID. */
|
|
3108
3807
|
id: string;
|
|
3808
|
+
/** @description The entry's path, such as `products/api/webhooks`. */
|
|
3109
3809
|
path: string;
|
|
3810
|
+
/** @description The entry's title. */
|
|
3110
3811
|
title: string;
|
|
3111
3812
|
}[];
|
|
3112
3813
|
};
|
|
@@ -3117,68 +3818,110 @@ interface operations {
|
|
|
3117
3818
|
listImports: {
|
|
3118
3819
|
parameters: {
|
|
3119
3820
|
query?: {
|
|
3821
|
+
/** @description The `nextCursor` value from the previous page. Omit it to get the first page. */
|
|
3120
3822
|
cursor?: string;
|
|
3823
|
+
/** @description The maximum number of items to return. */
|
|
3121
3824
|
limit?: number;
|
|
3122
3825
|
};
|
|
3123
3826
|
header?: never;
|
|
3124
3827
|
path: {
|
|
3828
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3125
3829
|
knowledgeBaseId: string;
|
|
3126
3830
|
};
|
|
3127
3831
|
cookie?: never;
|
|
3128
3832
|
};
|
|
3129
3833
|
requestBody?: never;
|
|
3130
3834
|
responses: {
|
|
3131
|
-
/** @description
|
|
3835
|
+
/** @description A page of imports. */
|
|
3132
3836
|
200: {
|
|
3133
3837
|
headers: {
|
|
3134
3838
|
[name: string]: unknown;
|
|
3135
3839
|
};
|
|
3136
3840
|
content: {
|
|
3137
3841
|
'application/json': {
|
|
3842
|
+
/** @description The items on this page. */
|
|
3138
3843
|
data: {
|
|
3139
|
-
/**
|
|
3844
|
+
/**
|
|
3845
|
+
* Format: uuid
|
|
3846
|
+
* @description The import's ID.
|
|
3847
|
+
*/
|
|
3140
3848
|
id: string;
|
|
3141
|
-
/**
|
|
3849
|
+
/**
|
|
3850
|
+
* Format: uuid
|
|
3851
|
+
* @description The `id` of the knowledge base that the import belongs to.
|
|
3852
|
+
*/
|
|
3142
3853
|
knowledgeBaseId: string;
|
|
3854
|
+
/** @description A label for the import: the file name for an upload, the root URL for a crawl, a label for a dataset query, or the title for inline text. */
|
|
3143
3855
|
name: string | null;
|
|
3856
|
+
/** @description The size of the uploaded file or inline text, in bytes. `null` for crawl and dataset imports, and until a file upload completes. */
|
|
3144
3857
|
sizeBytes: number | null;
|
|
3145
|
-
/**
|
|
3858
|
+
/**
|
|
3859
|
+
* @description The import's status. `uploading`: waiting for the file upload to complete. `processing`: content is being fetched and processed. `complete`: processing finished. `failed`: the import, or at least one of its sources, couldn't be processed. See `statusDetail` and `error` for details.
|
|
3860
|
+
* @enum {string}
|
|
3861
|
+
*/
|
|
3146
3862
|
status: 'uploading' | 'processing' | 'complete' | 'failed';
|
|
3147
|
-
/**
|
|
3863
|
+
/**
|
|
3864
|
+
* @description The kind of sources the import produces. `file`: uploads and inline text. `web`: crawls. `dataset`: Sanity datasets.
|
|
3865
|
+
* @enum {string}
|
|
3866
|
+
*/
|
|
3148
3867
|
sourceKind: 'web' | 'file' | 'dataset';
|
|
3149
|
-
/**
|
|
3868
|
+
/**
|
|
3869
|
+
* Format: date-time
|
|
3870
|
+
* @description When the import's website or dataset was last checked, even if nothing changed. `null` for file and text imports, and before the first check.
|
|
3871
|
+
*/
|
|
3150
3872
|
lastCheckedAt: string | null;
|
|
3873
|
+
/** @description The number of sources the import produced, such as crawled pages or files in an archive. Doesn't count parts split from large sources. */
|
|
3151
3874
|
sourceCount: number;
|
|
3875
|
+
/** @description The number of sources expected to be distilled, including parts split from large sources. Excludes skipped sources. */
|
|
3152
3876
|
totalDistillableCount: number;
|
|
3877
|
+
/** @description The number of sources distilled so far. Compare it with `totalDistillableCount` to show progress. */
|
|
3153
3878
|
distilledCount: number;
|
|
3879
|
+
/** @description The number of sources skipped because their file type isn't supported, such as images. */
|
|
3154
3880
|
unsupportedCount: number;
|
|
3881
|
+
/** @description A note about the import's outcome, written to show to users. It explains a failure or a partial result, such as a crawl that stopped at the source limit. `null` when there's nothing to note. Prefer it over `error`. */
|
|
3155
3882
|
statusDetail: string | null;
|
|
3883
|
+
/** @description When `status` is `failed`, a readable reason from one failed source. `null` for any other status, or when no single source failed. */
|
|
3156
3884
|
error: string | null;
|
|
3157
|
-
/** @description
|
|
3885
|
+
/** @description The options the next crawl of this website uses. An empty object means the defaults. `null` for other import types, and for a crawl whose root URL was removed. */
|
|
3158
3886
|
crawlOptions: {
|
|
3887
|
+
/** @description Regular expressions for URL paths to crawl. When set, the crawl only includes pages whose path matches one of them. */
|
|
3159
3888
|
includePaths?: string[];
|
|
3889
|
+
/** @description Regular expressions for URL paths to skip. Pages whose path matches one of them aren't crawled. */
|
|
3160
3890
|
excludePaths?: string[];
|
|
3891
|
+
/** @description How many levels deep the crawl goes from the root URL. */
|
|
3161
3892
|
maxDepth?: number;
|
|
3893
|
+
/** @description Whether to crawl only the pages listed in the site's sitemap. */
|
|
3162
3894
|
sitemapOnly?: boolean;
|
|
3895
|
+
/** @description Whether to treat URLs that differ only by query string as one page. New crawls set it to `true` unless you set it. Set it to `false` when the query string selects different content, such as pagination. */
|
|
3163
3896
|
ignoreQueryParameters?: boolean;
|
|
3897
|
+
/** @description The maximum number of pages to crawl. The crawl can stop sooner when the knowledge base reaches its source limit. */
|
|
3164
3898
|
pageLimit?: number;
|
|
3165
3899
|
} | null;
|
|
3166
|
-
/** @description
|
|
3900
|
+
/** @description The Sanity project, dataset, and full query a dataset import reads from. `null` for other import types. */
|
|
3167
3901
|
datasetSource: {
|
|
3902
|
+
/** @description The ID of the Sanity project the documents come from. */
|
|
3168
3903
|
sanityProjectId: string;
|
|
3904
|
+
/** @description The dataset the documents come from. */
|
|
3169
3905
|
sanityDatasetId: string;
|
|
3906
|
+
/** @description The full GROQ query that selects the documents, exactly as saved. */
|
|
3170
3907
|
query: string;
|
|
3171
3908
|
} | null;
|
|
3172
|
-
/** @description
|
|
3909
|
+
/** @description Who added the import. `null` if unknown. */
|
|
3173
3910
|
createdBy: {
|
|
3911
|
+
/** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
|
|
3174
3912
|
id: string | null;
|
|
3913
|
+
/** @description The user's name when the action happened. `null` if unknown. For the current name, look up the user by `id`. */
|
|
3175
3914
|
displayName: string | null;
|
|
3176
3915
|
} | null;
|
|
3177
|
-
/**
|
|
3916
|
+
/**
|
|
3917
|
+
* Format: date-time
|
|
3918
|
+
* @description When the import was created.
|
|
3919
|
+
*/
|
|
3178
3920
|
createdAt: string;
|
|
3179
3921
|
/** Format: date-time */
|
|
3180
3922
|
completedAt: string | null;
|
|
3181
3923
|
}[];
|
|
3924
|
+
/** @description The cursor for the next page. Pass it as `cursor` to get more results. `null` when there are no more pages. */
|
|
3182
3925
|
nextCursor: string | null;
|
|
3183
3926
|
};
|
|
3184
3927
|
};
|
|
@@ -3190,54 +3933,80 @@ interface operations {
|
|
|
3190
3933
|
query?: never;
|
|
3191
3934
|
header?: never;
|
|
3192
3935
|
path: {
|
|
3936
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3193
3937
|
knowledgeBaseId: string;
|
|
3194
3938
|
};
|
|
3195
3939
|
cookie?: never;
|
|
3196
3940
|
};
|
|
3197
|
-
/** @description
|
|
3941
|
+
/** @description Content to add to a knowledge base. The `type` field sets the kind of import. */
|
|
3198
3942
|
requestBody: {
|
|
3199
3943
|
content: {
|
|
3200
3944
|
'application/json': {
|
|
3201
|
-
/**
|
|
3945
|
+
/**
|
|
3946
|
+
* @description The import type. `text` imports inline content.
|
|
3947
|
+
* @enum {string}
|
|
3948
|
+
*/
|
|
3202
3949
|
type: 'text';
|
|
3950
|
+
/** @description The import's title, shown in the list of imports. */
|
|
3203
3951
|
title: string;
|
|
3952
|
+
/** @description The text or markdown to import, up to 1,000,000 bytes of UTF-8. */
|
|
3204
3953
|
content: string;
|
|
3205
3954
|
/**
|
|
3955
|
+
* @description The format of `content`: `text/markdown` (the default) or `text/plain`.
|
|
3206
3956
|
* @default text/markdown
|
|
3207
3957
|
* @enum {string}
|
|
3208
3958
|
*/
|
|
3209
3959
|
contentType?: 'text/markdown' | 'text/plain';
|
|
3210
3960
|
} | {
|
|
3211
|
-
/**
|
|
3961
|
+
/**
|
|
3962
|
+
* Format: uri
|
|
3963
|
+
* @description The URL to start crawling from. It must be a public `http` or `https` URL.
|
|
3964
|
+
*/
|
|
3212
3965
|
url: string;
|
|
3213
|
-
/** @description
|
|
3966
|
+
/** @description Options for the crawl. Options you omit use the defaults. */
|
|
3214
3967
|
options?: {
|
|
3968
|
+
/** @description Regular expressions for URL paths to crawl. When set, the crawl only includes pages whose path matches one of them. */
|
|
3215
3969
|
includePaths?: string[];
|
|
3970
|
+
/** @description Regular expressions for URL paths to skip. Pages whose path matches one of them aren't crawled. */
|
|
3216
3971
|
excludePaths?: string[];
|
|
3972
|
+
/** @description How many levels deep the crawl goes from the root URL. */
|
|
3217
3973
|
maxDepth?: number;
|
|
3974
|
+
/** @description Whether to crawl only the pages listed in the site's sitemap. */
|
|
3218
3975
|
sitemapOnly?: boolean;
|
|
3976
|
+
/** @description Whether to treat URLs that differ only by query string as one page. New crawls set it to `true` unless you set it. Set it to `false` when the query string selects different content, such as pagination. */
|
|
3219
3977
|
ignoreQueryParameters?: boolean;
|
|
3978
|
+
/** @description The maximum number of pages to crawl. The crawl can stop sooner when the knowledge base reaches its source limit. */
|
|
3220
3979
|
pageLimit?: number;
|
|
3221
3980
|
};
|
|
3222
|
-
/**
|
|
3981
|
+
/**
|
|
3982
|
+
* @description The import type. `crawl` imports a website.
|
|
3983
|
+
* @enum {string}
|
|
3984
|
+
*/
|
|
3223
3985
|
type: 'crawl';
|
|
3224
3986
|
} | {
|
|
3987
|
+
/** @description The ID of the Sanity project to read documents from. You need full read access to the dataset and, on its project, the Administrator or Developer role or a custom role that can create datasets. */
|
|
3225
3988
|
sanityProjectId: string;
|
|
3989
|
+
/** @description The dataset to read documents from, in the project set by `sanityProjectId`. */
|
|
3226
3990
|
sanityDatasetId: string;
|
|
3991
|
+
/** @description A GROQ query that selects the documents to import, with an optional projection. It can match up to 5,000 documents. Each refresh runs the query again. */
|
|
3227
3992
|
query: string;
|
|
3228
|
-
/**
|
|
3993
|
+
/**
|
|
3994
|
+
* @description The import type. `dataset` imports documents from a Sanity dataset.
|
|
3995
|
+
* @enum {string}
|
|
3996
|
+
*/
|
|
3229
3997
|
type: 'dataset';
|
|
3230
3998
|
};
|
|
3231
3999
|
};
|
|
3232
4000
|
};
|
|
3233
4001
|
responses: {
|
|
3234
|
-
/** @description
|
|
4002
|
+
/** @description A queued job that you can poll for progress. */
|
|
3235
4003
|
202: {
|
|
3236
4004
|
headers: {
|
|
3237
4005
|
[name: string]: unknown;
|
|
3238
4006
|
};
|
|
3239
4007
|
content: {
|
|
3240
4008
|
'application/json': {
|
|
4009
|
+
/** @description The queued job's ID. Check its progress with `GET .../jobs/{jobId}`. */
|
|
3241
4010
|
jobId: string;
|
|
3242
4011
|
};
|
|
3243
4012
|
};
|
|
@@ -3249,6 +4018,7 @@ interface operations {
|
|
|
3249
4018
|
query?: never;
|
|
3250
4019
|
header?: never;
|
|
3251
4020
|
path: {
|
|
4021
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3252
4022
|
knowledgeBaseId: string;
|
|
3253
4023
|
};
|
|
3254
4024
|
cookie?: never;
|
|
@@ -3256,22 +4026,30 @@ interface operations {
|
|
|
3256
4026
|
requestBody: {
|
|
3257
4027
|
content: {
|
|
3258
4028
|
'application/json': {
|
|
4029
|
+
/** @description The file's name. */
|
|
3259
4030
|
filename: string;
|
|
4031
|
+
/** @description The file's MIME type. If you set it, the `PUT` upload must send the same `Content-Type` header. */
|
|
3260
4032
|
contentType?: string;
|
|
3261
4033
|
};
|
|
3262
4034
|
};
|
|
3263
4035
|
};
|
|
3264
4036
|
responses: {
|
|
3265
|
-
/** @description
|
|
4037
|
+
/** @description The new file import and the URL to upload the file to. */
|
|
3266
4038
|
201: {
|
|
3267
4039
|
headers: {
|
|
3268
4040
|
[name: string]: unknown;
|
|
3269
4041
|
};
|
|
3270
4042
|
content: {
|
|
3271
4043
|
'application/json': {
|
|
3272
|
-
/**
|
|
4044
|
+
/**
|
|
4045
|
+
* Format: uuid
|
|
4046
|
+
* @description The ID of the new import. Use it to complete the upload and track the import.
|
|
4047
|
+
*/
|
|
3273
4048
|
importId: string;
|
|
3274
|
-
/**
|
|
4049
|
+
/**
|
|
4050
|
+
* Format: uri
|
|
4051
|
+
* @description A signed URL to send the file to in a single `PUT` request. It expires after one hour.
|
|
4052
|
+
*/
|
|
3275
4053
|
uploadUrl: string;
|
|
3276
4054
|
};
|
|
3277
4055
|
};
|
|
@@ -3283,20 +4061,23 @@ interface operations {
|
|
|
3283
4061
|
query?: never;
|
|
3284
4062
|
header?: never;
|
|
3285
4063
|
path: {
|
|
4064
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3286
4065
|
knowledgeBaseId: string;
|
|
4066
|
+
/** @description The import's ID. */
|
|
3287
4067
|
importId: string;
|
|
3288
4068
|
};
|
|
3289
4069
|
cookie?: never;
|
|
3290
4070
|
};
|
|
3291
4071
|
requestBody?: never;
|
|
3292
4072
|
responses: {
|
|
3293
|
-
/** @description
|
|
4073
|
+
/** @description A queued job that you can poll for progress. */
|
|
3294
4074
|
202: {
|
|
3295
4075
|
headers: {
|
|
3296
4076
|
[name: string]: unknown;
|
|
3297
4077
|
};
|
|
3298
4078
|
content: {
|
|
3299
4079
|
'application/json': {
|
|
4080
|
+
/** @description The queued job's ID. Check its progress with `GET .../jobs/{jobId}`. */
|
|
3300
4081
|
jobId: string;
|
|
3301
4082
|
};
|
|
3302
4083
|
};
|
|
@@ -3308,59 +4089,98 @@ interface operations {
|
|
|
3308
4089
|
query?: never;
|
|
3309
4090
|
header?: never;
|
|
3310
4091
|
path: {
|
|
4092
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3311
4093
|
knowledgeBaseId: string;
|
|
4094
|
+
/** @description The import's ID. */
|
|
3312
4095
|
importId: string;
|
|
3313
4096
|
};
|
|
3314
4097
|
cookie?: never;
|
|
3315
4098
|
};
|
|
3316
4099
|
requestBody?: never;
|
|
3317
4100
|
responses: {
|
|
3318
|
-
/** @description
|
|
4101
|
+
/** @description Content added to a knowledge base: a file upload, website crawl, Sanity dataset, or inline text. */
|
|
3319
4102
|
200: {
|
|
3320
4103
|
headers: {
|
|
3321
4104
|
[name: string]: unknown;
|
|
3322
4105
|
};
|
|
3323
4106
|
content: {
|
|
3324
4107
|
'application/json': {
|
|
3325
|
-
/**
|
|
4108
|
+
/**
|
|
4109
|
+
* Format: uuid
|
|
4110
|
+
* @description The import's ID.
|
|
4111
|
+
*/
|
|
3326
4112
|
id: string;
|
|
3327
|
-
/**
|
|
4113
|
+
/**
|
|
4114
|
+
* Format: uuid
|
|
4115
|
+
* @description The `id` of the knowledge base that the import belongs to.
|
|
4116
|
+
*/
|
|
3328
4117
|
knowledgeBaseId: string;
|
|
4118
|
+
/** @description A label for the import: the file name for an upload, the root URL for a crawl, a label for a dataset query, or the title for inline text. */
|
|
3329
4119
|
name: string | null;
|
|
4120
|
+
/** @description The size of the uploaded file or inline text, in bytes. `null` for crawl and dataset imports, and until a file upload completes. */
|
|
3330
4121
|
sizeBytes: number | null;
|
|
3331
|
-
/**
|
|
4122
|
+
/**
|
|
4123
|
+
* @description The import's status. `uploading`: waiting for the file upload to complete. `processing`: content is being fetched and processed. `complete`: processing finished. `failed`: the import, or at least one of its sources, couldn't be processed. See `statusDetail` and `error` for details.
|
|
4124
|
+
* @enum {string}
|
|
4125
|
+
*/
|
|
3332
4126
|
status: 'uploading' | 'processing' | 'complete' | 'failed';
|
|
3333
|
-
/**
|
|
4127
|
+
/**
|
|
4128
|
+
* @description The kind of sources the import produces. `file`: uploads and inline text. `web`: crawls. `dataset`: Sanity datasets.
|
|
4129
|
+
* @enum {string}
|
|
4130
|
+
*/
|
|
3334
4131
|
sourceKind: 'web' | 'file' | 'dataset';
|
|
3335
|
-
/**
|
|
4132
|
+
/**
|
|
4133
|
+
* Format: date-time
|
|
4134
|
+
* @description When the import's website or dataset was last checked, even if nothing changed. `null` for file and text imports, and before the first check.
|
|
4135
|
+
*/
|
|
3336
4136
|
lastCheckedAt: string | null;
|
|
4137
|
+
/** @description The number of sources the import produced, such as crawled pages or files in an archive. Doesn't count parts split from large sources. */
|
|
3337
4138
|
sourceCount: number;
|
|
4139
|
+
/** @description The number of sources expected to be distilled, including parts split from large sources. Excludes skipped sources. */
|
|
3338
4140
|
totalDistillableCount: number;
|
|
4141
|
+
/** @description The number of sources distilled so far. Compare it with `totalDistillableCount` to show progress. */
|
|
3339
4142
|
distilledCount: number;
|
|
4143
|
+
/** @description The number of sources skipped because their file type isn't supported, such as images. */
|
|
3340
4144
|
unsupportedCount: number;
|
|
4145
|
+
/** @description A note about the import's outcome, written to show to users. It explains a failure or a partial result, such as a crawl that stopped at the source limit. `null` when there's nothing to note. Prefer it over `error`. */
|
|
3341
4146
|
statusDetail: string | null;
|
|
4147
|
+
/** @description When `status` is `failed`, a readable reason from one failed source. `null` for any other status, or when no single source failed. */
|
|
3342
4148
|
error: string | null;
|
|
3343
|
-
/** @description
|
|
4149
|
+
/** @description The options the next crawl of this website uses. An empty object means the defaults. `null` for other import types, and for a crawl whose root URL was removed. */
|
|
3344
4150
|
crawlOptions: {
|
|
4151
|
+
/** @description Regular expressions for URL paths to crawl. When set, the crawl only includes pages whose path matches one of them. */
|
|
3345
4152
|
includePaths?: string[];
|
|
4153
|
+
/** @description Regular expressions for URL paths to skip. Pages whose path matches one of them aren't crawled. */
|
|
3346
4154
|
excludePaths?: string[];
|
|
4155
|
+
/** @description How many levels deep the crawl goes from the root URL. */
|
|
3347
4156
|
maxDepth?: number;
|
|
4157
|
+
/** @description Whether to crawl only the pages listed in the site's sitemap. */
|
|
3348
4158
|
sitemapOnly?: boolean;
|
|
4159
|
+
/** @description Whether to treat URLs that differ only by query string as one page. New crawls set it to `true` unless you set it. Set it to `false` when the query string selects different content, such as pagination. */
|
|
3349
4160
|
ignoreQueryParameters?: boolean;
|
|
4161
|
+
/** @description The maximum number of pages to crawl. The crawl can stop sooner when the knowledge base reaches its source limit. */
|
|
3350
4162
|
pageLimit?: number;
|
|
3351
4163
|
} | null;
|
|
3352
|
-
/** @description
|
|
4164
|
+
/** @description The Sanity project, dataset, and full query a dataset import reads from. `null` for other import types. */
|
|
3353
4165
|
datasetSource: {
|
|
4166
|
+
/** @description The ID of the Sanity project the documents come from. */
|
|
3354
4167
|
sanityProjectId: string;
|
|
4168
|
+
/** @description The dataset the documents come from. */
|
|
3355
4169
|
sanityDatasetId: string;
|
|
4170
|
+
/** @description The full GROQ query that selects the documents, exactly as saved. */
|
|
3356
4171
|
query: string;
|
|
3357
4172
|
} | null;
|
|
3358
|
-
/** @description
|
|
4173
|
+
/** @description Who added the import. `null` if unknown. */
|
|
3359
4174
|
createdBy: {
|
|
4175
|
+
/** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
|
|
3360
4176
|
id: string | null;
|
|
4177
|
+
/** @description The user's name when the action happened. `null` if unknown. For the current name, look up the user by `id`. */
|
|
3361
4178
|
displayName: string | null;
|
|
3362
4179
|
} | null;
|
|
3363
|
-
/**
|
|
4180
|
+
/**
|
|
4181
|
+
* Format: date-time
|
|
4182
|
+
* @description When the import was created.
|
|
4183
|
+
*/
|
|
3364
4184
|
createdAt: string;
|
|
3365
4185
|
/** Format: date-time */
|
|
3366
4186
|
completedAt: string | null;
|
|
@@ -3374,14 +4194,16 @@ interface operations {
|
|
|
3374
4194
|
query?: never;
|
|
3375
4195
|
header?: never;
|
|
3376
4196
|
path: {
|
|
4197
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3377
4198
|
knowledgeBaseId: string;
|
|
4199
|
+
/** @description The import's ID. */
|
|
3378
4200
|
importId: string;
|
|
3379
4201
|
};
|
|
3380
4202
|
cookie?: never;
|
|
3381
4203
|
};
|
|
3382
4204
|
requestBody?: never;
|
|
3383
4205
|
responses: {
|
|
3384
|
-
/** @description
|
|
4206
|
+
/** @description The import and its sources were deleted. */
|
|
3385
4207
|
204: {
|
|
3386
4208
|
headers: {
|
|
3387
4209
|
[name: string]: unknown;
|
|
@@ -3397,23 +4219,31 @@ interface operations {
|
|
|
3397
4219
|
query?: never;
|
|
3398
4220
|
header?: never;
|
|
3399
4221
|
path: {
|
|
4222
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3400
4223
|
knowledgeBaseId: string;
|
|
4224
|
+
/** @description The import's ID. */
|
|
3401
4225
|
importId: string;
|
|
3402
4226
|
};
|
|
3403
4227
|
cookie?: never;
|
|
3404
4228
|
};
|
|
3405
4229
|
requestBody?: never;
|
|
3406
4230
|
responses: {
|
|
3407
|
-
/** @description
|
|
4231
|
+
/** @description A short-lived URL that downloads the import's original content. */
|
|
3408
4232
|
200: {
|
|
3409
4233
|
headers: {
|
|
3410
4234
|
[name: string]: unknown;
|
|
3411
4235
|
};
|
|
3412
4236
|
content: {
|
|
3413
4237
|
'application/json': {
|
|
3414
|
-
/**
|
|
4238
|
+
/**
|
|
4239
|
+
* Format: uri
|
|
4240
|
+
* @description A signed URL that downloads the import's original content as a file.
|
|
4241
|
+
*/
|
|
3415
4242
|
url: string;
|
|
3416
|
-
/**
|
|
4243
|
+
/**
|
|
4244
|
+
* Format: date-time
|
|
4245
|
+
* @description When `url` expires, 10 minutes after the request.
|
|
4246
|
+
*/
|
|
3417
4247
|
expiresAt: string;
|
|
3418
4248
|
};
|
|
3419
4249
|
};
|
|
@@ -3425,58 +4255,89 @@ interface operations {
|
|
|
3425
4255
|
query?: never;
|
|
3426
4256
|
header?: never;
|
|
3427
4257
|
path: {
|
|
4258
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3428
4259
|
knowledgeBaseId: string;
|
|
3429
4260
|
};
|
|
3430
4261
|
cookie?: never;
|
|
3431
4262
|
};
|
|
3432
|
-
/** @description
|
|
4263
|
+
/** @description The instruction to create, and any entries to rebuild under it. */
|
|
3433
4264
|
requestBody: {
|
|
3434
4265
|
content: {
|
|
3435
4266
|
'application/json': {
|
|
4267
|
+
/** @description The instruction in plain language. Builds follow it over what the sources say. */
|
|
3436
4268
|
statement: string;
|
|
4269
|
+
/** @description IDs of the sources the instruction applies to. Builds apply it when they write entries that cite these sources. IDs of sources that no longer exist are dropped. If none exist, the request returns `422` with code `instructionScopeVanished`. */
|
|
3437
4270
|
scopeSourceIds: string[];
|
|
4271
|
+
/** @description Paths of entries to rebuild under the new instruction right away. The response returns the rebuild job ID in `rebuildJobId`. */
|
|
3438
4272
|
rebuildPaths?: string[];
|
|
4273
|
+
/** @description Whether you already checked the instruction for entries that contradict it. When `true`, the background check that files issues for those entries is skipped. It still runs if the rebuild you requested in `rebuildPaths` does not start. */
|
|
3439
4274
|
verified?: boolean;
|
|
3440
4275
|
};
|
|
3441
4276
|
};
|
|
3442
4277
|
};
|
|
3443
4278
|
responses: {
|
|
3444
|
-
/** @description
|
|
4279
|
+
/** @description The created instruction, and the rebuild it started. */
|
|
3445
4280
|
201: {
|
|
3446
4281
|
headers: {
|
|
3447
4282
|
[name: string]: unknown;
|
|
3448
4283
|
};
|
|
3449
4284
|
content: {
|
|
3450
4285
|
'application/json': {
|
|
3451
|
-
/** @description
|
|
4286
|
+
/** @description The created instruction. */
|
|
3452
4287
|
instruction: {
|
|
4288
|
+
/** @description The instruction's document ID. */
|
|
3453
4289
|
id: string;
|
|
4290
|
+
/** @description ID of the knowledge base the instruction belongs to. */
|
|
3454
4291
|
knowledgeBaseId: string;
|
|
3455
|
-
/**
|
|
4292
|
+
/**
|
|
4293
|
+
* @description How the instruction was created. `human`: someone wrote it. `conflict`: it records the side chosen when a conflict issue was resolved. Both kinds work the same way in builds.
|
|
4294
|
+
* @enum {string}
|
|
4295
|
+
*/
|
|
3456
4296
|
origin: 'conflict' | 'human';
|
|
3457
|
-
/**
|
|
4297
|
+
/**
|
|
4298
|
+
* @description Whether builds apply the instruction. `active`: builds apply it. `archived`: a refresh found that its sources no longer support it, so builds stop applying it. To reactivate an archived instruction, update it.
|
|
4299
|
+
* @enum {string}
|
|
4300
|
+
*/
|
|
3458
4301
|
status: 'active' | 'archived';
|
|
4302
|
+
/** @description The instruction in plain language. Builds follow it over what the sources say. */
|
|
3459
4303
|
statement: string;
|
|
4304
|
+
/** @description IDs of the sources the instruction applies to. Builds apply it when they write entries that cite these sources. An empty array means all of its sources were removed, so it applies to no entries. */
|
|
3460
4305
|
scopeSourceIds: string[];
|
|
3461
|
-
/**
|
|
4306
|
+
/**
|
|
4307
|
+
* Format: date-time
|
|
4308
|
+
* @description When a refresh archived the instruction. `null` while it is active.
|
|
4309
|
+
*/
|
|
3462
4310
|
archivedAt: string | null;
|
|
4311
|
+
/** @description Why the instruction was archived. `null` while it is active. */
|
|
3463
4312
|
archivedReason: string | null;
|
|
4313
|
+
/** @description ID of the conflict issue this instruction records. `null` when `origin` is `human`. */
|
|
3464
4314
|
sourceIssueId: string | null;
|
|
3465
|
-
/** @description
|
|
4315
|
+
/** @description Who created the instruction. `null` for instructions created by resolving a conflict, and when the creator is unknown. */
|
|
3466
4316
|
createdBy: {
|
|
4317
|
+
/** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
|
|
3467
4318
|
id: string | null;
|
|
4319
|
+
/** @description The user's name when the action happened. `null` if unknown. For the current name, look up the user by `id`. */
|
|
3468
4320
|
displayName: string | null;
|
|
3469
4321
|
} | null;
|
|
3470
|
-
/** @description
|
|
4322
|
+
/** @description Who last updated the instruction through the API. `null` when it was never updated, or when the person is unknown. */
|
|
3471
4323
|
updatedBy: {
|
|
4324
|
+
/** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
|
|
3472
4325
|
id: string | null;
|
|
4326
|
+
/** @description The user's name when the action happened. `null` if unknown. For the current name, look up the user by `id`. */
|
|
3473
4327
|
displayName: string | null;
|
|
3474
4328
|
} | null;
|
|
3475
|
-
/**
|
|
4329
|
+
/**
|
|
4330
|
+
* Format: date-time
|
|
4331
|
+
* @description When the instruction was created.
|
|
4332
|
+
*/
|
|
3476
4333
|
createdAt: string;
|
|
3477
|
-
/**
|
|
4334
|
+
/**
|
|
4335
|
+
* Format: date-time
|
|
4336
|
+
* @description When the instruction last changed, including changes a refresh makes. `null` when the time is unknown.
|
|
4337
|
+
*/
|
|
3478
4338
|
updatedAt: string | null;
|
|
3479
4339
|
};
|
|
4340
|
+
/** @description ID of the job that rebuilds the entries in `rebuildPaths`. Poll it with `GET .../jobs/{jobId}`. `null` when you didn't pass `rebuildPaths` or the rebuild could not start. The instruction is saved either way. */
|
|
3480
4341
|
rebuildJobId: string | null;
|
|
3481
4342
|
};
|
|
3482
4343
|
};
|
|
@@ -3488,14 +4349,16 @@ interface operations {
|
|
|
3488
4349
|
query?: never;
|
|
3489
4350
|
header?: never;
|
|
3490
4351
|
path: {
|
|
4352
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3491
4353
|
knowledgeBaseId: string;
|
|
4354
|
+
/** @description The instruction's ID. */
|
|
3492
4355
|
instructionId: string;
|
|
3493
4356
|
};
|
|
3494
4357
|
cookie?: never;
|
|
3495
4358
|
};
|
|
3496
4359
|
requestBody?: never;
|
|
3497
4360
|
responses: {
|
|
3498
|
-
/** @description
|
|
4361
|
+
/** @description The instruction was deleted. */
|
|
3499
4362
|
204: {
|
|
3500
4363
|
headers: {
|
|
3501
4364
|
[name: string]: unknown;
|
|
@@ -3511,53 +4374,82 @@ interface operations {
|
|
|
3511
4374
|
query?: never;
|
|
3512
4375
|
header?: never;
|
|
3513
4376
|
path: {
|
|
4377
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3514
4378
|
knowledgeBaseId: string;
|
|
4379
|
+
/** @description The instruction's ID. */
|
|
3515
4380
|
instructionId: string;
|
|
3516
4381
|
};
|
|
3517
4382
|
cookie?: never;
|
|
3518
4383
|
};
|
|
3519
|
-
/** @description
|
|
4384
|
+
/** @description The changes to make to an instruction. Set `statement`, `scopeSourceIds`, or both. Any update also reactivates an archived instruction. */
|
|
3520
4385
|
requestBody: {
|
|
3521
4386
|
content: {
|
|
3522
4387
|
'application/json': {
|
|
4388
|
+
/** @description The new instruction text. Omit it to keep the current text. */
|
|
3523
4389
|
statement?: string;
|
|
4390
|
+
/** @description IDs of the sources the instruction applies to. Replaces the current list. Omit it to keep the current sources. IDs of sources that no longer exist are dropped. If none exist, the request returns `422` with code `instructionScopeVanished`. */
|
|
3524
4391
|
scopeSourceIds?: string[];
|
|
3525
4392
|
};
|
|
3526
4393
|
};
|
|
3527
4394
|
};
|
|
3528
4395
|
responses: {
|
|
3529
|
-
/** @description
|
|
4396
|
+
/** @description A standing instruction that shapes how entries that cite its sources are written. */
|
|
3530
4397
|
200: {
|
|
3531
4398
|
headers: {
|
|
3532
4399
|
[name: string]: unknown;
|
|
3533
4400
|
};
|
|
3534
4401
|
content: {
|
|
3535
4402
|
'application/json': {
|
|
4403
|
+
/** @description The instruction's document ID. */
|
|
3536
4404
|
id: string;
|
|
4405
|
+
/** @description ID of the knowledge base the instruction belongs to. */
|
|
3537
4406
|
knowledgeBaseId: string;
|
|
3538
|
-
/**
|
|
4407
|
+
/**
|
|
4408
|
+
* @description How the instruction was created. `human`: someone wrote it. `conflict`: it records the side chosen when a conflict issue was resolved. Both kinds work the same way in builds.
|
|
4409
|
+
* @enum {string}
|
|
4410
|
+
*/
|
|
3539
4411
|
origin: 'conflict' | 'human';
|
|
3540
|
-
/**
|
|
4412
|
+
/**
|
|
4413
|
+
* @description Whether builds apply the instruction. `active`: builds apply it. `archived`: a refresh found that its sources no longer support it, so builds stop applying it. To reactivate an archived instruction, update it.
|
|
4414
|
+
* @enum {string}
|
|
4415
|
+
*/
|
|
3541
4416
|
status: 'active' | 'archived';
|
|
4417
|
+
/** @description The instruction in plain language. Builds follow it over what the sources say. */
|
|
3542
4418
|
statement: string;
|
|
4419
|
+
/** @description IDs of the sources the instruction applies to. Builds apply it when they write entries that cite these sources. An empty array means all of its sources were removed, so it applies to no entries. */
|
|
3543
4420
|
scopeSourceIds: string[];
|
|
3544
|
-
/**
|
|
4421
|
+
/**
|
|
4422
|
+
* Format: date-time
|
|
4423
|
+
* @description When a refresh archived the instruction. `null` while it is active.
|
|
4424
|
+
*/
|
|
3545
4425
|
archivedAt: string | null;
|
|
4426
|
+
/** @description Why the instruction was archived. `null` while it is active. */
|
|
3546
4427
|
archivedReason: string | null;
|
|
4428
|
+
/** @description ID of the conflict issue this instruction records. `null` when `origin` is `human`. */
|
|
3547
4429
|
sourceIssueId: string | null;
|
|
3548
|
-
/** @description
|
|
4430
|
+
/** @description Who created the instruction. `null` for instructions created by resolving a conflict, and when the creator is unknown. */
|
|
3549
4431
|
createdBy: {
|
|
4432
|
+
/** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
|
|
3550
4433
|
id: string | null;
|
|
4434
|
+
/** @description The user's name when the action happened. `null` if unknown. For the current name, look up the user by `id`. */
|
|
3551
4435
|
displayName: string | null;
|
|
3552
4436
|
} | null;
|
|
3553
|
-
/** @description
|
|
4437
|
+
/** @description Who last updated the instruction through the API. `null` when it was never updated, or when the person is unknown. */
|
|
3554
4438
|
updatedBy: {
|
|
4439
|
+
/** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
|
|
3555
4440
|
id: string | null;
|
|
4441
|
+
/** @description The user's name when the action happened. `null` if unknown. For the current name, look up the user by `id`. */
|
|
3556
4442
|
displayName: string | null;
|
|
3557
4443
|
} | null;
|
|
3558
|
-
/**
|
|
4444
|
+
/**
|
|
4445
|
+
* Format: date-time
|
|
4446
|
+
* @description When the instruction was created.
|
|
4447
|
+
*/
|
|
3559
4448
|
createdAt: string;
|
|
3560
|
-
/**
|
|
4449
|
+
/**
|
|
4450
|
+
* Format: date-time
|
|
4451
|
+
* @description When the instruction last changed, including changes a refresh makes. `null` when the time is unknown.
|
|
4452
|
+
*/
|
|
3561
4453
|
updatedAt: string | null;
|
|
3562
4454
|
};
|
|
3563
4455
|
};
|
|
@@ -3569,6 +4461,7 @@ interface operations {
|
|
|
3569
4461
|
query?: never;
|
|
3570
4462
|
header?: never;
|
|
3571
4463
|
path: {
|
|
4464
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3572
4465
|
knowledgeBaseId: string;
|
|
3573
4466
|
};
|
|
3574
4467
|
cookie?: never;
|
|
@@ -3576,18 +4469,20 @@ interface operations {
|
|
|
3576
4469
|
requestBody: {
|
|
3577
4470
|
content: {
|
|
3578
4471
|
'application/json': {
|
|
4472
|
+
/** @description The IDs of the issues to accept and apply. */
|
|
3579
4473
|
issueIds: string[];
|
|
3580
4474
|
};
|
|
3581
4475
|
};
|
|
3582
4476
|
};
|
|
3583
4477
|
responses: {
|
|
3584
|
-
/** @description
|
|
4478
|
+
/** @description A queued job that you can poll for progress. */
|
|
3585
4479
|
202: {
|
|
3586
4480
|
headers: {
|
|
3587
4481
|
[name: string]: unknown;
|
|
3588
4482
|
};
|
|
3589
4483
|
content: {
|
|
3590
4484
|
'application/json': {
|
|
4485
|
+
/** @description The queued job's ID. Check its progress with `GET .../jobs/{jobId}`. */
|
|
3591
4486
|
jobId: string;
|
|
3592
4487
|
};
|
|
3593
4488
|
};
|
|
@@ -3599,71 +4494,123 @@ interface operations {
|
|
|
3599
4494
|
query?: never;
|
|
3600
4495
|
header?: never;
|
|
3601
4496
|
path: {
|
|
4497
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3602
4498
|
knowledgeBaseId: string;
|
|
4499
|
+
/** @description The issue's document ID. */
|
|
3603
4500
|
issueId: string;
|
|
3604
4501
|
};
|
|
3605
4502
|
cookie?: never;
|
|
3606
4503
|
};
|
|
3607
4504
|
requestBody?: never;
|
|
3608
4505
|
responses: {
|
|
3609
|
-
/** @description
|
|
4506
|
+
/** @description An issue found in a knowledge base, and its triage status. */
|
|
3610
4507
|
200: {
|
|
3611
4508
|
headers: {
|
|
3612
4509
|
[name: string]: unknown;
|
|
3613
4510
|
};
|
|
3614
4511
|
content: {
|
|
3615
4512
|
'application/json': {
|
|
4513
|
+
/** @description The issue's document ID. A later build that finds the same issue in unchanged sources reuses this ID, so your triage decision is kept. */
|
|
3616
4514
|
id: string;
|
|
4515
|
+
/** @description ID of the knowledge base the issue belongs to. */
|
|
3617
4516
|
knowledgeBaseId: string;
|
|
3618
|
-
/** @description
|
|
4517
|
+
/** @description What the issue found. The shape depends on `kind`. */
|
|
3619
4518
|
content: {
|
|
3620
|
-
/**
|
|
4519
|
+
/**
|
|
4520
|
+
* @description How serious the issue is. `critical`: content is wrong or missing in a way that can mislead an agent. `suggestion`: a change that improves quality.
|
|
4521
|
+
* @enum {string}
|
|
4522
|
+
*/
|
|
3621
4523
|
severity: 'critical' | 'suggestion';
|
|
4524
|
+
/** @description Path of the entry the issue is about, or `*` when it applies to the whole knowledge base. For `add_entry`, the path of the proposed entry. */
|
|
3622
4525
|
scopePath: string;
|
|
4526
|
+
/** @description What the problem is, in one or two sentences. */
|
|
3623
4527
|
issue: string;
|
|
4528
|
+
/** @description What to do to fix the issue. */
|
|
3624
4529
|
suggestedFix: string;
|
|
3625
|
-
/**
|
|
4530
|
+
/**
|
|
4531
|
+
* @description The issue type. `conflict` means two or more positions disagree on the same fact, and you choose which one is correct.
|
|
4532
|
+
* @enum {string}
|
|
4533
|
+
*/
|
|
3626
4534
|
kind: 'conflict';
|
|
4535
|
+
/** @description A key naming the disputed fact, such as `free_tier.request_limit`. It never includes the disputed value, so every side shares it. */
|
|
3627
4536
|
claimKey: string;
|
|
4537
|
+
/** @description The conflicting positions, at least two. To resolve the conflict, pass the index of one side as `resolution`. */
|
|
3628
4538
|
sides: {
|
|
4539
|
+
/** @description The position as a self-contained sentence. This is the option you choose from. */
|
|
3629
4540
|
claim: string;
|
|
4541
|
+
/** @description The disputed value on its own, such as `10,000/month`, without the sentence. */
|
|
3630
4542
|
value?: string;
|
|
4543
|
+
/** @description Paths of the entries that state this position. */
|
|
3631
4544
|
entryPaths?: string[];
|
|
4545
|
+
/** @description IDs of the sources that directly back this position. */
|
|
3632
4546
|
sourceIds?: string[];
|
|
3633
|
-
/** @description
|
|
4547
|
+
/** @description Where in a source this position was read. */
|
|
3634
4548
|
span?: {
|
|
4549
|
+
/** @description ID of the source the position was read from. */
|
|
3635
4550
|
sourceId: string;
|
|
4551
|
+
/** @description First line of the range, counting from 1. Line numbers match `GET .../sources/{sourceId}/content`. */
|
|
3636
4552
|
lineStart: number;
|
|
4553
|
+
/** @description Last line of the range, inclusive. */
|
|
3637
4554
|
lineEnd: number;
|
|
3638
4555
|
};
|
|
3639
|
-
/**
|
|
4556
|
+
/**
|
|
4557
|
+
* @description How much weight the sources behind this position carry. `primary`: your own content, such as uploaded files and pages on your own site. `secondary`: other sources. `community`: forums and Q&A sites.
|
|
4558
|
+
* @enum {string}
|
|
4559
|
+
*/
|
|
3640
4560
|
authority?: 'primary' | 'secondary' | 'community';
|
|
3641
4561
|
}[];
|
|
4562
|
+
/** @description Index in `sides` of the suggested side, when there is one. It is only a hint: nothing is chosen until you resolve the issue. */
|
|
3642
4563
|
suggested?: number;
|
|
3643
4564
|
} | {
|
|
3644
|
-
/**
|
|
4565
|
+
/**
|
|
4566
|
+
* @description How serious the issue is. `critical`: content is wrong or missing in a way that can mislead an agent. `suggestion`: a change that improves quality.
|
|
4567
|
+
* @enum {string}
|
|
4568
|
+
*/
|
|
3645
4569
|
severity: 'critical' | 'suggestion';
|
|
4570
|
+
/** @description Path of the entry the issue is about, or `*` when it applies to the whole knowledge base. For `add_entry`, the path of the proposed entry. */
|
|
3646
4571
|
scopePath: string;
|
|
4572
|
+
/** @description What the problem is, in one or two sentences. */
|
|
3647
4573
|
issue: string;
|
|
4574
|
+
/** @description What to do to fix the issue. */
|
|
3648
4575
|
suggestedFix: string;
|
|
3649
|
-
/**
|
|
4576
|
+
/**
|
|
4577
|
+
* @description The issue type. `gap`: your sources cover material that entries leave out. `update_required`: an entry is out of date with its sources or contradicts an instruction, and needs a rewrite. `add_entry`: your sources cover a topic that no entry covers. `remove_entry`: an entry has lost its sources or its topic no longer applies. `split_entry`: an entry covers several distinct topics and should become child entries. `merge_entry`: an entry has too few sources to stand alone, so merge it into a nearby entry or keep it as it is.
|
|
4578
|
+
* @enum {string}
|
|
4579
|
+
*/
|
|
3650
4580
|
kind: 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
4581
|
+
/** @description IDs of the sources that led to the issue. For `add_entry`, the sources the new entry would cite. */
|
|
3651
4582
|
citedSourceIds?: string[];
|
|
4583
|
+
/** @description A key naming the specific finding, when the check that found it sets one. */
|
|
3652
4584
|
claimKey?: string;
|
|
4585
|
+
/** @description Paths of the entries the issue involves, when it spans more than one entry. */
|
|
3653
4586
|
involvedScopes?: string[];
|
|
3654
4587
|
};
|
|
3655
|
-
/**
|
|
4588
|
+
/**
|
|
4589
|
+
* @description The triage status. `open`: waiting for triage. `accepted`: accepted with `POST .../issues/apply`, or a conflict resolved to one side. `rejected`: dismissed. A rejected issue stays rejected. You can return an accepted conflict to `open` with `POST .../issues/{issueId}/reopen`.
|
|
4590
|
+
* @enum {string}
|
|
4591
|
+
*/
|
|
3656
4592
|
status: 'open' | 'accepted' | 'rejected';
|
|
4593
|
+
/** @description Index in `content.sides` of the side chosen when the conflict was resolved. For a conflict on a single entry, index `0` is the entry's current content. `null` until a conflict is resolved, and always `null` for other issue types. */
|
|
3657
4594
|
resolution: number | null;
|
|
3658
|
-
/** @description
|
|
4595
|
+
/** @description Who triaged the issue, so you can review what your agents decided. `null` while the issue is open, or when the caller could not be identified. */
|
|
3659
4596
|
resolvedBy: {
|
|
4597
|
+
/** @description Sanity user ID of the person or robot that triaged the issue. */
|
|
3660
4598
|
id: string;
|
|
3661
|
-
/**
|
|
4599
|
+
/**
|
|
4600
|
+
* @description `user` when a person made the decision. `robot` when a robot token did, such as an agent.
|
|
4601
|
+
* @enum {string}
|
|
4602
|
+
*/
|
|
3662
4603
|
kind: 'user' | 'robot';
|
|
3663
4604
|
} | null;
|
|
3664
|
-
/**
|
|
4605
|
+
/**
|
|
4606
|
+
* Format: date-time
|
|
4607
|
+
* @description When the issue was first filed.
|
|
4608
|
+
*/
|
|
3665
4609
|
createdAt: string;
|
|
3666
|
-
/**
|
|
4610
|
+
/**
|
|
4611
|
+
* Format: date-time
|
|
4612
|
+
* @description When the issue left `open`. `null` while the issue is open.
|
|
4613
|
+
*/
|
|
3667
4614
|
resolvedAt: string | null;
|
|
3668
4615
|
};
|
|
3669
4616
|
};
|
|
@@ -3675,71 +4622,123 @@ interface operations {
|
|
|
3675
4622
|
query?: never;
|
|
3676
4623
|
header?: never;
|
|
3677
4624
|
path: {
|
|
4625
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3678
4626
|
knowledgeBaseId: string;
|
|
4627
|
+
/** @description The issue's document ID. */
|
|
3679
4628
|
issueId: string;
|
|
3680
4629
|
};
|
|
3681
4630
|
cookie?: never;
|
|
3682
4631
|
};
|
|
3683
4632
|
requestBody?: never;
|
|
3684
4633
|
responses: {
|
|
3685
|
-
/** @description
|
|
4634
|
+
/** @description An issue found in a knowledge base, and its triage status. */
|
|
3686
4635
|
200: {
|
|
3687
4636
|
headers: {
|
|
3688
4637
|
[name: string]: unknown;
|
|
3689
4638
|
};
|
|
3690
4639
|
content: {
|
|
3691
4640
|
'application/json': {
|
|
4641
|
+
/** @description The issue's document ID. A later build that finds the same issue in unchanged sources reuses this ID, so your triage decision is kept. */
|
|
3692
4642
|
id: string;
|
|
4643
|
+
/** @description ID of the knowledge base the issue belongs to. */
|
|
3693
4644
|
knowledgeBaseId: string;
|
|
3694
|
-
/** @description
|
|
4645
|
+
/** @description What the issue found. The shape depends on `kind`. */
|
|
3695
4646
|
content: {
|
|
3696
|
-
/**
|
|
4647
|
+
/**
|
|
4648
|
+
* @description How serious the issue is. `critical`: content is wrong or missing in a way that can mislead an agent. `suggestion`: a change that improves quality.
|
|
4649
|
+
* @enum {string}
|
|
4650
|
+
*/
|
|
3697
4651
|
severity: 'critical' | 'suggestion';
|
|
4652
|
+
/** @description Path of the entry the issue is about, or `*` when it applies to the whole knowledge base. For `add_entry`, the path of the proposed entry. */
|
|
3698
4653
|
scopePath: string;
|
|
4654
|
+
/** @description What the problem is, in one or two sentences. */
|
|
3699
4655
|
issue: string;
|
|
4656
|
+
/** @description What to do to fix the issue. */
|
|
3700
4657
|
suggestedFix: string;
|
|
3701
|
-
/**
|
|
4658
|
+
/**
|
|
4659
|
+
* @description The issue type. `conflict` means two or more positions disagree on the same fact, and you choose which one is correct.
|
|
4660
|
+
* @enum {string}
|
|
4661
|
+
*/
|
|
3702
4662
|
kind: 'conflict';
|
|
4663
|
+
/** @description A key naming the disputed fact, such as `free_tier.request_limit`. It never includes the disputed value, so every side shares it. */
|
|
3703
4664
|
claimKey: string;
|
|
4665
|
+
/** @description The conflicting positions, at least two. To resolve the conflict, pass the index of one side as `resolution`. */
|
|
3704
4666
|
sides: {
|
|
4667
|
+
/** @description The position as a self-contained sentence. This is the option you choose from. */
|
|
3705
4668
|
claim: string;
|
|
4669
|
+
/** @description The disputed value on its own, such as `10,000/month`, without the sentence. */
|
|
3706
4670
|
value?: string;
|
|
4671
|
+
/** @description Paths of the entries that state this position. */
|
|
3707
4672
|
entryPaths?: string[];
|
|
4673
|
+
/** @description IDs of the sources that directly back this position. */
|
|
3708
4674
|
sourceIds?: string[];
|
|
3709
|
-
/** @description
|
|
4675
|
+
/** @description Where in a source this position was read. */
|
|
3710
4676
|
span?: {
|
|
4677
|
+
/** @description ID of the source the position was read from. */
|
|
3711
4678
|
sourceId: string;
|
|
4679
|
+
/** @description First line of the range, counting from 1. Line numbers match `GET .../sources/{sourceId}/content`. */
|
|
3712
4680
|
lineStart: number;
|
|
4681
|
+
/** @description Last line of the range, inclusive. */
|
|
3713
4682
|
lineEnd: number;
|
|
3714
4683
|
};
|
|
3715
|
-
/**
|
|
4684
|
+
/**
|
|
4685
|
+
* @description How much weight the sources behind this position carry. `primary`: your own content, such as uploaded files and pages on your own site. `secondary`: other sources. `community`: forums and Q&A sites.
|
|
4686
|
+
* @enum {string}
|
|
4687
|
+
*/
|
|
3716
4688
|
authority?: 'primary' | 'secondary' | 'community';
|
|
3717
4689
|
}[];
|
|
4690
|
+
/** @description Index in `sides` of the suggested side, when there is one. It is only a hint: nothing is chosen until you resolve the issue. */
|
|
3718
4691
|
suggested?: number;
|
|
3719
4692
|
} | {
|
|
3720
|
-
/**
|
|
4693
|
+
/**
|
|
4694
|
+
* @description How serious the issue is. `critical`: content is wrong or missing in a way that can mislead an agent. `suggestion`: a change that improves quality.
|
|
4695
|
+
* @enum {string}
|
|
4696
|
+
*/
|
|
3721
4697
|
severity: 'critical' | 'suggestion';
|
|
4698
|
+
/** @description Path of the entry the issue is about, or `*` when it applies to the whole knowledge base. For `add_entry`, the path of the proposed entry. */
|
|
3722
4699
|
scopePath: string;
|
|
4700
|
+
/** @description What the problem is, in one or two sentences. */
|
|
3723
4701
|
issue: string;
|
|
4702
|
+
/** @description What to do to fix the issue. */
|
|
3724
4703
|
suggestedFix: string;
|
|
3725
|
-
/**
|
|
4704
|
+
/**
|
|
4705
|
+
* @description The issue type. `gap`: your sources cover material that entries leave out. `update_required`: an entry is out of date with its sources or contradicts an instruction, and needs a rewrite. `add_entry`: your sources cover a topic that no entry covers. `remove_entry`: an entry has lost its sources or its topic no longer applies. `split_entry`: an entry covers several distinct topics and should become child entries. `merge_entry`: an entry has too few sources to stand alone, so merge it into a nearby entry or keep it as it is.
|
|
4706
|
+
* @enum {string}
|
|
4707
|
+
*/
|
|
3726
4708
|
kind: 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
4709
|
+
/** @description IDs of the sources that led to the issue. For `add_entry`, the sources the new entry would cite. */
|
|
3727
4710
|
citedSourceIds?: string[];
|
|
4711
|
+
/** @description A key naming the specific finding, when the check that found it sets one. */
|
|
3728
4712
|
claimKey?: string;
|
|
4713
|
+
/** @description Paths of the entries the issue involves, when it spans more than one entry. */
|
|
3729
4714
|
involvedScopes?: string[];
|
|
3730
4715
|
};
|
|
3731
|
-
/**
|
|
4716
|
+
/**
|
|
4717
|
+
* @description The triage status. `open`: waiting for triage. `accepted`: accepted with `POST .../issues/apply`, or a conflict resolved to one side. `rejected`: dismissed. A rejected issue stays rejected. You can return an accepted conflict to `open` with `POST .../issues/{issueId}/reopen`.
|
|
4718
|
+
* @enum {string}
|
|
4719
|
+
*/
|
|
3732
4720
|
status: 'open' | 'accepted' | 'rejected';
|
|
4721
|
+
/** @description Index in `content.sides` of the side chosen when the conflict was resolved. For a conflict on a single entry, index `0` is the entry's current content. `null` until a conflict is resolved, and always `null` for other issue types. */
|
|
3733
4722
|
resolution: number | null;
|
|
3734
|
-
/** @description
|
|
4723
|
+
/** @description Who triaged the issue, so you can review what your agents decided. `null` while the issue is open, or when the caller could not be identified. */
|
|
3735
4724
|
resolvedBy: {
|
|
4725
|
+
/** @description Sanity user ID of the person or robot that triaged the issue. */
|
|
3736
4726
|
id: string;
|
|
3737
|
-
/**
|
|
4727
|
+
/**
|
|
4728
|
+
* @description `user` when a person made the decision. `robot` when a robot token did, such as an agent.
|
|
4729
|
+
* @enum {string}
|
|
4730
|
+
*/
|
|
3738
4731
|
kind: 'user' | 'robot';
|
|
3739
4732
|
} | null;
|
|
3740
|
-
/**
|
|
4733
|
+
/**
|
|
4734
|
+
* Format: date-time
|
|
4735
|
+
* @description When the issue was first filed.
|
|
4736
|
+
*/
|
|
3741
4737
|
createdAt: string;
|
|
3742
|
-
/**
|
|
4738
|
+
/**
|
|
4739
|
+
* Format: date-time
|
|
4740
|
+
* @description When the issue left `open`. `null` while the issue is open.
|
|
4741
|
+
*/
|
|
3743
4742
|
resolvedAt: string | null;
|
|
3744
4743
|
};
|
|
3745
4744
|
};
|
|
@@ -3751,7 +4750,9 @@ interface operations {
|
|
|
3751
4750
|
query?: never;
|
|
3752
4751
|
header?: never;
|
|
3753
4752
|
path: {
|
|
4753
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3754
4754
|
knowledgeBaseId: string;
|
|
4755
|
+
/** @description The issue's document ID. */
|
|
3755
4756
|
issueId: string;
|
|
3756
4757
|
};
|
|
3757
4758
|
cookie?: never;
|
|
@@ -3759,73 +4760,125 @@ interface operations {
|
|
|
3759
4760
|
requestBody: {
|
|
3760
4761
|
content: {
|
|
3761
4762
|
'application/json': {
|
|
4763
|
+
/** @description The index of the chosen side in the issue's `content.sides`. */
|
|
3762
4764
|
resolution: number;
|
|
3763
4765
|
};
|
|
3764
4766
|
};
|
|
3765
4767
|
};
|
|
3766
4768
|
responses: {
|
|
3767
|
-
/** @description
|
|
4769
|
+
/** @description The resolved issue, plus the job that rewrites the entry when the decision changes it. */
|
|
3768
4770
|
200: {
|
|
3769
4771
|
headers: {
|
|
3770
4772
|
[name: string]: unknown;
|
|
3771
4773
|
};
|
|
3772
4774
|
content: {
|
|
3773
4775
|
'application/json': {
|
|
3774
|
-
/** @description
|
|
4776
|
+
/** @description The resolved conflict issue, now `accepted`. */
|
|
3775
4777
|
issue: {
|
|
4778
|
+
/** @description The issue's document ID. A later build that finds the same issue in unchanged sources reuses this ID, so your triage decision is kept. */
|
|
3776
4779
|
id: string;
|
|
4780
|
+
/** @description ID of the knowledge base the issue belongs to. */
|
|
3777
4781
|
knowledgeBaseId: string;
|
|
3778
|
-
/** @description
|
|
4782
|
+
/** @description What the issue found. The shape depends on `kind`. */
|
|
3779
4783
|
content: {
|
|
3780
|
-
/**
|
|
4784
|
+
/**
|
|
4785
|
+
* @description How serious the issue is. `critical`: content is wrong or missing in a way that can mislead an agent. `suggestion`: a change that improves quality.
|
|
4786
|
+
* @enum {string}
|
|
4787
|
+
*/
|
|
3781
4788
|
severity: 'critical' | 'suggestion';
|
|
4789
|
+
/** @description Path of the entry the issue is about, or `*` when it applies to the whole knowledge base. For `add_entry`, the path of the proposed entry. */
|
|
3782
4790
|
scopePath: string;
|
|
4791
|
+
/** @description What the problem is, in one or two sentences. */
|
|
3783
4792
|
issue: string;
|
|
4793
|
+
/** @description What to do to fix the issue. */
|
|
3784
4794
|
suggestedFix: string;
|
|
3785
|
-
/**
|
|
4795
|
+
/**
|
|
4796
|
+
* @description The issue type. `conflict` means two or more positions disagree on the same fact, and you choose which one is correct.
|
|
4797
|
+
* @enum {string}
|
|
4798
|
+
*/
|
|
3786
4799
|
kind: 'conflict';
|
|
4800
|
+
/** @description A key naming the disputed fact, such as `free_tier.request_limit`. It never includes the disputed value, so every side shares it. */
|
|
3787
4801
|
claimKey: string;
|
|
4802
|
+
/** @description The conflicting positions, at least two. To resolve the conflict, pass the index of one side as `resolution`. */
|
|
3788
4803
|
sides: {
|
|
4804
|
+
/** @description The position as a self-contained sentence. This is the option you choose from. */
|
|
3789
4805
|
claim: string;
|
|
4806
|
+
/** @description The disputed value on its own, such as `10,000/month`, without the sentence. */
|
|
3790
4807
|
value?: string;
|
|
4808
|
+
/** @description Paths of the entries that state this position. */
|
|
3791
4809
|
entryPaths?: string[];
|
|
4810
|
+
/** @description IDs of the sources that directly back this position. */
|
|
3792
4811
|
sourceIds?: string[];
|
|
3793
|
-
/** @description
|
|
4812
|
+
/** @description Where in a source this position was read. */
|
|
3794
4813
|
span?: {
|
|
4814
|
+
/** @description ID of the source the position was read from. */
|
|
3795
4815
|
sourceId: string;
|
|
4816
|
+
/** @description First line of the range, counting from 1. Line numbers match `GET .../sources/{sourceId}/content`. */
|
|
3796
4817
|
lineStart: number;
|
|
4818
|
+
/** @description Last line of the range, inclusive. */
|
|
3797
4819
|
lineEnd: number;
|
|
3798
4820
|
};
|
|
3799
|
-
/**
|
|
4821
|
+
/**
|
|
4822
|
+
* @description How much weight the sources behind this position carry. `primary`: your own content, such as uploaded files and pages on your own site. `secondary`: other sources. `community`: forums and Q&A sites.
|
|
4823
|
+
* @enum {string}
|
|
4824
|
+
*/
|
|
3800
4825
|
authority?: 'primary' | 'secondary' | 'community';
|
|
3801
4826
|
}[];
|
|
4827
|
+
/** @description Index in `sides` of the suggested side, when there is one. It is only a hint: nothing is chosen until you resolve the issue. */
|
|
3802
4828
|
suggested?: number;
|
|
3803
4829
|
} | {
|
|
3804
|
-
/**
|
|
4830
|
+
/**
|
|
4831
|
+
* @description How serious the issue is. `critical`: content is wrong or missing in a way that can mislead an agent. `suggestion`: a change that improves quality.
|
|
4832
|
+
* @enum {string}
|
|
4833
|
+
*/
|
|
3805
4834
|
severity: 'critical' | 'suggestion';
|
|
4835
|
+
/** @description Path of the entry the issue is about, or `*` when it applies to the whole knowledge base. For `add_entry`, the path of the proposed entry. */
|
|
3806
4836
|
scopePath: string;
|
|
4837
|
+
/** @description What the problem is, in one or two sentences. */
|
|
3807
4838
|
issue: string;
|
|
4839
|
+
/** @description What to do to fix the issue. */
|
|
3808
4840
|
suggestedFix: string;
|
|
3809
|
-
/**
|
|
4841
|
+
/**
|
|
4842
|
+
* @description The issue type. `gap`: your sources cover material that entries leave out. `update_required`: an entry is out of date with its sources or contradicts an instruction, and needs a rewrite. `add_entry`: your sources cover a topic that no entry covers. `remove_entry`: an entry has lost its sources or its topic no longer applies. `split_entry`: an entry covers several distinct topics and should become child entries. `merge_entry`: an entry has too few sources to stand alone, so merge it into a nearby entry or keep it as it is.
|
|
4843
|
+
* @enum {string}
|
|
4844
|
+
*/
|
|
3810
4845
|
kind: 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
|
|
4846
|
+
/** @description IDs of the sources that led to the issue. For `add_entry`, the sources the new entry would cite. */
|
|
3811
4847
|
citedSourceIds?: string[];
|
|
4848
|
+
/** @description A key naming the specific finding, when the check that found it sets one. */
|
|
3812
4849
|
claimKey?: string;
|
|
4850
|
+
/** @description Paths of the entries the issue involves, when it spans more than one entry. */
|
|
3813
4851
|
involvedScopes?: string[];
|
|
3814
4852
|
};
|
|
3815
|
-
/**
|
|
4853
|
+
/**
|
|
4854
|
+
* @description The triage status. `open`: waiting for triage. `accepted`: accepted with `POST .../issues/apply`, or a conflict resolved to one side. `rejected`: dismissed. A rejected issue stays rejected. You can return an accepted conflict to `open` with `POST .../issues/{issueId}/reopen`.
|
|
4855
|
+
* @enum {string}
|
|
4856
|
+
*/
|
|
3816
4857
|
status: 'open' | 'accepted' | 'rejected';
|
|
4858
|
+
/** @description Index in `content.sides` of the side chosen when the conflict was resolved. For a conflict on a single entry, index `0` is the entry's current content. `null` until a conflict is resolved, and always `null` for other issue types. */
|
|
3817
4859
|
resolution: number | null;
|
|
3818
|
-
/** @description
|
|
4860
|
+
/** @description Who triaged the issue, so you can review what your agents decided. `null` while the issue is open, or when the caller could not be identified. */
|
|
3819
4861
|
resolvedBy: {
|
|
4862
|
+
/** @description Sanity user ID of the person or robot that triaged the issue. */
|
|
3820
4863
|
id: string;
|
|
3821
|
-
/**
|
|
4864
|
+
/**
|
|
4865
|
+
* @description `user` when a person made the decision. `robot` when a robot token did, such as an agent.
|
|
4866
|
+
* @enum {string}
|
|
4867
|
+
*/
|
|
3822
4868
|
kind: 'user' | 'robot';
|
|
3823
4869
|
} | null;
|
|
3824
|
-
/**
|
|
4870
|
+
/**
|
|
4871
|
+
* Format: date-time
|
|
4872
|
+
* @description When the issue was first filed.
|
|
4873
|
+
*/
|
|
3825
4874
|
createdAt: string;
|
|
3826
|
-
/**
|
|
4875
|
+
/**
|
|
4876
|
+
* Format: date-time
|
|
4877
|
+
* @description When the issue left `open`. `null` while the issue is open.
|
|
4878
|
+
*/
|
|
3827
4879
|
resolvedAt: string | null;
|
|
3828
4880
|
};
|
|
4881
|
+
/** @description ID of the job that rewrites the entry to match the chosen side. Poll it with `GET .../jobs/{jobId}`. `null` when nothing is rewritten: you chose index `0`, or the conflict applies to the whole knowledge base. */
|
|
3829
4882
|
jobId: string | null;
|
|
3830
4883
|
};
|
|
3831
4884
|
};
|
|
@@ -3837,28 +4890,42 @@ interface operations {
|
|
|
3837
4890
|
query?: never;
|
|
3838
4891
|
header?: never;
|
|
3839
4892
|
path: {
|
|
4893
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3840
4894
|
knowledgeBaseId: string;
|
|
4895
|
+
/** @description The job ID returned by the endpoint that started the work. */
|
|
3841
4896
|
jobId: string;
|
|
3842
4897
|
};
|
|
3843
4898
|
cookie?: never;
|
|
3844
4899
|
};
|
|
3845
4900
|
requestBody?: never;
|
|
3846
4901
|
responses: {
|
|
3847
|
-
/** @description
|
|
4902
|
+
/** @description A background job, such as a build, refresh, or import, and its status. */
|
|
3848
4903
|
200: {
|
|
3849
4904
|
headers: {
|
|
3850
4905
|
[name: string]: unknown;
|
|
3851
4906
|
};
|
|
3852
4907
|
content: {
|
|
3853
4908
|
'application/json': {
|
|
4909
|
+
/** @description The job's ID. */
|
|
3854
4910
|
id: string;
|
|
3855
|
-
/**
|
|
4911
|
+
/**
|
|
4912
|
+
* @description The job's status. `queued`: waiting for build capacity. `running`: in progress. `succeeded`: finished successfully. `failed`: stopped with an error. `cancelled`: stopped before it finished. `pending` isn't currently returned.
|
|
4913
|
+
* @enum {string}
|
|
4914
|
+
*/
|
|
3856
4915
|
status: 'pending' | 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
3857
|
-
/**
|
|
4916
|
+
/**
|
|
4917
|
+
* Format: date-time
|
|
4918
|
+
* @description When the job started.
|
|
4919
|
+
*/
|
|
3858
4920
|
startedAt: string | null;
|
|
3859
|
-
/**
|
|
4921
|
+
/**
|
|
4922
|
+
* Format: date-time
|
|
4923
|
+
* @description When the job finished. `null` while the job is queued or running.
|
|
4924
|
+
*/
|
|
3860
4925
|
completedAt: string | null;
|
|
4926
|
+
/** @description The job's output. Only present when `status` is `succeeded`. Its shape depends on the kind of job. */
|
|
3861
4927
|
result?: unknown;
|
|
4928
|
+
/** @description A readable reason the job failed or was cancelled. `null` for any other status. */
|
|
3862
4929
|
error?: string | null;
|
|
3863
4930
|
};
|
|
3864
4931
|
};
|
|
@@ -3870,20 +4937,23 @@ interface operations {
|
|
|
3870
4937
|
query?: never;
|
|
3871
4938
|
header?: never;
|
|
3872
4939
|
path: {
|
|
4940
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3873
4941
|
knowledgeBaseId: string;
|
|
3874
4942
|
};
|
|
3875
4943
|
cookie?: never;
|
|
3876
4944
|
};
|
|
3877
4945
|
requestBody?: never;
|
|
3878
4946
|
responses: {
|
|
3879
|
-
/** @description
|
|
4947
|
+
/** @description A queued refresh job that you can poll for progress. */
|
|
3880
4948
|
202: {
|
|
3881
4949
|
headers: {
|
|
3882
4950
|
[name: string]: unknown;
|
|
3883
4951
|
};
|
|
3884
4952
|
content: {
|
|
3885
4953
|
'application/json': {
|
|
4954
|
+
/** @description The queued job's ID. Check its progress with `GET .../jobs/{jobId}`. */
|
|
3886
4955
|
jobId: string;
|
|
4956
|
+
/** @description Whether this request started a new refresh. `false` means a refresh was already running, and `jobId` is that refresh. */
|
|
3887
4957
|
started: boolean;
|
|
3888
4958
|
};
|
|
3889
4959
|
};
|
|
@@ -3893,49 +4963,84 @@ interface operations {
|
|
|
3893
4963
|
listSources: {
|
|
3894
4964
|
parameters: {
|
|
3895
4965
|
query?: {
|
|
4966
|
+
/** @description The `nextCursor` value from the previous page. Omit it to get the first page. */
|
|
3896
4967
|
cursor?: string;
|
|
4968
|
+
/** @description The maximum number of items to return. */
|
|
3897
4969
|
limit?: number;
|
|
4970
|
+
/** @description Return only sources with this status. */
|
|
3898
4971
|
status?: 'pending' | 'processing' | 'ready' | 'failed' | 'skipped';
|
|
4972
|
+
/** @description Return only the sources that this import produced. */
|
|
3899
4973
|
importId?: string;
|
|
4974
|
+
/** @description Comma-separated IDs of the sources to return, up to 200. Includes the parts of large sources that were split, which the default list leaves out. When set, `status` and `cursor` are ignored and every matching source is returned in one page. */
|
|
3900
4975
|
ids?: string;
|
|
3901
4976
|
};
|
|
3902
4977
|
header?: never;
|
|
3903
4978
|
path: {
|
|
4979
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3904
4980
|
knowledgeBaseId: string;
|
|
3905
4981
|
};
|
|
3906
4982
|
cookie?: never;
|
|
3907
4983
|
};
|
|
3908
4984
|
requestBody?: never;
|
|
3909
4985
|
responses: {
|
|
3910
|
-
/** @description
|
|
4986
|
+
/** @description A page of sources. */
|
|
3911
4987
|
200: {
|
|
3912
4988
|
headers: {
|
|
3913
4989
|
[name: string]: unknown;
|
|
3914
4990
|
};
|
|
3915
4991
|
content: {
|
|
3916
4992
|
'application/json': {
|
|
4993
|
+
/** @description The items on this page. */
|
|
3917
4994
|
data: {
|
|
3918
|
-
/**
|
|
4995
|
+
/**
|
|
4996
|
+
* Format: uuid
|
|
4997
|
+
* @description The source's ID.
|
|
4998
|
+
*/
|
|
3919
4999
|
id: string;
|
|
3920
|
-
/**
|
|
5000
|
+
/**
|
|
5001
|
+
* Format: uuid
|
|
5002
|
+
* @description The `id` of the knowledge base that the source belongs to.
|
|
5003
|
+
*/
|
|
3921
5004
|
knowledgeBaseId: string;
|
|
5005
|
+
/** @description The source's name: the file name for an upload, the page title for a web page, or the document title for a dataset document. */
|
|
3922
5006
|
filename: string;
|
|
3923
|
-
/**
|
|
5007
|
+
/**
|
|
5008
|
+
* @description Where the source came from. `web`: a crawled web page. `file`: an uploaded file or inline text. `dataset`: a document from a Sanity dataset.
|
|
5009
|
+
* @enum {string}
|
|
5010
|
+
*/
|
|
3924
5011
|
kind: 'web' | 'file' | 'dataset';
|
|
5012
|
+
/** @description The source's size in bytes. */
|
|
3925
5013
|
sizeBytes: number;
|
|
3926
|
-
/**
|
|
5014
|
+
/**
|
|
5015
|
+
* @description The source's processing status. `pending`: waiting to be processed. `processing`: distilled and being summarized. `ready`: processed and available to builds. `failed`: couldn't be processed. `skipped`: not processed, because its file type isn't supported, it's too large, or it was split into smaller sources.
|
|
5016
|
+
* @enum {string}
|
|
5017
|
+
*/
|
|
3927
5018
|
status: 'pending' | 'processing' | 'ready' | 'failed' | 'skipped';
|
|
5019
|
+
/** @description A short summary of the source. `null` until the source is summarized. */
|
|
3928
5020
|
tldr: string | null;
|
|
5021
|
+
/** @description Topics the source covers. `null` until the source is summarized. */
|
|
3929
5022
|
topics: string[] | null;
|
|
5023
|
+
/** @description The page URL of a `web` source. `null` for other kinds. */
|
|
3930
5024
|
canonicalUrl: string | null;
|
|
5025
|
+
/** @description The `_id` of the Sanity document a `dataset` source came from. Use it to find the document in your studio. `null` for other kinds. */
|
|
3931
5026
|
externalId: string | null;
|
|
3932
|
-
/**
|
|
5027
|
+
/**
|
|
5028
|
+
* Format: date-time
|
|
5029
|
+
* @description When the source's content was last fetched.
|
|
5030
|
+
*/
|
|
3933
5031
|
fetchedAt: string | null;
|
|
3934
|
-
/**
|
|
5032
|
+
/**
|
|
5033
|
+
* Format: date-time
|
|
5034
|
+
* @description When the source's content was last distilled into markdown. `null` until it's distilled.
|
|
5035
|
+
*/
|
|
3935
5036
|
distilledAt: string | null;
|
|
3936
|
-
/**
|
|
5037
|
+
/**
|
|
5038
|
+
* Format: date-time
|
|
5039
|
+
* @description When the source was added.
|
|
5040
|
+
*/
|
|
3937
5041
|
createdAt: string;
|
|
3938
5042
|
}[];
|
|
5043
|
+
/** @description The cursor for the next page. Pass it as `cursor` to get more results. `null` when there are no more pages. */
|
|
3939
5044
|
nextCursor: string | null;
|
|
3940
5045
|
};
|
|
3941
5046
|
};
|
|
@@ -3947,39 +5052,68 @@ interface operations {
|
|
|
3947
5052
|
query?: never;
|
|
3948
5053
|
header?: never;
|
|
3949
5054
|
path: {
|
|
5055
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3950
5056
|
knowledgeBaseId: string;
|
|
5057
|
+
/** @description The source's ID. */
|
|
3951
5058
|
sourceId: string;
|
|
3952
5059
|
};
|
|
3953
5060
|
cookie?: never;
|
|
3954
5061
|
};
|
|
3955
5062
|
requestBody?: never;
|
|
3956
5063
|
responses: {
|
|
3957
|
-
/** @description
|
|
5064
|
+
/** @description A page, file, or document that an import produced and that builds cite. */
|
|
3958
5065
|
200: {
|
|
3959
5066
|
headers: {
|
|
3960
5067
|
[name: string]: unknown;
|
|
3961
5068
|
};
|
|
3962
5069
|
content: {
|
|
3963
5070
|
'application/json': {
|
|
3964
|
-
/**
|
|
5071
|
+
/**
|
|
5072
|
+
* Format: uuid
|
|
5073
|
+
* @description The source's ID.
|
|
5074
|
+
*/
|
|
3965
5075
|
id: string;
|
|
3966
|
-
/**
|
|
5076
|
+
/**
|
|
5077
|
+
* Format: uuid
|
|
5078
|
+
* @description The `id` of the knowledge base that the source belongs to.
|
|
5079
|
+
*/
|
|
3967
5080
|
knowledgeBaseId: string;
|
|
5081
|
+
/** @description The source's name: the file name for an upload, the page title for a web page, or the document title for a dataset document. */
|
|
3968
5082
|
filename: string;
|
|
3969
|
-
/**
|
|
5083
|
+
/**
|
|
5084
|
+
* @description Where the source came from. `web`: a crawled web page. `file`: an uploaded file or inline text. `dataset`: a document from a Sanity dataset.
|
|
5085
|
+
* @enum {string}
|
|
5086
|
+
*/
|
|
3970
5087
|
kind: 'web' | 'file' | 'dataset';
|
|
5088
|
+
/** @description The source's size in bytes. */
|
|
3971
5089
|
sizeBytes: number;
|
|
3972
|
-
/**
|
|
5090
|
+
/**
|
|
5091
|
+
* @description The source's processing status. `pending`: waiting to be processed. `processing`: distilled and being summarized. `ready`: processed and available to builds. `failed`: couldn't be processed. `skipped`: not processed, because its file type isn't supported, it's too large, or it was split into smaller sources.
|
|
5092
|
+
* @enum {string}
|
|
5093
|
+
*/
|
|
3973
5094
|
status: 'pending' | 'processing' | 'ready' | 'failed' | 'skipped';
|
|
5095
|
+
/** @description A short summary of the source. `null` until the source is summarized. */
|
|
3974
5096
|
tldr: string | null;
|
|
5097
|
+
/** @description Topics the source covers. `null` until the source is summarized. */
|
|
3975
5098
|
topics: string[] | null;
|
|
5099
|
+
/** @description The page URL of a `web` source. `null` for other kinds. */
|
|
3976
5100
|
canonicalUrl: string | null;
|
|
5101
|
+
/** @description The `_id` of the Sanity document a `dataset` source came from. Use it to find the document in your studio. `null` for other kinds. */
|
|
3977
5102
|
externalId: string | null;
|
|
3978
|
-
/**
|
|
5103
|
+
/**
|
|
5104
|
+
* Format: date-time
|
|
5105
|
+
* @description When the source's content was last fetched.
|
|
5106
|
+
*/
|
|
3979
5107
|
fetchedAt: string | null;
|
|
3980
|
-
/**
|
|
5108
|
+
/**
|
|
5109
|
+
* Format: date-time
|
|
5110
|
+
* @description When the source's content was last distilled into markdown. `null` until it's distilled.
|
|
5111
|
+
*/
|
|
3981
5112
|
distilledAt: string | null;
|
|
3982
|
-
/**
|
|
5113
|
+
/**
|
|
5114
|
+
* Format: date-time
|
|
5115
|
+
* @description When the source was added.
|
|
5116
|
+
*/
|
|
3983
5117
|
createdAt: string;
|
|
3984
5118
|
};
|
|
3985
5119
|
};
|
|
@@ -3991,14 +5125,16 @@ interface operations {
|
|
|
3991
5125
|
query?: never;
|
|
3992
5126
|
header?: never;
|
|
3993
5127
|
path: {
|
|
5128
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
3994
5129
|
knowledgeBaseId: string;
|
|
5130
|
+
/** @description The source's ID. */
|
|
3995
5131
|
sourceId: string;
|
|
3996
5132
|
};
|
|
3997
5133
|
cookie?: never;
|
|
3998
5134
|
};
|
|
3999
5135
|
requestBody?: never;
|
|
4000
5136
|
responses: {
|
|
4001
|
-
/** @description
|
|
5137
|
+
/** @description The source was deleted. */
|
|
4002
5138
|
204: {
|
|
4003
5139
|
headers: {
|
|
4004
5140
|
[name: string]: unknown;
|
|
@@ -4012,33 +5148,45 @@ interface operations {
|
|
|
4012
5148
|
getSourceContent: {
|
|
4013
5149
|
parameters: {
|
|
4014
5150
|
query?: {
|
|
4015
|
-
/** @description
|
|
5151
|
+
/** @description Response format. `json` (default) returns the structured resource. `markdown` and `plain` return the content as rendered text, ready to pass to a model. */
|
|
4016
5152
|
format?: 'json' | 'markdown' | 'plain';
|
|
5153
|
+
/** @description The first line to return, starting at 1. Omit `startLine` and `endLine` to get the whole content. */
|
|
4017
5154
|
startLine?: number;
|
|
5155
|
+
/** @description The last line to return, inclusive. A value past the end returns everything up to the last line. */
|
|
4018
5156
|
endLine?: number;
|
|
4019
5157
|
};
|
|
4020
5158
|
header?: never;
|
|
4021
5159
|
path: {
|
|
5160
|
+
/** @description The knowledge base's public ID (`kb...`) or UUID. */
|
|
4022
5161
|
knowledgeBaseId: string;
|
|
5162
|
+
/** @description The source's ID. */
|
|
4023
5163
|
sourceId: string;
|
|
4024
5164
|
};
|
|
4025
5165
|
cookie?: never;
|
|
4026
5166
|
};
|
|
4027
5167
|
requestBody?: never;
|
|
4028
5168
|
responses: {
|
|
4029
|
-
/** @description
|
|
5169
|
+
/** @description A source's distilled markdown, or a range of its lines. */
|
|
4030
5170
|
200: {
|
|
4031
5171
|
headers: {
|
|
4032
5172
|
[name: string]: unknown;
|
|
4033
5173
|
};
|
|
4034
5174
|
content: {
|
|
4035
5175
|
'application/json': {
|
|
4036
|
-
/**
|
|
5176
|
+
/**
|
|
5177
|
+
* Format: uuid
|
|
5178
|
+
* @description The source's ID.
|
|
5179
|
+
*/
|
|
4037
5180
|
sourceId: string;
|
|
5181
|
+
/** @description The distilled markdown, or the requested lines of it. */
|
|
4038
5182
|
content: string;
|
|
5183
|
+
/** @description The number of lines in the full distilled content. */
|
|
4039
5184
|
totalLines: number;
|
|
5185
|
+
/** @description The range of lines returned, 1-indexed and inclusive. It can be shorter than requested when the range runs past the end. Both values are `0` when no lines are returned. */
|
|
4040
5186
|
slice: {
|
|
5187
|
+
/** @description The first line returned. */
|
|
4041
5188
|
start: number;
|
|
5189
|
+
/** @description The last line returned. */
|
|
4042
5190
|
end: number;
|
|
4043
5191
|
};
|
|
4044
5192
|
};
|
|
@@ -4053,115 +5201,184 @@ interface operations {
|
|
|
4053
5201
|
query?: never;
|
|
4054
5202
|
header?: never;
|
|
4055
5203
|
path: {
|
|
5204
|
+
/** @description Your ID for the conversation thread, unique within your organization. Up to 200 characters. */
|
|
4056
5205
|
threadId: string;
|
|
4057
5206
|
};
|
|
4058
5207
|
cookie?: never;
|
|
4059
5208
|
};
|
|
4060
|
-
/** @description
|
|
5209
|
+
/** @description A conversation transcript to save for one thread. */
|
|
4061
5210
|
requestBody: {
|
|
4062
5211
|
content: {
|
|
4063
5212
|
'application/json': {
|
|
5213
|
+
/** @description The full transcript so far, in order. It replaces the stored messages. */
|
|
4064
5214
|
messages: {
|
|
4065
|
-
/**
|
|
5215
|
+
/**
|
|
5216
|
+
* @description Who sent the message. `user` is the person talking to the agent, `assistant` is the agent, `system` is a system prompt, and `tool` is a tool call or tool result.
|
|
5217
|
+
* @enum {string}
|
|
5218
|
+
*/
|
|
4066
5219
|
role: 'user' | 'assistant' | 'system' | 'tool';
|
|
4067
|
-
/**
|
|
5220
|
+
/**
|
|
5221
|
+
* @description The message text. `null` when the message has no text, such as a tool call.
|
|
5222
|
+
* @default null
|
|
5223
|
+
*/
|
|
4068
5224
|
content?: string | null;
|
|
4069
|
-
/**
|
|
5225
|
+
/**
|
|
5226
|
+
* @description The name of the tool for a `tool` message. `null` on other messages.
|
|
5227
|
+
* @default null
|
|
5228
|
+
*/
|
|
4070
5229
|
toolName?: string | null;
|
|
4071
5230
|
/**
|
|
5231
|
+
* @description The kind of `tool` message. `call` is the agent calling the tool, and `result` is what the tool returned. `null` on other messages.
|
|
4072
5232
|
* @default null
|
|
4073
5233
|
* @enum {string|null}
|
|
4074
5234
|
*/
|
|
4075
5235
|
toolType?: 'call' | 'result' | null;
|
|
4076
|
-
/**
|
|
5236
|
+
/**
|
|
5237
|
+
* @description Why this step failed, including any stack trace. Set it on the tool result for a failed tool call, or on the assistant message for a turn that failed instead of answering. `null` when the step succeeded.
|
|
5238
|
+
* @default null
|
|
5239
|
+
*/
|
|
4077
5240
|
error?: string | null;
|
|
4078
5241
|
}[];
|
|
5242
|
+
/** @description The provider of the model the agent used. When absent, the stored value stays unchanged. */
|
|
4079
5243
|
modelProvider?: string;
|
|
5244
|
+
/** @description The ID of the model the agent used. When absent, the stored value stays unchanged. */
|
|
4080
5245
|
modelId?: string;
|
|
4081
|
-
/** @description
|
|
5246
|
+
/** @description Token usage for one generation call. The API adds it to the conversation total, but only when this save changes the messages. */
|
|
4082
5247
|
tokenUsage?: {
|
|
5248
|
+
/** @description The number of input tokens. */
|
|
4083
5249
|
inputTokens?: number;
|
|
5250
|
+
/** @description The number of output tokens. */
|
|
4084
5251
|
outputTokens?: number;
|
|
5252
|
+
/** @description The total number of tokens. */
|
|
4085
5253
|
totalTokens?: number;
|
|
4086
5254
|
};
|
|
4087
|
-
/** @description
|
|
5255
|
+
/** @description Up to 20 tags that describe the conversation. Well-known keys are `mcpEndpoints` (names of the MCP endpoints the conversation used), `app`, and `environment`. Add any other keys you need. Replaces the stored metadata. When absent, the stored value stays unchanged. */
|
|
4088
5256
|
metadata?: {
|
|
4089
5257
|
[key: string]: string | string[];
|
|
4090
5258
|
};
|
|
4091
|
-
/** @description
|
|
5259
|
+
/** @description Your choice to share conversation telemetry with Sanity. Replaces the stored setting. When absent, the stored value stays unchanged. */
|
|
4092
5260
|
sharing?: {
|
|
5261
|
+
/** @description Whether to share classification metrics with Sanity: scores, sentiment, content gap counts, message counts and sizes, tool names, and model and token usage. Message content is not included. */
|
|
4093
5262
|
metrics?: boolean;
|
|
5263
|
+
/** @description Whether to share full conversation transcripts with Sanity. When `true`, the API also sets `metrics` to `true`. */
|
|
4094
5264
|
conversations?: boolean;
|
|
5265
|
+
/** @description How the Sanity team can reach you about your agent, such as an email address or a Discord handle. */
|
|
4095
5266
|
contact?: string;
|
|
4096
5267
|
};
|
|
4097
5268
|
};
|
|
4098
5269
|
};
|
|
4099
5270
|
};
|
|
4100
5271
|
responses: {
|
|
4101
|
-
/** @description
|
|
5272
|
+
/** @description A recorded agent conversation: its transcript, metadata, token usage, and classification. */
|
|
4102
5273
|
200: {
|
|
4103
5274
|
headers: {
|
|
4104
5275
|
[name: string]: unknown;
|
|
4105
5276
|
};
|
|
4106
5277
|
content: {
|
|
4107
5278
|
'application/json': {
|
|
5279
|
+
/** @description The conversation ID, unique within the organization. It matches the `_id` of the conversation document in your document store. */
|
|
4108
5280
|
id: string;
|
|
5281
|
+
/** @description Your identifier for the conversation thread, unique within the organization. Saving with the same `threadId` updates the same conversation. */
|
|
4109
5282
|
threadId: string;
|
|
4110
|
-
/** @description
|
|
5283
|
+
/** @description Tags that describe the conversation, such as `mcpEndpoints`, `app`, and `environment`. Filter on them in GROQ queries. `null` until a save includes `metadata`. */
|
|
4111
5284
|
metadata: {
|
|
4112
5285
|
[key: string]: string | string[];
|
|
4113
5286
|
} | null;
|
|
4114
|
-
/**
|
|
5287
|
+
/**
|
|
5288
|
+
* Format: date-time
|
|
5289
|
+
* @description When the API received the first save for this thread, as an ISO 8601 timestamp.
|
|
5290
|
+
*/
|
|
4115
5291
|
startedAt: string;
|
|
4116
|
-
/**
|
|
5292
|
+
/**
|
|
5293
|
+
* Format: date-time
|
|
5294
|
+
* @description When the conversation was last saved, as an ISO 8601 timestamp.
|
|
5295
|
+
*/
|
|
4117
5296
|
messagesUpdatedAt: string;
|
|
5297
|
+
/** @description The conversation transcript, in order. Each save replaces it. */
|
|
4118
5298
|
messages: {
|
|
4119
|
-
/**
|
|
5299
|
+
/**
|
|
5300
|
+
* @description Who sent the message. `user` is the person talking to the agent, `assistant` is the agent, `system` is a system prompt, and `tool` is a tool call or tool result.
|
|
5301
|
+
* @enum {string}
|
|
5302
|
+
*/
|
|
4120
5303
|
role: 'user' | 'assistant' | 'system' | 'tool';
|
|
4121
|
-
/**
|
|
5304
|
+
/**
|
|
5305
|
+
* @description The message text. `null` when the message has no text, such as a tool call.
|
|
5306
|
+
* @default null
|
|
5307
|
+
*/
|
|
4122
5308
|
content: string | null;
|
|
4123
|
-
/**
|
|
5309
|
+
/**
|
|
5310
|
+
* @description The name of the tool for a `tool` message. `null` on other messages.
|
|
5311
|
+
* @default null
|
|
5312
|
+
*/
|
|
4124
5313
|
toolName: string | null;
|
|
4125
5314
|
/**
|
|
5315
|
+
* @description The kind of `tool` message. `call` is the agent calling the tool, and `result` is what the tool returned. `null` on other messages.
|
|
4126
5316
|
* @default null
|
|
4127
5317
|
* @enum {string|null}
|
|
4128
5318
|
*/
|
|
4129
5319
|
toolType: 'call' | 'result' | null;
|
|
4130
|
-
/**
|
|
5320
|
+
/**
|
|
5321
|
+
* @description Why this step failed, including any stack trace. Set it on the tool result for a failed tool call, or on the assistant message for a turn that failed instead of answering. `null` when the step succeeded.
|
|
5322
|
+
* @default null
|
|
5323
|
+
*/
|
|
4131
5324
|
error: string | null;
|
|
4132
5325
|
/**
|
|
4133
5326
|
* Format: date-time
|
|
5327
|
+
* @description When the API first received this message, as an ISO 8601 timestamp. The API sets it. Resending an unchanged message at the same position keeps its timestamp. `null` for messages recorded before timestamps existed.
|
|
4134
5328
|
* @default null
|
|
4135
5329
|
*/
|
|
4136
5330
|
timestamp: string | null;
|
|
4137
5331
|
}[];
|
|
5332
|
+
/** @description The provider of the model the agent used. `null` until a save includes `modelProvider`. */
|
|
4138
5333
|
modelProvider: string | null;
|
|
5334
|
+
/** @description The ID of the model the agent used. `null` until a save includes `modelId`. */
|
|
4139
5335
|
modelId: string | null;
|
|
4140
|
-
/** @description
|
|
5336
|
+
/** @description The running total of token usage for the conversation. `null` until a save includes `tokenUsage`. */
|
|
4141
5337
|
tokenUsage: {
|
|
5338
|
+
/** @description The number of input tokens. */
|
|
4142
5339
|
inputTokens?: number;
|
|
5340
|
+
/** @description The number of output tokens. */
|
|
4143
5341
|
outputTokens?: number;
|
|
5342
|
+
/** @description The total number of tokens. */
|
|
4144
5343
|
totalTokens?: number;
|
|
4145
5344
|
} | null;
|
|
4146
|
-
/** @description
|
|
5345
|
+
/** @description The latest classification result. `null` until you record one. */
|
|
4147
5346
|
coreMetrics: {
|
|
5347
|
+
/** @description How well the agent resolved the user's needs, from 1 to 10. */
|
|
4148
5348
|
successScore?: number;
|
|
4149
|
-
/**
|
|
5349
|
+
/**
|
|
5350
|
+
* @description The overall sentiment of the conversation.
|
|
5351
|
+
* @enum {string}
|
|
5352
|
+
*/
|
|
4150
5353
|
sentiment?: 'positive' | 'neutral' | 'negative';
|
|
5354
|
+
/** @description Topics the agent couldn't answer because it lacked content. */
|
|
4151
5355
|
contentGaps?: string[];
|
|
4152
5356
|
} | null;
|
|
4153
|
-
/**
|
|
5357
|
+
/**
|
|
5358
|
+
* Format: date-time
|
|
5359
|
+
* @description When the latest classification result was recorded, as an ISO 8601 timestamp. The API sets it. `null` until you record a result.
|
|
5360
|
+
*/
|
|
4154
5361
|
classifiedAt: string | null;
|
|
5362
|
+
/** @description Why your classifier couldn't classify the conversation. `null` when no failure is recorded. Recording a result clears it. */
|
|
4155
5363
|
classificationError: string | null;
|
|
4156
|
-
/** @description
|
|
5364
|
+
/** @description Your choice to share conversation telemetry with Sanity. `null` until a save includes `sharing`. */
|
|
4157
5365
|
sharing: {
|
|
5366
|
+
/** @description Whether to share classification metrics with Sanity: scores, sentiment, content gap counts, message counts and sizes, tool names, and model and token usage. Message content is not included. */
|
|
4158
5367
|
metrics?: boolean;
|
|
5368
|
+
/** @description Whether to share full conversation transcripts with Sanity. When `true`, the API also sets `metrics` to `true`. */
|
|
4159
5369
|
conversations?: boolean;
|
|
5370
|
+
/** @description How the Sanity team can reach you about your agent, such as an email address or a Discord handle. */
|
|
4160
5371
|
contact?: string;
|
|
4161
5372
|
} | null;
|
|
4162
|
-
/**
|
|
5373
|
+
/**
|
|
5374
|
+
* Format: date-time
|
|
5375
|
+
* @description When the conversation was created, as an ISO 8601 timestamp.
|
|
5376
|
+
*/
|
|
4163
5377
|
createdAt: string;
|
|
4164
|
-
/**
|
|
5378
|
+
/**
|
|
5379
|
+
* Format: date-time
|
|
5380
|
+
* @description When the conversation was last changed, as an ISO 8601 timestamp.
|
|
5381
|
+
*/
|
|
4165
5382
|
updatedAt: string;
|
|
4166
5383
|
};
|
|
4167
5384
|
};
|
|
@@ -4173,89 +5390,143 @@ interface operations {
|
|
|
4173
5390
|
query?: never;
|
|
4174
5391
|
header?: never;
|
|
4175
5392
|
path: {
|
|
5393
|
+
/** @description Your ID for the conversation thread, unique within your organization. Up to 200 characters. */
|
|
4176
5394
|
threadId: string;
|
|
4177
5395
|
};
|
|
4178
5396
|
cookie?: never;
|
|
4179
5397
|
};
|
|
4180
|
-
/** @description
|
|
5398
|
+
/** @description A classification result or failure for one conversation. Send exactly one of `coreMetrics` or `classificationError`. */
|
|
4181
5399
|
requestBody: {
|
|
4182
5400
|
content: {
|
|
4183
5401
|
'application/json': {
|
|
5402
|
+
/** @description The classification result. The API sets `classifiedAt` and clears any recorded `classificationError`. */
|
|
4184
5403
|
coreMetrics?: {
|
|
5404
|
+
/** @description How well the agent resolved the user's needs, as an integer from 1 to 10. */
|
|
4185
5405
|
successScore: number;
|
|
4186
|
-
/**
|
|
5406
|
+
/**
|
|
5407
|
+
* @description The overall sentiment of the conversation.
|
|
5408
|
+
* @enum {string}
|
|
5409
|
+
*/
|
|
4187
5410
|
sentiment: 'positive' | 'neutral' | 'negative';
|
|
5411
|
+
/** @description Topics the agent couldn't answer because it lacked content. */
|
|
4188
5412
|
contentGaps: string[];
|
|
4189
5413
|
};
|
|
5414
|
+
/** @description Why your classifier couldn't classify the conversation. Any earlier classification result stays unchanged. */
|
|
4190
5415
|
classificationError?: string;
|
|
4191
5416
|
};
|
|
4192
5417
|
};
|
|
4193
5418
|
};
|
|
4194
5419
|
responses: {
|
|
4195
|
-
/** @description
|
|
5420
|
+
/** @description A recorded agent conversation: its transcript, metadata, token usage, and classification. */
|
|
4196
5421
|
200: {
|
|
4197
5422
|
headers: {
|
|
4198
5423
|
[name: string]: unknown;
|
|
4199
5424
|
};
|
|
4200
5425
|
content: {
|
|
4201
5426
|
'application/json': {
|
|
5427
|
+
/** @description The conversation ID, unique within the organization. It matches the `_id` of the conversation document in your document store. */
|
|
4202
5428
|
id: string;
|
|
5429
|
+
/** @description Your identifier for the conversation thread, unique within the organization. Saving with the same `threadId` updates the same conversation. */
|
|
4203
5430
|
threadId: string;
|
|
4204
|
-
/** @description
|
|
5431
|
+
/** @description Tags that describe the conversation, such as `mcpEndpoints`, `app`, and `environment`. Filter on them in GROQ queries. `null` until a save includes `metadata`. */
|
|
4205
5432
|
metadata: {
|
|
4206
5433
|
[key: string]: string | string[];
|
|
4207
5434
|
} | null;
|
|
4208
|
-
/**
|
|
5435
|
+
/**
|
|
5436
|
+
* Format: date-time
|
|
5437
|
+
* @description When the API received the first save for this thread, as an ISO 8601 timestamp.
|
|
5438
|
+
*/
|
|
4209
5439
|
startedAt: string;
|
|
4210
|
-
/**
|
|
5440
|
+
/**
|
|
5441
|
+
* Format: date-time
|
|
5442
|
+
* @description When the conversation was last saved, as an ISO 8601 timestamp.
|
|
5443
|
+
*/
|
|
4211
5444
|
messagesUpdatedAt: string;
|
|
5445
|
+
/** @description The conversation transcript, in order. Each save replaces it. */
|
|
4212
5446
|
messages: {
|
|
4213
|
-
/**
|
|
5447
|
+
/**
|
|
5448
|
+
* @description Who sent the message. `user` is the person talking to the agent, `assistant` is the agent, `system` is a system prompt, and `tool` is a tool call or tool result.
|
|
5449
|
+
* @enum {string}
|
|
5450
|
+
*/
|
|
4214
5451
|
role: 'user' | 'assistant' | 'system' | 'tool';
|
|
4215
|
-
/**
|
|
5452
|
+
/**
|
|
5453
|
+
* @description The message text. `null` when the message has no text, such as a tool call.
|
|
5454
|
+
* @default null
|
|
5455
|
+
*/
|
|
4216
5456
|
content: string | null;
|
|
4217
|
-
/**
|
|
5457
|
+
/**
|
|
5458
|
+
* @description The name of the tool for a `tool` message. `null` on other messages.
|
|
5459
|
+
* @default null
|
|
5460
|
+
*/
|
|
4218
5461
|
toolName: string | null;
|
|
4219
5462
|
/**
|
|
5463
|
+
* @description The kind of `tool` message. `call` is the agent calling the tool, and `result` is what the tool returned. `null` on other messages.
|
|
4220
5464
|
* @default null
|
|
4221
5465
|
* @enum {string|null}
|
|
4222
5466
|
*/
|
|
4223
5467
|
toolType: 'call' | 'result' | null;
|
|
4224
|
-
/**
|
|
5468
|
+
/**
|
|
5469
|
+
* @description Why this step failed, including any stack trace. Set it on the tool result for a failed tool call, or on the assistant message for a turn that failed instead of answering. `null` when the step succeeded.
|
|
5470
|
+
* @default null
|
|
5471
|
+
*/
|
|
4225
5472
|
error: string | null;
|
|
4226
5473
|
/**
|
|
4227
5474
|
* Format: date-time
|
|
5475
|
+
* @description When the API first received this message, as an ISO 8601 timestamp. The API sets it. Resending an unchanged message at the same position keeps its timestamp. `null` for messages recorded before timestamps existed.
|
|
4228
5476
|
* @default null
|
|
4229
5477
|
*/
|
|
4230
5478
|
timestamp: string | null;
|
|
4231
5479
|
}[];
|
|
5480
|
+
/** @description The provider of the model the agent used. `null` until a save includes `modelProvider`. */
|
|
4232
5481
|
modelProvider: string | null;
|
|
5482
|
+
/** @description The ID of the model the agent used. `null` until a save includes `modelId`. */
|
|
4233
5483
|
modelId: string | null;
|
|
4234
|
-
/** @description
|
|
5484
|
+
/** @description The running total of token usage for the conversation. `null` until a save includes `tokenUsage`. */
|
|
4235
5485
|
tokenUsage: {
|
|
5486
|
+
/** @description The number of input tokens. */
|
|
4236
5487
|
inputTokens?: number;
|
|
5488
|
+
/** @description The number of output tokens. */
|
|
4237
5489
|
outputTokens?: number;
|
|
5490
|
+
/** @description The total number of tokens. */
|
|
4238
5491
|
totalTokens?: number;
|
|
4239
5492
|
} | null;
|
|
4240
|
-
/** @description
|
|
5493
|
+
/** @description The latest classification result. `null` until you record one. */
|
|
4241
5494
|
coreMetrics: {
|
|
5495
|
+
/** @description How well the agent resolved the user's needs, from 1 to 10. */
|
|
4242
5496
|
successScore?: number;
|
|
4243
|
-
/**
|
|
5497
|
+
/**
|
|
5498
|
+
* @description The overall sentiment of the conversation.
|
|
5499
|
+
* @enum {string}
|
|
5500
|
+
*/
|
|
4244
5501
|
sentiment?: 'positive' | 'neutral' | 'negative';
|
|
5502
|
+
/** @description Topics the agent couldn't answer because it lacked content. */
|
|
4245
5503
|
contentGaps?: string[];
|
|
4246
5504
|
} | null;
|
|
4247
|
-
/**
|
|
5505
|
+
/**
|
|
5506
|
+
* Format: date-time
|
|
5507
|
+
* @description When the latest classification result was recorded, as an ISO 8601 timestamp. The API sets it. `null` until you record a result.
|
|
5508
|
+
*/
|
|
4248
5509
|
classifiedAt: string | null;
|
|
5510
|
+
/** @description Why your classifier couldn't classify the conversation. `null` when no failure is recorded. Recording a result clears it. */
|
|
4249
5511
|
classificationError: string | null;
|
|
4250
|
-
/** @description
|
|
5512
|
+
/** @description Your choice to share conversation telemetry with Sanity. `null` until a save includes `sharing`. */
|
|
4251
5513
|
sharing: {
|
|
5514
|
+
/** @description Whether to share classification metrics with Sanity: scores, sentiment, content gap counts, message counts and sizes, tool names, and model and token usage. Message content is not included. */
|
|
4252
5515
|
metrics?: boolean;
|
|
5516
|
+
/** @description Whether to share full conversation transcripts with Sanity. When `true`, the API also sets `metrics` to `true`. */
|
|
4253
5517
|
conversations?: boolean;
|
|
5518
|
+
/** @description How the Sanity team can reach you about your agent, such as an email address or a Discord handle. */
|
|
4254
5519
|
contact?: string;
|
|
4255
5520
|
} | null;
|
|
4256
|
-
/**
|
|
5521
|
+
/**
|
|
5522
|
+
* Format: date-time
|
|
5523
|
+
* @description When the conversation was created, as an ISO 8601 timestamp.
|
|
5524
|
+
*/
|
|
4257
5525
|
createdAt: string;
|
|
4258
|
-
/**
|
|
5526
|
+
/**
|
|
5527
|
+
* Format: date-time
|
|
5528
|
+
* @description When the conversation was last changed, as an ISO 8601 timestamp.
|
|
5529
|
+
*/
|
|
4259
5530
|
updatedAt: string;
|
|
4260
5531
|
};
|
|
4261
5532
|
};
|
|
@@ -10356,4 +11627,4 @@ interface MediaLibraryAssetDocument {
|
|
|
10356
11627
|
rootDirectory?: Any$1;
|
|
10357
11628
|
}
|
|
10358
11629
|
export { DisconnectEvent as $, UnpublishVersionAction as $n, ObservableCollaborationCommentsClient as $r, QueryWithoutParams as $t, ContentSourceMapMappings as A, PatchTarget as Ai, SanityQueries as An, SanityClient$1 as Ar, MediaLibraryAssetVersion as At, CreateVersionAction as B, StoryboardTransformOptions as Bn, DatasetsClient as Br, MutationSelection as Bt, ContentSourceMap$1 as C, TransformOperation as Ci, SanityDocument$1 as Cn, WelcomeEvent as Cr, LiveEventGoAway as Ct, ContentSourceMapDocuments$1 as D, PromptRequest as Di, SanityProject as Dn, GenerateTargetDocument as Dr, LiveEventWelcome as Dt, ContentSourceMapDocumentValueSource as E, TransformTargetInclude as Ei, SanityImagePalette as En, GenerateTarget as Er, LiveEventRestart as Et, ContentSourceMapValueMapping as F, AgentActionTarget as Fi, ScheduleReleaseAction as Fn, MediaLibraryVideoClient as Fr, Mutation as Ft, DatasetResponse as G, TransactionFirstDocumentIdMutationOptions as Gn, PatchBuilder as Gr, PatchOperations as Gt, DatasetAclMode as H, ThumbnailTransformOptions as Hn, BaseTransaction as Hr, OpenEvent as Ht, CreateAction as I, ConstantAgentActionParam as Ii, SingleActionResult as In, ObservableMediaLibraryVideoClient as Ir, MutationError as It, DeleteReleaseAction as J, UnarchiveReleaseAction as Jn, ObservablePatch as Jr, PublishReleaseAction as Jt, DatasetsResponse as K, TransactionFirstDocumentMutationOptions as Kn, Transaction as Kr, PatchSelection as Kt, CreateReleaseAction as L, DocumentAgentActionParam as Li, SingleMutationResult as Ln, InvokeFunctionEvent as Lr, MutationErrorItem as Lt, ContentSourceMapRemoteDocument as M, AgentActionParams as Mi, SanityReference as Mn, UsersClient as Mr, MediaLibraryVideoPlaybackTransformations as Mt, ContentSourceMapSource as N, AgentActionPath as Ni, SanitySchemasByResource as Nn, ObservableProjectsClient as Nr, MultipleActionResult as Nt, ContentSourceMapLiteralSource as O, PatchDocument as Oi, SanityProjectMember as On, GenerateTargetInclude as Or, MediaLibraryAssetDocument as Ot, ContentSourceMapUnknownSource as P, AgentActionPathSegment as Pi, SanityUser as Pn, ProjectsClient as Pr, MultipleMutationResult as Pt, DiscardVersionAction as Q, UnpublishVariantAction as Qn, CollaborationCommentsClient as Qr, QueryParseError as Qt, CreateVariantAction as R, FieldAgentActionParam as Ri, StackablePerspective as Rn, InvokeFunctionOptions as Rr, MutationEvent as Rt, ClientVariantConditions as S, TransformDocument as Si, SanityAssetDocument as Sn, WelcomeBackEvent as Sr, LiveEvent as St, ContentSourceMapDocumentBase as T, TransformTargetDocument as Ti, SanityImageAssetDocument as Tn, GenerateOperation as Tr, LiveEventReconnect as Tt, DatasetCreateOptions as U, TransactionAllDocumentIdsMutationOptions as Un, ObservablePatchBuilder as Ur, PartialExcept as Ut, CurrentSanityUser as V, SyncTag as Vn, ObservableDatasetsClient as Vr, MutationSelectionQueryParams as Vt, DatasetEditOptions as W, TransactionAllDocumentsMutationOptions as Wn, ObservableTransaction as Wr, PatchMutationOperation as Wt, DeleteVariantDefinitionAction as X, UnfilteredResponseWithoutQuery as Xn, LiveClient as Xr, QueryOptions as Xt, DeleteVariantAction as Y, UnfilteredResponseQueryOptions as Yn, Patch as Yr, PublishVariantAction as Yt, DiscardAction as Z, UnpublishAction as Zn, types_d_exports as Zr, QueryParams as Zt, ChannelErrorEvent as _, ObservableAssetsClient as _i, Requester as _n, VideoRenditionInfoPublic as _r, InsertPatch as _t, AllDocumentsMutationOptions as a, CollaborationCommentPortableTextBlock as ai, ReleaseCardinality as an, UploadResponseEvent as ar, EditableReleaseDocument as at, ClientReturn$1 as b, TranslateTargetInclude as bi, ResumableListenEventNames as bn, VideoSubtitleInfoPublic as br, ListenOptions as bt, Any$1 as c, CollaborationCommentSelection as ci, ReleaseState as cn, VersionAction as cr, ErrorProps as ct, AssetMetadataType as d, CollaborationCommentUpdate as di, ReplaceVersionAction as dn, VideoPlaybackInfoItemPublic as dr, FirstDocumentMutationOptions as dt, CollaborationCommentAnchor as ei, RawQueryResponse$1 as en, UnscheduleReleaseAction as er, EXPERIMENTAL_API_WARNING as et, AttributeSet as f, CollaborationCommentsListenOptions as fi, RequestHandler as fn, VideoPlaybackInfoItemSigned as fr, FitMode as ft, BaseMutationOptions as g, AssetsClient as gi, RequestUrlOptions as gn, VideoRenditionInfo as gr, InitializedClientConfig$1 as gt, BaseActionOptions as h, _listen as hi, RequestOptions$1 as hn, VideoPlaybackTokens as hr, ImportReleaseAction as ht, AllDocumentIdsMutationOptions as i, CollaborationCommentMessage as ii, ReleaseAction as in, UploadProgressEvent as ir, EditVariantDefinitionAction as it, ContentSourceMapPaths as j, AgentActionParam as ji, SanityQueriesByResource as jn, ObservableUsersClient as jr, MediaLibraryPlaybackInfoOptions as jt, ContentSourceMapMapping as k, PatchOperation as ki, SanityProjectionsByResource as kn, ObservableSanityClient$1 as kr, MediaLibraryAssetInstanceIdentifier as kt, ApiError as l, CollaborationCommentStatus as li, ReleaseType as ln, VideoPlaybackInfo as lr, FilteredResponseQueryOptions as lt, AuthProviderResponse as m, CollaborationCommentsWriteOptions as mi, RequestObservableOptions as mn, VideoPlaybackInfoSigned as mr, IdentifiedSanityDocumentStub as mt, ActionError as n, CollaborationCommentDocument as ni, RawRequestOptions as nn, UploadClientConfig as nr, EditReleaseAction as nt, AnimatedImageFormat as o, CollaborationCommentRange as oi, ReleaseDocument as on, VariantAction as or, EmbeddingsSettings as ot, AuthProvider as p, CollaborationCommentsRequestOptions as pi, RequestHandlerOptions as pn, VideoPlaybackInfoPublic as pr, HttpRequest as pt, DeleteAction as q, TransactionMutationOptions as qn, BasePatch as qr, PublishAction as qt, ActionErrorItem as r, CollaborationCommentFieldValue as ri, ReconnectEvent as rn, UploadEvent as rr, EditVariantAction as rt, AnimatedTransformOptions as s, CollaborationCommentReactionShortName as si, ReleaseId as sn, VariantDefinitionAction as sr, EmbeddingsSettingsBody as st, Action as t, CollaborationCommentCreate as ti, RawQuerylessQueryResponse as tn, UploadBody as tr, EditAction as tt, ArchiveReleaseAction as u, CollaborationCommentTarget as ui, ReplaceDraftAction as un, VideoPlaybackInfoItem as ur, FirstDocumentIdMutationOptions as ut, ClientConfig$1 as v, TranslateDocument as vi, ResetEvent as vn, VideoRenditionInfoSigned as vr, ListenEvent as vt, ContentSourceMapDocument as w, TransformTarget as wi, SanityDocumentStub as wn, GenerateInstruction as wr, LiveEventMessage as wt, ClientVariant as x, ImageDescriptionOperation as xi, ResumableListenOptions as xn, VideoSubtitleInfoSigned as xr, ListenParams as xt, ClientPerspective$1 as y, TranslateTarget as yi, ResponseQueryOptions as yn, VideoSubtitleInfo as yr, ListenEventName as yt, CreateVariantDefinitionAction as z, GroqAgentActionParam as zi, StillImageFormat as zn, InvokeFunctionRequest as zr, MutationOperation as zt };
|
|
10359
|
-
//# sourceMappingURL=types-
|
|
11630
|
+
//# sourceMappingURL=types-KoKIKv8Z.d.ts.map
|