@squidcloud/client 1.0.492 → 1.0.493
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/internal-common/src/ai/system-openai-compatible.d.ts +35 -0
- package/dist/internal-common/src/metric-name.d.ts +14 -0
- package/dist/internal-common/src/public-types/ai-agent-connection.public-types.d.ts +34 -0
- package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +33 -2
- package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +29 -0
- package/dist/internal-common/src/public-types/ai-knowledge-base.public-types.d.ts +284 -29
- package/dist/internal-common/src/public-types/ai-voice.public-types.d.ts +200 -0
- package/dist/internal-common/src/public-types/connector.public-types.d.ts +1 -1
- package/dist/internal-common/src/public-types/integration.public-types.d.ts +1 -1
- package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +30 -0
- package/dist/internal-common/src/public-types-backend/mutation.public-context.d.ts +161 -0
- package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +75 -0
- package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +193 -0
- package/dist/internal-common/src/types/ai-agent.types.d.ts +302 -0
- package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +514 -0
- package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +19 -0
- package/dist/internal-common/src/types/backend-function.types.d.ts +1 -0
- package/dist/internal-common/src/types/communication.types.d.ts +1 -0
- package/dist/internal-common/src/types/document.types.d.ts +1 -0
- package/dist/internal-common/src/types/file.types.d.ts +6 -0
- package/dist/internal-common/src/types/headers.types.d.ts +52 -0
- package/dist/internal-common/src/types/management-api-key.types.d.ts +92 -0
- package/dist/internal-common/src/types/mutation.types.d.ts +1 -0
- package/dist/internal-common/src/types/notification.types.d.ts +19 -0
- package/dist/internal-common/src/types/observability.types.d.ts +223 -0
- package/dist/internal-common/src/types/query.types.d.ts +15 -0
- package/dist/internal-common/src/types/secret.types.d.ts +7 -0
- package/dist/internal-common/src/types/socket.types.d.ts +1 -0
- package/dist/internal-common/src/types/stage.d.ts +9 -0
- package/dist/internal-common/src/types/time-units.d.ts +1 -0
- package/dist/internal-common/src/types/url-shortener.types.d.ts +45 -0
- package/dist/internal-common/src/utils/array.d.ts +7 -0
- package/dist/internal-common/src/utils/e2e-test-utils.d.ts +2 -0
- package/dist/internal-common/src/utils/file-utils.d.ts +2 -0
- package/dist/internal-common/src/utils/global.utils.d.ts +1 -0
- package/dist/internal-common/src/utils/http.d.ts +24 -0
- package/dist/internal-common/src/utils/lock.manager.d.ts +14 -0
- package/dist/internal-common/src/utils/metric-utils.d.ts +4 -0
- package/dist/internal-common/src/utils/metrics.types.d.ts +7 -0
- package/dist/internal-common/src/utils/object.d.ts +86 -0
- package/dist/internal-common/src/utils/serialization.d.ts +24 -0
- package/dist/internal-common/src/utils/squid.constants.d.ts +6 -0
- package/dist/internal-common/src/utils/trace-id-generator.d.ts +1 -0
- package/dist/internal-common/src/utils/validation.d.ts +21 -0
- package/dist/internal-common/src/websocket.impl.d.ts +26 -0
- package/dist/typescript-client/src/ai-client.d.ts +13 -1
- package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client-reference.d.ts +4 -2
- package/dist/typescript-client/src/ai-voice-client.d.ts +42 -0
- package/dist/typescript-client/src/ai-web-voice-call.d.ts +62 -0
- package/dist/typescript-client/src/index.d.ts +2 -0
- package/dist/typescript-client/src/public-types.d.ts +2 -0
- package/dist/typescript-client/src/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,514 @@
|
|
|
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 the next `count` grep scans of a
|
|
210
|
+
* knowledge base to fail at their `maxTimeMS` deadline.
|
|
211
|
+
*/
|
|
212
|
+
export interface AiKnowledgeBaseFailNextGrepScansRequest {
|
|
213
|
+
/** The ID of the App */
|
|
214
|
+
appId: AppId;
|
|
215
|
+
/** The ID of the AIKnowledgeBase */
|
|
216
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
217
|
+
/** How many upcoming scans fail; a non-positive value disarms. */
|
|
218
|
+
count: number;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Request structure for the internal test-only route that makes one knowledge base's graph be built by
|
|
222
|
+
* the deterministic stub extractor instead of by the model.
|
|
223
|
+
*/
|
|
224
|
+
export interface AiKnowledgeBaseEnableGraphStubExtractionRequest {
|
|
225
|
+
/** The ID of the App */
|
|
226
|
+
appId: AppId;
|
|
227
|
+
/** The ID of the AIKnowledgeBase */
|
|
228
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
229
|
+
/** Gives every entity the stub's pseudo-vector, directive-seeded ones included, so none is embedded. */
|
|
230
|
+
pseudoVectors?: boolean;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Request structure for the internal test-only route that shrinks one knowledge base's resolution drain
|
|
234
|
+
* bounds, so a small corpus needs several rounds or sweeps to drain.
|
|
235
|
+
*/
|
|
236
|
+
export interface AiKnowledgeBaseSetGraphResolutionDrainBoundsRequest {
|
|
237
|
+
/** The ID of the App */
|
|
238
|
+
appId: AppId;
|
|
239
|
+
/** The ID of the AIKnowledgeBase */
|
|
240
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
241
|
+
/** Dirty entities one resolution pass examines. */
|
|
242
|
+
dirtyBatch: number;
|
|
243
|
+
/** Drain rounds one sweep runs. */
|
|
244
|
+
maxRounds: number;
|
|
245
|
+
/** Candidate pairs one drain round adjudicates; the deployment default when absent. */
|
|
246
|
+
maxPairsPerRound?: number;
|
|
247
|
+
/** Resolution passes one drain round runs; the deployment default when absent. */
|
|
248
|
+
maxPasses?: number;
|
|
249
|
+
/** Adjudication calls kept in flight; the deployment default when absent. */
|
|
250
|
+
adjudicationConcurrency?: number;
|
|
251
|
+
/** Dirty entities one pass searches candidates for at once; the deployment default when absent. */
|
|
252
|
+
proposalConcurrency?: number;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Request structure for the internal test-only route that drops each entity's own hit from one knowledge
|
|
256
|
+
* base's resolution ANN results, so a test can make every entity miss itself.
|
|
257
|
+
*/
|
|
258
|
+
export interface AiKnowledgeBaseHideOwnResolutionHitsRequest {
|
|
259
|
+
/** The ID of the App */
|
|
260
|
+
appId: AppId;
|
|
261
|
+
/** The ID of the AIKnowledgeBase */
|
|
262
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Where a test can park a graph write. `merge-component` holds a resolution merge before it takes the write
|
|
266
|
+
* lock for its component, `merge` between its snapshot read and its fence, and `merge-fenced` between its
|
|
267
|
+
* fence and its first write; `entity-read-back` holds a finalize upsert before the read-back that names its
|
|
268
|
+
* entities, and `entity-provenance` after that read-back's fallback, before its provenance write; `edge-write`
|
|
269
|
+
* holds it before the edge write, the window its description pass occupies, and `edge-upsert` after the edge
|
|
270
|
+
* write resolved its endpoints, before it writes. `prune-repair` holds a prune between its bucket delete and
|
|
271
|
+
* its owner repair.
|
|
272
|
+
*/
|
|
273
|
+
export type GraphWriteGatePoint = 'merge-component' | 'merge' | 'merge-fenced' | 'entity-read-back' | 'entity-provenance' | 'edge-write' | 'edge-upsert' | 'prune-repair';
|
|
274
|
+
/**
|
|
275
|
+
* Request structure for the internal test-only route that parks one of a knowledge base's graph writes,
|
|
276
|
+
* so a test can interleave a resolution merge with a bulk-finalize upsert deterministically.
|
|
277
|
+
*/
|
|
278
|
+
export interface AiKnowledgeBaseSetGraphWriteGateRequest {
|
|
279
|
+
/** The ID of the App */
|
|
280
|
+
appId: AppId;
|
|
281
|
+
/** The ID of the AIKnowledgeBase */
|
|
282
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
283
|
+
/** Which write to park. */
|
|
284
|
+
point: GraphWriteGatePoint;
|
|
285
|
+
/** True parks the next writer at that point; false releases a parked writer and stops parking. */
|
|
286
|
+
armed: boolean;
|
|
287
|
+
}
|
|
288
|
+
/** Response of the internal test-only graph write-gate route. */
|
|
289
|
+
export interface AiKnowledgeBaseSetGraphWriteGateResponse {
|
|
290
|
+
/** True once a writer has parked on the gate. */
|
|
291
|
+
entered: boolean;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Request structure for the internal test-only route that runs one knowledge base's graph writes without the
|
|
295
|
+
* per-KB write lock, so a test can pin the interleavings the lock rules out.
|
|
296
|
+
*/
|
|
297
|
+
export interface AiKnowledgeBaseBypassGraphWriteLockRequest {
|
|
298
|
+
/** The ID of the App */
|
|
299
|
+
appId: AppId;
|
|
300
|
+
/** The ID of the AIKnowledgeBase */
|
|
301
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
302
|
+
}
|
|
303
|
+
/** Request structure for the internal test-only route that reports one knowledge base's graph write lock. */
|
|
304
|
+
export interface AiKnowledgeBaseGetGraphWriteLockStateRequest {
|
|
305
|
+
/** The ID of the App */
|
|
306
|
+
appId: AppId;
|
|
307
|
+
/** The ID of the AIKnowledgeBase */
|
|
308
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
309
|
+
}
|
|
310
|
+
/** Response of the internal test-only graph write-lock state route. */
|
|
311
|
+
export interface AiKnowledgeBaseGetGraphWriteLockStateResponse {
|
|
312
|
+
/** Writers holding the lock shared: finalize entity or edge writes. */
|
|
313
|
+
sharedHolders: number;
|
|
314
|
+
/** True while a resolution merge holds the lock exclusive. */
|
|
315
|
+
exclusiveHeld: boolean;
|
|
316
|
+
/** Writers queued for a shared hold. */
|
|
317
|
+
sharedWaiters: number;
|
|
318
|
+
/** Writers queued for an exclusive hold. */
|
|
319
|
+
exclusiveWaiters: number;
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Request structure for the internal test-only route that sets a knowledge base's graph schema version.
|
|
323
|
+
* A migration test needs a KB on the older schema, which the creation path never produces.
|
|
324
|
+
*/
|
|
325
|
+
export interface AiKnowledgeBaseSetGraphSchemaVersionRequest {
|
|
326
|
+
/** The ID of the App */
|
|
327
|
+
appId: AppId;
|
|
328
|
+
/** The ID of the AIKnowledgeBase */
|
|
329
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
330
|
+
/** The schema version to stamp; omit to clear the stamp so the KB uses the v1 layout. */
|
|
331
|
+
version?: number;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Request structure of the operator call that quarantines a knowledge base's dead-weight graph entities
|
|
335
|
+
* (ENG-2802): entities of degree at most `maxDegree`, cited by at most one chunk, whose name carries no
|
|
336
|
+
* significant token, is numeric/date-like, or is one token shared by many other entity names.
|
|
337
|
+
*/
|
|
338
|
+
export interface QuarantineKnowledgeBaseGraphEntitiesRequest {
|
|
339
|
+
/** The ID of the AIKnowledgeBase */
|
|
340
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
341
|
+
/** Reports the matching set without writing anything. */
|
|
342
|
+
dryRun?: boolean;
|
|
343
|
+
/** Highest degree a quarantined entity may have: 0 (default) or 1. */
|
|
344
|
+
maxDegree?: number;
|
|
345
|
+
/**
|
|
346
|
+
* How many entities must share a single-token name signature before that token counts as generic;
|
|
347
|
+
* the deployment default when absent.
|
|
348
|
+
*/
|
|
349
|
+
frequentSignatureMinEntities?: number;
|
|
350
|
+
}
|
|
351
|
+
/** One entity a quarantine report samples. */
|
|
352
|
+
export interface KnowledgeBaseGraphQuarantineSampleEntity {
|
|
353
|
+
/** Hex id of the entity document. */
|
|
354
|
+
id: string;
|
|
355
|
+
/** Canonical display name. */
|
|
356
|
+
name: string;
|
|
357
|
+
/** Extracted entity type. */
|
|
358
|
+
type: string;
|
|
359
|
+
/** Relationships touching the entity. */
|
|
360
|
+
degree: number;
|
|
361
|
+
/** Chunks citing the entity. */
|
|
362
|
+
chunkRefCount: number;
|
|
363
|
+
}
|
|
364
|
+
/** Response structure of {@link QuarantineKnowledgeBaseGraphEntitiesRequest}. */
|
|
365
|
+
export interface QuarantineKnowledgeBaseGraphEntitiesResponse {
|
|
366
|
+
/** Stamped on every entity this run quarantined; absent on a dry run. */
|
|
367
|
+
runId?: string;
|
|
368
|
+
/** Entities the criteria match (dry run) or this run quarantined. */
|
|
369
|
+
matched: number;
|
|
370
|
+
/** Entities of the partition still live after the run (dry run: before it). */
|
|
371
|
+
liveEntityCount: number;
|
|
372
|
+
/** Entities quarantined by this and earlier runs. */
|
|
373
|
+
quarantinedEntityCount: number;
|
|
374
|
+
/** Up to 50 matching entities. */
|
|
375
|
+
sample: KnowledgeBaseGraphQuarantineSampleEntity[];
|
|
376
|
+
}
|
|
377
|
+
/** Request structure of the operator call that restores the entities one quarantine run hid. */
|
|
378
|
+
export interface RestoreKnowledgeBaseGraphEntitiesRequest {
|
|
379
|
+
/** The ID of the AIKnowledgeBase */
|
|
380
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
381
|
+
/** The `runId` the quarantine call returned. */
|
|
382
|
+
runId: string;
|
|
383
|
+
}
|
|
384
|
+
/** Response structure of {@link RestoreKnowledgeBaseGraphEntitiesRequest}. */
|
|
385
|
+
export interface RestoreKnowledgeBaseGraphEntitiesResponse {
|
|
386
|
+
/** Entities the call restored. */
|
|
387
|
+
restored: number;
|
|
388
|
+
/** Entities still quarantined by other runs. */
|
|
389
|
+
quarantinedEntityCount: number;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Request structure for identifying a knowledge base to reimport the context files (when possible).
|
|
393
|
+
*/
|
|
394
|
+
export interface AiKnowledgeBaseReimportAllFilesRequest {
|
|
395
|
+
/** The ID of the AIKnowledgeBase */
|
|
396
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Request structure for identifying a knowledge base to reimport the context files (when possible).
|
|
400
|
+
*/
|
|
401
|
+
export interface AiKnowledgeBaseReimportFilesRequest {
|
|
402
|
+
/** The ID of the AIKnowledgeBase */
|
|
403
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
404
|
+
/** The ids of the AiKnowledgeBaseContexts to reimport */
|
|
405
|
+
contextIds: Array<string>;
|
|
406
|
+
}
|
|
407
|
+
/** Longest context batch one `backfillFulltext` call accepts; larger work-lists are split by the caller. */
|
|
408
|
+
export declare const BACKFILL_FULLTEXT_MAX_CONTEXTS_PER_CALL = 20;
|
|
409
|
+
/**
|
|
410
|
+
* Request structure for rebuilding the stored raw text (`kb_fulltext`) of existing contexts from their
|
|
411
|
+
* stored source files, without re-ingesting them — no chunk, embedding or graph writes. This is how
|
|
412
|
+
* contexts ingested before literal search existed become greppable.
|
|
413
|
+
*/
|
|
414
|
+
export interface AiKnowledgeBaseBackfillFulltextRequest {
|
|
415
|
+
/** The ID of the AIKnowledgeBase */
|
|
416
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
417
|
+
/**
|
|
418
|
+
* The ids of the contexts to backfill, at most {@link BACKFILL_FULLTEXT_MAX_CONTEXTS_PER_CALL} per
|
|
419
|
+
* call. Each context's stored text is fully replaced, so re-running a context is safe.
|
|
420
|
+
*/
|
|
421
|
+
contextIds: Array<AiContextId>;
|
|
422
|
+
/**
|
|
423
|
+
* The extraction method for file contexts. Defaults to the server's regular document extraction
|
|
424
|
+
* default (OCR when configured), which reproduces the text the ingest pipeline indexed — including
|
|
425
|
+
* scanned pages. `legacy` extracts in-process without any external model call, but yields nothing for
|
|
426
|
+
* scanned pages, so a caller choosing it must compare the stored part counts against expectations.
|
|
427
|
+
* `legacy_with_llm` yields the same in-process text here — its page-screenshot descriptions are an
|
|
428
|
+
* ingest-time addition, not part of the literal text this backfill rebuilds.
|
|
429
|
+
*/
|
|
430
|
+
extractionMethod?: DocumentExtractionMethod;
|
|
431
|
+
/**
|
|
432
|
+
* A context that already has stored text is SKIPPED unless this is true. The backfill rebuilds
|
|
433
|
+
* literal text only, while ingest also stores image/OCR-description parts — so replacing a context
|
|
434
|
+
* that ingest populated would silently delete its description text from the literal index. Set this
|
|
435
|
+
* only to deliberately re-extract contexts this backfill itself populated (e.g. retrying a thin
|
|
436
|
+
* `legacy` yield with OCR).
|
|
437
|
+
*/
|
|
438
|
+
overwrite?: boolean;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Response structure for a `backfillFulltext` call: one status per requested context, in request order.
|
|
442
|
+
*/
|
|
443
|
+
export interface AiKnowledgeBaseBackfillFulltextResponse {
|
|
444
|
+
statuses: Array<AiKnowledgeBaseBackfillFulltextStatus>;
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Outcome of backfilling the raw text of one context.
|
|
448
|
+
*/
|
|
449
|
+
export interface AiKnowledgeBaseBackfillFulltextStatus {
|
|
450
|
+
contextId: AiContextId;
|
|
451
|
+
/** `skipped` means the context already has stored text and `overwrite` was not set; nothing changed. */
|
|
452
|
+
status: 'success' | 'error' | 'skipped';
|
|
453
|
+
/**
|
|
454
|
+
* How many parts (pages/sheets) were stored, on success. Zero means extraction yielded no text at
|
|
455
|
+
* all — for a `legacy` run over a scanned document that is the expected signal to retry with OCR.
|
|
456
|
+
*/
|
|
457
|
+
storedPartCount?: number;
|
|
458
|
+
errorMessage?: string;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Response structure for getting size of context
|
|
462
|
+
* @category AI
|
|
463
|
+
*/
|
|
464
|
+
export interface AiKnowledgeBaseContextSizeResponse {
|
|
465
|
+
/** Size of context bytes, as a number */
|
|
466
|
+
sizeBytes: number;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Request structure for getting the values vector of
|
|
470
|
+
* a specific context
|
|
471
|
+
*
|
|
472
|
+
* @category AI
|
|
473
|
+
*/
|
|
474
|
+
export interface AiKnowledgeBaseValueVectorRequest {
|
|
475
|
+
/** The ID of the App */
|
|
476
|
+
appId: AppId;
|
|
477
|
+
/** The ID of the AIKnowledgeBase */
|
|
478
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
479
|
+
/** The ID of the context */
|
|
480
|
+
contextId: AiContextId;
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Response structure for getting values vector of a
|
|
484
|
+
* specific context
|
|
485
|
+
* @category AI
|
|
486
|
+
*/
|
|
487
|
+
export interface AiKnowledgeBaseValueVectorResponse {
|
|
488
|
+
/** The vector */
|
|
489
|
+
vector: number[];
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* Internal (console-test-only) extension of the public chat options, for the `test/chat` endpoint
|
|
493
|
+
* used by the console's KB test-chat panel.
|
|
494
|
+
* @category AI
|
|
495
|
+
*/
|
|
496
|
+
export interface AiKnowledgeBaseChatOptionsInternal extends AiKnowledgeBaseChatOptions {
|
|
497
|
+
/**
|
|
498
|
+
* When true, the response cites sources by name using inline markers — names only, since this
|
|
499
|
+
* console-test path never mints download links. Takes precedence over the deprecated
|
|
500
|
+
* `includeReference`. Default to false.
|
|
501
|
+
*/
|
|
502
|
+
citation?: boolean;
|
|
503
|
+
}
|
|
504
|
+
export interface AiKnowledgeBaseChatRequest {
|
|
505
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
506
|
+
prompt?: string;
|
|
507
|
+
options?: AiKnowledgeBaseChatOptionsInternal;
|
|
508
|
+
}
|
|
509
|
+
/** Emitted to the console queue when a knowledge base or its contexts change. */
|
|
510
|
+
export interface KbChangeEvent {
|
|
511
|
+
appId: AppId;
|
|
512
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
513
|
+
changeType: 'kb' | 'context';
|
|
514
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ChatId = string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** HTTP header names used by Squid for request metadata. */
|
|
2
|
+
export declare const SquidHeaders: {
|
|
3
|
+
/** Correlates logs and spans across distributed calls. */
|
|
4
|
+
readonly TRACE_ID: "x-squid-traceid";
|
|
5
|
+
/** Shared secret header for internal authentication. */
|
|
6
|
+
readonly SECRET: "x-squid-secret";
|
|
7
|
+
/** API key provided by the calling application. */
|
|
8
|
+
readonly APP_API_KEY: "x-app-api-key";
|
|
9
|
+
/** Unique identifier of the client application. */
|
|
10
|
+
readonly APP_ID: "x-squid-appid";
|
|
11
|
+
/** Unique identifier of the end user or service client. */
|
|
12
|
+
readonly CLIENT_ID: "x-squid-clientid";
|
|
13
|
+
/**
|
|
14
|
+
* Marks a request already forwarded between the cores, carrying a digest of the internal API key.
|
|
15
|
+
*
|
|
16
|
+
* The receiving core answers such a request itself instead of forwarding it back, and does not
|
|
17
|
+
* meter it — whichever core took the request from the outside already did. A value derived from a
|
|
18
|
+
* shared secret is what makes that safe: a caller could otherwise send the header and skip their
|
|
19
|
+
* own quota. A digest rather than the key itself, because the header reaches tenant code, where
|
|
20
|
+
* the key would be a privilege escalation; it authorizes nothing, {@link SECRET} is what internal
|
|
21
|
+
* auth reads.
|
|
22
|
+
*/
|
|
23
|
+
readonly PROXY_HOP: "x-squid-proxy-hop";
|
|
24
|
+
/** Version string of the Squid client library. */
|
|
25
|
+
readonly CLIENT_VERSION: "x-squid-client-version";
|
|
26
|
+
/** Originating IP address of the request. */
|
|
27
|
+
readonly SOURCE_IP: "x-squid-source-ip";
|
|
28
|
+
/**
|
|
29
|
+
* Response-only: IP of the tenant pod that served the request, i.e. the address to reach it at
|
|
30
|
+
* again. Core records it to route subsequent affinity-keyed calls to the same pod. Absent when the
|
|
31
|
+
* pod does not know its own IP.
|
|
32
|
+
*/
|
|
33
|
+
readonly POD_IP: "x-squid-pod-ip";
|
|
34
|
+
/**
|
|
35
|
+
* Response-only: identity of the tenant process that served the request. Distinct from
|
|
36
|
+
* {@link POD_IP}, which is an address and is reused: Kubernetes hands the IP of a deleted pod to a
|
|
37
|
+
* new one, so only this value tells core whether it is still talking to the same instance.
|
|
38
|
+
*/
|
|
39
|
+
readonly INSTANCE_ID: "x-squid-instance-id";
|
|
40
|
+
/**
|
|
41
|
+
* Request-only: the {@link INSTANCE_ID} core believes it is calling, sent when routing directly to a
|
|
42
|
+
* pinned pod instead of through the tenant service. The receiving instance refuses the request when
|
|
43
|
+
* the value is not its own — the pod at that address may have been replaced, possibly by a pod of a
|
|
44
|
+
* different application.
|
|
45
|
+
*/
|
|
46
|
+
readonly EXPECTED_INSTANCE_ID: "x-squid-expected-instance-id";
|
|
47
|
+
/**
|
|
48
|
+
* Response-only: key of the tenant worker that served the request, reported separately from
|
|
49
|
+
* {@link POD_IP} so core alone decides whether to pin at pod or at worker granularity.
|
|
50
|
+
*/
|
|
51
|
+
readonly WORKER_KEY: "x-squid-worker-key";
|
|
52
|
+
};
|