@calltelemetry/ct-lab-mcp 0.8.78 → 0.8.79
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 +12 -0
- package/dist/src/tools/appliance-candidate-retire.d.ts +9 -9
- 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 +7 -0
- package/dist/src/tools/canonical-guard.js.map +1 -1
- package/dist/src/tools/claim-lifecycle.d.ts +4 -4
- package/dist/src/tools/claimed-import-qcow.d.ts +3 -3
- package/dist/src/tools/claimed-snapshot.d.ts +35 -0
- package/dist/src/tools/claimed-snapshot.d.ts.map +1 -0
- package/dist/src/tools/claimed-snapshot.js +101 -0
- package/dist/src/tools/claimed-snapshot.js.map +1 -0
- package/dist/src/tools/host-migrate-vm.d.ts +4 -4
- package/dist/src/tools/import-qcow.d.ts +9 -9
- package/dist/src/tools/index.js +4 -4
- package/dist/src/tools/index.js.map +1 -1
- package/dist/src/tools/lab-dev.d.ts +2 -2
- package/dist/src/tools/legacy-guest-guard.d.ts +1 -0
- package/dist/src/tools/legacy-guest-guard.d.ts.map +1 -1
- package/dist/src/tools/legacy-guest-guard.js +9 -0
- package/dist/src/tools/legacy-guest-guard.js.map +1 -1
- package/dist/src/tools/mission.d.ts +6 -6
- package/dist/src/tools/provision-tools.d.ts +12 -12
- package/dist/src/tools/purge-slots.d.ts +1 -1
- package/dist/src/tools/quick-provision.d.ts +1 -1
- package/dist/src/tools/sandbox-tools.d.ts +16 -16
- package/dist/src/tools/slot-tools.d.ts +12 -12
- package/dist/src/tools/storage-tools.d.ts +122 -2
- package/dist/src/tools/storage-tools.d.ts.map +1 -1
- package/dist/src/tools/storage-tools.js +11 -2
- package/dist/src/tools/storage-tools.js.map +1 -1
- package/dist/src/tools/uat-access.d.ts +2 -2
- package/dist/src/tools/vm-action.d.ts +14 -14
- package/dist/src/tools/vm-cleanup.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -409,6 +409,18 @@ Canonical mutation parameters are deliberately explicit:
|
|
|
409
409
|
Use separate unused plan/apply receipt paths. Failure records remain intact;
|
|
410
410
|
an expired guest is never renewed or reused, and verified absence precedes
|
|
411
411
|
ownership release. There is no force, host/IP selector or legacy fallback.
|
|
412
|
+
- `create_snapshot` and `rollback_snapshot` take a claim-scoped path when
|
|
413
|
+
`assetId` is supplied (UAT-1767), forwarding to `vm snapshot` / `vm rollback`.
|
|
414
|
+
They require `linearIssue`, `leaseId`, `operatorClaimUid`, `operationId` and
|
|
415
|
+
`snapshotName`, are plan-only until `apply: true`, and apply additionally
|
|
416
|
+
requires `confirmAssetId`, `confirmSmbiosUuid`, `confirmSnapshotName` and
|
|
417
|
+
`confirmPlanSha` copied from the plan. Snapshots are disk-only; rollback
|
|
418
|
+
accepts only the most recent snapshot this tooling created for the claim. The
|
|
419
|
+
canonical CLI independently refuses fixtures, unclaimed guests and foreign
|
|
420
|
+
claims. There is no VMID, name, host or RAM-state selector, no snapshot
|
|
421
|
+
deletion, and no legacy fallback: a request without `assetId` keeps the
|
|
422
|
+
legacy refusal. Requires a lab-inventory bundle that includes ct-meta
|
|
423
|
+
`067fa4cc` or later.
|
|
412
424
|
- `purge_slots` delegates only to `claims gc`; age, force, orphan, and VM-name
|
|
413
425
|
shortcuts are rejected.
|
|
414
426
|
|
|
@@ -22,14 +22,14 @@ export declare const ApplianceCandidateRetireInputObjectSchema: z.ZodObject<{
|
|
|
22
22
|
leaseId: string;
|
|
23
23
|
assetId: string;
|
|
24
24
|
operationId: string;
|
|
25
|
-
artifactReceipt: string;
|
|
26
25
|
apply: boolean;
|
|
26
|
+
artifactReceipt: string;
|
|
27
27
|
receiptFile: string;
|
|
28
28
|
candidateOperationId: string;
|
|
29
29
|
candidateReceipt: string;
|
|
30
30
|
confirmAssetId?: string | undefined;
|
|
31
|
-
confirmVmid?: number | undefined;
|
|
32
31
|
confirmSmbiosUuid?: string | undefined;
|
|
32
|
+
confirmVmid?: number | undefined;
|
|
33
33
|
}, {
|
|
34
34
|
linearIssue: string;
|
|
35
35
|
reason: string;
|
|
@@ -42,8 +42,8 @@ export declare const ApplianceCandidateRetireInputObjectSchema: z.ZodObject<{
|
|
|
42
42
|
candidateReceipt: string;
|
|
43
43
|
apply?: boolean | undefined;
|
|
44
44
|
confirmAssetId?: string | undefined;
|
|
45
|
-
confirmVmid?: number | undefined;
|
|
46
45
|
confirmSmbiosUuid?: string | undefined;
|
|
46
|
+
confirmVmid?: number | undefined;
|
|
47
47
|
}>;
|
|
48
48
|
declare const inputSchema: z.ZodEffects<z.ZodObject<{
|
|
49
49
|
assetId: z.ZodEffects<z.ZodString, string, string>;
|
|
@@ -65,14 +65,14 @@ declare const inputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
65
65
|
leaseId: string;
|
|
66
66
|
assetId: string;
|
|
67
67
|
operationId: string;
|
|
68
|
-
artifactReceipt: string;
|
|
69
68
|
apply: boolean;
|
|
69
|
+
artifactReceipt: string;
|
|
70
70
|
receiptFile: string;
|
|
71
71
|
candidateOperationId: string;
|
|
72
72
|
candidateReceipt: string;
|
|
73
73
|
confirmAssetId?: string | undefined;
|
|
74
|
-
confirmVmid?: number | undefined;
|
|
75
74
|
confirmSmbiosUuid?: string | undefined;
|
|
75
|
+
confirmVmid?: number | undefined;
|
|
76
76
|
}, {
|
|
77
77
|
linearIssue: string;
|
|
78
78
|
reason: string;
|
|
@@ -85,22 +85,22 @@ declare const inputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
85
85
|
candidateReceipt: string;
|
|
86
86
|
apply?: boolean | undefined;
|
|
87
87
|
confirmAssetId?: string | undefined;
|
|
88
|
-
confirmVmid?: number | undefined;
|
|
89
88
|
confirmSmbiosUuid?: string | undefined;
|
|
89
|
+
confirmVmid?: number | undefined;
|
|
90
90
|
}>, {
|
|
91
91
|
linearIssue: string;
|
|
92
92
|
reason: string;
|
|
93
93
|
leaseId: string;
|
|
94
94
|
assetId: string;
|
|
95
95
|
operationId: string;
|
|
96
|
-
artifactReceipt: string;
|
|
97
96
|
apply: boolean;
|
|
97
|
+
artifactReceipt: string;
|
|
98
98
|
receiptFile: string;
|
|
99
99
|
candidateOperationId: string;
|
|
100
100
|
candidateReceipt: string;
|
|
101
101
|
confirmAssetId?: string | undefined;
|
|
102
|
-
confirmVmid?: number | undefined;
|
|
103
102
|
confirmSmbiosUuid?: string | undefined;
|
|
103
|
+
confirmVmid?: number | undefined;
|
|
104
104
|
}, {
|
|
105
105
|
linearIssue: string;
|
|
106
106
|
reason: string;
|
|
@@ -113,8 +113,8 @@ declare const inputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
113
113
|
candidateReceipt: string;
|
|
114
114
|
apply?: boolean | undefined;
|
|
115
115
|
confirmAssetId?: string | undefined;
|
|
116
|
-
confirmVmid?: number | undefined;
|
|
117
116
|
confirmSmbiosUuid?: string | undefined;
|
|
117
|
+
confirmVmid?: number | undefined;
|
|
118
118
|
}>;
|
|
119
119
|
export type ApplianceCandidateRetireRawInput = z.input<typeof inputSchema>;
|
|
120
120
|
export declare function handleApplianceCandidateRetire(raw: ApplianceCandidateRetireRawInput | undefined, context: ToolContext): Promise<CallToolResult>;
|
|
@@ -13,7 +13,7 @@ export declare const CANONICAL_VM_CREDENTIAL_ACTIONS: readonly ["status", "shutd
|
|
|
13
13
|
* are not dispatcher operation IDs or an admission API. Actual calls use
|
|
14
14
|
* canonicalBridgeOwnsCredentials with the bare operation and its arguments.
|
|
15
15
|
*/
|
|
16
|
-
export declare const CANONICAL_CREDENTIAL_OPERATIONS: readonly ["lab_dev:doctor", "lab_dev:plan", "lab_dev:prepare", "lab_dev:status", "lab_dev:start", "lab_dev:sync", "lab_dev:stop", "lab_dev:cleanup", "list_hosts", "list_inventory", ...("vm_action:shutdown" | "vm_action:status")[], "vm_repair", "vm_renew", "vm_transfer", "release_slot", "list_expired_vms", "cleanup_expired_vms", "provision_vm", "auto_provision_vm", "proxmox_import_qcow", "claimed_import_qcow", "appliance_candidate_update", "purge_slots", "host_migrate_vm", "sandbox_clone", "sandbox_reset", "ferrum_fleet_metrics"];
|
|
16
|
+
export declare const CANONICAL_CREDENTIAL_OPERATIONS: readonly ["lab_dev:doctor", "lab_dev:plan", "lab_dev:prepare", "lab_dev:status", "lab_dev:start", "lab_dev:sync", "lab_dev:stop", "lab_dev:cleanup", "list_hosts", "list_inventory", ...("vm_action:shutdown" | "vm_action:status")[], "vm_repair", "vm_renew", "vm_transfer", "release_slot", "list_expired_vms", "cleanup_expired_vms", "provision_vm", "auto_provision_vm", "proxmox_import_qcow", "claimed_import_qcow", "appliance_candidate_update", "purge_slots", "host_migrate_vm", "sandbox_clone", "sandbox_reset", "ferrum_fleet_metrics", "create_snapshot", "rollback_snapshot"];
|
|
17
17
|
/**
|
|
18
18
|
* Operations that run on the canonical bridge whenever it is configured, even
|
|
19
19
|
* when the server is not in required (fail-closed) canonical mode. Both are
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonical-guard.d.ts","sourceRoot":"","sources":["../../../src/tools/canonical-guard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAkD,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"canonical-guard.d.ts","sourceRoot":"","sources":["../../../src/tools/canonical-guard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAkD,MAAM,iBAAiB,CAAC;AAGjG,wBAAgB,aAAa,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAE3D;AAED,kFAAkF;AAClF,eAAO,MAAM,+BAA+B,iC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AE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,EACD,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,uBAAuB,CAAC,EAAE,OAAO,CAAA;CAAE,GAC1E,MAAM,EAAE,CAgCV;AAED;;;GAGG;AACH,wBAAgB,mCAAmC,CACjD,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EAAE,GAChB,MAAM,CAOR;AAQD;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,OAAO,GACb,OAAO,CAqET;AAED,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,CAMzF;AAUD,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,kBAAkB,GAAG,SAAS,EACtC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EAAE,EACd,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,cAAc,CAAC,CAuCzB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createToolErrorResult, createToolSuccessResult } from "../types/mcp.js";
|
|
2
|
+
import { isClaimedSnapshotCall } from "./claimed-snapshot.js";
|
|
2
3
|
export function canonicalMode(context) {
|
|
3
4
|
return context.canonicalBridge?.isRequired === true;
|
|
4
5
|
}
|
|
@@ -44,6 +45,10 @@ export const CANONICAL_CREDENTIAL_OPERATIONS = [
|
|
|
44
45
|
"sandbox_clone",
|
|
45
46
|
"sandbox_reset",
|
|
46
47
|
"ferrum_fleet_metrics",
|
|
48
|
+
// Claim-scoped snapshots (UAT-1767): the canonical CLI owns the exact claim,
|
|
49
|
+
// lease and provider credential checks; selected only by an explicit assetId.
|
|
50
|
+
"create_snapshot",
|
|
51
|
+
"rollback_snapshot",
|
|
47
52
|
];
|
|
48
53
|
/**
|
|
49
54
|
* Operations that run on the canonical bridge whenever it is configured, even
|
|
@@ -207,6 +212,8 @@ export function canonicalBridgeOwnsCredentials(context, operation, args) {
|
|
|
207
212
|
}
|
|
208
213
|
if (operation === "vm_repair")
|
|
209
214
|
return true;
|
|
215
|
+
if (operation === "create_snapshot" || operation === "rollback_snapshot")
|
|
216
|
+
return isClaimedSnapshotCall(args);
|
|
210
217
|
if (operation === "lab_dev") {
|
|
211
218
|
const action = toolAction(args);
|
|
212
219
|
return action === "doctor" || action === "plan" || action === "prepare" || action === "status"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonical-guard.js","sourceRoot":"","sources":["../../../src/tools/canonical-guard.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"canonical-guard.js","sourceRoot":"","sources":["../../../src/tools/canonical-guard.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AACjG,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,MAAM,UAAU,aAAa,CAAC,OAAoB;IAChD,OAAO,OAAO,CAAC,eAAe,EAAE,UAAU,KAAK,IAAI,CAAC;AACtD,CAAC;AAED,kFAAkF;AAClF,MAAM,CAAC,MAAM,+BAA+B,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,UAAU,CAAU,CAAC,CAAC;AAE9F;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,gBAAgB;IAChB,cAAc;IACd,iBAAiB;IACjB,gBAAgB;IAChB,eAAe;IACf,cAAc;IACd,cAAc;IACd,iBAAiB;IACjB,YAAY;IACZ,gBAAgB;IAChB,GAAG,+BAA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,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACnD,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACxC,CAAC;QACF,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,qBAAqB,CAC1B,4BAA4B,EAC5B,MAAM,CAAC,MAAM;mBACR,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,iCAAiC,CAAC,CAAC,CAAC,EAAE,CAAC;mBAC/D,MAAM,CAAC,MAAM;mBACb,GAAG,SAAS,8BAA8B,EAC/C,OAAO,CACR,CAAC;QACJ,CAAC;QACD,OAAO,uBAAuB,CAAC,MAAM,CAAC,MAAM,IAAI,GAAG,SAAS,iCAAiC,EAAE,OAAO,CAAC,CAAC;IAC1G,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,OAAO,qBAAqB,CAC1B,iCAAiC,EACjC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EACtD,EAAE,SAAS,EAAE,CACd,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -40,8 +40,8 @@ export declare const RenewClaimInputSchema: z.ZodObject<{
|
|
|
40
40
|
ttlHours?: number | undefined;
|
|
41
41
|
assetId?: string | undefined;
|
|
42
42
|
operationId?: string | undefined;
|
|
43
|
-
receiptFile?: string | undefined;
|
|
44
43
|
confirmAssetId?: string | undefined;
|
|
44
|
+
receiptFile?: string | undefined;
|
|
45
45
|
}, {
|
|
46
46
|
linearIssue?: string | undefined;
|
|
47
47
|
leaseId?: string | undefined;
|
|
@@ -49,8 +49,8 @@ export declare const RenewClaimInputSchema: z.ZodObject<{
|
|
|
49
49
|
assetId?: string | undefined;
|
|
50
50
|
operationId?: string | undefined;
|
|
51
51
|
apply?: boolean | undefined;
|
|
52
|
-
receiptFile?: string | undefined;
|
|
53
52
|
confirmAssetId?: string | undefined;
|
|
53
|
+
receiptFile?: string | undefined;
|
|
54
54
|
replaceClosedClaim?: boolean | undefined;
|
|
55
55
|
allowRunning?: boolean | undefined;
|
|
56
56
|
}>;
|
|
@@ -86,8 +86,8 @@ export declare const TransferClaimInputSchema: z.ZodObject<{
|
|
|
86
86
|
ttlHours?: number | undefined;
|
|
87
87
|
assetId?: string | undefined;
|
|
88
88
|
operationId?: string | undefined;
|
|
89
|
-
receiptFile?: string | undefined;
|
|
90
89
|
confirmAssetId?: string | undefined;
|
|
90
|
+
receiptFile?: string | undefined;
|
|
91
91
|
toLinearIssue?: string | undefined;
|
|
92
92
|
}, {
|
|
93
93
|
linearIssue?: string | undefined;
|
|
@@ -96,8 +96,8 @@ export declare const TransferClaimInputSchema: z.ZodObject<{
|
|
|
96
96
|
assetId?: string | undefined;
|
|
97
97
|
operationId?: string | undefined;
|
|
98
98
|
apply?: boolean | undefined;
|
|
99
|
-
receiptFile?: string | undefined;
|
|
100
99
|
confirmAssetId?: string | undefined;
|
|
100
|
+
receiptFile?: string | undefined;
|
|
101
101
|
toLinearIssue?: string | undefined;
|
|
102
102
|
recoverExpiredRunning?: boolean | undefined;
|
|
103
103
|
}>;
|
|
@@ -75,9 +75,9 @@ export declare const ClaimedImportQcowInputObjectSchema: z.ZodObject<{
|
|
|
75
75
|
diskGb?: number | undefined;
|
|
76
76
|
ttlHours?: number | undefined;
|
|
77
77
|
claimName?: string | undefined;
|
|
78
|
+
confirmAssetId?: string | undefined;
|
|
78
79
|
workspaceRoot?: string | undefined;
|
|
79
80
|
importStorage?: string | undefined;
|
|
80
|
-
confirmAssetId?: string | undefined;
|
|
81
81
|
confirmVmPrefix?: string | undefined;
|
|
82
82
|
confirmVmid?: number | undefined;
|
|
83
83
|
vcpus?: number | undefined;
|
|
@@ -103,10 +103,10 @@ export declare const ClaimedImportQcowInputObjectSchema: z.ZodObject<{
|
|
|
103
103
|
purpose?: string | undefined;
|
|
104
104
|
ttlHours?: number | undefined;
|
|
105
105
|
claimName?: string | undefined;
|
|
106
|
-
workspaceRoot?: string | undefined;
|
|
107
|
-
importStorage?: string | undefined;
|
|
108
106
|
apply?: boolean | undefined;
|
|
109
107
|
confirmAssetId?: string | undefined;
|
|
108
|
+
workspaceRoot?: string | undefined;
|
|
109
|
+
importStorage?: string | undefined;
|
|
110
110
|
confirmVmPrefix?: string | undefined;
|
|
111
111
|
confirmVmid?: number | undefined;
|
|
112
112
|
vcpus?: number | undefined;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claim-scoped disk-only snapshot / rollback facade (UAT-1767).
|
|
3
|
+
*
|
|
4
|
+
* Thin by design: `lab-inventory vm snapshot|rollback` (UAT-1759) owns every
|
|
5
|
+
* authority decision (live Ready bare ApplianceClaim, canonical lease owned by
|
|
6
|
+
* the caller's Linear issue, protected/fixture refusal, marker, latest-only
|
|
7
|
+
* rollback, no snapshot deletion). This module only validates the closed
|
|
8
|
+
* input shape, refuses anything that is not an exact claimed-guest request,
|
|
9
|
+
* and forwards a fixed argument vector through the canonical bridge. There is
|
|
10
|
+
* no hypervisor, host, VMID, name or RAM-state selector, and no legacy
|
|
11
|
+
* fallback: an unclaimed request never reaches a provider.
|
|
12
|
+
*/
|
|
13
|
+
import { z } from "zod";
|
|
14
|
+
import { type CallToolResult } from "../types/mcp.js";
|
|
15
|
+
import type { ToolContext } from "./list-hosts.js";
|
|
16
|
+
export type ClaimedSnapshotAction = "snapshot" | "rollback";
|
|
17
|
+
/** Proxmox-compatible: 2-40 letters/digits/hyphen, a letter first; `current` is reserved. */
|
|
18
|
+
export declare const SNAPSHOT_NAME_PATTERN: RegExp;
|
|
19
|
+
/** Claim-scoped fields shared by create_snapshot and rollback_snapshot. */
|
|
20
|
+
export declare const ClaimedSnapshotInputShape: {
|
|
21
|
+
assetId: z.ZodOptional<z.ZodString>;
|
|
22
|
+
linearIssue: z.ZodOptional<z.ZodString>;
|
|
23
|
+
leaseId: z.ZodOptional<z.ZodString>;
|
|
24
|
+
operatorClaimUid: z.ZodOptional<z.ZodString>;
|
|
25
|
+
operationId: z.ZodOptional<z.ZodString>;
|
|
26
|
+
apply: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
27
|
+
confirmAssetId: z.ZodOptional<z.ZodString>;
|
|
28
|
+
confirmSmbiosUuid: z.ZodOptional<z.ZodString>;
|
|
29
|
+
confirmSnapshotName: z.ZodOptional<z.ZodString>;
|
|
30
|
+
confirmPlanSha: z.ZodOptional<z.ZodString>;
|
|
31
|
+
};
|
|
32
|
+
/** True when the call selects the claim-scoped canonical path. */
|
|
33
|
+
export declare function isClaimedSnapshotCall(args: unknown): boolean;
|
|
34
|
+
export declare function handleClaimedSnapshot(action: ClaimedSnapshotAction, raw: unknown, context: ToolContext): Promise<CallToolResult>;
|
|
35
|
+
//# sourceMappingURL=claimed-snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claimed-snapshot.d.ts","sourceRoot":"","sources":["../../../src/tools/claimed-snapshot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGnD,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,UAAU,CAAC;AAM5D,6FAA6F;AAC7F,eAAO,MAAM,qBAAqB,QAAiC,CAAC;AAKpE,2EAA2E;AAC3E,eAAO,MAAM,yBAAyB;;;;;;;;;;;CAarC,CAAC;AAoCF,kEAAkE;AAClE,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAG5D;AAED,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,qBAAqB,EAC7B,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,cAAc,CAAC,CAwBzB"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claim-scoped disk-only snapshot / rollback facade (UAT-1767).
|
|
3
|
+
*
|
|
4
|
+
* Thin by design: `lab-inventory vm snapshot|rollback` (UAT-1759) owns every
|
|
5
|
+
* authority decision (live Ready bare ApplianceClaim, canonical lease owned by
|
|
6
|
+
* the caller's Linear issue, protected/fixture refusal, marker, latest-only
|
|
7
|
+
* rollback, no snapshot deletion). This module only validates the closed
|
|
8
|
+
* input shape, refuses anything that is not an exact claimed-guest request,
|
|
9
|
+
* and forwards a fixed argument vector through the canonical bridge. There is
|
|
10
|
+
* no hypervisor, host, VMID, name or RAM-state selector, and no legacy
|
|
11
|
+
* fallback: an unclaimed request never reaches a provider.
|
|
12
|
+
*/
|
|
13
|
+
import { z } from "zod";
|
|
14
|
+
import { createToolErrorResult } from "../types/mcp.js";
|
|
15
|
+
import { canonicalMode, runCanonicalOperation } from "./canonical-guard.js";
|
|
16
|
+
const reference = z.string().trim().min(1).max(256)
|
|
17
|
+
.refine((value) => !value.startsWith("--") && !/[\x00-\x1f\x7f]/.test(value), "must be printable text, not a command-line option");
|
|
18
|
+
/** Proxmox-compatible: 2-40 letters/digits/hyphen, a letter first; `current` is reserved. */
|
|
19
|
+
export const SNAPSHOT_NAME_PATTERN = /^[A-Za-z][A-Za-z0-9-]{1,39}$/;
|
|
20
|
+
const snapshotName = z.string().regex(SNAPSHOT_NAME_PATTERN, "2-40 characters: a letter first, then letters, digits or hyphen")
|
|
21
|
+
.refine((value) => value.toLowerCase() !== "current", "'current' is reserved");
|
|
22
|
+
/** Claim-scoped fields shared by create_snapshot and rollback_snapshot. */
|
|
23
|
+
export const ClaimedSnapshotInputShape = {
|
|
24
|
+
assetId: z.string().optional()
|
|
25
|
+
.describe("Claimed runtime slot asset ID. Presence selects the claim-scoped canonical path; there is no VMID, name or host selector."),
|
|
26
|
+
linearIssue: z.string().optional().describe("The caller's Linear issue that owns the claim (e.g. UAT-1759)."),
|
|
27
|
+
leaseId: z.string().optional().describe("Exact canonical lease ID."),
|
|
28
|
+
operatorClaimUid: z.string().optional().describe("UID of the live Ready bare ApplianceClaim."),
|
|
29
|
+
operationId: z.string().optional().describe("Unique idempotency key, 8-128 characters."),
|
|
30
|
+
apply: z.boolean().optional().default(false)
|
|
31
|
+
.describe("Plan only unless true. Apply needs every confirm* field from the plan output."),
|
|
32
|
+
confirmAssetId: z.string().optional(),
|
|
33
|
+
confirmSmbiosUuid: z.string().optional(),
|
|
34
|
+
confirmSnapshotName: z.string().optional(),
|
|
35
|
+
confirmPlanSha: z.string().optional(),
|
|
36
|
+
};
|
|
37
|
+
const claimedInputSchema = z.object({
|
|
38
|
+
assetId: reference,
|
|
39
|
+
linearIssue: z.string().regex(/^[A-Z][A-Z0-9]*-[1-9][0-9]*$/),
|
|
40
|
+
leaseId: reference,
|
|
41
|
+
operatorClaimUid: z.string().uuid(),
|
|
42
|
+
operationId: z.string().regex(/^[A-Za-z0-9._:-]{8,128}$/),
|
|
43
|
+
snapshotName,
|
|
44
|
+
apply: z.boolean().default(false),
|
|
45
|
+
confirmAssetId: reference.optional(),
|
|
46
|
+
confirmSmbiosUuid: z.string().uuid().optional(),
|
|
47
|
+
confirmSnapshotName: z.string().optional(),
|
|
48
|
+
confirmPlanSha: z.string().regex(/^[a-f0-9]{64}$/).optional(),
|
|
49
|
+
// Legacy selectors are accepted only so they can be refused explicitly.
|
|
50
|
+
target: z.unknown().optional(),
|
|
51
|
+
vmIdOrName: z.unknown().optional(),
|
|
52
|
+
description: z.unknown().optional(),
|
|
53
|
+
includeRam: z.boolean().optional().default(false),
|
|
54
|
+
host: z.string().optional().default("auto"),
|
|
55
|
+
}).strict().superRefine((value, ctx) => {
|
|
56
|
+
const refuse = (path, message) => ctx.addIssue({ code: z.ZodIssueCode.custom, path: [path], message });
|
|
57
|
+
for (const key of ["target", "vmIdOrName", "description"]) {
|
|
58
|
+
if (value[key] !== undefined)
|
|
59
|
+
refuse(key, "not accepted with assetId: the claim names the guest");
|
|
60
|
+
}
|
|
61
|
+
if (value.includeRam)
|
|
62
|
+
refuse("includeRam", "claimed snapshots are disk-only");
|
|
63
|
+
if (value.host !== "auto")
|
|
64
|
+
refuse("host", "not accepted with assetId: the claim names the host");
|
|
65
|
+
if (!value.apply)
|
|
66
|
+
return;
|
|
67
|
+
if (value.confirmAssetId !== value.assetId)
|
|
68
|
+
refuse("confirmAssetId", "must match assetId on apply");
|
|
69
|
+
if (value.confirmSnapshotName !== value.snapshotName)
|
|
70
|
+
refuse("confirmSnapshotName", "must match snapshotName on apply");
|
|
71
|
+
for (const key of ["confirmSmbiosUuid", "confirmPlanSha"]) {
|
|
72
|
+
if (value[key] === undefined)
|
|
73
|
+
refuse(key, "required on apply (copy it from the plan output)");
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
/** True when the call selects the claim-scoped canonical path. */
|
|
77
|
+
export function isClaimedSnapshotCall(args) {
|
|
78
|
+
const assetId = args?.assetId;
|
|
79
|
+
return typeof assetId === "string" && assetId.trim().length > 0;
|
|
80
|
+
}
|
|
81
|
+
export async function handleClaimedSnapshot(action, raw, context) {
|
|
82
|
+
const tool = action === "snapshot" ? "create_snapshot" : "rollback_snapshot";
|
|
83
|
+
const parsed = claimedInputSchema.safeParse(raw ?? {});
|
|
84
|
+
if (!parsed.success)
|
|
85
|
+
return createToolErrorResult("VALIDATION_ERROR", parsed.error.errors.map((e) => `${e.path.join(".") || "input"}: ${e.message}`).join("; "));
|
|
86
|
+
if (!canonicalMode(context))
|
|
87
|
+
return createToolErrorResult("CANONICAL_OPERATION_REQUIRES_BRIDGE", `${tool} for a claimed guest requires the canonical lab-inventory bridge; no legacy fallback is allowed.`, { operation: tool });
|
|
88
|
+
const value = parsed.data;
|
|
89
|
+
const args = ["vm", action,
|
|
90
|
+
"--asset-id", value.assetId, "--linear-issue", value.linearIssue,
|
|
91
|
+
"--lease-id", value.leaseId, "--operator-claim-uid", value.operatorClaimUid,
|
|
92
|
+
"--operation-id", value.operationId, "--snapshot-name", value.snapshotName];
|
|
93
|
+
if (value.apply) {
|
|
94
|
+
// Snapshot of a large disk can outlast the CLI's default transport window.
|
|
95
|
+
args.push("--transport-timeout-seconds", "600", "--apply", "--confirm-asset-id", value.confirmAssetId, "--confirm-smbios-uuid", value.confirmSmbiosUuid, "--confirm-snapshot-name", value.confirmSnapshotName, "--confirm-plan-sha", value.confirmPlanSha);
|
|
96
|
+
}
|
|
97
|
+
// The CLI owns bounded Proxmox task waits, locks and journaling; the outer
|
|
98
|
+
// deadline must outlive them (transport 600s + coordinator/lock slack).
|
|
99
|
+
return runCanonicalOperation(context.canonicalBridge, tool, args, value.apply ? 900_000 : 120_000);
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=claimed-snapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claimed-snapshot.js","sourceRoot":"","sources":["../../../src/tools/claimed-snapshot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAuB,MAAM,iBAAiB,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAI5E,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;KAChD,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,EAC1E,mDAAmD,CAAC,CAAC;AAEzD,6FAA6F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,cAAe,CAAC,CAAC;IACxG,CAAC;IACD,2EAA2E;IAC3E,wEAAwE;IACxE,OAAO,qBAAqB,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AACrG,CAAC"}
|
|
@@ -40,8 +40,8 @@ export declare const HostMigrateVmInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
40
40
|
targetHost: "proxmox-lab" | "proxmox-mini" | "proxmox-minis-lab" | "proxmox-ibm64";
|
|
41
41
|
lockTimeoutSeconds: number;
|
|
42
42
|
targetStorage: string;
|
|
43
|
-
receiptFile?: string | undefined;
|
|
44
43
|
confirmAssetId?: string | undefined;
|
|
44
|
+
receiptFile?: string | undefined;
|
|
45
45
|
planDigest?: string | undefined;
|
|
46
46
|
confirmTargetHost?: "proxmox-lab" | "proxmox-mini" | "proxmox-minis-lab" | "proxmox-ibm64" | undefined;
|
|
47
47
|
targetBridge?: string | undefined;
|
|
@@ -51,8 +51,8 @@ export declare const HostMigrateVmInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
51
51
|
operationId: string;
|
|
52
52
|
targetHost: "proxmox-lab" | "proxmox-mini" | "proxmox-minis-lab" | "proxmox-ibm64";
|
|
53
53
|
apply?: boolean | undefined;
|
|
54
|
-
receiptFile?: string | undefined;
|
|
55
54
|
confirmAssetId?: string | undefined;
|
|
55
|
+
receiptFile?: string | undefined;
|
|
56
56
|
lockTimeoutSeconds?: number | undefined;
|
|
57
57
|
planDigest?: string | undefined;
|
|
58
58
|
confirmTargetHost?: "proxmox-lab" | "proxmox-mini" | "proxmox-minis-lab" | "proxmox-ibm64" | undefined;
|
|
@@ -66,8 +66,8 @@ export declare const HostMigrateVmInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
66
66
|
targetHost: "proxmox-lab" | "proxmox-mini" | "proxmox-minis-lab" | "proxmox-ibm64";
|
|
67
67
|
lockTimeoutSeconds: number;
|
|
68
68
|
targetStorage: string;
|
|
69
|
-
receiptFile?: string | undefined;
|
|
70
69
|
confirmAssetId?: string | undefined;
|
|
70
|
+
receiptFile?: string | undefined;
|
|
71
71
|
planDigest?: string | undefined;
|
|
72
72
|
confirmTargetHost?: "proxmox-lab" | "proxmox-mini" | "proxmox-minis-lab" | "proxmox-ibm64" | undefined;
|
|
73
73
|
targetBridge?: string | undefined;
|
|
@@ -77,8 +77,8 @@ export declare const HostMigrateVmInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
77
77
|
operationId: string;
|
|
78
78
|
targetHost: "proxmox-lab" | "proxmox-mini" | "proxmox-minis-lab" | "proxmox-ibm64";
|
|
79
79
|
apply?: boolean | undefined;
|
|
80
|
-
receiptFile?: string | undefined;
|
|
81
80
|
confirmAssetId?: string | undefined;
|
|
81
|
+
receiptFile?: string | undefined;
|
|
82
82
|
lockTimeoutSeconds?: number | undefined;
|
|
83
83
|
planDigest?: string | undefined;
|
|
84
84
|
confirmTargetHost?: "proxmox-lab" | "proxmox-mini" | "proxmox-minis-lab" | "proxmox-ibm64" | undefined;
|
|
@@ -116,9 +116,9 @@ export declare const ImportQcowInputObjectSchema: z.ZodObject<{
|
|
|
116
116
|
network?: string | undefined;
|
|
117
117
|
diskGb?: number | undefined;
|
|
118
118
|
ttlHours?: number | undefined;
|
|
119
|
+
confirmAssetId?: string | undefined;
|
|
119
120
|
workspaceRoot?: string | undefined;
|
|
120
121
|
importStorage?: string | undefined;
|
|
121
|
-
confirmAssetId?: string | undefined;
|
|
122
122
|
confirmVmPrefix?: string | undefined;
|
|
123
123
|
confirmVmid?: number | undefined;
|
|
124
124
|
vcpus?: number | undefined;
|
|
@@ -141,10 +141,10 @@ export declare const ImportQcowInputObjectSchema: z.ZodObject<{
|
|
|
141
141
|
diskGb?: number | undefined;
|
|
142
142
|
purpose?: string | undefined;
|
|
143
143
|
ttlHours?: number | undefined;
|
|
144
|
-
workspaceRoot?: string | undefined;
|
|
145
|
-
importStorage?: string | undefined;
|
|
146
144
|
apply?: boolean | undefined;
|
|
147
145
|
confirmAssetId?: string | undefined;
|
|
146
|
+
workspaceRoot?: string | undefined;
|
|
147
|
+
importStorage?: string | undefined;
|
|
148
148
|
confirmVmPrefix?: string | undefined;
|
|
149
149
|
confirmVmid?: number | undefined;
|
|
150
150
|
vcpus?: number | undefined;
|
|
@@ -195,9 +195,9 @@ export declare const ImportQcowInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
195
195
|
network?: string | undefined;
|
|
196
196
|
diskGb?: number | undefined;
|
|
197
197
|
ttlHours?: number | undefined;
|
|
198
|
+
confirmAssetId?: string | undefined;
|
|
198
199
|
workspaceRoot?: string | undefined;
|
|
199
200
|
importStorage?: string | undefined;
|
|
200
|
-
confirmAssetId?: string | undefined;
|
|
201
201
|
confirmVmPrefix?: string | undefined;
|
|
202
202
|
confirmVmid?: number | undefined;
|
|
203
203
|
vcpus?: number | undefined;
|
|
@@ -220,10 +220,10 @@ export declare const ImportQcowInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
220
220
|
diskGb?: number | undefined;
|
|
221
221
|
purpose?: string | undefined;
|
|
222
222
|
ttlHours?: number | undefined;
|
|
223
|
-
workspaceRoot?: string | undefined;
|
|
224
|
-
importStorage?: string | undefined;
|
|
225
223
|
apply?: boolean | undefined;
|
|
226
224
|
confirmAssetId?: string | undefined;
|
|
225
|
+
workspaceRoot?: string | undefined;
|
|
226
|
+
importStorage?: string | undefined;
|
|
227
227
|
confirmVmPrefix?: string | undefined;
|
|
228
228
|
confirmVmid?: number | undefined;
|
|
229
229
|
vcpus?: number | undefined;
|
|
@@ -247,9 +247,9 @@ export declare const ImportQcowInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
247
247
|
network?: string | undefined;
|
|
248
248
|
diskGb?: number | undefined;
|
|
249
249
|
ttlHours?: number | undefined;
|
|
250
|
+
confirmAssetId?: string | undefined;
|
|
250
251
|
workspaceRoot?: string | undefined;
|
|
251
252
|
importStorage?: string | undefined;
|
|
252
|
-
confirmAssetId?: string | undefined;
|
|
253
253
|
confirmVmPrefix?: string | undefined;
|
|
254
254
|
confirmVmid?: number | undefined;
|
|
255
255
|
vcpus?: number | undefined;
|
|
@@ -272,10 +272,10 @@ export declare const ImportQcowInputSchema: z.ZodEffects<z.ZodObject<{
|
|
|
272
272
|
diskGb?: number | undefined;
|
|
273
273
|
purpose?: string | undefined;
|
|
274
274
|
ttlHours?: number | undefined;
|
|
275
|
-
workspaceRoot?: string | undefined;
|
|
276
|
-
importStorage?: string | undefined;
|
|
277
275
|
apply?: boolean | undefined;
|
|
278
276
|
confirmAssetId?: string | undefined;
|
|
277
|
+
workspaceRoot?: string | undefined;
|
|
278
|
+
importStorage?: string | undefined;
|
|
279
279
|
confirmVmPrefix?: string | undefined;
|
|
280
280
|
confirmVmid?: number | undefined;
|
|
281
281
|
vcpus?: number | undefined;
|
package/dist/src/tools/index.js
CHANGED
|
@@ -56,7 +56,7 @@ import { SandboxCloneInputShape, handleSandboxClone, SandboxResetInputShape, han
|
|
|
56
56
|
import { FerrumFleetMetricsInputShape, handleFerrumFleetMetrics, } from "./fleet-metrics.js";
|
|
57
57
|
import { ListApplianceClaimsInputShape, handleListApplianceClaims, GetApplianceClaimInputShape, handleGetApplianceClaim, CreateApplianceClaimInputShape, handleCreateApplianceClaim, DeleteApplianceClaimInputShape, handleDeleteApplianceClaim, PauseApplianceClaimInputShape, handlePauseApplianceClaim, RenewApplianceClaimInputShape, handleRenewApplianceClaim, independentClaimVerb, verifyIndependentClaimAccess, } from "./appliance-claim-tools.js";
|
|
58
58
|
import { claimFirstCanonicalApply, hostForClaimNode } from "./claim-first.js";
|
|
59
|
-
import { legacyGuestHandlerBlocked, LEGACY_GUEST_AUTHORITY_ERROR } from "./legacy-guest-guard.js";
|
|
59
|
+
import { isClaimedSnapshotToolCall, legacyGuestHandlerBlocked, LEGACY_GUEST_AUTHORITY_ERROR } from "./legacy-guest-guard.js";
|
|
60
60
|
import { ClaimedImportQcowInputObjectSchema, CLAIMED_IMPORT_QCOW_TOOL_DESCRIPTION, handleClaimedImportQcow, } from "./claimed-import-qcow.js";
|
|
61
61
|
import { SideloadApplianceRunnerInputShape, handleSideloadApplianceRunner, } from "./sideload-runner.js";
|
|
62
62
|
import { GetApplianceIdInputShape, handleGetApplianceId, } from "./appliance-id.js";
|
|
@@ -193,7 +193,7 @@ export function registerAllTools(mcpServer, context) {
|
|
|
193
193
|
else if (legacyGuestHandlerBlocked(name, toolArgs, canonicalMode(context))) {
|
|
194
194
|
result = createToolErrorResult(LEGACY_GUEST_AUTHORITY_ERROR, "This legacy SDK guest effect has no claimed canonical physical-slot authority and is unavailable. Use only an implemented typed canonical lifecycle operation; caller flags cannot enable this handler.", { operation: name });
|
|
195
195
|
}
|
|
196
|
-
else if (canonicalMode(context) && canonicalDirectTools.has(name)) {
|
|
196
|
+
else if (canonicalMode(context) && canonicalDirectTools.has(name) && !isClaimedSnapshotToolCall(name, toolArgs)) {
|
|
197
197
|
result = canonicalOperationBlocked(name, "this legacy handler is not an identity-bound canonical operation; use the canonical lab workflow");
|
|
198
198
|
}
|
|
199
199
|
else {
|
|
@@ -407,11 +407,11 @@ export function registerAllTools(mcpServer, context) {
|
|
|
407
407
|
return handleUnmountIso(args, context);
|
|
408
408
|
});
|
|
409
409
|
// 17. create_snapshot
|
|
410
|
-
server.tool("create_snapshot", "Create a new snapshot of a target VM with optional RAM state and description.", CreateSnapshotInputShape, async (args) => {
|
|
410
|
+
server.tool("create_snapshot", "Create a new snapshot of a target VM with optional RAM state and description. For a claimed bare guest pass assetId, linearIssue, leaseId, operatorClaimUid, operationId and snapshotName instead: this routes to canonical lab-inventory vm snapshot (disk-only, plan by default; apply needs the confirm* fields from the plan).", CreateSnapshotInputShape, async (args) => {
|
|
411
411
|
return handleCreateSnapshot(args, context);
|
|
412
412
|
});
|
|
413
413
|
// 18. rollback_snapshot
|
|
414
|
-
server.tool("rollback_snapshot", "Revert / rollback a target VM to a specified snapshot with safety validation protecting core infrastructure.", RollbackSnapshotInputShape, async (args) => {
|
|
414
|
+
server.tool("rollback_snapshot", "Revert / rollback a target VM to a specified snapshot with safety validation protecting core infrastructure. For a claimed bare guest pass assetId, linearIssue, leaseId, operatorClaimUid, operationId and snapshotName instead: this routes to canonical lab-inventory vm rollback (latest snapshot made by this tooling for the claim only; plan by default).", RollbackSnapshotInputShape, async (args) => {
|
|
415
415
|
return handleRollbackSnapshot(args, context);
|
|
416
416
|
});
|
|
417
417
|
// 19. update_appliance_cli
|