microsandbox-mcp 0.5.7 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +142 -27
- package/dist/config.d.ts +10 -0
- package/dist/config.js +42 -0
- package/dist/config.js.map +1 -0
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/resources.d.ts +2 -0
- package/dist/resources.js +71 -0
- package/dist/resources.js.map +1 -0
- package/dist/schemas/common.d.ts +7 -0
- package/dist/schemas/common.js +8 -0
- package/dist/schemas/common.js.map +1 -0
- package/dist/state/exec-sessions.d.ts +19 -0
- package/dist/state/exec-sessions.js +151 -0
- package/dist/state/exec-sessions.js.map +1 -0
- package/dist/tools/exec.js +283 -56
- package/dist/tools/exec.js.map +1 -1
- package/dist/tools/filesystem.js +195 -59
- package/dist/tools/filesystem.js.map +1 -1
- package/dist/tools/image.d.ts +2 -0
- package/dist/tools/image.js +99 -0
- package/dist/tools/image.js.map +1 -0
- package/dist/tools/logs.d.ts +2 -0
- package/dist/tools/logs.js +128 -0
- package/dist/tools/logs.js.map +1 -0
- package/dist/tools/metrics.js +48 -65
- package/dist/tools/metrics.js.map +1 -1
- package/dist/tools/runtime.d.ts +2 -0
- package/dist/tools/runtime.js +61 -0
- package/dist/tools/runtime.js.map +1 -0
- package/dist/tools/sandbox.d.ts +216 -0
- package/dist/tools/sandbox.js +619 -202
- package/dist/tools/sandbox.js.map +1 -1
- package/dist/tools/snapshot.d.ts +2 -0
- package/dist/tools/snapshot.js +234 -0
- package/dist/tools/snapshot.js.map +1 -0
- package/dist/tools/ssh.d.ts +2 -0
- package/dist/tools/ssh.js +323 -0
- package/dist/tools/ssh.js.map +1 -0
- package/dist/tools/volume.js +287 -23
- package/dist/tools/volume.js.map +1 -1
- package/dist/utils/errors.d.ts +2 -7
- package/dist/utils/errors.js +6 -5
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/exec-output.d.ts +20 -0
- package/dist/utils/exec-output.js +15 -0
- package/dist/utils/exec-output.js.map +1 -0
- package/dist/utils/output.d.ts +11 -0
- package/dist/utils/output.js +21 -0
- package/dist/utils/output.js.map +1 -0
- package/dist/utils/policy.d.ts +8 -0
- package/dist/utils/policy.js +47 -0
- package/dist/utils/policy.js.map +1 -0
- package/dist/utils/redaction.d.ts +1 -0
- package/dist/utils/redaction.js +15 -0
- package/dist/utils/redaction.js.map +1 -0
- package/dist/utils/response.d.ts +34 -0
- package/dist/utils/response.js +38 -0
- package/dist/utils/response.js.map +1 -0
- package/dist/utils/serialization.d.ts +15 -0
- package/dist/utils/serialization.js +164 -0
- package/dist/utils/serialization.js.map +1 -0
- package/package.json +5 -3
package/dist/tools/metrics.js
CHANGED
|
@@ -1,11 +1,33 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { allSandboxMetrics, Sandbox } from "microsandbox";
|
|
3
3
|
import { formatError } from "../utils/errors.js";
|
|
4
|
+
import { ok } from "../utils/response.js";
|
|
5
|
+
import { metricsData } from "../utils/serialization.js";
|
|
4
6
|
export function registerMetricsTools(server) {
|
|
5
|
-
server.registerTool("
|
|
6
|
-
title: "
|
|
7
|
-
description: "
|
|
8
|
-
|
|
7
|
+
server.registerTool("sandbox_metrics", {
|
|
8
|
+
title: "Get Sandbox Metrics",
|
|
9
|
+
description: "Get live resource usage metrics for a running sandbox.",
|
|
10
|
+
inputSchema: z.object({
|
|
11
|
+
name: z.string().describe("Sandbox name"),
|
|
12
|
+
}),
|
|
13
|
+
annotations: {
|
|
14
|
+
readOnlyHint: true,
|
|
15
|
+
destructiveHint: false,
|
|
16
|
+
idempotentHint: true,
|
|
17
|
+
},
|
|
18
|
+
}, async ({ name }) => {
|
|
19
|
+
try {
|
|
20
|
+
const handle = await Sandbox.get(name);
|
|
21
|
+
const sandbox = await handle.connect();
|
|
22
|
+
return ok(metricsData(await sandbox.metrics()));
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
return formatError(error);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
server.registerTool("sandbox_metrics_all", {
|
|
29
|
+
title: "Get All Sandbox Metrics",
|
|
30
|
+
description: "Get point-in-time metrics for all running sandboxes.",
|
|
9
31
|
inputSchema: z.object({}),
|
|
10
32
|
annotations: {
|
|
11
33
|
readOnlyHint: true,
|
|
@@ -14,80 +36,41 @@ export function registerMetricsTools(server) {
|
|
|
14
36
|
},
|
|
15
37
|
}, async () => {
|
|
16
38
|
try {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
return {
|
|
20
|
-
content: [{
|
|
21
|
-
type: "text",
|
|
22
|
-
text: JSON.stringify({ installed: true }, null, 2),
|
|
23
|
-
}],
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
// Attempt automatic installation.
|
|
27
|
-
try {
|
|
28
|
-
await install();
|
|
29
|
-
return {
|
|
30
|
-
content: [{
|
|
31
|
-
type: "text",
|
|
32
|
-
text: JSON.stringify({
|
|
33
|
-
installed: true,
|
|
34
|
-
message: "Runtime dependencies were just installed.",
|
|
35
|
-
}, null, 2),
|
|
36
|
-
}],
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
catch (installError) {
|
|
40
|
-
return {
|
|
41
|
-
content: [{
|
|
42
|
-
type: "text",
|
|
43
|
-
text: JSON.stringify({
|
|
44
|
-
installed: false,
|
|
45
|
-
message: "msb and libkrunfw are not installed. " +
|
|
46
|
-
"Install manually: curl -fsSL https://install.microsandbox.dev | sh",
|
|
47
|
-
}, null, 2),
|
|
48
|
-
}],
|
|
49
|
-
isError: true,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
39
|
+
const metrics = await allSandboxMetrics();
|
|
40
|
+
return ok(Object.fromEntries(Object.entries(metrics).map(([name, value]) => [name, metricsData(value)])));
|
|
52
41
|
}
|
|
53
42
|
catch (error) {
|
|
54
43
|
return formatError(error);
|
|
55
44
|
}
|
|
56
45
|
});
|
|
57
|
-
server.registerTool("
|
|
58
|
-
title: "
|
|
59
|
-
description: "
|
|
46
|
+
server.registerTool("sandbox_metrics_stream", {
|
|
47
|
+
title: "Sample Sandbox Metrics Stream",
|
|
48
|
+
description: "Collect a bounded number of metrics samples from a running sandbox.",
|
|
60
49
|
inputSchema: z.object({
|
|
61
50
|
name: z.string().describe("Sandbox name"),
|
|
51
|
+
intervalMs: z.number().int().positive().optional().describe("Sampling interval in milliseconds"),
|
|
52
|
+
samples: z.number().int().positive().max(100).optional().describe("Number of samples to collect"),
|
|
62
53
|
}),
|
|
63
54
|
annotations: {
|
|
64
55
|
readOnlyHint: true,
|
|
65
56
|
destructiveHint: false,
|
|
66
|
-
idempotentHint:
|
|
57
|
+
idempotentHint: false,
|
|
67
58
|
},
|
|
68
|
-
}, async ({ name }) => {
|
|
69
|
-
|
|
59
|
+
}, async ({ name, intervalMs, samples }) => {
|
|
60
|
+
const stream = await (async () => {
|
|
70
61
|
const handle = await Sandbox.get(name);
|
|
71
62
|
const sandbox = await handle.connect();
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
diskReadBytes: m.diskReadBytes,
|
|
84
|
-
diskWriteBytes: m.diskWriteBytes,
|
|
85
|
-
netRxBytes: m.netRxBytes,
|
|
86
|
-
netTxBytes: m.netTxBytes,
|
|
87
|
-
uptimeSecs: m.uptimeMs ? Math.round(m.uptimeMs / 1000) : undefined,
|
|
88
|
-
}, null, 2),
|
|
89
|
-
}],
|
|
90
|
-
};
|
|
63
|
+
return sandbox.metricsStream(intervalMs ?? 1000);
|
|
64
|
+
})();
|
|
65
|
+
try {
|
|
66
|
+
const values = [];
|
|
67
|
+
for (let i = 0; i < (samples ?? 1); i += 1) {
|
|
68
|
+
const sample = await stream.recv();
|
|
69
|
+
if (!sample)
|
|
70
|
+
break;
|
|
71
|
+
values.push(metricsData(sample));
|
|
72
|
+
}
|
|
73
|
+
return ok({ name, intervalMs: intervalMs ?? 1000, samples: values });
|
|
91
74
|
}
|
|
92
75
|
catch (error) {
|
|
93
76
|
return formatError(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/tools/metrics.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/tools/metrics.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,EAAE,EAAE,MAAM,sBAAsB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,UAAU,oBAAoB,CAAC,MAAiB;IACpD,MAAM,CAAC,YAAY,CACjB,iBAAiB,EACjB;QACE,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EAAE,wDAAwD;QACrE,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;SAC1C,CAAC;QACF,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;SACrB;KACF,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACjB,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACvC,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;YACvC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 -0,0 +1,61 @@
|
|
|
1
|
+
import { install, isInstalled } from "microsandbox";
|
|
2
|
+
import { getServerConfig } from "../config.js";
|
|
3
|
+
import { emptySchema } from "../schemas/common.js";
|
|
4
|
+
import { formatError } from "../utils/errors.js";
|
|
5
|
+
import { ok } from "../utils/response.js";
|
|
6
|
+
const SERVER_VERSION = "0.6.0";
|
|
7
|
+
export function registerRuntimeTools(server) {
|
|
8
|
+
server.registerTool("runtime_check", {
|
|
9
|
+
title: "Check Runtime Installation",
|
|
10
|
+
description: "Check whether the microsandbox runtime dependencies are installed.",
|
|
11
|
+
inputSchema: emptySchema,
|
|
12
|
+
annotations: {
|
|
13
|
+
readOnlyHint: true,
|
|
14
|
+
destructiveHint: false,
|
|
15
|
+
idempotentHint: true,
|
|
16
|
+
},
|
|
17
|
+
}, async () => {
|
|
18
|
+
try {
|
|
19
|
+
const config = getServerConfig();
|
|
20
|
+
return ok({
|
|
21
|
+
installed: isInstalled(),
|
|
22
|
+
serverVersion: SERVER_VERSION,
|
|
23
|
+
nodeVersion: process.version,
|
|
24
|
+
platform: process.platform,
|
|
25
|
+
arch: process.arch,
|
|
26
|
+
msbPath: process.env.MSB_PATH ?? null,
|
|
27
|
+
libkrunfwPath: process.env.MSB_LIBKRUNFW_PATH ?? null,
|
|
28
|
+
hostPathPolicy: config.hostPathPolicy,
|
|
29
|
+
hostPaths: config.hostPaths,
|
|
30
|
+
dangerousEnabled: config.dangerousEnabled,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
return formatError(error);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
server.registerTool("runtime_install", {
|
|
38
|
+
title: "Install Runtime Dependencies",
|
|
39
|
+
description: "Install msb and libkrunfw using the microsandbox SDK installer.",
|
|
40
|
+
inputSchema: emptySchema,
|
|
41
|
+
annotations: {
|
|
42
|
+
readOnlyHint: false,
|
|
43
|
+
destructiveHint: false,
|
|
44
|
+
idempotentHint: true,
|
|
45
|
+
},
|
|
46
|
+
}, async () => {
|
|
47
|
+
try {
|
|
48
|
+
if (!isInstalled()) {
|
|
49
|
+
await install();
|
|
50
|
+
}
|
|
51
|
+
return ok({
|
|
52
|
+
installed: isInstalled(),
|
|
53
|
+
message: "Runtime dependencies are installed.",
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
return formatError(error);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/tools/runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,EAAE,EAAE,MAAM,sBAAsB,CAAC;AAE1C,MAAM,cAAc,GAAG,OAAO,CAAC;AAE/B,MAAM,UAAU,oBAAoB,CAAC,MAAiB;IACpD,MAAM,CAAC,YAAY,CACjB,eAAe,EACf;QACE,KAAK,EAAE,4BAA4B;QACnC,WAAW,EAAE,oEAAoE;QACjF,WAAW,EAAE,WAAW;QACxB,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;SACrB;KACF,EACD,KAAK,IAAI,EAAE;QACT,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,eAAe,EAAE,CAAC;YACjC,OAAO,EAAE,CAAC;gBACR,SAAS,EAAE,WAAW,EAAE;gBACxB,aAAa,EAAE,cAAc;gBAC7B,WAAW,EAAE,OAAO,CAAC,OAAO;gBAC5B,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,IAAI;gBACrC,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,IAAI;gBACrD,cAAc,EAAE,MAAM,CAAC,cAAc;gBACrC,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;aAC1C,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,YAAY,CACjB,iBAAiB,EACjB;QACE,KAAK,EAAE,8BAA8B;QACrC,WAAW,EAAE,iEAAiE;QAC9E,WAAW,EAAE,WAAW;QACxB,WAAW,EAAE;YACX,YAAY,EAAE,KAAK;YACnB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;SACrB;KACF,EACD,KAAK,IAAI,EAAE;QACT,IAAI,CAAC;YACH,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;gBACnB,MAAM,OAAO,EAAE,CAAC;YAClB,CAAC;YAED,OAAO,EAAE,CAAC;gBACR,SAAS,EAAE,WAAW,EAAE;gBACxB,OAAO,EAAE,qCAAqC;aAC/C,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/tools/sandbox.d.ts
CHANGED
|
@@ -1,2 +1,218 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export declare const sandboxCreateSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodOptional<z.ZodString>;
|
|
5
|
+
image: z.ZodOptional<z.ZodString>;
|
|
6
|
+
rootfs: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
7
|
+
kind: z.ZodLiteral<"oci">;
|
|
8
|
+
reference: z.ZodString;
|
|
9
|
+
pullPolicy: z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
never: "never";
|
|
11
|
+
always: "always";
|
|
12
|
+
"if-missing": "if-missing";
|
|
13
|
+
}>>;
|
|
14
|
+
upperSizeMib: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
registry: z.ZodOptional<z.ZodObject<{
|
|
16
|
+
insecure: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
caCertsPath: z.ZodOptional<z.ZodString>;
|
|
18
|
+
auth: z.ZodOptional<z.ZodObject<{
|
|
19
|
+
kind: z.ZodEnum<{
|
|
20
|
+
anonymous: "anonymous";
|
|
21
|
+
basic: "basic";
|
|
22
|
+
}>;
|
|
23
|
+
username: z.ZodOptional<z.ZodString>;
|
|
24
|
+
password: z.ZodOptional<z.ZodString>;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
28
|
+
kind: z.ZodLiteral<"bind">;
|
|
29
|
+
path: z.ZodString;
|
|
30
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
31
|
+
kind: z.ZodLiteral<"disk">;
|
|
32
|
+
path: z.ZodString;
|
|
33
|
+
fstype: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
35
|
+
kind: z.ZodLiteral<"snapshot">;
|
|
36
|
+
pathOrName: z.ZodString;
|
|
37
|
+
}, z.core.$strip>], "kind">>;
|
|
38
|
+
cpus: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
memoryMib: z.ZodOptional<z.ZodNumber>;
|
|
40
|
+
workdir: z.ZodOptional<z.ZodString>;
|
|
41
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
42
|
+
volumes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
43
|
+
kind: z.ZodEnum<{
|
|
44
|
+
bind: "bind";
|
|
45
|
+
named: "named";
|
|
46
|
+
tmpfs: "tmpfs";
|
|
47
|
+
disk: "disk";
|
|
48
|
+
}>;
|
|
49
|
+
guestPath: z.ZodString;
|
|
50
|
+
hostPath: z.ZodOptional<z.ZodString>;
|
|
51
|
+
name: z.ZodOptional<z.ZodString>;
|
|
52
|
+
source: z.ZodOptional<z.ZodString>;
|
|
53
|
+
readonly: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
+
noexec: z.ZodOptional<z.ZodBoolean>;
|
|
55
|
+
nosuid: z.ZodOptional<z.ZodBoolean>;
|
|
56
|
+
nodev: z.ZodOptional<z.ZodBoolean>;
|
|
57
|
+
sizeMib: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
format: z.ZodOptional<z.ZodEnum<{
|
|
59
|
+
raw: "raw";
|
|
60
|
+
qcow2: "qcow2";
|
|
61
|
+
vmdk: "vmdk";
|
|
62
|
+
}>>;
|
|
63
|
+
fstype: z.ZodOptional<z.ZodString>;
|
|
64
|
+
statVirtualization: z.ZodOptional<z.ZodEnum<{
|
|
65
|
+
strict: "strict";
|
|
66
|
+
relaxed: "relaxed";
|
|
67
|
+
off: "off";
|
|
68
|
+
}>>;
|
|
69
|
+
hostPermissions: z.ZodOptional<z.ZodEnum<{
|
|
70
|
+
private: "private";
|
|
71
|
+
mirror: "mirror";
|
|
72
|
+
}>>;
|
|
73
|
+
}, z.core.$strip>>>;
|
|
74
|
+
mounts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
75
|
+
kind: z.ZodEnum<{
|
|
76
|
+
bind: "bind";
|
|
77
|
+
named: "named";
|
|
78
|
+
tmpfs: "tmpfs";
|
|
79
|
+
disk: "disk";
|
|
80
|
+
}>;
|
|
81
|
+
guestPath: z.ZodString;
|
|
82
|
+
hostPath: z.ZodOptional<z.ZodString>;
|
|
83
|
+
name: z.ZodOptional<z.ZodString>;
|
|
84
|
+
source: z.ZodOptional<z.ZodString>;
|
|
85
|
+
readonly: z.ZodOptional<z.ZodBoolean>;
|
|
86
|
+
noexec: z.ZodOptional<z.ZodBoolean>;
|
|
87
|
+
nosuid: z.ZodOptional<z.ZodBoolean>;
|
|
88
|
+
nodev: z.ZodOptional<z.ZodBoolean>;
|
|
89
|
+
sizeMib: z.ZodOptional<z.ZodNumber>;
|
|
90
|
+
format: z.ZodOptional<z.ZodEnum<{
|
|
91
|
+
raw: "raw";
|
|
92
|
+
qcow2: "qcow2";
|
|
93
|
+
vmdk: "vmdk";
|
|
94
|
+
}>>;
|
|
95
|
+
fstype: z.ZodOptional<z.ZodString>;
|
|
96
|
+
statVirtualization: z.ZodOptional<z.ZodEnum<{
|
|
97
|
+
strict: "strict";
|
|
98
|
+
relaxed: "relaxed";
|
|
99
|
+
off: "off";
|
|
100
|
+
}>>;
|
|
101
|
+
hostPermissions: z.ZodOptional<z.ZodEnum<{
|
|
102
|
+
private: "private";
|
|
103
|
+
mirror: "mirror";
|
|
104
|
+
}>>;
|
|
105
|
+
}, z.core.$strip>>>;
|
|
106
|
+
patches: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
107
|
+
kind: z.ZodEnum<{
|
|
108
|
+
text: "text";
|
|
109
|
+
file: "file";
|
|
110
|
+
symlink: "symlink";
|
|
111
|
+
copyFile: "copyFile";
|
|
112
|
+
copyDir: "copyDir";
|
|
113
|
+
mkdir: "mkdir";
|
|
114
|
+
append: "append";
|
|
115
|
+
remove: "remove";
|
|
116
|
+
}>;
|
|
117
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
118
|
+
text: "text";
|
|
119
|
+
file: "file";
|
|
120
|
+
symlink: "symlink";
|
|
121
|
+
copyFile: "copyFile";
|
|
122
|
+
copyDir: "copyDir";
|
|
123
|
+
mkdir: "mkdir";
|
|
124
|
+
append: "append";
|
|
125
|
+
remove: "remove";
|
|
126
|
+
}>>;
|
|
127
|
+
path: z.ZodOptional<z.ZodString>;
|
|
128
|
+
guestPath: z.ZodOptional<z.ZodString>;
|
|
129
|
+
hostPath: z.ZodOptional<z.ZodString>;
|
|
130
|
+
content: z.ZodOptional<z.ZodString>;
|
|
131
|
+
contentBase64: z.ZodOptional<z.ZodString>;
|
|
132
|
+
target: z.ZodOptional<z.ZodString>;
|
|
133
|
+
linkPath: z.ZodOptional<z.ZodString>;
|
|
134
|
+
mode: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
replace: z.ZodOptional<z.ZodBoolean>;
|
|
136
|
+
}, z.core.$strip>>>;
|
|
137
|
+
entrypoint: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
138
|
+
hostname: z.ZodOptional<z.ZodString>;
|
|
139
|
+
maxDuration: z.ZodOptional<z.ZodNumber>;
|
|
140
|
+
idleTimeout: z.ZodOptional<z.ZodNumber>;
|
|
141
|
+
resources: z.ZodOptional<z.ZodObject<{
|
|
142
|
+
cpus: z.ZodOptional<z.ZodNumber>;
|
|
143
|
+
memoryMib: z.ZodOptional<z.ZodNumber>;
|
|
144
|
+
}, z.core.$strip>>;
|
|
145
|
+
process: z.ZodOptional<z.ZodObject<{
|
|
146
|
+
workdir: z.ZodOptional<z.ZodString>;
|
|
147
|
+
shell: z.ZodOptional<z.ZodString>;
|
|
148
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
149
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
150
|
+
entrypoint: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
151
|
+
user: z.ZodOptional<z.ZodString>;
|
|
152
|
+
scripts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
153
|
+
rlimits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
154
|
+
resource: z.ZodString;
|
|
155
|
+
soft: z.ZodNumber;
|
|
156
|
+
hard: z.ZodOptional<z.ZodNumber>;
|
|
157
|
+
}, z.core.$strip>>>;
|
|
158
|
+
init: z.ZodOptional<z.ZodObject<{
|
|
159
|
+
path: z.ZodString;
|
|
160
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
161
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
162
|
+
}, z.core.$strip>>;
|
|
163
|
+
}, z.core.$strip>>;
|
|
164
|
+
lifecycle: z.ZodOptional<z.ZodObject<{
|
|
165
|
+
detached: z.ZodOptional<z.ZodBoolean>;
|
|
166
|
+
replace: z.ZodOptional<z.ZodBoolean>;
|
|
167
|
+
replaceTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
168
|
+
maxDurationSecs: z.ZodOptional<z.ZodNumber>;
|
|
169
|
+
idleTimeoutSecs: z.ZodOptional<z.ZodNumber>;
|
|
170
|
+
logLevel: z.ZodOptional<z.ZodEnum<{
|
|
171
|
+
error: "error";
|
|
172
|
+
warn: "warn";
|
|
173
|
+
info: "info";
|
|
174
|
+
debug: "debug";
|
|
175
|
+
trace: "trace";
|
|
176
|
+
}>>;
|
|
177
|
+
metricsSampleIntervalMs: z.ZodOptional<z.ZodNumber>;
|
|
178
|
+
disableMetricsSample: z.ZodOptional<z.ZodBoolean>;
|
|
179
|
+
quietLogs: z.ZodOptional<z.ZodBoolean>;
|
|
180
|
+
}, z.core.$strip>>;
|
|
181
|
+
network: z.ZodOptional<z.ZodObject<{
|
|
182
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
183
|
+
ports: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
184
|
+
hostPort: z.ZodNumber;
|
|
185
|
+
guestPort: z.ZodNumber;
|
|
186
|
+
bindAddress: z.ZodOptional<z.ZodString>;
|
|
187
|
+
protocol: z.ZodOptional<z.ZodEnum<{
|
|
188
|
+
tcp: "tcp";
|
|
189
|
+
udp: "udp";
|
|
190
|
+
}>>;
|
|
191
|
+
}, z.core.$strip>>>;
|
|
192
|
+
maxConnections: z.ZodOptional<z.ZodNumber>;
|
|
193
|
+
trustHostCas: z.ZodOptional<z.ZodBoolean>;
|
|
194
|
+
ipv4Pool: z.ZodOptional<z.ZodString>;
|
|
195
|
+
ipv6Pool: z.ZodOptional<z.ZodString>;
|
|
196
|
+
dns: z.ZodOptional<z.ZodObject<{
|
|
197
|
+
allowRebind: z.ZodOptional<z.ZodBoolean>;
|
|
198
|
+
nameservers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
199
|
+
queryTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
200
|
+
}, z.core.$strip>>;
|
|
201
|
+
tls: z.ZodOptional<z.ZodObject<{
|
|
202
|
+
ports: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
203
|
+
bypassDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
204
|
+
blockQuic: z.ZodOptional<z.ZodBoolean>;
|
|
205
|
+
caCertPath: z.ZodOptional<z.ZodString>;
|
|
206
|
+
caKeyPath: z.ZodOptional<z.ZodString>;
|
|
207
|
+
upstreamCaCertPaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
208
|
+
trustHostCas: z.ZodOptional<z.ZodBoolean>;
|
|
209
|
+
}, z.core.$strip>>;
|
|
210
|
+
}, z.core.$strip>>;
|
|
211
|
+
secrets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
212
|
+
envVar: z.ZodString;
|
|
213
|
+
value: z.ZodOptional<z.ZodString>;
|
|
214
|
+
valueEnv: z.ZodOptional<z.ZodString>;
|
|
215
|
+
allowedHost: z.ZodString;
|
|
216
|
+
}, z.core.$strip>>>;
|
|
217
|
+
}, z.core.$strip>;
|
|
2
218
|
export declare function registerSandboxTools(server: McpServer): void;
|