@squidcloud/client 1.0.496 → 1.0.497

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.
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * See MetricName.kt for documentation on each value.
10
10
  */
11
- export declare const ALL_SQUID_METRIC_NAMES: readonly ["squid_functionExecution_count", "squid_functionExecution_time", "squid_aiChatbotContext_size", "squid_aiChatbotChatInputTokens_count", "squid_aiChatbotChatOutputTokens_count", "squid_aiChatbotChatReasoningTokens_count", "squid_aiChatbotChatCacheReadInputTokens_count", "squid_aiChatbotChatCacheWriteInputTokens_count", "squid_aiChatbotChatCostUsd_count", "squid_aiChatbotChatOutcome_count", "squid_aiSpendInputTokens_count", "squid_aiSpendOutputTokens_count", "squid_aiSpendReasoningTokens_count", "squid_aiSpendCacheReadTokens_count", "squid_aiSpendCacheWriteTokens_count", "squid_aiSpendPages_count", "squid_aiSpendImages_count", "squid_aiSpendAudioSeconds_count", "squid_aiSpendCharacters_count", "squid_aiSpendSearches_count", "squid_aiSpendCostUsd_count", "squid_aiImageGeneration_count", "squid_aiImageGeneration_time", "squid_aiRemoveBackground_count", "squid_aiRemoveBackground_time", "squid_aiAudioTranscribe_count", "squid_aiAudioTranscribe_time", "squid_aiAudioCreateSpeech_count", "squid_aiAudioCreateSpeech_time", "squid_aiVoiceCreateSession_count", "squid_aiVoiceCreateSession_time", "squid_aiVoiceAnswerOpenAiCall_count", "squid_aiVoiceAnswerOpenAiCall_time", "squid_aiVoiceStartOpenAiWebCall_count", "squid_aiVoiceStartOpenAiWebCall_time", "squid_aiOpenAiChatCompletions_count", "squid_aiOpenAiChatCompletions_time", "squid_aiIntegrationData_count", "squid_aiIntegrationData_time", "squid_aiIntegrationApi_count", "squid_aiIntegrationApi_time", "squid_apiControllerCall_count", "squid_apiControllerCall_time", "squid_aiContextUpsert_count", "squid_aiContextDelete_count", "squid_codeInitialization_count", "squid_codeInitialization_time", "squid_sourceCodeAnalysis_count", "squid_sourceCodeAnalysis_time", "squid_sourceCodeWorkspaceBytes_value", "squid_sourceCodeInputTokens_count", "squid_sourceCodeOutputTokens_count", "squid_deleteApiKey_count", "squid_deleteApiKey_time", "squid_deleteSecret_count", "squid_deleteSecret_time", "squid_discoverGraphQLConnectionSchema_count", "squid_discoverGraphQLConnectionSchema_time", "squid_discoverOpenApiSchema_count", "squid_discoverOpenApiSchema_time", "squid_discoverOpenApiSchemaFromFile_count", "squid_discoverOpenApiSchemaFromFile_time", "squid_executeBackendFunction_count", "squid_executeBackendFunction_time", "squid_apiControllerCall_count", "squid_apiControllerCall_time", "squid_getAiChatbotProfiles_count", "squid_getAiChatbotProfiles_time", "squid_getAllApiKeys_count", "squid_getAllApiKeys_time", "squid_getAllSecrets_count", "squid_getAllSecrets_time", "squid_getAppApiKey_count", "squid_getAppApiKey_time", "squid_getSecret_count", "squid_getSecret_time", "squid_graphql_count", "squid_graphql_time", "squid_graphqlQuery_count", "squid_graphqlQuery_time", "squid_integrationCount_value", "squid_mutate_count", "squid_mutate_time", "squid_metricQuery_count", "squid_metricQuery_time", "squid_metricReport_count", "squid_metricReport_time", "squid_nativeQuery_count", "squid_nativeQuery_time", "squid_openapi_count", "squid_openapi_time", "squid_produceTopicMessage_count", "squid_produceTopicMessage_time", "squid_query_count", "squid_query_time", "squid_queueMessageHandler_count", "squid_queueMessageHandler_time", "squid_registerQuery_count", "squid_registerQuery_time", "squid_rerankChunks_count", "squid_rerankChunks_time", "squid_schedulerJob_count", "squid_schedulerJob_time", "squid_eventHandler_count", "squid_eventHandler_time", "squid_schema_size", "squid_secrets_entries", "squid_storageDeleteFiles_count", "squid_storageDeleteFiles_time", "squid_storageGetDownloadUrl_count", "squid_storageGetDownloadUrl_time", "squid_storageGetFileMetadata_count", "squid_storageGetFileMetadata_time", "squid_storageListDirectoryContents_count", "squid_storageListDirectoryContents_time", "squid_storageUploadFile_count", "squid_storageUploadFile_time", "squid_subscribeToTopic_count", "squid_subscribeToTopic_time", "squid_testGraphQLConnection_count", "squid_testGraphQLConnection_time", "squid_testAgentProtocolConnection_count", "squid_testAgentProtocolConnection_time", "squid_trigger_count", "squid_trigger_time", "squid_upsertApiKey_count", "squid_upsertApiKey_time", "squid_upsertSecret_count", "squid_upsertSecret_time", "squid_vectorChunks_count", "squid_vectorChunks_time", "squid_webhook_count", "squid_webhook_time", "squid_acquireLock_count", "squid_acquireLock_time", "squid_releaseLock_count", "squid_releaseLock_time"];
11
+ export declare const ALL_SQUID_METRIC_NAMES: readonly ["squid_functionExecution_count", "squid_functionExecution_time", "squid_aiChatbotContext_size", "squid_aiChatbotChatInputTokens_count", "squid_aiChatbotChatOutputTokens_count", "squid_aiChatbotChatReasoningTokens_count", "squid_aiChatbotChatCacheReadInputTokens_count", "squid_aiChatbotChatCacheWriteInputTokens_count", "squid_aiChatbotChatCostUsd_count", "squid_aiChatbotChatOutcome_count", "squid_aiSpendInputTokens_count", "squid_aiSpendOutputTokens_count", "squid_aiSpendReasoningTokens_count", "squid_aiSpendCacheReadTokens_count", "squid_aiSpendCacheWriteTokens_count", "squid_aiSpendPages_count", "squid_aiSpendImages_count", "squid_aiSpendAudioSeconds_count", "squid_aiSpendCharacters_count", "squid_aiSpendSearches_count", "squid_aiSpendCostUsd_count", "squid_aiImageGeneration_count", "squid_aiImageGeneration_time", "squid_aiRemoveBackground_count", "squid_aiRemoveBackground_time", "squid_aiAudioTranscribe_count", "squid_aiAudioTranscribe_time", "squid_aiAudioCreateSpeech_count", "squid_aiAudioCreateSpeech_time", "squid_aiVoiceCreateSession_count", "squid_aiVoiceCreateSession_time", "squid_aiVoiceAnswerOpenAiCall_count", "squid_aiVoiceAnswerOpenAiCall_time", "squid_aiVoiceStartOpenAiWebCall_count", "squid_aiVoiceStartOpenAiWebCall_time", "squid_aiOpenAiChatCompletions_count", "squid_aiOpenAiChatCompletions_time", "squid_aiIntegrationData_count", "squid_aiIntegrationData_time", "squid_aiIntegrationApi_count", "squid_aiIntegrationApi_time", "squid_apiControllerCall_count", "squid_apiControllerCall_time", "squid_aiContextUpsert_count", "squid_aiContextDelete_count", "squid_codeInitialization_count", "squid_codeInitialization_time", "squid_sourceCodeAnalysis_count", "squid_sourceCodeAnalysis_time", "squid_sourceCodeWorkspaceBytes_value", "squid_sourceCodeInputTokens_count", "squid_sourceCodeOutputTokens_count", "squid_deleteApiKey_count", "squid_deleteApiKey_time", "squid_deleteSecret_count", "squid_deleteSecret_time", "squid_discoverGraphQLConnectionSchema_count", "squid_discoverGraphQLConnectionSchema_time", "squid_discoverOpenApiSchema_count", "squid_discoverOpenApiSchema_time", "squid_discoverOpenApiSchemaFromFile_count", "squid_discoverOpenApiSchemaFromFile_time", "squid_executeBackendFunction_count", "squid_executeBackendFunction_time", "squid_apiControllerCall_count", "squid_apiControllerCall_time", "squid_getAiChatbotProfiles_count", "squid_getAiChatbotProfiles_time", "squid_getAllApiKeys_count", "squid_getAllApiKeys_time", "squid_getAllSecrets_count", "squid_getAllSecrets_time", "squid_getAppApiKey_count", "squid_getAppApiKey_time", "squid_getSecret_count", "squid_getSecret_time", "squid_graphql_count", "squid_graphql_time", "squid_graphqlQuery_count", "squid_graphqlQuery_time", "squid_integrationCount_value", "squid_mutate_count", "squid_mutate_time", "squid_metricQuery_count", "squid_metricQuery_time", "squid_metricReport_count", "squid_metricReport_time", "squid_nativeQuery_count", "squid_nativeQuery_time", "squid_openapi_count", "squid_openapi_time", "squid_produceTopicMessage_count", "squid_produceTopicMessage_time", "squid_query_count", "squid_query_time", "squid_queueMessageHandler_count", "squid_queueMessageHandler_time", "squid_registerQuery_count", "squid_registerQuery_time", "squid_rerankChunks_count", "squid_rerankChunks_time", "squid_schedulerJob_count", "squid_schedulerJob_time", "squid_eventHandler_count", "squid_eventHandler_time", "squid_schema_size", "squid_secrets_entries", "squid_storageDeleteFiles_count", "squid_storageDeleteFiles_time", "squid_storageGetDownloadUrl_count", "squid_storageGetDownloadUrl_time", "squid_storageGetFileMetadata_count", "squid_storageGetFileMetadata_time", "squid_storageListDirectoryContents_count", "squid_storageListDirectoryContents_time", "squid_storageUploadFile_count", "squid_storageUploadFile_time", "squid_subscribeToTopic_count", "squid_subscribeToTopic_time", "squid_tenantDependencyResolved_count", "squid_tenantBrowserSpawnAttempt_count", "squid_testGraphQLConnection_count", "squid_testGraphQLConnection_time", "squid_testAgentProtocolConnection_count", "squid_testAgentProtocolConnection_time", "squid_trigger_count", "squid_trigger_time", "squid_upsertApiKey_count", "squid_upsertApiKey_time", "squid_upsertSecret_count", "squid_upsertSecret_time", "squid_vectorChunks_count", "squid_vectorChunks_time", "squid_webhook_count", "squid_webhook_time", "squid_acquireLock_count", "squid_acquireLock_time", "squid_releaseLock_count", "squid_releaseLock_time"];
12
12
  export type MetricName = (typeof ALL_SQUID_METRIC_NAMES)[number];
13
13
  /** Common prefix for all Squid metrics. */
14
14
  export declare const SQUID_METRIC_NAME_PREFIX = "squid_";
@@ -505,7 +505,11 @@ export interface BaseAiChatOptions {
505
505
  responseFormat?: AiAgentResponseFormat;
506
506
  /** Whether to response in a "smooth typing" way, beneficial when the chat result is displayed in a UI. Default to true. */
507
507
  smoothTyping?: boolean;
508
- /** Global context passed to the agent and all AI functions of the agent. */
508
+ /**
509
+ * Global context passed to the agent and all AI functions of the agent. A request's value also reaches the AI
510
+ * functions of its connected agents, merged over each one's stored `agentContext`. Its keys are caller input and
511
+ * win over stored ones: only the root agent's `@secureAiAgent` rules can vet them, and none run for a public agent.
512
+ */
509
513
  agentContext?: Record<string, unknown>;
510
514
  /**
511
515
  * Functions to expose to the AI.
@@ -1079,7 +1083,7 @@ export interface UpsertContextStatusSuccess extends BaseUpsertContextStatus {
1079
1083
  * succeed on retry. Document faults carry `retryable: false` because the same bytes fail again.
1080
1084
  * @category AI
1081
1085
  */
1082
- export type UpsertContextErrorCode = 'CONTENT_TOO_LARGE' | 'DUPLICATE_CONTENT' | 'EMBEDDING_FAILED' | 'ENCRYPTED_DOCUMENT' | 'EXTRACTION_TIMED_OUT' | 'NO_EMBEDDABLE_CONTENT' | 'PROVIDER_ACCESS_DENIED' | 'SOURCE_OVER_PROVIDER_LIMIT' | 'SOURCE_UNREACHABLE' | 'UNREADABLE_WORKBOOK' | 'UNSUPPORTED_FILE_TYPE';
1086
+ export type UpsertContextErrorCode = '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';
1083
1087
  /**
1084
1088
  * The existing context a `DUPLICATE_CONTENT` rejection points at — where the byte-identical original
1085
1089
  * already lives.
@@ -37,11 +37,16 @@ export type AiFileProviderType = (typeof AI_FILE_PROVIDER_TYPES)[number];
37
37
  * for them the ids are inert rather than wrong.
38
38
  */
39
39
  export declare function isFileCapableProviderType(type: AiProviderType): type is AiFileProviderType;
40
+ /**
41
+ * The AI providers whose chat provider implements the code interpreter. Declared like
42
+ * {@link AI_FILE_PROVIDER_TYPES}, so a provider that gains the interpreter is added here and nowhere else.
43
+ */
44
+ export declare const AI_CODE_INTERPRETER_PROVIDER_TYPES: readonly ["openai", "anthropic", "gemini"];
40
45
  /**
41
46
  * Public OpenAI chat model names (active models only).
42
47
  * @category AI
43
48
  */
44
- export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-6-astra"];
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-sol", "gpt-6-luna"];
45
50
  /**
46
51
  * Public Gemini chat model names (active models only).
47
52
  * @category AI
@@ -56,12 +61,12 @@ export declare const GROK_CHAT_MODEL_NAMES: readonly ["grok-4.6", "grok-4-1-fast
56
61
  * Public Anthropic chat model names (active models only).
57
62
  * @category AI
58
63
  */
59
- export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-fable-5", "claude-fable-5-1", "claude-haiku-4-5-20251001", "claude-opus-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"];
60
65
  /**
61
66
  * The supported AI model names.
62
67
  * @category AI
63
68
  */
64
- export declare const VENDOR_AI_CHAT_MODEL_NAMES: readonly ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-6-astra", "claude-fable-5", "claude-fable-5-1", "claude-haiku-4-5-20251001", "claude-opus-5", "claude-sonnet-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"];
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-sol", "gpt-6-luna", "claude-fable-5", "claude-fable-5-1", "claude-haiku-4-5-20251001", "claude-opus-5-5", "claude-sonnet-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"];
65
70
  /** Checks if the given model name is a global AI chat model name. */
66
71
  export declare function isVendorAiChatModelName(modelName: unknown): modelName is VendorAiChatModelName;
67
72
  /**
@@ -1,8 +1,11 @@
1
+ import { JSONSchema } from 'json-schema-typed';
1
2
  import { AiFileUrl } from './ai-agent.public-types';
2
3
  import { ServiceFunctionName } from './backend.public-types';
3
4
  import { IntegrationType } from './integration.public-types';
4
5
  /** Represents the possible data types for an AI function parameter. */
5
- export type AiFunctionParamType = 'string' | 'number' | 'boolean' | 'date' | 'files';
6
+ export type AiFunctionParamType = 'string' | 'number' | 'boolean' | 'date' | 'files' | 'object';
7
+ /** JSON Schema (draft 2020-12) describing the value of an `object` AI function parameter. */
8
+ export type AiFunctionParamSchema = JSONSchema.Interface;
6
9
  /**
7
10
  * How sticky affinity routing must be for a function that keeps state outside the request.
8
11
  * - `pod`: the state is reachable by any worker of the pod (a file on disk, a child process).
@@ -23,6 +26,13 @@ export interface AiFunctionParam {
23
26
  required: boolean;
24
27
  /** List of possible values for the parameter, if applicable. */
25
28
  enum?: Array<Omit<AiFunctionParamType, 'date'>>;
29
+ /**
30
+ * The JSON Schema of the value; required when `type` is `'object'` and rejected otherwise. Its root must be
31
+ * `{ type: 'object' }`, and an object that lists `properties` accepts no other property unless it sets
32
+ * `additionalProperties`. Squid validates every call against it, so the function only receives a value that
33
+ * satisfies it.
34
+ */
35
+ schema?: AiFunctionParamSchema;
26
36
  /**
27
37
  * Marks this parameter as the affinity key of the function and states how sticky the routing must
28
38
  * be: every call carrying the same value is routed to the same tenant pod (and, for `worker`, the
@@ -228,12 +228,24 @@ export interface AiKnowledgeBaseGraphConfig {
228
228
  */
229
229
  autoBuildDebounceMs?: number;
230
230
  /**
231
- * When true, the sweep does not start automatic structural builds for this KB: activity keeps arming
232
- * the build, and the first quiet window after the flag is cleared runs it. Meant for an ingestion
233
- * campaign whose builds an operator wants to schedule by hand; `rebuildGraph` stays available.
234
- * Defaults to false.
231
+ * When true, the sweep starts no automatic build for this KB, entity resolution included: activity keeps
232
+ * arming the build, and the first quiet window after the flag is cleared runs it. `rebuildGraph` stays
233
+ * available. To hold only the structural build, use `structuralBuildSchedule`. Defaults to false.
235
234
  */
236
235
  autoBuildPaused?: boolean;
236
+ /**
237
+ * When the sweep may start an automatic structural build: `'debounced'` (one quiet window after activity),
238
+ * `'off'` (manual `rebuildGraph` only) or a 5-field cron expression. Entity resolution keeps running
239
+ * either way. Omitted ⇒ the server's default, `'debounced'` unless the deployment sets one.
240
+ */
241
+ structuralBuildSchedule?: string;
242
+ /** IANA time zone of a cron `structuralBuildSchedule`, e.g. `'America/Los_Angeles'`. Omitted ⇒ the server's default (UTC). */
243
+ structuralBuildTimeZone?: string;
244
+ /**
245
+ * How long after a cron slot its structural build may still start (milliseconds); past it, the build waits for
246
+ * the next slot. Must be a positive integer. Omitted ⇒ the server's default (3 hours).
247
+ */
248
+ structuralBuildCatchUpMs?: number;
237
249
  /** Concept-layer (facet taxonomy) configuration. Omitted ⇒ `facets: 'auto'`. */
238
250
  concepts?: AiKnowledgeBaseGraphConceptsConfig;
239
251
  }
@@ -1901,9 +1913,11 @@ export interface BulkIngestionFileStatus {
1901
1913
  /**
1902
1914
  * Machine-readable class of a failed file, for outcomes to treat differently from real failures.
1903
1915
  * Terminal — reported with `retryable: false` — are `'CONTENT_TOO_LARGE'` (past the per-context
1904
- * ceiling), `'ENCRYPTED_DOCUMENT'`, `'NO_EMBEDDABLE_CONTENT'`, `'SOURCE_OVER_PROVIDER_LIMIT'` (the
1905
- * bytes exceed what the extraction provider accepts), `'UNREADABLE_WORKBOOK'` (a spreadsheet whose
1906
- * content the parser cannot read) and `'UNSUPPORTED_FILE_TYPE'`.
1916
+ * ceiling), `'ENCRYPTED_DOCUMENT'`, `'IMAGE_OVER_PROVIDER_LIMIT'` (the OCR provider refuses an image in the
1917
+ * document as too large, even with the pages that draw it redrawn smaller), `'NO_EMBEDDABLE_CONTENT'`,
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'`.
1907
1921
  * `'DUPLICATE_CONTENT'` is a skip rather than a failure: the KB already holds this content.
1908
1922
  * `'EXTRACTION_TIMED_OUT'` stays retryable — the deadline is contended, so a borderline document can
1909
1923
  * cross it under load. So do `'SOURCE_UNREACHABLE'` (the provider could not fetch the source, which a
@@ -1912,7 +1926,7 @@ export interface BulkIngestionFileStatus {
1912
1926
  * file, so re-submit it in a fresh job; a file that alone exceeds the ceiling fails this way in every job.
1913
1927
  * Additive; absent for ordinary failures.
1914
1928
  */
1915
- errorCode?: 'CONTENT_TOO_LARGE' | 'DUPLICATE_CONTENT' | 'ENCRYPTED_DOCUMENT' | 'EXTRACTION_TIMED_OUT' | 'JOB_FULL' | 'NO_EMBEDDABLE_CONTENT' | 'PROVIDER_ACCESS_DENIED' | 'SOURCE_OVER_PROVIDER_LIMIT' | 'SOURCE_UNREACHABLE' | 'UNREADABLE_WORKBOOK' | 'UNSUPPORTED_FILE_TYPE';
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';
1916
1930
  /**
1917
1931
  * Present only on a failed file an extraction provider answered: a stable fingerprint of that answer
1918
1932
  * (provider, HTTP status and provider code), so a caller can tell the same failure repeating from a new one.
@@ -170,6 +170,23 @@ export declare const O11Y_TAG_AI_BILLING_TIER = "billingTier";
170
170
  * the same app.
171
171
  */
172
172
  export declare const O11Y_TAG_AI_TRAFFIC_KIND = "trafficKind";
173
+ /**
174
+ * Which stage of a multi-stage lane spent the money, and which pass of its loop produced the call.
175
+ * Set by the query lanes, whose stages re-send the results gathered so far: without them one
176
+ * operation's bill cannot be attributed to the stage that carries the tokens. `iteration` is set
177
+ * only by a lane that loops.
178
+ */
179
+ export declare const O11Y_TAG_AI_SPEND_STAGE = "stage";
180
+ export declare const O11Y_TAG_AI_SPEND_ITERATION = "iteration";
181
+ /** The stages one `query_api` run reports under {@link O11Y_TAG_AI_SPEND_STAGE}. */
182
+ export type AiQueryApiSpendStage = 'endpoint_select' | 'body_create' | 'response_analyze' | 'explanation';
183
+ /** The stages one `query_data` run reports under {@link O11Y_TAG_AI_SPEND_STAGE}. */
184
+ export type AiQueryDataSpendStage = 'select_tables' | 'generate_query' | 'regenerate_queries' | 'clarification' | 'validate_queries' | 'interpreter_check' | 'interpreter_run' | 'results_analysis' | 'raw_result_purpose' | 'readonly_check' | 'spreadsheet_action';
185
+ /**
186
+ * Every stage value the ledger accepts. Enumerated rather than left free-form because the report
187
+ * groups by it: a typo would open a second bucket silently instead of failing to compile.
188
+ */
189
+ export type AiSpendStage = AiQueryApiSpendStage | AiQueryDataSpendStage;
173
190
  /**
174
191
  * Whether a billed page reached the document it was extracted for. Page-billed spend only: the
175
192
  * provider charges for a stale attempt too, so the pages are recorded either way and this separates
@@ -1,4 +1,10 @@
1
1
  import { Condition, DocIdCondition, SimpleCondition } from '../public-types/query.public-types';
2
+ /**
3
+ * Whether a LIKE pattern has a backslash before anything but `%`, `_` or another backslash, which is not
4
+ * a valid escape. Executors disagree on what it matches: PostgreSQL reads `\d` as `d`, while Mongo and
5
+ * the local matcher pass it to a regex as a digit.
6
+ */
7
+ export declare function hasInvalidLikeEscape(pattern: string): boolean;
2
8
  /**
3
9
  * Generates the regex pattern, handling special characters as follows:
4
10
  * - `_` is replaced with a `.`
@@ -1,3 +1,5 @@
1
+ /** Splits a field path into the segments `getInPath` walks: a dot or a bracket separates them. */
2
+ export declare const SPLIT_REGEX_FOR_GET_IN_PATH: RegExp;
1
3
  /** Returns a value by the `path`. Works with array indexes, like a.b[0]. */
2
4
  export declare function getInPath(obj: unknown, path: string): any;
3
5
  export declare function isDateObject(value: unknown): value is Date;
@@ -81,9 +81,9 @@ export declare class AiKnowledgeBaseReference {
81
81
  */
82
82
  listContextIds(): Promise<Array<AiContextId>>;
83
83
  /**
84
- * Retrieves a specific context by its ID. Pass `truncateTextAfter: 0` to omit the context's `text`
85
- * field from the response when only its metadata (e.g. `contentHash`) is needed — the stored text
86
- * can be multiple MB, and truncating it avoids sending that payload back in full.
84
+ * Retrieves a specific context by its ID. Pass `truncateTextAfter: 0` to return an empty `text`
85
+ * field when only its metadata (e.g. `contentHash`) is needed — the stored text can be multiple
86
+ * MB, and truncating it avoids sending that payload back in full.
87
87
  */
88
88
  getContext(contextId: string, options?: GetContextOptions): Promise<AiKnowledgeBaseContext | undefined>;
89
89
  /**
@@ -2,4 +2,4 @@
2
2
  * The current version of the SquidCloud client package.
3
3
  * @category Platform
4
4
  */
5
- export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.496";
5
+ export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.497";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/client",
3
- "version": "1.0.496",
3
+ "version": "1.0.497",
4
4
  "description": "A typescript implementation of the Squid client",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",