@calltelemetry/ct-lab-mcp 0.3.2 → 0.4.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 +30 -7
- package/dist/src/tools/claim-lifecycle.d.ts +107 -0
- package/dist/src/tools/claim-lifecycle.d.ts.map +1 -0
- package/dist/src/tools/claim-lifecycle.js +106 -0
- package/dist/src/tools/claim-lifecycle.js.map +1 -0
- package/dist/src/tools/index.d.ts +1 -0
- package/dist/src/tools/index.d.ts.map +1 -1
- package/dist/src/tools/index.js +4 -8
- package/dist/src/tools/index.js.map +1 -1
- package/dist/src/tools/list-hosts.d.ts.map +1 -1
- package/dist/src/tools/list-hosts.js +7 -0
- package/dist/src/tools/list-hosts.js.map +1 -1
- package/dist/src/tools/provision-tools.d.ts +156 -0
- package/dist/src/tools/provision-tools.d.ts.map +1 -1
- package/dist/src/tools/provision-tools.js +200 -8
- package/dist/src/tools/provision-tools.js.map +1 -1
- package/dist/src/tools/purge-slots.d.ts +20 -0
- package/dist/src/tools/purge-slots.d.ts.map +1 -1
- package/dist/src/tools/purge-slots.js +44 -3
- package/dist/src/tools/purge-slots.js.map +1 -1
- package/dist/src/tools/slot-tools.d.ts +90 -0
- package/dist/src/tools/slot-tools.d.ts.map +1 -1
- package/dist/src/tools/slot-tools.js +143 -9
- package/dist/src/tools/slot-tools.js.map +1 -1
- package/dist/src/tools/vm-action.d.ts +72 -0
- package/dist/src/tools/vm-action.d.ts.map +1 -1
- package/dist/src/tools/vm-action.js +89 -3
- package/dist/src/tools/vm-action.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,6 +8,18 @@ import { z } from "zod";
|
|
|
8
8
|
import { CallToolResult } from "../types/mcp.js";
|
|
9
9
|
import { ToolContext } from "./list-hosts.js";
|
|
10
10
|
export declare const ProvisionVmInputShape: {
|
|
11
|
+
assetId: z.ZodOptional<z.ZodString>;
|
|
12
|
+
hostAssetId: z.ZodOptional<z.ZodString>;
|
|
13
|
+
templateAssetId: z.ZodOptional<z.ZodString>;
|
|
14
|
+
purpose: z.ZodOptional<z.ZodString>;
|
|
15
|
+
operationId: z.ZodOptional<z.ZodString>;
|
|
16
|
+
ttlHours: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
version: z.ZodOptional<z.ZodString>;
|
|
18
|
+
diskGb: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
apply: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
20
|
+
confirmAssetId: z.ZodOptional<z.ZodString>;
|
|
21
|
+
outputFile: z.ZodOptional<z.ZodString>;
|
|
22
|
+
receiptFile: z.ZodOptional<z.ZodString>;
|
|
11
23
|
sourceVmIdOrName: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
12
24
|
template: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
13
25
|
newVmName: z.ZodOptional<z.ZodString>;
|
|
@@ -36,6 +48,18 @@ export declare const ProvisionVmInputShape: {
|
|
|
36
48
|
description: z.ZodOptional<z.ZodString>;
|
|
37
49
|
};
|
|
38
50
|
export declare const ProvisionVmInputSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
51
|
+
assetId: z.ZodOptional<z.ZodString>;
|
|
52
|
+
hostAssetId: z.ZodOptional<z.ZodString>;
|
|
53
|
+
templateAssetId: z.ZodOptional<z.ZodString>;
|
|
54
|
+
purpose: z.ZodOptional<z.ZodString>;
|
|
55
|
+
operationId: z.ZodOptional<z.ZodString>;
|
|
56
|
+
ttlHours: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
version: z.ZodOptional<z.ZodString>;
|
|
58
|
+
diskGb: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
apply: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
60
|
+
confirmAssetId: z.ZodOptional<z.ZodString>;
|
|
61
|
+
outputFile: z.ZodOptional<z.ZodString>;
|
|
62
|
+
receiptFile: z.ZodOptional<z.ZodString>;
|
|
39
63
|
sourceVmIdOrName: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
40
64
|
template: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
41
65
|
newVmName: z.ZodOptional<z.ZodString>;
|
|
@@ -64,6 +88,7 @@ export declare const ProvisionVmInputSchema: z.ZodEffects<z.ZodEffects<z.ZodObje
|
|
|
64
88
|
description: z.ZodOptional<z.ZodString>;
|
|
65
89
|
}, "strip", z.ZodTypeAny, {
|
|
66
90
|
hypervisorType: "proxmox" | "esxi" | "any";
|
|
91
|
+
apply: boolean;
|
|
67
92
|
startOnDeploy: boolean;
|
|
68
93
|
fullClone: boolean;
|
|
69
94
|
storage?: string | undefined;
|
|
@@ -72,6 +97,7 @@ export declare const ProvisionVmInputSchema: z.ZodEffects<z.ZodEffects<z.ZodObje
|
|
|
72
97
|
tags?: string | string[] | undefined;
|
|
73
98
|
template?: string | number | undefined;
|
|
74
99
|
description?: string | undefined;
|
|
100
|
+
version?: string | undefined;
|
|
75
101
|
start?: boolean | undefined;
|
|
76
102
|
memoryMb?: number | undefined;
|
|
77
103
|
host?: string | undefined;
|
|
@@ -82,7 +108,17 @@ export declare const ProvisionVmInputSchema: z.ZodEffects<z.ZodEffects<z.ZodObje
|
|
|
82
108
|
slotClaimId?: string | undefined;
|
|
83
109
|
cpuCores?: number | undefined;
|
|
84
110
|
requester?: string | undefined;
|
|
111
|
+
purpose?: string | undefined;
|
|
112
|
+
assetId?: string | undefined;
|
|
113
|
+
operationId?: string | undefined;
|
|
114
|
+
receiptFile?: string | undefined;
|
|
115
|
+
ttlHours?: number | undefined;
|
|
116
|
+
confirmAssetId?: string | undefined;
|
|
85
117
|
targetHost?: string | undefined;
|
|
118
|
+
hostAssetId?: string | undefined;
|
|
119
|
+
templateAssetId?: string | undefined;
|
|
120
|
+
diskGb?: number | undefined;
|
|
121
|
+
outputFile?: string | undefined;
|
|
86
122
|
sourceVmIdOrName?: string | number | undefined;
|
|
87
123
|
newVmName?: string | undefined;
|
|
88
124
|
newVmId?: string | number | undefined;
|
|
@@ -96,6 +132,7 @@ export declare const ProvisionVmInputSchema: z.ZodEffects<z.ZodEffects<z.ZodObje
|
|
|
96
132
|
tags?: string | string[] | undefined;
|
|
97
133
|
template?: string | number | undefined;
|
|
98
134
|
description?: string | undefined;
|
|
135
|
+
version?: string | undefined;
|
|
99
136
|
start?: boolean | undefined;
|
|
100
137
|
hypervisorType?: "proxmox" | "esxi" | "any" | undefined;
|
|
101
138
|
memoryMb?: number | undefined;
|
|
@@ -107,7 +144,18 @@ export declare const ProvisionVmInputSchema: z.ZodEffects<z.ZodEffects<z.ZodObje
|
|
|
107
144
|
slotClaimId?: string | undefined;
|
|
108
145
|
cpuCores?: number | undefined;
|
|
109
146
|
requester?: string | undefined;
|
|
147
|
+
purpose?: string | undefined;
|
|
148
|
+
assetId?: string | undefined;
|
|
149
|
+
operationId?: string | undefined;
|
|
150
|
+
apply?: boolean | undefined;
|
|
151
|
+
receiptFile?: string | undefined;
|
|
152
|
+
ttlHours?: number | undefined;
|
|
153
|
+
confirmAssetId?: string | undefined;
|
|
110
154
|
targetHost?: string | undefined;
|
|
155
|
+
hostAssetId?: string | undefined;
|
|
156
|
+
templateAssetId?: string | undefined;
|
|
157
|
+
diskGb?: number | undefined;
|
|
158
|
+
outputFile?: string | undefined;
|
|
111
159
|
sourceVmIdOrName?: string | number | undefined;
|
|
112
160
|
newVmName?: string | undefined;
|
|
113
161
|
newVmId?: string | number | undefined;
|
|
@@ -118,6 +166,7 @@ export declare const ProvisionVmInputSchema: z.ZodEffects<z.ZodEffects<z.ZodObje
|
|
|
118
166
|
fullClone?: boolean | undefined;
|
|
119
167
|
}>, {
|
|
120
168
|
hypervisorType: "proxmox" | "esxi" | "any";
|
|
169
|
+
apply: boolean;
|
|
121
170
|
startOnDeploy: boolean;
|
|
122
171
|
fullClone: boolean;
|
|
123
172
|
storage?: string | undefined;
|
|
@@ -126,6 +175,7 @@ export declare const ProvisionVmInputSchema: z.ZodEffects<z.ZodEffects<z.ZodObje
|
|
|
126
175
|
tags?: string | string[] | undefined;
|
|
127
176
|
template?: string | number | undefined;
|
|
128
177
|
description?: string | undefined;
|
|
178
|
+
version?: string | undefined;
|
|
129
179
|
start?: boolean | undefined;
|
|
130
180
|
memoryMb?: number | undefined;
|
|
131
181
|
host?: string | undefined;
|
|
@@ -136,7 +186,17 @@ export declare const ProvisionVmInputSchema: z.ZodEffects<z.ZodEffects<z.ZodObje
|
|
|
136
186
|
slotClaimId?: string | undefined;
|
|
137
187
|
cpuCores?: number | undefined;
|
|
138
188
|
requester?: string | undefined;
|
|
189
|
+
purpose?: string | undefined;
|
|
190
|
+
assetId?: string | undefined;
|
|
191
|
+
operationId?: string | undefined;
|
|
192
|
+
receiptFile?: string | undefined;
|
|
193
|
+
ttlHours?: number | undefined;
|
|
194
|
+
confirmAssetId?: string | undefined;
|
|
139
195
|
targetHost?: string | undefined;
|
|
196
|
+
hostAssetId?: string | undefined;
|
|
197
|
+
templateAssetId?: string | undefined;
|
|
198
|
+
diskGb?: number | undefined;
|
|
199
|
+
outputFile?: string | undefined;
|
|
140
200
|
sourceVmIdOrName?: string | number | undefined;
|
|
141
201
|
newVmName?: string | undefined;
|
|
142
202
|
newVmId?: string | number | undefined;
|
|
@@ -150,6 +210,7 @@ export declare const ProvisionVmInputSchema: z.ZodEffects<z.ZodEffects<z.ZodObje
|
|
|
150
210
|
tags?: string | string[] | undefined;
|
|
151
211
|
template?: string | number | undefined;
|
|
152
212
|
description?: string | undefined;
|
|
213
|
+
version?: string | undefined;
|
|
153
214
|
start?: boolean | undefined;
|
|
154
215
|
hypervisorType?: "proxmox" | "esxi" | "any" | undefined;
|
|
155
216
|
memoryMb?: number | undefined;
|
|
@@ -161,7 +222,18 @@ export declare const ProvisionVmInputSchema: z.ZodEffects<z.ZodEffects<z.ZodObje
|
|
|
161
222
|
slotClaimId?: string | undefined;
|
|
162
223
|
cpuCores?: number | undefined;
|
|
163
224
|
requester?: string | undefined;
|
|
225
|
+
purpose?: string | undefined;
|
|
226
|
+
assetId?: string | undefined;
|
|
227
|
+
operationId?: string | undefined;
|
|
228
|
+
apply?: boolean | undefined;
|
|
229
|
+
receiptFile?: string | undefined;
|
|
230
|
+
ttlHours?: number | undefined;
|
|
231
|
+
confirmAssetId?: string | undefined;
|
|
164
232
|
targetHost?: string | undefined;
|
|
233
|
+
hostAssetId?: string | undefined;
|
|
234
|
+
templateAssetId?: string | undefined;
|
|
235
|
+
diskGb?: number | undefined;
|
|
236
|
+
outputFile?: string | undefined;
|
|
165
237
|
sourceVmIdOrName?: string | number | undefined;
|
|
166
238
|
newVmName?: string | undefined;
|
|
167
239
|
newVmId?: string | number | undefined;
|
|
@@ -172,6 +244,7 @@ export declare const ProvisionVmInputSchema: z.ZodEffects<z.ZodEffects<z.ZodObje
|
|
|
172
244
|
fullClone?: boolean | undefined;
|
|
173
245
|
}>, {
|
|
174
246
|
hypervisorType: "proxmox" | "esxi" | "any";
|
|
247
|
+
apply: boolean;
|
|
175
248
|
startOnDeploy: boolean;
|
|
176
249
|
fullClone: boolean;
|
|
177
250
|
storage?: string | undefined;
|
|
@@ -180,6 +253,7 @@ export declare const ProvisionVmInputSchema: z.ZodEffects<z.ZodEffects<z.ZodObje
|
|
|
180
253
|
tags?: string | string[] | undefined;
|
|
181
254
|
template?: string | number | undefined;
|
|
182
255
|
description?: string | undefined;
|
|
256
|
+
version?: string | undefined;
|
|
183
257
|
start?: boolean | undefined;
|
|
184
258
|
memoryMb?: number | undefined;
|
|
185
259
|
host?: string | undefined;
|
|
@@ -190,7 +264,17 @@ export declare const ProvisionVmInputSchema: z.ZodEffects<z.ZodEffects<z.ZodObje
|
|
|
190
264
|
slotClaimId?: string | undefined;
|
|
191
265
|
cpuCores?: number | undefined;
|
|
192
266
|
requester?: string | undefined;
|
|
267
|
+
purpose?: string | undefined;
|
|
268
|
+
assetId?: string | undefined;
|
|
269
|
+
operationId?: string | undefined;
|
|
270
|
+
receiptFile?: string | undefined;
|
|
271
|
+
ttlHours?: number | undefined;
|
|
272
|
+
confirmAssetId?: string | undefined;
|
|
193
273
|
targetHost?: string | undefined;
|
|
274
|
+
hostAssetId?: string | undefined;
|
|
275
|
+
templateAssetId?: string | undefined;
|
|
276
|
+
diskGb?: number | undefined;
|
|
277
|
+
outputFile?: string | undefined;
|
|
194
278
|
sourceVmIdOrName?: string | number | undefined;
|
|
195
279
|
newVmName?: string | undefined;
|
|
196
280
|
newVmId?: string | number | undefined;
|
|
@@ -204,6 +288,7 @@ export declare const ProvisionVmInputSchema: z.ZodEffects<z.ZodEffects<z.ZodObje
|
|
|
204
288
|
tags?: string | string[] | undefined;
|
|
205
289
|
template?: string | number | undefined;
|
|
206
290
|
description?: string | undefined;
|
|
291
|
+
version?: string | undefined;
|
|
207
292
|
start?: boolean | undefined;
|
|
208
293
|
hypervisorType?: "proxmox" | "esxi" | "any" | undefined;
|
|
209
294
|
memoryMb?: number | undefined;
|
|
@@ -215,7 +300,18 @@ export declare const ProvisionVmInputSchema: z.ZodEffects<z.ZodEffects<z.ZodObje
|
|
|
215
300
|
slotClaimId?: string | undefined;
|
|
216
301
|
cpuCores?: number | undefined;
|
|
217
302
|
requester?: string | undefined;
|
|
303
|
+
purpose?: string | undefined;
|
|
304
|
+
assetId?: string | undefined;
|
|
305
|
+
operationId?: string | undefined;
|
|
306
|
+
apply?: boolean | undefined;
|
|
307
|
+
receiptFile?: string | undefined;
|
|
308
|
+
ttlHours?: number | undefined;
|
|
309
|
+
confirmAssetId?: string | undefined;
|
|
218
310
|
targetHost?: string | undefined;
|
|
311
|
+
hostAssetId?: string | undefined;
|
|
312
|
+
templateAssetId?: string | undefined;
|
|
313
|
+
diskGb?: number | undefined;
|
|
314
|
+
outputFile?: string | undefined;
|
|
219
315
|
sourceVmIdOrName?: string | number | undefined;
|
|
220
316
|
newVmName?: string | undefined;
|
|
221
317
|
newVmId?: string | number | undefined;
|
|
@@ -229,6 +325,21 @@ export type ProvisionVmInput = z.infer<typeof ProvisionVmInputSchema>;
|
|
|
229
325
|
export type ProvisionVmRawInput = z.input<typeof ProvisionVmInputSchema>;
|
|
230
326
|
export declare function handleProvisionVm(rawArgs: ProvisionVmRawInput, context: ToolContext): Promise<CallToolResult>;
|
|
231
327
|
export declare const AutoProvisionVmInputShape: {
|
|
328
|
+
assetId: z.ZodOptional<z.ZodString>;
|
|
329
|
+
hostAssetId: z.ZodOptional<z.ZodString>;
|
|
330
|
+
templateAssetId: z.ZodOptional<z.ZodString>;
|
|
331
|
+
purpose: z.ZodOptional<z.ZodString>;
|
|
332
|
+
operationId: z.ZodOptional<z.ZodString>;
|
|
333
|
+
ttlHours: z.ZodOptional<z.ZodNumber>;
|
|
334
|
+
apply: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
335
|
+
confirmAssetId: z.ZodOptional<z.ZodString>;
|
|
336
|
+
outputFile: z.ZodOptional<z.ZodString>;
|
|
337
|
+
receiptFile: z.ZodOptional<z.ZodString>;
|
|
338
|
+
diskGb: z.ZodOptional<z.ZodNumber>;
|
|
339
|
+
memoryMb: z.ZodOptional<z.ZodNumber>;
|
|
340
|
+
cpuCores: z.ZodOptional<z.ZodNumber>;
|
|
341
|
+
newVmId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
342
|
+
vmid: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
232
343
|
template: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
233
344
|
sourceVmIdOrName: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
234
345
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -254,6 +365,21 @@ export declare const AutoProvisionVmInputShape: {
|
|
|
254
365
|
readyTimeoutSeconds: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
255
366
|
};
|
|
256
367
|
export declare const AutoProvisionVmInputSchema: z.ZodObject<{
|
|
368
|
+
assetId: z.ZodOptional<z.ZodString>;
|
|
369
|
+
hostAssetId: z.ZodOptional<z.ZodString>;
|
|
370
|
+
templateAssetId: z.ZodOptional<z.ZodString>;
|
|
371
|
+
purpose: z.ZodOptional<z.ZodString>;
|
|
372
|
+
operationId: z.ZodOptional<z.ZodString>;
|
|
373
|
+
ttlHours: z.ZodOptional<z.ZodNumber>;
|
|
374
|
+
apply: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
375
|
+
confirmAssetId: z.ZodOptional<z.ZodString>;
|
|
376
|
+
outputFile: z.ZodOptional<z.ZodString>;
|
|
377
|
+
receiptFile: z.ZodOptional<z.ZodString>;
|
|
378
|
+
diskGb: z.ZodOptional<z.ZodNumber>;
|
|
379
|
+
memoryMb: z.ZodOptional<z.ZodNumber>;
|
|
380
|
+
cpuCores: z.ZodOptional<z.ZodNumber>;
|
|
381
|
+
newVmId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
382
|
+
vmid: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
257
383
|
template: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
258
384
|
sourceVmIdOrName: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
259
385
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -280,6 +406,7 @@ export declare const AutoProvisionVmInputSchema: z.ZodObject<{
|
|
|
280
406
|
}, "strip", z.ZodTypeAny, {
|
|
281
407
|
hypervisorType: "proxmox" | "esxi" | "any";
|
|
282
408
|
ttlMinutes: number;
|
|
409
|
+
apply: boolean;
|
|
283
410
|
waitForReady: boolean;
|
|
284
411
|
readyTimeoutSeconds: number;
|
|
285
412
|
storage?: string | undefined;
|
|
@@ -287,8 +414,10 @@ export declare const AutoProvisionVmInputSchema: z.ZodObject<{
|
|
|
287
414
|
tags?: string | string[] | undefined;
|
|
288
415
|
template?: string | number | undefined;
|
|
289
416
|
version?: string | undefined;
|
|
417
|
+
memoryMb?: number | undefined;
|
|
290
418
|
durationMinutes?: number | undefined;
|
|
291
419
|
host?: string | undefined;
|
|
420
|
+
vmid?: string | number | undefined;
|
|
292
421
|
ipAddress?: string | undefined;
|
|
293
422
|
targetVersion?: string | undefined;
|
|
294
423
|
workloadType?: "uat" | "perf" | "soak" | "dev" | "regression" | "reproduction" | "demo" | undefined;
|
|
@@ -296,10 +425,22 @@ export declare const AutoProvisionVmInputSchema: z.ZodObject<{
|
|
|
296
425
|
linearIssue?: string | undefined;
|
|
297
426
|
branch?: string | undefined;
|
|
298
427
|
vlan?: number | undefined;
|
|
428
|
+
cpuCores?: number | undefined;
|
|
299
429
|
requester?: string | undefined;
|
|
430
|
+
purpose?: string | undefined;
|
|
431
|
+
assetId?: string | undefined;
|
|
432
|
+
operationId?: string | undefined;
|
|
433
|
+
receiptFile?: string | undefined;
|
|
434
|
+
ttlHours?: number | undefined;
|
|
435
|
+
confirmAssetId?: string | undefined;
|
|
300
436
|
targetHost?: string | undefined;
|
|
437
|
+
hostAssetId?: string | undefined;
|
|
438
|
+
templateAssetId?: string | undefined;
|
|
439
|
+
diskGb?: number | undefined;
|
|
440
|
+
outputFile?: string | undefined;
|
|
301
441
|
sourceVmIdOrName?: string | number | undefined;
|
|
302
442
|
newVmName?: string | undefined;
|
|
443
|
+
newVmId?: string | number | undefined;
|
|
303
444
|
networkBridge?: string | undefined;
|
|
304
445
|
}, {
|
|
305
446
|
storage?: string | undefined;
|
|
@@ -308,9 +449,11 @@ export declare const AutoProvisionVmInputSchema: z.ZodObject<{
|
|
|
308
449
|
template?: string | number | undefined;
|
|
309
450
|
version?: string | undefined;
|
|
310
451
|
hypervisorType?: "proxmox" | "esxi" | "any" | undefined;
|
|
452
|
+
memoryMb?: number | undefined;
|
|
311
453
|
durationMinutes?: number | undefined;
|
|
312
454
|
ttlMinutes?: number | undefined;
|
|
313
455
|
host?: string | undefined;
|
|
456
|
+
vmid?: string | number | undefined;
|
|
314
457
|
ipAddress?: string | undefined;
|
|
315
458
|
targetVersion?: string | undefined;
|
|
316
459
|
workloadType?: "uat" | "perf" | "soak" | "dev" | "regression" | "reproduction" | "demo" | undefined;
|
|
@@ -318,10 +461,23 @@ export declare const AutoProvisionVmInputSchema: z.ZodObject<{
|
|
|
318
461
|
linearIssue?: string | undefined;
|
|
319
462
|
branch?: string | undefined;
|
|
320
463
|
vlan?: number | undefined;
|
|
464
|
+
cpuCores?: number | undefined;
|
|
321
465
|
requester?: string | undefined;
|
|
466
|
+
purpose?: string | undefined;
|
|
467
|
+
assetId?: string | undefined;
|
|
468
|
+
operationId?: string | undefined;
|
|
469
|
+
apply?: boolean | undefined;
|
|
470
|
+
receiptFile?: string | undefined;
|
|
471
|
+
ttlHours?: number | undefined;
|
|
472
|
+
confirmAssetId?: string | undefined;
|
|
322
473
|
targetHost?: string | undefined;
|
|
474
|
+
hostAssetId?: string | undefined;
|
|
475
|
+
templateAssetId?: string | undefined;
|
|
476
|
+
diskGb?: number | undefined;
|
|
477
|
+
outputFile?: string | undefined;
|
|
323
478
|
sourceVmIdOrName?: string | number | undefined;
|
|
324
479
|
newVmName?: string | undefined;
|
|
480
|
+
newVmId?: string | number | undefined;
|
|
325
481
|
networkBridge?: string | undefined;
|
|
326
482
|
waitForReady?: boolean | undefined;
|
|
327
483
|
readyTimeoutSeconds?: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provision-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/provision-tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAA2C,MAAM,iBAAiB,CAAC;AAM1F,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAa9C,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"provision-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/provision-tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAA2C,MAAM,iBAAiB,CAAC;AAM1F,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAa9C,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgLjC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAShC,CAAC;AAEJ,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEzE,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,cAAc,CAAC,CAwOzB;AAMD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4HrC,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAsC,CAAC;AAC9E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEjF,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,cAAc,CAAC,CA0WzB"}
|
|
@@ -11,8 +11,69 @@ import { CapacityExceededError, GlobalCapacityExceededError, DatastoreCapacityEx
|
|
|
11
11
|
import { ProtectedVmViolationError } from "../guardrails/types.js";
|
|
12
12
|
import { applianceSshExecutor } from "../appliance/executor.js";
|
|
13
13
|
import { MockProxmoxClient } from "../proxmox/mock.js";
|
|
14
|
-
import { canonicalMode,
|
|
14
|
+
import { canonicalMode, runCanonicalOperation } from "./canonical-guard.js";
|
|
15
15
|
export const ProvisionVmInputShape = {
|
|
16
|
+
assetId: z
|
|
17
|
+
.string()
|
|
18
|
+
.min(1)
|
|
19
|
+
.optional()
|
|
20
|
+
.describe("Canonical asset ID to create; required when canonical apply needs an exact resulting identity."),
|
|
21
|
+
hostAssetId: z
|
|
22
|
+
.string()
|
|
23
|
+
.min(1)
|
|
24
|
+
.optional()
|
|
25
|
+
.describe("Canonical inventory host asset ID; required in canonical mode."),
|
|
26
|
+
templateAssetId: z
|
|
27
|
+
.string()
|
|
28
|
+
.min(1)
|
|
29
|
+
.optional()
|
|
30
|
+
.describe("Canonical inventory template asset ID; required for canonical template provisioning."),
|
|
31
|
+
purpose: z
|
|
32
|
+
.string()
|
|
33
|
+
.min(1)
|
|
34
|
+
.optional()
|
|
35
|
+
.describe("Explicit UAT/provisioning purpose recorded in the canonical receipt."),
|
|
36
|
+
operationId: z
|
|
37
|
+
.string()
|
|
38
|
+
.min(1)
|
|
39
|
+
.optional()
|
|
40
|
+
.describe("Unique idempotency operation ID for the canonical provision receipt."),
|
|
41
|
+
ttlHours: z
|
|
42
|
+
.number()
|
|
43
|
+
.int()
|
|
44
|
+
.positive()
|
|
45
|
+
.optional()
|
|
46
|
+
.describe("Canonical lease duration in hours."),
|
|
47
|
+
version: z
|
|
48
|
+
.string()
|
|
49
|
+
.min(1)
|
|
50
|
+
.optional()
|
|
51
|
+
.describe("Exact immutable release version or approved stable alias."),
|
|
52
|
+
diskGb: z
|
|
53
|
+
.number()
|
|
54
|
+
.positive()
|
|
55
|
+
.optional()
|
|
56
|
+
.describe("Requested disk size in GB for canonical provisioning."),
|
|
57
|
+
apply: z
|
|
58
|
+
.boolean()
|
|
59
|
+
.optional()
|
|
60
|
+
.default(false)
|
|
61
|
+
.describe("Execute canonical provisioning. Omit for the reviewed dry-run plan."),
|
|
62
|
+
confirmAssetId: z
|
|
63
|
+
.string()
|
|
64
|
+
.min(1)
|
|
65
|
+
.optional()
|
|
66
|
+
.describe("Exact resulting asset ID confirmation required with apply=true."),
|
|
67
|
+
outputFile: z
|
|
68
|
+
.string()
|
|
69
|
+
.min(1)
|
|
70
|
+
.optional()
|
|
71
|
+
.describe("Separate reviewed inventory candidate output path."),
|
|
72
|
+
receiptFile: z
|
|
73
|
+
.string()
|
|
74
|
+
.min(1)
|
|
75
|
+
.optional()
|
|
76
|
+
.describe("Canonical provision plan/receipt path."),
|
|
16
77
|
sourceVmIdOrName: z
|
|
17
78
|
.union([z.string(), z.number()])
|
|
18
79
|
.optional()
|
|
@@ -130,21 +191,79 @@ export const ProvisionVmInputShape = {
|
|
|
130
191
|
};
|
|
131
192
|
export const ProvisionVmInputSchema = z
|
|
132
193
|
.object(ProvisionVmInputShape)
|
|
133
|
-
.refine((data) => Boolean(data.sourceVmIdOrName || data.template), { message: "Either 'sourceVmIdOrName' or 'template' must be provided." })
|
|
194
|
+
.refine((data) => Boolean(data.sourceVmIdOrName || data.template || data.templateAssetId), { message: "Either 'sourceVmIdOrName' or 'template' must be provided." })
|
|
134
195
|
.refine((data) => Boolean(data.newVmName || data.name), { message: "Either 'newVmName' or 'name' must be provided." });
|
|
135
196
|
export async function handleProvisionVm(rawArgs, context) {
|
|
136
197
|
let autoClaimId;
|
|
137
198
|
let slotClaim;
|
|
138
199
|
try {
|
|
139
|
-
if (canonicalMode(context)) {
|
|
140
|
-
return canonicalOperationBlocked("provision_vm", "canonical VM provisioning is not delegated to the legacy hypervisor manager until exact asset identity and receipts are available");
|
|
141
|
-
}
|
|
142
200
|
const parseResult = ProvisionVmInputSchema.safeParse(rawArgs);
|
|
143
201
|
if (!parseResult.success) {
|
|
144
202
|
const errMsg = parseResult.error.errors.map((e) => `${e.path.join(".")}: ${e.message}`).join("; ");
|
|
145
203
|
return createToolErrorResult(ProxmoxErrorCode.VALIDATION_ERROR, errMsg);
|
|
146
204
|
}
|
|
147
205
|
const args = parseResult.data;
|
|
206
|
+
if (canonicalMode(context)) {
|
|
207
|
+
const newName = args.newVmName ?? args.name;
|
|
208
|
+
if (!args.assetId ||
|
|
209
|
+
!args.hostAssetId ||
|
|
210
|
+
!args.templateAssetId ||
|
|
211
|
+
!newName ||
|
|
212
|
+
!args.purpose ||
|
|
213
|
+
!args.linearIssue ||
|
|
214
|
+
!args.operationId ||
|
|
215
|
+
!args.ipAddress ||
|
|
216
|
+
args.memoryMb === undefined ||
|
|
217
|
+
args.cpuCores === undefined ||
|
|
218
|
+
args.diskGb === undefined ||
|
|
219
|
+
!args.storage ||
|
|
220
|
+
!args.networkBridge) {
|
|
221
|
+
return createToolErrorResult(ProxmoxErrorCode.VALIDATION_ERROR, "Canonical provision_vm requires assetId, hostAssetId, templateAssetId, name, ipAddress, memoryMb, cpuCores, diskGb, storage, networkBridge, purpose, linearIssue, and operationId.");
|
|
222
|
+
}
|
|
223
|
+
if (args.apply && (!args.assetId || args.confirmAssetId !== args.assetId)) {
|
|
224
|
+
return createToolErrorResult(ProxmoxErrorCode.VALIDATION_ERROR, "Canonical apply requires assetId and confirmAssetId to match exactly.");
|
|
225
|
+
}
|
|
226
|
+
const command = [
|
|
227
|
+
"vm", "provision",
|
|
228
|
+
"--source", "template",
|
|
229
|
+
...(args.assetId ? ["--asset-id", args.assetId] : []),
|
|
230
|
+
"--host-asset-id", args.hostAssetId,
|
|
231
|
+
"--template-asset-id", args.templateAssetId,
|
|
232
|
+
"--name", newName,
|
|
233
|
+
"--purpose", args.purpose,
|
|
234
|
+
"--linear-issue", args.linearIssue,
|
|
235
|
+
"--operation-id", args.operationId,
|
|
236
|
+
];
|
|
237
|
+
if (args.ipAddress)
|
|
238
|
+
command.push("--ip", args.ipAddress);
|
|
239
|
+
if (args.memoryMb !== undefined)
|
|
240
|
+
command.push("--memory-mb", String(args.memoryMb));
|
|
241
|
+
if (args.cpuCores !== undefined)
|
|
242
|
+
command.push("--vcpus", String(args.cpuCores));
|
|
243
|
+
if (args.diskGb !== undefined)
|
|
244
|
+
command.push("--disk-gb", String(args.diskGb));
|
|
245
|
+
if (args.storage)
|
|
246
|
+
command.push("--storage", args.storage);
|
|
247
|
+
if (args.networkBridge)
|
|
248
|
+
command.push("--network", args.networkBridge);
|
|
249
|
+
if (args.vlan !== undefined)
|
|
250
|
+
command.push("--vlan-tag", String(args.vlan));
|
|
251
|
+
const vmid = args.newVmId ?? args.vmid;
|
|
252
|
+
if (vmid !== undefined)
|
|
253
|
+
command.push("--vmid", String(vmid));
|
|
254
|
+
if (args.version)
|
|
255
|
+
command.push("--version", args.version);
|
|
256
|
+
const ttlHours = args.ttlHours;
|
|
257
|
+
if (ttlHours !== undefined)
|
|
258
|
+
command.push("--ttl-hours", String(ttlHours));
|
|
259
|
+
if (args.apply)
|
|
260
|
+
command.push("--apply", "--confirm-asset-id", args.confirmAssetId);
|
|
261
|
+
if (args.outputFile)
|
|
262
|
+
command.push("--output-file", args.outputFile);
|
|
263
|
+
if (args.receiptFile)
|
|
264
|
+
command.push("--receipt-file", args.receiptFile);
|
|
265
|
+
return runCanonicalOperation(context.canonicalBridge, "provision_vm", command);
|
|
266
|
+
}
|
|
148
267
|
const source = (args.sourceVmIdOrName ?? args.template);
|
|
149
268
|
const newName = (args.newVmName ?? args.name);
|
|
150
269
|
const targetHost = args.targetHost || args.host;
|
|
@@ -304,6 +423,21 @@ export async function handleProvisionVm(rawArgs, context) {
|
|
|
304
423
|
// Auto Provision VM (Milestone M4)
|
|
305
424
|
// ============================================================================
|
|
306
425
|
export const AutoProvisionVmInputShape = {
|
|
426
|
+
assetId: z.string().min(1).optional().describe("Canonical resulting asset ID."),
|
|
427
|
+
hostAssetId: z.string().min(1).optional().describe("Canonical inventory host asset ID."),
|
|
428
|
+
templateAssetId: z.string().min(1).optional().describe("Canonical inventory template asset ID."),
|
|
429
|
+
purpose: z.string().min(1).optional().describe("Explicit canonical provisioning purpose."),
|
|
430
|
+
operationId: z.string().min(1).optional().describe("Unique canonical provision operation ID."),
|
|
431
|
+
ttlHours: z.number().int().positive().optional().describe("Canonical lease duration in hours."),
|
|
432
|
+
apply: z.boolean().optional().default(false).describe("Execute canonical provisioning; otherwise return a plan."),
|
|
433
|
+
confirmAssetId: z.string().min(1).optional().describe("Exact asset confirmation for apply=true."),
|
|
434
|
+
outputFile: z.string().min(1).optional().describe("Separate reviewed inventory candidate output path."),
|
|
435
|
+
receiptFile: z.string().min(1).optional().describe("Canonical provision plan/receipt path."),
|
|
436
|
+
diskGb: z.number().positive().optional().describe("Requested disk size in GB."),
|
|
437
|
+
memoryMb: z.number().positive().optional().describe("Requested memory in MB."),
|
|
438
|
+
cpuCores: z.number().int().positive().optional().describe("Requested vCPU count."),
|
|
439
|
+
newVmId: z.union([z.string(), z.number()]).optional().describe("Optional target VMID."),
|
|
440
|
+
vmid: z.union([z.string(), z.number()]).optional().describe("Alias for newVmId."),
|
|
307
441
|
template: z
|
|
308
442
|
.union([z.string(), z.number()])
|
|
309
443
|
.optional()
|
|
@@ -420,15 +554,73 @@ export async function handleAutoProvisionVm(rawArgs, context) {
|
|
|
420
554
|
let createdHost;
|
|
421
555
|
const startTime = Date.now();
|
|
422
556
|
try {
|
|
423
|
-
if (canonicalMode(context)) {
|
|
424
|
-
return canonicalOperationBlocked("auto_provision_vm", "canonical VM provisioning is not delegated to the legacy hypervisor manager until exact asset identity and receipts are available");
|
|
425
|
-
}
|
|
426
557
|
const parseResult = AutoProvisionVmInputSchema.safeParse(rawArgs);
|
|
427
558
|
if (!parseResult.success) {
|
|
428
559
|
const errMsg = parseResult.error.errors.map((e) => `${e.path.join(".")}: ${e.message}`).join("; ");
|
|
429
560
|
return createToolErrorResult(ProxmoxErrorCode.VALIDATION_ERROR, errMsg);
|
|
430
561
|
}
|
|
431
562
|
const args = parseResult.data;
|
|
563
|
+
if (canonicalMode(context)) {
|
|
564
|
+
const newName = args.name || args.newVmName;
|
|
565
|
+
if (!args.assetId ||
|
|
566
|
+
!args.hostAssetId ||
|
|
567
|
+
!args.templateAssetId ||
|
|
568
|
+
!newName ||
|
|
569
|
+
!args.purpose ||
|
|
570
|
+
!args.linearIssue ||
|
|
571
|
+
!args.operationId ||
|
|
572
|
+
!args.ipAddress ||
|
|
573
|
+
args.memoryMb === undefined ||
|
|
574
|
+
args.cpuCores === undefined ||
|
|
575
|
+
args.diskGb === undefined ||
|
|
576
|
+
!args.storage ||
|
|
577
|
+
!args.networkBridge) {
|
|
578
|
+
return createToolErrorResult(ProxmoxErrorCode.VALIDATION_ERROR, "Canonical auto_provision_vm requires assetId, hostAssetId, templateAssetId, name, ipAddress, memoryMb, cpuCores, diskGb, storage, networkBridge, purpose, linearIssue, and operationId.");
|
|
579
|
+
}
|
|
580
|
+
if (args.apply && (!args.assetId || args.confirmAssetId !== args.assetId)) {
|
|
581
|
+
return createToolErrorResult(ProxmoxErrorCode.VALIDATION_ERROR, "Canonical apply requires assetId and confirmAssetId to match exactly.");
|
|
582
|
+
}
|
|
583
|
+
const command = [
|
|
584
|
+
"vm", "provision", "--source", "template",
|
|
585
|
+
...(args.assetId ? ["--asset-id", args.assetId] : []),
|
|
586
|
+
"--host-asset-id", args.hostAssetId,
|
|
587
|
+
"--template-asset-id", args.templateAssetId,
|
|
588
|
+
"--name", newName,
|
|
589
|
+
"--purpose", args.purpose,
|
|
590
|
+
"--linear-issue", args.linearIssue,
|
|
591
|
+
"--operation-id", args.operationId,
|
|
592
|
+
];
|
|
593
|
+
if (args.ipAddress)
|
|
594
|
+
command.push("--ip", args.ipAddress);
|
|
595
|
+
if (args.memoryMb !== undefined)
|
|
596
|
+
command.push("--memory-mb", String(args.memoryMb));
|
|
597
|
+
if (args.cpuCores !== undefined)
|
|
598
|
+
command.push("--vcpus", String(args.cpuCores));
|
|
599
|
+
if (args.diskGb !== undefined)
|
|
600
|
+
command.push("--disk-gb", String(args.diskGb));
|
|
601
|
+
if (args.storage)
|
|
602
|
+
command.push("--storage", args.storage);
|
|
603
|
+
if (args.networkBridge)
|
|
604
|
+
command.push("--network", args.networkBridge);
|
|
605
|
+
if (args.vlan !== undefined)
|
|
606
|
+
command.push("--vlan-tag", String(args.vlan));
|
|
607
|
+
const vmid = args.newVmId ?? args.vmid;
|
|
608
|
+
if (vmid !== undefined)
|
|
609
|
+
command.push("--vmid", String(vmid));
|
|
610
|
+
const version = args.targetVersion || args.version;
|
|
611
|
+
if (version)
|
|
612
|
+
command.push("--version", version);
|
|
613
|
+
const ttlHours = args.ttlHours ?? (args.durationMinutes !== undefined ? args.durationMinutes / 60 : undefined);
|
|
614
|
+
if (ttlHours !== undefined)
|
|
615
|
+
command.push("--ttl-hours", String(ttlHours));
|
|
616
|
+
if (args.apply)
|
|
617
|
+
command.push("--apply", "--confirm-asset-id", args.confirmAssetId);
|
|
618
|
+
if (args.outputFile)
|
|
619
|
+
command.push("--output-file", args.outputFile);
|
|
620
|
+
if (args.receiptFile)
|
|
621
|
+
command.push("--receipt-file", args.receiptFile);
|
|
622
|
+
return runCanonicalOperation(context.canonicalBridge, "auto_provision_vm", command);
|
|
623
|
+
}
|
|
432
624
|
const rawHost = args.host || args.targetHost;
|
|
433
625
|
const targetHost = !rawHost || rawHost === "auto" ? undefined : rawHost;
|
|
434
626
|
const hypervisorType = args.hypervisorType || "any";
|