vibora 5.5.1 → 6.1.0

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/bin/vibora.js CHANGED
@@ -785,7 +785,7 @@ var init_prompt = __esm(() => {
785
785
  });
786
786
 
787
787
  // cli/src/utils/server.ts
788
- import { existsSync, readFileSync } from "fs";
788
+ import { existsSync, readFileSync, writeFileSync, mkdirSync } from "fs";
789
789
  import { join } from "path";
790
790
  import { homedir } from "os";
791
791
  function getPortFromSettings(settings) {
@@ -846,6 +846,24 @@ function discoverServerUrl(urlOverride, portOverride) {
846
846
  }
847
847
  return `http://localhost:${DEFAULT_PORT}`;
848
848
  }
849
+ function updateSettingsPort(port) {
850
+ const viboraDir = getViboraDir();
851
+ const settingsPath = join(viboraDir, "settings.json");
852
+ let settings = {};
853
+ try {
854
+ if (existsSync(settingsPath)) {
855
+ settings = JSON.parse(readFileSync(settingsPath, "utf-8"));
856
+ }
857
+ } catch {}
858
+ if (!settings.server || typeof settings.server !== "object") {
859
+ settings.server = {};
860
+ }
861
+ settings.server.port = port;
862
+ if (!existsSync(viboraDir)) {
863
+ mkdirSync(viboraDir, { recursive: true });
864
+ }
865
+ writeFileSync(settingsPath, JSON.stringify(settings, null, 2), "utf-8");
866
+ }
849
867
  function getViboraDir() {
850
868
  if (process.env.VIBORA_DIR) {
851
869
  return expandPath(process.env.VIBORA_DIR);
@@ -32338,7 +32356,7 @@ init_errors();
32338
32356
 
32339
32357
  // cli/src/utils/process.ts
32340
32358
  init_server();
32341
- import { existsSync as existsSync2, readFileSync as readFileSync2, writeFileSync, unlinkSync, mkdirSync } from "fs";
32359
+ import { existsSync as existsSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, unlinkSync, mkdirSync as mkdirSync2 } from "fs";
32342
32360
  import { join as join2, dirname } from "path";
32343
32361
  function getPidPath() {
32344
32362
  return join2(getViboraDir(), "vibora.pid");
@@ -32347,9 +32365,9 @@ function writePid(pid) {
32347
32365
  const pidPath = getPidPath();
32348
32366
  const dir = dirname(pidPath);
32349
32367
  if (!existsSync2(dir)) {
32350
- mkdirSync(dir, { recursive: true });
32368
+ mkdirSync2(dir, { recursive: true });
32351
32369
  }
32352
- writeFileSync(pidPath, pid.toString(), "utf-8");
32370
+ writeFileSync2(pidPath, pid.toString(), "utf-8");
32353
32371
  }
32354
32372
  function readPid() {
32355
32373
  const pidPath = getPidPath();
@@ -32592,7 +32610,7 @@ function installUv() {
32592
32610
  var package_default = {
32593
32611
  name: "vibora",
32594
32612
  private: true,
32595
- version: "5.5.1",
32613
+ version: "6.1.0",
32596
32614
  description: "The Vibe Engineer's Cockpit",
32597
32615
  license: "PolyForm-Shield-1.0.0",
32598
32616
  type: "module",
@@ -32776,6 +32794,9 @@ async function handleUpCommand(flags) {
32776
32794
  }
32777
32795
  }
32778
32796
  const port = getPort(flags.port);
32797
+ if (flags.port) {
32798
+ updateSettingsPort(port);
32799
+ }
32779
32800
  const host = flags.host ? "0.0.0.0" : "localhost";
32780
32801
  const packageRoot = getPackageRoot();
32781
32802
  const serverPath = join3(packageRoot, "server", "index.js");