@openserv-labs/sdk 1.7.0 → 1.8.0
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 +11 -11
- package/dist/agent.d.ts +31 -31
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +15 -15
- package/dist/types.d.ts +1527 -305
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +149 -57
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -450,7 +450,7 @@ const files = await agent.getFiles({
|
|
|
450
450
|
|
|
451
451
|
```typescript
|
|
452
452
|
const task = await agent.createTask({
|
|
453
|
-
workspaceId: number,
|
|
453
|
+
workspaceId: number | string,
|
|
454
454
|
assignee: number,
|
|
455
455
|
description: string,
|
|
456
456
|
body: string,
|
|
@@ -464,8 +464,8 @@ const task = await agent.createTask({
|
|
|
464
464
|
|
|
465
465
|
```typescript
|
|
466
466
|
await agent.updateTaskStatus({
|
|
467
|
-
workspaceId: number,
|
|
468
|
-
taskId: number,
|
|
467
|
+
workspaceId: number | string,
|
|
468
|
+
taskId: number | string,
|
|
469
469
|
status: 'to-do' | 'in-progress' | 'human-assistance-required' | 'error' | 'done' | 'cancelled'
|
|
470
470
|
})
|
|
471
471
|
```
|
|
@@ -474,8 +474,8 @@ await agent.updateTaskStatus({
|
|
|
474
474
|
|
|
475
475
|
```typescript
|
|
476
476
|
await agent.addLogToTask({
|
|
477
|
-
workspaceId: number,
|
|
478
|
-
taskId: number,
|
|
477
|
+
workspaceId: number | string,
|
|
478
|
+
taskId: number | string,
|
|
479
479
|
severity: 'info' | 'warning' | 'error',
|
|
480
480
|
type: 'text' | 'openai-message',
|
|
481
481
|
body: string | object
|
|
@@ -488,7 +488,7 @@ await agent.addLogToTask({
|
|
|
488
488
|
|
|
489
489
|
```typescript
|
|
490
490
|
await agent.sendChatMessage({
|
|
491
|
-
workspaceId: number,
|
|
491
|
+
workspaceId: number | string,
|
|
492
492
|
agentId: number,
|
|
493
493
|
message: string
|
|
494
494
|
})
|
|
@@ -498,8 +498,8 @@ await agent.sendChatMessage({
|
|
|
498
498
|
|
|
499
499
|
```typescript
|
|
500
500
|
await agent.requestHumanAssistance({
|
|
501
|
-
workspaceId: number,
|
|
502
|
-
taskId: number,
|
|
501
|
+
workspaceId: number | string,
|
|
502
|
+
taskId: number | string,
|
|
503
503
|
type: 'text' | 'project-manager-plan-review',
|
|
504
504
|
question: string | object,
|
|
505
505
|
agentDump?: object
|
|
@@ -512,7 +512,7 @@ await agent.requestHumanAssistance({
|
|
|
512
512
|
|
|
513
513
|
```typescript
|
|
514
514
|
const files = await agent.getFiles({
|
|
515
|
-
workspaceId: number
|
|
515
|
+
workspaceId: number | string
|
|
516
516
|
})
|
|
517
517
|
```
|
|
518
518
|
|
|
@@ -520,7 +520,7 @@ const files = await agent.getFiles({
|
|
|
520
520
|
|
|
521
521
|
```typescript
|
|
522
522
|
await agent.uploadFile({
|
|
523
|
-
workspaceId: number,
|
|
523
|
+
workspaceId: number | string,
|
|
524
524
|
path: string,
|
|
525
525
|
file: Buffer | string,
|
|
526
526
|
skipSummarizer?: boolean,
|
|
@@ -534,7 +534,7 @@ await agent.uploadFile({
|
|
|
534
534
|
|
|
535
535
|
```typescript
|
|
536
536
|
const response = await agent.callIntegration({
|
|
537
|
-
workspaceId: number,
|
|
537
|
+
workspaceId: number | string,
|
|
538
538
|
integrationId: string,
|
|
539
539
|
details: {
|
|
540
540
|
endpoint: string,
|
package/dist/agent.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type AxiosInstance } from 'axios';
|
|
2
|
-
import type { GetFilesParams, GetSecretsParams, GetSecretValueParams, UploadFileParams, DeleteFileParams, MarkTaskAsErroredParams, CompleteTaskParams, SendChatMessageParams, GetTaskDetailParams, GetAgentsParams, GetTasksParams, CreateTaskParams, AddLogToTaskParams, RequestHumanAssistanceParams, UpdateTaskStatusParams, ProcessParams, IntegrationCallRequest, GetChatMessagesParams } from './types';
|
|
2
|
+
import type { GetFilesParams, GetSecretsParams, GetSecretValueParams, UploadFileParams, DeleteFileParams, MarkTaskAsErroredParams, CompleteTaskParams, SendChatMessageParams, GetTaskDetailParams, GetAgentsParams, GetTasksParams, CreateTaskParams, AddLogToTaskParams, RequestHumanAssistanceParams, UpdateTaskStatusParams, ProcessParams, IntegrationCallRequest, GetChatMessagesParams, GetFilesResponse, GetSecretsResponse, UploadFileResponse, DeleteFileResponse, GetTaskDetailResponse, GetAgentsResponse, GetTasksResponse, CreateTaskResponse } from './types';
|
|
3
3
|
import type { doTaskActionSchema, respondChatMessageActionSchema } from './types';
|
|
4
4
|
import { actionSchema } from './types';
|
|
5
5
|
import type { ChatCompletionMessageParam, ChatCompletion } from 'openai/resources/chat/completions';
|
|
6
6
|
import OpenAI from 'openai';
|
|
7
|
-
import { z } from 'zod';
|
|
7
|
+
import type { z } from 'zod';
|
|
8
8
|
import { Capability } from './capability';
|
|
9
9
|
import { type MCPServerConfig, MCPClient } from './mcp';
|
|
10
10
|
/**
|
|
@@ -191,21 +191,21 @@ export declare class Agent<M extends string> {
|
|
|
191
191
|
*
|
|
192
192
|
* @param {GetFilesParams} params - Parameters for the file retrieval
|
|
193
193
|
* @param {number} params.workspaceId - ID of the workspace to get files from
|
|
194
|
-
* @returns {Promise<
|
|
194
|
+
* @returns {Promise<GetFilesResponse>} The files in the workspace
|
|
195
195
|
*/
|
|
196
|
-
getFiles(params: GetFilesParams): Promise<
|
|
196
|
+
getFiles(params: GetFilesParams): Promise<GetFilesResponse>;
|
|
197
197
|
/**
|
|
198
198
|
* Get all secrets for an agent in a workspace.
|
|
199
199
|
*
|
|
200
200
|
* @param {GetSecretsParams} params - Parameters for the secrets retrieval
|
|
201
|
-
* @returns {Promise<
|
|
201
|
+
* @returns {Promise<GetSecretsResponse>} List of agent secrets.
|
|
202
202
|
*/
|
|
203
|
-
getSecrets(params: GetSecretsParams): Promise<
|
|
203
|
+
getSecrets(params: GetSecretsParams): Promise<GetSecretsResponse>;
|
|
204
204
|
/**
|
|
205
205
|
* Get the value of a secret for an agent in a workspace
|
|
206
206
|
*
|
|
207
207
|
* @param {GetSecretValueParams} params - Parameters for the secret value retrieval
|
|
208
|
-
* @returns {Promise<
|
|
208
|
+
* @returns {Promise<GetSecretValueResponse>} The value of the secret.
|
|
209
209
|
*/
|
|
210
210
|
getSecretValue(params: GetSecretValueParams): Promise<string>;
|
|
211
211
|
/**
|
|
@@ -217,18 +217,18 @@ export declare class Agent<M extends string> {
|
|
|
217
217
|
* @param {number[]|number|null} [params.taskIds] - Optional task IDs to associate with the file
|
|
218
218
|
* @param {boolean} [params.skipSummarizer] - Whether to skip file summarization
|
|
219
219
|
* @param {Buffer|string} params.file - The file content to upload
|
|
220
|
-
* @returns {Promise<
|
|
220
|
+
* @returns {Promise<UploadFileResponse>} The uploaded file details
|
|
221
221
|
*/
|
|
222
|
-
uploadFile(params: UploadFileParams): Promise<
|
|
222
|
+
uploadFile(params: UploadFileParams): Promise<UploadFileResponse>;
|
|
223
223
|
/**
|
|
224
224
|
* Deletes a file from a workspace.
|
|
225
225
|
*
|
|
226
226
|
* @param {DeleteFileParams} params - Parameters for the file deletion
|
|
227
227
|
* @param {number} params.workspaceId - ID of the workspace containing the file
|
|
228
228
|
* @param {number} params.fileId - ID of the file to delete
|
|
229
|
-
* @returns {Promise<
|
|
229
|
+
* @returns {Promise<DeleteFileResponse>} A success message confirming the file was deleted
|
|
230
230
|
*/
|
|
231
|
-
deleteFile(params: DeleteFileParams): Promise<
|
|
231
|
+
deleteFile(params: DeleteFileParams): Promise<DeleteFileResponse>;
|
|
232
232
|
/**
|
|
233
233
|
* Marks a task as errored.
|
|
234
234
|
*
|
|
@@ -236,9 +236,9 @@ export declare class Agent<M extends string> {
|
|
|
236
236
|
* @param {number} params.workspaceId - ID of the workspace containing the task
|
|
237
237
|
* @param {number} params.taskId - ID of the task to mark as errored
|
|
238
238
|
* @param {string} params.error - Error message describing what went wrong
|
|
239
|
-
* @returns {Promise<
|
|
239
|
+
* @returns {Promise<MarkTaskAsErroredResponse>} The updated task details
|
|
240
240
|
*/
|
|
241
|
-
markTaskAsErrored(params: MarkTaskAsErroredParams): Promise<
|
|
241
|
+
markTaskAsErrored(params: MarkTaskAsErroredParams): Promise<undefined>;
|
|
242
242
|
/**
|
|
243
243
|
* Completes a task with the specified output.
|
|
244
244
|
*
|
|
@@ -246,9 +246,9 @@ export declare class Agent<M extends string> {
|
|
|
246
246
|
* @param {number} params.workspaceId - ID of the workspace containing the task
|
|
247
247
|
* @param {number} params.taskId - ID of the task to complete
|
|
248
248
|
* @param {string} params.output - Output or result of the completed task
|
|
249
|
-
* @returns {Promise<
|
|
249
|
+
* @returns {Promise<CompleteTaskResponse>} The completed task details
|
|
250
250
|
*/
|
|
251
|
-
completeTask(params: CompleteTaskParams): Promise<
|
|
251
|
+
completeTask(params: CompleteTaskParams): Promise<undefined>;
|
|
252
252
|
/**
|
|
253
253
|
* Sends a chat message from the agent.
|
|
254
254
|
*
|
|
@@ -256,34 +256,34 @@ export declare class Agent<M extends string> {
|
|
|
256
256
|
* @param {number} params.workspaceId - ID of the workspace where the chat is happening
|
|
257
257
|
* @param {number} params.agentId - ID of the agent sending the message
|
|
258
258
|
* @param {string} params.message - Content of the message to send
|
|
259
|
-
* @returns {Promise<
|
|
259
|
+
* @returns {Promise<SendChatMessageResponse>} The sent message details
|
|
260
260
|
*/
|
|
261
|
-
sendChatMessage(params: SendChatMessageParams): Promise<
|
|
261
|
+
sendChatMessage(params: SendChatMessageParams): Promise<undefined>;
|
|
262
262
|
/**
|
|
263
263
|
* Gets detailed information about a specific task.
|
|
264
264
|
*
|
|
265
265
|
* @param {GetTaskDetailParams} params - Parameters for getting task details
|
|
266
266
|
* @param {number} params.workspaceId - ID of the workspace containing the task
|
|
267
267
|
* @param {number} params.taskId - ID of the task to get details for
|
|
268
|
-
* @returns {Promise<
|
|
268
|
+
* @returns {Promise<GetTaskDetailResponse>} The detailed task information
|
|
269
269
|
*/
|
|
270
|
-
getTaskDetail(params: GetTaskDetailParams): Promise<
|
|
270
|
+
getTaskDetail(params: GetTaskDetailParams): Promise<GetTaskDetailResponse>;
|
|
271
271
|
/**
|
|
272
272
|
* Gets a list of agents in a workspace.
|
|
273
273
|
*
|
|
274
274
|
* @param {GetAgentsParams} params - Parameters for getting agents
|
|
275
275
|
* @param {number} params.workspaceId - ID of the workspace to get agents from
|
|
276
|
-
* @returns {Promise<
|
|
276
|
+
* @returns {Promise<GetAgentsResponse>} List of agents in the workspace
|
|
277
277
|
*/
|
|
278
|
-
getAgents(params: GetAgentsParams): Promise<
|
|
278
|
+
getAgents(params: GetAgentsParams): Promise<GetAgentsResponse>;
|
|
279
279
|
/**
|
|
280
280
|
* Gets a list of tasks in a workspace.
|
|
281
281
|
*
|
|
282
282
|
* @param {GetTasksParams} params - Parameters for getting tasks
|
|
283
283
|
* @param {number} params.workspaceId - ID of the workspace to get tasks from
|
|
284
|
-
* @returns {Promise<
|
|
284
|
+
* @returns {Promise<GetTasksResponse>} List of tasks in the workspace
|
|
285
285
|
*/
|
|
286
|
-
getTasks(params: GetTasksParams): Promise<
|
|
286
|
+
getTasks(params: GetTasksParams): Promise<GetTasksResponse>;
|
|
287
287
|
/**
|
|
288
288
|
* Gets a list of tasks in a workspace.
|
|
289
289
|
*
|
|
@@ -315,9 +315,9 @@ export declare class Agent<M extends string> {
|
|
|
315
315
|
* @param {string} params.input - Input data for the task
|
|
316
316
|
* @param {string} params.expectedOutput - Expected output format or content
|
|
317
317
|
* @param {number[]} params.dependencies - IDs of tasks that this task depends on
|
|
318
|
-
* @returns {Promise<
|
|
318
|
+
* @returns {Promise<CreateTaskResponse>} The created task details
|
|
319
319
|
*/
|
|
320
|
-
createTask(params: CreateTaskParams): Promise<
|
|
320
|
+
createTask(params: CreateTaskParams): Promise<CreateTaskResponse>;
|
|
321
321
|
/**
|
|
322
322
|
* Adds a log entry to a task.
|
|
323
323
|
*
|
|
@@ -327,9 +327,9 @@ export declare class Agent<M extends string> {
|
|
|
327
327
|
* @param {'info'|'warning'|'error'} params.severity - Severity level of the log
|
|
328
328
|
* @param {'text'|'openai-message'} params.type - Type of log entry
|
|
329
329
|
* @param {string|object} params.body - Content of the log entry
|
|
330
|
-
* @returns {Promise<
|
|
330
|
+
* @returns {Promise<AddLogToTaskResponse>} The created log entry details
|
|
331
331
|
*/
|
|
332
|
-
addLogToTask(params: AddLogToTaskParams): Promise<
|
|
332
|
+
addLogToTask(params: AddLogToTaskParams): Promise<undefined>;
|
|
333
333
|
/**
|
|
334
334
|
* Requests human assistance for a task.
|
|
335
335
|
*
|
|
@@ -339,9 +339,9 @@ export declare class Agent<M extends string> {
|
|
|
339
339
|
* @param {'text'|'project-manager-plan-review'} params.type - Type of assistance needed
|
|
340
340
|
* @param {string|object} params.question - Question or request for the human
|
|
341
341
|
* @param {object} [params.agentDump] - Optional agent state/context information
|
|
342
|
-
* @returns {Promise<
|
|
342
|
+
* @returns {Promise<RequestHumanAssistanceResponse>} The created assistance request details
|
|
343
343
|
*/
|
|
344
|
-
requestHumanAssistance(params: RequestHumanAssistanceParams): Promise<
|
|
344
|
+
requestHumanAssistance(params: RequestHumanAssistanceParams): Promise<undefined>;
|
|
345
345
|
/**
|
|
346
346
|
* Updates the status of a task.
|
|
347
347
|
*
|
|
@@ -349,9 +349,9 @@ export declare class Agent<M extends string> {
|
|
|
349
349
|
* @param {number} params.workspaceId - ID of the workspace containing the task
|
|
350
350
|
* @param {number} params.taskId - ID of the task to update
|
|
351
351
|
* @param {TaskStatus} params.status - New status for the task
|
|
352
|
-
* @returns {Promise<
|
|
352
|
+
* @returns {Promise<UpdateTaskStatusResponse>} The updated task details
|
|
353
353
|
*/
|
|
354
|
-
updateTaskStatus(params: UpdateTaskStatusParams): Promise<
|
|
354
|
+
updateTaskStatus(params: UpdateTaskStatusParams): Promise<undefined>;
|
|
355
355
|
/**
|
|
356
356
|
* Processes a conversation with OpenAI, handling tool calls iteratively until completion.
|
|
357
357
|
*
|
package/dist/agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAA;AAUjD,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,4BAA4B,EAC5B,sBAAsB,EACtB,aAAa,EACb,sBAAsB,EACtB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAA;AAUjD,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,4BAA4B,EAC5B,sBAAsB,EACtB,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EAErB,gBAAgB,EAEhB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAOnB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,kBAAkB,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAA;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC,OAAO,KAAK,EACV,0BAA0B,EAE1B,cAAc,EACf,MAAM,mCAAmC,CAAA;AAI1C,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,KAAK,EAAE,CAAC,EAAE,M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AAE,QAAQ,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;IA4FnE;;;;OAIG;cACa,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC;IA6BjE;;;;OAIG;cACa,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC;IA+BpF;;;;;;;;;;;;;OAaG;IACG,eAAe,CAAC,GAAG,EAAE;QACzB,MAAM,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAA;QAC5B,IAAI,EAAE;YACJ,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;YAC5B,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;YACrC,QAAQ,CAAC,EAAE,0BAA0B,EAAE,CAAA;SACxC,CAAA;KACF;;;IAyBD;;;;;;;OAOG;IACG,eAAe,CAAC,GAAG,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE;IAgB5C;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAuBnB;;;;;OAKG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA6C5B;;;;OAIG;IACG,IAAI;IAQV;;;OAGG;IACH,OAAO,CAAC,WAAW;IAOnB;;;;;;;;;;;;;OAaG;IACG,eAAe,CAAC,WAAW,EAAE,sBAAsB;IASzD;;;;;;;;OAQG;IACH,OAAO,CAAC,yBAAyB;CAsClC"}
|
package/dist/agent.js
CHANGED
|
@@ -247,7 +247,7 @@ class Agent {
|
|
|
247
247
|
*
|
|
248
248
|
* @param {GetFilesParams} params - Parameters for the file retrieval
|
|
249
249
|
* @param {number} params.workspaceId - ID of the workspace to get files from
|
|
250
|
-
* @returns {Promise<
|
|
250
|
+
* @returns {Promise<GetFilesResponse>} The files in the workspace
|
|
251
251
|
*/
|
|
252
252
|
async getFiles(params) {
|
|
253
253
|
const response = await this.apiClient.get(`/workspaces/${params.workspaceId}/files`);
|
|
@@ -257,7 +257,7 @@ class Agent {
|
|
|
257
257
|
* Get all secrets for an agent in a workspace.
|
|
258
258
|
*
|
|
259
259
|
* @param {GetSecretsParams} params - Parameters for the secrets retrieval
|
|
260
|
-
* @returns {Promise<
|
|
260
|
+
* @returns {Promise<GetSecretsResponse>} List of agent secrets.
|
|
261
261
|
*/
|
|
262
262
|
async getSecrets(params) {
|
|
263
263
|
const response = await this.apiClient.get(`/workspaces/${params.workspaceId}/agent-secrets`);
|
|
@@ -267,7 +267,7 @@ class Agent {
|
|
|
267
267
|
* Get the value of a secret for an agent in a workspace
|
|
268
268
|
*
|
|
269
269
|
* @param {GetSecretValueParams} params - Parameters for the secret value retrieval
|
|
270
|
-
* @returns {Promise<
|
|
270
|
+
* @returns {Promise<GetSecretValueResponse>} The value of the secret.
|
|
271
271
|
*/
|
|
272
272
|
async getSecretValue(params) {
|
|
273
273
|
const response = await this.apiClient.get(`/workspaces/${params.workspaceId}/agent-secrets/${params.secretId}/value`);
|
|
@@ -282,7 +282,7 @@ class Agent {
|
|
|
282
282
|
* @param {number[]|number|null} [params.taskIds] - Optional task IDs to associate with the file
|
|
283
283
|
* @param {boolean} [params.skipSummarizer] - Whether to skip file summarization
|
|
284
284
|
* @param {Buffer|string} params.file - The file content to upload
|
|
285
|
-
* @returns {Promise<
|
|
285
|
+
* @returns {Promise<UploadFileResponse>} The uploaded file details
|
|
286
286
|
*/
|
|
287
287
|
async uploadFile(params) {
|
|
288
288
|
const formData = new FormData();
|
|
@@ -311,7 +311,7 @@ class Agent {
|
|
|
311
311
|
* @param {DeleteFileParams} params - Parameters for the file deletion
|
|
312
312
|
* @param {number} params.workspaceId - ID of the workspace containing the file
|
|
313
313
|
* @param {number} params.fileId - ID of the file to delete
|
|
314
|
-
* @returns {Promise<
|
|
314
|
+
* @returns {Promise<DeleteFileResponse>} A success message confirming the file was deleted
|
|
315
315
|
*/
|
|
316
316
|
async deleteFile(params) {
|
|
317
317
|
const response = await this.apiClient.delete(`/workspaces/${params.workspaceId}/files/${params.fileId}`);
|
|
@@ -324,7 +324,7 @@ class Agent {
|
|
|
324
324
|
* @param {number} params.workspaceId - ID of the workspace containing the task
|
|
325
325
|
* @param {number} params.taskId - ID of the task to mark as errored
|
|
326
326
|
* @param {string} params.error - Error message describing what went wrong
|
|
327
|
-
* @returns {Promise<
|
|
327
|
+
* @returns {Promise<MarkTaskAsErroredResponse>} The updated task details
|
|
328
328
|
*/
|
|
329
329
|
async markTaskAsErrored(params) {
|
|
330
330
|
const response = await this.apiClient.post(`/workspaces/${params.workspaceId}/tasks/${params.taskId}/error`, {
|
|
@@ -339,7 +339,7 @@ class Agent {
|
|
|
339
339
|
* @param {number} params.workspaceId - ID of the workspace containing the task
|
|
340
340
|
* @param {number} params.taskId - ID of the task to complete
|
|
341
341
|
* @param {string} params.output - Output or result of the completed task
|
|
342
|
-
* @returns {Promise<
|
|
342
|
+
* @returns {Promise<CompleteTaskResponse>} The completed task details
|
|
343
343
|
*/
|
|
344
344
|
async completeTask(params) {
|
|
345
345
|
const response = await this.apiClient.put(`/workspaces/${params.workspaceId}/tasks/${params.taskId}/complete`, {
|
|
@@ -354,7 +354,7 @@ class Agent {
|
|
|
354
354
|
* @param {number} params.workspaceId - ID of the workspace where the chat is happening
|
|
355
355
|
* @param {number} params.agentId - ID of the agent sending the message
|
|
356
356
|
* @param {string} params.message - Content of the message to send
|
|
357
|
-
* @returns {Promise<
|
|
357
|
+
* @returns {Promise<SendChatMessageResponse>} The sent message details
|
|
358
358
|
*/
|
|
359
359
|
async sendChatMessage(params) {
|
|
360
360
|
const response = await this.apiClient.post(`/workspaces/${params.workspaceId}/agent-chat/${params.agentId}/message`, {
|
|
@@ -368,7 +368,7 @@ class Agent {
|
|
|
368
368
|
* @param {GetTaskDetailParams} params - Parameters for getting task details
|
|
369
369
|
* @param {number} params.workspaceId - ID of the workspace containing the task
|
|
370
370
|
* @param {number} params.taskId - ID of the task to get details for
|
|
371
|
-
* @returns {Promise<
|
|
371
|
+
* @returns {Promise<GetTaskDetailResponse>} The detailed task information
|
|
372
372
|
*/
|
|
373
373
|
async getTaskDetail(params) {
|
|
374
374
|
const response = await this.apiClient.get(`/workspaces/${params.workspaceId}/tasks/${params.taskId}/detail`);
|
|
@@ -379,7 +379,7 @@ class Agent {
|
|
|
379
379
|
*
|
|
380
380
|
* @param {GetAgentsParams} params - Parameters for getting agents
|
|
381
381
|
* @param {number} params.workspaceId - ID of the workspace to get agents from
|
|
382
|
-
* @returns {Promise<
|
|
382
|
+
* @returns {Promise<GetAgentsResponse>} List of agents in the workspace
|
|
383
383
|
*/
|
|
384
384
|
async getAgents(params) {
|
|
385
385
|
const response = await this.apiClient.get(`/workspaces/${params.workspaceId}/agents`);
|
|
@@ -390,7 +390,7 @@ class Agent {
|
|
|
390
390
|
*
|
|
391
391
|
* @param {GetTasksParams} params - Parameters for getting tasks
|
|
392
392
|
* @param {number} params.workspaceId - ID of the workspace to get tasks from
|
|
393
|
-
* @returns {Promise<
|
|
393
|
+
* @returns {Promise<GetTasksResponse>} List of tasks in the workspace
|
|
394
394
|
*/
|
|
395
395
|
async getTasks(params) {
|
|
396
396
|
const response = await this.apiClient.get(`/workspaces/${params.workspaceId}/tasks`);
|
|
@@ -419,7 +419,7 @@ class Agent {
|
|
|
419
419
|
* @param {string} params.input - Input data for the task
|
|
420
420
|
* @param {string} params.expectedOutput - Expected output format or content
|
|
421
421
|
* @param {number[]} params.dependencies - IDs of tasks that this task depends on
|
|
422
|
-
* @returns {Promise<
|
|
422
|
+
* @returns {Promise<CreateTaskResponse>} The created task details
|
|
423
423
|
*/
|
|
424
424
|
async createTask(params) {
|
|
425
425
|
const response = await this.apiClient.post(`/workspaces/${params.workspaceId}/task`, {
|
|
@@ -441,7 +441,7 @@ class Agent {
|
|
|
441
441
|
* @param {'info'|'warning'|'error'} params.severity - Severity level of the log
|
|
442
442
|
* @param {'text'|'openai-message'} params.type - Type of log entry
|
|
443
443
|
* @param {string|object} params.body - Content of the log entry
|
|
444
|
-
* @returns {Promise<
|
|
444
|
+
* @returns {Promise<AddLogToTaskResponse>} The created log entry details
|
|
445
445
|
*/
|
|
446
446
|
async addLogToTask(params) {
|
|
447
447
|
const response = await this.apiClient.post(`/workspaces/${params.workspaceId}/tasks/${params.taskId}/log`, {
|
|
@@ -460,7 +460,7 @@ class Agent {
|
|
|
460
460
|
* @param {'text'|'project-manager-plan-review'} params.type - Type of assistance needed
|
|
461
461
|
* @param {string|object} params.question - Question or request for the human
|
|
462
462
|
* @param {object} [params.agentDump] - Optional agent state/context information
|
|
463
|
-
* @returns {Promise<
|
|
463
|
+
* @returns {Promise<RequestHumanAssistanceResponse>} The created assistance request details
|
|
464
464
|
*/
|
|
465
465
|
async requestHumanAssistance(params) {
|
|
466
466
|
let question = params.question;
|
|
@@ -490,7 +490,7 @@ class Agent {
|
|
|
490
490
|
* @param {number} params.workspaceId - ID of the workspace containing the task
|
|
491
491
|
* @param {number} params.taskId - ID of the task to update
|
|
492
492
|
* @param {TaskStatus} params.status - New status for the task
|
|
493
|
-
* @returns {Promise<
|
|
493
|
+
* @returns {Promise<UpdateTaskStatusResponse>} The updated task details
|
|
494
494
|
*/
|
|
495
495
|
async updateTaskStatus(params) {
|
|
496
496
|
const response = await this.apiClient.put(`/workspaces/${params.workspaceId}/tasks/${params.taskId}/status`, {
|