vmsan 0.1.0-alpha.16 → 0.1.0-alpha.17

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.
@@ -29,11 +29,9 @@ const connectCommand = defineCommand({
29
29
  const paths = vmsanPaths();
30
30
  try {
31
31
  const { state, guestIp, port } = resolveVmState(args.vmId, paths);
32
- const log = consola.withTag(args.vmId);
33
32
  consola.debug(`Agent endpoint: ${guestIp}:${port}`);
34
- log.start("Waiting for agent to become ready...");
33
+ consola.debug("Waiting for agent to become ready...");
35
34
  await waitForAgent(guestIp, port);
36
- log.success("Agent is ready. Connecting via PTY shell...");
37
35
  const shell = new ShellSession({
38
36
  host: guestIp,
39
37
  port,
@@ -106,19 +106,17 @@ const execCommand = defineCommand({
106
106
  const envVars = parseEnvFlags(command);
107
107
  const { state, guestIp, port, store } = resolveVmState(args.vmId, paths);
108
108
  consola.debug(`Agent endpoint: ${guestIp}:${port}`);
109
- const log = consola.withTag(args.vmId);
110
- log.start("Waiting for agent...");
109
+ consola.debug(`Waiting for agent on ${guestIp}:${port}...`);
111
110
  await waitForAgent(guestIp, port);
112
111
  if (args.interactive) {
113
112
  const parts = [];
114
113
  parts.push(`export PS1=${shellEscape(buildVmsanPrompt(args.vmId))} TERM=xterm-256color &&`);
115
114
  if (args.workdir) parts.push(`cd ${shellEscape(args.workdir)} &&`);
116
115
  for (const [key, val] of Object.entries(envVars)) parts.push(`${key}=${shellEscape(val)}`);
117
- if (args.sudo) parts.push("sudo");
116
+ if (args.sudo) parts.push("/usr/bin/sudo");
118
117
  parts.push(shellEscape(command));
119
118
  for (const a of commandArgs) parts.push(shellEscape(a));
120
- const injectedCmd = parts.join(" ") + "; exit $?\n";
121
- log.success("Agent is ready. Connecting interactive shell...");
119
+ const injectedCmd = "clear; " + parts.join(" ") + "; exit $?\n";
122
120
  let extender = null;
123
121
  if (!args["no-extend-timeout"] && state.timeoutMs) {
124
122
  extender = new TimeoutExtender({
@@ -149,7 +147,7 @@ const execCommand = defineCommand({
149
147
  } else {
150
148
  consola.debug(`exec: ${command} ${commandArgs.join(" ")}`);
151
149
  const agent = new AgentClient(`http://${guestIp}:${port}`, state.agentToken);
152
- const cmd = args.sudo ? "sudo" : command;
150
+ const cmd = args.sudo ? "/usr/bin/sudo" : command;
153
151
  const runArgs = args.sudo ? [command, ...commandArgs] : commandArgs;
154
152
  const params = {
155
153
  cmd,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vmsan",
3
- "version": "0.1.0-alpha.16",
3
+ "version": "0.1.0-alpha.17",
4
4
  "description": "Firecracker microVM sandbox toolkit",
5
5
  "homepage": "https://github.com/angelorc/vmsan",
6
6
  "bugs": "https://github.com/angelorc/vmsan/issues",