@wix/himalaya-cli 0.1335.0 → 0.1337.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.
Files changed (2) hide show
  1. package/dist/cli.mjs +151 -65
  2. package/package.json +2 -2
package/dist/cli.mjs CHANGED
@@ -7535,7 +7535,6 @@ function buttonVariant(style) {
7535
7535
  var SYSTEM_FONT_FAMILY, TONAL_ELEVATION_ALPHA, BUTTON_MIN_HIT_TARGET, nonNegative, nonEmpty, own, COLOR_TOKEN_PROPS, TYPOGRAPHY_TOKEN_PROPS, BUTTON_VARIANTS;
7536
7536
  var init_tokens = __esm({
7537
7537
  "../../core/ts/src/tokens.ts"() {
7538
- "use strict";
7539
7538
  SYSTEM_FONT_FAMILY = "$system";
7540
7539
  TONAL_ELEVATION_ALPHA = [0, 0.05, 0.08, 0.11, 0.12, 0.14];
7541
7540
  BUTTON_MIN_HIT_TARGET = 44;
@@ -22689,8 +22688,13 @@ __export(gen_native_config_exports, {
22689
22688
  androidSettingsGradle: () => androidSettingsGradle,
22690
22689
  androidTvLeanbackPlan: () => androidTvLeanbackPlan,
22691
22690
  applyToFile: () => applyToFile,
22691
+ assertSingleMarkerPair: () => assertSingleMarkerPair,
22692
+ assertSingleModuleInstall: () => assertSingleModuleInstall,
22692
22693
  automotiveAppDescPath: () => automotiveAppDescPath,
22693
22694
  buildSet: () => buildSet,
22695
+ countBeginMarkers: () => countBeginMarkers,
22696
+ countEndMarkers: () => countEndMarkers,
22697
+ duplicateModuleInstalls: () => duplicateModuleInstalls,
22694
22698
  genCoreModuleInstallers: () => genCoreModuleInstallers,
22695
22699
  genNativeConfig: () => genNativeConfig,
22696
22700
  hasMarkers: () => hasMarkers,
@@ -22698,6 +22702,8 @@ __export(gen_native_config_exports, {
22698
22702
  iapBindingInfo: () => iapBindingInfo,
22699
22703
  injectBlock: () => injectBlock,
22700
22704
  iosPlanFor: () => iosPlanFor,
22705
+ kotlinBootSourcesUnder: () => kotlinBootSourcesUnder,
22706
+ kotlinFilesWithModuleInstall: () => kotlinFilesWithModuleInstall,
22701
22707
  loadOverrides: () => loadOverrides,
22702
22708
  macosPlanFor: () => macosPlanFor,
22703
22709
  orientationPlistPlan: () => orientationPlistPlan,
@@ -22727,7 +22733,7 @@ __export(gen_native_config_exports, {
22727
22733
  xmlAttr: () => xmlAttr,
22728
22734
  yamlScalar: () => yamlScalar
22729
22735
  });
22730
- import { existsSync as existsSync33, mkdirSync as mkdirSync15, readFileSync as readFileSync32, readdirSync as readdirSync19, rmSync as rmSync7, writeFileSync as writeFileSync13 } from "node:fs";
22736
+ import { existsSync as existsSync33, mkdirSync as mkdirSync15, readFileSync as readFileSync32, readdirSync as readdirSync19, rmSync as rmSync7, statSync as statSync6, writeFileSync as writeFileSync13 } from "node:fs";
22731
22737
  import { dirname as dirname20, join as join33 } from "node:path";
22732
22738
  import { fileURLToPath as fileURLToPath13 } from "node:url";
22733
22739
  function parseStringArray(configTs, field) {
@@ -22923,7 +22929,7 @@ function swiftFilesWithModuleMarkers(app) {
22923
22929
  const path2 = join33(dir, entry.name);
22924
22930
  if (entry.isDirectory()) {
22925
22931
  if (!entry.name.endsWith(".xcodeproj")) stack.push(path2);
22926
- } else if (entry.name.endsWith(".swift")) {
22932
+ } else if (entry.isFile() && entry.name.endsWith(".swift")) {
22927
22933
  const text9 = readFileSync32(path2, "utf8");
22928
22934
  if (hasMarkers(text9, "slash", LABEL_MODULES_SWIFT_IMPORT) || hasMarkers(text9, "slash", LABEL_MODULES_SWIFT_INSTALL)) out2.push(path2);
22929
22935
  }
@@ -22931,11 +22937,61 @@ function swiftFilesWithModuleMarkers(app) {
22931
22937
  }
22932
22938
  return out2.sort();
22933
22939
  }
22940
+ function kotlinFilesWithModuleInstall(app) {
22941
+ return kotlinBootSourcesUnder(join33(appDir(app), "android"));
22942
+ }
22943
+ function kotlinBootSourcesUnder(root) {
22944
+ if (!existsSync33(root)) return [];
22945
+ const out2 = [];
22946
+ const stack = [[root, 0, "project"]];
22947
+ while (stack.length) {
22948
+ const [dir, depth, where] = stack.pop();
22949
+ for (const entry of readdirSync19(dir, { withFileTypes: true })) {
22950
+ if (entry.name.startsWith(".")) continue;
22951
+ const path2 = join33(dir, entry.name);
22952
+ if (entry.isDirectory()) {
22953
+ if (depth >= ANDROID_MAX_DEPTH) continue;
22954
+ if (where === "project") {
22955
+ if (entry.name === "build") continue;
22956
+ stack.push([path2, depth + 1, entry.name === "src" ? "sources" : "project"]);
22957
+ } else if (where === "sources") {
22958
+ if (entry.name === "main") stack.push([path2, depth + 1, "main"]);
22959
+ } else {
22960
+ stack.push([path2, depth + 1, "main"]);
22961
+ }
22962
+ } else if (where === "main" && entry.isFile() && entry.name.endsWith("Application.kt") && statSync6(path2).size <= BOOT_SOURCE_MAX_BYTES && readFileSync32(path2, "utf8").includes("installLinkedModules")) {
22963
+ out2.push(path2);
22964
+ }
22965
+ }
22966
+ }
22967
+ return out2.sort();
22968
+ }
22969
+ function stripComments2(text9) {
22970
+ return text9.replace(/\/\*[\s\S]*?\*\//g, (c2) => c2.replace(/[^\n]/g, " ")).replace(/\/\/[^\n]*/g, "");
22971
+ }
22972
+ function duplicateModuleInstalls(...texts) {
22973
+ const calls = ["installLinkedModules", ...NATIVE_MODULES.flatMap((m2) => m2.ios ? [`${m2.ios.product}.install`] : [])];
22974
+ const code = texts.map(stripComments2).join("\n");
22975
+ return calls.filter((call) => {
22976
+ const re2 = new RegExp(`(^|[^\\w])${call.replace(".", "\\.")}\\s*\\(`, "gm");
22977
+ return (code.match(re2) ?? []).length > 1;
22978
+ });
22979
+ }
22980
+ function assertSingleModuleInstall(app, paths) {
22981
+ const dup = duplicateModuleInstalls(...paths.map((p2) => readFileSync32(p2, "utf8")));
22982
+ if (dup.length) {
22983
+ throw new Error(
22984
+ `native-config: ${app}: ${dup.join(", ")} is called more than once across ${paths.join(", ")} \u2014 a merge duplicated the module install; keep one call`
22985
+ );
22986
+ }
22987
+ }
22934
22988
  function isBegin(line, kind, label2) {
22935
22989
  const s2 = line.trim();
22936
- if (kind === "yaml") return s2.startsWith(`# >>> ${label2}`) && s2.endsWith(">>>");
22937
- if (kind === "xml") return s2.startsWith(`<!-- >>> ${label2}`) && s2.endsWith("-->");
22938
- return s2.startsWith(`// >>> ${label2}`) && s2.endsWith(">>>");
22990
+ const open = kind === "yaml" ? `# >>> ${label2}` : kind === "xml" ? `<!-- >>> ${label2}` : `// >>> ${label2}`;
22991
+ const close = kind === "xml" ? "-->" : ">>>";
22992
+ if (!s2.startsWith(open) || !s2.endsWith(close)) return false;
22993
+ const rest = s2.slice(open.length);
22994
+ return /^\s/.test(rest) || rest.startsWith(close) || kind === "xml" && rest.startsWith(">>>");
22939
22995
  }
22940
22996
  function isEnd(line, kind, label2) {
22941
22997
  const s2 = line.trim();
@@ -22973,11 +23029,28 @@ function hostAppliesDeferredWidgetActions(app) {
22973
23029
  }
22974
23030
  return false;
22975
23031
  }
23032
+ function countBeginMarkers(text9, kind, label2) {
23033
+ return text9.split("\n").filter((l2) => isBegin(l2, kind, label2)).length;
23034
+ }
23035
+ function countEndMarkers(text9, kind, label2) {
23036
+ return text9.split("\n").filter((l2) => isEnd(l2, kind, label2)).length;
23037
+ }
22976
23038
  function hasMarkers(text9, kind, label2) {
22977
23039
  const lines = text9.split("\n");
22978
23040
  return lines.some((l2) => isBegin(l2, kind, label2)) && lines.some((l2) => isEnd(l2, kind, label2));
22979
23041
  }
22980
- function injectBlock(text9, kind, label2, render) {
23042
+ function assertSingleMarkerPair(text9, kind, label2, where = "the file") {
23043
+ const opens = countBeginMarkers(text9, kind, label2);
23044
+ const closes = countEndMarkers(text9, kind, label2);
23045
+ if (opens > 1 || closes > 1) {
23046
+ const which = opens > 1 ? `">>> ${label2}" opens ${opens} times` : `"<<< ${label2}" closes ${closes} times`;
23047
+ throw new Error(
23048
+ `native-config: managed marker ${which} in ${where} \u2014 a merge duplicated the generated block; delete every copy but one, then run \`npm run native-config -- --all\``
23049
+ );
23050
+ }
23051
+ }
23052
+ function injectBlock(text9, kind, label2, render, where = "the file") {
23053
+ assertSingleMarkerPair(text9, kind, label2, where);
22981
23054
  const lines = text9.split("\n");
22982
23055
  const beginIdx = lines.findIndex((l2) => isBegin(l2, kind, label2));
22983
23056
  const endIdx = lines.findIndex((l2) => isEnd(l2, kind, label2));
@@ -23007,8 +23080,9 @@ function automotiveAppDescPath(app) {
23007
23080
  function applyToFile(path2, kind, label2, render, check) {
23008
23081
  if (!existsSync33(path2)) return { path: path2, outcome: "skipped" };
23009
23082
  const before = readFileSync32(path2, "utf8");
23083
+ assertSingleMarkerPair(before, kind, label2, path2);
23010
23084
  if (!hasMarkers(before, kind, label2)) return { path: path2, outcome: "skipped" };
23011
- const after = injectBlock(before, kind, label2, render);
23085
+ const after = injectBlock(before, kind, label2, render, path2);
23012
23086
  if (after === before) return { path: path2, outcome: "unchanged" };
23013
23087
  if (check) return { path: path2, outcome: "drift" };
23014
23088
  writeFileSync13(path2, after);
@@ -23052,6 +23126,8 @@ function resolveDistBake(app, own4, extra) {
23052
23126
  }
23053
23127
  function genNativeConfig(app, opts = {}) {
23054
23128
  const check = opts.check ?? false;
23129
+ assertSingleModuleInstall(app, swiftFilesWithModuleMarkers(app));
23130
+ assertSingleModuleInstall(app, kotlinFilesWithModuleInstall(app));
23055
23131
  const configPath = appConfigTs(app);
23056
23132
  const configTs = existsSync33(configPath) ? readFileSync32(configPath, "utf8") : "";
23057
23133
  const capabilities = parseStringArray(configTs, "capabilities");
@@ -23239,7 +23315,7 @@ function genNativeConfig(app, opts = {}) {
23239
23315
  );
23240
23316
  return { app, buildSet: ids, files, drift: files.some((f2) => f2.outcome === "drift") };
23241
23317
  }
23242
- var LABEL_IOS_INFO, LABEL_IOS_ENTITLEMENTS, LABEL_ANDROID, LABEL_ANDROID_SERVICES, LABEL_MODULES_IOS_PACKAGE, LABEL_MODULES_IOS_LINK, LABEL_MODULES_ANDROID_INCLUDE, LABEL_MODULES_ANDROID_LINK, LABEL_MODULES_SWIFT_IMPORT, LABEL_MODULES_SWIFT_INSTALL, LABEL_MODULES_ANDROID_INSTALLERS, LABEL_WATCH, LABEL_TV, LABEL_ANDROID_TV, LABEL_ORIENTATION, LABEL_CAR, IOS_ORIENTATION, ALL_ORIENTATIONS, HEALTH_PERMISSION_COPY_META, FROM_APP_PLATFORM_DIR, CORE_ANDROID_CAPABILITY_MODULES, IOS_BUILD_CAPABILITIES_KEY, IOS_DIST_CAPABILITIES_KEY, ANDROID_BUILD_CAPABILITIES_META, ANDROID_DIST_CAPABILITIES_META;
23318
+ var LABEL_IOS_INFO, LABEL_IOS_ENTITLEMENTS, LABEL_ANDROID, LABEL_ANDROID_SERVICES, LABEL_MODULES_IOS_PACKAGE, LABEL_MODULES_IOS_LINK, LABEL_MODULES_ANDROID_INCLUDE, LABEL_MODULES_ANDROID_LINK, LABEL_MODULES_SWIFT_IMPORT, LABEL_MODULES_SWIFT_INSTALL, LABEL_MODULES_ANDROID_INSTALLERS, LABEL_WATCH, LABEL_TV, LABEL_ANDROID_TV, LABEL_ORIENTATION, LABEL_CAR, IOS_ORIENTATION, ALL_ORIENTATIONS, HEALTH_PERMISSION_COPY_META, FROM_APP_PLATFORM_DIR, CORE_ANDROID_CAPABILITY_MODULES, ANDROID_MAX_DEPTH, BOOT_SOURCE_MAX_BYTES, IOS_BUILD_CAPABILITIES_KEY, IOS_DIST_CAPABILITIES_KEY, ANDROID_BUILD_CAPABILITIES_META, ANDROID_DIST_CAPABILITIES_META;
23243
23319
  var init_gen_native_config = __esm({
23244
23320
  "../native-config/gen-native-config.ts"() {
23245
23321
  init_src2();
@@ -23282,6 +23358,8 @@ var init_gen_native_config = __esm({
23282
23358
  dirname20(fileURLToPath13(import.meta.url)),
23283
23359
  "../../core/runtime/android/io/himalaya/core/src/main/kotlin/io/himalaya/core/CapabilityModules.kt"
23284
23360
  );
23361
+ ANDROID_MAX_DEPTH = 16;
23362
+ BOOT_SOURCE_MAX_BYTES = 1 << 20;
23285
23363
  IOS_BUILD_CAPABILITIES_KEY = "HimalayaBuildCapabilities";
23286
23364
  IOS_DIST_CAPABILITIES_KEY = "HimalayaDistCapabilities";
23287
23365
  ANDROID_BUILD_CAPABILITIES_META = "io.himalaya.buildCapabilities";
@@ -23591,7 +23669,7 @@ __export(progress_exports, {
23591
23669
  import { spawn as spawn3 } from "node:child_process";
23592
23670
  import { createHash as createHash12 } from "node:crypto";
23593
23671
  import { randomUUID as randomUUID3 } from "node:crypto";
23594
- import { appendFileSync, closeSync, existsSync as existsSync34, lstatSync as lstatSync8, mkdirSync as mkdirSync16, openSync, readdirSync as readdirSync20, readFileSync as readFileSync33, readSync, renameSync as renameSync5, rmSync as rmSync8, statSync as statSync6, writeFileSync as writeFileSync14 } from "node:fs";
23672
+ import { appendFileSync, closeSync, existsSync as existsSync34, lstatSync as lstatSync8, mkdirSync as mkdirSync16, openSync, readdirSync as readdirSync20, readFileSync as readFileSync33, readSync, renameSync as renameSync5, rmSync as rmSync8, statSync as statSync7, writeFileSync as writeFileSync14 } from "node:fs";
23595
23673
  import { isAbsolute as isAbsolute3, join as join34, relative as relative6, resolve as resolve27, sep as sep8 } from "node:path";
23596
23674
  function agentCovers(agent, cli) {
23597
23675
  if (isCliEntry(agent)) return false;
@@ -23620,14 +23698,14 @@ function imageExtension(buf) {
23620
23698
  }
23621
23699
  function locateImage(dir, src) {
23622
23700
  for (const candidate of [resolve27(src), resolve27(dir, src)]) {
23623
- if (existsSync34(candidate) && statSync6(candidate).isFile()) return candidate;
23701
+ if (existsSync34(candidate) && statSync7(candidate).isFile()) return candidate;
23624
23702
  }
23625
23703
  return null;
23626
23704
  }
23627
23705
  function archiveImage(dir, src) {
23628
23706
  const abs = locateImage(dir, src);
23629
23707
  if (!abs) throw new ProgressError("image_not_found", `no image at ${src} (looked relative to the current directory and to ${dir})`);
23630
- const size = statSync6(abs).size;
23708
+ const size = statSync7(abs).size;
23631
23709
  if (size > MAX_IMAGE_BYTES) {
23632
23710
  throw new ProgressError("image_too_large", `${src} is ${size} bytes; a progress image is capped at ${MAX_IMAGE_BYTES} \u2014 render at phone width (--device iphone)`);
23633
23711
  }
@@ -23714,7 +23792,7 @@ function packageRelative(dir, p2) {
23714
23792
  }
23715
23793
  function endsWithNewline(file2) {
23716
23794
  if (!existsSync34(file2)) return true;
23717
- const size = statSync6(file2).size;
23795
+ const size = statSync7(file2).size;
23718
23796
  if (size === 0) return true;
23719
23797
  const fd = openSync(file2, "r");
23720
23798
  try {
@@ -25903,7 +25981,7 @@ __export(template_trim_exports, {
25903
25981
  routeMatcher: () => routeMatcher,
25904
25982
  runTemplateTrim: () => runTemplateTrim
25905
25983
  });
25906
- import { cpSync, existsSync as existsSync37, mkdirSync as mkdirSync19, readdirSync as readdirSync21, readFileSync as readFileSync37, renameSync as renameSync7, rmSync as rmSync10, statSync as statSync7, writeFileSync as writeFileSync17 } from "node:fs";
25984
+ import { cpSync, existsSync as existsSync37, mkdirSync as mkdirSync19, readdirSync as readdirSync21, readFileSync as readFileSync37, renameSync as renameSync7, rmSync as rmSync10, statSync as statSync8, writeFileSync as writeFileSync17 } from "node:fs";
25907
25985
  import { dirname as dirname23, join as join38 } from "node:path";
25908
25986
  function routeMatcher(pattern) {
25909
25987
  const detail = /^\^([A-Za-z0-9_]+)\(\?:\[_\/\]\(\.\+\)\)\?\$$/.exec(pattern);
@@ -26600,14 +26678,14 @@ function homeModulesPass(app, kept, edited) {
26600
26678
  function listWorkers(dir) {
26601
26679
  const root = join38(dir, "tier5-src");
26602
26680
  if (!existsSync37(root)) return { dirs: [], files: {} };
26603
- const dirs = readdirSync21(root).filter((n2) => statSync7(join38(root, n2)).isDirectory()).sort();
26681
+ const dirs = readdirSync21(root).filter((n2) => statSync8(join38(root, n2)).isDirectory()).sort();
26604
26682
  const files = {};
26605
26683
  const walk2 = (abs, rel) => {
26606
26684
  for (const name of readdirSync21(abs)) {
26607
26685
  if (name === "node_modules") continue;
26608
26686
  const p2 = join38(abs, name);
26609
26687
  const r2 = `${rel}/${name}`;
26610
- if (statSync7(p2).isDirectory()) walk2(p2, r2);
26688
+ if (statSync8(p2).isDirectory()) walk2(p2, r2);
26611
26689
  else if (/\.(?:[cm]?[jt]sx?|json)$/.test(name)) files[r2] = readFileSync37(p2, "utf8");
26612
26690
  }
26613
26691
  };
@@ -26923,7 +27001,7 @@ __export(template_adopt_exports, {
26923
27001
  workerReach: () => workerReach,
26924
27002
  writeInventory: () => writeInventory
26925
27003
  });
26926
- import { existsSync as existsSync38, lstatSync as lstatSync12, mkdirSync as mkdirSync20, readdirSync as readdirSync22, readFileSync as readFileSync38, renameSync as renameSync8, statSync as statSync8, writeFileSync as writeFileSync18 } from "node:fs";
27004
+ import { existsSync as existsSync38, lstatSync as lstatSync12, mkdirSync as mkdirSync20, readdirSync as readdirSync22, readFileSync as readFileSync38, renameSync as renameSync8, statSync as statSync9, writeFileSync as writeFileSync18 } from "node:fs";
26927
27005
  import { dirname as dirname24, join as join39, posix as posix2 } from "node:path";
26928
27006
  function readAppSources(dir) {
26929
27007
  const devPath = join39(dir, "dev", "index.ts");
@@ -26936,14 +27014,14 @@ function readAppSources(dir) {
26936
27014
  if (existsSync38(root)) {
26937
27015
  for (const name of readdirSync22(root).sort()) {
26938
27016
  const abs = join39(root, name);
26939
- if (!statSync8(abs).isDirectory()) continue;
27017
+ if (!statSync9(abs).isDirectory()) continue;
26940
27018
  const files = {};
26941
27019
  const walk2 = (a2, rel) => {
26942
27020
  for (const n2 of readdirSync22(a2).sort()) {
26943
27021
  if (n2 === "node_modules") continue;
26944
27022
  const p2 = join39(a2, n2);
26945
27023
  const r2 = `${rel}/${n2}`;
26946
- if (statSync8(p2).isDirectory()) walk2(p2, r2);
27024
+ if (statSync9(p2).isDirectory()) walk2(p2, r2);
26947
27025
  else if (/\.(?:[cm]?[jt]sx?)$/.test(n2)) files[r2] = readFileSync38(p2, "utf8");
26948
27026
  }
26949
27027
  };
@@ -27042,7 +27120,7 @@ function walkPackage(dir, rel = "") {
27042
27120
  if (IGNORED.has(n2)) continue;
27043
27121
  const r2 = rel ? `${rel}/${n2}` : n2;
27044
27122
  const abs = join39(dir, r2);
27045
- if (statSync8(abs).isDirectory()) out2.push(...walkPackage(dir, r2));
27123
+ if (statSync9(abs).isDirectory()) out2.push(...walkPackage(dir, r2));
27046
27124
  else if (/\.(?:tsx?|jsx?|json)$/.test(n2)) out2.push(r2);
27047
27125
  }
27048
27126
  return out2;
@@ -33766,7 +33844,7 @@ var init_stable_ids = __esm({
33766
33844
  // ../../core/dev-server/src/preview.ts
33767
33845
  import { spawn as spawn4 } from "node:child_process";
33768
33846
  import { createHash as createHash17 } from "node:crypto";
33769
- import { existsSync as existsSync42, createReadStream, statSync as statSync9, readFileSync as readFileSync43, renameSync as renameSync9, unlinkSync as unlinkSync3 } from "node:fs";
33847
+ import { existsSync as existsSync42, createReadStream, statSync as statSync10, readFileSync as readFileSync43, renameSync as renameSync9, unlinkSync as unlinkSync3 } from "node:fs";
33770
33848
  import { homedir as homedir5, tmpdir as tmpdir2 } from "node:os";
33771
33849
  import { resolve as resolvePath, dirname as dirname26 } from "node:path";
33772
33850
  import { fileURLToPath as fileURLToPath17 } from "node:url";
@@ -34464,7 +34542,7 @@ function finalizeRecording(key2, rec) {
34464
34542
  } catch {
34465
34543
  }
34466
34544
  }
34467
- const sizeBytes = existsSync42(rec.localPath) ? statSync9(rec.localPath).size : 0;
34545
+ const sizeBytes = existsSync42(rec.localPath) ? statSync10(rec.localPath).size : 0;
34468
34546
  clips.set(rec.id, { path: rec.localPath, mime: rec.mime });
34469
34547
  recordings.delete(key2);
34470
34548
  return { sizeBytes };
@@ -34541,7 +34619,7 @@ async function handlePreviewClip(res, url) {
34541
34619
  res.setHeader("content-type", "application/json");
34542
34620
  return void res.end(JSON.stringify({ error: "clip_not_found", id }));
34543
34621
  }
34544
- const size = statSync9(clip3.path).size;
34622
+ const size = statSync10(clip3.path).size;
34545
34623
  res.statusCode = 200;
34546
34624
  res.setHeader("content-type", clip3.mime);
34547
34625
  res.setHeader("content-length", String(size));
@@ -137710,7 +137788,7 @@ __export(studio_exports, {
137710
137788
  writeStudioRecord: () => writeStudioRecord
137711
137789
  });
137712
137790
  import { createHash as createHash25 } from "node:crypto";
137713
- import { existsSync as existsSync49, readdirSync as readdirSync26, readFileSync as readFileSync54, realpathSync as realpathSync8, statSync as statSync10 } from "node:fs";
137791
+ import { existsSync as existsSync49, readdirSync as readdirSync26, readFileSync as readFileSync54, realpathSync as realpathSync8, statSync as statSync11 } from "node:fs";
137714
137792
  import { basename as basename11, extname as extname3, join as join49, relative as relative9, resolve as resolve39, sep as sep11 } from "node:path";
137715
137793
  import { pathToFileURL as pathToFileURL7 } from "node:url";
137716
137794
  function realInside(dir, abs) {
@@ -137729,7 +137807,7 @@ function archiveFile(dir, memory, abs) {
137729
137807
  let mtimeMs;
137730
137808
  let ino;
137731
137809
  try {
137732
- ({ size, mtimeMs, ino } = statSync10(real));
137810
+ ({ size, mtimeMs, ino } = statSync11(real));
137733
137811
  } catch {
137734
137812
  return null;
137735
137813
  }
@@ -137797,7 +137875,7 @@ function appIdentity(dir) {
137797
137875
  const icon = text(manifest?.icon)?.trim();
137798
137876
  const iconPath = icon ? resolve39(dir, icon) : null;
137799
137877
  const real = iconPath ? realInside(dir, iconPath) : null;
137800
- return { name, iconFile: real && statSync10(real).isFile() ? iconPath : null };
137878
+ return { name, iconFile: real && statSync11(real).isFile() ? iconPath : null };
137801
137879
  }
137802
137880
  function testRuns(dir) {
137803
137881
  const att = join49(dir, ".himi", "attestations");
@@ -145496,7 +145574,7 @@ var init_customer_signing_inspect = __esm({
145496
145574
  });
145497
145575
 
145498
145576
  // src/push-onboarding.ts
145499
- import { existsSync as existsSync51, mkdirSync as mkdirSync24, readFileSync as readFileSync57, statSync as statSync11, writeFileSync as writeFileSync20, chmodSync as chmodSync2 } from "node:fs";
145577
+ import { existsSync as existsSync51, mkdirSync as mkdirSync24, readFileSync as readFileSync57, statSync as statSync12, writeFileSync as writeFileSync20, chmodSync as chmodSync2 } from "node:fs";
145500
145578
  import { basename as basename12, dirname as dirname31, join as join50, resolve as resolve42 } from "node:path";
145501
145579
  function readJson5(path2) {
145502
145580
  try {
@@ -145576,7 +145654,7 @@ function localIdentityRefusal(i2) {
145576
145654
  function readKeyFile(path2) {
145577
145655
  let size;
145578
145656
  try {
145579
- size = statSync11(path2).size;
145657
+ size = statSync12(path2).size;
145580
145658
  } catch {
145581
145659
  return { ok: false, code: "key_file_unreadable", reason: "cannot read the selected key file; check its path and file permissions" };
145582
145660
  }
@@ -145743,7 +145821,7 @@ var signing_inspect_exports = {};
145743
145821
  __export(signing_inspect_exports, {
145744
145822
  runSigningInspect: () => runSigningInspect
145745
145823
  });
145746
- import { existsSync as existsSync52, readFileSync as readFileSync58, statSync as statSync12 } from "node:fs";
145824
+ import { existsSync as existsSync52, readFileSync as readFileSync58, statSync as statSync13 } from "node:fs";
145747
145825
  import { isAbsolute as isAbsolute5, resolve as resolve43 } from "node:path";
145748
145826
  function fail3(io2, code, fields = {}) {
145749
145827
  io2.error(JSON.stringify({ ok: false, code, ...fields }));
@@ -145836,7 +145914,7 @@ async function runSigningInspect(pos, flags, io2, deps = {}) {
145836
145914
  if (!existsSync52(certPath) || !existsSync52(profilePath2)) {
145837
145915
  return fail3(io2, "signing_inspect_local_assets_unreadable", { error: "cannot read --cert-file or --profile-file" });
145838
145916
  }
145839
- if (statSync12(certPath).size > 1048576 || statSync12(profilePath2).size > 1048576) {
145917
+ if (statSync13(certPath).size > 1048576 || statSync13(profilePath2).size > 1048576) {
145840
145918
  return fail3(io2, "signing_inspect_local_assets_unreadable", { error: "cert or profile file is unexpectedly large" });
145841
145919
  }
145842
145920
  assets = {
@@ -146576,7 +146654,7 @@ __export(pack_exports, {
146576
146654
  });
146577
146655
  import { createHash as createHash28 } from "node:crypto";
146578
146656
  import { deflateRawSync, inflateRawSync } from "node:zlib";
146579
- import { existsSync as existsSync53, mkdirSync as mkdirSync25, readFileSync as readFileSync60, readdirSync as readdirSync27, rmSync as rmSync12, statSync as statSync13, writeFileSync as writeFileSync21 } from "node:fs";
146657
+ import { existsSync as existsSync53, mkdirSync as mkdirSync25, readFileSync as readFileSync60, readdirSync as readdirSync27, rmSync as rmSync12, statSync as statSync14, writeFileSync as writeFileSync21 } from "node:fs";
146580
146658
  import { dirname as dirname32, join as join52, resolve as resolve45 } from "node:path";
146581
146659
  function writeZip(entries) {
146582
146660
  const sorted2 = entries.slice().sort((a2, b2) => a2.path < b2.path ? -1 : a2.path > b2.path ? 1 : 0);
@@ -146671,10 +146749,10 @@ function inflateEntry(buf, entry) {
146671
146749
  return bytes2;
146672
146750
  }
146673
146751
  function readIf(path2) {
146674
- return existsSync53(path2) && statSync13(path2).isFile() ? readFileSync60(path2) : null;
146752
+ return existsSync53(path2) && statSync14(path2).isFile() ? readFileSync60(path2) : null;
146675
146753
  }
146676
146754
  function listDir(dir) {
146677
- return existsSync53(dir) ? readdirSync27(dir).filter((f2) => statSync13(join52(dir, f2)).isFile()) : [];
146755
+ return existsSync53(dir) ? readdirSync27(dir).filter((f2) => statSync14(join52(dir, f2)).isFile()) : [];
146678
146756
  }
146679
146757
  function gatherReleaseEntries(appDir3) {
146680
146758
  const manifestPath = join52(appDir3, HIMI_PACKAGE_MANIFEST_PATH);
@@ -146753,7 +146831,7 @@ function packRelease(releaseRoot, app, out2, opts = {}) {
146753
146831
  const appDir3 = join52(resolve45(releaseRoot), app);
146754
146832
  const { all, header, skipped } = buildEntries(appDir3, app, opts);
146755
146833
  const buf = writeZip(all);
146756
- const isDir2 = existsSync53(out2) && statSync13(out2).isDirectory();
146834
+ const isDir2 = existsSync53(out2) && statSync14(out2).isDirectory();
146757
146835
  const outFile = isDir2 ? join52(resolve45(out2), packageFileName(app, header.releaseId)) : resolve45(out2);
146758
146836
  mkdirSync25(dirname32(outFile), { recursive: true });
146759
146837
  writeFileSync21(outFile, buf);
@@ -146771,10 +146849,10 @@ function resolvePackageDirDest(outDir, app, releaseId) {
146771
146849
  };
146772
146850
  const replaceable = (dir) => {
146773
146851
  if (!existsSync53(dir)) return true;
146774
- if (!statSync13(dir).isDirectory()) return false;
146852
+ if (!statSync14(dir).isDirectory()) return false;
146775
146853
  return readdirSync27(dir).length === 0 || packagedApp(dir) === app;
146776
146854
  };
146777
- if (existsSync53(outDir) && !statSync13(outDir).isDirectory()) {
146855
+ if (existsSync53(outDir) && !statSync14(outDir).isDirectory()) {
146778
146856
  throw new Error(`refusing to write a package tree over ${outDir} \u2014 it is a file, not a directory`);
146779
146857
  }
146780
146858
  if (replaceable(outDir)) return outDir;
@@ -146831,7 +146909,7 @@ function openPackageDir(dir) {
146831
146909
  for (const name of readdirSync27(abs)) {
146832
146910
  const childRel = rel ? `${rel}/${name}` : name;
146833
146911
  const childAbs = join52(abs, name);
146834
- if (statSync13(childAbs).isDirectory()) walk2(childRel);
146912
+ if (statSync14(childAbs).isDirectory()) walk2(childRel);
146835
146913
  else if (isSafeEntryName(childRel)) entries.set(childRel, readFileSync60(childAbs));
146836
146914
  }
146837
146915
  };
@@ -147248,7 +147326,7 @@ __export(run_watch_exports, {
147248
147326
  watchedContentDir: () => watchedContentDir,
147249
147327
  writeRunRecord: () => writeRunRecord
147250
147328
  });
147251
- import { closeSync as closeSync4, constants as constants2, existsSync as existsSync55, fstatSync, lstatSync as lstatSync16, statSync as statSync14, readdirSync as readdirSync29, mkdirSync as mkdirSync27, openSync as openSync4, readFileSync as readFileSync62, realpathSync as realpathSync9, renameSync as renameSync10, rmSync as rmSync14, writeFileSync as writeFileSync23, watch as fsWatch } from "node:fs";
147329
+ import { closeSync as closeSync4, constants as constants2, existsSync as existsSync55, fstatSync, lstatSync as lstatSync16, statSync as statSync15, readdirSync as readdirSync29, mkdirSync as mkdirSync27, openSync as openSync4, readFileSync as readFileSync62, realpathSync as realpathSync9, renameSync as renameSync10, rmSync as rmSync14, writeFileSync as writeFileSync23, watch as fsWatch } from "node:fs";
147252
147330
  import { randomUUID as randomUUID6 } from "node:crypto";
147253
147331
  import { extname as extname4, join as join54, resolve as resolve47, sep as sep14 } from "node:path";
147254
147332
  function diffReleases(prev, next) {
@@ -147355,7 +147433,7 @@ function watchedContentDir(source) {
147355
147433
  if (!source || /^https?:\/\//i.test(source)) return null;
147356
147434
  const dir = resolve47(source);
147357
147435
  try {
147358
- return statSync14(dir).isDirectory() && existsSync55(join54(dir, "himalaya.content.json")) ? dir : null;
147436
+ return statSync15(dir).isDirectory() && existsSync55(join54(dir, "himalaya.content.json")) ? dir : null;
147359
147437
  } catch {
147360
147438
  return null;
147361
147439
  }
@@ -147535,7 +147613,7 @@ var init_run_watch = __esm({
147535
147613
  };
147536
147614
  isDir = (path2) => {
147537
147615
  try {
147538
- return statSync14(path2).isDirectory();
147616
+ return statSync15(path2).isDirectory();
147539
147617
  } catch {
147540
147618
  return false;
147541
147619
  }
@@ -148010,7 +148088,7 @@ __export(milestones_exports, {
148010
148088
  });
148011
148089
  import { createHash as createHash32, randomUUID as randomUUID7 } from "node:crypto";
148012
148090
  import { spawn as spawn5 } from "node:child_process";
148013
- import { closeSync as closeSync5, existsSync as existsSync56, lstatSync as lstatSync19, readFileSync as readFileSync66, statSync as statSync15 } from "node:fs";
148091
+ import { closeSync as closeSync5, existsSync as existsSync56, lstatSync as lstatSync19, readFileSync as readFileSync66, statSync as statSync16 } from "node:fs";
148014
148092
  import { createServer as createServer4 } from "node:net";
148015
148093
  import { basename as basename15, dirname as dirname33, isAbsolute as isAbsolute6, join as join58, relative as relative11, resolve as resolve48, sep as sep15 } from "node:path";
148016
148094
  function homeShotPath(dir, home) {
@@ -148089,7 +148167,7 @@ async function renderHomeInChild(dir, home, opts) {
148089
148167
  }
148090
148168
  let fresh = false;
148091
148169
  try {
148092
- fresh = statSync15(shot).mtimeMs >= started - 1e3;
148170
+ fresh = statSync16(shot).mtimeMs >= started - 1e3;
148093
148171
  } catch {
148094
148172
  }
148095
148173
  if (code === 0 && fresh) {
@@ -148298,7 +148376,7 @@ function afterBrowserTestRun(dir, input) {
148298
148376
  function shotIsCurrent(shot, sourceChangedAtMs) {
148299
148377
  if (sourceChangedAtMs === void 0) return false;
148300
148378
  try {
148301
- return statSync15(shot).mtimeMs >= sourceChangedAtMs;
148379
+ return statSync16(shot).mtimeMs >= sourceChangedAtMs;
148302
148380
  } catch {
148303
148381
  return false;
148304
148382
  }
@@ -148662,7 +148740,7 @@ function afterHandoverPostcard(dir, opts = {}) {
148662
148740
  let fresh = false;
148663
148741
  try {
148664
148742
  const st2 = lstatSync19(file2);
148665
- fresh = st2.isFile() && !st2.isSymbolicLink() && st2.mtimeMs >= statSync15(join58(dir, ".himi", "progress.jsonl")).mtimeMs;
148743
+ fresh = st2.isFile() && !st2.isSymbolicLink() && st2.mtimeMs >= statSync16(join58(dir, ".himi", "progress.jsonl")).mtimeMs;
148666
148744
  } catch {
148667
148745
  fresh = false;
148668
148746
  }
@@ -152543,7 +152621,7 @@ var init_cli_bridge = __esm({
152543
152621
  });
152544
152622
 
152545
152623
  // src/mcp/file-tools.ts
152546
- import { closeSync as closeSync6, constants as constants3, lstatSync as lstatSync20, mkdirSync as mkdirSync30, openSync as openSync5, readdirSync as readdirSync30, readFileSync as readFileSync74, realpathSync as realpathSync10, renameSync as renameSync11, rmSync as rmSync15, statSync as statSync16, writeSync, existsSync as existsSync63 } from "node:fs";
152624
+ import { closeSync as closeSync6, constants as constants3, lstatSync as lstatSync20, mkdirSync as mkdirSync30, openSync as openSync5, readdirSync as readdirSync30, readFileSync as readFileSync74, realpathSync as realpathSync10, renameSync as renameSync11, rmSync as rmSync15, statSync as statSync17, writeSync, existsSync as existsSync63 } from "node:fs";
152547
152625
  import { randomBytes as randomBytes4 } from "node:crypto";
152548
152626
  import { dirname as dirname35, isAbsolute as isAbsolute7, join as join66, relative as relative13, resolve as resolve52, sep as sep17 } from "node:path";
152549
152627
  import * as z2 from "zod";
@@ -152662,7 +152740,7 @@ function listFiles(appDir3) {
152662
152740
  const rel = relative13(appDir3, p2);
152663
152741
  if (isDeniedSourcePath(rel) || isDeniedSourcePath(rel.toLowerCase())) continue;
152664
152742
  if (files.length >= MAX_LISTED) return false;
152665
- files.push({ path: rel.split(sep17).join("/"), bytes: statSync16(p2).size });
152743
+ files.push({ path: rel.split(sep17).join("/"), bytes: statSync17(p2).size });
152666
152744
  }
152667
152745
  }
152668
152746
  return true;
@@ -152698,7 +152776,7 @@ function fileTools() {
152698
152776
  handler: async (a2, d2) => {
152699
152777
  const app = await confinedAppDir(a2, d2);
152700
152778
  if (typeof app !== "string") return app;
152701
- if (!existsSync63(app) || !statSync16(app).isDirectory()) return refuse5("no_app", `no folder at ${app}`);
152779
+ if (!existsSync63(app) || !statSync17(app).isDirectory()) return refuse5("no_app", `no folder at ${app}`);
152702
152780
  return ok({ ok: true, dir: app, ...listFiles(app) });
152703
152781
  }
152704
152782
  },
@@ -152714,7 +152792,7 @@ function fileTools() {
152714
152792
  const p2 = confinedPath(app, a2.path);
152715
152793
  if (typeof p2 !== "string") return refuse5("bad_path", p2.error);
152716
152794
  if (!existsSync63(p2) || !lstatSync20(p2).isFile()) return refuse5("not_found", `no file "${String(a2.path)}"`);
152717
- const size = statSync16(p2).size;
152795
+ const size = statSync17(p2).size;
152718
152796
  if (size > MAX_FILE_BYTES) return refuse5("too_large", `"${String(a2.path)}" is ${size} bytes \u2014 over the ${MAX_FILE_BYTES}-byte read limit`);
152719
152797
  return ok({ ok: true, path: a2.path, bytes: size, content: readFileSync74(p2, "utf8") });
152720
152798
  }
@@ -153689,7 +153767,7 @@ __export(browser_authoring_exports, {
153689
153767
  });
153690
153768
  import { createServer as createServer5 } from "node:http";
153691
153769
  import { createHash as createHash35, randomBytes as randomBytes5 } from "node:crypto";
153692
- import { existsSync as existsSync65, readdirSync as readdirSync31, readFileSync as readFileSync77, realpathSync as realpathSync11, statSync as statSync17 } from "node:fs";
153770
+ import { existsSync as existsSync65, readdirSync as readdirSync31, readFileSync as readFileSync77, realpathSync as realpathSync11, statSync as statSync18 } from "node:fs";
153693
153771
  import { join as join68, posix as posix3, relative as relative14, sep as sep18 } from "node:path";
153694
153772
  function humanMs(ms2) {
153695
153773
  return ms2 < 1e3 ? `${ms2}ms` : `${Math.round(ms2 / 1e3)}s`;
@@ -153705,7 +153783,7 @@ function collectWorkerSources(tier5SrcDir, bundleName) {
153705
153783
  for (const name of readdirSync31(abs).sort()) {
153706
153784
  const childAbs = join68(abs, name);
153707
153785
  const childRel = posix3.join(rel, name);
153708
- if (statSync17(childAbs).isDirectory()) {
153786
+ if (statSync18(childAbs).isDirectory()) {
153709
153787
  walk2(childAbs, childRel);
153710
153788
  } else if (/\.(ts|tsx|js|mjs|json)$/.test(name)) {
153711
153789
  files[childRel] = readFileSync77(childAbs, "utf8");
@@ -153739,7 +153817,7 @@ function collectRelativeSiblings(files, tier5SrcDir) {
153739
153817
  join68(onDisk, "index.js")
153740
153818
  ];
153741
153819
  for (const abs of candidates) {
153742
- if (!existsSync65(abs) || statSync17(abs).isDirectory()) continue;
153820
+ if (!existsSync65(abs) || statSync18(abs).isDirectory()) continue;
153743
153821
  const key2 = `/tier5-src/${relative14(tier5SrcDir, abs).split(sep18).join(posix3.sep)}`;
153744
153822
  if (key2 in files) break;
153745
153823
  files[key2] = readFileSync77(abs, "utf8");
@@ -156178,7 +156256,7 @@ __export(run_exports, {
156178
156256
  runPackage: () => runPackage,
156179
156257
  withoutProdServe: () => withoutProdServe
156180
156258
  });
156181
- import { cpSync as cpSync2, existsSync as existsSync68, mkdirSync as mkdirSync33, mkdtempSync as mkdtempSync3, readFileSync as readFileSync81, rmSync as rmSync17, statSync as statSync18 } from "node:fs";
156259
+ import { cpSync as cpSync2, existsSync as existsSync68, mkdirSync as mkdirSync33, mkdtempSync as mkdtempSync3, readFileSync as readFileSync81, rmSync as rmSync17, statSync as statSync19 } from "node:fs";
156182
156260
  import { networkInterfaces as osNetworkInterfaces, tmpdir as tmpdir4 } from "node:os";
156183
156261
  import { dirname as dirname37, join as join71 } from "node:path";
156184
156262
  import { fileURLToPath as fileURLToPath26 } from "node:url";
@@ -156208,7 +156286,7 @@ async function fetchBytes(url) {
156208
156286
  }
156209
156287
  async function resolvePackage(source, workDir) {
156210
156288
  const isUrl2 = /^https?:\/\//i.test(source);
156211
- if (!isUrl2 && existsSync68(source) && statSync18(source).isDirectory()) {
156289
+ if (!isUrl2 && existsSync68(source) && statSync19(source).isDirectory()) {
156212
156290
  const appDirManifest = join71(source, "release-manifest.json");
156213
156291
  if (existsSync68(appDirManifest)) {
156214
156292
  const opened2 = openPackageDir(source);
@@ -160379,7 +160457,7 @@ __export(preflight_app_exports, {
160379
160457
  preflightApp: () => preflightApp,
160380
160458
  profileAccount: () => profileAccount
160381
160459
  });
160382
- import { readFileSync as readFileSync90, existsSync as existsSync74, readdirSync as readdirSync33, statSync as statSync19 } from "node:fs";
160460
+ import { readFileSync as readFileSync90, existsSync as existsSync74, readdirSync as readdirSync33, statSync as statSync20 } from "node:fs";
160383
160461
  import { createHash as createHash39 } from "node:crypto";
160384
160462
  import { join as join76 } from "node:path";
160385
160463
  function analyze(projectYml, storeConfig, icon, account) {
@@ -160605,7 +160683,7 @@ function playListingAssets(app, locale = "en-US") {
160605
160683
  for (const name of names) {
160606
160684
  const p2 = join76(dir, name);
160607
160685
  try {
160608
- if (statSync19(p2).isFile()) return { name, bytes: readFileSync90(p2) };
160686
+ if (statSync20(p2).isFile()) return { name, bytes: readFileSync90(p2) };
160609
160687
  } catch {
160610
160688
  }
160611
160689
  }
@@ -160653,7 +160731,7 @@ function listScreenshots(app, locale = "en-US") {
160653
160731
  if (existsSync74(legacy)) {
160654
160732
  for (const deviceDir of readdirSync33(legacy)) {
160655
160733
  const d2 = join76(legacy, deviceDir);
160656
- if (!statSync19(d2).isDirectory()) continue;
160734
+ if (!statSync20(d2).isDirectory()) continue;
160657
160735
  for (const png of readdirSync33(d2).filter((n2) => n2.endsWith(".png"))) {
160658
160736
  const sz = pngSize(readFileSync90(join76(d2, png)));
160659
160737
  if (sz) out2.push({ name: `${deviceDir}/${png}`, w: sz.w, h: sz.h });
@@ -160668,7 +160746,7 @@ function placeholderHashes2() {
160668
160746
  for (const target of readdirSync33(templateIos)) {
160669
160747
  const p2 = join76(templateIos, target, "Assets.xcassets", "AppIcon.appiconset", "icon_1024.png");
160670
160748
  try {
160671
- if (!statSync19(p2).isFile()) continue;
160749
+ if (!statSync20(p2).isFile()) continue;
160672
160750
  return [LEGACY_PLACEHOLDER_SHA2562, createHash39("sha256").update(readFileSync90(p2)).digest("hex")];
160673
160751
  } catch {
160674
160752
  }
@@ -160704,7 +160782,7 @@ async function appIconState(iosDir) {
160704
160782
  for (const target of readdirSync33(iosDir)) {
160705
160783
  const p2 = join76(iosDir, target, "Assets.xcassets", "AppIcon.appiconset", "icon_1024.png");
160706
160784
  try {
160707
- if (!statSync19(p2).isFile()) continue;
160785
+ if (!statSync20(p2).isFile()) continue;
160708
160786
  const bytes2 = readFileSync90(p2);
160709
160787
  const hash2 = createHash39("sha256").update(bytes2).digest("hex");
160710
160788
  const pixels = await pixelIssues(bytes2);
@@ -170285,7 +170363,7 @@ var init_customer_build = __esm({
170285
170363
  });
170286
170364
 
170287
170365
  // src/site-analyze/apply.ts
170288
- import { existsSync as existsSync77, readFileSync as readFileSync96, writeFileSync as writeFileSync36, copyFileSync as copyFileSync2, mkdirSync as mkdirSync40, realpathSync as realpathSync14, statSync as statSync20 } from "node:fs";
170366
+ import { existsSync as existsSync77, readFileSync as readFileSync96, writeFileSync as writeFileSync36, copyFileSync as copyFileSync2, mkdirSync as mkdirSync40, realpathSync as realpathSync14, statSync as statSync21 } from "node:fs";
170289
170367
  import { dirname as dirname43, isAbsolute as isAbsolute8, join as join82, resolve as resolve58, sep as sep20 } from "node:path";
170290
170368
  import { spawnSync as spawnSync4 } from "node:child_process";
170291
170369
  function unpairedRedirectNote(overlay) {
@@ -170432,7 +170510,7 @@ function buildMergedContract(options) {
170432
170510
  }
170433
170511
  if (!real.startsWith(realRoot + sep20)) return void 0;
170434
170512
  try {
170435
- if (!statSync20(real).isFile()) return void 0;
170513
+ if (!statSync21(real).isFile()) return void 0;
170436
170514
  mkdirSync40(dirname43(to2), { recursive: true });
170437
170515
  copyFileSync2(real, to2);
170438
170516
  } catch {
@@ -172910,7 +172988,7 @@ var init_context = __esm({
172910
172988
  });
172911
172989
 
172912
172990
  // src/cli.ts
172913
- import { mkdtempSync as mkdtempSync5, readFileSync as readFileSync99, mkdirSync as mkdirSync41, writeFileSync as writeFileSync38, existsSync as existsSync80, rmSync as rmSync22, readdirSync as readdirSync34, statSync as statSync21, lstatSync as lstatSync21, accessSync, constants as constants4, renameSync as renameSync12, cpSync as cpSync3 } from "node:fs";
172991
+ import { mkdtempSync as mkdtempSync5, readFileSync as readFileSync99, mkdirSync as mkdirSync41, writeFileSync as writeFileSync38, existsSync as existsSync80, rmSync as rmSync22, readdirSync as readdirSync34, statSync as statSync22, lstatSync as lstatSync21, accessSync, constants as constants4, renameSync as renameSync12, cpSync as cpSync3 } from "node:fs";
172914
172992
  import { execFile as execFile2, execFileSync as execFileSync7, spawnSync as spawnSync5, spawn as spawn7 } from "node:child_process";
172915
172993
  import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
172916
172994
  import { createHash as createHash41, randomUUID as randomUUID11 } from "node:crypto";
@@ -174916,6 +174994,10 @@ function auditUx(content, strict = false) {
174916
174994
  init_guides();
174917
174995
  init_wix_placeholders();
174918
174996
  var defaultIO = { log: (l2) => console.log(l2), error: (l2) => console.error(l2), isTTY: process.stdout.isTTY === true };
174997
+ function isCiEnvironment(env = process.env) {
174998
+ const ci2 = env.CI?.trim().toLowerCase();
174999
+ return env.GITHUB_ACTIONS === "true" || Boolean(env.BUILDKITE) || Boolean(ci2 && ci2 !== "0" && ci2 !== "false");
175000
+ }
174919
175001
  var REPEATABLE_FLAGS = /* @__PURE__ */ new Set(["data", "image", "set"]);
174920
175002
  var BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
174921
175003
  "no-network",
@@ -176265,7 +176347,7 @@ function staleUpdateLockFile(cachePath, now) {
176265
176347
  let since = stamped;
176266
176348
  if (!Number.isFinite(since)) {
176267
176349
  try {
176268
- since = statSync21(path2).mtimeMs;
176350
+ since = statSync22(path2).mtimeMs;
176269
176351
  } catch {
176270
176352
  continue;
176271
176353
  }
@@ -176874,7 +176956,7 @@ function executableOnPath(name, env = process.env) {
176874
176956
  for (const suffix of suffixes) {
176875
176957
  const candidate = join83(dir, `${name}${suffix}`);
176876
176958
  try {
176877
- if (!statSync21(candidate).isFile()) continue;
176959
+ if (!statSync22(candidate).isFile()) continue;
176878
176960
  if (process.platform !== "win32") accessSync(candidate, constants4.X_OK);
176879
176961
  return true;
176880
176962
  } catch {
@@ -177096,7 +177178,7 @@ function restoreDestinationIssue(dest, force) {
177096
177178
  const link = symlinkDestinationIssue(dest);
177097
177179
  if (link) return link;
177098
177180
  if (!existsSync80(dest)) return null;
177099
- if (!statSync21(dest).isDirectory()) {
177181
+ if (!statSync22(dest).isDirectory()) {
177100
177182
  return { error: `${dest} exists and is not a directory`, hint: "pass --out/--name to land somewhere else, or remove the file" };
177101
177183
  }
177102
177184
  if (readdirSync34(dest).length > 0 && !force) {
@@ -180134,7 +180216,7 @@ default (no --glyph): ${DEFAULT_GLYPH2} \u2014 a mark that claims nothing, so th
180134
180216
  return 1;
180135
180217
  }
180136
180218
  if (existsSync80(dest)) {
180137
- if (!statSync21(dest).isDirectory()) {
180219
+ if (!statSync22(dest).isDirectory()) {
180138
180220
  io2.error(JSON.stringify({
180139
180221
  error: `${dest} exists and is not a directory`,
180140
180222
  hint: "pass --out/--name to land somewhere else, or remove the file"
@@ -182682,6 +182764,8 @@ ${label2}`);
182682
182764
  io2.error(JSON.stringify({ error: "dist needs --app (or a content dir whose himalaya.content.json names one)" }));
182683
182765
  return 2;
182684
182766
  }
182767
+ const isCiBuild = isCiEnvironment();
182768
+ const buildOrigin = isCiBuild ? "system" : "user";
182685
182769
  const distShell = str9(flags.shell) ?? (await appId(contentDir(flags)) === app ? (await Promise.resolve().then(() => (init_capabilities(), capabilities_exports))).contentShell(contentDir(flags)) : null);
182686
182770
  if (Object.hasOwn(flags, "plan")) {
182687
182771
  const swallowed = Reflect.get(flags, "plan");
@@ -182759,6 +182843,7 @@ ${label2}`);
182759
182843
  try {
182760
182844
  r2 = await c2.distCreate({
182761
182845
  app,
182846
+ buildOrigin,
182762
182847
  ...platform?.length ? { platform } : customerTestflight ? { platform: ["ios"] } : {},
182763
182848
  ...str9(flags.release) ? { release: str9(flags.release) } : {},
182764
182849
  ...flags["allow-draft"] === true ? { allowDraft: true } : {},
@@ -183974,6 +184059,7 @@ export {
183974
184059
  handoverUxEvidence,
183975
184060
  humanDuration,
183976
184061
  inspectControlToken,
184062
+ isCiEnvironment,
183977
184063
  isHimalayaMonorepoCheckout,
183978
184064
  isLoopbackBase,
183979
184065
  isPublicTarget,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1335.0",
3
+ "version": "0.1337.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": [
@@ -71,5 +71,5 @@
71
71
  "artifactId": "himalaya-cli"
72
72
  }
73
73
  },
74
- "falconPackageHash": "e5c1ab9ce3c2bd6cf9e40b65eb8e8da6a229136e6742d2f870cfc93a"
74
+ "falconPackageHash": "c9f0a07698a276263bd2032ecf98c76cc1720a482529c20a0f71d586"
75
75
  }