@lamalibre/install-portlama-e2e-mcp 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/lib/multipass.js +2 -8
- package/src/tools/vm.js +4 -10
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lamalibre/install-portlama-e2e-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "MCP server for Portlama E2E test infrastructure — VM lifecycle, snapshots, test execution",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
7
7
|
"author": "Code Lama Software",
|
|
8
8
|
"main": "src/index.js",
|
|
9
9
|
"bin": {
|
|
10
|
-
"install-portlama-e2e-mcp": "
|
|
10
|
+
"install-portlama-e2e-mcp": "bin/install-portlama-e2e-mcp.js"
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
13
|
"bin",
|
package/src/lib/multipass.js
CHANGED
|
@@ -42,15 +42,9 @@ export async function launch(name, { cpus, memory, disk }) {
|
|
|
42
42
|
]);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
/** Delete a VM and purge
|
|
45
|
+
/** Delete a VM and purge only that VM (not other users' deleted VMs). */
|
|
46
46
|
export async function deleteVm(name) {
|
|
47
|
-
await run(['delete', name], { allowFailure: true });
|
|
48
|
-
await run(['purge'], { allowFailure: true });
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/** Delete a VM without purging (caller handles purge). */
|
|
52
|
-
export async function deleteVmNoPurge(name) {
|
|
53
|
-
await run(['delete', name], { allowFailure: true });
|
|
47
|
+
await run(['delete', '--purge', name], { allowFailure: true });
|
|
54
48
|
}
|
|
55
49
|
|
|
56
50
|
/** Get info for a VM as JSON. Returns null if VM doesn't exist. */
|
package/src/tools/vm.js
CHANGED
|
@@ -30,21 +30,16 @@ export const vmCreateTool = {
|
|
|
30
30
|
|
|
31
31
|
const results = [];
|
|
32
32
|
|
|
33
|
-
// Delete existing VMs in parallel
|
|
34
|
-
let needsPurge = false;
|
|
33
|
+
// Delete existing VMs in parallel (per-VM purge, won't affect other VMs)
|
|
35
34
|
await Promise.all(
|
|
36
35
|
targets.map(async (name) => {
|
|
37
36
|
const existing = await mp.info(name);
|
|
38
37
|
if (existing) {
|
|
39
|
-
await mp.
|
|
40
|
-
needsPurge = true;
|
|
38
|
+
await mp.deleteVm(name);
|
|
41
39
|
results.push(`Deleted existing ${name}`);
|
|
42
40
|
}
|
|
43
41
|
}),
|
|
44
42
|
);
|
|
45
|
-
if (needsPurge) {
|
|
46
|
-
await mp.run(['purge'], { allowFailure: true });
|
|
47
|
-
}
|
|
48
43
|
|
|
49
44
|
// Create VMs in parallel
|
|
50
45
|
await Promise.all(
|
|
@@ -105,14 +100,13 @@ export const vmDeleteTool = {
|
|
|
105
100
|
async handler({ vms } = {}) {
|
|
106
101
|
const targets = vms ? vms.map((v) => VM_NAME_MAP[v]) : ALL_VMS;
|
|
107
102
|
|
|
108
|
-
// Delete VMs in parallel (purge
|
|
103
|
+
// Delete VMs in parallel (per-VM purge, won't affect other VMs)
|
|
109
104
|
await Promise.all(
|
|
110
105
|
targets.map(async (name) => {
|
|
111
|
-
await mp.
|
|
106
|
+
await mp.deleteVm(name);
|
|
112
107
|
removeVmState(name);
|
|
113
108
|
}),
|
|
114
109
|
);
|
|
115
|
-
await mp.run(['purge'], { allowFailure: true });
|
|
116
110
|
|
|
117
111
|
return {
|
|
118
112
|
content: [
|