@sanity/client 8.2.0 → 8.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +2 -2
  2. package/dist/{browserUpload-2tz6Sdqp.js → browserUpload-C7PwCs-C.js} +6 -9
  3. package/dist/browserUpload-C7PwCs-C.js.map +1 -0
  4. package/dist/{browserUpload-CwpNx7Vl.js → browserUpload-D-2Rmfjo.js} +6 -9
  5. package/dist/browserUpload-D-2Rmfjo.js.map +1 -0
  6. package/dist/{config-3wiPP-sZ.js → config-CgJ16jET.js} +4 -2
  7. package/dist/config-CgJ16jET.js.map +1 -0
  8. package/dist/csm.js +1 -1
  9. package/dist/{dist-C9ExSk2R.js → dist-C5K_YcEU.js} +3 -2
  10. package/dist/{dist-C9ExSk2R.js.map → dist-C5K_YcEU.js.map} +1 -1
  11. package/dist/index.d.ts +2 -2
  12. package/dist/index.js +942 -115
  13. package/dist/index.js.map +1 -1
  14. package/dist/index.node.d.ts +3345 -16
  15. package/dist/index.node.js +865 -59
  16. package/dist/index.node.js.map +1 -1
  17. package/dist/media-library.d.ts +1 -1
  18. package/dist/rolldown-runtime-4YWMqDIC.js +9 -0
  19. package/dist/{stegaEncodeSourceMap-DbM2fTN4.js → stegaEncodeSourceMap-CO1HKnm2.js} +2 -2
  20. package/dist/{stegaEncodeSourceMap-DbM2fTN4.js.map → stegaEncodeSourceMap-CO1HKnm2.js.map} +1 -1
  21. package/dist/{types-nJhm5Nyq.d.ts → types-DiPF0ENT.d.ts} +3346 -17
  22. package/package.json +3 -3
  23. package/src/SanityClient.ts +7 -0
  24. package/src/assets/AssetsClient.ts +5 -0
  25. package/src/collaboration/types.ts +59 -8
  26. package/src/config.ts +1 -0
  27. package/src/context/ContextClient.ts +1006 -0
  28. package/src/context/openapi.json +5345 -0
  29. package/src/context/reads.ts +206 -0
  30. package/src/context/store.ts +100 -0
  31. package/src/context/types.gen.ts +2428 -0
  32. package/src/context/types.ts +228 -0
  33. package/src/data/dataMethods.ts +4 -1
  34. package/src/defineCreateClient.ts +1 -0
  35. package/src/functions/FunctionsClient.ts +52 -9
  36. package/src/functions/invoke.ts +47 -6
  37. package/src/http/browserUpload.ts +0 -12
  38. package/src/types.ts +29 -3
  39. package/src/util/createVersionId.ts +15 -5
  40. package/src/validators.ts +1 -0
  41. package/dist/browserUpload-2tz6Sdqp.js.map +0 -1
  42. package/dist/browserUpload-CwpNx7Vl.js.map +0 -1
  43. package/dist/config-3wiPP-sZ.js.map +0 -1
@@ -0,0 +1,2428 @@
1
+ /**
2
+ * This file was auto-generated by openapi-typescript.
3
+ * Do not make direct changes to the file.
4
+ */
5
+
6
+ export interface paths {
7
+ '/{apiVersion}/context/knowledge-bases': {
8
+ parameters: {
9
+ query?: never
10
+ header?: never
11
+ path?: never
12
+ cookie?: never
13
+ }
14
+ /**
15
+ * List knowledge bases
16
+ * @description Returns the organization's knowledge bases visible to the caller, cursor-paginated.
17
+ */
18
+ get: operations['listKnowledgeBases']
19
+ put?: never
20
+ /**
21
+ * Create a knowledge base
22
+ * @description Creates a knowledge base bound to a Sanity dataset, where its content documents will be stored.
23
+ */
24
+ post: operations['createKnowledgeBase']
25
+ delete?: never
26
+ options?: never
27
+ head?: never
28
+ patch?: never
29
+ trace?: never
30
+ }
31
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}': {
32
+ parameters: {
33
+ query?: never
34
+ header?: never
35
+ path?: never
36
+ cookie?: never
37
+ }
38
+ /**
39
+ * Get a knowledge base
40
+ * @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.
41
+ */
42
+ get: operations['getKnowledgeBase']
43
+ put?: never
44
+ post?: never
45
+ /**
46
+ * Delete a knowledge base
47
+ * @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.
48
+ */
49
+ delete: operations['deleteKnowledgeBase']
50
+ options?: never
51
+ head?: never
52
+ /**
53
+ * Update a knowledge base
54
+ * @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.
55
+ */
56
+ patch: operations['updateKnowledgeBase']
57
+ trace?: never
58
+ }
59
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/build': {
60
+ parameters: {
61
+ query?: never
62
+ header?: never
63
+ path?: never
64
+ cookie?: never
65
+ }
66
+ get?: never
67
+ put?: never
68
+ /**
69
+ * Trigger a knowledge base build
70
+ * @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.
71
+ */
72
+ post: operations['buildKnowledgeBase']
73
+ delete?: never
74
+ options?: never
75
+ head?: never
76
+ patch?: never
77
+ trace?: never
78
+ }
79
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/build/cancel': {
80
+ parameters: {
81
+ query?: never
82
+ header?: never
83
+ path?: never
84
+ cookie?: never
85
+ }
86
+ get?: never
87
+ put?: never
88
+ /**
89
+ * Cancel an in-progress build
90
+ * @description Cancels the running build and resets the knowledge base so it can be rebuilt.
91
+ */
92
+ post: operations['cancelKnowledgeBaseBuild']
93
+ delete?: never
94
+ options?: never
95
+ head?: never
96
+ patch?: never
97
+ trace?: never
98
+ }
99
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/entries/{entryPath}/rebuild': {
100
+ parameters: {
101
+ query?: never
102
+ header?: never
103
+ path?: never
104
+ cookie?: never
105
+ }
106
+ get?: never
107
+ put?: never
108
+ /**
109
+ * Rebuild an entry from its sources
110
+ * @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.
111
+ */
112
+ post: operations['rebuildEntry']
113
+ delete?: never
114
+ options?: never
115
+ head?: never
116
+ patch?: never
117
+ trace?: never
118
+ }
119
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/imports': {
120
+ parameters: {
121
+ query?: never
122
+ header?: never
123
+ path?: never
124
+ cookie?: never
125
+ }
126
+ /**
127
+ * List imports
128
+ * @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`.
129
+ */
130
+ get: operations['listImports']
131
+ put?: never
132
+ /**
133
+ * Create an import (text, crawl, or dataset)
134
+ * @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.
135
+ */
136
+ post: operations['createImport']
137
+ delete?: never
138
+ options?: never
139
+ head?: never
140
+ patch?: never
141
+ trace?: never
142
+ }
143
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/imports/uploads': {
144
+ parameters: {
145
+ query?: never
146
+ header?: never
147
+ path?: never
148
+ cookie?: never
149
+ }
150
+ get?: never
151
+ put?: never
152
+ /**
153
+ * Start a file-upload import
154
+ * @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.
155
+ */
156
+ post: operations['startUpload']
157
+ delete?: never
158
+ options?: never
159
+ head?: never
160
+ patch?: never
161
+ trace?: never
162
+ }
163
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/imports/uploads/{importId}/complete': {
164
+ parameters: {
165
+ query?: never
166
+ header?: never
167
+ path?: never
168
+ cookie?: never
169
+ }
170
+ get?: never
171
+ put?: never
172
+ /**
173
+ * Complete a file-upload import
174
+ * @description Call after the file bytes are uploaded to the signed URL. Starts processing and returns a job id to poll.
175
+ */
176
+ post: operations['completeUpload']
177
+ delete?: never
178
+ options?: never
179
+ head?: never
180
+ patch?: never
181
+ trace?: never
182
+ }
183
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/imports/{importId}': {
184
+ parameters: {
185
+ query?: never
186
+ header?: never
187
+ path?: never
188
+ cookie?: never
189
+ }
190
+ /**
191
+ * Get a single import
192
+ * @description Returns one import with its kind and processing status.
193
+ */
194
+ get: operations['getImport']
195
+ put?: never
196
+ post?: never
197
+ /**
198
+ * Delete an import
199
+ * @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.
200
+ */
201
+ delete: operations['deleteImport']
202
+ options?: never
203
+ head?: never
204
+ patch?: never
205
+ trace?: never
206
+ }
207
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/imports/{importId}/download': {
208
+ parameters: {
209
+ query?: never
210
+ header?: never
211
+ path?: never
212
+ cookie?: never
213
+ }
214
+ /**
215
+ * Get a download URL for an import
216
+ * @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`.
217
+ */
218
+ get: operations['downloadImport']
219
+ put?: never
220
+ post?: never
221
+ delete?: never
222
+ options?: never
223
+ head?: never
224
+ patch?: never
225
+ trace?: never
226
+ }
227
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/instructions': {
228
+ parameters: {
229
+ query?: never
230
+ header?: never
231
+ path?: never
232
+ cookie?: never
233
+ }
234
+ get?: never
235
+ put?: never
236
+ /**
237
+ * Author a human instruction
238
+ * @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.
239
+ */
240
+ post: operations['createInstruction']
241
+ delete?: never
242
+ options?: never
243
+ head?: never
244
+ patch?: never
245
+ trace?: never
246
+ }
247
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/instructions/{instructionId}': {
248
+ parameters: {
249
+ query?: never
250
+ header?: never
251
+ path?: never
252
+ cookie?: never
253
+ }
254
+ get?: never
255
+ put?: never
256
+ post?: never
257
+ /**
258
+ * Delete an instruction
259
+ * @description Deletes the rule. Builds stop honoring it from the next run.
260
+ */
261
+ delete: operations['deleteInstruction']
262
+ options?: never
263
+ head?: never
264
+ /**
265
+ * Edit an instruction
266
+ * @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.
267
+ */
268
+ patch: operations['updateInstruction']
269
+ trace?: never
270
+ }
271
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/issues/apply': {
272
+ parameters: {
273
+ query?: never
274
+ header?: never
275
+ path?: never
276
+ cookie?: never
277
+ }
278
+ get?: never
279
+ put?: never
280
+ /**
281
+ * Apply accepted issues to a Context
282
+ * @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.
283
+ */
284
+ post: operations['applyIssues']
285
+ delete?: never
286
+ options?: never
287
+ head?: never
288
+ patch?: never
289
+ trace?: never
290
+ }
291
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/issues/{issueId}/dismiss': {
292
+ parameters: {
293
+ query?: never
294
+ header?: never
295
+ path?: never
296
+ cookie?: never
297
+ }
298
+ get?: never
299
+ put?: never
300
+ /**
301
+ * Dismiss an issue
302
+ * @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.
303
+ */
304
+ post: operations['dismissIssue']
305
+ delete?: never
306
+ options?: never
307
+ head?: never
308
+ patch?: never
309
+ trace?: never
310
+ }
311
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/issues/{issueId}/reopen': {
312
+ parameters: {
313
+ query?: never
314
+ header?: never
315
+ path?: never
316
+ cookie?: never
317
+ }
318
+ get?: never
319
+ put?: never
320
+ /**
321
+ * Reopen an accepted conflict
322
+ * @description Returns an accepted conflict to triage, clearing its resolution and deleting the instruction it minted. Idempotent for issues that are not accepted conflicts.
323
+ */
324
+ post: operations['reopenIssue']
325
+ delete?: never
326
+ options?: never
327
+ head?: never
328
+ patch?: never
329
+ trace?: never
330
+ }
331
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/issues/{issueId}/resolve': {
332
+ parameters: {
333
+ query?: never
334
+ header?: never
335
+ path?: never
336
+ cookie?: never
337
+ }
338
+ get?: never
339
+ put?: never
340
+ /**
341
+ * Resolve a conflict issue
342
+ * @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.
343
+ */
344
+ post: operations['resolveIssue']
345
+ delete?: never
346
+ options?: never
347
+ head?: never
348
+ patch?: never
349
+ trace?: never
350
+ }
351
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/jobs/{jobId}': {
352
+ parameters: {
353
+ query?: never
354
+ header?: never
355
+ path?: never
356
+ cookie?: never
357
+ }
358
+ /**
359
+ * Get a job by id
360
+ * @description Returns the status of a job, such as a build or an import. Job ids come from the endpoint that queued the work.
361
+ */
362
+ get: operations['getJob']
363
+ put?: never
364
+ post?: never
365
+ delete?: never
366
+ options?: never
367
+ head?: never
368
+ patch?: never
369
+ trace?: never
370
+ }
371
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/refresh': {
372
+ parameters: {
373
+ query?: never
374
+ header?: never
375
+ path?: never
376
+ cookie?: never
377
+ }
378
+ get?: never
379
+ put?: never
380
+ /**
381
+ * Trigger an incremental refresh
382
+ * @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.
383
+ */
384
+ post: operations['refreshKnowledgeBase']
385
+ delete?: never
386
+ options?: never
387
+ head?: never
388
+ patch?: never
389
+ trace?: never
390
+ }
391
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/sources': {
392
+ parameters: {
393
+ query?: never
394
+ header?: never
395
+ path?: never
396
+ cookie?: never
397
+ }
398
+ /**
399
+ * List sources
400
+ * @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`.
401
+ */
402
+ get: operations['listSources']
403
+ put?: never
404
+ post?: never
405
+ delete?: never
406
+ options?: never
407
+ head?: never
408
+ patch?: never
409
+ trace?: never
410
+ }
411
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/sources/{sourceId}': {
412
+ parameters: {
413
+ query?: never
414
+ header?: never
415
+ path?: never
416
+ cookie?: never
417
+ }
418
+ /**
419
+ * Get a single source
420
+ * @description Returns one source with its metadata and processing status.
421
+ */
422
+ get: operations['getSource']
423
+ put?: never
424
+ post?: never
425
+ /**
426
+ * Delete a source
427
+ * @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.
428
+ */
429
+ delete: operations['deleteSource']
430
+ options?: never
431
+ head?: never
432
+ patch?: never
433
+ trace?: never
434
+ }
435
+ '/{apiVersion}/context/knowledge-bases/{knowledgeBaseId}/sources/{sourceId}/content': {
436
+ parameters: {
437
+ query?: never
438
+ header?: never
439
+ path?: never
440
+ cookie?: never
441
+ }
442
+ /**
443
+ * Read a source's distilled content
444
+ * @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.
445
+ */
446
+ get: operations['getSourceContent']
447
+ put?: never
448
+ post?: never
449
+ delete?: never
450
+ options?: never
451
+ head?: never
452
+ patch?: never
453
+ trace?: never
454
+ }
455
+ '/{apiVersion}/context/organizations/{organizationId}/conversations/{threadId}': {
456
+ parameters: {
457
+ query?: never
458
+ header?: never
459
+ path?: never
460
+ cookie?: never
461
+ }
462
+ get?: never
463
+ /**
464
+ * Record a conversation
465
+ * @description Upserts the conversation telemetry for one thread. `threadId` identifies the conversation within your organization — reuse means the same conversation. Messages replace the stored transcript wholesale; `metadata` and model fields only overwrite when present. Last write per thread wins — retries are safe.
466
+ */
467
+ put: operations['saveConversation']
468
+ post?: never
469
+ delete?: never
470
+ options?: never
471
+ head?: never
472
+ /**
473
+ * Record a classification verdict
474
+ * @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.
475
+ */
476
+ patch: operations['classifyConversation']
477
+ trace?: never
478
+ }
479
+ }
480
+ export type webhooks = Record<string, never>
481
+ export interface components {
482
+ schemas: {
483
+ /** @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. */
484
+ ConversationDoc: {
485
+ _id: string
486
+ _rev: string
487
+ /** Format: date-time */
488
+ _createdAt: string
489
+ /** Format: date-time */
490
+ _updatedAt: string
491
+ /** @enum {string} */
492
+ _type: 'sanity.context.conversation'
493
+ /** @enum {number} */
494
+ schemaVersion: 1
495
+ organizationId: string
496
+ threadId: string
497
+ /** @description ConversationMetadata */
498
+ metadata: {
499
+ [key: string]: string | string[]
500
+ } | null
501
+ /** Format: date-time */
502
+ startedAt: string
503
+ /** Format: date-time */
504
+ messagesUpdatedAt: string
505
+ messages: {
506
+ /** @enum {string} */
507
+ role: 'user' | 'assistant' | 'system' | 'tool'
508
+ /** @default null */
509
+ content: string | null
510
+ /** @default null */
511
+ toolName: string | null
512
+ /**
513
+ * @default null
514
+ * @enum {string|null}
515
+ */
516
+ toolType: 'call' | 'result' | null
517
+ }[]
518
+ modelProvider: string | null
519
+ modelId: string | null
520
+ /** @description ConversationTokenUsage */
521
+ tokenUsage: {
522
+ inputTokens?: number
523
+ outputTokens?: number
524
+ totalTokens?: number
525
+ } | null
526
+ /** @description ConversationCoreMetrics */
527
+ coreMetrics: {
528
+ successScore?: number
529
+ /** @enum {string} */
530
+ sentiment?: 'positive' | 'neutral' | 'negative'
531
+ contentGaps?: string[]
532
+ } | null
533
+ /** Format: date-time */
534
+ classifiedAt: string | null
535
+ classificationError: string | null
536
+ }
537
+ /** @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. */
538
+ EntryDoc: {
539
+ _id: string
540
+ _rev: string
541
+ /** Format: date-time */
542
+ _createdAt: string
543
+ /** Format: date-time */
544
+ _updatedAt: string
545
+ knowledgeBaseId: string
546
+ /** @enum {string} */
547
+ _type: 'sanity.context.entry'
548
+ schemaVersion: number
549
+ revisionId: string
550
+ path: string
551
+ title: string
552
+ tldr?: {
553
+ scope: string
554
+ excludes: string
555
+ neighbors?: string[]
556
+ /** @enum {string} */
557
+ centrality: 'core' | 'standard' | 'peripheral'
558
+ }
559
+ body?: string
560
+ topicHeadings?: string[]
561
+ citations?: {
562
+ sourceId: string
563
+ supports?: string
564
+ spans?: {
565
+ sourceLineStart: number
566
+ sourceLineEnd: number
567
+ quote: string
568
+ }[]
569
+ claim?: {
570
+ exact: string
571
+ prefix?: string
572
+ suffix?: string
573
+ }
574
+ /** @enum {string} */
575
+ groundingState?: 'drifted'
576
+ _key: string
577
+ /** @enum {string} */
578
+ _type: 'sanity.context.citation'
579
+ filename: string
580
+ mime?: string
581
+ excerpt?: string
582
+ }[]
583
+ /** @enum {string} */
584
+ status: 'virtual' | 'outlined' | 'filled' | 'stale' | 'generation_failed'
585
+ generatedAt: string
586
+ }
587
+ /** @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. */
588
+ InstructionDoc:
589
+ | {
590
+ _id: string
591
+ _rev: string
592
+ /** Format: date-time */
593
+ _createdAt: string
594
+ /** Format: date-time */
595
+ _updatedAt: string
596
+ knowledgeBaseId: string
597
+ /** @enum {string} */
598
+ _type: 'sanity.context.instruction'
599
+ /** @enum {number} */
600
+ schemaVersion: 1
601
+ statement: string
602
+ scopeSources:
603
+ | {
604
+ _key: string
605
+ sourceId: string
606
+ contentHash: string
607
+ }[]
608
+ | null
609
+ /** @enum {string} */
610
+ status: 'active' | 'archived'
611
+ archivedAt: string | null
612
+ archivedReason: string | null
613
+ /** @enum {string} */
614
+ origin: 'conflict'
615
+ sourceIssueId: string
616
+ }
617
+ | {
618
+ _id: string
619
+ _rev: string
620
+ /** Format: date-time */
621
+ _createdAt: string
622
+ /** Format: date-time */
623
+ _updatedAt: string
624
+ knowledgeBaseId: string
625
+ /** @enum {string} */
626
+ _type: 'sanity.context.instruction'
627
+ /** @enum {number} */
628
+ schemaVersion: 1
629
+ statement: string
630
+ scopeSources:
631
+ | {
632
+ _key: string
633
+ sourceId: string
634
+ contentHash: string
635
+ }[]
636
+ | null
637
+ /** @enum {string} */
638
+ status: 'active' | 'archived'
639
+ archivedAt: string | null
640
+ archivedReason: string | null
641
+ /** @enum {string} */
642
+ origin: 'human'
643
+ /** @enum {string|null} */
644
+ sourceIssueId: null
645
+ }
646
+ /** @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`. */
647
+ IssueDoc:
648
+ | {
649
+ _id: string
650
+ _rev: string
651
+ /** Format: date-time */
652
+ _createdAt: string
653
+ /** Format: date-time */
654
+ _updatedAt: string
655
+ knowledgeBaseId: string
656
+ /** @enum {string} */
657
+ _type: 'sanity.context.issue'
658
+ /** @enum {number} */
659
+ schemaVersion: 1
660
+ /** @description IssueContent */
661
+ content: {
662
+ /** @enum {string} */
663
+ kind:
664
+ | 'conflict'
665
+ | 'gap'
666
+ | 'update_required'
667
+ | 'add_entry'
668
+ | 'remove_entry'
669
+ | 'split_entry'
670
+ | 'merge_entry'
671
+ /** @enum {string} */
672
+ severity: 'critical' | 'suggestion'
673
+ scopePath: string
674
+ issue: string
675
+ suggestedFix: string
676
+ citedSourceIds?: string[]
677
+ claimKey?: string
678
+ involvedScopes?: string[]
679
+ currentClaim?: string
680
+ alternativeClaim?: string
681
+ /** @enum {string} */
682
+ currentAuthority?: 'primary' | 'secondary' | 'community'
683
+ /** @enum {string} */
684
+ alternativeAuthority?: 'primary' | 'secondary' | 'community'
685
+ /** @enum {string} */
686
+ suggestedResolution?: 'keep_existing' | 'accept_new'
687
+ }
688
+ fingerprint: string
689
+ revisionId: string | null
690
+ /** @enum {string} */
691
+ status: 'open'
692
+ /** @enum {string|null} */
693
+ resolution: null
694
+ /** @enum {string|null} */
695
+ resolvedAt: null
696
+ /** @enum {string|null} */
697
+ resolvedBy: null
698
+ }
699
+ | {
700
+ _id: string
701
+ _rev: string
702
+ /** Format: date-time */
703
+ _createdAt: string
704
+ /** Format: date-time */
705
+ _updatedAt: string
706
+ knowledgeBaseId: string
707
+ /** @enum {string} */
708
+ _type: 'sanity.context.issue'
709
+ /** @enum {number} */
710
+ schemaVersion: 1
711
+ /** @description IssueContent */
712
+ content: {
713
+ /** @enum {string} */
714
+ kind:
715
+ | 'conflict'
716
+ | 'gap'
717
+ | 'update_required'
718
+ | 'add_entry'
719
+ | 'remove_entry'
720
+ | 'split_entry'
721
+ | 'merge_entry'
722
+ /** @enum {string} */
723
+ severity: 'critical' | 'suggestion'
724
+ scopePath: string
725
+ issue: string
726
+ suggestedFix: string
727
+ citedSourceIds?: string[]
728
+ claimKey?: string
729
+ involvedScopes?: string[]
730
+ currentClaim?: string
731
+ alternativeClaim?: string
732
+ /** @enum {string} */
733
+ currentAuthority?: 'primary' | 'secondary' | 'community'
734
+ /** @enum {string} */
735
+ alternativeAuthority?: 'primary' | 'secondary' | 'community'
736
+ /** @enum {string} */
737
+ suggestedResolution?: 'keep_existing' | 'accept_new'
738
+ }
739
+ fingerprint: string
740
+ revisionId: string | null
741
+ /** @enum {string} */
742
+ status: 'accepted'
743
+ /** Format: date-time */
744
+ resolvedAt: string
745
+ resolvedBy: {
746
+ id: string
747
+ /** @enum {string} */
748
+ kind: 'user' | 'robot'
749
+ } | null
750
+ /** @enum {string|null} */
751
+ resolution: 'keep_existing' | 'accept_new' | null
752
+ }
753
+ | {
754
+ _id: string
755
+ _rev: string
756
+ /** Format: date-time */
757
+ _createdAt: string
758
+ /** Format: date-time */
759
+ _updatedAt: string
760
+ knowledgeBaseId: string
761
+ /** @enum {string} */
762
+ _type: 'sanity.context.issue'
763
+ /** @enum {number} */
764
+ schemaVersion: 1
765
+ /** @description IssueContent */
766
+ content: {
767
+ /** @enum {string} */
768
+ kind:
769
+ | 'conflict'
770
+ | 'gap'
771
+ | 'update_required'
772
+ | 'add_entry'
773
+ | 'remove_entry'
774
+ | 'split_entry'
775
+ | 'merge_entry'
776
+ /** @enum {string} */
777
+ severity: 'critical' | 'suggestion'
778
+ scopePath: string
779
+ issue: string
780
+ suggestedFix: string
781
+ citedSourceIds?: string[]
782
+ claimKey?: string
783
+ involvedScopes?: string[]
784
+ currentClaim?: string
785
+ alternativeClaim?: string
786
+ /** @enum {string} */
787
+ currentAuthority?: 'primary' | 'secondary' | 'community'
788
+ /** @enum {string} */
789
+ alternativeAuthority?: 'primary' | 'secondary' | 'community'
790
+ /** @enum {string} */
791
+ suggestedResolution?: 'keep_existing' | 'accept_new'
792
+ }
793
+ fingerprint: string
794
+ revisionId: string | null
795
+ /** @enum {string} */
796
+ status: 'rejected'
797
+ /** Format: date-time */
798
+ resolvedAt: string
799
+ resolvedBy: {
800
+ id: string
801
+ /** @enum {string} */
802
+ kind: 'user' | 'robot'
803
+ } | null
804
+ /** @enum {string|null} */
805
+ resolution: null
806
+ }
807
+ /** @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. */
808
+ McpDoc: {
809
+ _id: string
810
+ _rev: string
811
+ /** Format: date-time */
812
+ _createdAt: string
813
+ /** Format: date-time */
814
+ _updatedAt: string
815
+ /** @enum {string} */
816
+ _type: 'sanity.context.mcp'
817
+ /** @enum {number} */
818
+ schemaVersion: 1
819
+ organizationId: string
820
+ publicId: string
821
+ title: string
822
+ name: string
823
+ sources: (
824
+ | {
825
+ /** @enum {string} */
826
+ type: 'knowledge-base'
827
+ id: string
828
+ }
829
+ | {
830
+ /** @enum {string} */
831
+ type: 'dataset'
832
+ id: string
833
+ }
834
+ )[]
835
+ instructions: string | null
836
+ groqFilter: string | null
837
+ }
838
+ }
839
+ responses: never
840
+ parameters: never
841
+ requestBodies: never
842
+ headers: never
843
+ pathItems: never
844
+ }
845
+ export type $defs = Record<string, never>
846
+ export interface operations {
847
+ listKnowledgeBases: {
848
+ parameters: {
849
+ query: {
850
+ cursor?: string
851
+ limit?: number
852
+ organizationId: string
853
+ }
854
+ header?: never
855
+ path: {
856
+ apiVersion: string
857
+ }
858
+ cookie?: never
859
+ }
860
+ requestBody?: never
861
+ responses: {
862
+ /** @description Default Response */
863
+ 200: {
864
+ headers: {
865
+ [name: string]: unknown
866
+ }
867
+ content: {
868
+ 'application/json': {
869
+ data: {
870
+ /** Format: uuid */
871
+ id: string
872
+ publicId: string
873
+ organizationId: string
874
+ title: string
875
+ description: string
876
+ /** @enum {string} */
877
+ state: 'created' | 'building' | 'ready' | 'review' | 'stale' | 'paused'
878
+ activeJobId: string | null
879
+ isBuilding: boolean
880
+ buildStageState: {
881
+ jobId: string
882
+ stages: {
883
+ /** @enum {string} */
884
+ id:
885
+ | 'tldr'
886
+ | 'map'
887
+ | 'triage'
888
+ | 'plan'
889
+ | 'organize'
890
+ | 'arrange'
891
+ | 'write'
892
+ | 'review'
893
+ | 'polish'
894
+ /** @enum {string} */
895
+ status: 'pending' | 'running' | 'done' | 'failed'
896
+ units?: {
897
+ /** @enum {string} */
898
+ unit: 'sources' | 'groups' | 'entries' | 'rounds'
899
+ done: number
900
+ total?: number
901
+ }
902
+ }[]
903
+ } | null
904
+ /** Format: date-time */
905
+ lastCheckedAt: string | null
906
+ /** Format: date-time */
907
+ lastChangedAt: string | null
908
+ hasPendingChanges: boolean
909
+ pendingChanges: {
910
+ added: number
911
+ changed: number
912
+ removed: number
913
+ } | null
914
+ pipelineOutdated: boolean
915
+ rebuildRecommended: {
916
+ reason: string
917
+ /** Format: date-time */
918
+ at: string
919
+ } | null
920
+ hasWebSource: boolean
921
+ hasDatasetSource: boolean
922
+ sourceUsage: {
923
+ used: number
924
+ limit: number
925
+ } | null
926
+ refreshEnabled: boolean
927
+ /** @enum {string} */
928
+ refreshFrequency: 'weekly' | 'monthly'
929
+ /** Format: date-time */
930
+ refreshNextRunAt: string | null
931
+ refreshInFlight: boolean
932
+ openIssueCount: number
933
+ instructionCount: number
934
+ /** Format: date-time */
935
+ createdAt: string
936
+ /** Format: date-time */
937
+ updatedAt: string
938
+ }[]
939
+ nextCursor: string | null
940
+ }
941
+ }
942
+ }
943
+ }
944
+ }
945
+ createKnowledgeBase: {
946
+ parameters: {
947
+ query?: never
948
+ header?: never
949
+ path: {
950
+ apiVersion: string
951
+ }
952
+ cookie?: never
953
+ }
954
+ requestBody: {
955
+ content: {
956
+ 'application/json': {
957
+ organizationId: string
958
+ title: string
959
+ description: string
960
+ }
961
+ }
962
+ }
963
+ responses: {
964
+ /** @description KnowledgeBase */
965
+ 201: {
966
+ headers: {
967
+ [name: string]: unknown
968
+ }
969
+ content: {
970
+ 'application/json': {
971
+ /** Format: uuid */
972
+ id: string
973
+ publicId: string
974
+ organizationId: string
975
+ title: string
976
+ description: string
977
+ /** @enum {string} */
978
+ state: 'created' | 'building' | 'ready' | 'review' | 'stale' | 'paused'
979
+ activeJobId: string | null
980
+ isBuilding: boolean
981
+ buildStageState: {
982
+ jobId: string
983
+ stages: {
984
+ /** @enum {string} */
985
+ id:
986
+ | 'tldr'
987
+ | 'map'
988
+ | 'triage'
989
+ | 'plan'
990
+ | 'organize'
991
+ | 'arrange'
992
+ | 'write'
993
+ | 'review'
994
+ | 'polish'
995
+ /** @enum {string} */
996
+ status: 'pending' | 'running' | 'done' | 'failed'
997
+ units?: {
998
+ /** @enum {string} */
999
+ unit: 'sources' | 'groups' | 'entries' | 'rounds'
1000
+ done: number
1001
+ total?: number
1002
+ }
1003
+ }[]
1004
+ } | null
1005
+ /** Format: date-time */
1006
+ lastCheckedAt: string | null
1007
+ /** Format: date-time */
1008
+ lastChangedAt: string | null
1009
+ hasPendingChanges: boolean
1010
+ pendingChanges: {
1011
+ added: number
1012
+ changed: number
1013
+ removed: number
1014
+ } | null
1015
+ pipelineOutdated: boolean
1016
+ rebuildRecommended: {
1017
+ reason: string
1018
+ /** Format: date-time */
1019
+ at: string
1020
+ } | null
1021
+ hasWebSource: boolean
1022
+ hasDatasetSource: boolean
1023
+ sourceUsage: {
1024
+ used: number
1025
+ limit: number
1026
+ } | null
1027
+ refreshEnabled: boolean
1028
+ /** @enum {string} */
1029
+ refreshFrequency: 'weekly' | 'monthly'
1030
+ /** Format: date-time */
1031
+ refreshNextRunAt: string | null
1032
+ refreshInFlight: boolean
1033
+ openIssueCount: number
1034
+ instructionCount: number
1035
+ /** Format: date-time */
1036
+ createdAt: string
1037
+ /** Format: date-time */
1038
+ updatedAt: string
1039
+ }
1040
+ }
1041
+ }
1042
+ }
1043
+ }
1044
+ getKnowledgeBase: {
1045
+ parameters: {
1046
+ query?: never
1047
+ header?: never
1048
+ path: {
1049
+ knowledgeBaseId: string
1050
+ }
1051
+ cookie?: never
1052
+ }
1053
+ requestBody?: never
1054
+ responses: {
1055
+ /** @description KnowledgeBase */
1056
+ 200: {
1057
+ headers: {
1058
+ [name: string]: unknown
1059
+ }
1060
+ content: {
1061
+ 'application/json': {
1062
+ /** Format: uuid */
1063
+ id: string
1064
+ publicId: string
1065
+ organizationId: string
1066
+ title: string
1067
+ description: string
1068
+ /** @enum {string} */
1069
+ state: 'created' | 'building' | 'ready' | 'review' | 'stale' | 'paused'
1070
+ activeJobId: string | null
1071
+ isBuilding: boolean
1072
+ buildStageState: {
1073
+ jobId: string
1074
+ stages: {
1075
+ /** @enum {string} */
1076
+ id:
1077
+ | 'tldr'
1078
+ | 'map'
1079
+ | 'triage'
1080
+ | 'plan'
1081
+ | 'organize'
1082
+ | 'arrange'
1083
+ | 'write'
1084
+ | 'review'
1085
+ | 'polish'
1086
+ /** @enum {string} */
1087
+ status: 'pending' | 'running' | 'done' | 'failed'
1088
+ units?: {
1089
+ /** @enum {string} */
1090
+ unit: 'sources' | 'groups' | 'entries' | 'rounds'
1091
+ done: number
1092
+ total?: number
1093
+ }
1094
+ }[]
1095
+ } | null
1096
+ /** Format: date-time */
1097
+ lastCheckedAt: string | null
1098
+ /** Format: date-time */
1099
+ lastChangedAt: string | null
1100
+ hasPendingChanges: boolean
1101
+ pendingChanges: {
1102
+ added: number
1103
+ changed: number
1104
+ removed: number
1105
+ } | null
1106
+ pipelineOutdated: boolean
1107
+ rebuildRecommended: {
1108
+ reason: string
1109
+ /** Format: date-time */
1110
+ at: string
1111
+ } | null
1112
+ hasWebSource: boolean
1113
+ hasDatasetSource: boolean
1114
+ sourceUsage: {
1115
+ used: number
1116
+ limit: number
1117
+ } | null
1118
+ refreshEnabled: boolean
1119
+ /** @enum {string} */
1120
+ refreshFrequency: 'weekly' | 'monthly'
1121
+ /** Format: date-time */
1122
+ refreshNextRunAt: string | null
1123
+ refreshInFlight: boolean
1124
+ openIssueCount: number
1125
+ instructionCount: number
1126
+ /** Format: date-time */
1127
+ createdAt: string
1128
+ /** Format: date-time */
1129
+ updatedAt: string
1130
+ }
1131
+ }
1132
+ }
1133
+ }
1134
+ }
1135
+ deleteKnowledgeBase: {
1136
+ parameters: {
1137
+ query?: never
1138
+ header?: never
1139
+ path: {
1140
+ knowledgeBaseId: string
1141
+ }
1142
+ cookie?: never
1143
+ }
1144
+ requestBody?: never
1145
+ responses: {
1146
+ /** @description Default Response */
1147
+ 204: {
1148
+ headers: {
1149
+ [name: string]: unknown
1150
+ }
1151
+ content: {
1152
+ 'application/json': null
1153
+ }
1154
+ }
1155
+ }
1156
+ }
1157
+ updateKnowledgeBase: {
1158
+ parameters: {
1159
+ query?: never
1160
+ header?: never
1161
+ path: {
1162
+ knowledgeBaseId: string
1163
+ }
1164
+ cookie?: never
1165
+ }
1166
+ requestBody: {
1167
+ content: {
1168
+ 'application/json': {
1169
+ title?: string
1170
+ description?: string
1171
+ refreshEnabled?: boolean
1172
+ /** @enum {string} */
1173
+ refreshFrequency?: 'weekly' | 'monthly'
1174
+ }
1175
+ }
1176
+ }
1177
+ responses: {
1178
+ /** @description KnowledgeBase */
1179
+ 200: {
1180
+ headers: {
1181
+ [name: string]: unknown
1182
+ }
1183
+ content: {
1184
+ 'application/json': {
1185
+ /** Format: uuid */
1186
+ id: string
1187
+ publicId: string
1188
+ organizationId: string
1189
+ title: string
1190
+ description: string
1191
+ /** @enum {string} */
1192
+ state: 'created' | 'building' | 'ready' | 'review' | 'stale' | 'paused'
1193
+ activeJobId: string | null
1194
+ isBuilding: boolean
1195
+ buildStageState: {
1196
+ jobId: string
1197
+ stages: {
1198
+ /** @enum {string} */
1199
+ id:
1200
+ | 'tldr'
1201
+ | 'map'
1202
+ | 'triage'
1203
+ | 'plan'
1204
+ | 'organize'
1205
+ | 'arrange'
1206
+ | 'write'
1207
+ | 'review'
1208
+ | 'polish'
1209
+ /** @enum {string} */
1210
+ status: 'pending' | 'running' | 'done' | 'failed'
1211
+ units?: {
1212
+ /** @enum {string} */
1213
+ unit: 'sources' | 'groups' | 'entries' | 'rounds'
1214
+ done: number
1215
+ total?: number
1216
+ }
1217
+ }[]
1218
+ } | null
1219
+ /** Format: date-time */
1220
+ lastCheckedAt: string | null
1221
+ /** Format: date-time */
1222
+ lastChangedAt: string | null
1223
+ hasPendingChanges: boolean
1224
+ pendingChanges: {
1225
+ added: number
1226
+ changed: number
1227
+ removed: number
1228
+ } | null
1229
+ pipelineOutdated: boolean
1230
+ rebuildRecommended: {
1231
+ reason: string
1232
+ /** Format: date-time */
1233
+ at: string
1234
+ } | null
1235
+ hasWebSource: boolean
1236
+ hasDatasetSource: boolean
1237
+ sourceUsage: {
1238
+ used: number
1239
+ limit: number
1240
+ } | null
1241
+ refreshEnabled: boolean
1242
+ /** @enum {string} */
1243
+ refreshFrequency: 'weekly' | 'monthly'
1244
+ /** Format: date-time */
1245
+ refreshNextRunAt: string | null
1246
+ refreshInFlight: boolean
1247
+ openIssueCount: number
1248
+ instructionCount: number
1249
+ /** Format: date-time */
1250
+ createdAt: string
1251
+ /** Format: date-time */
1252
+ updatedAt: string
1253
+ }
1254
+ }
1255
+ }
1256
+ }
1257
+ }
1258
+ buildKnowledgeBase: {
1259
+ parameters: {
1260
+ query?: never
1261
+ header?: never
1262
+ path: {
1263
+ knowledgeBaseId: string
1264
+ }
1265
+ cookie?: never
1266
+ }
1267
+ requestBody?: never
1268
+ responses: {
1269
+ /** @description JobAccepted */
1270
+ 202: {
1271
+ headers: {
1272
+ [name: string]: unknown
1273
+ }
1274
+ content: {
1275
+ 'application/json': {
1276
+ jobId: string
1277
+ }
1278
+ }
1279
+ }
1280
+ }
1281
+ }
1282
+ cancelKnowledgeBaseBuild: {
1283
+ parameters: {
1284
+ query?: never
1285
+ header?: never
1286
+ path: {
1287
+ knowledgeBaseId: string
1288
+ }
1289
+ cookie?: never
1290
+ }
1291
+ requestBody?: never
1292
+ responses: {
1293
+ /** @description Default Response */
1294
+ 200: {
1295
+ headers: {
1296
+ [name: string]: unknown
1297
+ }
1298
+ content: {
1299
+ 'application/json': {
1300
+ cancelled: boolean
1301
+ }
1302
+ }
1303
+ }
1304
+ }
1305
+ }
1306
+ rebuildEntry: {
1307
+ parameters: {
1308
+ query?: never
1309
+ header?: never
1310
+ path: {
1311
+ knowledgeBaseId: string
1312
+ entryPath: string
1313
+ }
1314
+ cookie?: never
1315
+ }
1316
+ requestBody?: never
1317
+ responses: {
1318
+ /** @description RebuildEntryResponse */
1319
+ 202: {
1320
+ headers: {
1321
+ [name: string]: unknown
1322
+ }
1323
+ content: {
1324
+ 'application/json': {
1325
+ jobId: string
1326
+ affectedEntries: {
1327
+ id: string
1328
+ path: string
1329
+ title: string
1330
+ }[]
1331
+ }
1332
+ }
1333
+ }
1334
+ }
1335
+ }
1336
+ listImports: {
1337
+ parameters: {
1338
+ query?: {
1339
+ cursor?: string
1340
+ limit?: number
1341
+ }
1342
+ header?: never
1343
+ path: {
1344
+ knowledgeBaseId: string
1345
+ }
1346
+ cookie?: never
1347
+ }
1348
+ requestBody?: never
1349
+ responses: {
1350
+ /** @description Default Response */
1351
+ 200: {
1352
+ headers: {
1353
+ [name: string]: unknown
1354
+ }
1355
+ content: {
1356
+ 'application/json': {
1357
+ data: {
1358
+ /** Format: uuid */
1359
+ id: string
1360
+ /** Format: uuid */
1361
+ knowledgeBaseId: string
1362
+ name: string | null
1363
+ sizeBytes: number | null
1364
+ /** @enum {string} */
1365
+ status: 'uploading' | 'processing' | 'complete' | 'failed'
1366
+ /** @enum {string} */
1367
+ sourceKind: 'web' | 'file' | 'dataset'
1368
+ /** Format: date-time */
1369
+ lastCheckedAt: string | null
1370
+ sourceCount: number
1371
+ totalDistillableCount: number
1372
+ distilledCount: number
1373
+ unsupportedCount: number
1374
+ statusDetail: string | null
1375
+ error: string | null
1376
+ /** @description CrawlOptions */
1377
+ crawlOptions: {
1378
+ includePaths?: string[]
1379
+ excludePaths?: string[]
1380
+ maxDepth?: number
1381
+ sitemapOnly?: boolean
1382
+ ignoreQueryParameters?: boolean
1383
+ pageLimit?: number
1384
+ } | null
1385
+ /** @description DatasetSourceBinding */
1386
+ datasetSource: {
1387
+ sanityProjectId: string
1388
+ sanityDatasetId: string
1389
+ query: string
1390
+ } | null
1391
+ /** @description Actor */
1392
+ createdBy: {
1393
+ id: string | null
1394
+ displayName: string | null
1395
+ } | null
1396
+ /** Format: date-time */
1397
+ createdAt: string
1398
+ /** Format: date-time */
1399
+ completedAt: string | null
1400
+ }[]
1401
+ nextCursor: string | null
1402
+ }
1403
+ }
1404
+ }
1405
+ }
1406
+ }
1407
+ createImport: {
1408
+ parameters: {
1409
+ query?: never
1410
+ header?: never
1411
+ path: {
1412
+ knowledgeBaseId: string
1413
+ }
1414
+ cookie?: never
1415
+ }
1416
+ /** @description CreateImportInput */
1417
+ requestBody: {
1418
+ content: {
1419
+ 'application/json':
1420
+ | {
1421
+ /** @enum {string} */
1422
+ type: 'text'
1423
+ title: string
1424
+ content: string
1425
+ /**
1426
+ * @default text/markdown
1427
+ * @enum {string}
1428
+ */
1429
+ contentType?: 'text/markdown' | 'text/plain'
1430
+ }
1431
+ | {
1432
+ /** Format: uri */
1433
+ url: string
1434
+ /** @description CrawlOptions */
1435
+ options?: {
1436
+ includePaths?: string[]
1437
+ excludePaths?: string[]
1438
+ maxDepth?: number
1439
+ sitemapOnly?: boolean
1440
+ ignoreQueryParameters?: boolean
1441
+ pageLimit?: number
1442
+ }
1443
+ /** @enum {string} */
1444
+ type: 'crawl'
1445
+ }
1446
+ | {
1447
+ sanityProjectId: string
1448
+ sanityDatasetId: string
1449
+ query: string
1450
+ /** @enum {string} */
1451
+ type: 'dataset'
1452
+ }
1453
+ }
1454
+ }
1455
+ responses: {
1456
+ /** @description JobAccepted */
1457
+ 202: {
1458
+ headers: {
1459
+ [name: string]: unknown
1460
+ }
1461
+ content: {
1462
+ 'application/json': {
1463
+ jobId: string
1464
+ }
1465
+ }
1466
+ }
1467
+ }
1468
+ }
1469
+ startUpload: {
1470
+ parameters: {
1471
+ query?: never
1472
+ header?: never
1473
+ path: {
1474
+ knowledgeBaseId: string
1475
+ }
1476
+ cookie?: never
1477
+ }
1478
+ requestBody: {
1479
+ content: {
1480
+ 'application/json': {
1481
+ filename: string
1482
+ contentType?: string
1483
+ }
1484
+ }
1485
+ }
1486
+ responses: {
1487
+ /** @description Default Response */
1488
+ 201: {
1489
+ headers: {
1490
+ [name: string]: unknown
1491
+ }
1492
+ content: {
1493
+ 'application/json': {
1494
+ /** Format: uuid */
1495
+ importId: string
1496
+ /** Format: uri */
1497
+ uploadUrl: string
1498
+ }
1499
+ }
1500
+ }
1501
+ }
1502
+ }
1503
+ completeUpload: {
1504
+ parameters: {
1505
+ query?: never
1506
+ header?: never
1507
+ path: {
1508
+ knowledgeBaseId: string
1509
+ importId: string
1510
+ }
1511
+ cookie?: never
1512
+ }
1513
+ requestBody?: never
1514
+ responses: {
1515
+ /** @description JobAccepted */
1516
+ 202: {
1517
+ headers: {
1518
+ [name: string]: unknown
1519
+ }
1520
+ content: {
1521
+ 'application/json': {
1522
+ jobId: string
1523
+ }
1524
+ }
1525
+ }
1526
+ }
1527
+ }
1528
+ getImport: {
1529
+ parameters: {
1530
+ query?: never
1531
+ header?: never
1532
+ path: {
1533
+ knowledgeBaseId: string
1534
+ importId: string
1535
+ }
1536
+ cookie?: never
1537
+ }
1538
+ requestBody?: never
1539
+ responses: {
1540
+ /** @description Import */
1541
+ 200: {
1542
+ headers: {
1543
+ [name: string]: unknown
1544
+ }
1545
+ content: {
1546
+ 'application/json': {
1547
+ /** Format: uuid */
1548
+ id: string
1549
+ /** Format: uuid */
1550
+ knowledgeBaseId: string
1551
+ name: string | null
1552
+ sizeBytes: number | null
1553
+ /** @enum {string} */
1554
+ status: 'uploading' | 'processing' | 'complete' | 'failed'
1555
+ /** @enum {string} */
1556
+ sourceKind: 'web' | 'file' | 'dataset'
1557
+ /** Format: date-time */
1558
+ lastCheckedAt: string | null
1559
+ sourceCount: number
1560
+ totalDistillableCount: number
1561
+ distilledCount: number
1562
+ unsupportedCount: number
1563
+ statusDetail: string | null
1564
+ error: string | null
1565
+ /** @description CrawlOptions */
1566
+ crawlOptions: {
1567
+ includePaths?: string[]
1568
+ excludePaths?: string[]
1569
+ maxDepth?: number
1570
+ sitemapOnly?: boolean
1571
+ ignoreQueryParameters?: boolean
1572
+ pageLimit?: number
1573
+ } | null
1574
+ /** @description DatasetSourceBinding */
1575
+ datasetSource: {
1576
+ sanityProjectId: string
1577
+ sanityDatasetId: string
1578
+ query: string
1579
+ } | null
1580
+ /** @description Actor */
1581
+ createdBy: {
1582
+ id: string | null
1583
+ displayName: string | null
1584
+ } | null
1585
+ /** Format: date-time */
1586
+ createdAt: string
1587
+ /** Format: date-time */
1588
+ completedAt: string | null
1589
+ }
1590
+ }
1591
+ }
1592
+ }
1593
+ }
1594
+ deleteImport: {
1595
+ parameters: {
1596
+ query?: never
1597
+ header?: never
1598
+ path: {
1599
+ knowledgeBaseId: string
1600
+ importId: string
1601
+ }
1602
+ cookie?: never
1603
+ }
1604
+ requestBody?: never
1605
+ responses: {
1606
+ /** @description Default Response */
1607
+ 204: {
1608
+ headers: {
1609
+ [name: string]: unknown
1610
+ }
1611
+ content: {
1612
+ 'application/json': null
1613
+ }
1614
+ }
1615
+ }
1616
+ }
1617
+ downloadImport: {
1618
+ parameters: {
1619
+ query?: never
1620
+ header?: never
1621
+ path: {
1622
+ knowledgeBaseId: string
1623
+ importId: string
1624
+ }
1625
+ cookie?: never
1626
+ }
1627
+ requestBody?: never
1628
+ responses: {
1629
+ /** @description Default Response */
1630
+ 200: {
1631
+ headers: {
1632
+ [name: string]: unknown
1633
+ }
1634
+ content: {
1635
+ 'application/json': {
1636
+ /** Format: uri */
1637
+ url: string
1638
+ /** Format: date-time */
1639
+ expiresAt: string
1640
+ }
1641
+ }
1642
+ }
1643
+ }
1644
+ }
1645
+ createInstruction: {
1646
+ parameters: {
1647
+ query?: never
1648
+ header?: never
1649
+ path: {
1650
+ knowledgeBaseId: string
1651
+ }
1652
+ cookie?: never
1653
+ }
1654
+ /** @description CreateInstructionInput */
1655
+ requestBody: {
1656
+ content: {
1657
+ 'application/json': {
1658
+ statement: string
1659
+ scopeSourceIds?: string[] | null
1660
+ rebuildPaths?: string[]
1661
+ verified?: boolean
1662
+ }
1663
+ }
1664
+ }
1665
+ responses: {
1666
+ /** @description CreateInstructionResponse */
1667
+ 201: {
1668
+ headers: {
1669
+ [name: string]: unknown
1670
+ }
1671
+ content: {
1672
+ 'application/json': {
1673
+ /** @description Instruction */
1674
+ instruction: {
1675
+ id: string
1676
+ knowledgeBaseId: string
1677
+ /** @enum {string} */
1678
+ origin: 'conflict' | 'human'
1679
+ /** @enum {string} */
1680
+ status: 'active' | 'archived'
1681
+ statement: string
1682
+ scopeSourceIds: string[] | null
1683
+ /** Format: date-time */
1684
+ archivedAt: string | null
1685
+ archivedReason: string | null
1686
+ sourceIssueId: string | null
1687
+ /** @description Actor */
1688
+ createdBy: {
1689
+ id: string | null
1690
+ displayName: string | null
1691
+ } | null
1692
+ /** @description Actor */
1693
+ updatedBy: {
1694
+ id: string | null
1695
+ displayName: string | null
1696
+ } | null
1697
+ /** Format: date-time */
1698
+ createdAt: string
1699
+ /** Format: date-time */
1700
+ updatedAt: string | null
1701
+ }
1702
+ rebuildJobId: string | null
1703
+ }
1704
+ }
1705
+ }
1706
+ }
1707
+ }
1708
+ deleteInstruction: {
1709
+ parameters: {
1710
+ query?: never
1711
+ header?: never
1712
+ path: {
1713
+ knowledgeBaseId: string
1714
+ instructionId: string
1715
+ }
1716
+ cookie?: never
1717
+ }
1718
+ requestBody?: never
1719
+ responses: {
1720
+ /** @description Default Response */
1721
+ 204: {
1722
+ headers: {
1723
+ [name: string]: unknown
1724
+ }
1725
+ content: {
1726
+ 'application/json': null
1727
+ }
1728
+ }
1729
+ }
1730
+ }
1731
+ updateInstruction: {
1732
+ parameters: {
1733
+ query?: never
1734
+ header?: never
1735
+ path: {
1736
+ knowledgeBaseId: string
1737
+ instructionId: string
1738
+ }
1739
+ cookie?: never
1740
+ }
1741
+ /** @description UpdateInstructionInput */
1742
+ requestBody: {
1743
+ content: {
1744
+ 'application/json': {
1745
+ statement?: string
1746
+ scopeSourceIds?: string[] | null
1747
+ }
1748
+ }
1749
+ }
1750
+ responses: {
1751
+ /** @description Instruction */
1752
+ 200: {
1753
+ headers: {
1754
+ [name: string]: unknown
1755
+ }
1756
+ content: {
1757
+ 'application/json': {
1758
+ id: string
1759
+ knowledgeBaseId: string
1760
+ /** @enum {string} */
1761
+ origin: 'conflict' | 'human'
1762
+ /** @enum {string} */
1763
+ status: 'active' | 'archived'
1764
+ statement: string
1765
+ scopeSourceIds: string[] | null
1766
+ /** Format: date-time */
1767
+ archivedAt: string | null
1768
+ archivedReason: string | null
1769
+ sourceIssueId: string | null
1770
+ /** @description Actor */
1771
+ createdBy: {
1772
+ id: string | null
1773
+ displayName: string | null
1774
+ } | null
1775
+ /** @description Actor */
1776
+ updatedBy: {
1777
+ id: string | null
1778
+ displayName: string | null
1779
+ } | null
1780
+ /** Format: date-time */
1781
+ createdAt: string
1782
+ /** Format: date-time */
1783
+ updatedAt: string | null
1784
+ }
1785
+ }
1786
+ }
1787
+ }
1788
+ }
1789
+ applyIssues: {
1790
+ parameters: {
1791
+ query?: never
1792
+ header?: never
1793
+ path: {
1794
+ knowledgeBaseId: string
1795
+ }
1796
+ cookie?: never
1797
+ }
1798
+ requestBody: {
1799
+ content: {
1800
+ 'application/json': {
1801
+ issueIds: string[]
1802
+ }
1803
+ }
1804
+ }
1805
+ responses: {
1806
+ /** @description JobAccepted */
1807
+ 202: {
1808
+ headers: {
1809
+ [name: string]: unknown
1810
+ }
1811
+ content: {
1812
+ 'application/json': {
1813
+ jobId: string
1814
+ }
1815
+ }
1816
+ }
1817
+ }
1818
+ }
1819
+ dismissIssue: {
1820
+ parameters: {
1821
+ query?: never
1822
+ header?: never
1823
+ path: {
1824
+ knowledgeBaseId: string
1825
+ issueId: string
1826
+ }
1827
+ cookie?: never
1828
+ }
1829
+ requestBody?: never
1830
+ responses: {
1831
+ /** @description Issue */
1832
+ 200: {
1833
+ headers: {
1834
+ [name: string]: unknown
1835
+ }
1836
+ content: {
1837
+ 'application/json': {
1838
+ id: string
1839
+ knowledgeBaseId: string
1840
+ /** @description IssueContent */
1841
+ content: {
1842
+ /** @enum {string} */
1843
+ kind:
1844
+ | 'conflict'
1845
+ | 'gap'
1846
+ | 'update_required'
1847
+ | 'add_entry'
1848
+ | 'remove_entry'
1849
+ | 'split_entry'
1850
+ | 'merge_entry'
1851
+ /** @enum {string} */
1852
+ severity: 'critical' | 'suggestion'
1853
+ scopePath: string
1854
+ issue: string
1855
+ suggestedFix: string
1856
+ citedSourceIds?: string[]
1857
+ claimKey?: string
1858
+ involvedScopes?: string[]
1859
+ currentClaim?: string
1860
+ alternativeClaim?: string
1861
+ /** @enum {string} */
1862
+ currentAuthority?: 'primary' | 'secondary' | 'community'
1863
+ /** @enum {string} */
1864
+ alternativeAuthority?: 'primary' | 'secondary' | 'community'
1865
+ /** @enum {string} */
1866
+ suggestedResolution?: 'keep_existing' | 'accept_new'
1867
+ }
1868
+ /** @enum {string} */
1869
+ status: 'open' | 'accepted' | 'rejected'
1870
+ /** @enum {string|null} */
1871
+ resolution: 'keep_existing' | 'accept_new' | null
1872
+ /** @description IssueResolvedBy */
1873
+ resolvedBy: {
1874
+ id: string
1875
+ /** @enum {string} */
1876
+ kind: 'user' | 'robot'
1877
+ } | null
1878
+ /** Format: date-time */
1879
+ createdAt: string
1880
+ /** Format: date-time */
1881
+ resolvedAt: string | null
1882
+ }
1883
+ }
1884
+ }
1885
+ }
1886
+ }
1887
+ reopenIssue: {
1888
+ parameters: {
1889
+ query?: never
1890
+ header?: never
1891
+ path: {
1892
+ knowledgeBaseId: string
1893
+ issueId: string
1894
+ }
1895
+ cookie?: never
1896
+ }
1897
+ requestBody?: never
1898
+ responses: {
1899
+ /** @description Issue */
1900
+ 200: {
1901
+ headers: {
1902
+ [name: string]: unknown
1903
+ }
1904
+ content: {
1905
+ 'application/json': {
1906
+ id: string
1907
+ knowledgeBaseId: string
1908
+ /** @description IssueContent */
1909
+ content: {
1910
+ /** @enum {string} */
1911
+ kind:
1912
+ | 'conflict'
1913
+ | 'gap'
1914
+ | 'update_required'
1915
+ | 'add_entry'
1916
+ | 'remove_entry'
1917
+ | 'split_entry'
1918
+ | 'merge_entry'
1919
+ /** @enum {string} */
1920
+ severity: 'critical' | 'suggestion'
1921
+ scopePath: string
1922
+ issue: string
1923
+ suggestedFix: string
1924
+ citedSourceIds?: string[]
1925
+ claimKey?: string
1926
+ involvedScopes?: string[]
1927
+ currentClaim?: string
1928
+ alternativeClaim?: string
1929
+ /** @enum {string} */
1930
+ currentAuthority?: 'primary' | 'secondary' | 'community'
1931
+ /** @enum {string} */
1932
+ alternativeAuthority?: 'primary' | 'secondary' | 'community'
1933
+ /** @enum {string} */
1934
+ suggestedResolution?: 'keep_existing' | 'accept_new'
1935
+ }
1936
+ /** @enum {string} */
1937
+ status: 'open' | 'accepted' | 'rejected'
1938
+ /** @enum {string|null} */
1939
+ resolution: 'keep_existing' | 'accept_new' | null
1940
+ /** @description IssueResolvedBy */
1941
+ resolvedBy: {
1942
+ id: string
1943
+ /** @enum {string} */
1944
+ kind: 'user' | 'robot'
1945
+ } | null
1946
+ /** Format: date-time */
1947
+ createdAt: string
1948
+ /** Format: date-time */
1949
+ resolvedAt: string | null
1950
+ }
1951
+ }
1952
+ }
1953
+ }
1954
+ }
1955
+ resolveIssue: {
1956
+ parameters: {
1957
+ query?: never
1958
+ header?: never
1959
+ path: {
1960
+ knowledgeBaseId: string
1961
+ issueId: string
1962
+ }
1963
+ cookie?: never
1964
+ }
1965
+ requestBody: {
1966
+ content: {
1967
+ 'application/json': {
1968
+ /** @enum {string} */
1969
+ resolution: 'keep_existing' | 'accept_new'
1970
+ }
1971
+ }
1972
+ }
1973
+ responses: {
1974
+ /** @description ResolveIssueResponse */
1975
+ 200: {
1976
+ headers: {
1977
+ [name: string]: unknown
1978
+ }
1979
+ content: {
1980
+ 'application/json': {
1981
+ /** @description Issue */
1982
+ issue: {
1983
+ id: string
1984
+ knowledgeBaseId: string
1985
+ /** @description IssueContent */
1986
+ content: {
1987
+ /** @enum {string} */
1988
+ kind:
1989
+ | 'conflict'
1990
+ | 'gap'
1991
+ | 'update_required'
1992
+ | 'add_entry'
1993
+ | 'remove_entry'
1994
+ | 'split_entry'
1995
+ | 'merge_entry'
1996
+ /** @enum {string} */
1997
+ severity: 'critical' | 'suggestion'
1998
+ scopePath: string
1999
+ issue: string
2000
+ suggestedFix: string
2001
+ citedSourceIds?: string[]
2002
+ claimKey?: string
2003
+ involvedScopes?: string[]
2004
+ currentClaim?: string
2005
+ alternativeClaim?: string
2006
+ /** @enum {string} */
2007
+ currentAuthority?: 'primary' | 'secondary' | 'community'
2008
+ /** @enum {string} */
2009
+ alternativeAuthority?: 'primary' | 'secondary' | 'community'
2010
+ /** @enum {string} */
2011
+ suggestedResolution?: 'keep_existing' | 'accept_new'
2012
+ }
2013
+ /** @enum {string} */
2014
+ status: 'open' | 'accepted' | 'rejected'
2015
+ /** @enum {string|null} */
2016
+ resolution: 'keep_existing' | 'accept_new' | null
2017
+ /** @description IssueResolvedBy */
2018
+ resolvedBy: {
2019
+ id: string
2020
+ /** @enum {string} */
2021
+ kind: 'user' | 'robot'
2022
+ } | null
2023
+ /** Format: date-time */
2024
+ createdAt: string
2025
+ /** Format: date-time */
2026
+ resolvedAt: string | null
2027
+ }
2028
+ jobId: string | null
2029
+ }
2030
+ }
2031
+ }
2032
+ }
2033
+ }
2034
+ getJob: {
2035
+ parameters: {
2036
+ query?: never
2037
+ header?: never
2038
+ path: {
2039
+ knowledgeBaseId: string
2040
+ jobId: string
2041
+ }
2042
+ cookie?: never
2043
+ }
2044
+ requestBody?: never
2045
+ responses: {
2046
+ /** @description Job */
2047
+ 200: {
2048
+ headers: {
2049
+ [name: string]: unknown
2050
+ }
2051
+ content: {
2052
+ 'application/json': {
2053
+ id: string
2054
+ /** @enum {string} */
2055
+ status: 'pending' | 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled'
2056
+ /** Format: date-time */
2057
+ startedAt: string | null
2058
+ /** Format: date-time */
2059
+ completedAt: string | null
2060
+ result?: unknown
2061
+ error?: string | null
2062
+ }
2063
+ }
2064
+ }
2065
+ }
2066
+ }
2067
+ refreshKnowledgeBase: {
2068
+ parameters: {
2069
+ query?: never
2070
+ header?: never
2071
+ path: {
2072
+ knowledgeBaseId: string
2073
+ }
2074
+ cookie?: never
2075
+ }
2076
+ requestBody?: never
2077
+ responses: {
2078
+ /** @description RefreshAccepted */
2079
+ 202: {
2080
+ headers: {
2081
+ [name: string]: unknown
2082
+ }
2083
+ content: {
2084
+ 'application/json': {
2085
+ jobId: string
2086
+ started: boolean
2087
+ }
2088
+ }
2089
+ }
2090
+ }
2091
+ }
2092
+ listSources: {
2093
+ parameters: {
2094
+ query?: {
2095
+ cursor?: string
2096
+ limit?: number
2097
+ status?: 'pending' | 'processing' | 'ready' | 'failed' | 'skipped'
2098
+ importId?: string
2099
+ ids?: string
2100
+ }
2101
+ header?: never
2102
+ path: {
2103
+ knowledgeBaseId: string
2104
+ }
2105
+ cookie?: never
2106
+ }
2107
+ requestBody?: never
2108
+ responses: {
2109
+ /** @description Default Response */
2110
+ 200: {
2111
+ headers: {
2112
+ [name: string]: unknown
2113
+ }
2114
+ content: {
2115
+ 'application/json': {
2116
+ data: {
2117
+ /** Format: uuid */
2118
+ id: string
2119
+ /** Format: uuid */
2120
+ knowledgeBaseId: string
2121
+ filename: string
2122
+ /** @enum {string} */
2123
+ kind: 'web' | 'file' | 'dataset'
2124
+ sizeBytes: number
2125
+ /** @enum {string} */
2126
+ status: 'pending' | 'processing' | 'ready' | 'failed' | 'skipped'
2127
+ tldr: string | null
2128
+ topics: string[] | null
2129
+ canonicalUrl: string | null
2130
+ /** Format: date-time */
2131
+ fetchedAt: string | null
2132
+ /** Format: date-time */
2133
+ distilledAt: string | null
2134
+ /** Format: date-time */
2135
+ createdAt: string
2136
+ }[]
2137
+ nextCursor: string | null
2138
+ }
2139
+ }
2140
+ }
2141
+ }
2142
+ }
2143
+ getSource: {
2144
+ parameters: {
2145
+ query?: never
2146
+ header?: never
2147
+ path: {
2148
+ knowledgeBaseId: string
2149
+ sourceId: string
2150
+ }
2151
+ cookie?: never
2152
+ }
2153
+ requestBody?: never
2154
+ responses: {
2155
+ /** @description Source */
2156
+ 200: {
2157
+ headers: {
2158
+ [name: string]: unknown
2159
+ }
2160
+ content: {
2161
+ 'application/json': {
2162
+ /** Format: uuid */
2163
+ id: string
2164
+ /** Format: uuid */
2165
+ knowledgeBaseId: string
2166
+ filename: string
2167
+ /** @enum {string} */
2168
+ kind: 'web' | 'file' | 'dataset'
2169
+ sizeBytes: number
2170
+ /** @enum {string} */
2171
+ status: 'pending' | 'processing' | 'ready' | 'failed' | 'skipped'
2172
+ tldr: string | null
2173
+ topics: string[] | null
2174
+ canonicalUrl: string | null
2175
+ /** Format: date-time */
2176
+ fetchedAt: string | null
2177
+ /** Format: date-time */
2178
+ distilledAt: string | null
2179
+ /** Format: date-time */
2180
+ createdAt: string
2181
+ }
2182
+ }
2183
+ }
2184
+ }
2185
+ }
2186
+ deleteSource: {
2187
+ parameters: {
2188
+ query?: never
2189
+ header?: never
2190
+ path: {
2191
+ knowledgeBaseId: string
2192
+ sourceId: string
2193
+ }
2194
+ cookie?: never
2195
+ }
2196
+ requestBody?: never
2197
+ responses: {
2198
+ /** @description Default Response */
2199
+ 204: {
2200
+ headers: {
2201
+ [name: string]: unknown
2202
+ }
2203
+ content: {
2204
+ 'application/json': null
2205
+ }
2206
+ }
2207
+ }
2208
+ }
2209
+ getSourceContent: {
2210
+ parameters: {
2211
+ query?: {
2212
+ /** @description Output representation. `json` (default) returns the structured resource; `markdown` / `plain` return the rendered, LLM-ready text. */
2213
+ format?: 'json' | 'markdown' | 'plain'
2214
+ startLine?: number
2215
+ endLine?: number
2216
+ }
2217
+ header?: never
2218
+ path: {
2219
+ knowledgeBaseId: string
2220
+ sourceId: string
2221
+ }
2222
+ cookie?: never
2223
+ }
2224
+ requestBody?: never
2225
+ responses: {
2226
+ /** @description SourceContent */
2227
+ 200: {
2228
+ headers: {
2229
+ [name: string]: unknown
2230
+ }
2231
+ content: {
2232
+ 'application/json': {
2233
+ /** Format: uuid */
2234
+ sourceId: string
2235
+ content: string
2236
+ totalLines: number
2237
+ slice: {
2238
+ start: number
2239
+ end: number
2240
+ }
2241
+ }
2242
+ 'text/markdown': string
2243
+ 'text/plain': string
2244
+ }
2245
+ }
2246
+ }
2247
+ }
2248
+ saveConversation: {
2249
+ parameters: {
2250
+ query?: never
2251
+ header?: never
2252
+ path: {
2253
+ threadId: string
2254
+ }
2255
+ cookie?: never
2256
+ }
2257
+ /** @description SaveConversationInput */
2258
+ requestBody: {
2259
+ content: {
2260
+ 'application/json': {
2261
+ messages: {
2262
+ /** @enum {string} */
2263
+ role: 'user' | 'assistant' | 'system' | 'tool'
2264
+ /** @default null */
2265
+ content?: string | null
2266
+ /** @default null */
2267
+ toolName?: string | null
2268
+ /**
2269
+ * @default null
2270
+ * @enum {string|null}
2271
+ */
2272
+ toolType?: 'call' | 'result' | null
2273
+ }[]
2274
+ modelProvider?: string
2275
+ modelId?: string
2276
+ /** @description ConversationTokenUsage */
2277
+ tokenUsage?: {
2278
+ inputTokens?: number
2279
+ outputTokens?: number
2280
+ totalTokens?: number
2281
+ }
2282
+ /** @description ConversationMetadata */
2283
+ metadata?: {
2284
+ [key: string]: string | string[]
2285
+ }
2286
+ }
2287
+ }
2288
+ }
2289
+ responses: {
2290
+ /** @description Conversation */
2291
+ 200: {
2292
+ headers: {
2293
+ [name: string]: unknown
2294
+ }
2295
+ content: {
2296
+ 'application/json': {
2297
+ id: string
2298
+ threadId: string
2299
+ /** @description ConversationMetadata */
2300
+ metadata: {
2301
+ [key: string]: string | string[]
2302
+ } | null
2303
+ /** Format: date-time */
2304
+ startedAt: string
2305
+ /** Format: date-time */
2306
+ messagesUpdatedAt: string
2307
+ messages: {
2308
+ /** @enum {string} */
2309
+ role: 'user' | 'assistant' | 'system' | 'tool'
2310
+ /** @default null */
2311
+ content: string | null
2312
+ /** @default null */
2313
+ toolName: string | null
2314
+ /**
2315
+ * @default null
2316
+ * @enum {string|null}
2317
+ */
2318
+ toolType: 'call' | 'result' | null
2319
+ }[]
2320
+ modelProvider: string | null
2321
+ modelId: string | null
2322
+ /** @description ConversationTokenUsage */
2323
+ tokenUsage: {
2324
+ inputTokens?: number
2325
+ outputTokens?: number
2326
+ totalTokens?: number
2327
+ } | null
2328
+ /** @description ConversationCoreMetrics */
2329
+ coreMetrics: {
2330
+ successScore?: number
2331
+ /** @enum {string} */
2332
+ sentiment?: 'positive' | 'neutral' | 'negative'
2333
+ contentGaps?: string[]
2334
+ } | null
2335
+ /** Format: date-time */
2336
+ classifiedAt: string | null
2337
+ classificationError: string | null
2338
+ /** Format: date-time */
2339
+ createdAt: string
2340
+ /** Format: date-time */
2341
+ updatedAt: string
2342
+ }
2343
+ }
2344
+ }
2345
+ }
2346
+ }
2347
+ classifyConversation: {
2348
+ parameters: {
2349
+ query?: never
2350
+ header?: never
2351
+ path: {
2352
+ threadId: string
2353
+ }
2354
+ cookie?: never
2355
+ }
2356
+ /** @description ClassifyConversationInput */
2357
+ requestBody: {
2358
+ content: {
2359
+ 'application/json': {
2360
+ coreMetrics?: {
2361
+ successScore: number
2362
+ /** @enum {string} */
2363
+ sentiment: 'positive' | 'neutral' | 'negative'
2364
+ contentGaps: string[]
2365
+ }
2366
+ classificationError?: string
2367
+ }
2368
+ }
2369
+ }
2370
+ responses: {
2371
+ /** @description Conversation */
2372
+ 200: {
2373
+ headers: {
2374
+ [name: string]: unknown
2375
+ }
2376
+ content: {
2377
+ 'application/json': {
2378
+ id: string
2379
+ threadId: string
2380
+ /** @description ConversationMetadata */
2381
+ metadata: {
2382
+ [key: string]: string | string[]
2383
+ } | null
2384
+ /** Format: date-time */
2385
+ startedAt: string
2386
+ /** Format: date-time */
2387
+ messagesUpdatedAt: string
2388
+ messages: {
2389
+ /** @enum {string} */
2390
+ role: 'user' | 'assistant' | 'system' | 'tool'
2391
+ /** @default null */
2392
+ content: string | null
2393
+ /** @default null */
2394
+ toolName: string | null
2395
+ /**
2396
+ * @default null
2397
+ * @enum {string|null}
2398
+ */
2399
+ toolType: 'call' | 'result' | null
2400
+ }[]
2401
+ modelProvider: string | null
2402
+ modelId: string | null
2403
+ /** @description ConversationTokenUsage */
2404
+ tokenUsage: {
2405
+ inputTokens?: number
2406
+ outputTokens?: number
2407
+ totalTokens?: number
2408
+ } | null
2409
+ /** @description ConversationCoreMetrics */
2410
+ coreMetrics: {
2411
+ successScore?: number
2412
+ /** @enum {string} */
2413
+ sentiment?: 'positive' | 'neutral' | 'negative'
2414
+ contentGaps?: string[]
2415
+ } | null
2416
+ /** Format: date-time */
2417
+ classifiedAt: string | null
2418
+ classificationError: string | null
2419
+ /** Format: date-time */
2420
+ createdAt: string
2421
+ /** Format: date-time */
2422
+ updatedAt: string
2423
+ }
2424
+ }
2425
+ }
2426
+ }
2427
+ }
2428
+ }