@wix/himalaya-cli 0.1739.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 = {
|
|
@@ -29216,7 +29343,6 @@ var init_page_worker = __esm({
|
|
|
29216
29343
|
var ICON_VIEW_BOX, ICON_STROKE_WIDTH, ICON_FALLBACK, ICON_CATALOG, ICON_NORMALIZED_INDEX, ICON_NAMES;
|
|
29217
29344
|
var init_icon_catalog_generated = __esm({
|
|
29218
29345
|
"../../core/ts/src/icon-catalog.generated.ts"() {
|
|
29219
|
-
"use strict";
|
|
29220
29346
|
init_define_HHP_CATALOG();
|
|
29221
29347
|
ICON_VIEW_BOX = 24;
|
|
29222
29348
|
ICON_STROKE_WIDTH = 2;
|
|
@@ -38790,7 +38916,6 @@ function resolveIdiom(tokens2, ctx = {}) {
|
|
|
38790
38916
|
var IDIOM_CONTEXTS, UNSAFE_KEYS;
|
|
38791
38917
|
var init_idiom = __esm({
|
|
38792
38918
|
"../../core/ts/src/idiom.ts"() {
|
|
38793
|
-
"use strict";
|
|
38794
38919
|
init_define_HHP_CATALOG();
|
|
38795
38920
|
IDIOM_CONTEXTS = {
|
|
38796
38921
|
ios: { native: ["ios"] },
|
|
@@ -40526,6 +40651,7 @@ function shouldRevealError(args) {
|
|
|
40526
40651
|
var EMAIL_RE, URL_HOST_RE, INTEGER_RE, NUMBER_RE, AUTHORED_PATTERN_LIMIT, authoredPatterns;
|
|
40527
40652
|
var init_validation = __esm({
|
|
40528
40653
|
"../../core/ts/src/validation.ts"() {
|
|
40654
|
+
"use strict";
|
|
40529
40655
|
init_define_HHP_CATALOG();
|
|
40530
40656
|
EMAIL_RE = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
|
|
40531
40657
|
URL_HOST_RE = /^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(:[0-9]+)?$/;
|
|
@@ -42013,7 +42139,7 @@ function redactBodyString(body) {
|
|
|
42013
42139
|
} catch {
|
|
42014
42140
|
}
|
|
42015
42141
|
}
|
|
42016
|
-
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}`);
|
|
42017
42143
|
}
|
|
42018
42144
|
function createWixGatewayState() {
|
|
42019
42145
|
return { mode: "record", rules: [], traffic: [], clients: /* @__PURE__ */ new Set(), seq: 0, ruleSeq: 0 };
|
|
@@ -48967,10 +49093,10 @@ async function runRicosImageUpload(o2) {
|
|
|
48967
49093
|
} catch {
|
|
48968
49094
|
return fail12("read");
|
|
48969
49095
|
}
|
|
48970
|
-
const
|
|
49096
|
+
const sep31 = entry.uploadUrl.includes("?") ? "&" : "?";
|
|
48971
49097
|
let res;
|
|
48972
49098
|
try {
|
|
48973
|
-
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 });
|
|
48974
49100
|
} catch {
|
|
48975
49101
|
return fail12("put");
|
|
48976
49102
|
}
|
|
@@ -49613,10 +49739,10 @@ async function runMediaFieldUpload(o2) {
|
|
|
49613
49739
|
} catch (e2) {
|
|
49614
49740
|
return { ok: false, reason: e2 instanceof Deadline ? "timeout" : "read" };
|
|
49615
49741
|
}
|
|
49616
|
-
const
|
|
49742
|
+
const sep31 = uploadUrl.includes("?") ? "&" : "?";
|
|
49617
49743
|
let res;
|
|
49618
49744
|
try {
|
|
49619
|
-
res = await bounded2(deps.fetch(`${uploadUrl}${
|
|
49745
|
+
res = await bounded2(deps.fetch(`${uploadUrl}${sep31}filename=${encodeURIComponent(file2.fileName)}`, {
|
|
49620
49746
|
method: "PUT",
|
|
49621
49747
|
headers: { "Content-Type": file2.mimeType },
|
|
49622
49748
|
body,
|
|
@@ -133398,8 +133524,8 @@ function ensureCountUpRuntime() {
|
|
|
133398
133524
|
const neg = fixed.startsWith("-");
|
|
133399
133525
|
const body = neg ? fixed.slice(1) : fixed;
|
|
133400
133526
|
const [int3, frac] = body.split(".");
|
|
133401
|
-
const
|
|
133402
|
-
return (neg ? "-" : "") +
|
|
133527
|
+
const sep31 = int3.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
133528
|
+
return (neg ? "-" : "") + sep31 + (frac ? "." + frac : "");
|
|
133403
133529
|
};
|
|
133404
133530
|
const animateEl = (el2) => {
|
|
133405
133531
|
const node3 = el2;
|
|
@@ -143913,7 +144039,7 @@ function nodeHidden(modifiers, provider, itemScope, env) {
|
|
|
143913
144039
|
return false;
|
|
143914
144040
|
}
|
|
143915
144041
|
function isObservedTextProp(type2, key4) {
|
|
143916
|
-
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");
|
|
143917
144043
|
}
|
|
143918
144044
|
function resolveTreeScalar(v2, provider, itemScope) {
|
|
143919
144045
|
if (typeof v2 !== "string") return v2;
|
|
@@ -144018,6 +144144,17 @@ function buildRenderTree(node3, path2 = "$", provider = null, itemScope = void 0
|
|
|
144018
144144
|
const actionLabel = props2.action != null ? painted2(props2.actionLabel) : void 0;
|
|
144019
144145
|
if (actionLabel !== void 0) values.actionLabel = actionLabel;
|
|
144020
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
|
+
}
|
|
144021
144158
|
const template = props2.template;
|
|
144022
144159
|
if (type2 === "Text" && template && typeof template.template === "string") {
|
|
144023
144160
|
const args = Object.fromEntries(Object.entries(template.params ?? {}).map(([key4, value2]) => [key4, resolveTreeScalar(value2, provider, itemScope)]));
|
|
@@ -146106,6 +146243,18 @@ async function nativeActionsFor(state) {
|
|
|
146106
146243
|
function isWellFormedAppParam(app2) {
|
|
146107
146244
|
return /^(?=.{1,63}$)[a-z0-9][a-z0-9-]*(?:\.[a-z0-9][a-z0-9-]*)?$/.test(app2);
|
|
146108
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
|
+
}
|
|
146109
146258
|
function handleL10nRequest(req, res, state) {
|
|
146110
146259
|
const u2 = new URL(req.url ?? "", "http://localhost");
|
|
146111
146260
|
const app2 = (u2.searchParams.get("app") ?? "").trim();
|
|
@@ -146169,6 +146318,7 @@ async function runScreenDiagnostics(state, screenId, descriptor) {
|
|
|
146169
146318
|
appServices: appServicesContextFor2(state.app?.dir, state.app?.module.config, state.tier5Dir ?? TIER5_ROOT2),
|
|
146170
146319
|
strict: false,
|
|
146171
146320
|
workerSubtreeScreens: new Set(uiConfig(state.app?.module.config).workerSubtreeScreens ?? []),
|
|
146321
|
+
translationKeys: sourceTranslationKeys(state),
|
|
146172
146322
|
// Same a11y rung the build lint applies (RFC 0058 §5) — diagnostics must not disagree.
|
|
146173
146323
|
a11y: uiConfig(state.app?.module.config).a11y
|
|
146174
146324
|
});
|
|
@@ -148375,6 +148525,7 @@ async function handleAdminPlayground(req, res, state) {
|
|
|
148375
148525
|
appServices: appServicesContextFor2(state.app?.dir, state.app?.module.config, state.tier5Dir ?? TIER5_ROOT2),
|
|
148376
148526
|
strict,
|
|
148377
148527
|
workerSubtreeScreens: new Set(uiConfig(state.app?.module.config).workerSubtreeScreens ?? []),
|
|
148528
|
+
translationKeys: sourceTranslationKeys(state),
|
|
148378
148529
|
a11y: uiConfig(state.app?.module.config).a11y
|
|
148379
148530
|
});
|
|
148380
148531
|
return sendJson(res, report9.ok ? 200 : 422, report9);
|
|
@@ -151177,6 +151328,9 @@ function renderedValueDefect(value2, field, componentType = "", l10nKeys) {
|
|
|
151177
151328
|
const key4 = translationKey(v2);
|
|
151178
151329
|
if (key4 === null || !l10nKeys?.get(key4)) return { kind: "unsubstituted-binding", actual: tKey[0].trim() };
|
|
151179
151330
|
}
|
|
151331
|
+
if (field !== "value" && isObservedTextProp(componentType, field) && l10nKeys?.has(v2)) {
|
|
151332
|
+
return { kind: "placeholder-in-text", actual: v2, translationKey: true };
|
|
151333
|
+
}
|
|
151180
151334
|
if (value2.includes("[object Object]")) return { kind: "placeholder-in-text", actual: "[object Object]" };
|
|
151181
151335
|
if (/^[[{]/.test(v2)) {
|
|
151182
151336
|
try {
|
|
@@ -151197,6 +151351,9 @@ function resolvedDefectMessage(defect) {
|
|
|
151197
151351
|
return `visible text is "${defect.actual}"`;
|
|
151198
151352
|
}
|
|
151199
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
|
+
}
|
|
151200
151357
|
if (defect.kind === "unsubstituted-binding") {
|
|
151201
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";
|
|
151202
151359
|
}
|
|
@@ -152539,8 +152696,8 @@ async function crawlScreenInner(opts) {
|
|
|
152539
152696
|
if (linkable.has(target)) return true;
|
|
152540
152697
|
for (const base2 of linkable) {
|
|
152541
152698
|
if (target.length > base2.length + 1 && target.startsWith(base2)) {
|
|
152542
|
-
const
|
|
152543
|
-
if (
|
|
152699
|
+
const sep31 = target[base2.length];
|
|
152700
|
+
if (sep31 === "_" || sep31 === "/") return true;
|
|
152544
152701
|
}
|
|
152545
152702
|
}
|
|
152546
152703
|
return false;
|
|
@@ -153800,6 +153957,7 @@ __export(build_exports2, {
|
|
|
153800
153957
|
servicesFromBundleJs: () => servicesFromBundleJs,
|
|
153801
153958
|
shellSha: () => shellSha,
|
|
153802
153959
|
snapshotTokens: () => snapshotTokens,
|
|
153960
|
+
sourceTranslationKeys: () => sourceTranslationKeys2,
|
|
153803
153961
|
tokensSnapshotMessage: () => tokensSnapshotMessage,
|
|
153804
153962
|
unsupportedComponentMinVersions: () => unsupportedComponentMinVersions,
|
|
153805
153963
|
withPinnedRelease: () => withPinnedRelease,
|
|
@@ -153807,8 +153965,8 @@ __export(build_exports2, {
|
|
|
153807
153965
|
withoutDevOnlyAppConfig: () => withoutDevOnlyAppConfig
|
|
153808
153966
|
});
|
|
153809
153967
|
import { createHash as createHash23 } from "node:crypto";
|
|
153810
|
-
import { readFileSync as readFileSync46, readdirSync as readdirSync25, existsSync as existsSync43 } from "node:fs";
|
|
153811
|
-
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";
|
|
153812
153970
|
import { fileURLToPath as fileURLToPath27 } from "node:url";
|
|
153813
153971
|
import { createRequire as createRequire3 } from "node:module";
|
|
153814
153972
|
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
@@ -153893,6 +154051,21 @@ function l10nLintOptions(locale, appDir3) {
|
|
|
153893
154051
|
}
|
|
153894
154052
|
return { enforce, catalog: catalog4, locales: tags };
|
|
153895
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
|
+
}
|
|
153896
154069
|
async function bakeCatalogs(app2, locale, fetchCatalog, putDoc) {
|
|
153897
154070
|
const out2 = {};
|
|
153898
154071
|
if (!putDoc) return out2;
|
|
@@ -154453,6 +154626,7 @@ async function buildFromLoaded(preloaded, dest, opts = {}) {
|
|
|
154453
154626
|
const linkable = /* @__PURE__ */ new Set();
|
|
154454
154627
|
let bakedAppConfig;
|
|
154455
154628
|
const lintTokens = collect2?.lint || collect2?.render ? readTokensForLint(preloaded) : void 0;
|
|
154629
|
+
const lintTranslationKeys = collect2?.lint ? sourceTranslationKeys2(config.locale, preloaded.dir) : void 0;
|
|
154456
154630
|
const facedTokens = lintTokens && withServedFontFaces(lintTokens, preloaded.dir);
|
|
154457
154631
|
const idiomPolicy = config.idiom;
|
|
154458
154632
|
const renderTokens = facedTokens && idiomPolicy !== void 0 ? { ...facedTokens, idiomPolicy } : facedTokens;
|
|
@@ -154937,6 +155111,7 @@ async function buildFromLoaded(preloaded, dest, opts = {}) {
|
|
|
154937
155111
|
strict: collect2.strict,
|
|
154938
155112
|
workerSubtreeScreens: new Set(config.workerSubtreeScreens ?? []),
|
|
154939
155113
|
l10n: l10nLintOptions(config.locale, preloaded.dir),
|
|
155114
|
+
translationKeys: lintTranslationKeys,
|
|
154940
155115
|
// RFC 0058 §5 — the app's own rung of the a11y ladder. Omitted ⇒ the validator's
|
|
154941
155116
|
// default, "error"; an in-repo app with ratcheted debt declares "warn".
|
|
154942
155117
|
a11y: config.a11y
|
|
@@ -155448,6 +155623,7 @@ var init_build3 = __esm({
|
|
|
155448
155623
|
init_app_services_requirements();
|
|
155449
155624
|
init_app_icon();
|
|
155450
155625
|
init_app_config();
|
|
155626
|
+
init_l10n_catalog();
|
|
155451
155627
|
init_app_assets();
|
|
155452
155628
|
init_plan_fonts();
|
|
155453
155629
|
init_face_source();
|
|
@@ -156650,14 +156826,14 @@ __export(studio_exports, {
|
|
|
156650
156826
|
writeStudioRecord: () => writeStudioRecord
|
|
156651
156827
|
});
|
|
156652
156828
|
import { createHash as createHash24 } from "node:crypto";
|
|
156653
|
-
import { existsSync as existsSync46, readdirSync as readdirSync27, readFileSync as readFileSync49, realpathSync as
|
|
156654
|
-
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";
|
|
156655
156831
|
import { pathToFileURL as pathToFileURL6 } from "node:url";
|
|
156656
156832
|
function realInside(dir, abs) {
|
|
156657
156833
|
try {
|
|
156658
|
-
const root =
|
|
156659
|
-
const real =
|
|
156660
|
-
return real.startsWith(root +
|
|
156834
|
+
const root = realpathSync7(dir);
|
|
156835
|
+
const real = realpathSync7(abs);
|
|
156836
|
+
return real.startsWith(root + sep14) ? real : null;
|
|
156661
156837
|
} catch {
|
|
156662
156838
|
return null;
|
|
156663
156839
|
}
|
|
@@ -163040,21 +163216,21 @@ var init_Matcher = __esm({
|
|
|
163040
163216
|
* @returns {string}
|
|
163041
163217
|
*/
|
|
163042
163218
|
toString(separator, includeNamespace = true) {
|
|
163043
|
-
const
|
|
163044
|
-
const isDefault =
|
|
163219
|
+
const sep31 = separator || this.separator;
|
|
163220
|
+
const isDefault = sep31 === this.separator && includeNamespace === true;
|
|
163045
163221
|
if (isDefault) {
|
|
163046
163222
|
if (this._pathStringCache !== null) {
|
|
163047
163223
|
return this._pathStringCache;
|
|
163048
163224
|
}
|
|
163049
163225
|
const result = this.path.map(
|
|
163050
163226
|
(n2) => n2.namespace ? `${n2.namespace}:${n2.tag}` : n2.tag
|
|
163051
|
-
).join(
|
|
163227
|
+
).join(sep31);
|
|
163052
163228
|
this._pathStringCache = result;
|
|
163053
163229
|
return result;
|
|
163054
163230
|
}
|
|
163055
163231
|
return this.path.map(
|
|
163056
163232
|
(n2) => includeNamespace && n2.namespace ? `${n2.namespace}:${n2.tag}` : n2.tag
|
|
163057
|
-
).join(
|
|
163233
|
+
).join(sep31);
|
|
163058
163234
|
}
|
|
163059
163235
|
/**
|
|
163060
163236
|
* Get path as array of tag names.
|
|
@@ -163764,77 +163940,77 @@ var init_redos = __esm({
|
|
|
163764
163940
|
});
|
|
163765
163941
|
|
|
163766
163942
|
// ../../node_modules/is-unsafe/src/contexts/nosql.js
|
|
163767
|
-
var
|
|
163943
|
+
var sep15, NOSQL_PATTERNS, nosql_default;
|
|
163768
163944
|
var init_nosql = __esm({
|
|
163769
163945
|
"../../node_modules/is-unsafe/src/contexts/nosql.js"() {
|
|
163770
163946
|
init_define_HHP_CATALOG();
|
|
163771
|
-
|
|
163947
|
+
sep15 = `["'\\s]*:`;
|
|
163772
163948
|
NOSQL_PATTERNS = [
|
|
163773
163949
|
// ─── MongoDB $ operator injection ────────────────────────────────────────
|
|
163774
163950
|
{
|
|
163775
163951
|
id: "nosql-where-operator",
|
|
163776
163952
|
description: "$where \u2014 executes arbitrary JavaScript server-side in MongoDB",
|
|
163777
|
-
pattern: new RegExp(`\\$where${
|
|
163953
|
+
pattern: new RegExp(`\\$where${sep15}`, "i")
|
|
163778
163954
|
},
|
|
163779
163955
|
{
|
|
163780
163956
|
id: "nosql-ne-operator",
|
|
163781
163957
|
description: '$ne \u2014 "not equal" operator used to bypass equality checks',
|
|
163782
|
-
pattern: new RegExp(`\\$ne${
|
|
163958
|
+
pattern: new RegExp(`\\$ne${sep15}`, "i")
|
|
163783
163959
|
},
|
|
163784
163960
|
{
|
|
163785
163961
|
id: "nosql-gt-operator",
|
|
163786
163962
|
description: '$gt \u2014 "greater than" used to bypass password/value checks',
|
|
163787
|
-
pattern: new RegExp(`\\$gte?${
|
|
163963
|
+
pattern: new RegExp(`\\$gte?${sep15}`, "i")
|
|
163788
163964
|
},
|
|
163789
163965
|
{
|
|
163790
163966
|
id: "nosql-lt-operator",
|
|
163791
163967
|
description: '$lt / $lte \u2014 "less than" bypass variants',
|
|
163792
|
-
pattern: new RegExp(`\\$lte?${
|
|
163968
|
+
pattern: new RegExp(`\\$lte?${sep15}`, "i")
|
|
163793
163969
|
},
|
|
163794
163970
|
{
|
|
163795
163971
|
id: "nosql-regex-operator",
|
|
163796
163972
|
description: "$regex \u2014 can be used to extract data character by character (blind injection)",
|
|
163797
|
-
pattern: new RegExp(`\\$regex${
|
|
163973
|
+
pattern: new RegExp(`\\$regex${sep15}`, "i")
|
|
163798
163974
|
},
|
|
163799
163975
|
{
|
|
163800
163976
|
id: "nosql-or-operator",
|
|
163801
163977
|
description: "$or \u2014 logical OR; used to create always-true conditions",
|
|
163802
|
-
pattern: new RegExp(`\\$or${
|
|
163978
|
+
pattern: new RegExp(`\\$or${sep15}\\s*\\[`, "i")
|
|
163803
163979
|
},
|
|
163804
163980
|
{
|
|
163805
163981
|
id: "nosql-and-operator",
|
|
163806
163982
|
description: "$and \u2014 logical AND operator injection",
|
|
163807
|
-
pattern: new RegExp(`\\$and${
|
|
163983
|
+
pattern: new RegExp(`\\$and${sep15}\\s*\\[`, "i")
|
|
163808
163984
|
},
|
|
163809
163985
|
{
|
|
163810
163986
|
id: "nosql-nor-operator",
|
|
163811
163987
|
description: "$nor \u2014 logical NOR operator injection",
|
|
163812
|
-
pattern: new RegExp(`\\$nor${
|
|
163988
|
+
pattern: new RegExp(`\\$nor${sep15}\\s*\\[`, "i")
|
|
163813
163989
|
},
|
|
163814
163990
|
{
|
|
163815
163991
|
id: "nosql-exists-operator",
|
|
163816
163992
|
description: "$exists \u2014 can enumerate fields to determine schema",
|
|
163817
|
-
pattern: new RegExp(`\\$exists${
|
|
163993
|
+
pattern: new RegExp(`\\$exists${sep15}`, "i")
|
|
163818
163994
|
},
|
|
163819
163995
|
{
|
|
163820
163996
|
id: "nosql-in-operator",
|
|
163821
163997
|
description: "$in \u2014 matches any value in a list; can enumerate values",
|
|
163822
|
-
pattern: new RegExp(`\\$in${
|
|
163998
|
+
pattern: new RegExp(`\\$in${sep15}\\s*\\[`, "i")
|
|
163823
163999
|
},
|
|
163824
164000
|
{
|
|
163825
164001
|
id: "nosql-expr-operator",
|
|
163826
164002
|
description: "$expr \u2014 allows aggregation expressions in queries (MongoDB 3.6+)",
|
|
163827
|
-
pattern: new RegExp(`\\$expr${
|
|
164003
|
+
pattern: new RegExp(`\\$expr${sep15}`, "i")
|
|
163828
164004
|
},
|
|
163829
164005
|
{
|
|
163830
164006
|
id: "nosql-function-operator",
|
|
163831
164007
|
description: "$function \u2014 executes arbitrary JavaScript in MongoDB 4.4+",
|
|
163832
|
-
pattern: new RegExp(`\\$function${
|
|
164008
|
+
pattern: new RegExp(`\\$function${sep15}`, "i")
|
|
163833
164009
|
},
|
|
163834
164010
|
{
|
|
163835
164011
|
id: "nosql-accumulator-operator",
|
|
163836
164012
|
description: "$accumulator \u2014 custom aggregation with arbitrary JS execution",
|
|
163837
|
-
pattern: new RegExp(`\\$accumulator${
|
|
164013
|
+
pattern: new RegExp(`\\$accumulator${sep15}`, "i")
|
|
163838
164014
|
},
|
|
163839
164015
|
// ─── Prototype pollution ─────────────────────────────────────────────────
|
|
163840
164016
|
{
|
|
@@ -166651,10 +166827,10 @@ __export(content_manifest_exports, {
|
|
|
166651
166827
|
writeContentManifest: () => writeContentManifest
|
|
166652
166828
|
});
|
|
166653
166829
|
import { randomUUID as randomUUID8 } from "node:crypto";
|
|
166654
|
-
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";
|
|
166655
166831
|
import { join as join45 } from "node:path";
|
|
166656
166832
|
function contentManifestPath(dir) {
|
|
166657
|
-
const path2 = join45(
|
|
166833
|
+
const path2 = join45(realpathSync8(dir), "himalaya.content.json");
|
|
166658
166834
|
try {
|
|
166659
166835
|
if (lstatSync17(path2).isSymbolicLink()) throw new Error("himalaya.content.json is a symlink \u2014 refusing to read or write through it");
|
|
166660
166836
|
} catch (error) {
|
|
@@ -170206,7 +170382,7 @@ __export(app_source_exports, {
|
|
|
170206
170382
|
});
|
|
170207
170383
|
import { createHash as createHash29 } from "node:crypto";
|
|
170208
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";
|
|
170209
|
-
import { join as join50, resolve as resolve46, sep as
|
|
170385
|
+
import { join as join50, resolve as resolve46, sep as sep16 } from "node:path";
|
|
170210
170386
|
import { createRequire as createRequire4 } from "node:module";
|
|
170211
170387
|
import { deflateRawSync as deflateRawSync2 } from "node:zlib";
|
|
170212
170388
|
function walkSourceTree(dir, file2, skip, enter = () => {
|
|
@@ -170229,7 +170405,7 @@ function walkSourceTree(dir, file2, skip, enter = () => {
|
|
|
170229
170405
|
skip(rel2);
|
|
170230
170406
|
continue;
|
|
170231
170407
|
}
|
|
170232
|
-
file2(rel2.split(
|
|
170408
|
+
file2(rel2.split(sep16).join("/"), rel2);
|
|
170233
170409
|
}
|
|
170234
170410
|
};
|
|
170235
170411
|
walk4("");
|
|
@@ -170293,8 +170469,8 @@ function renderInputRootDirs(dir) {
|
|
|
170293
170469
|
}
|
|
170294
170470
|
function newestSourceChangeMs(dir) {
|
|
170295
170471
|
const roots2 = renderInputRootDirs(dir);
|
|
170296
|
-
const inRead = (hostRel) => !roots2 || roots2.has(hostRel.split(
|
|
170297
|
-
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);
|
|
170298
170474
|
let newest = 0;
|
|
170299
170475
|
walkSourceTree(
|
|
170300
170476
|
dir,
|
|
@@ -170456,7 +170632,7 @@ function pruneEmptyDirs(root, rel2, needed, removed) {
|
|
|
170456
170632
|
let empty2 = true;
|
|
170457
170633
|
for (const name of readdirSync32(rel2 ? join50(root, rel2) : root)) {
|
|
170458
170634
|
const childRel = rel2 ? join50(rel2, name) : name;
|
|
170459
|
-
const posix5 = childRel.split(
|
|
170635
|
+
const posix5 = childRel.split(sep16).join("/");
|
|
170460
170636
|
const kind = lstatSync19(join50(root, childRel));
|
|
170461
170637
|
if (kind.isSymbolicLink() || !kind.isDirectory() || isDeniedSourceDir(name, rel2)) {
|
|
170462
170638
|
empty2 = false;
|
|
@@ -170540,9 +170716,9 @@ __export(run_watch_exports, {
|
|
|
170540
170716
|
watchedContentDir: () => watchedContentDir,
|
|
170541
170717
|
writeRunRecord: () => writeRunRecord
|
|
170542
170718
|
});
|
|
170543
|
-
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";
|
|
170544
170720
|
import { randomUUID as randomUUID9 } from "node:crypto";
|
|
170545
|
-
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";
|
|
170546
170722
|
function diffReleases(prev, next) {
|
|
170547
170723
|
const bundles = Object.keys(next.bundles).filter((b3) => prev.bundles[b3]?.sha256 !== next.bundles[b3].sha256).sort();
|
|
170548
170724
|
const changedBundles = new Set(bundles);
|
|
@@ -170570,7 +170746,7 @@ function reloadEvents(d2) {
|
|
|
170570
170746
|
function hhpRasterDir(dir) {
|
|
170571
170747
|
const assets = findAssetsDir(dir);
|
|
170572
170748
|
if (!assets) return null;
|
|
170573
|
-
const rel2 = relative12(dir, assets).split(
|
|
170749
|
+
const rel2 = relative12(dir, assets).split(sep17).join("/");
|
|
170574
170750
|
return rel2 ? `${rel2}/hhp-raster` : "hhp-raster";
|
|
170575
170751
|
}
|
|
170576
170752
|
function ignoredChange(relPath, isDirectory = () => false, rasterDir = "assets/hhp-raster") {
|
|
@@ -170798,15 +170974,15 @@ function boardFile(dir, pathname) {
|
|
|
170798
170974
|
function readConfined(root, rel2) {
|
|
170799
170975
|
try {
|
|
170800
170976
|
if (!lstatSync20(root).isDirectory()) return null;
|
|
170801
|
-
const parts = rel2.split(
|
|
170977
|
+
const parts = rel2.split(sep17);
|
|
170802
170978
|
let at2 = root;
|
|
170803
170979
|
for (let i2 = 0; i2 < parts.length; i2++) {
|
|
170804
170980
|
at2 = join51(at2, parts[i2]);
|
|
170805
170981
|
const st2 = lstatSync20(at2);
|
|
170806
170982
|
if (st2.isSymbolicLink() || !(i2 === parts.length - 1 ? st2.isFile() : st2.isDirectory())) return null;
|
|
170807
170983
|
}
|
|
170808
|
-
const canonicalRoot =
|
|
170809
|
-
if (!
|
|
170984
|
+
const canonicalRoot = realpathSync9(root);
|
|
170985
|
+
if (!realpathSync9(at2).startsWith(canonicalRoot + sep17)) return null;
|
|
170810
170986
|
const fd = openSync4(at2, constants3.O_RDONLY | (constants3.O_NOFOLLOW ?? 0));
|
|
170811
170987
|
try {
|
|
170812
170988
|
if (!fstatSync(fd).isFile()) return null;
|
|
@@ -171425,13 +171601,13 @@ import { createHash as createHash32, randomUUID as randomUUID10 } from "node:cry
|
|
|
171425
171601
|
import { spawn as spawn4 } from "node:child_process";
|
|
171426
171602
|
import { closeSync as closeSync5, existsSync as existsSync61, lstatSync as lstatSync23, readFileSync as readFileSync69, statSync as statSync19 } from "node:fs";
|
|
171427
171603
|
import { createServer as createServer3 } from "node:net";
|
|
171428
|
-
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";
|
|
171429
171605
|
function homeShotPath(dir, home2) {
|
|
171430
171606
|
const root = resolve48(dir);
|
|
171431
171607
|
const base2 = resolve48(root, ".himi", "shots");
|
|
171432
171608
|
const shot = resolve48(base2, `${home2}.png`);
|
|
171433
|
-
if (!shot.startsWith(base2 +
|
|
171434
|
-
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)) {
|
|
171435
171611
|
try {
|
|
171436
171612
|
if (lstatSync23(p2).isSymbolicLink()) return null;
|
|
171437
171613
|
} catch {
|
|
@@ -181272,9 +181448,9 @@ function hostOf2(url) {
|
|
|
181272
181448
|
const m2 = /^[A-Za-z][A-Za-z0-9+.-]*:\/\/([^/?#]+)/.exec(url);
|
|
181273
181449
|
return m2 ? m2[1].toLowerCase() : null;
|
|
181274
181450
|
}
|
|
181275
|
-
function splitOnce(s5,
|
|
181276
|
-
const i2 = s5.indexOf(
|
|
181277
|
-
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)];
|
|
181278
181454
|
}
|
|
181279
181455
|
function stripLeadingSlashes(s5) {
|
|
181280
181456
|
return s5.replace(/^\/+/, "");
|
|
@@ -181976,7 +182152,7 @@ __export(eject_exports, {
|
|
|
181976
182152
|
ejectModule: () => ejectModule
|
|
181977
182153
|
});
|
|
181978
182154
|
import { existsSync as existsSync76, mkdirSync as mkdirSync33, readFileSync as readFileSync85, writeFileSync as writeFileSync30 } from "node:fs";
|
|
181979
|
-
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";
|
|
181980
182156
|
function locate(repoRootOrCwd, mod) {
|
|
181981
182157
|
const inRepo = resolve53(repoRootOrCwd, `stdlib/flows/${mod}/src/index.ts`);
|
|
181982
182158
|
if (existsSync76(inRepo)) return { path: inRepo, form: "source" };
|
|
@@ -182029,7 +182205,7 @@ function ejectModule(opts) {
|
|
|
182029
182205
|
if (!existsSync76(f2)) continue;
|
|
182030
182206
|
const before = readFileSync85(f2, "utf8");
|
|
182031
182207
|
let after = before;
|
|
182032
|
-
let rel2 = relative14(dirname41(f2), target).split(
|
|
182208
|
+
let rel2 = relative14(dirname41(f2), target).split(sep19).join("/").replace(/\.tsx?$/, ".js");
|
|
182033
182209
|
if (!rel2.startsWith(".")) rel2 = `./${rel2}`;
|
|
182034
182210
|
for (const spec of specifiersFor(mod)) {
|
|
182035
182211
|
const q4 = spec.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -182211,7 +182387,7 @@ __export(icon_exports, {
|
|
|
182211
182387
|
});
|
|
182212
182388
|
import { createHash as createHash35 } from "node:crypto";
|
|
182213
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";
|
|
182214
|
-
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";
|
|
182215
182391
|
function readManifest(dir) {
|
|
182216
182392
|
try {
|
|
182217
182393
|
return JSON.parse(readFileSync86(join73(dir, MANIFEST), "utf8"));
|
|
@@ -182228,7 +182404,7 @@ function declaredIconName(dir) {
|
|
|
182228
182404
|
function iconDest(dir, name) {
|
|
182229
182405
|
const base2 = resolve54(dir);
|
|
182230
182406
|
const abs = resolve54(base2, name);
|
|
182231
|
-
if (!abs.startsWith(base2 +
|
|
182407
|
+
if (!abs.startsWith(base2 + sep20)) {
|
|
182232
182408
|
throw new Error(
|
|
182233
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}".`
|
|
182234
182410
|
);
|
|
@@ -182589,8 +182765,8 @@ function baseOf(target, linkable, known2) {
|
|
|
182589
182765
|
let best = null;
|
|
182590
182766
|
for (const base2 of linkable ?? []) {
|
|
182591
182767
|
if (!known2.has(base2) || target.length <= base2.length + 1 || !target.startsWith(base2)) continue;
|
|
182592
|
-
const
|
|
182593
|
-
if ((
|
|
182768
|
+
const sep31 = target[base2.length];
|
|
182769
|
+
if ((sep31 === "_" || sep31 === "/") && (!best || base2.length > best.length)) best = base2;
|
|
182594
182770
|
}
|
|
182595
182771
|
return best;
|
|
182596
182772
|
}
|
|
@@ -182617,8 +182793,8 @@ __export(crawl_layers_exports, {
|
|
|
182617
182793
|
renderMocksFrom: () => renderMocksFrom,
|
|
182618
182794
|
tabRootScreens: () => tabRootScreens
|
|
182619
182795
|
});
|
|
182620
|
-
import { existsSync as existsSync79, readFileSync as readFileSync87, realpathSync as
|
|
182621
|
-
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";
|
|
182622
182798
|
async function loadContentConfigQuietly(dir) {
|
|
182623
182799
|
try {
|
|
182624
182800
|
return await loadAppConfigModule(dir);
|
|
@@ -182715,9 +182891,9 @@ async function l10nSourceCatalogFile(dir) {
|
|
|
182715
182891
|
const file2 = resolve55(l10nDir, `${tag}.json`);
|
|
182716
182892
|
if (!existsSync79(file2)) return null;
|
|
182717
182893
|
try {
|
|
182718
|
-
const realDir =
|
|
182719
|
-
const realFile =
|
|
182720
|
-
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;
|
|
182721
182897
|
return { tag, text: readFileSync87(realFile, "utf8") };
|
|
182722
182898
|
} catch {
|
|
182723
182899
|
return null;
|
|
@@ -184388,7 +184564,7 @@ import {
|
|
|
184388
184564
|
existsSync as existsSync82,
|
|
184389
184565
|
lstatSync as lstatSync26,
|
|
184390
184566
|
mkdirSync as mkdirSync37,
|
|
184391
|
-
realpathSync as
|
|
184567
|
+
realpathSync as realpathSync11,
|
|
184392
184568
|
readlinkSync as readlinkSync2,
|
|
184393
184569
|
readFileSync as readFileSync92,
|
|
184394
184570
|
readdirSync as readdirSync38,
|
|
@@ -184455,7 +184631,7 @@ function currentGitDiffHash(contentDir2) {
|
|
|
184455
184631
|
}
|
|
184456
184632
|
function currentGitUntrackedHash(contentDir2) {
|
|
184457
184633
|
const unresolved = resolve60(contentDir2);
|
|
184458
|
-
const absolute =
|
|
184634
|
+
const absolute = realpathSync11.native(unresolved);
|
|
184459
184635
|
const root = repoRoot(absolute);
|
|
184460
184636
|
if (!root) return sourceTreeHash(absolute);
|
|
184461
184637
|
const scope3 = relative15(root, absolute) || ".";
|
|
@@ -186963,12 +187139,12 @@ var init_cli_bridge = __esm({
|
|
|
186963
187139
|
});
|
|
186964
187140
|
|
|
186965
187141
|
// src/mcp/file-tools.ts
|
|
186966
|
-
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";
|
|
186967
187143
|
import { randomBytes as randomBytes4 } from "node:crypto";
|
|
186968
|
-
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";
|
|
186969
187145
|
import * as z2 from "zod";
|
|
186970
187146
|
function within(root, p2) {
|
|
186971
|
-
return p2 === root || p2.startsWith(root.endsWith(
|
|
187147
|
+
return p2 === root || p2.startsWith(root.endsWith(sep22) ? root : root + sep22);
|
|
186972
187148
|
}
|
|
186973
187149
|
function realish(p2) {
|
|
186974
187150
|
let cur = p2;
|
|
@@ -186976,14 +187152,14 @@ function realish(p2) {
|
|
|
186976
187152
|
while (!existsSync89(cur)) {
|
|
186977
187153
|
const up2 = dirname48(cur);
|
|
186978
187154
|
if (up2 === cur) break;
|
|
186979
|
-
tail.unshift(cur.slice(up2.length + (up2.endsWith(
|
|
187155
|
+
tail.unshift(cur.slice(up2.length + (up2.endsWith(sep22) ? 0 : 1)));
|
|
186980
187156
|
cur = up2;
|
|
186981
187157
|
}
|
|
186982
|
-
return join88(
|
|
187158
|
+
return join88(realpathSync12(cur), ...tail);
|
|
186983
187159
|
}
|
|
186984
187160
|
function symlinkComponent(base2, abs) {
|
|
186985
187161
|
let cur = base2;
|
|
186986
|
-
for (const part4 of relative17(base2, abs).split(
|
|
187162
|
+
for (const part4 of relative17(base2, abs).split(sep22).filter(Boolean)) {
|
|
186987
187163
|
cur = join88(cur, part4);
|
|
186988
187164
|
try {
|
|
186989
187165
|
if (lstatSync27(cur).isSymbolicLink()) return relative17(base2, cur);
|
|
@@ -186997,7 +187173,7 @@ function workspaceRefusal(root, target) {
|
|
|
186997
187173
|
const r3 = resolve63(root);
|
|
186998
187174
|
const t2 = resolve63(r3, target);
|
|
186999
187175
|
if (!existsSync89(r3)) return `the workspace folder ${r3} does not exist`;
|
|
187000
|
-
if (!within(r3, t2) || !within(
|
|
187176
|
+
if (!within(r3, t2) || !within(realpathSync12(r3), realish(t2))) return `"${target}" is outside the workspace folder ${r3}`;
|
|
187001
187177
|
const link3 = symlinkComponent(r3, t2);
|
|
187002
187178
|
if (link3) return `"${link3}" is a symlink \u2014 paths must stay in real folders inside the workspace`;
|
|
187003
187179
|
return null;
|
|
@@ -187006,7 +187182,7 @@ async function confinedAppDir(args, deps) {
|
|
|
187006
187182
|
const root = resolve63(await deps.defaultDir());
|
|
187007
187183
|
const dir = typeof args.dir === "string" && args.dir ? resolve63(root, args.dir) : root;
|
|
187008
187184
|
if (!existsSync89(root)) return refuse5("no_workspace", `the workspace folder ${root} does not exist`);
|
|
187009
|
-
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`);
|
|
187010
187186
|
const link3 = symlinkComponent(root, dir);
|
|
187011
187187
|
if (link3) return refuse5("outside_workspace", `"${link3}" is a symlink \u2014 the app folder must be a real folder in the workspace`);
|
|
187012
187188
|
const rel2 = relative17(root, dir);
|
|
@@ -187022,16 +187198,16 @@ function onDiskSpelling(abs) {
|
|
|
187022
187198
|
while (!existsSync89(cur)) {
|
|
187023
187199
|
const up2 = dirname48(cur);
|
|
187024
187200
|
if (up2 === cur) break;
|
|
187025
|
-
tail.unshift(cur.slice(up2.length + (up2.endsWith(
|
|
187201
|
+
tail.unshift(cur.slice(up2.length + (up2.endsWith(sep22) ? 0 : 1)));
|
|
187026
187202
|
cur = up2;
|
|
187027
187203
|
}
|
|
187028
|
-
return join88(
|
|
187204
|
+
return join88(realpathSync12.native(cur), ...tail);
|
|
187029
187205
|
}
|
|
187030
187206
|
function denied(appDir3, abs) {
|
|
187031
187207
|
const rel2 = relative17(appDir3, abs);
|
|
187032
187208
|
if (isDeniedSourcePath(rel2) || isDeniedSourcePath(rel2.toLowerCase())) return true;
|
|
187033
187209
|
try {
|
|
187034
|
-
return isDeniedSourcePath(relative17(
|
|
187210
|
+
return isDeniedSourcePath(relative17(realpathSync12.native(appDir3), onDiskSpelling(abs)));
|
|
187035
187211
|
} catch {
|
|
187036
187212
|
return true;
|
|
187037
187213
|
}
|
|
@@ -187043,7 +187219,7 @@ function confinedPath(appDir3, rel2) {
|
|
|
187043
187219
|
const abs = resolve63(appDir3, rel2);
|
|
187044
187220
|
if (!within(appDir3, abs) || abs === appDir3) return { error: `"${rel2}" is outside the app folder` };
|
|
187045
187221
|
const real = realish(abs);
|
|
187046
|
-
const base2 = existsSync89(appDir3) ?
|
|
187222
|
+
const base2 = existsSync89(appDir3) ? realpathSync12(appDir3) : realish(appDir3);
|
|
187047
187223
|
if (!within(base2, real) || real === base2) return { error: `"${rel2}" is outside the app folder` };
|
|
187048
187224
|
const link3 = symlinkComponent(appDir3, abs);
|
|
187049
187225
|
if (link3) return { error: `"${link3}" is a symlink, which this tool does not follow` };
|
|
@@ -187062,7 +187238,7 @@ function writeNoFollow2(appDir3, abs, content) {
|
|
|
187062
187238
|
closeSync7(fd);
|
|
187063
187239
|
}
|
|
187064
187240
|
const link3 = symlinkComponent(appDir3, abs);
|
|
187065
|
-
if (link3 || !within(
|
|
187241
|
+
if (link3 || !within(realpathSync12(appDir3), realpathSync12(dirname48(abs)))) {
|
|
187066
187242
|
rmSync22(tmp, { force: true });
|
|
187067
187243
|
throw new Error(`"${link3 ?? relative17(appDir3, dirname48(abs))}" changed into a link while writing`);
|
|
187068
187244
|
}
|
|
@@ -187082,7 +187258,7 @@ function listFiles2(appDir3) {
|
|
|
187082
187258
|
const rel2 = relative17(appDir3, p2);
|
|
187083
187259
|
if (isDeniedSourcePath(rel2) || isDeniedSourcePath(rel2.toLowerCase())) continue;
|
|
187084
187260
|
if (files.length >= MAX_LISTED) return false;
|
|
187085
|
-
files.push({ path: rel2.split(
|
|
187261
|
+
files.push({ path: rel2.split(sep22).join("/"), bytes: statSync24(p2).size });
|
|
187086
187262
|
}
|
|
187087
187263
|
}
|
|
187088
187264
|
return true;
|
|
@@ -197813,7 +197989,7 @@ var init_dist2 = __esm({
|
|
|
197813
197989
|
|
|
197814
197990
|
// src/store-google-host.ts
|
|
197815
197991
|
import { createHash as createHash52, randomUUID as randomUUID14 } from "node:crypto";
|
|
197816
|
-
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";
|
|
197817
197993
|
import { join as join103, relative as relative19 } from "node:path";
|
|
197818
197994
|
function readGooglePlayFacts(dir) {
|
|
197819
197995
|
const path2 = join103(dir, GOOGLE_FACTS_FILE);
|
|
@@ -197929,7 +198105,7 @@ async function googleAppFactsFor(dir, o2) {
|
|
|
197929
198105
|
const himi = packageName.toLowerCase().startsWith("himi.");
|
|
197930
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.`);
|
|
197931
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.`);
|
|
197932
|
-
const realDir =
|
|
198108
|
+
const realDir = realpathSync13(dir);
|
|
197933
198109
|
const files = {};
|
|
197934
198110
|
const given = (key4) => {
|
|
197935
198111
|
const p2 = str7(file2[key4]);
|
|
@@ -214103,7 +214279,7 @@ function realPathOf2(path2) {
|
|
|
214103
214279
|
d2 = dirname56(d2);
|
|
214104
214280
|
}
|
|
214105
214281
|
try {
|
|
214106
|
-
return join110(
|
|
214282
|
+
return join110(realpathSync14(d2), ...rest);
|
|
214107
214283
|
} catch {
|
|
214108
214284
|
return resolve70(path2);
|
|
214109
214285
|
}
|
|
@@ -214166,13 +214342,13 @@ function reserveKeyFile(dir, keyId) {
|
|
|
214166
214342
|
}
|
|
214167
214343
|
};
|
|
214168
214344
|
}
|
|
214169
|
-
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;
|
|
214170
214346
|
var init_api_keys = __esm({
|
|
214171
214347
|
"../../node_modules/@wix/asc-web/dist/api-keys.js"() {
|
|
214172
214348
|
init_define_HHP_CATALOG();
|
|
214173
214349
|
init_dist3();
|
|
214174
214350
|
({ createPrivateKey: createPrivateKey6 } = __ascBuiltin040);
|
|
214175
|
-
({ 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);
|
|
214176
214352
|
({ basename: basename25, dirname: dirname56, isAbsolute: isAbsolute11, join: join110, resolve: resolve70 } = __ascBuiltin213);
|
|
214177
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"];
|
|
214178
214354
|
DOWNLOAD_ATTEMPTS = 3;
|
|
@@ -226068,7 +226244,7 @@ function fileRoots(env) {
|
|
|
226068
226244
|
const roots2 = [process.cwd(), ...(env.ASC_MCP_FILE_ROOTS ?? "").split(delimiter3)].map((r3) => r3.trim()).filter(Boolean);
|
|
226069
226245
|
return [...new Set(roots2.flatMap((r3) => {
|
|
226070
226246
|
try {
|
|
226071
|
-
return [
|
|
226247
|
+
return [realpathSync15(resolve77(r3))];
|
|
226072
226248
|
} catch {
|
|
226073
226249
|
return [];
|
|
226074
226250
|
}
|
|
@@ -226081,7 +226257,7 @@ function checkJobFile(path2, param, ctx, o2 = {}) {
|
|
|
226081
226257
|
const given = resolve77(roots2[0] ?? process.cwd(), path2);
|
|
226082
226258
|
let real;
|
|
226083
226259
|
try {
|
|
226084
|
-
real =
|
|
226260
|
+
real = realpathSync15(given);
|
|
226085
226261
|
} catch (e2) {
|
|
226086
226262
|
throw new AscError("invalid", `${param}: cannot read ${path2} (${e2.code ?? "unreadable"})`);
|
|
226087
226263
|
}
|
|
@@ -226090,7 +226266,7 @@ function checkJobFile(path2, param, ctx, o2 = {}) {
|
|
|
226090
226266
|
throw new AscError("invalid", `${param}: ${path2} is not a ${o2.directory ? "directory" : "regular file"}`);
|
|
226091
226267
|
let state;
|
|
226092
226268
|
try {
|
|
226093
|
-
state =
|
|
226269
|
+
state = realpathSync15(ctx.stateDir);
|
|
226094
226270
|
} catch {
|
|
226095
226271
|
state = void 0;
|
|
226096
226272
|
}
|
|
@@ -226289,7 +226465,7 @@ ${o2.detail}` : ""}` };
|
|
|
226289
226465
|
function enabledTools(env, o2 = {}) {
|
|
226290
226466
|
return TOOLS.filter((t2) => !t2.write || env.ASC_MCP_WRITE === "1" || o2.approvals === true);
|
|
226291
226467
|
}
|
|
226292
|
-
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;
|
|
226293
226469
|
var init_tools2 = __esm({
|
|
226294
226470
|
"../../node_modules/@wix/asc-mcp/dist/tools.js"() {
|
|
226295
226471
|
init_define_HHP_CATALOG();
|
|
@@ -226299,8 +226475,8 @@ var init_tools2 = __esm({
|
|
|
226299
226475
|
init_dist6();
|
|
226300
226476
|
init_dist7();
|
|
226301
226477
|
init_action_catalog_generated();
|
|
226302
|
-
({ mkdirSync: mkdirSync47, readFileSync: readFileSync116, realpathSync:
|
|
226303
|
-
({ 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);
|
|
226304
226480
|
READ = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true };
|
|
226305
226481
|
PLAN = { readOnlyHint: true, destructiveHint: false, idempotentHint: false, openWorldHint: true };
|
|
226306
226482
|
APPLY = { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true };
|
|
@@ -226357,7 +226533,7 @@ var init_tools2 = __esm({
|
|
|
226357
226533
|
};
|
|
226358
226534
|
inside2 = (root, path2) => {
|
|
226359
226535
|
const rel2 = relative20(root, path2);
|
|
226360
|
-
return rel2 !== ".." && !rel2.startsWith(`..${
|
|
226536
|
+
return rel2 !== ".." && !rel2.startsWith(`..${sep23}`) && !isAbsolute13(rel2);
|
|
226361
226537
|
};
|
|
226362
226538
|
identityFile = (ctx, jobId) => join119(ctx.stateDir, "mcp", "web-jobs", `${jobId.replace(/[^A-Za-z0-9_-]/g, "_")}.json`);
|
|
226363
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.");
|
|
@@ -228092,14 +228268,14 @@ __export(apple_keys_exports, {
|
|
|
228092
228268
|
runAppleKeys: () => runAppleKeys
|
|
228093
228269
|
});
|
|
228094
228270
|
import { createPublicKey as createPublicKey5 } from "node:crypto";
|
|
228095
|
-
import { readFileSync as readFileSync117, realpathSync as
|
|
228271
|
+
import { readFileSync as readFileSync117, realpathSync as realpathSync16, statSync as statSync37 } from "node:fs";
|
|
228096
228272
|
function readKey2(flags, kind) {
|
|
228097
228273
|
const names2 = kind === "asc" ? ["asc-key-file", "asc-key-id", "asc-issuer-id"] : ["iap-key", "iap-key-id", "iap-issuer-id"];
|
|
228098
228274
|
if (names2.every((name) => flags[name] === void 0)) return void 0;
|
|
228099
228275
|
const [file2, keyId, issuerId] = names2.map((name) => text14(flags[name]));
|
|
228100
228276
|
if (!file2 || !keyId || !issuerId) throw new UsageError2(`Supply --${names2.join(" --")} together.`);
|
|
228101
228277
|
try {
|
|
228102
|
-
const path2 =
|
|
228278
|
+
const path2 = realpathSync16(file2);
|
|
228103
228279
|
assertCredentialOutsideRepo(names2[0], path2);
|
|
228104
228280
|
if (statSync37(path2).size > 16384) throw new Error("oversized");
|
|
228105
228281
|
const key4 = { keyId, issuerId, key: readFileSync117(path2, "utf8") };
|
|
@@ -228278,9 +228454,9 @@ __export(store_host_exports, {
|
|
|
228278
228454
|
wixTargetOf: () => wixTargetOf
|
|
228279
228455
|
});
|
|
228280
228456
|
import { spawn as spawn7 } from "node:child_process";
|
|
228281
|
-
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";
|
|
228282
228458
|
import { hostname as hostname5, userInfo as userInfo3 } from "node:os";
|
|
228283
|
-
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";
|
|
228284
228460
|
function storeNodeRefusal(version5 = process.versions.node) {
|
|
228285
228461
|
const major = Number(version5.split(".")[0]);
|
|
228286
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.`;
|
|
@@ -228352,7 +228528,7 @@ function appDirFor(appRef2, root, exists2 = existsSync96) {
|
|
|
228352
228528
|
const base2 = resolve78(root);
|
|
228353
228529
|
const ref = appRef2.trim();
|
|
228354
228530
|
const dir = !ref || ref === "." ? base2 : isAbsolute14(ref) ? resolve78(ref) : resolve78(base2, ref);
|
|
228355
|
-
const inside4 = dir === base2 || dir.startsWith(base2.endsWith(
|
|
228531
|
+
const inside4 = dir === base2 || dir.startsWith(base2.endsWith(sep24) ? base2 : base2 + sep24);
|
|
228356
228532
|
if (inside4 && ["config.ts", "config.js", "config.mjs", STORE_FACTS_FILE].some((f2) => exists2(join120(dir, f2)))) return dir;
|
|
228357
228533
|
throw new StoreFactsError(
|
|
228358
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`,
|
|
@@ -228411,13 +228587,13 @@ function privacyAnswersFor(dir, ownerPath, shellOnly, checked, deps, note) {
|
|
|
228411
228587
|
function ownerAnswers(dir, ownerPath, deps, note, rel2, render3) {
|
|
228412
228588
|
let real;
|
|
228413
228589
|
try {
|
|
228414
|
-
real =
|
|
228590
|
+
real = realpathSync17(ownerPath);
|
|
228415
228591
|
} catch {
|
|
228416
228592
|
note(`App Privacy: could not read ${rel2(ownerPath)} to check it against the Himi app's own answers.`);
|
|
228417
228593
|
return ownerPath;
|
|
228418
228594
|
}
|
|
228419
|
-
const realDir =
|
|
228420
|
-
if (real !== realDir && !real.startsWith(realDir +
|
|
228595
|
+
const realDir = realpathSync17(dir);
|
|
228596
|
+
if (real !== realDir && !real.startsWith(realDir + sep24)) {
|
|
228421
228597
|
throw new StoreFactsError(`privacyAnswersFile must be inside the app folder; ${rel2(ownerPath)} is not`, "store_facts_invalid");
|
|
228422
228598
|
}
|
|
228423
228599
|
let raw;
|
|
@@ -228453,16 +228629,16 @@ function factPathIn(dir, realDir, key4, p2, file2 = STORE_FACTS_FILE) {
|
|
|
228453
228629
|
if (isAbsolute14(p2)) throw refuse9();
|
|
228454
228630
|
const base2 = resolve78(dir);
|
|
228455
228631
|
const path2 = resolve78(base2, p2);
|
|
228456
|
-
if (path2 === base2 || !path2.startsWith(base2 +
|
|
228632
|
+
if (path2 === base2 || !path2.startsWith(base2 + sep24)) throw refuse9();
|
|
228457
228633
|
let probe2 = path2;
|
|
228458
228634
|
while (!existsSync96(probe2) && probe2 !== base2) probe2 = dirname58(probe2);
|
|
228459
228635
|
let real;
|
|
228460
228636
|
try {
|
|
228461
|
-
real =
|
|
228637
|
+
real = realpathSync17(probe2);
|
|
228462
228638
|
} catch {
|
|
228463
228639
|
throw refuse9();
|
|
228464
228640
|
}
|
|
228465
|
-
if (real !== realDir && !real.startsWith(realDir +
|
|
228641
|
+
if (real !== realDir && !real.startsWith(realDir + sep24)) throw refuse9();
|
|
228466
228642
|
return path2;
|
|
228467
228643
|
}
|
|
228468
228644
|
async function appFactsFor(dir, deps) {
|
|
@@ -228500,7 +228676,7 @@ async function appFactsFor(dir, deps) {
|
|
|
228500
228676
|
...str8(file2.sku) ? { sku: str8(file2.sku) } : {},
|
|
228501
228677
|
...str8(file2.buildNumber) ? { buildNumber: str8(file2.buildNumber) } : {}
|
|
228502
228678
|
};
|
|
228503
|
-
const realDir =
|
|
228679
|
+
const realDir = realpathSync17(dir);
|
|
228504
228680
|
for (const key4 of FILE_FACTS) {
|
|
228505
228681
|
const p2 = str8(file2[key4]);
|
|
228506
228682
|
if (p2) facts[key4] = factPathIn(dir, realDir, key4, p2);
|
|
@@ -229501,8 +229677,8 @@ __export(browser_authoring_exports, {
|
|
|
229501
229677
|
});
|
|
229502
229678
|
import { createServer as createServer6 } from "node:http";
|
|
229503
229679
|
import { createHash as createHash66, randomBytes as randomBytes17 } from "node:crypto";
|
|
229504
|
-
import { existsSync as existsSync101, readdirSync as readdirSync47, readFileSync as readFileSync122, realpathSync as
|
|
229505
|
-
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";
|
|
229506
229682
|
function humanMs(ms2) {
|
|
229507
229683
|
return ms2 < 1e3 ? `${ms2}ms` : `${Math.round(ms2 / 1e3)}s`;
|
|
229508
229684
|
}
|
|
@@ -229511,7 +229687,7 @@ function collectWorkerSources(tier5SrcDir, bundleName) {
|
|
|
229511
229687
|
const files = {};
|
|
229512
229688
|
const visitedDirs = /* @__PURE__ */ new Set();
|
|
229513
229689
|
const walk4 = (abs, rel2) => {
|
|
229514
|
-
const real =
|
|
229690
|
+
const real = realpathSync18(abs);
|
|
229515
229691
|
if (visitedDirs.has(real)) return;
|
|
229516
229692
|
visitedDirs.add(real);
|
|
229517
229693
|
for (const name of readdirSync47(abs).sort()) {
|
|
@@ -229552,7 +229728,7 @@ function collectRelativeSiblings(files, tier5SrcDir) {
|
|
|
229552
229728
|
];
|
|
229553
229729
|
for (const abs of candidates) {
|
|
229554
229730
|
if (!existsSync101(abs) || statSync38(abs).isDirectory()) continue;
|
|
229555
|
-
const key4 = `/tier5-src/${relative23(tier5SrcDir, abs).split(
|
|
229731
|
+
const key4 = `/tier5-src/${relative23(tier5SrcDir, abs).split(sep25).join(posix3.sep)}`;
|
|
229556
229732
|
if (key4 in files) break;
|
|
229557
229733
|
files[key4] = readFileSync122(abs, "utf8");
|
|
229558
229734
|
queue.push(key4);
|
|
@@ -231611,7 +231787,7 @@ __export(shot_files_exports, {
|
|
|
231611
231787
|
});
|
|
231612
231788
|
import { createHash as createHash69 } from "node:crypto";
|
|
231613
231789
|
import { mkdirSync as mkdirSync52, readdirSync as readdirSync48, readFileSync as readFileSync126, rmSync as rmSync27, statSync as statSync40 } from "node:fs";
|
|
231614
|
-
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";
|
|
231615
231791
|
function writeAtomic2(file2, bytes2) {
|
|
231616
231792
|
for (let attempt2 = 0; ; attempt2++) {
|
|
231617
231793
|
mkdirSync52(dirname61(file2), { recursive: true });
|
|
@@ -231636,7 +231812,7 @@ function writeScreenShot(dir, screenId, base64) {
|
|
|
231636
231812
|
function inside3(base2, rel2) {
|
|
231637
231813
|
const root = resolve84(base2);
|
|
231638
231814
|
const p2 = resolve84(root, rel2);
|
|
231639
|
-
return p2.startsWith(root +
|
|
231815
|
+
return p2.startsWith(root + sep26) ? p2 : null;
|
|
231640
231816
|
}
|
|
231641
231817
|
function pruneRenders(dir, opts = {}) {
|
|
231642
231818
|
try {
|
|
@@ -231699,7 +231875,7 @@ function pruneStaleShots(dir, keepScreenIds, now = Date.now()) {
|
|
|
231699
231875
|
if (mtime !== null && now - mtime >= STALE_TMP_MS) rmSync27(f2, { force: true });
|
|
231700
231876
|
continue;
|
|
231701
231877
|
}
|
|
231702
|
-
const screenId = relative24(root, f2).split(
|
|
231878
|
+
const screenId = relative24(root, f2).split(sep26).join("/").replace(/\.png$/, "");
|
|
231703
231879
|
if (!keepScreenIds.has(screenId)) rmSync27(f2, { force: true });
|
|
231704
231880
|
}
|
|
231705
231881
|
}
|
|
@@ -235185,8 +235361,8 @@ __export(validate_design_exports, {
|
|
|
235185
235361
|
validateDesign: () => validateDesign
|
|
235186
235362
|
});
|
|
235187
235363
|
import { randomBytes as randomBytes18 } from "node:crypto";
|
|
235188
|
-
import { closeSync as closeSync11, constants as constants9, existsSync as existsSync110, lstatSync as lstatSync33, openSync as openSync10, readFileSync as readFileSync133, realpathSync as
|
|
235189
|
-
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";
|
|
235190
235366
|
import ts19 from "typescript";
|
|
235191
235367
|
function readColorToken(tokens2, name) {
|
|
235192
235368
|
const entry = obj5(tokens2.colors)?.[name];
|
|
@@ -235408,14 +235584,14 @@ function writableTokensPath(contentDir2, location) {
|
|
|
235408
235584
|
if (isAbsolute16(location) || win32.isAbsolute(location) || location.split(/[\\/]/).includes("..")) {
|
|
235409
235585
|
throw new Error("--fix requires a token path inside the content directory without traversal.");
|
|
235410
235586
|
}
|
|
235411
|
-
const root =
|
|
235587
|
+
const root = realpathSync19(contentDir2);
|
|
235412
235588
|
const path2 = resolve87(root, location);
|
|
235413
235589
|
const rel2 = relative25(root, path2);
|
|
235414
|
-
if (!rel2 || rel2 === ".." || rel2.startsWith(`..${
|
|
235590
|
+
if (!rel2 || rel2 === ".." || rel2.startsWith(`..${sep27}`) || isAbsolute16(rel2)) {
|
|
235415
235591
|
throw new Error("--fix requires a token path inside the content directory.");
|
|
235416
235592
|
}
|
|
235417
235593
|
let current = root;
|
|
235418
|
-
const parts = rel2.split(
|
|
235594
|
+
const parts = rel2.split(sep27);
|
|
235419
235595
|
for (const [index, part4] of parts.entries()) {
|
|
235420
235596
|
current = join139(current, part4);
|
|
235421
235597
|
const stat9 = lstatSync33(current);
|
|
@@ -235423,8 +235599,8 @@ function writableTokensPath(contentDir2, location) {
|
|
|
235423
235599
|
throw new Error("--fix requires a regular token file under directories without symlinks.");
|
|
235424
235600
|
}
|
|
235425
235601
|
}
|
|
235426
|
-
const real = relative25(root,
|
|
235427
|
-
if (!real || real === ".." || real.startsWith(`..${
|
|
235602
|
+
const real = relative25(root, realpathSync19(path2));
|
|
235603
|
+
if (!real || real === ".." || real.startsWith(`..${sep27}`) || isAbsolute16(real)) {
|
|
235428
235604
|
throw new Error("--fix cannot write outside the content directory.");
|
|
235429
235605
|
}
|
|
235430
235606
|
return path2;
|
|
@@ -235620,11 +235796,11 @@ function validateDesign(evidenceDir, contentDir2, options2 = {}) {
|
|
|
235620
235796
|
};
|
|
235621
235797
|
}
|
|
235622
235798
|
function safeEvidencePath(contentDir2, name) {
|
|
235623
|
-
const root =
|
|
235799
|
+
const root = realpathSync19(contentDir2);
|
|
235624
235800
|
const dir = realDirIn(root, ".himi/one-app");
|
|
235625
235801
|
if (!dir) throw new Error("The design evidence directory is not a regular directory.");
|
|
235626
|
-
const real = relative25(root,
|
|
235627
|
-
if (!real || real === ".." || real.startsWith(`..${
|
|
235802
|
+
const real = relative25(root, realpathSync19(dir));
|
|
235803
|
+
if (!real || real === ".." || real.startsWith(`..${sep27}`) || isAbsolute16(real)) {
|
|
235628
235804
|
throw new Error("The design evidence directory is outside the content directory.");
|
|
235629
235805
|
}
|
|
235630
235806
|
const path2 = join139(dir, name);
|
|
@@ -243674,7 +243850,7 @@ var init_credential_profile = __esm({
|
|
|
243674
243850
|
|
|
243675
243851
|
// ../store-release/iap-credentials.ts
|
|
243676
243852
|
import { createHash as createHash75 } from "node:crypto";
|
|
243677
|
-
import { existsSync as existsSync119, readFileSync as readFileSync144, realpathSync as
|
|
243853
|
+
import { existsSync as existsSync119, readFileSync as readFileSync144, realpathSync as realpathSync20 } from "node:fs";
|
|
243678
243854
|
import { homedir as homedir17 } from "node:os";
|
|
243679
243855
|
function accountFingerprint(keyId, issuerId) {
|
|
243680
243856
|
return `sha256:${createHash75("sha256").update(`${issuerId}:${keyId}`).digest("hex").slice(0, 16)}`;
|
|
@@ -243712,7 +243888,7 @@ function resolveIapCredentials(options2) {
|
|
|
243712
243888
|
const { target } = options2;
|
|
243713
243889
|
const home2 = options2.home ?? homedir17();
|
|
243714
243890
|
const readFile21 = options2.readFile ?? ((p2) => readFileSync144(p2, "utf8"));
|
|
243715
|
-
const realpath2 = options2.realpath ??
|
|
243891
|
+
const realpath2 = options2.realpath ?? realpathSync20;
|
|
243716
243892
|
const profile = requireExplicitProfile(options2.profileFlag, target);
|
|
243717
243893
|
const creds = resolveStoreCredentials({
|
|
243718
243894
|
app: target.himiApp,
|
|
@@ -245131,7 +245307,7 @@ __export(store_iap_exports, {
|
|
|
245131
245307
|
});
|
|
245132
245308
|
import { execFileSync as execFileSync8 } from "node:child_process";
|
|
245133
245309
|
import { randomUUID as randomUUID17 } from "node:crypto";
|
|
245134
|
-
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";
|
|
245135
245311
|
import { homedir as homedir18, hostname as hostname6 } from "node:os";
|
|
245136
245312
|
import { dirname as dirname67, join as join153, resolve as resolve97 } from "node:path";
|
|
245137
245313
|
function scrubDeep(value2, scrub) {
|
|
@@ -245531,7 +245707,7 @@ function readInAppPurchaseKey(flags, deps, creds) {
|
|
|
245531
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}"`);
|
|
245532
245708
|
let privateKey2;
|
|
245533
245709
|
try {
|
|
245534
|
-
assertCredentialOutsideRepo("--iap-key", (deps.realpath ??
|
|
245710
|
+
assertCredentialOutsideRepo("--iap-key", (deps.realpath ?? realpathSync21)(path2));
|
|
245535
245711
|
privateKey2 = readInput2(deps, path2, "In-App Purchase key");
|
|
245536
245712
|
} catch (error) {
|
|
245537
245713
|
throw new KeyError(error.message);
|
|
@@ -251409,7 +251585,7 @@ var init_analyze = __esm({
|
|
|
251409
251585
|
|
|
251410
251586
|
// src/base44-analyze/write-artifacts.ts
|
|
251411
251587
|
import { existsSync as existsSync134, mkdirSync as mkdirSync61, readFileSync as readFileSync163, rmSync as rmSync38, writeFileSync as writeFileSync62 } from "node:fs";
|
|
251412
|
-
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";
|
|
251413
251589
|
function isBookFolder(dir) {
|
|
251414
251590
|
try {
|
|
251415
251591
|
return JSON.parse(readFileSync163(join169(dir, "book.json"), "utf8")).kind === "base44-app-book";
|
|
@@ -251517,7 +251693,7 @@ function writeBase44Book(result, outDir, opts = {}) {
|
|
|
251517
251693
|
for (const f2 of result.sourceFiles) {
|
|
251518
251694
|
if (!safeRel(f2.path)) continue;
|
|
251519
251695
|
const dest = join169(sourceRoot, ...f2.path.split("/"));
|
|
251520
|
-
if (!dest.startsWith(sourceRoot +
|
|
251696
|
+
if (!dest.startsWith(sourceRoot + sep28)) continue;
|
|
251521
251697
|
mkdirSync61(dirname76(dest), { recursive: true });
|
|
251522
251698
|
writeFileSync62(dest, f2.bytes);
|
|
251523
251699
|
}
|
|
@@ -259784,7 +259960,7 @@ __export(cli_exports2, {
|
|
|
259784
259960
|
ONE_APP_WORKFLOW: () => ONE_APP_WORKFLOW,
|
|
259785
259961
|
runOneAppCommand: () => runOneAppCommand
|
|
259786
259962
|
});
|
|
259787
|
-
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";
|
|
259788
259964
|
import { createHash as createHash89 } from "node:crypto";
|
|
259789
259965
|
import { isIP as isIP2 } from "node:net";
|
|
259790
259966
|
import { dirname as dirname78, join as join180, parse as parse8, resolve as resolve113 } from "node:path";
|
|
@@ -260031,7 +260207,7 @@ validate-payments checks site-bound payment evidence and explicit paid-flow deci
|
|
|
260031
260207
|
mkdirSync64(options2.parentDir, { recursive: true, mode: 448 });
|
|
260032
260208
|
assertSafeParents(options2.parentDir);
|
|
260033
260209
|
mkdirSync64(options2.workspace, { mode: 448 });
|
|
260034
|
-
if (
|
|
260210
|
+
if (realpathSync23(options2.workspace) !== options2.workspace) throw new Error("destination changed");
|
|
260035
260211
|
evidenceDir = join180(options2.workspace, ".himi", "one-app");
|
|
260036
260212
|
mkdirSync64(evidenceDir, { recursive: true, mode: 448 });
|
|
260037
260213
|
} catch (error) {
|
|
@@ -262350,8 +262526,8 @@ var init_customer_build = __esm({
|
|
|
262350
262526
|
});
|
|
262351
262527
|
|
|
262352
262528
|
// src/site-analyze/apply.ts
|
|
262353
|
-
import { existsSync as existsSync144, readFileSync as readFileSync174, writeFileSync as writeFileSync70, copyFileSync as copyFileSync2, mkdirSync as mkdirSync65, realpathSync as
|
|
262354
|
-
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";
|
|
262355
262531
|
import { spawnSync as spawnSync11 } from "node:child_process";
|
|
262356
262532
|
function inRepoBakeRefusal(repoRoot2, shell) {
|
|
262357
262533
|
if (isBrandable(repoRoot2, shell)) return null;
|
|
@@ -262543,7 +262719,7 @@ function buildMergedContract(options2) {
|
|
|
262543
262719
|
const contained = (root, rel2) => {
|
|
262544
262720
|
if (isAbsolute17(rel2)) return void 0;
|
|
262545
262721
|
const full = resolve114(root, rel2);
|
|
262546
|
-
return full.startsWith(resolve114(root) +
|
|
262722
|
+
return full.startsWith(resolve114(root) + sep29) ? full : void 0;
|
|
262547
262723
|
};
|
|
262548
262724
|
const stage = (fromRel, toRel) => {
|
|
262549
262725
|
const from = contained(packageDir, fromRel);
|
|
@@ -262552,12 +262728,12 @@ function buildMergedContract(options2) {
|
|
|
262552
262728
|
let real;
|
|
262553
262729
|
let realRoot;
|
|
262554
262730
|
try {
|
|
262555
|
-
real =
|
|
262556
|
-
realRoot =
|
|
262731
|
+
real = realpathSync24(from);
|
|
262732
|
+
realRoot = realpathSync24(packageDir);
|
|
262557
262733
|
} catch {
|
|
262558
262734
|
return void 0;
|
|
262559
262735
|
}
|
|
262560
|
-
if (!real.startsWith(realRoot +
|
|
262736
|
+
if (!real.startsWith(realRoot + sep29)) return void 0;
|
|
262561
262737
|
try {
|
|
262562
262738
|
if (!statSync49(real).isFile()) return void 0;
|
|
262563
262739
|
mkdirSync65(dirname79(to2), { recursive: true });
|
|
@@ -266367,8 +266543,8 @@ __export(fidelity_exports, {
|
|
|
266367
266543
|
himalayaRepoRoot: () => himalayaRepoRoot
|
|
266368
266544
|
});
|
|
266369
266545
|
import { execFileSync as execFileSync10 } from "node:child_process";
|
|
266370
|
-
import { existsSync as existsSync150, realpathSync as
|
|
266371
|
-
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";
|
|
266372
266548
|
function himalayaRepoRoot(dir) {
|
|
266373
266549
|
let top;
|
|
266374
266550
|
try {
|
|
@@ -266377,8 +266553,8 @@ function himalayaRepoRoot(dir) {
|
|
|
266377
266553
|
return null;
|
|
266378
266554
|
}
|
|
266379
266555
|
if (!existsSync150(join190(top, "tools/judges/fidelity/JUDGE.md"))) return null;
|
|
266380
|
-
const rel2 = relative31(
|
|
266381
|
-
return rel2.startsWith(`..${
|
|
266556
|
+
const rel2 = relative31(realpathSync25(top), realpathSync25(dir));
|
|
266557
|
+
return rel2.startsWith(`..${sep30}`) || rel2 === ".." ? null : top;
|
|
266382
266558
|
}
|
|
266383
266559
|
function fidelityEnvelope(report9) {
|
|
266384
266560
|
return report9.status === "fail" ? { ok: false, code: "fidelity_rows_failed", ...report9 } : { ok: true, ...report9 };
|
|
@@ -276880,7 +277056,7 @@ import {
|
|
|
276880
277056
|
openSync as openSync11,
|
|
276881
277057
|
readFileSync as readFileSync157,
|
|
276882
277058
|
readdirSync as readdirSync55,
|
|
276883
|
-
realpathSync as
|
|
277059
|
+
realpathSync as realpathSync22,
|
|
276884
277060
|
renameSync as renameSync23,
|
|
276885
277061
|
rmSync as rmSync36,
|
|
276886
277062
|
statSync as statSync46,
|
|
@@ -277120,8 +277296,8 @@ async function l10nCommand(ctx) {
|
|
|
277120
277296
|
try {
|
|
277121
277297
|
mkdirSync58(join162(appDir3, "l10n"), { recursive: true });
|
|
277122
277298
|
const swapped = unsafeDestination(appDir3, requested);
|
|
277123
|
-
const l10nReal =
|
|
277124
|
-
if (swapped !== void 0 || l10nReal !== join162(
|
|
277299
|
+
const l10nReal = realpathSync22(join162(appDir3, "l10n"));
|
|
277300
|
+
if (swapped !== void 0 || l10nReal !== join162(realpathSync22(appDir3), "l10n")) {
|
|
277125
277301
|
throw new UnsafePath(swapped ?? `${join162(appDir3, "l10n")} resolves outside the app`);
|
|
277126
277302
|
}
|
|
277127
277303
|
for (const tag of requested) {
|