@komputer-ai/sdk 0.11.1
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/.openapi-generator-ignore +31 -0
- package/README.md +147 -0
- package/docs/AgentListResponse.md +34 -0
- package/docs/AgentResponse.md +68 -0
- package/docs/AgentsApi.md +584 -0
- package/docs/ConnectorResponse.md +58 -0
- package/docs/ConnectorsApi.md +366 -0
- package/docs/CreateAgentRequest.md +58 -0
- package/docs/CreateConnectorRequest.md +54 -0
- package/docs/CreateMemoryRequest.md +40 -0
- package/docs/CreateScheduleAgentSpec.md +42 -0
- package/docs/CreateScheduleRequest.md +50 -0
- package/docs/CreateSecretRequest.md +38 -0
- package/docs/CreateSkillRequest.md +40 -0
- package/docs/MemoriesApi.md +368 -0
- package/docs/MemoryResponse.md +46 -0
- package/docs/OfficeListResponse.md +34 -0
- package/docs/OfficeMemberResponse.md +40 -0
- package/docs/OfficeResponse.md +54 -0
- package/docs/OfficesApi.md +300 -0
- package/docs/PatchAgentRequest.md +50 -0
- package/docs/PatchMemoryRequest.md +36 -0
- package/docs/PatchScheduleRequest.md +34 -0
- package/docs/PatchSkillRequest.md +36 -0
- package/docs/ScheduleListResponse.md +34 -0
- package/docs/ScheduleResponse.md +70 -0
- package/docs/SchedulesApi.md +369 -0
- package/docs/SecretListResponse.md +34 -0
- package/docs/SecretResponse.md +48 -0
- package/docs/SecretsApi.md +298 -0
- package/docs/SkillResponse.md +48 -0
- package/docs/SkillsApi.md +368 -0
- package/docs/TemplatesApi.md +138 -0
- package/docs/UpdateSecretRequest.md +36 -0
- package/package.json +27 -0
- package/src/apis/AgentsApi.ts +485 -0
- package/src/apis/ConnectorsApi.ts +301 -0
- package/src/apis/MemoriesApi.ts +315 -0
- package/src/apis/OfficesApi.ts +253 -0
- package/src/apis/SchedulesApi.ts +318 -0
- package/src/apis/SecretsApi.ts +267 -0
- package/src/apis/SkillsApi.ts +315 -0
- package/src/apis/TemplatesApi.ts +109 -0
- package/src/apis/index.ts +10 -0
- package/src/client.test.ts +88 -0
- package/src/client.ts +212 -0
- package/src/index.ts +7 -0
- package/src/models/AgentListResponse.ts +73 -0
- package/src/models/AgentResponse.ts +201 -0
- package/src/models/ConnectorResponse.ts +161 -0
- package/src/models/CreateAgentRequest.ts +163 -0
- package/src/models/CreateConnectorRequest.ts +148 -0
- package/src/models/CreateMemoryRequest.ts +91 -0
- package/src/models/CreateScheduleAgentSpec.ts +97 -0
- package/src/models/CreateScheduleRequest.ts +140 -0
- package/src/models/CreateSecretRequest.ts +83 -0
- package/src/models/CreateSkillRequest.ts +92 -0
- package/src/models/MemoryResponse.ts +113 -0
- package/src/models/OfficeListResponse.ts +73 -0
- package/src/models/OfficeMemberResponse.ts +89 -0
- package/src/models/OfficeResponse.ts +153 -0
- package/src/models/PatchAgentRequest.ts +129 -0
- package/src/models/PatchMemoryRequest.ts +73 -0
- package/src/models/PatchScheduleRequest.ts +65 -0
- package/src/models/PatchSkillRequest.ts +73 -0
- package/src/models/ScheduleListResponse.ts +73 -0
- package/src/models/ScheduleResponse.ts +209 -0
- package/src/models/SecretListResponse.ts +73 -0
- package/src/models/SecretResponse.ts +121 -0
- package/src/models/SkillResponse.ts +121 -0
- package/src/models/UpdateSecretRequest.ts +74 -0
- package/src/models/index.ts +26 -0
- package/src/runtime.ts +450 -0
- package/src/watch.ts +89 -0
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +18 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# TemplatesApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *http://localhost:8080/api/v1*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
| [**listTemplates**](TemplatesApi.md#listtemplates) | **GET** /templates | List agent templates |
|
|
8
|
+
| [**namespacesGet**](TemplatesApi.md#namespacesget) | **GET** /namespaces | List namespaces |
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## listTemplates
|
|
13
|
+
|
|
14
|
+
> { [key: string]: any; } listTemplates(namespace)
|
|
15
|
+
|
|
16
|
+
List agent templates
|
|
17
|
+
|
|
18
|
+
Returns all agent templates (both namespace-scoped and cluster-scoped) available in the specified namespace.
|
|
19
|
+
|
|
20
|
+
### Example
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import {
|
|
24
|
+
Configuration,
|
|
25
|
+
TemplatesApi,
|
|
26
|
+
} from 'komputer-ai';
|
|
27
|
+
import type { ListTemplatesRequest } from 'komputer-ai';
|
|
28
|
+
|
|
29
|
+
async function example() {
|
|
30
|
+
console.log("🚀 Testing komputer-ai SDK...");
|
|
31
|
+
const api = new TemplatesApi();
|
|
32
|
+
|
|
33
|
+
const body = {
|
|
34
|
+
// string | Kubernetes namespace (optional)
|
|
35
|
+
namespace: namespace_example,
|
|
36
|
+
} satisfies ListTemplatesRequest;
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
const data = await api.listTemplates(body);
|
|
40
|
+
console.log(data);
|
|
41
|
+
} catch (error) {
|
|
42
|
+
console.error(error);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Run the test
|
|
47
|
+
example().catch(console.error);
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Parameters
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
| Name | Type | Description | Notes |
|
|
54
|
+
|------------- | ------------- | ------------- | -------------|
|
|
55
|
+
| **namespace** | `string` | Kubernetes namespace | [Optional] [Defaults to `undefined`] |
|
|
56
|
+
|
|
57
|
+
### Return type
|
|
58
|
+
|
|
59
|
+
**{ [key: string]: any; }**
|
|
60
|
+
|
|
61
|
+
### Authorization
|
|
62
|
+
|
|
63
|
+
No authorization required
|
|
64
|
+
|
|
65
|
+
### HTTP request headers
|
|
66
|
+
|
|
67
|
+
- **Content-Type**: Not defined
|
|
68
|
+
- **Accept**: `application/json`
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### HTTP response details
|
|
72
|
+
| Status code | Description | Response headers |
|
|
73
|
+
|-------------|-------------|------------------|
|
|
74
|
+
| **200** | List of templates | - |
|
|
75
|
+
| **500** | Internal error | - |
|
|
76
|
+
|
|
77
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
## namespacesGet
|
|
81
|
+
|
|
82
|
+
> { [key: string]: any; } namespacesGet()
|
|
83
|
+
|
|
84
|
+
List namespaces
|
|
85
|
+
|
|
86
|
+
Returns all Kubernetes namespaces the API has access to.
|
|
87
|
+
|
|
88
|
+
### Example
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
import {
|
|
92
|
+
Configuration,
|
|
93
|
+
TemplatesApi,
|
|
94
|
+
} from 'komputer-ai';
|
|
95
|
+
import type { NamespacesGetRequest } from 'komputer-ai';
|
|
96
|
+
|
|
97
|
+
async function example() {
|
|
98
|
+
console.log("🚀 Testing komputer-ai SDK...");
|
|
99
|
+
const api = new TemplatesApi();
|
|
100
|
+
|
|
101
|
+
try {
|
|
102
|
+
const data = await api.namespacesGet();
|
|
103
|
+
console.log(data);
|
|
104
|
+
} catch (error) {
|
|
105
|
+
console.error(error);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Run the test
|
|
110
|
+
example().catch(console.error);
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Parameters
|
|
114
|
+
|
|
115
|
+
This endpoint does not need any parameter.
|
|
116
|
+
|
|
117
|
+
### Return type
|
|
118
|
+
|
|
119
|
+
**{ [key: string]: any; }**
|
|
120
|
+
|
|
121
|
+
### Authorization
|
|
122
|
+
|
|
123
|
+
No authorization required
|
|
124
|
+
|
|
125
|
+
### HTTP request headers
|
|
126
|
+
|
|
127
|
+
- **Content-Type**: Not defined
|
|
128
|
+
- **Accept**: `application/json`
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
### HTTP response details
|
|
132
|
+
| Status code | Description | Response headers |
|
|
133
|
+
|-------------|-------------|------------------|
|
|
134
|
+
| **200** | List of namespaces | - |
|
|
135
|
+
| **500** | Internal error | - |
|
|
136
|
+
|
|
137
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
138
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# UpdateSecretRequest
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`data` | { [key: string]: string; }
|
|
10
|
+
`namespace` | string
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { UpdateSecretRequest } from 'komputer-ai'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"data": null,
|
|
20
|
+
"namespace": null,
|
|
21
|
+
} satisfies UpdateSecretRequest
|
|
22
|
+
|
|
23
|
+
console.log(example)
|
|
24
|
+
|
|
25
|
+
// Convert the instance to a JSON string
|
|
26
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
27
|
+
console.log(exampleJSON)
|
|
28
|
+
|
|
29
|
+
// Parse the JSON string back to an object
|
|
30
|
+
const exampleParsed = JSON.parse(exampleJSON) as UpdateSecretRequest
|
|
31
|
+
console.log(exampleParsed)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
35
|
+
|
|
36
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@komputer-ai/sdk",
|
|
3
|
+
"version": "0.11.1",
|
|
4
|
+
"description": "TypeScript SDK for the komputer.ai platform",
|
|
5
|
+
"author": "kontroloop-ai",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/kontroloop-ai/komputer-ai.git",
|
|
10
|
+
"directory": "komputer-sdk/typescript"
|
|
11
|
+
},
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"main": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"module": "./dist/esm/index.js",
|
|
18
|
+
"sideEffects": false,
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsc && tsc -p tsconfig.esm.json",
|
|
21
|
+
"prepare": "npm run build"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"typescript": "^4.0 || ^5.0",
|
|
25
|
+
"vitest": "^4.1.4"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* komputer.ai API
|
|
5
|
+
* API-first platform for running persistent Claude AI agents on Kubernetes. Designed to be driven by external systems — create agents, send tasks, and stream real-time results via REST + WebSocket.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import type {
|
|
18
|
+
AgentListResponse,
|
|
19
|
+
AgentResponse,
|
|
20
|
+
CreateAgentRequest,
|
|
21
|
+
PatchAgentRequest,
|
|
22
|
+
} from '../models/index';
|
|
23
|
+
import {
|
|
24
|
+
AgentListResponseFromJSON,
|
|
25
|
+
AgentListResponseToJSON,
|
|
26
|
+
AgentResponseFromJSON,
|
|
27
|
+
AgentResponseToJSON,
|
|
28
|
+
CreateAgentRequestFromJSON,
|
|
29
|
+
CreateAgentRequestToJSON,
|
|
30
|
+
PatchAgentRequestFromJSON,
|
|
31
|
+
PatchAgentRequestToJSON,
|
|
32
|
+
} from '../models/index';
|
|
33
|
+
|
|
34
|
+
export interface AgentsNameWsGetRequest {
|
|
35
|
+
name: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface CancelAgentTaskRequest {
|
|
39
|
+
name: string;
|
|
40
|
+
namespace?: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface CreateAgentOperationRequest {
|
|
44
|
+
request: CreateAgentRequest;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface DeleteAgentRequest {
|
|
48
|
+
name: string;
|
|
49
|
+
namespace?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface GetAgentRequest {
|
|
53
|
+
name: string;
|
|
54
|
+
namespace?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface GetAgentEventsRequest {
|
|
58
|
+
name: string;
|
|
59
|
+
namespace?: string;
|
|
60
|
+
limit?: number;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface ListAgentsRequest {
|
|
64
|
+
namespace?: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface PatchAgentOperationRequest {
|
|
68
|
+
name: string;
|
|
69
|
+
request: PatchAgentRequest;
|
|
70
|
+
namespace?: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
*
|
|
75
|
+
*/
|
|
76
|
+
export class AgentsApi extends runtime.BaseAPI {
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Creates request options for agentsNameWsGet without sending the request
|
|
80
|
+
*/
|
|
81
|
+
async agentsNameWsGetRequestOpts(requestParameters: AgentsNameWsGetRequest): Promise<runtime.RequestOpts> {
|
|
82
|
+
if (requestParameters['name'] == null) {
|
|
83
|
+
throw new runtime.RequiredError(
|
|
84
|
+
'name',
|
|
85
|
+
'Required parameter "name" was null or undefined when calling agentsNameWsGet().'
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const queryParameters: any = {};
|
|
90
|
+
|
|
91
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
let urlPath = `/agents/{name}/ws`;
|
|
95
|
+
urlPath = urlPath.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters['name'])));
|
|
96
|
+
|
|
97
|
+
return {
|
|
98
|
+
path: urlPath,
|
|
99
|
+
method: 'GET',
|
|
100
|
+
headers: headerParameters,
|
|
101
|
+
query: queryParameters,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Upgrades to a WebSocket connection to stream real-time agent events. Events include task_started, thinking, tool_call, tool_result, text, task_completed, task_cancelled, and error.
|
|
107
|
+
* Stream agent events (WebSocket)
|
|
108
|
+
*/
|
|
109
|
+
async agentsNameWsGetRaw(requestParameters: AgentsNameWsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
110
|
+
const requestOptions = await this.agentsNameWsGetRequestOpts(requestParameters);
|
|
111
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
112
|
+
|
|
113
|
+
return new runtime.VoidApiResponse(response);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Upgrades to a WebSocket connection to stream real-time agent events. Events include task_started, thinking, tool_call, tool_result, text, task_completed, task_cancelled, and error.
|
|
118
|
+
* Stream agent events (WebSocket)
|
|
119
|
+
*/
|
|
120
|
+
async agentsNameWsGet(requestParameters: AgentsNameWsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
121
|
+
await this.agentsNameWsGetRaw(requestParameters, initOverrides);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Creates request options for cancelAgentTask without sending the request
|
|
126
|
+
*/
|
|
127
|
+
async cancelAgentTaskRequestOpts(requestParameters: CancelAgentTaskRequest): Promise<runtime.RequestOpts> {
|
|
128
|
+
if (requestParameters['name'] == null) {
|
|
129
|
+
throw new runtime.RequiredError(
|
|
130
|
+
'name',
|
|
131
|
+
'Required parameter "name" was null or undefined when calling cancelAgentTask().'
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const queryParameters: any = {};
|
|
136
|
+
|
|
137
|
+
if (requestParameters['namespace'] != null) {
|
|
138
|
+
queryParameters['namespace'] = requestParameters['namespace'];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
let urlPath = `/agents/{name}/cancel`;
|
|
145
|
+
urlPath = urlPath.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters['name'])));
|
|
146
|
+
|
|
147
|
+
return {
|
|
148
|
+
path: urlPath,
|
|
149
|
+
method: 'POST',
|
|
150
|
+
headers: headerParameters,
|
|
151
|
+
query: queryParameters,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Gracefully cancels the currently running task. The agent pod stays alive for future tasks.
|
|
157
|
+
* Cancel agent task
|
|
158
|
+
*/
|
|
159
|
+
async cancelAgentTaskRaw(requestParameters: CancelAgentTaskRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{ [key: string]: string; }>> {
|
|
160
|
+
const requestOptions = await this.cancelAgentTaskRequestOpts(requestParameters);
|
|
161
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
162
|
+
|
|
163
|
+
return new runtime.JSONApiResponse<any>(response);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Gracefully cancels the currently running task. The agent pod stays alive for future tasks.
|
|
168
|
+
* Cancel agent task
|
|
169
|
+
*/
|
|
170
|
+
async cancelAgentTask(requestParameters: CancelAgentTaskRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: string; }> {
|
|
171
|
+
const response = await this.cancelAgentTaskRaw(requestParameters, initOverrides);
|
|
172
|
+
return await response.value();
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Creates request options for createAgent without sending the request
|
|
177
|
+
*/
|
|
178
|
+
async createAgentRequestOpts(requestParameters: CreateAgentOperationRequest): Promise<runtime.RequestOpts> {
|
|
179
|
+
if (requestParameters['request'] == null) {
|
|
180
|
+
throw new runtime.RequiredError(
|
|
181
|
+
'request',
|
|
182
|
+
'Required parameter "request" was null or undefined when calling createAgent().'
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const queryParameters: any = {};
|
|
187
|
+
|
|
188
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
189
|
+
|
|
190
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
let urlPath = `/agents`;
|
|
194
|
+
|
|
195
|
+
return {
|
|
196
|
+
path: urlPath,
|
|
197
|
+
method: 'POST',
|
|
198
|
+
headers: headerParameters,
|
|
199
|
+
query: queryParameters,
|
|
200
|
+
body: CreateAgentRequestToJSON(requestParameters['request']),
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Creates a new agent or sends a task to an existing idle agent (upsert by name). If the agent doesn\'t exist, it is created. If it exists and is idle, the task is forwarded.
|
|
206
|
+
* Create agent or send task
|
|
207
|
+
*/
|
|
208
|
+
async createAgentRaw(requestParameters: CreateAgentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentResponse>> {
|
|
209
|
+
const requestOptions = await this.createAgentRequestOpts(requestParameters);
|
|
210
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
211
|
+
|
|
212
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AgentResponseFromJSON(jsonValue));
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Creates a new agent or sends a task to an existing idle agent (upsert by name). If the agent doesn\'t exist, it is created. If it exists and is idle, the task is forwarded.
|
|
217
|
+
* Create agent or send task
|
|
218
|
+
*/
|
|
219
|
+
async createAgent(requestParameters: CreateAgentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentResponse> {
|
|
220
|
+
const response = await this.createAgentRaw(requestParameters, initOverrides);
|
|
221
|
+
return await response.value();
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Creates request options for deleteAgent without sending the request
|
|
226
|
+
*/
|
|
227
|
+
async deleteAgentRequestOpts(requestParameters: DeleteAgentRequest): Promise<runtime.RequestOpts> {
|
|
228
|
+
if (requestParameters['name'] == null) {
|
|
229
|
+
throw new runtime.RequiredError(
|
|
230
|
+
'name',
|
|
231
|
+
'Required parameter "name" was null or undefined when calling deleteAgent().'
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
const queryParameters: any = {};
|
|
236
|
+
|
|
237
|
+
if (requestParameters['namespace'] != null) {
|
|
238
|
+
queryParameters['namespace'] = requestParameters['namespace'];
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
let urlPath = `/agents/{name}`;
|
|
245
|
+
urlPath = urlPath.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters['name'])));
|
|
246
|
+
|
|
247
|
+
return {
|
|
248
|
+
path: urlPath,
|
|
249
|
+
method: 'DELETE',
|
|
250
|
+
headers: headerParameters,
|
|
251
|
+
query: queryParameters,
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Deletes the agent CR, pod, PVC, secrets, and Redis event stream.
|
|
257
|
+
* Delete agent
|
|
258
|
+
*/
|
|
259
|
+
async deleteAgentRaw(requestParameters: DeleteAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{ [key: string]: string; }>> {
|
|
260
|
+
const requestOptions = await this.deleteAgentRequestOpts(requestParameters);
|
|
261
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
262
|
+
|
|
263
|
+
return new runtime.JSONApiResponse<any>(response);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Deletes the agent CR, pod, PVC, secrets, and Redis event stream.
|
|
268
|
+
* Delete agent
|
|
269
|
+
*/
|
|
270
|
+
async deleteAgent(requestParameters: DeleteAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: string; }> {
|
|
271
|
+
const response = await this.deleteAgentRaw(requestParameters, initOverrides);
|
|
272
|
+
return await response.value();
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Creates request options for getAgent without sending the request
|
|
277
|
+
*/
|
|
278
|
+
async getAgentRequestOpts(requestParameters: GetAgentRequest): Promise<runtime.RequestOpts> {
|
|
279
|
+
if (requestParameters['name'] == null) {
|
|
280
|
+
throw new runtime.RequiredError(
|
|
281
|
+
'name',
|
|
282
|
+
'Required parameter "name" was null or undefined when calling getAgent().'
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
const queryParameters: any = {};
|
|
287
|
+
|
|
288
|
+
if (requestParameters['namespace'] != null) {
|
|
289
|
+
queryParameters['namespace'] = requestParameters['namespace'];
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
let urlPath = `/agents/{name}`;
|
|
296
|
+
urlPath = urlPath.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters['name'])));
|
|
297
|
+
|
|
298
|
+
return {
|
|
299
|
+
path: urlPath,
|
|
300
|
+
method: 'GET',
|
|
301
|
+
headers: headerParameters,
|
|
302
|
+
query: queryParameters,
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Returns the current status and metadata for a single agent.
|
|
308
|
+
* Get agent details
|
|
309
|
+
*/
|
|
310
|
+
async getAgentRaw(requestParameters: GetAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentResponse>> {
|
|
311
|
+
const requestOptions = await this.getAgentRequestOpts(requestParameters);
|
|
312
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
313
|
+
|
|
314
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AgentResponseFromJSON(jsonValue));
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Returns the current status and metadata for a single agent.
|
|
319
|
+
* Get agent details
|
|
320
|
+
*/
|
|
321
|
+
async getAgent(requestParameters: GetAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentResponse> {
|
|
322
|
+
const response = await this.getAgentRaw(requestParameters, initOverrides);
|
|
323
|
+
return await response.value();
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Creates request options for getAgentEvents without sending the request
|
|
328
|
+
*/
|
|
329
|
+
async getAgentEventsRequestOpts(requestParameters: GetAgentEventsRequest): Promise<runtime.RequestOpts> {
|
|
330
|
+
if (requestParameters['name'] == null) {
|
|
331
|
+
throw new runtime.RequiredError(
|
|
332
|
+
'name',
|
|
333
|
+
'Required parameter "name" was null or undefined when calling getAgentEvents().'
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
const queryParameters: any = {};
|
|
338
|
+
|
|
339
|
+
if (requestParameters['namespace'] != null) {
|
|
340
|
+
queryParameters['namespace'] = requestParameters['namespace'];
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
if (requestParameters['limit'] != null) {
|
|
344
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
let urlPath = `/agents/{name}/events`;
|
|
351
|
+
urlPath = urlPath.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters['name'])));
|
|
352
|
+
|
|
353
|
+
return {
|
|
354
|
+
path: urlPath,
|
|
355
|
+
method: 'GET',
|
|
356
|
+
headers: headerParameters,
|
|
357
|
+
query: queryParameters,
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Returns recent events from the agent\'s Redis stream in chronological order.
|
|
363
|
+
* Get agent events
|
|
364
|
+
*/
|
|
365
|
+
async getAgentEventsRaw(requestParameters: GetAgentEventsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{ [key: string]: any; }>> {
|
|
366
|
+
const requestOptions = await this.getAgentEventsRequestOpts(requestParameters);
|
|
367
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
368
|
+
|
|
369
|
+
return new runtime.JSONApiResponse<any>(response);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Returns recent events from the agent\'s Redis stream in chronological order.
|
|
374
|
+
* Get agent events
|
|
375
|
+
*/
|
|
376
|
+
async getAgentEvents(requestParameters: GetAgentEventsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> {
|
|
377
|
+
const response = await this.getAgentEventsRaw(requestParameters, initOverrides);
|
|
378
|
+
return await response.value();
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Creates request options for listAgents without sending the request
|
|
383
|
+
*/
|
|
384
|
+
async listAgentsRequestOpts(requestParameters: ListAgentsRequest): Promise<runtime.RequestOpts> {
|
|
385
|
+
const queryParameters: any = {};
|
|
386
|
+
|
|
387
|
+
if (requestParameters['namespace'] != null) {
|
|
388
|
+
queryParameters['namespace'] = requestParameters['namespace'];
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
let urlPath = `/agents`;
|
|
395
|
+
|
|
396
|
+
return {
|
|
397
|
+
path: urlPath,
|
|
398
|
+
method: 'GET',
|
|
399
|
+
headers: headerParameters,
|
|
400
|
+
query: queryParameters,
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* Returns all agents with their current status in the specified namespace.
|
|
406
|
+
* List agents
|
|
407
|
+
*/
|
|
408
|
+
async listAgentsRaw(requestParameters: ListAgentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentListResponse>> {
|
|
409
|
+
const requestOptions = await this.listAgentsRequestOpts(requestParameters);
|
|
410
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
411
|
+
|
|
412
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AgentListResponseFromJSON(jsonValue));
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Returns all agents with their current status in the specified namespace.
|
|
417
|
+
* List agents
|
|
418
|
+
*/
|
|
419
|
+
async listAgents(requestParameters: ListAgentsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentListResponse> {
|
|
420
|
+
const response = await this.listAgentsRaw(requestParameters, initOverrides);
|
|
421
|
+
return await response.value();
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Creates request options for patchAgent without sending the request
|
|
426
|
+
*/
|
|
427
|
+
async patchAgentRequestOpts(requestParameters: PatchAgentOperationRequest): Promise<runtime.RequestOpts> {
|
|
428
|
+
if (requestParameters['name'] == null) {
|
|
429
|
+
throw new runtime.RequiredError(
|
|
430
|
+
'name',
|
|
431
|
+
'Required parameter "name" was null or undefined when calling patchAgent().'
|
|
432
|
+
);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
if (requestParameters['request'] == null) {
|
|
436
|
+
throw new runtime.RequiredError(
|
|
437
|
+
'request',
|
|
438
|
+
'Required parameter "request" was null or undefined when calling patchAgent().'
|
|
439
|
+
);
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
const queryParameters: any = {};
|
|
443
|
+
|
|
444
|
+
if (requestParameters['namespace'] != null) {
|
|
445
|
+
queryParameters['namespace'] = requestParameters['namespace'];
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
449
|
+
|
|
450
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
let urlPath = `/agents/{name}`;
|
|
454
|
+
urlPath = urlPath.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters['name'])));
|
|
455
|
+
|
|
456
|
+
return {
|
|
457
|
+
path: urlPath,
|
|
458
|
+
method: 'PATCH',
|
|
459
|
+
headers: headerParameters,
|
|
460
|
+
query: queryParameters,
|
|
461
|
+
body: PatchAgentRequestToJSON(requestParameters['request']),
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Updates model, lifecycle, instructions, secretRefs, memories, skills, or connectors on an existing agent.
|
|
467
|
+
* Patch agent
|
|
468
|
+
*/
|
|
469
|
+
async patchAgentRaw(requestParameters: PatchAgentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentResponse>> {
|
|
470
|
+
const requestOptions = await this.patchAgentRequestOpts(requestParameters);
|
|
471
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
472
|
+
|
|
473
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AgentResponseFromJSON(jsonValue));
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* Updates model, lifecycle, instructions, secretRefs, memories, skills, or connectors on an existing agent.
|
|
478
|
+
* Patch agent
|
|
479
|
+
*/
|
|
480
|
+
async patchAgent(requestParameters: PatchAgentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentResponse> {
|
|
481
|
+
const response = await this.patchAgentRaw(requestParameters, initOverrides);
|
|
482
|
+
return await response.value();
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
}
|