@squidcloud/client 1.0.492 → 1.0.493

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.
Files changed (55) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/esm/index.js +1 -1
  3. package/dist/internal-common/src/ai/system-openai-compatible.d.ts +35 -0
  4. package/dist/internal-common/src/metric-name.d.ts +14 -0
  5. package/dist/internal-common/src/public-types/ai-agent-connection.public-types.d.ts +34 -0
  6. package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +33 -2
  7. package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +29 -0
  8. package/dist/internal-common/src/public-types/ai-knowledge-base.public-types.d.ts +284 -29
  9. package/dist/internal-common/src/public-types/ai-voice.public-types.d.ts +200 -0
  10. package/dist/internal-common/src/public-types/connector.public-types.d.ts +1 -1
  11. package/dist/internal-common/src/public-types/integration.public-types.d.ts +1 -1
  12. package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +30 -0
  13. package/dist/internal-common/src/public-types-backend/mutation.public-context.d.ts +161 -0
  14. package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +75 -0
  15. package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +193 -0
  16. package/dist/internal-common/src/types/ai-agent.types.d.ts +302 -0
  17. package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +514 -0
  18. package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +19 -0
  19. package/dist/internal-common/src/types/backend-function.types.d.ts +1 -0
  20. package/dist/internal-common/src/types/communication.types.d.ts +1 -0
  21. package/dist/internal-common/src/types/document.types.d.ts +1 -0
  22. package/dist/internal-common/src/types/file.types.d.ts +6 -0
  23. package/dist/internal-common/src/types/headers.types.d.ts +52 -0
  24. package/dist/internal-common/src/types/management-api-key.types.d.ts +92 -0
  25. package/dist/internal-common/src/types/mutation.types.d.ts +1 -0
  26. package/dist/internal-common/src/types/notification.types.d.ts +19 -0
  27. package/dist/internal-common/src/types/observability.types.d.ts +223 -0
  28. package/dist/internal-common/src/types/query.types.d.ts +15 -0
  29. package/dist/internal-common/src/types/secret.types.d.ts +7 -0
  30. package/dist/internal-common/src/types/socket.types.d.ts +1 -0
  31. package/dist/internal-common/src/types/stage.d.ts +9 -0
  32. package/dist/internal-common/src/types/time-units.d.ts +1 -0
  33. package/dist/internal-common/src/types/url-shortener.types.d.ts +45 -0
  34. package/dist/internal-common/src/utils/array.d.ts +7 -0
  35. package/dist/internal-common/src/utils/e2e-test-utils.d.ts +2 -0
  36. package/dist/internal-common/src/utils/file-utils.d.ts +2 -0
  37. package/dist/internal-common/src/utils/global.utils.d.ts +1 -0
  38. package/dist/internal-common/src/utils/http.d.ts +24 -0
  39. package/dist/internal-common/src/utils/lock.manager.d.ts +14 -0
  40. package/dist/internal-common/src/utils/metric-utils.d.ts +4 -0
  41. package/dist/internal-common/src/utils/metrics.types.d.ts +7 -0
  42. package/dist/internal-common/src/utils/object.d.ts +86 -0
  43. package/dist/internal-common/src/utils/serialization.d.ts +24 -0
  44. package/dist/internal-common/src/utils/squid.constants.d.ts +6 -0
  45. package/dist/internal-common/src/utils/trace-id-generator.d.ts +1 -0
  46. package/dist/internal-common/src/utils/validation.d.ts +21 -0
  47. package/dist/internal-common/src/websocket.impl.d.ts +26 -0
  48. package/dist/typescript-client/src/ai-client.d.ts +13 -1
  49. package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client-reference.d.ts +4 -2
  50. package/dist/typescript-client/src/ai-voice-client.d.ts +42 -0
  51. package/dist/typescript-client/src/ai-web-voice-call.d.ts +62 -0
  52. package/dist/typescript-client/src/index.d.ts +2 -0
  53. package/dist/typescript-client/src/public-types.d.ts +2 -0
  54. package/dist/typescript-client/src/version.d.ts +1 -1
  55. package/package.json +1 -1
@@ -0,0 +1,193 @@
1
+ import { AiQueryOptions } from '../public-types/ai-query.public-types';
2
+ import { IntegrationId } from '../public-types/communication.public-types';
3
+ import { CollectionName, DocumentData, FieldName } from '../public-types/document.public-types';
4
+ import { FieldSort, Operator, Query, SimpleCondition } from '../public-types/query.public-types';
5
+ import { DeepRecord, FieldOf, PartialBy, Paths } from '../public-types/typescript.public-types';
6
+ /**
7
+ * The information provided to the secureAiQuery function about the AI query being executed.
8
+ * @category AI
9
+ */
10
+ export interface AiQueryContext {
11
+ /** The prompt provided for the AI query. */
12
+ prompt: string;
13
+ /** The options used for executing the AI query. */
14
+ options: AiQueryOptions;
15
+ }
16
+ /**
17
+ * Represents the Squid query context.
18
+ * Passed to methods that require query details, such as those annotated with the `@secureCollection` annotation.
19
+ * @category Database
20
+ */
21
+ export declare class QueryContext<T extends DocumentData = any> {
22
+ readonly query: Query<T>;
23
+ /**
24
+ * The ID of the integration being queried.
25
+ */
26
+ get integrationId(): IntegrationId;
27
+ /**
28
+ * The name of the collection being queried.
29
+ */
30
+ get collectionName(): CollectionName;
31
+ /**
32
+ * The query limit if one exists, -1 otherwise.
33
+ */
34
+ get limit(): number;
35
+ /**
36
+ * The fields to project (include) in query results, or undefined if all fields should be returned.
37
+ */
38
+ get projectFields(): Array<FieldName> | undefined;
39
+ /**
40
+ * Verifies that the query's sort order aligns with the provided field sorts. The fields specified in the `sorts`
41
+ * parameter must appear in the exact order at the beginning of the query's sort sequence. The query can include
42
+ * additional fields in its sort order, but only after the specified sorts.
43
+ *
44
+ * @param sorts An array of field sorts.
45
+ * @returns Whether the query's sorts matches the provided field sorts.
46
+ */
47
+ sortedBy(sorts: Array<PartialBy<FieldSort<T>, 'asc'>>): boolean;
48
+ /**
49
+ * Verifies that the query's sort order exactly matches the provided field sorts. The fields specified in the
50
+ * `sorts` parameter must appear in the exact order in the query's sort sequence. No additional sorts may be present
51
+ * in the query.
52
+ *
53
+ * @param sorts An array of field sorts.
54
+ * @returns Whether the query's sorts exactly match the provided field sorts.
55
+ */
56
+ sortedByExact(sorts: Array<PartialBy<FieldSort<T>, 'asc'>>): boolean;
57
+ /**
58
+ * Verifies that the query is a subquery of the specified condition. A subquery is defined as a query that evaluates
59
+ * to a subset of the results that would be obtained by applying the parent condition. The subquery may also include
60
+ * additional conditions, as these only narrow the result set.
61
+ *
62
+ * @param fieldName The name of the field for the condition.
63
+ * @param operator The operator of the condition.
64
+ * @param value The value of the condition.
65
+ * @returns Whether the query is a subquery of the parent condition.
66
+ */
67
+ isSubqueryOf<F extends Paths<T>, O extends AllOperators>(fieldName: F, operator: O, value: GenericValue<T, F, O> | null): boolean;
68
+ /**
69
+ * Verifies that the query is a subquery of the specified condition. A subquery is defined as a query that evaluates
70
+ * to a subset of the results that would be obtained by applying the parent condition. The subquery may also include
71
+ * additional conditions, as these only narrow the result set.
72
+ *
73
+ * @param condition The condition to validate.
74
+ * @returns Whether the query is a subquery of the parent condition.
75
+ */
76
+ isSubqueryOfCondition(condition: GeneralCondition<T>): boolean;
77
+ /**
78
+ * Verifies that the query is a subquery of the specified conditions. A subquery is defined as a query that evaluates
79
+ * to a subset of the results that would be obtained by applying the parent conditions. The subquery may also include
80
+ * additional conditions, as these only narrow the result set.
81
+ *
82
+ * @param conditions The conditions to validate.
83
+ * @returns Whether the query includes subquery of the parent conditions.
84
+ */
85
+ isSubqueryOfConditions(conditions: GeneralConditions<T>): boolean;
86
+ /**
87
+ * Verifies that the query is a subquery of the specified query. A subquery is defined as a query that evaluates
88
+ * to a subset of the results that obtained for the parent query, including sorts and limits.
89
+ *
90
+ * @param query The query to validate.
91
+ * @returns Whether the query is a subquery of the parent query.
92
+ */
93
+ isSubqueryOfQuery(query: Query<T>): boolean;
94
+ /**
95
+ * Checks if this query's projectFields are a subset of the parent query's projectFields.
96
+ * A query can only be a child of another if the parent provides all fields the child needs.
97
+ *
98
+ * @param childFields - The projectFields of this query (the potential child)
99
+ * @param parentFields - The projectFields of the candidate parent query
100
+ * @returns Whether the child's fields are available from the parent
101
+ */
102
+ private isProjectFieldsSubset;
103
+ /**
104
+ * Returns all conditions that apply to any of the specified field names. This method
105
+ * provides a convenient way to retrieve all conditions that involve a specific set of fields.
106
+ *
107
+ * @param fieldNames The field names for which to retrieve conditions.
108
+ * @returns An array of conditions that involve any of the specified field names.
109
+ */
110
+ getConditionsFor<K extends Paths<T>>(...fieldNames: Array<K>): ContextConditions<T, K>;
111
+ /**
112
+ * Returns all conditions that apply to the specified field name. This method provides
113
+ * a convenient way to retrieve all conditions that involve a specific field.
114
+ *
115
+ * @param fieldName The field name for which to retrieve conditions.
116
+ * @returns An array of conditions that involve the specified field name.
117
+ */
118
+ getConditionsForField<K extends Paths<T>>(fieldName: K): ContextConditions<T>;
119
+ /**
120
+ * Returns true if the given document can be a result of the query.
121
+ * The method does not account for limit and sort order.
122
+ */
123
+ documentMatchesQuery(doc: DocumentData): boolean;
124
+ }
125
+ /**
126
+ * A list of context conditions.
127
+ * @category Database
128
+ */
129
+ export type ContextConditions<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> = Array<ContextCondition<Doc, F>>;
130
+ /**
131
+ * A Context condition - a condition that replaces multiple '==' or '!=' conditions with 'in' and 'not in'.
132
+ * @category Database
133
+ */
134
+ export type ContextCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> = InContextCondition<Doc, F> | NotInContextCondition<Doc, F> | OtherContextCondition<Doc, F>;
135
+ /**
136
+ * A condition using the 'in' operator to match values within a set.
137
+ * @category Database
138
+ */
139
+ export interface InContextCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> extends SimpleCondition<Doc, F, 'in'> {
140
+ /** Specifies the 'in' operator to check if a value exists within an array. */
141
+ operator: 'in';
142
+ /** An array of values to match against the field. */
143
+ value: Array<FieldOf<DeepRecord<Doc>, Paths<Doc>> | any>;
144
+ }
145
+ /**
146
+ * A condition using the 'not in' operator to exclude values within a set.
147
+ * @category Database
148
+ */
149
+ export interface NotInContextCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> extends SimpleCondition<Doc, F, 'not in'> {
150
+ /** Specifies the 'not in' operator to check if a value does not exist within an array. */
151
+ operator: 'not in';
152
+ /** An array of values to exclude from the field. */
153
+ value: Array<FieldOf<DeepRecord<Doc>, Paths<Doc>> | any>;
154
+ }
155
+ /**
156
+ * A condition using operators other than 'in' or 'not in' for field comparisons.
157
+ * @category Database
158
+ */
159
+ export interface OtherContextCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> extends SimpleCondition<Doc, F, Exclude<ContextOperator, 'in' | 'not in'>> {
160
+ /** The operator to use for the comparison, excluding 'in' and 'not in'. */
161
+ operator: Exclude<ContextOperator, 'in' | 'not in'>;
162
+ /** The value to compare against the field. */
163
+ value: FieldOf<DeepRecord<Doc>, Paths<Doc>> | any;
164
+ }
165
+ /**
166
+ * A condition that includes all operators, including 'in' and 'not in', for general use.
167
+ * @category Database
168
+ */
169
+ export interface GeneralCondition<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> extends SimpleCondition<Doc, F, AllOperators> {
170
+ /** The operator to apply to the condition, including all possible operators. */
171
+ operator: AllOperators;
172
+ /** The value to use in the condition comparison. */
173
+ value: any;
174
+ }
175
+ /**
176
+ * A list of general conditions.
177
+ * @category Database
178
+ */
179
+ export type GeneralConditions<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> = Array<GeneralCondition<Doc, F>>;
180
+ /**
181
+ * @category Database
182
+ */
183
+ export type ContextOperator = Exclude<Operator, '==' | '!='> | 'in' | 'not in';
184
+ /**
185
+ * Set of operators supported by query context conditions, including list membership.
186
+ * @category Database
187
+ */
188
+ export type AllOperators = Operator | 'in' | 'not in';
189
+ /**
190
+ * A generic value that can exist in a query.
191
+ * @category Database
192
+ */
193
+ export type GenericValue<Doc = any, F extends Paths<Doc> = Paths<Doc>, O extends AllOperators = any> = O extends 'in' ? Array<DeepRecord<Doc>[F]> | null : O extends 'not in' ? Array<DeepRecord<Doc>[F]> | null : DeepRecord<Doc>[F] | null;
@@ -0,0 +1,302 @@
1
+ import { AgentContextRequest, AiAgent, AiAgentContext, AiAgentMcpServerConfig, AiAnnotation, AiAudioCreateSpeechOptions, AiChatMessage, AiChatOptions, AiGenerateImageOptions, AllAiAgentChatOptions, ApplicationAiSettings, BuildAgentOptions } from '../public-types/ai-agent.public-types';
2
+ import { AiProviderType, ModelIdSpec } from '../public-types/ai-common.public-types';
3
+ import { AiContextMetadata, AiContextMetadataFilter } from '../public-types/ai-knowledge-base.public-types';
4
+ import { AiAgentId, AiKnowledgeBaseId, AppId, ClientRequestId } from '../public-types/communication.public-types';
5
+ import { JobId } from '../public-types/job.public-types';
6
+ import { SecretKey } from '../public-types/secret.public-types';
7
+ /** Specification for an AI model, defining its operational parameters. */
8
+ export type AiModelSpec = {
9
+ /** Maximum tokens the model can generate in a single response. */
10
+ maxOutputTokens: number;
11
+ /** Total context window size: input (aka prompt) + output (aka completion) tokens combined. */
12
+ contextWindowTokens: number;
13
+ };
14
+ export interface AiChatRequest {
15
+ agentId: AiAgentId;
16
+ clientRequestId: ClientRequestId;
17
+ prompt?: string;
18
+ options?: AllAiAgentChatOptions;
19
+ jobId: JobId;
20
+ }
21
+ export interface AiAskRequest {
22
+ agentId: AiAgentId;
23
+ prompt?: string;
24
+ options?: AllAiAgentChatOptions;
25
+ jobId: JobId;
26
+ }
27
+ export interface AiGenerateImageRequest {
28
+ prompt: string;
29
+ options: AiGenerateImageOptions;
30
+ }
31
+ export interface AiAskQuestionInternalRequest {
32
+ appId: AppId;
33
+ prompt: string;
34
+ options: AiChatOptions;
35
+ /**
36
+ * API key resolution mode (see `AiProviderFactory.getChatProviderForModel`). 'system' is
37
+ * required to resolve system-internal models (e.g. the 'openai-compatible' registry models)
38
+ * and makes the call billable to Squid, not the app. Defaults to 'auto'. The endpoint is
39
+ * `@Internal()`, so only internal-key callers can set this.
40
+ */
41
+ keyType?: 'auto' | 'system';
42
+ }
43
+ export interface AiAskQuestionInternalResponse {
44
+ answer: string;
45
+ }
46
+ export interface GetSharedAgentsInternalRequest {
47
+ organizationId: string;
48
+ }
49
+ export interface GetSharedAgentsInternalResponse {
50
+ sharedAgents: Array<{
51
+ agentId: AiAgentId;
52
+ appId: AppId;
53
+ }>;
54
+ }
55
+ export interface ClearSharedAgentsForOrgInternalRequest {
56
+ organizationId: string;
57
+ }
58
+ export interface AiContextSizeRequest {
59
+ appId: AppId;
60
+ agentId: AiAgentId;
61
+ }
62
+ export interface AiContextSizeResponse {
63
+ sizeBytes: number;
64
+ }
65
+ export interface AiAskResponse {
66
+ responseString: string;
67
+ annotations?: Record<string, AiAnnotation>;
68
+ }
69
+ export interface AiAskWithVoiceResponse {
70
+ responseString: string;
71
+ voiceResponse: AiAudioCreateSpeechResponse;
72
+ annotations?: Record<string, AiAnnotation>;
73
+ }
74
+ export interface AiTranscribeAndAskWithVoiceResponse {
75
+ transcribedPrompt: string;
76
+ responseString: string;
77
+ voiceResponse: AiAudioCreateSpeechResponse;
78
+ annotations?: Record<string, AiAnnotation>;
79
+ }
80
+ export interface AiTranscribeAndChatResponse {
81
+ transcribedPrompt: string;
82
+ }
83
+ export interface AiAudioCreateSpeechResponse {
84
+ mimeType: string;
85
+ extension: string;
86
+ base64File: string;
87
+ }
88
+ export interface AiAudioCreateSpeechRequest {
89
+ input: string;
90
+ options: AiAudioCreateSpeechOptions;
91
+ }
92
+ export interface GetAgentRequest {
93
+ agentId: AiAgentId;
94
+ }
95
+ export interface GetAgentResponse {
96
+ agent: AiAgent | undefined;
97
+ }
98
+ export interface GetAgentContextRequest {
99
+ agentId: AiAgentId;
100
+ contextId: string;
101
+ }
102
+ export interface ConnectAgentKnowledgeBaseRequest {
103
+ agentId: AiAgentId;
104
+ knowledgeBaseId: AiKnowledgeBaseId;
105
+ description: string;
106
+ }
107
+ export interface DisconnectAgentKnowledgeBaseRequest {
108
+ agentId: AiAgentId;
109
+ knowledgeBaseId: AiKnowledgeBaseId;
110
+ }
111
+ export interface DeleteAgentRequest {
112
+ agentId: AiAgentId;
113
+ }
114
+ export interface UnshareAgentRequest {
115
+ agentId: AiAgentId;
116
+ }
117
+ export interface SetAgentOptionInPathRequest {
118
+ agentId: AiAgentId;
119
+ path: string;
120
+ value: unknown;
121
+ }
122
+ export interface AddConnectedIntegrationRequest {
123
+ agentId: AiAgentId;
124
+ integrationId: string;
125
+ integrationType: string;
126
+ description: string;
127
+ }
128
+ export interface AddConnectedAgentRequest {
129
+ agentId: AiAgentId;
130
+ connectedAgentId: string;
131
+ description: string;
132
+ }
133
+ export interface AddConnectedKnowledgeBaseRequest {
134
+ agentId: AiAgentId;
135
+ knowledgeBaseId: string;
136
+ description: string;
137
+ /** Mirrors {@link AiConnectedKnowledgeBaseMetadata.includeMetadata}; forwarded so this atomic API honors it. */
138
+ includeMetadata?: boolean;
139
+ }
140
+ export interface AddFunctionRequest {
141
+ agentId: AiAgentId;
142
+ functionId: string;
143
+ }
144
+ export interface RemoveConnectedAgentRequest {
145
+ agentId: AiAgentId;
146
+ connectedAgentId: string;
147
+ }
148
+ export interface RemoveConnectedIntegrationRequest {
149
+ agentId: AiAgentId;
150
+ integrationId: string;
151
+ }
152
+ export interface RemoveConnectedKnowledgeBaseRequest {
153
+ agentId: AiAgentId;
154
+ knowledgeBaseId: string;
155
+ }
156
+ export interface RemoveFunctionRequest {
157
+ agentId: AiAgentId;
158
+ functionId: string;
159
+ }
160
+ export interface SetAgentDescriptionRequest {
161
+ agentId: AiAgentId;
162
+ description: string;
163
+ }
164
+ export interface SetAgentMcpServerRequest {
165
+ agentId: AiAgentId;
166
+ mcpServer: AiAgentMcpServerConfig;
167
+ }
168
+ export interface ListAgentContextsRequest {
169
+ agentId: AiAgentId;
170
+ }
171
+ export interface ListAgentContextsResponse {
172
+ contexts: Array<AiAgentContext>;
173
+ }
174
+ export interface DeleteAgentContextsRequest {
175
+ agentId: AiAgentId;
176
+ contextIds: Array<string>;
177
+ }
178
+ export interface UpsertAgentContextsRequest {
179
+ agentId: AiAgentId;
180
+ contextRequests: Array<AgentContextRequest>;
181
+ }
182
+ export interface UpsertAgentCustomGuardrailsRequest {
183
+ agentId: AiAgentId;
184
+ customGuardrail: string;
185
+ }
186
+ export interface DeleteAgentCustomGuardrailsRequest {
187
+ agentId: AiAgentId;
188
+ }
189
+ export interface ListAgentsResponse {
190
+ agents: Array<AiAgent>;
191
+ }
192
+ export interface GetApplicationAiSettingsResponse {
193
+ settings: ApplicationAiSettings;
194
+ }
195
+ export interface GetApplicationAiSettingsResponse {
196
+ settings: ApplicationAiSettings;
197
+ }
198
+ export interface SetApplicationAiSettingsRequest {
199
+ settings: ApplicationAiSettings;
200
+ }
201
+ export interface SetAiProviderApiKeySecretRequest {
202
+ providerType: AiProviderType;
203
+ secretKey: SecretKey | undefined;
204
+ }
205
+ export interface SetAiProviderApiKeySecretResponse {
206
+ settings: ApplicationAiSettings;
207
+ }
208
+ export interface ListChatModelsResponse {
209
+ models: ModelIdSpec[];
210
+ }
211
+ export interface RegenerateAgentApiKeyRequest {
212
+ agentId: AiAgentId;
213
+ }
214
+ export interface GetAgentApiKeyRequest {
215
+ agentId: AiAgentId;
216
+ }
217
+ export declare function validateAiContextMetadata(metadata: AiContextMetadata): void;
218
+ export declare function validateAiContextMetadataFilter(filter: AiContextMetadataFilter): void;
219
+ export declare const METADATA_SERVICE_FUNCTION_NAME = "default:metadata";
220
+ export interface GetChatHistoryRequest {
221
+ agentId: AiAgentId;
222
+ memoryId: string;
223
+ }
224
+ export interface GetChatHistoryResponse {
225
+ messages: Array<AiChatMessage>;
226
+ }
227
+ export interface ProvideAgentFeedbackRequest {
228
+ agentId: string;
229
+ feedback: string;
230
+ /** If true, proposed changes are stored for later admin review instead of being applied immediately. */
231
+ holdForReview?: boolean;
232
+ /** Arbitrary caller-supplied metadata to store alongside the feedback. Limited to 4096 bytes when serialized. */
233
+ metadata?: Record<string, unknown>;
234
+ }
235
+ /** A proposed agent-feedback change, stored instead of applied when `holdForReview` is set. */
236
+ export interface AgentFeedbackRecord {
237
+ id: string;
238
+ agentId: string;
239
+ integrationId?: string;
240
+ /** Name of the executable or aiFunction that produced this record, e.g. `provideAgentFeedback`. */
241
+ action: string;
242
+ params: Record<string, unknown>;
243
+ rawFeedback: string;
244
+ status: 'pending' | 'applied' | 'dismissed';
245
+ createdAt: string;
246
+ metadata?: Record<string, unknown>;
247
+ }
248
+ export interface ListAgentFeedbackRequest {
249
+ agentId: string;
250
+ limit?: number;
251
+ /** Cursor from a previous response's `nextCursor`, to fetch the next page. */
252
+ cursor?: string;
253
+ /** If set, only returns records with this status. */
254
+ status?: 'pending' | 'applied' | 'dismissed';
255
+ }
256
+ export interface ListAgentFeedbackResponse {
257
+ records: Array<AgentFeedbackRecord>;
258
+ nextCursor?: string;
259
+ }
260
+ /** Result of trying to apply or dismiss a single held-for-review feedback record. */
261
+ export interface AgentFeedbackActionResult {
262
+ id: string;
263
+ success: boolean;
264
+ error?: string;
265
+ }
266
+ export interface ApplyAgentFeedbackRequest {
267
+ agentId: string;
268
+ ids: Array<string>;
269
+ }
270
+ export interface ApplyAgentFeedbackResponse {
271
+ results: Array<AgentFeedbackActionResult>;
272
+ }
273
+ export interface DismissAgentFeedbackRequest {
274
+ agentId: string;
275
+ ids: Array<string>;
276
+ }
277
+ export interface DismissAgentFeedbackResponse {
278
+ results: Array<AgentFeedbackActionResult>;
279
+ }
280
+ export interface BuildAgentRequest {
281
+ agentId: string;
282
+ request: string;
283
+ memoryId?: string;
284
+ options?: BuildAgentOptions;
285
+ }
286
+ export interface UploadAiFileRequest {
287
+ /** AI provider to upload file to. */
288
+ provider: AiProviderType;
289
+ /** Optional expiration time in seconds. If provided, file will be registered for automatic cleanup. */
290
+ expirationInSeconds?: number;
291
+ }
292
+ export interface UploadAiFileResponse {
293
+ fileId: string;
294
+ }
295
+ export interface DeleteAiFileRequest {
296
+ fileId: string;
297
+ /** AI provider that owns the file. */
298
+ provider: AiProviderType;
299
+ }
300
+ export interface DeleteAiFileResponse {
301
+ deleted: boolean;
302
+ }