@sanity/client 8.7.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.
@@ -1285,6 +1285,7 @@ interface CollaborationCommentDocument extends SanityDocument$1 {
1285
1285
  * Each endpoint pairs the `_key` of a Portable Text block with a character
1286
1286
  * offset into that block's plain text.
1287
1287
  *
1288
+ * @deprecated Use {@link CollaborationCommentAnchor}.
1288
1289
  * @alpha
1289
1290
  */
1290
1291
  interface CollaborationCommentRange {
@@ -1298,8 +1299,8 @@ interface CollaborationCommentRange {
1298
1299
  };
1299
1300
  }
1300
1301
  /**
1301
- * Portable Text covering a comment `range`. Callers can send just the blocks
1302
- * from the `range` start `_key` through end `_key`, or the full field.
1302
+ * Portable Text covering an inline comment anchor. Callers can send just the
1303
+ * blocks from the anchor start `_key` through end `_key`, or the full field.
1303
1304
  *
1304
1305
  * @alpha
1305
1306
  */
@@ -1308,16 +1309,38 @@ type CollaborationCommentFieldValue = Array<{
1308
1309
  _key: string;
1309
1310
  [key: string]: Any$1;
1310
1311
  }>;
1312
+ /**
1313
+ * Where in `path` a comment is anchored.
1314
+ *
1315
+ * For `portable-text`, each endpoint pairs the `_key` of a Portable Text
1316
+ * block with a character offset into that block's plain text. An optional
1317
+ * `fieldValue` is Portable Text covering the anchor. When set, the selection
1318
+ * is resolved from those blocks instead of from the live document.
1319
+ *
1320
+ * @alpha
1321
+ */
1322
+ type CollaborationCommentAnchor = {
1323
+ type: 'portable-text';
1324
+ start: {
1325
+ _key: string;
1326
+ offset: number;
1327
+ };
1328
+ end: {
1329
+ _key: string;
1330
+ offset: number;
1331
+ };
1332
+ fieldValue?: CollaborationCommentFieldValue;
1333
+ };
1311
1334
  /**
1312
1335
  * Target for a top-level comment. Inline selections require both `path` and
1313
- * `range`; field-level comments may set `path` alone.
1336
+ * `anchor`; field-level comments may set `path` alone.
1314
1337
  *
1315
1338
  * The created comment stores this in a different shape: `path` becomes
1316
- * `target.path.field`, and `range` is resolved against the document into
1339
+ * `target.path.field`, and `anchor` is resolved against the document into
1317
1340
  * `target.path.selection` and `contentSnapshot` rather than being stored.
1318
1341
  *
1319
- * An optional `fieldValue` is Portable Text covering the `range`. When set,
1320
- * the `range` is resolved from those blocks instead of from the live document.
1342
+ * Deprecated `range` + top-level `fieldValue` are still accepted and converted
1343
+ * to a `portable-text` `anchor` before the request is sent.
1321
1344
  *
1322
1345
  * @alpha
1323
1346
  */
@@ -1328,16 +1351,41 @@ type CollaborationCommentTarget = {
1328
1351
  } & ({
1329
1352
  /** Path to the field containing the inline comment selection */
1330
1353
  path: string;
1354
+ anchor: CollaborationCommentAnchor;
1355
+ /**
1356
+ * @deprecated Use `anchor`.
1357
+ */
1358
+ range?: never;
1359
+ /**
1360
+ * @deprecated Use `anchor.fieldValue`.
1361
+ */
1362
+ fieldValue?: never;
1363
+ } | {
1364
+ /** Path to the field containing the inline comment selection */
1365
+ path: string;
1366
+ /**
1367
+ * @deprecated Use `anchor`.
1368
+ */
1331
1369
  range: CollaborationCommentRange;
1332
1370
  /**
1333
- * Portable Text covering the `range`. When set, the `range` is resolved
1371
+ * Portable Text covering the `range`. When set, the selection is resolved
1334
1372
  * from these blocks instead of from the live document.
1373
+ *
1374
+ * @deprecated Use `anchor.fieldValue`.
1335
1375
  */
1336
1376
  fieldValue?: CollaborationCommentFieldValue;
1377
+ anchor?: never;
1337
1378
  } | {
1338
1379
  /** Path to the commented field */
1339
1380
  path?: string;
1381
+ anchor?: never;
1382
+ /**
1383
+ * @deprecated Use `anchor`.
1384
+ */
1340
1385
  range?: never;
1386
+ /**
1387
+ * @deprecated Use `anchor.fieldValue`.
1388
+ */
1341
1389
  fieldValue?: never;
1342
1390
  });
1343
1391
  /**
@@ -1365,7 +1413,11 @@ type CollaborationCommentTarget = {
1365
1413
  * documentId: 'doc-1',
1366
1414
  * documentType: 'article',
1367
1415
  * path: 'body',
1368
- * range: {start: {_key: 'block-1', offset: 0}, end: {_key: 'block-1', offset: 5}},
1416
+ * anchor: {
1417
+ * type: 'portable-text',
1418
+ * start: {_key: 'block-1', offset: 0},
1419
+ * end: {_key: 'block-1', offset: 5},
1420
+ * },
1369
1421
  * },
1370
1422
  * })
1371
1423
  * ```
@@ -1397,11 +1449,13 @@ type CollaborationCommentCreate = {
1397
1449
  /**
1398
1450
  * Fields that can be updated on an existing comment.
1399
1451
  *
1400
- * A `range` re-anchors the comment within the field it already targets.
1452
+ * An `anchor` re-anchors the comment within the field it already targets.
1401
1453
  * Pass `null` to remove the selection and leave a field-level comment.
1402
- * An optional `fieldValue` is Portable Text covering that `range`; when set,
1403
- * the `range` is resolved from those blocks instead of from the live document.
1404
- * `fieldValue` cannot be sent alone or together with `range: null`.
1454
+ * An optional `fieldValue` on a `portable-text` anchor is resolved from those
1455
+ * blocks instead of from the live document.
1456
+ *
1457
+ * Deprecated `range` + top-level `fieldValue` (and `range: null`) are still
1458
+ * accepted and converted to `anchor` before the request is sent.
1405
1459
  *
1406
1460
  * @alpha
1407
1461
  */
@@ -1411,17 +1465,57 @@ type CollaborationCommentUpdate = {
1411
1465
  /** Cascades to the comment's replies */
1412
1466
  status?: CollaborationCommentStatus;
1413
1467
  } & ({
1468
+ anchor: CollaborationCommentAnchor;
1469
+ /**
1470
+ * @deprecated Use `anchor`.
1471
+ */
1472
+ range?: never;
1473
+ /**
1474
+ * @deprecated Use `anchor.fieldValue`.
1475
+ */
1476
+ fieldValue?: never;
1477
+ } | {
1478
+ anchor: null;
1479
+ /**
1480
+ * @deprecated Use `anchor`.
1481
+ */
1482
+ range?: never;
1483
+ /**
1484
+ * @deprecated Use `anchor.fieldValue`.
1485
+ */
1486
+ fieldValue?: never;
1487
+ } | {
1488
+ /**
1489
+ * @deprecated Use `anchor`.
1490
+ */
1414
1491
  range: CollaborationCommentRange;
1415
1492
  /**
1416
- * Portable Text covering the `range`. When set, the `range` is resolved
1493
+ * Portable Text covering the `range`. When set, the selection is resolved
1417
1494
  * from these blocks instead of from the live document.
1495
+ *
1496
+ * @deprecated Use `anchor.fieldValue`.
1418
1497
  */
1419
1498
  fieldValue?: CollaborationCommentFieldValue;
1499
+ anchor?: never;
1420
1500
  } | {
1501
+ /**
1502
+ * @deprecated Use `anchor: null`.
1503
+ */
1421
1504
  range: null;
1505
+ /**
1506
+ * @deprecated Use `anchor.fieldValue`.
1507
+ */
1422
1508
  fieldValue?: never;
1509
+ anchor?: never;
1423
1510
  } | {
1511
+ anchor?: undefined;
1512
+ /**
1513
+ * @deprecated Use `anchor`.
1514
+ */
1424
1515
  range?: undefined;
1516
+ /**
1517
+ * @deprecated Use `anchor.fieldValue`.
1518
+ */
1425
1519
  fieldValue?: never;
1426
1520
  });
1427
1521
  /**
@@ -1668,13 +1762,13 @@ interface paths {
1668
1762
  };
1669
1763
  /**
1670
1764
  * List knowledge bases
1671
- * @description Returns the organization's knowledge bases visible to the caller, cursor-paginated.
1765
+ * @description Returns the knowledge bases you can access in the organization set by `organizationId`. Results are cursor-paginated.
1672
1766
  */
1673
1767
  get: operations['listKnowledgeBases'];
1674
1768
  put?: never;
1675
1769
  /**
1676
1770
  * Create a knowledge base
1677
- * @description Creates a knowledge base bound to a Sanity dataset, where its content documents will be stored.
1771
+ * @description Creates a knowledge base in your organization. To add content to it, create an import.
1678
1772
  */
1679
1773
  post: operations['createKnowledgeBase'];
1680
1774
  delete?: never;
@@ -1692,21 +1786,21 @@ interface paths {
1692
1786
  };
1693
1787
  /**
1694
1788
  * Get a knowledge base
1695
- * @description Returns the knowledge base object: metadata and state. Resolves from the id alone, the public id (`kb...`) or the uuid; access is decided against the knowledge base's own organization, and an id the caller cannot read returns 404. For the built content, use the outline or entries endpoints.
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.
1696
1790
  */
1697
1791
  get: operations['getKnowledgeBase'];
1698
1792
  put?: never;
1699
1793
  post?: never;
1700
1794
  /**
1701
1795
  * Delete a knowledge base
1702
- * @description Removes the knowledge base and everything it owns: sources, imports, and revisions. Content documents in the bound dataset are deleted best-effort, and stored source files are reclaimed by a separate cleanup.
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.
1703
1797
  */
1704
1798
  delete: operations['deleteKnowledgeBase'];
1705
1799
  options?: never;
1706
1800
  head?: never;
1707
1801
  /**
1708
1802
  * Update a knowledge base
1709
- * @description Edits the name and description, or the recurring refresh controls (`refreshEnabled`, `refreshFrequency`). Refresh fields return 422 for knowledge bases with no web or dataset source. Disabling pauses the schedule; manual refresh still works.
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.
1710
1804
  */
1711
1805
  patch: operations['updateKnowledgeBase'];
1712
1806
  trace?: never;
@@ -1721,8 +1815,8 @@ interface paths {
1721
1815
  get?: never;
1722
1816
  put?: never;
1723
1817
  /**
1724
- * Trigger a knowledge base build
1725
- * @description Queues a build over the current corpus and returns a job id right away. If a build is already running, you get that job instead of a second one.
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.
1726
1820
  */
1727
1821
  post: operations['buildKnowledgeBase'];
1728
1822
  delete?: never;
@@ -1741,8 +1835,8 @@ interface paths {
1741
1835
  get?: never;
1742
1836
  put?: never;
1743
1837
  /**
1744
- * Cancel an in-progress build
1745
- * @description Cancels the running build and resets the knowledge base so it can be rebuilt.
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.
1746
1840
  */
1747
1841
  post: operations['cancelKnowledgeBaseBuild'];
1748
1842
  delete?: never;
@@ -1762,7 +1856,7 @@ interface paths {
1762
1856
  put?: never;
1763
1857
  /**
1764
1858
  * Rebuild an entry from its sources
1765
- * @description Queues a re-write of the entry at this path from its cited sources and the active instructions, and returns a job id right away. The response also names the other entries citing any of the same sources: a source-tied rule affects every page citing that source, so those may change too.
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.
1766
1860
  */
1767
1861
  post: operations['rebuildEntry'];
1768
1862
  delete?: never;
@@ -1780,13 +1874,21 @@ interface paths {
1780
1874
  };
1781
1875
  /**
1782
1876
  * List imports
1783
- * @description Everything added to this knowledge base, one row per import: a file upload, web crawl, dataset bind, or inline text. Cursor-paginated. The sources each import produced live under `/sources`.
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`.
1784
1878
  */
1785
1879
  get: operations['listImports'];
1786
1880
  put?: never;
1787
1881
  /**
1788
- * Create an import (text, crawl, or dataset)
1789
- * @description Adds content, discriminated on `type`: `text` for inline content, `crawl` for a website, `dataset` for a GROQ-filtered Sanity dataset. Each variant queues processing and returns a job id to poll. For files, use `POST .../imports/uploads` instead. Re-adding an existing crawl url returns 409 `webSourceRootConflict`; exceeding the crawl root limit returns 409 `webSourceRootLimitExceeded`. Supports the `Idempotency-Key` header.
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.
1790
1892
  */
1791
1893
  post: operations['createImport'];
1792
1894
  delete?: never;
@@ -1805,8 +1907,13 @@ interface paths {
1805
1907
  get?: never;
1806
1908
  put?: never;
1807
1909
  /**
1808
- * Start a file-upload import
1809
- * @description Creates a file-upload import and returns a single-use signed upload URL. PUT the file bytes to it, then call `POST .../imports/uploads/{importId}/complete` to start ingestion. The bytes never pass through this API. Supports the `Idempotency-Key` header.
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.
1810
1917
  */
1811
1918
  post: operations['startUpload'];
1812
1919
  delete?: never;
@@ -1825,8 +1932,8 @@ interface paths {
1825
1932
  get?: never;
1826
1933
  put?: never;
1827
1934
  /**
1828
- * Complete a file-upload import
1829
- * @description Call after the file bytes are uploaded to the signed URL. Starts processing and returns a job id to poll.
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.
1830
1937
  */
1831
1938
  post: operations['completeUpload'];
1832
1939
  delete?: never;
@@ -1843,15 +1950,15 @@ interface paths {
1843
1950
  cookie?: never;
1844
1951
  };
1845
1952
  /**
1846
- * Get a single import
1847
- * @description Returns one import with its kind and processing status.
1953
+ * Get an import
1954
+ * @description Returns an import with its `sourceKind` and processing `status`.
1848
1955
  */
1849
1956
  get: operations['getImport'];
1850
1957
  put?: never;
1851
1958
  post?: never;
1852
1959
  /**
1853
1960
  * Delete an import
1854
- * @description Removes the import and every source it produced, and cancels its ingest if one is still running. Use it to discard something added by mistake.
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.
1855
1962
  */
1856
1963
  delete: operations['deleteImport'];
1857
1964
  options?: never;
@@ -1868,7 +1975,7 @@ interface paths {
1868
1975
  };
1869
1976
  /**
1870
1977
  * Get a download URL for an import
1871
- * @description Mints a short-lived signed URL serving the import's original bytes as an attachment. Use it before `expiresAt`; the bytes never pass through this API. Only file and text imports carry original bytes; crawls and dataset binds return 409 `importInvalidState`.
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`.
1872
1979
  */
1873
1980
  get: operations['downloadImport'];
1874
1981
  put?: never;
@@ -1889,8 +1996,8 @@ interface paths {
1889
1996
  get?: never;
1890
1997
  put?: never;
1891
1998
  /**
1892
- * Author a human instruction
1893
- * @description Creates a standing rule that every future build honors. Tie it to one or more sources with `scopeSourceIds`, or leave it null to apply knowledge-base-wide. Pass `rebuildPaths` to immediately rebuild those entries under the new rule; the response carries the rebuild job id, or null when the rebuild could not start (the rule is saved either way). Pass `verified` after a completed synchronous contradiction check to skip the background one; if the requested rebuild fails to start, the background check runs anyway so the contradicting pages get filed as issues.
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.
1894
2001
  */
1895
2002
  post: operations['createInstruction'];
1896
2003
  delete?: never;
@@ -1911,14 +2018,14 @@ interface paths {
1911
2018
  post?: never;
1912
2019
  /**
1913
2020
  * Delete an instruction
1914
- * @description Deletes the rule. Builds stop honoring it from the next run.
2021
+ * @description Deletes the instruction. Builds stop applying it from the next run.
1915
2022
  */
1916
2023
  delete: operations['deleteInstruction'];
1917
2024
  options?: never;
1918
2025
  head?: never;
1919
2026
  /**
1920
- * Edit an instruction
1921
- * @description Edits the statement or scope. The change applies from the next build. Any edit re-affirms the rule: an archived rule returns to active, re-anchored to the sources' current content.
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.
1922
2029
  */
1923
2030
  patch: operations['updateInstruction'];
1924
2031
  trace?: never;
@@ -1933,8 +2040,8 @@ interface paths {
1933
2040
  get?: never;
1934
2041
  put?: never;
1935
2042
  /**
1936
- * Apply accepted issues to a Context
1937
- * @description Queues a job that applies accepted issues, rewrites the affected entries, and commits a new revision. Returns a job id. Issue ids that no longer exist are skipped.
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.
1938
2045
  */
1939
2046
  post: operations['applyIssues'];
1940
2047
  delete?: never;
@@ -1954,7 +2061,7 @@ interface paths {
1954
2061
  put?: never;
1955
2062
  /**
1956
2063
  * Dismiss an issue
1957
- * @description Marks the issue rejected. Idempotent: dismissing an issue that already left the queue returns it as-is. 422 `issueDocumentInvalid` when the document was hand-edited into an unverifiable shape; 409 `issueTransitionConflict` on a concurrent edit, safe to retry.
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`.
1958
2065
  */
1959
2066
  post: operations['dismissIssue'];
1960
2067
  delete?: never;
@@ -1974,7 +2081,7 @@ interface paths {
1974
2081
  put?: never;
1975
2082
  /**
1976
2083
  * Reopen an accepted conflict
1977
- * @description Returns an accepted conflict to triage, clearing its resolution and deleting the instruction it minted. Idempotent for issues that are not accepted conflicts.
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`.
1978
2085
  */
1979
2086
  post: operations['reopenIssue'];
1980
2087
  delete?: never;
@@ -1994,7 +2101,7 @@ interface paths {
1994
2101
  put?: never;
1995
2102
  /**
1996
2103
  * Resolve a conflict issue
1997
- * @description Settles a conflict with one of two choices: `keep_existing` or `accept_new` (rewrites the entry; the returned `jobId` tracks it). Only conflict issues are resolvable, and a dismissed issue must be reopened first. The decision becomes a standing instruction for every future build; `resolvedBy` records who decided.
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`.
1998
2105
  */
1999
2106
  post: operations['resolveIssue'];
2000
2107
  delete?: never;
@@ -2011,8 +2118,8 @@ interface paths {
2011
2118
  cookie?: never;
2012
2119
  };
2013
2120
  /**
2014
- * Get a job by id
2015
- * @description Returns the status of a job, such as a build or an import. Job ids come from the endpoint that queued the work.
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.
2016
2123
  */
2017
2124
  get: operations['getJob'];
2018
2125
  put?: never;
@@ -2033,8 +2140,8 @@ interface paths {
2033
2140
  get?: never;
2034
2141
  put?: never;
2035
2142
  /**
2036
- * Trigger an incremental refresh
2037
- * @description Queues a refresh: recrawls each web source, diffs the corpus against the last build, and files change issues. Returns a job id, with `started: false` when a refresh was already in flight. Supports the `Idempotency-Key` header.
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.
2038
2145
  */
2039
2146
  post: operations['refreshKnowledgeBase'];
2040
2147
  delete?: never;
@@ -2052,7 +2159,7 @@ interface paths {
2052
2159
  };
2053
2160
  /**
2054
2161
  * List sources
2055
- * @description The distilled units builds cite: the pages, files, and documents your imports expanded into. Read-only; add content via `/imports`. Cursor-paginated, filter by `status`.
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`.
2056
2163
  */
2057
2164
  get: operations['listSources'];
2058
2165
  put?: never;
@@ -2071,15 +2178,15 @@ interface paths {
2071
2178
  cookie?: never;
2072
2179
  };
2073
2180
  /**
2074
- * Get a single source
2075
- * @description Returns one source with its metadata and processing status.
2181
+ * Get a source
2182
+ * @description Returns a source with its metadata and processing status.
2076
2183
  */
2077
2184
  get: operations['getSource'];
2078
2185
  put?: never;
2079
2186
  post?: never;
2080
2187
  /**
2081
2188
  * Delete a source
2082
- * @description Removes the source immediately. Entries are not modified here — citations to it are cleaned up by the next build or check for changes, where entries left without sources become removal proposals. Human-edited entries are never modified.
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.
2083
2190
  */
2084
2191
  delete: operations['deleteSource'];
2085
2192
  options?: never;
@@ -2095,8 +2202,8 @@ interface paths {
2095
2202
  cookie?: never;
2096
2203
  };
2097
2204
  /**
2098
- * Read a source's distilled content
2099
- * @description The distilled markdown builds cite, the same text the pipeline itself reads. Use it to verify an issue's claims against the sources its `citedSourceIds` name. Optional `startLine` and `endLine` (1-indexed, inclusive) fetch just a span. JSON by default; `?format=markdown` returns the raw text. 409 `sourceNotDistilled` until distillation has produced content.
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`.
2100
2207
  */
2101
2208
  get: operations['getSourceContent'];
2102
2209
  put?: never;
@@ -2117,7 +2224,13 @@ interface paths {
2117
2224
  get?: never;
2118
2225
  /**
2119
2226
  * Record a conversation
2120
- * @description Upserts the conversation telemetry for one thread. `threadId` identifies the conversation within your organization — reuse means the same conversation. Messages replace the stored transcript wholesale; `metadata`, `sharing`, and model fields only overwrite when present. Last write per thread wins — retries are safe. `sharing` records your opt-in to share telemetry with Sanity: metadata-only metrics, or full transcripts.
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.
2121
2234
  */
2122
2235
  put: operations['saveConversation'];
2123
2236
  post?: never;
@@ -2125,8 +2238,13 @@ interface paths {
2125
2238
  options?: never;
2126
2239
  head?: never;
2127
2240
  /**
2128
- * Record a classification verdict
2129
- * @description Records the classification your own model produced for one thread: exactly one of `coreMetrics` (a verdict — the server stamps `classifiedAt` and clears any recorded failure) or `classificationError` (why classification failed; an earlier verdict stays untouched). No revision guard — like the ingest upsert the writer is an automated classifier, so last write wins and a re-classification simply overwrites.
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.
2130
2248
  */
2131
2249
  patch: operations['classifyConversation'];
2132
2250
  trace?: never;
@@ -2134,84 +2252,162 @@ interface paths {
2134
2252
  }
2135
2253
  interface components {
2136
2254
  schemas: {
2137
- /** @description A `sanity.context.conversation` document, one agent conversation transcript with its classification, stored in the organization store. Not returned by any endpoint raw; published so GROQ reads can be typed. Write through the conversation ingest and classify endpoints, never with a raw client. */
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. */
2138
2256
  ConversationDoc: {
2257
+ /** @description The document ID. */
2139
2258
  _id: string;
2259
+ /** @description The document revision. It changes on every write. */
2140
2260
  _rev: string;
2141
- /** Format: date-time */
2261
+ /**
2262
+ * Format: date-time
2263
+ * @description When the document was created, as an ISO 8601 timestamp.
2264
+ */
2142
2265
  _createdAt: string;
2143
- /** Format: date-time */
2266
+ /**
2267
+ * Format: date-time
2268
+ * @description When the document was last changed, as an ISO 8601 timestamp.
2269
+ */
2144
2270
  _updatedAt: string;
2145
- /** @enum {string} */
2271
+ /**
2272
+ * @description The document type. Always `sanity.context.conversation`.
2273
+ * @enum {string}
2274
+ */
2146
2275
  _type: 'sanity.context.conversation';
2147
- /** @enum {number} */
2276
+ /**
2277
+ * @description The version of the document shape. Currently `1`.
2278
+ * @enum {number}
2279
+ */
2148
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. */
2149
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`. */
2150
2284
  threadId: string;
2151
- /** @description ConversationMetadata */
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`. */
2152
2286
  metadata: {
2153
2287
  [key: string]: string | string[];
2154
2288
  } | null;
2155
- /** Format: date-time */
2289
+ /**
2290
+ * Format: date-time
2291
+ * @description When the API received the first save for this thread, as an ISO 8601 timestamp.
2292
+ */
2156
2293
  startedAt: string;
2157
- /** Format: date-time */
2294
+ /**
2295
+ * Format: date-time
2296
+ * @description When the conversation was last saved, as an ISO 8601 timestamp.
2297
+ */
2158
2298
  messagesUpdatedAt: string;
2299
+ /** @description The conversation transcript, in order. Each save replaces it. */
2159
2300
  messages: {
2160
- /** @enum {string} */
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
+ */
2161
2305
  role: 'user' | 'assistant' | 'system' | 'tool';
2162
- /** @default null */
2306
+ /**
2307
+ * @description The message text. `null` when the message has no text, such as a tool call.
2308
+ * @default null
2309
+ */
2163
2310
  content: string | null;
2164
- /** @default null */
2311
+ /**
2312
+ * @description The name of the tool for a `tool` message. `null` on other messages.
2313
+ * @default null
2314
+ */
2165
2315
  toolName: string | null;
2166
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.
2167
2318
  * @default null
2168
2319
  * @enum {string|null}
2169
2320
  */
2170
2321
  toolType: 'call' | 'result' | null;
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
+ */
2326
+ error: string | null;
2327
+ /**
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.
2330
+ * @default null
2331
+ */
2332
+ timestamp: string | null;
2171
2333
  }[];
2334
+ /** @description The provider of the model the agent used. `null` until a save includes `modelProvider`. */
2172
2335
  modelProvider: string | null;
2336
+ /** @description The ID of the model the agent used. `null` until a save includes `modelId`. */
2173
2337
  modelId: string | null;
2174
- /** @description ConversationTokenUsage */
2338
+ /** @description The running total of token usage for the conversation. `null` until a save includes `tokenUsage`. */
2175
2339
  tokenUsage: {
2340
+ /** @description The number of input tokens. */
2176
2341
  inputTokens?: number;
2342
+ /** @description The number of output tokens. */
2177
2343
  outputTokens?: number;
2344
+ /** @description The total number of tokens. */
2178
2345
  totalTokens?: number;
2179
2346
  } | null;
2180
- /** @description ConversationCoreMetrics */
2347
+ /** @description The latest classification result. `null` until you record one. */
2181
2348
  coreMetrics: {
2349
+ /** @description How well the agent resolved the user's needs, from 1 to 10. */
2182
2350
  successScore?: number;
2183
- /** @enum {string} */
2351
+ /**
2352
+ * @description The overall sentiment of the conversation.
2353
+ * @enum {string}
2354
+ */
2184
2355
  sentiment?: 'positive' | 'neutral' | 'negative';
2356
+ /** @description Topics the agent couldn't answer because it lacked content. */
2185
2357
  contentGaps?: string[];
2186
2358
  } | null;
2187
- /** Format: date-time */
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
+ */
2188
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. */
2189
2365
  classificationError: string | null;
2190
2366
  /**
2191
- * @description ConversationSharing
2367
+ * @description Your choice to share conversation telemetry with Sanity. `null` until a save includes `sharing`.
2192
2368
  * @default null
2193
2369
  */
2194
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. */
2195
2372
  metrics?: boolean;
2373
+ /** @description Whether to share full conversation transcripts with Sanity. When `true`, the API also sets `metrics` to `true`. */
2196
2374
  conversations?: boolean;
2375
+ /** @description How the Sanity team can reach you about your agent, such as an email address or a Discord handle. */
2197
2376
  contact?: string;
2198
2377
  } | null;
2199
2378
  };
2200
- /** @description A `sanity.context.entry` document, one outline node stored in the bound dataset. Not returned by any endpoint; published so GROQ reads against the dataset can be typed. The entries endpoints serve the validated wire view. */
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. */
2201
2380
  EntryDoc: {
2381
+ /** @description The document ID. */
2202
2382
  _id: string;
2383
+ /** @description The document revision. It changes on every write. */
2203
2384
  _rev: string;
2204
- /** Format: date-time */
2385
+ /**
2386
+ * Format: date-time
2387
+ * @description When the document was created, as an ISO 8601 timestamp.
2388
+ */
2205
2389
  _createdAt: string;
2206
- /** Format: date-time */
2390
+ /**
2391
+ * Format: date-time
2392
+ * @description When the document was last changed, as an ISO 8601 timestamp.
2393
+ */
2207
2394
  _updatedAt: string;
2395
+ /** @description The ID (`kb…`) of the knowledge base this document belongs to. */
2208
2396
  knowledgeBaseId: string;
2209
- /** @enum {string} */
2397
+ /**
2398
+ * @description The document type. Always `sanity.context.entry`.
2399
+ * @enum {string}
2400
+ */
2210
2401
  _type: 'sanity.context.entry';
2402
+ /** @description The version of the document shape. Currently `1`. */
2211
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. */
2212
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. */
2213
2407
  path: string;
2408
+ /** @description The entry title. */
2214
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`. */
2215
2411
  tldr?: {
2216
2412
  scope: string;
2217
2413
  excludes: string;
@@ -2219,250 +2415,599 @@ interface components {
2219
2415
  /** @enum {string} */
2220
2416
  centrality: 'core' | 'standard' | 'peripheral';
2221
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. */
2222
2419
  body?: string;
2420
+ /** @description The H2 and H3 heading titles in `body`. Absent when the entry has no `body`. */
2223
2421
  topicHeadings?: string[];
2422
+ /** @description The sources that back this entry, one item per source. */
2224
2423
  citations?: {
2424
+ /** @description ID of the cited source. */
2225
2425
  sourceId: string;
2426
+ /** @description Which facts in the entry body this source backs, in a short phrase. */
2226
2427
  supports?: string;
2428
+ /** @description Line ranges in the source's distilled content that back those facts, with the quoted text. */
2227
2429
  spans?: {
2430
+ /** @description First line of the range, counting from 1. Line numbers match `GET .../sources/{sourceId}/content`. */
2228
2431
  sourceLineStart: number;
2432
+ /** @description Last line of the range, inclusive. */
2229
2433
  sourceLineEnd: number;
2434
+ /** @description The exact text of the line range in the source. */
2230
2435
  quote: string;
2231
2436
  }[];
2437
+ /** @description The text in the entry body that this citation backs. */
2232
2438
  claim?: {
2439
+ /** @description The exact entry text the citation backs. */
2233
2440
  exact: string;
2441
+ /** @description Text immediately before `exact`, to tell apart repeated phrases. */
2234
2442
  prefix?: string;
2443
+ /** @description Text immediately after `exact`, to tell apart repeated phrases. */
2235
2444
  suffix?: string;
2236
2445
  };
2237
2446
  /** @enum {string} */
2238
2447
  groundingState?: 'drifted';
2448
+ /** @description A unique key for this item in the `citations` array. */
2239
2449
  _key: string;
2240
- /** @enum {string} */
2450
+ /**
2451
+ * @description The citation type. Always `sanity.context.citation`.
2452
+ * @enum {string}
2453
+ */
2241
2454
  _type: 'sanity.context.citation';
2455
+ /** @description A display name for the cited source. Builds currently set it to the `sourceId`. */
2242
2456
  filename: string;
2243
2457
  mime?: string;
2244
2458
  excerpt?: string;
2245
2459
  }[];
2246
- /** @enum {string} */
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
+ */
2247
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. */
2248
2466
  generatedAt: string;
2249
2467
  };
2250
- /** @description A `sanity.context.instruction` document, a standing decision steering every build, stored in the bound dataset. Not returned by any endpoint; published so GROQ reads against the dataset can be typed. Write through the instructions endpoints, never with a raw client. */
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. */
2251
2469
  InstructionDoc: {
2470
+ /** @description The document ID. */
2252
2471
  _id: string;
2472
+ /** @description The document revision. It changes on every write. */
2253
2473
  _rev: string;
2254
- /** Format: date-time */
2474
+ /**
2475
+ * Format: date-time
2476
+ * @description When the document was created, as an ISO 8601 timestamp.
2477
+ */
2255
2478
  _createdAt: string;
2256
- /** Format: date-time */
2479
+ /**
2480
+ * Format: date-time
2481
+ * @description When the document was last changed, as an ISO 8601 timestamp.
2482
+ */
2257
2483
  _updatedAt: string;
2484
+ /** @description The ID (`kb…`) of the knowledge base this document belongs to. */
2258
2485
  knowledgeBaseId: string;
2259
- /** @enum {string} */
2486
+ /**
2487
+ * @description The document type. Always `sanity.context.instruction`.
2488
+ * @enum {string}
2489
+ */
2260
2490
  _type: 'sanity.context.instruction';
2261
- /** @enum {number} */
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
+ */
2262
2495
  schemaVersion: 1;
2496
+ /** @description The instruction, in plain language. Builds follow it over the raw sources. */
2263
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. */
2264
2499
  scopeSources: {
2500
+ /** @description A unique key for this item in the array. It matches `sourceId`. */
2265
2501
  _key: string;
2502
+ /** @description The ID of the source the instruction is tied to. */
2266
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. */
2267
2505
  contentHash: string;
2268
2506
  }[] | null;
2269
- /** @enum {string} */
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
+ */
2270
2511
  status: 'active' | 'archived';
2512
+ /** @description When the instruction was archived, as an ISO 8601 timestamp. `null` while `active`. */
2271
2513
  archivedAt: string | null;
2514
+ /** @description Why the instruction was archived. `null` while `active`. */
2272
2515
  archivedReason: string | null;
2273
- /** @enum {string} */
2516
+ /**
2517
+ * @description Where the instruction came from. `conflict` means it was created when you resolved a conflict issue.
2518
+ * @enum {string}
2519
+ */
2274
2520
  origin: 'conflict';
2521
+ /** @description The `_id` of the conflict issue this instruction resolved. Reopening that issue deletes this instruction. */
2275
2522
  sourceIssueId: string;
2276
2523
  } | {
2524
+ /** @description The document ID. */
2277
2525
  _id: string;
2526
+ /** @description The document revision. It changes on every write. */
2278
2527
  _rev: string;
2279
- /** Format: date-time */
2528
+ /**
2529
+ * Format: date-time
2530
+ * @description When the document was created, as an ISO 8601 timestamp.
2531
+ */
2280
2532
  _createdAt: string;
2281
- /** Format: date-time */
2533
+ /**
2534
+ * Format: date-time
2535
+ * @description When the document was last changed, as an ISO 8601 timestamp.
2536
+ */
2282
2537
  _updatedAt: string;
2538
+ /** @description The ID (`kb…`) of the knowledge base this document belongs to. */
2283
2539
  knowledgeBaseId: string;
2284
- /** @enum {string} */
2540
+ /**
2541
+ * @description The document type. Always `sanity.context.instruction`.
2542
+ * @enum {string}
2543
+ */
2285
2544
  _type: 'sanity.context.instruction';
2286
- /** @enum {number} */
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
+ */
2287
2549
  schemaVersion: 1;
2550
+ /** @description The instruction, in plain language. Builds follow it over the raw sources. */
2288
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. */
2289
2553
  scopeSources: {
2554
+ /** @description A unique key for this item in the array. It matches `sourceId`. */
2290
2555
  _key: string;
2556
+ /** @description The ID of the source the instruction is tied to. */
2291
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. */
2292
2559
  contentHash: string;
2293
2560
  }[] | null;
2294
- /** @enum {string} */
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
+ */
2295
2565
  status: 'active' | 'archived';
2566
+ /** @description When the instruction was archived, as an ISO 8601 timestamp. `null` while `active`. */
2296
2567
  archivedAt: string | null;
2568
+ /** @description Why the instruction was archived. `null` while `active`. */
2297
2569
  archivedReason: string | null;
2298
- /** @enum {string} */
2570
+ /**
2571
+ * @description Where the instruction came from. `human` means it was created directly through the API or the dashboard.
2572
+ * @enum {string}
2573
+ */
2299
2574
  origin: 'human';
2300
- /** @enum {string|null} */
2575
+ /**
2576
+ * @description Always `null` for a `human` instruction.
2577
+ * @enum {string|null}
2578
+ */
2301
2579
  sourceIssueId: null;
2302
2580
  };
2303
- /** @description A `sanity.context.issue` document, a build finding awaiting triage, stored in the bound dataset. Not returned by any endpoint; published so GROQ reads and trigger filters can be typed. Status transitions flow through the issues endpoints, which own the state machine. One invariant the schema cannot express: only a `conflict` issue ever carries a non-null `resolution`. */
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`. */
2304
2582
  IssueDoc: {
2583
+ /** @description The document ID. */
2305
2584
  _id: string;
2585
+ /** @description The document revision. It changes on every write. */
2306
2586
  _rev: string;
2307
- /** Format: date-time */
2587
+ /**
2588
+ * Format: date-time
2589
+ * @description When the document was created, as an ISO 8601 timestamp.
2590
+ */
2308
2591
  _createdAt: string;
2309
- /** Format: date-time */
2592
+ /**
2593
+ * Format: date-time
2594
+ * @description When the document was last changed, as an ISO 8601 timestamp.
2595
+ */
2310
2596
  _updatedAt: string;
2597
+ /** @description The ID (`kb…`) of the knowledge base this document belongs to. */
2311
2598
  knowledgeBaseId: string;
2312
- /** @enum {string} */
2599
+ /**
2600
+ * @description The document type. Always `sanity.context.issue`.
2601
+ * @enum {string}
2602
+ */
2313
2603
  _type: 'sanity.context.issue';
2314
- /** @enum {number} */
2604
+ /**
2605
+ * @description The version of the document shape. Currently `1`.
2606
+ * @enum {number}
2607
+ */
2315
2608
  schemaVersion: 1;
2316
- /** @description IssueContent */
2609
+ /** @description What an issue found. The shape depends on `kind`. */
2317
2610
  content: {
2318
- /** @enum {string} */
2319
- kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
2320
- /** @enum {string} */
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
+ */
2321
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. */
2322
2617
  scopePath: string;
2618
+ /** @description What the problem is, in one or two sentences. */
2323
2619
  issue: string;
2620
+ /** @description What to do to fix the issue. */
2324
2621
  suggestedFix: string;
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
+ */
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. */
2628
+ claimKey: string;
2629
+ /** @description The conflicting positions, at least two. To resolve the conflict, pass the index of one side as `resolution`. */
2630
+ sides: {
2631
+ /** @description The position as a self-contained sentence. This is the option you choose from. */
2632
+ claim: string;
2633
+ /** @description The disputed value on its own, such as `10,000/month`, without the sentence. */
2634
+ value?: string;
2635
+ /** @description Paths of the entries that state this position. */
2636
+ entryPaths?: string[];
2637
+ /** @description IDs of the sources that directly back this position. */
2638
+ sourceIds?: string[];
2639
+ /** @description Where in a source this position was read. */
2640
+ span?: {
2641
+ /** @description ID of the source the position was read from. */
2642
+ sourceId: string;
2643
+ /** @description First line of the range, counting from 1. Line numbers match `GET .../sources/{sourceId}/content`. */
2644
+ lineStart: number;
2645
+ /** @description Last line of the range, inclusive. */
2646
+ lineEnd: number;
2647
+ };
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
+ */
2652
+ authority?: 'primary' | 'secondary' | 'community';
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. */
2655
+ suggested?: number;
2656
+ } | {
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
+ */
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. */
2663
+ scopePath: string;
2664
+ /** @description What the problem is, in one or two sentences. */
2665
+ issue: string;
2666
+ /** @description What to do to fix the issue. */
2667
+ suggestedFix: string;
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
+ */
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. */
2325
2674
  citedSourceIds?: string[];
2675
+ /** @description A key naming the specific finding, when the check that found it sets one. */
2326
2676
  claimKey?: string;
2677
+ /** @description Paths of the entries the issue involves, when it spans more than one entry. */
2327
2678
  involvedScopes?: string[];
2328
- currentClaim?: string;
2329
- alternativeClaim?: string;
2330
- /** @enum {string} */
2331
- currentAuthority?: 'primary' | 'secondary' | 'community';
2332
- /** @enum {string} */
2333
- alternativeAuthority?: 'primary' | 'secondary' | 'community';
2334
- /** @enum {string} */
2335
- suggestedResolution?: 'keep_existing' | 'accept_new';
2336
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. */
2337
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. */
2338
2683
  revisionId: string | null;
2339
- /** @enum {string} */
2684
+ /**
2685
+ * @description The issue status. `open` means it is waiting for triage.
2686
+ * @enum {string}
2687
+ */
2340
2688
  status: 'open';
2341
- /** @enum {string|null} */
2689
+ /**
2690
+ * @description Always `null` while the issue is `open`.
2691
+ * @enum {string|null}
2692
+ */
2342
2693
  resolution: null;
2343
- /** @enum {string|null} */
2694
+ /**
2695
+ * @description Always `null` while the issue is `open`.
2696
+ * @enum {string|null}
2697
+ */
2344
2698
  resolvedAt: null;
2345
- /** @enum {string|null} */
2699
+ /**
2700
+ * @description Always `null` while the issue is `open`.
2701
+ * @enum {string|null}
2702
+ */
2346
2703
  resolvedBy: null;
2347
2704
  } | {
2705
+ /** @description The document ID. */
2348
2706
  _id: string;
2707
+ /** @description The document revision. It changes on every write. */
2349
2708
  _rev: string;
2350
- /** Format: date-time */
2709
+ /**
2710
+ * Format: date-time
2711
+ * @description When the document was created, as an ISO 8601 timestamp.
2712
+ */
2351
2713
  _createdAt: string;
2352
- /** Format: date-time */
2714
+ /**
2715
+ * Format: date-time
2716
+ * @description When the document was last changed, as an ISO 8601 timestamp.
2717
+ */
2353
2718
  _updatedAt: string;
2719
+ /** @description The ID (`kb…`) of the knowledge base this document belongs to. */
2354
2720
  knowledgeBaseId: string;
2355
- /** @enum {string} */
2721
+ /**
2722
+ * @description The document type. Always `sanity.context.issue`.
2723
+ * @enum {string}
2724
+ */
2356
2725
  _type: 'sanity.context.issue';
2357
- /** @enum {number} */
2726
+ /**
2727
+ * @description The version of the document shape. Currently `1`.
2728
+ * @enum {number}
2729
+ */
2358
2730
  schemaVersion: 1;
2359
- /** @description IssueContent */
2731
+ /** @description What an issue found. The shape depends on `kind`. */
2360
2732
  content: {
2361
- /** @enum {string} */
2362
- kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
2363
- /** @enum {string} */
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
+ */
2364
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. */
2365
2739
  scopePath: string;
2740
+ /** @description What the problem is, in one or two sentences. */
2366
2741
  issue: string;
2742
+ /** @description What to do to fix the issue. */
2367
2743
  suggestedFix: string;
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
+ */
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. */
2750
+ claimKey: string;
2751
+ /** @description The conflicting positions, at least two. To resolve the conflict, pass the index of one side as `resolution`. */
2752
+ sides: {
2753
+ /** @description The position as a self-contained sentence. This is the option you choose from. */
2754
+ claim: string;
2755
+ /** @description The disputed value on its own, such as `10,000/month`, without the sentence. */
2756
+ value?: string;
2757
+ /** @description Paths of the entries that state this position. */
2758
+ entryPaths?: string[];
2759
+ /** @description IDs of the sources that directly back this position. */
2760
+ sourceIds?: string[];
2761
+ /** @description Where in a source this position was read. */
2762
+ span?: {
2763
+ /** @description ID of the source the position was read from. */
2764
+ sourceId: string;
2765
+ /** @description First line of the range, counting from 1. Line numbers match `GET .../sources/{sourceId}/content`. */
2766
+ lineStart: number;
2767
+ /** @description Last line of the range, inclusive. */
2768
+ lineEnd: number;
2769
+ };
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
+ */
2774
+ authority?: 'primary' | 'secondary' | 'community';
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. */
2777
+ suggested?: number;
2778
+ } | {
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
+ */
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. */
2785
+ scopePath: string;
2786
+ /** @description What the problem is, in one or two sentences. */
2787
+ issue: string;
2788
+ /** @description What to do to fix the issue. */
2789
+ suggestedFix: string;
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
+ */
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. */
2368
2796
  citedSourceIds?: string[];
2797
+ /** @description A key naming the specific finding, when the check that found it sets one. */
2369
2798
  claimKey?: string;
2799
+ /** @description Paths of the entries the issue involves, when it spans more than one entry. */
2370
2800
  involvedScopes?: string[];
2371
- currentClaim?: string;
2372
- alternativeClaim?: string;
2373
- /** @enum {string} */
2374
- currentAuthority?: 'primary' | 'secondary' | 'community';
2375
- /** @enum {string} */
2376
- alternativeAuthority?: 'primary' | 'secondary' | 'community';
2377
- /** @enum {string} */
2378
- suggestedResolution?: 'keep_existing' | 'accept_new';
2379
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. */
2380
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. */
2381
2805
  revisionId: string | null;
2382
- /** @enum {string} */
2806
+ /**
2807
+ * @description The issue status. `accepted` means the issue was resolved or its fix applied.
2808
+ * @enum {string}
2809
+ */
2383
2810
  status: 'accepted';
2384
- /** Format: date-time */
2811
+ /**
2812
+ * Format: date-time
2813
+ * @description When the issue left `open`, as an ISO 8601 timestamp.
2814
+ */
2385
2815
  resolvedAt: string;
2816
+ /** @description Who triaged the issue. `null` while the issue is open, or when the caller could not be identified. */
2386
2817
  resolvedBy: {
2818
+ /** @description The ID of the Sanity user or robot token that triaged the issue. */
2387
2819
  id: string;
2388
- /** @enum {string} */
2820
+ /**
2821
+ * @description What triaged the issue. `user` is a person, and `robot` is a robot token.
2822
+ * @enum {string}
2823
+ */
2389
2824
  kind: 'user' | 'robot';
2390
2825
  } | null;
2391
- /** @enum {string|null} */
2392
- resolution: 'keep_existing' | 'accept_new' | 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. */
2827
+ resolution: number | null;
2393
2828
  } | {
2829
+ /** @description The document ID. */
2394
2830
  _id: string;
2831
+ /** @description The document revision. It changes on every write. */
2395
2832
  _rev: string;
2396
- /** Format: date-time */
2833
+ /**
2834
+ * Format: date-time
2835
+ * @description When the document was created, as an ISO 8601 timestamp.
2836
+ */
2397
2837
  _createdAt: string;
2398
- /** Format: date-time */
2838
+ /**
2839
+ * Format: date-time
2840
+ * @description When the document was last changed, as an ISO 8601 timestamp.
2841
+ */
2399
2842
  _updatedAt: string;
2843
+ /** @description The ID (`kb…`) of the knowledge base this document belongs to. */
2400
2844
  knowledgeBaseId: string;
2401
- /** @enum {string} */
2845
+ /**
2846
+ * @description The document type. Always `sanity.context.issue`.
2847
+ * @enum {string}
2848
+ */
2402
2849
  _type: 'sanity.context.issue';
2403
- /** @enum {number} */
2850
+ /**
2851
+ * @description The version of the document shape. Currently `1`.
2852
+ * @enum {number}
2853
+ */
2404
2854
  schemaVersion: 1;
2405
- /** @description IssueContent */
2855
+ /** @description What an issue found. The shape depends on `kind`. */
2406
2856
  content: {
2407
- /** @enum {string} */
2408
- kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
2409
- /** @enum {string} */
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
+ */
2410
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. */
2411
2863
  scopePath: string;
2864
+ /** @description What the problem is, in one or two sentences. */
2412
2865
  issue: string;
2866
+ /** @description What to do to fix the issue. */
2413
2867
  suggestedFix: string;
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
+ */
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. */
2874
+ claimKey: string;
2875
+ /** @description The conflicting positions, at least two. To resolve the conflict, pass the index of one side as `resolution`. */
2876
+ sides: {
2877
+ /** @description The position as a self-contained sentence. This is the option you choose from. */
2878
+ claim: string;
2879
+ /** @description The disputed value on its own, such as `10,000/month`, without the sentence. */
2880
+ value?: string;
2881
+ /** @description Paths of the entries that state this position. */
2882
+ entryPaths?: string[];
2883
+ /** @description IDs of the sources that directly back this position. */
2884
+ sourceIds?: string[];
2885
+ /** @description Where in a source this position was read. */
2886
+ span?: {
2887
+ /** @description ID of the source the position was read from. */
2888
+ sourceId: string;
2889
+ /** @description First line of the range, counting from 1. Line numbers match `GET .../sources/{sourceId}/content`. */
2890
+ lineStart: number;
2891
+ /** @description Last line of the range, inclusive. */
2892
+ lineEnd: number;
2893
+ };
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
+ */
2898
+ authority?: 'primary' | 'secondary' | 'community';
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. */
2901
+ suggested?: number;
2902
+ } | {
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
+ */
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. */
2909
+ scopePath: string;
2910
+ /** @description What the problem is, in one or two sentences. */
2911
+ issue: string;
2912
+ /** @description What to do to fix the issue. */
2913
+ suggestedFix: string;
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
+ */
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. */
2414
2920
  citedSourceIds?: string[];
2921
+ /** @description A key naming the specific finding, when the check that found it sets one. */
2415
2922
  claimKey?: string;
2923
+ /** @description Paths of the entries the issue involves, when it spans more than one entry. */
2416
2924
  involvedScopes?: string[];
2417
- currentClaim?: string;
2418
- alternativeClaim?: string;
2419
- /** @enum {string} */
2420
- currentAuthority?: 'primary' | 'secondary' | 'community';
2421
- /** @enum {string} */
2422
- alternativeAuthority?: 'primary' | 'secondary' | 'community';
2423
- /** @enum {string} */
2424
- suggestedResolution?: 'keep_existing' | 'accept_new';
2425
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. */
2426
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. */
2427
2929
  revisionId: string | null;
2428
- /** @enum {string} */
2930
+ /**
2931
+ * @description The issue status. `rejected` means the issue was dismissed. Dismissal is final.
2932
+ * @enum {string}
2933
+ */
2429
2934
  status: 'rejected';
2430
- /** Format: date-time */
2935
+ /**
2936
+ * Format: date-time
2937
+ * @description When the issue left `open`, as an ISO 8601 timestamp.
2938
+ */
2431
2939
  resolvedAt: string;
2940
+ /** @description Who triaged the issue. `null` while the issue is open, or when the caller could not be identified. */
2432
2941
  resolvedBy: {
2942
+ /** @description The ID of the Sanity user or robot token that triaged the issue. */
2433
2943
  id: string;
2434
- /** @enum {string} */
2944
+ /**
2945
+ * @description What triaged the issue. `user` is a person, and `robot` is a robot token.
2946
+ * @enum {string}
2947
+ */
2435
2948
  kind: 'user' | 'robot';
2436
2949
  } | null;
2437
- /** @enum {string|null} */
2950
+ /**
2951
+ * @description Always `null`, because a dismissal chooses no side.
2952
+ * @enum {string|null}
2953
+ */
2438
2954
  resolution: null;
2439
2955
  };
2440
- /** @description A `sanity.context.mcp` document, an org-owned MCP endpoint configuration stored in the organization store. Not returned by any endpoint raw; published so GROQ reads and trigger filters can be typed. Write through the mcp endpoints, never with a raw client. The mcp endpoints serve the validated wire view. */
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. */
2441
2957
  McpDoc: {
2958
+ /** @description The document ID. */
2442
2959
  _id: string;
2960
+ /** @description The document revision. It changes on every write. */
2443
2961
  _rev: string;
2444
- /** Format: date-time */
2962
+ /**
2963
+ * Format: date-time
2964
+ * @description When the document was created, as an ISO 8601 timestamp.
2965
+ */
2445
2966
  _createdAt: string;
2446
- /** Format: date-time */
2967
+ /**
2968
+ * Format: date-time
2969
+ * @description When the document was last changed, as an ISO 8601 timestamp.
2970
+ */
2447
2971
  _updatedAt: string;
2448
- /** @enum {string} */
2972
+ /**
2973
+ * @description The document type. Always `sanity.context.mcp`.
2974
+ * @enum {string}
2975
+ */
2449
2976
  _type: 'sanity.context.mcp';
2450
- /** @enum {number} */
2977
+ /**
2978
+ * @description The version of the document shape. Currently `1`.
2979
+ * @enum {number}
2980
+ */
2451
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. */
2452
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`. */
2453
2985
  publicId: string;
2986
+ /** @description The MCP endpoint's display name. You can change it at any time. */
2454
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. */
2455
2989
  name: string;
2990
+ /** @description The content sources the MCP endpoint serves. Each source appears once, and the order has no meaning. */
2456
2991
  sources: ({
2457
- /** @enum {string} */
2992
+ /**
2993
+ * @description The source type. `knowledge-base` serves a whole knowledge base.
2994
+ * @enum {string}
2995
+ */
2458
2996
  type: 'knowledge-base';
2997
+ /** @description The knowledge base ID (`kb…`). */
2459
2998
  id: string;
2460
2999
  } | {
2461
- /** @enum {string} */
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
+ */
2462
3004
  type: 'dataset';
3005
+ /** @description The dataset, as `<projectId>.<datasetName>`. */
2463
3006
  id: string;
2464
3007
  })[];
3008
+ /** @description Prompt text the MCP endpoint serves to connecting agents. `null` when unset. */
2465
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. */
2466
3011
  groqFilter: string | null;
2467
3012
  };
2468
3013
  };
@@ -2476,8 +3021,11 @@ interface operations {
2476
3021
  listKnowledgeBases: {
2477
3022
  parameters: {
2478
3023
  query: {
3024
+ /** @description The `nextCursor` value from the previous page. Omit it to get the first page. */
2479
3025
  cursor?: string;
3026
+ /** @description The maximum number of items to return. */
2480
3027
  limit?: number;
3028
+ /** @description The organization to list knowledge bases for. */
2481
3029
  organizationId: string;
2482
3030
  };
2483
3031
  header?: never;
@@ -2488,79 +3036,155 @@ interface operations {
2488
3036
  };
2489
3037
  requestBody?: never;
2490
3038
  responses: {
2491
- /** @description Default Response */
3039
+ /** @description A page of knowledge bases. */
2492
3040
  200: {
2493
3041
  headers: {
2494
3042
  [name: string]: unknown;
2495
3043
  };
2496
3044
  content: {
2497
3045
  'application/json': {
3046
+ /** @description The items on this page. */
2498
3047
  data: {
2499
- /** Format: uuid */
3048
+ /**
3049
+ * Format: uuid
3050
+ * @description The knowledge base's unique ID, a UUID. Accepted anywhere a `knowledgeBaseId` is expected.
3051
+ */
2500
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. */
2501
3054
  publicId: string;
3055
+ /** @description The ID of the organization that owns the knowledge base. */
2502
3056
  organizationId: string;
3057
+ /** @description The knowledge base's title. */
2503
3058
  title: string;
3059
+ /** @description A short description of what the knowledge base covers. */
2504
3060
  description: string;
2505
- /** @enum {string} */
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
+ */
2506
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}`. */
2507
3067
  activeJobId: string | null;
3068
+ /** @description Whether a build is running now. */
2508
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`. */
2509
3071
  buildStageState: {
3072
+ /** @description The ID of the build job this progress belongs to. */
2510
3073
  jobId: string;
3074
+ /** @description The build's stages and their progress. Stages that haven't reported yet can be missing. */
2511
3075
  stages: {
2512
- /** @enum {string} */
3076
+ /**
3077
+ * @description The stage's ID. The values are listed in the order stages run.
3078
+ * @enum {string}
3079
+ */
2513
3080
  id: 'tldr' | 'map' | 'triage' | 'plan' | 'organize' | 'arrange' | 'write' | 'review' | 'polish';
2514
- /** @enum {string} */
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
+ */
2515
3085
  status: 'pending' | 'running' | 'done' | 'failed';
3086
+ /** @description The stage's progress counts. Absent when the stage hasn't reported counts. */
2516
3087
  units?: {
2517
- /** @enum {string} */
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
+ */
2518
3092
  unit: 'sources' | 'groups' | 'entries' | 'rounds';
3093
+ /** @description How many units the stage has finished. */
2519
3094
  done: number;
3095
+ /** @description How many units the stage will process. Absent when `unit` is `rounds`. */
2520
3096
  total?: number;
2521
3097
  };
2522
3098
  }[];
2523
3099
  } | null;
2524
- /** Format: date-time */
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
+ */
2525
3104
  lastCheckedAt: string | null;
2526
- /** Format: date-time */
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
+ */
2527
3109
  lastChangedAt: string | null;
3110
+ /** @description Whether sources were added, changed, or removed since the last successful build. Always `false` before the first build. */
2528
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. */
2529
3113
  pendingChanges: {
3114
+ /** @description Sources added since the last successful build, including sources no successful build has included yet. */
2530
3115
  added: number;
3116
+ /** @description Sources whose content changed since the last successful build. */
2531
3117
  changed: number;
3118
+ /** @description Sources that recent refreshes no longer find. */
2532
3119
  removed: number;
2533
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. */
2534
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. */
2535
3124
  rebuildRecommended: {
3125
+ /** @description Why a rebuild is recommended, written to show to users. */
2536
3126
  reason: string;
2537
- /** Format: date-time */
3127
+ /**
3128
+ * Format: date-time
3129
+ * @description When the recommendation was made.
3130
+ */
2538
3131
  at: string;
2539
3132
  } | null;
3133
+ /** @description Whether the knowledge base has at least one website source. */
2540
3134
  hasWebSource: boolean;
3135
+ /** @description Whether the knowledge base has at least one Sanity dataset source. */
2541
3136
  hasDatasetSource: boolean;
3137
+ /** @description How many sources the knowledge base uses, and its source limit. */
2542
3138
  sourceUsage: {
3139
+ /** @description The number of sources counted toward the limit, including parts split from large sources. */
2543
3140
  used: number;
3141
+ /** @description The maximum number of sources the knowledge base can have. */
2544
3142
  limit: number;
2545
3143
  } | null;
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`. */
3145
+ buildRestriction: {
3146
+ /** @description A stable code for the restriction, such as `planLimitReached`. */
3147
+ code: string;
3148
+ /** @description A readable explanation that you can show to users. */
3149
+ message: string;
3150
+ } | null;
3151
+ /** @description Whether scheduled refresh is on. Only applies to knowledge bases with a website or dataset source. */
2546
3152
  refreshEnabled: boolean;
2547
- /** @enum {string} */
3153
+ /**
3154
+ * @description How often scheduled refresh runs: `weekly` (the default) or `monthly`.
3155
+ * @enum {string}
3156
+ */
2548
3157
  refreshFrequency: 'weekly' | 'monthly';
2549
- /** Format: date-time */
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
+ */
2550
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`. */
2551
3164
  refreshInFlight: boolean;
3165
+ /** @description The number of open issues waiting for review. Always `0` before the first build. */
2552
3166
  openIssueCount: number;
3167
+ /** @description The number of active instructions for the knowledge base. */
2553
3168
  instructionCount: number;
2554
- /** @description Actor */
3169
+ /** @description Who created the knowledge base. `null` if unknown. */
2555
3170
  createdBy: {
3171
+ /** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
2556
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`. */
2557
3174
  displayName: string | null;
2558
3175
  } | null;
2559
- /** Format: date-time */
3176
+ /**
3177
+ * Format: date-time
3178
+ * @description When the knowledge base was created.
3179
+ */
2560
3180
  createdAt: string;
2561
- /** Format: date-time */
3181
+ /**
3182
+ * Format: date-time
3183
+ * @description When the knowledge base was last updated.
3184
+ */
2562
3185
  updatedAt: string;
2563
3186
  }[];
3187
+ /** @description The cursor for the next page. Pass it as `cursor` to get more results. `null` when there are no more pages. */
2564
3188
  nextCursor: string | null;
2565
3189
  };
2566
3190
  };
@@ -2579,83 +3203,160 @@ interface operations {
2579
3203
  requestBody: {
2580
3204
  content: {
2581
3205
  'application/json': {
3206
+ /** @description The ID of the organization to create the knowledge base in. */
2582
3207
  organizationId: string;
3208
+ /** @description The knowledge base's title. */
2583
3209
  title: string;
3210
+ /** @description A short description of what the knowledge base covers. */
2584
3211
  description: string;
2585
3212
  };
2586
3213
  };
2587
3214
  };
2588
3215
  responses: {
2589
- /** @description KnowledgeBase */
3216
+ /** @description A knowledge base and its current state. */
2590
3217
  201: {
2591
3218
  headers: {
2592
3219
  [name: string]: unknown;
2593
3220
  };
2594
3221
  content: {
2595
3222
  'application/json': {
2596
- /** Format: uuid */
3223
+ /**
3224
+ * Format: uuid
3225
+ * @description The knowledge base's unique ID, a UUID. Accepted anywhere a `knowledgeBaseId` is expected.
3226
+ */
2597
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. */
2598
3229
  publicId: string;
3230
+ /** @description The ID of the organization that owns the knowledge base. */
2599
3231
  organizationId: string;
3232
+ /** @description The knowledge base's title. */
2600
3233
  title: string;
3234
+ /** @description A short description of what the knowledge base covers. */
2601
3235
  description: string;
2602
- /** @enum {string} */
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
+ */
2603
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}`. */
2604
3242
  activeJobId: string | null;
3243
+ /** @description Whether a build is running now. */
2605
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`. */
2606
3246
  buildStageState: {
3247
+ /** @description The ID of the build job this progress belongs to. */
2607
3248
  jobId: string;
3249
+ /** @description The build's stages and their progress. Stages that haven't reported yet can be missing. */
2608
3250
  stages: {
2609
- /** @enum {string} */
3251
+ /**
3252
+ * @description The stage's ID. The values are listed in the order stages run.
3253
+ * @enum {string}
3254
+ */
2610
3255
  id: 'tldr' | 'map' | 'triage' | 'plan' | 'organize' | 'arrange' | 'write' | 'review' | 'polish';
2611
- /** @enum {string} */
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
+ */
2612
3260
  status: 'pending' | 'running' | 'done' | 'failed';
3261
+ /** @description The stage's progress counts. Absent when the stage hasn't reported counts. */
2613
3262
  units?: {
2614
- /** @enum {string} */
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
+ */
2615
3267
  unit: 'sources' | 'groups' | 'entries' | 'rounds';
3268
+ /** @description How many units the stage has finished. */
2616
3269
  done: number;
3270
+ /** @description How many units the stage will process. Absent when `unit` is `rounds`. */
2617
3271
  total?: number;
2618
3272
  };
2619
3273
  }[];
2620
3274
  } | null;
2621
- /** Format: date-time */
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
+ */
2622
3279
  lastCheckedAt: string | null;
2623
- /** Format: date-time */
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
+ */
2624
3284
  lastChangedAt: string | null;
3285
+ /** @description Whether sources were added, changed, or removed since the last successful build. Always `false` before the first build. */
2625
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. */
2626
3288
  pendingChanges: {
3289
+ /** @description Sources added since the last successful build, including sources no successful build has included yet. */
2627
3290
  added: number;
3291
+ /** @description Sources whose content changed since the last successful build. */
2628
3292
  changed: number;
3293
+ /** @description Sources that recent refreshes no longer find. */
2629
3294
  removed: number;
2630
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. */
2631
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. */
2632
3299
  rebuildRecommended: {
3300
+ /** @description Why a rebuild is recommended, written to show to users. */
2633
3301
  reason: string;
2634
- /** Format: date-time */
3302
+ /**
3303
+ * Format: date-time
3304
+ * @description When the recommendation was made.
3305
+ */
2635
3306
  at: string;
2636
3307
  } | null;
3308
+ /** @description Whether the knowledge base has at least one website source. */
2637
3309
  hasWebSource: boolean;
3310
+ /** @description Whether the knowledge base has at least one Sanity dataset source. */
2638
3311
  hasDatasetSource: boolean;
3312
+ /** @description How many sources the knowledge base uses, and its source limit. */
2639
3313
  sourceUsage: {
3314
+ /** @description The number of sources counted toward the limit, including parts split from large sources. */
2640
3315
  used: number;
3316
+ /** @description The maximum number of sources the knowledge base can have. */
2641
3317
  limit: number;
2642
3318
  } | null;
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`. */
3320
+ buildRestriction: {
3321
+ /** @description A stable code for the restriction, such as `planLimitReached`. */
3322
+ code: string;
3323
+ /** @description A readable explanation that you can show to users. */
3324
+ message: string;
3325
+ } | null;
3326
+ /** @description Whether scheduled refresh is on. Only applies to knowledge bases with a website or dataset source. */
2643
3327
  refreshEnabled: boolean;
2644
- /** @enum {string} */
3328
+ /**
3329
+ * @description How often scheduled refresh runs: `weekly` (the default) or `monthly`.
3330
+ * @enum {string}
3331
+ */
2645
3332
  refreshFrequency: 'weekly' | 'monthly';
2646
- /** Format: date-time */
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
+ */
2647
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`. */
2648
3339
  refreshInFlight: boolean;
3340
+ /** @description The number of open issues waiting for review. Always `0` before the first build. */
2649
3341
  openIssueCount: number;
3342
+ /** @description The number of active instructions for the knowledge base. */
2650
3343
  instructionCount: number;
2651
- /** @description Actor */
3344
+ /** @description Who created the knowledge base. `null` if unknown. */
2652
3345
  createdBy: {
3346
+ /** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
2653
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`. */
2654
3349
  displayName: string | null;
2655
3350
  } | null;
2656
- /** Format: date-time */
3351
+ /**
3352
+ * Format: date-time
3353
+ * @description When the knowledge base was created.
3354
+ */
2657
3355
  createdAt: string;
2658
- /** Format: date-time */
3356
+ /**
3357
+ * Format: date-time
3358
+ * @description When the knowledge base was last updated.
3359
+ */
2659
3360
  updatedAt: string;
2660
3361
  };
2661
3362
  };
@@ -2667,82 +3368,157 @@ interface operations {
2667
3368
  query?: never;
2668
3369
  header?: never;
2669
3370
  path: {
3371
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
2670
3372
  knowledgeBaseId: string;
2671
3373
  };
2672
3374
  cookie?: never;
2673
3375
  };
2674
3376
  requestBody?: never;
2675
3377
  responses: {
2676
- /** @description KnowledgeBase */
3378
+ /** @description A knowledge base and its current state. */
2677
3379
  200: {
2678
3380
  headers: {
2679
3381
  [name: string]: unknown;
2680
3382
  };
2681
3383
  content: {
2682
3384
  'application/json': {
2683
- /** Format: uuid */
3385
+ /**
3386
+ * Format: uuid
3387
+ * @description The knowledge base's unique ID, a UUID. Accepted anywhere a `knowledgeBaseId` is expected.
3388
+ */
2684
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. */
2685
3391
  publicId: string;
3392
+ /** @description The ID of the organization that owns the knowledge base. */
2686
3393
  organizationId: string;
3394
+ /** @description The knowledge base's title. */
2687
3395
  title: string;
3396
+ /** @description A short description of what the knowledge base covers. */
2688
3397
  description: string;
2689
- /** @enum {string} */
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
+ */
2690
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}`. */
2691
3404
  activeJobId: string | null;
3405
+ /** @description Whether a build is running now. */
2692
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`. */
2693
3408
  buildStageState: {
3409
+ /** @description The ID of the build job this progress belongs to. */
2694
3410
  jobId: string;
3411
+ /** @description The build's stages and their progress. Stages that haven't reported yet can be missing. */
2695
3412
  stages: {
2696
- /** @enum {string} */
3413
+ /**
3414
+ * @description The stage's ID. The values are listed in the order stages run.
3415
+ * @enum {string}
3416
+ */
2697
3417
  id: 'tldr' | 'map' | 'triage' | 'plan' | 'organize' | 'arrange' | 'write' | 'review' | 'polish';
2698
- /** @enum {string} */
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
+ */
2699
3422
  status: 'pending' | 'running' | 'done' | 'failed';
3423
+ /** @description The stage's progress counts. Absent when the stage hasn't reported counts. */
2700
3424
  units?: {
2701
- /** @enum {string} */
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
+ */
2702
3429
  unit: 'sources' | 'groups' | 'entries' | 'rounds';
3430
+ /** @description How many units the stage has finished. */
2703
3431
  done: number;
3432
+ /** @description How many units the stage will process. Absent when `unit` is `rounds`. */
2704
3433
  total?: number;
2705
3434
  };
2706
3435
  }[];
2707
3436
  } | null;
2708
- /** Format: date-time */
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
+ */
2709
3441
  lastCheckedAt: string | null;
2710
- /** Format: date-time */
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
+ */
2711
3446
  lastChangedAt: string | null;
3447
+ /** @description Whether sources were added, changed, or removed since the last successful build. Always `false` before the first build. */
2712
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. */
2713
3450
  pendingChanges: {
3451
+ /** @description Sources added since the last successful build, including sources no successful build has included yet. */
2714
3452
  added: number;
3453
+ /** @description Sources whose content changed since the last successful build. */
2715
3454
  changed: number;
3455
+ /** @description Sources that recent refreshes no longer find. */
2716
3456
  removed: number;
2717
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. */
2718
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. */
2719
3461
  rebuildRecommended: {
3462
+ /** @description Why a rebuild is recommended, written to show to users. */
2720
3463
  reason: string;
2721
- /** Format: date-time */
3464
+ /**
3465
+ * Format: date-time
3466
+ * @description When the recommendation was made.
3467
+ */
2722
3468
  at: string;
2723
3469
  } | null;
3470
+ /** @description Whether the knowledge base has at least one website source. */
2724
3471
  hasWebSource: boolean;
3472
+ /** @description Whether the knowledge base has at least one Sanity dataset source. */
2725
3473
  hasDatasetSource: boolean;
3474
+ /** @description How many sources the knowledge base uses, and its source limit. */
2726
3475
  sourceUsage: {
3476
+ /** @description The number of sources counted toward the limit, including parts split from large sources. */
2727
3477
  used: number;
3478
+ /** @description The maximum number of sources the knowledge base can have. */
2728
3479
  limit: number;
2729
3480
  } | null;
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`. */
3482
+ buildRestriction: {
3483
+ /** @description A stable code for the restriction, such as `planLimitReached`. */
3484
+ code: string;
3485
+ /** @description A readable explanation that you can show to users. */
3486
+ message: string;
3487
+ } | null;
3488
+ /** @description Whether scheduled refresh is on. Only applies to knowledge bases with a website or dataset source. */
2730
3489
  refreshEnabled: boolean;
2731
- /** @enum {string} */
3490
+ /**
3491
+ * @description How often scheduled refresh runs: `weekly` (the default) or `monthly`.
3492
+ * @enum {string}
3493
+ */
2732
3494
  refreshFrequency: 'weekly' | 'monthly';
2733
- /** Format: date-time */
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
+ */
2734
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`. */
2735
3501
  refreshInFlight: boolean;
3502
+ /** @description The number of open issues waiting for review. Always `0` before the first build. */
2736
3503
  openIssueCount: number;
3504
+ /** @description The number of active instructions for the knowledge base. */
2737
3505
  instructionCount: number;
2738
- /** @description Actor */
3506
+ /** @description Who created the knowledge base. `null` if unknown. */
2739
3507
  createdBy: {
3508
+ /** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
2740
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`. */
2741
3511
  displayName: string | null;
2742
3512
  } | null;
2743
- /** Format: date-time */
3513
+ /**
3514
+ * Format: date-time
3515
+ * @description When the knowledge base was created.
3516
+ */
2744
3517
  createdAt: string;
2745
- /** Format: date-time */
3518
+ /**
3519
+ * Format: date-time
3520
+ * @description When the knowledge base was last updated.
3521
+ */
2746
3522
  updatedAt: string;
2747
3523
  };
2748
3524
  };
@@ -2754,13 +3530,14 @@ interface operations {
2754
3530
  query?: never;
2755
3531
  header?: never;
2756
3532
  path: {
3533
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
2757
3534
  knowledgeBaseId: string;
2758
3535
  };
2759
3536
  cookie?: never;
2760
3537
  };
2761
3538
  requestBody?: never;
2762
3539
  responses: {
2763
- /** @description Default Response */
3540
+ /** @description The knowledge base was deleted. */
2764
3541
  204: {
2765
3542
  headers: {
2766
3543
  [name: string]: unknown;
@@ -2776,6 +3553,7 @@ interface operations {
2776
3553
  query?: never;
2777
3554
  header?: never;
2778
3555
  path: {
3556
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
2779
3557
  knowledgeBaseId: string;
2780
3558
  };
2781
3559
  cookie?: never;
@@ -2783,85 +3561,165 @@ interface operations {
2783
3561
  requestBody: {
2784
3562
  content: {
2785
3563
  'application/json': {
3564
+ /** @description The knowledge base's new title. */
2786
3565
  title?: string;
3566
+ /** @description The knowledge base's new description. */
2787
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. */
2788
3569
  refreshEnabled?: boolean;
2789
- /** @enum {string} */
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
+ */
2790
3574
  refreshFrequency?: 'weekly' | 'monthly';
2791
3575
  };
2792
3576
  };
2793
3577
  };
2794
3578
  responses: {
2795
- /** @description KnowledgeBase */
3579
+ /** @description A knowledge base and its current state. */
2796
3580
  200: {
2797
3581
  headers: {
2798
3582
  [name: string]: unknown;
2799
3583
  };
2800
3584
  content: {
2801
3585
  'application/json': {
2802
- /** Format: uuid */
3586
+ /**
3587
+ * Format: uuid
3588
+ * @description The knowledge base's unique ID, a UUID. Accepted anywhere a `knowledgeBaseId` is expected.
3589
+ */
2803
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. */
2804
3592
  publicId: string;
3593
+ /** @description The ID of the organization that owns the knowledge base. */
2805
3594
  organizationId: string;
3595
+ /** @description The knowledge base's title. */
2806
3596
  title: string;
3597
+ /** @description A short description of what the knowledge base covers. */
2807
3598
  description: string;
2808
- /** @enum {string} */
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
+ */
2809
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}`. */
2810
3605
  activeJobId: string | null;
3606
+ /** @description Whether a build is running now. */
2811
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`. */
2812
3609
  buildStageState: {
3610
+ /** @description The ID of the build job this progress belongs to. */
2813
3611
  jobId: string;
3612
+ /** @description The build's stages and their progress. Stages that haven't reported yet can be missing. */
2814
3613
  stages: {
2815
- /** @enum {string} */
3614
+ /**
3615
+ * @description The stage's ID. The values are listed in the order stages run.
3616
+ * @enum {string}
3617
+ */
2816
3618
  id: 'tldr' | 'map' | 'triage' | 'plan' | 'organize' | 'arrange' | 'write' | 'review' | 'polish';
2817
- /** @enum {string} */
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
+ */
2818
3623
  status: 'pending' | 'running' | 'done' | 'failed';
3624
+ /** @description The stage's progress counts. Absent when the stage hasn't reported counts. */
2819
3625
  units?: {
2820
- /** @enum {string} */
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
+ */
2821
3630
  unit: 'sources' | 'groups' | 'entries' | 'rounds';
3631
+ /** @description How many units the stage has finished. */
2822
3632
  done: number;
3633
+ /** @description How many units the stage will process. Absent when `unit` is `rounds`. */
2823
3634
  total?: number;
2824
3635
  };
2825
3636
  }[];
2826
3637
  } | null;
2827
- /** Format: date-time */
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
+ */
2828
3642
  lastCheckedAt: string | null;
2829
- /** Format: date-time */
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
+ */
2830
3647
  lastChangedAt: string | null;
3648
+ /** @description Whether sources were added, changed, or removed since the last successful build. Always `false` before the first build. */
2831
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. */
2832
3651
  pendingChanges: {
3652
+ /** @description Sources added since the last successful build, including sources no successful build has included yet. */
2833
3653
  added: number;
3654
+ /** @description Sources whose content changed since the last successful build. */
2834
3655
  changed: number;
3656
+ /** @description Sources that recent refreshes no longer find. */
2835
3657
  removed: number;
2836
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. */
2837
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. */
2838
3662
  rebuildRecommended: {
3663
+ /** @description Why a rebuild is recommended, written to show to users. */
2839
3664
  reason: string;
2840
- /** Format: date-time */
3665
+ /**
3666
+ * Format: date-time
3667
+ * @description When the recommendation was made.
3668
+ */
2841
3669
  at: string;
2842
3670
  } | null;
3671
+ /** @description Whether the knowledge base has at least one website source. */
2843
3672
  hasWebSource: boolean;
3673
+ /** @description Whether the knowledge base has at least one Sanity dataset source. */
2844
3674
  hasDatasetSource: boolean;
3675
+ /** @description How many sources the knowledge base uses, and its source limit. */
2845
3676
  sourceUsage: {
3677
+ /** @description The number of sources counted toward the limit, including parts split from large sources. */
2846
3678
  used: number;
3679
+ /** @description The maximum number of sources the knowledge base can have. */
2847
3680
  limit: number;
2848
3681
  } | null;
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`. */
3683
+ buildRestriction: {
3684
+ /** @description A stable code for the restriction, such as `planLimitReached`. */
3685
+ code: string;
3686
+ /** @description A readable explanation that you can show to users. */
3687
+ message: string;
3688
+ } | null;
3689
+ /** @description Whether scheduled refresh is on. Only applies to knowledge bases with a website or dataset source. */
2849
3690
  refreshEnabled: boolean;
2850
- /** @enum {string} */
3691
+ /**
3692
+ * @description How often scheduled refresh runs: `weekly` (the default) or `monthly`.
3693
+ * @enum {string}
3694
+ */
2851
3695
  refreshFrequency: 'weekly' | 'monthly';
2852
- /** Format: date-time */
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
+ */
2853
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`. */
2854
3702
  refreshInFlight: boolean;
3703
+ /** @description The number of open issues waiting for review. Always `0` before the first build. */
2855
3704
  openIssueCount: number;
3705
+ /** @description The number of active instructions for the knowledge base. */
2856
3706
  instructionCount: number;
2857
- /** @description Actor */
3707
+ /** @description Who created the knowledge base. `null` if unknown. */
2858
3708
  createdBy: {
3709
+ /** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
2859
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`. */
2860
3712
  displayName: string | null;
2861
3713
  } | null;
2862
- /** Format: date-time */
3714
+ /**
3715
+ * Format: date-time
3716
+ * @description When the knowledge base was created.
3717
+ */
2863
3718
  createdAt: string;
2864
- /** Format: date-time */
3719
+ /**
3720
+ * Format: date-time
3721
+ * @description When the knowledge base was last updated.
3722
+ */
2865
3723
  updatedAt: string;
2866
3724
  };
2867
3725
  };
@@ -2873,19 +3731,21 @@ interface operations {
2873
3731
  query?: never;
2874
3732
  header?: never;
2875
3733
  path: {
3734
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
2876
3735
  knowledgeBaseId: string;
2877
3736
  };
2878
3737
  cookie?: never;
2879
3738
  };
2880
3739
  requestBody?: never;
2881
3740
  responses: {
2882
- /** @description JobAccepted */
3741
+ /** @description A queued job that you can poll for progress. */
2883
3742
  202: {
2884
3743
  headers: {
2885
3744
  [name: string]: unknown;
2886
3745
  };
2887
3746
  content: {
2888
3747
  'application/json': {
3748
+ /** @description The queued job's ID. Check its progress with `GET .../jobs/{jobId}`. */
2889
3749
  jobId: string;
2890
3750
  };
2891
3751
  };
@@ -2897,19 +3757,21 @@ interface operations {
2897
3757
  query?: never;
2898
3758
  header?: never;
2899
3759
  path: {
3760
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
2900
3761
  knowledgeBaseId: string;
2901
3762
  };
2902
3763
  cookie?: never;
2903
3764
  };
2904
3765
  requestBody?: never;
2905
3766
  responses: {
2906
- /** @description Default Response */
3767
+ /** @description The result of the cancel request. */
2907
3768
  200: {
2908
3769
  headers: {
2909
3770
  [name: string]: unknown;
2910
3771
  };
2911
3772
  content: {
2912
3773
  'application/json': {
3774
+ /** @description Whether a running build was cancelled. `false` when no build was running. */
2913
3775
  cancelled: boolean;
2914
3776
  };
2915
3777
  };
@@ -2921,24 +3783,31 @@ interface operations {
2921
3783
  query?: never;
2922
3784
  header?: never;
2923
3785
  path: {
3786
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
2924
3787
  knowledgeBaseId: string;
3788
+ /** @description The entry's slash-delimited path, such as `pricing/plans/free`, URL-encoded. */
2925
3789
  entryPath: string;
2926
3790
  };
2927
3791
  cookie?: never;
2928
3792
  };
2929
3793
  requestBody?: never;
2930
3794
  responses: {
2931
- /** @description RebuildEntryResponse */
3795
+ /** @description The job that rebuilds the entry, and the other entries that share its sources. */
2932
3796
  202: {
2933
3797
  headers: {
2934
3798
  [name: string]: unknown;
2935
3799
  };
2936
3800
  content: {
2937
3801
  'application/json': {
3802
+ /** @description ID of the job that rebuilds the entry. Poll it with `GET .../jobs/{jobId}`. */
2938
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. */
2939
3805
  affectedEntries: {
3806
+ /** @description The entry's document ID. */
2940
3807
  id: string;
3808
+ /** @description The entry's path, such as `products/api/webhooks`. */
2941
3809
  path: string;
3810
+ /** @description The entry's title. */
2942
3811
  title: string;
2943
3812
  }[];
2944
3813
  };
@@ -2949,68 +3818,110 @@ interface operations {
2949
3818
  listImports: {
2950
3819
  parameters: {
2951
3820
  query?: {
3821
+ /** @description The `nextCursor` value from the previous page. Omit it to get the first page. */
2952
3822
  cursor?: string;
3823
+ /** @description The maximum number of items to return. */
2953
3824
  limit?: number;
2954
3825
  };
2955
3826
  header?: never;
2956
3827
  path: {
3828
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
2957
3829
  knowledgeBaseId: string;
2958
3830
  };
2959
3831
  cookie?: never;
2960
3832
  };
2961
3833
  requestBody?: never;
2962
3834
  responses: {
2963
- /** @description Default Response */
3835
+ /** @description A page of imports. */
2964
3836
  200: {
2965
3837
  headers: {
2966
3838
  [name: string]: unknown;
2967
3839
  };
2968
3840
  content: {
2969
3841
  'application/json': {
3842
+ /** @description The items on this page. */
2970
3843
  data: {
2971
- /** Format: uuid */
3844
+ /**
3845
+ * Format: uuid
3846
+ * @description The import's ID.
3847
+ */
2972
3848
  id: string;
2973
- /** Format: uuid */
3849
+ /**
3850
+ * Format: uuid
3851
+ * @description The `id` of the knowledge base that the import belongs to.
3852
+ */
2974
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. */
2975
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. */
2976
3857
  sizeBytes: number | null;
2977
- /** @enum {string} */
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
+ */
2978
3862
  status: 'uploading' | 'processing' | 'complete' | 'failed';
2979
- /** @enum {string} */
3863
+ /**
3864
+ * @description The kind of sources the import produces. `file`: uploads and inline text. `web`: crawls. `dataset`: Sanity datasets.
3865
+ * @enum {string}
3866
+ */
2980
3867
  sourceKind: 'web' | 'file' | 'dataset';
2981
- /** Format: date-time */
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
+ */
2982
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. */
2983
3874
  sourceCount: number;
3875
+ /** @description The number of sources expected to be distilled, including parts split from large sources. Excludes skipped sources. */
2984
3876
  totalDistillableCount: number;
3877
+ /** @description The number of sources distilled so far. Compare it with `totalDistillableCount` to show progress. */
2985
3878
  distilledCount: number;
3879
+ /** @description The number of sources skipped because their file type isn't supported, such as images. */
2986
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`. */
2987
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. */
2988
3884
  error: string | null;
2989
- /** @description CrawlOptions */
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. */
2990
3886
  crawlOptions: {
3887
+ /** @description Regular expressions for URL paths to crawl. When set, the crawl only includes pages whose path matches one of them. */
2991
3888
  includePaths?: string[];
3889
+ /** @description Regular expressions for URL paths to skip. Pages whose path matches one of them aren't crawled. */
2992
3890
  excludePaths?: string[];
3891
+ /** @description How many levels deep the crawl goes from the root URL. */
2993
3892
  maxDepth?: number;
3893
+ /** @description Whether to crawl only the pages listed in the site's sitemap. */
2994
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. */
2995
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. */
2996
3898
  pageLimit?: number;
2997
3899
  } | null;
2998
- /** @description DatasetSourceBinding */
3900
+ /** @description The Sanity project, dataset, and full query a dataset import reads from. `null` for other import types. */
2999
3901
  datasetSource: {
3902
+ /** @description The ID of the Sanity project the documents come from. */
3000
3903
  sanityProjectId: string;
3904
+ /** @description The dataset the documents come from. */
3001
3905
  sanityDatasetId: string;
3906
+ /** @description The full GROQ query that selects the documents, exactly as saved. */
3002
3907
  query: string;
3003
3908
  } | null;
3004
- /** @description Actor */
3909
+ /** @description Who added the import. `null` if unknown. */
3005
3910
  createdBy: {
3911
+ /** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
3006
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`. */
3007
3914
  displayName: string | null;
3008
3915
  } | null;
3009
- /** Format: date-time */
3916
+ /**
3917
+ * Format: date-time
3918
+ * @description When the import was created.
3919
+ */
3010
3920
  createdAt: string;
3011
3921
  /** Format: date-time */
3012
3922
  completedAt: string | null;
3013
3923
  }[];
3924
+ /** @description The cursor for the next page. Pass it as `cursor` to get more results. `null` when there are no more pages. */
3014
3925
  nextCursor: string | null;
3015
3926
  };
3016
3927
  };
@@ -3022,54 +3933,80 @@ interface operations {
3022
3933
  query?: never;
3023
3934
  header?: never;
3024
3935
  path: {
3936
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
3025
3937
  knowledgeBaseId: string;
3026
3938
  };
3027
3939
  cookie?: never;
3028
3940
  };
3029
- /** @description CreateImportInput */
3941
+ /** @description Content to add to a knowledge base. The `type` field sets the kind of import. */
3030
3942
  requestBody: {
3031
3943
  content: {
3032
3944
  'application/json': {
3033
- /** @enum {string} */
3945
+ /**
3946
+ * @description The import type. `text` imports inline content.
3947
+ * @enum {string}
3948
+ */
3034
3949
  type: 'text';
3950
+ /** @description The import's title, shown in the list of imports. */
3035
3951
  title: string;
3952
+ /** @description The text or markdown to import, up to 1,000,000 bytes of UTF-8. */
3036
3953
  content: string;
3037
3954
  /**
3955
+ * @description The format of `content`: `text/markdown` (the default) or `text/plain`.
3038
3956
  * @default text/markdown
3039
3957
  * @enum {string}
3040
3958
  */
3041
3959
  contentType?: 'text/markdown' | 'text/plain';
3042
3960
  } | {
3043
- /** Format: uri */
3961
+ /**
3962
+ * Format: uri
3963
+ * @description The URL to start crawling from. It must be a public `http` or `https` URL.
3964
+ */
3044
3965
  url: string;
3045
- /** @description CrawlOptions */
3966
+ /** @description Options for the crawl. Options you omit use the defaults. */
3046
3967
  options?: {
3968
+ /** @description Regular expressions for URL paths to crawl. When set, the crawl only includes pages whose path matches one of them. */
3047
3969
  includePaths?: string[];
3970
+ /** @description Regular expressions for URL paths to skip. Pages whose path matches one of them aren't crawled. */
3048
3971
  excludePaths?: string[];
3972
+ /** @description How many levels deep the crawl goes from the root URL. */
3049
3973
  maxDepth?: number;
3974
+ /** @description Whether to crawl only the pages listed in the site's sitemap. */
3050
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. */
3051
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. */
3052
3979
  pageLimit?: number;
3053
3980
  };
3054
- /** @enum {string} */
3981
+ /**
3982
+ * @description The import type. `crawl` imports a website.
3983
+ * @enum {string}
3984
+ */
3055
3985
  type: 'crawl';
3056
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. */
3057
3988
  sanityProjectId: string;
3989
+ /** @description The dataset to read documents from, in the project set by `sanityProjectId`. */
3058
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. */
3059
3992
  query: string;
3060
- /** @enum {string} */
3993
+ /**
3994
+ * @description The import type. `dataset` imports documents from a Sanity dataset.
3995
+ * @enum {string}
3996
+ */
3061
3997
  type: 'dataset';
3062
3998
  };
3063
3999
  };
3064
4000
  };
3065
4001
  responses: {
3066
- /** @description JobAccepted */
4002
+ /** @description A queued job that you can poll for progress. */
3067
4003
  202: {
3068
4004
  headers: {
3069
4005
  [name: string]: unknown;
3070
4006
  };
3071
4007
  content: {
3072
4008
  'application/json': {
4009
+ /** @description The queued job's ID. Check its progress with `GET .../jobs/{jobId}`. */
3073
4010
  jobId: string;
3074
4011
  };
3075
4012
  };
@@ -3081,6 +4018,7 @@ interface operations {
3081
4018
  query?: never;
3082
4019
  header?: never;
3083
4020
  path: {
4021
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
3084
4022
  knowledgeBaseId: string;
3085
4023
  };
3086
4024
  cookie?: never;
@@ -3088,22 +4026,30 @@ interface operations {
3088
4026
  requestBody: {
3089
4027
  content: {
3090
4028
  'application/json': {
4029
+ /** @description The file's name. */
3091
4030
  filename: string;
4031
+ /** @description The file's MIME type. If you set it, the `PUT` upload must send the same `Content-Type` header. */
3092
4032
  contentType?: string;
3093
4033
  };
3094
4034
  };
3095
4035
  };
3096
4036
  responses: {
3097
- /** @description Default Response */
4037
+ /** @description The new file import and the URL to upload the file to. */
3098
4038
  201: {
3099
4039
  headers: {
3100
4040
  [name: string]: unknown;
3101
4041
  };
3102
4042
  content: {
3103
4043
  'application/json': {
3104
- /** Format: uuid */
4044
+ /**
4045
+ * Format: uuid
4046
+ * @description The ID of the new import. Use it to complete the upload and track the import.
4047
+ */
3105
4048
  importId: string;
3106
- /** Format: uri */
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
+ */
3107
4053
  uploadUrl: string;
3108
4054
  };
3109
4055
  };
@@ -3115,20 +4061,23 @@ interface operations {
3115
4061
  query?: never;
3116
4062
  header?: never;
3117
4063
  path: {
4064
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
3118
4065
  knowledgeBaseId: string;
4066
+ /** @description The import's ID. */
3119
4067
  importId: string;
3120
4068
  };
3121
4069
  cookie?: never;
3122
4070
  };
3123
4071
  requestBody?: never;
3124
4072
  responses: {
3125
- /** @description JobAccepted */
4073
+ /** @description A queued job that you can poll for progress. */
3126
4074
  202: {
3127
4075
  headers: {
3128
4076
  [name: string]: unknown;
3129
4077
  };
3130
4078
  content: {
3131
4079
  'application/json': {
4080
+ /** @description The queued job's ID. Check its progress with `GET .../jobs/{jobId}`. */
3132
4081
  jobId: string;
3133
4082
  };
3134
4083
  };
@@ -3140,59 +4089,98 @@ interface operations {
3140
4089
  query?: never;
3141
4090
  header?: never;
3142
4091
  path: {
4092
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
3143
4093
  knowledgeBaseId: string;
4094
+ /** @description The import's ID. */
3144
4095
  importId: string;
3145
4096
  };
3146
4097
  cookie?: never;
3147
4098
  };
3148
4099
  requestBody?: never;
3149
4100
  responses: {
3150
- /** @description Import */
4101
+ /** @description Content added to a knowledge base: a file upload, website crawl, Sanity dataset, or inline text. */
3151
4102
  200: {
3152
4103
  headers: {
3153
4104
  [name: string]: unknown;
3154
4105
  };
3155
4106
  content: {
3156
4107
  'application/json': {
3157
- /** Format: uuid */
4108
+ /**
4109
+ * Format: uuid
4110
+ * @description The import's ID.
4111
+ */
3158
4112
  id: string;
3159
- /** Format: uuid */
4113
+ /**
4114
+ * Format: uuid
4115
+ * @description The `id` of the knowledge base that the import belongs to.
4116
+ */
3160
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. */
3161
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. */
3162
4121
  sizeBytes: number | null;
3163
- /** @enum {string} */
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
+ */
3164
4126
  status: 'uploading' | 'processing' | 'complete' | 'failed';
3165
- /** @enum {string} */
4127
+ /**
4128
+ * @description The kind of sources the import produces. `file`: uploads and inline text. `web`: crawls. `dataset`: Sanity datasets.
4129
+ * @enum {string}
4130
+ */
3166
4131
  sourceKind: 'web' | 'file' | 'dataset';
3167
- /** Format: date-time */
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
+ */
3168
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. */
3169
4138
  sourceCount: number;
4139
+ /** @description The number of sources expected to be distilled, including parts split from large sources. Excludes skipped sources. */
3170
4140
  totalDistillableCount: number;
4141
+ /** @description The number of sources distilled so far. Compare it with `totalDistillableCount` to show progress. */
3171
4142
  distilledCount: number;
4143
+ /** @description The number of sources skipped because their file type isn't supported, such as images. */
3172
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`. */
3173
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. */
3174
4148
  error: string | null;
3175
- /** @description CrawlOptions */
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. */
3176
4150
  crawlOptions: {
4151
+ /** @description Regular expressions for URL paths to crawl. When set, the crawl only includes pages whose path matches one of them. */
3177
4152
  includePaths?: string[];
4153
+ /** @description Regular expressions for URL paths to skip. Pages whose path matches one of them aren't crawled. */
3178
4154
  excludePaths?: string[];
4155
+ /** @description How many levels deep the crawl goes from the root URL. */
3179
4156
  maxDepth?: number;
4157
+ /** @description Whether to crawl only the pages listed in the site's sitemap. */
3180
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. */
3181
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. */
3182
4162
  pageLimit?: number;
3183
4163
  } | null;
3184
- /** @description DatasetSourceBinding */
4164
+ /** @description The Sanity project, dataset, and full query a dataset import reads from. `null` for other import types. */
3185
4165
  datasetSource: {
4166
+ /** @description The ID of the Sanity project the documents come from. */
3186
4167
  sanityProjectId: string;
4168
+ /** @description The dataset the documents come from. */
3187
4169
  sanityDatasetId: string;
4170
+ /** @description The full GROQ query that selects the documents, exactly as saved. */
3188
4171
  query: string;
3189
4172
  } | null;
3190
- /** @description Actor */
4173
+ /** @description Who added the import. `null` if unknown. */
3191
4174
  createdBy: {
4175
+ /** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
3192
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`. */
3193
4178
  displayName: string | null;
3194
4179
  } | null;
3195
- /** Format: date-time */
4180
+ /**
4181
+ * Format: date-time
4182
+ * @description When the import was created.
4183
+ */
3196
4184
  createdAt: string;
3197
4185
  /** Format: date-time */
3198
4186
  completedAt: string | null;
@@ -3206,14 +4194,16 @@ interface operations {
3206
4194
  query?: never;
3207
4195
  header?: never;
3208
4196
  path: {
4197
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
3209
4198
  knowledgeBaseId: string;
4199
+ /** @description The import's ID. */
3210
4200
  importId: string;
3211
4201
  };
3212
4202
  cookie?: never;
3213
4203
  };
3214
4204
  requestBody?: never;
3215
4205
  responses: {
3216
- /** @description Default Response */
4206
+ /** @description The import and its sources were deleted. */
3217
4207
  204: {
3218
4208
  headers: {
3219
4209
  [name: string]: unknown;
@@ -3229,23 +4219,31 @@ interface operations {
3229
4219
  query?: never;
3230
4220
  header?: never;
3231
4221
  path: {
4222
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
3232
4223
  knowledgeBaseId: string;
4224
+ /** @description The import's ID. */
3233
4225
  importId: string;
3234
4226
  };
3235
4227
  cookie?: never;
3236
4228
  };
3237
4229
  requestBody?: never;
3238
4230
  responses: {
3239
- /** @description Default Response */
4231
+ /** @description A short-lived URL that downloads the import's original content. */
3240
4232
  200: {
3241
4233
  headers: {
3242
4234
  [name: string]: unknown;
3243
4235
  };
3244
4236
  content: {
3245
4237
  'application/json': {
3246
- /** Format: uri */
4238
+ /**
4239
+ * Format: uri
4240
+ * @description A signed URL that downloads the import's original content as a file.
4241
+ */
3247
4242
  url: string;
3248
- /** Format: date-time */
4243
+ /**
4244
+ * Format: date-time
4245
+ * @description When `url` expires, 10 minutes after the request.
4246
+ */
3249
4247
  expiresAt: string;
3250
4248
  };
3251
4249
  };
@@ -3257,58 +4255,89 @@ interface operations {
3257
4255
  query?: never;
3258
4256
  header?: never;
3259
4257
  path: {
4258
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
3260
4259
  knowledgeBaseId: string;
3261
4260
  };
3262
4261
  cookie?: never;
3263
4262
  };
3264
- /** @description CreateInstructionInput */
4263
+ /** @description The instruction to create, and any entries to rebuild under it. */
3265
4264
  requestBody: {
3266
4265
  content: {
3267
4266
  'application/json': {
4267
+ /** @description The instruction in plain language. Builds follow it over what the sources say. */
3268
4268
  statement: string;
3269
- scopeSourceIds?: string[] | null;
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`. */
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`. */
3270
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. */
3271
4274
  verified?: boolean;
3272
4275
  };
3273
4276
  };
3274
4277
  };
3275
4278
  responses: {
3276
- /** @description CreateInstructionResponse */
4279
+ /** @description The created instruction, and the rebuild it started. */
3277
4280
  201: {
3278
4281
  headers: {
3279
4282
  [name: string]: unknown;
3280
4283
  };
3281
4284
  content: {
3282
4285
  'application/json': {
3283
- /** @description Instruction */
4286
+ /** @description The created instruction. */
3284
4287
  instruction: {
4288
+ /** @description The instruction's document ID. */
3285
4289
  id: string;
4290
+ /** @description ID of the knowledge base the instruction belongs to. */
3286
4291
  knowledgeBaseId: string;
3287
- /** @enum {string} */
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
+ */
3288
4296
  origin: 'conflict' | 'human';
3289
- /** @enum {string} */
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
+ */
3290
4301
  status: 'active' | 'archived';
4302
+ /** @description The instruction in plain language. Builds follow it over what the sources say. */
3291
4303
  statement: string;
3292
- scopeSourceIds: string[] | null;
3293
- /** Format: date-time */
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. */
4305
+ scopeSourceIds: string[];
4306
+ /**
4307
+ * Format: date-time
4308
+ * @description When a refresh archived the instruction. `null` while it is active.
4309
+ */
3294
4310
  archivedAt: string | null;
4311
+ /** @description Why the instruction was archived. `null` while it is active. */
3295
4312
  archivedReason: string | null;
4313
+ /** @description ID of the conflict issue this instruction records. `null` when `origin` is `human`. */
3296
4314
  sourceIssueId: string | null;
3297
- /** @description Actor */
4315
+ /** @description Who created the instruction. `null` for instructions created by resolving a conflict, and when the creator is unknown. */
3298
4316
  createdBy: {
4317
+ /** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
3299
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`. */
3300
4320
  displayName: string | null;
3301
4321
  } | null;
3302
- /** @description Actor */
4322
+ /** @description Who last updated the instruction through the API. `null` when it was never updated, or when the person is unknown. */
3303
4323
  updatedBy: {
4324
+ /** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
3304
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`. */
3305
4327
  displayName: string | null;
3306
4328
  } | null;
3307
- /** Format: date-time */
4329
+ /**
4330
+ * Format: date-time
4331
+ * @description When the instruction was created.
4332
+ */
3308
4333
  createdAt: string;
3309
- /** Format: date-time */
4334
+ /**
4335
+ * Format: date-time
4336
+ * @description When the instruction last changed, including changes a refresh makes. `null` when the time is unknown.
4337
+ */
3310
4338
  updatedAt: string | null;
3311
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. */
3312
4341
  rebuildJobId: string | null;
3313
4342
  };
3314
4343
  };
@@ -3320,14 +4349,16 @@ interface operations {
3320
4349
  query?: never;
3321
4350
  header?: never;
3322
4351
  path: {
4352
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
3323
4353
  knowledgeBaseId: string;
4354
+ /** @description The instruction's ID. */
3324
4355
  instructionId: string;
3325
4356
  };
3326
4357
  cookie?: never;
3327
4358
  };
3328
4359
  requestBody?: never;
3329
4360
  responses: {
3330
- /** @description Default Response */
4361
+ /** @description The instruction was deleted. */
3331
4362
  204: {
3332
4363
  headers: {
3333
4364
  [name: string]: unknown;
@@ -3343,53 +4374,82 @@ interface operations {
3343
4374
  query?: never;
3344
4375
  header?: never;
3345
4376
  path: {
4377
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
3346
4378
  knowledgeBaseId: string;
4379
+ /** @description The instruction's ID. */
3347
4380
  instructionId: string;
3348
4381
  };
3349
4382
  cookie?: never;
3350
4383
  };
3351
- /** @description UpdateInstructionInput */
4384
+ /** @description The changes to make to an instruction. Set `statement`, `scopeSourceIds`, or both. Any update also reactivates an archived instruction. */
3352
4385
  requestBody: {
3353
4386
  content: {
3354
4387
  'application/json': {
4388
+ /** @description The new instruction text. Omit it to keep the current text. */
3355
4389
  statement?: string;
3356
- scopeSourceIds?: string[] | null;
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`. */
4391
+ scopeSourceIds?: string[];
3357
4392
  };
3358
4393
  };
3359
4394
  };
3360
4395
  responses: {
3361
- /** @description Instruction */
4396
+ /** @description A standing instruction that shapes how entries that cite its sources are written. */
3362
4397
  200: {
3363
4398
  headers: {
3364
4399
  [name: string]: unknown;
3365
4400
  };
3366
4401
  content: {
3367
4402
  'application/json': {
4403
+ /** @description The instruction's document ID. */
3368
4404
  id: string;
4405
+ /** @description ID of the knowledge base the instruction belongs to. */
3369
4406
  knowledgeBaseId: string;
3370
- /** @enum {string} */
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
+ */
3371
4411
  origin: 'conflict' | 'human';
3372
- /** @enum {string} */
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
+ */
3373
4416
  status: 'active' | 'archived';
4417
+ /** @description The instruction in plain language. Builds follow it over what the sources say. */
3374
4418
  statement: string;
3375
- scopeSourceIds: string[] | null;
3376
- /** Format: date-time */
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. */
4420
+ scopeSourceIds: string[];
4421
+ /**
4422
+ * Format: date-time
4423
+ * @description When a refresh archived the instruction. `null` while it is active.
4424
+ */
3377
4425
  archivedAt: string | null;
4426
+ /** @description Why the instruction was archived. `null` while it is active. */
3378
4427
  archivedReason: string | null;
4428
+ /** @description ID of the conflict issue this instruction records. `null` when `origin` is `human`. */
3379
4429
  sourceIssueId: string | null;
3380
- /** @description Actor */
4430
+ /** @description Who created the instruction. `null` for instructions created by resolving a conflict, and when the creator is unknown. */
3381
4431
  createdBy: {
4432
+ /** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
3382
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`. */
3383
4435
  displayName: string | null;
3384
4436
  } | null;
3385
- /** @description Actor */
4437
+ /** @description Who last updated the instruction through the API. `null` when it was never updated, or when the person is unknown. */
3386
4438
  updatedBy: {
4439
+ /** @description The Sanity user ID, or `sanity-system` when Sanity Context made the change. `null` if unknown. */
3387
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`. */
3388
4442
  displayName: string | null;
3389
4443
  } | null;
3390
- /** Format: date-time */
4444
+ /**
4445
+ * Format: date-time
4446
+ * @description When the instruction was created.
4447
+ */
3391
4448
  createdAt: string;
3392
- /** Format: date-time */
4449
+ /**
4450
+ * Format: date-time
4451
+ * @description When the instruction last changed, including changes a refresh makes. `null` when the time is unknown.
4452
+ */
3393
4453
  updatedAt: string | null;
3394
4454
  };
3395
4455
  };
@@ -3401,6 +4461,7 @@ interface operations {
3401
4461
  query?: never;
3402
4462
  header?: never;
3403
4463
  path: {
4464
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
3404
4465
  knowledgeBaseId: string;
3405
4466
  };
3406
4467
  cookie?: never;
@@ -3408,18 +4469,20 @@ interface operations {
3408
4469
  requestBody: {
3409
4470
  content: {
3410
4471
  'application/json': {
4472
+ /** @description The IDs of the issues to accept and apply. */
3411
4473
  issueIds: string[];
3412
4474
  };
3413
4475
  };
3414
4476
  };
3415
4477
  responses: {
3416
- /** @description JobAccepted */
4478
+ /** @description A queued job that you can poll for progress. */
3417
4479
  202: {
3418
4480
  headers: {
3419
4481
  [name: string]: unknown;
3420
4482
  };
3421
4483
  content: {
3422
4484
  'application/json': {
4485
+ /** @description The queued job's ID. Check its progress with `GET .../jobs/{jobId}`. */
3423
4486
  jobId: string;
3424
4487
  };
3425
4488
  };
@@ -3431,56 +4494,123 @@ interface operations {
3431
4494
  query?: never;
3432
4495
  header?: never;
3433
4496
  path: {
4497
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
3434
4498
  knowledgeBaseId: string;
4499
+ /** @description The issue's document ID. */
3435
4500
  issueId: string;
3436
4501
  };
3437
4502
  cookie?: never;
3438
4503
  };
3439
4504
  requestBody?: never;
3440
4505
  responses: {
3441
- /** @description Issue */
4506
+ /** @description An issue found in a knowledge base, and its triage status. */
3442
4507
  200: {
3443
4508
  headers: {
3444
4509
  [name: string]: unknown;
3445
4510
  };
3446
4511
  content: {
3447
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. */
3448
4514
  id: string;
4515
+ /** @description ID of the knowledge base the issue belongs to. */
3449
4516
  knowledgeBaseId: string;
3450
- /** @description IssueContent */
4517
+ /** @description What the issue found. The shape depends on `kind`. */
3451
4518
  content: {
3452
- /** @enum {string} */
3453
- kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
3454
- /** @enum {string} */
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
+ */
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. */
4525
+ scopePath: string;
4526
+ /** @description What the problem is, in one or two sentences. */
4527
+ issue: string;
4528
+ /** @description What to do to fix the issue. */
4529
+ suggestedFix: string;
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
+ */
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. */
4536
+ claimKey: string;
4537
+ /** @description The conflicting positions, at least two. To resolve the conflict, pass the index of one side as `resolution`. */
4538
+ sides: {
4539
+ /** @description The position as a self-contained sentence. This is the option you choose from. */
4540
+ claim: string;
4541
+ /** @description The disputed value on its own, such as `10,000/month`, without the sentence. */
4542
+ value?: string;
4543
+ /** @description Paths of the entries that state this position. */
4544
+ entryPaths?: string[];
4545
+ /** @description IDs of the sources that directly back this position. */
4546
+ sourceIds?: string[];
4547
+ /** @description Where in a source this position was read. */
4548
+ span?: {
4549
+ /** @description ID of the source the position was read from. */
4550
+ sourceId: string;
4551
+ /** @description First line of the range, counting from 1. Line numbers match `GET .../sources/{sourceId}/content`. */
4552
+ lineStart: number;
4553
+ /** @description Last line of the range, inclusive. */
4554
+ lineEnd: number;
4555
+ };
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
+ */
4560
+ authority?: 'primary' | 'secondary' | 'community';
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. */
4563
+ suggested?: number;
4564
+ } | {
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
+ */
3455
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. */
3456
4571
  scopePath: string;
4572
+ /** @description What the problem is, in one or two sentences. */
3457
4573
  issue: string;
4574
+ /** @description What to do to fix the issue. */
3458
4575
  suggestedFix: string;
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
+ */
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. */
3459
4582
  citedSourceIds?: string[];
4583
+ /** @description A key naming the specific finding, when the check that found it sets one. */
3460
4584
  claimKey?: string;
4585
+ /** @description Paths of the entries the issue involves, when it spans more than one entry. */
3461
4586
  involvedScopes?: string[];
3462
- currentClaim?: string;
3463
- alternativeClaim?: string;
3464
- /** @enum {string} */
3465
- currentAuthority?: 'primary' | 'secondary' | 'community';
3466
- /** @enum {string} */
3467
- alternativeAuthority?: 'primary' | 'secondary' | 'community';
3468
- /** @enum {string} */
3469
- suggestedResolution?: 'keep_existing' | 'accept_new';
3470
4587
  };
3471
- /** @enum {string} */
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
+ */
3472
4592
  status: 'open' | 'accepted' | 'rejected';
3473
- /** @enum {string|null} */
3474
- resolution: 'keep_existing' | 'accept_new' | null;
3475
- /** @description IssueResolvedBy */
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. */
4594
+ resolution: number | null;
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. */
3476
4596
  resolvedBy: {
4597
+ /** @description Sanity user ID of the person or robot that triaged the issue. */
3477
4598
  id: string;
3478
- /** @enum {string} */
4599
+ /**
4600
+ * @description `user` when a person made the decision. `robot` when a robot token did, such as an agent.
4601
+ * @enum {string}
4602
+ */
3479
4603
  kind: 'user' | 'robot';
3480
4604
  } | null;
3481
- /** Format: date-time */
4605
+ /**
4606
+ * Format: date-time
4607
+ * @description When the issue was first filed.
4608
+ */
3482
4609
  createdAt: string;
3483
- /** Format: date-time */
4610
+ /**
4611
+ * Format: date-time
4612
+ * @description When the issue left `open`. `null` while the issue is open.
4613
+ */
3484
4614
  resolvedAt: string | null;
3485
4615
  };
3486
4616
  };
@@ -3492,56 +4622,123 @@ interface operations {
3492
4622
  query?: never;
3493
4623
  header?: never;
3494
4624
  path: {
4625
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
3495
4626
  knowledgeBaseId: string;
4627
+ /** @description The issue's document ID. */
3496
4628
  issueId: string;
3497
4629
  };
3498
4630
  cookie?: never;
3499
4631
  };
3500
4632
  requestBody?: never;
3501
4633
  responses: {
3502
- /** @description Issue */
4634
+ /** @description An issue found in a knowledge base, and its triage status. */
3503
4635
  200: {
3504
4636
  headers: {
3505
4637
  [name: string]: unknown;
3506
4638
  };
3507
4639
  content: {
3508
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. */
3509
4642
  id: string;
4643
+ /** @description ID of the knowledge base the issue belongs to. */
3510
4644
  knowledgeBaseId: string;
3511
- /** @description IssueContent */
4645
+ /** @description What the issue found. The shape depends on `kind`. */
3512
4646
  content: {
3513
- /** @enum {string} */
3514
- kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
3515
- /** @enum {string} */
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
+ */
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. */
4653
+ scopePath: string;
4654
+ /** @description What the problem is, in one or two sentences. */
4655
+ issue: string;
4656
+ /** @description What to do to fix the issue. */
4657
+ suggestedFix: string;
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
+ */
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. */
4664
+ claimKey: string;
4665
+ /** @description The conflicting positions, at least two. To resolve the conflict, pass the index of one side as `resolution`. */
4666
+ sides: {
4667
+ /** @description The position as a self-contained sentence. This is the option you choose from. */
4668
+ claim: string;
4669
+ /** @description The disputed value on its own, such as `10,000/month`, without the sentence. */
4670
+ value?: string;
4671
+ /** @description Paths of the entries that state this position. */
4672
+ entryPaths?: string[];
4673
+ /** @description IDs of the sources that directly back this position. */
4674
+ sourceIds?: string[];
4675
+ /** @description Where in a source this position was read. */
4676
+ span?: {
4677
+ /** @description ID of the source the position was read from. */
4678
+ sourceId: string;
4679
+ /** @description First line of the range, counting from 1. Line numbers match `GET .../sources/{sourceId}/content`. */
4680
+ lineStart: number;
4681
+ /** @description Last line of the range, inclusive. */
4682
+ lineEnd: number;
4683
+ };
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
+ */
4688
+ authority?: 'primary' | 'secondary' | 'community';
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. */
4691
+ suggested?: number;
4692
+ } | {
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
+ */
3516
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. */
3517
4699
  scopePath: string;
4700
+ /** @description What the problem is, in one or two sentences. */
3518
4701
  issue: string;
4702
+ /** @description What to do to fix the issue. */
3519
4703
  suggestedFix: string;
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
+ */
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. */
3520
4710
  citedSourceIds?: string[];
4711
+ /** @description A key naming the specific finding, when the check that found it sets one. */
3521
4712
  claimKey?: string;
4713
+ /** @description Paths of the entries the issue involves, when it spans more than one entry. */
3522
4714
  involvedScopes?: string[];
3523
- currentClaim?: string;
3524
- alternativeClaim?: string;
3525
- /** @enum {string} */
3526
- currentAuthority?: 'primary' | 'secondary' | 'community';
3527
- /** @enum {string} */
3528
- alternativeAuthority?: 'primary' | 'secondary' | 'community';
3529
- /** @enum {string} */
3530
- suggestedResolution?: 'keep_existing' | 'accept_new';
3531
4715
  };
3532
- /** @enum {string} */
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
+ */
3533
4720
  status: 'open' | 'accepted' | 'rejected';
3534
- /** @enum {string|null} */
3535
- resolution: 'keep_existing' | 'accept_new' | null;
3536
- /** @description IssueResolvedBy */
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. */
4722
+ resolution: number | null;
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. */
3537
4724
  resolvedBy: {
4725
+ /** @description Sanity user ID of the person or robot that triaged the issue. */
3538
4726
  id: string;
3539
- /** @enum {string} */
4727
+ /**
4728
+ * @description `user` when a person made the decision. `robot` when a robot token did, such as an agent.
4729
+ * @enum {string}
4730
+ */
3540
4731
  kind: 'user' | 'robot';
3541
4732
  } | null;
3542
- /** Format: date-time */
4733
+ /**
4734
+ * Format: date-time
4735
+ * @description When the issue was first filed.
4736
+ */
3543
4737
  createdAt: string;
3544
- /** Format: date-time */
4738
+ /**
4739
+ * Format: date-time
4740
+ * @description When the issue left `open`. `null` while the issue is open.
4741
+ */
3545
4742
  resolvedAt: string | null;
3546
4743
  };
3547
4744
  };
@@ -3553,7 +4750,9 @@ interface operations {
3553
4750
  query?: never;
3554
4751
  header?: never;
3555
4752
  path: {
4753
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
3556
4754
  knowledgeBaseId: string;
4755
+ /** @description The issue's document ID. */
3557
4756
  issueId: string;
3558
4757
  };
3559
4758
  cookie?: never;
@@ -3561,59 +4760,125 @@ interface operations {
3561
4760
  requestBody: {
3562
4761
  content: {
3563
4762
  'application/json': {
3564
- /** @enum {string} */
3565
- resolution: 'keep_existing' | 'accept_new';
4763
+ /** @description The index of the chosen side in the issue's `content.sides`. */
4764
+ resolution: number;
3566
4765
  };
3567
4766
  };
3568
4767
  };
3569
4768
  responses: {
3570
- /** @description ResolveIssueResponse */
4769
+ /** @description The resolved issue, plus the job that rewrites the entry when the decision changes it. */
3571
4770
  200: {
3572
4771
  headers: {
3573
4772
  [name: string]: unknown;
3574
4773
  };
3575
4774
  content: {
3576
4775
  'application/json': {
3577
- /** @description Issue */
4776
+ /** @description The resolved conflict issue, now `accepted`. */
3578
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. */
3579
4779
  id: string;
4780
+ /** @description ID of the knowledge base the issue belongs to. */
3580
4781
  knowledgeBaseId: string;
3581
- /** @description IssueContent */
4782
+ /** @description What the issue found. The shape depends on `kind`. */
3582
4783
  content: {
3583
- /** @enum {string} */
3584
- kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
3585
- /** @enum {string} */
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
+ */
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. */
4790
+ scopePath: string;
4791
+ /** @description What the problem is, in one or two sentences. */
4792
+ issue: string;
4793
+ /** @description What to do to fix the issue. */
4794
+ suggestedFix: string;
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
+ */
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. */
4801
+ claimKey: string;
4802
+ /** @description The conflicting positions, at least two. To resolve the conflict, pass the index of one side as `resolution`. */
4803
+ sides: {
4804
+ /** @description The position as a self-contained sentence. This is the option you choose from. */
4805
+ claim: string;
4806
+ /** @description The disputed value on its own, such as `10,000/month`, without the sentence. */
4807
+ value?: string;
4808
+ /** @description Paths of the entries that state this position. */
4809
+ entryPaths?: string[];
4810
+ /** @description IDs of the sources that directly back this position. */
4811
+ sourceIds?: string[];
4812
+ /** @description Where in a source this position was read. */
4813
+ span?: {
4814
+ /** @description ID of the source the position was read from. */
4815
+ sourceId: string;
4816
+ /** @description First line of the range, counting from 1. Line numbers match `GET .../sources/{sourceId}/content`. */
4817
+ lineStart: number;
4818
+ /** @description Last line of the range, inclusive. */
4819
+ lineEnd: number;
4820
+ };
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
+ */
4825
+ authority?: 'primary' | 'secondary' | 'community';
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. */
4828
+ suggested?: number;
4829
+ } | {
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
+ */
3586
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. */
3587
4836
  scopePath: string;
4837
+ /** @description What the problem is, in one or two sentences. */
3588
4838
  issue: string;
4839
+ /** @description What to do to fix the issue. */
3589
4840
  suggestedFix: string;
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
+ */
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. */
3590
4847
  citedSourceIds?: string[];
4848
+ /** @description A key naming the specific finding, when the check that found it sets one. */
3591
4849
  claimKey?: string;
4850
+ /** @description Paths of the entries the issue involves, when it spans more than one entry. */
3592
4851
  involvedScopes?: string[];
3593
- currentClaim?: string;
3594
- alternativeClaim?: string;
3595
- /** @enum {string} */
3596
- currentAuthority?: 'primary' | 'secondary' | 'community';
3597
- /** @enum {string} */
3598
- alternativeAuthority?: 'primary' | 'secondary' | 'community';
3599
- /** @enum {string} */
3600
- suggestedResolution?: 'keep_existing' | 'accept_new';
3601
4852
  };
3602
- /** @enum {string} */
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
+ */
3603
4857
  status: 'open' | 'accepted' | 'rejected';
3604
- /** @enum {string|null} */
3605
- resolution: 'keep_existing' | 'accept_new' | null;
3606
- /** @description IssueResolvedBy */
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. */
4859
+ resolution: number | null;
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. */
3607
4861
  resolvedBy: {
4862
+ /** @description Sanity user ID of the person or robot that triaged the issue. */
3608
4863
  id: string;
3609
- /** @enum {string} */
4864
+ /**
4865
+ * @description `user` when a person made the decision. `robot` when a robot token did, such as an agent.
4866
+ * @enum {string}
4867
+ */
3610
4868
  kind: 'user' | 'robot';
3611
4869
  } | null;
3612
- /** Format: date-time */
4870
+ /**
4871
+ * Format: date-time
4872
+ * @description When the issue was first filed.
4873
+ */
3613
4874
  createdAt: string;
3614
- /** Format: date-time */
4875
+ /**
4876
+ * Format: date-time
4877
+ * @description When the issue left `open`. `null` while the issue is open.
4878
+ */
3615
4879
  resolvedAt: string | null;
3616
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. */
3617
4882
  jobId: string | null;
3618
4883
  };
3619
4884
  };
@@ -3625,28 +4890,42 @@ interface operations {
3625
4890
  query?: never;
3626
4891
  header?: never;
3627
4892
  path: {
4893
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
3628
4894
  knowledgeBaseId: string;
4895
+ /** @description The job ID returned by the endpoint that started the work. */
3629
4896
  jobId: string;
3630
4897
  };
3631
4898
  cookie?: never;
3632
4899
  };
3633
4900
  requestBody?: never;
3634
4901
  responses: {
3635
- /** @description Job */
4902
+ /** @description A background job, such as a build, refresh, or import, and its status. */
3636
4903
  200: {
3637
4904
  headers: {
3638
4905
  [name: string]: unknown;
3639
4906
  };
3640
4907
  content: {
3641
4908
  'application/json': {
4909
+ /** @description The job's ID. */
3642
4910
  id: string;
3643
- /** @enum {string} */
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
+ */
3644
4915
  status: 'pending' | 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled';
3645
- /** Format: date-time */
4916
+ /**
4917
+ * Format: date-time
4918
+ * @description When the job started.
4919
+ */
3646
4920
  startedAt: string | null;
3647
- /** Format: date-time */
4921
+ /**
4922
+ * Format: date-time
4923
+ * @description When the job finished. `null` while the job is queued or running.
4924
+ */
3648
4925
  completedAt: string | null;
4926
+ /** @description The job's output. Only present when `status` is `succeeded`. Its shape depends on the kind of job. */
3649
4927
  result?: unknown;
4928
+ /** @description A readable reason the job failed or was cancelled. `null` for any other status. */
3650
4929
  error?: string | null;
3651
4930
  };
3652
4931
  };
@@ -3658,20 +4937,23 @@ interface operations {
3658
4937
  query?: never;
3659
4938
  header?: never;
3660
4939
  path: {
4940
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
3661
4941
  knowledgeBaseId: string;
3662
4942
  };
3663
4943
  cookie?: never;
3664
4944
  };
3665
4945
  requestBody?: never;
3666
4946
  responses: {
3667
- /** @description RefreshAccepted */
4947
+ /** @description A queued refresh job that you can poll for progress. */
3668
4948
  202: {
3669
4949
  headers: {
3670
4950
  [name: string]: unknown;
3671
4951
  };
3672
4952
  content: {
3673
4953
  'application/json': {
4954
+ /** @description The queued job's ID. Check its progress with `GET .../jobs/{jobId}`. */
3674
4955
  jobId: string;
4956
+ /** @description Whether this request started a new refresh. `false` means a refresh was already running, and `jobId` is that refresh. */
3675
4957
  started: boolean;
3676
4958
  };
3677
4959
  };
@@ -3681,48 +4963,84 @@ interface operations {
3681
4963
  listSources: {
3682
4964
  parameters: {
3683
4965
  query?: {
4966
+ /** @description The `nextCursor` value from the previous page. Omit it to get the first page. */
3684
4967
  cursor?: string;
4968
+ /** @description The maximum number of items to return. */
3685
4969
  limit?: number;
4970
+ /** @description Return only sources with this status. */
3686
4971
  status?: 'pending' | 'processing' | 'ready' | 'failed' | 'skipped';
4972
+ /** @description Return only the sources that this import produced. */
3687
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. */
3688
4975
  ids?: string;
3689
4976
  };
3690
4977
  header?: never;
3691
4978
  path: {
4979
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
3692
4980
  knowledgeBaseId: string;
3693
4981
  };
3694
4982
  cookie?: never;
3695
4983
  };
3696
4984
  requestBody?: never;
3697
4985
  responses: {
3698
- /** @description Default Response */
4986
+ /** @description A page of sources. */
3699
4987
  200: {
3700
4988
  headers: {
3701
4989
  [name: string]: unknown;
3702
4990
  };
3703
4991
  content: {
3704
4992
  'application/json': {
4993
+ /** @description The items on this page. */
3705
4994
  data: {
3706
- /** Format: uuid */
4995
+ /**
4996
+ * Format: uuid
4997
+ * @description The source's ID.
4998
+ */
3707
4999
  id: string;
3708
- /** Format: uuid */
5000
+ /**
5001
+ * Format: uuid
5002
+ * @description The `id` of the knowledge base that the source belongs to.
5003
+ */
3709
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. */
3710
5006
  filename: string;
3711
- /** @enum {string} */
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
+ */
3712
5011
  kind: 'web' | 'file' | 'dataset';
5012
+ /** @description The source's size in bytes. */
3713
5013
  sizeBytes: number;
3714
- /** @enum {string} */
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
+ */
3715
5018
  status: 'pending' | 'processing' | 'ready' | 'failed' | 'skipped';
5019
+ /** @description A short summary of the source. `null` until the source is summarized. */
3716
5020
  tldr: string | null;
5021
+ /** @description Topics the source covers. `null` until the source is summarized. */
3717
5022
  topics: string[] | null;
5023
+ /** @description The page URL of a `web` source. `null` for other kinds. */
3718
5024
  canonicalUrl: string | null;
3719
- /** Format: date-time */
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. */
5026
+ externalId: string | null;
5027
+ /**
5028
+ * Format: date-time
5029
+ * @description When the source's content was last fetched.
5030
+ */
3720
5031
  fetchedAt: string | null;
3721
- /** Format: date-time */
5032
+ /**
5033
+ * Format: date-time
5034
+ * @description When the source's content was last distilled into markdown. `null` until it's distilled.
5035
+ */
3722
5036
  distilledAt: string | null;
3723
- /** Format: date-time */
5037
+ /**
5038
+ * Format: date-time
5039
+ * @description When the source was added.
5040
+ */
3724
5041
  createdAt: string;
3725
5042
  }[];
5043
+ /** @description The cursor for the next page. Pass it as `cursor` to get more results. `null` when there are no more pages. */
3726
5044
  nextCursor: string | null;
3727
5045
  };
3728
5046
  };
@@ -3734,38 +5052,68 @@ interface operations {
3734
5052
  query?: never;
3735
5053
  header?: never;
3736
5054
  path: {
5055
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
3737
5056
  knowledgeBaseId: string;
5057
+ /** @description The source's ID. */
3738
5058
  sourceId: string;
3739
5059
  };
3740
5060
  cookie?: never;
3741
5061
  };
3742
5062
  requestBody?: never;
3743
5063
  responses: {
3744
- /** @description Source */
5064
+ /** @description A page, file, or document that an import produced and that builds cite. */
3745
5065
  200: {
3746
5066
  headers: {
3747
5067
  [name: string]: unknown;
3748
5068
  };
3749
5069
  content: {
3750
5070
  'application/json': {
3751
- /** Format: uuid */
5071
+ /**
5072
+ * Format: uuid
5073
+ * @description The source's ID.
5074
+ */
3752
5075
  id: string;
3753
- /** Format: uuid */
5076
+ /**
5077
+ * Format: uuid
5078
+ * @description The `id` of the knowledge base that the source belongs to.
5079
+ */
3754
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. */
3755
5082
  filename: string;
3756
- /** @enum {string} */
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
+ */
3757
5087
  kind: 'web' | 'file' | 'dataset';
5088
+ /** @description The source's size in bytes. */
3758
5089
  sizeBytes: number;
3759
- /** @enum {string} */
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
+ */
3760
5094
  status: 'pending' | 'processing' | 'ready' | 'failed' | 'skipped';
5095
+ /** @description A short summary of the source. `null` until the source is summarized. */
3761
5096
  tldr: string | null;
5097
+ /** @description Topics the source covers. `null` until the source is summarized. */
3762
5098
  topics: string[] | null;
5099
+ /** @description The page URL of a `web` source. `null` for other kinds. */
3763
5100
  canonicalUrl: string | null;
3764
- /** Format: date-time */
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. */
5102
+ externalId: string | null;
5103
+ /**
5104
+ * Format: date-time
5105
+ * @description When the source's content was last fetched.
5106
+ */
3765
5107
  fetchedAt: string | null;
3766
- /** Format: date-time */
5108
+ /**
5109
+ * Format: date-time
5110
+ * @description When the source's content was last distilled into markdown. `null` until it's distilled.
5111
+ */
3767
5112
  distilledAt: string | null;
3768
- /** Format: date-time */
5113
+ /**
5114
+ * Format: date-time
5115
+ * @description When the source was added.
5116
+ */
3769
5117
  createdAt: string;
3770
5118
  };
3771
5119
  };
@@ -3777,14 +5125,16 @@ interface operations {
3777
5125
  query?: never;
3778
5126
  header?: never;
3779
5127
  path: {
5128
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
3780
5129
  knowledgeBaseId: string;
5130
+ /** @description The source's ID. */
3781
5131
  sourceId: string;
3782
5132
  };
3783
5133
  cookie?: never;
3784
5134
  };
3785
5135
  requestBody?: never;
3786
5136
  responses: {
3787
- /** @description Default Response */
5137
+ /** @description The source was deleted. */
3788
5138
  204: {
3789
5139
  headers: {
3790
5140
  [name: string]: unknown;
@@ -3798,33 +5148,45 @@ interface operations {
3798
5148
  getSourceContent: {
3799
5149
  parameters: {
3800
5150
  query?: {
3801
- /** @description Output representation. `json` (default) returns the structured resource; `markdown` / `plain` return the rendered, LLM-ready text. */
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. */
3802
5152
  format?: 'json' | 'markdown' | 'plain';
5153
+ /** @description The first line to return, starting at 1. Omit `startLine` and `endLine` to get the whole content. */
3803
5154
  startLine?: number;
5155
+ /** @description The last line to return, inclusive. A value past the end returns everything up to the last line. */
3804
5156
  endLine?: number;
3805
5157
  };
3806
5158
  header?: never;
3807
5159
  path: {
5160
+ /** @description The knowledge base's public ID (`kb...`) or UUID. */
3808
5161
  knowledgeBaseId: string;
5162
+ /** @description The source's ID. */
3809
5163
  sourceId: string;
3810
5164
  };
3811
5165
  cookie?: never;
3812
5166
  };
3813
5167
  requestBody?: never;
3814
5168
  responses: {
3815
- /** @description SourceContent */
5169
+ /** @description A source's distilled markdown, or a range of its lines. */
3816
5170
  200: {
3817
5171
  headers: {
3818
5172
  [name: string]: unknown;
3819
5173
  };
3820
5174
  content: {
3821
5175
  'application/json': {
3822
- /** Format: uuid */
5176
+ /**
5177
+ * Format: uuid
5178
+ * @description The source's ID.
5179
+ */
3823
5180
  sourceId: string;
5181
+ /** @description The distilled markdown, or the requested lines of it. */
3824
5182
  content: string;
5183
+ /** @description The number of lines in the full distilled content. */
3825
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. */
3826
5186
  slice: {
5187
+ /** @description The first line returned. */
3827
5188
  start: number;
5189
+ /** @description The last line returned. */
3828
5190
  end: number;
3829
5191
  };
3830
5192
  };
@@ -3839,106 +5201,184 @@ interface operations {
3839
5201
  query?: never;
3840
5202
  header?: never;
3841
5203
  path: {
5204
+ /** @description Your ID for the conversation thread, unique within your organization. Up to 200 characters. */
3842
5205
  threadId: string;
3843
5206
  };
3844
5207
  cookie?: never;
3845
5208
  };
3846
- /** @description SaveConversationInput */
5209
+ /** @description A conversation transcript to save for one thread. */
3847
5210
  requestBody: {
3848
5211
  content: {
3849
5212
  'application/json': {
5213
+ /** @description The full transcript so far, in order. It replaces the stored messages. */
3850
5214
  messages: {
3851
- /** @enum {string} */
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
+ */
3852
5219
  role: 'user' | 'assistant' | 'system' | 'tool';
3853
- /** @default null */
5220
+ /**
5221
+ * @description The message text. `null` when the message has no text, such as a tool call.
5222
+ * @default null
5223
+ */
3854
5224
  content?: string | null;
3855
- /** @default null */
5225
+ /**
5226
+ * @description The name of the tool for a `tool` message. `null` on other messages.
5227
+ * @default null
5228
+ */
3856
5229
  toolName?: string | null;
3857
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.
3858
5232
  * @default null
3859
5233
  * @enum {string|null}
3860
5234
  */
3861
5235
  toolType?: 'call' | 'result' | null;
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
+ */
5240
+ error?: string | null;
3862
5241
  }[];
5242
+ /** @description The provider of the model the agent used. When absent, the stored value stays unchanged. */
3863
5243
  modelProvider?: string;
5244
+ /** @description The ID of the model the agent used. When absent, the stored value stays unchanged. */
3864
5245
  modelId?: string;
3865
- /** @description ConversationTokenUsage */
5246
+ /** @description Token usage for one generation call. The API adds it to the conversation total, but only when this save changes the messages. */
3866
5247
  tokenUsage?: {
5248
+ /** @description The number of input tokens. */
3867
5249
  inputTokens?: number;
5250
+ /** @description The number of output tokens. */
3868
5251
  outputTokens?: number;
5252
+ /** @description The total number of tokens. */
3869
5253
  totalTokens?: number;
3870
5254
  };
3871
- /** @description ConversationMetadata */
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. */
3872
5256
  metadata?: {
3873
5257
  [key: string]: string | string[];
3874
5258
  };
3875
- /** @description ConversationSharing */
5259
+ /** @description Your choice to share conversation telemetry with Sanity. Replaces the stored setting. When absent, the stored value stays unchanged. */
3876
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. */
3877
5262
  metrics?: boolean;
5263
+ /** @description Whether to share full conversation transcripts with Sanity. When `true`, the API also sets `metrics` to `true`. */
3878
5264
  conversations?: boolean;
5265
+ /** @description How the Sanity team can reach you about your agent, such as an email address or a Discord handle. */
3879
5266
  contact?: string;
3880
5267
  };
3881
5268
  };
3882
5269
  };
3883
5270
  };
3884
5271
  responses: {
3885
- /** @description Conversation */
5272
+ /** @description A recorded agent conversation: its transcript, metadata, token usage, and classification. */
3886
5273
  200: {
3887
5274
  headers: {
3888
5275
  [name: string]: unknown;
3889
5276
  };
3890
5277
  content: {
3891
5278
  'application/json': {
5279
+ /** @description The conversation ID, unique within the organization. It matches the `_id` of the conversation document in your document store. */
3892
5280
  id: string;
5281
+ /** @description Your identifier for the conversation thread, unique within the organization. Saving with the same `threadId` updates the same conversation. */
3893
5282
  threadId: string;
3894
- /** @description ConversationMetadata */
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`. */
3895
5284
  metadata: {
3896
5285
  [key: string]: string | string[];
3897
5286
  } | null;
3898
- /** Format: date-time */
5287
+ /**
5288
+ * Format: date-time
5289
+ * @description When the API received the first save for this thread, as an ISO 8601 timestamp.
5290
+ */
3899
5291
  startedAt: string;
3900
- /** Format: date-time */
5292
+ /**
5293
+ * Format: date-time
5294
+ * @description When the conversation was last saved, as an ISO 8601 timestamp.
5295
+ */
3901
5296
  messagesUpdatedAt: string;
5297
+ /** @description The conversation transcript, in order. Each save replaces it. */
3902
5298
  messages: {
3903
- /** @enum {string} */
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
+ */
3904
5303
  role: 'user' | 'assistant' | 'system' | 'tool';
3905
- /** @default null */
5304
+ /**
5305
+ * @description The message text. `null` when the message has no text, such as a tool call.
5306
+ * @default null
5307
+ */
3906
5308
  content: string | null;
3907
- /** @default null */
5309
+ /**
5310
+ * @description The name of the tool for a `tool` message. `null` on other messages.
5311
+ * @default null
5312
+ */
3908
5313
  toolName: string | null;
3909
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.
3910
5316
  * @default null
3911
5317
  * @enum {string|null}
3912
5318
  */
3913
5319
  toolType: 'call' | 'result' | null;
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
+ */
5324
+ error: string | null;
5325
+ /**
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.
5328
+ * @default null
5329
+ */
5330
+ timestamp: string | null;
3914
5331
  }[];
5332
+ /** @description The provider of the model the agent used. `null` until a save includes `modelProvider`. */
3915
5333
  modelProvider: string | null;
5334
+ /** @description The ID of the model the agent used. `null` until a save includes `modelId`. */
3916
5335
  modelId: string | null;
3917
- /** @description ConversationTokenUsage */
5336
+ /** @description The running total of token usage for the conversation. `null` until a save includes `tokenUsage`. */
3918
5337
  tokenUsage: {
5338
+ /** @description The number of input tokens. */
3919
5339
  inputTokens?: number;
5340
+ /** @description The number of output tokens. */
3920
5341
  outputTokens?: number;
5342
+ /** @description The total number of tokens. */
3921
5343
  totalTokens?: number;
3922
5344
  } | null;
3923
- /** @description ConversationCoreMetrics */
5345
+ /** @description The latest classification result. `null` until you record one. */
3924
5346
  coreMetrics: {
5347
+ /** @description How well the agent resolved the user's needs, from 1 to 10. */
3925
5348
  successScore?: number;
3926
- /** @enum {string} */
5349
+ /**
5350
+ * @description The overall sentiment of the conversation.
5351
+ * @enum {string}
5352
+ */
3927
5353
  sentiment?: 'positive' | 'neutral' | 'negative';
5354
+ /** @description Topics the agent couldn't answer because it lacked content. */
3928
5355
  contentGaps?: string[];
3929
5356
  } | null;
3930
- /** Format: date-time */
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
+ */
3931
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. */
3932
5363
  classificationError: string | null;
3933
- /** @description ConversationSharing */
5364
+ /** @description Your choice to share conversation telemetry with Sanity. `null` until a save includes `sharing`. */
3934
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. */
3935
5367
  metrics?: boolean;
5368
+ /** @description Whether to share full conversation transcripts with Sanity. When `true`, the API also sets `metrics` to `true`. */
3936
5369
  conversations?: boolean;
5370
+ /** @description How the Sanity team can reach you about your agent, such as an email address or a Discord handle. */
3937
5371
  contact?: string;
3938
5372
  } | null;
3939
- /** Format: date-time */
5373
+ /**
5374
+ * Format: date-time
5375
+ * @description When the conversation was created, as an ISO 8601 timestamp.
5376
+ */
3940
5377
  createdAt: string;
3941
- /** Format: date-time */
5378
+ /**
5379
+ * Format: date-time
5380
+ * @description When the conversation was last changed, as an ISO 8601 timestamp.
5381
+ */
3942
5382
  updatedAt: string;
3943
5383
  };
3944
5384
  };
@@ -3950,82 +5390,143 @@ interface operations {
3950
5390
  query?: never;
3951
5391
  header?: never;
3952
5392
  path: {
5393
+ /** @description Your ID for the conversation thread, unique within your organization. Up to 200 characters. */
3953
5394
  threadId: string;
3954
5395
  };
3955
5396
  cookie?: never;
3956
5397
  };
3957
- /** @description ClassifyConversationInput */
5398
+ /** @description A classification result or failure for one conversation. Send exactly one of `coreMetrics` or `classificationError`. */
3958
5399
  requestBody: {
3959
5400
  content: {
3960
5401
  'application/json': {
5402
+ /** @description The classification result. The API sets `classifiedAt` and clears any recorded `classificationError`. */
3961
5403
  coreMetrics?: {
5404
+ /** @description How well the agent resolved the user's needs, as an integer from 1 to 10. */
3962
5405
  successScore: number;
3963
- /** @enum {string} */
5406
+ /**
5407
+ * @description The overall sentiment of the conversation.
5408
+ * @enum {string}
5409
+ */
3964
5410
  sentiment: 'positive' | 'neutral' | 'negative';
5411
+ /** @description Topics the agent couldn't answer because it lacked content. */
3965
5412
  contentGaps: string[];
3966
5413
  };
5414
+ /** @description Why your classifier couldn't classify the conversation. Any earlier classification result stays unchanged. */
3967
5415
  classificationError?: string;
3968
5416
  };
3969
5417
  };
3970
5418
  };
3971
5419
  responses: {
3972
- /** @description Conversation */
5420
+ /** @description A recorded agent conversation: its transcript, metadata, token usage, and classification. */
3973
5421
  200: {
3974
5422
  headers: {
3975
5423
  [name: string]: unknown;
3976
5424
  };
3977
5425
  content: {
3978
5426
  'application/json': {
5427
+ /** @description The conversation ID, unique within the organization. It matches the `_id` of the conversation document in your document store. */
3979
5428
  id: string;
5429
+ /** @description Your identifier for the conversation thread, unique within the organization. Saving with the same `threadId` updates the same conversation. */
3980
5430
  threadId: string;
3981
- /** @description ConversationMetadata */
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`. */
3982
5432
  metadata: {
3983
5433
  [key: string]: string | string[];
3984
5434
  } | null;
3985
- /** Format: date-time */
5435
+ /**
5436
+ * Format: date-time
5437
+ * @description When the API received the first save for this thread, as an ISO 8601 timestamp.
5438
+ */
3986
5439
  startedAt: string;
3987
- /** Format: date-time */
5440
+ /**
5441
+ * Format: date-time
5442
+ * @description When the conversation was last saved, as an ISO 8601 timestamp.
5443
+ */
3988
5444
  messagesUpdatedAt: string;
5445
+ /** @description The conversation transcript, in order. Each save replaces it. */
3989
5446
  messages: {
3990
- /** @enum {string} */
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
+ */
3991
5451
  role: 'user' | 'assistant' | 'system' | 'tool';
3992
- /** @default null */
5452
+ /**
5453
+ * @description The message text. `null` when the message has no text, such as a tool call.
5454
+ * @default null
5455
+ */
3993
5456
  content: string | null;
3994
- /** @default null */
5457
+ /**
5458
+ * @description The name of the tool for a `tool` message. `null` on other messages.
5459
+ * @default null
5460
+ */
3995
5461
  toolName: string | null;
3996
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.
3997
5464
  * @default null
3998
5465
  * @enum {string|null}
3999
5466
  */
4000
5467
  toolType: 'call' | 'result' | null;
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
+ */
5472
+ error: string | null;
5473
+ /**
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.
5476
+ * @default null
5477
+ */
5478
+ timestamp: string | null;
4001
5479
  }[];
5480
+ /** @description The provider of the model the agent used. `null` until a save includes `modelProvider`. */
4002
5481
  modelProvider: string | null;
5482
+ /** @description The ID of the model the agent used. `null` until a save includes `modelId`. */
4003
5483
  modelId: string | null;
4004
- /** @description ConversationTokenUsage */
5484
+ /** @description The running total of token usage for the conversation. `null` until a save includes `tokenUsage`. */
4005
5485
  tokenUsage: {
5486
+ /** @description The number of input tokens. */
4006
5487
  inputTokens?: number;
5488
+ /** @description The number of output tokens. */
4007
5489
  outputTokens?: number;
5490
+ /** @description The total number of tokens. */
4008
5491
  totalTokens?: number;
4009
5492
  } | null;
4010
- /** @description ConversationCoreMetrics */
5493
+ /** @description The latest classification result. `null` until you record one. */
4011
5494
  coreMetrics: {
5495
+ /** @description How well the agent resolved the user's needs, from 1 to 10. */
4012
5496
  successScore?: number;
4013
- /** @enum {string} */
5497
+ /**
5498
+ * @description The overall sentiment of the conversation.
5499
+ * @enum {string}
5500
+ */
4014
5501
  sentiment?: 'positive' | 'neutral' | 'negative';
5502
+ /** @description Topics the agent couldn't answer because it lacked content. */
4015
5503
  contentGaps?: string[];
4016
5504
  } | null;
4017
- /** Format: date-time */
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
+ */
4018
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. */
4019
5511
  classificationError: string | null;
4020
- /** @description ConversationSharing */
5512
+ /** @description Your choice to share conversation telemetry with Sanity. `null` until a save includes `sharing`. */
4021
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. */
4022
5515
  metrics?: boolean;
5516
+ /** @description Whether to share full conversation transcripts with Sanity. When `true`, the API also sets `metrics` to `true`. */
4023
5517
  conversations?: boolean;
5518
+ /** @description How the Sanity team can reach you about your agent, such as an email address or a Discord handle. */
4024
5519
  contact?: string;
4025
5520
  } | null;
4026
- /** Format: date-time */
5521
+ /**
5522
+ * Format: date-time
5523
+ * @description When the conversation was created, as an ISO 8601 timestamp.
5524
+ */
4027
5525
  createdAt: string;
4028
- /** Format: date-time */
5526
+ /**
5527
+ * Format: date-time
5528
+ * @description When the conversation was last changed, as an ISO 8601 timestamp.
5529
+ */
4029
5530
  updatedAt: string;
4030
5531
  };
4031
5532
  };
@@ -4487,22 +5988,37 @@ declare class ContextClient {
4487
5988
  id: string;
4488
5989
  knowledgeBaseId: string;
4489
5990
  content: {
4490
- kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
4491
5991
  severity: 'critical' | 'suggestion';
4492
5992
  scopePath: string;
4493
5993
  issue: string;
4494
5994
  suggestedFix: string;
5995
+ kind: 'conflict';
5996
+ claimKey: string;
5997
+ sides: {
5998
+ claim: string;
5999
+ value?: string;
6000
+ entryPaths?: string[];
6001
+ sourceIds?: string[];
6002
+ span?: {
6003
+ sourceId: string;
6004
+ lineStart: number;
6005
+ lineEnd: number;
6006
+ };
6007
+ authority?: 'primary' | 'secondary' | 'community';
6008
+ }[];
6009
+ suggested?: number;
6010
+ } | {
6011
+ severity: 'critical' | 'suggestion';
6012
+ scopePath: string;
6013
+ issue: string;
6014
+ suggestedFix: string;
6015
+ kind: 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
4495
6016
  citedSourceIds?: string[];
4496
6017
  claimKey?: string;
4497
6018
  involvedScopes?: string[];
4498
- currentClaim?: string;
4499
- alternativeClaim?: string;
4500
- currentAuthority?: 'primary' | 'secondary' | 'community';
4501
- alternativeAuthority?: 'primary' | 'secondary' | 'community';
4502
- suggestedResolution?: 'keep_existing' | 'accept_new';
4503
6019
  };
4504
6020
  status: 'open' | 'accepted' | 'rejected';
4505
- resolution: 'keep_existing' | 'accept_new' | null;
6021
+ resolution: number | null;
4506
6022
  resolvedBy: {
4507
6023
  id: string;
4508
6024
  kind: 'user' | 'robot';
@@ -4518,22 +6034,37 @@ declare class ContextClient {
4518
6034
  id: string;
4519
6035
  knowledgeBaseId: string;
4520
6036
  content: {
4521
- kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
4522
6037
  severity: 'critical' | 'suggestion';
4523
6038
  scopePath: string;
4524
6039
  issue: string;
4525
6040
  suggestedFix: string;
6041
+ kind: 'conflict';
6042
+ claimKey: string;
6043
+ sides: {
6044
+ claim: string;
6045
+ value?: string;
6046
+ entryPaths?: string[];
6047
+ sourceIds?: string[];
6048
+ span?: {
6049
+ sourceId: string;
6050
+ lineStart: number;
6051
+ lineEnd: number;
6052
+ };
6053
+ authority?: 'primary' | 'secondary' | 'community';
6054
+ }[];
6055
+ suggested?: number;
6056
+ } | {
6057
+ severity: 'critical' | 'suggestion';
6058
+ scopePath: string;
6059
+ issue: string;
6060
+ suggestedFix: string;
6061
+ kind: 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
4526
6062
  citedSourceIds?: string[];
4527
6063
  claimKey?: string;
4528
6064
  involvedScopes?: string[];
4529
- currentClaim?: string;
4530
- alternativeClaim?: string;
4531
- currentAuthority?: 'primary' | 'secondary' | 'community';
4532
- alternativeAuthority?: 'primary' | 'secondary' | 'community';
4533
- suggestedResolution?: 'keep_existing' | 'accept_new';
4534
6065
  };
4535
6066
  status: 'open' | 'accepted' | 'rejected';
4536
- resolution: 'keep_existing' | 'accept_new' | null;
6067
+ resolution: number | null;
4537
6068
  resolvedBy: {
4538
6069
  id: string;
4539
6070
  kind: 'user' | 'robot';
@@ -4547,22 +6078,37 @@ declare class ContextClient {
4547
6078
  id: string;
4548
6079
  knowledgeBaseId: string;
4549
6080
  content: {
4550
- kind: 'conflict' | 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
4551
6081
  severity: 'critical' | 'suggestion';
4552
6082
  scopePath: string;
4553
6083
  issue: string;
4554
6084
  suggestedFix: string;
6085
+ kind: 'conflict';
6086
+ claimKey: string;
6087
+ sides: {
6088
+ claim: string;
6089
+ value?: string;
6090
+ entryPaths?: string[];
6091
+ sourceIds?: string[];
6092
+ span?: {
6093
+ sourceId: string;
6094
+ lineStart: number;
6095
+ lineEnd: number;
6096
+ };
6097
+ authority?: 'primary' | 'secondary' | 'community';
6098
+ }[];
6099
+ suggested?: number;
6100
+ } | {
6101
+ severity: 'critical' | 'suggestion';
6102
+ scopePath: string;
6103
+ issue: string;
6104
+ suggestedFix: string;
6105
+ kind: 'gap' | 'update_required' | 'add_entry' | 'remove_entry' | 'split_entry' | 'merge_entry';
4555
6106
  citedSourceIds?: string[];
4556
6107
  claimKey?: string;
4557
6108
  involvedScopes?: string[];
4558
- currentClaim?: string;
4559
- alternativeClaim?: string;
4560
- currentAuthority?: 'primary' | 'secondary' | 'community';
4561
- alternativeAuthority?: 'primary' | 'secondary' | 'community';
4562
- suggestedResolution?: 'keep_existing' | 'accept_new';
4563
6109
  };
4564
6110
  status: 'open' | 'accepted' | 'rejected';
4565
- resolution: 'keep_existing' | 'accept_new' | null;
6111
+ resolution: number | null;
4566
6112
  resolvedBy: {
4567
6113
  id: string;
4568
6114
  kind: 'user' | 'robot';
@@ -4597,7 +6143,7 @@ declare class ContextClient {
4597
6143
  origin: 'conflict' | 'human';
4598
6144
  status: 'active' | 'archived';
4599
6145
  statement: string;
4600
- scopeSourceIds: string[] | null;
6146
+ scopeSourceIds: string[];
4601
6147
  archivedAt: string | null;
4602
6148
  archivedReason: string | null;
4603
6149
  sourceIssueId: string | null;
@@ -4700,6 +6246,7 @@ declare class ContextClient {
4700
6246
  tldr: string | null;
4701
6247
  topics: string[] | null;
4702
6248
  canonicalUrl: string | null;
6249
+ externalId: string | null;
4703
6250
  fetchedAt: string | null;
4704
6251
  distilledAt: string | null;
4705
6252
  createdAt: string;
@@ -4718,6 +6265,7 @@ declare class ContextClient {
4718
6265
  tldr: string | null;
4719
6266
  topics: string[] | null;
4720
6267
  canonicalUrl: string | null;
6268
+ externalId: string | null;
4721
6269
  fetchedAt: string | null;
4722
6270
  distilledAt: string | null;
4723
6271
  createdAt: string;
@@ -10078,5 +11626,5 @@ interface MediaLibraryAssetDocument {
10078
11626
  parent?: SanityReference | null;
10079
11627
  rootDirectory?: Any$1;
10080
11628
  }
10081
- export { DisconnectEvent as $, UnpublishVersionAction as $n, ObservableCollaborationCommentsClient as $r, QueryWithoutParams as $t, ContentSourceMapMappings as A, AgentActionParam 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, TransformTarget as Ci, SanityDocument$1 as Cn, WelcomeEvent as Cr, LiveEventGoAway as Ct, ContentSourceMapDocuments$1 as D, PatchDocument as Di, SanityProject as Dn, GenerateTargetDocument as Dr, LiveEventWelcome as Dt, ContentSourceMapDocumentValueSource as E, PromptRequest as Ei, SanityImagePalette as En, GenerateTarget as Er, LiveEventRestart as Et, ContentSourceMapValueMapping as F, ConstantAgentActionParam 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, DocumentAgentActionParam 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, FieldAgentActionParam as Li, SingleMutationResult as Ln, InvokeFunctionEvent as Lr, MutationErrorItem as Lt, ContentSourceMapRemoteDocument as M, AgentActionPath as Mi, SanityReference as Mn, UsersClient as Mr, MediaLibraryVideoPlaybackTransformations as Mt, ContentSourceMapSource as N, AgentActionPathSegment as Ni, SanitySchemasByResource as Nn, ObservableProjectsClient as Nr, MultipleActionResult as Nt, ContentSourceMapLiteralSource as O, PatchOperation as Oi, SanityProjectMember as On, GenerateTargetInclude as Or, MediaLibraryAssetDocument as Ot, ContentSourceMapUnknownSource as P, AgentActionTarget 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, GroqAgentActionParam as Ri, StackablePerspective as Rn, InvokeFunctionOptions as Rr, MutationEvent as Rt, ClientVariantConditions as S, TransformOperation as Si, SanityAssetDocument as Sn, WelcomeBackEvent as Sr, LiveEvent as St, ContentSourceMapDocumentBase as T, TransformTargetInclude 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 _, TranslateDocument as _i, Requester as _n, VideoRenditionInfoPublic as _r, InsertPatch as _t, AllDocumentsMutationOptions as a, CollaborationCommentRange as ai, ReleaseCardinality as an, UploadResponseEvent as ar, EditableReleaseDocument as at, ClientReturn$1 as b, ImageDescriptionOperation as bi, ResumableListenEventNames as bn, VideoSubtitleInfoPublic as br, ListenOptions as bt, Any$1 as c, CollaborationCommentStatus as ci, ReleaseState as cn, VersionAction as cr, ErrorProps as ct, AssetMetadataType as d, CollaborationCommentsListenOptions as di, ReplaceVersionAction as dn, VideoPlaybackInfoItemPublic as dr, FirstDocumentMutationOptions as dt, CollaborationCommentCreate as ei, RawQueryResponse$1 as en, UnscheduleReleaseAction as er, EXPERIMENTAL_API_WARNING as et, AttributeSet as f, CollaborationCommentsRequestOptions as fi, RequestHandler as fn, VideoPlaybackInfoItemSigned as fr, FitMode as ft, BaseMutationOptions as g, ObservableAssetsClient as gi, RequestUrlOptions as gn, VideoRenditionInfo as gr, InitializedClientConfig$1 as gt, BaseActionOptions as h, AssetsClient as hi, RequestOptions$1 as hn, VideoPlaybackTokens as hr, ImportReleaseAction as ht, AllDocumentIdsMutationOptions as i, CollaborationCommentPortableTextBlock as ii, ReleaseAction as in, UploadProgressEvent as ir, EditVariantDefinitionAction as it, ContentSourceMapPaths as j, AgentActionParams as ji, SanityQueriesByResource as jn, ObservableUsersClient as jr, MediaLibraryPlaybackInfoOptions as jt, ContentSourceMapMapping as k, PatchTarget as ki, SanityProjectionsByResource as kn, ObservableSanityClient$1 as kr, MediaLibraryAssetInstanceIdentifier as kt, ApiError as l, CollaborationCommentTarget as li, ReleaseType as ln, VideoPlaybackInfo as lr, FilteredResponseQueryOptions as lt, AuthProviderResponse as m, _listen as mi, RequestObservableOptions as mn, VideoPlaybackInfoSigned as mr, IdentifiedSanityDocumentStub as mt, ActionError as n, CollaborationCommentFieldValue as ni, RawRequestOptions as nn, UploadClientConfig as nr, EditReleaseAction as nt, AnimatedImageFormat as o, CollaborationCommentReactionShortName as oi, ReleaseDocument as on, VariantAction as or, EmbeddingsSettings as ot, AuthProvider as p, CollaborationCommentsWriteOptions 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, CollaborationCommentMessage as ri, ReconnectEvent as rn, UploadEvent as rr, EditVariantAction as rt, AnimatedTransformOptions as s, CollaborationCommentSelection as si, ReleaseId as sn, VariantDefinitionAction as sr, EmbeddingsSettingsBody as st, Action as t, CollaborationCommentDocument as ti, RawQuerylessQueryResponse as tn, UploadBody as tr, EditAction as tt, ArchiveReleaseAction as u, CollaborationCommentUpdate as ui, ReplaceDraftAction as un, VideoPlaybackInfoItem as ur, FirstDocumentIdMutationOptions as ut, ClientConfig$1 as v, TranslateTarget as vi, ResetEvent as vn, VideoRenditionInfoSigned as vr, ListenEvent as vt, ContentSourceMapDocument as w, TransformTargetDocument as wi, SanityDocumentStub as wn, GenerateInstruction as wr, LiveEventMessage as wt, ClientVariant as x, TransformDocument as xi, ResumableListenOptions as xn, VideoSubtitleInfoSigned as xr, ListenParams as xt, ClientPerspective$1 as y, TranslateTargetInclude as yi, ResponseQueryOptions as yn, VideoSubtitleInfo as yr, ListenEventName as yt, CreateVariantDefinitionAction as z, StillImageFormat as zn, InvokeFunctionRequest as zr, MutationOperation as zt };
10082
- //# sourceMappingURL=types-Do7-A3K9.d.ts.map
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 };
11630
+ //# sourceMappingURL=types-KoKIKv8Z.d.ts.map