codemie-sdk 0.1.64
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/README.md +1008 -0
- package/dist/index.cjs +1357 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2025 -0
- package/dist/index.d.ts +2025 -0
- package/dist/index.js +1291 -0
- package/dist/index.js.map +1 -0
- package/package.json +52 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,2025 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AxiosResponse } from 'axios/index';
|
|
3
|
+
import FormData from 'form-data';
|
|
4
|
+
|
|
5
|
+
interface TokensUsage {
|
|
6
|
+
input_tokens?: number;
|
|
7
|
+
output_tokens?: number;
|
|
8
|
+
money_spent?: number;
|
|
9
|
+
}
|
|
10
|
+
interface BaseUser {
|
|
11
|
+
user_id?: string;
|
|
12
|
+
username: string;
|
|
13
|
+
name: string;
|
|
14
|
+
}
|
|
15
|
+
interface PaginationParams {
|
|
16
|
+
page?: number;
|
|
17
|
+
per_page?: number;
|
|
18
|
+
}
|
|
19
|
+
interface PaginatedResponse<T> {
|
|
20
|
+
data: T[];
|
|
21
|
+
pagination: {
|
|
22
|
+
page: number;
|
|
23
|
+
per_page: number;
|
|
24
|
+
total: number;
|
|
25
|
+
pages: number;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
type SortOrder = "asc" | "desc";
|
|
29
|
+
/** API specification not defined in the OpenAPI spec. */
|
|
30
|
+
type AnyJson = Record<string, unknown>;
|
|
31
|
+
|
|
32
|
+
/** Models for integration-related data structures */
|
|
33
|
+
/**
|
|
34
|
+
* Credential types as constant object
|
|
35
|
+
*/
|
|
36
|
+
declare const CredentialTypes: {
|
|
37
|
+
readonly JIRA: "Jira";
|
|
38
|
+
readonly CONFLUENCE: "Confluence";
|
|
39
|
+
readonly GIT: "Git";
|
|
40
|
+
readonly KUBERNETES: "Kubernetes";
|
|
41
|
+
readonly AWS: "AWS";
|
|
42
|
+
readonly GCP: "GCP";
|
|
43
|
+
readonly KEYCLOAK: "Keycloak";
|
|
44
|
+
readonly AZURE: "Azure";
|
|
45
|
+
readonly ELASTIC: "Elastic";
|
|
46
|
+
readonly OPENAPI: "OpenAPI";
|
|
47
|
+
readonly PLUGIN: "Plugin";
|
|
48
|
+
readonly FILESYSTEM: "FileSystem";
|
|
49
|
+
readonly SCHEDULER: "Scheduler";
|
|
50
|
+
readonly WEBHOOK: "Webhook";
|
|
51
|
+
readonly EMAIL: "Email";
|
|
52
|
+
readonly AZURE_DEVOPS: "AzureDevOps";
|
|
53
|
+
readonly SONAR: "Sonar";
|
|
54
|
+
readonly SQL: "SQL";
|
|
55
|
+
readonly TELEGRAM: "Telegram";
|
|
56
|
+
readonly ZEPHYR_CLOUD: "ZephyrCloud";
|
|
57
|
+
readonly ZEPHYR_SQUAD: "ZephyrSquad";
|
|
58
|
+
readonly SERVICE_NOW: "ServiceNow";
|
|
59
|
+
readonly DIAL: "DIAL";
|
|
60
|
+
readonly A2A: "A2A";
|
|
61
|
+
readonly MCP: "MCP";
|
|
62
|
+
};
|
|
63
|
+
type CredentialTypesType = (typeof CredentialTypes)[keyof typeof CredentialTypes];
|
|
64
|
+
/**
|
|
65
|
+
* Integration types as constant object
|
|
66
|
+
*/
|
|
67
|
+
declare const IntegrationType: {
|
|
68
|
+
readonly USER: "user";
|
|
69
|
+
readonly PROJECT: "project";
|
|
70
|
+
};
|
|
71
|
+
type IntegrationTypeType = (typeof IntegrationType)[keyof typeof IntegrationType];
|
|
72
|
+
/**
|
|
73
|
+
* Model for credential values
|
|
74
|
+
*/
|
|
75
|
+
interface CredentialValues {
|
|
76
|
+
/** Key for the credential value */
|
|
77
|
+
key: string;
|
|
78
|
+
/** Value of the credential (can be any type) */
|
|
79
|
+
value: unknown;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Model for settings configuration
|
|
83
|
+
*/
|
|
84
|
+
interface Integration {
|
|
85
|
+
/** Integration ID */
|
|
86
|
+
id: string;
|
|
87
|
+
/** Creation date */
|
|
88
|
+
date?: string;
|
|
89
|
+
/** Last update date */
|
|
90
|
+
update_date?: string;
|
|
91
|
+
/** User ID */
|
|
92
|
+
user_id?: string;
|
|
93
|
+
/** Project name */
|
|
94
|
+
project_name: string;
|
|
95
|
+
/** Integration alias */
|
|
96
|
+
alias?: string;
|
|
97
|
+
/** Whether this is the default integration */
|
|
98
|
+
default?: boolean;
|
|
99
|
+
/** Type of credential */
|
|
100
|
+
credential_type: CredentialTypesType;
|
|
101
|
+
/** List of credential values */
|
|
102
|
+
credential_values: CredentialValues[];
|
|
103
|
+
/** Type of integration */
|
|
104
|
+
setting_type: IntegrationTypeType;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** Models for assistant-related data structures. */
|
|
108
|
+
|
|
109
|
+
declare enum ContextType {
|
|
110
|
+
KNOWLEDGE_BASE = "knowledge_base",
|
|
111
|
+
CODE = "code"
|
|
112
|
+
}
|
|
113
|
+
declare enum ChatRole {
|
|
114
|
+
ASSISTANT = "Assistant",
|
|
115
|
+
USER = "User"
|
|
116
|
+
}
|
|
117
|
+
interface ToolDetails {
|
|
118
|
+
name: string;
|
|
119
|
+
label?: string;
|
|
120
|
+
settings_config: boolean;
|
|
121
|
+
user_description?: string;
|
|
122
|
+
settings?: Integration | null;
|
|
123
|
+
}
|
|
124
|
+
interface ToolKitDetails {
|
|
125
|
+
toolkit: string;
|
|
126
|
+
tools: ToolDetails[];
|
|
127
|
+
label: string;
|
|
128
|
+
settings_config: boolean;
|
|
129
|
+
is_external: boolean;
|
|
130
|
+
settings?: Integration;
|
|
131
|
+
}
|
|
132
|
+
interface Context {
|
|
133
|
+
context_type: ContextType;
|
|
134
|
+
name: string;
|
|
135
|
+
}
|
|
136
|
+
interface MCPServerConfig {
|
|
137
|
+
command: string;
|
|
138
|
+
args?: string[];
|
|
139
|
+
env?: Record<string, unknown>;
|
|
140
|
+
auth_token?: string;
|
|
141
|
+
}
|
|
142
|
+
interface MCPServerDetails {
|
|
143
|
+
name: string;
|
|
144
|
+
description?: string;
|
|
145
|
+
enabled: boolean;
|
|
146
|
+
config?: MCPServerConfig;
|
|
147
|
+
mcp_connect_url?: string;
|
|
148
|
+
tools_tokens_size_limit?: number;
|
|
149
|
+
command?: string;
|
|
150
|
+
arguments?: string;
|
|
151
|
+
settings?: Integration;
|
|
152
|
+
mcp_connect_auth_token?: Integration;
|
|
153
|
+
}
|
|
154
|
+
interface SystemPromptHistory {
|
|
155
|
+
system_prompt: string;
|
|
156
|
+
date: string;
|
|
157
|
+
created_by?: BaseUser;
|
|
158
|
+
}
|
|
159
|
+
interface AssistantBase {
|
|
160
|
+
id: string;
|
|
161
|
+
created_by?: BaseUser;
|
|
162
|
+
name: string;
|
|
163
|
+
description: string;
|
|
164
|
+
icon_url?: string;
|
|
165
|
+
}
|
|
166
|
+
interface Assistant extends AssistantBase {
|
|
167
|
+
system_prompt: string;
|
|
168
|
+
system_prompt_history: SystemPromptHistory[];
|
|
169
|
+
project: string;
|
|
170
|
+
llm_model_type?: string;
|
|
171
|
+
toolkits: ToolKitDetails[];
|
|
172
|
+
user_prompts: string[];
|
|
173
|
+
shared: boolean;
|
|
174
|
+
is_react: boolean;
|
|
175
|
+
is_global: boolean;
|
|
176
|
+
created_date?: string;
|
|
177
|
+
updated_date?: string;
|
|
178
|
+
creator: string;
|
|
179
|
+
slug?: string;
|
|
180
|
+
temperature?: number;
|
|
181
|
+
top_p?: number;
|
|
182
|
+
context: Context[];
|
|
183
|
+
user_abilities?: unknown[];
|
|
184
|
+
mcp_servers: MCPServerDetails[];
|
|
185
|
+
assistant_ids: string[];
|
|
186
|
+
}
|
|
187
|
+
interface AssistantRequestBase extends AssistantBase {
|
|
188
|
+
system_prompt: string;
|
|
189
|
+
project: string;
|
|
190
|
+
context: Context[];
|
|
191
|
+
llm_model_type: string;
|
|
192
|
+
toolkits: ToolKitDetails[];
|
|
193
|
+
user_prompts: string[];
|
|
194
|
+
shared?: boolean;
|
|
195
|
+
is_react?: boolean;
|
|
196
|
+
is_global?: boolean;
|
|
197
|
+
slug?: string;
|
|
198
|
+
temperature?: number;
|
|
199
|
+
top_p?: number;
|
|
200
|
+
mcp_servers: MCPServerDetails[];
|
|
201
|
+
assistant_ids: string[];
|
|
202
|
+
}
|
|
203
|
+
interface ChatMessage {
|
|
204
|
+
role: ChatRole;
|
|
205
|
+
message?: string;
|
|
206
|
+
}
|
|
207
|
+
interface BaseModelApiResponse {
|
|
208
|
+
generated: string;
|
|
209
|
+
timeElapsed?: number;
|
|
210
|
+
tokensUsed?: number;
|
|
211
|
+
thoughts?: Record<string, unknown>[];
|
|
212
|
+
taskId?: string;
|
|
213
|
+
}
|
|
214
|
+
interface BaseModelResponse {
|
|
215
|
+
generated: string;
|
|
216
|
+
time_elapsed?: number;
|
|
217
|
+
tokens_used?: number;
|
|
218
|
+
thoughts?: Record<string, unknown>[];
|
|
219
|
+
task_id?: string;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
declare const AssistantListParamsSchema: z.ZodReadonly<z.ZodObject<{
|
|
223
|
+
minimal_response: z.ZodDefault<z.ZodBoolean>;
|
|
224
|
+
scope: z.ZodDefault<z.ZodEnum<["visible_to_user", "created_by_user"]>>;
|
|
225
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
226
|
+
per_page: z.ZodDefault<z.ZodNumber>;
|
|
227
|
+
filters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
228
|
+
}, "strip", z.ZodTypeAny, {
|
|
229
|
+
minimal_response: boolean;
|
|
230
|
+
scope: "visible_to_user" | "created_by_user";
|
|
231
|
+
page: number;
|
|
232
|
+
per_page: number;
|
|
233
|
+
filters?: Record<string, unknown> | undefined;
|
|
234
|
+
}, {
|
|
235
|
+
minimal_response?: boolean | undefined;
|
|
236
|
+
scope?: "visible_to_user" | "created_by_user" | undefined;
|
|
237
|
+
page?: number | undefined;
|
|
238
|
+
per_page?: number | undefined;
|
|
239
|
+
filters?: Record<string, unknown> | undefined;
|
|
240
|
+
}>>;
|
|
241
|
+
type AssistantListParams = Partial<z.infer<typeof AssistantListParamsSchema>>;
|
|
242
|
+
declare const AssistantCreateParamsSchema: z.ZodReadonly<z.ZodObject<{
|
|
243
|
+
name: z.ZodString;
|
|
244
|
+
description: z.ZodString;
|
|
245
|
+
icon_url: z.ZodOptional<z.ZodString>;
|
|
246
|
+
system_prompt: z.ZodString;
|
|
247
|
+
project: z.ZodString;
|
|
248
|
+
context: z.ZodArray<z.ZodObject<{
|
|
249
|
+
context_type: z.ZodEnum<["knowledge_base", "code"]>;
|
|
250
|
+
name: z.ZodString;
|
|
251
|
+
}, "strip", z.ZodTypeAny, {
|
|
252
|
+
name: string;
|
|
253
|
+
context_type: "knowledge_base" | "code";
|
|
254
|
+
}, {
|
|
255
|
+
name: string;
|
|
256
|
+
context_type: "knowledge_base" | "code";
|
|
257
|
+
}>, "many">;
|
|
258
|
+
llm_model_type: z.ZodString;
|
|
259
|
+
toolkits: z.ZodArray<z.ZodObject<{
|
|
260
|
+
toolkit: z.ZodString;
|
|
261
|
+
tools: z.ZodArray<z.ZodObject<{
|
|
262
|
+
name: z.ZodString;
|
|
263
|
+
label: z.ZodOptional<z.ZodString>;
|
|
264
|
+
settings_config: z.ZodBoolean;
|
|
265
|
+
user_description: z.ZodOptional<z.ZodString>;
|
|
266
|
+
settings: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
|
|
267
|
+
}, "strip", z.ZodTypeAny, {
|
|
268
|
+
name: string;
|
|
269
|
+
settings_config: boolean;
|
|
270
|
+
label?: string | undefined;
|
|
271
|
+
user_description?: string | undefined;
|
|
272
|
+
settings?: any;
|
|
273
|
+
}, {
|
|
274
|
+
name: string;
|
|
275
|
+
settings_config: boolean;
|
|
276
|
+
label?: string | undefined;
|
|
277
|
+
user_description?: string | undefined;
|
|
278
|
+
settings?: any;
|
|
279
|
+
}>, "many">;
|
|
280
|
+
label: z.ZodString;
|
|
281
|
+
settings_config: z.ZodBoolean;
|
|
282
|
+
is_external: z.ZodBoolean;
|
|
283
|
+
settings: z.ZodOptional<z.ZodAny>;
|
|
284
|
+
}, "strip", z.ZodTypeAny, {
|
|
285
|
+
toolkit: string;
|
|
286
|
+
tools: {
|
|
287
|
+
name: string;
|
|
288
|
+
settings_config: boolean;
|
|
289
|
+
label?: string | undefined;
|
|
290
|
+
user_description?: string | undefined;
|
|
291
|
+
settings?: any;
|
|
292
|
+
}[];
|
|
293
|
+
label: string;
|
|
294
|
+
settings_config: boolean;
|
|
295
|
+
is_external: boolean;
|
|
296
|
+
settings?: any;
|
|
297
|
+
}, {
|
|
298
|
+
toolkit: string;
|
|
299
|
+
tools: {
|
|
300
|
+
name: string;
|
|
301
|
+
settings_config: boolean;
|
|
302
|
+
label?: string | undefined;
|
|
303
|
+
user_description?: string | undefined;
|
|
304
|
+
settings?: any;
|
|
305
|
+
}[];
|
|
306
|
+
label: string;
|
|
307
|
+
settings_config: boolean;
|
|
308
|
+
is_external: boolean;
|
|
309
|
+
settings?: any;
|
|
310
|
+
}>, "many">;
|
|
311
|
+
user_prompts: z.ZodArray<z.ZodString, "many">;
|
|
312
|
+
shared: z.ZodOptional<z.ZodBoolean>;
|
|
313
|
+
is_react: z.ZodOptional<z.ZodBoolean>;
|
|
314
|
+
is_global: z.ZodOptional<z.ZodBoolean>;
|
|
315
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
316
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
317
|
+
top_p: z.ZodOptional<z.ZodNumber>;
|
|
318
|
+
mcp_servers: z.ZodArray<z.ZodObject<{
|
|
319
|
+
name: z.ZodString;
|
|
320
|
+
description: z.ZodOptional<z.ZodString>;
|
|
321
|
+
enabled: z.ZodBoolean;
|
|
322
|
+
config: z.ZodOptional<z.ZodObject<{
|
|
323
|
+
command: z.ZodString;
|
|
324
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
325
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
326
|
+
auth_token: z.ZodOptional<z.ZodString>;
|
|
327
|
+
}, "strip", z.ZodTypeAny, {
|
|
328
|
+
command: string;
|
|
329
|
+
args?: string[] | undefined;
|
|
330
|
+
env?: Record<string, unknown> | undefined;
|
|
331
|
+
auth_token?: string | undefined;
|
|
332
|
+
}, {
|
|
333
|
+
command: string;
|
|
334
|
+
args?: string[] | undefined;
|
|
335
|
+
env?: Record<string, unknown> | undefined;
|
|
336
|
+
auth_token?: string | undefined;
|
|
337
|
+
}>>;
|
|
338
|
+
mcp_connect_url: z.ZodOptional<z.ZodString>;
|
|
339
|
+
tools_tokens_size_limit: z.ZodOptional<z.ZodNumber>;
|
|
340
|
+
command: z.ZodOptional<z.ZodString>;
|
|
341
|
+
arguments: z.ZodOptional<z.ZodString>;
|
|
342
|
+
settings: z.ZodOptional<z.ZodAny>;
|
|
343
|
+
mcp_connect_auth_token: z.ZodOptional<z.ZodAny>;
|
|
344
|
+
}, "strip", z.ZodTypeAny, {
|
|
345
|
+
name: string;
|
|
346
|
+
enabled: boolean;
|
|
347
|
+
description?: string | undefined;
|
|
348
|
+
settings?: any;
|
|
349
|
+
command?: string | undefined;
|
|
350
|
+
config?: {
|
|
351
|
+
command: string;
|
|
352
|
+
args?: string[] | undefined;
|
|
353
|
+
env?: Record<string, unknown> | undefined;
|
|
354
|
+
auth_token?: string | undefined;
|
|
355
|
+
} | undefined;
|
|
356
|
+
mcp_connect_url?: string | undefined;
|
|
357
|
+
tools_tokens_size_limit?: number | undefined;
|
|
358
|
+
arguments?: string | undefined;
|
|
359
|
+
mcp_connect_auth_token?: any;
|
|
360
|
+
}, {
|
|
361
|
+
name: string;
|
|
362
|
+
enabled: boolean;
|
|
363
|
+
description?: string | undefined;
|
|
364
|
+
settings?: any;
|
|
365
|
+
command?: string | undefined;
|
|
366
|
+
config?: {
|
|
367
|
+
command: string;
|
|
368
|
+
args?: string[] | undefined;
|
|
369
|
+
env?: Record<string, unknown> | undefined;
|
|
370
|
+
auth_token?: string | undefined;
|
|
371
|
+
} | undefined;
|
|
372
|
+
mcp_connect_url?: string | undefined;
|
|
373
|
+
tools_tokens_size_limit?: number | undefined;
|
|
374
|
+
arguments?: string | undefined;
|
|
375
|
+
mcp_connect_auth_token?: any;
|
|
376
|
+
}>, "many">;
|
|
377
|
+
assistant_ids: z.ZodArray<z.ZodString, "many">;
|
|
378
|
+
}, "strip", z.ZodTypeAny, {
|
|
379
|
+
project: string;
|
|
380
|
+
name: string;
|
|
381
|
+
description: string;
|
|
382
|
+
system_prompt: string;
|
|
383
|
+
context: {
|
|
384
|
+
name: string;
|
|
385
|
+
context_type: "knowledge_base" | "code";
|
|
386
|
+
}[];
|
|
387
|
+
llm_model_type: string;
|
|
388
|
+
toolkits: {
|
|
389
|
+
toolkit: string;
|
|
390
|
+
tools: {
|
|
391
|
+
name: string;
|
|
392
|
+
settings_config: boolean;
|
|
393
|
+
label?: string | undefined;
|
|
394
|
+
user_description?: string | undefined;
|
|
395
|
+
settings?: any;
|
|
396
|
+
}[];
|
|
397
|
+
label: string;
|
|
398
|
+
settings_config: boolean;
|
|
399
|
+
is_external: boolean;
|
|
400
|
+
settings?: any;
|
|
401
|
+
}[];
|
|
402
|
+
user_prompts: string[];
|
|
403
|
+
mcp_servers: {
|
|
404
|
+
name: string;
|
|
405
|
+
enabled: boolean;
|
|
406
|
+
description?: string | undefined;
|
|
407
|
+
settings?: any;
|
|
408
|
+
command?: string | undefined;
|
|
409
|
+
config?: {
|
|
410
|
+
command: string;
|
|
411
|
+
args?: string[] | undefined;
|
|
412
|
+
env?: Record<string, unknown> | undefined;
|
|
413
|
+
auth_token?: string | undefined;
|
|
414
|
+
} | undefined;
|
|
415
|
+
mcp_connect_url?: string | undefined;
|
|
416
|
+
tools_tokens_size_limit?: number | undefined;
|
|
417
|
+
arguments?: string | undefined;
|
|
418
|
+
mcp_connect_auth_token?: any;
|
|
419
|
+
}[];
|
|
420
|
+
assistant_ids: string[];
|
|
421
|
+
icon_url?: string | undefined;
|
|
422
|
+
shared?: boolean | undefined;
|
|
423
|
+
is_react?: boolean | undefined;
|
|
424
|
+
is_global?: boolean | undefined;
|
|
425
|
+
slug?: string | undefined;
|
|
426
|
+
temperature?: number | undefined;
|
|
427
|
+
top_p?: number | undefined;
|
|
428
|
+
}, {
|
|
429
|
+
project: string;
|
|
430
|
+
name: string;
|
|
431
|
+
description: string;
|
|
432
|
+
system_prompt: string;
|
|
433
|
+
context: {
|
|
434
|
+
name: string;
|
|
435
|
+
context_type: "knowledge_base" | "code";
|
|
436
|
+
}[];
|
|
437
|
+
llm_model_type: string;
|
|
438
|
+
toolkits: {
|
|
439
|
+
toolkit: string;
|
|
440
|
+
tools: {
|
|
441
|
+
name: string;
|
|
442
|
+
settings_config: boolean;
|
|
443
|
+
label?: string | undefined;
|
|
444
|
+
user_description?: string | undefined;
|
|
445
|
+
settings?: any;
|
|
446
|
+
}[];
|
|
447
|
+
label: string;
|
|
448
|
+
settings_config: boolean;
|
|
449
|
+
is_external: boolean;
|
|
450
|
+
settings?: any;
|
|
451
|
+
}[];
|
|
452
|
+
user_prompts: string[];
|
|
453
|
+
mcp_servers: {
|
|
454
|
+
name: string;
|
|
455
|
+
enabled: boolean;
|
|
456
|
+
description?: string | undefined;
|
|
457
|
+
settings?: any;
|
|
458
|
+
command?: string | undefined;
|
|
459
|
+
config?: {
|
|
460
|
+
command: string;
|
|
461
|
+
args?: string[] | undefined;
|
|
462
|
+
env?: Record<string, unknown> | undefined;
|
|
463
|
+
auth_token?: string | undefined;
|
|
464
|
+
} | undefined;
|
|
465
|
+
mcp_connect_url?: string | undefined;
|
|
466
|
+
tools_tokens_size_limit?: number | undefined;
|
|
467
|
+
arguments?: string | undefined;
|
|
468
|
+
mcp_connect_auth_token?: any;
|
|
469
|
+
}[];
|
|
470
|
+
assistant_ids: string[];
|
|
471
|
+
icon_url?: string | undefined;
|
|
472
|
+
shared?: boolean | undefined;
|
|
473
|
+
is_react?: boolean | undefined;
|
|
474
|
+
is_global?: boolean | undefined;
|
|
475
|
+
slug?: string | undefined;
|
|
476
|
+
temperature?: number | undefined;
|
|
477
|
+
top_p?: number | undefined;
|
|
478
|
+
}>>;
|
|
479
|
+
type AssistantCreateParams = z.infer<typeof AssistantCreateParamsSchema>;
|
|
480
|
+
declare const AssistantUpdateParamsSchema: z.ZodReadonly<z.ZodObject<{
|
|
481
|
+
name: z.ZodString;
|
|
482
|
+
description: z.ZodString;
|
|
483
|
+
icon_url: z.ZodOptional<z.ZodString>;
|
|
484
|
+
system_prompt: z.ZodString;
|
|
485
|
+
project: z.ZodString;
|
|
486
|
+
context: z.ZodArray<z.ZodObject<{
|
|
487
|
+
context_type: z.ZodEnum<["knowledge_base", "code"]>;
|
|
488
|
+
name: z.ZodString;
|
|
489
|
+
}, "strip", z.ZodTypeAny, {
|
|
490
|
+
name: string;
|
|
491
|
+
context_type: "knowledge_base" | "code";
|
|
492
|
+
}, {
|
|
493
|
+
name: string;
|
|
494
|
+
context_type: "knowledge_base" | "code";
|
|
495
|
+
}>, "many">;
|
|
496
|
+
llm_model_type: z.ZodString;
|
|
497
|
+
toolkits: z.ZodArray<z.ZodObject<{
|
|
498
|
+
toolkit: z.ZodString;
|
|
499
|
+
tools: z.ZodArray<z.ZodObject<{
|
|
500
|
+
name: z.ZodString;
|
|
501
|
+
label: z.ZodOptional<z.ZodString>;
|
|
502
|
+
settings_config: z.ZodBoolean;
|
|
503
|
+
user_description: z.ZodOptional<z.ZodString>;
|
|
504
|
+
settings: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
|
|
505
|
+
}, "strip", z.ZodTypeAny, {
|
|
506
|
+
name: string;
|
|
507
|
+
settings_config: boolean;
|
|
508
|
+
label?: string | undefined;
|
|
509
|
+
user_description?: string | undefined;
|
|
510
|
+
settings?: any;
|
|
511
|
+
}, {
|
|
512
|
+
name: string;
|
|
513
|
+
settings_config: boolean;
|
|
514
|
+
label?: string | undefined;
|
|
515
|
+
user_description?: string | undefined;
|
|
516
|
+
settings?: any;
|
|
517
|
+
}>, "many">;
|
|
518
|
+
label: z.ZodString;
|
|
519
|
+
settings_config: z.ZodBoolean;
|
|
520
|
+
is_external: z.ZodBoolean;
|
|
521
|
+
settings: z.ZodOptional<z.ZodAny>;
|
|
522
|
+
}, "strip", z.ZodTypeAny, {
|
|
523
|
+
toolkit: string;
|
|
524
|
+
tools: {
|
|
525
|
+
name: string;
|
|
526
|
+
settings_config: boolean;
|
|
527
|
+
label?: string | undefined;
|
|
528
|
+
user_description?: string | undefined;
|
|
529
|
+
settings?: any;
|
|
530
|
+
}[];
|
|
531
|
+
label: string;
|
|
532
|
+
settings_config: boolean;
|
|
533
|
+
is_external: boolean;
|
|
534
|
+
settings?: any;
|
|
535
|
+
}, {
|
|
536
|
+
toolkit: string;
|
|
537
|
+
tools: {
|
|
538
|
+
name: string;
|
|
539
|
+
settings_config: boolean;
|
|
540
|
+
label?: string | undefined;
|
|
541
|
+
user_description?: string | undefined;
|
|
542
|
+
settings?: any;
|
|
543
|
+
}[];
|
|
544
|
+
label: string;
|
|
545
|
+
settings_config: boolean;
|
|
546
|
+
is_external: boolean;
|
|
547
|
+
settings?: any;
|
|
548
|
+
}>, "many">;
|
|
549
|
+
user_prompts: z.ZodArray<z.ZodString, "many">;
|
|
550
|
+
shared: z.ZodOptional<z.ZodBoolean>;
|
|
551
|
+
is_react: z.ZodOptional<z.ZodBoolean>;
|
|
552
|
+
is_global: z.ZodOptional<z.ZodBoolean>;
|
|
553
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
554
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
555
|
+
top_p: z.ZodOptional<z.ZodNumber>;
|
|
556
|
+
mcp_servers: z.ZodArray<z.ZodObject<{
|
|
557
|
+
name: z.ZodString;
|
|
558
|
+
description: z.ZodOptional<z.ZodString>;
|
|
559
|
+
enabled: z.ZodBoolean;
|
|
560
|
+
config: z.ZodOptional<z.ZodObject<{
|
|
561
|
+
command: z.ZodString;
|
|
562
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
563
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
564
|
+
auth_token: z.ZodOptional<z.ZodString>;
|
|
565
|
+
}, "strip", z.ZodTypeAny, {
|
|
566
|
+
command: string;
|
|
567
|
+
args?: string[] | undefined;
|
|
568
|
+
env?: Record<string, unknown> | undefined;
|
|
569
|
+
auth_token?: string | undefined;
|
|
570
|
+
}, {
|
|
571
|
+
command: string;
|
|
572
|
+
args?: string[] | undefined;
|
|
573
|
+
env?: Record<string, unknown> | undefined;
|
|
574
|
+
auth_token?: string | undefined;
|
|
575
|
+
}>>;
|
|
576
|
+
mcp_connect_url: z.ZodOptional<z.ZodString>;
|
|
577
|
+
tools_tokens_size_limit: z.ZodOptional<z.ZodNumber>;
|
|
578
|
+
command: z.ZodOptional<z.ZodString>;
|
|
579
|
+
arguments: z.ZodOptional<z.ZodString>;
|
|
580
|
+
settings: z.ZodOptional<z.ZodAny>;
|
|
581
|
+
mcp_connect_auth_token: z.ZodOptional<z.ZodAny>;
|
|
582
|
+
}, "strip", z.ZodTypeAny, {
|
|
583
|
+
name: string;
|
|
584
|
+
enabled: boolean;
|
|
585
|
+
description?: string | undefined;
|
|
586
|
+
settings?: any;
|
|
587
|
+
command?: string | undefined;
|
|
588
|
+
config?: {
|
|
589
|
+
command: string;
|
|
590
|
+
args?: string[] | undefined;
|
|
591
|
+
env?: Record<string, unknown> | undefined;
|
|
592
|
+
auth_token?: string | undefined;
|
|
593
|
+
} | undefined;
|
|
594
|
+
mcp_connect_url?: string | undefined;
|
|
595
|
+
tools_tokens_size_limit?: number | undefined;
|
|
596
|
+
arguments?: string | undefined;
|
|
597
|
+
mcp_connect_auth_token?: any;
|
|
598
|
+
}, {
|
|
599
|
+
name: string;
|
|
600
|
+
enabled: boolean;
|
|
601
|
+
description?: string | undefined;
|
|
602
|
+
settings?: any;
|
|
603
|
+
command?: string | undefined;
|
|
604
|
+
config?: {
|
|
605
|
+
command: string;
|
|
606
|
+
args?: string[] | undefined;
|
|
607
|
+
env?: Record<string, unknown> | undefined;
|
|
608
|
+
auth_token?: string | undefined;
|
|
609
|
+
} | undefined;
|
|
610
|
+
mcp_connect_url?: string | undefined;
|
|
611
|
+
tools_tokens_size_limit?: number | undefined;
|
|
612
|
+
arguments?: string | undefined;
|
|
613
|
+
mcp_connect_auth_token?: any;
|
|
614
|
+
}>, "many">;
|
|
615
|
+
assistant_ids: z.ZodArray<z.ZodString, "many">;
|
|
616
|
+
}, "strip", z.ZodTypeAny, {
|
|
617
|
+
project: string;
|
|
618
|
+
name: string;
|
|
619
|
+
description: string;
|
|
620
|
+
system_prompt: string;
|
|
621
|
+
context: {
|
|
622
|
+
name: string;
|
|
623
|
+
context_type: "knowledge_base" | "code";
|
|
624
|
+
}[];
|
|
625
|
+
llm_model_type: string;
|
|
626
|
+
toolkits: {
|
|
627
|
+
toolkit: string;
|
|
628
|
+
tools: {
|
|
629
|
+
name: string;
|
|
630
|
+
settings_config: boolean;
|
|
631
|
+
label?: string | undefined;
|
|
632
|
+
user_description?: string | undefined;
|
|
633
|
+
settings?: any;
|
|
634
|
+
}[];
|
|
635
|
+
label: string;
|
|
636
|
+
settings_config: boolean;
|
|
637
|
+
is_external: boolean;
|
|
638
|
+
settings?: any;
|
|
639
|
+
}[];
|
|
640
|
+
user_prompts: string[];
|
|
641
|
+
mcp_servers: {
|
|
642
|
+
name: string;
|
|
643
|
+
enabled: boolean;
|
|
644
|
+
description?: string | undefined;
|
|
645
|
+
settings?: any;
|
|
646
|
+
command?: string | undefined;
|
|
647
|
+
config?: {
|
|
648
|
+
command: string;
|
|
649
|
+
args?: string[] | undefined;
|
|
650
|
+
env?: Record<string, unknown> | undefined;
|
|
651
|
+
auth_token?: string | undefined;
|
|
652
|
+
} | undefined;
|
|
653
|
+
mcp_connect_url?: string | undefined;
|
|
654
|
+
tools_tokens_size_limit?: number | undefined;
|
|
655
|
+
arguments?: string | undefined;
|
|
656
|
+
mcp_connect_auth_token?: any;
|
|
657
|
+
}[];
|
|
658
|
+
assistant_ids: string[];
|
|
659
|
+
icon_url?: string | undefined;
|
|
660
|
+
shared?: boolean | undefined;
|
|
661
|
+
is_react?: boolean | undefined;
|
|
662
|
+
is_global?: boolean | undefined;
|
|
663
|
+
slug?: string | undefined;
|
|
664
|
+
temperature?: number | undefined;
|
|
665
|
+
top_p?: number | undefined;
|
|
666
|
+
}, {
|
|
667
|
+
project: string;
|
|
668
|
+
name: string;
|
|
669
|
+
description: string;
|
|
670
|
+
system_prompt: string;
|
|
671
|
+
context: {
|
|
672
|
+
name: string;
|
|
673
|
+
context_type: "knowledge_base" | "code";
|
|
674
|
+
}[];
|
|
675
|
+
llm_model_type: string;
|
|
676
|
+
toolkits: {
|
|
677
|
+
toolkit: string;
|
|
678
|
+
tools: {
|
|
679
|
+
name: string;
|
|
680
|
+
settings_config: boolean;
|
|
681
|
+
label?: string | undefined;
|
|
682
|
+
user_description?: string | undefined;
|
|
683
|
+
settings?: any;
|
|
684
|
+
}[];
|
|
685
|
+
label: string;
|
|
686
|
+
settings_config: boolean;
|
|
687
|
+
is_external: boolean;
|
|
688
|
+
settings?: any;
|
|
689
|
+
}[];
|
|
690
|
+
user_prompts: string[];
|
|
691
|
+
mcp_servers: {
|
|
692
|
+
name: string;
|
|
693
|
+
enabled: boolean;
|
|
694
|
+
description?: string | undefined;
|
|
695
|
+
settings?: any;
|
|
696
|
+
command?: string | undefined;
|
|
697
|
+
config?: {
|
|
698
|
+
command: string;
|
|
699
|
+
args?: string[] | undefined;
|
|
700
|
+
env?: Record<string, unknown> | undefined;
|
|
701
|
+
auth_token?: string | undefined;
|
|
702
|
+
} | undefined;
|
|
703
|
+
mcp_connect_url?: string | undefined;
|
|
704
|
+
tools_tokens_size_limit?: number | undefined;
|
|
705
|
+
arguments?: string | undefined;
|
|
706
|
+
mcp_connect_auth_token?: any;
|
|
707
|
+
}[];
|
|
708
|
+
assistant_ids: string[];
|
|
709
|
+
icon_url?: string | undefined;
|
|
710
|
+
shared?: boolean | undefined;
|
|
711
|
+
is_react?: boolean | undefined;
|
|
712
|
+
is_global?: boolean | undefined;
|
|
713
|
+
slug?: string | undefined;
|
|
714
|
+
temperature?: number | undefined;
|
|
715
|
+
top_p?: number | undefined;
|
|
716
|
+
}>>;
|
|
717
|
+
type AssistantUpdateParams = z.infer<typeof AssistantUpdateParamsSchema>;
|
|
718
|
+
declare const AssistantChatParamsSchema: z.ZodReadonly<z.ZodObject<{
|
|
719
|
+
conversation_id: z.ZodOptional<z.ZodString>;
|
|
720
|
+
text: z.ZodString;
|
|
721
|
+
content_raw: z.ZodOptional<z.ZodString>;
|
|
722
|
+
file_name: z.ZodOptional<z.ZodString>;
|
|
723
|
+
llm_model: z.ZodOptional<z.ZodString>;
|
|
724
|
+
history: z.ZodUnion<[z.ZodArray<z.ZodObject<{
|
|
725
|
+
role: z.ZodEnum<["Assistant", "User"]>;
|
|
726
|
+
message: z.ZodOptional<z.ZodString>;
|
|
727
|
+
}, "strip", z.ZodTypeAny, {
|
|
728
|
+
role: "Assistant" | "User";
|
|
729
|
+
message?: string | undefined;
|
|
730
|
+
}, {
|
|
731
|
+
role: "Assistant" | "User";
|
|
732
|
+
message?: string | undefined;
|
|
733
|
+
}>, "many">, z.ZodString]>;
|
|
734
|
+
history_index: z.ZodOptional<z.ZodNumber>;
|
|
735
|
+
stream: z.ZodOptional<z.ZodBoolean>;
|
|
736
|
+
top_k: z.ZodOptional<z.ZodNumber>;
|
|
737
|
+
system_prompt: z.ZodOptional<z.ZodString>;
|
|
738
|
+
background_task: z.ZodOptional<z.ZodBoolean>;
|
|
739
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
740
|
+
}, "strip", z.ZodTypeAny, {
|
|
741
|
+
text: string;
|
|
742
|
+
history: string | {
|
|
743
|
+
role: "Assistant" | "User";
|
|
744
|
+
message?: string | undefined;
|
|
745
|
+
}[];
|
|
746
|
+
system_prompt?: string | undefined;
|
|
747
|
+
conversation_id?: string | undefined;
|
|
748
|
+
content_raw?: string | undefined;
|
|
749
|
+
file_name?: string | undefined;
|
|
750
|
+
llm_model?: string | undefined;
|
|
751
|
+
history_index?: number | undefined;
|
|
752
|
+
stream?: boolean | undefined;
|
|
753
|
+
top_k?: number | undefined;
|
|
754
|
+
background_task?: boolean | undefined;
|
|
755
|
+
metadata?: Record<string, unknown> | undefined;
|
|
756
|
+
}, {
|
|
757
|
+
text: string;
|
|
758
|
+
history: string | {
|
|
759
|
+
role: "Assistant" | "User";
|
|
760
|
+
message?: string | undefined;
|
|
761
|
+
}[];
|
|
762
|
+
system_prompt?: string | undefined;
|
|
763
|
+
conversation_id?: string | undefined;
|
|
764
|
+
content_raw?: string | undefined;
|
|
765
|
+
file_name?: string | undefined;
|
|
766
|
+
llm_model?: string | undefined;
|
|
767
|
+
history_index?: number | undefined;
|
|
768
|
+
stream?: boolean | undefined;
|
|
769
|
+
top_k?: number | undefined;
|
|
770
|
+
background_task?: boolean | undefined;
|
|
771
|
+
metadata?: Record<string, unknown> | undefined;
|
|
772
|
+
}>>;
|
|
773
|
+
type AssistantChatParams = z.infer<typeof AssistantChatParamsSchema>;
|
|
774
|
+
|
|
775
|
+
declare class AssistantService {
|
|
776
|
+
private api;
|
|
777
|
+
constructor(apiDomain: string, token: string, verifySSL?: boolean);
|
|
778
|
+
/**
|
|
779
|
+
* Get list of available assistants.
|
|
780
|
+
*/
|
|
781
|
+
list(_params?: AssistantListParams): Promise<(Assistant | AssistantBase)[]>;
|
|
782
|
+
/**
|
|
783
|
+
* Get assistant by ID.
|
|
784
|
+
*/
|
|
785
|
+
get(assistantId: string): Promise<Assistant>;
|
|
786
|
+
/**
|
|
787
|
+
* Get assistant by slug.
|
|
788
|
+
*/
|
|
789
|
+
getBySlug(slug: string): Promise<Assistant>;
|
|
790
|
+
/**
|
|
791
|
+
* Create a new assistant.
|
|
792
|
+
*/
|
|
793
|
+
create(_params: AssistantCreateParams): Promise<AnyJson>;
|
|
794
|
+
/**
|
|
795
|
+
* Update an existing assistant.
|
|
796
|
+
*/
|
|
797
|
+
update(assistantId: string, _params: AssistantUpdateParams): Promise<AnyJson>;
|
|
798
|
+
/**
|
|
799
|
+
* Get list of available tools.
|
|
800
|
+
*/
|
|
801
|
+
getTools(): Promise<ToolKitDetails[]>;
|
|
802
|
+
/**
|
|
803
|
+
* Delete an assistant by ID.
|
|
804
|
+
*/
|
|
805
|
+
delete(assistantId: string): Promise<AnyJson>;
|
|
806
|
+
/**
|
|
807
|
+
* Get list of prebuilt assistants.
|
|
808
|
+
*/
|
|
809
|
+
getPrebuilt(): Promise<Assistant[]>;
|
|
810
|
+
/**
|
|
811
|
+
* Get prebuilt assistant by slug.
|
|
812
|
+
*/
|
|
813
|
+
getPrebuiltBySlug(slug: string): Promise<Assistant>;
|
|
814
|
+
/**
|
|
815
|
+
* Send a chat request to an assistant.
|
|
816
|
+
*/
|
|
817
|
+
chat(assistantId: string, _params: AssistantChatParams): Promise<BaseModelResponse>;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
/** Models for datasource service. */
|
|
821
|
+
|
|
822
|
+
/** Code datasource type options */
|
|
823
|
+
declare const CodeDataSourceType: {
|
|
824
|
+
readonly CODE: "code";
|
|
825
|
+
readonly SUMMARY: "summary";
|
|
826
|
+
readonly CHUNK_SUMMARY: "chunk-summary";
|
|
827
|
+
};
|
|
828
|
+
type CodeDataSourceTypeType = (typeof CodeDataSourceType)[keyof typeof CodeDataSourceType];
|
|
829
|
+
/** Datasource type options */
|
|
830
|
+
declare const DataSourceType: {
|
|
831
|
+
readonly CODE: "code";
|
|
832
|
+
readonly CONFLUENCE: "knowledge_base_confluence";
|
|
833
|
+
readonly JIRA: "knowledge_base_jira";
|
|
834
|
+
readonly FILE: "knowledge_base_file";
|
|
835
|
+
readonly GOOGLE: "llm_routing_google";
|
|
836
|
+
readonly PROVIDER: "provider";
|
|
837
|
+
readonly SUMMARY: "summary";
|
|
838
|
+
readonly CHUNK_SUMMARY: "chunk-summary";
|
|
839
|
+
readonly JSON: "knowledge_base_json";
|
|
840
|
+
};
|
|
841
|
+
type DataSourceTypeType = (typeof DataSourceType)[keyof typeof DataSourceType];
|
|
842
|
+
/** Datasource status options */
|
|
843
|
+
declare const DataSourceStatus: {
|
|
844
|
+
readonly COMPLETED: "completed";
|
|
845
|
+
readonly FAILED: "failed";
|
|
846
|
+
readonly FETCHING: "fetching";
|
|
847
|
+
readonly IN_PROGRESS: "in_progress";
|
|
848
|
+
};
|
|
849
|
+
type DataSourceStatusType = (typeof DataSourceStatus)[keyof typeof DataSourceStatus];
|
|
850
|
+
/** Base file model for file datasources */
|
|
851
|
+
type File = Readonly<{
|
|
852
|
+
/** File name */
|
|
853
|
+
name: string;
|
|
854
|
+
/** File content */
|
|
855
|
+
content: string | Buffer<ArrayBuffer>;
|
|
856
|
+
/** MIME type of the file */
|
|
857
|
+
mime_type: string;
|
|
858
|
+
}>;
|
|
859
|
+
/** Confluence-specific configuration */
|
|
860
|
+
interface Confluence {
|
|
861
|
+
cql: string;
|
|
862
|
+
include_restricted_content?: boolean;
|
|
863
|
+
include_archived_content?: boolean;
|
|
864
|
+
include_attachments?: boolean;
|
|
865
|
+
include_comments?: boolean;
|
|
866
|
+
keep_markdown_format?: boolean;
|
|
867
|
+
keep_newlines?: boolean;
|
|
868
|
+
max_pages?: boolean;
|
|
869
|
+
pages_per_request?: boolean;
|
|
870
|
+
}
|
|
871
|
+
/** Jira-specific configuration */
|
|
872
|
+
interface Jira {
|
|
873
|
+
jql: string;
|
|
874
|
+
}
|
|
875
|
+
/** Google-specific configuration */
|
|
876
|
+
interface Google {
|
|
877
|
+
googleDoc: string;
|
|
878
|
+
}
|
|
879
|
+
/** File-specific configuration */
|
|
880
|
+
interface Files {
|
|
881
|
+
files: File[];
|
|
882
|
+
}
|
|
883
|
+
/** Code repository configuration */
|
|
884
|
+
interface Code {
|
|
885
|
+
settingId: string;
|
|
886
|
+
projectSpaceVisible?: boolean;
|
|
887
|
+
link: string;
|
|
888
|
+
branch: string;
|
|
889
|
+
indexType: CodeDataSourceTypeType;
|
|
890
|
+
filesFilter?: string;
|
|
891
|
+
embeddingsModel?: string;
|
|
892
|
+
summarizationModel?: string;
|
|
893
|
+
prompt?: string;
|
|
894
|
+
docsGeneration?: boolean;
|
|
895
|
+
}
|
|
896
|
+
/** Base data source DTO */
|
|
897
|
+
interface BaseDataSourceCreateDto {
|
|
898
|
+
name: string;
|
|
899
|
+
project_name: string;
|
|
900
|
+
description: string;
|
|
901
|
+
project_space_visible: boolean;
|
|
902
|
+
setting_id: string | null;
|
|
903
|
+
type: DataSourceTypeType;
|
|
904
|
+
}
|
|
905
|
+
interface ConfluenceDataSourceCreateDto extends BaseDataSourceCreateDto, Confluence {
|
|
906
|
+
type: typeof DataSourceType.CONFLUENCE;
|
|
907
|
+
}
|
|
908
|
+
interface JiraDataSourceCreateDto extends BaseDataSourceCreateDto, Jira {
|
|
909
|
+
type: typeof DataSourceType.JIRA;
|
|
910
|
+
}
|
|
911
|
+
interface GoogleDataSourceCreateDto extends BaseDataSourceCreateDto, Google {
|
|
912
|
+
type: typeof DataSourceType.GOOGLE;
|
|
913
|
+
}
|
|
914
|
+
interface FileDataSourceCreateDto extends BaseDataSourceCreateDto, Files {
|
|
915
|
+
type: typeof DataSourceType.FILE;
|
|
916
|
+
}
|
|
917
|
+
interface CodeDataSourceCreateDto extends Omit<BaseDataSourceCreateDto, "setting_id" | "project_space_visible">, Code {
|
|
918
|
+
type: typeof DataSourceType.CODE;
|
|
919
|
+
}
|
|
920
|
+
type DataSourceCreateDto = ConfluenceDataSourceCreateDto | JiraDataSourceCreateDto | GoogleDataSourceCreateDto | FileDataSourceCreateDto | CodeDataSourceCreateDto | BaseDataSourceCreateDto;
|
|
921
|
+
/** Base data source update DTO */
|
|
922
|
+
interface BaseDataSourceUpdateDto {
|
|
923
|
+
name: string;
|
|
924
|
+
project_name: string;
|
|
925
|
+
description?: string;
|
|
926
|
+
project_space_visible?: boolean;
|
|
927
|
+
setting_id?: string | null;
|
|
928
|
+
type: DataSourceTypeType;
|
|
929
|
+
full_reindex?: boolean;
|
|
930
|
+
skip_reindex?: boolean;
|
|
931
|
+
resume_indexing?: boolean;
|
|
932
|
+
incremental_reindex?: boolean;
|
|
933
|
+
}
|
|
934
|
+
interface ConfluenceDataSourceUpdateDto extends BaseDataSourceUpdateDto, Partial<Confluence> {
|
|
935
|
+
type: typeof DataSourceType.CONFLUENCE;
|
|
936
|
+
}
|
|
937
|
+
interface JiraDataSourceUpdateDto extends BaseDataSourceUpdateDto, Partial<Jira> {
|
|
938
|
+
type: typeof DataSourceType.JIRA;
|
|
939
|
+
}
|
|
940
|
+
interface GoogleDataSourceUpdateDto extends BaseDataSourceUpdateDto, Partial<Google> {
|
|
941
|
+
type: typeof DataSourceType.GOOGLE;
|
|
942
|
+
}
|
|
943
|
+
interface FileDataSourceUpdateDto extends BaseDataSourceUpdateDto, Partial<Files> {
|
|
944
|
+
type: typeof DataSourceType.FILE;
|
|
945
|
+
}
|
|
946
|
+
interface CodeDataSourceUpdateDto extends Omit<BaseDataSourceUpdateDto, "setting_id" | "project_space_visible">, Partial<Code> {
|
|
947
|
+
type: typeof DataSourceType.CODE;
|
|
948
|
+
}
|
|
949
|
+
type DataSourceUpdateDto = ConfluenceDataSourceUpdateDto | JiraDataSourceUpdateDto | GoogleDataSourceUpdateDto | FileDataSourceUpdateDto | CodeDataSourceUpdateDto | BaseDataSourceUpdateDto;
|
|
950
|
+
/** Processing information for datasource */
|
|
951
|
+
interface DataSourceProcessingInfoResponse {
|
|
952
|
+
/** Total number of documents processed */
|
|
953
|
+
total_documents?: number;
|
|
954
|
+
/** Number of documents skipped */
|
|
955
|
+
skipped_documents?: number;
|
|
956
|
+
/** Total size in kilobytes */
|
|
957
|
+
total_size_kb?: number;
|
|
958
|
+
/** Average file size in bytes */
|
|
959
|
+
average_file_size_bytes?: number;
|
|
960
|
+
/** List of unique file extensions */
|
|
961
|
+
unique_extensions?: string[];
|
|
962
|
+
/** Filtered documents count or list */
|
|
963
|
+
filtered_documents?: number | string[];
|
|
964
|
+
/** Number of processed documents */
|
|
965
|
+
documents_count_key?: number;
|
|
966
|
+
}
|
|
967
|
+
/** Processing information for datasource */
|
|
968
|
+
interface DataSourceProcessingInfo {
|
|
969
|
+
/** Total number of documents processed */
|
|
970
|
+
total_documents_count?: number;
|
|
971
|
+
/** Number of documents skipped */
|
|
972
|
+
skipped_documents_count?: number;
|
|
973
|
+
/** Total size in kilobytes */
|
|
974
|
+
total_size_kb?: number;
|
|
975
|
+
/** Average file size in bytes */
|
|
976
|
+
average_file_size_bytes?: number;
|
|
977
|
+
/** List of unique file extensions */
|
|
978
|
+
unique_extensions?: string[];
|
|
979
|
+
/** Filtered documents count or list */
|
|
980
|
+
filtered_documents?: number | string[];
|
|
981
|
+
/** Number of processed documents */
|
|
982
|
+
processed_documents_count?: number;
|
|
983
|
+
}
|
|
984
|
+
/** Datasource response interface */
|
|
985
|
+
interface DataSourceResponse {
|
|
986
|
+
/** Unique identifier */
|
|
987
|
+
id: string;
|
|
988
|
+
/** Project name */
|
|
989
|
+
project_name: string;
|
|
990
|
+
/** Datasource name */
|
|
991
|
+
repo_name: string;
|
|
992
|
+
/** Description */
|
|
993
|
+
description?: string;
|
|
994
|
+
/** Type of datasource */
|
|
995
|
+
index_type: DataSourceTypeType;
|
|
996
|
+
/** Embeddings model used */
|
|
997
|
+
embeddings_model?: string;
|
|
998
|
+
/** Current status */
|
|
999
|
+
status: DataSourceStatusType;
|
|
1000
|
+
/** Setting ID reference */
|
|
1001
|
+
setting_id?: string;
|
|
1002
|
+
/** Creation date */
|
|
1003
|
+
date: string;
|
|
1004
|
+
/** Creator information */
|
|
1005
|
+
created_by: BaseUser;
|
|
1006
|
+
/** Whether shared with project */
|
|
1007
|
+
project_space_visible: boolean;
|
|
1008
|
+
/** Last update date */
|
|
1009
|
+
update_date: string;
|
|
1010
|
+
/** Error message if failed */
|
|
1011
|
+
text?: string;
|
|
1012
|
+
/** User abilities list */
|
|
1013
|
+
user_abilities: string[];
|
|
1014
|
+
/** Processing information */
|
|
1015
|
+
processing_info?: DataSourceProcessingInfoResponse;
|
|
1016
|
+
/** List of processed documents */
|
|
1017
|
+
processed_files?: string[];
|
|
1018
|
+
/** Token usage statistics */
|
|
1019
|
+
tokens_usage?: TokensUsage;
|
|
1020
|
+
/** Code-specific configuration */
|
|
1021
|
+
code?: Code;
|
|
1022
|
+
/** Jira-specific configuration */
|
|
1023
|
+
jira?: Jira;
|
|
1024
|
+
/** Confluence-specific configuration */
|
|
1025
|
+
confluence?: Confluence;
|
|
1026
|
+
/** Google document link */
|
|
1027
|
+
google_doc_link?: string;
|
|
1028
|
+
}
|
|
1029
|
+
/** Datasource model */
|
|
1030
|
+
interface DataSource {
|
|
1031
|
+
/** Unique identifier */
|
|
1032
|
+
id: string;
|
|
1033
|
+
/** Project name */
|
|
1034
|
+
project_name: string;
|
|
1035
|
+
/** Datasource name */
|
|
1036
|
+
name: string;
|
|
1037
|
+
/** Description */
|
|
1038
|
+
description?: string;
|
|
1039
|
+
/** Type of datasource */
|
|
1040
|
+
type: DataSourceTypeType;
|
|
1041
|
+
/** Embeddings model used */
|
|
1042
|
+
embeddings_model?: string;
|
|
1043
|
+
/** Current status */
|
|
1044
|
+
status: DataSourceStatusType;
|
|
1045
|
+
/** Setting ID reference */
|
|
1046
|
+
setting_id?: string;
|
|
1047
|
+
/** Creation date */
|
|
1048
|
+
created_date: string;
|
|
1049
|
+
/** Creator information */
|
|
1050
|
+
created_by: BaseUser;
|
|
1051
|
+
/** Whether shared with project */
|
|
1052
|
+
shared_with_project: boolean;
|
|
1053
|
+
/** Last update date */
|
|
1054
|
+
update_date: string;
|
|
1055
|
+
/** Error message if failed */
|
|
1056
|
+
error_message?: string;
|
|
1057
|
+
/** User abilities list */
|
|
1058
|
+
user_abilities: string[];
|
|
1059
|
+
/** Processing information */
|
|
1060
|
+
processing_info?: DataSourceProcessingInfo;
|
|
1061
|
+
/** List of processed documents */
|
|
1062
|
+
processed_documents?: string[];
|
|
1063
|
+
/** Token usage statistics */
|
|
1064
|
+
tokens_usage?: TokensUsage;
|
|
1065
|
+
/** Code-specific configuration */
|
|
1066
|
+
code?: Code;
|
|
1067
|
+
/** Jira-specific configuration */
|
|
1068
|
+
jira?: Jira;
|
|
1069
|
+
/** Confluence-specific configuration */
|
|
1070
|
+
confluence?: Confluence;
|
|
1071
|
+
/** Google document link */
|
|
1072
|
+
google_doc_link?: string;
|
|
1073
|
+
}
|
|
1074
|
+
/** DataSource fetch parameters */
|
|
1075
|
+
type DataSourceListParams = {
|
|
1076
|
+
page?: number;
|
|
1077
|
+
per_page?: number;
|
|
1078
|
+
sort_key?: "date" | "update_date";
|
|
1079
|
+
sort_order?: SortOrder;
|
|
1080
|
+
datasource_types?: DataSourceTypeType[];
|
|
1081
|
+
projects?: string[];
|
|
1082
|
+
owner?: string;
|
|
1083
|
+
status?: DataSourceStatusType;
|
|
1084
|
+
};
|
|
1085
|
+
interface BaseConfluenceParams {
|
|
1086
|
+
/** Confluence Query Language string */
|
|
1087
|
+
cql: string;
|
|
1088
|
+
/** Include restricted content */
|
|
1089
|
+
include_restricted_content?: boolean;
|
|
1090
|
+
/** Include archived content */
|
|
1091
|
+
include_archived_content?: boolean;
|
|
1092
|
+
/** Include attachments */
|
|
1093
|
+
include_attachments?: boolean;
|
|
1094
|
+
/** Include comments */
|
|
1095
|
+
include_comments?: boolean;
|
|
1096
|
+
/** Keep markdown format */
|
|
1097
|
+
keep_markdown_format?: boolean;
|
|
1098
|
+
/** Keep newlines */
|
|
1099
|
+
keep_newlines?: boolean;
|
|
1100
|
+
/** Maximum pages to fetch */
|
|
1101
|
+
max_pages?: number;
|
|
1102
|
+
/** Pages per request */
|
|
1103
|
+
pages_per_request?: number;
|
|
1104
|
+
}
|
|
1105
|
+
interface BaseJiraParams {
|
|
1106
|
+
/** Jira Query Language string */
|
|
1107
|
+
jql: string;
|
|
1108
|
+
}
|
|
1109
|
+
/** File-specific configuration */
|
|
1110
|
+
interface BaseFileParams {
|
|
1111
|
+
/** List of files with their content and mime type */
|
|
1112
|
+
files: File[];
|
|
1113
|
+
}
|
|
1114
|
+
/** Google-specific configuration */
|
|
1115
|
+
interface BaseGoogleParams {
|
|
1116
|
+
/** Google document ID or URL */
|
|
1117
|
+
google_doc: string;
|
|
1118
|
+
}
|
|
1119
|
+
/** Code repository configuration */
|
|
1120
|
+
interface BaseCodeParams {
|
|
1121
|
+
/** Repository URL */
|
|
1122
|
+
link: string;
|
|
1123
|
+
/** Branch name */
|
|
1124
|
+
branch: string;
|
|
1125
|
+
/** Type of index to create */
|
|
1126
|
+
index_type: CodeDataSourceTypeType;
|
|
1127
|
+
/** Files filter pattern */
|
|
1128
|
+
files_filter?: string;
|
|
1129
|
+
/** Embeddings model to use */
|
|
1130
|
+
embeddings_model?: string;
|
|
1131
|
+
/** Summarization model to use */
|
|
1132
|
+
summarization_model?: string;
|
|
1133
|
+
/** Custom summarization prompt */
|
|
1134
|
+
prompt?: string;
|
|
1135
|
+
/** Enable documentation generation */
|
|
1136
|
+
docs_generation?: boolean;
|
|
1137
|
+
}
|
|
1138
|
+
interface BaseDataSourceCreateParams {
|
|
1139
|
+
/** Name of the datasource */
|
|
1140
|
+
name: string;
|
|
1141
|
+
/** Project name */
|
|
1142
|
+
project_name: string;
|
|
1143
|
+
/** Description of the datasource */
|
|
1144
|
+
description: string;
|
|
1145
|
+
/** Whether to share with project */
|
|
1146
|
+
shared_with_project: boolean;
|
|
1147
|
+
/** Setting ID reference */
|
|
1148
|
+
setting_id: string | null;
|
|
1149
|
+
/** Type of datasource */
|
|
1150
|
+
type: DataSourceTypeType;
|
|
1151
|
+
}
|
|
1152
|
+
interface ConfluenceDataSourceCreateParams extends BaseDataSourceCreateParams, BaseConfluenceParams {
|
|
1153
|
+
type: typeof DataSourceType.CONFLUENCE;
|
|
1154
|
+
}
|
|
1155
|
+
interface JiraDataSourceCreateParams extends BaseDataSourceCreateParams, BaseJiraParams {
|
|
1156
|
+
type: typeof DataSourceType.JIRA;
|
|
1157
|
+
}
|
|
1158
|
+
interface GoogleDataSourceCreateParams extends BaseDataSourceCreateParams, BaseGoogleParams {
|
|
1159
|
+
type: typeof DataSourceType.GOOGLE;
|
|
1160
|
+
}
|
|
1161
|
+
interface FileDataSourceCreateParams extends BaseDataSourceCreateParams, BaseFileParams {
|
|
1162
|
+
type: typeof DataSourceType.FILE;
|
|
1163
|
+
}
|
|
1164
|
+
interface CodeDataSourceCreateParams extends BaseDataSourceCreateParams, BaseCodeParams {
|
|
1165
|
+
type: typeof DataSourceType.CODE;
|
|
1166
|
+
}
|
|
1167
|
+
interface OtherDataSourceCreateParams extends BaseDataSourceCreateParams {
|
|
1168
|
+
type: typeof DataSourceType.PROVIDER | typeof DataSourceType.SUMMARY | typeof DataSourceType.CHUNK_SUMMARY | typeof DataSourceType.JSON;
|
|
1169
|
+
}
|
|
1170
|
+
/** DataSource create parameters */
|
|
1171
|
+
type DataSourceCreateParams = ConfluenceDataSourceCreateParams | JiraDataSourceCreateParams | GoogleDataSourceCreateParams | FileDataSourceCreateParams | CodeDataSourceCreateParams | OtherDataSourceCreateParams;
|
|
1172
|
+
interface BaseDataSourceUpdateParams {
|
|
1173
|
+
/** Type of datasource */
|
|
1174
|
+
type: DataSourceTypeType;
|
|
1175
|
+
/** Name of the datasource */
|
|
1176
|
+
name: string;
|
|
1177
|
+
/** Project name */
|
|
1178
|
+
project_name: string;
|
|
1179
|
+
/** Description of the datasource */
|
|
1180
|
+
description?: string;
|
|
1181
|
+
/** Whether to share with project */
|
|
1182
|
+
shared_with_project?: boolean;
|
|
1183
|
+
/** Setting ID reference */
|
|
1184
|
+
setting_id?: string | null;
|
|
1185
|
+
/** Perform full reindex */
|
|
1186
|
+
full_reindex?: boolean;
|
|
1187
|
+
/** Skip reindex operation */
|
|
1188
|
+
skip_reindex?: boolean;
|
|
1189
|
+
/** Resume interrupted indexing */
|
|
1190
|
+
resume_indexing?: boolean;
|
|
1191
|
+
/** Perform incremental reindex */
|
|
1192
|
+
incremental_reindex?: boolean;
|
|
1193
|
+
}
|
|
1194
|
+
interface ConfluenceDataSourceUpdateParams extends BaseDataSourceUpdateParams, Partial<BaseConfluenceParams> {
|
|
1195
|
+
type: typeof DataSourceType.CONFLUENCE;
|
|
1196
|
+
}
|
|
1197
|
+
interface JiraDataSourceUpdateParams extends BaseDataSourceUpdateParams, Partial<BaseJiraParams> {
|
|
1198
|
+
type: typeof DataSourceType.JIRA;
|
|
1199
|
+
}
|
|
1200
|
+
interface GoogleDataSourceUpdateParams extends BaseDataSourceUpdateParams, Partial<BaseGoogleParams> {
|
|
1201
|
+
type: typeof DataSourceType.GOOGLE;
|
|
1202
|
+
}
|
|
1203
|
+
interface FileDataSourceUpdateParams extends BaseDataSourceUpdateParams, Partial<BaseFileParams> {
|
|
1204
|
+
type: typeof DataSourceType.FILE;
|
|
1205
|
+
}
|
|
1206
|
+
interface CodeDataSourceUpdateParams extends BaseDataSourceUpdateParams, Partial<BaseCodeParams> {
|
|
1207
|
+
type: typeof DataSourceType.CODE;
|
|
1208
|
+
}
|
|
1209
|
+
interface OtherDataSourceUpdateParams extends BaseDataSourceUpdateParams {
|
|
1210
|
+
type: typeof DataSourceType.PROVIDER | typeof DataSourceType.SUMMARY | typeof DataSourceType.CHUNK_SUMMARY | typeof DataSourceType.JSON;
|
|
1211
|
+
}
|
|
1212
|
+
/** DataSource update parameters */
|
|
1213
|
+
type DataSourceUpdateParams = ConfluenceDataSourceUpdateParams | JiraDataSourceUpdateParams | GoogleDataSourceUpdateParams | FileDataSourceUpdateParams | CodeDataSourceUpdateParams | OtherDataSourceUpdateParams;
|
|
1214
|
+
|
|
1215
|
+
declare class DatasourceService {
|
|
1216
|
+
private api;
|
|
1217
|
+
constructor(apiDomain: string, token: string, verifySSL?: boolean);
|
|
1218
|
+
/**
|
|
1219
|
+
* Create a new datasource.
|
|
1220
|
+
*/
|
|
1221
|
+
create(params: DataSourceCreateParams): Promise<AnyJson>;
|
|
1222
|
+
/**
|
|
1223
|
+
* Create a file datasource.
|
|
1224
|
+
*/
|
|
1225
|
+
private createFileDatasource;
|
|
1226
|
+
/**
|
|
1227
|
+
* Update an existing datasource.
|
|
1228
|
+
*/
|
|
1229
|
+
update(params: DataSourceUpdateParams): Promise<AnyJson>;
|
|
1230
|
+
/**
|
|
1231
|
+
* List datasources with pagination and filtering support.
|
|
1232
|
+
*/
|
|
1233
|
+
list(params?: DataSourceListParams): Promise<DataSource[]>;
|
|
1234
|
+
/**
|
|
1235
|
+
* Get datasource by ID.
|
|
1236
|
+
*/
|
|
1237
|
+
get(datasourceId: string): Promise<DataSource>;
|
|
1238
|
+
/**
|
|
1239
|
+
* Delete a datasource by ID.
|
|
1240
|
+
*/
|
|
1241
|
+
delete(datasourceId: string): Promise<AnyJson>;
|
|
1242
|
+
private getCreateDatasourceUrl;
|
|
1243
|
+
private getKnowledgeBaseParam;
|
|
1244
|
+
/**
|
|
1245
|
+
* Validates update parameters for reindexing.
|
|
1246
|
+
* @throws {Error} If the update parameters are invalid for the given datasource type.
|
|
1247
|
+
*/
|
|
1248
|
+
private validateUpdateReindexParams;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
declare const IntegrationListParamsSchema: z.ZodReadonly<z.ZodObject<{
|
|
1252
|
+
setting_type: z.ZodDefault<z.ZodEnum<["user", "project"]>>;
|
|
1253
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
1254
|
+
per_page: z.ZodDefault<z.ZodNumber>;
|
|
1255
|
+
filters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1256
|
+
}, "strip", z.ZodTypeAny, {
|
|
1257
|
+
page: number;
|
|
1258
|
+
per_page: number;
|
|
1259
|
+
setting_type: "user" | "project";
|
|
1260
|
+
filters?: Record<string, unknown> | undefined;
|
|
1261
|
+
}, {
|
|
1262
|
+
page?: number | undefined;
|
|
1263
|
+
per_page?: number | undefined;
|
|
1264
|
+
filters?: Record<string, unknown> | undefined;
|
|
1265
|
+
setting_type?: "user" | "project" | undefined;
|
|
1266
|
+
}>>;
|
|
1267
|
+
type IntegrationListParams = Partial<z.infer<typeof IntegrationListParamsSchema>>;
|
|
1268
|
+
declare const IntegrationGetParamsSchema: z.ZodReadonly<z.ZodObject<{
|
|
1269
|
+
integration_id: z.ZodString;
|
|
1270
|
+
setting_type: z.ZodDefault<z.ZodEnum<["user", "project"]>>;
|
|
1271
|
+
}, "strip", z.ZodTypeAny, {
|
|
1272
|
+
setting_type: "user" | "project";
|
|
1273
|
+
integration_id: string;
|
|
1274
|
+
}, {
|
|
1275
|
+
integration_id: string;
|
|
1276
|
+
setting_type?: "user" | "project" | undefined;
|
|
1277
|
+
}>>;
|
|
1278
|
+
type IntegrationGetParams = z.infer<typeof IntegrationGetParamsSchema>;
|
|
1279
|
+
declare const IntegrationGetByAliasParamsSchema: z.ZodReadonly<z.ZodObject<{
|
|
1280
|
+
alias: z.ZodString;
|
|
1281
|
+
setting_type: z.ZodDefault<z.ZodEnum<["user", "project"]>>;
|
|
1282
|
+
}, "strip", z.ZodTypeAny, {
|
|
1283
|
+
setting_type: "user" | "project";
|
|
1284
|
+
alias: string;
|
|
1285
|
+
}, {
|
|
1286
|
+
alias: string;
|
|
1287
|
+
setting_type?: "user" | "project" | undefined;
|
|
1288
|
+
}>>;
|
|
1289
|
+
type IntegrationGetByAliasParams = Omit<z.infer<typeof IntegrationGetByAliasParamsSchema>, "setting_type"> & {
|
|
1290
|
+
setting_type?: IntegrationTypeType;
|
|
1291
|
+
};
|
|
1292
|
+
declare const IntegrationCreateParamsSchema: z.ZodReadonly<z.ZodObject<{
|
|
1293
|
+
credential_type: z.ZodEnum<[string, ...string[]]>;
|
|
1294
|
+
credential_values: z.ZodArray<z.ZodObject<{
|
|
1295
|
+
key: z.ZodString;
|
|
1296
|
+
value: z.ZodUnknown;
|
|
1297
|
+
}, "strip", z.ZodTypeAny, {
|
|
1298
|
+
key: string;
|
|
1299
|
+
value?: unknown;
|
|
1300
|
+
}, {
|
|
1301
|
+
key: string;
|
|
1302
|
+
value?: unknown;
|
|
1303
|
+
}>, "many">;
|
|
1304
|
+
project_name: z.ZodString;
|
|
1305
|
+
setting_type: z.ZodDefault<z.ZodEnum<["user", "project"]>>;
|
|
1306
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
1307
|
+
default: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1308
|
+
project: z.ZodOptional<z.ZodString>;
|
|
1309
|
+
enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1310
|
+
external_id: z.ZodOptional<z.ZodString>;
|
|
1311
|
+
}, "strip", z.ZodTypeAny, {
|
|
1312
|
+
project_name: string;
|
|
1313
|
+
enabled: boolean;
|
|
1314
|
+
default: boolean;
|
|
1315
|
+
setting_type: "user" | "project";
|
|
1316
|
+
credential_type: string;
|
|
1317
|
+
credential_values: {
|
|
1318
|
+
key: string;
|
|
1319
|
+
value?: unknown;
|
|
1320
|
+
}[];
|
|
1321
|
+
project?: string | undefined;
|
|
1322
|
+
alias?: string | undefined;
|
|
1323
|
+
external_id?: string | undefined;
|
|
1324
|
+
}, {
|
|
1325
|
+
project_name: string;
|
|
1326
|
+
credential_type: string;
|
|
1327
|
+
credential_values: {
|
|
1328
|
+
key: string;
|
|
1329
|
+
value?: unknown;
|
|
1330
|
+
}[];
|
|
1331
|
+
project?: string | undefined;
|
|
1332
|
+
enabled?: boolean | undefined;
|
|
1333
|
+
default?: boolean | undefined;
|
|
1334
|
+
setting_type?: "user" | "project" | undefined;
|
|
1335
|
+
alias?: string | undefined;
|
|
1336
|
+
external_id?: string | undefined;
|
|
1337
|
+
}>>;
|
|
1338
|
+
type IntegrationCreateParams = Omit<z.infer<typeof IntegrationCreateParamsSchema>, "default" | "enabled"> & {
|
|
1339
|
+
default?: boolean;
|
|
1340
|
+
enabled?: boolean;
|
|
1341
|
+
};
|
|
1342
|
+
declare const IntegrationUpdateParamsSchema: z.ZodReadonly<z.ZodObject<{
|
|
1343
|
+
credential_type: z.ZodEnum<[string, ...string[]]>;
|
|
1344
|
+
credential_values: z.ZodArray<z.ZodObject<{
|
|
1345
|
+
key: z.ZodString;
|
|
1346
|
+
value: z.ZodUnknown;
|
|
1347
|
+
}, "strip", z.ZodTypeAny, {
|
|
1348
|
+
key: string;
|
|
1349
|
+
value?: unknown;
|
|
1350
|
+
}, {
|
|
1351
|
+
key: string;
|
|
1352
|
+
value?: unknown;
|
|
1353
|
+
}>, "many">;
|
|
1354
|
+
project_name: z.ZodString;
|
|
1355
|
+
setting_type: z.ZodDefault<z.ZodEnum<["user", "project"]>>;
|
|
1356
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
1357
|
+
default: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1358
|
+
project: z.ZodOptional<z.ZodString>;
|
|
1359
|
+
enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1360
|
+
external_id: z.ZodOptional<z.ZodString>;
|
|
1361
|
+
}, "strip", z.ZodTypeAny, {
|
|
1362
|
+
project_name: string;
|
|
1363
|
+
enabled: boolean;
|
|
1364
|
+
default: boolean;
|
|
1365
|
+
setting_type: "user" | "project";
|
|
1366
|
+
credential_type: string;
|
|
1367
|
+
credential_values: {
|
|
1368
|
+
key: string;
|
|
1369
|
+
value?: unknown;
|
|
1370
|
+
}[];
|
|
1371
|
+
project?: string | undefined;
|
|
1372
|
+
alias?: string | undefined;
|
|
1373
|
+
external_id?: string | undefined;
|
|
1374
|
+
}, {
|
|
1375
|
+
project_name: string;
|
|
1376
|
+
credential_type: string;
|
|
1377
|
+
credential_values: {
|
|
1378
|
+
key: string;
|
|
1379
|
+
value?: unknown;
|
|
1380
|
+
}[];
|
|
1381
|
+
project?: string | undefined;
|
|
1382
|
+
enabled?: boolean | undefined;
|
|
1383
|
+
default?: boolean | undefined;
|
|
1384
|
+
setting_type?: "user" | "project" | undefined;
|
|
1385
|
+
alias?: string | undefined;
|
|
1386
|
+
external_id?: string | undefined;
|
|
1387
|
+
}>>;
|
|
1388
|
+
type IntegrationUpdateParams = Omit<z.infer<typeof IntegrationUpdateParamsSchema>, "default" | "enabled"> & {
|
|
1389
|
+
default?: boolean;
|
|
1390
|
+
enabled?: boolean;
|
|
1391
|
+
};
|
|
1392
|
+
|
|
1393
|
+
declare class IntegrationService {
|
|
1394
|
+
private api;
|
|
1395
|
+
constructor(apiDomain: string, token: string, verifySSL?: boolean);
|
|
1396
|
+
/**
|
|
1397
|
+
* Get base API path based on setting type.
|
|
1398
|
+
*/
|
|
1399
|
+
private getBasePath;
|
|
1400
|
+
/**
|
|
1401
|
+
* Get list of available integrations.
|
|
1402
|
+
*/
|
|
1403
|
+
list(_params?: IntegrationListParams): Promise<Integration[]>;
|
|
1404
|
+
/**
|
|
1405
|
+
* Get integration by ID.
|
|
1406
|
+
*/
|
|
1407
|
+
get(_params: IntegrationGetParams): Promise<Integration>;
|
|
1408
|
+
/**
|
|
1409
|
+
* Get integration by alias.
|
|
1410
|
+
*/
|
|
1411
|
+
getByAlias(_params: IntegrationGetByAliasParams): Promise<Integration>;
|
|
1412
|
+
/**
|
|
1413
|
+
* Create a new integration.
|
|
1414
|
+
*/
|
|
1415
|
+
create(_params: IntegrationCreateParams): Promise<AnyJson>;
|
|
1416
|
+
/**
|
|
1417
|
+
* Update an existing integration.
|
|
1418
|
+
*/
|
|
1419
|
+
update(settingId: string, _params: IntegrationUpdateParams): Promise<AnyJson>;
|
|
1420
|
+
/**
|
|
1421
|
+
* Delete an integration by ID.
|
|
1422
|
+
*/
|
|
1423
|
+
delete(settingId: string, settingType?: IntegrationTypeType): Promise<AnyJson>;
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
/** Models for LLM service. */
|
|
1427
|
+
/** LLM provider options as constant object */
|
|
1428
|
+
declare const LLMProvider: {
|
|
1429
|
+
readonly AZURE_OPENAI: "azure_openai";
|
|
1430
|
+
readonly AWS_BEDROCK: "aws_bedrock";
|
|
1431
|
+
readonly GOOGLE_VERTEXAI: "google_vertexai";
|
|
1432
|
+
};
|
|
1433
|
+
type LLMProviderType = (typeof LLMProvider)[keyof typeof LLMProvider];
|
|
1434
|
+
/** Cost configuration for LLM model */
|
|
1435
|
+
interface CostConfig {
|
|
1436
|
+
/** Cost per input token */
|
|
1437
|
+
input: number;
|
|
1438
|
+
/** Cost per output token */
|
|
1439
|
+
output: number;
|
|
1440
|
+
}
|
|
1441
|
+
/** Features supported by LLM model */
|
|
1442
|
+
interface LLMFeatures {
|
|
1443
|
+
/** Support for streaming responses */
|
|
1444
|
+
streaming: boolean;
|
|
1445
|
+
/** Support for tool usage */
|
|
1446
|
+
tools: boolean;
|
|
1447
|
+
/** Support for temperature parameter */
|
|
1448
|
+
temperature: boolean;
|
|
1449
|
+
/** Support for parallel tool calls */
|
|
1450
|
+
parallel_tool_calls: boolean;
|
|
1451
|
+
/** Support for system prompt */
|
|
1452
|
+
system_prompt: boolean;
|
|
1453
|
+
/** Support for max tokens parameter */
|
|
1454
|
+
max_tokens: boolean;
|
|
1455
|
+
}
|
|
1456
|
+
/** LLM model configuration. */
|
|
1457
|
+
interface LLMModel {
|
|
1458
|
+
/** Base name of the model */
|
|
1459
|
+
base_name: string;
|
|
1460
|
+
/** Deployment name */
|
|
1461
|
+
deployment_name: string;
|
|
1462
|
+
/** Display label */
|
|
1463
|
+
label?: string;
|
|
1464
|
+
/** Whether model supports multimodal inputs */
|
|
1465
|
+
multimodal?: boolean;
|
|
1466
|
+
/** Whether model supports react agent pattern */
|
|
1467
|
+
react_agent?: boolean;
|
|
1468
|
+
/** Whether the model is enabled */
|
|
1469
|
+
enabled: boolean;
|
|
1470
|
+
/** LLM provider */
|
|
1471
|
+
provider?: LLMProviderType;
|
|
1472
|
+
/** Whether this is the default model */
|
|
1473
|
+
default?: boolean;
|
|
1474
|
+
/** Cost configuration */
|
|
1475
|
+
cost?: CostConfig;
|
|
1476
|
+
/** Maximum output tokens */
|
|
1477
|
+
max_output_tokens?: number;
|
|
1478
|
+
/** Supported features */
|
|
1479
|
+
features: LLMFeatures;
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
declare class LLMService {
|
|
1483
|
+
private api;
|
|
1484
|
+
constructor(apiDomain: string, token: string, verifySSL?: boolean);
|
|
1485
|
+
/**
|
|
1486
|
+
* Get list of available LLM models.
|
|
1487
|
+
*/
|
|
1488
|
+
list(): Promise<LLMModel[]>;
|
|
1489
|
+
/**
|
|
1490
|
+
* Get list of available embeddings models.
|
|
1491
|
+
*/
|
|
1492
|
+
listEmbeddings(): Promise<LLMModel[]>;
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
/** Models for task service. */
|
|
1496
|
+
/** Background task status constants */
|
|
1497
|
+
declare const BackgroundTaskStatus: {
|
|
1498
|
+
readonly STARTED: "STARTED";
|
|
1499
|
+
readonly COMPLETED: "COMPLETED";
|
|
1500
|
+
readonly FAILED: "FAILED";
|
|
1501
|
+
};
|
|
1502
|
+
type BackgroundTaskStatusType = (typeof BackgroundTaskStatus)[keyof typeof BackgroundTaskStatus];
|
|
1503
|
+
/** Model representing task user information */
|
|
1504
|
+
interface TaskUser {
|
|
1505
|
+
/** Unique identifier of the user */
|
|
1506
|
+
user_id: string;
|
|
1507
|
+
/** Username of the task owner */
|
|
1508
|
+
username: string;
|
|
1509
|
+
/** Display name of the task owner */
|
|
1510
|
+
name: string;
|
|
1511
|
+
}
|
|
1512
|
+
/** Model representing a background task */
|
|
1513
|
+
interface BackgroundTaskEntity {
|
|
1514
|
+
/** Unique identifier of the task */
|
|
1515
|
+
id: string;
|
|
1516
|
+
/** Task description or name */
|
|
1517
|
+
task: string;
|
|
1518
|
+
/** Information about the task owner */
|
|
1519
|
+
user: TaskUser;
|
|
1520
|
+
/** The final result or output of the task */
|
|
1521
|
+
final_output?: string;
|
|
1522
|
+
/** Current step or stage of the task */
|
|
1523
|
+
current_step?: string;
|
|
1524
|
+
/** Task status (STARTED, COMPLETED, or FAILED) */
|
|
1525
|
+
status: BackgroundTaskStatusType;
|
|
1526
|
+
/** Task creation timestamp */
|
|
1527
|
+
date: string;
|
|
1528
|
+
/** Last update timestamp */
|
|
1529
|
+
update_date: string;
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
declare class TaskService {
|
|
1533
|
+
private api;
|
|
1534
|
+
constructor(apiDomain: string, token: string, verifySSL?: boolean);
|
|
1535
|
+
/**
|
|
1536
|
+
* Get a background task by ID.
|
|
1537
|
+
*/
|
|
1538
|
+
get(taskId: string): Promise<BackgroundTaskEntity>;
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
/** Models for user service. */
|
|
1542
|
+
/** User API response. */
|
|
1543
|
+
interface AboutUserResponse {
|
|
1544
|
+
userId: string;
|
|
1545
|
+
name: string;
|
|
1546
|
+
username: string;
|
|
1547
|
+
isAdmin: boolean;
|
|
1548
|
+
applications: string[];
|
|
1549
|
+
applicationsAdmin: string[];
|
|
1550
|
+
picture: string;
|
|
1551
|
+
knowledgeBases: string[];
|
|
1552
|
+
}
|
|
1553
|
+
/** User model. */
|
|
1554
|
+
interface AboutUser {
|
|
1555
|
+
user_id: string;
|
|
1556
|
+
name: string;
|
|
1557
|
+
username: string;
|
|
1558
|
+
is_admin: boolean;
|
|
1559
|
+
applications: string[];
|
|
1560
|
+
applications_admin: string[];
|
|
1561
|
+
picture: string;
|
|
1562
|
+
knowledge_bases: string[];
|
|
1563
|
+
}
|
|
1564
|
+
/** User data and preferences model. */
|
|
1565
|
+
interface UserData {
|
|
1566
|
+
id?: string;
|
|
1567
|
+
date?: string;
|
|
1568
|
+
update_date?: string;
|
|
1569
|
+
user_id?: string;
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
declare class UserService {
|
|
1573
|
+
private api;
|
|
1574
|
+
constructor(apiDomain: string, token: string, verifySSL?: boolean);
|
|
1575
|
+
/**
|
|
1576
|
+
* Get current user profile.
|
|
1577
|
+
*/
|
|
1578
|
+
aboutMe(): Promise<AboutUser>;
|
|
1579
|
+
/**
|
|
1580
|
+
* Get user data and preferences.
|
|
1581
|
+
*/
|
|
1582
|
+
getData(): Promise<UserData>;
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
/** Models for workflow functionality */
|
|
1586
|
+
|
|
1587
|
+
/** Available workflow modes */
|
|
1588
|
+
declare const WorkflowMode: {
|
|
1589
|
+
readonly SEQUENTIAL: "Sequential";
|
|
1590
|
+
readonly AUTONOMOUS: "Autonomous";
|
|
1591
|
+
};
|
|
1592
|
+
type WorkflowModeType = (typeof WorkflowMode)[keyof typeof WorkflowMode];
|
|
1593
|
+
/** Workflow execution status */
|
|
1594
|
+
declare const ExecutionStatus: {
|
|
1595
|
+
readonly IN_PROGRESS: "In Progress";
|
|
1596
|
+
readonly NOT_STARTED: "Not Started";
|
|
1597
|
+
readonly INTERRUPTED: "Interrupted";
|
|
1598
|
+
readonly FAILED: "Failed";
|
|
1599
|
+
readonly SUCCEEDED: "Succeeded";
|
|
1600
|
+
readonly ABORTED: "Aborted";
|
|
1601
|
+
};
|
|
1602
|
+
type ExecutionStatusType = (typeof ExecutionStatus)[keyof typeof ExecutionStatus];
|
|
1603
|
+
/** Workflow API response */
|
|
1604
|
+
interface WorkflowResponse {
|
|
1605
|
+
/** Unique identifier */
|
|
1606
|
+
id: string;
|
|
1607
|
+
/** Project name */
|
|
1608
|
+
project: string;
|
|
1609
|
+
/** Workflow name */
|
|
1610
|
+
name: string;
|
|
1611
|
+
/** Workflow description */
|
|
1612
|
+
description?: string;
|
|
1613
|
+
/** YAML configuration */
|
|
1614
|
+
yaml_config?: string;
|
|
1615
|
+
/** Workflow execution mode */
|
|
1616
|
+
mode: WorkflowModeType;
|
|
1617
|
+
/** Whether workflow is shared */
|
|
1618
|
+
shared: boolean;
|
|
1619
|
+
/** URL to workflow icon */
|
|
1620
|
+
icon_url?: string;
|
|
1621
|
+
/** Creation date */
|
|
1622
|
+
date: string;
|
|
1623
|
+
/** Last update date */
|
|
1624
|
+
update_date: string;
|
|
1625
|
+
/** Creator information */
|
|
1626
|
+
created_by: BaseUser;
|
|
1627
|
+
}
|
|
1628
|
+
/** Workflow model */
|
|
1629
|
+
interface Workflow {
|
|
1630
|
+
/** Unique identifier */
|
|
1631
|
+
id: string;
|
|
1632
|
+
/** Project name */
|
|
1633
|
+
project: string;
|
|
1634
|
+
/** Workflow name */
|
|
1635
|
+
name: string;
|
|
1636
|
+
/** Workflow description */
|
|
1637
|
+
description?: string;
|
|
1638
|
+
/** YAML configuration */
|
|
1639
|
+
yaml_config?: string;
|
|
1640
|
+
/** Workflow execution mode */
|
|
1641
|
+
mode: WorkflowModeType;
|
|
1642
|
+
/** Whether workflow is shared */
|
|
1643
|
+
shared: boolean;
|
|
1644
|
+
/** URL to workflow icon */
|
|
1645
|
+
icon_url?: string;
|
|
1646
|
+
/** Creation date */
|
|
1647
|
+
created_date: string;
|
|
1648
|
+
/** Last update date */
|
|
1649
|
+
update_date: string;
|
|
1650
|
+
/** Creator information */
|
|
1651
|
+
created_by: BaseUser;
|
|
1652
|
+
}
|
|
1653
|
+
/** Workflow execution API response */
|
|
1654
|
+
interface WorkflowExecutionResponse {
|
|
1655
|
+
/** Unique identifier */
|
|
1656
|
+
id: string;
|
|
1657
|
+
/** Execution identifier */
|
|
1658
|
+
execution_id: string;
|
|
1659
|
+
/** Associated workflow identifier */
|
|
1660
|
+
workflow_id: string;
|
|
1661
|
+
/** Execution status */
|
|
1662
|
+
status: ExecutionStatusType;
|
|
1663
|
+
/** Creation date */
|
|
1664
|
+
date: string;
|
|
1665
|
+
/** Execution prompt */
|
|
1666
|
+
prompt: string;
|
|
1667
|
+
/** Last update date */
|
|
1668
|
+
updated_date?: string;
|
|
1669
|
+
/** Creator information */
|
|
1670
|
+
created_by: BaseUser;
|
|
1671
|
+
/** Token usage statistics */
|
|
1672
|
+
tokens_usage?: TokensUsage;
|
|
1673
|
+
}
|
|
1674
|
+
/** Model representing a workflow execution */
|
|
1675
|
+
interface WorkflowExecution {
|
|
1676
|
+
/** Unique identifier */
|
|
1677
|
+
id: string;
|
|
1678
|
+
/** Execution identifier */
|
|
1679
|
+
execution_id: string;
|
|
1680
|
+
/** Associated workflow identifier */
|
|
1681
|
+
workflow_id: string;
|
|
1682
|
+
/** Execution status */
|
|
1683
|
+
overall_status: ExecutionStatusType;
|
|
1684
|
+
/** Creation date */
|
|
1685
|
+
created_date: string;
|
|
1686
|
+
/** Execution prompt */
|
|
1687
|
+
prompt: string;
|
|
1688
|
+
/** Last update date */
|
|
1689
|
+
updated_date?: string;
|
|
1690
|
+
/** Creator information */
|
|
1691
|
+
created_by: BaseUser;
|
|
1692
|
+
/** Token usage statistics */
|
|
1693
|
+
tokens_usage?: TokensUsage;
|
|
1694
|
+
}
|
|
1695
|
+
/** Model for workflow execution state thought */
|
|
1696
|
+
interface WorkflowExecutionStateThought {
|
|
1697
|
+
/** Unique identifier */
|
|
1698
|
+
id: string;
|
|
1699
|
+
/** Thought content */
|
|
1700
|
+
text: string;
|
|
1701
|
+
/** Creation timestamp */
|
|
1702
|
+
created_at: string;
|
|
1703
|
+
/** Parent thought identifier */
|
|
1704
|
+
parent_id?: string;
|
|
1705
|
+
}
|
|
1706
|
+
/** Model for workflow execution state */
|
|
1707
|
+
interface WorkflowExecutionState {
|
|
1708
|
+
/** Unique identifier */
|
|
1709
|
+
id: string;
|
|
1710
|
+
/** Execution identifier */
|
|
1711
|
+
execution_id: string;
|
|
1712
|
+
/** State name */
|
|
1713
|
+
name: string;
|
|
1714
|
+
/** Associated task */
|
|
1715
|
+
task?: string;
|
|
1716
|
+
/** State status */
|
|
1717
|
+
status: ExecutionStatusType;
|
|
1718
|
+
/** Start timestamp */
|
|
1719
|
+
started_at?: string;
|
|
1720
|
+
/** Completion timestamp */
|
|
1721
|
+
completed_at?: string;
|
|
1722
|
+
}
|
|
1723
|
+
/** Model for workflow execution state output */
|
|
1724
|
+
interface WorkflowExecutionStateOutput {
|
|
1725
|
+
/** Output content */
|
|
1726
|
+
output?: string;
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
/**
|
|
1730
|
+
* Workflow list parameters schema
|
|
1731
|
+
*/
|
|
1732
|
+
declare const WorkflowListParamsSchema: z.ZodReadonly<z.ZodObject<{
|
|
1733
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
1734
|
+
per_page: z.ZodDefault<z.ZodNumber>;
|
|
1735
|
+
projects: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1736
|
+
}, "strip", z.ZodTypeAny, {
|
|
1737
|
+
page: number;
|
|
1738
|
+
per_page: number;
|
|
1739
|
+
projects?: string[] | undefined;
|
|
1740
|
+
}, {
|
|
1741
|
+
page?: number | undefined;
|
|
1742
|
+
per_page?: number | undefined;
|
|
1743
|
+
projects?: string[] | undefined;
|
|
1744
|
+
}>>;
|
|
1745
|
+
type WorkflowListParams = Partial<z.infer<typeof WorkflowListParamsSchema>>;
|
|
1746
|
+
/**
|
|
1747
|
+
* Workflow create parameters schema
|
|
1748
|
+
*/
|
|
1749
|
+
declare const WorkflowCreateParamsSchema: z.ZodReadonly<z.ZodObject<{
|
|
1750
|
+
project: z.ZodString;
|
|
1751
|
+
name: z.ZodString;
|
|
1752
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1753
|
+
yaml_config: z.ZodString;
|
|
1754
|
+
mode: z.ZodEnum<["Sequential", "Autonomous"]>;
|
|
1755
|
+
shared: z.ZodBoolean;
|
|
1756
|
+
icon_url: z.ZodOptional<z.ZodString>;
|
|
1757
|
+
}, "strip", z.ZodTypeAny, {
|
|
1758
|
+
project: string;
|
|
1759
|
+
name: string;
|
|
1760
|
+
shared: boolean;
|
|
1761
|
+
yaml_config: string;
|
|
1762
|
+
mode: "Sequential" | "Autonomous";
|
|
1763
|
+
description?: string | undefined;
|
|
1764
|
+
icon_url?: string | undefined;
|
|
1765
|
+
}, {
|
|
1766
|
+
project: string;
|
|
1767
|
+
name: string;
|
|
1768
|
+
shared: boolean;
|
|
1769
|
+
yaml_config: string;
|
|
1770
|
+
mode: "Sequential" | "Autonomous";
|
|
1771
|
+
description?: string | undefined;
|
|
1772
|
+
icon_url?: string | undefined;
|
|
1773
|
+
}>>;
|
|
1774
|
+
type WorkflowCreateParams = z.infer<typeof WorkflowCreateParamsSchema>;
|
|
1775
|
+
/**
|
|
1776
|
+
* Workflow update parameters schema
|
|
1777
|
+
*/
|
|
1778
|
+
declare const WorkflowUpdateParamsSchema: z.ZodReadonly<z.ZodObject<{
|
|
1779
|
+
project: z.ZodString;
|
|
1780
|
+
name: z.ZodString;
|
|
1781
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1782
|
+
yaml_config: z.ZodString;
|
|
1783
|
+
mode: z.ZodOptional<z.ZodEnum<["Sequential", "Autonomous"]>>;
|
|
1784
|
+
shared: z.ZodOptional<z.ZodBoolean>;
|
|
1785
|
+
icon_url: z.ZodOptional<z.ZodString>;
|
|
1786
|
+
}, "strip", z.ZodTypeAny, {
|
|
1787
|
+
project: string;
|
|
1788
|
+
name: string;
|
|
1789
|
+
yaml_config: string;
|
|
1790
|
+
description?: string | undefined;
|
|
1791
|
+
icon_url?: string | undefined;
|
|
1792
|
+
shared?: boolean | undefined;
|
|
1793
|
+
mode?: "Sequential" | "Autonomous" | undefined;
|
|
1794
|
+
}, {
|
|
1795
|
+
project: string;
|
|
1796
|
+
name: string;
|
|
1797
|
+
yaml_config: string;
|
|
1798
|
+
description?: string | undefined;
|
|
1799
|
+
icon_url?: string | undefined;
|
|
1800
|
+
shared?: boolean | undefined;
|
|
1801
|
+
mode?: "Sequential" | "Autonomous" | undefined;
|
|
1802
|
+
}>>;
|
|
1803
|
+
type WorkflowUpdateParams = z.infer<typeof WorkflowUpdateParamsSchema>;
|
|
1804
|
+
/**
|
|
1805
|
+
* Workflow execution list parameters schema
|
|
1806
|
+
*/
|
|
1807
|
+
declare const WorkflowExecutionListParamsSchema: z.ZodReadonly<z.ZodObject<{
|
|
1808
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
1809
|
+
per_page: z.ZodDefault<z.ZodNumber>;
|
|
1810
|
+
}, "strip", z.ZodTypeAny, {
|
|
1811
|
+
page: number;
|
|
1812
|
+
per_page: number;
|
|
1813
|
+
}, {
|
|
1814
|
+
page?: number | undefined;
|
|
1815
|
+
per_page?: number | undefined;
|
|
1816
|
+
}>>;
|
|
1817
|
+
type WorkflowExecutionListParams = Partial<z.infer<typeof WorkflowExecutionListParamsSchema>>;
|
|
1818
|
+
/**
|
|
1819
|
+
* Workflow execution create parameters schema
|
|
1820
|
+
*/
|
|
1821
|
+
declare const WorkflowExecutionCreateParamsSchema: z.ZodReadonly<z.ZodObject<{
|
|
1822
|
+
user_input: z.ZodDefault<z.ZodString>;
|
|
1823
|
+
}, "strip", z.ZodTypeAny, {
|
|
1824
|
+
user_input: string;
|
|
1825
|
+
}, {
|
|
1826
|
+
user_input?: string | undefined;
|
|
1827
|
+
}>>;
|
|
1828
|
+
type WorkflowExecutionCreateParams = z.infer<typeof WorkflowExecutionCreateParamsSchema>;
|
|
1829
|
+
/**
|
|
1830
|
+
* Workflow execution state list parameters schema
|
|
1831
|
+
*/
|
|
1832
|
+
declare const WorkflowExecutionStateListParamsSchema: z.ZodReadonly<z.ZodObject<{
|
|
1833
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
1834
|
+
per_page: z.ZodDefault<z.ZodNumber>;
|
|
1835
|
+
}, "strip", z.ZodTypeAny, {
|
|
1836
|
+
page: number;
|
|
1837
|
+
per_page: number;
|
|
1838
|
+
}, {
|
|
1839
|
+
page?: number | undefined;
|
|
1840
|
+
per_page?: number | undefined;
|
|
1841
|
+
}>>;
|
|
1842
|
+
type WorkflowExecutionStateListParams = Partial<z.infer<typeof WorkflowExecutionStateListParamsSchema>>;
|
|
1843
|
+
|
|
1844
|
+
declare class ApiRequestHandler {
|
|
1845
|
+
private client;
|
|
1846
|
+
constructor(apiDomain: string, token: string, verifySSL?: boolean);
|
|
1847
|
+
private request;
|
|
1848
|
+
get<T>(path: string, params?: Record<string, unknown>, config?: Record<string, unknown>): Promise<T>;
|
|
1849
|
+
post<T>(path: string, data?: unknown, config?: Record<string, unknown>): Promise<T>;
|
|
1850
|
+
postMultipart<T>(url: string, formData: FormData, params?: Record<string, unknown>): Promise<T>;
|
|
1851
|
+
put<T>(path: string, data?: unknown, config?: Record<string, unknown>): Promise<T>;
|
|
1852
|
+
delete<T>(path: string, config?: Record<string, unknown>): Promise<T>;
|
|
1853
|
+
stream(path: string, data?: unknown, config?: Record<string, unknown>): Promise<AxiosResponse>;
|
|
1854
|
+
private processFailedResponse;
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
declare class WorkflowExecutionStateService {
|
|
1858
|
+
private api;
|
|
1859
|
+
private workflowId;
|
|
1860
|
+
private executionId;
|
|
1861
|
+
constructor(api: ApiRequestHandler, workflowId: string, executionId: string);
|
|
1862
|
+
/**
|
|
1863
|
+
* List states for the workflow execution with filtering and pagination support.
|
|
1864
|
+
*/
|
|
1865
|
+
list(_params?: WorkflowExecutionStateListParams): Promise<WorkflowExecutionState[]>;
|
|
1866
|
+
/**
|
|
1867
|
+
* Get output for a specific execution state.
|
|
1868
|
+
*/
|
|
1869
|
+
getOutput(stateId: string): Promise<WorkflowExecutionStateOutput>;
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
declare class WorkflowExecutionService {
|
|
1873
|
+
private api;
|
|
1874
|
+
private workflowId;
|
|
1875
|
+
constructor(api: ApiRequestHandler, workflowId: string);
|
|
1876
|
+
/**
|
|
1877
|
+
* List executions for the workflow with filtering and pagination support.
|
|
1878
|
+
*/
|
|
1879
|
+
list(_params?: WorkflowExecutionListParams): Promise<WorkflowExecution[]>;
|
|
1880
|
+
/**
|
|
1881
|
+
* Create a new workflow execution.
|
|
1882
|
+
*/
|
|
1883
|
+
create(userInput?: string): Promise<AnyJson>;
|
|
1884
|
+
/**
|
|
1885
|
+
* Get workflow execution by ID.
|
|
1886
|
+
*/
|
|
1887
|
+
get(executionId: string): Promise<WorkflowExecution>;
|
|
1888
|
+
/**
|
|
1889
|
+
* Get states service for a specific workflow execution.
|
|
1890
|
+
*/
|
|
1891
|
+
states(executionId: string): WorkflowExecutionStateService;
|
|
1892
|
+
/**
|
|
1893
|
+
* Delete all workflow executions.
|
|
1894
|
+
*/
|
|
1895
|
+
deleteAll(): Promise<AnyJson>;
|
|
1896
|
+
/**
|
|
1897
|
+
* Abort a running workflow execution.
|
|
1898
|
+
*/
|
|
1899
|
+
abort(executionId: string): Promise<AnyJson>;
|
|
1900
|
+
/**
|
|
1901
|
+
* Resume an interrupted workflow execution.
|
|
1902
|
+
*/
|
|
1903
|
+
resume(executionId: string): Promise<AnyJson>;
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
declare class WorkflowService {
|
|
1907
|
+
private api;
|
|
1908
|
+
constructor(apiDomain: string, token: string, verifySSL?: boolean);
|
|
1909
|
+
/**
|
|
1910
|
+
* Get list of prebuilt workflows.
|
|
1911
|
+
*/
|
|
1912
|
+
getPrebuilt(): Promise<Workflow[]>;
|
|
1913
|
+
/**
|
|
1914
|
+
* Create a new workflow.
|
|
1915
|
+
*/
|
|
1916
|
+
create(_params: WorkflowCreateParams): Promise<AnyJson>;
|
|
1917
|
+
/**
|
|
1918
|
+
* Update an existing workflow.
|
|
1919
|
+
*/
|
|
1920
|
+
update(workflowId: string, _params: WorkflowUpdateParams): Promise<AnyJson>;
|
|
1921
|
+
/**
|
|
1922
|
+
* List workflows with filtering and pagination support.
|
|
1923
|
+
*/
|
|
1924
|
+
list(_params?: WorkflowListParams): Promise<Workflow[]>;
|
|
1925
|
+
/**
|
|
1926
|
+
* Get workflow by ID.
|
|
1927
|
+
*/
|
|
1928
|
+
get(workflowId: string): Promise<Workflow>;
|
|
1929
|
+
/**
|
|
1930
|
+
* Delete a workflow by ID.
|
|
1931
|
+
*/
|
|
1932
|
+
delete(workflowId: string): Promise<AnyJson>;
|
|
1933
|
+
/**
|
|
1934
|
+
* Run a workflow by ID.
|
|
1935
|
+
*/
|
|
1936
|
+
run(workflowId: string, userInput?: string): Promise<AnyJson>;
|
|
1937
|
+
/**
|
|
1938
|
+
* Get workflow execution service for the specified workflow.
|
|
1939
|
+
*/
|
|
1940
|
+
executions(workflowId: string): WorkflowExecutionService;
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
interface CodeMieClientConfig {
|
|
1944
|
+
auth_server_url: string;
|
|
1945
|
+
auth_realm_name: string;
|
|
1946
|
+
codemie_api_domain: string;
|
|
1947
|
+
auth_client_id?: string;
|
|
1948
|
+
auth_client_secret?: string;
|
|
1949
|
+
username?: string;
|
|
1950
|
+
password?: string;
|
|
1951
|
+
verify_ssl?: boolean;
|
|
1952
|
+
}
|
|
1953
|
+
declare class CodeMieClient {
|
|
1954
|
+
private auth;
|
|
1955
|
+
private token;
|
|
1956
|
+
private apiDomain;
|
|
1957
|
+
private verifySSL;
|
|
1958
|
+
private _assistants;
|
|
1959
|
+
private _llms;
|
|
1960
|
+
private _integrations;
|
|
1961
|
+
private _tasks;
|
|
1962
|
+
private _users;
|
|
1963
|
+
private _datasources;
|
|
1964
|
+
private _workflows;
|
|
1965
|
+
constructor(config: CodeMieClientConfig);
|
|
1966
|
+
/**
|
|
1967
|
+
* Get the AssistantService instance.
|
|
1968
|
+
*/
|
|
1969
|
+
get assistants(): AssistantService;
|
|
1970
|
+
/**
|
|
1971
|
+
* Get the LLMService instance.
|
|
1972
|
+
*/
|
|
1973
|
+
get llms(): LLMService;
|
|
1974
|
+
/**
|
|
1975
|
+
* Get the IntegrationService instance.
|
|
1976
|
+
*/
|
|
1977
|
+
get integrations(): IntegrationService;
|
|
1978
|
+
/**
|
|
1979
|
+
* Get the TaskService instance.
|
|
1980
|
+
*/
|
|
1981
|
+
get tasks(): TaskService;
|
|
1982
|
+
/**
|
|
1983
|
+
* Get the UserService instance.
|
|
1984
|
+
*/
|
|
1985
|
+
get users(): UserService;
|
|
1986
|
+
/**
|
|
1987
|
+
* Get the DatasourceService instance.
|
|
1988
|
+
*/
|
|
1989
|
+
get datasources(): DatasourceService;
|
|
1990
|
+
/**
|
|
1991
|
+
* Get the WorkflowService instance.
|
|
1992
|
+
*/
|
|
1993
|
+
get workflows(): WorkflowService;
|
|
1994
|
+
/**
|
|
1995
|
+
* Initialize the client by obtaining the initial token.
|
|
1996
|
+
* This should be called after creating the client instance.
|
|
1997
|
+
*/
|
|
1998
|
+
initialize(): Promise<void>;
|
|
1999
|
+
/**
|
|
2000
|
+
* Get the current access token or fetch a new one if not available.
|
|
2001
|
+
*/
|
|
2002
|
+
getToken(): Promise<string>;
|
|
2003
|
+
/**
|
|
2004
|
+
* Force token refresh and update all services with the new token.
|
|
2005
|
+
*/
|
|
2006
|
+
refreshToken(): Promise<string>;
|
|
2007
|
+
/**
|
|
2008
|
+
* Reinitialize all services with the current token.
|
|
2009
|
+
*/
|
|
2010
|
+
private refreshServices;
|
|
2011
|
+
}
|
|
2012
|
+
|
|
2013
|
+
declare class CodeMieError extends Error {
|
|
2014
|
+
constructor(message: string);
|
|
2015
|
+
}
|
|
2016
|
+
declare class ApiError extends CodeMieError {
|
|
2017
|
+
statusCode?: number;
|
|
2018
|
+
response?: AnyJson;
|
|
2019
|
+
constructor(message: string, statusCode?: number, response?: AnyJson);
|
|
2020
|
+
}
|
|
2021
|
+
declare class NotFoundError extends ApiError {
|
|
2022
|
+
constructor(resourceType: string, resourceId: string);
|
|
2023
|
+
}
|
|
2024
|
+
|
|
2025
|
+
export { type AboutUser, type AboutUserResponse, type AnyJson, ApiError, type Assistant, type AssistantBase, type AssistantChatParams, AssistantChatParamsSchema, type AssistantCreateParams, AssistantCreateParamsSchema, type AssistantListParams, AssistantListParamsSchema, type AssistantRequestBase, type AssistantUpdateParams, AssistantUpdateParamsSchema, type BackgroundTaskEntity, BackgroundTaskStatus, type BackgroundTaskStatusType, type BaseCodeParams, type BaseConfluenceParams, type BaseDataSourceCreateDto, type BaseDataSourceCreateParams, type BaseDataSourceUpdateDto, type BaseDataSourceUpdateParams, type BaseFileParams, type BaseGoogleParams, type BaseJiraParams, type BaseModelApiResponse, type BaseModelResponse, type BaseUser, type ChatMessage, ChatRole, type Code, type CodeDataSourceCreateDto, type CodeDataSourceCreateParams, CodeDataSourceType, type CodeDataSourceTypeType, type CodeDataSourceUpdateDto, type CodeDataSourceUpdateParams, CodeMieClient, type CodeMieClientConfig, CodeMieError, type Confluence, type ConfluenceDataSourceCreateDto, type ConfluenceDataSourceCreateParams, type ConfluenceDataSourceUpdateDto, type ConfluenceDataSourceUpdateParams, type Context, ContextType, type CostConfig, CredentialTypes, type CredentialTypesType, type CredentialValues, type DataSource, type DataSourceCreateDto, type DataSourceCreateParams, type DataSourceListParams, type DataSourceProcessingInfo, type DataSourceProcessingInfoResponse, type DataSourceResponse, DataSourceStatus, type DataSourceStatusType, DataSourceType, type DataSourceTypeType, type DataSourceUpdateDto, type DataSourceUpdateParams, ExecutionStatus, type ExecutionStatusType, type File, type FileDataSourceCreateDto, type FileDataSourceCreateParams, type FileDataSourceUpdateDto, type FileDataSourceUpdateParams, type Files, type Google, type GoogleDataSourceCreateDto, type GoogleDataSourceCreateParams, type GoogleDataSourceUpdateDto, type GoogleDataSourceUpdateParams, type Integration, type IntegrationCreateParams, IntegrationCreateParamsSchema, type IntegrationGetByAliasParams, IntegrationGetByAliasParamsSchema, type IntegrationGetParams, IntegrationGetParamsSchema, type IntegrationListParams, IntegrationListParamsSchema, IntegrationType, type IntegrationTypeType, type IntegrationUpdateParams, IntegrationUpdateParamsSchema, type Jira, type JiraDataSourceCreateDto, type JiraDataSourceCreateParams, type JiraDataSourceUpdateDto, type JiraDataSourceUpdateParams, type LLMFeatures, type LLMModel, LLMProvider, type LLMProviderType, type MCPServerConfig, type MCPServerDetails, NotFoundError, type OtherDataSourceCreateParams, type OtherDataSourceUpdateParams, type PaginatedResponse, type PaginationParams, type SortOrder, type SystemPromptHistory, type TaskUser, type TokensUsage, type ToolDetails, type ToolKitDetails, type UserData, type Workflow, type WorkflowCreateParams, WorkflowCreateParamsSchema, type WorkflowExecution, type WorkflowExecutionCreateParams, WorkflowExecutionCreateParamsSchema, type WorkflowExecutionListParams, WorkflowExecutionListParamsSchema, type WorkflowExecutionResponse, type WorkflowExecutionState, type WorkflowExecutionStateListParams, WorkflowExecutionStateListParamsSchema, type WorkflowExecutionStateOutput, type WorkflowExecutionStateThought, type WorkflowListParams, WorkflowListParamsSchema, WorkflowMode, type WorkflowModeType, type WorkflowResponse, type WorkflowUpdateParams, WorkflowUpdateParamsSchema };
|