vibelet 1.2.224 → 1.2.227
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/README.md +14 -37
- package/dist/index.cjs +1 -1
- package/dist/inventory-scan-worker.cjs +1 -1
- package/dist/{tailcat/vibelet-tailcat-darwin-amd64 → remoteDirect/vibelet-remote-direct-darwin-amd64} +0 -0
- package/dist/{tailcat/vibelet-tailcat-darwin-arm64 → remoteDirect/vibelet-remote-direct-darwin-arm64} +0 -0
- package/dist/{tailcat/vibelet-tailcat-linux-amd64 → remoteDirect/vibelet-remote-direct-linux-amd64} +0 -0
- package/dist/{tailcat/vibelet-tailcat-linux-arm64 → remoteDirect/vibelet-remote-direct-linux-arm64} +0 -0
- package/dist/{tailcat/vibelet-tailcat-win32-amd64.exe → remoteDirect/vibelet-remote-direct-win32-amd64.exe} +0 -0
- package/dist/{tailcat/vibelet-tailcat-win32-arm64.exe → remoteDirect/vibelet-remote-direct-win32-arm64.exe} +0 -0
- package/dist/runtime-version.cjs +1 -1
- package/dist/vibelet.mjs +282 -289
- package/dist/web/assets/App-DfyOZYmt.js +12 -0
- package/dist/web/assets/App-t0H-03RW.css +1 -0
- package/dist/web/assets/BrowserControlPanel-dQOp1WlN.js +1 -0
- package/dist/web/assets/ChipGroup-FQF2g0Fr.js +1 -0
- package/dist/web/assets/DiffDrawer-CHjkoGPE.js +2 -0
- package/dist/web/assets/FileCodeEditor-yqSvo7VZ.css +1 -0
- package/dist/web/assets/FilesControlPanel-A7LFhjRm.js +1 -0
- package/dist/web/assets/FilesControlPanel-DsKJrFYk.css +1 -0
- package/dist/web/assets/GlobalPendingDialog-BeOMI3dc.js +1 -0
- package/dist/web/assets/ImageViewer-BQ9YKQDY.js +1 -0
- package/dist/web/assets/ImageViewer-L8SQkFy1.css +1 -0
- package/dist/web/assets/LanguageSettingsPanel-Benilh-Y.js +1 -0
- package/dist/web/assets/NewSessionDialog-B0YMv6RR.js +1 -0
- package/dist/web/assets/NewSessionDialog-CxPwD87T.css +1 -0
- package/dist/web/assets/NotificationSettingsPanel-B_k_PfhC.js +1 -0
- package/dist/web/assets/TerminalControlPanel-DCmHOa9Y.js +13 -0
- package/dist/web/assets/ThemeSettingsPanel-DNDIWk0L.js +1 -0
- package/dist/web/assets/arrow-right-Boi1uHFr.js +1 -0
- package/dist/web/assets/collectMessageImages-BROUPbis.js +3 -0
- package/dist/web/assets/file-editor-FileCodeEditor-CTEWh6kV.js +13 -0
- package/dist/web/assets/file-editor-MarkdownLivePreview-Blr8OOKh.js +1 -0
- package/dist/web/assets/file-editor-clike-B9uivgTg.js +1 -0
- package/dist/web/assets/file-editor-go-CTD25R5P.js +1 -0
- package/dist/web/assets/file-editor-index-C1T947NK.js +13 -0
- package/dist/web/assets/file-editor-index-Cj9yLeGr.js +1 -0
- package/dist/web/assets/file-editor-index-Ckq0jexT.js +6 -0
- package/dist/web/assets/file-editor-index-CxU5Gq1E.js +1 -0
- package/dist/web/assets/file-editor-index-Dv8iMJMj.js +3 -0
- package/dist/web/assets/file-editor-index-DvdSLdIk.js +1 -0
- package/dist/web/assets/file-editor-index-DvenUGpC.js +1 -0
- package/dist/web/assets/file-editor-index-iFiQtQEr.js +1 -0
- package/dist/web/assets/file-editor-rust-Bh1DdySD.js +1 -0
- package/dist/web/assets/file-editor-shell-CjFT_Tl9.js +1 -0
- package/dist/web/assets/file-editor-sql-B0zzsL_y.js +1 -0
- package/dist/web/assets/file-editor-swift-BzpIVaGY.js +1 -0
- package/dist/web/assets/file-editor-toml-Bm5Em-hy.js +1 -0
- package/dist/web/assets/file-editor-yaml-DsCXHVTH.js +1 -0
- package/dist/web/assets/folder-plus-tHXFtdSw.js +1 -0
- package/dist/web/assets/ghostty-vt-DOMeXDrv.wasm +0 -0
- package/dist/web/assets/highlighted-body-TPN3WLV5-D5c7I9mI.js +1 -0
- package/dist/web/assets/index-CoCv7_xG.css +1 -0
- package/dist/web/assets/index-P4_gSQhN.js +71 -0
- package/dist/web/assets/mermaid-O7DHMXV3-BIyESbw5.js +120 -0
- package/dist/web/assets/mermaid-O7DHMXV3-tkqeC_Xz.css +1 -0
- package/dist/web/ghostty-license.txt +21 -0
- package/dist/web/index.html +2 -2
- package/package.json +3 -3
- package/dist/web/assets/App-CAJ3pB85.js +0 -12
- package/dist/web/assets/ArchiveSyncPanel-_lLATKjA.js +0 -1
- package/dist/web/assets/ConnectionSettingsPanel-4MhvD7ra.js +0 -1
- package/dist/web/assets/DaemonSettingsPanel-zHBCPi0h.js +0 -1
- package/dist/web/assets/DiffDrawer-BGx5Fl6h.js +0 -2
- package/dist/web/assets/FilesControlPanel-D7SPEihe.js +0 -2
- package/dist/web/assets/LanguageSettingsPanel-Bofh0WHQ.js +0 -1
- package/dist/web/assets/NotificationSettingsPanel-BafuO9ww.js +0 -1
- package/dist/web/assets/SavedTargetsPanel-lutvzUOp.js +0 -1
- package/dist/web/assets/ThemeSettingsPanel-ARFGBpot.js +0 -1
- package/dist/web/assets/file-text-CpofUkq8.js +0 -1
- package/dist/web/assets/highlighted-body-TPN3WLV5-CEWZdsEu.js +0 -1
- package/dist/web/assets/index-CFMLtw93.css +0 -1
- package/dist/web/assets/index-D3KotGfi.js +0 -17
- package/dist/web/assets/mermaid-O7DHMXV3-BPtfCfol.css +0 -1
- package/dist/web/assets/mermaid-O7DHMXV3-DuCy9NVb.js +0 -124
- /package/dist/web/assets/{splash-logo-SQcOtj-8.png → logo-SQcOtj-8.png} +0 -0
package/dist/vibelet.mjs
CHANGED
|
@@ -14307,63 +14307,34 @@ async function tryUpdateRunningDaemonRelay({
|
|
|
14307
14307
|
/* harmony export */ });
|
|
14308
14308
|
function printCliHelp({ packageJson, port }) {
|
|
14309
14309
|
process.stdout.write(`Vibelet ${packageJson.version}\n\n`);
|
|
14310
|
-
process.stdout.write(`Package names:\n`);
|
|
14311
|
-
process.stdout.write(` @vibelet/cli\n`);
|
|
14312
|
-
process.stdout.write(` vibelet\n\n`);
|
|
14313
14310
|
process.stdout.write(`Usage:\n`);
|
|
14314
|
-
|
|
14315
|
-
|
|
14316
|
-
|
|
14317
|
-
|
|
14318
|
-
|
|
14319
|
-
|
|
14320
|
-
|
|
14321
|
-
|
|
14322
|
-
|
|
14323
|
-
|
|
14324
|
-
|
|
14325
|
-
|
|
14326
|
-
|
|
14327
|
-
|
|
14328
|
-
|
|
14329
|
-
|
|
14330
|
-
|
|
14331
|
-
|
|
14332
|
-
|
|
14333
|
-
|
|
14334
|
-
|
|
14335
|
-
|
|
14336
|
-
|
|
14337
|
-
process.stdout.write(
|
|
14338
|
-
process.stdout.write(`
|
|
14339
|
-
process.stdout.write(`
|
|
14340
|
-
process.stdout.write(
|
|
14341
|
-
process.stdout.write(` npx ${packageJson.name} --version Show the installed CLI version\n`);
|
|
14342
|
-
process.stdout.write(`\n`);
|
|
14343
|
-
process.stdout.write(`You can also invoke the published alias with:\n`);
|
|
14344
|
-
process.stdout.write(` npx ${packageJson.name === 'vibelet' ? '@vibelet/cli' : 'vibelet'}\n`);
|
|
14345
|
-
process.stdout.write(` vibelet\n\n`);
|
|
14346
|
-
process.stdout.write(`Remote access:\n`);
|
|
14347
|
-
process.stdout.write(` # Tailcat and Cloudflare are on by default for start/reset/restart\n`);
|
|
14348
|
-
process.stdout.write(` npx ${packageJson.name}\n\n`);
|
|
14349
|
-
process.stdout.write(` # Want LAN/local-only pairing for this run?\n`);
|
|
14350
|
-
process.stdout.write(` npx ${packageJson.name} --access=local\n\n`);
|
|
14351
|
-
process.stdout.write(` # Use Cloudflare instead of Tailcat (add --force for a fresh URL):\n`);
|
|
14352
|
-
process.stdout.write(` npx ${packageJson.name} --cloudflare\n\n`);
|
|
14353
|
-
process.stdout.write(` # Or bring your own tunnel and pass the URL manually:\n`);
|
|
14354
|
-
process.stdout.write(` npx cloudflared tunnel --protocol auto --url http://localhost:${port}\n`);
|
|
14355
|
-
process.stdout.write(` ngrok http ${port}\n`);
|
|
14356
|
-
process.stdout.write(` npx ${packageJson.name} --access=https://<your-tunnel-url>\n\n`);
|
|
14357
|
-
process.stdout.write(` # Tailscale (P2P VPN, no tunnel needed)\n`);
|
|
14358
|
-
process.stdout.write(` npx ${packageJson.name} --access=<tailscale-ip>\n\n`);
|
|
14359
|
-
process.stdout.write(`\nTailcat direct access:\n`);
|
|
14360
|
-
process.stdout.write(` npx ${packageJson.name} --tailcat\n`);
|
|
14361
|
-
process.stdout.write(
|
|
14362
|
-
` # Add --cloudflare to --tailcat to enable both transports.\n # Tailcat does not change system VPN, DNS, or routes.\n\n`,
|
|
14363
|
-
);
|
|
14364
|
-
process.stdout.write(
|
|
14365
|
-
`Legacy aliases still work: --access=remote, --local, --relay, --host, --fallback-hosts, --remote, --tunnel.\n`,
|
|
14366
|
-
);
|
|
14311
|
+
const commands = [
|
|
14312
|
+
['', 'Install/start the daemon, enable Remote Direct, and print a pairing QR code'],
|
|
14313
|
+
['start', 'Start the daemon and print a pairing QR code'],
|
|
14314
|
+
['--cloudflare', 'Add a Cloudflare Tunnel as an optional remote path'],
|
|
14315
|
+
['--cloudflare --force', 'Add Cloudflare with a fresh tunnel URL'],
|
|
14316
|
+
['--access=local', 'Use LAN/local pairing only for this run'],
|
|
14317
|
+
['--access=https://<url>', 'Use your own remote relay URL'],
|
|
14318
|
+
['--access=<host>,<fallbacks>', 'Set LAN or existing network addresses'],
|
|
14319
|
+
['--port <port>', 'Set the daemon listening port'],
|
|
14320
|
+
['--claude-code-sdk', 'Use the Claude Code SDK execution driver'],
|
|
14321
|
+
['stop', 'Stop the daemon'],
|
|
14322
|
+
['restart', 'Restart the daemon'],
|
|
14323
|
+
['status', 'Show service and daemon diagnostics'],
|
|
14324
|
+
['logs', 'Print recent daemon logs'],
|
|
14325
|
+
['reset', 'Clear pairings and saved device connections; print a fresh QR code'],
|
|
14326
|
+
['claude [...args]', 'Start Claude Code with Vibelet App takeover'],
|
|
14327
|
+
['codex [...args]', 'Start Codex with Vibelet App takeover'],
|
|
14328
|
+
['--help', 'Show this help text'],
|
|
14329
|
+
['--version', 'Show the installed CLI version'],
|
|
14330
|
+
];
|
|
14331
|
+
for (const [args, description] of commands) {
|
|
14332
|
+
process.stdout.write(` npx ${packageJson.name} ${args} ${description}\n`);
|
|
14333
|
+
}
|
|
14334
|
+
process.stdout.write(`\nRemote Direct is enabled by default. Cloudflare starts only when requested.\n`);
|
|
14335
|
+
process.stdout.write(`Scan a new QR code with the current Vibelet app after changing access mode.\n`);
|
|
14336
|
+
process.stdout.write(`The daemon listens on port ${port}.\n`);
|
|
14337
|
+
process.stdout.write(`\nPackage names: @vibelet/cli, vibelet\n`);
|
|
14367
14338
|
}
|
|
14368
14339
|
|
|
14369
14340
|
|
|
@@ -14572,17 +14543,17 @@ function normalizePairingConnections(pairingPayload) {
|
|
|
14572
14543
|
typeof target.stability === 'string',
|
|
14573
14544
|
)
|
|
14574
14545
|
.map((target) => {
|
|
14575
|
-
const
|
|
14576
|
-
target.
|
|
14577
|
-
typeof target.
|
|
14578
|
-
target.
|
|
14579
|
-
target.
|
|
14580
|
-
Number.isInteger(target.
|
|
14581
|
-
target.
|
|
14582
|
-
target.
|
|
14546
|
+
const remoteDirect =
|
|
14547
|
+
target.remoteDirect &&
|
|
14548
|
+
typeof target.remoteDirect.serverAddress === 'string' &&
|
|
14549
|
+
target.remoteDirect.serverAddress.startsWith('tc') &&
|
|
14550
|
+
target.remoteDirect.serverAddress.length <= 4096 &&
|
|
14551
|
+
Number.isInteger(target.remoteDirect.remotePort) &&
|
|
14552
|
+
target.remoteDirect.remotePort > 0 &&
|
|
14553
|
+
target.remoteDirect.remotePort <= 65535
|
|
14583
14554
|
? {
|
|
14584
|
-
serverAddress: target.
|
|
14585
|
-
remotePort: target.
|
|
14555
|
+
serverAddress: target.remoteDirect.serverAddress,
|
|
14556
|
+
remotePort: target.remoteDirect.remotePort,
|
|
14586
14557
|
}
|
|
14587
14558
|
: null;
|
|
14588
14559
|
return {
|
|
@@ -14592,7 +14563,7 @@ function normalizePairingConnections(pairingPayload) {
|
|
|
14592
14563
|
...(target.secure === true ? { secure: true } : {}),
|
|
14593
14564
|
source: target.source,
|
|
14594
14565
|
stability: target.stability,
|
|
14595
|
-
...(
|
|
14566
|
+
...(remoteDirect ? { remoteDirect } : {}),
|
|
14596
14567
|
};
|
|
14597
14568
|
})
|
|
14598
14569
|
.filter((target) => target.host && target.port > 0)
|
|
@@ -14602,8 +14573,8 @@ function normalizePairingConnections(pairingPayload) {
|
|
|
14602
14573
|
const seen = new Set();
|
|
14603
14574
|
return targets.filter((target) => {
|
|
14604
14575
|
const key =
|
|
14605
|
-
target.source === '
|
|
14606
|
-
? `
|
|
14576
|
+
target.source === 'remoteDirect' && target.remoteDirect
|
|
14577
|
+
? `remoteDirect:${target.remoteDirect.remotePort}`
|
|
14607
14578
|
: `${target.host}:${target.port}:${target.secure === true ? 'secure' : 'plain'}`;
|
|
14608
14579
|
if (seen.has(key)) {
|
|
14609
14580
|
return false;
|
|
@@ -14706,8 +14677,8 @@ function createCompactPairingPayload(pairingPayload) {
|
|
|
14706
14677
|
if (connections.length > 0) {
|
|
14707
14678
|
compactPayload.o = connections.map((target) => {
|
|
14708
14679
|
const tuple = [target.kind, target.host, target.port, target.source, target.stability, target.secure === true];
|
|
14709
|
-
if (target.
|
|
14710
|
-
tuple.push(target.
|
|
14680
|
+
if (target.remoteDirect) {
|
|
14681
|
+
tuple.push(target.remoteDirect.serverAddress, target.remoteDirect.remotePort);
|
|
14711
14682
|
}
|
|
14712
14683
|
return tuple;
|
|
14713
14684
|
});
|
|
@@ -14717,10 +14688,9 @@ function createCompactPairingPayload(pairingPayload) {
|
|
|
14717
14688
|
|
|
14718
14689
|
/**
|
|
14719
14690
|
* Keep camera-scanned QR codes small enough for reliable terminal capture.
|
|
14720
|
-
*
|
|
14721
|
-
*
|
|
14722
|
-
*
|
|
14723
|
-
* transport capability on its own.
|
|
14691
|
+
* A RemoteDirect capability must survive QR compaction even when LAN is primary:
|
|
14692
|
+
* off-network phones need it before they can fetch the daemon's full routes.
|
|
14693
|
+
* Otherwise preserve the primary tuple when h/p cannot represent its transport.
|
|
14724
14694
|
*/
|
|
14725
14695
|
function createScannablePairingPayload(pairingPayload) {
|
|
14726
14696
|
const compactPayload = {
|
|
@@ -14733,13 +14703,16 @@ function createScannablePairingPayload(pairingPayload) {
|
|
|
14733
14703
|
};
|
|
14734
14704
|
const connections = normalizePairingConnections(pairingPayload);
|
|
14735
14705
|
const [primary] = connections;
|
|
14706
|
+
if (connections.some((target) => target.remoteDirect)) {
|
|
14707
|
+
return { ...compactPayload, o: createCompactPairingPayload(pairingPayload).o };
|
|
14708
|
+
}
|
|
14736
14709
|
// Keep the common HTTPS relay QR compact while preserving enough transport
|
|
14737
14710
|
// semantics for clients to avoid treating host:443 as a legacy direct host.
|
|
14738
14711
|
if (primary?.kind === 'relay' && primary.secure === true && primary.port === 443) {
|
|
14739
14712
|
compactPayload.r = 1;
|
|
14740
14713
|
}
|
|
14741
14714
|
const needsExplicitTransport =
|
|
14742
|
-
primary && (Boolean(primary.
|
|
14715
|
+
primary && (Boolean(primary.remoteDirect) || (primary.secure === true && primary.port !== 443));
|
|
14743
14716
|
const compactFallback = !needsExplicitTransport
|
|
14744
14717
|
? connections
|
|
14745
14718
|
.slice(1)
|
|
@@ -14748,7 +14721,7 @@ function createScannablePairingPayload(pairingPayload) {
|
|
|
14748
14721
|
primary?.secure !== true &&
|
|
14749
14722
|
target.kind === 'direct' &&
|
|
14750
14723
|
target.secure !== true &&
|
|
14751
|
-
!target.
|
|
14724
|
+
!target.remoteDirect &&
|
|
14752
14725
|
target.port === primary.port,
|
|
14753
14726
|
)
|
|
14754
14727
|
: undefined;
|
|
@@ -14764,8 +14737,8 @@ function createScannablePairingPayload(pairingPayload) {
|
|
|
14764
14737
|
primary.stability,
|
|
14765
14738
|
primary.secure === true,
|
|
14766
14739
|
];
|
|
14767
|
-
if (primary.
|
|
14768
|
-
tuple.push(primary.
|
|
14740
|
+
if (primary.remoteDirect) {
|
|
14741
|
+
tuple.push(primary.remoteDirect.serverAddress, primary.remoteDirect.remotePort);
|
|
14769
14742
|
}
|
|
14770
14743
|
compactPayload.o = [tuple];
|
|
14771
14744
|
}
|
|
@@ -14782,8 +14755,8 @@ function formatConnectionSourceLabel(source) {
|
|
|
14782
14755
|
return 'Manual Host';
|
|
14783
14756
|
case 'tailscale':
|
|
14784
14757
|
return 'Tailscale';
|
|
14785
|
-
case '
|
|
14786
|
-
return '
|
|
14758
|
+
case 'remoteDirect':
|
|
14759
|
+
return 'Remote Direct';
|
|
14787
14760
|
case 'local_network':
|
|
14788
14761
|
return 'LAN';
|
|
14789
14762
|
case 'fallback':
|
|
@@ -14794,6 +14767,7 @@ function formatConnectionSourceLabel(source) {
|
|
|
14794
14767
|
|
|
14795
14768
|
function formatConnectionSummary(target) {
|
|
14796
14769
|
const stabilityLabel = target.stability === 'ephemeral' ? 'ephemeral' : 'stable';
|
|
14770
|
+
if (target.source === 'remoteDirect') return `Remote Direct [${stabilityLabel}]`;
|
|
14797
14771
|
return `${target.host}:${target.port} [${formatConnectionSourceLabel(target.source)}, ${stabilityLabel}]`;
|
|
14798
14772
|
}
|
|
14799
14773
|
|
|
@@ -15810,6 +15784,76 @@ async function writePairingOutput(pairingPayload, { directory, pairingCodePath,
|
|
|
15810
15784
|
}
|
|
15811
15785
|
|
|
15812
15786
|
|
|
15787
|
+
/***/ }),
|
|
15788
|
+
|
|
15789
|
+
/***/ 6736:
|
|
15790
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => {
|
|
15791
|
+
|
|
15792
|
+
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
|
15793
|
+
/* harmony export */ FN: () => (/* binding */ configureRemoteDirectMode),
|
|
15794
|
+
/* harmony export */ OW: () => (/* binding */ shouldRequestCloudflare),
|
|
15795
|
+
/* harmony export */ Tl: () => (/* binding */ createRemoteDirectConfigStore)
|
|
15796
|
+
/* harmony export */ });
|
|
15797
|
+
/* unused harmony export resolveRemoteDirectChoice */
|
|
15798
|
+
/* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(3024);
|
|
15799
|
+
/* harmony import */ var _vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(6927);
|
|
15800
|
+
|
|
15801
|
+
|
|
15802
|
+
|
|
15803
|
+
function createRemoteDirectConfigStore(configPath, dataDirectory) {
|
|
15804
|
+
return {
|
|
15805
|
+
load() {
|
|
15806
|
+
try {
|
|
15807
|
+
const enabled = JSON.parse((0,node_fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync)(configPath, 'utf8')).enabled;
|
|
15808
|
+
return typeof enabled === 'boolean' ? enabled : true;
|
|
15809
|
+
} catch {
|
|
15810
|
+
return true;
|
|
15811
|
+
}
|
|
15812
|
+
},
|
|
15813
|
+
save(enabled) {
|
|
15814
|
+
(0,node_fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync)(dataDirectory, { recursive: true });
|
|
15815
|
+
(0,node_fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync)(configPath, `${JSON.stringify({ enabled }, null, 2)}\n`, { encoding: 'utf8', mode: 0o600 });
|
|
15816
|
+
},
|
|
15817
|
+
};
|
|
15818
|
+
}
|
|
15819
|
+
|
|
15820
|
+
function resolveRemoteDirectChoice({ enable, disable, environmentEnabled, savedEnabled }) {
|
|
15821
|
+
if (enable) return true;
|
|
15822
|
+
if (disable) return false;
|
|
15823
|
+
return environmentEnabled || savedEnabled;
|
|
15824
|
+
}
|
|
15825
|
+
|
|
15826
|
+
function configureRemoteDirectMode({
|
|
15827
|
+
readFlag,
|
|
15828
|
+
fail,
|
|
15829
|
+
config,
|
|
15830
|
+
localMode,
|
|
15831
|
+
cloudflareRequested,
|
|
15832
|
+
environment = process.env,
|
|
15833
|
+
}) {
|
|
15834
|
+
const enable = readFlag('remote-direct');
|
|
15835
|
+
const disable = readFlag('no-remote-direct');
|
|
15836
|
+
if (enable && disable) fail('Do not combine --remote-direct with --no-remote-direct.');
|
|
15837
|
+
const requested = resolveRemoteDirectChoice({
|
|
15838
|
+
enable,
|
|
15839
|
+
disable,
|
|
15840
|
+
cloudflareRequested,
|
|
15841
|
+
environmentEnabled: (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_1__/* .isTruthyEnvFlag */ .ap)(environment.VIBELET_REMOTE_DIRECT),
|
|
15842
|
+
savedEnabled: config.load(),
|
|
15843
|
+
});
|
|
15844
|
+
if (enable || disable) config.save(requested);
|
|
15845
|
+
// Local access overrides RemoteDirect for this run without changing its saved choice.
|
|
15846
|
+
const enabled = !localMode && requested;
|
|
15847
|
+
if (enabled) environment.VIBELET_REMOTE_DIRECT = '1';
|
|
15848
|
+
else delete environment.VIBELET_REMOTE_DIRECT;
|
|
15849
|
+
return { enabled, explicitChoice: enable || disable };
|
|
15850
|
+
}
|
|
15851
|
+
|
|
15852
|
+
function shouldRequestCloudflare({ accessTarget }) {
|
|
15853
|
+
return accessTarget?.kind === 'remote';
|
|
15854
|
+
}
|
|
15855
|
+
|
|
15856
|
+
|
|
15813
15857
|
/***/ }),
|
|
15814
15858
|
|
|
15815
15859
|
/***/ 4:
|
|
@@ -15819,7 +15863,7 @@ async function writePairingOutput(pairingPayload, { directory, pairingCodePath,
|
|
|
15819
15863
|
/* harmony export */ Ne: () => (/* binding */ shouldRefuseRuntimeDowngrade),
|
|
15820
15864
|
/* harmony export */ Pg: () => (/* binding */ shouldRetireManagedQuickTunnel),
|
|
15821
15865
|
/* harmony export */ ZN: () => (/* binding */ shouldReuseHealthyDaemon),
|
|
15822
|
-
/* harmony export */
|
|
15866
|
+
/* harmony export */ _4: () => (/* binding */ isRemoteDirectConfigurationMismatch),
|
|
15823
15867
|
/* harmony export */ gm: () => (/* binding */ shouldManageQuickTunnel),
|
|
15824
15868
|
/* harmony export */ iX: () => (/* binding */ doesHealthSupportTerminalControl),
|
|
15825
15869
|
/* harmony export */ nW: () => (/* binding */ doesHealthMatchRequestedConnectionConfig)
|
|
@@ -15865,10 +15909,10 @@ function shouldReuseHealthyDaemon({
|
|
|
15865
15909
|
return !hasExplicitConfigOverrides || canApplyConnectionConfigWithoutRestart;
|
|
15866
15910
|
}
|
|
15867
15911
|
|
|
15868
|
-
function
|
|
15912
|
+
function isRemoteDirectConfigurationMismatch({ health, remoteDirectEnabled }) {
|
|
15869
15913
|
if (!health) return false;
|
|
15870
|
-
const reportedEnabled = health?.
|
|
15871
|
-
return typeof reportedEnabled === 'boolean' ? reportedEnabled !==
|
|
15914
|
+
const reportedEnabled = health?.remoteDirect?.enabled;
|
|
15915
|
+
return typeof reportedEnabled === 'boolean' ? reportedEnabled !== remoteDirectEnabled : remoteDirectEnabled;
|
|
15872
15916
|
}
|
|
15873
15917
|
|
|
15874
15918
|
function doesHealthSupportTerminalControl(health) {
|
|
@@ -15923,7 +15967,7 @@ function shouldManageQuickTunnel({
|
|
|
15923
15967
|
savedRelayUrl = '',
|
|
15924
15968
|
force = false,
|
|
15925
15969
|
preserveAccess = false,
|
|
15926
|
-
|
|
15970
|
+
remoteDirectEnabled = false,
|
|
15927
15971
|
remoteRequested = false,
|
|
15928
15972
|
}) {
|
|
15929
15973
|
if (preserveAccess || !remoteRequested) return false;
|
|
@@ -15973,13 +16017,13 @@ function doesHealthMatchRequestedConnectionConfig({
|
|
|
15973
16017
|
canonicalHost = '',
|
|
15974
16018
|
fallbackHosts = '',
|
|
15975
16019
|
localMode = false,
|
|
15976
|
-
|
|
16020
|
+
remoteDirectEnabled,
|
|
15977
16021
|
}) {
|
|
15978
16022
|
if (!health) return false;
|
|
15979
16023
|
|
|
15980
|
-
if (typeof
|
|
15981
|
-
const
|
|
15982
|
-
if (
|
|
16024
|
+
if (typeof remoteDirectEnabled === 'boolean') {
|
|
16025
|
+
const runningRemoteDirectEnabled = health.remoteDirect?.enabled === true;
|
|
16026
|
+
if (runningRemoteDirectEnabled !== remoteDirectEnabled) return false;
|
|
15983
16027
|
}
|
|
15984
16028
|
|
|
15985
16029
|
const currentRelayUrl = typeof health.relayUrl === 'string' ? health.relayUrl : '';
|
|
@@ -16044,71 +16088,81 @@ async function stopDaemonWithHooks({
|
|
|
16044
16088
|
|
|
16045
16089
|
/***/ }),
|
|
16046
16090
|
|
|
16047
|
-
/***/
|
|
16091
|
+
/***/ 7775:
|
|
16048
16092
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => {
|
|
16049
16093
|
|
|
16050
16094
|
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
|
16051
|
-
/* harmony export */
|
|
16052
|
-
/* harmony export */ SS: () => (/* binding */ configureTailcatMode),
|
|
16053
|
-
/* harmony export */ SY: () => (/* binding */ createTailcatConfigStore)
|
|
16095
|
+
/* harmony export */ J: () => (/* binding */ createUpdateChecker)
|
|
16054
16096
|
/* harmony export */ });
|
|
16055
|
-
/*
|
|
16056
|
-
/* harmony import */ var
|
|
16057
|
-
/* harmony import */ var
|
|
16097
|
+
/* harmony import */ var node_child_process__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(1421);
|
|
16098
|
+
/* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(3024);
|
|
16099
|
+
/* harmony import */ var _vibelet_value_validation_mjs__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(50);
|
|
16058
16100
|
|
|
16059
16101
|
|
|
16060
16102
|
|
|
16061
|
-
function createTailcatConfigStore(configPath, dataDirectory) {
|
|
16062
|
-
return {
|
|
16063
|
-
load() {
|
|
16064
|
-
try {
|
|
16065
|
-
const enabled = JSON.parse((0,node_fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync)(configPath, 'utf8')).enabled;
|
|
16066
|
-
return typeof enabled === 'boolean' ? enabled : true;
|
|
16067
|
-
} catch {
|
|
16068
|
-
return true;
|
|
16069
|
-
}
|
|
16070
|
-
},
|
|
16071
|
-
save(enabled) {
|
|
16072
|
-
(0,node_fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync)(dataDirectory, { recursive: true });
|
|
16073
|
-
(0,node_fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync)(configPath, `${JSON.stringify({ enabled }, null, 2)}\n`, { encoding: 'utf8', mode: 0o600 });
|
|
16074
|
-
},
|
|
16075
|
-
};
|
|
16076
|
-
}
|
|
16077
16103
|
|
|
16078
|
-
function
|
|
16079
|
-
|
|
16080
|
-
|
|
16081
|
-
|
|
16082
|
-
|
|
16104
|
+
function createUpdateChecker({ updateCheckPath, packageJson }) {
|
|
16105
|
+
const UPDATE_CHECK_INTERVAL_MS = 4 * 60 * 60 * 1000;
|
|
16106
|
+
function readUpdateCheck() {
|
|
16107
|
+
try {
|
|
16108
|
+
return JSON.parse((0,node_fs__WEBPACK_IMPORTED_MODULE_1__.readFileSync)(updateCheckPath, 'utf8'));
|
|
16109
|
+
} catch {
|
|
16110
|
+
return null;
|
|
16111
|
+
}
|
|
16112
|
+
}
|
|
16083
16113
|
|
|
16084
|
-
function
|
|
16085
|
-
|
|
16086
|
-
|
|
16087
|
-
|
|
16088
|
-
|
|
16089
|
-
|
|
16090
|
-
|
|
16091
|
-
|
|
16092
|
-
|
|
16093
|
-
|
|
16094
|
-
|
|
16095
|
-
|
|
16096
|
-
|
|
16097
|
-
|
|
16098
|
-
|
|
16099
|
-
|
|
16100
|
-
|
|
16101
|
-
|
|
16102
|
-
|
|
16103
|
-
// Local access overrides Tailcat for this run without changing its saved choice.
|
|
16104
|
-
const enabled = !localMode && requested;
|
|
16105
|
-
if (enabled) environment.VIBELET_TAILCAT = '1';
|
|
16106
|
-
else delete environment.VIBELET_TAILCAT;
|
|
16107
|
-
return { enabled, explicitChoice: enable || disable };
|
|
16108
|
-
}
|
|
16114
|
+
function checkForUpdateFromCache() {
|
|
16115
|
+
const cached = readUpdateCheck();
|
|
16116
|
+
if (!cached?.latestVersion) return;
|
|
16117
|
+
if ((0,_vibelet_value_validation_mjs__WEBPACK_IMPORTED_MODULE_2__/* .compareVersions */ .Z)(packageJson.version, cached.latestVersion) < 0) {
|
|
16118
|
+
return (
|
|
16119
|
+
`\x1b[33m╭───────────────────────────────────────────╮\x1b[0m\n` +
|
|
16120
|
+
`\x1b[33m│\x1b[0m Update available: \x1b[90m${packageJson.version}\x1b[0m → \x1b[32m${cached.latestVersion}\x1b[0m${' '.repeat(Math.max(0, 14 - packageJson.version.length - cached.latestVersion.length))}\x1b[33m│\x1b[0m\n` +
|
|
16121
|
+
`\x1b[33m│\x1b[0m Run \x1b[36mnpx -y vibelet@latest\x1b[0m to upgrade \x1b[33m│\x1b[0m\n` +
|
|
16122
|
+
`\x1b[33m╰───────────────────────────────────────────╯\x1b[0m`
|
|
16123
|
+
);
|
|
16124
|
+
}
|
|
16125
|
+
}
|
|
16126
|
+
|
|
16127
|
+
function fetchLatestVersionInBackground() {
|
|
16128
|
+
const cached = readUpdateCheck();
|
|
16129
|
+
const now = Date.now();
|
|
16130
|
+
if (cached?.checkedAt && now - cached.checkedAt < UPDATE_CHECK_INTERVAL_MS) {
|
|
16131
|
+
return; // Checked recently; skip.
|
|
16132
|
+
}
|
|
16109
16133
|
|
|
16110
|
-
|
|
16111
|
-
|
|
16134
|
+
// Fire-and-forget: spawn a detached process to query the registry so we
|
|
16135
|
+
// never block the CLI. Results are read on the *next* invocation.
|
|
16136
|
+
const script = `
|
|
16137
|
+
const https = await import('node:https');
|
|
16138
|
+
const fs = await import('node:fs');
|
|
16139
|
+
const url = 'https://registry.npmjs.org/@vibelet/cli/latest';
|
|
16140
|
+
https.get(url, { headers: { 'Accept': 'application/json' }, timeout: 8000 }, (res) => {
|
|
16141
|
+
let data = '';
|
|
16142
|
+
res.on('data', (c) => data += c);
|
|
16143
|
+
res.on('end', () => {
|
|
16144
|
+
try {
|
|
16145
|
+
const version = JSON.parse(data).version;
|
|
16146
|
+
if (version) {
|
|
16147
|
+
fs.writeFileSync(${JSON.stringify(updateCheckPath)}, JSON.stringify({
|
|
16148
|
+
latestVersion: version,
|
|
16149
|
+
checkedAt: Date.now(),
|
|
16150
|
+
}, null, 2) + '\\n');
|
|
16151
|
+
}
|
|
16152
|
+
} catch {}
|
|
16153
|
+
});
|
|
16154
|
+
}).on('error', () => {});
|
|
16155
|
+
`;
|
|
16156
|
+
|
|
16157
|
+
const child = (0,node_child_process__WEBPACK_IMPORTED_MODULE_0__.spawn)(process.execPath, ['--input-type=module', '-e', script], {
|
|
16158
|
+
detached: true,
|
|
16159
|
+
stdio: 'ignore',
|
|
16160
|
+
windowsHide: true,
|
|
16161
|
+
});
|
|
16162
|
+
child.unref();
|
|
16163
|
+
}
|
|
16164
|
+
|
|
16165
|
+
return { checkForUpdateFromCache, fetchLatestVersionInBackground };
|
|
16112
16166
|
}
|
|
16113
16167
|
|
|
16114
16168
|
|
|
@@ -16154,24 +16208,26 @@ function compareVersions(a, b) {
|
|
|
16154
16208
|
|
|
16155
16209
|
__nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
16156
16210
|
/* harmony import */ var node_child_process__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(1421);
|
|
16157
|
-
/* harmony import */ var
|
|
16211
|
+
/* harmony import */ var _vibelet_value_validation_mjs__WEBPACK_IMPORTED_MODULE_13__ = __nccwpck_require__(50);
|
|
16158
16212
|
/* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(3024);
|
|
16159
16213
|
/* harmony import */ var node_module__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(8995);
|
|
16160
16214
|
/* harmony import */ var node_os__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(8161);
|
|
16161
16215
|
/* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(6760);
|
|
16162
16216
|
/* harmony import */ var node_url__WEBPACK_IMPORTED_MODULE_5__ = __nccwpck_require__(3136);
|
|
16163
|
-
/* harmony import */ var
|
|
16217
|
+
/* harmony import */ var _vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_19__ = __nccwpck_require__(6927);
|
|
16164
16218
|
/* harmony import */ var _cloudflared_tunnel_manager_mjs__WEBPACK_IMPORTED_MODULE_6__ = __nccwpck_require__(1484);
|
|
16165
16219
|
/* harmony import */ var _vibelet_cloudflare_runtime_mjs__WEBPACK_IMPORTED_MODULE_7__ = __nccwpck_require__(3869);
|
|
16166
|
-
/* harmony import */ var
|
|
16220
|
+
/* harmony import */ var _vibelet_launchd_mjs__WEBPACK_IMPORTED_MODULE_15__ = __nccwpck_require__(1010);
|
|
16167
16221
|
/* harmony import */ var _linux_systemd_mjs__WEBPACK_IMPORTED_MODULE_8__ = __nccwpck_require__(4217);
|
|
16168
|
-
/* harmony import */ var
|
|
16169
|
-
/* harmony import */ var
|
|
16170
|
-
/* harmony import */ var
|
|
16171
|
-
/* harmony import */ var
|
|
16172
|
-
/* harmony import */ var
|
|
16173
|
-
/* harmony import */ var
|
|
16174
|
-
/* harmony import */ var
|
|
16222
|
+
/* harmony import */ var _vibelet_stop_logic_mjs__WEBPACK_IMPORTED_MODULE_16__ = __nccwpck_require__(6274);
|
|
16223
|
+
/* harmony import */ var _vibelet_update_check_mjs__WEBPACK_IMPORTED_MODULE_9__ = __nccwpck_require__(7775);
|
|
16224
|
+
/* harmony import */ var _vibelet_help_mjs__WEBPACK_IMPORTED_MODULE_18__ = __nccwpck_require__(4162);
|
|
16225
|
+
/* harmony import */ var _vibelet_remote_direct_config_mjs__WEBPACK_IMPORTED_MODULE_10__ = __nccwpck_require__(6736);
|
|
16226
|
+
/* harmony import */ var _vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_14__ = __nccwpck_require__(4);
|
|
16227
|
+
/* harmony import */ var _terminal_wrapper_mjs__WEBPACK_IMPORTED_MODULE_11__ = __nccwpck_require__(5028);
|
|
16228
|
+
/* harmony import */ var _vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_17__ = __nccwpck_require__(7721);
|
|
16229
|
+
/* harmony import */ var _vibelet_pairing_output_mjs__WEBPACK_IMPORTED_MODULE_12__ = __nccwpck_require__(9485);
|
|
16230
|
+
|
|
16175
16231
|
|
|
16176
16232
|
|
|
16177
16233
|
|
|
@@ -16207,21 +16263,20 @@ const runtimeDir = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(vibeletDir, '
|
|
|
16207
16263
|
const runtimeCurrentDir = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(runtimeDir, 'current');
|
|
16208
16264
|
const runtimeMetadataPath = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(runtimeCurrentDir, 'runtime.json');
|
|
16209
16265
|
const runtimeDaemonEntryPath = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(runtimeCurrentDir, 'dist', 'index.cjs');
|
|
16210
|
-
const runtimeTerminalControlTokenPath =
|
|
16266
|
+
const runtimeTerminalControlTokenPath = _terminal_wrapper_mjs__WEBPACK_IMPORTED_MODULE_11__/* .terminalControlTokenPath */ .gJ;
|
|
16211
16267
|
const stdoutLogPath = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(logDir, 'daemon.stdout.log');
|
|
16212
16268
|
const stderrLogPath = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(logDir, 'daemon.stderr.log');
|
|
16213
16269
|
const pidFilePath = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(vibeletDir, 'daemon.pid');
|
|
16214
16270
|
const relayConfig = (0,_vibelet_cloudflare_runtime_mjs__WEBPACK_IMPORTED_MODULE_7__/* .createRelayConfigStore */ .T7)((0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(vibeletDir, 'relay.json'));
|
|
16215
|
-
const
|
|
16271
|
+
const remoteDirectConfig = (0,_vibelet_remote_direct_config_mjs__WEBPACK_IMPORTED_MODULE_10__/* .createRemoteDirectConfigStore */ .Tl)((0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(vibeletDir, 'remote-direct.json'), vibeletDir);
|
|
16216
16272
|
const tunnelStatePath = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(vibeletDir, 'tunnel.json');
|
|
16217
16273
|
const cloudflaredUpdateStatePath = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(vibeletDir, 'cloudflared-update.json');
|
|
16218
16274
|
const updateCheckPath = (0,node_path__WEBPACK_IMPORTED_MODULE_4__.join)(vibeletDir, 'update-check.json');
|
|
16219
16275
|
const OFFICIAL_SITE_URL = 'https://vibelet.icu';
|
|
16220
|
-
const UPDATE_CHECK_INTERVAL_MS = 4 * 60 * 60 * 1000; // 4 hours
|
|
16221
16276
|
|
|
16222
16277
|
let officialSitePrinted = false;
|
|
16223
16278
|
let updateMessage = '';
|
|
16224
|
-
let port = (0,
|
|
16279
|
+
let port = (0,_vibelet_value_validation_mjs__WEBPACK_IMPORTED_MODULE_13__/* .normalizePortValue */ .Q)(process.env.VIBE_PORT) ?? 9876;
|
|
16225
16280
|
|
|
16226
16281
|
function printOfficialSite() {
|
|
16227
16282
|
if (officialSitePrinted) return;
|
|
@@ -16236,72 +16291,10 @@ function printOfficialSite() {
|
|
|
16236
16291
|
|
|
16237
16292
|
// ─── Update check ──────────────────────────────────────────────────────────────
|
|
16238
16293
|
|
|
16239
|
-
|
|
16240
|
-
|
|
16241
|
-
|
|
16242
|
-
|
|
16243
|
-
return null;
|
|
16244
|
-
}
|
|
16245
|
-
}
|
|
16246
|
-
|
|
16247
|
-
function writeUpdateCheck(data) {
|
|
16248
|
-
try {
|
|
16249
|
-
mkdirSync(vibeletDir, { recursive: true });
|
|
16250
|
-
writeFileSync(updateCheckPath, JSON.stringify(data, null, 2) + '\n', 'utf8');
|
|
16251
|
-
} catch {
|
|
16252
|
-
// Best-effort; failing to persist is fine.
|
|
16253
|
-
}
|
|
16254
|
-
}
|
|
16255
|
-
|
|
16256
|
-
function checkForUpdateFromCache() {
|
|
16257
|
-
const cached = readUpdateCheck();
|
|
16258
|
-
if (!cached?.latestVersion) return;
|
|
16259
|
-
if ((0,_vibelet_value_validation_mjs__WEBPACK_IMPORTED_MODULE_12__/* .compareVersions */ .Z)(packageJson.version, cached.latestVersion) < 0) {
|
|
16260
|
-
updateMessage =
|
|
16261
|
-
`\x1b[33m╭───────────────────────────────────────────╮\x1b[0m\n` +
|
|
16262
|
-
`\x1b[33m│\x1b[0m Update available: \x1b[90m${packageJson.version}\x1b[0m → \x1b[32m${cached.latestVersion}\x1b[0m${' '.repeat(Math.max(0, 14 - packageJson.version.length - cached.latestVersion.length))}\x1b[33m│\x1b[0m\n` +
|
|
16263
|
-
`\x1b[33m│\x1b[0m Run \x1b[36mnpx -y vibelet@latest\x1b[0m to upgrade \x1b[33m│\x1b[0m\n` +
|
|
16264
|
-
`\x1b[33m╰───────────────────────────────────────────╯\x1b[0m`;
|
|
16265
|
-
}
|
|
16266
|
-
}
|
|
16267
|
-
|
|
16268
|
-
function fetchLatestVersionInBackground() {
|
|
16269
|
-
const cached = readUpdateCheck();
|
|
16270
|
-
const now = Date.now();
|
|
16271
|
-
if (cached?.checkedAt && now - cached.checkedAt < UPDATE_CHECK_INTERVAL_MS) {
|
|
16272
|
-
return; // Checked recently; skip.
|
|
16273
|
-
}
|
|
16274
|
-
|
|
16275
|
-
// Fire-and-forget: spawn a detached process to query the registry so we
|
|
16276
|
-
// never block the CLI. Results are read on the *next* invocation.
|
|
16277
|
-
const script = `
|
|
16278
|
-
const https = await import('node:https');
|
|
16279
|
-
const fs = await import('node:fs');
|
|
16280
|
-
const url = 'https://registry.npmjs.org/@vibelet/cli/latest';
|
|
16281
|
-
https.get(url, { headers: { 'Accept': 'application/json' }, timeout: 8000 }, (res) => {
|
|
16282
|
-
let data = '';
|
|
16283
|
-
res.on('data', (c) => data += c);
|
|
16284
|
-
res.on('end', () => {
|
|
16285
|
-
try {
|
|
16286
|
-
const version = JSON.parse(data).version;
|
|
16287
|
-
if (version) {
|
|
16288
|
-
fs.writeFileSync(${JSON.stringify(updateCheckPath)}, JSON.stringify({
|
|
16289
|
-
latestVersion: version,
|
|
16290
|
-
checkedAt: Date.now(),
|
|
16291
|
-
}, null, 2) + '\\n');
|
|
16292
|
-
}
|
|
16293
|
-
} catch {}
|
|
16294
|
-
});
|
|
16295
|
-
}).on('error', () => {});
|
|
16296
|
-
`;
|
|
16297
|
-
|
|
16298
|
-
const child = (0,node_child_process__WEBPACK_IMPORTED_MODULE_0__.spawn)(process.execPath, ['--input-type=module', '-e', script], {
|
|
16299
|
-
detached: true,
|
|
16300
|
-
stdio: 'ignore',
|
|
16301
|
-
windowsHide: true,
|
|
16302
|
-
});
|
|
16303
|
-
child.unref();
|
|
16304
|
-
}
|
|
16294
|
+
const { checkForUpdateFromCache, fetchLatestVersionInBackground } = (0,_vibelet_update_check_mjs__WEBPACK_IMPORTED_MODULE_9__/* .createUpdateChecker */ .J)({
|
|
16295
|
+
updateCheckPath,
|
|
16296
|
+
packageJson,
|
|
16297
|
+
});
|
|
16305
16298
|
|
|
16306
16299
|
// ─── Helpers ────────────────────────────────────────────────────────────────────
|
|
16307
16300
|
|
|
@@ -16334,7 +16327,7 @@ function ensureRuntimeInstalled() {
|
|
|
16334
16327
|
const runtimeMetadata = readRuntimeMetadata();
|
|
16335
16328
|
|
|
16336
16329
|
if (
|
|
16337
|
-
(0,
|
|
16330
|
+
(0,_vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_14__/* .shouldRefuseRuntimeDowngrade */ .Ne)({
|
|
16338
16331
|
cliVersion: packageJson.version,
|
|
16339
16332
|
runtimeVersion: runtimeMetadata?.version,
|
|
16340
16333
|
runtimeEntryExists: (0,node_fs__WEBPACK_IMPORTED_MODULE_1__.existsSync)(runtimeDaemonEntryPath),
|
|
@@ -16538,7 +16531,7 @@ function createDarwinBackend() {
|
|
|
16538
16531
|
}
|
|
16539
16532
|
|
|
16540
16533
|
function bootoutService() {
|
|
16541
|
-
return (0,
|
|
16534
|
+
return (0,_vibelet_launchd_mjs__WEBPACK_IMPORTED_MODULE_15__/* .bootoutLaunchdService */ .B)({
|
|
16542
16535
|
launchctl,
|
|
16543
16536
|
launchDomain,
|
|
16544
16537
|
label,
|
|
@@ -16563,7 +16556,7 @@ function createDarwinBackend() {
|
|
|
16563
16556
|
if (process.env.VIBELET_CANONICAL_HOST) envVars.VIBELET_CANONICAL_HOST = process.env.VIBELET_CANONICAL_HOST;
|
|
16564
16557
|
if (process.env.VIBELET_FALLBACK_HOSTS) envVars.VIBELET_FALLBACK_HOSTS = process.env.VIBELET_FALLBACK_HOSTS;
|
|
16565
16558
|
if (process.env.VIBELET_LOCAL_ONLY) envVars.VIBELET_LOCAL_ONLY = process.env.VIBELET_LOCAL_ONLY;
|
|
16566
|
-
if (process.env.
|
|
16559
|
+
if (process.env.VIBELET_REMOTE_DIRECT) envVars.VIBELET_REMOTE_DIRECT = process.env.VIBELET_REMOTE_DIRECT;
|
|
16567
16560
|
if (process.env.VIBE_CLAUDE_DRIVER) envVars.VIBE_CLAUDE_DRIVER = process.env.VIBE_CLAUDE_DRIVER;
|
|
16568
16561
|
if (process.env.CODEX_PATH) envVars.CODEX_PATH = process.env.CODEX_PATH;
|
|
16569
16562
|
if (process.env.CLAUDE_PATH) envVars.CLAUDE_PATH = process.env.CLAUDE_PATH;
|
|
@@ -16628,7 +16621,7 @@ ${envSection}
|
|
|
16628
16621
|
if (result.status !== 0) {
|
|
16629
16622
|
fail(
|
|
16630
16623
|
'Failed to bootstrap vibelet launch agent.',
|
|
16631
|
-
[(0,
|
|
16624
|
+
[(0,_vibelet_launchd_mjs__WEBPACK_IMPORTED_MODULE_15__/* .describeLaunchctlResult */ .N)(bootoutResult.result), (0,_vibelet_launchd_mjs__WEBPACK_IMPORTED_MODULE_15__/* .describeLaunchctlResult */ .N)(result)].filter(Boolean).join('\n'),
|
|
16632
16625
|
);
|
|
16633
16626
|
}
|
|
16634
16627
|
}
|
|
@@ -16644,7 +16637,7 @@ ${envSection}
|
|
|
16644
16637
|
stop() {
|
|
16645
16638
|
const bootoutResult = bootoutService();
|
|
16646
16639
|
if (!bootoutResult.ok) {
|
|
16647
|
-
fail('Failed to unload vibelet launch agent.', (0,
|
|
16640
|
+
fail('Failed to unload vibelet launch agent.', (0,_vibelet_launchd_mjs__WEBPACK_IMPORTED_MODULE_15__/* .describeLaunchctlResult */ .N)(bootoutResult.result));
|
|
16648
16641
|
}
|
|
16649
16642
|
// bootout returns before launchd actually finishes unloading. Poll
|
|
16650
16643
|
// until the service is gone so a follow-up install() doesn't see a
|
|
@@ -16700,7 +16693,7 @@ RestartSec=3
|
|
|
16700
16693
|
StandardOutput=append:${stdoutLogPath}
|
|
16701
16694
|
StandardError=append:${stderrLogPath}
|
|
16702
16695
|
Environment=PATH=${servicePath}
|
|
16703
|
-
Environment=VIBE_PORT=${port}${process.env.VIBELET_RELAY_URL ? `\nEnvironment=VIBELET_RELAY_URL=${process.env.VIBELET_RELAY_URL}` : ''}${process.env.VIBELET_CANONICAL_HOST ? `\nEnvironment=VIBELET_CANONICAL_HOST=${process.env.VIBELET_CANONICAL_HOST}` : ''}${process.env.VIBELET_FALLBACK_HOSTS ? `\nEnvironment=VIBELET_FALLBACK_HOSTS=${process.env.VIBELET_FALLBACK_HOSTS}` : ''}${process.env.VIBELET_LOCAL_ONLY ? `\nEnvironment=VIBELET_LOCAL_ONLY=${process.env.VIBELET_LOCAL_ONLY}` : ''}${process.env.
|
|
16696
|
+
Environment=VIBE_PORT=${port}${process.env.VIBELET_RELAY_URL ? `\nEnvironment=VIBELET_RELAY_URL=${process.env.VIBELET_RELAY_URL}` : ''}${process.env.VIBELET_CANONICAL_HOST ? `\nEnvironment=VIBELET_CANONICAL_HOST=${process.env.VIBELET_CANONICAL_HOST}` : ''}${process.env.VIBELET_FALLBACK_HOSTS ? `\nEnvironment=VIBELET_FALLBACK_HOSTS=${process.env.VIBELET_FALLBACK_HOSTS}` : ''}${process.env.VIBELET_LOCAL_ONLY ? `\nEnvironment=VIBELET_LOCAL_ONLY=${process.env.VIBELET_LOCAL_ONLY}` : ''}${process.env.VIBELET_REMOTE_DIRECT ? `\nEnvironment=VIBELET_REMOTE_DIRECT=${process.env.VIBELET_REMOTE_DIRECT}` : ''}${process.env.VIBE_CLAUDE_DRIVER ? `\nEnvironment=VIBE_CLAUDE_DRIVER=${process.env.VIBE_CLAUDE_DRIVER}` : ''}${process.env.CODEX_PATH ? `\nEnvironment=CODEX_PATH=${process.env.CODEX_PATH}` : ''}${process.env.CLAUDE_PATH ? `\nEnvironment=CLAUDE_PATH=${process.env.CLAUDE_PATH}` : ''}
|
|
16704
16697
|
|
|
16705
16698
|
[Install]
|
|
16706
16699
|
WantedBy=default.target
|
|
@@ -16987,7 +16980,7 @@ function retireTrackedQuickTunnel({ required = false } = {}) {
|
|
|
16987
16980
|
|
|
16988
16981
|
async function stopRunningDaemon(backend) {
|
|
16989
16982
|
try {
|
|
16990
|
-
await (0,
|
|
16983
|
+
await (0,_vibelet_stop_logic_mjs__WEBPACK_IMPORTED_MODULE_16__/* .stopDaemonWithHooks */ .v)({
|
|
16991
16984
|
requestShutdown,
|
|
16992
16985
|
backendStop: () => backend.stop(),
|
|
16993
16986
|
waitForDaemonExit,
|
|
@@ -17000,13 +16993,13 @@ async function stopRunningDaemon(backend) {
|
|
|
17000
16993
|
async function ensureDaemonForTerminalControl(backend) {
|
|
17001
16994
|
const healthyDaemon = await probeHealth(1_500);
|
|
17002
16995
|
const tokenReady = (0,node_fs__WEBPACK_IMPORTED_MODULE_1__.existsSync)(runtimeTerminalControlTokenPath);
|
|
17003
|
-
const terminalControlReady = healthyDaemon && tokenReady && (0,
|
|
16996
|
+
const terminalControlReady = healthyDaemon && tokenReady && (0,_vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_14__/* .doesHealthSupportTerminalControl */ .iX)(healthyDaemon);
|
|
17004
16997
|
if (terminalControlReady) return healthyDaemon;
|
|
17005
16998
|
|
|
17006
16999
|
if (healthyDaemon && !terminalControlReady) {
|
|
17007
17000
|
const activeSessions = typeof healthyDaemon.activeSessions === 'number' ? healthyDaemon.activeSessions : 0;
|
|
17008
17001
|
if (activeSessions > 0) {
|
|
17009
|
-
const reason = (0,
|
|
17002
|
+
const reason = (0,_vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_14__/* .doesHealthSupportTerminalControl */ .iX)(healthyDaemon)
|
|
17010
17003
|
? 'terminal-control token is missing'
|
|
17011
17004
|
: 'the running daemon does not advertise terminal-control support';
|
|
17012
17005
|
process.stderr.write(
|
|
@@ -17025,12 +17018,12 @@ async function ensureDaemonForTerminalControl(backend) {
|
|
|
17025
17018
|
}
|
|
17026
17019
|
|
|
17027
17020
|
function validateExplicitCleartextHosts({ hostArg, fallbackHostsArg }) {
|
|
17028
|
-
const [unsafeHost] = (0,
|
|
17021
|
+
const [unsafeHost] = (0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_17__/* .findUnsafeCleartextHosts */ .dE)({ hostArg, fallbackHostsArg });
|
|
17029
17022
|
if (unsafeHost) fail(`Refusing public cleartext host ${unsafeHost}. Use HTTPS, Tailscale, LAN, or local access.`);
|
|
17030
17023
|
}
|
|
17031
17024
|
|
|
17032
17025
|
async function printPairingQr(pairingPayload) {
|
|
17033
|
-
await (0,
|
|
17026
|
+
await (0,_vibelet_pairing_output_mjs__WEBPACK_IMPORTED_MODULE_12__/* .writePairingOutput */ .pO)(pairingPayload, {
|
|
17034
17027
|
directory: vibeletDir,
|
|
17035
17028
|
pairingCodePath,
|
|
17036
17029
|
pairingQrPngPath,
|
|
@@ -17046,11 +17039,11 @@ async function printPairingSummary(existingHealth = null, { relayUrlOverride = n
|
|
|
17046
17039
|
const pairingPayload =
|
|
17047
17040
|
relayUrlOverride === null
|
|
17048
17041
|
? daemonPairingPayload
|
|
17049
|
-
: (0,
|
|
17050
|
-
const connections = (0,
|
|
17042
|
+
: (0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_17__/* .applyRelayUrlToPairingPayload */ .mp)(daemonPairingPayload, relayUrlOverride);
|
|
17043
|
+
const connections = (0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_17__/* .normalizePairingConnections */ .No)(pairingPayload);
|
|
17051
17044
|
const [preferredConnection, ...otherConnections] = connections;
|
|
17052
|
-
const webUiConnection = (0,
|
|
17053
|
-
const compactPairingPayload = (0,
|
|
17045
|
+
const webUiConnection = (0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_17__/* .selectWebUiConnectionTarget */ .SF)(connections);
|
|
17046
|
+
const compactPairingPayload = (0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_17__/* .createCompactPairingPayload */ .YP)(pairingPayload);
|
|
17054
17047
|
|
|
17055
17048
|
process.stdout.write(`Vibelet daemon is ready.\n\n`);
|
|
17056
17049
|
process.stdout.write(`Device: ${health.displayName}\n`);
|
|
@@ -17058,26 +17051,26 @@ async function printPairingSummary(existingHealth = null, { relayUrlOverride = n
|
|
|
17058
17051
|
process.stdout.write(`Host: ${pairingPayload.canonicalHost}\n`);
|
|
17059
17052
|
process.stdout.write(`Port: ${pairingPayload.port}\n`);
|
|
17060
17053
|
if (preferredConnection) {
|
|
17061
|
-
process.stdout.write(`Preferred path: ${(0,
|
|
17054
|
+
process.stdout.write(`Preferred path: ${(0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_17__/* .formatConnectionSummary */ .uR)(preferredConnection)}\n`);
|
|
17062
17055
|
}
|
|
17063
17056
|
if (otherConnections.length > 0) {
|
|
17064
17057
|
process.stdout.write(`Other paths:\n`);
|
|
17065
17058
|
otherConnections.forEach((target) => {
|
|
17066
|
-
process.stdout.write(` - ${(0,
|
|
17059
|
+
process.stdout.write(` - ${(0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_17__/* .formatConnectionSummary */ .uR)(target)}\n`);
|
|
17067
17060
|
});
|
|
17068
17061
|
}
|
|
17069
|
-
process.stdout.write(`Web UI: ${(0,
|
|
17062
|
+
process.stdout.write(`Web UI: ${(0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_17__/* .buildWebUiUrl */ .Gv)({ host: 'localhost', port }, compactPairingPayload)}\n`);
|
|
17070
17063
|
if (webUiConnection && webUiConnection.host !== 'localhost') {
|
|
17071
|
-
process.stdout.write(`Web UI (other devices): ${(0,
|
|
17064
|
+
process.stdout.write(`Web UI (other devices): ${(0,_vibelet_pairing_connections_mjs__WEBPACK_IMPORTED_MODULE_17__/* .buildWebUiUrl */ .Gv)(webUiConnection, compactPairingPayload)}\n`);
|
|
17072
17065
|
}
|
|
17073
17066
|
process.stdout.write(`Paired devices: ${health.pairedDevices}\n`);
|
|
17074
17067
|
await printPairingQr(pairingPayload);
|
|
17075
17068
|
}
|
|
17076
17069
|
|
|
17077
|
-
const printHelp = () => (0,
|
|
17070
|
+
const printHelp = () => (0,_vibelet_help_mjs__WEBPACK_IMPORTED_MODULE_18__/* .printCliHelp */ .n)({ packageJson, port });
|
|
17078
17071
|
|
|
17079
17072
|
function parseNamedArg(name, errorHint) {
|
|
17080
|
-
return (0,
|
|
17073
|
+
return (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_19__/* .parseNamedArg */ .nE)(process.argv, name, errorHint, fail);
|
|
17081
17074
|
}
|
|
17082
17075
|
|
|
17083
17076
|
function parseRelayArg() {
|
|
@@ -17087,7 +17080,7 @@ function parseRelayArg() {
|
|
|
17087
17080
|
function parsePortArg() {
|
|
17088
17081
|
const rawValue = parseNamedArg('port', '9876');
|
|
17089
17082
|
if (rawValue === null) return null;
|
|
17090
|
-
const parsed = (0,
|
|
17083
|
+
const parsed = (0,_vibelet_value_validation_mjs__WEBPACK_IMPORTED_MODULE_13__/* .normalizePortValue */ .Q)(rawValue);
|
|
17091
17084
|
if (parsed === null) {
|
|
17092
17085
|
fail('--port must be an integer between 1 and 65535');
|
|
17093
17086
|
}
|
|
@@ -17134,8 +17127,8 @@ function parseCommandArg(argv) {
|
|
|
17134
17127
|
arg === '--tunnel' ||
|
|
17135
17128
|
arg === '--force' ||
|
|
17136
17129
|
arg === '--preserve-access' ||
|
|
17137
|
-
arg === '--
|
|
17138
|
-
arg === '--no-
|
|
17130
|
+
arg === '--remote-direct' ||
|
|
17131
|
+
arg === '--no-remote-direct'
|
|
17139
17132
|
) {
|
|
17140
17133
|
continue;
|
|
17141
17134
|
}
|
|
@@ -17150,7 +17143,7 @@ async function tryUpdateRunningDaemonRelay(relayUrl) {
|
|
|
17150
17143
|
|
|
17151
17144
|
async function main() {
|
|
17152
17145
|
// Update check: read cached result (sync, instant) and spawn background fetch.
|
|
17153
|
-
checkForUpdateFromCache();
|
|
17146
|
+
updateMessage = checkForUpdateFromCache() ?? '';
|
|
17154
17147
|
fetchLatestVersionInBackground();
|
|
17155
17148
|
|
|
17156
17149
|
const portArg = parsePortArg();
|
|
@@ -17177,10 +17170,10 @@ async function main() {
|
|
|
17177
17170
|
return;
|
|
17178
17171
|
}
|
|
17179
17172
|
|
|
17180
|
-
if ((0,
|
|
17173
|
+
if ((0,_terminal_wrapper_mjs__WEBPACK_IMPORTED_MODULE_11__/* .isTerminalAgentCommand */ .$c)(command)) {
|
|
17181
17174
|
const backend = resolveBackend();
|
|
17182
17175
|
await ensureDaemonForTerminalControl(backend);
|
|
17183
|
-
process.exitCode = await (0,
|
|
17176
|
+
process.exitCode = await (0,_terminal_wrapper_mjs__WEBPACK_IMPORTED_MODULE_11__/* .runManagedNativeTerminal */ .WA)({
|
|
17184
17177
|
agent: command,
|
|
17185
17178
|
args: process.argv.slice(3),
|
|
17186
17179
|
port,
|
|
@@ -17189,12 +17182,12 @@ async function main() {
|
|
|
17189
17182
|
return;
|
|
17190
17183
|
}
|
|
17191
17184
|
|
|
17192
|
-
let accessTarget = (0,
|
|
17193
|
-
const cloudflareFlag = (0,
|
|
17185
|
+
let accessTarget = (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_19__/* .parseAccessTargetArg */ .tY)(process.argv, fail);
|
|
17186
|
+
const cloudflareFlag = (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_19__/* .consumeFlag */ .PC)(process.argv, 'cloudflare') || (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_19__/* .readNpmConfigFlag */ .AW)('cloudflare');
|
|
17194
17187
|
if (cloudflareFlag && accessTarget && accessTarget.kind !== 'remote')
|
|
17195
17188
|
fail('Do not combine --cloudflare with another --access mode.');
|
|
17196
17189
|
if (cloudflareFlag) accessTarget = { kind: 'remote' };
|
|
17197
|
-
if (accessTarget && (0,
|
|
17190
|
+
if (accessTarget && (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_19__/* .hasLegacyAccessArgs */ .NT)(process.argv, process.env)) {
|
|
17198
17191
|
fail(
|
|
17199
17192
|
'Do not combine --access with legacy access flags.',
|
|
17200
17193
|
'Use one form, for example `--access=local`, `--access=remote`, `--access=https://...`, or `--access=<host>`.',
|
|
@@ -17202,25 +17195,25 @@ async function main() {
|
|
|
17202
17195
|
}
|
|
17203
17196
|
if (!accessTarget) {
|
|
17204
17197
|
const legacyRemote =
|
|
17205
|
-
(0,
|
|
17206
|
-
(0,
|
|
17207
|
-
(0,
|
|
17208
|
-
(0,
|
|
17198
|
+
(0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_19__/* .consumeFlag */ .PC)(process.argv, 'remote') ||
|
|
17199
|
+
(0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_19__/* .consumeFlag */ .PC)(process.argv, 'tunnel') ||
|
|
17200
|
+
(0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_19__/* .readNpmConfigFlag */ .AW)('remote') ||
|
|
17201
|
+
(0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_19__/* .readNpmConfigFlag */ .AW)('tunnel');
|
|
17209
17202
|
if (legacyRemote) accessTarget = { kind: 'remote' };
|
|
17210
17203
|
}
|
|
17211
17204
|
const localFlag =
|
|
17212
17205
|
accessTarget?.kind === 'local' ||
|
|
17213
17206
|
(!accessTarget &&
|
|
17214
|
-
((0,
|
|
17215
|
-
(0,
|
|
17216
|
-
(0,
|
|
17217
|
-
const forceFlag = (0,
|
|
17207
|
+
((0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_19__/* .consumeFlag */ .PC)(process.argv, 'local') ||
|
|
17208
|
+
(0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_19__/* .readNpmConfigFlag */ .AW)('local') ||
|
|
17209
|
+
(0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_19__/* .isTruthyEnvFlag */ .ap)(process.env.VIBELET_LOCAL_ONLY)));
|
|
17210
|
+
const forceFlag = (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_19__/* .consumeFlag */ .PC)(process.argv, 'force') || (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_19__/* .readNpmConfigFlag */ .AW)('force');
|
|
17218
17211
|
// App-triggered upgrades keep the currently working connection intact.
|
|
17219
|
-
const preserveAccess = (0,
|
|
17220
|
-
const { enabled:
|
|
17221
|
-
readFlag: (name) => (0,
|
|
17212
|
+
const preserveAccess = (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_19__/* .consumeFlag */ .PC)(process.argv, 'preserve-access') || (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_19__/* .readNpmConfigFlag */ .AW)('preserve-access');
|
|
17213
|
+
const { enabled: remoteDirectEnabled, explicitChoice: explicitRemoteDirectChoice } = (0,_vibelet_remote_direct_config_mjs__WEBPACK_IMPORTED_MODULE_10__/* .configureRemoteDirectMode */ .FN)({
|
|
17214
|
+
readFlag: (name) => (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_19__/* .consumeFlag */ .PC)(process.argv, name) || (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_19__/* .readNpmConfigFlag */ .AW)(name),
|
|
17222
17215
|
fail,
|
|
17223
|
-
config:
|
|
17216
|
+
config: remoteDirectConfig,
|
|
17224
17217
|
localMode: localFlag,
|
|
17225
17218
|
cloudflareRequested: accessTarget?.kind === 'remote',
|
|
17226
17219
|
});
|
|
@@ -17248,7 +17241,7 @@ async function main() {
|
|
|
17248
17241
|
command = parseCommandArg(process.argv);
|
|
17249
17242
|
const startCommand = isDaemonStartCommand(command);
|
|
17250
17243
|
const savedRelayUrl = relayConfig.load();
|
|
17251
|
-
const shouldManageTunnel = (0,
|
|
17244
|
+
const shouldManageTunnel = (0,_vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_14__/* .shouldManageQuickTunnel */ .gm)({
|
|
17252
17245
|
startCommand,
|
|
17253
17246
|
localMode: localFlag,
|
|
17254
17247
|
relayArg,
|
|
@@ -17257,8 +17250,8 @@ async function main() {
|
|
|
17257
17250
|
savedRelayUrl,
|
|
17258
17251
|
force: forceFlag,
|
|
17259
17252
|
preserveAccess,
|
|
17260
|
-
|
|
17261
|
-
remoteRequested: (0,
|
|
17253
|
+
remoteDirectEnabled,
|
|
17254
|
+
remoteRequested: (0,_vibelet_remote_direct_config_mjs__WEBPACK_IMPORTED_MODULE_10__/* .shouldRequestCloudflare */ .OW)({ accessTarget, remoteDirectEnabled, explicitRemoteDirectChoice }),
|
|
17262
17255
|
});
|
|
17263
17256
|
const cloudflaredProtocol = process.env.VIBELET_CLOUDFLARED_PROTOCOL?.trim() || 'http2';
|
|
17264
17257
|
if (shouldManageTunnel && !['auto', 'quic', 'http2'].includes(cloudflaredProtocol)) {
|
|
@@ -17266,7 +17259,7 @@ async function main() {
|
|
|
17266
17259
|
}
|
|
17267
17260
|
|
|
17268
17261
|
if (
|
|
17269
|
-
(0,
|
|
17262
|
+
(0,_vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_14__/* .shouldRetireManagedQuickTunnel */ .Pg)({
|
|
17270
17263
|
startCommand,
|
|
17271
17264
|
manageQuickTunnel: shouldManageTunnel,
|
|
17272
17265
|
preserveAccess,
|
|
@@ -17314,7 +17307,7 @@ async function main() {
|
|
|
17314
17307
|
Boolean(hostArg) ||
|
|
17315
17308
|
Boolean(fallbackHostsArg) ||
|
|
17316
17309
|
managedTunnelFailed ||
|
|
17317
|
-
(
|
|
17310
|
+
(remoteDirectEnabled && !shouldManageTunnel && !preserveAccess));
|
|
17318
17311
|
const relayUrl = relayArg !== null ? relayArg : shouldIgnoreSavedRelay ? '' : relayConfig.load();
|
|
17319
17312
|
if (relayUrl) {
|
|
17320
17313
|
process.env.VIBELET_RELAY_URL = relayUrl;
|
|
@@ -17409,22 +17402,22 @@ async function main() {
|
|
|
17409
17402
|
if (command === 'reset') {
|
|
17410
17403
|
const healthyDaemon = await probeHealth(1_500);
|
|
17411
17404
|
const hasExplicitConfigOverrides =
|
|
17412
|
-
!(0,
|
|
17405
|
+
!(0,_vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_14__/* .doesHealthMatchRequestedConnectionConfig */ .nW)({
|
|
17413
17406
|
health: healthyDaemon,
|
|
17414
17407
|
relayUrl,
|
|
17415
17408
|
canonicalHost: hostArg || '',
|
|
17416
17409
|
fallbackHosts: fallbackHostsArg || '',
|
|
17417
17410
|
localMode: localFlag,
|
|
17418
|
-
|
|
17411
|
+
remoteDirectEnabled,
|
|
17419
17412
|
}) &&
|
|
17420
17413
|
(localFlag ||
|
|
17421
17414
|
relayArg !== null ||
|
|
17422
17415
|
Boolean(relayUrl) ||
|
|
17423
17416
|
Boolean(hostArg) ||
|
|
17424
17417
|
Boolean(fallbackHostsArg) ||
|
|
17425
|
-
|
|
17426
|
-
|
|
17427
|
-
healthyDaemon?.
|
|
17418
|
+
explicitRemoteDirectChoice ||
|
|
17419
|
+
remoteDirectEnabled ||
|
|
17420
|
+
healthyDaemon?.remoteDirect?.enabled === true);
|
|
17428
17421
|
const shouldReplaceDetachedDaemon =
|
|
17429
17422
|
!healthyDaemon && !backend.handlesProcessLifecycle && backend.isServiceInstalled();
|
|
17430
17423
|
if (shouldReplaceDetachedDaemon || (healthyDaemon && hasExplicitConfigOverrides)) {
|
|
@@ -17445,15 +17438,15 @@ async function main() {
|
|
|
17445
17438
|
}
|
|
17446
17439
|
|
|
17447
17440
|
let healthyDaemon = await probeHealth(1_500);
|
|
17448
|
-
let
|
|
17441
|
+
let remoteDirectMismatch = (0,_vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_14__/* .isRemoteDirectConfigurationMismatch */ ._4)({ health: healthyDaemon, remoteDirectEnabled });
|
|
17449
17442
|
let hasExplicitConfigOverrides =
|
|
17450
|
-
!(0,
|
|
17443
|
+
!(0,_vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_14__/* .doesHealthMatchRequestedConnectionConfig */ .nW)({
|
|
17451
17444
|
health: healthyDaemon,
|
|
17452
17445
|
relayUrl,
|
|
17453
17446
|
canonicalHost: hostArg || '',
|
|
17454
17447
|
fallbackHosts: fallbackHostsArg || '',
|
|
17455
17448
|
localMode: localFlag,
|
|
17456
|
-
|
|
17449
|
+
remoteDirectEnabled,
|
|
17457
17450
|
}) &&
|
|
17458
17451
|
(localFlag ||
|
|
17459
17452
|
shouldManageTunnel ||
|
|
@@ -17461,30 +17454,30 @@ async function main() {
|
|
|
17461
17454
|
Boolean(relayUrl) ||
|
|
17462
17455
|
Boolean(hostArg) ||
|
|
17463
17456
|
Boolean(fallbackHostsArg) ||
|
|
17464
|
-
|
|
17465
|
-
|
|
17466
|
-
healthyDaemon?.
|
|
17457
|
+
explicitRemoteDirectChoice ||
|
|
17458
|
+
remoteDirectEnabled ||
|
|
17459
|
+
healthyDaemon?.remoteDirect?.enabled === true);
|
|
17467
17460
|
const relayOverrideRequested =
|
|
17468
17461
|
!localFlag && !hostArg && !fallbackHostsArg && (shouldManageTunnel || relayArg !== null || Boolean(savedRelayUrl));
|
|
17469
17462
|
const canApplyConnectionConfigWithoutRestart = Boolean(
|
|
17470
|
-
healthyDaemon && relayOverrideRequested && hasExplicitConfigOverrides && !
|
|
17463
|
+
healthyDaemon && relayOverrideRequested && hasExplicitConfigOverrides && !remoteDirectMismatch,
|
|
17471
17464
|
);
|
|
17472
17465
|
if (healthyDaemon && hasExplicitConfigOverrides && canApplyConnectionConfigWithoutRestart) {
|
|
17473
17466
|
const refreshedHealth = await tryUpdateRunningDaemonRelay(relayUrl);
|
|
17474
17467
|
if (refreshedHealth) {
|
|
17475
17468
|
healthyDaemon = refreshedHealth;
|
|
17476
|
-
hasExplicitConfigOverrides = !(0,
|
|
17469
|
+
hasExplicitConfigOverrides = !(0,_vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_14__/* .doesHealthMatchRequestedConnectionConfig */ .nW)({
|
|
17477
17470
|
health: healthyDaemon,
|
|
17478
17471
|
relayUrl,
|
|
17479
17472
|
canonicalHost: '',
|
|
17480
17473
|
fallbackHosts: '',
|
|
17481
17474
|
localMode: false,
|
|
17482
|
-
|
|
17475
|
+
remoteDirectEnabled,
|
|
17483
17476
|
});
|
|
17484
|
-
|
|
17477
|
+
remoteDirectMismatch = (0,_vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_14__/* .isRemoteDirectConfigurationMismatch */ ._4)({ health: healthyDaemon, remoteDirectEnabled });
|
|
17485
17478
|
}
|
|
17486
17479
|
}
|
|
17487
|
-
const existingHealth = (0,
|
|
17480
|
+
const existingHealth = (0,_vibelet_runtime_policy_mjs__WEBPACK_IMPORTED_MODULE_14__/* .shouldReuseHealthyDaemon */ .ZN)({
|
|
17488
17481
|
command,
|
|
17489
17482
|
daemonHealthy: Boolean(healthyDaemon),
|
|
17490
17483
|
hasExplicitConfigOverrides,
|
|
@@ -17496,7 +17489,7 @@ async function main() {
|
|
|
17496
17489
|
if (existingHealth) {
|
|
17497
17490
|
const runningVersion = typeof existingHealth.version === 'string' ? existingHealth.version : '';
|
|
17498
17491
|
const activeSessions = typeof existingHealth.activeSessions === 'number' ? existingHealth.activeSessions : 0;
|
|
17499
|
-
const isOutdated = runningVersion && (0,
|
|
17492
|
+
const isOutdated = runningVersion && (0,_vibelet_value_validation_mjs__WEBPACK_IMPORTED_MODULE_13__/* .compareVersions */ .Z)(runningVersion, packageJson.version) < 0;
|
|
17500
17493
|
// Only force a driver switch when the user explicitly requested one (flag/env).
|
|
17501
17494
|
const requestedDriver = process.env.VIBE_CLAUDE_DRIVER ? normalizeDriver(process.env.VIBE_CLAUDE_DRIVER) : null;
|
|
17502
17495
|
const runningDriver = normalizeDriver(existingHealth.claudeDriverMode);
|