@wix/himalaya-cli 0.1738.0 → 0.1740.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
CHANGED
|
@@ -1906,7 +1906,7 @@ function sentinelizeIdentity(body, identity) {
|
|
|
1906
1906
|
}
|
|
1907
1907
|
if (identity.name) {
|
|
1908
1908
|
const re2 = new RegExp(`\\b(${NAME_FIELDS.join("|")})(["']?\\s*[:=]\\s*)(["'])${escapeRe(identity.name)}\\3`, "g");
|
|
1909
|
-
out2 = out2.replace(re2, (_m, key4,
|
|
1909
|
+
out2 = out2.replace(re2, (_m, key4, sep31, q4) => `${key4}${sep31}${q4}__HIMI_APP_NAME__${q4}`);
|
|
1910
1910
|
}
|
|
1911
1911
|
return out2;
|
|
1912
1912
|
}
|
|
@@ -17086,6 +17086,10 @@ function collectDescriptorStrings(descriptor, options2 = {}) {
|
|
|
17086
17086
|
seen.add(key4);
|
|
17087
17087
|
out2.push(f2);
|
|
17088
17088
|
};
|
|
17089
|
+
walkVisibleLiterals(descriptor, isCopy2, push);
|
|
17090
|
+
return out2;
|
|
17091
|
+
}
|
|
17092
|
+
function walkVisibleLiterals(descriptor, isCopy2, push) {
|
|
17089
17093
|
const visit = (node3, path2) => {
|
|
17090
17094
|
if (Array.isArray(node3)) {
|
|
17091
17095
|
node3.forEach((n2, i2) => visit(n2, `${path2}[${i2}]`));
|
|
@@ -17132,9 +17136,23 @@ function collectDescriptorStrings(descriptor, options2 = {}) {
|
|
|
17132
17136
|
}
|
|
17133
17137
|
};
|
|
17134
17138
|
visit(descriptor, "");
|
|
17135
|
-
return out2;
|
|
17136
17139
|
}
|
|
17137
|
-
|
|
17140
|
+
function isKeyShapedLiteral(s5, keys2) {
|
|
17141
|
+
if (typeof s5 !== "string") return false;
|
|
17142
|
+
if (keys2?.has(s5) === true) return true;
|
|
17143
|
+
if (!s5.includes("_") || !KEY_SHAPED.test(s5)) return false;
|
|
17144
|
+
const leaf = s5.slice(s5.lastIndexOf(".") + 1);
|
|
17145
|
+
return leaf.includes("_") || leaf.length >= 5;
|
|
17146
|
+
}
|
|
17147
|
+
function collectKeyShapedLiterals(descriptor, keys2) {
|
|
17148
|
+
const byPath = /* @__PURE__ */ new Map();
|
|
17149
|
+
walkVisibleLiterals(descriptor, (v2) => isKeyShapedLiteral(v2, keys2), (f2) => {
|
|
17150
|
+
const path2 = f2.path.replace(/^\./, "");
|
|
17151
|
+
if (!byPath.has(path2)) byPath.set(path2, { ...f2, path: path2 });
|
|
17152
|
+
});
|
|
17153
|
+
return [...byPath.values()];
|
|
17154
|
+
}
|
|
17155
|
+
var STRING_FIELDS_BY_TYPE, SECONDARY_FIELDS, UNREACHED_VISIBLE_FIELDS, BINDING_SIGIL, KEY_SHAPED;
|
|
17138
17156
|
var init_l10n_strings = __esm({
|
|
17139
17157
|
"../../core/dev-server/src/l10n-strings.ts"() {
|
|
17140
17158
|
init_define_HHP_CATALOG();
|
|
@@ -17173,6 +17191,7 @@ var init_l10n_strings = __esm({
|
|
|
17173
17191
|
"footer"
|
|
17174
17192
|
]);
|
|
17175
17193
|
BINDING_SIGIL = /^\$(service|flag|item)\b/;
|
|
17194
|
+
KEY_SHAPED = /^[a-z][A-Za-z0-9]*(?:_[A-Za-z0-9]+)*(?:\.[a-z][A-Za-z0-9]*(?:_[A-Za-z0-9]+)*)+$/;
|
|
17176
17195
|
}
|
|
17177
17196
|
});
|
|
17178
17197
|
|
|
@@ -17879,8 +17898,8 @@ function textOf(node3) {
|
|
|
17879
17898
|
function plainText(node3) {
|
|
17880
17899
|
if (typeOf2(node3) === "TEXT") return str(at(node3, "textData", "text"));
|
|
17881
17900
|
const children2 = kids(node3).filter(isObj);
|
|
17882
|
-
const
|
|
17883
|
-
return children2.map(plainText).join(
|
|
17901
|
+
const sep31 = children2.every((c2) => typeOf2(c2) === "TEXT") ? "" : "\n";
|
|
17902
|
+
return children2.map(plainText).join(sep31);
|
|
17884
17903
|
}
|
|
17885
17904
|
function alignOf(v2) {
|
|
17886
17905
|
switch (v2) {
|
|
@@ -20274,6 +20293,92 @@ function topBarFindings(descriptor) {
|
|
|
20274
20293
|
}
|
|
20275
20294
|
return out2;
|
|
20276
20295
|
}
|
|
20296
|
+
function deadTopBarFindings(descriptor) {
|
|
20297
|
+
const out2 = [];
|
|
20298
|
+
const bar = descriptor?.topBar;
|
|
20299
|
+
if (!bar || typeof bar !== "object") return out2;
|
|
20300
|
+
const b3 = bar;
|
|
20301
|
+
const set3 = (v2) => typeof v2 === "string" && v2 !== "";
|
|
20302
|
+
const items = Array.isArray(b3.items) ? b3.items : [];
|
|
20303
|
+
items.forEach((raw, idx) => {
|
|
20304
|
+
if (!raw || typeof raw !== "object") return;
|
|
20305
|
+
const i2 = raw;
|
|
20306
|
+
if (!set3(i2.id) || i2.placement === "principal") return;
|
|
20307
|
+
const at2 = `topBar.items[${idx}]`;
|
|
20308
|
+
const id = JSON.stringify(i2.id);
|
|
20309
|
+
if (i2.content != null) {
|
|
20310
|
+
out2.push({ path: `${at2}.content`, ruleCode: "top_bar_item_content_ignored", message: `Top-bar item ${id} sets \`content\`, which only a \`placement: "principal"\` item draws, so no shell draws it here. Put the control's \`label\` (or \`icon\`) and \`onTap\` on the item itself` });
|
|
20311
|
+
}
|
|
20312
|
+
if (!set3(i2.label) && !set3(i2.labelPath) && !set3(i2.icon) && i2.avatar == null) {
|
|
20313
|
+
out2.push({ path: at2, ruleCode: "top_bar_item_no_label", message: `Top-bar item ${id} has no \`label\`, \`labelPath\`, \`icon\` or \`avatar\`, so every shell draws its id ${id} as the label. Give it a \`label\` or an \`icon\`` });
|
|
20314
|
+
}
|
|
20315
|
+
if (i2.onTap == null && !(Array.isArray(i2.menu) && i2.menu.length > 0) && i2.disabled !== true) {
|
|
20316
|
+
out2.push({ path: at2, ruleCode: "top_bar_item_no_action", message: `Top-bar item ${id} has no \`onTap\` and no \`menu\`, so it draws as a control and a tap does nothing. Add an \`onTap\`, or \`disabled: true\` if it is a placeholder` });
|
|
20317
|
+
}
|
|
20318
|
+
});
|
|
20319
|
+
const actions = Array.isArray(b3.actions) ? b3.actions : [];
|
|
20320
|
+
actions.forEach((raw, idx) => {
|
|
20321
|
+
if (!raw || typeof raw !== "object") return;
|
|
20322
|
+
const a3 = raw;
|
|
20323
|
+
const id = JSON.stringify(a3.id);
|
|
20324
|
+
if (!set3(a3.icon) && !set3(a3.iconPath) && !set3(a3.label) && !set3(a3.labelPath)) {
|
|
20325
|
+
out2.push({ path: `topBar.actions[${idx}]`, ruleCode: "top_bar_action_no_label", message: `Top-bar action ${id} has no \`icon\` or \`label\`, so every shell draws its id ${id} as the label. Give it an \`icon\` or a \`label\`` });
|
|
20326
|
+
}
|
|
20327
|
+
if (a3.onTap == null) {
|
|
20328
|
+
out2.push({ path: `topBar.actions[${idx}]`, ruleCode: "top_bar_action_no_action", message: `Top-bar action ${id} has no \`onTap\`, so it draws as a control and a tap does nothing. Add an \`onTap\`` });
|
|
20329
|
+
}
|
|
20330
|
+
});
|
|
20331
|
+
return out2;
|
|
20332
|
+
}
|
|
20333
|
+
function deadButtonFindings(descriptor) {
|
|
20334
|
+
const out2 = [];
|
|
20335
|
+
const hasPress = (o2) => !!o2 && Object.entries(o2).some(([k3, v2]) => PRESS_PROPS.has(k3) && v2 != null);
|
|
20336
|
+
const visit = (v2, path2, owned) => {
|
|
20337
|
+
if (Array.isArray(v2)) {
|
|
20338
|
+
v2.forEach((x2, i2) => visit(x2, `${path2}[${i2}]`, owned));
|
|
20339
|
+
return;
|
|
20340
|
+
}
|
|
20341
|
+
if (!v2 || typeof v2 !== "object") return;
|
|
20342
|
+
const node3 = v2;
|
|
20343
|
+
const body = node3.body;
|
|
20344
|
+
const props2 = body?.props;
|
|
20345
|
+
const pressed = owned || hasPress(node3.modifiers) || hasPress(props2);
|
|
20346
|
+
if (body?.type === "Button" && !pressed && props2?.disabled !== true && !(typeof props2?.disabledPath === "string" && props2.disabledPath)) {
|
|
20347
|
+
out2.push({ path: path2, message: `Button ${JSON.stringify(props2?.title ?? node3.id)} has no \`action\` and nothing around it handles its tap, so it draws and does nothing. Give it an \`action\`, or \`disabled: true\`` });
|
|
20348
|
+
}
|
|
20349
|
+
for (const [k3, child3] of Object.entries(node3)) {
|
|
20350
|
+
if (isOpaqueAuthorJson(k3, child3, path2 === "") || path2 === "logicBundle" && k3 === "bootState") continue;
|
|
20351
|
+
if (child3 && typeof child3 === "object") visit(child3, path2 ? `${path2}.${k3}` : k3, pressed || PRESS_OWNING_SLOTS.has(k3));
|
|
20352
|
+
}
|
|
20353
|
+
};
|
|
20354
|
+
visit(descriptor, "", false);
|
|
20355
|
+
return out2;
|
|
20356
|
+
}
|
|
20357
|
+
function missingTranslationKeyFindings(descriptor, keys2) {
|
|
20358
|
+
const out2 = [];
|
|
20359
|
+
const seen = /* @__PURE__ */ new Set();
|
|
20360
|
+
const visit = (v2, path2) => {
|
|
20361
|
+
if (typeof v2 === "string") {
|
|
20362
|
+
const key4 = translationKey(v2);
|
|
20363
|
+
if (key4 !== null && !keys2.has(key4) && !seen.has(key4)) {
|
|
20364
|
+
seen.add(key4);
|
|
20365
|
+
out2.push({ path: path2, message: `\`$t:${key4}\` has no entry in the app's source-locale catalog, so the screen shows the raw key "${key4}". Add a message with \`key: "${key4}"\` to \`l10n/<default locale>.json\`, or use literal copy` });
|
|
20366
|
+
}
|
|
20367
|
+
return;
|
|
20368
|
+
}
|
|
20369
|
+
if (Array.isArray(v2)) {
|
|
20370
|
+
v2.forEach((x2, i2) => visit(x2, `${path2}[${i2}]`));
|
|
20371
|
+
return;
|
|
20372
|
+
}
|
|
20373
|
+
if (!v2 || typeof v2 !== "object") return;
|
|
20374
|
+
for (const [k3, child3] of Object.entries(v2)) {
|
|
20375
|
+
if (path2 === "" && k3 === "input" || path2 === "logicBundle" && k3 === "bootState") continue;
|
|
20376
|
+
visit(child3, path2 ? `${path2}.${k3}` : k3);
|
|
20377
|
+
}
|
|
20378
|
+
};
|
|
20379
|
+
visit(descriptor, "");
|
|
20380
|
+
return out2;
|
|
20381
|
+
}
|
|
20277
20382
|
function validateTabBarVisibility(screens, navigation) {
|
|
20278
20383
|
const out2 = [];
|
|
20279
20384
|
const items = navigation?.tabBar?.items;
|
|
@@ -20645,6 +20750,26 @@ function validateScreenDescriptor(screenId, served, opts = {}) {
|
|
|
20645
20750
|
for (const finding2 of topBarFindings(descriptor)) {
|
|
20646
20751
|
issues.push({ severity: "warning", pass: "top-bar", path: finding2.path, message: finding2.message, ...finding2.ruleCode ? { ruleCode: finding2.ruleCode } : {} });
|
|
20647
20752
|
}
|
|
20753
|
+
for (const finding2 of deadTopBarFindings(descriptor)) {
|
|
20754
|
+
issues.push({ severity: "error", pass: "dead-control", path: finding2.path, message: finding2.message, ruleCode: finding2.ruleCode });
|
|
20755
|
+
}
|
|
20756
|
+
for (const finding2 of deadButtonFindings(descriptor)) {
|
|
20757
|
+
issues.push({ severity: hygiene, pass: "dead-control", path: finding2.path, message: finding2.message, ruleCode: "button_no_action" });
|
|
20758
|
+
}
|
|
20759
|
+
if (opts.translationKeys) {
|
|
20760
|
+
for (const finding2 of missingTranslationKeyFindings(descriptor, opts.translationKeys)) {
|
|
20761
|
+
issues.push({ severity: "error", pass: "l10n", path: finding2.path, message: finding2.message, ruleCode: "l10n_missing_key" });
|
|
20762
|
+
}
|
|
20763
|
+
}
|
|
20764
|
+
for (const f2 of collectKeyShapedLiterals(descriptor, opts.translationKeys)) {
|
|
20765
|
+
issues.push({
|
|
20766
|
+
severity: hygiene,
|
|
20767
|
+
pass: "l10n",
|
|
20768
|
+
path: f2.path,
|
|
20769
|
+
ruleCode: "l10n_key_literal",
|
|
20770
|
+
message: `${f2.type ?? "The screen"}.${f2.prop} is ${JSON.stringify(f2.value)}, which is shaped like a translation key, so the screen shows the key itself. Write the copy, or \`$t:${f2.value}\` with a catalog entry`
|
|
20771
|
+
});
|
|
20772
|
+
}
|
|
20648
20773
|
issues.push(...depthIssues);
|
|
20649
20774
|
const bindings = collectServiceBindings(descriptor);
|
|
20650
20775
|
const descriptorActions = collectDescriptorActions(descriptor);
|
|
@@ -21298,7 +21423,7 @@ function validateAppWebViewInstances(screens, opts) {
|
|
|
21298
21423
|
];
|
|
21299
21424
|
return webViewEmbeddedIssues(findings).map((issue3, i2) => ({ ...issue3, screenId: findings[i2].screenId }));
|
|
21300
21425
|
}
|
|
21301
|
-
var CRAWL_BLOCKING_PASSES, BOOT_EVAL_TIMEOUT_MS, BUNDLE_FILENAME, DRIFT_PROBES, DEVICE_NETWORK_WITHHELD, DEVICE_STRIPPED_HOST_GLOBALS, DEVICE_WITHHELD, DEVICE_PARITY_CANDIDATES, DEVICE_PARITY_WITHHELD, defaultEvaluator, bootEvaluator, actionEvaluator, NATIVE_PROP_ENUMS, KNOWN_PROPS, IN_ARRAY_BINDING_PROPS, SERVICE_SIGIL, INTEGER_PROPS, NESTED_COMPONENT_SLOTS, NESTED_SLOT_DECODE_KILL, NATIVE_REQUIRED_PROPS, bareNestedClass, NATIVE_NESTED_CLASSES, NATIVE_MODIFIERS_CLASS, NATIVE_NESTED_SCALARS, NATIVE_DESCRIPTOR_CLASS, NATIVE_DESCRIPTOR_NESTED, NATIVE_NESTED_PROPS, LENIENT_TOP_BAR_BLOCKS, MODIFIER_KEYS, INTEGER_MODIFIERS, MODIFIER_KINDS, SCHEMA_SCORED_NODES, CORE_PACKAGES, LEGACY_UNSCORED_KEYS, DYNAMIC_PLACEHOLDER, LITERAL_ONLY_PROPS, SERVICE_ONLY_BINDING_PROPS, WHOLE_VALUE_BINDING, EMBEDDED_BINDING, OPTIONS_BINDING_PROPS, EDITOR_SERVICE_NAME, SHEET_PLACEMENTS, UNSAFE_TO_RECURSE_DEPTH, TOP_BAR_TRAILING_LIMIT, TOP_BAR_NON_TRAILING, TOP_BAR_TITLE_ALIGN_VALUES, TOP_BAR_TITLE_DISPLAY_VALUES, TOP_BAR_SEARCH_BINDINGS, TOP_BAR_SEARCH_GATE, TAB_BAR_KINDS_WITHOUT_BOTTOM_TABS, BUTTON_STYLES, PROP_VALUE_ENUMS, PROP_VALUE_DEFAULTS, EMPTY_STATE_ACTION_STYLES, EMPTY_STATE_ACTION_SIZES;
|
|
21426
|
+
var CRAWL_BLOCKING_PASSES, BOOT_EVAL_TIMEOUT_MS, BUNDLE_FILENAME, DRIFT_PROBES, DEVICE_NETWORK_WITHHELD, DEVICE_STRIPPED_HOST_GLOBALS, DEVICE_WITHHELD, DEVICE_PARITY_CANDIDATES, DEVICE_PARITY_WITHHELD, defaultEvaluator, bootEvaluator, actionEvaluator, NATIVE_PROP_ENUMS, KNOWN_PROPS, IN_ARRAY_BINDING_PROPS, SERVICE_SIGIL, INTEGER_PROPS, NESTED_COMPONENT_SLOTS, NESTED_SLOT_DECODE_KILL, NATIVE_REQUIRED_PROPS, bareNestedClass, NATIVE_NESTED_CLASSES, NATIVE_MODIFIERS_CLASS, NATIVE_NESTED_SCALARS, NATIVE_DESCRIPTOR_CLASS, NATIVE_DESCRIPTOR_NESTED, NATIVE_NESTED_PROPS, LENIENT_TOP_BAR_BLOCKS, MODIFIER_KEYS, INTEGER_MODIFIERS, MODIFIER_KINDS, SCHEMA_SCORED_NODES, CORE_PACKAGES, LEGACY_UNSCORED_KEYS, DYNAMIC_PLACEHOLDER, LITERAL_ONLY_PROPS, SERVICE_ONLY_BINDING_PROPS, WHOLE_VALUE_BINDING, EMBEDDED_BINDING, OPTIONS_BINDING_PROPS, EDITOR_SERVICE_NAME, SHEET_PLACEMENTS, UNSAFE_TO_RECURSE_DEPTH, TOP_BAR_TRAILING_LIMIT, TOP_BAR_NON_TRAILING, TOP_BAR_TITLE_ALIGN_VALUES, TOP_BAR_TITLE_DISPLAY_VALUES, TOP_BAR_SEARCH_BINDINGS, TOP_BAR_SEARCH_GATE, PRESS_PROPS, PRESS_OWNING_SLOTS, TAB_BAR_KINDS_WITHOUT_BOTTOM_TABS, BUTTON_STYLES, PROP_VALUE_ENUMS, PROP_VALUE_DEFAULTS, EMPTY_STATE_ACTION_STYLES, EMPTY_STATE_ACTION_SIZES;
|
|
21302
21427
|
var init_validate_descriptor_core = __esm({
|
|
21303
21428
|
"../../core/dev-server/src/validate-descriptor.core.ts"() {
|
|
21304
21429
|
init_define_HHP_CATALOG();
|
|
@@ -22489,6 +22614,8 @@ var init_validate_descriptor_core = __esm({
|
|
|
22489
22614
|
TOP_BAR_TITLE_DISPLAY_VALUES = /* @__PURE__ */ new Set(["", "automatic", "large", "inline", "hidden"]);
|
|
22490
22615
|
TOP_BAR_SEARCH_BINDINGS = ["valuePath", "focusPath", "loadingPath", "suggestionsPath", "scopePath"];
|
|
22491
22616
|
TOP_BAR_SEARCH_GATE = "$env:topBarSearch";
|
|
22617
|
+
PRESS_PROPS = /* @__PURE__ */ new Set(["action", "onTap"]);
|
|
22618
|
+
PRESS_OWNING_SLOTS = /* @__PURE__ */ new Set(["anchor", "submitButton"]);
|
|
22492
22619
|
TAB_BAR_KINDS_WITHOUT_BOTTOM_TABS = /* @__PURE__ */ new Set(["single", "drawer", "sidebar"]);
|
|
22493
22620
|
BUTTON_STYLES = /* @__PURE__ */ new Set(["filled", "tonal", "outlined", "text", "elevated", "bordered", "prominent", "plain", "glass", "primary", "secondary", "tertiary", "link", "destructive"]);
|
|
22494
22621
|
PROP_VALUE_ENUMS = {
|
|
@@ -38789,7 +38916,6 @@ function resolveIdiom(tokens2, ctx = {}) {
|
|
|
38789
38916
|
var IDIOM_CONTEXTS, UNSAFE_KEYS;
|
|
38790
38917
|
var init_idiom = __esm({
|
|
38791
38918
|
"../../core/ts/src/idiom.ts"() {
|
|
38792
|
-
"use strict";
|
|
38793
38919
|
init_define_HHP_CATALOG();
|
|
38794
38920
|
IDIOM_CONTEXTS = {
|
|
38795
38921
|
ios: { native: ["ios"] },
|
|
@@ -40525,6 +40651,7 @@ function shouldRevealError(args) {
|
|
|
40525
40651
|
var EMAIL_RE, URL_HOST_RE, INTEGER_RE, NUMBER_RE, AUTHORED_PATTERN_LIMIT, authoredPatterns;
|
|
40526
40652
|
var init_validation = __esm({
|
|
40527
40653
|
"../../core/ts/src/validation.ts"() {
|
|
40654
|
+
"use strict";
|
|
40528
40655
|
init_define_HHP_CATALOG();
|
|
40529
40656
|
EMAIL_RE = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
|
|
40530
40657
|
URL_HOST_RE = /^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(:[0-9]+)?$/;
|
|
@@ -42012,7 +42139,7 @@ function redactBodyString(body) {
|
|
|
42012
42139
|
} catch {
|
|
42013
42140
|
}
|
|
42014
42141
|
}
|
|
42015
|
-
return body.replace(FORM_ASSIGNMENT_RE, (m2, name) => isSensitiveBodyName(name) ? `${name}=${REDACTED}` : m2).replace(JSON_FIELD_RE, (m2, name,
|
|
42142
|
+
return body.replace(FORM_ASSIGNMENT_RE, (m2, name) => isSensitiveBodyName(name) ? `${name}=${REDACTED}` : m2).replace(JSON_FIELD_RE, (m2, name, sep31) => isSensitiveBodyName(name) ? `"${name}"${sep31}"${REDACTED}"` : m2).replace(JSON_FIELD_UNTERMINATED_RE, (m2, name, sep31) => isSensitiveBodyName(name) ? `"${name}"${sep31}"${REDACTED}` : m2).replace(BEARER_RE, (_m, s5) => `${s5} ${REDACTED}`);
|
|
42016
42143
|
}
|
|
42017
42144
|
function createWixGatewayState() {
|
|
42018
42145
|
return { mode: "record", rules: [], traffic: [], clients: /* @__PURE__ */ new Set(), seq: 0, ruleSeq: 0 };
|
|
@@ -48966,10 +49093,10 @@ async function runRicosImageUpload(o2) {
|
|
|
48966
49093
|
} catch {
|
|
48967
49094
|
return fail12("read");
|
|
48968
49095
|
}
|
|
48969
|
-
const
|
|
49096
|
+
const sep31 = entry.uploadUrl.includes("?") ? "&" : "?";
|
|
48970
49097
|
let res;
|
|
48971
49098
|
try {
|
|
48972
|
-
res = await deps.fetch(`${entry.uploadUrl}${
|
|
49099
|
+
res = await deps.fetch(`${entry.uploadUrl}${sep31}filename=${encodeURIComponent(file2.fileName)}`, { method: "PUT", headers: { "Content-Type": file2.mimeType }, body });
|
|
48973
49100
|
} catch {
|
|
48974
49101
|
return fail12("put");
|
|
48975
49102
|
}
|
|
@@ -49612,10 +49739,10 @@ async function runMediaFieldUpload(o2) {
|
|
|
49612
49739
|
} catch (e2) {
|
|
49613
49740
|
return { ok: false, reason: e2 instanceof Deadline ? "timeout" : "read" };
|
|
49614
49741
|
}
|
|
49615
|
-
const
|
|
49742
|
+
const sep31 = uploadUrl.includes("?") ? "&" : "?";
|
|
49616
49743
|
let res;
|
|
49617
49744
|
try {
|
|
49618
|
-
res = await bounded2(deps.fetch(`${uploadUrl}${
|
|
49745
|
+
res = await bounded2(deps.fetch(`${uploadUrl}${sep31}filename=${encodeURIComponent(file2.fileName)}`, {
|
|
49619
49746
|
method: "PUT",
|
|
49620
49747
|
headers: { "Content-Type": file2.mimeType },
|
|
49621
49748
|
body,
|
|
@@ -133397,8 +133524,8 @@ function ensureCountUpRuntime() {
|
|
|
133397
133524
|
const neg = fixed.startsWith("-");
|
|
133398
133525
|
const body = neg ? fixed.slice(1) : fixed;
|
|
133399
133526
|
const [int3, frac] = body.split(".");
|
|
133400
|
-
const
|
|
133401
|
-
return (neg ? "-" : "") +
|
|
133527
|
+
const sep31 = int3.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
133528
|
+
return (neg ? "-" : "") + sep31 + (frac ? "." + frac : "");
|
|
133402
133529
|
};
|
|
133403
133530
|
const animateEl = (el2) => {
|
|
133404
133531
|
const node3 = el2;
|
|
@@ -143912,7 +144039,7 @@ function nodeHidden(modifiers, provider, itemScope, env) {
|
|
|
143912
144039
|
return false;
|
|
143913
144040
|
}
|
|
143914
144041
|
function isObservedTextProp(type2, key4) {
|
|
143915
|
-
return TREE_TEXT_VALUE_PROPS.has(key4) || type2 === "ListItem" && key4 === "subtitle" || type2 === "EmptyState" && (key4 === "subtitle" || key4 === "actionLabel");
|
|
144042
|
+
return TREE_TEXT_VALUE_PROPS.has(key4) || type2 === "ListItem" && key4 === "subtitle" || type2 === "EmptyState" && (key4 === "subtitle" || key4 === "actionLabel") || type2 === "ErrorState" && (key4 === "body" || key4 === "ctaLabel");
|
|
143916
144043
|
}
|
|
143917
144044
|
function resolveTreeScalar(v2, provider, itemScope) {
|
|
143918
144045
|
if (typeof v2 !== "string") return v2;
|
|
@@ -144017,6 +144144,17 @@ function buildRenderTree(node3, path2 = "$", provider = null, itemScope = void 0
|
|
|
144017
144144
|
const actionLabel = props2.action != null ? painted2(props2.actionLabel) : void 0;
|
|
144018
144145
|
if (actionLabel !== void 0) values.actionLabel = actionLabel;
|
|
144019
144146
|
}
|
|
144147
|
+
if (type2 === "ErrorState") {
|
|
144148
|
+
const painted2 = (raw) => {
|
|
144149
|
+
if (typeof raw !== "string") return void 0;
|
|
144150
|
+
const r3 = resolveTreeScalar(raw, provider, itemScope);
|
|
144151
|
+
return typeof r3 === "string" && r3.trim() !== "" ? r3 : void 0;
|
|
144152
|
+
};
|
|
144153
|
+
const body2 = painted2(props2.body);
|
|
144154
|
+
if (body2 !== void 0) values.body = body2;
|
|
144155
|
+
const ctaLabel = props2.cta != null ? painted2(props2.ctaLabel) : void 0;
|
|
144156
|
+
if (ctaLabel !== void 0) values.ctaLabel = ctaLabel;
|
|
144157
|
+
}
|
|
144020
144158
|
const template = props2.template;
|
|
144021
144159
|
if (type2 === "Text" && template && typeof template.template === "string") {
|
|
144022
144160
|
const args = Object.fromEntries(Object.entries(template.params ?? {}).map(([key4, value2]) => [key4, resolveTreeScalar(value2, provider, itemScope)]));
|
|
@@ -146105,6 +146243,18 @@ async function nativeActionsFor(state) {
|
|
|
146105
146243
|
function isWellFormedAppParam(app2) {
|
|
146106
146244
|
return /^(?=.{1,63}$)[a-z0-9][a-z0-9-]*(?:\.[a-z0-9][a-z0-9-]*)?$/.test(app2);
|
|
146107
146245
|
}
|
|
146246
|
+
function sourceTranslationKeys(state) {
|
|
146247
|
+
if (!state.app) return void 0;
|
|
146248
|
+
const tag = uiConfig(state.app.module.config).locale?.default ?? "en";
|
|
146249
|
+
if (!/^[a-z]{2,3}(-[A-Za-z0-9]{1,8})?$/.test(tag)) return /* @__PURE__ */ new Set();
|
|
146250
|
+
const path2 = resolve34(state.app.dir, "l10n", `${tag}.json`);
|
|
146251
|
+
if (!existsSync40(path2)) return /* @__PURE__ */ new Set();
|
|
146252
|
+
try {
|
|
146253
|
+
return new Set(keyMap(parseCatalog(readFileSync43(path2, "utf8")), { sourceFallback: true }).keys());
|
|
146254
|
+
} catch {
|
|
146255
|
+
return /* @__PURE__ */ new Set();
|
|
146256
|
+
}
|
|
146257
|
+
}
|
|
146108
146258
|
function handleL10nRequest(req, res, state) {
|
|
146109
146259
|
const u2 = new URL(req.url ?? "", "http://localhost");
|
|
146110
146260
|
const app2 = (u2.searchParams.get("app") ?? "").trim();
|
|
@@ -146168,6 +146318,7 @@ async function runScreenDiagnostics(state, screenId, descriptor) {
|
|
|
146168
146318
|
appServices: appServicesContextFor2(state.app?.dir, state.app?.module.config, state.tier5Dir ?? TIER5_ROOT2),
|
|
146169
146319
|
strict: false,
|
|
146170
146320
|
workerSubtreeScreens: new Set(uiConfig(state.app?.module.config).workerSubtreeScreens ?? []),
|
|
146321
|
+
translationKeys: sourceTranslationKeys(state),
|
|
146171
146322
|
// Same a11y rung the build lint applies (RFC 0058 §5) — diagnostics must not disagree.
|
|
146172
146323
|
a11y: uiConfig(state.app?.module.config).a11y
|
|
146173
146324
|
});
|
|
@@ -148374,6 +148525,7 @@ async function handleAdminPlayground(req, res, state) {
|
|
|
148374
148525
|
appServices: appServicesContextFor2(state.app?.dir, state.app?.module.config, state.tier5Dir ?? TIER5_ROOT2),
|
|
148375
148526
|
strict,
|
|
148376
148527
|
workerSubtreeScreens: new Set(uiConfig(state.app?.module.config).workerSubtreeScreens ?? []),
|
|
148528
|
+
translationKeys: sourceTranslationKeys(state),
|
|
148377
148529
|
a11y: uiConfig(state.app?.module.config).a11y
|
|
148378
148530
|
});
|
|
148379
148531
|
return sendJson(res, report9.ok ? 200 : 422, report9);
|
|
@@ -151176,6 +151328,9 @@ function renderedValueDefect(value2, field, componentType = "", l10nKeys) {
|
|
|
151176
151328
|
const key4 = translationKey(v2);
|
|
151177
151329
|
if (key4 === null || !l10nKeys?.get(key4)) return { kind: "unsubstituted-binding", actual: tKey[0].trim() };
|
|
151178
151330
|
}
|
|
151331
|
+
if (field !== "value" && isObservedTextProp(componentType, field) && l10nKeys?.has(v2)) {
|
|
151332
|
+
return { kind: "placeholder-in-text", actual: v2, translationKey: true };
|
|
151333
|
+
}
|
|
151179
151334
|
if (value2.includes("[object Object]")) return { kind: "placeholder-in-text", actual: "[object Object]" };
|
|
151180
151335
|
if (/^[[{]/.test(v2)) {
|
|
151181
151336
|
try {
|
|
@@ -151196,6 +151351,9 @@ function resolvedDefectMessage(defect) {
|
|
|
151196
151351
|
return `visible text is "${defect.actual}"`;
|
|
151197
151352
|
}
|
|
151198
151353
|
function resolvedDefectHint(defect) {
|
|
151354
|
+
if (defect.translationKey) {
|
|
151355
|
+
return "the text is a translation key, not copy \u2014 return the copy from the worker, or a `$t:` key the app's l10n catalog answers";
|
|
151356
|
+
}
|
|
151199
151357
|
if (defect.kind === "unsubstituted-binding") {
|
|
151200
151358
|
return "the bound path resolved to nothing, so the raw token reaches the screen \u2014 check the service name and path against the worker's state";
|
|
151201
151359
|
}
|
|
@@ -152538,8 +152696,8 @@ async function crawlScreenInner(opts) {
|
|
|
152538
152696
|
if (linkable.has(target)) return true;
|
|
152539
152697
|
for (const base2 of linkable) {
|
|
152540
152698
|
if (target.length > base2.length + 1 && target.startsWith(base2)) {
|
|
152541
|
-
const
|
|
152542
|
-
if (
|
|
152699
|
+
const sep31 = target[base2.length];
|
|
152700
|
+
if (sep31 === "_" || sep31 === "/") return true;
|
|
152543
152701
|
}
|
|
152544
152702
|
}
|
|
152545
152703
|
return false;
|
|
@@ -153799,6 +153957,7 @@ __export(build_exports2, {
|
|
|
153799
153957
|
servicesFromBundleJs: () => servicesFromBundleJs,
|
|
153800
153958
|
shellSha: () => shellSha,
|
|
153801
153959
|
snapshotTokens: () => snapshotTokens,
|
|
153960
|
+
sourceTranslationKeys: () => sourceTranslationKeys2,
|
|
153802
153961
|
tokensSnapshotMessage: () => tokensSnapshotMessage,
|
|
153803
153962
|
unsupportedComponentMinVersions: () => unsupportedComponentMinVersions,
|
|
153804
153963
|
withPinnedRelease: () => withPinnedRelease,
|
|
@@ -153806,8 +153965,8 @@ __export(build_exports2, {
|
|
|
153806
153965
|
withoutDevOnlyAppConfig: () => withoutDevOnlyAppConfig
|
|
153807
153966
|
});
|
|
153808
153967
|
import { createHash as createHash23 } from "node:crypto";
|
|
153809
|
-
import { readFileSync as readFileSync46, readdirSync as readdirSync25, existsSync as existsSync43 } from "node:fs";
|
|
153810
|
-
import { dirname as dirname28, join as join37, resolve as resolve36 } from "node:path";
|
|
153968
|
+
import { readFileSync as readFileSync46, readdirSync as readdirSync25, existsSync as existsSync43, realpathSync as realpathSync6 } from "node:fs";
|
|
153969
|
+
import { dirname as dirname28, join as join37, resolve as resolve36, sep as sep13 } from "node:path";
|
|
153811
153970
|
import { fileURLToPath as fileURLToPath27 } from "node:url";
|
|
153812
153971
|
import { createRequire as createRequire3 } from "node:module";
|
|
153813
153972
|
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
@@ -153892,6 +154051,21 @@ function l10nLintOptions(locale, appDir3) {
|
|
|
153892
154051
|
}
|
|
153893
154052
|
return { enforce, catalog: catalog4, locales: tags };
|
|
153894
154053
|
}
|
|
154054
|
+
function sourceTranslationKeys2(locale, appDir3) {
|
|
154055
|
+
const tag = locale?.default || "en";
|
|
154056
|
+
if (!/^[a-z]{2,3}(-[A-Za-z0-9]{1,8})?$/.test(tag)) return /* @__PURE__ */ new Set();
|
|
154057
|
+
const l10nDir = join37(appDir3, "l10n");
|
|
154058
|
+
const path2 = join37(l10nDir, `${tag}.json`);
|
|
154059
|
+
if (!existsSync43(path2)) return /* @__PURE__ */ new Set();
|
|
154060
|
+
try {
|
|
154061
|
+
const realDir = realpathSync6(l10nDir);
|
|
154062
|
+
const realFile = realpathSync6(path2);
|
|
154063
|
+
if (!realDir.startsWith(realpathSync6(appDir3) + sep13) || dirname28(realFile) !== realDir) return /* @__PURE__ */ new Set();
|
|
154064
|
+
return new Set(keyMap(parseCatalog(readFileSync46(realFile, "utf8")), { sourceFallback: true }).keys());
|
|
154065
|
+
} catch {
|
|
154066
|
+
return /* @__PURE__ */ new Set();
|
|
154067
|
+
}
|
|
154068
|
+
}
|
|
153895
154069
|
async function bakeCatalogs(app2, locale, fetchCatalog, putDoc) {
|
|
153896
154070
|
const out2 = {};
|
|
153897
154071
|
if (!putDoc) return out2;
|
|
@@ -154452,6 +154626,7 @@ async function buildFromLoaded(preloaded, dest, opts = {}) {
|
|
|
154452
154626
|
const linkable = /* @__PURE__ */ new Set();
|
|
154453
154627
|
let bakedAppConfig;
|
|
154454
154628
|
const lintTokens = collect2?.lint || collect2?.render ? readTokensForLint(preloaded) : void 0;
|
|
154629
|
+
const lintTranslationKeys = collect2?.lint ? sourceTranslationKeys2(config.locale, preloaded.dir) : void 0;
|
|
154455
154630
|
const facedTokens = lintTokens && withServedFontFaces(lintTokens, preloaded.dir);
|
|
154456
154631
|
const idiomPolicy = config.idiom;
|
|
154457
154632
|
const renderTokens = facedTokens && idiomPolicy !== void 0 ? { ...facedTokens, idiomPolicy } : facedTokens;
|
|
@@ -154936,6 +155111,7 @@ async function buildFromLoaded(preloaded, dest, opts = {}) {
|
|
|
154936
155111
|
strict: collect2.strict,
|
|
154937
155112
|
workerSubtreeScreens: new Set(config.workerSubtreeScreens ?? []),
|
|
154938
155113
|
l10n: l10nLintOptions(config.locale, preloaded.dir),
|
|
155114
|
+
translationKeys: lintTranslationKeys,
|
|
154939
155115
|
// RFC 0058 §5 — the app's own rung of the a11y ladder. Omitted ⇒ the validator's
|
|
154940
155116
|
// default, "error"; an in-repo app with ratcheted debt declares "warn".
|
|
154941
155117
|
a11y: config.a11y
|
|
@@ -155447,6 +155623,7 @@ var init_build3 = __esm({
|
|
|
155447
155623
|
init_app_services_requirements();
|
|
155448
155624
|
init_app_icon();
|
|
155449
155625
|
init_app_config();
|
|
155626
|
+
init_l10n_catalog();
|
|
155450
155627
|
init_app_assets();
|
|
155451
155628
|
init_plan_fonts();
|
|
155452
155629
|
init_face_source();
|
|
@@ -156649,14 +156826,14 @@ __export(studio_exports, {
|
|
|
156649
156826
|
writeStudioRecord: () => writeStudioRecord
|
|
156650
156827
|
});
|
|
156651
156828
|
import { createHash as createHash24 } from "node:crypto";
|
|
156652
|
-
import { existsSync as existsSync46, readdirSync as readdirSync27, readFileSync as readFileSync49, realpathSync as
|
|
156653
|
-
import { basename as basename12, extname as extname3, join as join40, relative as relative10, resolve as resolve37, sep as
|
|
156829
|
+
import { existsSync as existsSync46, readdirSync as readdirSync27, readFileSync as readFileSync49, realpathSync as realpathSync7, statSync as statSync10 } from "node:fs";
|
|
156830
|
+
import { basename as basename12, extname as extname3, join as join40, relative as relative10, resolve as resolve37, sep as sep14 } from "node:path";
|
|
156654
156831
|
import { pathToFileURL as pathToFileURL6 } from "node:url";
|
|
156655
156832
|
function realInside(dir, abs) {
|
|
156656
156833
|
try {
|
|
156657
|
-
const root =
|
|
156658
|
-
const real =
|
|
156659
|
-
return real.startsWith(root +
|
|
156834
|
+
const root = realpathSync7(dir);
|
|
156835
|
+
const real = realpathSync7(abs);
|
|
156836
|
+
return real.startsWith(root + sep14) ? real : null;
|
|
156660
156837
|
} catch {
|
|
156661
156838
|
return null;
|
|
156662
156839
|
}
|
|
@@ -163039,21 +163216,21 @@ var init_Matcher = __esm({
|
|
|
163039
163216
|
* @returns {string}
|
|
163040
163217
|
*/
|
|
163041
163218
|
toString(separator, includeNamespace = true) {
|
|
163042
|
-
const
|
|
163043
|
-
const isDefault =
|
|
163219
|
+
const sep31 = separator || this.separator;
|
|
163220
|
+
const isDefault = sep31 === this.separator && includeNamespace === true;
|
|
163044
163221
|
if (isDefault) {
|
|
163045
163222
|
if (this._pathStringCache !== null) {
|
|
163046
163223
|
return this._pathStringCache;
|
|
163047
163224
|
}
|
|
163048
163225
|
const result = this.path.map(
|
|
163049
163226
|
(n2) => n2.namespace ? `${n2.namespace}:${n2.tag}` : n2.tag
|
|
163050
|
-
).join(
|
|
163227
|
+
).join(sep31);
|
|
163051
163228
|
this._pathStringCache = result;
|
|
163052
163229
|
return result;
|
|
163053
163230
|
}
|
|
163054
163231
|
return this.path.map(
|
|
163055
163232
|
(n2) => includeNamespace && n2.namespace ? `${n2.namespace}:${n2.tag}` : n2.tag
|
|
163056
|
-
).join(
|
|
163233
|
+
).join(sep31);
|
|
163057
163234
|
}
|
|
163058
163235
|
/**
|
|
163059
163236
|
* Get path as array of tag names.
|
|
@@ -163763,77 +163940,77 @@ var init_redos = __esm({
|
|
|
163763
163940
|
});
|
|
163764
163941
|
|
|
163765
163942
|
// ../../node_modules/is-unsafe/src/contexts/nosql.js
|
|
163766
|
-
var
|
|
163943
|
+
var sep15, NOSQL_PATTERNS, nosql_default;
|
|
163767
163944
|
var init_nosql = __esm({
|
|
163768
163945
|
"../../node_modules/is-unsafe/src/contexts/nosql.js"() {
|
|
163769
163946
|
init_define_HHP_CATALOG();
|
|
163770
|
-
|
|
163947
|
+
sep15 = `["'\\s]*:`;
|
|
163771
163948
|
NOSQL_PATTERNS = [
|
|
163772
163949
|
// ─── MongoDB $ operator injection ────────────────────────────────────────
|
|
163773
163950
|
{
|
|
163774
163951
|
id: "nosql-where-operator",
|
|
163775
163952
|
description: "$where \u2014 executes arbitrary JavaScript server-side in MongoDB",
|
|
163776
|
-
pattern: new RegExp(`\\$where${
|
|
163953
|
+
pattern: new RegExp(`\\$where${sep15}`, "i")
|
|
163777
163954
|
},
|
|
163778
163955
|
{
|
|
163779
163956
|
id: "nosql-ne-operator",
|
|
163780
163957
|
description: '$ne \u2014 "not equal" operator used to bypass equality checks',
|
|
163781
|
-
pattern: new RegExp(`\\$ne${
|
|
163958
|
+
pattern: new RegExp(`\\$ne${sep15}`, "i")
|
|
163782
163959
|
},
|
|
163783
163960
|
{
|
|
163784
163961
|
id: "nosql-gt-operator",
|
|
163785
163962
|
description: '$gt \u2014 "greater than" used to bypass password/value checks',
|
|
163786
|
-
pattern: new RegExp(`\\$gte?${
|
|
163963
|
+
pattern: new RegExp(`\\$gte?${sep15}`, "i")
|
|
163787
163964
|
},
|
|
163788
163965
|
{
|
|
163789
163966
|
id: "nosql-lt-operator",
|
|
163790
163967
|
description: '$lt / $lte \u2014 "less than" bypass variants',
|
|
163791
|
-
pattern: new RegExp(`\\$lte?${
|
|
163968
|
+
pattern: new RegExp(`\\$lte?${sep15}`, "i")
|
|
163792
163969
|
},
|
|
163793
163970
|
{
|
|
163794
163971
|
id: "nosql-regex-operator",
|
|
163795
163972
|
description: "$regex \u2014 can be used to extract data character by character (blind injection)",
|
|
163796
|
-
pattern: new RegExp(`\\$regex${
|
|
163973
|
+
pattern: new RegExp(`\\$regex${sep15}`, "i")
|
|
163797
163974
|
},
|
|
163798
163975
|
{
|
|
163799
163976
|
id: "nosql-or-operator",
|
|
163800
163977
|
description: "$or \u2014 logical OR; used to create always-true conditions",
|
|
163801
|
-
pattern: new RegExp(`\\$or${
|
|
163978
|
+
pattern: new RegExp(`\\$or${sep15}\\s*\\[`, "i")
|
|
163802
163979
|
},
|
|
163803
163980
|
{
|
|
163804
163981
|
id: "nosql-and-operator",
|
|
163805
163982
|
description: "$and \u2014 logical AND operator injection",
|
|
163806
|
-
pattern: new RegExp(`\\$and${
|
|
163983
|
+
pattern: new RegExp(`\\$and${sep15}\\s*\\[`, "i")
|
|
163807
163984
|
},
|
|
163808
163985
|
{
|
|
163809
163986
|
id: "nosql-nor-operator",
|
|
163810
163987
|
description: "$nor \u2014 logical NOR operator injection",
|
|
163811
|
-
pattern: new RegExp(`\\$nor${
|
|
163988
|
+
pattern: new RegExp(`\\$nor${sep15}\\s*\\[`, "i")
|
|
163812
163989
|
},
|
|
163813
163990
|
{
|
|
163814
163991
|
id: "nosql-exists-operator",
|
|
163815
163992
|
description: "$exists \u2014 can enumerate fields to determine schema",
|
|
163816
|
-
pattern: new RegExp(`\\$exists${
|
|
163993
|
+
pattern: new RegExp(`\\$exists${sep15}`, "i")
|
|
163817
163994
|
},
|
|
163818
163995
|
{
|
|
163819
163996
|
id: "nosql-in-operator",
|
|
163820
163997
|
description: "$in \u2014 matches any value in a list; can enumerate values",
|
|
163821
|
-
pattern: new RegExp(`\\$in${
|
|
163998
|
+
pattern: new RegExp(`\\$in${sep15}\\s*\\[`, "i")
|
|
163822
163999
|
},
|
|
163823
164000
|
{
|
|
163824
164001
|
id: "nosql-expr-operator",
|
|
163825
164002
|
description: "$expr \u2014 allows aggregation expressions in queries (MongoDB 3.6+)",
|
|
163826
|
-
pattern: new RegExp(`\\$expr${
|
|
164003
|
+
pattern: new RegExp(`\\$expr${sep15}`, "i")
|
|
163827
164004
|
},
|
|
163828
164005
|
{
|
|
163829
164006
|
id: "nosql-function-operator",
|
|
163830
164007
|
description: "$function \u2014 executes arbitrary JavaScript in MongoDB 4.4+",
|
|
163831
|
-
pattern: new RegExp(`\\$function${
|
|
164008
|
+
pattern: new RegExp(`\\$function${sep15}`, "i")
|
|
163832
164009
|
},
|
|
163833
164010
|
{
|
|
163834
164011
|
id: "nosql-accumulator-operator",
|
|
163835
164012
|
description: "$accumulator \u2014 custom aggregation with arbitrary JS execution",
|
|
163836
|
-
pattern: new RegExp(`\\$accumulator${
|
|
164013
|
+
pattern: new RegExp(`\\$accumulator${sep15}`, "i")
|
|
163837
164014
|
},
|
|
163838
164015
|
// ─── Prototype pollution ─────────────────────────────────────────────────
|
|
163839
164016
|
{
|
|
@@ -166650,10 +166827,10 @@ __export(content_manifest_exports, {
|
|
|
166650
166827
|
writeContentManifest: () => writeContentManifest
|
|
166651
166828
|
});
|
|
166652
166829
|
import { randomUUID as randomUUID8 } from "node:crypto";
|
|
166653
|
-
import { constants as constants2, lstatSync as lstatSync17, readFileSync as readFileSync57, realpathSync as
|
|
166830
|
+
import { constants as constants2, lstatSync as lstatSync17, readFileSync as readFileSync57, realpathSync as realpathSync8, writeFileSync as writeFileSync20, renameSync as renameSync9, openSync as openSync3, closeSync as closeSync3, unlinkSync as unlinkSync2 } from "node:fs";
|
|
166654
166831
|
import { join as join45 } from "node:path";
|
|
166655
166832
|
function contentManifestPath(dir) {
|
|
166656
|
-
const path2 = join45(
|
|
166833
|
+
const path2 = join45(realpathSync8(dir), "himalaya.content.json");
|
|
166657
166834
|
try {
|
|
166658
166835
|
if (lstatSync17(path2).isSymbolicLink()) throw new Error("himalaya.content.json is a symlink \u2014 refusing to read or write through it");
|
|
166659
166836
|
} catch (error) {
|
|
@@ -170205,7 +170382,7 @@ __export(app_source_exports, {
|
|
|
170205
170382
|
});
|
|
170206
170383
|
import { createHash as createHash29 } from "node:crypto";
|
|
170207
170384
|
import { readdirSync as readdirSync32, lstatSync as lstatSync19, readFileSync as readFileSync63, mkdirSync as mkdirSync29, writeFileSync as writeFileSync24, existsSync as existsSync58, rmSync as rmSync17, rmdirSync as rmdirSync3, unlinkSync as unlinkSync3 } from "node:fs";
|
|
170208
|
-
import { join as join50, resolve as resolve46, sep as
|
|
170385
|
+
import { join as join50, resolve as resolve46, sep as sep16 } from "node:path";
|
|
170209
170386
|
import { createRequire as createRequire4 } from "node:module";
|
|
170210
170387
|
import { deflateRawSync as deflateRawSync2 } from "node:zlib";
|
|
170211
170388
|
function walkSourceTree(dir, file2, skip, enter = () => {
|
|
@@ -170228,7 +170405,7 @@ function walkSourceTree(dir, file2, skip, enter = () => {
|
|
|
170228
170405
|
skip(rel2);
|
|
170229
170406
|
continue;
|
|
170230
170407
|
}
|
|
170231
|
-
file2(rel2.split(
|
|
170408
|
+
file2(rel2.split(sep16).join("/"), rel2);
|
|
170232
170409
|
}
|
|
170233
170410
|
};
|
|
170234
170411
|
walk4("");
|
|
@@ -170292,8 +170469,8 @@ function renderInputRootDirs(dir) {
|
|
|
170292
170469
|
}
|
|
170293
170470
|
function newestSourceChangeMs(dir) {
|
|
170294
170471
|
const roots2 = renderInputRootDirs(dir);
|
|
170295
|
-
const inRead = (hostRel) => !roots2 || roots2.has(hostRel.split(
|
|
170296
|
-
const counts = (hostRel) => !hostRel.includes(
|
|
170472
|
+
const inRead = (hostRel) => !roots2 || roots2.has(hostRel.split(sep16)[0]);
|
|
170473
|
+
const counts = (hostRel) => !hostRel.includes(sep16) || inRead(hostRel);
|
|
170297
170474
|
let newest = 0;
|
|
170298
170475
|
walkSourceTree(
|
|
170299
170476
|
dir,
|
|
@@ -170455,7 +170632,7 @@ function pruneEmptyDirs(root, rel2, needed, removed) {
|
|
|
170455
170632
|
let empty2 = true;
|
|
170456
170633
|
for (const name of readdirSync32(rel2 ? join50(root, rel2) : root)) {
|
|
170457
170634
|
const childRel = rel2 ? join50(rel2, name) : name;
|
|
170458
|
-
const posix5 = childRel.split(
|
|
170635
|
+
const posix5 = childRel.split(sep16).join("/");
|
|
170459
170636
|
const kind = lstatSync19(join50(root, childRel));
|
|
170460
170637
|
if (kind.isSymbolicLink() || !kind.isDirectory() || isDeniedSourceDir(name, rel2)) {
|
|
170461
170638
|
empty2 = false;
|
|
@@ -170539,9 +170716,9 @@ __export(run_watch_exports, {
|
|
|
170539
170716
|
watchedContentDir: () => watchedContentDir,
|
|
170540
170717
|
writeRunRecord: () => writeRunRecord
|
|
170541
170718
|
});
|
|
170542
|
-
import { closeSync as closeSync4, constants as constants3, existsSync as existsSync59, fstatSync, lstatSync as lstatSync20, statSync as statSync18, readdirSync as readdirSync33, mkdirSync as mkdirSync30, openSync as openSync4, readFileSync as readFileSync64, realpathSync as
|
|
170719
|
+
import { closeSync as closeSync4, constants as constants3, existsSync as existsSync59, fstatSync, lstatSync as lstatSync20, statSync as statSync18, readdirSync as readdirSync33, mkdirSync as mkdirSync30, openSync as openSync4, readFileSync as readFileSync64, realpathSync as realpathSync9, renameSync as renameSync12, rmSync as rmSync18, writeFileSync as writeFileSync25, watch as fsWatch } from "node:fs";
|
|
170543
170720
|
import { randomUUID as randomUUID9 } from "node:crypto";
|
|
170544
|
-
import { extname as extname4, join as join51, relative as relative12, resolve as resolve47, sep as
|
|
170721
|
+
import { extname as extname4, join as join51, relative as relative12, resolve as resolve47, sep as sep17 } from "node:path";
|
|
170545
170722
|
function diffReleases(prev, next) {
|
|
170546
170723
|
const bundles = Object.keys(next.bundles).filter((b3) => prev.bundles[b3]?.sha256 !== next.bundles[b3].sha256).sort();
|
|
170547
170724
|
const changedBundles = new Set(bundles);
|
|
@@ -170569,7 +170746,7 @@ function reloadEvents(d2) {
|
|
|
170569
170746
|
function hhpRasterDir(dir) {
|
|
170570
170747
|
const assets = findAssetsDir(dir);
|
|
170571
170748
|
if (!assets) return null;
|
|
170572
|
-
const rel2 = relative12(dir, assets).split(
|
|
170749
|
+
const rel2 = relative12(dir, assets).split(sep17).join("/");
|
|
170573
170750
|
return rel2 ? `${rel2}/hhp-raster` : "hhp-raster";
|
|
170574
170751
|
}
|
|
170575
170752
|
function ignoredChange(relPath, isDirectory = () => false, rasterDir = "assets/hhp-raster") {
|
|
@@ -170797,15 +170974,15 @@ function boardFile(dir, pathname) {
|
|
|
170797
170974
|
function readConfined(root, rel2) {
|
|
170798
170975
|
try {
|
|
170799
170976
|
if (!lstatSync20(root).isDirectory()) return null;
|
|
170800
|
-
const parts = rel2.split(
|
|
170977
|
+
const parts = rel2.split(sep17);
|
|
170801
170978
|
let at2 = root;
|
|
170802
170979
|
for (let i2 = 0; i2 < parts.length; i2++) {
|
|
170803
170980
|
at2 = join51(at2, parts[i2]);
|
|
170804
170981
|
const st2 = lstatSync20(at2);
|
|
170805
170982
|
if (st2.isSymbolicLink() || !(i2 === parts.length - 1 ? st2.isFile() : st2.isDirectory())) return null;
|
|
170806
170983
|
}
|
|
170807
|
-
const canonicalRoot =
|
|
170808
|
-
if (!
|
|
170984
|
+
const canonicalRoot = realpathSync9(root);
|
|
170985
|
+
if (!realpathSync9(at2).startsWith(canonicalRoot + sep17)) return null;
|
|
170809
170986
|
const fd = openSync4(at2, constants3.O_RDONLY | (constants3.O_NOFOLLOW ?? 0));
|
|
170810
170987
|
try {
|
|
170811
170988
|
if (!fstatSync(fd).isFile()) return null;
|
|
@@ -171424,13 +171601,13 @@ import { createHash as createHash32, randomUUID as randomUUID10 } from "node:cry
|
|
|
171424
171601
|
import { spawn as spawn4 } from "node:child_process";
|
|
171425
171602
|
import { closeSync as closeSync5, existsSync as existsSync61, lstatSync as lstatSync23, readFileSync as readFileSync69, statSync as statSync19 } from "node:fs";
|
|
171426
171603
|
import { createServer as createServer3 } from "node:net";
|
|
171427
|
-
import { basename as basename17, dirname as dirname36, isAbsolute as isAbsolute6, join as join56, relative as relative13, resolve as resolve48, sep as
|
|
171604
|
+
import { basename as basename17, dirname as dirname36, isAbsolute as isAbsolute6, join as join56, relative as relative13, resolve as resolve48, sep as sep18 } from "node:path";
|
|
171428
171605
|
function homeShotPath(dir, home2) {
|
|
171429
171606
|
const root = resolve48(dir);
|
|
171430
171607
|
const base2 = resolve48(root, ".himi", "shots");
|
|
171431
171608
|
const shot = resolve48(base2, `${home2}.png`);
|
|
171432
|
-
if (!shot.startsWith(base2 +
|
|
171433
|
-
for (let p2 = shot; p2 !== root && p2.startsWith(root +
|
|
171609
|
+
if (!shot.startsWith(base2 + sep18)) return null;
|
|
171610
|
+
for (let p2 = shot; p2 !== root && p2.startsWith(root + sep18); p2 = dirname36(p2)) {
|
|
171434
171611
|
try {
|
|
171435
171612
|
if (lstatSync23(p2).isSymbolicLink()) return null;
|
|
171436
171613
|
} catch {
|
|
@@ -181271,9 +181448,9 @@ function hostOf2(url) {
|
|
|
181271
181448
|
const m2 = /^[A-Za-z][A-Za-z0-9+.-]*:\/\/([^/?#]+)/.exec(url);
|
|
181272
181449
|
return m2 ? m2[1].toLowerCase() : null;
|
|
181273
181450
|
}
|
|
181274
|
-
function splitOnce(s5,
|
|
181275
|
-
const i2 = s5.indexOf(
|
|
181276
|
-
return i2 < 0 ? [s5, void 0] : [s5.slice(0, i2), s5.slice(i2 +
|
|
181451
|
+
function splitOnce(s5, sep31) {
|
|
181452
|
+
const i2 = s5.indexOf(sep31);
|
|
181453
|
+
return i2 < 0 ? [s5, void 0] : [s5.slice(0, i2), s5.slice(i2 + sep31.length)];
|
|
181277
181454
|
}
|
|
181278
181455
|
function stripLeadingSlashes(s5) {
|
|
181279
181456
|
return s5.replace(/^\/+/, "");
|
|
@@ -181975,7 +182152,7 @@ __export(eject_exports, {
|
|
|
181975
182152
|
ejectModule: () => ejectModule
|
|
181976
182153
|
});
|
|
181977
182154
|
import { existsSync as existsSync76, mkdirSync as mkdirSync33, readFileSync as readFileSync85, writeFileSync as writeFileSync30 } from "node:fs";
|
|
181978
|
-
import { dirname as dirname41, join as join72, relative as relative14, resolve as resolve53, sep as
|
|
182155
|
+
import { dirname as dirname41, join as join72, relative as relative14, resolve as resolve53, sep as sep19 } from "node:path";
|
|
181979
182156
|
function locate(repoRootOrCwd, mod) {
|
|
181980
182157
|
const inRepo = resolve53(repoRootOrCwd, `stdlib/flows/${mod}/src/index.ts`);
|
|
181981
182158
|
if (existsSync76(inRepo)) return { path: inRepo, form: "source" };
|
|
@@ -182028,7 +182205,7 @@ function ejectModule(opts) {
|
|
|
182028
182205
|
if (!existsSync76(f2)) continue;
|
|
182029
182206
|
const before = readFileSync85(f2, "utf8");
|
|
182030
182207
|
let after = before;
|
|
182031
|
-
let rel2 = relative14(dirname41(f2), target).split(
|
|
182208
|
+
let rel2 = relative14(dirname41(f2), target).split(sep19).join("/").replace(/\.tsx?$/, ".js");
|
|
182032
182209
|
if (!rel2.startsWith(".")) rel2 = `./${rel2}`;
|
|
182033
182210
|
for (const spec of specifiersFor(mod)) {
|
|
182034
182211
|
const q4 = spec.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -182210,7 +182387,7 @@ __export(icon_exports, {
|
|
|
182210
182387
|
});
|
|
182211
182388
|
import { createHash as createHash35 } from "node:crypto";
|
|
182212
182389
|
import { accessSync as accessSync3, constants as constants4, existsSync as existsSync77, mkdirSync as mkdirSync34, readFileSync as readFileSync86, statSync as statSync22, writeFileSync as writeFileSync31 } from "node:fs";
|
|
182213
|
-
import { basename as basename19, dirname as dirname42, join as join73, resolve as resolve54, sep as
|
|
182390
|
+
import { basename as basename19, dirname as dirname42, join as join73, resolve as resolve54, sep as sep20 } from "node:path";
|
|
182214
182391
|
function readManifest(dir) {
|
|
182215
182392
|
try {
|
|
182216
182393
|
return JSON.parse(readFileSync86(join73(dir, MANIFEST), "utf8"));
|
|
@@ -182227,7 +182404,7 @@ function declaredIconName(dir) {
|
|
|
182227
182404
|
function iconDest(dir, name) {
|
|
182228
182405
|
const base2 = resolve54(dir);
|
|
182229
182406
|
const abs = resolve54(base2, name);
|
|
182230
|
-
if (!abs.startsWith(base2 +
|
|
182407
|
+
if (!abs.startsWith(base2 + sep20)) {
|
|
182231
182408
|
throw new Error(
|
|
182232
182409
|
`himi icon: himalaya.content.json declares "icon": "${name}", which resolves outside the package (${abs}). Declare a path inside it, e.g. "${DEFAULT_CONTENT_ICON}".`
|
|
182233
182410
|
);
|
|
@@ -182588,8 +182765,8 @@ function baseOf(target, linkable, known2) {
|
|
|
182588
182765
|
let best = null;
|
|
182589
182766
|
for (const base2 of linkable ?? []) {
|
|
182590
182767
|
if (!known2.has(base2) || target.length <= base2.length + 1 || !target.startsWith(base2)) continue;
|
|
182591
|
-
const
|
|
182592
|
-
if ((
|
|
182768
|
+
const sep31 = target[base2.length];
|
|
182769
|
+
if ((sep31 === "_" || sep31 === "/") && (!best || base2.length > best.length)) best = base2;
|
|
182593
182770
|
}
|
|
182594
182771
|
return best;
|
|
182595
182772
|
}
|
|
@@ -182616,8 +182793,8 @@ __export(crawl_layers_exports, {
|
|
|
182616
182793
|
renderMocksFrom: () => renderMocksFrom,
|
|
182617
182794
|
tabRootScreens: () => tabRootScreens
|
|
182618
182795
|
});
|
|
182619
|
-
import { existsSync as existsSync79, readFileSync as readFileSync87, realpathSync as
|
|
182620
|
-
import { dirname as dirname43, join as join75, resolve as resolve55, sep as
|
|
182796
|
+
import { existsSync as existsSync79, readFileSync as readFileSync87, realpathSync as realpathSync10 } from "node:fs";
|
|
182797
|
+
import { dirname as dirname43, join as join75, resolve as resolve55, sep as sep21 } from "node:path";
|
|
182621
182798
|
async function loadContentConfigQuietly(dir) {
|
|
182622
182799
|
try {
|
|
182623
182800
|
return await loadAppConfigModule(dir);
|
|
@@ -182714,9 +182891,9 @@ async function l10nSourceCatalogFile(dir) {
|
|
|
182714
182891
|
const file2 = resolve55(l10nDir, `${tag}.json`);
|
|
182715
182892
|
if (!existsSync79(file2)) return null;
|
|
182716
182893
|
try {
|
|
182717
|
-
const realDir =
|
|
182718
|
-
const realFile =
|
|
182719
|
-
if (!realDir.startsWith(
|
|
182894
|
+
const realDir = realpathSync10(l10nDir);
|
|
182895
|
+
const realFile = realpathSync10(file2);
|
|
182896
|
+
if (!realDir.startsWith(realpathSync10(dir) + sep21) || dirname43(realFile) !== realDir) return null;
|
|
182720
182897
|
return { tag, text: readFileSync87(realFile, "utf8") };
|
|
182721
182898
|
} catch {
|
|
182722
182899
|
return null;
|
|
@@ -184387,7 +184564,7 @@ import {
|
|
|
184387
184564
|
existsSync as existsSync82,
|
|
184388
184565
|
lstatSync as lstatSync26,
|
|
184389
184566
|
mkdirSync as mkdirSync37,
|
|
184390
|
-
realpathSync as
|
|
184567
|
+
realpathSync as realpathSync11,
|
|
184391
184568
|
readlinkSync as readlinkSync2,
|
|
184392
184569
|
readFileSync as readFileSync92,
|
|
184393
184570
|
readdirSync as readdirSync38,
|
|
@@ -184454,7 +184631,7 @@ function currentGitDiffHash(contentDir2) {
|
|
|
184454
184631
|
}
|
|
184455
184632
|
function currentGitUntrackedHash(contentDir2) {
|
|
184456
184633
|
const unresolved = resolve60(contentDir2);
|
|
184457
|
-
const absolute =
|
|
184634
|
+
const absolute = realpathSync11.native(unresolved);
|
|
184458
184635
|
const root = repoRoot(absolute);
|
|
184459
184636
|
if (!root) return sourceTreeHash(absolute);
|
|
184460
184637
|
const scope3 = relative15(root, absolute) || ".";
|
|
@@ -186962,12 +187139,12 @@ var init_cli_bridge = __esm({
|
|
|
186962
187139
|
});
|
|
186963
187140
|
|
|
186964
187141
|
// src/mcp/file-tools.ts
|
|
186965
|
-
import { closeSync as closeSync7, constants as constants5, lstatSync as lstatSync27, mkdirSync as mkdirSync39, openSync as openSync6, readdirSync as readdirSync39, readFileSync as readFileSync100, realpathSync as
|
|
187142
|
+
import { closeSync as closeSync7, constants as constants5, lstatSync as lstatSync27, mkdirSync as mkdirSync39, openSync as openSync6, readdirSync as readdirSync39, readFileSync as readFileSync100, realpathSync as realpathSync12, renameSync as renameSync15, rmSync as rmSync22, statSync as statSync24, writeSync as writeSync2, existsSync as existsSync89 } from "node:fs";
|
|
186966
187143
|
import { randomBytes as randomBytes4 } from "node:crypto";
|
|
186967
|
-
import { dirname as dirname48, isAbsolute as isAbsolute9, join as join88, relative as relative17, resolve as resolve63, sep as
|
|
187144
|
+
import { dirname as dirname48, isAbsolute as isAbsolute9, join as join88, relative as relative17, resolve as resolve63, sep as sep22 } from "node:path";
|
|
186968
187145
|
import * as z2 from "zod";
|
|
186969
187146
|
function within(root, p2) {
|
|
186970
|
-
return p2 === root || p2.startsWith(root.endsWith(
|
|
187147
|
+
return p2 === root || p2.startsWith(root.endsWith(sep22) ? root : root + sep22);
|
|
186971
187148
|
}
|
|
186972
187149
|
function realish(p2) {
|
|
186973
187150
|
let cur = p2;
|
|
@@ -186975,14 +187152,14 @@ function realish(p2) {
|
|
|
186975
187152
|
while (!existsSync89(cur)) {
|
|
186976
187153
|
const up2 = dirname48(cur);
|
|
186977
187154
|
if (up2 === cur) break;
|
|
186978
|
-
tail.unshift(cur.slice(up2.length + (up2.endsWith(
|
|
187155
|
+
tail.unshift(cur.slice(up2.length + (up2.endsWith(sep22) ? 0 : 1)));
|
|
186979
187156
|
cur = up2;
|
|
186980
187157
|
}
|
|
186981
|
-
return join88(
|
|
187158
|
+
return join88(realpathSync12(cur), ...tail);
|
|
186982
187159
|
}
|
|
186983
187160
|
function symlinkComponent(base2, abs) {
|
|
186984
187161
|
let cur = base2;
|
|
186985
|
-
for (const part4 of relative17(base2, abs).split(
|
|
187162
|
+
for (const part4 of relative17(base2, abs).split(sep22).filter(Boolean)) {
|
|
186986
187163
|
cur = join88(cur, part4);
|
|
186987
187164
|
try {
|
|
186988
187165
|
if (lstatSync27(cur).isSymbolicLink()) return relative17(base2, cur);
|
|
@@ -186996,7 +187173,7 @@ function workspaceRefusal(root, target) {
|
|
|
186996
187173
|
const r3 = resolve63(root);
|
|
186997
187174
|
const t2 = resolve63(r3, target);
|
|
186998
187175
|
if (!existsSync89(r3)) return `the workspace folder ${r3} does not exist`;
|
|
186999
|
-
if (!within(r3, t2) || !within(
|
|
187176
|
+
if (!within(r3, t2) || !within(realpathSync12(r3), realish(t2))) return `"${target}" is outside the workspace folder ${r3}`;
|
|
187000
187177
|
const link3 = symlinkComponent(r3, t2);
|
|
187001
187178
|
if (link3) return `"${link3}" is a symlink \u2014 paths must stay in real folders inside the workspace`;
|
|
187002
187179
|
return null;
|
|
@@ -187005,7 +187182,7 @@ async function confinedAppDir(args, deps) {
|
|
|
187005
187182
|
const root = resolve63(await deps.defaultDir());
|
|
187006
187183
|
const dir = typeof args.dir === "string" && args.dir ? resolve63(root, args.dir) : root;
|
|
187007
187184
|
if (!existsSync89(root)) return refuse5("no_workspace", `the workspace folder ${root} does not exist`);
|
|
187008
|
-
if (!within(root, dir) || !within(
|
|
187185
|
+
if (!within(root, dir) || !within(realpathSync12(root), realish(dir))) return refuse5("outside_workspace", `"${String(args.dir)}" is outside the workspace folder`);
|
|
187009
187186
|
const link3 = symlinkComponent(root, dir);
|
|
187010
187187
|
if (link3) return refuse5("outside_workspace", `"${link3}" is a symlink \u2014 the app folder must be a real folder in the workspace`);
|
|
187011
187188
|
const rel2 = relative17(root, dir);
|
|
@@ -187021,16 +187198,16 @@ function onDiskSpelling(abs) {
|
|
|
187021
187198
|
while (!existsSync89(cur)) {
|
|
187022
187199
|
const up2 = dirname48(cur);
|
|
187023
187200
|
if (up2 === cur) break;
|
|
187024
|
-
tail.unshift(cur.slice(up2.length + (up2.endsWith(
|
|
187201
|
+
tail.unshift(cur.slice(up2.length + (up2.endsWith(sep22) ? 0 : 1)));
|
|
187025
187202
|
cur = up2;
|
|
187026
187203
|
}
|
|
187027
|
-
return join88(
|
|
187204
|
+
return join88(realpathSync12.native(cur), ...tail);
|
|
187028
187205
|
}
|
|
187029
187206
|
function denied(appDir3, abs) {
|
|
187030
187207
|
const rel2 = relative17(appDir3, abs);
|
|
187031
187208
|
if (isDeniedSourcePath(rel2) || isDeniedSourcePath(rel2.toLowerCase())) return true;
|
|
187032
187209
|
try {
|
|
187033
|
-
return isDeniedSourcePath(relative17(
|
|
187210
|
+
return isDeniedSourcePath(relative17(realpathSync12.native(appDir3), onDiskSpelling(abs)));
|
|
187034
187211
|
} catch {
|
|
187035
187212
|
return true;
|
|
187036
187213
|
}
|
|
@@ -187042,7 +187219,7 @@ function confinedPath(appDir3, rel2) {
|
|
|
187042
187219
|
const abs = resolve63(appDir3, rel2);
|
|
187043
187220
|
if (!within(appDir3, abs) || abs === appDir3) return { error: `"${rel2}" is outside the app folder` };
|
|
187044
187221
|
const real = realish(abs);
|
|
187045
|
-
const base2 = existsSync89(appDir3) ?
|
|
187222
|
+
const base2 = existsSync89(appDir3) ? realpathSync12(appDir3) : realish(appDir3);
|
|
187046
187223
|
if (!within(base2, real) || real === base2) return { error: `"${rel2}" is outside the app folder` };
|
|
187047
187224
|
const link3 = symlinkComponent(appDir3, abs);
|
|
187048
187225
|
if (link3) return { error: `"${link3}" is a symlink, which this tool does not follow` };
|
|
@@ -187061,7 +187238,7 @@ function writeNoFollow2(appDir3, abs, content) {
|
|
|
187061
187238
|
closeSync7(fd);
|
|
187062
187239
|
}
|
|
187063
187240
|
const link3 = symlinkComponent(appDir3, abs);
|
|
187064
|
-
if (link3 || !within(
|
|
187241
|
+
if (link3 || !within(realpathSync12(appDir3), realpathSync12(dirname48(abs)))) {
|
|
187065
187242
|
rmSync22(tmp, { force: true });
|
|
187066
187243
|
throw new Error(`"${link3 ?? relative17(appDir3, dirname48(abs))}" changed into a link while writing`);
|
|
187067
187244
|
}
|
|
@@ -187081,7 +187258,7 @@ function listFiles2(appDir3) {
|
|
|
187081
187258
|
const rel2 = relative17(appDir3, p2);
|
|
187082
187259
|
if (isDeniedSourcePath(rel2) || isDeniedSourcePath(rel2.toLowerCase())) continue;
|
|
187083
187260
|
if (files.length >= MAX_LISTED) return false;
|
|
187084
|
-
files.push({ path: rel2.split(
|
|
187261
|
+
files.push({ path: rel2.split(sep22).join("/"), bytes: statSync24(p2).size });
|
|
187085
187262
|
}
|
|
187086
187263
|
}
|
|
187087
187264
|
return true;
|
|
@@ -197812,7 +197989,7 @@ var init_dist2 = __esm({
|
|
|
197812
197989
|
|
|
197813
197990
|
// src/store-google-host.ts
|
|
197814
197991
|
import { createHash as createHash52, randomUUID as randomUUID14 } from "node:crypto";
|
|
197815
|
-
import { existsSync as existsSync91, lstatSync as lstatSync29, mkdirSync as mkdirSync40, readFileSync as readFileSync103, readdirSync as readdirSync41, realpathSync as
|
|
197992
|
+
import { existsSync as existsSync91, lstatSync as lstatSync29, mkdirSync as mkdirSync40, readFileSync as readFileSync103, readdirSync as readdirSync41, realpathSync as realpathSync13, renameSync as renameSync16, rmSync as rmSync23, statSync as statSync26, writeFileSync as writeFileSync36 } from "node:fs";
|
|
197816
197993
|
import { join as join103, relative as relative19 } from "node:path";
|
|
197817
197994
|
function readGooglePlayFacts(dir) {
|
|
197818
197995
|
const path2 = join103(dir, GOOGLE_FACTS_FILE);
|
|
@@ -197928,7 +198105,7 @@ async function googleAppFactsFor(dir, o2) {
|
|
|
197928
198105
|
const himi = packageName.toLowerCase().startsWith("himi.");
|
|
197929
198106
|
if (himi && !site) note(`Signing: ${packageName} is a Containers (himi.*) package, which Wix builds and signs for a site-linked app, but this app names no Wix site (a "wix" block in ${GOOGLE_FACTS_FILE} or ${STORE_FACTS_FILE}). Link it (\`himi store app set --app <id> --site <msid> --android-package ${packageName}\`) and add the wix block, or use your own package name.`);
|
|
197930
198107
|
if (!himi && site) note(`Signing: this app is linked to Wix site ${site.site}, so Wix signs its bundle under a himi.<name> package; ${packageName} is not one. Set packageName to the site's saved himi.<name> package (\`himi store app show --app ${site.app} --site ${site.site}\`), or drop the wix block for an owner-signed app.`);
|
|
197931
|
-
const realDir =
|
|
198108
|
+
const realDir = realpathSync13(dir);
|
|
197932
198109
|
const files = {};
|
|
197933
198110
|
const given = (key4) => {
|
|
197934
198111
|
const p2 = str7(file2[key4]);
|
|
@@ -214102,7 +214279,7 @@ function realPathOf2(path2) {
|
|
|
214102
214279
|
d2 = dirname56(d2);
|
|
214103
214280
|
}
|
|
214104
214281
|
try {
|
|
214105
|
-
return join110(
|
|
214282
|
+
return join110(realpathSync14(d2), ...rest);
|
|
214106
214283
|
} catch {
|
|
214107
214284
|
return resolve70(path2);
|
|
214108
214285
|
}
|
|
@@ -214165,13 +214342,13 @@ function reserveKeyFile(dir, keyId) {
|
|
|
214165
214342
|
}
|
|
214166
214343
|
};
|
|
214167
214344
|
}
|
|
214168
|
-
var createPrivateKey6, closeSync8, existsSync93, mkdirSync42, openSync7,
|
|
214345
|
+
var createPrivateKey6, closeSync8, existsSync93, mkdirSync42, openSync7, realpathSync14, statSync28, unlinkSync7, writeSync3, basename25, dirname56, isAbsolute11, join110, resolve70, TEAM_KEY_ROLES, DOWNLOAD_ATTEMPTS, ApiKeysApi;
|
|
214169
214346
|
var init_api_keys = __esm({
|
|
214170
214347
|
"../../node_modules/@wix/asc-web/dist/api-keys.js"() {
|
|
214171
214348
|
init_define_HHP_CATALOG();
|
|
214172
214349
|
init_dist3();
|
|
214173
214350
|
({ createPrivateKey: createPrivateKey6 } = __ascBuiltin040);
|
|
214174
|
-
({ closeSync: closeSync8, existsSync: existsSync93, mkdirSync: mkdirSync42, openSync: openSync7, realpathSync:
|
|
214351
|
+
({ closeSync: closeSync8, existsSync: existsSync93, mkdirSync: mkdirSync42, openSync: openSync7, realpathSync: realpathSync14, statSync: statSync28, unlinkSync: unlinkSync7, writeSync: writeSync3 } = __ascBuiltin125);
|
|
214175
214352
|
({ basename: basename25, dirname: dirname56, isAbsolute: isAbsolute11, join: join110, resolve: resolve70 } = __ascBuiltin213);
|
|
214176
214353
|
TEAM_KEY_ROLES = ["ADMIN", "APP_MANAGER", "DEVELOPER", "FINANCE", "SALES", "MARKETING", "ACCESS_TO_REPORTS", "CUSTOMER_SUPPORT", "CREATE_APPS", "CLOUD_MANAGED_APP_DISTRIBUTION", "CLOUD_MANAGED_DEVELOPER_ID"];
|
|
214177
214354
|
DOWNLOAD_ATTEMPTS = 3;
|
|
@@ -226067,7 +226244,7 @@ function fileRoots(env) {
|
|
|
226067
226244
|
const roots2 = [process.cwd(), ...(env.ASC_MCP_FILE_ROOTS ?? "").split(delimiter3)].map((r3) => r3.trim()).filter(Boolean);
|
|
226068
226245
|
return [...new Set(roots2.flatMap((r3) => {
|
|
226069
226246
|
try {
|
|
226070
|
-
return [
|
|
226247
|
+
return [realpathSync15(resolve77(r3))];
|
|
226071
226248
|
} catch {
|
|
226072
226249
|
return [];
|
|
226073
226250
|
}
|
|
@@ -226080,7 +226257,7 @@ function checkJobFile(path2, param, ctx, o2 = {}) {
|
|
|
226080
226257
|
const given = resolve77(roots2[0] ?? process.cwd(), path2);
|
|
226081
226258
|
let real;
|
|
226082
226259
|
try {
|
|
226083
|
-
real =
|
|
226260
|
+
real = realpathSync15(given);
|
|
226084
226261
|
} catch (e2) {
|
|
226085
226262
|
throw new AscError("invalid", `${param}: cannot read ${path2} (${e2.code ?? "unreadable"})`);
|
|
226086
226263
|
}
|
|
@@ -226089,7 +226266,7 @@ function checkJobFile(path2, param, ctx, o2 = {}) {
|
|
|
226089
226266
|
throw new AscError("invalid", `${param}: ${path2} is not a ${o2.directory ? "directory" : "regular file"}`);
|
|
226090
226267
|
let state;
|
|
226091
226268
|
try {
|
|
226092
|
-
state =
|
|
226269
|
+
state = realpathSync15(ctx.stateDir);
|
|
226093
226270
|
} catch {
|
|
226094
226271
|
state = void 0;
|
|
226095
226272
|
}
|
|
@@ -226288,7 +226465,7 @@ ${o2.detail}` : ""}` };
|
|
|
226288
226465
|
function enabledTools(env, o2 = {}) {
|
|
226289
226466
|
return TOOLS.filter((t2) => !t2.write || env.ASC_MCP_WRITE === "1" || o2.approvals === true);
|
|
226290
226467
|
}
|
|
226291
|
-
var mkdirSync47, readFileSync116,
|
|
226468
|
+
var mkdirSync47, readFileSync116, realpathSync15, statSync36, writeFileSync42, delimiter3, isAbsolute13, join119, relative20, resolve77, sep23, READ, PLAN, APPLY, BATCH_SUMMARY_LINES, BATCH_CHANGES_PER_LINE, BATCH_CHANGE_LINES, ok2, app, reads, jobView2, noAppleId, EXIT_KINDS, notesOf2, cliResult, flag2, ACTIONS, FAMILIES, inside2, identityFile, appleIdParam, TOOLS;
|
|
226292
226469
|
var init_tools2 = __esm({
|
|
226293
226470
|
"../../node_modules/@wix/asc-mcp/dist/tools.js"() {
|
|
226294
226471
|
init_define_HHP_CATALOG();
|
|
@@ -226298,8 +226475,8 @@ var init_tools2 = __esm({
|
|
|
226298
226475
|
init_dist6();
|
|
226299
226476
|
init_dist7();
|
|
226300
226477
|
init_action_catalog_generated();
|
|
226301
|
-
({ mkdirSync: mkdirSync47, readFileSync: readFileSync116, realpathSync:
|
|
226302
|
-
({ delimiter: delimiter3, isAbsolute: isAbsolute13, join: join119, relative: relative20, resolve: resolve77, sep:
|
|
226478
|
+
({ mkdirSync: mkdirSync47, readFileSync: readFileSync116, realpathSync: realpathSync15, statSync: statSync36, writeFileSync: writeFileSync42 } = __ascBuiltin063);
|
|
226479
|
+
({ delimiter: delimiter3, isAbsolute: isAbsolute13, join: join119, relative: relative20, resolve: resolve77, sep: sep23 } = __ascBuiltin140);
|
|
226303
226480
|
READ = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true };
|
|
226304
226481
|
PLAN = { readOnlyHint: true, destructiveHint: false, idempotentHint: false, openWorldHint: true };
|
|
226305
226482
|
APPLY = { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true };
|
|
@@ -226356,7 +226533,7 @@ var init_tools2 = __esm({
|
|
|
226356
226533
|
};
|
|
226357
226534
|
inside2 = (root, path2) => {
|
|
226358
226535
|
const rel2 = relative20(root, path2);
|
|
226359
|
-
return rel2 !== ".." && !rel2.startsWith(`..${
|
|
226536
|
+
return rel2 !== ".." && !rel2.startsWith(`..${sep23}`) && !isAbsolute13(rel2);
|
|
226360
226537
|
};
|
|
226361
226538
|
identityFile = (ctx, jobId) => join119(ctx.stateDir, "mcp", "web-jobs", `${jobId.replace(/[^A-Za-z0-9_-]/g, "_")}.json`);
|
|
226362
226539
|
appleIdParam = z5.string().optional().describe("The signed-in Apple ID; default ASC_APPLE_ID. Never a password: a person signs in at a terminal with asc-node web auth login.");
|
|
@@ -228091,14 +228268,14 @@ __export(apple_keys_exports, {
|
|
|
228091
228268
|
runAppleKeys: () => runAppleKeys
|
|
228092
228269
|
});
|
|
228093
228270
|
import { createPublicKey as createPublicKey5 } from "node:crypto";
|
|
228094
|
-
import { readFileSync as readFileSync117, realpathSync as
|
|
228271
|
+
import { readFileSync as readFileSync117, realpathSync as realpathSync16, statSync as statSync37 } from "node:fs";
|
|
228095
228272
|
function readKey2(flags, kind) {
|
|
228096
228273
|
const names2 = kind === "asc" ? ["asc-key-file", "asc-key-id", "asc-issuer-id"] : ["iap-key", "iap-key-id", "iap-issuer-id"];
|
|
228097
228274
|
if (names2.every((name) => flags[name] === void 0)) return void 0;
|
|
228098
228275
|
const [file2, keyId, issuerId] = names2.map((name) => text14(flags[name]));
|
|
228099
228276
|
if (!file2 || !keyId || !issuerId) throw new UsageError2(`Supply --${names2.join(" --")} together.`);
|
|
228100
228277
|
try {
|
|
228101
|
-
const path2 =
|
|
228278
|
+
const path2 = realpathSync16(file2);
|
|
228102
228279
|
assertCredentialOutsideRepo(names2[0], path2);
|
|
228103
228280
|
if (statSync37(path2).size > 16384) throw new Error("oversized");
|
|
228104
228281
|
const key4 = { keyId, issuerId, key: readFileSync117(path2, "utf8") };
|
|
@@ -228277,9 +228454,9 @@ __export(store_host_exports, {
|
|
|
228277
228454
|
wixTargetOf: () => wixTargetOf
|
|
228278
228455
|
});
|
|
228279
228456
|
import { spawn as spawn7 } from "node:child_process";
|
|
228280
|
-
import { existsSync as existsSync96, lstatSync as lstatSync32, readFileSync as readFileSync118, realpathSync as
|
|
228457
|
+
import { existsSync as existsSync96, lstatSync as lstatSync32, readFileSync as readFileSync118, realpathSync as realpathSync17 } from "node:fs";
|
|
228281
228458
|
import { hostname as hostname5, userInfo as userInfo3 } from "node:os";
|
|
228282
|
-
import { delimiter as delimiter4, dirname as dirname58, isAbsolute as isAbsolute14, join as join120, relative as relative21, resolve as resolve78, sep as
|
|
228459
|
+
import { delimiter as delimiter4, dirname as dirname58, isAbsolute as isAbsolute14, join as join120, relative as relative21, resolve as resolve78, sep as sep24 } from "node:path";
|
|
228283
228460
|
function storeNodeRefusal(version5 = process.versions.node) {
|
|
228284
228461
|
const major = Number(version5.split(".")[0]);
|
|
228285
228462
|
return Number.isFinite(major) && major >= STORE_MIN_NODE_MAJOR ? void 0 : `App Store submission needs Node ${STORE_MIN_NODE_MAJOR} or newer (this is Node ${version5}). Install a current Node, then run the command again.`;
|
|
@@ -228351,7 +228528,7 @@ function appDirFor(appRef2, root, exists2 = existsSync96) {
|
|
|
228351
228528
|
const base2 = resolve78(root);
|
|
228352
228529
|
const ref = appRef2.trim();
|
|
228353
228530
|
const dir = !ref || ref === "." ? base2 : isAbsolute14(ref) ? resolve78(ref) : resolve78(base2, ref);
|
|
228354
|
-
const inside4 = dir === base2 || dir.startsWith(base2.endsWith(
|
|
228531
|
+
const inside4 = dir === base2 || dir.startsWith(base2.endsWith(sep24) ? base2 : base2 + sep24);
|
|
228355
228532
|
if (inside4 && ["config.ts", "config.js", "config.mjs", STORE_FACTS_FILE].some((f2) => exists2(join120(dir, f2)))) return dir;
|
|
228356
228533
|
throw new StoreFactsError(
|
|
228357
228534
|
!ref || ref === "." ? `no Himi app in ${base2} (no config.ts or ${STORE_FACTS_FILE}): run from the app's folder or name it (--dir, or the tool's app)` : `no Himi app "${appRef2}" under ${base2}: name the app's folder (where config.ts is), inside the workspace`,
|
|
@@ -228410,13 +228587,13 @@ function privacyAnswersFor(dir, ownerPath, shellOnly, checked, deps, note) {
|
|
|
228410
228587
|
function ownerAnswers(dir, ownerPath, deps, note, rel2, render3) {
|
|
228411
228588
|
let real;
|
|
228412
228589
|
try {
|
|
228413
|
-
real =
|
|
228590
|
+
real = realpathSync17(ownerPath);
|
|
228414
228591
|
} catch {
|
|
228415
228592
|
note(`App Privacy: could not read ${rel2(ownerPath)} to check it against the Himi app's own answers.`);
|
|
228416
228593
|
return ownerPath;
|
|
228417
228594
|
}
|
|
228418
|
-
const realDir =
|
|
228419
|
-
if (real !== realDir && !real.startsWith(realDir +
|
|
228595
|
+
const realDir = realpathSync17(dir);
|
|
228596
|
+
if (real !== realDir && !real.startsWith(realDir + sep24)) {
|
|
228420
228597
|
throw new StoreFactsError(`privacyAnswersFile must be inside the app folder; ${rel2(ownerPath)} is not`, "store_facts_invalid");
|
|
228421
228598
|
}
|
|
228422
228599
|
let raw;
|
|
@@ -228452,16 +228629,16 @@ function factPathIn(dir, realDir, key4, p2, file2 = STORE_FACTS_FILE) {
|
|
|
228452
228629
|
if (isAbsolute14(p2)) throw refuse9();
|
|
228453
228630
|
const base2 = resolve78(dir);
|
|
228454
228631
|
const path2 = resolve78(base2, p2);
|
|
228455
|
-
if (path2 === base2 || !path2.startsWith(base2 +
|
|
228632
|
+
if (path2 === base2 || !path2.startsWith(base2 + sep24)) throw refuse9();
|
|
228456
228633
|
let probe2 = path2;
|
|
228457
228634
|
while (!existsSync96(probe2) && probe2 !== base2) probe2 = dirname58(probe2);
|
|
228458
228635
|
let real;
|
|
228459
228636
|
try {
|
|
228460
|
-
real =
|
|
228637
|
+
real = realpathSync17(probe2);
|
|
228461
228638
|
} catch {
|
|
228462
228639
|
throw refuse9();
|
|
228463
228640
|
}
|
|
228464
|
-
if (real !== realDir && !real.startsWith(realDir +
|
|
228641
|
+
if (real !== realDir && !real.startsWith(realDir + sep24)) throw refuse9();
|
|
228465
228642
|
return path2;
|
|
228466
228643
|
}
|
|
228467
228644
|
async function appFactsFor(dir, deps) {
|
|
@@ -228499,7 +228676,7 @@ async function appFactsFor(dir, deps) {
|
|
|
228499
228676
|
...str8(file2.sku) ? { sku: str8(file2.sku) } : {},
|
|
228500
228677
|
...str8(file2.buildNumber) ? { buildNumber: str8(file2.buildNumber) } : {}
|
|
228501
228678
|
};
|
|
228502
|
-
const realDir =
|
|
228679
|
+
const realDir = realpathSync17(dir);
|
|
228503
228680
|
for (const key4 of FILE_FACTS) {
|
|
228504
228681
|
const p2 = str8(file2[key4]);
|
|
228505
228682
|
if (p2) facts[key4] = factPathIn(dir, realDir, key4, p2);
|
|
@@ -229500,8 +229677,8 @@ __export(browser_authoring_exports, {
|
|
|
229500
229677
|
});
|
|
229501
229678
|
import { createServer as createServer6 } from "node:http";
|
|
229502
229679
|
import { createHash as createHash66, randomBytes as randomBytes17 } from "node:crypto";
|
|
229503
|
-
import { existsSync as existsSync101, readdirSync as readdirSync47, readFileSync as readFileSync122, realpathSync as
|
|
229504
|
-
import { join as join127, posix as posix3, relative as relative23, sep as
|
|
229680
|
+
import { existsSync as existsSync101, readdirSync as readdirSync47, readFileSync as readFileSync122, realpathSync as realpathSync18, statSync as statSync38 } from "node:fs";
|
|
229681
|
+
import { join as join127, posix as posix3, relative as relative23, sep as sep25 } from "node:path";
|
|
229505
229682
|
function humanMs(ms2) {
|
|
229506
229683
|
return ms2 < 1e3 ? `${ms2}ms` : `${Math.round(ms2 / 1e3)}s`;
|
|
229507
229684
|
}
|
|
@@ -229510,7 +229687,7 @@ function collectWorkerSources(tier5SrcDir, bundleName) {
|
|
|
229510
229687
|
const files = {};
|
|
229511
229688
|
const visitedDirs = /* @__PURE__ */ new Set();
|
|
229512
229689
|
const walk4 = (abs, rel2) => {
|
|
229513
|
-
const real =
|
|
229690
|
+
const real = realpathSync18(abs);
|
|
229514
229691
|
if (visitedDirs.has(real)) return;
|
|
229515
229692
|
visitedDirs.add(real);
|
|
229516
229693
|
for (const name of readdirSync47(abs).sort()) {
|
|
@@ -229551,7 +229728,7 @@ function collectRelativeSiblings(files, tier5SrcDir) {
|
|
|
229551
229728
|
];
|
|
229552
229729
|
for (const abs of candidates) {
|
|
229553
229730
|
if (!existsSync101(abs) || statSync38(abs).isDirectory()) continue;
|
|
229554
|
-
const key4 = `/tier5-src/${relative23(tier5SrcDir, abs).split(
|
|
229731
|
+
const key4 = `/tier5-src/${relative23(tier5SrcDir, abs).split(sep25).join(posix3.sep)}`;
|
|
229555
229732
|
if (key4 in files) break;
|
|
229556
229733
|
files[key4] = readFileSync122(abs, "utf8");
|
|
229557
229734
|
queue.push(key4);
|
|
@@ -231610,7 +231787,7 @@ __export(shot_files_exports, {
|
|
|
231610
231787
|
});
|
|
231611
231788
|
import { createHash as createHash69 } from "node:crypto";
|
|
231612
231789
|
import { mkdirSync as mkdirSync52, readdirSync as readdirSync48, readFileSync as readFileSync126, rmSync as rmSync27, statSync as statSync40 } from "node:fs";
|
|
231613
|
-
import { basename as basename31, dirname as dirname61, join as join131, relative as relative24, resolve as resolve84, sep as
|
|
231790
|
+
import { basename as basename31, dirname as dirname61, join as join131, relative as relative24, resolve as resolve84, sep as sep26 } from "node:path";
|
|
231614
231791
|
function writeAtomic2(file2, bytes2) {
|
|
231615
231792
|
for (let attempt2 = 0; ; attempt2++) {
|
|
231616
231793
|
mkdirSync52(dirname61(file2), { recursive: true });
|
|
@@ -231635,7 +231812,7 @@ function writeScreenShot(dir, screenId, base64) {
|
|
|
231635
231812
|
function inside3(base2, rel2) {
|
|
231636
231813
|
const root = resolve84(base2);
|
|
231637
231814
|
const p2 = resolve84(root, rel2);
|
|
231638
|
-
return p2.startsWith(root +
|
|
231815
|
+
return p2.startsWith(root + sep26) ? p2 : null;
|
|
231639
231816
|
}
|
|
231640
231817
|
function pruneRenders(dir, opts = {}) {
|
|
231641
231818
|
try {
|
|
@@ -231698,7 +231875,7 @@ function pruneStaleShots(dir, keepScreenIds, now = Date.now()) {
|
|
|
231698
231875
|
if (mtime !== null && now - mtime >= STALE_TMP_MS) rmSync27(f2, { force: true });
|
|
231699
231876
|
continue;
|
|
231700
231877
|
}
|
|
231701
|
-
const screenId = relative24(root, f2).split(
|
|
231878
|
+
const screenId = relative24(root, f2).split(sep26).join("/").replace(/\.png$/, "");
|
|
231702
231879
|
if (!keepScreenIds.has(screenId)) rmSync27(f2, { force: true });
|
|
231703
231880
|
}
|
|
231704
231881
|
}
|
|
@@ -235184,8 +235361,8 @@ __export(validate_design_exports, {
|
|
|
235184
235361
|
validateDesign: () => validateDesign
|
|
235185
235362
|
});
|
|
235186
235363
|
import { randomBytes as randomBytes18 } from "node:crypto";
|
|
235187
|
-
import { closeSync as closeSync11, constants as constants9, existsSync as existsSync110, lstatSync as lstatSync33, openSync as openSync10, readFileSync as readFileSync133, realpathSync as
|
|
235188
|
-
import { dirname as dirname63, isAbsolute as isAbsolute16, join as join139, relative as relative25, resolve as resolve87, sep as
|
|
235364
|
+
import { closeSync as closeSync11, constants as constants9, existsSync as existsSync110, lstatSync as lstatSync33, openSync as openSync10, readFileSync as readFileSync133, realpathSync as realpathSync19, renameSync as renameSync19, unlinkSync as unlinkSync9, writeFileSync as writeFileSync50 } from "node:fs";
|
|
235365
|
+
import { dirname as dirname63, isAbsolute as isAbsolute16, join as join139, relative as relative25, resolve as resolve87, sep as sep27, win32 } from "node:path";
|
|
235189
235366
|
import ts19 from "typescript";
|
|
235190
235367
|
function readColorToken(tokens2, name) {
|
|
235191
235368
|
const entry = obj5(tokens2.colors)?.[name];
|
|
@@ -235407,14 +235584,14 @@ function writableTokensPath(contentDir2, location) {
|
|
|
235407
235584
|
if (isAbsolute16(location) || win32.isAbsolute(location) || location.split(/[\\/]/).includes("..")) {
|
|
235408
235585
|
throw new Error("--fix requires a token path inside the content directory without traversal.");
|
|
235409
235586
|
}
|
|
235410
|
-
const root =
|
|
235587
|
+
const root = realpathSync19(contentDir2);
|
|
235411
235588
|
const path2 = resolve87(root, location);
|
|
235412
235589
|
const rel2 = relative25(root, path2);
|
|
235413
|
-
if (!rel2 || rel2 === ".." || rel2.startsWith(`..${
|
|
235590
|
+
if (!rel2 || rel2 === ".." || rel2.startsWith(`..${sep27}`) || isAbsolute16(rel2)) {
|
|
235414
235591
|
throw new Error("--fix requires a token path inside the content directory.");
|
|
235415
235592
|
}
|
|
235416
235593
|
let current = root;
|
|
235417
|
-
const parts = rel2.split(
|
|
235594
|
+
const parts = rel2.split(sep27);
|
|
235418
235595
|
for (const [index, part4] of parts.entries()) {
|
|
235419
235596
|
current = join139(current, part4);
|
|
235420
235597
|
const stat9 = lstatSync33(current);
|
|
@@ -235422,8 +235599,8 @@ function writableTokensPath(contentDir2, location) {
|
|
|
235422
235599
|
throw new Error("--fix requires a regular token file under directories without symlinks.");
|
|
235423
235600
|
}
|
|
235424
235601
|
}
|
|
235425
|
-
const real = relative25(root,
|
|
235426
|
-
if (!real || real === ".." || real.startsWith(`..${
|
|
235602
|
+
const real = relative25(root, realpathSync19(path2));
|
|
235603
|
+
if (!real || real === ".." || real.startsWith(`..${sep27}`) || isAbsolute16(real)) {
|
|
235427
235604
|
throw new Error("--fix cannot write outside the content directory.");
|
|
235428
235605
|
}
|
|
235429
235606
|
return path2;
|
|
@@ -235619,11 +235796,11 @@ function validateDesign(evidenceDir, contentDir2, options2 = {}) {
|
|
|
235619
235796
|
};
|
|
235620
235797
|
}
|
|
235621
235798
|
function safeEvidencePath(contentDir2, name) {
|
|
235622
|
-
const root =
|
|
235799
|
+
const root = realpathSync19(contentDir2);
|
|
235623
235800
|
const dir = realDirIn(root, ".himi/one-app");
|
|
235624
235801
|
if (!dir) throw new Error("The design evidence directory is not a regular directory.");
|
|
235625
|
-
const real = relative25(root,
|
|
235626
|
-
if (!real || real === ".." || real.startsWith(`..${
|
|
235802
|
+
const real = relative25(root, realpathSync19(dir));
|
|
235803
|
+
if (!real || real === ".." || real.startsWith(`..${sep27}`) || isAbsolute16(real)) {
|
|
235627
235804
|
throw new Error("The design evidence directory is outside the content directory.");
|
|
235628
235805
|
}
|
|
235629
235806
|
const path2 = join139(dir, name);
|
|
@@ -243673,7 +243850,7 @@ var init_credential_profile = __esm({
|
|
|
243673
243850
|
|
|
243674
243851
|
// ../store-release/iap-credentials.ts
|
|
243675
243852
|
import { createHash as createHash75 } from "node:crypto";
|
|
243676
|
-
import { existsSync as existsSync119, readFileSync as readFileSync144, realpathSync as
|
|
243853
|
+
import { existsSync as existsSync119, readFileSync as readFileSync144, realpathSync as realpathSync20 } from "node:fs";
|
|
243677
243854
|
import { homedir as homedir17 } from "node:os";
|
|
243678
243855
|
function accountFingerprint(keyId, issuerId) {
|
|
243679
243856
|
return `sha256:${createHash75("sha256").update(`${issuerId}:${keyId}`).digest("hex").slice(0, 16)}`;
|
|
@@ -243711,7 +243888,7 @@ function resolveIapCredentials(options2) {
|
|
|
243711
243888
|
const { target } = options2;
|
|
243712
243889
|
const home2 = options2.home ?? homedir17();
|
|
243713
243890
|
const readFile21 = options2.readFile ?? ((p2) => readFileSync144(p2, "utf8"));
|
|
243714
|
-
const realpath2 = options2.realpath ??
|
|
243891
|
+
const realpath2 = options2.realpath ?? realpathSync20;
|
|
243715
243892
|
const profile = requireExplicitProfile(options2.profileFlag, target);
|
|
243716
243893
|
const creds = resolveStoreCredentials({
|
|
243717
243894
|
app: target.himiApp,
|
|
@@ -245130,7 +245307,7 @@ __export(store_iap_exports, {
|
|
|
245130
245307
|
});
|
|
245131
245308
|
import { execFileSync as execFileSync8 } from "node:child_process";
|
|
245132
245309
|
import { randomUUID as randomUUID17 } from "node:crypto";
|
|
245133
|
-
import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync56, readFileSync as readFileSync147, realpathSync as
|
|
245310
|
+
import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync56, readFileSync as readFileSync147, realpathSync as realpathSync21, renameSync as renameSync22, rmSync as rmSync35, writeFileSync as writeFileSync52 } from "node:fs";
|
|
245134
245311
|
import { homedir as homedir18, hostname as hostname6 } from "node:os";
|
|
245135
245312
|
import { dirname as dirname67, join as join153, resolve as resolve97 } from "node:path";
|
|
245136
245313
|
function scrubDeep(value2, scrub) {
|
|
@@ -245530,7 +245707,7 @@ function readInAppPurchaseKey(flags, deps, creds) {
|
|
|
245530
245707
|
if (!/^[A-Z0-9]{10}$/.test(keyId)) throw new UsageError7(`--iap-key-id must be the 10-character key id App Store Connect shows, got "${keyId}"`);
|
|
245531
245708
|
let privateKey2;
|
|
245532
245709
|
try {
|
|
245533
|
-
assertCredentialOutsideRepo("--iap-key", (deps.realpath ??
|
|
245710
|
+
assertCredentialOutsideRepo("--iap-key", (deps.realpath ?? realpathSync21)(path2));
|
|
245534
245711
|
privateKey2 = readInput2(deps, path2, "In-App Purchase key");
|
|
245535
245712
|
} catch (error) {
|
|
245536
245713
|
throw new KeyError(error.message);
|
|
@@ -251408,7 +251585,7 @@ var init_analyze = __esm({
|
|
|
251408
251585
|
|
|
251409
251586
|
// src/base44-analyze/write-artifacts.ts
|
|
251410
251587
|
import { existsSync as existsSync134, mkdirSync as mkdirSync61, readFileSync as readFileSync163, rmSync as rmSync38, writeFileSync as writeFileSync62 } from "node:fs";
|
|
251411
|
-
import { dirname as dirname76, join as join169, resolve as resolve104, sep as
|
|
251588
|
+
import { dirname as dirname76, join as join169, resolve as resolve104, sep as sep28 } from "node:path";
|
|
251412
251589
|
function isBookFolder(dir) {
|
|
251413
251590
|
try {
|
|
251414
251591
|
return JSON.parse(readFileSync163(join169(dir, "book.json"), "utf8")).kind === "base44-app-book";
|
|
@@ -251516,7 +251693,7 @@ function writeBase44Book(result, outDir, opts = {}) {
|
|
|
251516
251693
|
for (const f2 of result.sourceFiles) {
|
|
251517
251694
|
if (!safeRel(f2.path)) continue;
|
|
251518
251695
|
const dest = join169(sourceRoot, ...f2.path.split("/"));
|
|
251519
|
-
if (!dest.startsWith(sourceRoot +
|
|
251696
|
+
if (!dest.startsWith(sourceRoot + sep28)) continue;
|
|
251520
251697
|
mkdirSync61(dirname76(dest), { recursive: true });
|
|
251521
251698
|
writeFileSync62(dest, f2.bytes);
|
|
251522
251699
|
}
|
|
@@ -259783,7 +259960,7 @@ __export(cli_exports2, {
|
|
|
259783
259960
|
ONE_APP_WORKFLOW: () => ONE_APP_WORKFLOW,
|
|
259784
259961
|
runOneAppCommand: () => runOneAppCommand
|
|
259785
259962
|
});
|
|
259786
|
-
import { closeSync as closeSync13, constants as constants12, lstatSync as lstatSync37, mkdirSync as mkdirSync64, openSync as openSync12, readFileSync as readFileSync172, realpathSync as
|
|
259963
|
+
import { closeSync as closeSync13, constants as constants12, lstatSync as lstatSync37, mkdirSync as mkdirSync64, openSync as openSync12, readFileSync as readFileSync172, realpathSync as realpathSync23, writeFileSync as writeFileSync69 } from "node:fs";
|
|
259787
259964
|
import { createHash as createHash89 } from "node:crypto";
|
|
259788
259965
|
import { isIP as isIP2 } from "node:net";
|
|
259789
259966
|
import { dirname as dirname78, join as join180, parse as parse8, resolve as resolve113 } from "node:path";
|
|
@@ -260030,7 +260207,7 @@ validate-payments checks site-bound payment evidence and explicit paid-flow deci
|
|
|
260030
260207
|
mkdirSync64(options2.parentDir, { recursive: true, mode: 448 });
|
|
260031
260208
|
assertSafeParents(options2.parentDir);
|
|
260032
260209
|
mkdirSync64(options2.workspace, { mode: 448 });
|
|
260033
|
-
if (
|
|
260210
|
+
if (realpathSync23(options2.workspace) !== options2.workspace) throw new Error("destination changed");
|
|
260034
260211
|
evidenceDir = join180(options2.workspace, ".himi", "one-app");
|
|
260035
260212
|
mkdirSync64(evidenceDir, { recursive: true, mode: 448 });
|
|
260036
260213
|
} catch (error) {
|
|
@@ -262349,8 +262526,8 @@ var init_customer_build = __esm({
|
|
|
262349
262526
|
});
|
|
262350
262527
|
|
|
262351
262528
|
// src/site-analyze/apply.ts
|
|
262352
|
-
import { existsSync as existsSync144, readFileSync as readFileSync174, writeFileSync as writeFileSync70, copyFileSync as copyFileSync2, mkdirSync as mkdirSync65, realpathSync as
|
|
262353
|
-
import { dirname as dirname79, isAbsolute as isAbsolute17, join as join182, resolve as resolve114, sep as
|
|
262529
|
+
import { existsSync as existsSync144, readFileSync as readFileSync174, writeFileSync as writeFileSync70, copyFileSync as copyFileSync2, mkdirSync as mkdirSync65, realpathSync as realpathSync24, statSync as statSync49 } from "node:fs";
|
|
262530
|
+
import { dirname as dirname79, isAbsolute as isAbsolute17, join as join182, resolve as resolve114, sep as sep29 } from "node:path";
|
|
262354
262531
|
import { spawnSync as spawnSync11 } from "node:child_process";
|
|
262355
262532
|
function inRepoBakeRefusal(repoRoot2, shell) {
|
|
262356
262533
|
if (isBrandable(repoRoot2, shell)) return null;
|
|
@@ -262542,7 +262719,7 @@ function buildMergedContract(options2) {
|
|
|
262542
262719
|
const contained = (root, rel2) => {
|
|
262543
262720
|
if (isAbsolute17(rel2)) return void 0;
|
|
262544
262721
|
const full = resolve114(root, rel2);
|
|
262545
|
-
return full.startsWith(resolve114(root) +
|
|
262722
|
+
return full.startsWith(resolve114(root) + sep29) ? full : void 0;
|
|
262546
262723
|
};
|
|
262547
262724
|
const stage = (fromRel, toRel) => {
|
|
262548
262725
|
const from = contained(packageDir, fromRel);
|
|
@@ -262551,12 +262728,12 @@ function buildMergedContract(options2) {
|
|
|
262551
262728
|
let real;
|
|
262552
262729
|
let realRoot;
|
|
262553
262730
|
try {
|
|
262554
|
-
real =
|
|
262555
|
-
realRoot =
|
|
262731
|
+
real = realpathSync24(from);
|
|
262732
|
+
realRoot = realpathSync24(packageDir);
|
|
262556
262733
|
} catch {
|
|
262557
262734
|
return void 0;
|
|
262558
262735
|
}
|
|
262559
|
-
if (!real.startsWith(realRoot +
|
|
262736
|
+
if (!real.startsWith(realRoot + sep29)) return void 0;
|
|
262560
262737
|
try {
|
|
262561
262738
|
if (!statSync49(real).isFile()) return void 0;
|
|
262562
262739
|
mkdirSync65(dirname79(to2), { recursive: true });
|
|
@@ -266366,8 +266543,8 @@ __export(fidelity_exports, {
|
|
|
266366
266543
|
himalayaRepoRoot: () => himalayaRepoRoot
|
|
266367
266544
|
});
|
|
266368
266545
|
import { execFileSync as execFileSync10 } from "node:child_process";
|
|
266369
|
-
import { existsSync as existsSync150, realpathSync as
|
|
266370
|
-
import { join as join190, relative as relative31, sep as
|
|
266546
|
+
import { existsSync as existsSync150, realpathSync as realpathSync25 } from "node:fs";
|
|
266547
|
+
import { join as join190, relative as relative31, sep as sep30 } from "node:path";
|
|
266371
266548
|
function himalayaRepoRoot(dir) {
|
|
266372
266549
|
let top;
|
|
266373
266550
|
try {
|
|
@@ -266376,8 +266553,8 @@ function himalayaRepoRoot(dir) {
|
|
|
266376
266553
|
return null;
|
|
266377
266554
|
}
|
|
266378
266555
|
if (!existsSync150(join190(top, "tools/judges/fidelity/JUDGE.md"))) return null;
|
|
266379
|
-
const rel2 = relative31(
|
|
266380
|
-
return rel2.startsWith(`..${
|
|
266556
|
+
const rel2 = relative31(realpathSync25(top), realpathSync25(dir));
|
|
266557
|
+
return rel2.startsWith(`..${sep30}`) || rel2 === ".." ? null : top;
|
|
266381
266558
|
}
|
|
266382
266559
|
function fidelityEnvelope(report9) {
|
|
266383
266560
|
return report9.status === "fail" ? { ok: false, code: "fidelity_rows_failed", ...report9 } : { ok: true, ...report9 };
|
|
@@ -276879,7 +277056,7 @@ import {
|
|
|
276879
277056
|
openSync as openSync11,
|
|
276880
277057
|
readFileSync as readFileSync157,
|
|
276881
277058
|
readdirSync as readdirSync55,
|
|
276882
|
-
realpathSync as
|
|
277059
|
+
realpathSync as realpathSync22,
|
|
276883
277060
|
renameSync as renameSync23,
|
|
276884
277061
|
rmSync as rmSync36,
|
|
276885
277062
|
statSync as statSync46,
|
|
@@ -277119,8 +277296,8 @@ async function l10nCommand(ctx) {
|
|
|
277119
277296
|
try {
|
|
277120
277297
|
mkdirSync58(join162(appDir3, "l10n"), { recursive: true });
|
|
277121
277298
|
const swapped = unsafeDestination(appDir3, requested);
|
|
277122
|
-
const l10nReal =
|
|
277123
|
-
if (swapped !== void 0 || l10nReal !== join162(
|
|
277299
|
+
const l10nReal = realpathSync22(join162(appDir3, "l10n"));
|
|
277300
|
+
if (swapped !== void 0 || l10nReal !== join162(realpathSync22(appDir3), "l10n")) {
|
|
277124
277301
|
throw new UnsafePath(swapped ?? `${join162(appDir3, "l10n")} resolves outside the app`);
|
|
277125
277302
|
}
|
|
277126
277303
|
for (const tag of requested) {
|