@vibelet/cli 1.2.107 → 1.2.109

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.
@@ -1,2 +1,2 @@
1
- var c=require("node:fs"),n=require("node:path"),p="@vibelet/cli";function i(r){try{let e=JSON.parse((0,c.readFileSync)(r,"utf8"));if(e.name===p&&typeof e.version=="string"&&e.version.length>0)return e.version}catch{}return null}function l(){return"1.2.107"}var a=l();process.stdout.write(`${a}
1
+ var c=require("node:fs"),n=require("node:path"),p="@vibelet/cli";function i(r){try{let e=JSON.parse((0,c.readFileSync)(r,"utf8"));if(e.name===p&&typeof e.version=="string"&&e.version.length>0)return e.version}catch{}return null}function l(){return"1.2.109"}var a=l();process.stdout.write(`${a}
2
2
  `);
package/dist/vibelet.mjs CHANGED
@@ -11182,6 +11182,13 @@ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs");
11182
11182
 
11183
11183
  /***/ }),
11184
11184
 
11185
+ /***/ 8995:
11186
+ /***/ ((module) => {
11187
+
11188
+ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:module");
11189
+
11190
+ /***/ }),
11191
+
11185
11192
  /***/ 8161:
11186
11193
  /***/ ((module) => {
11187
11194
 
@@ -11238,7 +11245,7 @@ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("zlib");
11238
11245
 
11239
11246
  /***/ }),
11240
11247
 
11241
- /***/ 2113:
11248
+ /***/ 2517:
11242
11249
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => {
11243
11250
 
11244
11251
 
@@ -11256,8 +11263,8 @@ __nccwpck_require__.d(__webpack_exports__, {
11256
11263
  var external_node_child_process_ = __nccwpck_require__(1421);
11257
11264
  // EXTERNAL MODULE: external "node:fs"
11258
11265
  var external_node_fs_ = __nccwpck_require__(3024);
11259
- ;// CONCATENATED MODULE: external "node:module"
11260
- const external_node_module_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:module");
11266
+ // EXTERNAL MODULE: external "node:module"
11267
+ var external_node_module_ = __nccwpck_require__(8995);
11261
11268
  // EXTERNAL MODULE: external "node:path"
11262
11269
  var external_node_path_ = __nccwpck_require__(6760);
11263
11270
  ;// CONCATENATED MODULE: ../../packages/cloudflared-tunnel/index.mjs
@@ -11305,8 +11312,8 @@ function defaultResolveCloudflaredPackageJsonPath() {
11305
11312
  }
11306
11313
 
11307
11314
  const candidates = [
11308
- process.argv[1] ? (0,external_node_module_namespaceObject.createRequire)((0,external_node_path_.resolve)(process.argv[1])) : null,
11309
- (0,external_node_module_namespaceObject.createRequire)((0,external_node_path_.join)(process.cwd(), 'package.json')),
11315
+ process.argv[1] ? (0,external_node_module_.createRequire)((0,external_node_path_.resolve)(process.argv[1])) : null,
11316
+ (0,external_node_module_.createRequire)((0,external_node_path_.join)(process.cwd(), 'package.json')),
11310
11317
  ].filter(Boolean);
11311
11318
 
11312
11319
  for (const requireLike of candidates) {
@@ -13526,18 +13533,20 @@ async function stopDaemonWithHooks({
13526
13533
  __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
13527
13534
  /* harmony import */ var node_child_process__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(1421);
13528
13535
  /* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(3024);
13529
- /* harmony import */ var node_os__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(8161);
13530
- /* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(6760);
13531
- /* harmony import */ var node_url__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(3136);
13532
- /* harmony import */ var qrcode__WEBPACK_IMPORTED_MODULE_5__ = __nccwpck_require__(7514);
13533
- /* harmony import */ var _vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_13__ = __nccwpck_require__(6927);
13534
- /* harmony import */ var _cloudflared_tunnel_manager_mjs__WEBPACK_IMPORTED_MODULE_6__ = __nccwpck_require__(2113);
13535
- /* harmony import */ var _vibelet_launchd_mjs__WEBPACK_IMPORTED_MODULE_10__ = __nccwpck_require__(1010);
13536
- /* harmony import */ var _linux_systemd_mjs__WEBPACK_IMPORTED_MODULE_7__ = __nccwpck_require__(4217);
13537
- /* harmony import */ var _vibelet_stop_logic_mjs__WEBPACK_IMPORTED_MODULE_11__ = __nccwpck_require__(6274);
13538
- /* harmony import */ var _vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_9__ = __nccwpck_require__(4);
13539
- /* harmony import */ var _terminal_wrapper_mjs__WEBPACK_IMPORTED_MODULE_8__ = __nccwpck_require__(1427);
13540
- /* harmony import */ var _vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_12__ = __nccwpck_require__(7721);
13536
+ /* harmony import */ var node_module__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(8995);
13537
+ /* harmony import */ var node_os__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(8161);
13538
+ /* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(6760);
13539
+ /* harmony import */ var node_url__WEBPACK_IMPORTED_MODULE_5__ = __nccwpck_require__(3136);
13540
+ /* harmony import */ var qrcode__WEBPACK_IMPORTED_MODULE_6__ = __nccwpck_require__(7514);
13541
+ /* harmony import */ var _vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_14__ = __nccwpck_require__(6927);
13542
+ /* harmony import */ var _cloudflared_tunnel_manager_mjs__WEBPACK_IMPORTED_MODULE_7__ = __nccwpck_require__(2517);
13543
+ /* harmony import */ var _vibelet_launchd_mjs__WEBPACK_IMPORTED_MODULE_11__ = __nccwpck_require__(1010);
13544
+ /* harmony import */ var _linux_systemd_mjs__WEBPACK_IMPORTED_MODULE_8__ = __nccwpck_require__(4217);
13545
+ /* harmony import */ var _vibelet_stop_logic_mjs__WEBPACK_IMPORTED_MODULE_12__ = __nccwpck_require__(6274);
13546
+ /* harmony import */ var _vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_10__ = __nccwpck_require__(4);
13547
+ /* harmony import */ var _terminal_wrapper_mjs__WEBPACK_IMPORTED_MODULE_9__ = __nccwpck_require__(1427);
13548
+ /* harmony import */ var _vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_13__ = __nccwpck_require__(7721);
13549
+
13541
13550
 
13542
13551
 
13543
13552
 
@@ -13556,25 +13565,25 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
13556
13565
 
13557
13566
  // ─── Paths & constants ─────────────────────────────────────────────────────────
13558
13567
 
13559
- const rootDir = (0,node_path__WEBPACK_IMPORTED_MODULE_3__.resolve)((0,node_path__WEBPACK_IMPORTED_MODULE_3__.dirname)((0,node_url__WEBPACK_IMPORTED_MODULE_4__.fileURLToPath)(import.meta.url)), '..');
13560
- const packageJson = JSON.parse((0,node_fs__WEBPACK_IMPORTED_MODULE_1__.readFileSync)((0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(rootDir, 'package.json'), 'utf8'));
13561
- const daemonDistDir = (0,node_path__WEBPACK_IMPORTED_MODULE_3__.resolve)(rootDir, 'dist');
13562
- const daemonEntryPath = (0,node_path__WEBPACK_IMPORTED_MODULE_3__.resolve)(daemonDistDir, 'index.cjs');
13563
- const vibeletDir = (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)((0,node_os__WEBPACK_IMPORTED_MODULE_2__.homedir)(), '.vibelet');
13564
- const pairingQrPngPath = (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(vibeletDir, 'pairing-qr.png');
13565
- const pairingCodePath = (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(vibeletDir, 'pairing-code.txt');
13566
- const logDir = (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(vibeletDir, 'logs');
13567
- const runtimeDir = (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(vibeletDir, 'runtime');
13568
- const runtimeCurrentDir = (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(runtimeDir, 'current');
13569
- const runtimeMetadataPath = (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(runtimeCurrentDir, 'runtime.json');
13570
- const runtimeDaemonEntryPath = (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(runtimeCurrentDir, 'dist', 'index.cjs');
13571
- const runtimeTerminalControlTokenPath = _terminal_wrapper_mjs__WEBPACK_IMPORTED_MODULE_8__/* .terminalControlTokenPath */ .gJ;
13572
- const stdoutLogPath = (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(logDir, 'daemon.stdout.log');
13573
- const stderrLogPath = (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(logDir, 'daemon.stderr.log');
13574
- const pidFilePath = (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(vibeletDir, 'daemon.pid');
13575
- const relayConfigPath = (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(vibeletDir, 'relay.json');
13576
- const tunnelStatePath = (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(vibeletDir, 'tunnel.json');
13577
- const updateCheckPath = (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(vibeletDir, 'update-check.json');
13568
+ const rootDir = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.resolve)((0,node_path__WEBPACK_IMPORTED_MODULE_4__.dirname)((0,node_url__WEBPACK_IMPORTED_MODULE_5__.fileURLToPath)(import.meta.url)), '..');
13569
+ const packageJson = JSON.parse((0,node_fs__WEBPACK_IMPORTED_MODULE_1__.readFileSync)((0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(rootDir, 'package.json'), 'utf8'));
13570
+ const daemonDistDir = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.resolve)(rootDir, 'dist');
13571
+ const daemonEntryPath = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.resolve)(daemonDistDir, 'index.cjs');
13572
+ const vibeletDir = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)((0,node_os__WEBPACK_IMPORTED_MODULE_3__.homedir)(), '.vibelet');
13573
+ const pairingQrPngPath = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(vibeletDir, 'pairing-qr.png');
13574
+ const pairingCodePath = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(vibeletDir, 'pairing-code.txt');
13575
+ const logDir = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(vibeletDir, 'logs');
13576
+ const runtimeDir = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(vibeletDir, 'runtime');
13577
+ const runtimeCurrentDir = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(runtimeDir, 'current');
13578
+ const runtimeMetadataPath = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(runtimeCurrentDir, 'runtime.json');
13579
+ const runtimeDaemonEntryPath = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(runtimeCurrentDir, 'dist', 'index.cjs');
13580
+ const runtimeTerminalControlTokenPath = _terminal_wrapper_mjs__WEBPACK_IMPORTED_MODULE_9__/* .terminalControlTokenPath */ .gJ;
13581
+ const stdoutLogPath = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(logDir, 'daemon.stdout.log');
13582
+ const stderrLogPath = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(logDir, 'daemon.stderr.log');
13583
+ const pidFilePath = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(vibeletDir, 'daemon.pid');
13584
+ const relayConfigPath = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(vibeletDir, 'relay.json');
13585
+ const tunnelStatePath = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(vibeletDir, 'tunnel.json');
13586
+ const updateCheckPath = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(vibeletDir, 'update-check.json');
13578
13587
  const OFFICIAL_SITE_URL = 'https://vibelet.icu';
13579
13588
  const UPDATE_CHECK_INTERVAL_MS = 4 * 60 * 60 * 1000; // 4 hours
13580
13589
 
@@ -13724,7 +13733,7 @@ function ensureRuntimeInstalled() {
13724
13733
  const runtimeMetadata = readRuntimeMetadata();
13725
13734
 
13726
13735
  if (
13727
- (0,_vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_9__/* .shouldRefuseRuntimeDowngrade */ .Ne)({
13736
+ (0,_vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_10__/* .shouldRefuseRuntimeDowngrade */ .Ne)({
13728
13737
  cliVersion: packageJson.version,
13729
13738
  runtimeVersion: runtimeMetadata?.version,
13730
13739
  runtimeEntryExists: (0,node_fs__WEBPACK_IMPORTED_MODULE_1__.existsSync)(runtimeDaemonEntryPath),
@@ -13747,13 +13756,13 @@ function ensureRuntimeInstalled() {
13747
13756
  }
13748
13757
 
13749
13758
  (0,node_fs__WEBPACK_IMPORTED_MODULE_1__.mkdirSync)(runtimeDir, { recursive: true });
13750
- const nextRuntimeDir = (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(runtimeDir, `current.${Date.now()}.${process.pid}`);
13759
+ const nextRuntimeDir = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(runtimeDir, `current.${Date.now()}.${process.pid}`);
13751
13760
  (0,node_fs__WEBPACK_IMPORTED_MODULE_1__.rmSync)(nextRuntimeDir, { recursive: true, force: true });
13752
13761
  (0,node_fs__WEBPACK_IMPORTED_MODULE_1__.mkdirSync)(nextRuntimeDir, { recursive: true });
13753
13762
  (0,node_fs__WEBPACK_IMPORTED_MODULE_1__.mkdirSync)(logDir, { recursive: true });
13754
13763
 
13755
13764
  (0,node_fs__WEBPACK_IMPORTED_MODULE_1__.writeFileSync)(
13756
- (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(nextRuntimeDir, 'package.json'),
13765
+ (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(nextRuntimeDir, 'package.json'),
13757
13766
  JSON.stringify(
13758
13767
  {
13759
13768
  name: 'vibelet-runtime',
@@ -13766,12 +13775,27 @@ function ensureRuntimeInstalled() {
13766
13775
  'utf8',
13767
13776
  );
13768
13777
 
13769
- (0,node_fs__WEBPACK_IMPORTED_MODULE_1__.cpSync)(daemonDistDir, (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(nextRuntimeDir, 'dist'), {
13778
+ (0,node_fs__WEBPACK_IMPORTED_MODULE_1__.cpSync)(daemonDistDir, (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(nextRuntimeDir, 'dist'), {
13770
13779
  recursive: true,
13771
13780
  dereference: true,
13772
13781
  force: true,
13773
13782
  });
13774
13783
 
13784
+ // The bundled daemon loads node-pty (native, used by the TUI Claude driver) at
13785
+ // runtime via require(). It is not bundled, so copy the installed package into
13786
+ // the isolated runtime's node_modules; otherwise require('node-pty') fails from
13787
+ // ~/.vibelet/runtime/current/dist/index.cjs. Best-effort: TUI is opt-in.
13788
+ try {
13789
+ const ptyRoot = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.dirname)((0,node_module__WEBPACK_IMPORTED_MODULE_2__.createRequire)(import.meta.url).resolve('node-pty/package.json'));
13790
+ (0,node_fs__WEBPACK_IMPORTED_MODULE_1__.cpSync)(ptyRoot, (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(nextRuntimeDir, 'node_modules', 'node-pty'), {
13791
+ recursive: true,
13792
+ dereference: true,
13793
+ force: true,
13794
+ });
13795
+ } catch {
13796
+ // node-pty unavailable (e.g. unsupported platform); the print driver still works.
13797
+ }
13798
+
13775
13799
  (0,node_fs__WEBPACK_IMPORTED_MODULE_1__.writeFileSync)(
13776
13800
  runtimeMetadataPath.replace(runtimeCurrentDir, nextRuntimeDir),
13777
13801
  JSON.stringify(
@@ -13793,7 +13817,7 @@ function ensureRuntimeInstalled() {
13793
13817
  // ─── PID file helpers ───────────────────────────────────────────────────────────
13794
13818
 
13795
13819
  function writePidFile(pid) {
13796
- (0,node_fs__WEBPACK_IMPORTED_MODULE_1__.mkdirSync)((0,node_path__WEBPACK_IMPORTED_MODULE_3__.dirname)(pidFilePath), { recursive: true });
13820
+ (0,node_fs__WEBPACK_IMPORTED_MODULE_1__.mkdirSync)((0,node_path__WEBPACK_IMPORTED_MODULE_4__.dirname)(pidFilePath), { recursive: true });
13797
13821
  (0,node_fs__WEBPACK_IMPORTED_MODULE_1__.writeFileSync)(pidFilePath, String(pid), 'utf8');
13798
13822
  }
13799
13823
 
@@ -13832,7 +13856,7 @@ function isTransientNodePath(p) {
13832
13856
  function stabilizeServiceFile(p) {
13833
13857
  if (!p || !isTransientNodePath(p)) return p;
13834
13858
  try {
13835
- const stable = (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)((0,node_fs__WEBPACK_IMPORTED_MODULE_1__.realpathSync)((0,node_path__WEBPACK_IMPORTED_MODULE_3__.dirname)(p)), (0,node_path__WEBPACK_IMPORTED_MODULE_3__.basename)(p));
13859
+ const stable = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)((0,node_fs__WEBPACK_IMPORTED_MODULE_1__.realpathSync)((0,node_path__WEBPACK_IMPORTED_MODULE_4__.dirname)(p)), (0,node_path__WEBPACK_IMPORTED_MODULE_4__.basename)(p));
13836
13860
  if ((0,node_fs__WEBPACK_IMPORTED_MODULE_1__.existsSync)(stable) && !isTransientNodePath(stable)) return stable;
13837
13861
  } catch {
13838
13862
  /* broken symlink */
@@ -13856,16 +13880,16 @@ function stabilizeServiceDir(dir) {
13856
13880
  // scripts spawned by the daemon (codex, claude) can resolve `node` via PATH,
13857
13881
  // then falls back to common system and user-tool locations.
13858
13882
  function buildServicePath(nodeBinDir) {
13859
- const home = (0,node_os__WEBPACK_IMPORTED_MODULE_2__.homedir)();
13883
+ const home = (0,node_os__WEBPACK_IMPORTED_MODULE_3__.homedir)();
13860
13884
  const pnpmHome =
13861
- process.env.PNPM_HOME || (process.platform === 'win32' ? (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(home, 'pnpm') : (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(home, 'Library', 'pnpm'));
13885
+ process.env.PNPM_HOME || (process.platform === 'win32' ? (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(home, 'pnpm') : (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(home, 'Library', 'pnpm'));
13862
13886
  const baseline =
13863
13887
  process.platform === 'win32'
13864
13888
  ? [
13865
13889
  nodeBinDir,
13866
- (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(home, '.npm-global', 'bin'),
13867
- (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(home, '.local', 'bin'),
13868
- (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(home, '.claude', 'bin'),
13890
+ (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(home, '.npm-global', 'bin'),
13891
+ (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(home, '.local', 'bin'),
13892
+ (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(home, '.claude', 'bin'),
13869
13893
  pnpmHome,
13870
13894
  ]
13871
13895
  : [
@@ -13876,12 +13900,12 @@ function buildServicePath(nodeBinDir) {
13876
13900
  '/bin',
13877
13901
  '/usr/sbin',
13878
13902
  '/sbin',
13879
- (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(home, '.npm-global', 'bin'),
13880
- (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(home, '.local', 'bin'),
13881
- (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(home, '.claude', 'bin'),
13903
+ (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(home, '.npm-global', 'bin'),
13904
+ (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(home, '.local', 'bin'),
13905
+ (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(home, '.claude', 'bin'),
13882
13906
  pnpmHome,
13883
13907
  ];
13884
- const current = (process.env.PATH || '').split(node_path__WEBPACK_IMPORTED_MODULE_3__.delimiter).filter(Boolean).map(stabilizeServiceDir);
13908
+ const current = (process.env.PATH || '').split(node_path__WEBPACK_IMPORTED_MODULE_4__.delimiter).filter(Boolean).map(stabilizeServiceDir);
13885
13909
  const out = [];
13886
13910
  const seen = new Set();
13887
13911
  for (const p of [...baseline, ...current]) {
@@ -13890,7 +13914,7 @@ function buildServicePath(nodeBinDir) {
13890
13914
  seen.add(p);
13891
13915
  }
13892
13916
  }
13893
- return out.join(node_path__WEBPACK_IMPORTED_MODULE_3__.delimiter);
13917
+ return out.join(node_path__WEBPACK_IMPORTED_MODULE_4__.delimiter);
13894
13918
  }
13895
13919
 
13896
13920
  // ─── Platform service backends ──────────────────────────────────────────────────
@@ -13899,8 +13923,8 @@ function createDarwinBackend() {
13899
13923
  const label = 'dev.vibelet.daemon';
13900
13924
  const uid = process.getuid?.();
13901
13925
  const launchDomain = `gui/${uid ?? 0}`;
13902
- const launchAgentsDir = (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)((0,node_os__WEBPACK_IMPORTED_MODULE_2__.homedir)(), 'Library', 'LaunchAgents');
13903
- const plistPath = (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(launchAgentsDir, `${label}.plist`);
13926
+ const launchAgentsDir = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)((0,node_os__WEBPACK_IMPORTED_MODULE_3__.homedir)(), 'Library', 'LaunchAgents');
13927
+ const plistPath = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(launchAgentsDir, `${label}.plist`);
13904
13928
 
13905
13929
  function launchctl(args) {
13906
13930
  return (0,node_child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync)('launchctl', args, { encoding: 'utf8' });
@@ -13911,7 +13935,7 @@ function createDarwinBackend() {
13911
13935
  }
13912
13936
 
13913
13937
  function bootoutService() {
13914
- return (0,_vibelet_launchd_mjs__WEBPACK_IMPORTED_MODULE_10__/* .bootoutLaunchdService */ .B)({
13938
+ return (0,_vibelet_launchd_mjs__WEBPACK_IMPORTED_MODULE_11__/* .bootoutLaunchdService */ .B)({
13915
13939
  launchctl,
13916
13940
  launchDomain,
13917
13941
  label,
@@ -13929,7 +13953,7 @@ function createDarwinBackend() {
13929
13953
  // launchd starts the daemon with a bare PATH; inject a rich one so child
13930
13954
  // CLIs like codex (a sh wrapper that does `exec node`) can find node.
13931
13955
  const envVars = {
13932
- PATH: buildServicePath((0,node_path__WEBPACK_IMPORTED_MODULE_3__.dirname)(nodeBin)),
13956
+ PATH: buildServicePath((0,node_path__WEBPACK_IMPORTED_MODULE_4__.dirname)(nodeBin)),
13933
13957
  VIBE_PORT: String(port),
13934
13958
  };
13935
13959
  if (process.env.VIBELET_RELAY_URL) envVars.VIBELET_RELAY_URL = process.env.VIBELET_RELAY_URL;
@@ -14000,7 +14024,7 @@ ${envSection}
14000
14024
  if (result.status !== 0) {
14001
14025
  fail(
14002
14026
  'Failed to bootstrap vibelet launch agent.',
14003
- [(0,_vibelet_launchd_mjs__WEBPACK_IMPORTED_MODULE_10__/* .describeLaunchctlResult */ .N)(bootoutResult.result), (0,_vibelet_launchd_mjs__WEBPACK_IMPORTED_MODULE_10__/* .describeLaunchctlResult */ .N)(result)].filter(Boolean).join('\n'),
14027
+ [(0,_vibelet_launchd_mjs__WEBPACK_IMPORTED_MODULE_11__/* .describeLaunchctlResult */ .N)(bootoutResult.result), (0,_vibelet_launchd_mjs__WEBPACK_IMPORTED_MODULE_11__/* .describeLaunchctlResult */ .N)(result)].filter(Boolean).join('\n'),
14004
14028
  );
14005
14029
  }
14006
14030
  }
@@ -14016,7 +14040,7 @@ ${envSection}
14016
14040
  stop() {
14017
14041
  const bootoutResult = bootoutService();
14018
14042
  if (!bootoutResult.ok) {
14019
- fail('Failed to unload vibelet launch agent.', (0,_vibelet_launchd_mjs__WEBPACK_IMPORTED_MODULE_10__/* .describeLaunchctlResult */ .N)(bootoutResult.result));
14043
+ fail('Failed to unload vibelet launch agent.', (0,_vibelet_launchd_mjs__WEBPACK_IMPORTED_MODULE_11__/* .describeLaunchctlResult */ .N)(bootoutResult.result));
14020
14044
  }
14021
14045
  // bootout returns before launchd actually finishes unloading. Poll
14022
14046
  // until the service is gone so a follow-up install() doesn't see a
@@ -14036,8 +14060,8 @@ ${envSection}
14036
14060
 
14037
14061
  function createLinuxBackend() {
14038
14062
  const unitName = 'vibelet-daemon.service';
14039
- const unitDir = (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)((0,node_os__WEBPACK_IMPORTED_MODULE_2__.homedir)(), '.config', 'systemd', 'user');
14040
- const unitPath = (0,node_path__WEBPACK_IMPORTED_MODULE_3__.join)(unitDir, unitName);
14063
+ const unitDir = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)((0,node_os__WEBPACK_IMPORTED_MODULE_3__.homedir)(), '.config', 'systemd', 'user');
14064
+ const unitPath = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(unitDir, unitName);
14041
14065
 
14042
14066
  function systemctl(args) {
14043
14067
  return (0,node_child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync)('systemctl', ['--user', ...args], { encoding: 'utf8' });
@@ -14047,10 +14071,10 @@ function createLinuxBackend() {
14047
14071
  return [result?.stderr, result?.stdout].filter(Boolean).join('\n').trim();
14048
14072
  }
14049
14073
 
14050
- let useSystemd = (0,_linux_systemd_mjs__WEBPACK_IMPORTED_MODULE_7__/* .canUseSystemdUserManager */ .X)();
14074
+ let useSystemd = (0,_linux_systemd_mjs__WEBPACK_IMPORTED_MODULE_8__/* .canUseSystemdUserManager */ .X)();
14051
14075
 
14052
14076
  function demoteToDetachedIfSystemdUnavailable(result) {
14053
- if (!(0,_linux_systemd_mjs__WEBPACK_IMPORTED_MODULE_7__/* .isSystemdUserManagerUnavailable */ .a)(resultOutput(result))) {
14077
+ if (!(0,_linux_systemd_mjs__WEBPACK_IMPORTED_MODULE_8__/* .isSystemdUserManagerUnavailable */ .a)(resultOutput(result))) {
14054
14078
  return false;
14055
14079
  }
14056
14080
  useSystemd = false;
@@ -14059,7 +14083,7 @@ function createLinuxBackend() {
14059
14083
 
14060
14084
  function unitContents() {
14061
14085
  const nodeBin = stabilizeServiceFile(process.execPath);
14062
- const servicePath = buildServicePath((0,node_path__WEBPACK_IMPORTED_MODULE_3__.dirname)(nodeBin));
14086
+ const servicePath = buildServicePath((0,node_path__WEBPACK_IMPORTED_MODULE_4__.dirname)(nodeBin));
14063
14087
  return `[Unit]
14064
14088
  Description=Vibelet Daemon
14065
14089
  After=network.target
@@ -14351,7 +14375,7 @@ function isDaemonStartCommand(command) {
14351
14375
 
14352
14376
  async function stopRunningDaemon(backend) {
14353
14377
  try {
14354
- await (0,_vibelet_stop_logic_mjs__WEBPACK_IMPORTED_MODULE_11__/* .stopDaemonWithHooks */ .v)({
14378
+ await (0,_vibelet_stop_logic_mjs__WEBPACK_IMPORTED_MODULE_12__/* .stopDaemonWithHooks */ .v)({
14355
14379
  requestShutdown,
14356
14380
  backendStop: () => backend.stop(),
14357
14381
  waitForDaemonExit,
@@ -14364,7 +14388,7 @@ async function stopRunningDaemon(backend) {
14364
14388
  async function ensureDaemonForTerminalControl(backend) {
14365
14389
  const healthyDaemon = await probeHealth(1_500);
14366
14390
  const tokenReady = (0,node_fs__WEBPACK_IMPORTED_MODULE_1__.existsSync)(runtimeTerminalControlTokenPath);
14367
- const terminalControlReady = healthyDaemon && tokenReady && (0,_vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_9__/* .doesHealthSupportTerminalControl */ .iX)(healthyDaemon);
14391
+ const terminalControlReady = healthyDaemon && tokenReady && (0,_vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_10__/* .doesHealthSupportTerminalControl */ .iX)(healthyDaemon);
14368
14392
  if (terminalControlReady) {
14369
14393
  return healthyDaemon;
14370
14394
  }
@@ -14372,7 +14396,7 @@ async function ensureDaemonForTerminalControl(backend) {
14372
14396
  if (healthyDaemon && !terminalControlReady) {
14373
14397
  const activeSessions = typeof healthyDaemon.activeSessions === 'number' ? healthyDaemon.activeSessions : 0;
14374
14398
  if (activeSessions > 0) {
14375
- const reason = (0,_vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_9__/* .doesHealthSupportTerminalControl */ .iX)(healthyDaemon)
14399
+ const reason = (0,_vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_10__/* .doesHealthSupportTerminalControl */ .iX)(healthyDaemon)
14376
14400
  ? 'terminal-control token is missing'
14377
14401
  : 'the running daemon does not advertise terminal-control support';
14378
14402
  process.stderr.write(
@@ -14391,7 +14415,7 @@ async function ensureDaemonForTerminalControl(backend) {
14391
14415
  }
14392
14416
 
14393
14417
  function validateExplicitCleartextHosts({ hostArg, fallbackHostsArg }) {
14394
- const unsafeHosts = (0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_12__/* .findUnsafeCleartextHosts */ .dE)({ hostArg, fallbackHostsArg });
14418
+ const unsafeHosts = (0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_13__/* .findUnsafeCleartextHosts */ .dE)({ hostArg, fallbackHostsArg });
14395
14419
  if (unsafeHosts.length === 0) {
14396
14420
  return;
14397
14421
  }
@@ -14401,16 +14425,16 @@ function validateExplicitCleartextHosts({ hostArg, fallbackHostsArg }) {
14401
14425
  }
14402
14426
 
14403
14427
  async function printPairingQr(pairingPayload) {
14404
- const payload = JSON.stringify((0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_12__/* .createCompactPairingPayload */ .YP)(pairingPayload));
14405
- const deepLink = (0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_12__/* .buildPairingDeepLink */ .N7)(payload);
14428
+ const payload = JSON.stringify((0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_13__/* .createCompactPairingPayload */ .YP)(pairingPayload));
14429
+ const deepLink = (0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_13__/* .buildPairingDeepLink */ .N7)(payload);
14406
14430
  (0,node_fs__WEBPACK_IMPORTED_MODULE_1__.mkdirSync)(vibeletDir, { recursive: true });
14407
- await qrcode__WEBPACK_IMPORTED_MODULE_5__.toFile(pairingQrPngPath, payload, {
14431
+ await qrcode__WEBPACK_IMPORTED_MODULE_6__.toFile(pairingQrPngPath, payload, {
14408
14432
  type: 'png',
14409
14433
  errorCorrectionLevel: 'M',
14410
14434
  margin: 1,
14411
14435
  scale: 8,
14412
14436
  });
14413
- const qr = await qrcode__WEBPACK_IMPORTED_MODULE_5__.toString(payload, {
14437
+ const qr = await qrcode__WEBPACK_IMPORTED_MODULE_6__.toString(payload, {
14414
14438
  type: 'terminal',
14415
14439
  small: true,
14416
14440
  errorCorrectionLevel: 'M',
@@ -14428,7 +14452,7 @@ async function printPairingQr(pairingPayload) {
14428
14452
  async function printPairingSummary(existingHealth = null) {
14429
14453
  const health = existingHealth ?? (await waitForHealth());
14430
14454
  const pairingPayload = await postJson('/pair/open');
14431
- const connections = (0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_12__/* .normalizePairingConnections */ .No)(pairingPayload);
14455
+ const connections = (0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_13__/* .normalizePairingConnections */ .No)(pairingPayload);
14432
14456
  const [preferredConnection, ...otherConnections] = connections;
14433
14457
 
14434
14458
  process.stdout.write(`Vibelet daemon is ready.\n\n`);
@@ -14437,17 +14461,17 @@ async function printPairingSummary(existingHealth = null) {
14437
14461
  process.stdout.write(`Host: ${pairingPayload.canonicalHost}\n`);
14438
14462
  process.stdout.write(`Port: ${pairingPayload.port}\n`);
14439
14463
  if (preferredConnection) {
14440
- process.stdout.write(`Preferred path: ${(0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_12__/* .formatConnectionSummary */ .uR)(preferredConnection)}\n`);
14464
+ process.stdout.write(`Preferred path: ${(0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_13__/* .formatConnectionSummary */ .uR)(preferredConnection)}\n`);
14441
14465
  }
14442
14466
  if (otherConnections.length > 0) {
14443
14467
  process.stdout.write(`Other paths:\n`);
14444
14468
  otherConnections.forEach((target) => {
14445
- process.stdout.write(` - ${(0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_12__/* .formatConnectionSummary */ .uR)(target)}\n`);
14469
+ process.stdout.write(` - ${(0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_13__/* .formatConnectionSummary */ .uR)(target)}\n`);
14446
14470
  });
14447
14471
  }
14448
14472
  if (preferredConnection) {
14449
14473
  process.stdout.write(
14450
- `Web UI: ${(0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_12__/* .buildWebUiUrl */ .Gv)(preferredConnection, (0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_12__/* .createCompactPairingPayload */ .YP)(pairingPayload))}\n`,
14474
+ `Web UI: ${(0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_13__/* .buildWebUiUrl */ .Gv)(preferredConnection, (0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_13__/* .createCompactPairingPayload */ .YP)(pairingPayload))}\n`,
14451
14475
  );
14452
14476
  }
14453
14477
  process.stdout.write(`Paired devices: ${health.pairedDevices}\n`);
@@ -14505,7 +14529,7 @@ function printHelp() {
14505
14529
  }
14506
14530
 
14507
14531
  function parseNamedArg(name, errorHint) {
14508
- return (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_13__/* .parseNamedArg */ .nE)(process.argv, name, errorHint, fail);
14532
+ return (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_14__/* .parseNamedArg */ .nE)(process.argv, name, errorHint, fail);
14509
14533
  }
14510
14534
 
14511
14535
  function parseRelayArg() {
@@ -14522,6 +14546,14 @@ function parsePortArg() {
14522
14546
  return parsed;
14523
14547
  }
14524
14548
 
14549
+ function normalizeDriver(value) {
14550
+ return String(value ?? '')
14551
+ .trim()
14552
+ .toLowerCase() === 'tui'
14553
+ ? 'tui'
14554
+ : 'print';
14555
+ }
14556
+
14525
14557
  function parseCommandArg(argv) {
14526
14558
  const namedArgsWithValues = new Set([
14527
14559
  '--access',
@@ -14610,10 +14642,10 @@ async function main() {
14610
14642
  return;
14611
14643
  }
14612
14644
 
14613
- if ((0,_terminal_wrapper_mjs__WEBPACK_IMPORTED_MODULE_8__/* .isTerminalAgentCommand */ .$c)(command)) {
14645
+ if ((0,_terminal_wrapper_mjs__WEBPACK_IMPORTED_MODULE_9__/* .isTerminalAgentCommand */ .$c)(command)) {
14614
14646
  const backend = resolveBackend();
14615
14647
  await ensureDaemonForTerminalControl(backend);
14616
- process.exitCode = await (0,_terminal_wrapper_mjs__WEBPACK_IMPORTED_MODULE_8__/* .runManagedNativeTerminal */ .WA)({
14648
+ process.exitCode = await (0,_terminal_wrapper_mjs__WEBPACK_IMPORTED_MODULE_9__/* .runManagedNativeTerminal */ .WA)({
14617
14649
  agent: command,
14618
14650
  args: process.argv.slice(3),
14619
14651
  port,
@@ -14622,26 +14654,26 @@ async function main() {
14622
14654
  return;
14623
14655
  }
14624
14656
 
14625
- const accessTarget = (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_13__/* .parseAccessTargetArg */ .tY)(process.argv, fail);
14626
- if (accessTarget && (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_13__/* .hasLegacyAccessArgs */ .NT)(process.argv, process.env)) {
14657
+ const accessTarget = (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_14__/* .parseAccessTargetArg */ .tY)(process.argv, fail);
14658
+ if (accessTarget && (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_14__/* .hasLegacyAccessArgs */ .NT)(process.argv, process.env)) {
14627
14659
  fail(
14628
14660
  'Do not combine --access with legacy access flags.',
14629
14661
  'Use one form, for example `--access=local`, `--access=remote`, `--access=https://...`, or `--access=<host>`.',
14630
14662
  );
14631
14663
  }
14632
14664
  if (!accessTarget) {
14633
- (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_13__/* .consumeFlag */ .PC)(process.argv, 'remote') ||
14634
- (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_13__/* .consumeFlag */ .PC)(process.argv, 'tunnel') ||
14635
- (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_13__/* .readNpmConfigFlag */ .AW)('remote') ||
14636
- (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_13__/* .readNpmConfigFlag */ .AW)('tunnel');
14665
+ (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_14__/* .consumeFlag */ .PC)(process.argv, 'remote') ||
14666
+ (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_14__/* .consumeFlag */ .PC)(process.argv, 'tunnel') ||
14667
+ (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_14__/* .readNpmConfigFlag */ .AW)('remote') ||
14668
+ (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_14__/* .readNpmConfigFlag */ .AW)('tunnel');
14637
14669
  }
14638
14670
  const localFlag =
14639
14671
  accessTarget?.kind === 'local' ||
14640
14672
  (!accessTarget &&
14641
- ((0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_13__/* .consumeFlag */ .PC)(process.argv, 'local') ||
14642
- (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_13__/* .readNpmConfigFlag */ .AW)('local') ||
14673
+ ((0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_14__/* .consumeFlag */ .PC)(process.argv, 'local') ||
14674
+ (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_14__/* .readNpmConfigFlag */ .AW)('local') ||
14643
14675
  isTruthyEnvFlag(process.env.VIBELET_LOCAL_ONLY)));
14644
- const forceFlag = (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_13__/* .consumeFlag */ .PC)(process.argv, 'force') || (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_13__/* .readNpmConfigFlag */ .AW)('force');
14676
+ const forceFlag = (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_14__/* .consumeFlag */ .PC)(process.argv, 'force') || (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_14__/* .readNpmConfigFlag */ .AW)('force');
14645
14677
  const relayArg =
14646
14678
  accessTarget?.kind === 'relay'
14647
14679
  ? accessTarget.relayUrl
@@ -14676,20 +14708,20 @@ async function main() {
14676
14708
  }
14677
14709
 
14678
14710
  if (shouldManageTunnel) {
14679
- const existing = forceFlag ? null : (0,_cloudflared_tunnel_manager_mjs__WEBPACK_IMPORTED_MODULE_6__/* .getAliveTunnel */ .QQ)(getTunnelManagerOptions());
14711
+ const existing = forceFlag ? null : (0,_cloudflared_tunnel_manager_mjs__WEBPACK_IMPORTED_MODULE_7__/* .getAliveTunnel */ .QQ)(getTunnelManagerOptions());
14680
14712
  if (existing) {
14681
14713
  process.stdout.write(`Reusing tunnel: ${existing.url} (pid ${existing.pid})\n`);
14682
14714
  saveRelayConfig(existing.url);
14683
14715
  } else {
14684
- if (forceFlag) (0,_cloudflared_tunnel_manager_mjs__WEBPACK_IMPORTED_MODULE_6__/* .stopTunnel */ .HM)(getTunnelManagerOptions());
14716
+ if (forceFlag) (0,_cloudflared_tunnel_manager_mjs__WEBPACK_IMPORTED_MODULE_7__/* .stopTunnel */ .HM)(getTunnelManagerOptions());
14685
14717
  process.stdout.write('Starting Cloudflare Tunnel...\n');
14686
14718
  try {
14687
- const tunnel = await (0,_cloudflared_tunnel_manager_mjs__WEBPACK_IMPORTED_MODULE_6__/* .startTunnel */ .DH)({ port, logDir, tunnelStatePath });
14719
+ const tunnel = await (0,_cloudflared_tunnel_manager_mjs__WEBPACK_IMPORTED_MODULE_7__/* .startTunnel */ .DH)({ port, logDir, tunnelStatePath });
14688
14720
  process.stdout.write(`Tunnel ready: ${tunnel.url}\n`);
14689
14721
  saveRelayConfig(tunnel.url);
14690
14722
  } catch (err) {
14691
14723
  managedTunnelFailed = true;
14692
- (0,_cloudflared_tunnel_manager_mjs__WEBPACK_IMPORTED_MODULE_6__/* .clearTunnelState */ .vD)({ tunnelStatePath });
14724
+ (0,_cloudflared_tunnel_manager_mjs__WEBPACK_IMPORTED_MODULE_7__/* .clearTunnelState */ .vD)({ tunnelStatePath });
14693
14725
  clearRelayConfig();
14694
14726
  const message = err instanceof Error ? err.message : String(err);
14695
14727
  process.stderr.write(`${message}\n`);
@@ -14735,9 +14767,9 @@ async function main() {
14735
14767
  // close sessions and flush logs before the service manager kills it.
14736
14768
  await stopRunningDaemon(backend);
14737
14769
  // Also stop tunnel if running
14738
- const tunnelState = (0,_cloudflared_tunnel_manager_mjs__WEBPACK_IMPORTED_MODULE_6__/* .getAliveTunnel */ .QQ)(getTunnelManagerOptions());
14770
+ const tunnelState = (0,_cloudflared_tunnel_manager_mjs__WEBPACK_IMPORTED_MODULE_7__/* .getAliveTunnel */ .QQ)(getTunnelManagerOptions());
14739
14771
  if (tunnelState) {
14740
- (0,_cloudflared_tunnel_manager_mjs__WEBPACK_IMPORTED_MODULE_6__/* .stopTunnel */ .HM)(getTunnelManagerOptions());
14772
+ (0,_cloudflared_tunnel_manager_mjs__WEBPACK_IMPORTED_MODULE_7__/* .stopTunnel */ .HM)(getTunnelManagerOptions());
14741
14773
  process.stdout.write('Tunnel stopped.\n');
14742
14774
  }
14743
14775
  process.stdout.write('Daemon stopped.\n');
@@ -14747,7 +14779,7 @@ async function main() {
14747
14779
  if (command === 'status') {
14748
14780
  process.stdout.write(`Service (${backend.name}): ${backend.statusLabel()}\n`);
14749
14781
  process.stdout.write(`Runtime: ${(0,node_fs__WEBPACK_IMPORTED_MODULE_1__.existsSync)(runtimeDaemonEntryPath) ? runtimeDaemonEntryPath : 'not installed'}\n`);
14750
- const tunnelState = (0,_cloudflared_tunnel_manager_mjs__WEBPACK_IMPORTED_MODULE_6__/* .getAliveTunnel */ .QQ)(getTunnelManagerOptions());
14782
+ const tunnelState = (0,_cloudflared_tunnel_manager_mjs__WEBPACK_IMPORTED_MODULE_7__/* .getAliveTunnel */ .QQ)(getTunnelManagerOptions());
14751
14783
  if (tunnelState) {
14752
14784
  process.stdout.write(`Tunnel: ${tunnelState.url} (pid ${tunnelState.pid})\n`);
14753
14785
  }
@@ -14800,7 +14832,7 @@ async function main() {
14800
14832
  if (command === 'reset') {
14801
14833
  const healthyDaemon = await probeHealth(1_500);
14802
14834
  const hasExplicitConfigOverrides =
14803
- !(0,_vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_9__/* .doesHealthMatchRequestedConnectionConfig */ .nW)({
14835
+ !(0,_vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_10__/* .doesHealthMatchRequestedConnectionConfig */ .nW)({
14804
14836
  health: healthyDaemon,
14805
14837
  relayUrl,
14806
14838
  canonicalHost: hostArg || '',
@@ -14829,7 +14861,7 @@ async function main() {
14829
14861
 
14830
14862
  const healthyDaemon = await probeHealth(1_500);
14831
14863
  const hasExplicitConfigOverrides =
14832
- !(0,_vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_9__/* .doesHealthMatchRequestedConnectionConfig */ .nW)({
14864
+ !(0,_vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_10__/* .doesHealthMatchRequestedConnectionConfig */ .nW)({
14833
14865
  health: healthyDaemon,
14834
14866
  relayUrl,
14835
14867
  canonicalHost: hostArg || '',
@@ -14837,7 +14869,7 @@ async function main() {
14837
14869
  localMode: localFlag,
14838
14870
  }) &&
14839
14871
  (localFlag || Boolean(relayUrl) || Boolean(hostArg) || Boolean(fallbackHostsArg));
14840
- const existingHealth = (0,_vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_9__/* .shouldReuseHealthyDaemon */ .ZN)({
14872
+ const existingHealth = (0,_vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_10__/* .shouldReuseHealthyDaemon */ .ZN)({
14841
14873
  command,
14842
14874
  daemonHealthy: Boolean(healthyDaemon),
14843
14875
  hasExplicitConfigOverrides,
@@ -14849,9 +14881,16 @@ async function main() {
14849
14881
  const runningVersion = typeof existingHealth.version === 'string' ? existingHealth.version : '';
14850
14882
  const activeSessions = typeof existingHealth.activeSessions === 'number' ? existingHealth.activeSessions : 0;
14851
14883
  const isOutdated = runningVersion && compareVersions(runningVersion, packageJson.version) < 0;
14852
- if (isOutdated && activeSessions === 0) {
14884
+ // Only force a driver switch when the user explicitly requested one (flag/env).
14885
+ const requestedDriver = process.env.VIBE_CLAUDE_DRIVER ? normalizeDriver(process.env.VIBE_CLAUDE_DRIVER) : null;
14886
+ const runningDriver = normalizeDriver(existingHealth.claudeDriverMode);
14887
+ const driverMismatch = requestedDriver !== null && runningDriver !== requestedDriver;
14888
+ const needsRestart = Boolean(isOutdated) || driverMismatch;
14889
+ if (needsRestart && activeSessions === 0) {
14853
14890
  process.stdout.write(
14854
- `Daemon is running v${runningVersion}, CLI is v${packageJson.version}. Restarting daemon to upgrade...\n`,
14891
+ isOutdated
14892
+ ? `Daemon is running v${runningVersion}, CLI is v${packageJson.version}. Restarting daemon to upgrade...\n`
14893
+ : `Daemon is using the "${runningDriver}" Claude driver; you requested "${requestedDriver}". Restarting to switch...\n`,
14855
14894
  );
14856
14895
  await stopRunningDaemon(backend);
14857
14896
  process.stdout.write('Daemon stopped. Starting...\n');
@@ -14866,6 +14905,13 @@ async function main() {
14866
14905
  `Daemon is running v${runningVersion}, CLI is v${packageJson.version}, but ${activeSessions} active session(s) would be interrupted.\n`,
14867
14906
  );
14868
14907
  process.stdout.write('Run `npx vibelet restart` once those sessions are idle to upgrade the daemon.\n');
14908
+ } else if (driverMismatch) {
14909
+ process.stdout.write(
14910
+ `Daemon is using the "${runningDriver}" Claude driver; you requested "${requestedDriver}", but ${activeSessions} active session(s) would be interrupted.\n`,
14911
+ );
14912
+ process.stdout.write(
14913
+ `Run \`npx vibelet restart --claude-driver ${requestedDriver}\` once those sessions are idle to switch.\n`,
14914
+ );
14869
14915
  } else {
14870
14916
  process.stdout.write('Vibelet daemon is already running.\n');
14871
14917
  process.stdout.write('Reusing the current runtime so active sessions stay alive.\n');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibelet/cli",
3
- "version": "1.2.107",
3
+ "version": "1.2.109",
4
4
  "description": "Cross-platform CLI for installing and running the Vibelet daemon",
5
5
  "homepage": "https://vibelet.icu",
6
6
  "files": [