@squidcloud/client 1.0.497 → 1.0.498
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +37 -2
- package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +2 -2
- package/dist/internal-common/src/public-types/ai-knowledge-base.public-types.d.ts +177 -17
- package/dist/internal-common/src/public-types/langgraph.public-types.d.ts +10 -0
- package/dist/typescript-client/src/agent/ai-agent-client-reference.d.ts +4 -4
- package/dist/typescript-client/src/agent/ai-agent-client.types.d.ts +11 -3
- package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client-reference.d.ts +15 -1
- package/dist/typescript-client/src/langgraph-client.d.ts +7 -13
- package/dist/typescript-client/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/dist/internal-common/src/ai/system-openai-compatible.d.ts +0 -35
- package/dist/internal-common/src/metric-name.d.ts +0 -14
- package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +0 -30
- package/dist/internal-common/src/public-types-backend/mutation.public-context.d.ts +0 -161
- package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +0 -75
- package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +0 -193
- package/dist/internal-common/src/types/ai-agent.types.d.ts +0 -302
- package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +0 -618
- package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +0 -19
- package/dist/internal-common/src/types/backend-function.types.d.ts +0 -1
- package/dist/internal-common/src/types/communication.types.d.ts +0 -1
- package/dist/internal-common/src/types/document.types.d.ts +0 -1
- package/dist/internal-common/src/types/file.types.d.ts +0 -6
- package/dist/internal-common/src/types/headers.types.d.ts +0 -58
- package/dist/internal-common/src/types/management-api-key.types.d.ts +0 -92
- package/dist/internal-common/src/types/mutation.types.d.ts +0 -1
- package/dist/internal-common/src/types/notification.types.d.ts +0 -19
- package/dist/internal-common/src/types/observability.types.d.ts +0 -243
- package/dist/internal-common/src/types/query.types.d.ts +0 -21
- package/dist/internal-common/src/types/secret.types.d.ts +0 -7
- package/dist/internal-common/src/types/socket.types.d.ts +0 -1
- package/dist/internal-common/src/types/stage.d.ts +0 -9
- package/dist/internal-common/src/types/time-units.d.ts +0 -1
- package/dist/internal-common/src/types/url-shortener.types.d.ts +0 -45
- package/dist/internal-common/src/utils/array.d.ts +0 -7
- package/dist/internal-common/src/utils/e2e-test-utils.d.ts +0 -2
- package/dist/internal-common/src/utils/file-utils.d.ts +0 -2
- package/dist/internal-common/src/utils/global.utils.d.ts +0 -1
- package/dist/internal-common/src/utils/http-utils.d.ts +0 -15
- package/dist/internal-common/src/utils/http.d.ts +0 -4
- package/dist/internal-common/src/utils/integration-access-tokens.d.ts +0 -15
- package/dist/internal-common/src/utils/lock.manager.d.ts +0 -14
- package/dist/internal-common/src/utils/metric-utils.d.ts +0 -4
- package/dist/internal-common/src/utils/metrics.types.d.ts +0 -7
- package/dist/internal-common/src/utils/object.d.ts +0 -88
- package/dist/internal-common/src/utils/serialization.d.ts +0 -30
- package/dist/internal-common/src/utils/squid.constants.d.ts +0 -6
- package/dist/internal-common/src/utils/trace-id-generator.d.ts +0 -1
- package/dist/internal-common/src/utils/validation.d.ts +0 -21
- package/dist/internal-common/src/websocket.impl.d.ts +0 -26
|
@@ -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,39 @@ 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` 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` 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
|
+
* How an `ask` request whose `model` was an {@link AiModelRoutingOptions} was routed.
|
|
442
|
+
* @category AI
|
|
443
|
+
*/
|
|
444
|
+
export interface AiModelRoutingResult {
|
|
445
|
+
/** The model the routing model chose and the request was sent to. A `backupModel` may still have served it. */
|
|
446
|
+
model: VendorAiChatModelName;
|
|
447
|
+
/** The model that made the choice. */
|
|
448
|
+
routingModel: VendorAiChatModelName;
|
|
449
|
+
/** Input tokens the routing call consumed. */
|
|
450
|
+
inputTokens: number;
|
|
451
|
+
/** Output tokens the routing call generated. */
|
|
452
|
+
outputTokens: number;
|
|
453
|
+
/** Best-effort USD cost of the routing call; undefined when the routing model is unpriced. */
|
|
454
|
+
costUsd?: number;
|
|
455
|
+
}
|
|
423
456
|
/**
|
|
424
457
|
* A backup model together with the sampling settings to run it with. Use this form instead of a
|
|
425
458
|
* bare {@link AiChatModelSelection} when the backup needs settings of its own; anything left unset
|
|
@@ -1244,7 +1277,7 @@ export type AiPiiEntityType = 'email' | 'phoneNumber' | 'creditCard' | 'ssn' | '
|
|
|
1244
1277
|
/** Entity kinds screened when {@link AiPiiOptions.entities} is omitted. */
|
|
1245
1278
|
export declare const DEFAULT_PII_ENTITY_TYPES: ReadonlyArray<AiPiiEntityType>;
|
|
1246
1279
|
/** Model that screens prompts unless overridden. Small and fast: it runs on every prompt. */
|
|
1247
|
-
export declare const DEFAULT_PII_CLASSIFIER_MODEL = "gpt-
|
|
1280
|
+
export declare const DEFAULT_PII_CLASSIFIER_MODEL = "gpt-6-luna";
|
|
1248
1281
|
/**
|
|
1249
1282
|
* Rejects a prompt before it reaches the agent's model when it carries PII, so the prompt is never
|
|
1250
1283
|
* sent to the model provider, never answered, and never written to chat memory.
|
|
@@ -1401,6 +1434,8 @@ export interface AiAskResponse {
|
|
|
1401
1434
|
responseString: string;
|
|
1402
1435
|
/** Optional annotations (e.g., file references) in the response */
|
|
1403
1436
|
annotations?: Record<string, AiAnnotation>;
|
|
1437
|
+
/** Set when `model` was an {@link AiModelRoutingOptions}: which model answered and what routing cost. */
|
|
1438
|
+
routing?: AiModelRoutingResult;
|
|
1404
1439
|
}
|
|
1405
1440
|
/**
|
|
1406
1441
|
* 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
|
|
@@ -66,7 +66,7 @@ export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-fable-5", "cl
|
|
|
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", "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,23 @@ 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, so re-submit it in a fresh job; a file that alone exceeds the ceiling fails this way in every job.
|
|
1981
|
+
* @category AI
|
|
1982
|
+
*/
|
|
1983
|
+
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
1984
|
/**
|
|
1900
1985
|
* Per-file/per-context status within a bulk-ingestion job, so a caller can see which file finished,
|
|
1901
1986
|
* which is still processing, and why a file failed.
|
|
@@ -1912,21 +1997,9 @@ export interface BulkIngestionFileStatus {
|
|
|
1912
1997
|
errorMessage?: string;
|
|
1913
1998
|
/**
|
|
1914
1999
|
* 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';
|
|
2000
|
+
* Additive; absent for ordinary failures. See {@link BulkIngestionFileErrorCode}.
|
|
2001
|
+
*/
|
|
2002
|
+
errorCode?: BulkIngestionFileErrorCode;
|
|
1930
2003
|
/**
|
|
1931
2004
|
* Present only on a failed file an extraction provider answered: a stable fingerprint of that answer
|
|
1932
2005
|
* (provider, HTTP status and provider code), so a caller can tell the same failure repeating from a new one.
|
|
@@ -1963,6 +2036,91 @@ export interface BulkIngestionFileStatus {
|
|
|
1963
2036
|
* @category AI
|
|
1964
2037
|
*/
|
|
1965
2038
|
export type BulkIngestionGraphSkipReason = 'cap' | 'queue';
|
|
2039
|
+
/**
|
|
2040
|
+
* The durable ingestion status of a single file/text context, tracked independently of any one
|
|
2041
|
+
* bulk-ingestion job so it survives job purge. `'no_record'` means the knowledge base has never seen
|
|
2042
|
+
* this path — never persisted, only synthesized when a status query finds nothing. `'in_progress'`
|
|
2043
|
+
* covers every non-terminal bulk-ingestion stage (staged through embedding); the ledger only records
|
|
2044
|
+
* terminal outcomes, so finer sub-stages are not distinguished. `'completed'` and `'failed'` are terminal.
|
|
2045
|
+
* @category AI
|
|
2046
|
+
*/
|
|
2047
|
+
export type AiKnowledgeBaseFileStatus = 'no_record' | 'in_progress' | 'completed' | 'failed';
|
|
2048
|
+
/**
|
|
2049
|
+
* The durable ingestion status of one file/text context at a path, returned by
|
|
2050
|
+
* {@link AiKnowledgeBaseReference.getFileStatus} and as one entry of
|
|
2051
|
+
* {@link AiKnowledgeBaseFolderStatusResponse.files}.
|
|
2052
|
+
* @category AI
|
|
2053
|
+
*/
|
|
2054
|
+
export interface AiKnowledgeBaseFileStatusInfo {
|
|
2055
|
+
/** The context id, absent only when `status` is `'no_record'`. */
|
|
2056
|
+
contextId?: AiContextId;
|
|
2057
|
+
/** The file's path: `folderPath/filename`, or just `filename` at the upload root. */
|
|
2058
|
+
path: string;
|
|
2059
|
+
/** The file's current durable status. */
|
|
2060
|
+
status: AiKnowledgeBaseFileStatus;
|
|
2061
|
+
/** Present only when `status` is `'failed'`: the terminal failure reason. */
|
|
2062
|
+
errorMessage?: string;
|
|
2063
|
+
/**
|
|
2064
|
+
* Present only when `status` is `'failed'`: the machine-readable failure class, when known. A bulk
|
|
2065
|
+
* lane failure reports {@link BulkIngestionFileErrorCode}; a synchronous `upsertContexts` failure
|
|
2066
|
+
* reports {@link UpsertContextErrorCode} — the two lanes use distinct, mostly-overlapping codes.
|
|
2067
|
+
*/
|
|
2068
|
+
errorCode?: BulkIngestionFileErrorCode | UpsertContextErrorCode;
|
|
2069
|
+
/** When this status was last recorded; absent when `status` is `'no_record'`. */
|
|
2070
|
+
updatedAt?: Date;
|
|
2071
|
+
}
|
|
2072
|
+
/**
|
|
2073
|
+
* Request to look up the durable ingestion status of a single file/text context by path.
|
|
2074
|
+
* @category AI
|
|
2075
|
+
*/
|
|
2076
|
+
export interface GetKnowledgeBaseFileStatusRequest {
|
|
2077
|
+
/** The knowledge base to query. */
|
|
2078
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
2079
|
+
/** The file's path: `folderPath/filename`, or just `filename` at the upload root. */
|
|
2080
|
+
path: string;
|
|
2081
|
+
}
|
|
2082
|
+
/**
|
|
2083
|
+
* Request to search and aggregate the durable ingestion status of every file/text context matching
|
|
2084
|
+
* `folderPath`, read three ways and unioned: a folder subtree, a bare filename anywhere in the
|
|
2085
|
+
* knowledge base, and — when it contains a `/` — an exact `folderPath/filename` path.
|
|
2086
|
+
* @category AI
|
|
2087
|
+
*/
|
|
2088
|
+
export interface GetKnowledgeBaseFolderStatusRequest {
|
|
2089
|
+
/** The knowledge base to query. */
|
|
2090
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
2091
|
+
/**
|
|
2092
|
+
* The folder subtree, bare filename, or exact file path to search for. A subtree match uses the same
|
|
2093
|
+
* segment-safe matching as `$underPath` metadata filters; a value containing `/` also matches that
|
|
2094
|
+
* exact file, so pasting a path from an earlier result finds that one file, not a folder of the same name.
|
|
2095
|
+
*/
|
|
2096
|
+
folderPath: string;
|
|
2097
|
+
/**
|
|
2098
|
+
* Maximum number of files to return in `files`, prioritizing failures (the ones needing attention)
|
|
2099
|
+
* before filling remaining room with other statuses. `counts`/`totalFiles` always cover every file
|
|
2100
|
+
* regardless of this cap. Defaults to 50.
|
|
2101
|
+
*/
|
|
2102
|
+
fileLimit?: number;
|
|
2103
|
+
}
|
|
2104
|
+
/**
|
|
2105
|
+
* Aggregate ingestion status for every file/text context matching a searched folder subtree, bare
|
|
2106
|
+
* filename, or exact file path (see {@link GetKnowledgeBaseFolderStatusRequest.folderPath}), combining
|
|
2107
|
+
* a name/path search with per-status counts and the failures that need attention.
|
|
2108
|
+
* @category AI
|
|
2109
|
+
*/
|
|
2110
|
+
export interface AiKnowledgeBaseFolderStatusResponse {
|
|
2111
|
+
/** The folder subtree, filename, or exact path that was searched. */
|
|
2112
|
+
folderPath: string;
|
|
2113
|
+
/** Count of matching files by terminal/in-progress status (excludes `no_record`), uncapped. */
|
|
2114
|
+
counts: Record<Exclude<AiKnowledgeBaseFileStatus, 'no_record'>, number>;
|
|
2115
|
+
/** Total files found, across all statuses in `counts`. */
|
|
2116
|
+
totalFiles: number;
|
|
2117
|
+
/** False when nothing matched — the folder-level `no_record` case. */
|
|
2118
|
+
hasAnyRecords: boolean;
|
|
2119
|
+
/** Files under the folder, capped at `fileLimit` and prioritizing failures. */
|
|
2120
|
+
files: Array<AiKnowledgeBaseFileStatusInfo>;
|
|
2121
|
+
/** True when `files` was capped and more files exist under the folder than are returned. */
|
|
2122
|
+
truncated: boolean;
|
|
2123
|
+
}
|
|
1966
2124
|
/**
|
|
1967
2125
|
* Why a whole bulk-ingestion staging call was refused, on the `details` of its 400 response. The
|
|
1968
2126
|
* refusal names the one context that caused it, so a caller recording per-file outcomes charges only
|
|
@@ -2013,6 +2171,8 @@ export interface BulkIngestionProviderBatchStatus {
|
|
|
2013
2171
|
providerStatus?: string;
|
|
2014
2172
|
/** When a poll first saw {@link providerStatus}. */
|
|
2015
2173
|
providerStatusChangedAt?: Date;
|
|
2174
|
+
/** Why the provider failed the batch as a whole, in its own words; absent on a batch it did not fail. */
|
|
2175
|
+
providerError?: string;
|
|
2016
2176
|
/** When the provider started running the batch; absent while it has not. */
|
|
2017
2177
|
providerInProgressAt?: Date;
|
|
2018
2178
|
/** Per-request progress at the newest poll; absent for a provider that does not report it. */
|
|
@@ -7,6 +7,16 @@ export interface InvokeLangGraphOptions {
|
|
|
7
7
|
threadId?: string;
|
|
8
8
|
/** Initial state for the run. */
|
|
9
9
|
input?: Record<string, unknown>;
|
|
10
|
+
/** How long the run may take, in ms, before it stops and fails. At most, and by default, one hour. */
|
|
11
|
+
timeoutMs?: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Options for resuming an interrupted LangGraph thread.
|
|
15
|
+
* @category AI
|
|
16
|
+
*/
|
|
17
|
+
export interface ResumeLangGraphOptions {
|
|
18
|
+
/** How long the resumed run may take, in ms, before it stops and fails. At most, and by default, one hour. */
|
|
19
|
+
timeoutMs?: number;
|
|
10
20
|
}
|
|
11
21
|
/**
|
|
12
22
|
* Successful result of a LangGraph invocation.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { AiAgent, AiAgentMcpServerConfig, AiChatMessage, AiChatModelSelection, AiConnectedAgentMetadata, AiConnectedIntegrationMetadata, AiConnectedKnowledgeBaseMetadata, AiPiiOptions, AiStatusMessage, AiTranscribeAndAskResponse, AllAiAgentChatOptions, BuildAgentOptions, GenerateAgentMcpDescriptionsResponse, GuardrailsOptions, ListAgentRevisionsResponse, UpsertAgentRequest } from '../../../internal-common/src/public-types/ai-agent.public-types';
|
|
2
|
+
import { AiAgent, AiAgentMcpServerConfig, AiAskModelSelection, AiChatMessage, AiChatModelSelection, AiConnectedAgentMetadata, AiConnectedIntegrationMetadata, AiConnectedKnowledgeBaseMetadata, AiPiiOptions, AiStatusMessage, AiTranscribeAndAskResponse, AllAiAgentChatOptions, BuildAgentOptions, GenerateAgentMcpDescriptionsResponse, GuardrailsOptions, ListAgentRevisionsResponse, UpsertAgentRequest } from '../../../internal-common/src/public-types/ai-agent.public-types';
|
|
3
3
|
import { JobId } from '../../../internal-common/src/public-types/job.public-types';
|
|
4
4
|
import { Paths } from '../../../internal-common/src/public-types/typescript.public-types';
|
|
5
5
|
import { AiAskOptions, AiAskOptionsWithVoice, AiChatOptionsWithoutVoice, AskResponse, AskWithVoiceResponse, TranscribeAndAskWithVoiceResponse, TranscribeAndChatResponse } from './ai-agent-client.types';
|
|
@@ -131,7 +131,7 @@ export declare class AiAgentReference {
|
|
|
131
131
|
* `squid.jobs().getJob(jobId)` to track progress. Make sure each job ID is both unique and kept private—anyone who
|
|
132
132
|
* knows it can look up the job’s status.
|
|
133
133
|
*/
|
|
134
|
-
ask<T extends
|
|
134
|
+
ask<T extends AiAskModelSelection | undefined = undefined>(prompt: string, options?: AiAskOptions<T>, jobId?: JobId): Promise<string>;
|
|
135
135
|
/**
|
|
136
136
|
* Sends a prompt and returns the string response and file annotations.
|
|
137
137
|
* @param prompt The text prompt to send to the agent.
|
|
@@ -140,7 +140,7 @@ export declare class AiAgentReference {
|
|
|
140
140
|
* `squid.jobs().getJob(jobId)` to track progress. Make sure each job ID is both unique and kept private—anyone who
|
|
141
141
|
* knows it can look up the job’s status.
|
|
142
142
|
*/
|
|
143
|
-
askWithAnnotations<T extends
|
|
143
|
+
askWithAnnotations<T extends AiAskModelSelection | undefined = undefined>(prompt: string, options?: AiAskOptions<T>, jobId?: JobId): Promise<AskResponse>;
|
|
144
144
|
/**
|
|
145
145
|
* Sends a prompt and not wait for the result - the result can be tracked using the job ID
|
|
146
146
|
* (`squid.jobs().awaitJob(jobId)` or `squid.jobs().getJob(jobId)).
|
|
@@ -151,7 +151,7 @@ export declare class AiAgentReference {
|
|
|
151
151
|
to track progress. Make sure each job ID is both unique and kept private—anyone who knows it can look up the job’s status.
|
|
152
152
|
* @param options Optional parameters for the AI ask request.
|
|
153
153
|
*/
|
|
154
|
-
askAsync<T extends
|
|
154
|
+
askAsync<T extends AiAskModelSelection | undefined = undefined>(prompt: string, jobId: JobId, options?: AiAskOptions<T>): Promise<void>;
|
|
155
155
|
/**
|
|
156
156
|
* Observes live status messages from the agent.
|
|
157
157
|
* @param jobId The job ID to filter status updates for a specific job. If not provided, all status updates for the agent are observed.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { AiAnnotation, AiChatModelSelection, AiChatOptions, AiChatRequestCredentials } from '../../../internal-common/src/public-types/ai-agent.public-types';
|
|
2
|
+
import { AiAnnotation, AiAskModelSelection, AiChatModelSelection, AiChatOptions, AiChatRequestCredentials, AiModelRoutingResult } from '../../../internal-common/src/public-types/ai-agent.public-types';
|
|
3
3
|
/**
|
|
4
4
|
* Response format for transcribing audio and generating a chat response.
|
|
5
5
|
* Contains the transcribed text and a stream of AI-generated responses.
|
|
@@ -33,6 +33,8 @@ export interface AskResponse {
|
|
|
33
33
|
responseString: string;
|
|
34
34
|
/** Optional annotations that provide additional context or metadata about the response. */
|
|
35
35
|
annotations?: Record<string, AiAnnotation>;
|
|
36
|
+
/** Set when `model` was an {@link AiModelRoutingOptions}: which model answered and what the routing call cost. */
|
|
37
|
+
routing?: AiModelRoutingResult;
|
|
36
38
|
}
|
|
37
39
|
/**
|
|
38
40
|
* Response format for AI-generated voice responses.
|
|
@@ -56,13 +58,19 @@ export type AiChatOptionsWithoutVoice<T extends AiChatModelSelection | undefined
|
|
|
56
58
|
* Options for AI-generated responses that exclude voice-specific settings and smooth typing behavior.
|
|
57
59
|
* @category AI
|
|
58
60
|
*/
|
|
59
|
-
export type AiAskOptions<T extends
|
|
61
|
+
export type AiAskOptions<T extends AiAskModelSelection | undefined = undefined> = Omit<AiChatOptions<ConcreteModelOf<T>>, 'voiceOptions' | 'smoothTyping' | 'model'> & {
|
|
60
62
|
model?: T;
|
|
61
63
|
} & AiChatRequestCredentials;
|
|
62
64
|
/**
|
|
63
65
|
* Options for AI-generated responses that include voice-specific settings but excludes smooth typing.
|
|
64
66
|
* @category AI
|
|
65
67
|
*/
|
|
66
|
-
export type AiAskOptionsWithVoice<T extends
|
|
68
|
+
export type AiAskOptionsWithVoice<T extends AiAskModelSelection | undefined = undefined> = Omit<AiChatOptions<ConcreteModelOf<T>>, 'smoothTyping' | 'model'> & {
|
|
67
69
|
model?: T;
|
|
68
70
|
} & AiChatRequestCredentials;
|
|
71
|
+
/**
|
|
72
|
+
* The concrete model an ask's model selection names, which picks the provider-specific option set;
|
|
73
|
+
* a routing choice names none, so it gets the provider-agnostic options.
|
|
74
|
+
* @category AI
|
|
75
|
+
*/
|
|
76
|
+
export type ConcreteModelOf<T extends AiAskModelSelection | undefined> = T extends AiChatModelSelection ? T : undefined;
|
package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client-reference.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { AiEmbeddingsModelWithOptionalFields, AiKnowledgeBase, AiKnowledgeBaseChatOptions, AiKnowledgeBaseContext, AiKnowledgeBaseContextRequest, AiKnowledgeBaseContextWithReasoning, AiKnowledgeBaseDownloadContextResponse, AiKnowledgeBaseSearchContextsWithContextIdRequest, AiKnowledgeBaseSearchContextsWithPromptRequest, AiKnowledgeBaseSearchResponse, AiKnowledgeBaseSearchResultChunk, BulkIngestionContext, BulkIngestionCreateUploadUrlsResponse, BulkIngestionJobStatusResponse, BulkIngestionUpsertContextsOptions, BulkIngestionUpsertContextsResponse, ExploreKnowledgeBaseGraphRequest, ExploreKnowledgeBaseGraphResponse, GenerateMetadataFieldDescriptionsRequest, GenerateMetadataFieldDescriptionsResponse, GetKnowledgeBaseGraphStatusResponse, GrepKnowledgeBaseOptions, GrepKnowledgeBaseResponse, ListAiKnowledgeBaseContextsPageResponse, ListKnowledgeBaseContextsOptions, QueryKnowledgeBaseGraphRequest, QueryKnowledgeBaseGraphResponse, RebuildKnowledgeBaseGraphRequest, UpsertKnowledgeBaseContextResponse, UpsertKnowledgeBaseContextsResponse } from '../../../internal-common/src/public-types/ai-knowledge-base.public-types';
|
|
2
|
+
import { AiEmbeddingsModelWithOptionalFields, AiKnowledgeBase, AiKnowledgeBaseChatOptions, AiKnowledgeBaseContext, AiKnowledgeBaseContextRequest, AiKnowledgeBaseContextWithReasoning, AiKnowledgeBaseDownloadContextResponse, AiKnowledgeBaseFileStatusInfo, AiKnowledgeBaseFolderStatusResponse, AiKnowledgeBaseSearchContextsWithContextIdRequest, AiKnowledgeBaseSearchContextsWithPromptRequest, AiKnowledgeBaseSearchResponse, AiKnowledgeBaseSearchResultChunk, BulkIngestionContext, BulkIngestionCreateUploadUrlsResponse, BulkIngestionJobStatusResponse, BulkIngestionUpsertContextsOptions, BulkIngestionUpsertContextsResponse, ExploreKnowledgeBaseGraphRequest, ExploreKnowledgeBaseGraphResponse, GenerateMetadataFieldDescriptionsRequest, GenerateMetadataFieldDescriptionsResponse, GetKnowledgeBaseGraphStatusResponse, GrepKnowledgeBaseOptions, GrepKnowledgeBaseResponse, ListAiKnowledgeBaseContextsPageResponse, ListKnowledgeBaseContextsOptions, QueryKnowledgeBaseGraphRequest, QueryKnowledgeBaseGraphResponse, RebuildKnowledgeBaseGraphRequest, UpsertKnowledgeBaseContextResponse, UpsertKnowledgeBaseContextsResponse } from '../../../internal-common/src/public-types/ai-knowledge-base.public-types';
|
|
3
3
|
import { AiContextId } from '../../../internal-common/src/public-types/communication.public-types';
|
|
4
4
|
/**
|
|
5
5
|
* Parameters for creating or updating an AI agent.
|
|
@@ -207,6 +207,20 @@ export declare class AiKnowledgeBaseReference {
|
|
|
207
207
|
* recent rebuild job, and the graph's LLM token/cost usage (`ingestUsage`, `lastRebuildUsage`).
|
|
208
208
|
*/
|
|
209
209
|
getGraphStatus(): Promise<GetKnowledgeBaseGraphStatusResponse>;
|
|
210
|
+
/**
|
|
211
|
+
* Looks up the durable ingestion status of one file by path (`folderPath/filename`, or just
|
|
212
|
+
* `filename` at the upload root): `'completed'`, `'failed'` (with `errorMessage`/`errorCode`),
|
|
213
|
+
* `'in_progress'`, or `'no_record'` when the knowledge base has no trace of that path.
|
|
214
|
+
*/
|
|
215
|
+
getFileStatus(path: string): Promise<AiKnowledgeBaseFileStatusInfo>;
|
|
216
|
+
/**
|
|
217
|
+
* Searches and aggregates the durable ingestion status of every file matching `folderPath`, read
|
|
218
|
+
* three ways and unioned: a folder subtree (matched the same segment-safe way as `$underPath`
|
|
219
|
+
* metadata filters), a bare filename anywhere in the knowledge base, and — when it contains a `/` —
|
|
220
|
+
* an exact `folderPath/filename` path. Returns per-status counts plus the files themselves (failures
|
|
221
|
+
* prioritized, capped at `fileLimit`, default 50).
|
|
222
|
+
*/
|
|
223
|
+
getFolderStatus(folderPath: string, fileLimit?: number): Promise<AiKnowledgeBaseFolderStatusResponse>;
|
|
210
224
|
/**
|
|
211
225
|
* Enqueues a graph rebuild/backfill. The default `'structural'` mode keeps the already-extracted
|
|
212
226
|
* entity graph (extracting only contexts never graph-indexed) and rebuilds just the concept layer
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JobId } from '../../internal-common/src/public-types/job.public-types';
|
|
2
|
-
import { GetLangGraphStateSuccessResult, InvokeLangGraphOptions, InvokeLangGraphSuccessResult } from '../../internal-common/src/public-types/langgraph.public-types';
|
|
2
|
+
import { GetLangGraphStateSuccessResult, InvokeLangGraphOptions, InvokeLangGraphSuccessResult, ResumeLangGraphOptions } from '../../internal-common/src/public-types/langgraph.public-types';
|
|
3
3
|
/**
|
|
4
4
|
* Reference to a specific LangGraph.
|
|
5
5
|
* @category AI
|
|
@@ -13,9 +13,7 @@ export declare class LangGraphReference {
|
|
|
13
13
|
*
|
|
14
14
|
* For very long graphs where you don't want to hold a Promise, use `invokeAsync()` instead.
|
|
15
15
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* @param options Initial state and optional thread to run against.
|
|
16
|
+
* @param options Initial state, optional thread to run against and optional timeout of the run.
|
|
19
17
|
*/
|
|
20
18
|
invoke(options?: InvokeLangGraphOptions): Promise<InvokeLangGraphSuccessResult>;
|
|
21
19
|
/**
|
|
@@ -24,31 +22,27 @@ export declare class LangGraphReference {
|
|
|
24
22
|
*
|
|
25
23
|
* Use this for graphs that may run longer than is comfortable to hold a Promise for.
|
|
26
24
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* @param options Initial state and optional thread to run against.
|
|
25
|
+
* @param options Initial state, optional thread to run against and optional timeout of the run.
|
|
30
26
|
*/
|
|
31
27
|
invokeAsync(options?: InvokeLangGraphOptions): Promise<JobId>;
|
|
32
28
|
/**
|
|
33
29
|
* Resumes an interrupted LangGraph thread and waits for the result.
|
|
34
30
|
* The thread must currently be in `interrupted` status.
|
|
35
31
|
*
|
|
36
|
-
* Note: graph execution caps at the tenant IPC timeout (currently 4 minutes).
|
|
37
|
-
*
|
|
38
32
|
* @param threadId The thread to resume.
|
|
39
33
|
* @param resumePayload Value passed to the `interrupt()` call inside the graph.
|
|
34
|
+
* @param options Optional timeout of the resumed run.
|
|
40
35
|
*/
|
|
41
|
-
resume(threadId: string, resumePayload: unknown): Promise<InvokeLangGraphSuccessResult>;
|
|
36
|
+
resume(threadId: string, resumePayload: unknown, options?: ResumeLangGraphOptions): Promise<InvokeLangGraphSuccessResult>;
|
|
42
37
|
/**
|
|
43
38
|
* Resumes an interrupted LangGraph thread without waiting for the result.
|
|
44
39
|
* Returns a jobId — pass it to `squid.job().awaitJob(jobId)` or `getJob(jobId)` to retrieve the result later.
|
|
45
40
|
*
|
|
46
|
-
* Note: graph execution caps at the tenant IPC timeout (currently 4 minutes)
|
|
47
|
-
*
|
|
48
41
|
* @param threadId The thread to resume.
|
|
49
42
|
* @param resumePayload Value passed to the `interrupt()` call inside the graph.
|
|
43
|
+
* @param options Optional timeout of the resumed run.
|
|
50
44
|
*/
|
|
51
|
-
resumeAsync(threadId: string, resumePayload: unknown): Promise<JobId>;
|
|
45
|
+
resumeAsync(threadId: string, resumePayload: unknown, options?: ResumeLangGraphOptions): Promise<JobId>;
|
|
52
46
|
/** Returns the current state of a LangGraph thread. */
|
|
53
47
|
getState(threadId: string): Promise<GetLangGraphStateSuccessResult>;
|
|
54
48
|
/**
|
package/package.json
CHANGED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* System-level OpenAI-compatible backends ("slots") for Squid's own internal AI calls.
|
|
3
|
-
*
|
|
4
|
-
* Generic plumbing for pointing an internal model at ANY OpenAI-compatible HTTP endpoint —
|
|
5
|
-
* primarily Squid's own self-hosted models, but any OpenAI-compatible backend works. The
|
|
6
|
-
* non-secret part of a slot (base URL, optional headers/extra body) is hardcoded here on purpose
|
|
7
|
-
* (changing a backend is a reviewed code change); only the API key lives in Vault under
|
|
8
|
-
* `SystemSecrets['openai-compatible'][slotName].apiKey`.
|
|
9
|
-
*
|
|
10
|
-
* NOT the customer-facing `openai_compatible` Integration (per-app, console-configured). Models
|
|
11
|
-
* served through these slots are declared in `AI_CHAT_MODEL_REGISTRY` with
|
|
12
|
-
* `providerType: 'openai-compatible'` + `openAiCompatibleSlot`, and resolve only with
|
|
13
|
-
* `keyType: 'system'` (see `AiProviderFactory.getChatProviderForModel`) — never customer-reachable.
|
|
14
|
-
*
|
|
15
|
-
* No slots are defined yet (foundation only). To wire one up:
|
|
16
|
-
* 1. add a slot below, e.g. `'my-model': { baseUrl: 'https://llm.internal.squid/v1' }`;
|
|
17
|
-
* 2. seed its key in `SystemSecrets['openai-compatible']['my-model'].apiKey`;
|
|
18
|
-
* 3. add a model entry in ai-model.registry.ts pointing `openAiCompatibleSlot: 'my-model'`.
|
|
19
|
-
*/
|
|
20
|
-
/** Non-secret configuration of one system OpenAI-compatible backend. */
|
|
21
|
-
export interface SystemOpenAiCompatibleSlotConfig {
|
|
22
|
-
/** Base URL of the OpenAI-compatible API, e.g. a self-hosted 'https://llm.internal.squid/v1'. */
|
|
23
|
-
baseUrl: string;
|
|
24
|
-
/** Extra HTTP headers sent with every request. */
|
|
25
|
-
headers?: Record<string, string>;
|
|
26
|
-
/** Extra JSON body fields merged into every request — reserved wire fields are dropped by the provider. */
|
|
27
|
-
extraBody?: Record<string, unknown>;
|
|
28
|
-
}
|
|
29
|
-
/** Name of a system OpenAI-compatible slot (a key of `SYSTEM_OPENAI_COMPATIBLE_SLOTS`). */
|
|
30
|
-
export type SystemOpenAiCompatibleSlotName = string;
|
|
31
|
-
/**
|
|
32
|
-
* Registered system OpenAI-compatible slots, keyed by name. Empty by design — add a self-hosted
|
|
33
|
-
* (or any other) OpenAI-compatible backend here; see the module doc above.
|
|
34
|
-
*/
|
|
35
|
-
export declare const SYSTEM_OPENAI_COMPATIBLE_SLOTS: Record<SystemOpenAiCompatibleSlotName, SystemOpenAiCompatibleSlotConfig>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Names of the Squid metrics.
|
|
3
|
-
*
|
|
4
|
-
* This list and its Kotlin counterpart (MetricName.kt) may diverge:
|
|
5
|
-
* each side declares only the metrics that its own backend emits.
|
|
6
|
-
* However, metrics emitted by both backends MUST use identical names on both sides —
|
|
7
|
-
* otherwise dashboards and metric queries that mix data from both sources will break.
|
|
8
|
-
*
|
|
9
|
-
* See MetricName.kt for documentation on each value.
|
|
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_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
|
-
export type MetricName = (typeof ALL_SQUID_METRIC_NAMES)[number];
|
|
13
|
-
/** Common prefix for all Squid metrics. */
|
|
14
|
-
export declare const SQUID_METRIC_NAME_PREFIX = "squid_";
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ApiOptions } from '../public-types/api-client.public-types';
|
|
2
|
-
import { ApiEndpointId, HttpMethod } from '../public-types/api.public-types';
|
|
3
|
-
import { IntegrationId } from '../public-types/communication.public-types';
|
|
4
|
-
/** The headers of an API call. */
|
|
5
|
-
export type ApiHeaders = Record<string, string | number | boolean>;
|
|
6
|
-
/** The context of an API call. */
|
|
7
|
-
export declare class ApiCallContext {
|
|
8
|
-
readonly integrationId: IntegrationId;
|
|
9
|
-
readonly endpointId: ApiEndpointId;
|
|
10
|
-
readonly url: string;
|
|
11
|
-
readonly method: HttpMethod;
|
|
12
|
-
readonly body: unknown;
|
|
13
|
-
readonly options: ApiOptions;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Represents a request to call an API through a specified integration and endpoint.
|
|
17
|
-
* Includes optional method override and additional request options.
|
|
18
|
-
*/
|
|
19
|
-
export interface CallApiRequest<BodyType = any> {
|
|
20
|
-
/** The identifier of the integration through which the API is called. */
|
|
21
|
-
integrationId: IntegrationId;
|
|
22
|
-
/** Target API endpoint to invoke. */
|
|
23
|
-
endpointId: ApiEndpointId;
|
|
24
|
-
/** Optional request payload. */
|
|
25
|
-
body?: BodyType;
|
|
26
|
-
/** Optional HTTP method override. Default is POST. */
|
|
27
|
-
overrideMethod?: HttpMethod;
|
|
28
|
-
/** Additional request options. */
|
|
29
|
-
options: ApiOptions;
|
|
30
|
-
}
|