@squidcloud/client 1.0.487 → 1.0.489
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/public-types/ai-agent-integrations.public-types.d.ts +8 -0
- package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +128 -3
- package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +17 -5
- package/dist/internal-common/src/public-types/ai-knowledge-base.public-types.d.ts +40 -10
- package/dist/internal-common/src/public-types/extraction.public-types.d.ts +13 -0
- package/dist/internal-common/src/public-types/web.public-types.d.ts +18 -1
- package/dist/typescript-client/src/agent/ai-agent-client-reference.d.ts +7 -1
- package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client-reference.d.ts +6 -6
- package/dist/typescript-client/src/ai-status-updates.d.ts +1 -0
- package/dist/typescript-client/src/index.d.ts +1 -0
- package/dist/typescript-client/src/version.d.ts +1 -1
- package/dist/typescript-client/src/web-client.d.ts +4 -2
- package/package.json +1 -1
|
@@ -48,6 +48,14 @@ export interface AiApiOptions {
|
|
|
48
48
|
* Defaults to no memory.
|
|
49
49
|
*/
|
|
50
50
|
memoryOptions?: AiAgentMemoryOptions;
|
|
51
|
+
/**
|
|
52
|
+
* How long, in milliseconds, a single AI call of the loop may wait for the provider — endpoint
|
|
53
|
+
* selection, request-body creation and response analysis each get this budget on their own, so
|
|
54
|
+
* the whole call may run for a multiple of it. Values below the chat minimum of 20 000 ms are
|
|
55
|
+
* raised to it. Defaults to the standard chat timeout, or to the timeout of the chat this call
|
|
56
|
+
* runs inside when the caller is a nested one.
|
|
57
|
+
*/
|
|
58
|
+
stageTimeoutMs?: number;
|
|
51
59
|
}
|
|
52
60
|
/**
|
|
53
61
|
* Configuration options for AI agent MCP integration.
|
|
@@ -420,6 +420,26 @@ export interface IntegrationModelSpec {
|
|
|
420
420
|
* @category AI
|
|
421
421
|
*/
|
|
422
422
|
export type AiChatModelSelection = AiChatModelName | IntegrationModelSpec;
|
|
423
|
+
/**
|
|
424
|
+
* A backup model together with the sampling settings to run it with. Use this form instead of a
|
|
425
|
+
* bare {@link AiChatModelSelection} when the backup needs settings of its own; anything left unset
|
|
426
|
+
* takes the backup model's own default rather than the primary model's value.
|
|
427
|
+
* @category AI
|
|
428
|
+
*/
|
|
429
|
+
export interface BackupModelOptions {
|
|
430
|
+
/** The model to fall back to. */
|
|
431
|
+
model: AiChatModelSelection;
|
|
432
|
+
/** The temperature to use when sampling from the backup model. */
|
|
433
|
+
temperature?: number;
|
|
434
|
+
/** The level of reasoning effort to apply; effective only for models with reasoning. */
|
|
435
|
+
reasoningEffort?: AiReasoningEffort;
|
|
436
|
+
/** The maximum number of input tokens Squid may send to the backup model. */
|
|
437
|
+
maxTokens?: number;
|
|
438
|
+
/** The maximum number of tokens the backup model should output. */
|
|
439
|
+
maxOutputTokens?: number;
|
|
440
|
+
/** Response length and detail level; supported by OpenAI models only. */
|
|
441
|
+
verbosity?: AiVerbosityLevel;
|
|
442
|
+
}
|
|
423
443
|
/**
|
|
424
444
|
* The base AI agent chat options, should not be used directly.
|
|
425
445
|
* @category AI
|
|
@@ -505,8 +525,59 @@ export interface BaseAiChatOptions {
|
|
|
505
525
|
temperature?: number;
|
|
506
526
|
/** Preset instruction options that can be toggled on */
|
|
507
527
|
guardrails?: GuardrailsOptions;
|
|
528
|
+
/**
|
|
529
|
+
* Refuses prompts that carry PII before they reach the model. Read from the stored agent only —
|
|
530
|
+
* a value passed with a chat request is ignored, so a caller cannot switch off its own screening.
|
|
531
|
+
*/
|
|
532
|
+
pii?: AiPiiOptions;
|
|
508
533
|
/** The LLM model to use. Can be a vendor model name (string) or an integration-based model (object). */
|
|
509
534
|
model?: AiChatModelSelection;
|
|
535
|
+
/**
|
|
536
|
+
* The model to use when `model` cannot serve the conversation's very first request because its
|
|
537
|
+
* provider is unavailable — a rate limit, a capacity outage, or any other failure on the
|
|
538
|
+
* provider's side. A request that fails for its own reasons (an invalid prompt, a rejected
|
|
539
|
+
* schema, an exhausted Squid quota) is never retried on the backup, nor is any request after the
|
|
540
|
+
* first one, nor one that already produced output or ran a tool.
|
|
541
|
+
*
|
|
542
|
+
* A conversation that fell back then STAYS on that backup for the rest of its life, so an outage
|
|
543
|
+
* costs the primary's retry budget once rather than once per turn, and the model does not change
|
|
544
|
+
* mid-dialogue. The pin outlives the option that created it: changing or removing `backupModel`,
|
|
545
|
+
* changing the agent's own `model`, and the primary recovering all leave a pinned conversation
|
|
546
|
+
* where it is, and a pinned model that no longer resolves fails the request rather than moving the
|
|
547
|
+
* conversation. This is deliberate — a conversation accumulates provider-native file ids and a
|
|
548
|
+
* transcript in that provider's dialect, none of which survive a move. Pinning needs Squid-managed
|
|
549
|
+
* memory to have somewhere to record it; without memory every request is a first request anyway.
|
|
550
|
+
*
|
|
551
|
+
* A request carrying `fileIds` follows from the same reasoning, and the two cases differ. A first
|
|
552
|
+
* request does not fall back where that would cost it the attachments — to a model that cannot read
|
|
553
|
+
* ids the primary could, or that reads them without owning them — since answering from a model that
|
|
554
|
+
* never saw them is worse than reporting the outage. Where neither model reads file ids they are
|
|
555
|
+
* inert either way and the fallback proceeds. A
|
|
556
|
+
* conversation already pinned is held to less: it keeps running on its model, and if that model
|
|
557
|
+
* reads no file ids the ids are ignored there as they are anywhere else, because the alternative is
|
|
558
|
+
* a conversation that can never run again.
|
|
559
|
+
*
|
|
560
|
+
* Pass a model name for the model's own defaults, or a {@link BackupModelOptions} object to give
|
|
561
|
+
* the backup its own sampling settings. Everything else — instructions, functions, knowledge
|
|
562
|
+
* bases, connected agents, response format, memory — always comes from the primary configuration.
|
|
563
|
+
*
|
|
564
|
+
* On a turn the backup serves, the sampling settings are ITS settings alone: `temperature`,
|
|
565
|
+
* `reasoningEffort`, `maxTokens`, `maxOutputTokens` and `verbosity` are read from `backupModel`
|
|
566
|
+
* and nowhere else, so a value left unset there takes the backup model's own default even when
|
|
567
|
+
* the agent's profile or the request itself carries one. This holds for every turn of a pinned
|
|
568
|
+
* conversation, not only the one that fell back — tuning meant for one model is not evidence of
|
|
569
|
+
* what another should use.
|
|
570
|
+
*
|
|
571
|
+
* Applies to models served through Squid's own provider SDKs — the vendor models and
|
|
572
|
+
* `openai_compatible`, Bedrock and Vertex integrations. A model you serve yourself from backend
|
|
573
|
+
* code reports its failures as plain errors that carry no provider status, so a turn on one is
|
|
574
|
+
* never diagnosed as a provider outage and never falls back.
|
|
575
|
+
*
|
|
576
|
+
* The backup resolves its API key exactly as it would as the primary model, and is skipped
|
|
577
|
+
* silently when it cannot be resolved, when it reaches the same model as the primary, or when
|
|
578
|
+
* either model is a CLI-backed agent. Leave unset to keep a provider outage surfacing as an error.
|
|
579
|
+
*/
|
|
580
|
+
backupModel?: AiChatModelSelection | BackupModelOptions;
|
|
510
581
|
/** Which provider's reranker to use for reranking the context. Defaults to 'cohere'. */
|
|
511
582
|
rerankProvider?: AiRerankProvider;
|
|
512
583
|
/**
|
|
@@ -932,9 +1003,13 @@ export interface UpsertContextStatusSuccess extends BaseUpsertContextStatus {
|
|
|
932
1003
|
*
|
|
933
1004
|
* `DUPLICATE_CONTENT` means the request omitted a contextId and its content is
|
|
934
1005
|
* byte-identical to an existing context in the same knowledge base.
|
|
1006
|
+
*
|
|
1007
|
+
* `EMBEDDING_FAILED` means extraction succeeded but embedding the context's chunks did not; the
|
|
1008
|
+
* content was not written (an overwrite target keeps its previous content) and the request can be
|
|
1009
|
+
* safely retried as-is.
|
|
935
1010
|
* @category AI
|
|
936
1011
|
*/
|
|
937
|
-
export type UpsertContextErrorCode = 'DUPLICATE_CONTENT';
|
|
1012
|
+
export type UpsertContextErrorCode = 'DUPLICATE_CONTENT' | 'EMBEDDING_FAILED';
|
|
938
1013
|
/**
|
|
939
1014
|
* The existing context a `DUPLICATE_CONTENT` rejection points at — where the byte-identical original
|
|
940
1015
|
* already lives.
|
|
@@ -1077,6 +1152,56 @@ export type GuardrailsOptions = {
|
|
|
1077
1152
|
/** A custom guardrail instruction, if specified. */
|
|
1078
1153
|
custom?: string;
|
|
1079
1154
|
};
|
|
1155
|
+
/**
|
|
1156
|
+
* PII kinds a prompt can be screened for. Each one is judged in context by the screening model, so
|
|
1157
|
+
* a value is classified by what the prompt says it is rather than by which format it happens to fit.
|
|
1158
|
+
* @category AI
|
|
1159
|
+
*/
|
|
1160
|
+
export type AiPiiEntityType = 'email' | 'phoneNumber' | 'creditCard' | 'ssn' | 'iban' | 'passport';
|
|
1161
|
+
/** Entity kinds screened when {@link AiPiiOptions.entities} is omitted. */
|
|
1162
|
+
export declare const DEFAULT_PII_ENTITY_TYPES: ReadonlyArray<AiPiiEntityType>;
|
|
1163
|
+
/** Model that screens prompts unless overridden. Small and fast: it runs on every prompt. */
|
|
1164
|
+
export declare const DEFAULT_PII_CLASSIFIER_MODEL = "gpt-5.6-luna";
|
|
1165
|
+
/**
|
|
1166
|
+
* Rejects a prompt before it reaches the agent's model when it carries PII, so the prompt is never
|
|
1167
|
+
* sent to the model provider, never answered, and never written to chat memory.
|
|
1168
|
+
*
|
|
1169
|
+
* Screening is one {@link classifierModel} call per prompt, covering {@link entities} and
|
|
1170
|
+
* {@link customRules} together. Because a model does the reading rather than a pattern, a value is
|
|
1171
|
+
* judged by what the prompt says it is, and app-specific identifiers can be described in plain
|
|
1172
|
+
* language instead of expressed as a format.
|
|
1173
|
+
*
|
|
1174
|
+
* This is the inverse of {@link GuardrailsOptions.disablePii}, which asks the agent's own model not
|
|
1175
|
+
* to *emit* PII in its answer.
|
|
1176
|
+
* @category AI
|
|
1177
|
+
*/
|
|
1178
|
+
export type AiPiiOptions = {
|
|
1179
|
+
/** `reject` refuses a prompt carrying PII; `off` (default) disables screening entirely. */
|
|
1180
|
+
onDetect: 'off' | 'reject';
|
|
1181
|
+
/** Entity kinds to screen for. Defaults to {@link DEFAULT_PII_ENTITY_TYPES}. */
|
|
1182
|
+
entities?: Array<AiPiiEntityType>;
|
|
1183
|
+
/** App-specific PII in plain language, e.g. `'internal case numbers like CASE-12345'`. */
|
|
1184
|
+
customRules?: Array<string>;
|
|
1185
|
+
/** Model performing the screening. Defaults to {@link DEFAULT_PII_CLASSIFIER_MODEL}. */
|
|
1186
|
+
classifierModel?: AiChatModelSelection;
|
|
1187
|
+
/** Literal values that never count as PII, e.g. a shared support address. */
|
|
1188
|
+
allowList?: Array<string>;
|
|
1189
|
+
};
|
|
1190
|
+
/**
|
|
1191
|
+
* Outcome of screening one prompt. On a detection the prompt is replaced by {@link redactedPrompt}
|
|
1192
|
+
* everywhere it would otherwise be stored, so the audit trail records that a request was refused
|
|
1193
|
+
* and why without restating the values that caused it.
|
|
1194
|
+
* @category AI
|
|
1195
|
+
*/
|
|
1196
|
+
export type AiPiiScanResult = {
|
|
1197
|
+
detected: false;
|
|
1198
|
+
} | {
|
|
1199
|
+
detected: true;
|
|
1200
|
+
/** Entity kinds and custom-rule names that matched. Never the matched values. */
|
|
1201
|
+
matchedTypes: Array<string>;
|
|
1202
|
+
/** The prompt with every match replaced by a `[REDACTED:<type>]` placeholder. */
|
|
1203
|
+
redactedPrompt: string;
|
|
1204
|
+
};
|
|
1080
1205
|
/**
|
|
1081
1206
|
* Response structure for transcribing audio and asking an AI agent a question.
|
|
1082
1207
|
* @category AI
|
|
@@ -1146,8 +1271,8 @@ export type AiSessionContext = {
|
|
|
1146
1271
|
/** The ID of the job associated with the session. */
|
|
1147
1272
|
jobId: JobId;
|
|
1148
1273
|
/**
|
|
1149
|
-
* The conversation this call belongs to, as the caller named it (`memoryOptions.memoryId
|
|
1150
|
-
*
|
|
1274
|
+
* The conversation this call belongs to, as the caller named it (`memoryOptions.memoryId`).
|
|
1275
|
+
* Stable across the turns of one chat and different for two chats, including
|
|
1151
1276
|
* two chats of the same client, which `clientId` is not: a client id belongs to a connection, and
|
|
1152
1277
|
* one connection can carry several conversations. Not the id chat history is keyed by — that one
|
|
1153
1278
|
* falls back to `clientId` — so do not read it as one. Absent for callers that named no conversation
|
|
@@ -20,26 +20,38 @@ export type AiProviderType = (typeof AI_PROVIDER_TYPES)[number];
|
|
|
20
20
|
* @category AI
|
|
21
21
|
*/
|
|
22
22
|
export type CanonicalReasoningEffort = 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
|
|
23
|
+
/**
|
|
24
|
+
* The AI providers that support file upload operations, and so are the only ones that resolve a
|
|
25
|
+
* pre-uploaded file id. Declared as the list, with the type derived from it, so the two cannot drift:
|
|
26
|
+
* a provider added to one is added to both.
|
|
27
|
+
*/
|
|
28
|
+
export declare const AI_FILE_PROVIDER_TYPES: readonly ["openai", "gemini", "anthropic", "grok"];
|
|
23
29
|
/**
|
|
24
30
|
* Type of AI provider that supports file upload operations.
|
|
25
31
|
* Only a subset of AI providers support file management features.
|
|
26
32
|
*/
|
|
27
|
-
export type AiFileProviderType =
|
|
33
|
+
export type AiFileProviderType = (typeof AI_FILE_PROVIDER_TYPES)[number];
|
|
34
|
+
/**
|
|
35
|
+
* True when the provider resolves pre-uploaded file ids. Every other provider — the integration-backed
|
|
36
|
+
* and user-defined ones, which report no vendor identity of their own — ignores `fileIds` outright, so
|
|
37
|
+
* for them the ids are inert rather than wrong.
|
|
38
|
+
*/
|
|
39
|
+
export declare function isFileCapableProviderType(type: AiProviderType): type is AiFileProviderType;
|
|
28
40
|
/**
|
|
29
41
|
* Public OpenAI chat model names (active models only).
|
|
30
42
|
* @category AI
|
|
31
43
|
*/
|
|
32
|
-
export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-5.
|
|
44
|
+
export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-5.5-pro", "gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna"];
|
|
33
45
|
/**
|
|
34
46
|
* Public Gemini chat model names (active models only).
|
|
35
47
|
* @category AI
|
|
36
48
|
*/
|
|
37
|
-
export declare const GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-3.1-pro", "gemini-3.
|
|
49
|
+
export declare const GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-3.1-pro", "gemini-3.7-flash", "gemini-3.5-flash-lite"];
|
|
38
50
|
/**
|
|
39
51
|
* Public Grok chat model names (active models only).
|
|
40
52
|
* @category AI
|
|
41
53
|
*/
|
|
42
|
-
export declare const GROK_CHAT_MODEL_NAMES: readonly ["grok-4.
|
|
54
|
+
export declare const GROK_CHAT_MODEL_NAMES: readonly ["grok-4.6", "grok-4-1-fast-reasoning", "grok-4-1-fast-non-reasoning"];
|
|
43
55
|
/**
|
|
44
56
|
* Public Anthropic chat model names (active models only).
|
|
45
57
|
* @category AI
|
|
@@ -49,7 +61,7 @@ export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-fable-5", "cl
|
|
|
49
61
|
* The supported AI model names.
|
|
50
62
|
* @category AI
|
|
51
63
|
*/
|
|
52
|
-
export declare const VENDOR_AI_CHAT_MODEL_NAMES: readonly ["gpt-5.
|
|
64
|
+
export declare const VENDOR_AI_CHAT_MODEL_NAMES: readonly ["gpt-5.5-pro", "gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "claude-fable-5", "claude-haiku-4-5-20251001", "claude-opus-5", "claude-sonnet-5", "gemini-3.1-pro", "gemini-3.7-flash", "gemini-3.5-flash-lite", "grok-4.6", "grok-4-1-fast-reasoning", "grok-4-1-fast-non-reasoning"];
|
|
53
65
|
/** Checks if the given model name is a global AI chat model name. */
|
|
54
66
|
export declare function isVendorAiChatModelName(modelName: unknown): modelName is VendorAiChatModelName;
|
|
55
67
|
/**
|
|
@@ -161,8 +161,9 @@ export interface AiKnowledgeBaseGraphSearchOptions {
|
|
|
161
161
|
}
|
|
162
162
|
/**
|
|
163
163
|
* Per-knowledge-base GraphRAG configuration. Opt-in and mutable (unlike `embeddingModel`/`vectorDbType`);
|
|
164
|
-
* only honored for `vectorDbType:'mongoAtlas'` KBs. Enabling it on a KB that already has content
|
|
165
|
-
* graph
|
|
164
|
+
* only honored for `vectorDbType:'mongoAtlas'` KBs. Enabling it on a KB that already has content backfills
|
|
165
|
+
* the graph automatically (a debounced structural build runs once the KB goes quiet); the `rebuildGraph`
|
|
166
|
+
* endpoint remains available for an immediate or full rebuild.
|
|
166
167
|
* @category AI
|
|
167
168
|
*/
|
|
168
169
|
export interface AiKnowledgeBaseGraphConfig {
|
|
@@ -172,6 +173,12 @@ export interface AiKnowledgeBaseGraphConfig {
|
|
|
172
173
|
extractionModel?: AiChatModelSelection;
|
|
173
174
|
/** Optional domain taxonomy hint (entity types) injected into the extraction prompt. */
|
|
174
175
|
entityTypes?: string[];
|
|
176
|
+
/**
|
|
177
|
+
* Quiet window (milliseconds) after the last graph activity before the sweep auto-builds the
|
|
178
|
+
* structure. Must be a positive integer. Defaults to the server's window (5 minutes); the sweep
|
|
179
|
+
* cadence (1 minute) bounds how promptly an elapsed window is picked up.
|
|
180
|
+
*/
|
|
181
|
+
autoBuildDebounceMs?: number;
|
|
175
182
|
/** Concept-layer (facet taxonomy) configuration. Omitted ⇒ `facets: 'auto'`. */
|
|
176
183
|
concepts?: AiKnowledgeBaseGraphConceptsConfig;
|
|
177
184
|
}
|
|
@@ -1085,6 +1092,13 @@ export interface GetKnowledgeBaseGraphStatusResponse {
|
|
|
1085
1092
|
* {@link ingestUsage}.
|
|
1086
1093
|
*/
|
|
1087
1094
|
combinedIngestUsage?: KnowledgeBaseGraphUsage;
|
|
1095
|
+
/** When a structural/full rebuild last completed successfully (epoch millis), when one ever has. */
|
|
1096
|
+
lastStructureBuildAt?: number;
|
|
1097
|
+
/**
|
|
1098
|
+
* When the debounced auto-build sweep will pick the KB up (epoch millis), present while an auto-build
|
|
1099
|
+
* is pending. Recomputed per poll — it moves forward while ingest activity continues.
|
|
1100
|
+
*/
|
|
1101
|
+
nextAutoBuildAt?: number;
|
|
1088
1102
|
}
|
|
1089
1103
|
/** The most recent graph backfill/rebuild job of a knowledge base. @category AI */
|
|
1090
1104
|
export interface KnowledgeBaseGraphBuildJob {
|
|
@@ -1092,6 +1106,8 @@ export interface KnowledgeBaseGraphBuildJob {
|
|
|
1092
1106
|
status: 'in_progress' | 'completed' | 'failed';
|
|
1093
1107
|
/** Failure message, present when `status` is `'failed'`. */
|
|
1094
1108
|
error?: string;
|
|
1109
|
+
/** When the job was enqueued (epoch millis). */
|
|
1110
|
+
startedAt?: number;
|
|
1095
1111
|
}
|
|
1096
1112
|
/**
|
|
1097
1113
|
* Aggregated LLM token usage (and best-effort cost) of graph work on a KB. Token counts are the
|
|
@@ -1172,13 +1188,15 @@ export interface KnowledgeBaseGraphFacetValueStatus {
|
|
|
1172
1188
|
/**
|
|
1173
1189
|
* How much of the knowledge base's graph a rebuild recomputes.
|
|
1174
1190
|
*
|
|
1191
|
+
* - `'structural'` (default) — keeps the already-extracted entity graph (LLM extraction runs only for
|
|
1192
|
+
* contexts that were never graph-indexed, e.g. after an interrupted ingest) and recomputes the
|
|
1193
|
+
* derived structure on top of it: entity resolution, lexical mentions, topics and facets. Typically
|
|
1194
|
+
* a small fraction of a full rebuild's cost — the right choice for folding freshly ingested
|
|
1195
|
+
* documents into topics/facets.
|
|
1175
1196
|
* - `'full'` — wipes the graph and re-extracts entities/relationships from every chunk with an LLM,
|
|
1176
1197
|
* then rebuilds the concept layer. The expensive deep-clean: re-extraction dominates its cost.
|
|
1177
|
-
*
|
|
1178
|
-
*
|
|
1179
|
-
* structure on top of it: entity resolution, lexical mentions, topics and facets. Typically a small
|
|
1180
|
-
* fraction of a full rebuild's cost — the right choice for folding freshly ingested documents into
|
|
1181
|
-
* topics/facets.
|
|
1198
|
+
* Only needed when the extraction itself must be redone, e.g. after changing `entityTypes` or
|
|
1199
|
+
* `extractionModel`.
|
|
1182
1200
|
* @category AI
|
|
1183
1201
|
*/
|
|
1184
1202
|
export type KnowledgeBaseGraphRebuildMode = 'full' | 'structural';
|
|
@@ -1189,7 +1207,7 @@ export type KnowledgeBaseGraphRebuildMode = 'full' | 'structural';
|
|
|
1189
1207
|
export interface RebuildKnowledgeBaseGraphRequest {
|
|
1190
1208
|
/** The id of the AiKnowledgeBase. */
|
|
1191
1209
|
knowledgeBaseId: AiKnowledgeBaseId;
|
|
1192
|
-
/** What to recompute (see {@link KnowledgeBaseGraphRebuildMode}). Default `'
|
|
1210
|
+
/** What to recompute (see {@link KnowledgeBaseGraphRebuildMode}). Default `'structural'`. */
|
|
1193
1211
|
mode?: KnowledgeBaseGraphRebuildMode;
|
|
1194
1212
|
}
|
|
1195
1213
|
/**
|
|
@@ -1498,12 +1516,17 @@ export interface BulkIngestionUpsertContextsResponse {
|
|
|
1498
1516
|
*/
|
|
1499
1517
|
contextIds: Array<string>;
|
|
1500
1518
|
/**
|
|
1501
|
-
* Contexts rejected because the knowledge base already holds identical content — either stored under
|
|
1502
|
-
* existing context or accepted earlier in this same call. Absent when nothing was rejected.
|
|
1519
|
+
* Contexts rejected because the knowledge base already holds identical content — either stored under
|
|
1520
|
+
* an existing context or accepted earlier in this same call. Absent when nothing was rejected.
|
|
1503
1521
|
*
|
|
1504
1522
|
* Same shape and `errorCode: 'DUPLICATE_CONTENT'` the synchronous `upsertContexts` returns, so a caller
|
|
1505
1523
|
* handles a duplicate identically on both lanes. These contexts are NOT part of the job: they are not
|
|
1506
1524
|
* extracted, not staged, and never appear in its per-file statuses.
|
|
1525
|
+
*
|
|
1526
|
+
* Covers TEXT contexts and MULTIPART file contexts (their bytes are in hand at staging). A file staged
|
|
1527
|
+
* by `stagedObjectKey` is the one exception: its bytes are first read by the deferred extraction pass,
|
|
1528
|
+
* so its duplicate surfaces asynchronously as a failed file with `errorCode: 'DUPLICATE_CONTENT'` in
|
|
1529
|
+
* the job's per-file statuses instead.
|
|
1507
1530
|
*/
|
|
1508
1531
|
duplicates?: Array<UpsertContextStatusError>;
|
|
1509
1532
|
}
|
|
@@ -1545,6 +1568,13 @@ export interface BulkIngestionFileStatus {
|
|
|
1545
1568
|
status: 'processing' | 'completed' | 'failed';
|
|
1546
1569
|
/** Present only when status is 'failed': the terminal failure reason. */
|
|
1547
1570
|
errorMessage?: string;
|
|
1571
|
+
/**
|
|
1572
|
+
* Machine-readable class of a failed file, for outcomes to treat differently from real failures.
|
|
1573
|
+
* `'DUPLICATE_CONTENT'` marks a duplicate found by the deferred extraction pass (a presigned
|
|
1574
|
+
* object's bytes are first read there) — a skip, not a failure: the KB already holds this content.
|
|
1575
|
+
* Additive; absent for ordinary failures.
|
|
1576
|
+
*/
|
|
1577
|
+
errorCode?: 'DUPLICATE_CONTENT';
|
|
1548
1578
|
}
|
|
1549
1579
|
/**
|
|
1550
1580
|
* Response describing a bulk-ingestion job's current state and progress counts.
|
|
@@ -51,6 +51,14 @@ export interface ExtractDataFromDocumentOptions {
|
|
|
51
51
|
* URL-based extraction ignores it and never returns `documentMetadata`.
|
|
52
52
|
*/
|
|
53
53
|
collectDocumentMetadata?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Safety-net storage expiration (seconds) registered WITH the long-term upload of the original file,
|
|
56
|
+
* before its bytes land — so a process crash at any later point (mid-OCR, before the caller ever
|
|
57
|
+
* learns the path) leaves a self-collecting object instead of a permanent orphan. The caller that
|
|
58
|
+
* sets this owns clearing the expiration once it durably references the path; leaving it unset keeps
|
|
59
|
+
* the original permanent from the moment it uploads.
|
|
60
|
+
*/
|
|
61
|
+
originalFileExpirationSeconds?: number;
|
|
54
62
|
}
|
|
55
63
|
/**
|
|
56
64
|
* Request payload for extracting data from a document via URL.
|
|
@@ -262,6 +270,11 @@ export interface ExtractDataFromDocumentResponse {
|
|
|
262
270
|
* Array of pages containing extracted data.
|
|
263
271
|
*/
|
|
264
272
|
pages: Array<ExtractDataFromDocumentPage>;
|
|
273
|
+
/**
|
|
274
|
+
* Pages the OCR provider reported as processed (billed), when it reports one. Can exceed
|
|
275
|
+
* `pages.length` — a blank page is billed but returns no content.
|
|
276
|
+
*/
|
|
277
|
+
ocrPagesProcessed?: number;
|
|
265
278
|
/**
|
|
266
279
|
* Path to the original file in cloud storage, if applicable.
|
|
267
280
|
*/
|
|
@@ -6,7 +6,9 @@ export interface WebAiSearchRequest {
|
|
|
6
6
|
query: string;
|
|
7
7
|
/**
|
|
8
8
|
* When provided, restricts the web search to these domains (subdomains are included).
|
|
9
|
-
* Cited URLs in the response are guaranteed to belong to one of the listed domains
|
|
9
|
+
* Cited URLs in the response are guaranteed to belong to one of the listed domains, as are the
|
|
10
|
+
* consulted ones — see {@link WebAiSearchResponse.consultedUrls} for which of the two Squid
|
|
11
|
+
* enforces itself.
|
|
10
12
|
*/
|
|
11
13
|
allowedDomains?: Array<string>;
|
|
12
14
|
}
|
|
@@ -27,6 +29,21 @@ export interface WebAiSearchResponse {
|
|
|
27
29
|
markdownText: string;
|
|
28
30
|
/** A list of cited URLs included in the search response. */
|
|
29
31
|
citedUrls: Array<WebAiSearchCitedUrl>;
|
|
32
|
+
/**
|
|
33
|
+
* Pages the search opened while answering, whether or not the answer cites them. Empty when the
|
|
34
|
+
* search reached nothing.
|
|
35
|
+
*
|
|
36
|
+
* This is what the search did, where {@link citedUrls} is what the answer leans on: a model may
|
|
37
|
+
* open ten pages and find the fact on one, and it may answer so tersely ("2026-08-16") that it
|
|
38
|
+
* cites nothing at all. Read this to show where the answer was looked for, or to establish that a
|
|
39
|
+
* search happened; read {@link citedUrls} to attribute a claim.
|
|
40
|
+
*
|
|
41
|
+
* A {@link WebAiSearchRequest.allowedDomains} restriction is applied to this list by Squid rather
|
|
42
|
+
* than relied upon from the provider, since these pages are reported through a channel the
|
|
43
|
+
* provider does not document as filtered. Citations arrive already filtered, being drawn from a
|
|
44
|
+
* restricted answer.
|
|
45
|
+
*/
|
|
46
|
+
consultedUrls: Array<string>;
|
|
30
47
|
}
|
|
31
48
|
/**
|
|
32
49
|
* Request to fetch content from a URL.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { AiAgent, AiAgentMcpServerConfig, AiChatMessage, AiChatModelSelection, AiConnectedAgentMetadata, AiConnectedIntegrationMetadata, AiConnectedKnowledgeBaseMetadata, AiStatusMessage, AiTranscribeAndAskResponse, AllAiAgentChatOptions, BuildAgentOptions, GenerateAgentMcpDescriptionsResponse, GuardrailsOptions, ListAgentRevisionsResponse, UpsertAgentRequest } from '../../../internal-common/src/public-types/ai-agent.public-types';
|
|
2
|
+
import { AiAgent, AiAgentMcpServerConfig, AiChatMessage, AiChatModelSelection, AiConnectedAgentMetadata, AiConnectedIntegrationMetadata, AiConnectedKnowledgeBaseMetadata, AiPiiOptions, AiStatusMessage, AiTranscribeAndAskResponse, AllAiAgentChatOptions, BuildAgentOptions, GenerateAgentMcpDescriptionsResponse, GuardrailsOptions, ListAgentRevisionsResponse, UpsertAgentRequest } from '../../../internal-common/src/public-types/ai-agent.public-types';
|
|
3
3
|
import { JobId } from '../../../internal-common/src/public-types/job.public-types';
|
|
4
4
|
import { Paths } from '../../../internal-common/src/public-types/typescript.public-types';
|
|
5
5
|
import { AiAskOptions, AiAskOptionsWithVoice, AiChatOptionsWithoutVoice, AskResponse, AskWithVoiceResponse, TranscribeAndAskWithVoiceResponse, TranscribeAndChatResponse } from './ai-agent-client.types';
|
|
@@ -52,6 +52,12 @@ export declare class AiAgentReference {
|
|
|
52
52
|
* Updates the agent's guardrails with the provided options.
|
|
53
53
|
*/
|
|
54
54
|
updateGuardrails(guardrails: GuardrailsOptions): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Updates the agent's PII screening. With `onDetect: 'reject'` the agent refuses any prompt
|
|
57
|
+
* carrying PII before it reaches the model, so the prompt is never answered and never stored.
|
|
58
|
+
* Merges with the agent's existing PII options.
|
|
59
|
+
*/
|
|
60
|
+
updatePii(pii: Partial<AiPiiOptions>): Promise<void>;
|
|
55
61
|
/**
|
|
56
62
|
* Updates the agent's MCP server configuration, controlling whether the agent is exposed as an
|
|
57
63
|
* MCP server at `/mcp/<agentId>`. Requires an API key.
|
package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client-reference.d.ts
CHANGED
|
@@ -178,12 +178,12 @@ export declare class AiKnowledgeBaseReference {
|
|
|
178
178
|
*/
|
|
179
179
|
getGraphStatus(): Promise<GetKnowledgeBaseGraphStatusResponse>;
|
|
180
180
|
/**
|
|
181
|
-
* Enqueues a graph rebuild/backfill. The default `'
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
* base at a time.
|
|
181
|
+
* Enqueues a graph rebuild/backfill. The default `'structural'` mode keeps the already-extracted
|
|
182
|
+
* entity graph (extracting only contexts never graph-indexed) and rebuilds just the concept layer
|
|
183
|
+
* (topics + facets); `mode: 'full'` wipes the graph and re-extracts every context with an LLM —
|
|
184
|
+
* expensive, and only needed when the extraction itself must be redone (e.g. after changing
|
|
185
|
+
* `entityTypes` or `extractionModel`). Requires `graphRag.enabled`. Track progress via
|
|
186
|
+
* {@link getGraphStatus}'s `buildJob`; only one rebuild can run per knowledge base at a time.
|
|
187
187
|
*/
|
|
188
188
|
rebuildGraph(request?: Omit<RebuildKnowledgeBaseGraphRequest, 'knowledgeBaseId'>): Promise<void>;
|
|
189
189
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -9,6 +9,7 @@ export * from './ai-image-client';
|
|
|
9
9
|
export * from './ai-knowledge-base/ai-knowledge-base-client';
|
|
10
10
|
export * from './ai-knowledge-base/ai-knowledge-base-client-reference';
|
|
11
11
|
export * from './ai-matchmaking-client';
|
|
12
|
+
export * from './ai-status-updates';
|
|
12
13
|
export * from './api-client';
|
|
13
14
|
export * from './auth.manager';
|
|
14
15
|
export * from './backend-function.manager';
|
|
@@ -12,13 +12,15 @@ export declare class WebClient {
|
|
|
12
12
|
/** Headers for short URL API requests. Only use after asserting apiKey is defined. */
|
|
13
13
|
private get shortUrlHeaders();
|
|
14
14
|
/**
|
|
15
|
-
* Search the web using AI. Returns a response containing Markdown text
|
|
15
|
+
* Search the web using AI. Returns a response containing Markdown text, the URLs the answer cites, and
|
|
16
|
+
* the pages the search consulted.
|
|
16
17
|
* @param query The keywords or query string to search for.
|
|
17
18
|
* @param abortSignal Optional signal used to abort the underlying request. When the signal aborts, the in-flight
|
|
18
19
|
* HTTP request is cancelled and its promise rejects, allowing callers to bound a single call
|
|
19
20
|
* without leaking the request.
|
|
20
21
|
* @param allowedDomains Optional list of domains the search is restricted to (subdomains included). When provided,
|
|
21
|
-
* every
|
|
22
|
+
* every URL in the response — cited or consulted — belongs to one of the listed domains.
|
|
23
|
+
* Squid enforces this over the consulted pages; citations arrive already restricted.
|
|
22
24
|
*/
|
|
23
25
|
aiSearch(query: string, abortSignal?: AbortSignal, allowedDomains?: Array<string>): Promise<WebAiSearchResponse>;
|
|
24
26
|
/**
|