@squidcloud/client 1.0.500 → 1.0.501

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 (47) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/esm/index.js +1 -1
  3. package/dist/internal-common/src/public-types/connector.public-types.d.ts +45 -0
  4. package/dist/typescript-client/src/admin-client.d.ts +1 -0
  5. package/dist/typescript-client/src/integration-client.d.ts +14 -1
  6. package/dist/typescript-client/src/version.d.ts +1 -1
  7. package/package.json +1 -1
  8. package/dist/internal-common/src/ai/system-openai-compatible.d.ts +0 -35
  9. package/dist/internal-common/src/metric-name.d.ts +0 -5
  10. package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +0 -30
  11. package/dist/internal-common/src/public-types-backend/mutation.public-context.d.ts +0 -161
  12. package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +0 -75
  13. package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +0 -193
  14. package/dist/internal-common/src/types/ai-agent.types.d.ts +0 -304
  15. package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +0 -639
  16. package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +0 -19
  17. package/dist/internal-common/src/types/backend-function.types.d.ts +0 -1
  18. package/dist/internal-common/src/types/communication.types.d.ts +0 -1
  19. package/dist/internal-common/src/types/document.types.d.ts +0 -1
  20. package/dist/internal-common/src/types/file.types.d.ts +0 -6
  21. package/dist/internal-common/src/types/headers.types.d.ts +0 -45
  22. package/dist/internal-common/src/types/management-api-key.types.d.ts +0 -92
  23. package/dist/internal-common/src/types/mutation.types.d.ts +0 -1
  24. package/dist/internal-common/src/types/notification.types.d.ts +0 -19
  25. package/dist/internal-common/src/types/observability.types.d.ts +0 -296
  26. package/dist/internal-common/src/types/query.types.d.ts +0 -21
  27. package/dist/internal-common/src/types/secret.types.d.ts +0 -7
  28. package/dist/internal-common/src/types/socket.types.d.ts +0 -1
  29. package/dist/internal-common/src/types/stage.d.ts +0 -9
  30. package/dist/internal-common/src/types/time-units.d.ts +0 -1
  31. package/dist/internal-common/src/types/url-shortener.types.d.ts +0 -45
  32. package/dist/internal-common/src/utils/array.d.ts +0 -7
  33. package/dist/internal-common/src/utils/e2e-test-utils.d.ts +0 -2
  34. package/dist/internal-common/src/utils/file-utils.d.ts +0 -2
  35. package/dist/internal-common/src/utils/global.utils.d.ts +0 -1
  36. package/dist/internal-common/src/utils/http-utils.d.ts +0 -15
  37. package/dist/internal-common/src/utils/http.d.ts +0 -4
  38. package/dist/internal-common/src/utils/integration-access-tokens.d.ts +0 -15
  39. package/dist/internal-common/src/utils/lock.manager.d.ts +0 -14
  40. package/dist/internal-common/src/utils/metric-utils.d.ts +0 -4
  41. package/dist/internal-common/src/utils/metrics.types.d.ts +0 -7
  42. package/dist/internal-common/src/utils/object.d.ts +0 -93
  43. package/dist/internal-common/src/utils/serialization.d.ts +0 -30
  44. package/dist/internal-common/src/utils/squid.constants.d.ts +0 -3
  45. package/dist/internal-common/src/utils/trace-id-generator.d.ts +0 -1
  46. package/dist/internal-common/src/utils/validation.d.ts +0 -21
  47. package/dist/internal-common/src/websocket.impl.d.ts +0 -26
@@ -1,639 +0,0 @@
1
- import { AiEmbeddingsModelWithOptionalFields, AiKnowledgeBase, AiKnowledgeBaseChatOptions, AiKnowledgeBaseContext, AiKnowledgeBaseContextRequest, AiKnowledgeBaseGraphContext, AiKnowledgeBaseGraphSearchOptions, AiKnowledgeBaseSearchResultChunk } from '../public-types/ai-knowledge-base.public-types';
2
- import { AiContextId, AiKnowledgeBaseId, AppId } from '../public-types/communication.public-types';
3
- import { DocumentExtractionMethod } from '../public-types/extraction.public-types';
4
- /**
5
- * Internal (eval-harness-only) extension of the public graph search options. `graphOnly` returns just the
6
- * graph channel's chunks (measures the graph's marginal recall) instead of the public `fused` behavior;
7
- * it is not exposed in public-types because production callers always fuse. The graph channel accepts
8
- * this shape at runtime, so eval specs cast their options to it. Themes-level "global" answering is NOT a
9
- * search mode — it moved to the `globalSummary` op of `queryKnowledgeGraph`.
10
- * @category AI
11
- */
12
- export interface AiKnowledgeBaseGraphSearchOptionsInternal extends AiKnowledgeBaseGraphSearchOptions {
13
- /** Internal/eval-only: `'graphOnly'` returns only the graph channel; `'fused'` (default) RRF-merges with hybrid. */
14
- mode?: 'graphOnly' | 'fused';
15
- }
16
- /**
17
- * Request structure for getting an AiKnowledgeBase
18
- * @category AI
19
- */
20
- export interface GetAiKnowledgeBaseRequest {
21
- /** The id of the app */
22
- appId: AppId;
23
- /** The id of the AiKnowledgeBase */
24
- knowledgeBaseId: AiKnowledgeBaseId;
25
- }
26
- /**
27
- * Request structure for getting all AiKnowledgeBases
28
- * @category AI
29
- */
30
- export interface GetAiKnowledgeBasesRequest {
31
- /** The id of the app */
32
- appId: AppId;
33
- }
34
- /**
35
- * Response structure for getting an AiKnowledgeBase
36
- * @category AI
37
- */
38
- export interface GetAiKnowledgeBaseResponse {
39
- /** The resulting AiKnowledgeBase, if it is found */
40
- knowledgeBase: AiKnowledgeBase | undefined;
41
- }
42
- /**
43
- * Request structure for deleting an AiKnowledgeBase
44
- * @category AI
45
- */
46
- export interface DeleteAiKnowledgeBaseRequest {
47
- /** The id of the AiKnowledgeBase */
48
- id: string;
49
- }
50
- /**
51
- * Request structure for upserting an AiKnowledgeBase
52
- * @category AI
53
- */
54
- export interface UpsertAiKnowledgeBaseRequest {
55
- /** The AiKnowledgeBase to upsert */
56
- knowledgeBase: Omit<AiEmbeddingsModelWithOptionalFields, 'appId' | 'updatedAt'>;
57
- }
58
- /**
59
- * Response structure for listing AiKnowledgeBases
60
- * @category AI
61
- */
62
- export interface ListAiKnowledgeBasesResponse {
63
- /** The list of AiKnowledgeBases */
64
- knowledgeBases: Array<AiKnowledgeBase>;
65
- }
66
- /**
67
- * Request structure for listing AiKnowledgeBaseContexts
68
- * @category AI
69
- * @deprecated Fetches every context in one call with no pagination — expensive for large knowledge
70
- * bases. Use {@link ListAiKnowledgeBaseContextsPageRequest} instead.
71
- */
72
- export interface ListAiKnowledgeBaseContextsRequest {
73
- /** The id of the AiKnowledgeBase */
74
- id: string;
75
- /** The number of characters after which text is truncated. Optional */
76
- truncateTextAfter?: number;
77
- }
78
- /**
79
- * Response structure to list AiKnowledgeBaseContexts
80
- * @category AI
81
- * @deprecated See {@link ListAiKnowledgeBaseContextsRequest}.
82
- */
83
- export interface ListAiKnowledgeBaseContextsResponse {
84
- /** The list of AiKnowledgeBaseContexts */
85
- contexts: Array<AiKnowledgeBaseContext>;
86
- }
87
- /**
88
- * Response structure to list contextids for an AiKnowledgeBase
89
- * @category AI
90
- */
91
- export interface ListAiKnowledgeBaseContextIdsResponse {
92
- /** The list of AiContextIds */
93
- contextIds: Array<AiContextId>;
94
- }
95
- /**
96
- * Request structure for deleting AiKnowledgeBaseContexts
97
- * @category AI
98
- */
99
- export interface DeleteAiKnowledgeBaseContextsRequest {
100
- /** The id of the AiKnowledgeBase */
101
- knowledgeBaseId: string;
102
- /** An array of AiKnowledgeBaseContext ids */
103
- contextIds: Array<string>;
104
- }
105
- /**
106
- * Request structure for replacing the access scopes of a single AiKnowledgeBaseContext.
107
- * @category AI
108
- */
109
- export interface SetAiKnowledgeBaseContextScopesRequest {
110
- /** The id of the AiKnowledgeBase */
111
- knowledgeBaseId: string;
112
- /** The id of the AiKnowledgeBaseContext whose scopes are replaced */
113
- contextId: string;
114
- /** The scopes that grant read access to this context. An empty array makes it visible to everyone. */
115
- scopes: Array<string>;
116
- }
117
- /**
118
- * Response structure for replacing the access scopes of a single AiKnowledgeBaseContext.
119
- * @category AI
120
- */
121
- export interface SetAiKnowledgeBaseContextScopesResponse {
122
- /** How many chunks of the context had their scopes rewritten. */
123
- updatedChunkCount: number;
124
- }
125
- /**
126
- * Request structure for getting an AiKnowledgeBaseContext
127
- * @category AI
128
- */
129
- export interface GetAiKnowledgeBaseContextRequest {
130
- /** The id of the AiKnowledgeBase */
131
- knowledgeBaseId: string;
132
- /** The id of the AiKnowledgeBaseContext */
133
- contextId: string;
134
- /** The number of characters after which text is truncated. Optional */
135
- truncateTextAfter?: number;
136
- }
137
- /**
138
- * Request structure for getting a page of AiKnowledgeBaseContexts
139
- * for a given knowledge base
140
- * @category AI
141
- */
142
- export interface GetAiKnowledgeBaseContextsRequest {
143
- /** The id of the app */
144
- appId: AppId;
145
- /** The id of the AiKnowledgeBase */
146
- knowledgeBaseId: AiKnowledgeBaseId;
147
- /** The number of characters after which text is truncated. Optional */
148
- truncateTextAfter?: number;
149
- /** The number of contexts to skip, for pagination. Optional */
150
- offset?: number;
151
- /** The maximum number of contexts to return, for pagination. Optional */
152
- limit?: number;
153
- /** Case-insensitive substring search across id/title only. Optional */
154
- search?: string;
155
- }
156
- /**
157
- * Response structure for getting a page of AiKnowledgeBaseContexts for a given knowledge base
158
- * @category AI
159
- */
160
- export interface GetAiKnowledgeBaseContextsResponse {
161
- /** The requested page of AiKnowledgeBaseContexts */
162
- contexts: Array<AiKnowledgeBaseContext>;
163
- /** The total number of contexts in the AiKnowledgeBase, ignoring offset/limit */
164
- totalCount: number;
165
- }
166
- /**
167
- * Response structure for getting an AiKnowledgeBaseContext
168
- * @category AI
169
- */
170
- export interface GetAiKnowledgeBaseContextResponse {
171
- /** The resulting AiKnowledgeBaseContext, if it is found */
172
- context: AiKnowledgeBaseContext | undefined;
173
- }
174
- /**
175
- * Request structure for upserting context for an AiKnowledgeBase
176
- * @category AI
177
- */
178
- export interface UpsertAiKnowledgeBaseContextsRequest {
179
- /** The id of the AiKnowledgeBase */
180
- knowledgeBaseId: string;
181
- /** The AiKnowledgeBaseContext data, which could be a file or text */
182
- contextRequests: Array<AiKnowledgeBaseContextRequest>;
183
- /** The job ID to use for the async upsert job */
184
- jobId: string;
185
- }
186
- /**
187
- * Response structure for searching an AiKnowledgeBase
188
- * @category AI
189
- */
190
- export interface AiKnowledgeBaseSearchResponse {
191
- /** Array of result chunks from the search */
192
- chunks: Array<AiKnowledgeBaseSearchResultChunk>;
193
- /** Traversed subgraph for a `searchMode:'graph'` query with `includeGraphContext`; absent otherwise. */
194
- graphContext?: AiKnowledgeBaseGraphContext;
195
- }
196
- export type { ExploreKnowledgeBaseGraphRequest, ExploreKnowledgeBaseGraphResponse, GetKnowledgeBaseGraphStatusRequest, GetKnowledgeBaseGraphStatusResponse, KnowledgeBaseGraphBuildStageUsage, KnowledgeBaseGraphBuildUsage, KnowledgeBaseGraphEdge, KnowledgeBaseGraphFacetStatus, KnowledgeBaseGraphModelUsage, KnowledgeBaseGraphNode, KnowledgeBaseGraphQueryConcepts, KnowledgeBaseGraphQueryDoc, KnowledgeBaseGraphQueryGlobalSummary, KnowledgeBaseGraphQueryMatch, KnowledgeBaseGraphQueryOp, KnowledgeBaseGraphQueryPath, KnowledgeBaseGraphQueryRelationship, KnowledgeBaseGraphQuerySubtreeNode, KnowledgeBaseGraphQueuedRebuild, KnowledgeBaseGraphRebuildMode, KnowledgeBaseGraphResolutionProgress, KnowledgeBaseGraphResolutionStatus, KnowledgeBaseGraphStructuralBuildSkip, KnowledgeBaseGraphStructuralBuildSkipReason, KnowledgeBaseGraphTopic, KnowledgeBaseGraphTopicEdge, KnowledgeBaseGraphUsage, QueryKnowledgeBaseGraphRequest, QueryKnowledgeBaseGraphResponse, RebuildKnowledgeBaseGraphRequest, } from '../public-types/ai-knowledge-base.public-types';
197
- /**
198
- * Request structure for getting the size of context
199
- * for an AiKnowledgeBase
200
- * @category AI
201
- */
202
- export interface AiKnowledgeBaseContextSizeRequest {
203
- /** The ID of the App */
204
- appId: AppId;
205
- /** The ID of the AIKnowledgeBase */
206
- knowledgeBaseId: AiKnowledgeBaseId;
207
- }
208
- /**
209
- * Request structure for the internal test-only route that arms an app's next bulk-ingestion fulltext blob
210
- * operations to fail, so the staging and finalize fallbacks can be exercised without a storage outage.
211
- */
212
- export interface AiKnowledgeBaseFailNextBulkFulltextBlobOpsRequest {
213
- /** The ID of the App */
214
- appId: AppId;
215
- /** How many blob uploads land before the next one fails; omitted leaves uploads alone. */
216
- uploadsBeforeFailure?: number;
217
- /** How many blob reads land before the next one fails; omitted leaves reads alone. */
218
- readsBeforeFailure?: number;
219
- }
220
- /**
221
- * Request structure for the internal test-only route that arms the next `count` grep scans of a
222
- * knowledge base to fail at their `maxTimeMS` deadline.
223
- */
224
- export interface AiKnowledgeBaseFailNextGrepScansRequest {
225
- /** The ID of the App */
226
- appId: AppId;
227
- /** The ID of the AIKnowledgeBase */
228
- knowledgeBaseId: AiKnowledgeBaseId;
229
- /** How many upcoming scans fail; a non-positive value disarms. */
230
- count: number;
231
- /** Whether the next truncated-file-name lookup fails; false disarms, absent leaves it alone. */
232
- failNextTruncatedNameLookup?: boolean;
233
- }
234
- /**
235
- * Request structure for the internal test-only route that reports how many chunk-collection scope
236
- * resolutions a Mongo-backed knowledge base's filtered searches ran, and arms the next ones to fail.
237
- */
238
- export interface AiKnowledgeBaseChunkScopeResolutionsRequest {
239
- /** The ID of the App */
240
- appId: AppId;
241
- /** The ID of the AIKnowledgeBase */
242
- knowledgeBaseId: AiKnowledgeBaseId;
243
- /** How many upcoming chunk-collection resolutions fail at their `maxTimeMS` deadline; absent disarms. */
244
- failNext?: number;
245
- /** How many upcoming context-record lookups fail at their `maxTimeMS` deadline; absent disarms. */
246
- failNextRecordLookups?: number;
247
- }
248
- /** Response structure for {@link AiKnowledgeBaseChunkScopeResolutionsRequest}. */
249
- export interface AiKnowledgeBaseChunkScopeResolutionsResponse {
250
- /** How many chunk-collection scope resolutions ran since the previous request. */
251
- count: number;
252
- }
253
- /**
254
- * Where an armed bulk finalize failure throws: past the destructive-write boundary but before the vector
255
- * write (nothing written), or right after it (the vectors are replaced, the record is not).
256
- */
257
- export type BulkFinalizeFailurePhase = 'beforeVectorWrite' | 'afterVectorWrite';
258
- /**
259
- * Request structure for the internal test-only route that arms the next `count` bulk-ingestion finalizes
260
- * of a knowledge base to throw at `phase`.
261
- */
262
- export interface AiKnowledgeBaseFailNextBulkFinalizeWritesRequest {
263
- /** The ID of the App */
264
- appId: AppId;
265
- /** The ID of the AIKnowledgeBase */
266
- knowledgeBaseId: AiKnowledgeBaseId;
267
- /** How many upcoming finalizes fail; a non-positive value disarms. */
268
- count: number;
269
- /** Where in the finalize the armed failures throw. */
270
- phase: BulkFinalizeFailurePhase;
271
- }
272
- /**
273
- * Request structure for the internal test-only route that arms the next `count` finalize-time
274
- * image-description reads of a bulk-ingested knowledge base to fail.
275
- */
276
- export interface AiKnowledgeBaseFailNextImageDescriptionReadsRequest {
277
- /** The ID of the App */
278
- appId: AppId;
279
- /** The ID of the AIKnowledgeBase */
280
- knowledgeBaseId: AiKnowledgeBaseId;
281
- /** How many upcoming reads fail; zero disarms. */
282
- count: number;
283
- }
284
- /**
285
- * Request structure for the internal test-only route that answers every image with a description derived
286
- * from its own bytes and no vision call, so the sync and bulk lanes describe a file identically.
287
- */
288
- export interface AiKnowledgeBaseStubImageDescriptionsRequest {
289
- /** The ID of the App */
290
- appId: AppId;
291
- /** Arms the stub when true, disarms it when false. */
292
- enabled: boolean;
293
- }
294
- /** Leading text of a stubbed image description; the rest is the sha256 of the image bytes. */
295
- export declare const STUB_IMAGE_DESCRIPTION_PREFIX = "Stubbed image description sha256:";
296
- /**
297
- * Request structure for the internal test-only route that makes one knowledge base's graph be built by
298
- * the deterministic stub extractor instead of by the model.
299
- */
300
- export interface AiKnowledgeBaseEnableGraphStubExtractionRequest {
301
- /** The ID of the App */
302
- appId: AppId;
303
- /** The ID of the AIKnowledgeBase */
304
- knowledgeBaseId: AiKnowledgeBaseId;
305
- /** Gives every entity the stub's pseudo-vector, directive-seeded ones included, so none is embedded. */
306
- pseudoVectors?: boolean;
307
- }
308
- /**
309
- * Request structure for the internal test-only route that shrinks one knowledge base's resolution drain
310
- * bounds, so a small corpus needs several rounds or sweeps to drain.
311
- */
312
- export interface AiKnowledgeBaseSetGraphResolutionDrainBoundsRequest {
313
- /** The ID of the App */
314
- appId: AppId;
315
- /** The ID of the AIKnowledgeBase */
316
- knowledgeBaseId: AiKnowledgeBaseId;
317
- /** Dirty entities one resolution pass examines. */
318
- dirtyBatch: number;
319
- /** Drain rounds one sweep runs. */
320
- maxRounds: number;
321
- /** Candidate pairs one drain round adjudicates; the deployment default when absent. */
322
- maxPairsPerRound?: number;
323
- /** Resolution passes one drain round runs; the deployment default when absent. */
324
- maxPasses?: number;
325
- /** Adjudication calls kept in flight; the deployment default when absent. */
326
- adjudicationConcurrency?: number;
327
- /** Dirty entities one pass searches candidates for at once; the deployment default when absent. */
328
- proposalConcurrency?: number;
329
- }
330
- /**
331
- * Request structure for the internal test-only route that drops each entity's own hit from one knowledge
332
- * base's resolution ANN results, so a test can make every entity miss itself.
333
- */
334
- export interface AiKnowledgeBaseHideOwnResolutionHitsRequest {
335
- /** The ID of the App */
336
- appId: AppId;
337
- /** The ID of the AIKnowledgeBase */
338
- knowledgeBaseId: AiKnowledgeBaseId;
339
- }
340
- /**
341
- * Where a test can park a graph write. `merge-component` holds a resolution merge before it takes the write
342
- * lock for its component, `merge` between its snapshot read and its fence, and `merge-fenced` between its
343
- * fence and its first write; `entity-read-back` holds a finalize upsert before the read-back that names its
344
- * entities, and `entity-provenance` after that read-back's fallback, before its provenance write; `edge-write`
345
- * holds it before the edge write, the window its description pass occupies, and `edge-upsert` after the edge
346
- * write resolved its endpoints, before it writes. `prune-repair` holds a prune between its bucket delete and
347
- * its owner repair.
348
- */
349
- export type GraphWriteGatePoint = 'merge-component' | 'merge' | 'merge-fenced' | 'entity-read-back' | 'entity-provenance' | 'edge-write' | 'edge-upsert' | 'prune-repair';
350
- /**
351
- * Request structure for the internal test-only route that parks one of a knowledge base's graph writes,
352
- * so a test can interleave a resolution merge with a bulk-finalize upsert deterministically.
353
- */
354
- export interface AiKnowledgeBaseSetGraphWriteGateRequest {
355
- /** The ID of the App */
356
- appId: AppId;
357
- /** The ID of the AIKnowledgeBase */
358
- knowledgeBaseId: AiKnowledgeBaseId;
359
- /** Which write to park. */
360
- point: GraphWriteGatePoint;
361
- /** True parks the next writer at that point; false releases a parked writer and stops parking. */
362
- armed: boolean;
363
- }
364
- /** Response of the internal test-only graph write-gate route. */
365
- export interface AiKnowledgeBaseSetGraphWriteGateResponse {
366
- /** True once a writer has parked on the gate. */
367
- entered: boolean;
368
- /** How many writers have parked on the gate since it was armed. */
369
- entrants: number;
370
- }
371
- /**
372
- * Request structure for the internal test-only route that runs one knowledge base's graph writes without the
373
- * per-KB write lock, so a test can pin the interleavings the lock rules out.
374
- */
375
- export interface AiKnowledgeBaseBypassGraphWriteLockRequest {
376
- /** The ID of the App */
377
- appId: AppId;
378
- /** The ID of the AIKnowledgeBase */
379
- knowledgeBaseId: AiKnowledgeBaseId;
380
- }
381
- /** Request structure for the internal test-only route that reports one knowledge base's graph write lock. */
382
- export interface AiKnowledgeBaseGetGraphWriteLockStateRequest {
383
- /** The ID of the App */
384
- appId: AppId;
385
- /** The ID of the AIKnowledgeBase */
386
- knowledgeBaseId: AiKnowledgeBaseId;
387
- }
388
- /** Response of the internal test-only graph write-lock state route. */
389
- export interface AiKnowledgeBaseGetGraphWriteLockStateResponse {
390
- /** Writers holding the lock shared: finalize entity or edge writes. */
391
- sharedHolders: number;
392
- /** True while a resolution merge holds the lock exclusive. */
393
- exclusiveHeld: boolean;
394
- /** Writers queued for a shared hold. */
395
- sharedWaiters: number;
396
- /** Writers queued for an exclusive hold. */
397
- exclusiveWaiters: number;
398
- }
399
- /**
400
- * Request structure for the internal test-only route that sets a knowledge base's graph schema version.
401
- * A migration test needs a KB on the older schema, which the creation path never produces.
402
- */
403
- export interface AiKnowledgeBaseSetGraphSchemaVersionRequest {
404
- /** The ID of the App */
405
- appId: AppId;
406
- /** The ID of the AIKnowledgeBase */
407
- knowledgeBaseId: AiKnowledgeBaseId;
408
- /** The schema version to stamp; omit to clear the stamp so the KB uses the v1 layout. */
409
- version?: number;
410
- }
411
- /**
412
- * Request structure of the operator call that quarantines a knowledge base's dead-weight graph entities
413
- * (ENG-2802): entities of degree at most `maxDegree`, cited by at most one chunk, whose name carries no
414
- * significant token, is numeric/date-like, or is one token shared by many other entity names.
415
- */
416
- export interface QuarantineKnowledgeBaseGraphEntitiesRequest {
417
- /** The ID of the AIKnowledgeBase */
418
- knowledgeBaseId: AiKnowledgeBaseId;
419
- /** Reports the matching set without writing anything. */
420
- dryRun?: boolean;
421
- /** Highest degree a quarantined entity may have: 0 (default) or 1. */
422
- maxDegree?: number;
423
- /**
424
- * How many entities must share a single-token name signature before that token counts as generic;
425
- * the deployment default when absent.
426
- */
427
- frequentSignatureMinEntities?: number;
428
- }
429
- /** One entity a quarantine report samples. */
430
- export interface KnowledgeBaseGraphQuarantineSampleEntity {
431
- /** Hex id of the entity document. */
432
- id: string;
433
- /** Canonical display name. */
434
- name: string;
435
- /** Extracted entity type. */
436
- type: string;
437
- /** Relationships touching the entity. */
438
- degree: number;
439
- /** Chunks citing the entity. */
440
- chunkRefCount: number;
441
- }
442
- /** Response structure of {@link QuarantineKnowledgeBaseGraphEntitiesRequest}. */
443
- export interface QuarantineKnowledgeBaseGraphEntitiesResponse {
444
- /** Stamped on every entity this run quarantined; absent on a dry run. */
445
- runId?: string;
446
- /** Entities the criteria match (dry run) or this run quarantined. */
447
- matched: number;
448
- /** Entities of the partition still live after the run (dry run: before it). */
449
- liveEntityCount: number;
450
- /** Entities quarantined by this and earlier runs. */
451
- quarantinedEntityCount: number;
452
- /** Up to 50 matching entities. */
453
- sample: KnowledgeBaseGraphQuarantineSampleEntity[];
454
- }
455
- /** Request structure of the operator call that restores the entities one quarantine run hid. */
456
- export interface RestoreKnowledgeBaseGraphEntitiesRequest {
457
- /** The ID of the AIKnowledgeBase */
458
- knowledgeBaseId: AiKnowledgeBaseId;
459
- /** The `runId` the quarantine call returned. */
460
- runId: string;
461
- }
462
- /** Response structure of {@link RestoreKnowledgeBaseGraphEntitiesRequest}. */
463
- export interface RestoreKnowledgeBaseGraphEntitiesResponse {
464
- /** Entities the call restored. */
465
- restored: number;
466
- /** Entities still quarantined by other runs. */
467
- quarantinedEntityCount: number;
468
- }
469
- /**
470
- * Request structure for identifying a knowledge base to reimport the context files (when possible).
471
- */
472
- export interface AiKnowledgeBaseReimportAllFilesRequest {
473
- /** The ID of the AIKnowledgeBase */
474
- knowledgeBaseId: AiKnowledgeBaseId;
475
- }
476
- /**
477
- * Request structure for identifying a knowledge base to reimport the context files (when possible).
478
- */
479
- export interface AiKnowledgeBaseReimportFilesRequest {
480
- /** The ID of the AIKnowledgeBase */
481
- knowledgeBaseId: AiKnowledgeBaseId;
482
- /** The ids of the AiKnowledgeBaseContexts to reimport */
483
- contextIds: Array<string>;
484
- }
485
- /** Longest context batch one `backfillFulltext` call accepts; larger work-lists are split by the caller. */
486
- export declare const BACKFILL_FULLTEXT_MAX_CONTEXTS_PER_CALL = 20;
487
- /**
488
- * Request structure for rebuilding the stored raw text (`kb_fulltext`) of existing contexts from their
489
- * stored source files, without re-ingesting them — no chunk, embedding or graph writes. This is how
490
- * contexts ingested before literal search existed become greppable.
491
- */
492
- export interface AiKnowledgeBaseBackfillFulltextRequest {
493
- /** The ID of the AIKnowledgeBase */
494
- knowledgeBaseId: AiKnowledgeBaseId;
495
- /**
496
- * The ids of the contexts to backfill, at most {@link BACKFILL_FULLTEXT_MAX_CONTEXTS_PER_CALL} per
497
- * call. Each context's stored text is fully replaced, so re-running a context is safe.
498
- */
499
- contextIds: Array<AiContextId>;
500
- /**
501
- * The extraction method for file contexts. Defaults to the server's regular document extraction
502
- * default (OCR when configured), which reproduces the text the ingest pipeline indexed — including
503
- * scanned pages. `legacy` extracts in-process without any external model call, but yields nothing for
504
- * scanned pages, so a caller choosing it must compare the stored part counts against expectations.
505
- * `legacy_with_llm` yields the same in-process text here — its page-screenshot descriptions are an
506
- * ingest-time addition, not part of the literal text this backfill rebuilds.
507
- */
508
- extractionMethod?: DocumentExtractionMethod;
509
- /**
510
- * A context that already has stored text is SKIPPED unless this is true. The backfill rebuilds
511
- * literal text only, while ingest also stores image/OCR-description parts — so replacing a context
512
- * that ingest populated would silently delete its description text from the literal index. Set this
513
- * only to deliberately re-extract contexts this backfill itself populated (e.g. retrying a thin
514
- * `legacy` yield with OCR).
515
- */
516
- overwrite?: boolean;
517
- }
518
- /**
519
- * Response structure for a `backfillFulltext` call: one status per requested context, in request order.
520
- */
521
- export interface AiKnowledgeBaseBackfillFulltextResponse {
522
- statuses: Array<AiKnowledgeBaseBackfillFulltextStatus>;
523
- }
524
- /**
525
- * Outcome of backfilling the raw text of one context.
526
- */
527
- export interface AiKnowledgeBaseBackfillFulltextStatus {
528
- contextId: AiContextId;
529
- /** `skipped` means the context already has stored text and `overwrite` was not set; nothing changed. */
530
- status: 'success' | 'error' | 'skipped';
531
- /**
532
- * How many parts (pages/sheets) were stored, on success. Zero means extraction yielded no text at
533
- * all — for a `legacy` run over a scanned document that is the expected signal to retry with OCR.
534
- */
535
- storedPartCount?: number;
536
- errorMessage?: string;
537
- }
538
- /** Longest context batch one `repairBulkFulltext` call accepts; larger work-lists are split by the caller. */
539
- export declare const REPAIR_BULK_FULLTEXT_MAX_CONTEXTS_PER_CALL = 20;
540
- /**
541
- * Request structure for rebuilding the stored raw text (`kb_fulltext`) of bulk-ingested contexts from the
542
- * bulk-ingestion rows their job retained: the staged pages plus the descriptions its `imageDescription`
543
- * requests already produced. No vision call, so a repaired context reads exactly as a freshly ingested
544
- * one at no model cost.
545
- */
546
- export interface AiKnowledgeBaseRepairBulkFulltextRequest {
547
- /** The ID of the AIKnowledgeBase */
548
- knowledgeBaseId: AiKnowledgeBaseId;
549
- /**
550
- * The ids of the contexts to repair, at most {@link REPAIR_BULK_FULLTEXT_MAX_CONTEXTS_PER_CALL} per
551
- * call. Each context's stored text is fully replaced, so re-running a context is safe.
552
- */
553
- contextIds: Array<AiContextId>;
554
- /**
555
- * Rebuilds a context whose staged pages are gone by re-extracting its stored source file, which runs
556
- * the regular document lane and can bill OCR. Off by default; such contexts are skipped without it.
557
- */
558
- reextractMissingPages?: boolean;
559
- /**
560
- * The extraction method of the {@link reextractMissingPages} fallback, defaulting to the server's
561
- * regular one. Name the method the original ingest used: a file extracted with OCR yields no text for
562
- * its scanned pages under a method that does not run it, replacing the context's text with less of it.
563
- */
564
- extractionMethod?: DocumentExtractionMethod;
565
- }
566
- /** Response structure for a `repairBulkFulltext` call: one status per requested context, in request order. */
567
- export interface AiKnowledgeBaseRepairBulkFulltextResponse {
568
- statuses: Array<AiKnowledgeBaseRepairBulkFulltextStatus>;
569
- }
570
- /** Outcome of repairing the raw text of one bulk-ingested context. */
571
- export interface AiKnowledgeBaseRepairBulkFulltextStatus {
572
- contextId: AiContextId;
573
- /**
574
- * `repairedFromReextraction` rebuilt the pages from the stored source file because the row's own were
575
- * gone: a fresh extraction, so its text is best-effort rather than the original's. `raced` means another
576
- * ingest took the context over during the repair, so re-run it.
577
- */
578
- status: 'repaired' | 'repairedFromReextraction' | 'raced' | 'error' | 'skipped';
579
- /** Why the context was left untouched, when it was skipped. `noJob` cannot be repaired by re-running. */
580
- skippedReason?: 'notBulkIngested' | 'noJob' | 'jobActive' | 'noFileRow' | 'notFinalized' | 'pagesBounded' | 'noDescriptionRows' | 'noPages' | 'reingested';
581
- /** How many parts (pages/sheets/image descriptions) were stored, on success. */
582
- storedPartCount?: number;
583
- errorMessage?: string;
584
- }
585
- /**
586
- * Response structure for getting size of context
587
- * @category AI
588
- */
589
- export interface AiKnowledgeBaseContextSizeResponse {
590
- /** Size of context bytes, as a number */
591
- sizeBytes: number;
592
- }
593
- /**
594
- * Request structure for getting the values vector of
595
- * a specific context
596
- *
597
- * @category AI
598
- */
599
- export interface AiKnowledgeBaseValueVectorRequest {
600
- /** The ID of the App */
601
- appId: AppId;
602
- /** The ID of the AIKnowledgeBase */
603
- knowledgeBaseId: AiKnowledgeBaseId;
604
- /** The ID of the context */
605
- contextId: AiContextId;
606
- }
607
- /**
608
- * Response structure for getting values vector of a
609
- * specific context
610
- * @category AI
611
- */
612
- export interface AiKnowledgeBaseValueVectorResponse {
613
- /** The vector */
614
- vector: number[];
615
- }
616
- /**
617
- * Internal (console-test-only) extension of the public chat options, for the `test/chat` endpoint
618
- * used by the console's KB test-chat panel.
619
- * @category AI
620
- */
621
- export interface AiKnowledgeBaseChatOptionsInternal extends AiKnowledgeBaseChatOptions {
622
- /**
623
- * When true, the response cites sources by name using inline markers — names only, since this
624
- * console-test path never mints download links. Takes precedence over the deprecated
625
- * `includeReference`. Default to false.
626
- */
627
- citation?: boolean;
628
- }
629
- export interface AiKnowledgeBaseChatRequest {
630
- knowledgeBaseId: AiKnowledgeBaseId;
631
- prompt?: string;
632
- options?: AiKnowledgeBaseChatOptionsInternal;
633
- }
634
- /** Emitted to the console queue when a knowledge base, its contexts, or a file's ingestion status change. */
635
- export interface KbChangeEvent {
636
- appId: AppId;
637
- knowledgeBaseId: AiKnowledgeBaseId;
638
- changeType: 'kb' | 'context' | 'fileStatus';
639
- }
@@ -1,19 +0,0 @@
1
- import { MmEntity, MmMatchMaker } from '../public-types/ai-matchmaking.public-types';
2
- /**
3
- * Internal-only matchmaking request shapes. Every other request/response of the matchmaking wire
4
- * contract is declared in `ai-matchmaking.public-types` and imported directly from there.
5
- */
6
- export interface MmCreateMatchMakerRequest {
7
- matchMaker: MmMatchMaker;
8
- }
9
- export interface MmGetMatchMakerRequest {
10
- matchMakerId: string;
11
- }
12
- export interface MmInsertEntityRequest {
13
- matchMakerId: string;
14
- entity: MmEntity;
15
- }
16
- export interface MmGetEntityRequest {
17
- matchMakerId: string;
18
- entityId: string;
19
- }
@@ -1 +0,0 @@
1
- export type ChatId = string;
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- export interface Base64File {
2
- filename: string;
3
- mimetype: string;
4
- base64: string;
5
- __isSquidBase64File__: true;
6
- }