viagen 0.1.4 → 0.1.5

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/dist/cli.js CHANGED
@@ -118,11 +118,15 @@ async function deploySandbox(opts) {
118
118
  ...opts.git.revision ? { revision: opts.git.revision } : {}
119
119
  }
120
120
  } : {};
121
+ const hasAppCommand = !!opts.envVars?.["VIAGEN_APP_COMMAND"];
122
+ const appPort = parseInt(opts.envVars?.["VIAGEN_APP_PORT"] || "5173", 10);
123
+ const serverPort = parseInt(opts.envVars?.["VIAGEN_SERVER_PORT"] || "5199", 10);
124
+ const sandboxPorts = hasAppCommand ? [serverPort, appPort] : [appPort];
121
125
  let sandbox2;
122
126
  try {
123
127
  sandbox2 = await Sandbox.create({
124
128
  runtime: "node22",
125
- ports: [5173],
129
+ ports: sandboxPorts,
126
130
  timeout: timeoutMs,
127
131
  ...sourceOpts
128
132
  });
@@ -243,7 +247,7 @@ async function deploySandbox(opts) {
243
247
  args: ["-c", devCmd],
244
248
  detached: true
245
249
  });
246
- const baseUrl = sandbox2.domain(5173);
250
+ const baseUrl = sandbox2.domain(hasAppCommand ? serverPort : appPort);
247
251
  const url = `${baseUrl}/t/${token}`;
248
252
  const dots2 = startDots(" Starting dev server");
249
253
  const ready = await waitForServer(baseUrl, token, devServer);
package/dist/index.js CHANGED
@@ -111,7 +111,7 @@ function registerHealthRoutes(server, env, errorRef) {
111
111
  );
112
112
  }
113
113
  });
114
- const currentVersion = true ? "0.1.4" : "0.0.0";
114
+ const currentVersion = true ? "0.1.5" : "0.0.0";
115
115
  debug("health", `version resolved: ${currentVersion}`);
116
116
  let versionCache = null;
117
117
  server.middlewares.use("/via/version", (_req, res) => {
@@ -19346,11 +19346,15 @@ async function deploySandbox(opts) {
19346
19346
  ...opts.git.revision ? { revision: opts.git.revision } : {}
19347
19347
  }
19348
19348
  } : {};
19349
+ const hasAppCommand = !!opts.envVars?.["VIAGEN_APP_COMMAND"];
19350
+ const appPort = parseInt(opts.envVars?.["VIAGEN_APP_PORT"] || "5173", 10);
19351
+ const serverPort = parseInt(opts.envVars?.["VIAGEN_SERVER_PORT"] || "5199", 10);
19352
+ const sandboxPorts = hasAppCommand ? [serverPort, appPort] : [appPort];
19349
19353
  let sandbox;
19350
19354
  try {
19351
19355
  sandbox = await Sandbox.create({
19352
19356
  runtime: "node22",
19353
- ports: [5173],
19357
+ ports: sandboxPorts,
19354
19358
  timeout: timeoutMs,
19355
19359
  ...sourceOpts
19356
19360
  });
@@ -19471,7 +19475,7 @@ async function deploySandbox(opts) {
19471
19475
  args: ["-c", devCmd],
19472
19476
  detached: true
19473
19477
  });
19474
- const baseUrl = sandbox.domain(5173);
19478
+ const baseUrl = sandbox.domain(hasAppCommand ? serverPort : appPort);
19475
19479
  const url2 = `${baseUrl}/t/${token}`;
19476
19480
  const dots2 = startDots(" Starting dev server");
19477
19481
  const ready = await waitForServer(baseUrl, token, devServer);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viagen",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Vite dev server plugin that exposes endpoints for chatting with Claude Code SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",