@calltelemetry/ct-lab-mcp 0.8.58 → 0.8.60
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 +4 -2
- package/dist/src/server.d.ts +3 -0
- package/dist/src/server.d.ts.map +1 -1
- package/dist/src/server.js +3 -0
- package/dist/src/server.js.map +1 -1
- package/dist/src/tools/appliance-claim-tools.d.ts +97 -14
- package/dist/src/tools/appliance-claim-tools.d.ts.map +1 -1
- package/dist/src/tools/appliance-claim-tools.js +254 -25
- package/dist/src/tools/appliance-claim-tools.js.map +1 -1
- package/dist/src/tools/canonical-guard.d.ts +1 -1
- package/dist/src/tools/canonical-guard.d.ts.map +1 -1
- package/dist/src/tools/canonical-guard.js +4 -0
- package/dist/src/tools/canonical-guard.js.map +1 -1
- package/dist/src/tools/claim-first.d.ts +76 -0
- package/dist/src/tools/claim-first.d.ts.map +1 -0
- package/dist/src/tools/claim-first.js +149 -0
- package/dist/src/tools/claim-first.js.map +1 -0
- package/dist/src/tools/claim-lifecycle.d.ts +4 -4
- package/dist/src/tools/claimed-import-qcow.d.ts +117 -0
- package/dist/src/tools/claimed-import-qcow.d.ts.map +1 -0
- package/dist/src/tools/claimed-import-qcow.js +171 -0
- package/dist/src/tools/claimed-import-qcow.js.map +1 -0
- package/dist/src/tools/cube-provision.d.ts +2 -2
- package/dist/src/tools/factory-reset.d.ts +4 -4
- package/dist/src/tools/import-qcow.d.ts +6 -6
- 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 +66 -7
- package/dist/src/tools/index.js.map +1 -1
- package/dist/src/tools/lab-dev.d.ts +26 -26
- package/dist/src/tools/license-tools.d.ts +4 -4
- package/dist/src/tools/list-hosts.d.ts +6 -0
- package/dist/src/tools/list-hosts.d.ts.map +1 -1
- package/dist/src/tools/list-hosts.js.map +1 -1
- package/dist/src/tools/provision-tools.d.ts +8 -8
- package/dist/src/tools/provision-tools.d.ts.map +1 -1
- package/dist/src/tools/provision-tools.js +51 -0
- package/dist/src/tools/provision-tools.js.map +1 -1
- package/dist/src/tools/quick-provision.d.ts +2 -2
- package/dist/src/tools/sandbox-tools.d.ts +4 -4
- package/dist/src/tools/slot-tools.d.ts +22 -4
- package/dist/src/tools/slot-tools.d.ts.map +1 -1
- package/dist/src/tools/slot-tools.js +15 -0
- package/dist/src/tools/slot-tools.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claim-first provisioning (REL-1388, ADR 0779).
|
|
3
|
+
*
|
|
4
|
+
* The appliance operator destroys every guest no ApplianceClaim names within
|
|
5
|
+
* about five minutes. Any tool that creates a guest must therefore create the
|
|
6
|
+
* claim BEFORE the guest exists and remove it again if creation fails; a tool
|
|
7
|
+
* that cannot know which guest it will create refuses instead of silently
|
|
8
|
+
* creating an unclaimed one. Runbook:
|
|
9
|
+
* plugins/ct-lab/skills/ct-lab-mcp/references/appliance-claim-runbook.md
|
|
10
|
+
*/
|
|
11
|
+
import { ProxmoxErrorCode, createToolErrorResult } from "../types/mcp.js";
|
|
12
|
+
import { buildApplianceClaimManifest, CreateApplianceClaimInputSchema, handleCreateApplianceClaim, handleDeleteApplianceClaim, patchApplianceClaimSpec, } from "./appliance-claim-tools.js";
|
|
13
|
+
import { canonicalMode } from "./canonical-guard.js";
|
|
14
|
+
export const CLAIM_FIRST_RUNBOOK = "plugins/ct-lab/skills/ct-lab-mcp/references/appliance-claim-runbook.md";
|
|
15
|
+
const text = (r) => {
|
|
16
|
+
const block = r.content?.[0];
|
|
17
|
+
return block && block.type === "text" ? block.text : "";
|
|
18
|
+
};
|
|
19
|
+
/** Production hooks: bare ApplianceClaims through the same handlers the claim tools use. */
|
|
20
|
+
export function createClaimFirstHooks() {
|
|
21
|
+
return {
|
|
22
|
+
async create(request) {
|
|
23
|
+
const claimName = claimNameFor(request);
|
|
24
|
+
const input = {
|
|
25
|
+
name: claimName,
|
|
26
|
+
node: request.node,
|
|
27
|
+
vmid: request.vmid,
|
|
28
|
+
vmName: request.vmName,
|
|
29
|
+
profile: "bare",
|
|
30
|
+
ttlHours: request.ttlHours,
|
|
31
|
+
linearIssue: request.linearIssue,
|
|
32
|
+
dryRun: false,
|
|
33
|
+
};
|
|
34
|
+
const res = await handleCreateApplianceClaim(input);
|
|
35
|
+
if (res.isError) {
|
|
36
|
+
if (/already ?exists|AlreadyExists|\(409\)/i.test(text(res))) {
|
|
37
|
+
return { claimName, created: false };
|
|
38
|
+
}
|
|
39
|
+
throw new Error(text(res));
|
|
40
|
+
}
|
|
41
|
+
return { claimName, created: true };
|
|
42
|
+
},
|
|
43
|
+
async attachVmid(claimName, vmid) {
|
|
44
|
+
await patchApplianceClaimSpec(claimName, { vmid });
|
|
45
|
+
},
|
|
46
|
+
async remove(claimName) {
|
|
47
|
+
const res = await handleDeleteApplianceClaim({ name: claimName });
|
|
48
|
+
if (res.isError)
|
|
49
|
+
throw new Error(text(res));
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export function claimNameFor(request) {
|
|
54
|
+
const issue = (request.linearIssue ?? "lab").toLowerCase().replace(/[^a-z0-9-]/g, "");
|
|
55
|
+
const tail = request.vmid ??
|
|
56
|
+
(request.vmName ?? "guest").toLowerCase().replace(/[^a-z0-9-]/g, "-").slice(0, 30);
|
|
57
|
+
return `claim-${issue}-${tail}`.replace(/-+$/g, "").slice(0, 63);
|
|
58
|
+
}
|
|
59
|
+
/** Canonical claim node for a hypervisor host id, or null when the operator would not track it. */
|
|
60
|
+
export function claimNodeForHost(host) {
|
|
61
|
+
if (typeof host !== "string")
|
|
62
|
+
return null;
|
|
63
|
+
const h = host.trim().toLowerCase();
|
|
64
|
+
if (h === "proxmox-lab" || h === "proxmox")
|
|
65
|
+
return "proxmox";
|
|
66
|
+
if (h === "proxmox-mini" || h === "proxmox-minis-lab" || h === "minis")
|
|
67
|
+
return "minis";
|
|
68
|
+
if (h.startsWith("esxi"))
|
|
69
|
+
return "esxi";
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
export function ttlHoursFrom(args) {
|
|
73
|
+
const num = (v) => (typeof v === "number" && Number.isFinite(v) && v > 0 ? v : undefined);
|
|
74
|
+
const hours = num(args.ttlHours) ?? (num(args.ttlMinutes) ?? num(args.durationMinutes) ?? 24 * 60) / 60;
|
|
75
|
+
return Math.min(8760, Math.max(1, Math.ceil(hours)));
|
|
76
|
+
}
|
|
77
|
+
export function refusal(tool, why) {
|
|
78
|
+
return createToolErrorResult(ProxmoxErrorCode.VALIDATION_ERROR, `${tool} refused: ${why} The strict appliance operator destroys every guest no ApplianceClaim names, so ${tool} will not create an unclaimed guest. Follow ${CLAIM_FIRST_RUNBOOK} (claim first; claimed_import_qcow or create_appliance_claim).`, { operation: tool, runbook: CLAIM_FIRST_RUNBOOK });
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Wraps a canonical guest-creating apply: the claim is created first, the
|
|
82
|
+
* operation runs, and the claim is removed again when it fails. Plans create
|
|
83
|
+
* nothing and pass straight through.
|
|
84
|
+
*/
|
|
85
|
+
export async function claimFirstCanonicalApply(d, run, hooks = d.context.claimFirst) {
|
|
86
|
+
if (!d.apply || (!d.alwaysClaim && !canonicalMode(d.context)))
|
|
87
|
+
return run();
|
|
88
|
+
if (!hooks) {
|
|
89
|
+
return refusal(d.tool, "claim-first hooks are not available on this server instance.");
|
|
90
|
+
}
|
|
91
|
+
const node = claimNodeForHost(d.hostAssetId);
|
|
92
|
+
if (!node) {
|
|
93
|
+
return refusal(d.tool, `hostAssetId '${String(d.hostAssetId)}' does not map to a node the operator tracks (proxmox-lab, proxmox-minis-lab, esxi).`);
|
|
94
|
+
}
|
|
95
|
+
const vmidRaw = typeof d.vmid === "string" ? Number(d.vmid) : d.vmid;
|
|
96
|
+
const vmid = typeof vmidRaw === "number" && Number.isInteger(vmidRaw) && vmidRaw > 0 ? vmidRaw : undefined;
|
|
97
|
+
const vmName = typeof d.vmName === "string" && d.vmName ? d.vmName : undefined;
|
|
98
|
+
if (vmid === undefined && !(d.allowNameOnly && vmName)) {
|
|
99
|
+
return refusal(d.tool, d.allowNameOnly
|
|
100
|
+
? "apply needs claimVmid or claimVmName so the claim can name the guest."
|
|
101
|
+
: "apply needs an explicit vmid so the claim can name the guest before it exists (pick a free VMID with list_inventory).");
|
|
102
|
+
}
|
|
103
|
+
const linearIssue = typeof d.linearIssue === "string" ? d.linearIssue : undefined;
|
|
104
|
+
const request = { node, vmid, vmName, ttlHours: ttlHoursFrom(d.ttl), linearIssue };
|
|
105
|
+
// Validate the manifest before touching anything.
|
|
106
|
+
const parsed = CreateApplianceClaimInputSchema.safeParse({
|
|
107
|
+
name: claimNameFor(request), node, vmid, vmName, profile: "bare", ttlHours: request.ttlHours, linearIssue, dryRun: true,
|
|
108
|
+
});
|
|
109
|
+
const built = parsed.success ? buildApplianceClaimManifest(parsed.data) : { error: parsed.error.message };
|
|
110
|
+
if ("error" in built)
|
|
111
|
+
return refusal(d.tool, `the claim for this guest is invalid: ${built.error}`);
|
|
112
|
+
let ref;
|
|
113
|
+
try {
|
|
114
|
+
ref = await hooks.create(request);
|
|
115
|
+
}
|
|
116
|
+
catch (err) {
|
|
117
|
+
return refusal(d.tool, `the claim could not be created (${err?.message ?? err}); nothing was provisioned.`);
|
|
118
|
+
}
|
|
119
|
+
let result;
|
|
120
|
+
try {
|
|
121
|
+
result = await run();
|
|
122
|
+
}
|
|
123
|
+
catch (err) {
|
|
124
|
+
result = createToolErrorResult(ProxmoxErrorCode.UPSTREAM_API_ERROR, `${d.tool} threw: ${err?.message ?? err}`);
|
|
125
|
+
}
|
|
126
|
+
if (result.isError && ref.created) {
|
|
127
|
+
try {
|
|
128
|
+
await hooks.remove(ref.claimName);
|
|
129
|
+
}
|
|
130
|
+
catch (err) {
|
|
131
|
+
return createToolErrorResult(ProxmoxErrorCode.UPSTREAM_API_ERROR, `${text(result)}\n\nClaim '${ref.claimName}' could NOT be removed (${err?.message ?? err}); delete it with delete_appliance_claim.`, { operation: d.tool, claimName: ref.claimName });
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return result;
|
|
135
|
+
}
|
|
136
|
+
/** Legacy (non-canonical) handlers know the guest NAME before they create it. Claim it by name. */
|
|
137
|
+
export async function claimLegacyGuest(context, guest) {
|
|
138
|
+
const hooks = context.claimFirst;
|
|
139
|
+
if (!hooks)
|
|
140
|
+
return undefined;
|
|
141
|
+
const node = claimNodeForHost(guest.hostId);
|
|
142
|
+
if (!node) {
|
|
143
|
+
throw new Error(`host '${String(guest.hostId)}' is not tracked by the appliance operator; refusing to create an unclaimed guest (${CLAIM_FIRST_RUNBOOK}).`);
|
|
144
|
+
}
|
|
145
|
+
return hooks.create({ node, vmName: guest.vmName, vmid: guest.vmid, ttlHours: guest.ttlHours, linearIssue: guest.linearIssue });
|
|
146
|
+
}
|
|
147
|
+
const NODE_HOST = { proxmox: "proxmox-lab", minis: "proxmox-minis-lab", esxi: "esxi" };
|
|
148
|
+
export const hostForClaimNode = (node) => NODE_HOST[node];
|
|
149
|
+
//# sourceMappingURL=claim-first.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claim-first.js","sourceRoot":"","sources":["../../../src/tools/claim-first.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAkB,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC1F,OAAO,EAEL,2BAA2B,EAC3B,+BAA+B,EAC/B,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,CAAC,MAAM,mBAAmB,GAC9B,wEAAwE,CAAC;AAsB3E,MAAM,IAAI,GAAG,CAAC,CAAiB,EAAU,EAAE;IACzC,MAAM,KAAK,GAAG,CAAC,CAAC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
|
allowRunning: boolean;
|
|
38
38
|
linearIssue?: string | undefined;
|
|
39
39
|
leaseId?: string | undefined;
|
|
40
|
+
ttlHours?: number | undefined;
|
|
40
41
|
assetId?: string | undefined;
|
|
41
42
|
operationId?: string | undefined;
|
|
42
43
|
receiptFile?: string | undefined;
|
|
43
|
-
ttlHours?: number | undefined;
|
|
44
44
|
confirmAssetId?: string | undefined;
|
|
45
45
|
}, {
|
|
46
46
|
linearIssue?: string | undefined;
|
|
47
47
|
leaseId?: string | undefined;
|
|
48
|
+
ttlHours?: number | undefined;
|
|
48
49
|
assetId?: string | undefined;
|
|
49
50
|
operationId?: string | undefined;
|
|
50
51
|
apply?: boolean | undefined;
|
|
51
52
|
receiptFile?: string | undefined;
|
|
52
|
-
ttlHours?: number | undefined;
|
|
53
53
|
confirmAssetId?: string | undefined;
|
|
54
54
|
replaceClosedClaim?: boolean | undefined;
|
|
55
55
|
allowRunning?: boolean | undefined;
|
|
@@ -83,20 +83,20 @@ export declare const TransferClaimInputSchema: z.ZodObject<{
|
|
|
83
83
|
recoverExpiredRunning: boolean;
|
|
84
84
|
linearIssue?: string | undefined;
|
|
85
85
|
leaseId?: string | undefined;
|
|
86
|
+
ttlHours?: number | undefined;
|
|
86
87
|
assetId?: string | undefined;
|
|
87
88
|
operationId?: string | undefined;
|
|
88
89
|
receiptFile?: string | undefined;
|
|
89
|
-
ttlHours?: number | undefined;
|
|
90
90
|
confirmAssetId?: string | undefined;
|
|
91
91
|
toLinearIssue?: string | undefined;
|
|
92
92
|
}, {
|
|
93
93
|
linearIssue?: string | undefined;
|
|
94
94
|
leaseId?: string | undefined;
|
|
95
|
+
ttlHours?: number | undefined;
|
|
95
96
|
assetId?: string | undefined;
|
|
96
97
|
operationId?: string | undefined;
|
|
97
98
|
apply?: boolean | undefined;
|
|
98
99
|
receiptFile?: string | undefined;
|
|
99
|
-
ttlHours?: number | undefined;
|
|
100
100
|
confirmAssetId?: string | undefined;
|
|
101
101
|
toLinearIssue?: string | undefined;
|
|
102
102
|
recoverExpiredRunning?: boolean | undefined;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP tool: claimed_import_qcow
|
|
3
|
+
*
|
|
4
|
+
* The one sanctioned path from a published (or private candidate) appliance
|
|
5
|
+
* image to a CLAIMED Proxmox guest (REL-1388, ADR 0779).
|
|
6
|
+
*
|
|
7
|
+
* The strict appliance operator destroys every guest no ApplianceClaim names, on
|
|
8
|
+
* a 5-minute pass. A plain proxmox_import_qcow guest has no claim and would be
|
|
9
|
+
* destroyed minutes after it boots. This tool therefore claims FIRST:
|
|
10
|
+
*
|
|
11
|
+
* 1. validate everything (import contract + claim contract) before any mutation
|
|
12
|
+
* 2. create a profile=bare ApplianceClaim naming node + VMID + VM name
|
|
13
|
+
* (no seed, no license, no bootstrap: the imported image stays exactly as
|
|
14
|
+
* published), with a finite TTL
|
|
15
|
+
* 3. run the canonical `lab-inventory vm import-qcow` apply (digest-bound,
|
|
16
|
+
* leased, receipts) through proxmox_import_qcow
|
|
17
|
+
* 4. if the import fails, delete the claim again so nothing is left half-owned
|
|
18
|
+
*
|
|
19
|
+
* Dry-run (the default) runs the canonical import PLAN and previews the claim
|
|
20
|
+
* manifest without creating anything. Renew with renew_appliance_claim, release
|
|
21
|
+
* with delete_appliance_claim (the operator then destroys the guest).
|
|
22
|
+
*/
|
|
23
|
+
import { z } from "zod";
|
|
24
|
+
import { CallToolResult } from "../types/mcp.js";
|
|
25
|
+
import { ToolContext } from "./list-hosts.js";
|
|
26
|
+
export declare const ClaimedImportQcowInputObjectSchema: z.ZodObject<{
|
|
27
|
+
readonly assetId: z.ZodString;
|
|
28
|
+
readonly hostAssetId: z.ZodString;
|
|
29
|
+
readonly linearIssue: z.ZodString;
|
|
30
|
+
readonly imageUrl: z.ZodString;
|
|
31
|
+
readonly imageSha256: z.ZodString;
|
|
32
|
+
readonly operationId: z.ZodString;
|
|
33
|
+
readonly receiptFile: z.ZodString;
|
|
34
|
+
readonly vmid: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
readonly vmPrefix: z.ZodOptional<z.ZodString>;
|
|
36
|
+
readonly memoryMb: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
readonly vcpus: z.ZodOptional<z.ZodNumber>;
|
|
38
|
+
readonly diskGb: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
readonly storage: z.ZodOptional<z.ZodString>;
|
|
40
|
+
readonly importStorage: z.ZodOptional<z.ZodString>;
|
|
41
|
+
readonly network: z.ZodOptional<z.ZodString>;
|
|
42
|
+
readonly vlanTag: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
readonly purpose: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
44
|
+
readonly ttlHours: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
readonly apply: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
46
|
+
readonly confirmAssetId: z.ZodOptional<z.ZodString>;
|
|
47
|
+
readonly confirmVmPrefix: z.ZodOptional<z.ZodString>;
|
|
48
|
+
readonly confirmVmid: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
readonly confirmImageSha256: z.ZodOptional<z.ZodString>;
|
|
50
|
+
} & {
|
|
51
|
+
node: z.ZodEnum<["minis", "proxmox"]>;
|
|
52
|
+
claimName: z.ZodOptional<z.ZodString>;
|
|
53
|
+
claimTtlHours: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
}, "strict", z.ZodTypeAny, {
|
|
55
|
+
node: "proxmox" | "minis";
|
|
56
|
+
linearIssue: string;
|
|
57
|
+
purpose: string;
|
|
58
|
+
assetId: string;
|
|
59
|
+
hostAssetId: string;
|
|
60
|
+
operationId: string;
|
|
61
|
+
apply: boolean;
|
|
62
|
+
receiptFile: string;
|
|
63
|
+
imageUrl: string;
|
|
64
|
+
imageSha256: string;
|
|
65
|
+
storage?: string | undefined;
|
|
66
|
+
memoryMb?: number | undefined;
|
|
67
|
+
vmid?: number | undefined;
|
|
68
|
+
network?: string | undefined;
|
|
69
|
+
ttlHours?: number | undefined;
|
|
70
|
+
claimName?: string | undefined;
|
|
71
|
+
diskGb?: number | undefined;
|
|
72
|
+
importStorage?: string | undefined;
|
|
73
|
+
confirmAssetId?: string | undefined;
|
|
74
|
+
confirmVmPrefix?: string | undefined;
|
|
75
|
+
confirmVmid?: number | undefined;
|
|
76
|
+
vcpus?: number | undefined;
|
|
77
|
+
vlanTag?: number | undefined;
|
|
78
|
+
vmPrefix?: string | undefined;
|
|
79
|
+
confirmImageSha256?: string | undefined;
|
|
80
|
+
claimTtlHours?: number | undefined;
|
|
81
|
+
}, {
|
|
82
|
+
node: "proxmox" | "minis";
|
|
83
|
+
linearIssue: string;
|
|
84
|
+
assetId: string;
|
|
85
|
+
hostAssetId: string;
|
|
86
|
+
operationId: string;
|
|
87
|
+
receiptFile: string;
|
|
88
|
+
imageUrl: string;
|
|
89
|
+
imageSha256: string;
|
|
90
|
+
storage?: string | undefined;
|
|
91
|
+
memoryMb?: number | undefined;
|
|
92
|
+
vmid?: number | undefined;
|
|
93
|
+
network?: string | undefined;
|
|
94
|
+
purpose?: string | undefined;
|
|
95
|
+
ttlHours?: number | undefined;
|
|
96
|
+
claimName?: string | undefined;
|
|
97
|
+
diskGb?: number | undefined;
|
|
98
|
+
importStorage?: string | undefined;
|
|
99
|
+
apply?: boolean | undefined;
|
|
100
|
+
confirmAssetId?: string | undefined;
|
|
101
|
+
confirmVmPrefix?: string | undefined;
|
|
102
|
+
confirmVmid?: number | undefined;
|
|
103
|
+
vcpus?: number | undefined;
|
|
104
|
+
vlanTag?: number | undefined;
|
|
105
|
+
vmPrefix?: string | undefined;
|
|
106
|
+
confirmImageSha256?: string | undefined;
|
|
107
|
+
claimTtlHours?: number | undefined;
|
|
108
|
+
}>;
|
|
109
|
+
export type ClaimedImportQcowRawInput = z.input<typeof ClaimedImportQcowInputObjectSchema>;
|
|
110
|
+
export interface ClaimedImportDeps {
|
|
111
|
+
createClaim: (args: unknown) => Promise<CallToolResult>;
|
|
112
|
+
deleteClaim: (args: unknown) => Promise<CallToolResult>;
|
|
113
|
+
importQcow: (args: unknown, context: ToolContext) => Promise<CallToolResult>;
|
|
114
|
+
}
|
|
115
|
+
export declare function handleClaimedImportQcow(rawArgs: ClaimedImportQcowRawInput | undefined, context: ToolContext, deps?: ClaimedImportDeps): Promise<CallToolResult>;
|
|
116
|
+
export declare const CLAIMED_IMPORT_QCOW_TOOL_DESCRIPTION = "Import a published or private-candidate appliance QCOW2 as a Proxmox lab guest AND claim it, in one sanctioned step. The strict appliance operator destroys every guest no ApplianceClaim names within ~5 minutes, so this tool creates a profile=bare ApplianceClaim (no seed, no license, no bootstrap; names node + VMID + VM name; finite TTL) FIRST, then runs the canonical lab-inventory vm import-qcow apply (digest-bound, leased, receipted), and deletes the claim again if the import fails. Dry-run is the default: it runs the canonical import plan and previews the claim. Requires vmid, vmPrefix and node (minis|proxmox, matching hostAssetId). Renew with renew_appliance_claim; release with delete_appliance_claim.";
|
|
117
|
+
//# sourceMappingURL=claimed-import-qcow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claimed-import-qcow.d.ts","sourceRoot":"","sources":["../../../src/tools/claimed-import-qcow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAA2C,MAAM,iBAAiB,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAgB9C,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqBpC,CAAC;AAEZ,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE3F,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IACxD,WAAW,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IACxD,UAAU,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;CAC9E;AAoBD,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,yBAAyB,GAAG,SAAS,EAC9C,OAAO,EAAE,WAAW,EACpB,IAAI,GAAE,iBAA+B,GACpC,OAAO,CAAC,cAAc,CAAC,CAkIzB;AAED,eAAO,MAAM,oCAAoC,8sBAC4pB,CAAC"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP tool: claimed_import_qcow
|
|
3
|
+
*
|
|
4
|
+
* The one sanctioned path from a published (or private candidate) appliance
|
|
5
|
+
* image to a CLAIMED Proxmox guest (REL-1388, ADR 0779).
|
|
6
|
+
*
|
|
7
|
+
* The strict appliance operator destroys every guest no ApplianceClaim names, on
|
|
8
|
+
* a 5-minute pass. A plain proxmox_import_qcow guest has no claim and would be
|
|
9
|
+
* destroyed minutes after it boots. This tool therefore claims FIRST:
|
|
10
|
+
*
|
|
11
|
+
* 1. validate everything (import contract + claim contract) before any mutation
|
|
12
|
+
* 2. create a profile=bare ApplianceClaim naming node + VMID + VM name
|
|
13
|
+
* (no seed, no license, no bootstrap: the imported image stays exactly as
|
|
14
|
+
* published), with a finite TTL
|
|
15
|
+
* 3. run the canonical `lab-inventory vm import-qcow` apply (digest-bound,
|
|
16
|
+
* leased, receipts) through proxmox_import_qcow
|
|
17
|
+
* 4. if the import fails, delete the claim again so nothing is left half-owned
|
|
18
|
+
*
|
|
19
|
+
* Dry-run (the default) runs the canonical import PLAN and previews the claim
|
|
20
|
+
* manifest without creating anything. Renew with renew_appliance_claim, release
|
|
21
|
+
* with delete_appliance_claim (the operator then destroys the guest).
|
|
22
|
+
*/
|
|
23
|
+
import { z } from "zod";
|
|
24
|
+
import { ProxmoxErrorCode, createToolErrorResult } from "../types/mcp.js";
|
|
25
|
+
import { canonicalMode } from "./canonical-guard.js";
|
|
26
|
+
import { reservedIdentityError } from "./sha-channel.js";
|
|
27
|
+
import { ImportQcowInputObjectSchema, ImportQcowInputSchema, handleProxmoxImportQcow, } from "./import-qcow.js";
|
|
28
|
+
import { buildApplianceClaimManifest, handleCreateApplianceClaim, handleDeleteApplianceClaim, normalizeClaimNode, CreateApplianceClaimInputSchema, } from "./appliance-claim-tools.js";
|
|
29
|
+
export const ClaimedImportQcowInputObjectSchema = ImportQcowInputObjectSchema.extend({
|
|
30
|
+
node: z
|
|
31
|
+
.enum(["minis", "proxmox"])
|
|
32
|
+
.describe("Proxmox node the guest lands on, as the operator tracks claims: 'minis' (proxmox-minis-lab / proxmox-mini) or 'proxmox' (proxmox-lab). Must match hostAssetId."),
|
|
33
|
+
claimName: z
|
|
34
|
+
.string()
|
|
35
|
+
.trim()
|
|
36
|
+
.min(1)
|
|
37
|
+
.max(63)
|
|
38
|
+
.regex(/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/, "must be a DNS-1123 label")
|
|
39
|
+
.optional()
|
|
40
|
+
.describe("ApplianceClaim name (default: claim-<linearIssue>-<vmid>)."),
|
|
41
|
+
claimTtlHours: z
|
|
42
|
+
.number()
|
|
43
|
+
.int()
|
|
44
|
+
.min(1)
|
|
45
|
+
.max(8760)
|
|
46
|
+
.optional()
|
|
47
|
+
.describe("Claim TTL in hours; the operator destroys the guest when it elapses (default: ttlHours, else 24). Renew with renew_appliance_claim."),
|
|
48
|
+
}).strict();
|
|
49
|
+
const defaultDeps = {
|
|
50
|
+
createClaim: (args) => handleCreateApplianceClaim(args),
|
|
51
|
+
deleteClaim: (args) => handleDeleteApplianceClaim(args),
|
|
52
|
+
importQcow: (args, context) => handleProxmoxImportQcow(args, context),
|
|
53
|
+
};
|
|
54
|
+
function textOf(result) {
|
|
55
|
+
const block = result.content?.[0];
|
|
56
|
+
return block && block.type === "text" ? block.text : "";
|
|
57
|
+
}
|
|
58
|
+
function fail(message, details) {
|
|
59
|
+
return createToolErrorResult(ProxmoxErrorCode.VALIDATION_ERROR, message, {
|
|
60
|
+
operation: "claimed_import_qcow",
|
|
61
|
+
...details,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
export async function handleClaimedImportQcow(rawArgs, context, deps = defaultDeps) {
|
|
65
|
+
const parsed = ClaimedImportQcowInputObjectSchema.safeParse(rawArgs ?? {});
|
|
66
|
+
if (!parsed.success) {
|
|
67
|
+
return fail(parsed.error.errors.map((e) => `${e.path.join(".")}: ${e.message}`).join("; "));
|
|
68
|
+
}
|
|
69
|
+
const { node, claimName, claimTtlHours, ...importArgs } = parsed.data;
|
|
70
|
+
// The import contract (apply confirmations, URL allowlist, ...) is validated
|
|
71
|
+
// up front so a bad request never reaches the claim step.
|
|
72
|
+
const importCheck = ImportQcowInputSchema.safeParse(importArgs);
|
|
73
|
+
if (!importCheck.success) {
|
|
74
|
+
return fail(importCheck.error.errors.map((e) => `${e.path.join(".")}: ${e.message}`).join("; "));
|
|
75
|
+
}
|
|
76
|
+
const imp = importCheck.data;
|
|
77
|
+
if (imp.vmid === undefined || !imp.vmPrefix) {
|
|
78
|
+
return fail("claimed_import_qcow needs both vmid and vmPrefix: the claim names the guest by node + VMID + VM name, and the canonical CLI names the guest exactly vmPrefix.");
|
|
79
|
+
}
|
|
80
|
+
const reserved = reservedIdentityError(imp.vmid);
|
|
81
|
+
if (reserved)
|
|
82
|
+
return fail(reserved);
|
|
83
|
+
const hostNode = normalizeClaimNode(imp.hostAssetId);
|
|
84
|
+
if (hostNode && hostNode !== node) {
|
|
85
|
+
return fail(`node '${node}' does not match hostAssetId '${imp.hostAssetId}' (${hostNode}); the claim would not protect the guest.`);
|
|
86
|
+
}
|
|
87
|
+
if (!canonicalMode(context)) {
|
|
88
|
+
return createToolErrorResult("CANONICAL_OPERATION_REQUIRES_BRIDGE", "claimed_import_qcow requires canonical lab mode (image qualification, digest verification and guest evidence are owned by lab-inventory vm import-qcow); no claim was created.", { operation: "claimed_import_qcow" });
|
|
89
|
+
}
|
|
90
|
+
const claimInput = {
|
|
91
|
+
name: claimName ?? `claim-${imp.linearIssue.toLowerCase()}-${imp.vmid}`,
|
|
92
|
+
targetIp: undefined,
|
|
93
|
+
node,
|
|
94
|
+
vmid: imp.vmid,
|
|
95
|
+
vmName: imp.vmPrefix,
|
|
96
|
+
profile: "bare",
|
|
97
|
+
ttlHours: claimTtlHours ?? imp.ttlHours ?? 24,
|
|
98
|
+
linearIssue: imp.linearIssue,
|
|
99
|
+
dryRun: !imp.apply,
|
|
100
|
+
};
|
|
101
|
+
const claimParsed = CreateApplianceClaimInputSchema.safeParse(claimInput);
|
|
102
|
+
if (!claimParsed.success) {
|
|
103
|
+
return fail(claimParsed.error.errors.map((e) => `claim.${e.path.join(".")}: ${e.message}`).join("; "));
|
|
104
|
+
}
|
|
105
|
+
const built = buildApplianceClaimManifest(claimParsed.data);
|
|
106
|
+
if ("error" in built)
|
|
107
|
+
return fail(built.error);
|
|
108
|
+
// Plan: canonical import plan + claim preview. Nothing is created.
|
|
109
|
+
if (!imp.apply) {
|
|
110
|
+
const plan = await deps.importQcow(importArgs, context);
|
|
111
|
+
if (plan.isError)
|
|
112
|
+
return plan;
|
|
113
|
+
return {
|
|
114
|
+
content: [
|
|
115
|
+
{
|
|
116
|
+
type: "text",
|
|
117
|
+
text: JSON.stringify({
|
|
118
|
+
success: true,
|
|
119
|
+
mode: "plan",
|
|
120
|
+
claim: { name: built.claimName, manifest: built.manifest },
|
|
121
|
+
import: textOf(plan),
|
|
122
|
+
next: "Re-run with apply=true and the confirm* fields. The claim is created first, then the import runs; a failed import deletes the claim again.",
|
|
123
|
+
}, null, 2),
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
// Apply: claim FIRST so the strict operator never sees an unclaimed guest.
|
|
129
|
+
const created = await deps.createClaim({ ...claimInput, dryRun: false });
|
|
130
|
+
if (created.isError) {
|
|
131
|
+
return createToolErrorResult(ProxmoxErrorCode.UPSTREAM_API_ERROR, `claim creation failed; the image was NOT imported: ${textOf(created)}`, { operation: "claimed_import_qcow", claimName: built.claimName });
|
|
132
|
+
}
|
|
133
|
+
let imported;
|
|
134
|
+
try {
|
|
135
|
+
imported = await deps.importQcow(importArgs, context);
|
|
136
|
+
}
|
|
137
|
+
catch (err) {
|
|
138
|
+
imported = createToolErrorResult(ProxmoxErrorCode.UPSTREAM_API_ERROR, `import threw: ${err?.message ?? err}`);
|
|
139
|
+
}
|
|
140
|
+
if (imported.isError) {
|
|
141
|
+
// Do not leave a claim holding a guest that never came up. Any partial guest
|
|
142
|
+
// is unclaimed after this and is reclaimed by the strict operator; the
|
|
143
|
+
// canonical CLI journal keeps the evidence.
|
|
144
|
+
const released = await deps.deleteClaim({ name: built.claimName, namespace: built.manifest.metadata.namespace });
|
|
145
|
+
return createToolErrorResult(ProxmoxErrorCode.UPSTREAM_API_ERROR, `import failed; claim '${built.claimName}' was ${released.isError ? "NOT deleted (delete it manually)" : "deleted"}. ${textOf(imported)}`, { operation: "claimed_import_qcow", claimName: built.claimName });
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
content: [
|
|
149
|
+
{
|
|
150
|
+
type: "text",
|
|
151
|
+
text: JSON.stringify({
|
|
152
|
+
success: true,
|
|
153
|
+
mode: "apply",
|
|
154
|
+
claim: {
|
|
155
|
+
name: built.claimName,
|
|
156
|
+
namespace: built.manifest.metadata.namespace,
|
|
157
|
+
profile: "bare",
|
|
158
|
+
node,
|
|
159
|
+
vmid: imp.vmid,
|
|
160
|
+
vmName: imp.vmPrefix,
|
|
161
|
+
ttlHours: claimInput.ttlHours,
|
|
162
|
+
},
|
|
163
|
+
import: textOf(imported),
|
|
164
|
+
lifecycle: "The guest is claimed (no seed, no license, no bootstrap) and lives for ttlHours. renew_appliance_claim extends it; delete_appliance_claim makes the operator destroy it.",
|
|
165
|
+
}, null, 2),
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
export const CLAIMED_IMPORT_QCOW_TOOL_DESCRIPTION = "Import a published or private-candidate appliance QCOW2 as a Proxmox lab guest AND claim it, in one sanctioned step. The strict appliance operator destroys every guest no ApplianceClaim names within ~5 minutes, so this tool creates a profile=bare ApplianceClaim (no seed, no license, no bootstrap; names node + VMID + VM name; finite TTL) FIRST, then runs the canonical lab-inventory vm import-qcow apply (digest-bound, leased, receipted), and deletes the claim again if the import fails. Dry-run is the default: it runs the canonical import plan and previews the claim. Requires vmid, vmPrefix and node (minis|proxmox, matching hostAssetId). Renew with renew_appliance_claim; release with delete_appliance_claim.";
|
|
171
|
+
//# sourceMappingURL=claimed-import-qcow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claimed-import-qcow.js","sourceRoot":"","sources":["../../../src/tools/claimed-import-qcow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE1F,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,0BAA0B,EAC1B,kBAAkB,EAClB,+BAA+B,GAChC,MAAM,4BAA4B,CAAC;AAEpC,MAAM,CAAC,MAAM,kCAAkC,GAAG,2BAA2B,CAAC,MAAM,CAAC;IACnF,IAAI,EAAE,CAAC;SACJ,IAAI,CAAC,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KACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,oCAAoC,GAC/C,2sBAA2sB,CAAC"}
|
|
@@ -128,10 +128,10 @@ export declare const ProvisionCubeInputSchema: z.ZodObject<{
|
|
|
128
128
|
}, "strip", z.ZodTypeAny, {
|
|
129
129
|
host: string;
|
|
130
130
|
vlan: number;
|
|
131
|
+
profile: "standard" | "minimal" | "performance";
|
|
131
132
|
wipeExistingConfig: boolean;
|
|
132
133
|
activateLicenseAndReboot: boolean;
|
|
133
134
|
licenseLevel: string;
|
|
134
|
-
profile: "standard" | "minimal" | "performance";
|
|
135
135
|
topologyRole: "cucm-edge" | "att-pstn" | "verizon-peer" | "dual-cube-peer";
|
|
136
136
|
peerTargetPort: number;
|
|
137
137
|
inboundPattern: string;
|
|
@@ -165,6 +165,7 @@ export declare const ProvisionCubeInputSchema: z.ZodObject<{
|
|
|
165
165
|
vlan?: number | undefined;
|
|
166
166
|
cpuCores?: number | undefined;
|
|
167
167
|
purpose?: string | undefined;
|
|
168
|
+
profile?: "standard" | "minimal" | "performance" | undefined;
|
|
168
169
|
gatewayIp?: string | undefined;
|
|
169
170
|
applianceIp?: string | undefined;
|
|
170
171
|
xccRemoteUrl?: string | undefined;
|
|
@@ -173,7 +174,6 @@ export declare const ProvisionCubeInputSchema: z.ZodObject<{
|
|
|
173
174
|
wipeExistingConfig?: boolean | undefined;
|
|
174
175
|
activateLicenseAndReboot?: boolean | undefined;
|
|
175
176
|
licenseLevel?: string | undefined;
|
|
176
|
-
profile?: "standard" | "minimal" | "performance" | undefined;
|
|
177
177
|
topologyRole?: "cucm-edge" | "att-pstn" | "verizon-peer" | "dual-cube-peer" | undefined;
|
|
178
178
|
peerTargetHost?: string | undefined;
|
|
179
179
|
peerTargetPort?: number | undefined;
|
|
@@ -32,9 +32,9 @@ export declare const FactoryResetInputSchema: z.ZodObject<{
|
|
|
32
32
|
timeoutMs: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
33
33
|
}, "strip", z.ZodTypeAny, {
|
|
34
34
|
targetIp: string;
|
|
35
|
-
timeoutMs: number;
|
|
36
|
-
licenseDays: number;
|
|
37
35
|
licenseTier: string;
|
|
36
|
+
licenseDays: number;
|
|
37
|
+
timeoutMs: number;
|
|
38
38
|
applyLicense: boolean;
|
|
39
39
|
runMigrations: boolean;
|
|
40
40
|
assertHealth: boolean;
|
|
@@ -42,9 +42,9 @@ export declare const FactoryResetInputSchema: z.ZodObject<{
|
|
|
42
42
|
}, {
|
|
43
43
|
targetIp: string;
|
|
44
44
|
version?: string | undefined;
|
|
45
|
-
timeoutMs?: number | undefined;
|
|
46
|
-
licenseDays?: number | undefined;
|
|
47
45
|
licenseTier?: string | undefined;
|
|
46
|
+
licenseDays?: number | undefined;
|
|
47
|
+
timeoutMs?: number | undefined;
|
|
48
48
|
applyLicense?: boolean | undefined;
|
|
49
49
|
runMigrations?: boolean | undefined;
|
|
50
50
|
assertHealth?: boolean | undefined;
|
|
@@ -97,9 +97,9 @@ export declare const ImportQcowInputObjectSchema: z.ZodObject<{
|
|
|
97
97
|
memoryMb?: number | undefined;
|
|
98
98
|
vmid?: number | undefined;
|
|
99
99
|
network?: string | undefined;
|
|
100
|
+
ttlHours?: number | undefined;
|
|
100
101
|
diskGb?: number | undefined;
|
|
101
102
|
importStorage?: string | undefined;
|
|
102
|
-
ttlHours?: number | undefined;
|
|
103
103
|
confirmAssetId?: string | undefined;
|
|
104
104
|
confirmVmPrefix?: string | undefined;
|
|
105
105
|
confirmVmid?: number | undefined;
|
|
@@ -120,10 +120,10 @@ export declare const ImportQcowInputObjectSchema: z.ZodObject<{
|
|
|
120
120
|
vmid?: number | undefined;
|
|
121
121
|
network?: string | undefined;
|
|
122
122
|
purpose?: string | undefined;
|
|
123
|
+
ttlHours?: number | undefined;
|
|
123
124
|
diskGb?: number | undefined;
|
|
124
125
|
importStorage?: string | undefined;
|
|
125
126
|
apply?: boolean | undefined;
|
|
126
|
-
ttlHours?: number | undefined;
|
|
127
127
|
confirmAssetId?: string | undefined;
|
|
128
128
|
confirmVmPrefix?: string | undefined;
|
|
129
129
|
confirmVmid?: number | undefined;
|
|
@@ -170,9 +170,9 @@ export declare const ImportQcowInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
170
170
|
memoryMb?: number | undefined;
|
|
171
171
|
vmid?: number | undefined;
|
|
172
172
|
network?: string | undefined;
|
|
173
|
+
ttlHours?: number | undefined;
|
|
173
174
|
diskGb?: number | undefined;
|
|
174
175
|
importStorage?: string | undefined;
|
|
175
|
-
ttlHours?: number | undefined;
|
|
176
176
|
confirmAssetId?: string | undefined;
|
|
177
177
|
confirmVmPrefix?: string | undefined;
|
|
178
178
|
confirmVmid?: number | undefined;
|
|
@@ -193,10 +193,10 @@ export declare const ImportQcowInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
193
193
|
vmid?: number | undefined;
|
|
194
194
|
network?: string | undefined;
|
|
195
195
|
purpose?: string | undefined;
|
|
196
|
+
ttlHours?: number | undefined;
|
|
196
197
|
diskGb?: number | undefined;
|
|
197
198
|
importStorage?: string | undefined;
|
|
198
199
|
apply?: boolean | undefined;
|
|
199
|
-
ttlHours?: number | undefined;
|
|
200
200
|
confirmAssetId?: string | undefined;
|
|
201
201
|
confirmVmPrefix?: string | undefined;
|
|
202
202
|
confirmVmid?: number | undefined;
|
|
@@ -218,9 +218,9 @@ export declare const ImportQcowInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
218
218
|
memoryMb?: number | undefined;
|
|
219
219
|
vmid?: number | undefined;
|
|
220
220
|
network?: string | undefined;
|
|
221
|
+
ttlHours?: number | undefined;
|
|
221
222
|
diskGb?: number | undefined;
|
|
222
223
|
importStorage?: string | undefined;
|
|
223
|
-
ttlHours?: number | undefined;
|
|
224
224
|
confirmAssetId?: string | undefined;
|
|
225
225
|
confirmVmPrefix?: string | undefined;
|
|
226
226
|
confirmVmid?: number | undefined;
|
|
@@ -241,10 +241,10 @@ export declare const ImportQcowInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
241
241
|
vmid?: number | undefined;
|
|
242
242
|
network?: string | undefined;
|
|
243
243
|
purpose?: string | undefined;
|
|
244
|
+
ttlHours?: number | undefined;
|
|
244
245
|
diskGb?: number | undefined;
|
|
245
246
|
importStorage?: string | undefined;
|
|
246
247
|
apply?: boolean | undefined;
|
|
247
|
-
ttlHours?: number | undefined;
|
|
248
248
|
confirmAssetId?: string | undefined;
|
|
249
249
|
confirmVmPrefix?: string | undefined;
|
|
250
250
|
confirmVmid?: number | undefined;
|
|
@@ -54,6 +54,7 @@ export * from "./host-migrate-vm.js";
|
|
|
54
54
|
export * from "./sandbox-tools.js";
|
|
55
55
|
export * from "./fleet-metrics.js";
|
|
56
56
|
export * from "./appliance-claim-tools.js";
|
|
57
|
+
export * from "./claimed-import-qcow.js";
|
|
57
58
|
export * from "./sideload-runner.js";
|
|
58
59
|
export * from "./appliance-id.js";
|
|
59
60
|
export * from "./verify-demo.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAIL,WAAW,EACZ,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAIL,WAAW,EACZ,MAAM,iBAAiB,CAAC;AAuSzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,0B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