@daocloud-proto/agentclaw 0.0.1-dev-2dff1e69 → 0.0.1-dev-31ebb535
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/package.json +1 -1
- package/v1alpha1/agent.pb.ts +213 -22
package/package.json
CHANGED
package/v1alpha1/agent.pb.ts
CHANGED
|
@@ -5,43 +5,234 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as fm from "../fetch.pb"
|
|
8
|
-
import * as
|
|
8
|
+
import * as GoogleProtobufEmpty from "../google/api/empty.pb"
|
|
9
9
|
import * as AgentclawV1alpha1Page from "./page.pb"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
|
|
11
|
+
export enum RegionStorageStatus {
|
|
12
|
+
unspecified = "unspecified",
|
|
13
|
+
uninitialized = "uninitialized",
|
|
14
|
+
created = "created",
|
|
15
|
+
initializing = "initializing",
|
|
16
|
+
initialFailed = "initialFailed",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export enum InstanceStatus {
|
|
20
|
+
STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
|
|
21
|
+
RUNNING = "RUNNING",
|
|
22
|
+
PENDING = "PENDING",
|
|
23
|
+
STOPPING = "STOPPING",
|
|
24
|
+
DELETING = "DELETING",
|
|
25
|
+
STOPPED = "STOPPED",
|
|
26
|
+
DELETED = "DELETED",
|
|
27
|
+
CREATING = "CREATING",
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export enum StorageType {
|
|
31
|
+
StorageTypeUnspecified = "StorageTypeUnspecified",
|
|
32
|
+
LocalStorage = "LocalStorage",
|
|
33
|
+
FileStorage = "FileStorage",
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export enum ImageType {
|
|
37
|
+
IMAGE_TYPE_UNSPECIFIED = "IMAGE_TYPE_UNSPECIFIED",
|
|
38
|
+
IMAGE_OFFICIAL = "IMAGE_OFFICIAL",
|
|
39
|
+
IMAGE_APPLICATION = "IMAGE_APPLICATION",
|
|
40
|
+
IMAGE_CUSTOM = "IMAGE_CUSTOM",
|
|
41
|
+
IMAGE_PRIVATE = "IMAGE_PRIVATE",
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export enum InstanceType {
|
|
45
|
+
INSTANCE_TYPE_UNSPECIFIED = "INSTANCE_TYPE_UNSPECIFIED",
|
|
46
|
+
POD = "POD",
|
|
47
|
+
VM = "VM",
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export enum NetworkType {
|
|
51
|
+
NETWORK_TYPE_UNSPECIFIED = "NETWORK_TYPE_UNSPECIFIED",
|
|
52
|
+
SSH = "SSH",
|
|
53
|
+
JUPYTER = "JUPYTER",
|
|
54
|
+
VSCODE = "VSCODE",
|
|
55
|
+
CUSTOM = "CUSTOM",
|
|
56
|
+
SYSTEM = "SYSTEM",
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export enum NetworkProtocol {
|
|
60
|
+
PROTOCOL_UNSPECIFIED = "PROTOCOL_UNSPECIFIED",
|
|
61
|
+
HTTP = "HTTP",
|
|
62
|
+
HTTPS = "HTTPS",
|
|
63
|
+
TCP = "TCP",
|
|
64
|
+
UDP = "UDP",
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export enum SaveImageStatus {
|
|
68
|
+
SAVE_IMAGE_STATUS_UNSPECIFIED = "SAVE_IMAGE_STATUS_UNSPECIFIED",
|
|
69
|
+
SAVE_IMAGE_STATUS_SUCCESS = "SAVE_IMAGE_STATUS_SUCCESS",
|
|
70
|
+
SAVE_IMAGE_STATUS_FAILED = "SAVE_IMAGE_STATUS_FAILED",
|
|
71
|
+
SAVE_IMAGE_STATUS_SAVING = "SAVE_IMAGE_STATUS_SAVING",
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export enum StartMode {
|
|
75
|
+
GPU = "GPU",
|
|
76
|
+
CPU = "CPU",
|
|
19
77
|
}
|
|
20
78
|
|
|
21
|
-
export type
|
|
79
|
+
export type ListAgentInstanceRequest = {
|
|
80
|
+
name?: string
|
|
22
81
|
page?: number
|
|
23
82
|
pageSize?: number
|
|
24
|
-
search?: string
|
|
25
83
|
}
|
|
26
84
|
|
|
27
|
-
export type
|
|
28
|
-
|
|
85
|
+
export type ListAgentInstanceResponse = {
|
|
86
|
+
items?: ContainerInstance[]
|
|
29
87
|
pagination?: AgentclawV1alpha1Page.Pagination
|
|
30
88
|
}
|
|
31
89
|
|
|
32
|
-
export type
|
|
33
|
-
|
|
90
|
+
export type GetAgentInstanceRequest = {
|
|
91
|
+
instanceId?: string
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export type GetAgentInstanceResponse = {
|
|
95
|
+
item?: ContainerInstance
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export type CreateAgentInstanceRequest = {
|
|
99
|
+
name?: string
|
|
100
|
+
instanceSpec?: InstanceSpec
|
|
101
|
+
image?: Image
|
|
102
|
+
serviceEnable?: ServiceEnable
|
|
103
|
+
volumeSpec?: VolumeSpec[]
|
|
104
|
+
sshKeyLoginEnable?: boolean
|
|
105
|
+
schedule?: Schedule
|
|
106
|
+
enableDockerInDocker?: boolean
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export type CreateAgentInstanceResponse = {
|
|
110
|
+
item?: ContainerInstance
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export type DeleteAgentInstanceRequest = {
|
|
114
|
+
instanceId?: string
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export type GetUserInfoRequest = {
|
|
34
118
|
}
|
|
35
119
|
|
|
36
|
-
export type
|
|
37
|
-
|
|
120
|
+
export type GetUserInfoResponse = {
|
|
121
|
+
balance?: string
|
|
122
|
+
isVerified?: boolean
|
|
123
|
+
isMain?: boolean
|
|
124
|
+
enableSub?: boolean
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export type GetStorageDetailsRequest = {
|
|
128
|
+
excludeCurrentUsage?: boolean
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export type GetStorageDetailsResponse = {
|
|
132
|
+
status?: RegionStorageStatus
|
|
133
|
+
currentUsage?: string
|
|
134
|
+
quota?: string
|
|
135
|
+
userMaxQuota?: string
|
|
136
|
+
userDefaultQuota?: string
|
|
137
|
+
freeSize?: string
|
|
138
|
+
mountPath?: string
|
|
139
|
+
initializedAt?: string
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export type ContainerInstance = {
|
|
143
|
+
instanceName?: string
|
|
144
|
+
namespace?: string
|
|
145
|
+
creationTimestamp?: string
|
|
146
|
+
instanceId?: string
|
|
147
|
+
status?: InstanceStatus
|
|
148
|
+
volumeSpec?: VolumeSpec[]
|
|
149
|
+
image?: Image
|
|
150
|
+
instanceSpec?: InstanceSpec
|
|
151
|
+
regionId?: string
|
|
152
|
+
networks?: ContainerInstanceNetwork[]
|
|
153
|
+
saveImage?: SaveImage
|
|
154
|
+
ssh?: SSHInfo
|
|
155
|
+
schedule?: Schedule
|
|
156
|
+
serviceEnable?: ServiceEnable
|
|
157
|
+
enableDockerInDocker?: boolean
|
|
158
|
+
enablePersistentRootfs?: boolean
|
|
159
|
+
startMode?: StartMode
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export type VolumeSpec = {
|
|
163
|
+
sourcePath?: string
|
|
164
|
+
mountPath?: string
|
|
165
|
+
size?: string
|
|
166
|
+
storageType?: StorageType
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export type Image = {
|
|
170
|
+
imageType?: ImageType
|
|
171
|
+
name?: string
|
|
172
|
+
username?: string
|
|
173
|
+
password?: string
|
|
174
|
+
command?: Command
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export type Command = {
|
|
178
|
+
commands?: string[]
|
|
179
|
+
args?: string[]
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export type InstanceSpec = {
|
|
183
|
+
instanceType?: InstanceType
|
|
184
|
+
skuId?: string
|
|
185
|
+
specName?: string
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export type ContainerInstanceNetwork = {
|
|
189
|
+
networkType?: NetworkType
|
|
190
|
+
name?: string
|
|
191
|
+
url?: string
|
|
192
|
+
containerPort?: number
|
|
193
|
+
protocol?: NetworkProtocol
|
|
194
|
+
externalPort?: number
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export type SaveImage = {
|
|
198
|
+
status?: SaveImageStatus
|
|
199
|
+
failReason?: string
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export type SSHInfo = {
|
|
203
|
+
username?: string
|
|
204
|
+
password?: string
|
|
205
|
+
host?: string
|
|
206
|
+
port?: number
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export type Schedule = {
|
|
210
|
+
shutdownTime?: string
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export type ServiceEnable = {
|
|
214
|
+
ssh?: boolean
|
|
215
|
+
jupyter?: boolean
|
|
216
|
+
vscode?: boolean
|
|
38
217
|
}
|
|
39
218
|
|
|
40
219
|
export class Agents {
|
|
41
|
-
static
|
|
42
|
-
return fm.fetchReq<
|
|
220
|
+
static ListAgentInstances(req: ListAgentInstanceRequest, initReq?: fm.InitReq): Promise<ListAgentInstanceResponse> {
|
|
221
|
+
return fm.fetchReq<ListAgentInstanceRequest, ListAgentInstanceResponse>(`/apis/agentclaw.io/v1alpha1/agent-instances?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
222
|
+
}
|
|
223
|
+
static GetAgentInstance(req: GetAgentInstanceRequest, initReq?: fm.InitReq): Promise<GetAgentInstanceResponse> {
|
|
224
|
+
return fm.fetchReq<GetAgentInstanceRequest, GetAgentInstanceResponse>(`/apis/agentclaw.io/v1alpha1/agent-instances/${req["instanceId"]}?${fm.renderURLSearchParams(req, ["instanceId"])}`, {...initReq, method: "GET"})
|
|
225
|
+
}
|
|
226
|
+
static CreateAgentInstance(req: CreateAgentInstanceRequest, initReq?: fm.InitReq): Promise<CreateAgentInstanceResponse> {
|
|
227
|
+
return fm.fetchReq<CreateAgentInstanceRequest, CreateAgentInstanceResponse>(`/apis/agentclaw.io/v1alpha1/agent-instances`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
228
|
+
}
|
|
229
|
+
static DeleteAgentInstance(req: DeleteAgentInstanceRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
|
|
230
|
+
return fm.fetchReq<DeleteAgentInstanceRequest, GoogleProtobufEmpty.Empty>(`/apis/agentclaw.io/v1alpha1/agent-instances/${req["instanceId"]}`, {...initReq, method: "DELETE"})
|
|
231
|
+
}
|
|
232
|
+
static GetUserInfo(req: GetUserInfoRequest, initReq?: fm.InitReq): Promise<GetUserInfoResponse> {
|
|
233
|
+
return fm.fetchReq<GetUserInfoRequest, GetUserInfoResponse>(`/apis/agentclaw.io/v1alpha1/userinfo?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
43
234
|
}
|
|
44
|
-
static
|
|
45
|
-
return fm.fetchReq<
|
|
235
|
+
static GetStorageDetails(req: GetStorageDetailsRequest, initReq?: fm.InitReq): Promise<GetStorageDetailsResponse> {
|
|
236
|
+
return fm.fetchReq<GetStorageDetailsRequest, GetStorageDetailsResponse>(`/apis/agentclaw.io/v1alpha1/filestorage/details?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
46
237
|
}
|
|
47
238
|
}
|