@squidcloud/client 1.0.496 → 1.0.498

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 (53) 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/ai-agent.public-types.d.ts +43 -4
  4. package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +8 -3
  5. package/dist/internal-common/src/public-types/ai-function.public-types.d.ts +11 -1
  6. package/dist/internal-common/src/public-types/ai-knowledge-base.public-types.d.ts +193 -19
  7. package/dist/internal-common/src/public-types/langgraph.public-types.d.ts +10 -0
  8. package/dist/typescript-client/src/agent/ai-agent-client-reference.d.ts +4 -4
  9. package/dist/typescript-client/src/agent/ai-agent-client.types.d.ts +11 -3
  10. package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client-reference.d.ts +18 -4
  11. package/dist/typescript-client/src/langgraph-client.d.ts +7 -13
  12. package/dist/typescript-client/src/version.d.ts +1 -1
  13. package/package.json +1 -1
  14. package/dist/internal-common/src/ai/system-openai-compatible.d.ts +0 -35
  15. package/dist/internal-common/src/metric-name.d.ts +0 -14
  16. package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +0 -30
  17. package/dist/internal-common/src/public-types-backend/mutation.public-context.d.ts +0 -161
  18. package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +0 -75
  19. package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +0 -193
  20. package/dist/internal-common/src/types/ai-agent.types.d.ts +0 -302
  21. package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +0 -618
  22. package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +0 -19
  23. package/dist/internal-common/src/types/backend-function.types.d.ts +0 -1
  24. package/dist/internal-common/src/types/communication.types.d.ts +0 -1
  25. package/dist/internal-common/src/types/document.types.d.ts +0 -1
  26. package/dist/internal-common/src/types/file.types.d.ts +0 -6
  27. package/dist/internal-common/src/types/headers.types.d.ts +0 -58
  28. package/dist/internal-common/src/types/management-api-key.types.d.ts +0 -92
  29. package/dist/internal-common/src/types/mutation.types.d.ts +0 -1
  30. package/dist/internal-common/src/types/notification.types.d.ts +0 -19
  31. package/dist/internal-common/src/types/observability.types.d.ts +0 -226
  32. package/dist/internal-common/src/types/query.types.d.ts +0 -15
  33. package/dist/internal-common/src/types/secret.types.d.ts +0 -7
  34. package/dist/internal-common/src/types/socket.types.d.ts +0 -1
  35. package/dist/internal-common/src/types/stage.d.ts +0 -9
  36. package/dist/internal-common/src/types/time-units.d.ts +0 -1
  37. package/dist/internal-common/src/types/url-shortener.types.d.ts +0 -45
  38. package/dist/internal-common/src/utils/array.d.ts +0 -7
  39. package/dist/internal-common/src/utils/e2e-test-utils.d.ts +0 -2
  40. package/dist/internal-common/src/utils/file-utils.d.ts +0 -2
  41. package/dist/internal-common/src/utils/global.utils.d.ts +0 -1
  42. package/dist/internal-common/src/utils/http-utils.d.ts +0 -15
  43. package/dist/internal-common/src/utils/http.d.ts +0 -4
  44. package/dist/internal-common/src/utils/integration-access-tokens.d.ts +0 -15
  45. package/dist/internal-common/src/utils/lock.manager.d.ts +0 -14
  46. package/dist/internal-common/src/utils/metric-utils.d.ts +0 -4
  47. package/dist/internal-common/src/utils/metrics.types.d.ts +0 -7
  48. package/dist/internal-common/src/utils/object.d.ts +0 -86
  49. package/dist/internal-common/src/utils/serialization.d.ts +0 -30
  50. package/dist/internal-common/src/utils/squid.constants.d.ts +0 -6
  51. package/dist/internal-common/src/utils/trace-id-generator.d.ts +0 -1
  52. package/dist/internal-common/src/utils/validation.d.ts +0 -21
  53. package/dist/internal-common/src/websocket.impl.d.ts +0 -26
@@ -1,618 +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, KnowledgeBaseGraphQuerySubtreeNode, KnowledgeBaseGraphRebuildMode, KnowledgeBaseGraphResolutionStatus, 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
- * Where an armed bulk finalize failure throws: past the destructive-write boundary but before the vector
236
- * write (nothing written), or right after it (the vectors are replaced, the record is not).
237
- */
238
- export type BulkFinalizeFailurePhase = 'beforeVectorWrite' | 'afterVectorWrite';
239
- /**
240
- * Request structure for the internal test-only route that arms the next `count` bulk-ingestion finalizes
241
- * of a knowledge base to throw at `phase`.
242
- */
243
- export interface AiKnowledgeBaseFailNextBulkFinalizeWritesRequest {
244
- /** The ID of the App */
245
- appId: AppId;
246
- /** The ID of the AIKnowledgeBase */
247
- knowledgeBaseId: AiKnowledgeBaseId;
248
- /** How many upcoming finalizes fail; a non-positive value disarms. */
249
- count: number;
250
- /** Where in the finalize the armed failures throw. */
251
- phase: BulkFinalizeFailurePhase;
252
- }
253
- /**
254
- * Request structure for the internal test-only route that arms the next `count` finalize-time
255
- * image-description reads of a bulk-ingested knowledge base to fail.
256
- */
257
- export interface AiKnowledgeBaseFailNextImageDescriptionReadsRequest {
258
- /** The ID of the App */
259
- appId: AppId;
260
- /** The ID of the AIKnowledgeBase */
261
- knowledgeBaseId: AiKnowledgeBaseId;
262
- /** How many upcoming reads fail; zero disarms. */
263
- count: number;
264
- }
265
- /**
266
- * Request structure for the internal test-only route that answers every image with a description derived
267
- * from its own bytes and no vision call, so the sync and bulk lanes describe a file identically.
268
- */
269
- export interface AiKnowledgeBaseStubImageDescriptionsRequest {
270
- /** The ID of the App */
271
- appId: AppId;
272
- /** Arms the stub when true, disarms it when false. */
273
- enabled: boolean;
274
- }
275
- /** Leading text of a stubbed image description; the rest is the sha256 of the image bytes. */
276
- export declare const STUB_IMAGE_DESCRIPTION_PREFIX = "Stubbed image description sha256:";
277
- /**
278
- * Request structure for the internal test-only route that makes one knowledge base's graph be built by
279
- * the deterministic stub extractor instead of by the model.
280
- */
281
- export interface AiKnowledgeBaseEnableGraphStubExtractionRequest {
282
- /** The ID of the App */
283
- appId: AppId;
284
- /** The ID of the AIKnowledgeBase */
285
- knowledgeBaseId: AiKnowledgeBaseId;
286
- /** Gives every entity the stub's pseudo-vector, directive-seeded ones included, so none is embedded. */
287
- pseudoVectors?: boolean;
288
- }
289
- /**
290
- * Request structure for the internal test-only route that shrinks one knowledge base's resolution drain
291
- * bounds, so a small corpus needs several rounds or sweeps to drain.
292
- */
293
- export interface AiKnowledgeBaseSetGraphResolutionDrainBoundsRequest {
294
- /** The ID of the App */
295
- appId: AppId;
296
- /** The ID of the AIKnowledgeBase */
297
- knowledgeBaseId: AiKnowledgeBaseId;
298
- /** Dirty entities one resolution pass examines. */
299
- dirtyBatch: number;
300
- /** Drain rounds one sweep runs. */
301
- maxRounds: number;
302
- /** Candidate pairs one drain round adjudicates; the deployment default when absent. */
303
- maxPairsPerRound?: number;
304
- /** Resolution passes one drain round runs; the deployment default when absent. */
305
- maxPasses?: number;
306
- /** Adjudication calls kept in flight; the deployment default when absent. */
307
- adjudicationConcurrency?: number;
308
- /** Dirty entities one pass searches candidates for at once; the deployment default when absent. */
309
- proposalConcurrency?: number;
310
- }
311
- /**
312
- * Request structure for the internal test-only route that drops each entity's own hit from one knowledge
313
- * base's resolution ANN results, so a test can make every entity miss itself.
314
- */
315
- export interface AiKnowledgeBaseHideOwnResolutionHitsRequest {
316
- /** The ID of the App */
317
- appId: AppId;
318
- /** The ID of the AIKnowledgeBase */
319
- knowledgeBaseId: AiKnowledgeBaseId;
320
- }
321
- /**
322
- * Where a test can park a graph write. `merge-component` holds a resolution merge before it takes the write
323
- * lock for its component, `merge` between its snapshot read and its fence, and `merge-fenced` between its
324
- * fence and its first write; `entity-read-back` holds a finalize upsert before the read-back that names its
325
- * entities, and `entity-provenance` after that read-back's fallback, before its provenance write; `edge-write`
326
- * holds it before the edge write, the window its description pass occupies, and `edge-upsert` after the edge
327
- * write resolved its endpoints, before it writes. `prune-repair` holds a prune between its bucket delete and
328
- * its owner repair.
329
- */
330
- export type GraphWriteGatePoint = 'merge-component' | 'merge' | 'merge-fenced' | 'entity-read-back' | 'entity-provenance' | 'edge-write' | 'edge-upsert' | 'prune-repair';
331
- /**
332
- * Request structure for the internal test-only route that parks one of a knowledge base's graph writes,
333
- * so a test can interleave a resolution merge with a bulk-finalize upsert deterministically.
334
- */
335
- export interface AiKnowledgeBaseSetGraphWriteGateRequest {
336
- /** The ID of the App */
337
- appId: AppId;
338
- /** The ID of the AIKnowledgeBase */
339
- knowledgeBaseId: AiKnowledgeBaseId;
340
- /** Which write to park. */
341
- point: GraphWriteGatePoint;
342
- /** True parks the next writer at that point; false releases a parked writer and stops parking. */
343
- armed: boolean;
344
- }
345
- /** Response of the internal test-only graph write-gate route. */
346
- export interface AiKnowledgeBaseSetGraphWriteGateResponse {
347
- /** True once a writer has parked on the gate. */
348
- entered: boolean;
349
- }
350
- /**
351
- * Request structure for the internal test-only route that runs one knowledge base's graph writes without the
352
- * per-KB write lock, so a test can pin the interleavings the lock rules out.
353
- */
354
- export interface AiKnowledgeBaseBypassGraphWriteLockRequest {
355
- /** The ID of the App */
356
- appId: AppId;
357
- /** The ID of the AIKnowledgeBase */
358
- knowledgeBaseId: AiKnowledgeBaseId;
359
- }
360
- /** Request structure for the internal test-only route that reports one knowledge base's graph write lock. */
361
- export interface AiKnowledgeBaseGetGraphWriteLockStateRequest {
362
- /** The ID of the App */
363
- appId: AppId;
364
- /** The ID of the AIKnowledgeBase */
365
- knowledgeBaseId: AiKnowledgeBaseId;
366
- }
367
- /** Response of the internal test-only graph write-lock state route. */
368
- export interface AiKnowledgeBaseGetGraphWriteLockStateResponse {
369
- /** Writers holding the lock shared: finalize entity or edge writes. */
370
- sharedHolders: number;
371
- /** True while a resolution merge holds the lock exclusive. */
372
- exclusiveHeld: boolean;
373
- /** Writers queued for a shared hold. */
374
- sharedWaiters: number;
375
- /** Writers queued for an exclusive hold. */
376
- exclusiveWaiters: number;
377
- }
378
- /**
379
- * Request structure for the internal test-only route that sets a knowledge base's graph schema version.
380
- * A migration test needs a KB on the older schema, which the creation path never produces.
381
- */
382
- export interface AiKnowledgeBaseSetGraphSchemaVersionRequest {
383
- /** The ID of the App */
384
- appId: AppId;
385
- /** The ID of the AIKnowledgeBase */
386
- knowledgeBaseId: AiKnowledgeBaseId;
387
- /** The schema version to stamp; omit to clear the stamp so the KB uses the v1 layout. */
388
- version?: number;
389
- }
390
- /**
391
- * Request structure of the operator call that quarantines a knowledge base's dead-weight graph entities
392
- * (ENG-2802): entities of degree at most `maxDegree`, cited by at most one chunk, whose name carries no
393
- * significant token, is numeric/date-like, or is one token shared by many other entity names.
394
- */
395
- export interface QuarantineKnowledgeBaseGraphEntitiesRequest {
396
- /** The ID of the AIKnowledgeBase */
397
- knowledgeBaseId: AiKnowledgeBaseId;
398
- /** Reports the matching set without writing anything. */
399
- dryRun?: boolean;
400
- /** Highest degree a quarantined entity may have: 0 (default) or 1. */
401
- maxDegree?: number;
402
- /**
403
- * How many entities must share a single-token name signature before that token counts as generic;
404
- * the deployment default when absent.
405
- */
406
- frequentSignatureMinEntities?: number;
407
- }
408
- /** One entity a quarantine report samples. */
409
- export interface KnowledgeBaseGraphQuarantineSampleEntity {
410
- /** Hex id of the entity document. */
411
- id: string;
412
- /** Canonical display name. */
413
- name: string;
414
- /** Extracted entity type. */
415
- type: string;
416
- /** Relationships touching the entity. */
417
- degree: number;
418
- /** Chunks citing the entity. */
419
- chunkRefCount: number;
420
- }
421
- /** Response structure of {@link QuarantineKnowledgeBaseGraphEntitiesRequest}. */
422
- export interface QuarantineKnowledgeBaseGraphEntitiesResponse {
423
- /** Stamped on every entity this run quarantined; absent on a dry run. */
424
- runId?: string;
425
- /** Entities the criteria match (dry run) or this run quarantined. */
426
- matched: number;
427
- /** Entities of the partition still live after the run (dry run: before it). */
428
- liveEntityCount: number;
429
- /** Entities quarantined by this and earlier runs. */
430
- quarantinedEntityCount: number;
431
- /** Up to 50 matching entities. */
432
- sample: KnowledgeBaseGraphQuarantineSampleEntity[];
433
- }
434
- /** Request structure of the operator call that restores the entities one quarantine run hid. */
435
- export interface RestoreKnowledgeBaseGraphEntitiesRequest {
436
- /** The ID of the AIKnowledgeBase */
437
- knowledgeBaseId: AiKnowledgeBaseId;
438
- /** The `runId` the quarantine call returned. */
439
- runId: string;
440
- }
441
- /** Response structure of {@link RestoreKnowledgeBaseGraphEntitiesRequest}. */
442
- export interface RestoreKnowledgeBaseGraphEntitiesResponse {
443
- /** Entities the call restored. */
444
- restored: number;
445
- /** Entities still quarantined by other runs. */
446
- quarantinedEntityCount: number;
447
- }
448
- /**
449
- * Request structure for identifying a knowledge base to reimport the context files (when possible).
450
- */
451
- export interface AiKnowledgeBaseReimportAllFilesRequest {
452
- /** The ID of the AIKnowledgeBase */
453
- knowledgeBaseId: AiKnowledgeBaseId;
454
- }
455
- /**
456
- * Request structure for identifying a knowledge base to reimport the context files (when possible).
457
- */
458
- export interface AiKnowledgeBaseReimportFilesRequest {
459
- /** The ID of the AIKnowledgeBase */
460
- knowledgeBaseId: AiKnowledgeBaseId;
461
- /** The ids of the AiKnowledgeBaseContexts to reimport */
462
- contextIds: Array<string>;
463
- }
464
- /** Longest context batch one `backfillFulltext` call accepts; larger work-lists are split by the caller. */
465
- export declare const BACKFILL_FULLTEXT_MAX_CONTEXTS_PER_CALL = 20;
466
- /**
467
- * Request structure for rebuilding the stored raw text (`kb_fulltext`) of existing contexts from their
468
- * stored source files, without re-ingesting them — no chunk, embedding or graph writes. This is how
469
- * contexts ingested before literal search existed become greppable.
470
- */
471
- export interface AiKnowledgeBaseBackfillFulltextRequest {
472
- /** The ID of the AIKnowledgeBase */
473
- knowledgeBaseId: AiKnowledgeBaseId;
474
- /**
475
- * The ids of the contexts to backfill, at most {@link BACKFILL_FULLTEXT_MAX_CONTEXTS_PER_CALL} per
476
- * call. Each context's stored text is fully replaced, so re-running a context is safe.
477
- */
478
- contextIds: Array<AiContextId>;
479
- /**
480
- * The extraction method for file contexts. Defaults to the server's regular document extraction
481
- * default (OCR when configured), which reproduces the text the ingest pipeline indexed — including
482
- * scanned pages. `legacy` extracts in-process without any external model call, but yields nothing for
483
- * scanned pages, so a caller choosing it must compare the stored part counts against expectations.
484
- * `legacy_with_llm` yields the same in-process text here — its page-screenshot descriptions are an
485
- * ingest-time addition, not part of the literal text this backfill rebuilds.
486
- */
487
- extractionMethod?: DocumentExtractionMethod;
488
- /**
489
- * A context that already has stored text is SKIPPED unless this is true. The backfill rebuilds
490
- * literal text only, while ingest also stores image/OCR-description parts — so replacing a context
491
- * that ingest populated would silently delete its description text from the literal index. Set this
492
- * only to deliberately re-extract contexts this backfill itself populated (e.g. retrying a thin
493
- * `legacy` yield with OCR).
494
- */
495
- overwrite?: boolean;
496
- }
497
- /**
498
- * Response structure for a `backfillFulltext` call: one status per requested context, in request order.
499
- */
500
- export interface AiKnowledgeBaseBackfillFulltextResponse {
501
- statuses: Array<AiKnowledgeBaseBackfillFulltextStatus>;
502
- }
503
- /**
504
- * Outcome of backfilling the raw text of one context.
505
- */
506
- export interface AiKnowledgeBaseBackfillFulltextStatus {
507
- contextId: AiContextId;
508
- /** `skipped` means the context already has stored text and `overwrite` was not set; nothing changed. */
509
- status: 'success' | 'error' | 'skipped';
510
- /**
511
- * How many parts (pages/sheets) were stored, on success. Zero means extraction yielded no text at
512
- * all — for a `legacy` run over a scanned document that is the expected signal to retry with OCR.
513
- */
514
- storedPartCount?: number;
515
- errorMessage?: string;
516
- }
517
- /** Longest context batch one `repairBulkFulltext` call accepts; larger work-lists are split by the caller. */
518
- export declare const REPAIR_BULK_FULLTEXT_MAX_CONTEXTS_PER_CALL = 20;
519
- /**
520
- * Request structure for rebuilding the stored raw text (`kb_fulltext`) of bulk-ingested contexts from the
521
- * bulk-ingestion rows their job retained: the staged pages plus the descriptions its `imageDescription`
522
- * requests already produced. No vision call, so a repaired context reads exactly as a freshly ingested
523
- * one at no model cost.
524
- */
525
- export interface AiKnowledgeBaseRepairBulkFulltextRequest {
526
- /** The ID of the AIKnowledgeBase */
527
- knowledgeBaseId: AiKnowledgeBaseId;
528
- /**
529
- * The ids of the contexts to repair, at most {@link REPAIR_BULK_FULLTEXT_MAX_CONTEXTS_PER_CALL} per
530
- * call. Each context's stored text is fully replaced, so re-running a context is safe.
531
- */
532
- contextIds: Array<AiContextId>;
533
- /**
534
- * Rebuilds a context whose staged pages are gone by re-extracting its stored source file, which runs
535
- * the regular document lane and can bill OCR. Off by default; such contexts are skipped without it.
536
- */
537
- reextractMissingPages?: boolean;
538
- /**
539
- * The extraction method of the {@link reextractMissingPages} fallback, defaulting to the server's
540
- * regular one. Name the method the original ingest used: a file extracted with OCR yields no text for
541
- * its scanned pages under a method that does not run it, replacing the context's text with less of it.
542
- */
543
- extractionMethod?: DocumentExtractionMethod;
544
- }
545
- /** Response structure for a `repairBulkFulltext` call: one status per requested context, in request order. */
546
- export interface AiKnowledgeBaseRepairBulkFulltextResponse {
547
- statuses: Array<AiKnowledgeBaseRepairBulkFulltextStatus>;
548
- }
549
- /** Outcome of repairing the raw text of one bulk-ingested context. */
550
- export interface AiKnowledgeBaseRepairBulkFulltextStatus {
551
- contextId: AiContextId;
552
- /**
553
- * `repairedFromReextraction` rebuilt the pages from the stored source file because the row's own were
554
- * gone: a fresh extraction, so its text is best-effort rather than the original's. `raced` means another
555
- * ingest took the context over during the repair, so re-run it.
556
- */
557
- status: 'repaired' | 'repairedFromReextraction' | 'raced' | 'error' | 'skipped';
558
- /** Why the context was left untouched, when it was skipped. `noJob` cannot be repaired by re-running. */
559
- skippedReason?: 'notBulkIngested' | 'noJob' | 'jobActive' | 'noFileRow' | 'notFinalized' | 'pagesBounded' | 'noDescriptionRows' | 'noPages' | 'reingested';
560
- /** How many parts (pages/sheets/image descriptions) were stored, on success. */
561
- storedPartCount?: number;
562
- errorMessage?: string;
563
- }
564
- /**
565
- * Response structure for getting size of context
566
- * @category AI
567
- */
568
- export interface AiKnowledgeBaseContextSizeResponse {
569
- /** Size of context bytes, as a number */
570
- sizeBytes: number;
571
- }
572
- /**
573
- * Request structure for getting the values vector of
574
- * a specific context
575
- *
576
- * @category AI
577
- */
578
- export interface AiKnowledgeBaseValueVectorRequest {
579
- /** The ID of the App */
580
- appId: AppId;
581
- /** The ID of the AIKnowledgeBase */
582
- knowledgeBaseId: AiKnowledgeBaseId;
583
- /** The ID of the context */
584
- contextId: AiContextId;
585
- }
586
- /**
587
- * Response structure for getting values vector of a
588
- * specific context
589
- * @category AI
590
- */
591
- export interface AiKnowledgeBaseValueVectorResponse {
592
- /** The vector */
593
- vector: number[];
594
- }
595
- /**
596
- * Internal (console-test-only) extension of the public chat options, for the `test/chat` endpoint
597
- * used by the console's KB test-chat panel.
598
- * @category AI
599
- */
600
- export interface AiKnowledgeBaseChatOptionsInternal extends AiKnowledgeBaseChatOptions {
601
- /**
602
- * When true, the response cites sources by name using inline markers — names only, since this
603
- * console-test path never mints download links. Takes precedence over the deprecated
604
- * `includeReference`. Default to false.
605
- */
606
- citation?: boolean;
607
- }
608
- export interface AiKnowledgeBaseChatRequest {
609
- knowledgeBaseId: AiKnowledgeBaseId;
610
- prompt?: string;
611
- options?: AiKnowledgeBaseChatOptionsInternal;
612
- }
613
- /** Emitted to the console queue when a knowledge base or its contexts change. */
614
- export interface KbChangeEvent {
615
- appId: AppId;
616
- knowledgeBaseId: AiKnowledgeBaseId;
617
- changeType: 'kb' | 'context';
618
- }
@@ -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
- }