viagen 0.1.3 → 0.1.4

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.
Files changed (2) hide show
  1. package/dist/index.js +12 -2
  2. package/package.json +1 -1
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.3" : "0.0.0";
114
+ const currentVersion = true ? "0.1.4" : "0.0.0";
115
115
  debug("health", `version resolved: ${currentVersion}`);
116
116
  let versionCache = null;
117
117
  server.middlewares.use("/via/version", (_req, res) => {
@@ -19519,7 +19519,7 @@ function viagen(options) {
19519
19519
  config(_, { mode }) {
19520
19520
  const e = loadEnv(mode, process.cwd(), "");
19521
19521
  const serverConfig = {};
19522
- if (e["VIAGEN_AUTH_TOKEN"] || e["VIAGEN_USER_TOKEN"]) {
19522
+ if (e["VIAGEN_AUTH_TOKEN"] || e["VIAGEN_USER_TOKEN"] || e["VIAGEN_PROMPT"]) {
19523
19523
  serverConfig.host = true;
19524
19524
  serverConfig.allowedHosts = true;
19525
19525
  }
@@ -19528,6 +19528,11 @@ function viagen(options) {
19528
19528
  serverConfig.port = viagenPort;
19529
19529
  serverConfig.strictPort = true;
19530
19530
  }
19531
+ const childAppPort = e["VIAGEN_APP_PORT"] || process.env["VIAGEN_APP_PORT"] || process.env["PORT"];
19532
+ if (process.env["__VIAGEN_CHILD"] && childAppPort) {
19533
+ serverConfig.port = parseInt(childAppPort, 10);
19534
+ serverConfig.strictPort = true;
19535
+ }
19531
19536
  if (Object.keys(serverConfig).length > 0) {
19532
19537
  return { server: serverConfig };
19533
19538
  }
@@ -19749,6 +19754,11 @@ Page URL: ${pageUrl}`);
19749
19754
  appPort
19750
19755
  });
19751
19756
  processManager.start();
19757
+ const cleanup = () => {
19758
+ processManager?.stop().finally(() => process.exit());
19759
+ };
19760
+ process.on("SIGINT", cleanup);
19761
+ process.on("SIGTERM", cleanup);
19752
19762
  }
19753
19763
  let mcpServers;
19754
19764
  const hasPlatformContext = !!(viagenClient && projectId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viagen",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
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",