@taico/client 0.2.6 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contracts/types.d.ts +268 -187
- package/dist/src/v1/client/index.d.ts +4 -3
- package/dist/src/v1/client/index.js +1 -2
- package/dist/src/v1/client/models/ActiveTaskExecutionResponseDto.d.ts +8 -0
- package/dist/src/v1/client/models/ImportBlocksResponseDto.d.ts +6 -0
- package/dist/src/v1/client/models/TaskExecutionHistoryResponseDto.d.ts +8 -0
- package/dist/src/v1/client/models/UpdateRunnerSessionIdDto.d.ts +6 -0
- package/dist/src/v1/client/models/UpdateRunnerSessionIdDto.js +1 -0
- package/dist/src/v1/client/models/WorkerResponseDto.d.ts +8 -0
- package/dist/src/v1/client/models/WorkerResponseDto.js +1 -0
- package/dist/src/v1/client/services/AgentRunService.d.ts +2 -2
- package/dist/src/v1/client/services/AgentRunService.js +2 -2
- package/dist/src/v1/client/services/ContextService.d.ts +19 -0
- package/dist/src/v1/client/services/ContextService.js +28 -0
- package/dist/src/v1/client/services/ExecutionsService.d.ts +57 -10
- package/dist/src/v1/client/services/ExecutionsService.js +97 -15
- package/dist/src/v1/client/services/WorkersService.d.ts +11 -0
- package/dist/src/v1/client/services/WorkersService.js +15 -0
- package/dist/src/v2/agent-resource.js +2 -2
- package/dist/src/v2/authorization-server-resource.js +3 -3
- package/dist/src/v2/base-client.d.ts +4 -0
- package/dist/src/v2/base-client.js +51 -7
- package/dist/src/v2/chat-providers-resource.js +2 -2
- package/dist/src/v2/client.d.ts +4 -4
- package/dist/src/v2/client.js +6 -6
- package/dist/src/v2/context-resource.d.ts +10 -1
- package/dist/src/v2/context-resource.js +16 -8
- package/dist/src/v2/executions-resource.d.ts +35 -10
- package/dist/src/v2/executions-resource.js +27 -3
- package/dist/src/v2/meta---projects-resource.js +1 -1
- package/dist/src/v2/meta-resource.js +1 -1
- package/dist/src/v2/scheduled-tasks-resource.js +1 -1
- package/dist/src/v2/secrets-resource.js +1 -1
- package/dist/src/v2/task-blueprints-resource.js +1 -1
- package/dist/src/v2/task-resource.js +8 -8
- package/dist/src/v2/threads-resource.js +1 -1
- package/dist/src/v2/types.d.ts +18 -28
- package/dist/src/v2/workers-resource.d.ts +9 -0
- package/dist/src/v2/workers-resource.js +10 -0
- package/package.json +1 -1
- package/dist/src/v1/client/models/ExecutionListResponseDto.d.ts +0 -23
- package/dist/src/v1/client/models/ExecutionResponseDto.d.ts +0 -93
- package/dist/src/v1/client/models/ExecutionResponseDto.js +0 -17
- package/dist/src/v1/client/services/ExecutionsV2Service.d.ts +0 -46
- package/dist/src/v1/client/services/ExecutionsV2Service.js +0 -75
- package/dist/src/v2/executions-v2-resource.d.ts +0 -28
- package/dist/src/v2/executions-v2-resource.js +0 -26
- /package/dist/src/v1/client/models/{ExecutionListResponseDto.js → ImportBlocksResponseDto.js} +0 -0
|
@@ -31,6 +31,14 @@ export type TaskExecutionHistoryResponseDto = {
|
|
|
31
31
|
* OAuth client id of the worker that executed the task
|
|
32
32
|
*/
|
|
33
33
|
workerClientId: string;
|
|
34
|
+
/**
|
|
35
|
+
* Agent runtime session identifier associated with this execution
|
|
36
|
+
*/
|
|
37
|
+
runnerSessionId: string | null;
|
|
38
|
+
/**
|
|
39
|
+
* Number of tool calls made during the execution
|
|
40
|
+
*/
|
|
41
|
+
toolCallCount: number;
|
|
34
42
|
/**
|
|
35
43
|
* Terminal execution status
|
|
36
44
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,7 +8,7 @@ export declare class AgentRunService {
|
|
|
8
8
|
/**
|
|
9
9
|
* @deprecated
|
|
10
10
|
* Create a new agent run
|
|
11
|
-
*
|
|
11
|
+
* Compatibility endpoint for contexts that still create AgentRun records. Execution id is the authoritative runtime identity.
|
|
12
12
|
* @param requestBody
|
|
13
13
|
* @returns AgentRunResponseDto Agent run created successfully
|
|
14
14
|
* @throws ApiError
|
|
@@ -34,7 +34,7 @@ export declare class AgentRunService {
|
|
|
34
34
|
/**
|
|
35
35
|
* @deprecated
|
|
36
36
|
* Update an agent run
|
|
37
|
-
*
|
|
37
|
+
* Compatibility endpoint for updating AgentRun records. Execution lifecycle state is owned by executions.
|
|
38
38
|
* @param runId Agent run ID
|
|
39
39
|
* @param requestBody
|
|
40
40
|
* @returns AgentRunResponseDto Agent run updated successfully
|
|
@@ -4,7 +4,7 @@ export class AgentRunService {
|
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated
|
|
6
6
|
* Create a new agent run
|
|
7
|
-
*
|
|
7
|
+
* Compatibility endpoint for contexts that still create AgentRun records. Execution id is the authoritative runtime identity.
|
|
8
8
|
* @param requestBody
|
|
9
9
|
* @returns AgentRunResponseDto Agent run created successfully
|
|
10
10
|
* @throws ApiError
|
|
@@ -62,7 +62,7 @@ export class AgentRunService {
|
|
|
62
62
|
/**
|
|
63
63
|
* @deprecated
|
|
64
64
|
* Update an agent run
|
|
65
|
-
*
|
|
65
|
+
* Compatibility endpoint for updating AgentRun records. Execution lifecycle state is owned by executions.
|
|
66
66
|
* @param runId Agent run ID
|
|
67
67
|
* @param requestBody
|
|
68
68
|
* @returns AgentRunResponseDto Agent run updated successfully
|
|
@@ -5,6 +5,7 @@ import type { BlockSearchResultDto } from '../models/BlockSearchResultDto.js';
|
|
|
5
5
|
import type { BlockTreeResponseDto } from '../models/BlockTreeResponseDto.js';
|
|
6
6
|
import type { CreateBlockDto } from '../models/CreateBlockDto.js';
|
|
7
7
|
import type { CreateTagDto } from '../models/CreateTagDto.js';
|
|
8
|
+
import type { ImportBlocksResponseDto } from '../models/ImportBlocksResponseDto.js';
|
|
8
9
|
import type { MoveBlockDto } from '../models/MoveBlockDto.js';
|
|
9
10
|
import type { ReorderBlockDto } from '../models/ReorderBlockDto.js';
|
|
10
11
|
import type { UpdateBlockDto } from '../models/UpdateBlockDto.js';
|
|
@@ -40,6 +41,24 @@ export declare class ContextService {
|
|
|
40
41
|
* @throws ApiError
|
|
41
42
|
*/
|
|
42
43
|
static contextControllerGetBlockTree(config?: OpenAPIConfig): CancelablePromise<Array<BlockTreeResponseDto>>;
|
|
44
|
+
/**
|
|
45
|
+
* Export all context blocks as markdown zip
|
|
46
|
+
* @returns binary Context blocks archive downloaded successfully
|
|
47
|
+
* @throws ApiError
|
|
48
|
+
*/
|
|
49
|
+
static contextControllerExportBlocks(config?: OpenAPIConfig): CancelablePromise<Blob>;
|
|
50
|
+
/**
|
|
51
|
+
* Import context blocks from markdown zip
|
|
52
|
+
* @param formData
|
|
53
|
+
* @returns ImportBlocksResponseDto Context blocks imported successfully
|
|
54
|
+
* @throws ApiError
|
|
55
|
+
*/
|
|
56
|
+
static contextControllerImportBlocks(formData: {
|
|
57
|
+
/**
|
|
58
|
+
* Zip file exported from context blocks
|
|
59
|
+
*/
|
|
60
|
+
file: Blob;
|
|
61
|
+
}, config?: OpenAPIConfig): CancelablePromise<ImportBlocksResponseDto>;
|
|
43
62
|
/**
|
|
44
63
|
* Fetch a wiki page by ID
|
|
45
64
|
* @param id Context block identifier
|
|
@@ -63,6 +63,34 @@ export class ContextService {
|
|
|
63
63
|
url: '/api/v1/context/blocks/tree',
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Export all context blocks as markdown zip
|
|
68
|
+
* @returns binary Context blocks archive downloaded successfully
|
|
69
|
+
* @throws ApiError
|
|
70
|
+
*/
|
|
71
|
+
static contextControllerExportBlocks(config = OpenAPI) {
|
|
72
|
+
return __request(config, {
|
|
73
|
+
method: 'GET',
|
|
74
|
+
url: '/api/v1/context/blocks/export',
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Import context blocks from markdown zip
|
|
79
|
+
* @param formData
|
|
80
|
+
* @returns ImportBlocksResponseDto Context blocks imported successfully
|
|
81
|
+
* @throws ApiError
|
|
82
|
+
*/
|
|
83
|
+
static contextControllerImportBlocks(formData, config = OpenAPI) {
|
|
84
|
+
return __request(config, {
|
|
85
|
+
method: 'POST',
|
|
86
|
+
url: '/api/v1/context/blocks/import',
|
|
87
|
+
formData: formData,
|
|
88
|
+
mediaType: 'multipart/form-data',
|
|
89
|
+
errors: {
|
|
90
|
+
400: `No archive file uploaded or invalid file type`,
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
}
|
|
66
94
|
/**
|
|
67
95
|
* Fetch a wiki page by ID
|
|
68
96
|
* @param id Context block identifier
|
|
@@ -1,17 +1,64 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ActiveTaskExecutionResponseDto } from '../models/ActiveTaskExecutionResponseDto.js';
|
|
2
|
+
import type { StopActiveTaskExecutionDto } from '../models/StopActiveTaskExecutionDto.js';
|
|
3
|
+
import type { TaskExecutionHistoryResponseDto } from '../models/TaskExecutionHistoryResponseDto.js';
|
|
4
|
+
import type { TaskExecutionQueueEntryResponseDto } from '../models/TaskExecutionQueueEntryResponseDto.js';
|
|
5
|
+
import type { UpdateRunnerSessionIdDto } from '../models/UpdateRunnerSessionIdDto.js';
|
|
2
6
|
import type { CancelablePromise } from '../core/CancelablePromise.js';
|
|
3
7
|
import type { OpenAPIConfig } from '../core/OpenAPI.js';
|
|
4
8
|
export declare class ExecutionsService {
|
|
5
9
|
/**
|
|
6
|
-
* List
|
|
7
|
-
* Returns the
|
|
8
|
-
* @
|
|
9
|
-
* @param agentActorId Filter by agent actor ID
|
|
10
|
-
* @param taskId Filter by task ID
|
|
11
|
-
* @param page Page number (1-indexed)
|
|
12
|
-
* @param limit Number of items per page
|
|
13
|
-
* @returns ExecutionListResponseDto
|
|
10
|
+
* List the current task execution work queue
|
|
11
|
+
* Returns the tasks currently present in the execution queue. Presence means the task is ready to be picked by the executor.
|
|
12
|
+
* @returns TaskExecutionQueueEntryResponseDto
|
|
14
13
|
* @throws ApiError
|
|
15
14
|
*/
|
|
16
|
-
static
|
|
15
|
+
static taskExecutionQueueControllerListQueue(config?: OpenAPIConfig): CancelablePromise<Array<TaskExecutionQueueEntryResponseDto>>;
|
|
16
|
+
/**
|
|
17
|
+
* Claim a specific task from the execution queue
|
|
18
|
+
* Atomically removes the task from the queue and inserts it into the active execution table.
|
|
19
|
+
* @param taskId Task ID to claim
|
|
20
|
+
* @returns ActiveTaskExecutionResponseDto
|
|
21
|
+
* @throws ApiError
|
|
22
|
+
*/
|
|
23
|
+
static taskExecutionQueueControllerClaimTask(taskId: string, config?: OpenAPIConfig): CancelablePromise<ActiveTaskExecutionResponseDto>;
|
|
24
|
+
/**
|
|
25
|
+
* List active task executions
|
|
26
|
+
* Returns the tasks currently being worked on in the execution system.
|
|
27
|
+
* @returns ActiveTaskExecutionResponseDto
|
|
28
|
+
* @throws ApiError
|
|
29
|
+
*/
|
|
30
|
+
static activeTaskExecutionControllerListActiveExecutions(config?: OpenAPIConfig): CancelablePromise<Array<ActiveTaskExecutionResponseDto>>;
|
|
31
|
+
/**
|
|
32
|
+
* Stop an active task execution and move it to history
|
|
33
|
+
* Atomically removes the execution from the active execution table and inserts it into the history table.
|
|
34
|
+
* @param executionId Execution ID to stop
|
|
35
|
+
* @param requestBody
|
|
36
|
+
* @returns TaskExecutionHistoryResponseDto
|
|
37
|
+
* @throws ApiError
|
|
38
|
+
*/
|
|
39
|
+
static activeTaskExecutionControllerStopTaskExecution(executionId: string, requestBody: StopActiveTaskExecutionDto, config?: OpenAPIConfig): CancelablePromise<TaskExecutionHistoryResponseDto>;
|
|
40
|
+
/**
|
|
41
|
+
* Attach the runner session id to an active execution
|
|
42
|
+
* Stores the runtime session identifier emitted by the agent harness so it can be propagated to execution history.
|
|
43
|
+
* @param executionId Execution ID to update
|
|
44
|
+
* @param requestBody
|
|
45
|
+
* @returns void
|
|
46
|
+
* @throws ApiError
|
|
47
|
+
*/
|
|
48
|
+
static activeTaskExecutionControllerUpdateRunnerSessionId(executionId: string, requestBody: UpdateRunnerSessionIdDto, config?: OpenAPIConfig): CancelablePromise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Increment tool call count for an active execution
|
|
51
|
+
* Atomically increments the active execution tool-call counter without touching other mutable execution fields.
|
|
52
|
+
* @param executionId Execution ID to update
|
|
53
|
+
* @returns void
|
|
54
|
+
* @throws ApiError
|
|
55
|
+
*/
|
|
56
|
+
static activeTaskExecutionControllerIncrementToolCallCount(executionId: string, config?: OpenAPIConfig): CancelablePromise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* List task execution history
|
|
59
|
+
* Returns the persisted execution history rows in the execution system.
|
|
60
|
+
* @returns TaskExecutionHistoryResponseDto
|
|
61
|
+
* @throws ApiError
|
|
62
|
+
*/
|
|
63
|
+
static taskExecutionHistoryControllerListHistory(config?: OpenAPIConfig): CancelablePromise<Array<TaskExecutionHistoryResponseDto>>;
|
|
17
64
|
}
|
|
@@ -2,27 +2,109 @@ import { OpenAPI } from '../core/OpenAPI.js';
|
|
|
2
2
|
import { request as __request } from '../core/request.js';
|
|
3
3
|
export class ExecutionsService {
|
|
4
4
|
/**
|
|
5
|
-
* List
|
|
6
|
-
* Returns the
|
|
7
|
-
* @
|
|
8
|
-
* @param agentActorId Filter by agent actor ID
|
|
9
|
-
* @param taskId Filter by task ID
|
|
10
|
-
* @param page Page number (1-indexed)
|
|
11
|
-
* @param limit Number of items per page
|
|
12
|
-
* @returns ExecutionListResponseDto
|
|
5
|
+
* List the current task execution work queue
|
|
6
|
+
* Returns the tasks currently present in the execution queue. Presence means the task is ready to be picked by the executor.
|
|
7
|
+
* @returns TaskExecutionQueueEntryResponseDto
|
|
13
8
|
* @throws ApiError
|
|
14
9
|
*/
|
|
15
|
-
static
|
|
10
|
+
static taskExecutionQueueControllerListQueue(config = OpenAPI) {
|
|
16
11
|
return __request(config, {
|
|
17
12
|
method: 'GET',
|
|
18
|
-
url: '/api/v1/executions',
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
url: '/api/v1/executions/queue',
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Claim a specific task from the execution queue
|
|
18
|
+
* Atomically removes the task from the queue and inserts it into the active execution table.
|
|
19
|
+
* @param taskId Task ID to claim
|
|
20
|
+
* @returns ActiveTaskExecutionResponseDto
|
|
21
|
+
* @throws ApiError
|
|
22
|
+
*/
|
|
23
|
+
static taskExecutionQueueControllerClaimTask(taskId, config = OpenAPI) {
|
|
24
|
+
return __request(config, {
|
|
25
|
+
method: 'POST',
|
|
26
|
+
url: '/api/v1/executions/queue/{taskId}/claim',
|
|
27
|
+
path: {
|
|
22
28
|
'taskId': taskId,
|
|
23
|
-
'page': page,
|
|
24
|
-
'limit': limit,
|
|
25
29
|
},
|
|
26
30
|
});
|
|
27
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* List active task executions
|
|
34
|
+
* Returns the tasks currently being worked on in the execution system.
|
|
35
|
+
* @returns ActiveTaskExecutionResponseDto
|
|
36
|
+
* @throws ApiError
|
|
37
|
+
*/
|
|
38
|
+
static activeTaskExecutionControllerListActiveExecutions(config = OpenAPI) {
|
|
39
|
+
return __request(config, {
|
|
40
|
+
method: 'GET',
|
|
41
|
+
url: '/api/v1/executions/active',
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Stop an active task execution and move it to history
|
|
46
|
+
* Atomically removes the execution from the active execution table and inserts it into the history table.
|
|
47
|
+
* @param executionId Execution ID to stop
|
|
48
|
+
* @param requestBody
|
|
49
|
+
* @returns TaskExecutionHistoryResponseDto
|
|
50
|
+
* @throws ApiError
|
|
51
|
+
*/
|
|
52
|
+
static activeTaskExecutionControllerStopTaskExecution(executionId, requestBody, config = OpenAPI) {
|
|
53
|
+
return __request(config, {
|
|
54
|
+
method: 'POST',
|
|
55
|
+
url: '/api/v1/executions/active/{executionId}/stop',
|
|
56
|
+
path: {
|
|
57
|
+
'executionId': executionId,
|
|
58
|
+
},
|
|
59
|
+
body: requestBody,
|
|
60
|
+
mediaType: 'application/json',
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Attach the runner session id to an active execution
|
|
65
|
+
* Stores the runtime session identifier emitted by the agent harness so it can be propagated to execution history.
|
|
66
|
+
* @param executionId Execution ID to update
|
|
67
|
+
* @param requestBody
|
|
68
|
+
* @returns void
|
|
69
|
+
* @throws ApiError
|
|
70
|
+
*/
|
|
71
|
+
static activeTaskExecutionControllerUpdateRunnerSessionId(executionId, requestBody, config = OpenAPI) {
|
|
72
|
+
return __request(config, {
|
|
73
|
+
method: 'PATCH',
|
|
74
|
+
url: '/api/v1/executions/active/{executionId}/session',
|
|
75
|
+
path: {
|
|
76
|
+
'executionId': executionId,
|
|
77
|
+
},
|
|
78
|
+
body: requestBody,
|
|
79
|
+
mediaType: 'application/json',
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Increment tool call count for an active execution
|
|
84
|
+
* Atomically increments the active execution tool-call counter without touching other mutable execution fields.
|
|
85
|
+
* @param executionId Execution ID to update
|
|
86
|
+
* @returns void
|
|
87
|
+
* @throws ApiError
|
|
88
|
+
*/
|
|
89
|
+
static activeTaskExecutionControllerIncrementToolCallCount(executionId, config = OpenAPI) {
|
|
90
|
+
return __request(config, {
|
|
91
|
+
method: 'PATCH',
|
|
92
|
+
url: '/api/v1/executions/active/{executionId}/tool-calls/increment',
|
|
93
|
+
path: {
|
|
94
|
+
'executionId': executionId,
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* List task execution history
|
|
100
|
+
* Returns the persisted execution history rows in the execution system.
|
|
101
|
+
* @returns TaskExecutionHistoryResponseDto
|
|
102
|
+
* @throws ApiError
|
|
103
|
+
*/
|
|
104
|
+
static taskExecutionHistoryControllerListHistory(config = OpenAPI) {
|
|
105
|
+
return __request(config, {
|
|
106
|
+
method: 'GET',
|
|
107
|
+
url: '/api/v1/executions/history',
|
|
108
|
+
});
|
|
109
|
+
}
|
|
28
110
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { WorkerResponseDto } from '../models/WorkerResponseDto.js';
|
|
2
|
+
import type { CancelablePromise } from '../core/CancelablePromise.js';
|
|
3
|
+
import type { OpenAPIConfig } from '../core/OpenAPI.js';
|
|
4
|
+
export declare class WorkersService {
|
|
5
|
+
/**
|
|
6
|
+
* List all workers
|
|
7
|
+
* @returns WorkerResponseDto List of all registered workers
|
|
8
|
+
* @throws ApiError
|
|
9
|
+
*/
|
|
10
|
+
static workersControllerListWorkers(config?: OpenAPIConfig): CancelablePromise<Array<WorkerResponseDto>>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OpenAPI } from '../core/OpenAPI.js';
|
|
2
|
+
import { request as __request } from '../core/request.js';
|
|
3
|
+
export class WorkersService {
|
|
4
|
+
/**
|
|
5
|
+
* List all workers
|
|
6
|
+
* @returns WorkerResponseDto List of all registered workers
|
|
7
|
+
* @throws ApiError
|
|
8
|
+
*/
|
|
9
|
+
static workersControllerListWorkers(config = OpenAPI) {
|
|
10
|
+
return __request(config, {
|
|
11
|
+
method: 'GET',
|
|
12
|
+
url: '/api/v1/workers',
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -21,7 +21,7 @@ export class AgentResource extends BaseClient {
|
|
|
21
21
|
}
|
|
22
22
|
/** Delete an agent */
|
|
23
23
|
async AgentsController_deleteAgent(params) {
|
|
24
|
-
return this.request('DELETE', `/api/v1/agents/${params.actorId}`, { signal: params?.signal });
|
|
24
|
+
return this.request('DELETE', `/api/v1/agents/${params.actorId}`, { responseType: 'void', signal: params?.signal });
|
|
25
25
|
}
|
|
26
26
|
/** List tool permissions for an agent */
|
|
27
27
|
async AgentToolPermissionsController_listAgentToolPermissions(params) {
|
|
@@ -33,6 +33,6 @@ export class AgentResource extends BaseClient {
|
|
|
33
33
|
}
|
|
34
34
|
/** Delete an agent tool permission assignment */
|
|
35
35
|
async AgentToolPermissionsController_deleteAgentToolPermission(params) {
|
|
36
|
-
return this.request('DELETE', `/api/v1/agents/${params.actorId}/tool-permissions/${params.serverId}`, { signal: params?.signal });
|
|
36
|
+
return this.request('DELETE', `/api/v1/agents/${params.actorId}/tool-permissions/${params.serverId}`, { responseType: 'void', signal: params?.signal });
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -17,11 +17,11 @@ export class AuthorizationServerResource extends BaseClient {
|
|
|
17
17
|
}
|
|
18
18
|
/** OAuth 2.0 Authorization Endpoint */
|
|
19
19
|
async AuthorizationController_authorize(params) {
|
|
20
|
-
return this.request('GET', `/api/v1/auth/authorize/mcp/${params.serverIdentifier}/${params.version}`, { params: { response_type: params.response_type, scope: params.scope, client_id: params.client_id, code_challenge: params.code_challenge, code_challenge_method: params.code_challenge_method, redirect_uri: params.redirect_uri, state: params.state, resource: params.resource }, signal: params?.signal });
|
|
20
|
+
return this.request('GET', `/api/v1/auth/authorize/mcp/${params.serverIdentifier}/${params.version}`, { params: { response_type: params.response_type, scope: params.scope, client_id: params.client_id, code_challenge: params.code_challenge, code_challenge_method: params.code_challenge_method, redirect_uri: params.redirect_uri, state: params.state, resource: params.resource }, responseType: 'void', signal: params?.signal });
|
|
21
21
|
}
|
|
22
22
|
/** OAuth 2.0 Authorization Consent Handler */
|
|
23
23
|
async AuthorizationController_authorizeConsent(params) {
|
|
24
|
-
return this.request('POST', `/api/v1/auth/authorize/mcp/${params.serverIdentifier}/${params.version}`, { body: params.body, signal: params?.signal });
|
|
24
|
+
return this.request('POST', `/api/v1/auth/authorize/mcp/${params.serverIdentifier}/${params.version}`, { body: params.body, responseType: 'void', signal: params?.signal });
|
|
25
25
|
}
|
|
26
26
|
/** Get metadata for the consent screen from flow ID */
|
|
27
27
|
async AuthorizationController_getConsentMetadata(params) {
|
|
@@ -41,7 +41,7 @@ export class AuthorizationServerResource extends BaseClient {
|
|
|
41
41
|
}
|
|
42
42
|
/** OAuth 2.0 Callback Endpoint for Downstream Systems */
|
|
43
43
|
async AuthorizationController_callback(params) {
|
|
44
|
-
return this.request('GET', '/api/v1/auth/callback', { params: { code: params.code, state: params.state, error: params.error, scope: params.scope, error_description: params.error_description }, signal: params?.signal });
|
|
44
|
+
return this.request('GET', '/api/v1/auth/callback', { params: { code: params.code, state: params.state, error: params.error, scope: params.scope, error_description: params.error_description }, responseType: 'void', signal: params?.signal });
|
|
45
45
|
}
|
|
46
46
|
/** List All Available Scopes */
|
|
47
47
|
async AuthorizationController_getScopes(params) {
|
|
@@ -18,10 +18,14 @@ export declare class BaseClient {
|
|
|
18
18
|
protected config: ClientConfig;
|
|
19
19
|
constructor(config: ClientConfig);
|
|
20
20
|
private parseResponseBody;
|
|
21
|
+
private hasHeader;
|
|
22
|
+
private removeHeader;
|
|
21
23
|
private buildAuthHeaders;
|
|
22
24
|
protected request<T>(method: string, path: string, options?: {
|
|
23
25
|
params?: Record<string, any>;
|
|
24
26
|
body?: any;
|
|
27
|
+
bodyType?: 'json' | 'form-data' | 'raw';
|
|
28
|
+
responseType?: 'auto' | 'json' | 'text' | 'arrayBuffer' | 'void';
|
|
25
29
|
headers?: Record<string, string>;
|
|
26
30
|
signal?: AbortSignal;
|
|
27
31
|
}): Promise<T>;
|
|
@@ -41,10 +41,29 @@ export class BaseClient {
|
|
|
41
41
|
constructor(config) {
|
|
42
42
|
this.config = config;
|
|
43
43
|
}
|
|
44
|
-
async parseResponseBody(response) {
|
|
44
|
+
async parseResponseBody(response, responseType = 'auto') {
|
|
45
|
+
if (responseType === 'void') {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
45
48
|
if (response.status === 204 || response.headers.get('content-length') === '0') {
|
|
46
49
|
return undefined;
|
|
47
50
|
}
|
|
51
|
+
if (responseType === 'json') {
|
|
52
|
+
try {
|
|
53
|
+
return await response.json();
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (responseType === 'text') {
|
|
60
|
+
const text = await response.text();
|
|
61
|
+
return text.length > 0 ? text : undefined;
|
|
62
|
+
}
|
|
63
|
+
if (responseType === 'arrayBuffer') {
|
|
64
|
+
const arrayBuffer = await response.arrayBuffer();
|
|
65
|
+
return arrayBuffer.byteLength > 0 ? arrayBuffer : undefined;
|
|
66
|
+
}
|
|
48
67
|
const contentType = response.headers.get('content-type');
|
|
49
68
|
if (contentType?.includes('application/json')) {
|
|
50
69
|
try {
|
|
@@ -57,6 +76,18 @@ export class BaseClient {
|
|
|
57
76
|
const text = await response.text();
|
|
58
77
|
return text.length > 0 ? text : undefined;
|
|
59
78
|
}
|
|
79
|
+
hasHeader(headers, headerName) {
|
|
80
|
+
const target = headerName.toLowerCase();
|
|
81
|
+
return Object.keys(headers).some((key) => key.toLowerCase() === target);
|
|
82
|
+
}
|
|
83
|
+
removeHeader(headers, headerName) {
|
|
84
|
+
const target = headerName.toLowerCase();
|
|
85
|
+
for (const key of Object.keys(headers)) {
|
|
86
|
+
if (key.toLowerCase() === target) {
|
|
87
|
+
delete headers[key];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
60
91
|
async buildAuthHeaders() {
|
|
61
92
|
const headers = {};
|
|
62
93
|
if (this.config.getAccessToken) {
|
|
@@ -98,22 +129,35 @@ export class BaseClient {
|
|
|
98
129
|
}
|
|
99
130
|
// Add auth headers
|
|
100
131
|
Object.assign(headers, await this.buildAuthHeaders());
|
|
101
|
-
|
|
102
|
-
if (options?.body
|
|
103
|
-
|
|
132
|
+
let requestBody;
|
|
133
|
+
if (options?.body !== undefined) {
|
|
134
|
+
const bodyType = options.bodyType ?? 'json';
|
|
135
|
+
if (bodyType === 'form-data') {
|
|
136
|
+
requestBody = options.body;
|
|
137
|
+
this.removeHeader(headers, 'Content-Type');
|
|
138
|
+
}
|
|
139
|
+
else if (bodyType === 'raw') {
|
|
140
|
+
requestBody = options.body;
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
if (!this.hasHeader(headers, 'Content-Type')) {
|
|
144
|
+
headers['Content-Type'] = 'application/json';
|
|
145
|
+
}
|
|
146
|
+
requestBody = JSON.stringify(options.body);
|
|
147
|
+
}
|
|
104
148
|
}
|
|
105
149
|
const response = await fetch(url.toString(), {
|
|
106
150
|
method,
|
|
107
151
|
headers,
|
|
108
|
-
body:
|
|
152
|
+
body: requestBody,
|
|
109
153
|
signal: options?.signal,
|
|
110
154
|
credentials: this.config.credentials,
|
|
111
155
|
});
|
|
112
156
|
if (!response.ok) {
|
|
113
|
-
const errorBody = await this.parseResponseBody(response);
|
|
157
|
+
const errorBody = await this.parseResponseBody(response, 'auto');
|
|
114
158
|
throw new ApiError(response, errorBody);
|
|
115
159
|
}
|
|
116
|
-
return await this.parseResponseBody(response);
|
|
160
|
+
return await this.parseResponseBody(response, options?.responseType ?? 'auto');
|
|
117
161
|
}
|
|
118
162
|
async *streamEvents(path, options) {
|
|
119
163
|
const url = new URL(path, this.config.baseUrl);
|
|
@@ -21,7 +21,7 @@ export class ChatProvidersResource extends BaseClient {
|
|
|
21
21
|
}
|
|
22
22
|
/** Delete a chat provider */
|
|
23
23
|
async ChatProvidersController_deleteChatProvider(params) {
|
|
24
|
-
return this.request('DELETE', `/api/v1/chat-providers/${params.id}`, { signal: params?.signal });
|
|
24
|
+
return this.request('DELETE', `/api/v1/chat-providers/${params.id}`, { responseType: 'void', signal: params?.signal });
|
|
25
25
|
}
|
|
26
26
|
/** Set the active chat provider */
|
|
27
27
|
async ChatProvidersController_setActiveChatProvider(params) {
|
|
@@ -29,6 +29,6 @@ export class ChatProvidersResource extends BaseClient {
|
|
|
29
29
|
}
|
|
30
30
|
/** Deactivate the active chat provider */
|
|
31
31
|
async ChatProvidersController_deactivateActiveChatProvider(params) {
|
|
32
|
-
return this.request('POST', '/api/v1/chat-providers/deactivate', { signal: params?.signal });
|
|
32
|
+
return this.request('POST', '/api/v1/chat-providers/deactivate', { responseType: 'void', signal: params?.signal });
|
|
33
33
|
}
|
|
34
34
|
}
|
package/dist/src/v2/client.d.ts
CHANGED
|
@@ -17,11 +17,11 @@ import { AgentExecutionTokensResource } from './agent-execution-tokens-resource.
|
|
|
17
17
|
import { ChatProvidersResource } from './chat-providers-resource.js';
|
|
18
18
|
import { SecretsResource } from './secrets-resource.js';
|
|
19
19
|
import { ContextResource } from './context-resource.js';
|
|
20
|
-
import {
|
|
20
|
+
import { ExecutionsResource } from './executions-resource.js';
|
|
21
|
+
import { WorkersResource } from './workers-resource.js';
|
|
21
22
|
import { TaskBlueprintsResource } from './task-blueprints-resource.js';
|
|
22
23
|
import { ScheduledTasksResource } from './scheduled-tasks-resource.js';
|
|
23
24
|
import { DiscoveryResource } from './discovery-resource.js';
|
|
24
|
-
import { ExecutionsResource } from './executions-resource.js';
|
|
25
25
|
import { SearchResource } from './search-resource.js';
|
|
26
26
|
export declare class ApiClient {
|
|
27
27
|
readonly app: AppResource;
|
|
@@ -42,11 +42,11 @@ export declare class ApiClient {
|
|
|
42
42
|
readonly chatProviders: ChatProvidersResource;
|
|
43
43
|
readonly secrets: SecretsResource;
|
|
44
44
|
readonly context: ContextResource;
|
|
45
|
-
readonly
|
|
45
|
+
readonly executions: ExecutionsResource;
|
|
46
|
+
readonly workers: WorkersResource;
|
|
46
47
|
readonly taskBlueprints: TaskBlueprintsResource;
|
|
47
48
|
readonly scheduledTasks: ScheduledTasksResource;
|
|
48
49
|
readonly discovery: DiscoveryResource;
|
|
49
|
-
readonly executions: ExecutionsResource;
|
|
50
50
|
readonly search: SearchResource;
|
|
51
51
|
constructor(config: ClientConfig);
|
|
52
52
|
}
|
package/dist/src/v2/client.js
CHANGED
|
@@ -16,11 +16,11 @@ import { AgentExecutionTokensResource } from './agent-execution-tokens-resource.
|
|
|
16
16
|
import { ChatProvidersResource } from './chat-providers-resource.js';
|
|
17
17
|
import { SecretsResource } from './secrets-resource.js';
|
|
18
18
|
import { ContextResource } from './context-resource.js';
|
|
19
|
-
import {
|
|
19
|
+
import { ExecutionsResource } from './executions-resource.js';
|
|
20
|
+
import { WorkersResource } from './workers-resource.js';
|
|
20
21
|
import { TaskBlueprintsResource } from './task-blueprints-resource.js';
|
|
21
22
|
import { ScheduledTasksResource } from './scheduled-tasks-resource.js';
|
|
22
23
|
import { DiscoveryResource } from './discovery-resource.js';
|
|
23
|
-
import { ExecutionsResource } from './executions-resource.js';
|
|
24
24
|
import { SearchResource } from './search-resource.js';
|
|
25
25
|
export class ApiClient {
|
|
26
26
|
app;
|
|
@@ -41,11 +41,11 @@ export class ApiClient {
|
|
|
41
41
|
chatProviders;
|
|
42
42
|
secrets;
|
|
43
43
|
context;
|
|
44
|
-
|
|
44
|
+
executions;
|
|
45
|
+
workers;
|
|
45
46
|
taskBlueprints;
|
|
46
47
|
scheduledTasks;
|
|
47
48
|
discovery;
|
|
48
|
-
executions;
|
|
49
49
|
search;
|
|
50
50
|
constructor(config) {
|
|
51
51
|
this.app = new AppResource(config);
|
|
@@ -66,11 +66,11 @@ export class ApiClient {
|
|
|
66
66
|
this.chatProviders = new ChatProvidersResource(config);
|
|
67
67
|
this.secrets = new SecretsResource(config);
|
|
68
68
|
this.context = new ContextResource(config);
|
|
69
|
-
this.
|
|
69
|
+
this.executions = new ExecutionsResource(config);
|
|
70
|
+
this.workers = new WorkersResource(config);
|
|
70
71
|
this.taskBlueprints = new TaskBlueprintsResource(config);
|
|
71
72
|
this.scheduledTasks = new ScheduledTasksResource(config);
|
|
72
73
|
this.discovery = new DiscoveryResource(config);
|
|
73
|
-
this.executions = new ExecutionsResource(config);
|
|
74
74
|
this.search = new SearchResource(config);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseClient, ClientConfig } from './base-client.js';
|
|
2
|
-
import type { AppendBlockDto, BlockListResponseDto, BlockResponseDto, BlockSearchResultDto, BlockTreeResponseDto, CreateBlockDto, CreateTagDto, MoveBlockDto, ReorderBlockDto, UpdateBlockDto } from './types.js';
|
|
2
|
+
import type { AppendBlockDto, BlockListResponseDto, BlockResponseDto, BlockSearchResultDto, BlockTreeResponseDto, CreateBlockDto, CreateTagDto, ImportBlocksResponseDto, MoveBlockDto, ReorderBlockDto, UpdateBlockDto } from './types.js';
|
|
3
3
|
export declare class ContextResource extends BaseClient {
|
|
4
4
|
constructor(config: ClientConfig);
|
|
5
5
|
/** Create a new wiki page */
|
|
@@ -23,6 +23,15 @@ export declare class ContextResource extends BaseClient {
|
|
|
23
23
|
ContextController_getBlockTree(params?: {
|
|
24
24
|
signal?: AbortSignal;
|
|
25
25
|
}): Promise<BlockTreeResponseDto[]>;
|
|
26
|
+
/** Export all context blocks as markdown zip */
|
|
27
|
+
ContextController_exportBlocks(params?: {
|
|
28
|
+
signal?: AbortSignal;
|
|
29
|
+
}): Promise<ArrayBuffer>;
|
|
30
|
+
/** Import context blocks from markdown zip */
|
|
31
|
+
ContextController_importBlocks(params: {
|
|
32
|
+
body: FormData;
|
|
33
|
+
signal?: AbortSignal;
|
|
34
|
+
}): Promise<ImportBlocksResponseDto>;
|
|
26
35
|
/** Fetch a wiki page by ID */
|
|
27
36
|
ContextController_getBlock(params: {
|
|
28
37
|
id: string;
|