@boxes-dev/dvb 1.0.33 → 1.0.35
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/bin/dvb.cjs +43 -47
- package/dist/bin/dvb.cjs.map +1 -1
- package/dist/bin/dvbd.cjs +5 -5
- package/dist/devbox/commands/setup.d.ts +1 -0
- package/dist/devbox/commands/setup.d.ts.map +1 -1
- package/dist/devbox/commands/setup.js +27 -27
- package/dist/devbox/commands/setup.js.map +1 -1
- package/dist/devbox/controlPlane.js +1 -1
- package/dist/scripts/fix-bashrc.sh +2 -1
- package/package.json +1 -1
package/dist/bin/dvb.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c5ff8eeb-e556-5c16-a965-f352e4d938da")}catch(e){}}();
|
|
4
4
|
|
|
5
5
|
var __create = Object.create;
|
|
6
6
|
var __defProp = Object.defineProperty;
|
|
@@ -88634,8 +88634,8 @@ var init_otel = __esm({
|
|
|
88634
88634
|
return trimmed && trimmed.length > 0 ? trimmed : void 0;
|
|
88635
88635
|
};
|
|
88636
88636
|
readBuildMetadata = () => {
|
|
88637
|
-
const rawPackageVersion = "1.0.
|
|
88638
|
-
const rawGitSha = "
|
|
88637
|
+
const rawPackageVersion = "1.0.35";
|
|
88638
|
+
const rawGitSha = "f3556e7e62d92e3775dcf9005933b49b6f735161";
|
|
88639
88639
|
const packageVersion = typeof rawPackageVersion === "string" ? rawPackageVersion : void 0;
|
|
88640
88640
|
const gitSha = typeof rawGitSha === "string" ? rawGitSha : void 0;
|
|
88641
88641
|
return { packageVersion, gitSha };
|
|
@@ -120623,9 +120623,9 @@ var init_sentry = __esm({
|
|
|
120623
120623
|
sentryEnabled = false;
|
|
120624
120624
|
uncaughtExceptionMonitorInstalled = false;
|
|
120625
120625
|
readBuildMetadata2 = () => {
|
|
120626
|
-
const rawPackageVersion = "1.0.
|
|
120627
|
-
const rawGitSha = "
|
|
120628
|
-
const rawSentryRelease = "boxes-dev-dvb@1.0.
|
|
120626
|
+
const rawPackageVersion = "1.0.35";
|
|
120627
|
+
const rawGitSha = "f3556e7e62d92e3775dcf9005933b49b6f735161";
|
|
120628
|
+
const rawSentryRelease = "boxes-dev-dvb@1.0.35+f3556e7e62d92e3775dcf9005933b49b6f735161";
|
|
120629
120629
|
const packageVersion = typeof rawPackageVersion === "string" ? rawPackageVersion : void 0;
|
|
120630
120630
|
const gitSha = typeof rawGitSha === "string" ? rawGitSha : void 0;
|
|
120631
120631
|
const sentryRelease = typeof rawSentryRelease === "string" ? rawSentryRelease : void 0;
|
|
@@ -134194,7 +134194,7 @@ var init_controlPlane = __esm({
|
|
|
134194
134194
|
0 4px 14px rgba(0, 0, 0, 0.05);
|
|
134195
134195
|
}
|
|
134196
134196
|
.brand {
|
|
134197
|
-
display:
|
|
134197
|
+
display: flex;
|
|
134198
134198
|
align-items: center;
|
|
134199
134199
|
justify-content: center;
|
|
134200
134200
|
width: min(100%, 360px);
|
|
@@ -153919,12 +153919,11 @@ var init_qr = __esm({
|
|
|
153919
153919
|
});
|
|
153920
153920
|
|
|
153921
153921
|
// src/devbox/commands/setup.ts
|
|
153922
|
-
var import_node_crypto11,
|
|
153922
|
+
var import_node_crypto11, trim, normalizeOrgSlug, extractOrgFromSpriteToken, normalizeSiteUrl, resolveSiteUrl, MOBILE_DOWNLOAD_LINK, parseSetupArgs, splitQrLines, printMobileDownloadQr, printFirstSetupCompleteMessage, probeSpritesAccess, runSetup;
|
|
153923
153923
|
var init_setup = __esm({
|
|
153924
153924
|
"src/devbox/commands/setup.ts"() {
|
|
153925
153925
|
"use strict";
|
|
153926
153926
|
import_node_crypto11 = require("node:crypto");
|
|
153927
|
-
import_promises31 = __toESM(require("node:readline/promises"), 1);
|
|
153928
153927
|
init_src();
|
|
153929
153928
|
init_src();
|
|
153930
153929
|
init_auth();
|
|
@@ -153935,6 +153934,20 @@ var init_setup = __esm({
|
|
|
153935
153934
|
init_statusLine();
|
|
153936
153935
|
init_completions();
|
|
153937
153936
|
trim = (value) => value.trim().replace(/\r/g, "");
|
|
153937
|
+
normalizeOrgSlug = (value) => {
|
|
153938
|
+
const trimmed = value.trim();
|
|
153939
|
+
if (!trimmed) return void 0;
|
|
153940
|
+
if (!/^[a-z0-9][a-z0-9-]*$/i.test(trimmed)) return void 0;
|
|
153941
|
+
return trimmed;
|
|
153942
|
+
};
|
|
153943
|
+
extractOrgFromSpriteToken = (token) => {
|
|
153944
|
+
const trimmed = token.trim();
|
|
153945
|
+
if (!trimmed) return void 0;
|
|
153946
|
+
const normalized = trimmed.toLowerCase().startsWith("bearer ") ? trimmed.slice("bearer ".length).trim() : trimmed;
|
|
153947
|
+
const slashIndex = normalized.indexOf("/");
|
|
153948
|
+
if (slashIndex <= 0) return void 0;
|
|
153949
|
+
return normalizeOrgSlug(normalized.slice(0, slashIndex));
|
|
153950
|
+
};
|
|
153938
153951
|
normalizeSiteUrl = (raw) => {
|
|
153939
153952
|
const trimmed = trim(raw);
|
|
153940
153953
|
if (!trimmed) return null;
|
|
@@ -154000,18 +154013,6 @@ var init_setup = __esm({
|
|
|
154000
154013
|
}
|
|
154001
154014
|
return parsed;
|
|
154002
154015
|
};
|
|
154003
|
-
promptForValue = async (label) => {
|
|
154004
|
-
if (!process.stdin.isTTY) {
|
|
154005
|
-
throw new Error(`Missing ${label} (non-interactive)`);
|
|
154006
|
-
}
|
|
154007
|
-
const rl = import_promises31.default.createInterface({
|
|
154008
|
-
input: process.stdin,
|
|
154009
|
-
output: process.stdout
|
|
154010
|
-
});
|
|
154011
|
-
const answer = await rl.question(`${label}: `);
|
|
154012
|
-
rl.close();
|
|
154013
|
-
return answer.trim();
|
|
154014
|
-
};
|
|
154015
154016
|
splitQrLines = (qr) => qr ? qr.trimEnd().split("\n") : [];
|
|
154016
154017
|
printMobileDownloadQr = () => {
|
|
154017
154018
|
const link = MOBILE_DOWNLOAD_LINK;
|
|
@@ -154061,9 +154062,8 @@ var init_setup = __esm({
|
|
|
154061
154062
|
const payload = await response.json();
|
|
154062
154063
|
const orgs = /* @__PURE__ */ new Set();
|
|
154063
154064
|
for (const sprite of payload.sprites ?? []) {
|
|
154064
|
-
|
|
154065
|
-
|
|
154066
|
-
}
|
|
154065
|
+
const org = normalizeOrgSlug(sprite.org_slug ?? sprite.organization ?? "");
|
|
154066
|
+
if (org) orgs.add(org);
|
|
154067
154067
|
}
|
|
154068
154068
|
return { orgs: [...orgs] };
|
|
154069
154069
|
};
|
|
@@ -154088,19 +154088,15 @@ var init_setup = __esm({
|
|
|
154088
154088
|
const token = tokenResult.token;
|
|
154089
154089
|
const tokenSource = tokenResult.source;
|
|
154090
154090
|
let org = tokenSource === "flag" ? parsed.org ?? existingConfig?.org : void 0;
|
|
154091
|
+
if (!org && tokenSource === "flag" && parsed.token) {
|
|
154092
|
+
org = extractOrgFromSpriteToken(parsed.token);
|
|
154093
|
+
}
|
|
154091
154094
|
if (parsed.verify) {
|
|
154092
154095
|
status.stage("Verifying token");
|
|
154093
154096
|
const { orgs } = await probeSpritesAccess(apiBaseUrl, token);
|
|
154094
154097
|
if (tokenSource === "flag") {
|
|
154095
|
-
if (!org && orgs.length
|
|
154098
|
+
if (!org && orgs.length > 0) {
|
|
154096
154099
|
org = orgs[0];
|
|
154097
|
-
} else if (!org && orgs.length > 1) {
|
|
154098
|
-
status.stop();
|
|
154099
|
-
org = await promptForValue("Sprites org slug");
|
|
154100
|
-
} else if (!org && orgs.length === 0) {
|
|
154101
|
-
status.stop();
|
|
154102
|
-
org = await promptForValue("Sprites org slug (optional)");
|
|
154103
|
-
if (org.length === 0) org = void 0;
|
|
154104
154100
|
}
|
|
154105
154101
|
}
|
|
154106
154102
|
}
|
|
@@ -154588,16 +154584,16 @@ var init_whoami = __esm({
|
|
|
154588
154584
|
});
|
|
154589
154585
|
|
|
154590
154586
|
// src/devbox/commands/wezterm.ts
|
|
154591
|
-
var import_node_crypto12, import_node_child_process12,
|
|
154587
|
+
var import_node_crypto12, import_node_child_process12, import_promises31, import_node_os13, import_node_path29, import_promises32, logger10, WEZTERM_APP_PATH, WEZTERM_BIN_PATH, WEZTERM_BIN_DIR, WEZTERM_INSTALL_URL, WEZTERM_PATH_EXPORT, WEZTERM_HEALTH_POLL_INTERVAL_MS, WEZTERM_HEALTH_POLL_TIMEOUT_MS, WEZTERM_PROXY_BASE_ENV, WEZTERM_PROXY_LOG_NAME, WEZTERM_USAGE, parseWeztermArgs, resolveCanonical3, initWeztermClient, waitForWeztermMuxHealthy, ensureWeztermMuxReady, runWeztermProxy, runCommand6, promptYesNo2, fileExists, hasWeztermOnPath, resolveShellProfilePath, ensureWeztermOnPath, ensureWeztermInstalled, expandPath, resolveDefaultConfigPath, escapeRegExp2, resolveCliName3, resolveDvbCommand, formatLuaArgs, resolveWeztermProxyEnv, buildProxyCommand, buildDomainBlock, canAppendToConfig, countReturns, applyReturnTableTransform, insertBlock, runWeztermSetup, startWeztermDomain, runWezterm;
|
|
154592
154588
|
var init_wezterm = __esm({
|
|
154593
154589
|
"src/devbox/commands/wezterm.ts"() {
|
|
154594
154590
|
"use strict";
|
|
154595
154591
|
import_node_crypto12 = require("node:crypto");
|
|
154596
154592
|
import_node_child_process12 = require("node:child_process");
|
|
154597
|
-
|
|
154593
|
+
import_promises31 = __toESM(require("node:fs/promises"), 1);
|
|
154598
154594
|
import_node_os13 = __toESM(require("node:os"), 1);
|
|
154599
154595
|
import_node_path29 = __toESM(require("node:path"), 1);
|
|
154600
|
-
|
|
154596
|
+
import_promises32 = __toESM(require("node:readline/promises"), 1);
|
|
154601
154597
|
init_src();
|
|
154602
154598
|
init_daemonClient();
|
|
154603
154599
|
init_auth();
|
|
@@ -154792,10 +154788,10 @@ var init_wezterm = __esm({
|
|
|
154792
154788
|
if (!homeDir) return;
|
|
154793
154789
|
try {
|
|
154794
154790
|
const logDir = import_node_path29.default.join(resolveDevboxDir(homeDir), "wezterm");
|
|
154795
|
-
await
|
|
154791
|
+
await import_promises31.default.mkdir(logDir, { recursive: true });
|
|
154796
154792
|
const line = `${(/* @__PURE__ */ new Date()).toISOString()} ${message}
|
|
154797
154793
|
`;
|
|
154798
|
-
await
|
|
154794
|
+
await import_promises31.default.appendFile(
|
|
154799
154795
|
import_node_path29.default.join(logDir, WEZTERM_PROXY_LOG_NAME),
|
|
154800
154796
|
line,
|
|
154801
154797
|
"utf8"
|
|
@@ -155011,7 +155007,7 @@ var init_wezterm = __esm({
|
|
|
155011
155007
|
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
155012
155008
|
throw new Error("This command requires a TTY to confirm changes.");
|
|
155013
155009
|
}
|
|
155014
|
-
const rl =
|
|
155010
|
+
const rl = import_promises32.default.createInterface({
|
|
155015
155011
|
input: process.stdin,
|
|
155016
155012
|
output: process.stdout
|
|
155017
155013
|
});
|
|
@@ -155023,7 +155019,7 @@ var init_wezterm = __esm({
|
|
|
155023
155019
|
};
|
|
155024
155020
|
fileExists = async (value) => {
|
|
155025
155021
|
try {
|
|
155026
|
-
await
|
|
155022
|
+
await import_promises31.default.access(value);
|
|
155027
155023
|
return true;
|
|
155028
155024
|
} catch {
|
|
155029
155025
|
return false;
|
|
@@ -155069,7 +155065,7 @@ var init_wezterm = __esm({
|
|
|
155069
155065
|
if (shouldUpdate) {
|
|
155070
155066
|
let content = "";
|
|
155071
155067
|
try {
|
|
155072
|
-
content = await
|
|
155068
|
+
content = await import_promises31.default.readFile(profilePath, "utf8");
|
|
155073
155069
|
} catch {
|
|
155074
155070
|
content = "";
|
|
155075
155071
|
}
|
|
@@ -155077,7 +155073,7 @@ var init_wezterm = __esm({
|
|
|
155077
155073
|
const next = `${content.trimEnd()}
|
|
155078
155074
|
${content ? "\n" : ""}${WEZTERM_PATH_EXPORT}
|
|
155079
155075
|
`;
|
|
155080
|
-
await
|
|
155076
|
+
await import_promises31.default.writeFile(profilePath, next, "utf8");
|
|
155081
155077
|
updatedProfile = true;
|
|
155082
155078
|
}
|
|
155083
155079
|
const currentPath = process.env.PATH ?? "";
|
|
@@ -155121,7 +155117,7 @@ ${content ? "\n" : ""}${WEZTERM_PATH_EXPORT}
|
|
|
155121
155117
|
];
|
|
155122
155118
|
for (const candidate of candidates) {
|
|
155123
155119
|
try {
|
|
155124
|
-
await
|
|
155120
|
+
await import_promises31.default.access(candidate);
|
|
155125
155121
|
return candidate;
|
|
155126
155122
|
} catch {
|
|
155127
155123
|
}
|
|
@@ -155140,7 +155136,7 @@ ${content ? "\n" : ""}${WEZTERM_PATH_EXPORT}
|
|
|
155140
155136
|
if (scriptPath) {
|
|
155141
155137
|
const candidate = import_node_path29.default.isAbsolute(scriptPath) ? scriptPath : import_node_path29.default.resolve(process.cwd(), scriptPath);
|
|
155142
155138
|
try {
|
|
155143
|
-
await
|
|
155139
|
+
await import_promises31.default.access(candidate);
|
|
155144
155140
|
return [process.execPath, candidate];
|
|
155145
155141
|
} catch {
|
|
155146
155142
|
}
|
|
@@ -155241,7 +155237,7 @@ ${block}`;
|
|
|
155241
155237
|
let existing = "";
|
|
155242
155238
|
let hasExisting = false;
|
|
155243
155239
|
try {
|
|
155244
|
-
existing = await
|
|
155240
|
+
existing = await import_promises31.default.readFile(configPath, "utf8");
|
|
155245
155241
|
hasExisting = true;
|
|
155246
155242
|
} catch {
|
|
155247
155243
|
hasExisting = false;
|
|
@@ -155280,8 +155276,8 @@ ${block}`;
|
|
|
155280
155276
|
}
|
|
155281
155277
|
}
|
|
155282
155278
|
if (updated) {
|
|
155283
|
-
await
|
|
155284
|
-
await
|
|
155279
|
+
await import_promises31.default.mkdir(import_node_path29.default.dirname(configPath), { recursive: true });
|
|
155280
|
+
await import_promises31.default.writeFile(configPath, nextContent, "utf8");
|
|
155285
155281
|
console.log(`Updated WezTerm config: ${configPath}`);
|
|
155286
155282
|
} else {
|
|
155287
155283
|
console.log(`WezTerm config already up to date: ${configPath}`);
|
|
@@ -155775,4 +155771,4 @@ smol-toml/dist/index.js:
|
|
|
155775
155771
|
*/
|
|
155776
155772
|
//# sourceMappingURL=dvb.cjs.map
|
|
155777
155773
|
|
|
155778
|
-
//# debugId=
|
|
155774
|
+
//# debugId=c5ff8eeb-e556-5c16-a965-f352e4d938da
|