@squidcloud/twilio-client 1.0.503 → 1.0.505
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/index.js +1 -1
- package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +52 -12
- package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +5 -5
- package/dist/internal-common/src/public-types/ai-knowledge-base.public-types.d.ts +39 -10
- package/dist/internal-common/src/public-types/ai-voice.public-types.d.ts +16 -0
- package/dist/internal-common/src/public-types/extraction.public-types.d.ts +1 -1
- package/dist/internal-common/src/public-types/integration.public-types.d.ts +1 -1
- package/dist/internal-common/src/public-types/session.public-types.d.ts +82 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";const
|
|
1
|
+
(()=>{"use strict";const t={d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};t.r(e),t.d(e,{SMS_EVENT_TYPE:()=>i,SquidTwilioClient:()=>r,VOICE_ENGINES:()=>o,VOICE_MODES:()=>n});const i="twilio-sms-event",n=["relay","gather"],o=["twilio","elevenlabs","openai"];class r{constructor(t,e){this.squid=t,this.integrationId=e}async sendSms(t){return this.squid.executeFunction("sendSms",{...t,integrationId:this.integrationId})}async placeCall(t){return this.squid.executeFunction("placeCall",{...t,integrationId:this.integrationId})}async getCallTranscript(t){return this.squid.executeFunction("getCallTranscript",{...t,integrationId:this.integrationId})}async listPhoneNumbers(){return this.squid.executeFunction("twilioListPhoneNumbers",{integrationId:this.integrationId})}async provisionAgent(t){return this.squid.executeFunction("twilioProvisionAgent",{...t,integrationId:this.integrationId})}async createCustomerVoiceToken(t){return this.squid.executeFunction("twilioCreateCustomerVoiceToken",{...t,integrationId:this.integrationId})}async getCustomerVoiceCall(t){return this.squid.executeFunction("twilioGetCustomerVoiceCall",{...t,integrationId:this.integrationId})}async setHumanHandoff(t){return this.squid.executeFunction("twilioSetHumanHandoff",{...t,integrationId:this.integrationId})}}const s=exports;for(var a in e)s[a]=e[a];e.__esModule&&Object.defineProperty(s,"__esModule",{value:!0})})();
|
|
@@ -7,6 +7,7 @@ import { DocumentExtractionMethod } from './extraction.public-types';
|
|
|
7
7
|
import { IntegrationType } from './integration.public-types';
|
|
8
8
|
import { JobId } from './job.public-types';
|
|
9
9
|
import { SecretKey } from './secret.public-types';
|
|
10
|
+
import { UpsertSessionRequest } from './session.public-types';
|
|
10
11
|
/**
|
|
11
12
|
* @category AI
|
|
12
13
|
*/
|
|
@@ -431,6 +432,13 @@ export interface AiModelRoutingOptions {
|
|
|
431
432
|
models: VendorAiChatModelName[];
|
|
432
433
|
/** The vendor model that makes the choice. */
|
|
433
434
|
routingModel: VendorAiChatModelName;
|
|
435
|
+
/**
|
|
436
|
+
* How to choose, in plain language: the routing model follows it over its default rule, which
|
|
437
|
+
* takes the cheapest candidate that can answer well. Up to 2000 characters. The routing model
|
|
438
|
+
* sees each candidate's price, context window and benchmark measurements, so an instruction can
|
|
439
|
+
* refer to them ("never pay more than $0.01 per answer", "prefer the model measured on coding").
|
|
440
|
+
*/
|
|
441
|
+
instructions?: string;
|
|
434
442
|
}
|
|
435
443
|
/**
|
|
436
444
|
* The model of an `ask` or `chat` request: a concrete model, or a set of models a routing model chooses from.
|
|
@@ -459,8 +467,15 @@ export type AiChatRequestOptions = Omit<AllAiAgentChatOptions, 'model'> & {
|
|
|
459
467
|
export interface AiModelRoutingResult {
|
|
460
468
|
/** The model the routing model chose and the request was sent to. A `backupModel` may still have served it. */
|
|
461
469
|
model: VendorAiChatModelName;
|
|
470
|
+
/**
|
|
471
|
+
* The reasoning effort the chosen model ran at: the routing model's own pick, or the request's or
|
|
472
|
+
* agent's effort resolved to a level the model accepts when one was set. Undefined is the model's default.
|
|
473
|
+
*/
|
|
474
|
+
reasoningEffort?: AiReasoningEffort;
|
|
462
475
|
/** The model that made the choice. */
|
|
463
476
|
routingModel: VendorAiChatModelName;
|
|
477
|
+
/** The routing model's one-line justification of the choice. */
|
|
478
|
+
reason: string;
|
|
464
479
|
/** Input tokens the routing call consumed. */
|
|
465
480
|
inputTokens: number;
|
|
466
481
|
/** Output tokens the routing call generated. */
|
|
@@ -516,8 +531,8 @@ export interface BaseAiChatOptions {
|
|
|
516
531
|
*/
|
|
517
532
|
maxTokens?: number;
|
|
518
533
|
/**
|
|
519
|
-
* The maximum number of tokens the model should output.
|
|
520
|
-
*
|
|
534
|
+
* The maximum number of tokens the model should output. Can be used to control the output verbosity.
|
|
535
|
+
* For a model from an AI connector, the model's configured max output tokens is the ceiling.
|
|
521
536
|
*/
|
|
522
537
|
maxOutputTokens?: number;
|
|
523
538
|
/** The context ID to use for the request. If not provided, the agent's default context will be used. */
|
|
@@ -653,6 +668,9 @@ export interface BaseAiChatOptions {
|
|
|
653
668
|
* conversation, not only the one that fell back — tuning meant for one model is not evidence of
|
|
654
669
|
* what another should use.
|
|
655
670
|
*
|
|
671
|
+
* A turn the primary's safety classifier declines outright — no text at all came back — falls
|
|
672
|
+
* back the same way, since another model may well answer the same prompt.
|
|
673
|
+
*
|
|
656
674
|
* Applies to models served through Squid's own provider SDKs — the vendor models and
|
|
657
675
|
* `openai_compatible`, Bedrock and Vertex integrations. A model you serve yourself from backend
|
|
658
676
|
* code reports its failures as plain errors that carry no provider status, so a turn on one is
|
|
@@ -697,17 +715,16 @@ export interface BaseAiChatOptions {
|
|
|
697
715
|
*/
|
|
698
716
|
verbosity?: AiVerbosityLevel;
|
|
699
717
|
/**
|
|
700
|
-
*
|
|
718
|
+
* Enables a code interpreter for executing Python code.
|
|
701
719
|
* - 'none': Code interpreter is disabled (default).
|
|
702
|
-
* - 'llm':
|
|
703
|
-
*
|
|
704
|
-
* Note: Only supported by OpenAI, Anthropic and Gemini models. Ignored for other providers.
|
|
720
|
+
* - 'llm': The model runs Python in Squid's sandbox through a tool call. Requires a model that supports tool calling.
|
|
705
721
|
*/
|
|
706
722
|
useCodeInterpreter?: 'none' | 'llm';
|
|
707
723
|
/**
|
|
708
724
|
* File IDs to include in the chat context.
|
|
709
725
|
* These are IDs returned from the AI provider's Files API after uploading files.
|
|
710
|
-
* Files are attached to the conversation and can be read/analyzed by the AI.
|
|
726
|
+
* Files are attached to the conversation and can be read/analyzed by the AI. With `useCodeInterpreter: 'llm'`,
|
|
727
|
+
* the files are given to the code interpreter instead.
|
|
711
728
|
*/
|
|
712
729
|
fileIds?: string[];
|
|
713
730
|
/**
|
|
@@ -863,6 +880,19 @@ export interface AiChatRequestCredentials {
|
|
|
863
880
|
*/
|
|
864
881
|
integrationAccessTokens?: Record<IntegrationId, string>;
|
|
865
882
|
}
|
|
883
|
+
/**
|
|
884
|
+
* The session (`squid.sessions()`) a chat request runs in. It is part of the request only: never stored with the agent.
|
|
885
|
+
* @category AI
|
|
886
|
+
*/
|
|
887
|
+
export interface AiChatRequestSession {
|
|
888
|
+
/**
|
|
889
|
+
* Every AI function the request calls gets the session as `context.session`. With the app API key, the request
|
|
890
|
+
* creates the session or updates the one with the same id. Without it, a new id creates the session with its data
|
|
891
|
+
* and a live one is attached as it is; the agent's `@secureAiAgent` rules see both and can refuse them. A call that
|
|
892
|
+
* skips the rules, to a public agent or with the agent's API key, cannot attach one.
|
|
893
|
+
*/
|
|
894
|
+
session?: UpsertSessionRequest;
|
|
895
|
+
}
|
|
866
896
|
/**
|
|
867
897
|
* Configuration for exposing an AI agent as an MCP server at `/mcp/<agentId>`.
|
|
868
898
|
* @category AI
|
|
@@ -1144,11 +1174,12 @@ export interface UpsertContextStatusSuccess extends BaseUpsertContextStatus {
|
|
|
1144
1174
|
}
|
|
1145
1175
|
/**
|
|
1146
1176
|
* Names an upsert failure; `DUPLICATE_CONTENT` identifies existing content when contextId is omitted.
|
|
1147
|
-
* `CONTENT_IN_FLIGHT`, `
|
|
1148
|
-
* `SOURCE_UNREACHABLE` may succeed on retry. Document faults carry `retryable: false`
|
|
1177
|
+
* `CONTENT_IN_FLIGHT`, `EMBEDDED_CHILDREN_NOT_RECONCILED`, `EMBEDDING_FAILED`, `EXTRACTION_TIMED_OUT`,
|
|
1178
|
+
* `PROVIDER_ACCESS_DENIED`, and `SOURCE_UNREACHABLE` may succeed on retry. Document faults carry `retryable: false`
|
|
1179
|
+
* because the same bytes fail again.
|
|
1149
1180
|
* @category AI
|
|
1150
1181
|
*/
|
|
1151
|
-
export type UpsertContextErrorCode = 'CONTENT_IN_FLIGHT' | 'CONTENT_TOO_LARGE' | 'DUPLICATE_CONTENT' | 'EMBEDDING_FAILED' | 'ENCRYPTED_DOCUMENT' | 'EXTRACTION_TIMED_OUT' | 'IMAGE_OVER_PROVIDER_LIMIT' | 'NO_EMBEDDABLE_CONTENT' | 'PROVIDER_ACCESS_DENIED' | 'SOURCE_OVER_PROVIDER_LIMIT' | 'SOURCE_UNREACHABLE' | 'UNREADABLE_DOCUMENT' | 'UNREADABLE_WORKBOOK' | 'UNSUPPORTED_FILE_TYPE';
|
|
1182
|
+
export type UpsertContextErrorCode = 'CONTENT_IN_FLIGHT' | 'CONTENT_TOO_LARGE' | 'DUPLICATE_CONTENT' | 'EMBEDDED_CHILDREN_NOT_RECONCILED' | 'EMBEDDING_FAILED' | 'ENCRYPTED_DOCUMENT' | 'EXTRACTION_TIMED_OUT' | 'IMAGE_OVER_PROVIDER_LIMIT' | 'NO_EMBEDDABLE_CONTENT' | 'PROVIDER_ACCESS_DENIED' | 'SOURCE_OVER_PROVIDER_LIMIT' | 'SOURCE_UNREACHABLE' | 'UNREADABLE_DOCUMENT' | 'UNREADABLE_WORKBOOK' | 'UNSUPPORTED_FILE_TYPE';
|
|
1152
1183
|
/**
|
|
1153
1184
|
* The existing context a `DUPLICATE_CONTENT` rejection points at — where the byte-identical original
|
|
1154
1185
|
* already lives.
|
|
@@ -1279,6 +1310,14 @@ export type BaseAiContextOptions = {
|
|
|
1279
1310
|
ragType?: AiRagType;
|
|
1280
1311
|
/** Amount of chunk overlap, in characters. */
|
|
1281
1312
|
chunkOverlap?: number;
|
|
1313
|
+
/**
|
|
1314
|
+
* Contextual RAG only. On a re-upsert, a chunk whose text is unchanged keeps its stored blurb and
|
|
1315
|
+
* embedding, and only chunks with new text are sent to the LLM; with GraphRAG it also keeps its graph
|
|
1316
|
+
* entities and is not extracted again. A chunk that carries an image is always written anew. A reused blurb
|
|
1317
|
+
* was written against the previous version of the document; set false when an edit can change the meaning
|
|
1318
|
+
* of text elsewhere in it. Defaults to true.
|
|
1319
|
+
*/
|
|
1320
|
+
reuseChunkContext?: boolean;
|
|
1282
1321
|
};
|
|
1283
1322
|
/**
|
|
1284
1323
|
* @category AI
|
|
@@ -1331,8 +1370,9 @@ export type AiPiiOptions = {
|
|
|
1331
1370
|
/** App-specific PII in plain language, e.g. `'internal case numbers like CASE-12345'`. */
|
|
1332
1371
|
customRules?: Array<string>;
|
|
1333
1372
|
/**
|
|
1334
|
-
* Model performing the screening. Defaults to {@link DEFAULT_PII_CLASSIFIER_MODEL}
|
|
1335
|
-
* bounded at a minute, so an override has
|
|
1373
|
+
* Model performing the screening. Defaults to {@link DEFAULT_PII_CLASSIFIER_MODEL}, or the app's best
|
|
1374
|
+
* available model when that one is unavailable. Each attempt is bounded at a minute, so an override has
|
|
1375
|
+
* to answer within it.
|
|
1336
1376
|
*/
|
|
1337
1377
|
classifierModel?: AiChatModelSelection;
|
|
1338
1378
|
/** Literal values that never count as PII, e.g. a shared support address. */
|
|
@@ -38,8 +38,8 @@ export type AiFileProviderType = (typeof AI_FILE_PROVIDER_TYPES)[number];
|
|
|
38
38
|
*/
|
|
39
39
|
export declare function isFileCapableProviderType(type: AiProviderType): type is AiFileProviderType;
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
41
|
+
* Providers with a vendor-hosted code interpreter; unused by Squid.
|
|
42
|
+
* @deprecated The code interpreter runs in Squid's sandbox and works with any model that supports tool calling.
|
|
43
43
|
*/
|
|
44
44
|
export declare const AI_CODE_INTERPRETER_PROVIDER_TYPES: readonly ["openai", "anthropic", "gemini"];
|
|
45
45
|
/**
|
|
@@ -51,7 +51,7 @@ export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-5.6-sol", "gpt-5.6-
|
|
|
51
51
|
* Public Gemini chat model names (active models only).
|
|
52
52
|
* @category AI
|
|
53
53
|
*/
|
|
54
|
-
export declare const GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-
|
|
54
|
+
export declare const GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-4-argon", "gemini-3.8-flash", "gemini-3.5-flash-lite"];
|
|
55
55
|
/**
|
|
56
56
|
* Public Grok chat model names (active models only).
|
|
57
57
|
* @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-
|
|
64
|
+
export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-fable-5", "claude-fable-5-1", "claude-haiku-5-5", "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-luna", "gpt-6.1-sol", "claude-fable-5", "claude-fable-5-1", "claude-haiku-
|
|
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-5-5", "claude-opus-5-5", "claude-sonnet-5-5", "gemini-4-argon", "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
|
/**
|
|
@@ -220,6 +220,13 @@ export interface AiKnowledgeBaseGraphConfig {
|
|
|
220
220
|
extractionModel?: AiChatModelSelection;
|
|
221
221
|
/** Optional domain taxonomy hint (entity types) injected into the extraction prompt. */
|
|
222
222
|
entityTypes?: string[];
|
|
223
|
+
/**
|
|
224
|
+
* How hard per-chunk extraction works. `'thorough'` allows about 40 entities per chunk instead of 15 and runs
|
|
225
|
+
* at high reasoning effort on OpenAI extraction models: more entities and relationships, a bigger graph (a
|
|
226
|
+
* listing yields ~40 entities per chunk) and about 1.5x the extraction cost. Like `extractionModel`, a change
|
|
227
|
+
* reaches already-indexed content on the next `full` rebuild. Defaults to `'standard'`.
|
|
228
|
+
*/
|
|
229
|
+
extractionDepth?: 'standard' | 'thorough';
|
|
223
230
|
/**
|
|
224
231
|
* Quiet window (milliseconds) after the last graph activity before the sweep auto-builds the
|
|
225
232
|
* structure. Must be a positive integer, and is floored at 3 seconds — a shorter window is not
|
|
@@ -528,6 +535,11 @@ export interface AiKnowledgeBaseContext {
|
|
|
528
535
|
* carry none; their reupsert takes the defaults.
|
|
529
536
|
*/
|
|
530
537
|
requestConfig?: AiKnowledgeBaseContextRequestConfig;
|
|
538
|
+
/**
|
|
539
|
+
* Set on an attachment of a OneNote section or email that the knowledge base indexed as its own context: the
|
|
540
|
+
* id of that container. Such contexts are managed with their container and left out of context listings.
|
|
541
|
+
*/
|
|
542
|
+
parentContextId?: string;
|
|
531
543
|
}
|
|
532
544
|
/**
|
|
533
545
|
* The ingestion request's options only. Everything else a reupsert needs lives on the context itself —
|
|
@@ -692,6 +704,12 @@ export declare const BULK_INGESTION_MAX_MULTIPART_FILE_BYTES: number;
|
|
|
692
704
|
* @category AI
|
|
693
705
|
*/
|
|
694
706
|
export declare const MAX_UPLOAD_FILE_BYTES: number;
|
|
707
|
+
/**
|
|
708
|
+
* Largest OneNote section (`.one`) a knowledge base ingests, on either lane. A section carries its attachments,
|
|
709
|
+
* each indexed as a context of its own, so it may exceed {@link MAX_UPLOAD_FILE_BYTES}.
|
|
710
|
+
* @category AI
|
|
711
|
+
*/
|
|
712
|
+
export declare const MAX_ONENOTE_SECTION_BYTES: number;
|
|
695
713
|
/**
|
|
696
714
|
* @category AI
|
|
697
715
|
*/
|
|
@@ -709,6 +727,14 @@ export type BaseAiKnowledgeBaseContextOptions = {
|
|
|
709
727
|
ragType?: AiRagType;
|
|
710
728
|
/** Amount of chunk overlap, in characters. */
|
|
711
729
|
chunkOverlap?: number;
|
|
730
|
+
/**
|
|
731
|
+
* Contextual RAG only. On a re-upsert, a chunk whose text is unchanged keeps its stored blurb and
|
|
732
|
+
* embedding, and only chunks with new text are sent to the LLM; with GraphRAG it also keeps its graph
|
|
733
|
+
* entities and is not extracted again. A chunk that carries an image is always written anew. A reused blurb
|
|
734
|
+
* was written against the previous version of the document; set false when an edit can change the meaning
|
|
735
|
+
* of text elsewhere in it. Defaults to true.
|
|
736
|
+
*/
|
|
737
|
+
reuseChunkContext?: boolean;
|
|
712
738
|
};
|
|
713
739
|
/**
|
|
714
740
|
* Specific options for the AI knowledgebase search method.
|
|
@@ -795,9 +821,10 @@ export interface UpsertKnowledgeBaseContextResponse {
|
|
|
795
821
|
/** List of the upsert status of each item sent in the request. */
|
|
796
822
|
failure?: UpsertContextStatusError;
|
|
797
823
|
/**
|
|
798
|
-
* Set when the context was stored (and is fully searchable via vector/keyword) but NOT graph-indexed
|
|
799
|
-
*
|
|
800
|
-
*
|
|
824
|
+
* Set when the context was stored (and is fully searchable via vector/keyword) but NOT graph-indexed by
|
|
825
|
+
* this upsert: the knowledge base is over its per-KB graph chunk cap, or its stale graph data could not be
|
|
826
|
+
* pruned, which a later graph rebuild repairs. Only GraphRAG coverage is absent; the singular counterpart
|
|
827
|
+
* of {@link UpsertKnowledgeBaseContextsResponse.graphIndexingSkippedContextIds}.
|
|
801
828
|
*/
|
|
802
829
|
graphIndexingSkipped?: boolean;
|
|
803
830
|
/**
|
|
@@ -838,9 +865,10 @@ export interface UpsertKnowledgeBaseContextsResponse {
|
|
|
838
865
|
*/
|
|
839
866
|
contextIds?: Array<AiContextId>;
|
|
840
867
|
/**
|
|
841
|
-
* Contexts that were stored (and are fully searchable via vector/keyword) but NOT graph-indexed
|
|
842
|
-
* the knowledge base is over its per-KB graph chunk cap
|
|
843
|
-
*
|
|
868
|
+
* Contexts that were stored (and are fully searchable via vector/keyword) but NOT graph-indexed by this
|
|
869
|
+
* upsert: the knowledge base is over its per-KB graph chunk cap, or their stale graph data could not be
|
|
870
|
+
* pruned, which a later graph rebuild repairs. Only GraphRAG coverage is absent; surfaced so a caller can
|
|
871
|
+
* report the graph-coverage gap. Absent/empty when nothing was skipped or graph is disabled.
|
|
844
872
|
*/
|
|
845
873
|
graphIndexingSkippedContextIds?: Array<AiContextId>;
|
|
846
874
|
/**
|
|
@@ -1549,8 +1577,8 @@ export interface KnowledgeBaseGraphFacetValueStatus {
|
|
|
1549
1577
|
* documents into topics/facets.
|
|
1550
1578
|
* - `'full'` — wipes the graph and re-extracts entities/relationships from every chunk with an LLM,
|
|
1551
1579
|
* then rebuilds the concept layer. The expensive deep-clean: re-extraction dominates its cost.
|
|
1552
|
-
* Only needed when the extraction itself must be redone, e.g. after changing `entityTypes
|
|
1553
|
-
* `extractionModel`.
|
|
1580
|
+
* Only needed when the extraction itself must be redone, e.g. after changing `entityTypes`,
|
|
1581
|
+
* `extractionModel` or `extractionDepth`.
|
|
1554
1582
|
* @category AI
|
|
1555
1583
|
*/
|
|
1556
1584
|
export type KnowledgeBaseGraphRebuildMode = 'full' | 'structural';
|
|
@@ -2072,7 +2100,8 @@ export interface BulkIngestionJobStatusCounts {
|
|
|
2072
2100
|
/**
|
|
2073
2101
|
* Machine-readable class of a bulk-ingestion file failure, for outcomes to treat differently from real
|
|
2074
2102
|
* failures. Terminal — reported with `retryable: false` — are `'CONTENT_TOO_LARGE'` (past the per-context
|
|
2075
|
-
* ceiling), `'ENCRYPTED_DOCUMENT'`, `'
|
|
2103
|
+
* ceiling), `'ENCRYPTED_DOCUMENT'`, `'EXTRACTION_ABANDONED'` (each worker that took the file up died before
|
|
2104
|
+
* finishing it), `'IMAGE_OVER_PROVIDER_LIMIT'` (the OCR provider refuses an image in the
|
|
2076
2105
|
* document as too large, even with the pages that draw it redrawn smaller), `'NO_EMBEDDABLE_CONTENT'`,
|
|
2077
2106
|
* `'SOURCE_OVER_PROVIDER_LIMIT'` (the bytes exceed what the extraction provider accepts),
|
|
2078
2107
|
* `'UNREADABLE_DOCUMENT'` (a PDF or Office file whose bytes cannot be opened as one), `'UNREADABLE_WORKBOOK'`
|
|
@@ -2086,7 +2115,7 @@ export interface BulkIngestionJobStatusCounts {
|
|
|
2086
2115
|
* alone exceeds the ceiling fails this way in every job.
|
|
2087
2116
|
* @category AI
|
|
2088
2117
|
*/
|
|
2089
|
-
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';
|
|
2118
|
+
export type BulkIngestionFileErrorCode = 'CONTENT_TOO_LARGE' | 'DUPLICATE_CONTENT' | 'ENCRYPTED_DOCUMENT' | 'EXTRACTION_ABANDONED' | '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';
|
|
2090
2119
|
/**
|
|
2091
2120
|
* Per-file/per-context status within a bulk-ingestion job, so a caller can see which file finished,
|
|
2092
2121
|
* which is still processing, and why a file failed.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AllAiAgentChatOptions } from './ai-agent.public-types';
|
|
2
2
|
import type { AiAgentId, IntegrationId } from './communication.public-types';
|
|
3
|
+
import type { UpsertSessionRequest } from './session.public-types';
|
|
3
4
|
/**
|
|
4
5
|
* Providers that put a Squid agent on a phone call. `twilio` relays the call to Squid over a WebSocket
|
|
5
6
|
* Squid serves; `openai` is an OpenAI Realtime call Squid answers itself, see
|
|
@@ -48,6 +49,11 @@ export interface CreateAiVoiceSessionRequest {
|
|
|
48
49
|
connectTimeoutSeconds?: number;
|
|
49
50
|
/** Public base URL of the application when it differs from the default, such as a tunnel in local development. */
|
|
50
51
|
relayBaseUrl?: string;
|
|
52
|
+
/**
|
|
53
|
+
* The session (`squid.sessions()`) the call runs in: the AI functions of every turn get it as `context.session`.
|
|
54
|
+
* Attached once, when the call starts.
|
|
55
|
+
*/
|
|
56
|
+
session?: UpsertSessionRequest;
|
|
51
57
|
}
|
|
52
58
|
/**
|
|
53
59
|
* The opened voice session.
|
|
@@ -94,6 +100,11 @@ export interface AnswerOpenAiVoiceCallRequest {
|
|
|
94
100
|
chatOptions?: AllAiAgentChatOptions;
|
|
95
101
|
/** Free-form data echoed on every session event, for the caller's own bookkeeping. */
|
|
96
102
|
metadata?: Record<string, unknown>;
|
|
103
|
+
/**
|
|
104
|
+
* The session (`squid.sessions()`) the call runs in: the AI functions of every turn get it as `context.session`.
|
|
105
|
+
* Attached once, when the call starts.
|
|
106
|
+
*/
|
|
107
|
+
session?: UpsertSessionRequest;
|
|
97
108
|
}
|
|
98
109
|
/**
|
|
99
110
|
* The answered OpenAI call.
|
|
@@ -148,6 +159,11 @@ export interface StartOpenAiWebVoiceCallRequest {
|
|
|
148
159
|
chatOptions?: AllAiAgentChatOptions;
|
|
149
160
|
/** Free-form data echoed on every session event, for the caller's own bookkeeping. */
|
|
150
161
|
metadata?: Record<string, unknown>;
|
|
162
|
+
/**
|
|
163
|
+
* The session (`squid.sessions()`) the call runs in: the AI functions of every turn get it as `context.session`.
|
|
164
|
+
* Attached once, when the call starts.
|
|
165
|
+
*/
|
|
166
|
+
session?: UpsertSessionRequest;
|
|
151
167
|
}
|
|
152
168
|
/**
|
|
153
169
|
* The started browser call.
|
|
@@ -399,7 +399,7 @@ export interface DocumentMetadata {
|
|
|
399
399
|
docModifiedAt?: string;
|
|
400
400
|
/**
|
|
401
401
|
* Source document type: `pdf` | `docx` | `doc` | `pptx` | `ppt` | `xlsx` | `xlsm` | `xls` | `xlsb` |
|
|
402
|
-
* `eml` | `msg` | `csv` | `tsv` | `md` | `html` | `txt`.
|
|
402
|
+
* `eml` | `msg` | `one` | `csv` | `tsv` | `md` | `html` | `txt`.
|
|
403
403
|
*/
|
|
404
404
|
docType?: string;
|
|
405
405
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IntegrationId } from './communication.public-types';
|
|
2
2
|
/** List of all integration types supported by Squid. */
|
|
3
|
-
export declare const INTEGRATION_TYPES: readonly ["active_directory", "ai_agents", "ai_chatbot", "algolia", "alloydb", "api", "auth0", "bedrock", "azure_blob", "azure_cosmosdb", "azure_postgresql", "azure_sql", "bigquery", "bitbucket", "built_in_azure_blob", "built_in_db", "built_in_gcs", "built_in_queue", "built_in_s3", "cassandra", "clickhouse", "cloudsql", "cockroach", "cognito", "connected_knowledgebases", "confluence", "confluent", "datadog", "db2", "descope", "documentdb", "azure-entra-external-id", "azure-entra-id", "dynamodb", "elasticsearch", "firebase_auth", "firestore", "gcs", "generic_site_ingester", "github", "google_calendar", "google_docs", "google_drive", "graphql", "hubspot", "jira", "jira_jsm", "jwt_hmac", "jwt_rsa", "kafka", "keycloak", "linear", "mariadb", "monday", "mongo", "mssql", "databricks", "mysql", "newrelic", "okta", "onedrive", "outlook", "oracledb", "pinecone", "postgres", "redis", "s3", "salesforce", "sap_hana", "sentry", "snowflake", "spanner", "xata", "zendesk", "servicenow_csm", "freshdesk", "mail", "slack", "twilio", "elevenlabs", "openai_voice", "mcp", "a2a", "legend", "teams", "openai_compatible", "openai_compatible_embedding", "sharepoint", "vertex"];
|
|
3
|
+
export declare const INTEGRATION_TYPES: readonly ["active_directory", "ai_agents", "ai_chatbot", "algolia", "alloydb", "api", "auth0", "bedrock", "azure_blob", "azure_cosmosdb", "azure_postgresql", "azure_sql", "bigquery", "bitbucket", "built_in_azure_blob", "built_in_db", "built_in_gcs", "built_in_queue", "built_in_s3", "cassandra", "clickhouse", "cloudsql", "cockroach", "cognito", "connected_knowledgebases", "confluence", "confluent", "datadog", "db2", "descope", "documentdb", "azure-entra-external-id", "azure-entra-id", "dynamodb", "elasticsearch", "firebase_auth", "firestore", "gcs", "generic_site_ingester", "github", "google_calendar", "google_docs", "google_drive", "graphql", "hubspot", "jira", "jira_jsm", "jwt_hmac", "jwt_rsa", "kafka", "keycloak", "linear", "mariadb", "monday", "mongo", "mssql", "databricks", "mysql", "newrelic", "okta", "onedrive", "outlook", "oracledb", "pinecone", "postgres", "redis", "s3", "salesforce", "sap_hana", "sentry", "snowflake", "spanner", "xata", "zendesk", "servicenow_csm", "freshdesk", "mail", "slack", "twilio", "elevenlabs", "openai_voice", "mcp", "a2a", "legend", "teams", "openai_compatible", "openai_compatible_embedding", "bedrock_embedding", "sharepoint", "vertex"];
|
|
4
4
|
/**
|
|
5
5
|
* @category Database
|
|
6
6
|
*/
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An app-scoped record of JSON data under an id the app chooses, which expires. See `squid.sessions()`.
|
|
3
|
+
* @category Sessions
|
|
4
|
+
*/
|
|
5
|
+
export interface Session {
|
|
6
|
+
/** The id of the session. */
|
|
7
|
+
id: string;
|
|
8
|
+
/** The data of the session. */
|
|
9
|
+
data: Record<string, unknown>;
|
|
10
|
+
/** When the session was created. */
|
|
11
|
+
createdAt: Date;
|
|
12
|
+
/** When the session was last written. */
|
|
13
|
+
updatedAt: Date;
|
|
14
|
+
/** When the session expires, or `null` when it never does. */
|
|
15
|
+
expiresAt: Date | null;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* How long a session lives after its last write: a TTL, or `'never'` to keep it until it is deleted.
|
|
19
|
+
* @category Sessions
|
|
20
|
+
*/
|
|
21
|
+
export type SessionExpiration = SessionTtl | 'never';
|
|
22
|
+
/**
|
|
23
|
+
* An expiration a fixed time after the session's last write.
|
|
24
|
+
* @category Sessions
|
|
25
|
+
*/
|
|
26
|
+
export interface SessionTtl {
|
|
27
|
+
/** Milliseconds from the last write to the expiration. At least 1000. */
|
|
28
|
+
ttlMs: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Creates a session, or updates the one with the same id.
|
|
32
|
+
* @category Sessions
|
|
33
|
+
*/
|
|
34
|
+
export interface UpsertSessionRequest {
|
|
35
|
+
/** The id of the session: 1-256 characters, without control characters. */
|
|
36
|
+
id: string;
|
|
37
|
+
/** Top-level keys to set; other keys keep their values. The session's data is at most 64 KB. */
|
|
38
|
+
data?: Record<string, unknown>;
|
|
39
|
+
/** Top-level keys to remove. */
|
|
40
|
+
deleteKeys?: string[];
|
|
41
|
+
/** Replaces the session's expiration. A new session expires one day after its last write. */
|
|
42
|
+
expiration?: SessionExpiration;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A value a session listing matches a data key against.
|
|
46
|
+
* @category Sessions
|
|
47
|
+
*/
|
|
48
|
+
export type SessionFilterValue = string | number | boolean | null;
|
|
49
|
+
/**
|
|
50
|
+
* Filters of a session listing.
|
|
51
|
+
* @category Sessions
|
|
52
|
+
*/
|
|
53
|
+
export interface ListSessionsFilter {
|
|
54
|
+
/** Top-level data keys that must equal the given values. */
|
|
55
|
+
data?: Record<string, SessionFilterValue>;
|
|
56
|
+
/** Only sessions created after this time. */
|
|
57
|
+
createdAfter?: Date;
|
|
58
|
+
/** Only sessions created before this time. */
|
|
59
|
+
createdBefore?: Date;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Asks for a page of sessions, newest first.
|
|
63
|
+
* @category Sessions
|
|
64
|
+
*/
|
|
65
|
+
export interface ListSessionsRequest {
|
|
66
|
+
/** The page size: 100 by default, at most 1000. */
|
|
67
|
+
limit?: number;
|
|
68
|
+
/** The `nextCursor` of the previous page. */
|
|
69
|
+
cursor?: string;
|
|
70
|
+
/** Filters of the listing. */
|
|
71
|
+
where?: ListSessionsFilter;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A page of sessions.
|
|
75
|
+
* @category Sessions
|
|
76
|
+
*/
|
|
77
|
+
export interface ListSessionsResponse {
|
|
78
|
+
/** The sessions of the page, newest first. */
|
|
79
|
+
sessions: Session[];
|
|
80
|
+
/** Pass it as `cursor` to get the next page. Absent on the last page. */
|
|
81
|
+
nextCursor?: string;
|
|
82
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squidcloud/twilio-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.505",
|
|
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.505"
|
|
21
21
|
},
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=20.0.0"
|