@vibelet/cli 1.2.29 → 1.2.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/runtime-version.cjs +1 -1
- package/dist/vibelet.mjs +70 -4
- package/package.json +1 -1
package/dist/runtime-version.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var s=require("node:fs"),n=require("node:path"),c="@vibelet/cli";function a(e){try{let r=JSON.parse((0,s.readFileSync)(e,"utf8"));if(r.name===c&&typeof r.version=="string"&&r.version.length>0)return r.version}catch{}return null}function p(){return"1.2.
|
|
1
|
+
var s=require("node:fs"),n=require("node:path"),c="@vibelet/cli";function a(e){try{let r=JSON.parse((0,s.readFileSync)(e,"utf8"));if(r.name===c&&typeof r.version=="string"&&r.version.length>0)return r.version}catch{}return null}function p(){return"1.2.31"}var i=p();process.stdout.write(`${i}
|
|
2
2
|
`);
|
package/dist/vibelet.mjs
CHANGED
|
@@ -6667,6 +6667,55 @@ function shouldReuseHealthyDaemon({
|
|
|
6667
6667
|
return !hasExplicitConfigOverrides;
|
|
6668
6668
|
}
|
|
6669
6669
|
|
|
6670
|
+
function normalizeHostValue(host) {
|
|
6671
|
+
if (typeof host !== 'string') return '';
|
|
6672
|
+
return host.trim().replace(/\.$/, '').toLowerCase();
|
|
6673
|
+
}
|
|
6674
|
+
|
|
6675
|
+
function isIpv4Host(host) {
|
|
6676
|
+
const parts = host.split('.');
|
|
6677
|
+
return parts.length === 4 && parts.every((part) => /^\d+$/.test(part) && Number(part) >= 0 && Number(part) <= 255);
|
|
6678
|
+
}
|
|
6679
|
+
|
|
6680
|
+
function isTailscaleHost(host) {
|
|
6681
|
+
const normalized = normalizeHostValue(host.replace(/^https?:\/\//, '').replace(/\/.*$/, ''));
|
|
6682
|
+
if (normalized.endsWith('.ts.net')) return true;
|
|
6683
|
+
if (!isIpv4Host(normalized)) return false;
|
|
6684
|
+
const [first, second] = normalized.split('.').map(Number);
|
|
6685
|
+
return first === 100 && second >= 64 && second <= 127;
|
|
6686
|
+
}
|
|
6687
|
+
|
|
6688
|
+
function isQuickTunnelHost(host) {
|
|
6689
|
+
return normalizeHostValue(host.replace(/^https?:\/\//, '').replace(/\/.*$/, '')).endsWith('.trycloudflare.com');
|
|
6690
|
+
}
|
|
6691
|
+
|
|
6692
|
+
function hasRemoteAdvertisementInLocalMode(health) {
|
|
6693
|
+
const hosts = [
|
|
6694
|
+
typeof health.canonicalHost === 'string' ? health.canonicalHost : '',
|
|
6695
|
+
...(Array.isArray(health.fallbackHosts) ? health.fallbackHosts : []),
|
|
6696
|
+
];
|
|
6697
|
+
if (hosts.some((host) => isTailscaleHost(String(host)) || isQuickTunnelHost(String(host)))) {
|
|
6698
|
+
return true;
|
|
6699
|
+
}
|
|
6700
|
+
|
|
6701
|
+
if (!Array.isArray(health.connections)) {
|
|
6702
|
+
return false;
|
|
6703
|
+
}
|
|
6704
|
+
|
|
6705
|
+
return health.connections.some((connection) => {
|
|
6706
|
+
if (!connection || typeof connection !== 'object') return false;
|
|
6707
|
+
const source = typeof connection.source === 'string' ? connection.source : '';
|
|
6708
|
+
const kind = typeof connection.kind === 'string' ? connection.kind : '';
|
|
6709
|
+
const host = typeof connection.host === 'string' ? connection.host : '';
|
|
6710
|
+
return kind === 'relay'
|
|
6711
|
+
|| source === 'quick_tunnel'
|
|
6712
|
+
|| source === 'configured_relay'
|
|
6713
|
+
|| source === 'tailscale'
|
|
6714
|
+
|| isQuickTunnelHost(host)
|
|
6715
|
+
|| isTailscaleHost(host);
|
|
6716
|
+
});
|
|
6717
|
+
}
|
|
6718
|
+
|
|
6670
6719
|
function doesHealthMatchRequestedConnectionConfig({
|
|
6671
6720
|
health,
|
|
6672
6721
|
relayUrl = '',
|
|
@@ -6686,6 +6735,10 @@ function doesHealthMatchRequestedConnectionConfig({
|
|
|
6686
6735
|
return false;
|
|
6687
6736
|
}
|
|
6688
6737
|
|
|
6738
|
+
if (localMode && hasRemoteAdvertisementInLocalMode(health)) {
|
|
6739
|
+
return false;
|
|
6740
|
+
}
|
|
6741
|
+
|
|
6689
6742
|
if (canonicalHost && health.canonicalHost !== canonicalHost) {
|
|
6690
6743
|
return false;
|
|
6691
6744
|
}
|
|
@@ -6808,6 +6861,12 @@ function normalizePortValue(rawValue) {
|
|
|
6808
6861
|
return parsed;
|
|
6809
6862
|
}
|
|
6810
6863
|
|
|
6864
|
+
function isTruthyEnvFlag(rawValue) {
|
|
6865
|
+
if (typeof rawValue !== 'string') return false;
|
|
6866
|
+
const normalized = rawValue.trim().toLowerCase();
|
|
6867
|
+
return normalized === '' || normalized === '1' || normalized === 'true' || normalized === 'yes';
|
|
6868
|
+
}
|
|
6869
|
+
|
|
6811
6870
|
function printOfficialSite() {
|
|
6812
6871
|
if (officialSitePrinted) return;
|
|
6813
6872
|
officialSitePrinted = true;
|
|
@@ -7117,6 +7176,7 @@ function createDarwinBackend() {
|
|
|
7117
7176
|
if (process.env.VIBELET_RELAY_URL) envVars.VIBELET_RELAY_URL = process.env.VIBELET_RELAY_URL;
|
|
7118
7177
|
if (process.env.VIBELET_CANONICAL_HOST) envVars.VIBELET_CANONICAL_HOST = process.env.VIBELET_CANONICAL_HOST;
|
|
7119
7178
|
if (process.env.VIBELET_FALLBACK_HOSTS) envVars.VIBELET_FALLBACK_HOSTS = process.env.VIBELET_FALLBACK_HOSTS;
|
|
7179
|
+
if (process.env.VIBELET_LOCAL_ONLY) envVars.VIBELET_LOCAL_ONLY = process.env.VIBELET_LOCAL_ONLY;
|
|
7120
7180
|
if (process.env.CODEX_PATH) envVars.CODEX_PATH = process.env.CODEX_PATH;
|
|
7121
7181
|
if (process.env.CLAUDE_PATH) envVars.CLAUDE_PATH = process.env.CLAUDE_PATH;
|
|
7122
7182
|
const envSection = Object.keys(envVars).length > 0
|
|
@@ -7251,7 +7311,7 @@ RestartSec=3
|
|
|
7251
7311
|
StandardOutput=append:${stdoutLogPath}
|
|
7252
7312
|
StandardError=append:${stderrLogPath}
|
|
7253
7313
|
Environment=PATH=${servicePath}
|
|
7254
|
-
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}` : ''}
|
|
7314
|
+
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}` : ''}
|
|
7255
7315
|
|
|
7256
7316
|
[Install]
|
|
7257
7317
|
WantedBy=default.target
|
|
@@ -7809,7 +7869,7 @@ function printHelp() {
|
|
|
7809
7869
|
process.stdout.write(`Usage:\n`);
|
|
7810
7870
|
process.stdout.write(` npx ${packageJson.name} Install/start the daemon, auto-enable remote access, and print a pairing QR code\n`);
|
|
7811
7871
|
process.stdout.write(` npx ${packageJson.name} start Same as above\n`);
|
|
7812
|
-
process.stdout.write(` npx ${packageJson.name} --local
|
|
7872
|
+
process.stdout.write(` npx ${packageJson.name} --local Use LAN/local pairing only; skip Cloudflare and Tailscale\n`);
|
|
7813
7873
|
process.stdout.write(` npx ${packageJson.name} --force Force a new Cloudflare Tunnel URL\n`);
|
|
7814
7874
|
process.stdout.write(` npx ${packageJson.name} --relay <url> Use a custom tunnel URL for remote access\n`);
|
|
7815
7875
|
process.stdout.write(` npx ${packageJson.name} --host <ip> Set the primary LAN/Tailscale host/IP address\n`);
|
|
@@ -7829,7 +7889,7 @@ function printHelp() {
|
|
|
7829
7889
|
process.stdout.write(`Remote access:\n`);
|
|
7830
7890
|
process.stdout.write(` # Remote access is on by default for start/reset/restart\n`);
|
|
7831
7891
|
process.stdout.write(` npx ${packageJson.name}\n\n`);
|
|
7832
|
-
process.stdout.write(` # Want LAN-only pairing for this run?\n`);
|
|
7892
|
+
process.stdout.write(` # Want LAN/local-only pairing for this run?\n`);
|
|
7833
7893
|
process.stdout.write(` npx ${packageJson.name} --local\n\n`);
|
|
7834
7894
|
process.stdout.write(` # Need a fresh Cloudflare Tunnel URL?\n`);
|
|
7835
7895
|
process.stdout.write(` npx ${packageJson.name} --force\n\n`);
|
|
@@ -8057,7 +8117,7 @@ async function main() {
|
|
|
8057
8117
|
}
|
|
8058
8118
|
|
|
8059
8119
|
(0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_11__/* .consumeFlag */ .PC)(process.argv, 'remote') || (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_11__/* .consumeFlag */ .PC)(process.argv, 'tunnel') || (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_11__/* .readNpmConfigFlag */ .AW)('remote') || (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_11__/* .readNpmConfigFlag */ .AW)('tunnel');
|
|
8060
|
-
const localFlag = (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_11__/* .consumeFlag */ .PC)(process.argv, 'local') || (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_11__/* .readNpmConfigFlag */ .AW)('local');
|
|
8120
|
+
const localFlag = (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_11__/* .consumeFlag */ .PC)(process.argv, 'local') || (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_11__/* .readNpmConfigFlag */ .AW)('local') || isTruthyEnvFlag(process.env.VIBELET_LOCAL_ONLY);
|
|
8061
8121
|
const forceFlag = (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_11__/* .consumeFlag */ .PC)(process.argv, 'force') || (0,_vibelet_cli_args_mjs__WEBPACK_IMPORTED_MODULE_11__/* .readNpmConfigFlag */ .AW)('force');
|
|
8062
8122
|
const relayArg = parseRelayArg();
|
|
8063
8123
|
const hostArg = parseNamedArg('host', '100.x.x.x');
|
|
@@ -8083,6 +8143,12 @@ async function main() {
|
|
|
8083
8143
|
return;
|
|
8084
8144
|
}
|
|
8085
8145
|
|
|
8146
|
+
if (localFlag) {
|
|
8147
|
+
process.env.VIBELET_LOCAL_ONLY = '1';
|
|
8148
|
+
} else {
|
|
8149
|
+
delete process.env.VIBELET_LOCAL_ONLY;
|
|
8150
|
+
}
|
|
8151
|
+
|
|
8086
8152
|
if (shouldManageTunnel) {
|
|
8087
8153
|
const existing = forceFlag ? null : getAliveTunnel();
|
|
8088
8154
|
if (existing) {
|