@squidcloud/twilio-client 1.0.505 → 1.0.507

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.
@@ -422,23 +422,62 @@ export interface IntegrationModelSpec {
422
422
  */
423
423
  export type AiChatModelSelection = AiChatModelName | IntegrationModelSpec;
424
424
  /**
425
- * Lets a routing model pick which of several vendor models answers an `ask` or `chat` request. The routing model
426
- * sees the question, the agent's instructions and a card per candidate (price, tier, reasoning,
427
- * context window) and names the one that should answer; that model then serves the request.
425
+ * How demanding a routing model rated a question: `simple` goes to the first step of the routing ladder, `complex`
426
+ * to the last, `moderate` to the middle one.
427
+ * @category AI
428
+ */
429
+ export type AiModelRoutingLevel = 'simple' | 'moderate' | 'complex';
430
+ /**
431
+ * Lets a routing model pick which model of a ladder answers an `ask` or `chat` request. The routing model rates
432
+ * how demanding the question is, given the agent's instructions, and the ladder step for that rating serves it.
428
433
  * @category AI
429
434
  */
430
435
  export interface AiModelRoutingOptions {
431
- /** The vendor models the routing model chooses from; at least two, no duplicates. */
432
- models: VendorAiChatModelName[];
433
- /** The vendor model that makes the choice. */
436
+ /**
437
+ * The ladder, cheapest first: two or three distinct steps, each a vendor model name or a model with its own effort.
438
+ * Omitted, the platform's fast, medium and capable chat models form the ladder, at low, default and high effort.
439
+ */
440
+ models?: Array<VendorAiChatModelName | AiModelRoutingStep>;
441
+ /** The vendor model that rates the question. */
434
442
  routingModel: VendorAiChatModelName;
435
443
  /**
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").
444
+ * How to rate questions, in plain language: replaces the default rule, which takes the lower of two
445
+ * levels a question sits between. Up to 2000 characters.
446
+ */
447
+ instructions?: string;
448
+ }
449
+ /**
450
+ * One step of a routing ladder. A bare model name in the ladder runs at the request's or agent's effort, else the
451
+ * model's default.
452
+ * @category AI
453
+ */
454
+ export interface AiModelRoutingStep {
455
+ /** The vendor model of the step. */
456
+ model: VendorAiChatModelName;
457
+ /**
458
+ * The effort the step runs at, resolved to a level the model accepts. Overrides the request's and agent's effort.
440
459
  */
460
+ reasoningEffort?: AiReasoningEffort;
461
+ }
462
+ /**
463
+ * Gives the answering model a tool that consults a stronger model mid-turn. The turn stays on its own model, so its
464
+ * prompt cache survives, and the advisor gets only what the answering model passes it.
465
+ * @category AI
466
+ */
467
+ export interface AiAdvisorOptions {
468
+ /** The model that gives the advice. */
469
+ model: AiChatModelSelection;
470
+ /** The effort the advisor runs at. A vendor model runs at the nearest level it accepts. */
471
+ reasoningEffort?: AiReasoningEffort;
472
+ /** Added to the advisor's prompt, to steer what it answers and how. */
441
473
  instructions?: string;
474
+ /** Consultations allowed per turn, 1 to 10. Defaults to 3. */
475
+ maxConsultations?: number;
476
+ /**
477
+ * Lets the advisor call the turn's functions, including ones with side effects, and pays for its tool loop.
478
+ * Defaults to false: the advisor sees only what the answering model passes it.
479
+ */
480
+ shareFunctions?: boolean;
442
481
  }
443
482
  /**
444
483
  * The model of an `ask` or `chat` request: a concrete model, or a set of models a routing model chooses from.
@@ -465,16 +504,18 @@ export type AiChatRequestOptions = Omit<AllAiAgentChatOptions, 'model'> & {
465
504
  * @category AI
466
505
  */
467
506
  export interface AiModelRoutingResult {
468
- /** The model the routing model chose and the request was sent to. A `backupModel` may still have served it. */
469
- model: VendorAiChatModelName;
507
+ /** The ladder model the request was sent to. A `backupModel` may still have served it. */
508
+ model: AiChatModelName;
470
509
  /**
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.
510
+ * The reasoning effort the chosen model ran at, resolved to a level the model accepts: the step's own effort,
511
+ * else the request's or agent's, else the platform ladder step's. Undefined is the model's default.
473
512
  */
474
513
  reasoningEffort?: AiReasoningEffort;
475
- /** The model that made the choice. */
514
+ /** The model that rated the question. */
476
515
  routingModel: VendorAiChatModelName;
477
- /** The routing model's one-line justification of the choice. */
516
+ /** How demanding the routing model rated the question. */
517
+ level: AiModelRoutingLevel;
518
+ /** The routing model's one-line justification of the rating. */
478
519
  reason: string;
479
520
  /** Input tokens the routing call consumed. */
480
521
  inputTokens: number;
@@ -608,6 +649,8 @@ export interface BaseAiChatOptions {
608
649
  contextMetadataFilterForKnowledgeBase?: Record<AiKnowledgeBaseId, AiContextMetadataFilter>;
609
650
  /** The options to use for the response in voice. */
610
651
  voiceOptions?: AiAudioCreateSpeechOptions;
652
+ /** A stronger model the answering model can consult mid-turn. Overrides the stored value. */
653
+ advisor?: AiAdvisorOptions;
611
654
  /** List of connected AI agents can be called by the current agent. Overrides the stored value. */
612
655
  connectedAgents?: Array<AiConnectedAgentMetadata>;
613
656
  /** List of connected AI agents can be called by the current agent. Overrides the stored value. */
@@ -1488,6 +1531,11 @@ export type AiSessionContext = {
1488
1531
  * takes precedence over it.
1489
1532
  */
1490
1533
  timeoutMs?: number;
1534
+ /**
1535
+ * The root request's `metricAnnotations`. Nested AI operations (e.g. AI-query stages spawned by a tool
1536
+ * call) report their model usage under them, so it adds up with the agent's own.
1537
+ */
1538
+ metricAnnotations?: Record<string, string>;
1491
1539
  };
1492
1540
  /**
1493
1541
  * API request to delete an AI agent
@@ -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-luna", "gpt-6.1-sol"];
49
+ export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-5.6-sol", "gpt-5.6-luna", "gpt-6-astra", "gpt-6-luna", "gpt-6.1-sol", "gpt-6.1-terra"];
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-5-5", "claude-opus-5-5", "claude-sonnet-5-5"];
64
+ export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["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-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"];
69
+ export declare const VENDOR_AI_CHAT_MODEL_NAMES: readonly ["gpt-5.6-sol", "gpt-5.6-luna", "gpt-6-astra", "gpt-6-luna", "gpt-6.1-sol", "gpt-6.1-terra", "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
  /**
@@ -357,7 +357,7 @@ export interface AiKnowledgeBaseChatOptions {
357
357
  includeReference?: boolean;
358
358
  /** Include metadata in the context */
359
359
  includeMetadata?: boolean;
360
- /** Which provider's reranker to use for reranking the context. Defaults to 'cohere'. */
360
+ /** Which provider's reranker to use for reranking the context. Defaults to the deployment's default reranker. */
361
361
  rerankProvider?: AiRerankProvider;
362
362
  /**
363
363
  * Minimum reranker relevance score a chunk must reach to stay once at least 10 chunks are already kept.
@@ -682,7 +682,7 @@ export interface AiKnowledgeBaseFileContextRequest extends BaseAiKnowledgeBaseCo
682
682
  * Whether Squid discards the downloadable original once the file is extracted; the extracted text and
683
683
  * images are stored either way. Defaults to false: the original is kept so the user can download it and
684
684
  * Squid can reprocess it. Without it, `querySpreadsheetsWithAi` cannot open a workbook context and a
685
- * reupsert of the context fails, on the sync and the bulk lane alike.
685
+ * reupsert of the context fails, on the sync and the bulk path alike.
686
686
  */
687
687
  discardOriginalFile?: boolean;
688
688
  }
@@ -705,7 +705,7 @@ export declare const BULK_INGESTION_MAX_MULTIPART_FILE_BYTES: number;
705
705
  */
706
706
  export declare const MAX_UPLOAD_FILE_BYTES: number;
707
707
  /**
708
- * Largest OneNote section (`.one`) a knowledge base ingests, on either lane. A section carries its attachments,
708
+ * Largest OneNote section (`.one`) a knowledge base ingests, on either path. A section carries its attachments,
709
709
  * each indexed as a context of its own, so it may exceed {@link MAX_UPLOAD_FILE_BYTES}.
710
710
  * @category AI
711
711
  */
@@ -745,7 +745,7 @@ export interface AiKnowledgeBaseSearchOptions {
745
745
  prompt: string;
746
746
  /** The maximum number of results to return */
747
747
  limit?: number;
748
- /** Which provider's reranker to use for reranking the context. Defaults to 'cohere'. */
748
+ /** Which provider's reranker to use for reranking the context. Defaults to the deployment's default reranker. */
749
749
  rerankProvider?: AiRerankProvider;
750
750
  /**
751
751
  * Minimum reranker relevance score a chunk must reach to stay once at least 10 chunks are already kept.
@@ -1969,8 +1969,8 @@ export interface BulkIngestionContext {
1969
1969
  */
1970
1970
  stagedObjectKey?: string;
1971
1971
  /**
1972
- * The preferred method for extracting data from a file context; mirrors the sync lane's field of the
1973
- * same name, so a caller's choice survives whichever lane a deployment routes the upload through.
1972
+ * The preferred method for extracting data from a file context; mirrors the sync path's field of the
1973
+ * same name, so a caller's choice survives whichever path a deployment routes the upload through.
1974
1974
  */
1975
1975
  preferredExtractionMethod?: DocumentExtractionMethod;
1976
1976
  /**
@@ -2007,7 +2007,7 @@ export interface BulkIngestionContext {
2007
2007
  scopes?: Array<string>;
2008
2008
  }
2009
2009
  /**
2010
- * Request structure for staging contexts through bulk ingestion: a durable, asynchronous lane that
2010
+ * Request structure for staging contexts through bulk ingestion: a durable, asynchronous path that
2011
2011
  * processes contexts through provider batch APIs rather than inline, for high-volume ingestion. Poll
2012
2012
  * {@link BulkIngestionJobStatusResponse} with the returned job id for progress.
2013
2013
  * @category AI
@@ -2063,7 +2063,7 @@ export interface BulkIngestionUpsertContextsResponse {
2063
2063
  * an existing context or accepted earlier in this same call. Absent when nothing was rejected.
2064
2064
  *
2065
2065
  * Same shape and `errorCode: 'DUPLICATE_CONTENT'` the synchronous `upsertContexts` returns, so a caller
2066
- * handles a duplicate identically on both lanes. These contexts are NOT part of the job: they are not
2066
+ * handles a duplicate identically on both paths. These contexts are NOT part of the job: they are not
2067
2067
  * extracted, not staged, and never appear in its per-file statuses.
2068
2068
  *
2069
2069
  * Covers TEXT contexts and MULTIPART file contexts (their bytes are in hand at staging). A file staged
@@ -2197,8 +2197,8 @@ export interface AiKnowledgeBaseFileStatusInfo {
2197
2197
  errorMessage?: string;
2198
2198
  /**
2199
2199
  * Present only when `status` is `'failed'`: the machine-readable failure class, when known. A bulk
2200
- * lane failure reports {@link BulkIngestionFileErrorCode}; a synchronous `upsertContexts` failure
2201
- * reports {@link UpsertContextErrorCode} — the two lanes use distinct, mostly-overlapping codes.
2200
+ * path failure reports {@link BulkIngestionFileErrorCode}; a synchronous `upsertContexts` failure
2201
+ * reports {@link UpsertContextErrorCode} — the two paths use distinct, mostly-overlapping codes.
2202
2202
  */
2203
2203
  errorCode?: BulkIngestionFileErrorCode | UpsertContextErrorCode;
2204
2204
  /** When this status was last recorded; absent when `status` is `'no_record'`. */
@@ -2272,7 +2272,7 @@ export interface BulkIngestionStagingRefusal {
2272
2272
  }
2273
2273
  /**
2274
2274
  * One provider batch created for a bulk-ingestion job, so a caller can tell a job waiting on a
2275
- * submitted provider batch (healthy — the designed cost/latency tradeoff of the batch lane, with
2275
+ * submitted provider batch (healthy — the designed cost/latency tradeoff of the batch route, with
2276
2276
  * turnaround up to 24 hours) from a job that is actually stuck, and see since when.
2277
2277
  * @category AI
2278
2278
  */
@@ -300,7 +300,7 @@ export interface ExtractDataFromDocumentResponse {
300
300
  documentMetadata?: DocumentMetadata;
301
301
  /**
302
302
  * Structural information about the sheets when the document is a parseable spreadsheet
303
- * (best-effort). Presence marks the document for the spreadsheet summary-embedding lane.
303
+ * (best-effort). Presence marks the document for spreadsheet summary ingestion.
304
304
  */
305
305
  spreadsheet?: SpreadsheetDocumentInfo;
306
306
  }
@@ -1,10 +1,10 @@
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", "bedrock_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", "databricks_genie", "mysql", "newrelic", "okta", "onedrive", "outlook", "oracledb", "pinecone", "postgres", "redis", "s3", "salesforce", "salesforce_db", "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
  */
7
- export declare const DATA_INTEGRATION_TYPES: readonly ["bigquery", "built_in_db", "clickhouse", "cockroach", "dynamodb", "mongo", "mssql", "databricks", "mysql", "oracledb", "postgres", "snowflake", "elasticsearch", "legend"];
7
+ export declare const DATA_INTEGRATION_TYPES: readonly ["bigquery", "built_in_db", "clickhouse", "cockroach", "dynamodb", "mongo", "mssql", "databricks", "mysql", "oracledb", "postgres", "snowflake", "elasticsearch", "legend", "salesforce_db"];
8
8
  /**
9
9
  * @category Auth
10
10
  */
@@ -43,6 +43,11 @@ export interface ResolveJobRequest {
43
43
  /** The error message, present when status is 'failed'. */
44
44
  error?: string;
45
45
  }
46
+ /** Represents a request to cancel a running server-executed job. */
47
+ export interface CancelJobRequest {
48
+ /** The unique identifier of the job to cancel. */
49
+ jobId: JobId;
50
+ }
46
51
  /**
47
52
  * Represents a keep-alive request signalling that the client still owns the listed active jobs.
48
53
  */
@@ -72,8 +77,9 @@ export interface AsyncJob<T = any> {
72
77
  * - 'in_progress': The job is currently being processed.
73
78
  * - 'completed': The job has finished successfully.
74
79
  * - 'failed': The job has failed.
80
+ * - 'cancelled': The job was stopped by a cancel request.
75
81
  */
76
- status: 'in_progress' | 'completed' | 'failed';
82
+ status: 'in_progress' | 'completed' | 'failed' | 'cancelled';
77
83
  /**
78
84
  * The result of the job, if available.
79
85
  * This is of type `T` and is optional.
@@ -89,7 +95,14 @@ export interface AsyncJob<T = any> {
89
95
  * failure kind (e.g. `'AI_PROVIDER_ERROR'`) without parsing {@link error}.
90
96
  */
91
97
  errorType?: string;
98
+ /**
99
+ * Whether the job can be stopped with a cancel request. Providers that do not honor the abort
100
+ * signal keep running until their current call ends, so cancellation is not always immediate.
101
+ */
102
+ cancellable?: boolean;
92
103
  }
104
+ /** The {@link JobError.errorType} of an error thrown for a job stopped by a cancel request. */
105
+ export declare const JOB_CANCELLED_ERROR_TYPE = "JOB_CANCELLED";
93
106
  /**
94
107
  * An `Error` carrying a machine-readable {@link errorType}, thrown by `JobClient.awaitJob` when a
95
108
  * failed job's {@link AsyncJob.errorType} is set. Lets a caller branch on the failure kind (e.g.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/twilio-client",
3
- "version": "1.0.505",
3
+ "version": "1.0.507",
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.505"
20
+ "@squidcloud/client": "^1.0.507"
21
21
  },
22
22
  "engines": {
23
23
  "node": ">=20.0.0"