viagen 0.2.0 → 0.2.1

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
@@ -267,9 +267,11 @@ async function deploySandbox(opts) {
267
267
  `Dev server failed to start: ${ready.error}`
268
268
  );
269
269
  }
270
+ const appBaseUrl = hasAppCommand ? sandbox2.domain(appPort) : baseUrl;
270
271
  return {
271
272
  url: url2,
272
273
  token,
274
+ appUrl: appBaseUrl,
273
275
  sandboxId: sandbox2.sandboxId,
274
276
  mode: useGit ? "git" : "upload",
275
277
  streamLogs: (opts2) => devServer.logs(opts2),
@@ -19477,7 +19479,15 @@ var ProcessManager = class {
19477
19479
  const stderrFd = openSync(this.stderrLog, "a");
19478
19480
  this.child = spawn(this.command, [], {
19479
19481
  cwd: this.cwd,
19480
- env: { ...process.env, ...this.env, PORT: String(this.appPort), __VIAGEN_CHILD: "1" },
19482
+ env: {
19483
+ ...process.env,
19484
+ ...this.env,
19485
+ PORT: String(this.appPort),
19486
+ __VIAGEN_CHILD: "1",
19487
+ // Don't pass auth token to child — the app shouldn't require auth.
19488
+ // Auth is handled by the standalone viagen server in front.
19489
+ VIAGEN_AUTH_TOKEN: ""
19490
+ },
19481
19491
  stdio: ["ignore", stdoutFd, stderrFd],
19482
19492
  shell: true,
19483
19493
  // Detached so the app survives if the viagen chat server restarts
@@ -20824,11 +20834,12 @@ async function sandbox(args, options) {
20824
20834
  clearInterval(spinner);
20825
20835
  process.stdout.write("\r \u2713 Sandbox ready! \n");
20826
20836
  const baseUrl = result.url.replace(/\/t\/.*$/, "");
20827
- const iframeUrl = `${baseUrl}/via/iframe/t/${result.token}`;
20837
+ const appParam = result.appUrl !== baseUrl ? `&appUrl=${encodeURIComponent(`${result.appUrl}/t/${result.token}`)}` : "";
20838
+ const iframeUrl = `${baseUrl}/via/iframe/t/${result.token}${appParam ? `?${appParam.slice(1)}` : ""}`;
20828
20839
  const chatUrl = `${baseUrl}/via/ui/t/${result.token}`;
20829
20840
  const popUrl = `${baseUrl}/via/pop/t/${result.token}`;
20830
20841
  console.log("");
20831
- console.log(` App: ${result.url}`);
20842
+ console.log(` App: ${result.appUrl}/t/${result.token}`);
20832
20843
  console.log(` App + Chat: ${popUrl}`);
20833
20844
  console.log(` Split view: ${iframeUrl}`);
20834
20845
  console.log(` Chat only: ${chatUrl}`);
package/dist/index.d.ts CHANGED
@@ -64,6 +64,8 @@ interface DeploySandboxResult {
64
64
  sandboxId: string;
65
65
  /** Deployment mode used. */
66
66
  mode: "git" | "upload";
67
+ /** App URL (different subdomain in standalone mode, same as url otherwise). */
68
+ appUrl: string;
67
69
  /** Stream dev server logs. Yields { data, stream } entries. Call close() to stop. */
68
70
  streamLogs(opts?: {
69
71
  signal?: AbortSignal;
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.2.0" : "0.0.0";
114
+ const currentVersion = true ? "0.2.1" : "0.0.0";
115
115
  debug("health", `version resolved: ${currentVersion}`);
116
116
  let versionCache = null;
117
117
  server.middlewares.use("/via/version", (_req, res) => {
@@ -19075,7 +19075,15 @@ var ProcessManager = class {
19075
19075
  const stderrFd = openSync(this.stderrLog, "a");
19076
19076
  this.child = spawn(this.command, [], {
19077
19077
  cwd: this.cwd,
19078
- env: { ...process.env, ...this.env, PORT: String(this.appPort), __VIAGEN_CHILD: "1" },
19078
+ env: {
19079
+ ...process.env,
19080
+ ...this.env,
19081
+ PORT: String(this.appPort),
19082
+ __VIAGEN_CHILD: "1",
19083
+ // Don't pass auth token to child — the app shouldn't require auth.
19084
+ // Auth is handled by the standalone viagen server in front.
19085
+ VIAGEN_AUTH_TOKEN: ""
19086
+ },
19079
19087
  stdio: ["ignore", stdoutFd, stderrFd],
19080
19088
  shell: true,
19081
19089
  // Detached so the app survives if the viagen chat server restarts
@@ -19553,9 +19561,11 @@ async function deploySandbox(opts) {
19553
19561
  `Dev server failed to start: ${ready.error}`
19554
19562
  );
19555
19563
  }
19564
+ const appBaseUrl = hasAppCommand ? sandbox.domain(appPort) : baseUrl;
19556
19565
  return {
19557
19566
  url: url2,
19558
19567
  token,
19568
+ appUrl: appBaseUrl,
19559
19569
  sandboxId: sandbox.sandboxId,
19560
19570
  mode: useGit ? "git" : "upload",
19561
19571
  streamLogs: (opts2) => devServer.logs(opts2),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viagen",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
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",