@calltelemetry/ct-lab-mcp 0.8.59 → 0.8.61
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 +3 -3
- package/dist/src/canonical/bridge.d.ts.map +1 -1
- package/dist/src/canonical/bridge.js +4 -0
- package/dist/src/canonical/bridge.js.map +1 -1
- 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 +19 -12
- package/dist/src/tools/appliance-claim-tools.d.ts.map +1 -1
- package/dist/src/tools/appliance-claim-tools.js +29 -0
- 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 +15 -7
- package/dist/src/tools/claimed-import-qcow.d.ts.map +1 -1
- package/dist/src/tools/claimed-import-qcow.js +9 -4
- package/dist/src/tools/claimed-import-qcow.js.map +1 -1
- 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 +43 -13
- package/dist/src/tools/import-qcow.d.ts.map +1 -1
- package/dist/src/tools/import-qcow.js +63 -13
- package/dist/src/tools/import-qcow.js.map +1 -1
- package/dist/src/tools/index.d.ts.map +1 -1
- package/dist/src/tools/index.js +63 -4
- 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,76 @@
|
|
|
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 { CallToolResult } from "../types/mcp.js";
|
|
12
|
+
import { ClaimNode } from "./appliance-claim-tools.js";
|
|
13
|
+
import type { ToolContext } from "./list-hosts.js";
|
|
14
|
+
export declare const CLAIM_FIRST_RUNBOOK = "plugins/ct-lab/skills/ct-lab-mcp/references/appliance-claim-runbook.md";
|
|
15
|
+
export interface ClaimFirstRequest {
|
|
16
|
+
node: ClaimNode;
|
|
17
|
+
vmid?: number;
|
|
18
|
+
vmName?: string;
|
|
19
|
+
ttlHours: number;
|
|
20
|
+
linearIssue?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ClaimFirstRef {
|
|
23
|
+
claimName: string;
|
|
24
|
+
/** False when an existing claim was adopted; it is never deleted on rollback. */
|
|
25
|
+
created: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface ClaimFirstHooks {
|
|
28
|
+
create(request: ClaimFirstRequest): Promise<ClaimFirstRef>;
|
|
29
|
+
attachVmid(claimName: string, vmid: number): Promise<void>;
|
|
30
|
+
remove(claimName: string): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
/** Production hooks: bare ApplianceClaims through the same handlers the claim tools use. */
|
|
33
|
+
export declare function createClaimFirstHooks(): ClaimFirstHooks;
|
|
34
|
+
export declare function claimNameFor(request: ClaimFirstRequest): string;
|
|
35
|
+
/** Canonical claim node for a hypervisor host id, or null when the operator would not track it. */
|
|
36
|
+
export declare function claimNodeForHost(host: unknown): ClaimNode | null;
|
|
37
|
+
export declare function ttlHoursFrom(args: {
|
|
38
|
+
ttlHours?: unknown;
|
|
39
|
+
ttlMinutes?: unknown;
|
|
40
|
+
durationMinutes?: unknown;
|
|
41
|
+
}): number;
|
|
42
|
+
export declare function refusal(tool: string, why: string): CallToolResult;
|
|
43
|
+
export interface CanonicalApplyDescriptor {
|
|
44
|
+
tool: string;
|
|
45
|
+
context: ToolContext;
|
|
46
|
+
apply: boolean;
|
|
47
|
+
hostAssetId?: unknown;
|
|
48
|
+
vmid?: unknown;
|
|
49
|
+
vmName?: unknown;
|
|
50
|
+
linearIssue?: unknown;
|
|
51
|
+
ttl: {
|
|
52
|
+
ttlHours?: unknown;
|
|
53
|
+
ttlMinutes?: unknown;
|
|
54
|
+
durationMinutes?: unknown;
|
|
55
|
+
};
|
|
56
|
+
/** Claim even without a canonical bridge (script-based tools such as proxmox_quick_provision). */
|
|
57
|
+
alwaysClaim?: boolean;
|
|
58
|
+
/** The guest already exists: a name alone is enough to claim it (claim_slot). */
|
|
59
|
+
allowNameOnly?: boolean;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Wraps a canonical guest-creating apply: the claim is created first, the
|
|
63
|
+
* operation runs, and the claim is removed again when it fails. Plans create
|
|
64
|
+
* nothing and pass straight through.
|
|
65
|
+
*/
|
|
66
|
+
export declare function claimFirstCanonicalApply(d: CanonicalApplyDescriptor, run: () => Promise<CallToolResult>, hooks?: ClaimFirstHooks | undefined): Promise<CallToolResult>;
|
|
67
|
+
/** Legacy (non-canonical) handlers know the guest NAME before they create it. Claim it by name. */
|
|
68
|
+
export declare function claimLegacyGuest(context: ToolContext, guest: {
|
|
69
|
+
hostId: unknown;
|
|
70
|
+
vmName: string;
|
|
71
|
+
vmid?: number;
|
|
72
|
+
ttlHours: number;
|
|
73
|
+
linearIssue?: string;
|
|
74
|
+
}): Promise<ClaimFirstRef | undefined>;
|
|
75
|
+
export declare const hostForClaimNode: (node: ClaimNode) => string;
|
|
76
|
+
//# sourceMappingURL=claim-first.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claim-first.d.ts","sourceRoot":"","sources":["../../../src/tools/claim-first.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,cAAc,EAA2C,MAAM,iBAAiB,CAAC;AAC1F,OAAO,EACL,SAAS,EAMV,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGnD,eAAO,MAAM,mBAAmB,2EAC0C,CAAC;AAE3E,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,iFAAiF;IACjF,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,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EAC3B,GAAG,EAAE,MAAM,OAAO,CAAC,cAAc,CAAC,EAClC,KAAK,GAAE,eAAe,GAAG,SAAgC,GACxD,OAAO,CAAC,cAAc,CAAC,CAuDzB;AAED,mGAAmG;AACnG,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAChG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAUpC;AAGD,eAAO,MAAM,gBAAgB,GAAI,MAAM,SAAS,KAAG,MAAyB,CAAC"}
|
|
@@ -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,4BA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EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAClH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAe,EAAU,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -37,19 +37,19 @@ export declare const RenewClaimInputSchema: z.ZodObject<{
|
|
|
37
37
|
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;
|
|
@@ -12,8 +12,10 @@
|
|
|
12
12
|
* 2. create a profile=bare ApplianceClaim naming node + VMID + VM name
|
|
13
13
|
* (no seed, no license, no bootstrap: the imported image stays exactly as
|
|
14
14
|
* published), with a finite TTL
|
|
15
|
-
* 3. run the canonical `lab-inventory vm
|
|
16
|
-
* leased, receipts) through
|
|
15
|
+
* 3. run the canonical `lab-inventory vm provision --source published-qcow`
|
|
16
|
+
* apply (digest-bound, leased, journaled, receipts) through
|
|
17
|
+
* proxmox_import_qcow; the guest then awaits credential enrollment
|
|
18
|
+
* (vm_repair, finalize, uat_access)
|
|
17
19
|
* 4. if the import fails, delete the claim again so nothing is left half-owned
|
|
18
20
|
*
|
|
19
21
|
* Dry-run (the default) runs the canonical import PLAN and previews the claim
|
|
@@ -47,6 +49,8 @@ export declare const ClaimedImportQcowInputObjectSchema: z.ZodObject<{
|
|
|
47
49
|
readonly confirmVmPrefix: z.ZodOptional<z.ZodString>;
|
|
48
50
|
readonly confirmVmid: z.ZodOptional<z.ZodNumber>;
|
|
49
51
|
readonly confirmImageSha256: z.ZodOptional<z.ZodString>;
|
|
52
|
+
readonly osVersion: z.ZodString;
|
|
53
|
+
readonly workspaceRoot: z.ZodOptional<z.ZodString>;
|
|
50
54
|
} & {
|
|
51
55
|
node: z.ZodEnum<["minis", "proxmox"]>;
|
|
52
56
|
claimName: z.ZodOptional<z.ZodString>;
|
|
@@ -54,6 +58,7 @@ export declare const ClaimedImportQcowInputObjectSchema: z.ZodObject<{
|
|
|
54
58
|
}, "strict", z.ZodTypeAny, {
|
|
55
59
|
node: "proxmox" | "minis";
|
|
56
60
|
linearIssue: string;
|
|
61
|
+
osVersion: string;
|
|
57
62
|
purpose: string;
|
|
58
63
|
assetId: string;
|
|
59
64
|
hostAssetId: string;
|
|
@@ -66,9 +71,11 @@ export declare const ClaimedImportQcowInputObjectSchema: z.ZodObject<{
|
|
|
66
71
|
memoryMb?: number | undefined;
|
|
67
72
|
vmid?: number | undefined;
|
|
68
73
|
network?: string | undefined;
|
|
74
|
+
ttlHours?: number | undefined;
|
|
75
|
+
claimName?: string | undefined;
|
|
69
76
|
diskGb?: number | undefined;
|
|
77
|
+
workspaceRoot?: string | undefined;
|
|
70
78
|
importStorage?: string | undefined;
|
|
71
|
-
ttlHours?: number | undefined;
|
|
72
79
|
confirmAssetId?: string | undefined;
|
|
73
80
|
confirmVmPrefix?: string | undefined;
|
|
74
81
|
confirmVmid?: number | undefined;
|
|
@@ -76,11 +83,11 @@ export declare const ClaimedImportQcowInputObjectSchema: z.ZodObject<{
|
|
|
76
83
|
vlanTag?: number | undefined;
|
|
77
84
|
vmPrefix?: string | undefined;
|
|
78
85
|
confirmImageSha256?: string | undefined;
|
|
79
|
-
claimName?: string | undefined;
|
|
80
86
|
claimTtlHours?: number | undefined;
|
|
81
87
|
}, {
|
|
82
88
|
node: "proxmox" | "minis";
|
|
83
89
|
linearIssue: string;
|
|
90
|
+
osVersion: string;
|
|
84
91
|
assetId: string;
|
|
85
92
|
hostAssetId: string;
|
|
86
93
|
operationId: string;
|
|
@@ -92,10 +99,12 @@ export declare const ClaimedImportQcowInputObjectSchema: z.ZodObject<{
|
|
|
92
99
|
vmid?: number | undefined;
|
|
93
100
|
network?: string | undefined;
|
|
94
101
|
purpose?: string | undefined;
|
|
102
|
+
ttlHours?: number | undefined;
|
|
103
|
+
claimName?: string | undefined;
|
|
95
104
|
diskGb?: number | undefined;
|
|
105
|
+
workspaceRoot?: string | undefined;
|
|
96
106
|
importStorage?: string | undefined;
|
|
97
107
|
apply?: boolean | undefined;
|
|
98
|
-
ttlHours?: number | undefined;
|
|
99
108
|
confirmAssetId?: string | undefined;
|
|
100
109
|
confirmVmPrefix?: string | undefined;
|
|
101
110
|
confirmVmid?: number | undefined;
|
|
@@ -103,7 +112,6 @@ export declare const ClaimedImportQcowInputObjectSchema: z.ZodObject<{
|
|
|
103
112
|
vlanTag?: number | undefined;
|
|
104
113
|
vmPrefix?: string | undefined;
|
|
105
114
|
confirmImageSha256?: string | undefined;
|
|
106
|
-
claimName?: string | undefined;
|
|
107
115
|
claimTtlHours?: number | undefined;
|
|
108
116
|
}>;
|
|
109
117
|
export type ClaimedImportQcowRawInput = z.input<typeof ClaimedImportQcowInputObjectSchema>;
|
|
@@ -113,5 +121,5 @@ export interface ClaimedImportDeps {
|
|
|
113
121
|
importQcow: (args: unknown, context: ToolContext) => Promise<CallToolResult>;
|
|
114
122
|
}
|
|
115
123
|
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
|
|
124
|
+
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 provision --source published-qcow apply (digest-bound, leased, journaled, receipted; the guest then awaits vm_repair, finalize and uat_access), 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
125
|
//# sourceMappingURL=claimed-import-qcow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claimed-import-qcow.d.ts","sourceRoot":"","sources":["../../../src/tools/claimed-import-qcow.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"claimed-import-qcow.d.ts","sourceRoot":"","sources":["../../../src/tools/claimed-import-qcow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAA2C,MAAM,iBAAiB,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAiB9C,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,CAqIzB;AAED,eAAO,MAAM,oCAAoC,yyBACuvB,CAAC"}
|
|
@@ -12,8 +12,10 @@
|
|
|
12
12
|
* 2. create a profile=bare ApplianceClaim naming node + VMID + VM name
|
|
13
13
|
* (no seed, no license, no bootstrap: the imported image stays exactly as
|
|
14
14
|
* published), with a finite TTL
|
|
15
|
-
* 3. run the canonical `lab-inventory vm
|
|
16
|
-
* leased, receipts) through
|
|
15
|
+
* 3. run the canonical `lab-inventory vm provision --source published-qcow`
|
|
16
|
+
* apply (digest-bound, leased, journaled, receipts) through
|
|
17
|
+
* proxmox_import_qcow; the guest then awaits credential enrollment
|
|
18
|
+
* (vm_repair, finalize, uat_access)
|
|
17
19
|
* 4. if the import fails, delete the claim again so nothing is left half-owned
|
|
18
20
|
*
|
|
19
21
|
* Dry-run (the default) runs the canonical import PLAN and previews the claim
|
|
@@ -24,7 +26,7 @@ import { z } from "zod";
|
|
|
24
26
|
import { ProxmoxErrorCode, createToolErrorResult } from "../types/mcp.js";
|
|
25
27
|
import { canonicalMode } from "./canonical-guard.js";
|
|
26
28
|
import { reservedIdentityError } from "./sha-channel.js";
|
|
27
|
-
import { ImportQcowInputObjectSchema, ImportQcowInputSchema, handleProxmoxImportQcow, } from "./import-qcow.js";
|
|
29
|
+
import { ImportQcowInputObjectSchema, ImportQcowInputSchema, handleProxmoxImportQcow, importQcowVersionFromUrl, } from "./import-qcow.js";
|
|
28
30
|
import { buildApplianceClaimManifest, handleCreateApplianceClaim, handleDeleteApplianceClaim, normalizeClaimNode, CreateApplianceClaimInputSchema, } from "./appliance-claim-tools.js";
|
|
29
31
|
export const ClaimedImportQcowInputObjectSchema = ImportQcowInputObjectSchema.extend({
|
|
30
32
|
node: z
|
|
@@ -94,6 +96,9 @@ export async function handleClaimedImportQcow(rawArgs, context, deps = defaultDe
|
|
|
94
96
|
vmid: imp.vmid,
|
|
95
97
|
vmName: imp.vmPrefix,
|
|
96
98
|
profile: "bare",
|
|
99
|
+
// The claim records the release the image carries (and its channel), not
|
|
100
|
+
// the generic default, so an rc candidate is not described as stable.
|
|
101
|
+
version: importQcowVersionFromUrl(imp.imageUrl),
|
|
97
102
|
ttlHours: claimTtlHours ?? imp.ttlHours ?? 24,
|
|
98
103
|
linearIssue: imp.linearIssue,
|
|
99
104
|
dryRun: !imp.apply,
|
|
@@ -167,5 +172,5 @@ export async function handleClaimedImportQcow(rawArgs, context, deps = defaultDe
|
|
|
167
172
|
],
|
|
168
173
|
};
|
|
169
174
|
}
|
|
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
|
|
175
|
+
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 provision --source published-qcow apply (digest-bound, leased, journaled, receipted; the guest then awaits vm_repair, finalize and uat_access), 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
176
|
//# sourceMappingURL=claimed-import-qcow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claimed-import-qcow.js","sourceRoot":"","sources":["../../../src/tools/claimed-import-qcow.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"claimed-import-qcow.js","sourceRoot":"","sources":["../../../src/tools/claimed-import-qcow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,C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CAAC,SAAS,EAAE,CACjE,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB;oBACE,OAAO,EAAE,IAAI;oBACb,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE;wBACL,IAAI,EAAE,KAAK,CAAC,SAAS;wBACrB,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,SAAS;wBAC5C,OAAO,EAAE,MAAM;wBACf,IAAI;wBACJ,IAAI,EAAE,GAAG,CAAC,IAAI;wBACd,MAAM,EAAE,GAAG,CAAC,QAAQ;wBACpB,QAAQ,EAAE,UAAU,CAAC,QAAQ;qBAC9B;oBACD,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC;oBACxB,SAAS,EACP,0KAA0K;iBAC7K,EACD,IAAI,EACJ,CAAC,CACF;aACF;SACF;KACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,oCAAoC,GAC/C,syBAAsyB,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;
|