@wix/himalaya-cli 0.1921.0 → 0.1922.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +177 -21
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -3964,7 +3964,6 @@ var init_himi_package = __esm({
|
|
|
3964
3964
|
var ICON_VIEW_BOX, ICON_STROKE_WIDTH, ICON_FALLBACK, ICON_CATALOG, ICON_NORMALIZED_INDEX, ICON_NAMES;
|
|
3965
3965
|
var init_icon_catalog_generated = __esm({
|
|
3966
3966
|
"../../core/ts/src/icon-catalog.generated.ts"() {
|
|
3967
|
-
"use strict";
|
|
3968
3967
|
init_define_HHP_CATALOG();
|
|
3969
3968
|
ICON_VIEW_BOX = 24;
|
|
3970
3969
|
ICON_STROKE_WIDTH = 2;
|
|
@@ -48460,10 +48459,98 @@ async function buildMacosWinlist(bin) {
|
|
|
48460
48459
|
return compiledWinlist(bin);
|
|
48461
48460
|
}
|
|
48462
48461
|
async function listMacosWindows() {
|
|
48462
|
+
return (await listAllMacosWindows()).filter(isHimalayaAppWindow);
|
|
48463
|
+
}
|
|
48464
|
+
async function listAllMacosWindows() {
|
|
48465
|
+
const parsed = JSON.parse(await runMacosHelper("list"));
|
|
48466
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
48467
|
+
}
|
|
48468
|
+
async function runCompiledMacosHelper(sub) {
|
|
48469
|
+
const bin = macosWinlistBin();
|
|
48470
|
+
if (!existsSync37(bin)) throw new Error("macos enumerator not compiled yet");
|
|
48471
|
+
return (await runner.capture(bin, [sub], DEVICE_LIST_TIMEOUT_MS)).toString("utf8");
|
|
48472
|
+
}
|
|
48473
|
+
async function runMacosHelper(sub) {
|
|
48463
48474
|
const { cmd, args, timeoutMs } = await macosWinlistCommand();
|
|
48464
|
-
const out2 = await runner.capture(cmd, args, timeoutMs);
|
|
48465
|
-
|
|
48466
|
-
|
|
48475
|
+
const out2 = await runner.capture(cmd, [...args.slice(0, -1), sub], timeoutMs);
|
|
48476
|
+
return out2.toString("utf8");
|
|
48477
|
+
}
|
|
48478
|
+
async function macosHostApp() {
|
|
48479
|
+
try {
|
|
48480
|
+
const out2 = (await runner.capture(PS_BIN, ["-A", "-o", "pid=,ppid=,comm="], DEVICE_LIST_TIMEOUT_MS)).toString("utf8");
|
|
48481
|
+
const procs = /* @__PURE__ */ new Map();
|
|
48482
|
+
for (const line of out2.split("\n")) {
|
|
48483
|
+
const m2 = /^\s*(\d+)\s+(\d+)\s+(.+)$/.exec(line);
|
|
48484
|
+
if (m2) procs.set(Number(m2[1]), { ppid: Number(m2[2]), comm: m2[3].trim() });
|
|
48485
|
+
}
|
|
48486
|
+
let outermost = null;
|
|
48487
|
+
let pid = process.pid;
|
|
48488
|
+
for (let hops = 0; hops < 64 && pid > 1; hops++) {
|
|
48489
|
+
const p2 = procs.get(pid);
|
|
48490
|
+
if (!p2) break;
|
|
48491
|
+
const app2 = /\/([^/]+)\.app\//.exec(p2.comm);
|
|
48492
|
+
if (app2) outermost = app2[1];
|
|
48493
|
+
pid = p2.ppid;
|
|
48494
|
+
}
|
|
48495
|
+
return outermost;
|
|
48496
|
+
} catch {
|
|
48497
|
+
}
|
|
48498
|
+
return null;
|
|
48499
|
+
}
|
|
48500
|
+
async function macosCaptureStatus() {
|
|
48501
|
+
try {
|
|
48502
|
+
const s5 = JSON.parse(await runCompiledMacosHelper("status"));
|
|
48503
|
+
if (typeof s5.displayAsleep !== "boolean" || typeof s5.screenRecording !== "boolean") return null;
|
|
48504
|
+
return { displayAsleep: s5.displayAsleep, screenLocked: s5.screenLocked === true, screenRecording: s5.screenRecording };
|
|
48505
|
+
} catch {
|
|
48506
|
+
return null;
|
|
48507
|
+
}
|
|
48508
|
+
}
|
|
48509
|
+
async function diagnoseMacosCaptureFailure(windowId, err) {
|
|
48510
|
+
const detail = err.message.trim();
|
|
48511
|
+
const status2 = await macosCaptureStatus();
|
|
48512
|
+
if (status2 && !status2.screenRecording) {
|
|
48513
|
+
const host = await macosHostApp();
|
|
48514
|
+
const who2 = host ? `"${host}"` : "the app that launched the dev-server (your terminal, dev-3.0, or IDE)";
|
|
48515
|
+
return new MacosCaptureError(
|
|
48516
|
+
"screen_recording_denied",
|
|
48517
|
+
`macos_screen_recording_denied: ${who2} has no Screen Recording permission, so macOS refuses to capture window ${windowId} (${detail})`,
|
|
48518
|
+
`Grant ${who2} Screen Recording in System Settings > Privacy & Security > Screen & System Audio Recording, then quit and reopen it. ${RENDER_FALLBACK_HINT}`,
|
|
48519
|
+
host ?? void 0
|
|
48520
|
+
);
|
|
48521
|
+
}
|
|
48522
|
+
if (status2?.displayAsleep) {
|
|
48523
|
+
return new MacosCaptureError(
|
|
48524
|
+
"display_asleep",
|
|
48525
|
+
`macos_display_asleep: the display is asleep, so the window server has no image of window ${windowId} to capture (${detail}). This is not a permission problem.`,
|
|
48526
|
+
`Wake the display and retry: add \`&wake=1\` to the snapshot URL, or run \`caffeinate -u -t 2\` first. ${RENDER_FALLBACK_HINT}`
|
|
48527
|
+
);
|
|
48528
|
+
}
|
|
48529
|
+
if (status2?.screenLocked) {
|
|
48530
|
+
return new MacosCaptureError(
|
|
48531
|
+
"screen_locked",
|
|
48532
|
+
`macos_screen_locked: the screen is locked, which can block capturing window ${windowId} (${detail})`,
|
|
48533
|
+
`Unlock the Mac and retry. ${RENDER_FALLBACK_HINT}`
|
|
48534
|
+
);
|
|
48535
|
+
}
|
|
48536
|
+
let windows = null;
|
|
48537
|
+
try {
|
|
48538
|
+
const parsed = JSON.parse(await runCompiledMacosHelper("list"));
|
|
48539
|
+
if (Array.isArray(parsed)) windows = parsed;
|
|
48540
|
+
} catch {
|
|
48541
|
+
}
|
|
48542
|
+
if (windows && !windows.some((w2) => String(w2.windowId) === windowId)) {
|
|
48543
|
+
return new MacosCaptureError(
|
|
48544
|
+
"window_gone",
|
|
48545
|
+
`macos_window_gone: window ${windowId} is not on screen (closed, minimised, on another Space, or the app relaunched with a new window id) (${detail})`,
|
|
48546
|
+
"List the current windows with `GET /__dev/preview/devices` and capture again without `device=` (the first Himalaya window) or with a current id. A minimised window must be restored first."
|
|
48547
|
+
);
|
|
48548
|
+
}
|
|
48549
|
+
return new MacosCaptureError(
|
|
48550
|
+
"unknown",
|
|
48551
|
+
`macos_capture_failed: screencapture could not capture window ${windowId} (${detail})`,
|
|
48552
|
+
`Check that the window is visible on the current Space and the display is on. ${RENDER_FALLBACK_HINT}`
|
|
48553
|
+
);
|
|
48467
48554
|
}
|
|
48468
48555
|
async function listMacosWindowsSafe() {
|
|
48469
48556
|
try {
|
|
@@ -48515,9 +48602,10 @@ function parsePreviewParams(url) {
|
|
|
48515
48602
|
return { error: "platform must be 'ios', 'android', 'macos', 'tvos' or 'androidtv'" };
|
|
48516
48603
|
}
|
|
48517
48604
|
const device = q4.get("device") ?? void 0;
|
|
48518
|
-
|
|
48605
|
+
const wake = q4.get("wake") === "1" || q4.get("wake") === "true";
|
|
48606
|
+
return wake ? { platform, device, wake } : { platform, device };
|
|
48519
48607
|
}
|
|
48520
|
-
async function captureFrame(params, format = "png") {
|
|
48608
|
+
async function captureFrame(params, format = "png", opts = { diagnose: true }) {
|
|
48521
48609
|
if (params.platform === "ios" || params.platform === "tvos") {
|
|
48522
48610
|
const udid = params.device ?? (params.platform === "tvos" ? await firstBootedTvosUdid() : await firstBootedIosUdid());
|
|
48523
48611
|
if (!udid) {
|
|
@@ -48540,9 +48628,27 @@ async function captureFrame(params, format = "png") {
|
|
|
48540
48628
|
}
|
|
48541
48629
|
if (!windowId) throw new Error("no_macos_window");
|
|
48542
48630
|
const tmp = resolvePath(tmpdir(), `himalaya-macos-preview-${windowId}-${process.pid}-${++macosCaptureSeq}.png`);
|
|
48543
|
-
|
|
48631
|
+
const shoot2 = async () => {
|
|
48544
48632
|
await runner.capture(SCREENCAPTURE_BIN, ["-o", "-x", `-l${windowId}`, tmp]);
|
|
48545
48633
|
return { buf: readFileSync37(tmp), mime: "image/png" };
|
|
48634
|
+
};
|
|
48635
|
+
try {
|
|
48636
|
+
try {
|
|
48637
|
+
return await shoot2();
|
|
48638
|
+
} catch (e2) {
|
|
48639
|
+
if (!opts.diagnose) throw e2;
|
|
48640
|
+
const failure4 = await diagnoseMacosCaptureFailure(windowId, e2);
|
|
48641
|
+
if (failure4.reason !== "display_asleep" || !params.wake) throw failure4;
|
|
48642
|
+
try {
|
|
48643
|
+
await runner.capture(CAFFEINATE_BIN, ["-u", "-t", "2"]);
|
|
48644
|
+
} catch {
|
|
48645
|
+
}
|
|
48646
|
+
try {
|
|
48647
|
+
return await shoot2();
|
|
48648
|
+
} catch (retryErr) {
|
|
48649
|
+
throw await diagnoseMacosCaptureFailure(windowId, retryErr);
|
|
48650
|
+
}
|
|
48651
|
+
}
|
|
48546
48652
|
} finally {
|
|
48547
48653
|
try {
|
|
48548
48654
|
unlinkSync(tmp);
|
|
@@ -48557,7 +48663,7 @@ async function captureFrame(params, format = "png") {
|
|
|
48557
48663
|
const args = serial ? ["-s", serial, "exec-out", "screencap", "-p"] : ["exec-out", "screencap", "-p"];
|
|
48558
48664
|
return { buf: await runner.capture(ADB_BIN, args), mime: "image/png" };
|
|
48559
48665
|
}
|
|
48560
|
-
async function handlePreviewSnapshot(
|
|
48666
|
+
async function handlePreviewSnapshot(req, res, url) {
|
|
48561
48667
|
const params = parsePreviewParams(url);
|
|
48562
48668
|
if ("error" in params) {
|
|
48563
48669
|
res.statusCode = 400;
|
|
@@ -48565,6 +48671,15 @@ async function handlePreviewSnapshot(_req, res, url) {
|
|
|
48565
48671
|
res.end(JSON.stringify({ error: params.error }));
|
|
48566
48672
|
return;
|
|
48567
48673
|
}
|
|
48674
|
+
if (params.wake) {
|
|
48675
|
+
const refused2 = wakeRefusal(req);
|
|
48676
|
+
if (refused2) {
|
|
48677
|
+
res.statusCode = 403;
|
|
48678
|
+
res.setHeader("content-type", "application/json");
|
|
48679
|
+
res.end(JSON.stringify({ error: "wake_refused", detail: refused2 }));
|
|
48680
|
+
return;
|
|
48681
|
+
}
|
|
48682
|
+
}
|
|
48568
48683
|
try {
|
|
48569
48684
|
const q4 = new URLSearchParams(url.split("?")[1] ?? "");
|
|
48570
48685
|
const format = q4.get("format") === "jpeg" ? "jpeg" : "png";
|
|
@@ -48576,9 +48691,37 @@ async function handlePreviewSnapshot(_req, res, url) {
|
|
|
48576
48691
|
} catch (err) {
|
|
48577
48692
|
res.statusCode = 503;
|
|
48578
48693
|
res.setHeader("content-type", "application/json");
|
|
48579
|
-
res.end(JSON.stringify(
|
|
48694
|
+
res.end(JSON.stringify(captureFailureBody(err)));
|
|
48580
48695
|
}
|
|
48581
48696
|
}
|
|
48697
|
+
function wakeRefusal(req) {
|
|
48698
|
+
const addr = req.socket?.remoteAddress ?? "";
|
|
48699
|
+
if (!LOOPBACK3.has(addr)) return `wake=1 is accepted only from this machine (request came from ${addr || "an unknown address"})`;
|
|
48700
|
+
const site = req.headers["sec-fetch-site"];
|
|
48701
|
+
if (req.headers.origin !== void 0 || site !== void 0 && site !== "none") {
|
|
48702
|
+
return "wake=1 is not accepted from a browser page; run the request from a terminal (curl or `himalaya-dev preview snapshot --wake 1`)";
|
|
48703
|
+
}
|
|
48704
|
+
return null;
|
|
48705
|
+
}
|
|
48706
|
+
function captureFailureBody(err) {
|
|
48707
|
+
if (!(err instanceof MacosCaptureError)) return { error: "capture_failed", detail: err.message };
|
|
48708
|
+
return {
|
|
48709
|
+
error: "capture_failed",
|
|
48710
|
+
detail: err.message,
|
|
48711
|
+
cause: err.reason,
|
|
48712
|
+
hint: err.hint,
|
|
48713
|
+
...err.hostApp ? { hostApp: err.hostApp } : {},
|
|
48714
|
+
...err.reason === "window_gone" ? {} : {
|
|
48715
|
+
fallback: {
|
|
48716
|
+
method: "POST",
|
|
48717
|
+
path: "/__dev/render",
|
|
48718
|
+
body: { png: true },
|
|
48719
|
+
needs: "screenId",
|
|
48720
|
+
nativePixels: false
|
|
48721
|
+
}
|
|
48722
|
+
}
|
|
48723
|
+
};
|
|
48724
|
+
}
|
|
48582
48725
|
async function handlePreviewStream(req, res, url) {
|
|
48583
48726
|
const params = parsePreviewParams(url);
|
|
48584
48727
|
if ("error" in params) {
|
|
@@ -48604,7 +48747,7 @@ async function handlePreviewStream(req, res, url) {
|
|
|
48604
48747
|
if (stopped || inFlight) return;
|
|
48605
48748
|
inFlight = true;
|
|
48606
48749
|
try {
|
|
48607
|
-
const { buf, mime } = await captureFrame(params, format);
|
|
48750
|
+
const { buf, mime } = await captureFrame({ ...params, wake: false }, format, { diagnose: false });
|
|
48608
48751
|
if (stopped) return;
|
|
48609
48752
|
const header2 = `--${BOUNDARY}\r
|
|
48610
48753
|
Content-Type: ${mime}\r
|
|
@@ -49164,7 +49307,7 @@ async function handlePreviewClip(res, url) {
|
|
|
49164
49307
|
res.setHeader("cache-control", "no-store");
|
|
49165
49308
|
createReadStream(clip3.path).pipe(res);
|
|
49166
49309
|
}
|
|
49167
|
-
var DEFAULT_CAPTURE_TIMEOUT_MS, DEVICE_LIST_TIMEOUT_MS, defaultRunner, runner, ADB_BIN, IDB_BIN, XCRUN_BIN, SWIFT_BIN, SWIFTC_BIN, SCREENCAPTURE_BIN, MACOS_WINLIST, MACOS_WINLIST_BUILD_TIMEOUT_MS, MACOS_WINLIST_INTERPRET_TIMEOUT_MS, HIMALAYA_MAC_BUNDLE_ID, macosWinlistCompileFailed, macosWinlistInFlight, macosWinlistAttempt, macosCaptureSeq, interpretWinlist, compiledWinlist, BOUNDARY, dimsCache, ANDROID_KEYCODES, IOS_BUTTONS, layoutCache, normRect, RECORD_MAX_MS, recordSeq, recordings, clips;
|
|
49310
|
+
var DEFAULT_CAPTURE_TIMEOUT_MS, DEVICE_LIST_TIMEOUT_MS, defaultRunner, runner, ADB_BIN, IDB_BIN, XCRUN_BIN, SWIFT_BIN, SWIFTC_BIN, SCREENCAPTURE_BIN, CAFFEINATE_BIN, PS_BIN, MACOS_WINLIST, MACOS_WINLIST_BUILD_TIMEOUT_MS, MACOS_WINLIST_INTERPRET_TIMEOUT_MS, HIMALAYA_MAC_BUNDLE_ID, macosWinlistCompileFailed, macosWinlistInFlight, macosWinlistAttempt, macosCaptureSeq, interpretWinlist, compiledWinlist, MacosCaptureError, RENDER_FALLBACK_HINT, LOOPBACK3, BOUNDARY, dimsCache, ANDROID_KEYCODES, IOS_BUTTONS, layoutCache, normRect, RECORD_MAX_MS, recordSeq, recordings, clips;
|
|
49168
49311
|
var init_preview2 = __esm({
|
|
49169
49312
|
"../../core/dev-server/src/preview.ts"() {
|
|
49170
49313
|
init_define_HHP_CATALOG();
|
|
@@ -49214,6 +49357,8 @@ var init_preview2 = __esm({
|
|
|
49214
49357
|
SWIFT_BIN = process.env.HIMALAYA_SWIFT_PATH ?? "swift";
|
|
49215
49358
|
SWIFTC_BIN = process.env.HIMALAYA_SWIFTC_PATH ?? "swiftc";
|
|
49216
49359
|
SCREENCAPTURE_BIN = process.env.HIMALAYA_SCREENCAPTURE_PATH ?? "screencapture";
|
|
49360
|
+
CAFFEINATE_BIN = process.env.HIMALAYA_CAFFEINATE_PATH ?? "caffeinate";
|
|
49361
|
+
PS_BIN = process.env.HIMALAYA_PS_PATH ?? "ps";
|
|
49217
49362
|
MACOS_WINLIST = resolvePath(dirname25(fileURLToPath23(import.meta.url)), "../scripts/macos-winshot.swift");
|
|
49218
49363
|
MACOS_WINLIST_BUILD_TIMEOUT_MS = 12e4;
|
|
49219
49364
|
MACOS_WINLIST_INTERPRET_TIMEOUT_MS = 3e4;
|
|
@@ -49224,6 +49369,17 @@ var init_preview2 = __esm({
|
|
|
49224
49369
|
macosCaptureSeq = 0;
|
|
49225
49370
|
interpretWinlist = () => ({ cmd: SWIFT_BIN, args: [MACOS_WINLIST, "list"], timeoutMs: MACOS_WINLIST_INTERPRET_TIMEOUT_MS });
|
|
49226
49371
|
compiledWinlist = (bin) => ({ cmd: bin, args: ["list"], timeoutMs: DEVICE_LIST_TIMEOUT_MS });
|
|
49372
|
+
MacosCaptureError = class extends Error {
|
|
49373
|
+
constructor(reason, message5, hint, hostApp) {
|
|
49374
|
+
super(message5);
|
|
49375
|
+
this.reason = reason;
|
|
49376
|
+
this.hint = hint;
|
|
49377
|
+
this.hostApp = hostApp;
|
|
49378
|
+
this.name = "MacosCaptureError";
|
|
49379
|
+
}
|
|
49380
|
+
};
|
|
49381
|
+
RENDER_FALLBACK_HINT = 'No native capture is possible in this state; for a picture of the screen\'s content use the headless render, `POST /__dev/render {"screenId":"<id>","png":true}` (or `himalaya-dev screen render <id> --png <file>`). It is the web renderer\'s drawing, not Mac pixels, so it does not prove native parity.';
|
|
49382
|
+
LOOPBACK3 = /* @__PURE__ */ new Set(["127.0.0.1", "::1", "::ffff:127.0.0.1"]);
|
|
49227
49383
|
BOUNDARY = "himalaya-preview-frame";
|
|
49228
49384
|
dimsCache = /* @__PURE__ */ new Map();
|
|
49229
49385
|
ANDROID_KEYCODES = {
|
|
@@ -215524,11 +215680,11 @@ function checkBaseUrl(value2) {
|
|
|
215524
215680
|
} catch {
|
|
215525
215681
|
throw new GplayError("refused", `--base-url ${value2} is not a URL`);
|
|
215526
215682
|
}
|
|
215527
|
-
if (!
|
|
215683
|
+
if (!LOOPBACK4.has(url.hostname) || url.username || url.password)
|
|
215528
215684
|
throw new GplayError("refused", `--base-url must be a loopback address (the simulator); ${url.host} is not`);
|
|
215529
215685
|
return url.origin;
|
|
215530
215686
|
}
|
|
215531
|
-
var HOSTS, TOKEN_REFRESH_SKEW_MS, DETAIL_LIMIT,
|
|
215687
|
+
var HOSTS, TOKEN_REFRESH_SKEW_MS, DETAIL_LIMIT, LOOPBACK4, GoogleTransport;
|
|
215532
215688
|
var init_transport = __esm({
|
|
215533
215689
|
"../../node_modules/@wix/gplay-api/dist/transport.js"() {
|
|
215534
215690
|
init_define_HHP_CATALOG();
|
|
@@ -215543,7 +215699,7 @@ var init_transport = __esm({
|
|
|
215543
215699
|
};
|
|
215544
215700
|
TOKEN_REFRESH_SKEW_MS = 6e4;
|
|
215545
215701
|
DETAIL_LIMIT = 1e3;
|
|
215546
|
-
|
|
215702
|
+
LOOPBACK4 = /* @__PURE__ */ new Set(["127.0.0.1", "localhost", "[::1]"]);
|
|
215547
215703
|
GoogleTransport = class {
|
|
215548
215704
|
options;
|
|
215549
215705
|
fetchImpl;
|
|
@@ -228876,7 +229032,7 @@ function appleErrors(payload) {
|
|
|
228876
229032
|
const errors = payload?.errors;
|
|
228877
229033
|
return Array.isArray(errors) ? errors.filter((e2) => !!e2 && typeof e2 === "object") : [];
|
|
228878
229034
|
}
|
|
228879
|
-
var ASC_ORIGIN, ENTERPRISE_ORIGIN, DEFAULT_MAX_PAGES, DEFAULT_PAGE_LIMIT, MUTATION_LIMIT, BULK_MUTATION_LIMIT, TOKEN_REFRESH_SKEW_MS2, DETAIL_LIMIT2, Semaphore,
|
|
229035
|
+
var ASC_ORIGIN, ENTERPRISE_ORIGIN, DEFAULT_MAX_PAGES, DEFAULT_PAGE_LIMIT, MUTATION_LIMIT, BULK_MUTATION_LIMIT, TOKEN_REFRESH_SKEW_MS2, DETAIL_LIMIT2, Semaphore, LOOPBACK5, AscTransport;
|
|
228880
229036
|
var init_transport2 = __esm({
|
|
228881
229037
|
"../../node_modules/@wix/asc-core/dist/transport.js"() {
|
|
228882
229038
|
init_define_HHP_CATALOG();
|
|
@@ -228912,7 +229068,7 @@ var init_transport2 = __esm({
|
|
|
228912
229068
|
};
|
|
228913
229069
|
}
|
|
228914
229070
|
};
|
|
228915
|
-
|
|
229071
|
+
LOOPBACK5 = /* @__PURE__ */ new Set(["127.0.0.1", "localhost", "[::1]", "::1"]);
|
|
228916
229072
|
AscTransport = class {
|
|
228917
229073
|
options;
|
|
228918
229074
|
origin;
|
|
@@ -228935,7 +229091,7 @@ var init_transport2 = __esm({
|
|
|
228935
229091
|
const base2 = new URL(options2.baseUrl ?? (options2.enterprise ? ENTERPRISE_ORIGIN : ASC_ORIGIN));
|
|
228936
229092
|
if (base2.username || base2.password)
|
|
228937
229093
|
throw new AscError("refused", "the API base URL must not carry credentials");
|
|
228938
|
-
if (base2.protocol !== "https:" && !(base2.protocol === "http:" &&
|
|
229094
|
+
if (base2.protocol !== "https:" && !(base2.protocol === "http:" && LOOPBACK5.has(base2.hostname))) {
|
|
228939
229095
|
throw new AscError("refused", `refusing a non-HTTPS API base URL ${base2.origin} (plain HTTP is allowed only on loopback, for the simulator)`);
|
|
228940
229096
|
}
|
|
228941
229097
|
this.origin = base2.origin;
|
|
@@ -253943,7 +254099,7 @@ function checkBaseUrl2(value2) {
|
|
|
253943
254099
|
} catch {
|
|
253944
254100
|
throw new UsageError(`--base-url ${value2} is not a URL`);
|
|
253945
254101
|
}
|
|
253946
|
-
if (!
|
|
254102
|
+
if (!LOOPBACK6.has(url.hostname))
|
|
253947
254103
|
throw new UsageError(`--base-url must be a loopback address (the simulator); ${url.host} is not`);
|
|
253948
254104
|
return url.origin;
|
|
253949
254105
|
}
|
|
@@ -253957,7 +254113,7 @@ function checkWorkerUrl(value2) {
|
|
|
253957
254113
|
throw new UsageError(`--worker ${value2} is not a URL`);
|
|
253958
254114
|
}
|
|
253959
254115
|
const base2 = `${url.origin}${url.pathname.replace(/\/+$/, "")}`;
|
|
253960
|
-
if (
|
|
254116
|
+
if (LOOPBACK6.has(url.hostname))
|
|
253961
254117
|
return { url: base2, gateway: false };
|
|
253962
254118
|
if (url.protocol !== "https:")
|
|
253963
254119
|
throw new UsageError(`--worker must be https off loopback (the hosted worker behind the gateway); ${url.protocol}//${url.host} is not`);
|
|
@@ -253979,7 +254135,7 @@ function safeUser() {
|
|
|
253979
254135
|
return "unknown";
|
|
253980
254136
|
}
|
|
253981
254137
|
}
|
|
253982
|
-
var chmodSync5, existsSync116, mkdirSync49, readFileSync137, renameSync18, writeFileSync52, homedir15, userInfo2, join144,
|
|
254138
|
+
var chmodSync5, existsSync116, mkdirSync49, readFileSync137, renameSync18, writeFileSync52, homedir15, userInfo2, join144, LOOPBACK6, Context, GuardedProfileStore;
|
|
253983
254139
|
var init_context = __esm({
|
|
253984
254140
|
"../../node_modules/@wix/asc/dist/context.js"() {
|
|
253985
254141
|
init_define_HHP_CATALOG();
|
|
@@ -253994,7 +254150,7 @@ var init_context = __esm({
|
|
|
253994
254150
|
({ chmodSync: chmodSync5, existsSync: existsSync116, mkdirSync: mkdirSync49, readFileSync: readFileSync137, renameSync: renameSync18, writeFileSync: writeFileSync52 } = __ascBuiltin073);
|
|
253995
254151
|
({ homedir: homedir15, userInfo: userInfo2 } = __ascBuiltin147);
|
|
253996
254152
|
({ join: join144 } = __ascBuiltin225);
|
|
253997
|
-
|
|
254153
|
+
LOOPBACK6 = /* @__PURE__ */ new Set(["127.0.0.1", "localhost", "[::1]"]);
|
|
253998
254154
|
Context = class _Context {
|
|
253999
254155
|
flags;
|
|
254000
254156
|
io;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1922.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
|
|
6
6
|
"keywords": [
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"artifactId": "himalaya-cli"
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
|
-
"falconPackageHash": "
|
|
85
|
+
"falconPackageHash": "2cefdcf3427a2266ad96367bcf1893b3b3dd45f17a9dc95565199e34"
|
|
86
86
|
}
|