@squidcloud/client 1.0.497 → 1.0.499
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/internal-common/src/metric-name.d.ts +1 -10
- package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +53 -3
- package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +3 -3
- package/dist/internal-common/src/public-types/ai-knowledge-base.public-types.d.ts +178 -17
- package/dist/internal-common/src/public-types/langgraph.public-types.d.ts +17 -0
- package/dist/internal-common/src/types/ai-agent.types.d.ts +4 -3
- package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +24 -3
- package/dist/internal-common/src/types/headers.types.d.ts +0 -13
- package/dist/internal-common/src/types/observability.types.d.ts +55 -2
- package/dist/internal-common/src/utils/object.d.ts +5 -0
- package/dist/internal-common/src/utils/squid.constants.d.ts +1 -4
- package/dist/typescript-client/src/agent/ai-agent-client-reference.d.ts +5 -5
- package/dist/typescript-client/src/agent/ai-agent-client.types.d.ts +12 -4
- 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
|
@@ -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';
|
|
@@ -113,7 +113,7 @@ export declare class AiAgentReference {
|
|
|
113
113
|
* `squid.jobs().getJob(jobId)` to track progress. Make sure each job ID is both unique and kept private—anyone who
|
|
114
114
|
* knows it can look up the job’s status.
|
|
115
115
|
*/
|
|
116
|
-
chat<T extends
|
|
116
|
+
chat<T extends AiAskModelSelection | undefined>(prompt: string, options?: AiChatOptionsWithoutVoice<T>, jobId?: JobId): Observable<string>;
|
|
117
117
|
/**
|
|
118
118
|
* Transcribes the given file and performs a chat interaction.
|
|
119
119
|
* @param fileToTranscribe The audio file to transcribe and send to the agent.
|
|
@@ -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.
|
|
@@ -49,20 +51,26 @@ export interface AskWithVoiceResponse {
|
|
|
49
51
|
* Chat options that exclude voice-specific configurations.
|
|
50
52
|
* @category AI
|
|
51
53
|
*/
|
|
52
|
-
export type AiChatOptionsWithoutVoice<T extends
|
|
54
|
+
export type AiChatOptionsWithoutVoice<T extends AiAskModelSelection | undefined = undefined> = Omit<AiChatOptions<ConcreteModelOf<T>>, 'voiceOptions' | 'model'> & {
|
|
53
55
|
model?: T;
|
|
54
56
|
} & AiChatRequestCredentials;
|
|
55
57
|
/**
|
|
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 a request'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 and context 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 and context 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 and context 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 and context 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
|
/**
|