viagen 0.0.38 → 0.0.40

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
@@ -54,7 +54,7 @@ function startDots(label) {
54
54
  }
55
55
  };
56
56
  }
57
- async function waitForServer(baseUrl, devServer) {
57
+ async function waitForServer(baseUrl, token, devServer) {
58
58
  const timeout = 6e4;
59
59
  const start = Date.now();
60
60
  const ac = new AbortController();
@@ -79,6 +79,7 @@ async function waitForServer(baseUrl, devServer) {
79
79
  }
80
80
  try {
81
81
  const res = await fetch(`${baseUrl}/via/health`, {
82
+ headers: { Authorization: `Bearer ${token}` },
82
83
  signal: AbortSignal.timeout(3e3)
83
84
  });
84
85
  if (res.ok) {
@@ -226,13 +227,13 @@ async function deploySandbox(opts) {
226
227
  }
227
228
  const devServer = await sandbox2.runCommand({
228
229
  cmd: "npm",
229
- args: ["run", "dev", "--", "--host", "0.0.0.0"],
230
+ args: ["run", "dev"],
230
231
  detached: true
231
232
  });
232
233
  const baseUrl = sandbox2.domain(5173);
233
234
  const url = `${baseUrl}/t/${token}`;
234
235
  const dots2 = startDots(" Starting dev server");
235
- const ready = await waitForServer(baseUrl, devServer);
236
+ const ready = await waitForServer(baseUrl, token, devServer);
236
237
  dots2.stop();
237
238
  if (!ready.ok) {
238
239
  throw new Error(
package/dist/index.js CHANGED
@@ -104,7 +104,7 @@ function registerHealthRoutes(server, env, errorRef) {
104
104
  );
105
105
  }
106
106
  });
107
- const currentVersion = true ? "0.0.38" : "0.0.0";
107
+ const currentVersion = true ? "0.0.40" : "0.0.0";
108
108
  debug("health", `version resolved: ${currentVersion}`);
109
109
  let versionCache = null;
110
110
  server.middlewares.use("/via/version", (_req, res) => {
@@ -3571,7 +3571,7 @@ function startDots(label) {
3571
3571
  }
3572
3572
  };
3573
3573
  }
3574
- async function waitForServer(baseUrl, devServer) {
3574
+ async function waitForServer(baseUrl, token, devServer) {
3575
3575
  const timeout = 6e4;
3576
3576
  const start = Date.now();
3577
3577
  const ac = new AbortController();
@@ -3596,6 +3596,7 @@ async function waitForServer(baseUrl, devServer) {
3596
3596
  }
3597
3597
  try {
3598
3598
  const res = await fetch(`${baseUrl}/via/health`, {
3599
+ headers: { Authorization: `Bearer ${token}` },
3599
3600
  signal: AbortSignal.timeout(3e3)
3600
3601
  });
3601
3602
  if (res.ok) {
@@ -3743,13 +3744,13 @@ async function deploySandbox(opts) {
3743
3744
  }
3744
3745
  const devServer = await sandbox.runCommand({
3745
3746
  cmd: "npm",
3746
- args: ["run", "dev", "--", "--host", "0.0.0.0"],
3747
+ args: ["run", "dev"],
3747
3748
  detached: true
3748
3749
  });
3749
3750
  const baseUrl = sandbox.domain(5173);
3750
3751
  const url = `${baseUrl}/t/${token}`;
3751
3752
  const dots2 = startDots(" Starting dev server");
3752
- const ready = await waitForServer(baseUrl, devServer);
3753
+ const ready = await waitForServer(baseUrl, token, devServer);
3753
3754
  dots2.stop();
3754
3755
  if (!ready.ok) {
3755
3756
  throw new Error(
@@ -3791,7 +3792,7 @@ function viagen(options) {
3791
3792
  config(_, { mode }) {
3792
3793
  const e = loadEnv(mode, process.cwd(), "");
3793
3794
  if (e["VIAGEN_AUTH_TOKEN"]) {
3794
- return { server: { allowedHosts: true } };
3795
+ return { server: { host: true, allowedHosts: true } };
3795
3796
  }
3796
3797
  },
3797
3798
  configResolved(config) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viagen",
3
- "version": "0.0.38",
3
+ "version": "0.0.40",
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",