host-execution-mcp 1.0.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/CHANGELOG.md +330 -0
- package/LICENSE +21 -0
- package/README.md +92 -0
- package/SECURITY.md +72 -0
- package/dist/access/docker-runtime.d.ts +38 -0
- package/dist/access/docker-runtime.js +61 -0
- package/dist/access/docker-runtime.js.map +1 -0
- package/dist/access/index.d.ts +110 -0
- package/dist/access/index.js +174 -0
- package/dist/access/index.js.map +1 -0
- package/dist/access/paradi-auth.d.ts +33 -0
- package/dist/access/paradi-auth.js +89 -0
- package/dist/access/paradi-auth.js.map +1 -0
- package/dist/access/paradi-transport.d.ts +10 -0
- package/dist/access/paradi-transport.js +39 -0
- package/dist/access/paradi-transport.js.map +1 -0
- package/dist/access/paradi-username.d.ts +5 -0
- package/dist/access/paradi-username.js +14 -0
- package/dist/access/paradi-username.js.map +1 -0
- package/dist/access/probe.d.ts +14 -0
- package/dist/access/probe.js +63 -0
- package/dist/access/probe.js.map +1 -0
- package/dist/access/session-pool.d.ts +25 -0
- package/dist/access/session-pool.js +46 -0
- package/dist/access/session-pool.js.map +1 -0
- package/dist/access/ssh-transport.d.ts +16 -0
- package/dist/access/ssh-transport.js +74 -0
- package/dist/access/ssh-transport.js.map +1 -0
- package/dist/access/types.d.ts +43 -0
- package/dist/access/types.js +21 -0
- package/dist/access/types.js.map +1 -0
- package/dist/config.d.ts +52 -0
- package/dist/config.js +179 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/instructions.d.ts +4 -0
- package/dist/instructions.js +93 -0
- package/dist/instructions.js.map +1 -0
- package/dist/kubectl/runner.d.ts +32 -0
- package/dist/kubectl/runner.js +79 -0
- package/dist/kubectl/runner.js.map +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.js +24 -0
- package/dist/server.js.map +1 -0
- package/dist/ssh/access-client.d.ts +62 -0
- package/dist/ssh/access-client.js +470 -0
- package/dist/ssh/access-client.js.map +1 -0
- package/dist/ssh/access-errors.d.ts +53 -0
- package/dist/ssh/access-errors.js +180 -0
- package/dist/ssh/access-errors.js.map +1 -0
- package/dist/ssh/access-sftp.d.ts +14 -0
- package/dist/ssh/access-sftp.js +456 -0
- package/dist/ssh/access-sftp.js.map +1 -0
- package/dist/ssh/bastion-client.d.ts +60 -0
- package/dist/ssh/bastion-client.js +423 -0
- package/dist/ssh/bastion-client.js.map +1 -0
- package/dist/ssh/bastion-errors.d.ts +62 -0
- package/dist/ssh/bastion-errors.js +190 -0
- package/dist/ssh/bastion-errors.js.map +1 -0
- package/dist/ssh/hop1-sftp.d.ts +14 -0
- package/dist/ssh/hop1-sftp.js +437 -0
- package/dist/ssh/hop1-sftp.js.map +1 -0
- package/dist/tools/copy-job-schemas.d.ts +709 -0
- package/dist/tools/copy-job-schemas.js +48 -0
- package/dist/tools/copy-job-schemas.js.map +1 -0
- package/dist/tools/register.d.ts +14 -0
- package/dist/tools/register.js +619 -0
- package/dist/tools/register.js.map +1 -0
- package/dist/tools/remote-schemas.d.ts +879 -0
- package/dist/tools/remote-schemas.js +214 -0
- package/dist/tools/remote-schemas.js.map +1 -0
- package/dist/utils/copy-executor.d.ts +41 -0
- package/dist/utils/copy-executor.js +231 -0
- package/dist/utils/copy-executor.js.map +1 -0
- package/dist/utils/copy-job-manager.d.ts +34 -0
- package/dist/utils/copy-job-manager.js +400 -0
- package/dist/utils/copy-job-manager.js.map +1 -0
- package/dist/utils/copy-job-store.d.ts +18 -0
- package/dist/utils/copy-job-store.js +104 -0
- package/dist/utils/copy-job-store.js.map +1 -0
- package/dist/utils/copy-job-types.d.ts +133 -0
- package/dist/utils/copy-job-types.js +37 -0
- package/dist/utils/copy-job-types.js.map +1 -0
- package/dist/utils/copy-transfer.d.ts +59 -0
- package/dist/utils/copy-transfer.js +86 -0
- package/dist/utils/copy-transfer.js.map +1 -0
- package/dist/utils/remote-copy.d.ts +14 -0
- package/dist/utils/remote-copy.js +115 -0
- package/dist/utils/remote-copy.js.map +1 -0
- package/dist/utils/remote-executor.d.ts +15 -0
- package/dist/utils/remote-executor.js +34 -0
- package/dist/utils/remote-executor.js.map +1 -0
- package/dist/utils/remote-target.d.ts +22 -0
- package/dist/utils/remote-target.js +75 -0
- package/dist/utils/remote-target.js.map +1 -0
- package/dist/utils/result.d.ts +87 -0
- package/dist/utils/result.js +81 -0
- package/dist/utils/result.js.map +1 -0
- package/dist/utils/shell-quote.d.ts +22 -0
- package/dist/utils/shell-quote.js +55 -0
- package/dist/utils/shell-quote.js.map +1 -0
- package/dist/utils/timeout.d.ts +1 -0
- package/dist/utils/timeout.js +18 -0
- package/dist/utils/timeout.js.map +1 -0
- package/dist/utils/truncate.d.ts +5 -0
- package/dist/utils/truncate.js +12 -0
- package/dist/utils/truncate.js.map +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +7 -0
- package/dist/version.js.map +1 -0
- package/docs/AGENT_GUIDE.md +161 -0
- package/docs/CONFIGURATION.md +130 -0
- package/docs/COPY_SPECIALIZED_TEST_CHECKLIST.md +9 -0
- package/docs/HOP1_E2E_CHECKLIST.md +128 -0
- package/docs/HOP1_E2E_RESULTS.json +647 -0
- package/docs/PARADI_ACCESS_PLAN.md +272 -0
- package/docs/REMOTE_COPY_JOB_API.md +92 -0
- package/docs/TODO.md +66 -0
- package/docs/USER_GUIDE.zh-CN.md +93 -0
- package/docs/clients/claude-desktop.json.example +12 -0
- package/docs/clients/cursor-npx.json.example +12 -0
- package/docs/clients/cursor.json.example +12 -0
- package/docs/clients/vscode.json.example +12 -0
- package/package.json +65 -0
|
@@ -0,0 +1,619 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { assertCopyEndpointsAllowed, executeRemoteCopy } from "../utils/copy-executor.js";
|
|
3
|
+
import { CopyJobManager } from "../utils/copy-job-manager.js";
|
|
4
|
+
import { buildPsCommand, buildRemoteReadCommand, parseReadFileMeta, } from "../utils/remote-target.js";
|
|
5
|
+
import { formatCommandResult, formatCopyFileResult, formatErrorResult, formatReadFileResult, toToolText, } from "../utils/result.js";
|
|
6
|
+
import { remoteCopyCancelSchema, remoteCopyStatusSchema, buildRemoteCopyStartSchema, } from "./copy-job-schemas.js";
|
|
7
|
+
import { buildRemoteCopyFileSchema, buildRemotePsSchema, buildRemoteReadFileSchema, fileEndpointToInternal, materializeCopyEndpoint, remoteInputToTarget, resolveReadOptions, } from "./remote-schemas.js";
|
|
8
|
+
async function handleTool(config, fn) {
|
|
9
|
+
const started = Date.now();
|
|
10
|
+
try {
|
|
11
|
+
const raw = await fn();
|
|
12
|
+
const mergedStdout = [raw.stdout, raw.stderr].filter(Boolean).join("\n");
|
|
13
|
+
return toToolText(formatCommandResult(config, {
|
|
14
|
+
stdout: mergedStdout,
|
|
15
|
+
stderr: "",
|
|
16
|
+
exitCode: raw.exitCode,
|
|
17
|
+
durationMs: raw.durationMs ?? Date.now() - started,
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
return toToolText(formatErrorResult(config, error, Date.now() - started));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
async function handleRemoteReadFile(config, remote, args) {
|
|
25
|
+
const started = Date.now();
|
|
26
|
+
const resolved = resolveReadOptions(args);
|
|
27
|
+
try {
|
|
28
|
+
const command = buildRemoteReadCommand(args.path, resolved);
|
|
29
|
+
const raw = await remote.runOnTarget(remoteInputToTarget(args), command, args.timeoutMs);
|
|
30
|
+
const mergedStdout = [raw.stdout, raw.stderr].filter(Boolean).join("\n");
|
|
31
|
+
const { meta, content } = parseReadFileMeta(mergedStdout);
|
|
32
|
+
return toToolText(formatReadFileResult(config, {
|
|
33
|
+
content,
|
|
34
|
+
exitCode: raw.exitCode,
|
|
35
|
+
durationMs: raw.durationMs ?? Date.now() - started,
|
|
36
|
+
maxLines: resolved.lines,
|
|
37
|
+
mode: resolved.mode,
|
|
38
|
+
meta,
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
return toToolText(formatErrorResult(config, error, Date.now() - started));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function resolveCopyEndpoints(access, config, args) {
|
|
46
|
+
const sourceRaw = fileEndpointToInternal(args.source);
|
|
47
|
+
const destRaw = fileEndpointToInternal(args.dest);
|
|
48
|
+
assertCopyEndpointsAllowed(config, sourceRaw, destRaw);
|
|
49
|
+
const source = materializeCopyEndpoint(access, sourceRaw);
|
|
50
|
+
const dest = materializeCopyEndpoint(access, destRaw);
|
|
51
|
+
return { source, dest };
|
|
52
|
+
}
|
|
53
|
+
export function registerTools(server, deps) {
|
|
54
|
+
const { config, accessClient, access, kubectl, remote } = deps;
|
|
55
|
+
const copyJobs = new CopyJobManager({ accessClient, config });
|
|
56
|
+
const targetUserConfigured = Boolean(config.targetUser?.trim());
|
|
57
|
+
const targetPasswordConfigured = Boolean(config.targetPassword);
|
|
58
|
+
const targetHostConfigured = Boolean(config.targetHost?.trim());
|
|
59
|
+
const isParadi = config.accessKind === "paradi-gateway";
|
|
60
|
+
const allowContext = !isParadi;
|
|
61
|
+
const remoteReadFileSchema = buildRemoteReadFileSchema({ allowContext });
|
|
62
|
+
const remotePsSchema = buildRemotePsSchema({ allowContext });
|
|
63
|
+
const remoteCopyFileSchema = buildRemoteCopyFileSchema({ allowContext });
|
|
64
|
+
const remoteCopyStartSchema = buildRemoteCopyStartSchema({ allowContext });
|
|
65
|
+
const contextKeyField = allowContext
|
|
66
|
+
? z
|
|
67
|
+
.string()
|
|
68
|
+
.optional()
|
|
69
|
+
.describe("HostExecutionContext key from context_derive (omit for landing Context)")
|
|
70
|
+
: undefined;
|
|
71
|
+
const shellInputSchema = {
|
|
72
|
+
command: z.string().min(1).describe("Shell command to run on the selected Context"),
|
|
73
|
+
timeoutMs: z.number().int().positive().optional().describe("Timeout in milliseconds"),
|
|
74
|
+
cwd: z.string().optional().describe("Working directory on the Context"),
|
|
75
|
+
...(contextKeyField ? { contextKey: contextKeyField } : {}),
|
|
76
|
+
};
|
|
77
|
+
server.registerTool("access_check", {
|
|
78
|
+
description: isParadi
|
|
79
|
+
? `Probe Local → Paradi gateway → TARGET connectivity (≤10s). Structured JSON: reachable, latencyMs, host, port, auth.
|
|
80
|
+
|
|
81
|
+
Under ACCESS_KIND=paradi-gateway, AccessTransport SSHs the gateway with encoded username; success means landing Context (TARGET) is reachable. Does NOT run kubectl.
|
|
82
|
+
|
|
83
|
+
When to use: first session; VPN/network unsure; after ACCESS_UNAVAILABLE.
|
|
84
|
+
If reachable=false: stop; check VPN / ACCESS_HOST (gateway). Example: {}`
|
|
85
|
+
: `Probe Local → ACCESS SSH connectivity with short timeouts (≤10s). Structured JSON: reachable, latencyMs, host, port, auth.
|
|
86
|
+
|
|
87
|
+
AccessTransport only (MCP client → SSH → ACCESS). Does NOT run kubectl or touch pods/hosts. Uses an ephemeral SSH session (does not sever in-flight shell_exec / copy).
|
|
88
|
+
|
|
89
|
+
When to use: first session; VPN/network unsure; after ACCESS_UNAVAILABLE; before long copy/exec when connectivity may be down.
|
|
90
|
+
When NOT to use: checking cluster/kubectl health (shell_exec cluster-info); pod/context ops.
|
|
91
|
+
If reachable=false (code ACCESS_UNAVAILABLE): stop retrying other tools; tell user to check VPN / ACCESS_HOST (hints in message). Negative TTL may return a cached failure without re-probing.
|
|
92
|
+
Example: {}`,
|
|
93
|
+
inputSchema: {},
|
|
94
|
+
}, async () => {
|
|
95
|
+
const started = Date.now();
|
|
96
|
+
try {
|
|
97
|
+
const result = await accessClient.check();
|
|
98
|
+
return toToolText({ ...result });
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
return toToolText(formatErrorResult(config, error, Date.now() - started));
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
server.registerTool("shell_exec", {
|
|
105
|
+
description: isParadi
|
|
106
|
+
? `Run a shell command on the Paradi landing Context (TARGET host OS).
|
|
107
|
+
|
|
108
|
+
Architecture: MCP → SSH(gateway, encoded user) → TARGET shell. Omit contextKey.
|
|
109
|
+
|
|
110
|
+
When to use: TARGET OS shell, kubectl on TARGET, local scripts on TARGET.
|
|
111
|
+
When NOT to use: second-hop SSH (context_derive / ssh_exec unsupported under Paradi); inside a pod (k8s_exec).
|
|
112
|
+
Example: {"command":"hostname","timeoutMs":30000}`
|
|
113
|
+
: `Run a shell command on a HostExecutionContext (default landing).
|
|
114
|
+
|
|
115
|
+
Architecture: MCP client → SSH → ACCESS → shell on landing or derived Context (contextKey).
|
|
116
|
+
|
|
117
|
+
When to use: kubectl cluster-info, landing scripts, or shell on a derived host via contextKey.
|
|
118
|
+
When NOT to use: inside a pod (k8s_exec), derive-only probe (context_derive), pure connectivity probe (access_check).
|
|
119
|
+
Prerequisites: prefer access_check if VPN/network may be down. On ACCESS_UNAVAILABLE: do not retry — ask user to fix VPN.
|
|
120
|
+
Example: {"command":"kubectl get nodes","timeoutMs":30000} or {"command":"hostname","contextKey":"<from context_derive>"}`,
|
|
121
|
+
inputSchema: shellInputSchema,
|
|
122
|
+
}, async ({ command, contextKey, timeoutMs, cwd }) => handleTool(config, () => access.shellExec(command, {
|
|
123
|
+
contextKey,
|
|
124
|
+
timeoutMs: timeoutMs ?? config.defaultTimeoutMs,
|
|
125
|
+
cwd,
|
|
126
|
+
})));
|
|
127
|
+
server.registerTool("context_derive", {
|
|
128
|
+
description: isParadi
|
|
129
|
+
? `UNAVAILABLE under ACCESS_KIND=paradi-gateway — landing Context is already TARGET. Handler throws.`
|
|
130
|
+
: `Derive a child HostExecutionContext from landing. Returns contextKey + endpoint + capabilities summary.
|
|
131
|
+
|
|
132
|
+
Use the returned contextKey on shell_exec, docker_*, context_probe, remote_* target=context, and remote_copy_* target=context.
|
|
133
|
+
Omit host to use TARGET_HOST when configured; useTarget=true forces default TARGET derive selector.
|
|
134
|
+
Example: {"host":"10.0.0.5","user":"admin"} or {"useTarget":true}`,
|
|
135
|
+
inputSchema: isParadi
|
|
136
|
+
? {}
|
|
137
|
+
: {
|
|
138
|
+
host: z
|
|
139
|
+
.string()
|
|
140
|
+
.optional()
|
|
141
|
+
.describe(targetHostConfigured
|
|
142
|
+
? `Omit to use TARGET_HOST=${config.targetHost} with useTarget=true`
|
|
143
|
+
: "Target host IP/hostname reachable FROM ACCESS"),
|
|
144
|
+
useTarget: z
|
|
145
|
+
.boolean()
|
|
146
|
+
.optional()
|
|
147
|
+
.describe(targetHostConfigured
|
|
148
|
+
? `When true, derive TARGET_HOST=${config.targetHost}`
|
|
149
|
+
: "When true, derive default TARGET from config (requires TARGET_HOST)"),
|
|
150
|
+
user: z
|
|
151
|
+
.string()
|
|
152
|
+
.optional()
|
|
153
|
+
.describe(targetUserConfigured
|
|
154
|
+
? `Omit to use TARGET_USER=${config.targetUser}`
|
|
155
|
+
: "SSH user (required unless TARGET_USER set)"),
|
|
156
|
+
password: z
|
|
157
|
+
.string()
|
|
158
|
+
.optional()
|
|
159
|
+
.describe(targetPasswordConfigured
|
|
160
|
+
? "Omit to use TARGET_PASSWORD"
|
|
161
|
+
: "SSH password via sshpass (or set TARGET_PASSWORD)"),
|
|
162
|
+
},
|
|
163
|
+
}, async (args) => {
|
|
164
|
+
const started = Date.now();
|
|
165
|
+
try {
|
|
166
|
+
const summary = access.deriveContext(args);
|
|
167
|
+
return toToolText({
|
|
168
|
+
success: true,
|
|
169
|
+
...summary,
|
|
170
|
+
durationMs: Date.now() - started,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
catch (error) {
|
|
174
|
+
return toToolText(formatErrorResult(config, error, Date.now() - started));
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
server.registerTool("k8s_list_pods", {
|
|
178
|
+
description: `List pods in a namespace (kubectl on landing Context only — ${isParadi ? "TARGET" : "ACCESS"}).
|
|
179
|
+
|
|
180
|
+
By design k8s_* have no contextKey. For kubectl on a derived host use shell_exec with contextKey.
|
|
181
|
+
|
|
182
|
+
No capabilities.kubectl gate — kubectl failures surface via exitCode; use context_probe to check kubectl CLI presence.
|
|
183
|
+
|
|
184
|
+
When to use: discover pod names before k8s_exec, k8s_logs, or remote_* with target=pod.
|
|
185
|
+
When NOT to use: running commands in a pod (k8s_exec), reading files (remote_read_file), listing processes (remote_ps), SSH to hosts (ssh_exec).
|
|
186
|
+
Prerequisites: namespace from user or context.
|
|
187
|
+
Example: {"namespace":"default","labelSelector":"app=web","fieldSelector":"status.phase=Running","output":"wide"}`,
|
|
188
|
+
inputSchema: {
|
|
189
|
+
namespace: z.string().min(1),
|
|
190
|
+
labelSelector: z.string().optional(),
|
|
191
|
+
fieldSelector: z.string().optional(),
|
|
192
|
+
output: z.enum(["wide", "json", "name"]).optional(),
|
|
193
|
+
timeoutMs: z.number().int().positive().optional(),
|
|
194
|
+
},
|
|
195
|
+
}, async ({ namespace, labelSelector, fieldSelector, output, timeoutMs }) => handleTool(config, () => kubectl.listPods(namespace, { labelSelector, fieldSelector, output }, timeoutMs)));
|
|
196
|
+
server.registerTool("k8s_exec", {
|
|
197
|
+
description: `Run a command inside a pod container (${isParadi ? "TARGET" : "ACCESS"} → kubectl exec, non-interactive).
|
|
198
|
+
|
|
199
|
+
Architecture: MCP client → SSH → ${isParadi ? "TARGET" : "ACCESS"} → kubectl exec → pod. NOT local SSH to pod.
|
|
200
|
+
|
|
201
|
+
When to use: run scripts, inspect env, list dirs, start processes inside a container.
|
|
202
|
+
When NOT to use: file logs on disk (remote_read_file mode=tail), container stdout history (k8s_logs), host OS via SSH (ssh_exec).
|
|
203
|
+
Prerequisites: namespace and pod — use k8s_list_pods first if unknown.
|
|
204
|
+
Example: {"namespace":"dev","pod":"web-abc","command":"ls -la /app","container":"app"}`,
|
|
205
|
+
inputSchema: {
|
|
206
|
+
namespace: z.string().min(1),
|
|
207
|
+
pod: z.string().min(1),
|
|
208
|
+
command: z.string().min(1),
|
|
209
|
+
container: z.string().optional(),
|
|
210
|
+
timeoutMs: z.number().int().positive().optional(),
|
|
211
|
+
},
|
|
212
|
+
}, async ({ namespace, pod, command, container, timeoutMs }) => handleTool(config, () => kubectl.exec(namespace, pod, command, container, timeoutMs)));
|
|
213
|
+
server.registerTool("k8s_logs", {
|
|
214
|
+
description: `Fetch pod container stdout/stderr (${isParadi ? "TARGET" : "ACCESS"} → kubectl logs).
|
|
215
|
+
|
|
216
|
+
When to use: process output captured by container runtime logging.
|
|
217
|
+
When NOT to use: log files on disk (remote_read_file mode=tail). Often empty for sshd-only idle pods.
|
|
218
|
+
Prerequisites: namespace and pod name.
|
|
219
|
+
Example: {"namespace":"dev","pod":"web-abc","tail":200,"since":"1h"}`,
|
|
220
|
+
inputSchema: {
|
|
221
|
+
namespace: z.string().min(1),
|
|
222
|
+
pod: z.string().min(1),
|
|
223
|
+
container: z.string().optional(),
|
|
224
|
+
tail: z.number().int().positive().optional(),
|
|
225
|
+
since: z.string().optional(),
|
|
226
|
+
timeoutMs: z.number().int().positive().optional(),
|
|
227
|
+
},
|
|
228
|
+
}, async ({ namespace, pod, container, tail, since, timeoutMs }) => handleTool(config, () => kubectl.logs(namespace, pod, { container, tail, since }, timeoutMs)));
|
|
229
|
+
server.registerTool("ssh_exec", {
|
|
230
|
+
description: isParadi
|
|
231
|
+
? `UNAVAILABLE under ACCESS_KIND=paradi-gateway — landing Context is already TARGET. Use shell_exec for TARGET shell, docker_* (omit contextKey), or k8s_* for pods. Handler errors if called.`
|
|
232
|
+
: `Shortcut: context_derive + shell_exec on a remote host (ACCESS → ssh/sshpass → host).
|
|
233
|
+
|
|
234
|
+
IMPORTANT: NOT SSH from the laptop. MCP → ACCESS; ACCESS derives and shells to the host.
|
|
235
|
+
Returns reusable contextKey + standard command result fields (exitCode, stdout, etc.). Prefer this for derive+shell in one call; reuse contextKey for follow-up shell_exec / docker_* / remote_* target=context.
|
|
236
|
+
|
|
237
|
+
When to use: host IP/node when kubectl exec is not appropriate; omit host to use TARGET_HOST when configured.
|
|
238
|
+
When NOT to use: inside a pod (k8s_exec); ACCESS_KIND=paradi-gateway (unsupported — handler throws).
|
|
239
|
+
Example: {"host":"10.0.0.5","command":"hostname"} or {"command":"hostname"} with TARGET_HOST set`,
|
|
240
|
+
inputSchema: {
|
|
241
|
+
host: z
|
|
242
|
+
.string()
|
|
243
|
+
.optional()
|
|
244
|
+
.describe(isParadi
|
|
245
|
+
? "UNAVAILABLE under paradi-gateway"
|
|
246
|
+
: targetHostConfigured
|
|
247
|
+
? `Omit to use TARGET_HOST=${config.targetHost}`
|
|
248
|
+
: "Target host IP/hostname reachable FROM ACCESS (required unless TARGET_HOST set)"),
|
|
249
|
+
command: z.string().min(1),
|
|
250
|
+
user: z
|
|
251
|
+
.string()
|
|
252
|
+
.optional()
|
|
253
|
+
.describe(isParadi
|
|
254
|
+
? "UNAVAILABLE under paradi-gateway"
|
|
255
|
+
: targetUserConfigured
|
|
256
|
+
? `Omit to use TARGET_USER=${config.targetUser}`
|
|
257
|
+
: "SSH user (required unless TARGET_USER set)"),
|
|
258
|
+
password: z
|
|
259
|
+
.string()
|
|
260
|
+
.optional()
|
|
261
|
+
.describe(isParadi
|
|
262
|
+
? "UNAVAILABLE under paradi-gateway"
|
|
263
|
+
: targetPasswordConfigured
|
|
264
|
+
? "Omit to use TARGET_PASSWORD"
|
|
265
|
+
: "SSH password via sshpass (or set TARGET_PASSWORD)"),
|
|
266
|
+
timeoutMs: z.number().int().positive().optional(),
|
|
267
|
+
},
|
|
268
|
+
}, async ({ host, command, user, password, timeoutMs }) => {
|
|
269
|
+
const started = Date.now();
|
|
270
|
+
try {
|
|
271
|
+
const raw = await access.sshExec({
|
|
272
|
+
host,
|
|
273
|
+
command,
|
|
274
|
+
user,
|
|
275
|
+
password,
|
|
276
|
+
timeoutMs: timeoutMs ?? config.defaultTimeoutMs,
|
|
277
|
+
});
|
|
278
|
+
const mergedStdout = [raw.stdout, raw.stderr].filter(Boolean).join("\n");
|
|
279
|
+
const base = formatCommandResult(config, {
|
|
280
|
+
stdout: mergedStdout,
|
|
281
|
+
stderr: "",
|
|
282
|
+
exitCode: raw.exitCode,
|
|
283
|
+
durationMs: raw.durationMs ?? Date.now() - started,
|
|
284
|
+
});
|
|
285
|
+
return toToolText({
|
|
286
|
+
...base,
|
|
287
|
+
contextKey: raw.contextKey,
|
|
288
|
+
endpoint: raw.endpoint,
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
catch (error) {
|
|
292
|
+
return toToolText(formatErrorResult(config, error, Date.now() - started));
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
const withOptionalContextKey = (fields) => contextKeyField ? { ...fields, contextKey: contextKeyField } : fields;
|
|
296
|
+
server.registerTool("context_probe", {
|
|
297
|
+
description: isParadi
|
|
298
|
+
? `Probe TARGET landing capabilities (docker/kubectl CLI). SSH success ≠ docker/kubectl.
|
|
299
|
+
Example: {}`
|
|
300
|
+
: `Probe Context capabilities (docker/kubectl CLI presence). SSH success does NOT imply docker/kubectl.
|
|
301
|
+
|
|
302
|
+
Returns capabilities tri-state: true | false | unknown. Prefer this (or let docker_* auto-probe) before assuming docker.
|
|
303
|
+
Default Context = landing; pass contextKey to probe a derived host.
|
|
304
|
+
Example: {} or {"contextKey":"<from context_derive>"}`,
|
|
305
|
+
inputSchema: withOptionalContextKey({
|
|
306
|
+
timeoutMs: z.number().int().positive().optional().describe("Timeout in milliseconds"),
|
|
307
|
+
}),
|
|
308
|
+
}, async ({ contextKey, timeoutMs }) => {
|
|
309
|
+
const started = Date.now();
|
|
310
|
+
try {
|
|
311
|
+
const result = await access.probe({
|
|
312
|
+
contextKey,
|
|
313
|
+
timeoutMs: timeoutMs ?? config.defaultTimeoutMs,
|
|
314
|
+
});
|
|
315
|
+
return toToolText({
|
|
316
|
+
success: true,
|
|
317
|
+
contextKey: result.contextKey,
|
|
318
|
+
endpoint: result.endpoint,
|
|
319
|
+
capabilities: result.capabilities,
|
|
320
|
+
durationMs: Date.now() - started,
|
|
321
|
+
note: "unknown must not be treated as true; docker_* auto-probes when still unknown",
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
catch (error) {
|
|
325
|
+
return toToolText(formatErrorResult(config, error, Date.now() - started));
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
server.registerTool("docker_ps", {
|
|
329
|
+
description: isParadi
|
|
330
|
+
? `List Docker containers on TARGET landing (Runtime via SessionPool). Auto-probes docker.
|
|
331
|
+
Example: {"all":true}`
|
|
332
|
+
: `List Docker containers on a HostExecutionContext (landing or derived via contextKey).
|
|
333
|
+
|
|
334
|
+
Runtime only — uses SessionPool; does not create SSH. Auto-probes capabilities.docker if unknown; fails if false.
|
|
335
|
+
Example: {"all":true} or {"contextKey":"<from context_derive>","all":true}`,
|
|
336
|
+
inputSchema: withOptionalContextKey({
|
|
337
|
+
timeoutMs: z.number().int().positive().optional().describe("Timeout in milliseconds"),
|
|
338
|
+
all: z.boolean().optional().describe("Include stopped containers (-a)"),
|
|
339
|
+
quiet: z.boolean().optional().describe("Only container IDs (-q)"),
|
|
340
|
+
filter: z.string().optional().describe("docker ps --filter value"),
|
|
341
|
+
}),
|
|
342
|
+
}, async ({ contextKey, timeoutMs, all, quiet, filter, }) => handleTool(config, () => access.dockerPs({
|
|
343
|
+
contextKey,
|
|
344
|
+
all,
|
|
345
|
+
quiet,
|
|
346
|
+
filter,
|
|
347
|
+
timeoutMs: timeoutMs ?? config.defaultTimeoutMs,
|
|
348
|
+
})));
|
|
349
|
+
server.registerTool("docker_exec", {
|
|
350
|
+
description: isParadi
|
|
351
|
+
? `Run a command inside a Docker container on TARGET landing (docker exec → bash -lc). Not kubectl exec. Auto-probes docker.
|
|
352
|
+
Example: {"container":"musa-starvla","command":"nvidia-smi"}`
|
|
353
|
+
: `Run a command inside a Docker container on landing or derived Context (docker exec → bash -lc).
|
|
354
|
+
|
|
355
|
+
Not kubectl exec (use k8s_exec for pods). Auto-probes docker capability.
|
|
356
|
+
Example: {"container":"musa-starvla","command":"nvidia-smi"} or {"contextKey":"<key>","container":"c1","command":"pwd"}`,
|
|
357
|
+
inputSchema: withOptionalContextKey({
|
|
358
|
+
container: z.string().min(1).describe("Container name or ID"),
|
|
359
|
+
command: z.string().min(1).describe("Command run via bash -lc inside the container"),
|
|
360
|
+
workdir: z.string().optional().describe("docker exec -w"),
|
|
361
|
+
timeoutMs: z.number().int().positive().optional().describe("Timeout in milliseconds"),
|
|
362
|
+
}),
|
|
363
|
+
}, async ({ container, command, workdir, contextKey, timeoutMs, }) => handleTool(config, () => access.dockerExec({
|
|
364
|
+
container,
|
|
365
|
+
command,
|
|
366
|
+
workdir,
|
|
367
|
+
contextKey,
|
|
368
|
+
timeoutMs: timeoutMs ?? config.defaultTimeoutMs,
|
|
369
|
+
})));
|
|
370
|
+
server.registerTool("docker_logs", {
|
|
371
|
+
description: isParadi
|
|
372
|
+
? `Fetch Docker container logs on TARGET landing (docker logs). For k8s pod logs use k8s_logs. Auto-probes docker.
|
|
373
|
+
Example: {"container":"musa-starvla","tail":200}`
|
|
374
|
+
: `Fetch Docker container logs (docker logs) on landing or derived Context.
|
|
375
|
+
|
|
376
|
+
For k8s pod logs use k8s_logs. Auto-probes docker capability.
|
|
377
|
+
Example: {"container":"musa-starvla","tail":200}`,
|
|
378
|
+
inputSchema: withOptionalContextKey({
|
|
379
|
+
container: z.string().min(1),
|
|
380
|
+
tail: z.number().int().positive().optional().describe("Default 200"),
|
|
381
|
+
since: z.string().optional().describe("docker logs --since"),
|
|
382
|
+
timestamps: z.boolean().optional(),
|
|
383
|
+
timeoutMs: z.number().int().positive().optional().describe("Timeout in milliseconds"),
|
|
384
|
+
}),
|
|
385
|
+
}, async ({ container, tail, since, timestamps, contextKey, timeoutMs, }) => handleTool(config, () => access.dockerLogs({
|
|
386
|
+
container,
|
|
387
|
+
tail,
|
|
388
|
+
since,
|
|
389
|
+
timestamps,
|
|
390
|
+
contextKey,
|
|
391
|
+
timeoutMs: timeoutMs ?? config.defaultTimeoutMs,
|
|
392
|
+
})));
|
|
393
|
+
server.registerTool("remote_read_file", {
|
|
394
|
+
description: isParadi
|
|
395
|
+
? `Read a file on TARGET landing (target=landing) or in a pod (target=pod).
|
|
396
|
+
|
|
397
|
+
Schema rejects target=context under Paradi — use target=landing for OS files.
|
|
398
|
+
Use mode=head|tail. Limits: MAX_OUTPUT_CHARS. For transfer use remote_copy_file.
|
|
399
|
+
Example: {"target":"landing","path":"/var/log/app.log","mode":"tail","lines":100}`
|
|
400
|
+
: `Read a file on landing, in a pod, or on a derived Context (target=context).
|
|
401
|
+
|
|
402
|
+
Use target to select path: landing=shell, pod=kubectl exec, context=derived shell (contextKey required).
|
|
403
|
+
Use mode to read from start or end of file:
|
|
404
|
+
- mode=head (default): first N lines; default lines=500; supports offset for pagination
|
|
405
|
+
- mode=tail: last N lines; default lines=200; supports grep filter
|
|
406
|
+
|
|
407
|
+
Limits: MAX_OUTPUT_CHARS env (default 65536) may truncate response; check truncatedByChars.
|
|
408
|
+
Response includes totalLines/totalBytes/truncatedByLines. For file transfer use remote_copy_file.
|
|
409
|
+
|
|
410
|
+
When NOT to use: container stdout (k8s_logs); copying files (remote_copy_file).
|
|
411
|
+
Example (head): {"target":"pod","namespace":"dev","pod":"web","path":"/app/main.py","mode":"head","lines":2000}
|
|
412
|
+
Example (context): {"target":"context","contextKey":"<key>","path":"/etc/hostname"}`,
|
|
413
|
+
inputSchema: remoteReadFileSchema,
|
|
414
|
+
}, async (args) => handleRemoteReadFile(config, remote, args));
|
|
415
|
+
server.registerTool("remote_copy_file", {
|
|
416
|
+
description: isParadi
|
|
417
|
+
? `Synchronous copy between local, landing (=TARGET), or pod. Schema rejects target=context under Paradi.
|
|
418
|
+
|
|
419
|
+
local↔landing uses SFTP (declared degraded — prefer smaller transfers / remote_copy_start; expect retries).
|
|
420
|
+
Example: {"source":{"target":"local","path":"C:/tmp/a.bin"},"dest":{"target":"landing","path":"/tmp/a.bin"}}`
|
|
421
|
+
: `Synchronous copy of a file or directory between local, landing, pod, or context.
|
|
422
|
+
|
|
423
|
+
Always waits for completion and returns success/bytes/transferId — does NOT start a background job.
|
|
424
|
+
- local↔landing: independent SFTP (ssh2-sftp-client); files and directories (directory = walk + per-file)
|
|
425
|
+
- landing/pod/context (context materializes before copy): kubectl cp, scp, cp on landing
|
|
426
|
+
|
|
427
|
+
skipIfComplete: gate strength = verify (default size=cheap; size+sha256=content). verify=none + skip is rejected. Verify fail → rewrite (not throw-only).
|
|
428
|
+
Set totalTimeoutMs (or timeoutMs alias). Progress via notifications/progress when client provides progressToken.
|
|
429
|
+
|
|
430
|
+
When to use: short/medium sync copies that fit the MCP call timeout.
|
|
431
|
+
When NOT to use: long/large copies — call remote_copy_start (async) then remote_copy_status (size>256MB or ETA>2min). Do not expect remote_copy_file to auto-async.
|
|
432
|
+
Example (file): {"source":{"target":"local","path":"C:/tmp/a.bin"},"dest":{"target":"landing","path":"/tmp/a.bin"}}
|
|
433
|
+
Example (context): {"source":{"target":"context","contextKey":"<key>","path":"/data/a.bin"},"dest":{"target":"local","path":"C:/data/a.bin"}}`,
|
|
434
|
+
inputSchema: remoteCopyFileSchema,
|
|
435
|
+
}, async (args, extra) => {
|
|
436
|
+
const started = Date.now();
|
|
437
|
+
try {
|
|
438
|
+
const { source, dest } = resolveCopyEndpoints(access, config, args);
|
|
439
|
+
const progressToken = extra._meta?.progressToken;
|
|
440
|
+
const onProgress = (progress) => {
|
|
441
|
+
if (progressToken === undefined) {
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
void extra
|
|
445
|
+
.sendNotification({
|
|
446
|
+
method: "notifications/progress",
|
|
447
|
+
params: {
|
|
448
|
+
progressToken,
|
|
449
|
+
progress: progress.transferred,
|
|
450
|
+
total: progress.total,
|
|
451
|
+
},
|
|
452
|
+
})
|
|
453
|
+
.catch(() => undefined);
|
|
454
|
+
};
|
|
455
|
+
const result = await executeRemoteCopy({ accessClient, config }, source, dest, {
|
|
456
|
+
recursive: args.recursive ?? true,
|
|
457
|
+
timeoutMs: args.timeoutMs,
|
|
458
|
+
skipIfComplete: args.skipIfComplete,
|
|
459
|
+
progressIntervalMs: args.progressIntervalMs,
|
|
460
|
+
totalTimeoutMs: args.totalTimeoutMs,
|
|
461
|
+
connectionTimeoutMs: args.connectionTimeoutMs,
|
|
462
|
+
verify: args.verify,
|
|
463
|
+
onProgress,
|
|
464
|
+
});
|
|
465
|
+
return toToolText(formatCopyFileResult({
|
|
466
|
+
source: { target: source.target, path: source.path },
|
|
467
|
+
dest: { target: dest.target, path: dest.path },
|
|
468
|
+
exitCode: result.exitCode,
|
|
469
|
+
durationMs: result.durationMs ?? Date.now() - started,
|
|
470
|
+
bytes: result.bytes,
|
|
471
|
+
totalBytes: result.totalBytes,
|
|
472
|
+
skippedBytes: result.skippedBytes,
|
|
473
|
+
skipped: result.skipped,
|
|
474
|
+
skipReason: result.skipReason,
|
|
475
|
+
transferId: result.transferId,
|
|
476
|
+
verified: result.verified,
|
|
477
|
+
usedFastPath: result.usedFastPath,
|
|
478
|
+
message: result.message,
|
|
479
|
+
}));
|
|
480
|
+
}
|
|
481
|
+
catch (error) {
|
|
482
|
+
return toToolText(formatErrorResult(config, error, Date.now() - started));
|
|
483
|
+
}
|
|
484
|
+
});
|
|
485
|
+
server.registerTool("remote_copy_start", {
|
|
486
|
+
description: isParadi
|
|
487
|
+
? `Start an async copy job and return transferId immediately. Same rules as remote_copy_file under Paradi: landing=TARGET; schema rejects target=context. SFTP degraded — prefer this for large transfers.
|
|
488
|
+
Example: {"source":{"target":"landing","path":"/tmp/big.pt"},"dest":{"target":"local","path":"C:/data/big.pt"},"skipIfComplete":true,"totalTimeoutMs":7200000}`
|
|
489
|
+
: `Start an async file/directory copy job (same path engine as remote_copy_file) and return immediately with transferId.
|
|
490
|
+
|
|
491
|
+
This is the async primitive — remote_copy_file never auto-promotes to a job.
|
|
492
|
+
Job state: ~/.agent-compose/remote-copy/jobs/<transferId>.json
|
|
493
|
+
Poll remote_copy_status; cancel with remote_copy_cancel.
|
|
494
|
+
Prefer when size>256MB or ETA>2min. Supports skipIfComplete/verify/totalTimeoutMs.
|
|
495
|
+
Terminal statuses: success|failed|cancelled|timeout.
|
|
496
|
+
Example: {"source":{"target":"landing","path":"/tmp/big.pt"},"dest":{"target":"local","path":"C:/data/big.pt"},"skipIfComplete":true,"totalTimeoutMs":7200000}`,
|
|
497
|
+
inputSchema: remoteCopyStartSchema,
|
|
498
|
+
}, async (args) => {
|
|
499
|
+
const started = Date.now();
|
|
500
|
+
try {
|
|
501
|
+
const { source, dest } = resolveCopyEndpoints(access, config, args);
|
|
502
|
+
const result = await copyJobs.start({
|
|
503
|
+
source,
|
|
504
|
+
dest,
|
|
505
|
+
recursive: args.recursive,
|
|
506
|
+
skipIfComplete: args.skipIfComplete,
|
|
507
|
+
verify: args.verify,
|
|
508
|
+
progressIntervalMs: args.progressIntervalMs,
|
|
509
|
+
totalTimeoutMs: args.totalTimeoutMs,
|
|
510
|
+
timeoutMs: args.timeoutMs,
|
|
511
|
+
});
|
|
512
|
+
return toToolText(result);
|
|
513
|
+
}
|
|
514
|
+
catch (error) {
|
|
515
|
+
return toToolText(formatErrorResult(config, error, Date.now() - started));
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
server.registerTool("remote_copy_status", {
|
|
519
|
+
description: `Poll async copy job status by transferId from remote_copy_start.
|
|
520
|
+
|
|
521
|
+
Returns status (queued|running|success|failed|cancelled|timeout) and progress bytes/percent/speed/eta.
|
|
522
|
+
Example: {"transferId":"copy-xxx"}`,
|
|
523
|
+
inputSchema: remoteCopyStatusSchema,
|
|
524
|
+
}, async (args) => {
|
|
525
|
+
const started = Date.now();
|
|
526
|
+
try {
|
|
527
|
+
const result = await copyJobs.status(args.transferId);
|
|
528
|
+
return toToolText(result);
|
|
529
|
+
}
|
|
530
|
+
catch (error) {
|
|
531
|
+
return toToolText(formatErrorResult(config, error, Date.now() - started));
|
|
532
|
+
}
|
|
533
|
+
});
|
|
534
|
+
server.registerTool("remote_copy_cancel", {
|
|
535
|
+
description: `Cancel a running/queued async copy job by transferId.
|
|
536
|
+
|
|
537
|
+
Aborts the in-process worker: local↔landing SFTP sessions end promptly; kubectl cp / scp on landing is best-effort (abort checked between hops).
|
|
538
|
+
Already-finished jobs are left unchanged (terminal status is fenced).
|
|
539
|
+
Example: {"transferId":"copy-xxx"}`,
|
|
540
|
+
inputSchema: remoteCopyCancelSchema,
|
|
541
|
+
}, async (args) => {
|
|
542
|
+
const started = Date.now();
|
|
543
|
+
try {
|
|
544
|
+
const result = await copyJobs.cancel(args.transferId);
|
|
545
|
+
return toToolText(result);
|
|
546
|
+
}
|
|
547
|
+
catch (error) {
|
|
548
|
+
return toToolText(formatErrorResult(config, error, Date.now() - started));
|
|
549
|
+
}
|
|
550
|
+
});
|
|
551
|
+
server.registerTool("remote_ps", {
|
|
552
|
+
description: isParadi
|
|
553
|
+
? `List processes on TARGET landing (target=landing) or in a pod (target=pod).
|
|
554
|
+
Example: {"target":"landing","pattern":"python"}`
|
|
555
|
+
: `List processes on landing, in a pod, or on a derived Context (ps aux | grep).
|
|
556
|
+
|
|
557
|
+
When NOT to use: reading log files (remote_read_file).
|
|
558
|
+
Example (pod): {"target":"pod","namespace":"dev","pod":"train-0","pattern":"python"}
|
|
559
|
+
Example (context): {"target":"context","contextKey":"<key>","pattern":"nginx"}`,
|
|
560
|
+
inputSchema: remotePsSchema,
|
|
561
|
+
}, async (args) => handleTool(config, async () => {
|
|
562
|
+
const command = buildPsCommand(args.pattern);
|
|
563
|
+
return remote.runOnTarget(remoteInputToTarget(args), command, args.timeoutMs);
|
|
564
|
+
}));
|
|
565
|
+
}
|
|
566
|
+
export function registerPrompts(server) {
|
|
567
|
+
server.prompt("tool-selection", "Recommend the best host-execution-mcp tool for a scenario (all ops go via ACCESS landing Context)", {
|
|
568
|
+
scenario: z.string().describe("Description of what the user wants to do remotely"),
|
|
569
|
+
}, async ({ scenario }) => ({
|
|
570
|
+
messages: [
|
|
571
|
+
{
|
|
572
|
+
role: "user",
|
|
573
|
+
content: {
|
|
574
|
+
type: "text",
|
|
575
|
+
text: `Analyze the user's remote operation scenario and respond with:
|
|
576
|
+
1. Recommended tool (access_check | context_derive | context_probe | shell_exec | k8s_list_pods | k8s_exec | ssh_exec | docker_ps | docker_exec | docker_logs | k8s_logs | remote_read_file | remote_copy_file | remote_copy_start | remote_copy_status | remote_copy_cancel | remote_ps)
|
|
577
|
+
2. Why this tool fits (remember: MCP → ACCESS → Context; ssh_exec is ACCESS SSH derive, NOT local SSH; large copies — remote_copy_start; VPN/network unsure — access_check first)
|
|
578
|
+
3. The first MCP tool call (JSON arguments only)
|
|
579
|
+
|
|
580
|
+
If VPN/connectivity may be down, recommend access_check first. Use k8s_list_pods when pod name is unknown. Use context_derive before target=context or contextKey tools. Prefer k8s_exec over ssh_exec for pod/container access.
|
|
581
|
+
|
|
582
|
+
Scenario: ${scenario}`,
|
|
583
|
+
},
|
|
584
|
+
},
|
|
585
|
+
],
|
|
586
|
+
}));
|
|
587
|
+
server.prompt("remote-debug-workflow", "Standard remote debug workflow: check → list → read/tail → ps → report", {
|
|
588
|
+
namespace: z.string().describe("Kubernetes namespace"),
|
|
589
|
+
pod: z.string().optional().describe("Pod name if known"),
|
|
590
|
+
log_path: z.string().optional().describe("Log file path if known"),
|
|
591
|
+
pattern: z.string().optional().describe("Process name pattern if known"),
|
|
592
|
+
}, async ({ namespace, pod, log_path, pattern }) => ({
|
|
593
|
+
messages: [
|
|
594
|
+
{
|
|
595
|
+
role: "user",
|
|
596
|
+
content: {
|
|
597
|
+
type: "text",
|
|
598
|
+
text: `Execute a remote debug workflow using host-execution-mcp:
|
|
599
|
+
|
|
600
|
+
Namespace: ${namespace}
|
|
601
|
+
Pod: ${pod ?? "(discover via k8s_list_pods)"}
|
|
602
|
+
Log path: ${log_path ?? "(ask user if needed)"}
|
|
603
|
+
Process pattern: ${pattern ?? "(optional)"}
|
|
604
|
+
|
|
605
|
+
Steps:
|
|
606
|
+
1. Verify connectivity (access_check); if unreachable stop and report VPN/ACCESS_HOST
|
|
607
|
+
2. Verify cluster (shell_exec kubectl cluster-info)
|
|
608
|
+
3. List pods if needed (k8s_list_pods)
|
|
609
|
+
4. Read or tail files (remote_read_file); copy files (remote_copy_file or remote_copy_start for large)
|
|
610
|
+
5. Check processes (remote_ps)
|
|
611
|
+
6. Report findings and suggest next exec command if needed
|
|
612
|
+
|
|
613
|
+
Do not invent business-specific paths.`,
|
|
614
|
+
},
|
|
615
|
+
},
|
|
616
|
+
],
|
|
617
|
+
}));
|
|
618
|
+
}
|
|
619
|
+
//# sourceMappingURL=register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/tools/register.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,UAAU,GACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,GAE3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,GAInB,MAAM,qBAAqB,CAAC;AAE7B,KAAK,UAAU,UAAU,CACvB,MAAiB,EACjB,EAA2F;IAE3F,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC3B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,EAAE,EAAE,CAAC;QACvB,MAAM,YAAY,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,C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