@squidcloud/twilio-client 1.0.497 → 1.0.499
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSONSchema } from 'json-schema-typed';
|
|
2
|
-
import { AiAudioCreateSpeechModelName, AiAudioTranscriptionModelName, AiChatModelName, AiImageModelName, AiProviderType, AiRerankProvider, AnthropicChatModelName, CanonicalReasoningEffort, EmbeddingModelIdSpec, GeminiChatModelName, GrokChatModelName, ModelIdSpec, OpenAiAudioCreateSpeechModelName, OpenAiAudioTranscriptionModelName, OpenAiChatModelName, OpenAiCreateSpeechFormat, OpenAiImageModelName } from './ai-common.public-types';
|
|
2
|
+
import { AiAudioCreateSpeechModelName, AiAudioTranscriptionModelName, AiChatModelName, AiImageModelName, AiProviderType, AiRerankProvider, AnthropicChatModelName, CanonicalReasoningEffort, EmbeddingModelIdSpec, GeminiChatModelName, GrokChatModelName, ModelIdSpec, OpenAiAudioCreateSpeechModelName, OpenAiAudioTranscriptionModelName, OpenAiChatModelName, OpenAiCreateSpeechFormat, OpenAiImageModelName, VendorAiChatModelName } from './ai-common.public-types';
|
|
3
3
|
import { AiContextMetadata, AiContextMetadataFilter, AiKnowledgeBaseContextType, AiRagType } from './ai-knowledge-base.public-types';
|
|
4
4
|
import { AiFunctionId, AiFunctionIdWithContext, UserAiChatModelName } from './backend.public-types';
|
|
5
5
|
import { AiAgentId, AiContextId, AiKnowledgeBaseId, AppId, IntegrationId } from './communication.public-types';
|
|
@@ -420,6 +420,54 @@ export interface IntegrationModelSpec {
|
|
|
420
420
|
* @category AI
|
|
421
421
|
*/
|
|
422
422
|
export type AiChatModelSelection = AiChatModelName | IntegrationModelSpec;
|
|
423
|
+
/**
|
|
424
|
+
* Lets a routing model pick which of several vendor models answers an `ask` or `chat` request. The routing model
|
|
425
|
+
* sees the question, the agent's instructions and a card per candidate (price, tier, reasoning,
|
|
426
|
+
* context window) and names the one that should answer; that model then serves the request.
|
|
427
|
+
* @category AI
|
|
428
|
+
*/
|
|
429
|
+
export interface AiModelRoutingOptions {
|
|
430
|
+
/** The vendor models the routing model chooses from; at least two, no duplicates. */
|
|
431
|
+
models: VendorAiChatModelName[];
|
|
432
|
+
/** The vendor model that makes the choice. */
|
|
433
|
+
routingModel: VendorAiChatModelName;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* The model of an `ask` or `chat` request: a concrete model, or a set of models a routing model chooses from.
|
|
437
|
+
* @category AI
|
|
438
|
+
*/
|
|
439
|
+
export type AiAskModelSelection = AiChatModelSelection | AiModelRoutingOptions;
|
|
440
|
+
/**
|
|
441
|
+
* What a `chat` job resolves to once its stream has ended; read it with `squid.jobs().awaitJob(jobId)`.
|
|
442
|
+
* @category AI
|
|
443
|
+
*/
|
|
444
|
+
export interface AiChatJobResult {
|
|
445
|
+
/** Set when `model` was an {@link AiModelRoutingOptions}: which model answered and what routing cost. */
|
|
446
|
+
routing?: AiModelRoutingResult;
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Chat options as a request carries them: the model may also be a routing choice between several models.
|
|
450
|
+
* @category AI
|
|
451
|
+
*/
|
|
452
|
+
export type AiChatRequestOptions = Omit<AllAiAgentChatOptions, 'model'> & {
|
|
453
|
+
model?: AiAskModelSelection;
|
|
454
|
+
};
|
|
455
|
+
/**
|
|
456
|
+
* How a request whose `model` was an {@link AiModelRoutingOptions} was routed.
|
|
457
|
+
* @category AI
|
|
458
|
+
*/
|
|
459
|
+
export interface AiModelRoutingResult {
|
|
460
|
+
/** The model the routing model chose and the request was sent to. A `backupModel` may still have served it. */
|
|
461
|
+
model: VendorAiChatModelName;
|
|
462
|
+
/** The model that made the choice. */
|
|
463
|
+
routingModel: VendorAiChatModelName;
|
|
464
|
+
/** Input tokens the routing call consumed. */
|
|
465
|
+
inputTokens: number;
|
|
466
|
+
/** Output tokens the routing call generated. */
|
|
467
|
+
outputTokens: number;
|
|
468
|
+
/** Best-effort USD cost of the routing call; undefined when the routing model is unpriced. */
|
|
469
|
+
costUsd?: number;
|
|
470
|
+
}
|
|
423
471
|
/**
|
|
424
472
|
* A backup model together with the sampling settings to run it with. Use this form instead of a
|
|
425
473
|
* bare {@link AiChatModelSelection} when the backup needs settings of its own; anything left unset
|
|
@@ -750,7 +798,7 @@ export type AiVerbosityLevel = 'low' | 'medium' | 'high';
|
|
|
750
798
|
* **Example:**
|
|
751
799
|
* ```typescript
|
|
752
800
|
* {
|
|
753
|
-
* model: 'claude-sonnet-5',
|
|
801
|
+
* model: 'claude-sonnet-5-5',
|
|
754
802
|
* responseFormat: {
|
|
755
803
|
* type: 'json_schema',
|
|
756
804
|
* schema: {
|
|
@@ -1244,7 +1292,7 @@ export type AiPiiEntityType = 'email' | 'phoneNumber' | 'creditCard' | 'ssn' | '
|
|
|
1244
1292
|
/** Entity kinds screened when {@link AiPiiOptions.entities} is omitted. */
|
|
1245
1293
|
export declare const DEFAULT_PII_ENTITY_TYPES: ReadonlyArray<AiPiiEntityType>;
|
|
1246
1294
|
/** Model that screens prompts unless overridden. Small and fast: it runs on every prompt. */
|
|
1247
|
-
export declare const DEFAULT_PII_CLASSIFIER_MODEL = "gpt-
|
|
1295
|
+
export declare const DEFAULT_PII_CLASSIFIER_MODEL = "gpt-6-luna";
|
|
1248
1296
|
/**
|
|
1249
1297
|
* Rejects a prompt before it reaches the agent's model when it carries PII, so the prompt is never
|
|
1250
1298
|
* sent to the model provider, never answered, and never written to chat memory.
|
|
@@ -1401,6 +1449,8 @@ export interface AiAskResponse {
|
|
|
1401
1449
|
responseString: string;
|
|
1402
1450
|
/** Optional annotations (e.g., file references) in the response */
|
|
1403
1451
|
annotations?: Record<string, AiAnnotation>;
|
|
1452
|
+
/** Set when `model` was an {@link AiModelRoutingOptions}: which model answered and what routing cost. */
|
|
1453
|
+
routing?: AiModelRoutingResult;
|
|
1404
1454
|
}
|
|
1405
1455
|
/**
|
|
1406
1456
|
* API request to create speech from text
|
|
@@ -46,7 +46,7 @@ export declare const AI_CODE_INTERPRETER_PROVIDER_TYPES: readonly ["openai", "an
|
|
|
46
46
|
* Public OpenAI chat model names (active models only).
|
|
47
47
|
* @category AI
|
|
48
48
|
*/
|
|
49
|
-
export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-6-astra", "gpt-6-
|
|
49
|
+
export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-6-astra", "gpt-6-luna", "gpt-6.1-sol"];
|
|
50
50
|
/**
|
|
51
51
|
* Public Gemini chat model names (active models only).
|
|
52
52
|
* @category AI
|
|
@@ -61,12 +61,12 @@ export declare const GROK_CHAT_MODEL_NAMES: readonly ["grok-4.6", "grok-4-1-fast
|
|
|
61
61
|
* Public Anthropic chat model names (active models only).
|
|
62
62
|
* @category AI
|
|
63
63
|
*/
|
|
64
|
-
export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-fable-5", "claude-fable-5-1", "claude-haiku-4-5-20251001", "claude-opus-5-5", "claude-sonnet-5"];
|
|
64
|
+
export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-fable-5", "claude-fable-5-1", "claude-haiku-4-5-20251001", "claude-opus-5-5", "claude-sonnet-5-5"];
|
|
65
65
|
/**
|
|
66
66
|
* The supported AI model names.
|
|
67
67
|
* @category AI
|
|
68
68
|
*/
|
|
69
|
-
export declare const VENDOR_AI_CHAT_MODEL_NAMES: readonly ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-6-astra", "gpt-6-
|
|
69
|
+
export declare const VENDOR_AI_CHAT_MODEL_NAMES: readonly ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-6-astra", "gpt-6-luna", "gpt-6.1-sol", "claude-fable-5", "claude-fable-5-1", "claude-haiku-4-5-20251001", "claude-opus-5-5", "claude-sonnet-5-5", "gemini-3.1-pro", "gemini-3.8-flash", "gemini-3.5-flash-lite", "grok-4.6", "grok-4-1-fast-reasoning", "grok-4-1-fast-non-reasoning"];
|
|
70
70
|
/** Checks if the given model name is a global AI chat model name. */
|
|
71
71
|
export declare function isVendorAiChatModelName(modelName: unknown): modelName is VendorAiChatModelName;
|
|
72
72
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AiChatModelSelection, AiReasoningEffort, ContextImageFailure, UpsertContextStatusError } from './ai-agent.public-types';
|
|
1
|
+
import { AiChatModelSelection, AiReasoningEffort, ContextImageFailure, UpsertContextErrorCode, UpsertContextStatusError } from './ai-agent.public-types';
|
|
2
2
|
import { AiEmbeddingsModelSelection, AiRerankProvider } from './ai-common.public-types';
|
|
3
3
|
import { AiContextId, AiKnowledgeBaseId, AppId } from './communication.public-types';
|
|
4
4
|
import { DocumentExtractionMethod } from './extraction.public-types';
|
|
@@ -943,9 +943,11 @@ export interface AiKnowledgeBaseGrepMatch {
|
|
|
943
943
|
* content was never searchable.
|
|
944
944
|
* - `coverageUnknown` — the scan itself succeeded, but how much of the scope holds stored text could not
|
|
945
945
|
* be determined, so completeness cannot be asserted either way.
|
|
946
|
+
* - `patternTooBroad` — the pattern may occur in too many places to check them all within the time limit,
|
|
947
|
+
* so only some were searched. Narrow with `metadataFilter` or use a longer, more distinctive pattern.
|
|
946
948
|
* @category AI
|
|
947
949
|
*/
|
|
948
|
-
export type GrepScanLimitation = 'timedOut' | 'noIndexedText' | 'filterMatchedNoContexts' | 'scopeTruncated' | 'partsCapReached' | 'partialCoverage' | 'truncatedContent' | 'coverageUnknown';
|
|
950
|
+
export type GrepScanLimitation = 'timedOut' | 'noIndexedText' | 'filterMatchedNoContexts' | 'scopeTruncated' | 'partsCapReached' | 'partialCoverage' | 'truncatedContent' | 'coverageUnknown' | 'patternTooBroad';
|
|
949
951
|
/**
|
|
950
952
|
* Response structure for a literal scan over a knowledge base's raw extracted text.
|
|
951
953
|
* @category AI
|
|
@@ -1271,6 +1273,21 @@ export interface GetKnowledgeBaseGraphStatusResponse {
|
|
|
1271
1273
|
conceptScopeReady?: boolean;
|
|
1272
1274
|
/** The incremental entity-resolution sweep's latest readings, present once a sweep has sampled the KB. */
|
|
1273
1275
|
resolution?: KnowledgeBaseGraphResolutionStatus;
|
|
1276
|
+
/** Scheduled structural build slots skipped because the build could not start in time, newest last. */
|
|
1277
|
+
structuralBuildSkips?: Array<KnowledgeBaseGraphStructuralBuildSkip>;
|
|
1278
|
+
/** A manual `rebuildGraph` request waiting for the running entity-resolution build to finish. */
|
|
1279
|
+
queuedRebuild?: KnowledgeBaseGraphQueuedRebuild;
|
|
1280
|
+
}
|
|
1281
|
+
/**
|
|
1282
|
+
* A manual graph rebuild requested while an entity-resolution build ran. It starts once that build ends,
|
|
1283
|
+
* regardless of the structural build schedule.
|
|
1284
|
+
* @category AI
|
|
1285
|
+
*/
|
|
1286
|
+
export interface KnowledgeBaseGraphQueuedRebuild {
|
|
1287
|
+
/** The requested rebuild mode; a `'full'` request absorbs a `'structural'` one queued with it. */
|
|
1288
|
+
mode: KnowledgeBaseGraphRebuildMode;
|
|
1289
|
+
/** When the latest request was queued (epoch millis). */
|
|
1290
|
+
requestedAt: number;
|
|
1274
1291
|
}
|
|
1275
1292
|
/**
|
|
1276
1293
|
* Readings the incremental entity-resolution sweep persists on a knowledge base: the dirty backlog it
|
|
@@ -1358,7 +1375,58 @@ export interface KnowledgeBaseGraphBuildUsage {
|
|
|
1358
1375
|
usage: KnowledgeBaseGraphUsage;
|
|
1359
1376
|
/** The split of {@link usage} across the stages the build ran. */
|
|
1360
1377
|
stages: KnowledgeBaseGraphBuildStageUsage;
|
|
1378
|
+
/** What the build's incremental entity-resolution stage has got through; absent until its first pass reports. */
|
|
1379
|
+
resolutionProgress?: KnowledgeBaseGraphResolutionProgress;
|
|
1380
|
+
}
|
|
1381
|
+
/**
|
|
1382
|
+
* Running progress of a build's incremental entity-resolution stage, written as each pass proposes,
|
|
1383
|
+
* adjudicates and merges, and summed over the build's execution attempts. The build's `usage` is flushed
|
|
1384
|
+
* at the same points, so it reads as the cost so far while the build runs.
|
|
1385
|
+
* @category AI
|
|
1386
|
+
*/
|
|
1387
|
+
export interface KnowledgeBaseGraphResolutionProgress {
|
|
1388
|
+
/** Drain rounds completed. */
|
|
1389
|
+
rounds: number;
|
|
1390
|
+
/** Resolution passes completed. */
|
|
1391
|
+
passes: number;
|
|
1392
|
+
/** Dirty entities examined. */
|
|
1393
|
+
examined: number;
|
|
1394
|
+
/** Candidate pairs sent to adjudication. */
|
|
1395
|
+
pairsProposed: number;
|
|
1396
|
+
/** Candidate pairs adjudication confirmed as the same entity. */
|
|
1397
|
+
pairsConfirmed: number;
|
|
1398
|
+
/** Entities merged into a canonical entity. */
|
|
1399
|
+
entitiesMerged: number;
|
|
1400
|
+
/** Time spent proposing candidate pairs (millis). */
|
|
1401
|
+
proposalMs: number;
|
|
1402
|
+
/** Time spent adjudicating candidate pairs (millis). */
|
|
1403
|
+
adjudicationMs: number;
|
|
1404
|
+
/** Time spent merging confirmed pairs and refreshing the survivors (millis). */
|
|
1405
|
+
mergeMs: number;
|
|
1406
|
+
/** When the progress was last written (epoch millis). */
|
|
1407
|
+
updatedAt: number;
|
|
1408
|
+
}
|
|
1409
|
+
/**
|
|
1410
|
+
* A scheduled structural build slot whose catch-up window closed (or the next slot superseded it) without a
|
|
1411
|
+
* structural build, because the automatic build could not start while the window was open.
|
|
1412
|
+
* @category AI
|
|
1413
|
+
*/
|
|
1414
|
+
export interface KnowledgeBaseGraphStructuralBuildSkip {
|
|
1415
|
+
/** The cron slot that was skipped (epoch millis). */
|
|
1416
|
+
slotAt: number;
|
|
1417
|
+
/** When the slot's catch-up window closed (epoch millis). */
|
|
1418
|
+
windowEndsAt: number;
|
|
1419
|
+
/**
|
|
1420
|
+
* Why the build could not start: an entity-resolution build was still running, another graph build held the KB,
|
|
1421
|
+
* a manual rebuild was queued ahead of it, a bulk ingestion was writing to it, or `graphRag.autoBuildPaused` was set.
|
|
1422
|
+
* The last reason seen in the window.
|
|
1423
|
+
*/
|
|
1424
|
+
reason: KnowledgeBaseGraphStructuralBuildSkipReason;
|
|
1425
|
+
/** When the skip was recorded (epoch millis). */
|
|
1426
|
+
recordedAt: number;
|
|
1361
1427
|
}
|
|
1428
|
+
/** Why an automatic structural build could not start inside its scheduled window. @category AI */
|
|
1429
|
+
export type KnowledgeBaseGraphStructuralBuildSkipReason = 'resolution-running' | 'build-in-progress' | 'queued-rebuild' | 'bulk-ingest' | 'paused';
|
|
1362
1430
|
/**
|
|
1363
1431
|
* A graph build's LLM usage split by pipeline stage. A stage the build entered but spent nothing on
|
|
1364
1432
|
* reads zero; a stage it never ran (skipped by its plan, or by a resume) is absent.
|
|
@@ -1896,6 +1964,24 @@ export interface BulkIngestionJobStatusCounts {
|
|
|
1896
1964
|
/** Logical requests submitted to the provider and awaiting results. */
|
|
1897
1965
|
requestsSubmitted: number;
|
|
1898
1966
|
}
|
|
1967
|
+
/**
|
|
1968
|
+
* Machine-readable class of a bulk-ingestion file failure, for outcomes to treat differently from real
|
|
1969
|
+
* failures. Terminal — reported with `retryable: false` — are `'CONTENT_TOO_LARGE'` (past the per-context
|
|
1970
|
+
* ceiling), `'ENCRYPTED_DOCUMENT'`, `'IMAGE_OVER_PROVIDER_LIMIT'` (the OCR provider refuses an image in the
|
|
1971
|
+
* document as too large, even with the pages that draw it redrawn smaller), `'NO_EMBEDDABLE_CONTENT'`,
|
|
1972
|
+
* `'SOURCE_OVER_PROVIDER_LIMIT'` (the bytes exceed what the extraction provider accepts),
|
|
1973
|
+
* `'UNREADABLE_DOCUMENT'` (a PDF or Office file whose bytes cannot be opened as one), `'UNREADABLE_WORKBOOK'`
|
|
1974
|
+
* (a spreadsheet whose content the parser cannot read) and `'UNSUPPORTED_FILE_TYPE'`.
|
|
1975
|
+
* `'DUPLICATE_CONTENT'` is a skip rather than a failure: the KB already holds this content.
|
|
1976
|
+
* `'EXTRACTION_TIMED_OUT'` stays retryable — the deadline is contended, so a borderline document can
|
|
1977
|
+
* cross it under load. So do `'SOURCE_UNREACHABLE'` (the provider could not fetch the source, which a
|
|
1978
|
+
* fresh link can fix) and `'PROVIDER_ACCESS_DENIED'` (the provider refused the credential or its quota is
|
|
1979
|
+
* spent, a fault of the environment). `'JOB_FULL'`: the job's request ceiling had no room left for this
|
|
1980
|
+
* file when it was admitted — before any paid stage ran — so re-submit it in a fresh job; a file that
|
|
1981
|
+
* alone exceeds the ceiling fails this way in every job.
|
|
1982
|
+
* @category AI
|
|
1983
|
+
*/
|
|
1984
|
+
export type BulkIngestionFileErrorCode = 'CONTENT_TOO_LARGE' | 'DUPLICATE_CONTENT' | 'ENCRYPTED_DOCUMENT' | 'EXTRACTION_TIMED_OUT' | 'IMAGE_OVER_PROVIDER_LIMIT' | 'JOB_FULL' | 'NO_EMBEDDABLE_CONTENT' | 'PROVIDER_ACCESS_DENIED' | 'SOURCE_OVER_PROVIDER_LIMIT' | 'SOURCE_UNREACHABLE' | 'UNREADABLE_DOCUMENT' | 'UNREADABLE_WORKBOOK' | 'UNSUPPORTED_FILE_TYPE';
|
|
1899
1985
|
/**
|
|
1900
1986
|
* Per-file/per-context status within a bulk-ingestion job, so a caller can see which file finished,
|
|
1901
1987
|
* which is still processing, and why a file failed.
|
|
@@ -1912,21 +1998,9 @@ export interface BulkIngestionFileStatus {
|
|
|
1912
1998
|
errorMessage?: string;
|
|
1913
1999
|
/**
|
|
1914
2000
|
* Machine-readable class of a failed file, for outcomes to treat differently from real failures.
|
|
1915
|
-
*
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
* `'SOURCE_OVER_PROVIDER_LIMIT'` (the bytes exceed what the extraction provider accepts),
|
|
1919
|
-
* `'UNREADABLE_DOCUMENT'` (a PDF or Office file whose bytes cannot be opened as one), `'UNREADABLE_WORKBOOK'`
|
|
1920
|
-
* (a spreadsheet whose content the parser cannot read) and `'UNSUPPORTED_FILE_TYPE'`.
|
|
1921
|
-
* `'DUPLICATE_CONTENT'` is a skip rather than a failure: the KB already holds this content.
|
|
1922
|
-
* `'EXTRACTION_TIMED_OUT'` stays retryable — the deadline is contended, so a borderline document can
|
|
1923
|
-
* cross it under load. So do `'SOURCE_UNREACHABLE'` (the provider could not fetch the source, which a
|
|
1924
|
-
* fresh link can fix) and `'PROVIDER_ACCESS_DENIED'` (the provider refused the credential or its quota is
|
|
1925
|
-
* spent, a fault of the environment). `'JOB_FULL'`: the job's request ceiling had no room left for this
|
|
1926
|
-
* file, so re-submit it in a fresh job; a file that alone exceeds the ceiling fails this way in every job.
|
|
1927
|
-
* Additive; absent for ordinary failures.
|
|
1928
|
-
*/
|
|
1929
|
-
errorCode?: 'CONTENT_TOO_LARGE' | 'DUPLICATE_CONTENT' | 'ENCRYPTED_DOCUMENT' | 'EXTRACTION_TIMED_OUT' | 'IMAGE_OVER_PROVIDER_LIMIT' | 'JOB_FULL' | 'NO_EMBEDDABLE_CONTENT' | 'PROVIDER_ACCESS_DENIED' | 'SOURCE_OVER_PROVIDER_LIMIT' | 'SOURCE_UNREACHABLE' | 'UNREADABLE_DOCUMENT' | 'UNREADABLE_WORKBOOK' | 'UNSUPPORTED_FILE_TYPE';
|
|
2001
|
+
* Additive; absent for ordinary failures. See {@link BulkIngestionFileErrorCode}.
|
|
2002
|
+
*/
|
|
2003
|
+
errorCode?: BulkIngestionFileErrorCode;
|
|
1930
2004
|
/**
|
|
1931
2005
|
* Present only on a failed file an extraction provider answered: a stable fingerprint of that answer
|
|
1932
2006
|
* (provider, HTTP status and provider code), so a caller can tell the same failure repeating from a new one.
|
|
@@ -1963,6 +2037,91 @@ export interface BulkIngestionFileStatus {
|
|
|
1963
2037
|
* @category AI
|
|
1964
2038
|
*/
|
|
1965
2039
|
export type BulkIngestionGraphSkipReason = 'cap' | 'queue';
|
|
2040
|
+
/**
|
|
2041
|
+
* The durable ingestion status of a single file/text context, tracked independently of any one
|
|
2042
|
+
* bulk-ingestion job so it survives job purge. `'no_record'` means the knowledge base has never seen
|
|
2043
|
+
* this path — never persisted, only synthesized when a status query finds nothing. `'in_progress'`
|
|
2044
|
+
* covers every non-terminal bulk-ingestion stage (staged through embedding); the ledger only records
|
|
2045
|
+
* terminal outcomes, so finer sub-stages are not distinguished. `'completed'` and `'failed'` are terminal.
|
|
2046
|
+
* @category AI
|
|
2047
|
+
*/
|
|
2048
|
+
export type AiKnowledgeBaseFileStatus = 'no_record' | 'in_progress' | 'completed' | 'failed';
|
|
2049
|
+
/**
|
|
2050
|
+
* The durable ingestion status of one file/text context at a path, returned by
|
|
2051
|
+
* {@link AiKnowledgeBaseReference.getFileStatus} and as one entry of
|
|
2052
|
+
* {@link AiKnowledgeBaseFolderStatusResponse.files}.
|
|
2053
|
+
* @category AI
|
|
2054
|
+
*/
|
|
2055
|
+
export interface AiKnowledgeBaseFileStatusInfo {
|
|
2056
|
+
/** The context id, absent only when `status` is `'no_record'`. */
|
|
2057
|
+
contextId?: AiContextId;
|
|
2058
|
+
/** The file's path: `folderPath/filename`, or just `filename` at the upload root. */
|
|
2059
|
+
path: string;
|
|
2060
|
+
/** The file's current durable status. */
|
|
2061
|
+
status: AiKnowledgeBaseFileStatus;
|
|
2062
|
+
/** Present only when `status` is `'failed'`: the terminal failure reason. */
|
|
2063
|
+
errorMessage?: string;
|
|
2064
|
+
/**
|
|
2065
|
+
* Present only when `status` is `'failed'`: the machine-readable failure class, when known. A bulk
|
|
2066
|
+
* lane failure reports {@link BulkIngestionFileErrorCode}; a synchronous `upsertContexts` failure
|
|
2067
|
+
* reports {@link UpsertContextErrorCode} — the two lanes use distinct, mostly-overlapping codes.
|
|
2068
|
+
*/
|
|
2069
|
+
errorCode?: BulkIngestionFileErrorCode | UpsertContextErrorCode;
|
|
2070
|
+
/** When this status was last recorded; absent when `status` is `'no_record'`. */
|
|
2071
|
+
updatedAt?: Date;
|
|
2072
|
+
}
|
|
2073
|
+
/**
|
|
2074
|
+
* Request to look up the durable ingestion status of a single file/text context by path.
|
|
2075
|
+
* @category AI
|
|
2076
|
+
*/
|
|
2077
|
+
export interface GetKnowledgeBaseFileStatusRequest {
|
|
2078
|
+
/** The knowledge base to query. */
|
|
2079
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
2080
|
+
/** The file's path: `folderPath/filename`, or just `filename` at the upload root. */
|
|
2081
|
+
path: string;
|
|
2082
|
+
}
|
|
2083
|
+
/**
|
|
2084
|
+
* Request to search and aggregate the durable ingestion status of every file/text context matching
|
|
2085
|
+
* `folderPath`, read three ways and unioned: a folder subtree, a bare filename anywhere in the
|
|
2086
|
+
* knowledge base, and — when it contains a `/` — an exact `folderPath/filename` path.
|
|
2087
|
+
* @category AI
|
|
2088
|
+
*/
|
|
2089
|
+
export interface GetKnowledgeBaseFolderStatusRequest {
|
|
2090
|
+
/** The knowledge base to query. */
|
|
2091
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
2092
|
+
/**
|
|
2093
|
+
* The folder subtree, bare filename, or exact file path to search for. A subtree match uses the same
|
|
2094
|
+
* segment-safe matching as `$underPath` metadata filters; a value containing `/` also matches that
|
|
2095
|
+
* exact file, so pasting a path from an earlier result finds that one file, not a folder of the same name.
|
|
2096
|
+
*/
|
|
2097
|
+
folderPath: string;
|
|
2098
|
+
/**
|
|
2099
|
+
* Maximum number of files to return in `files`, prioritizing failures (the ones needing attention)
|
|
2100
|
+
* before filling remaining room with other statuses. `counts`/`totalFiles` always cover every file
|
|
2101
|
+
* regardless of this cap. Defaults to 50.
|
|
2102
|
+
*/
|
|
2103
|
+
fileLimit?: number;
|
|
2104
|
+
}
|
|
2105
|
+
/**
|
|
2106
|
+
* Aggregate ingestion status for every file/text context matching a searched folder subtree, bare
|
|
2107
|
+
* filename, or exact file path (see {@link GetKnowledgeBaseFolderStatusRequest.folderPath}), combining
|
|
2108
|
+
* a name/path search with per-status counts and the failures that need attention.
|
|
2109
|
+
* @category AI
|
|
2110
|
+
*/
|
|
2111
|
+
export interface AiKnowledgeBaseFolderStatusResponse {
|
|
2112
|
+
/** The folder subtree, filename, or exact path that was searched. */
|
|
2113
|
+
folderPath: string;
|
|
2114
|
+
/** Count of matching files by terminal/in-progress status (excludes `no_record`), uncapped. */
|
|
2115
|
+
counts: Record<Exclude<AiKnowledgeBaseFileStatus, 'no_record'>, number>;
|
|
2116
|
+
/** Total files found, across all statuses in `counts`. */
|
|
2117
|
+
totalFiles: number;
|
|
2118
|
+
/** False when nothing matched — the folder-level `no_record` case. */
|
|
2119
|
+
hasAnyRecords: boolean;
|
|
2120
|
+
/** Files under the folder, capped at `fileLimit` and prioritizing failures. */
|
|
2121
|
+
files: Array<AiKnowledgeBaseFileStatusInfo>;
|
|
2122
|
+
/** True when `files` was capped and more files exist under the folder than are returned. */
|
|
2123
|
+
truncated: boolean;
|
|
2124
|
+
}
|
|
1966
2125
|
/**
|
|
1967
2126
|
* Why a whole bulk-ingestion staging call was refused, on the `details` of its 400 response. The
|
|
1968
2127
|
* refusal names the one context that caused it, so a caller recording per-file outcomes charges only
|
|
@@ -2013,6 +2172,8 @@ export interface BulkIngestionProviderBatchStatus {
|
|
|
2013
2172
|
providerStatus?: string;
|
|
2014
2173
|
/** When a poll first saw {@link providerStatus}. */
|
|
2015
2174
|
providerStatusChangedAt?: Date;
|
|
2175
|
+
/** Why the provider failed the batch as a whole, in its own words; absent on a batch it did not fail. */
|
|
2176
|
+
providerError?: string;
|
|
2016
2177
|
/** When the provider started running the batch; absent while it has not. */
|
|
2017
2178
|
providerInProgressAt?: Date;
|
|
2018
2179
|
/** Per-request progress at the newest poll; absent for a provider that does not report it. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squidcloud/twilio-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.499",
|
|
4
4
|
"description": "Squid Twilio Client",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/connectors/twilio/twilio-client/src/index.d.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"author": "",
|
|
18
18
|
"license": "ISC",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@squidcloud/client": "^1.0.
|
|
20
|
+
"@squidcloud/client": "^1.0.499"
|
|
21
21
|
},
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=20.0.0"
|