@squidcloud/client 1.0.483 → 1.0.485
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.public-types.d.ts +79 -3
- package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +9 -0
- package/dist/internal-common/src/public-types/ai-function.public-types.d.ts +36 -0
- package/dist/internal-common/src/public-types/ai-knowledge-base.public-types.d.ts +141 -2
- package/dist/internal-common/src/public-types/connector.public-types.d.ts +1 -1
- package/dist/internal-common/src/public-types/extraction.public-types.d.ts +9 -2
- package/dist/internal-common/src/public-types/integration.public-types.d.ts +7 -1
- package/dist/internal-common/src/public-types/source-code.public-types.d.ts +196 -0
- 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 +253 -0
- package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +306 -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 +41 -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 +168 -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 +10 -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 +19 -0
- package/dist/internal-common/src/websocket.impl.d.ts +26 -0
- package/dist/typescript-client/src/agent/ai-agent-client-reference.d.ts +12 -1
- package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client-reference.d.ts +9 -1
- package/dist/typescript-client/src/distributed-lock.manager.d.ts +3 -2
- package/dist/typescript-client/src/integration-client.d.ts +5 -1
- package/dist/typescript-client/src/public-types.d.ts +1 -0
- package/dist/typescript-client/src/version.d.ts +1 -1
- package/package.json +1 -3
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { AgentContextRequest, AiAgent, AiAgentContext, AiAgentMcpServerConfig, AiAnnotation, AiAudioCreateSpeechOptions, AiChatMessage, AiChatOptions, AiGenerateImageOptions, AllAiAgentChatOptions, ApplicationAiSettings, BuildAgentOptions } from '../public-types/ai-agent.public-types';
|
|
2
|
+
import { AiProviderType, ModelIdSpec } from '../public-types/ai-common.public-types';
|
|
3
|
+
import { AiContextMetadata, AiContextMetadataFilter } from '../public-types/ai-knowledge-base.public-types';
|
|
4
|
+
import { AiAgentId, AiKnowledgeBaseId, AppId, ClientRequestId } from '../public-types/communication.public-types';
|
|
5
|
+
import { JobId } from '../public-types/job.public-types';
|
|
6
|
+
import { SecretKey } from '../public-types/secret.public-types';
|
|
7
|
+
/** Specification for an AI model, defining its operational parameters. */
|
|
8
|
+
export type AiModelSpec = {
|
|
9
|
+
/** Maximum tokens the model can generate in a single response. */
|
|
10
|
+
maxOutputTokens: number;
|
|
11
|
+
/** Total context window size: input (aka prompt) + output (aka completion) tokens combined. */
|
|
12
|
+
contextWindowTokens: number;
|
|
13
|
+
};
|
|
14
|
+
export interface AiChatRequest {
|
|
15
|
+
agentId: AiAgentId;
|
|
16
|
+
clientRequestId: ClientRequestId;
|
|
17
|
+
prompt?: string;
|
|
18
|
+
options?: AllAiAgentChatOptions;
|
|
19
|
+
jobId: JobId;
|
|
20
|
+
}
|
|
21
|
+
export interface AiAskRequest {
|
|
22
|
+
agentId: AiAgentId;
|
|
23
|
+
prompt?: string;
|
|
24
|
+
options?: AllAiAgentChatOptions;
|
|
25
|
+
jobId: JobId;
|
|
26
|
+
}
|
|
27
|
+
export interface AiGenerateImageRequest {
|
|
28
|
+
prompt: string;
|
|
29
|
+
options: AiGenerateImageOptions;
|
|
30
|
+
}
|
|
31
|
+
export interface AiAskQuestionInternalRequest {
|
|
32
|
+
appId: AppId;
|
|
33
|
+
prompt: string;
|
|
34
|
+
options: AiChatOptions;
|
|
35
|
+
/**
|
|
36
|
+
* API key resolution mode (see `AiProviderFactory.getChatProviderForModel`). 'system' is
|
|
37
|
+
* required to resolve system-internal models (e.g. the 'openai-compatible' registry models)
|
|
38
|
+
* and makes the call billable to Squid, not the app. Defaults to 'auto'. The endpoint is
|
|
39
|
+
* `@Internal()`, so only internal-key callers can set this.
|
|
40
|
+
*/
|
|
41
|
+
keyType?: 'auto' | 'system';
|
|
42
|
+
}
|
|
43
|
+
export interface AiAskQuestionInternalResponse {
|
|
44
|
+
answer: string;
|
|
45
|
+
}
|
|
46
|
+
export interface GetSharedAgentsInternalRequest {
|
|
47
|
+
organizationId: string;
|
|
48
|
+
}
|
|
49
|
+
export interface GetSharedAgentsInternalResponse {
|
|
50
|
+
sharedAgents: Array<{
|
|
51
|
+
agentId: AiAgentId;
|
|
52
|
+
appId: AppId;
|
|
53
|
+
}>;
|
|
54
|
+
}
|
|
55
|
+
export interface ClearSharedAgentsForOrgInternalRequest {
|
|
56
|
+
organizationId: string;
|
|
57
|
+
}
|
|
58
|
+
export interface AiContextSizeRequest {
|
|
59
|
+
appId: AppId;
|
|
60
|
+
agentId: AiAgentId;
|
|
61
|
+
}
|
|
62
|
+
export interface AiContextSizeResponse {
|
|
63
|
+
sizeBytes: number;
|
|
64
|
+
}
|
|
65
|
+
export interface AiAskResponse {
|
|
66
|
+
responseString: string;
|
|
67
|
+
annotations?: Record<string, AiAnnotation>;
|
|
68
|
+
}
|
|
69
|
+
export interface AiAskWithVoiceResponse {
|
|
70
|
+
responseString: string;
|
|
71
|
+
voiceResponse: AiAudioCreateSpeechResponse;
|
|
72
|
+
annotations?: Record<string, AiAnnotation>;
|
|
73
|
+
}
|
|
74
|
+
export interface AiTranscribeAndAskWithVoiceResponse {
|
|
75
|
+
transcribedPrompt: string;
|
|
76
|
+
responseString: string;
|
|
77
|
+
voiceResponse: AiAudioCreateSpeechResponse;
|
|
78
|
+
annotations?: Record<string, AiAnnotation>;
|
|
79
|
+
}
|
|
80
|
+
export interface AiTranscribeAndChatResponse {
|
|
81
|
+
transcribedPrompt: string;
|
|
82
|
+
}
|
|
83
|
+
export interface AiAudioCreateSpeechResponse {
|
|
84
|
+
mimeType: string;
|
|
85
|
+
extension: string;
|
|
86
|
+
base64File: string;
|
|
87
|
+
}
|
|
88
|
+
export interface AiAudioCreateSpeechRequest {
|
|
89
|
+
input: string;
|
|
90
|
+
options: AiAudioCreateSpeechOptions;
|
|
91
|
+
}
|
|
92
|
+
export interface GetAgentRequest {
|
|
93
|
+
agentId: AiAgentId;
|
|
94
|
+
}
|
|
95
|
+
export interface GetAgentResponse {
|
|
96
|
+
agent: AiAgent | undefined;
|
|
97
|
+
}
|
|
98
|
+
export interface GetAgentContextRequest {
|
|
99
|
+
agentId: AiAgentId;
|
|
100
|
+
contextId: string;
|
|
101
|
+
}
|
|
102
|
+
export interface ConnectAgentKnowledgeBaseRequest {
|
|
103
|
+
agentId: AiAgentId;
|
|
104
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
105
|
+
description: string;
|
|
106
|
+
}
|
|
107
|
+
export interface DisconnectAgentKnowledgeBaseRequest {
|
|
108
|
+
agentId: AiAgentId;
|
|
109
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
110
|
+
}
|
|
111
|
+
export interface DeleteAgentRequest {
|
|
112
|
+
agentId: AiAgentId;
|
|
113
|
+
}
|
|
114
|
+
export interface UnshareAgentRequest {
|
|
115
|
+
agentId: AiAgentId;
|
|
116
|
+
}
|
|
117
|
+
export interface SetAgentOptionInPathRequest {
|
|
118
|
+
agentId: AiAgentId;
|
|
119
|
+
path: string;
|
|
120
|
+
value: unknown;
|
|
121
|
+
}
|
|
122
|
+
export interface AddConnectedIntegrationRequest {
|
|
123
|
+
agentId: AiAgentId;
|
|
124
|
+
integrationId: string;
|
|
125
|
+
integrationType: string;
|
|
126
|
+
description: string;
|
|
127
|
+
}
|
|
128
|
+
export interface AddConnectedAgentRequest {
|
|
129
|
+
agentId: AiAgentId;
|
|
130
|
+
connectedAgentId: string;
|
|
131
|
+
description: string;
|
|
132
|
+
}
|
|
133
|
+
export interface AddConnectedKnowledgeBaseRequest {
|
|
134
|
+
agentId: AiAgentId;
|
|
135
|
+
knowledgeBaseId: string;
|
|
136
|
+
description: string;
|
|
137
|
+
/** Mirrors {@link AiConnectedKnowledgeBaseMetadata.includeMetadata}; forwarded so this atomic API honors it. */
|
|
138
|
+
includeMetadata?: boolean;
|
|
139
|
+
}
|
|
140
|
+
export interface AddFunctionRequest {
|
|
141
|
+
agentId: AiAgentId;
|
|
142
|
+
functionId: string;
|
|
143
|
+
}
|
|
144
|
+
export interface RemoveConnectedAgentRequest {
|
|
145
|
+
agentId: AiAgentId;
|
|
146
|
+
connectedAgentId: string;
|
|
147
|
+
}
|
|
148
|
+
export interface RemoveConnectedIntegrationRequest {
|
|
149
|
+
agentId: AiAgentId;
|
|
150
|
+
integrationId: string;
|
|
151
|
+
}
|
|
152
|
+
export interface RemoveConnectedKnowledgeBaseRequest {
|
|
153
|
+
agentId: AiAgentId;
|
|
154
|
+
knowledgeBaseId: string;
|
|
155
|
+
}
|
|
156
|
+
export interface RemoveFunctionRequest {
|
|
157
|
+
agentId: AiAgentId;
|
|
158
|
+
functionId: string;
|
|
159
|
+
}
|
|
160
|
+
export interface SetAgentDescriptionRequest {
|
|
161
|
+
agentId: AiAgentId;
|
|
162
|
+
description: string;
|
|
163
|
+
}
|
|
164
|
+
export interface SetAgentMcpServerRequest {
|
|
165
|
+
agentId: AiAgentId;
|
|
166
|
+
mcpServer: AiAgentMcpServerConfig;
|
|
167
|
+
}
|
|
168
|
+
export interface ListAgentContextsRequest {
|
|
169
|
+
agentId: AiAgentId;
|
|
170
|
+
}
|
|
171
|
+
export interface ListAgentContextsResponse {
|
|
172
|
+
contexts: Array<AiAgentContext>;
|
|
173
|
+
}
|
|
174
|
+
export interface DeleteAgentContextsRequest {
|
|
175
|
+
agentId: AiAgentId;
|
|
176
|
+
contextIds: Array<string>;
|
|
177
|
+
}
|
|
178
|
+
export interface UpsertAgentContextsRequest {
|
|
179
|
+
agentId: AiAgentId;
|
|
180
|
+
contextRequests: Array<AgentContextRequest>;
|
|
181
|
+
}
|
|
182
|
+
export interface UpsertAgentCustomGuardrailsRequest {
|
|
183
|
+
agentId: AiAgentId;
|
|
184
|
+
customGuardrail: string;
|
|
185
|
+
}
|
|
186
|
+
export interface DeleteAgentCustomGuardrailsRequest {
|
|
187
|
+
agentId: AiAgentId;
|
|
188
|
+
}
|
|
189
|
+
export interface ListAgentsResponse {
|
|
190
|
+
agents: Array<AiAgent>;
|
|
191
|
+
}
|
|
192
|
+
export interface GetApplicationAiSettingsResponse {
|
|
193
|
+
settings: ApplicationAiSettings;
|
|
194
|
+
}
|
|
195
|
+
export interface GetApplicationAiSettingsResponse {
|
|
196
|
+
settings: ApplicationAiSettings;
|
|
197
|
+
}
|
|
198
|
+
export interface SetApplicationAiSettingsRequest {
|
|
199
|
+
settings: ApplicationAiSettings;
|
|
200
|
+
}
|
|
201
|
+
export interface SetAiProviderApiKeySecretRequest {
|
|
202
|
+
providerType: AiProviderType;
|
|
203
|
+
secretKey: SecretKey | undefined;
|
|
204
|
+
}
|
|
205
|
+
export interface SetAiProviderApiKeySecretResponse {
|
|
206
|
+
settings: ApplicationAiSettings;
|
|
207
|
+
}
|
|
208
|
+
export interface ListChatModelsResponse {
|
|
209
|
+
models: ModelIdSpec[];
|
|
210
|
+
}
|
|
211
|
+
export interface RegenerateAgentApiKeyRequest {
|
|
212
|
+
agentId: AiAgentId;
|
|
213
|
+
}
|
|
214
|
+
export interface GetAgentApiKeyRequest {
|
|
215
|
+
agentId: AiAgentId;
|
|
216
|
+
}
|
|
217
|
+
export declare function validateAiContextMetadata(metadata: AiContextMetadata): void;
|
|
218
|
+
export declare function validateAiContextMetadataFilter(filter: AiContextMetadataFilter): void;
|
|
219
|
+
export declare const METADATA_SERVICE_FUNCTION_NAME = "default:metadata";
|
|
220
|
+
export interface GetChatHistoryRequest {
|
|
221
|
+
agentId: AiAgentId;
|
|
222
|
+
memoryId: string;
|
|
223
|
+
}
|
|
224
|
+
export interface GetChatHistoryResponse {
|
|
225
|
+
messages: Array<AiChatMessage>;
|
|
226
|
+
}
|
|
227
|
+
export interface ProvideAgentFeedbackRequest {
|
|
228
|
+
agentId: string;
|
|
229
|
+
feedback: string;
|
|
230
|
+
}
|
|
231
|
+
export interface BuildAgentRequest {
|
|
232
|
+
agentId: string;
|
|
233
|
+
request: string;
|
|
234
|
+
memoryId?: string;
|
|
235
|
+
options?: BuildAgentOptions;
|
|
236
|
+
}
|
|
237
|
+
export interface UploadAiFileRequest {
|
|
238
|
+
/** AI provider to upload file to. */
|
|
239
|
+
provider: AiProviderType;
|
|
240
|
+
/** Optional expiration time in seconds. If provided, file will be registered for automatic cleanup. */
|
|
241
|
+
expirationInSeconds?: number;
|
|
242
|
+
}
|
|
243
|
+
export interface UploadAiFileResponse {
|
|
244
|
+
fileId: string;
|
|
245
|
+
}
|
|
246
|
+
export interface DeleteAiFileRequest {
|
|
247
|
+
fileId: string;
|
|
248
|
+
/** AI provider that owns the file. */
|
|
249
|
+
provider: AiProviderType;
|
|
250
|
+
}
|
|
251
|
+
export interface DeleteAiFileResponse {
|
|
252
|
+
deleted: boolean;
|
|
253
|
+
}
|
|
@@ -0,0 +1,306 @@
|
|
|
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 getting an AiKnowledgeBaseContext
|
|
107
|
+
* @category AI
|
|
108
|
+
*/
|
|
109
|
+
export interface GetAiKnowledgeBaseContextRequest {
|
|
110
|
+
/** The id of the AiKnowledgeBase */
|
|
111
|
+
knowledgeBaseId: string;
|
|
112
|
+
/** The id of the AiKnowledgeBaseContext */
|
|
113
|
+
contextId: string;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Request structure for getting a page of AiKnowledgeBaseContexts
|
|
117
|
+
* for a given knowledge base
|
|
118
|
+
* @category AI
|
|
119
|
+
*/
|
|
120
|
+
export interface GetAiKnowledgeBaseContextsRequest {
|
|
121
|
+
/** The id of the app */
|
|
122
|
+
appId: AppId;
|
|
123
|
+
/** The id of the AiKnowledgeBase */
|
|
124
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
125
|
+
/** The number of characters after which text is truncated. Optional */
|
|
126
|
+
truncateTextAfter?: number;
|
|
127
|
+
/** The number of contexts to skip, for pagination. Optional */
|
|
128
|
+
offset?: number;
|
|
129
|
+
/** The maximum number of contexts to return, for pagination. Optional */
|
|
130
|
+
limit?: number;
|
|
131
|
+
/** Case-insensitive substring search across id/title only. Optional */
|
|
132
|
+
search?: string;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Response structure for getting a page of AiKnowledgeBaseContexts for a given knowledge base
|
|
136
|
+
* @category AI
|
|
137
|
+
*/
|
|
138
|
+
export interface GetAiKnowledgeBaseContextsResponse {
|
|
139
|
+
/** The requested page of AiKnowledgeBaseContexts */
|
|
140
|
+
contexts: Array<AiKnowledgeBaseContext>;
|
|
141
|
+
/** The total number of contexts in the AiKnowledgeBase, ignoring offset/limit */
|
|
142
|
+
totalCount: number;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Response structure for getting an AiKnowledgeBaseContext
|
|
146
|
+
* @category AI
|
|
147
|
+
*/
|
|
148
|
+
export interface GetAiKnowledgeBaseContextResponse {
|
|
149
|
+
/** The resulting AiKnowledgeBaseContext, if it is found */
|
|
150
|
+
context: AiKnowledgeBaseContext | undefined;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Request structure for upserting context for an AiKnowledgeBase
|
|
154
|
+
* @category AI
|
|
155
|
+
*/
|
|
156
|
+
export interface UpsertAiKnowledgeBaseContextsRequest {
|
|
157
|
+
/** The id of the AiKnowledgeBase */
|
|
158
|
+
knowledgeBaseId: string;
|
|
159
|
+
/** The AiKnowledgeBaseContext data, which could be a file or text */
|
|
160
|
+
contextRequests: Array<AiKnowledgeBaseContextRequest>;
|
|
161
|
+
/** The job ID to use for the async upsert job */
|
|
162
|
+
jobId: string;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Response structure for searching an AiKnowledgeBase
|
|
166
|
+
* @category AI
|
|
167
|
+
*/
|
|
168
|
+
export interface AiKnowledgeBaseSearchResponse {
|
|
169
|
+
/** Array of result chunks from the search */
|
|
170
|
+
chunks: Array<AiKnowledgeBaseSearchResultChunk>;
|
|
171
|
+
/** Traversed subgraph for a `searchMode:'graph'` query with `includeGraphContext`; absent otherwise. */
|
|
172
|
+
graphContext?: AiKnowledgeBaseGraphContext;
|
|
173
|
+
}
|
|
174
|
+
export type { ExploreKnowledgeBaseGraphRequest, ExploreKnowledgeBaseGraphResponse, GetKnowledgeBaseGraphStatusRequest, GetKnowledgeBaseGraphStatusResponse, KnowledgeBaseGraphEdge, KnowledgeBaseGraphFacetStatus, KnowledgeBaseGraphModelUsage, KnowledgeBaseGraphNode, KnowledgeBaseGraphQueryConcepts, KnowledgeBaseGraphQueryDoc, KnowledgeBaseGraphQueryGlobalSummary, KnowledgeBaseGraphQueryMatch, KnowledgeBaseGraphQueryOp, KnowledgeBaseGraphQueryPath, KnowledgeBaseGraphQuerySubtreeNode, KnowledgeBaseGraphRebuildMode, KnowledgeBaseGraphTopic, KnowledgeBaseGraphTopicEdge, KnowledgeBaseGraphUsage, QueryKnowledgeBaseGraphRequest, QueryKnowledgeBaseGraphResponse, RebuildKnowledgeBaseGraphRequest, } from '../public-types/ai-knowledge-base.public-types';
|
|
175
|
+
/**
|
|
176
|
+
* Request structure for getting the size of context
|
|
177
|
+
* for an AiKnowledgeBase
|
|
178
|
+
* @category AI
|
|
179
|
+
*/
|
|
180
|
+
export interface AiKnowledgeBaseContextSizeRequest {
|
|
181
|
+
/** The ID of the App */
|
|
182
|
+
appId: AppId;
|
|
183
|
+
/** The ID of the AIKnowledgeBase */
|
|
184
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Request structure for the internal test-only route that arms the next `count` grep scans of a
|
|
188
|
+
* knowledge base to fail at their `maxTimeMS` deadline.
|
|
189
|
+
*/
|
|
190
|
+
export interface AiKnowledgeBaseFailNextGrepScansRequest {
|
|
191
|
+
/** The ID of the App */
|
|
192
|
+
appId: AppId;
|
|
193
|
+
/** The ID of the AIKnowledgeBase */
|
|
194
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
195
|
+
/** How many upcoming scans fail; a non-positive value disarms. */
|
|
196
|
+
count: number;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Request structure for identifying a knowledge base to reimport the context files (when possible).
|
|
200
|
+
*/
|
|
201
|
+
export interface AiKnowledgeBaseReimportAllFilesRequest {
|
|
202
|
+
/** The ID of the AIKnowledgeBase */
|
|
203
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Request structure for identifying a knowledge base to reimport the context files (when possible).
|
|
207
|
+
*/
|
|
208
|
+
export interface AiKnowledgeBaseReimportFilesRequest {
|
|
209
|
+
/** The ID of the AIKnowledgeBase */
|
|
210
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
211
|
+
/** The ids of the AiKnowledgeBaseContexts to reimport */
|
|
212
|
+
contextIds: Array<string>;
|
|
213
|
+
}
|
|
214
|
+
/** Longest context batch one `backfillFulltext` call accepts; larger work-lists are split by the caller. */
|
|
215
|
+
export declare const BACKFILL_FULLTEXT_MAX_CONTEXTS_PER_CALL = 20;
|
|
216
|
+
/**
|
|
217
|
+
* Request structure for rebuilding the stored raw text (`kb_fulltext`) of existing contexts from their
|
|
218
|
+
* stored source files, without re-ingesting them — no chunk, embedding or graph writes. This is how
|
|
219
|
+
* contexts ingested before literal search existed become greppable.
|
|
220
|
+
*/
|
|
221
|
+
export interface AiKnowledgeBaseBackfillFulltextRequest {
|
|
222
|
+
/** The ID of the AIKnowledgeBase */
|
|
223
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
224
|
+
/**
|
|
225
|
+
* The ids of the contexts to backfill, at most {@link BACKFILL_FULLTEXT_MAX_CONTEXTS_PER_CALL} per
|
|
226
|
+
* call. Each context's stored text is fully replaced, so re-running a context is safe.
|
|
227
|
+
*/
|
|
228
|
+
contextIds: Array<AiContextId>;
|
|
229
|
+
/**
|
|
230
|
+
* The extraction method for file contexts. Defaults to the server's regular document extraction
|
|
231
|
+
* default (OCR when configured), which reproduces the text the ingest pipeline indexed — including
|
|
232
|
+
* scanned pages. `legacy` extracts in-process without any external model call, but yields nothing for
|
|
233
|
+
* scanned pages, so a caller choosing it must compare the stored part counts against expectations.
|
|
234
|
+
*/
|
|
235
|
+
extractionMethod?: DocumentExtractionMethod;
|
|
236
|
+
/**
|
|
237
|
+
* A context that already has stored text is SKIPPED unless this is true. The backfill rebuilds
|
|
238
|
+
* literal text only, while ingest also stores image/OCR-description parts — so replacing a context
|
|
239
|
+
* that ingest populated would silently delete its description text from the literal index. Set this
|
|
240
|
+
* only to deliberately re-extract contexts this backfill itself populated (e.g. retrying a thin
|
|
241
|
+
* `legacy` yield with OCR).
|
|
242
|
+
*/
|
|
243
|
+
overwrite?: boolean;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Response structure for a `backfillFulltext` call: one status per requested context, in request order.
|
|
247
|
+
*/
|
|
248
|
+
export interface AiKnowledgeBaseBackfillFulltextResponse {
|
|
249
|
+
statuses: Array<AiKnowledgeBaseBackfillFulltextStatus>;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Outcome of backfilling the raw text of one context.
|
|
253
|
+
*/
|
|
254
|
+
export interface AiKnowledgeBaseBackfillFulltextStatus {
|
|
255
|
+
contextId: AiContextId;
|
|
256
|
+
/** `skipped` means the context already has stored text and `overwrite` was not set; nothing changed. */
|
|
257
|
+
status: 'success' | 'error' | 'skipped';
|
|
258
|
+
/**
|
|
259
|
+
* How many parts (pages/sheets) were stored, on success. Zero means extraction yielded no text at
|
|
260
|
+
* all — for a `legacy` run over a scanned document that is the expected signal to retry with OCR.
|
|
261
|
+
*/
|
|
262
|
+
storedPartCount?: number;
|
|
263
|
+
errorMessage?: string;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Response structure for getting size of context
|
|
267
|
+
* @category AI
|
|
268
|
+
*/
|
|
269
|
+
export interface AiKnowledgeBaseContextSizeResponse {
|
|
270
|
+
/** Size of context bytes, as a number */
|
|
271
|
+
sizeBytes: number;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Request structure for getting the values vector of
|
|
275
|
+
* a specific context
|
|
276
|
+
*
|
|
277
|
+
* @category AI
|
|
278
|
+
*/
|
|
279
|
+
export interface AiKnowledgeBaseValueVectorRequest {
|
|
280
|
+
/** The ID of the App */
|
|
281
|
+
appId: AppId;
|
|
282
|
+
/** The ID of the AIKnowledgeBase */
|
|
283
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
284
|
+
/** The ID of the context */
|
|
285
|
+
contextId: AiContextId;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Response structure for getting values vector of a
|
|
289
|
+
* specific context
|
|
290
|
+
* @category AI
|
|
291
|
+
*/
|
|
292
|
+
export interface AiKnowledgeBaseValueVectorResponse {
|
|
293
|
+
/** The vector */
|
|
294
|
+
vector: number[];
|
|
295
|
+
}
|
|
296
|
+
export interface AiKnowledgeBaseChatRequest {
|
|
297
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
298
|
+
prompt?: string;
|
|
299
|
+
options?: AiKnowledgeBaseChatOptions;
|
|
300
|
+
}
|
|
301
|
+
/** Emitted to the console queue when a knowledge base or its contexts change. */
|
|
302
|
+
export interface KbChangeEvent {
|
|
303
|
+
appId: AppId;
|
|
304
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
305
|
+
changeType: 'kb' | 'context';
|
|
306
|
+
}
|
|
@@ -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,41 @@
|
|
|
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
|
+
/** Version string of the Squid client library. */
|
|
14
|
+
readonly CLIENT_VERSION: "x-squid-client-version";
|
|
15
|
+
/** Originating IP address of the request. */
|
|
16
|
+
readonly SOURCE_IP: "x-squid-source-ip";
|
|
17
|
+
/**
|
|
18
|
+
* Response-only: IP of the tenant pod that served the request, i.e. the address to reach it at
|
|
19
|
+
* again. Core records it to route subsequent affinity-keyed calls to the same pod. Absent when the
|
|
20
|
+
* pod does not know its own IP.
|
|
21
|
+
*/
|
|
22
|
+
readonly POD_IP: "x-squid-pod-ip";
|
|
23
|
+
/**
|
|
24
|
+
* Response-only: identity of the tenant process that served the request. Distinct from
|
|
25
|
+
* {@link POD_IP}, which is an address and is reused: Kubernetes hands the IP of a deleted pod to a
|
|
26
|
+
* new one, so only this value tells core whether it is still talking to the same instance.
|
|
27
|
+
*/
|
|
28
|
+
readonly INSTANCE_ID: "x-squid-instance-id";
|
|
29
|
+
/**
|
|
30
|
+
* Request-only: the {@link INSTANCE_ID} core believes it is calling, sent when routing directly to a
|
|
31
|
+
* pinned pod instead of through the tenant service. The receiving instance refuses the request when
|
|
32
|
+
* the value is not its own — the pod at that address may have been replaced, possibly by a pod of a
|
|
33
|
+
* different application.
|
|
34
|
+
*/
|
|
35
|
+
readonly EXPECTED_INSTANCE_ID: "x-squid-expected-instance-id";
|
|
36
|
+
/**
|
|
37
|
+
* Response-only: key of the tenant worker that served the request, reported separately from
|
|
38
|
+
* {@link POD_IP} so core alone decides whether to pin at pod or at worker granularity.
|
|
39
|
+
*/
|
|
40
|
+
readonly WORKER_KEY: "x-squid-worker-key";
|
|
41
|
+
};
|