@wix/himalaya-cli 0.1674.0 → 0.1675.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/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/serve-runtime/src/wix-bridge.d.ts +13 -0
- package/dist/browser-plane/sw.js +5 -5
- package/dist/cli.mjs +143 -12
- package/guides/himi-json-output.md +17 -1
- package/guides/one-app-to-himi-app.md +18 -3
- package/guides/qa-builds.md +8 -2
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -51,6 +51,7 @@ __export(client_exports, {
|
|
|
51
51
|
MAX_PUBLISH_BODY_BYTES: () => MAX_PUBLISH_BODY_BYTES,
|
|
52
52
|
ServeCliClient: () => ServeCliClient,
|
|
53
53
|
encodePublishBody: () => encodePublishBody,
|
|
54
|
+
measurePublishBody: () => measurePublishBody,
|
|
54
55
|
publishReleaseBody: () => publishReleaseBody,
|
|
55
56
|
publishReleaseBodyBytes: () => publishReleaseBodyBytes,
|
|
56
57
|
publishReleaseWireBytes: () => publishReleaseWireBytes
|
|
@@ -66,12 +67,19 @@ function publishReleaseWireBytes(payload, meta, draft = false) {
|
|
|
66
67
|
return encodePublishBody(publishReleaseBody(payload, meta, draft)).bytes.byteLength;
|
|
67
68
|
}
|
|
68
69
|
function encodePublishBody(body) {
|
|
69
|
-
|
|
70
|
+
return encodePlainPublishBody(Buffer.from(JSON.stringify(body), "utf8"));
|
|
71
|
+
}
|
|
72
|
+
function encodePlainPublishBody(plain2) {
|
|
70
73
|
if (plain2.byteLength <= MAX_PUBLISH_BODY_BYTES || plain2.byteLength > MAX_DECODED_PUBLISH_BODY_BYTES) {
|
|
71
74
|
return { bytes: plain2, gzip: false };
|
|
72
75
|
}
|
|
73
76
|
return { bytes: gzipSync(plain2), gzip: true };
|
|
74
77
|
}
|
|
78
|
+
function measurePublishBody(payload, meta, draft = false) {
|
|
79
|
+
const plain2 = Buffer.from(JSON.stringify(publishReleaseBody(payload, meta, draft)), "utf8");
|
|
80
|
+
const { bytes: bytes2, gzip } = encodePlainPublishBody(plain2);
|
|
81
|
+
return { bodyBytes: plain2.byteLength, wireBytes: bytes2.byteLength, gzip };
|
|
82
|
+
}
|
|
75
83
|
var MAX_PUBLISH_BODY_BYTES, MAX_DECODED_PUBLISH_BODY_BYTES, CREDENTIAL_HEADERS, ServeCliClient;
|
|
76
84
|
var init_client = __esm({
|
|
77
85
|
"../serve-cli/src/client.ts"() {
|
|
@@ -3143,6 +3151,7 @@ __export(dist_jobs_exports, {
|
|
|
3143
3151
|
distJobSpec: () => distJobSpec,
|
|
3144
3152
|
encodeDistParams: () => encodeDistParams,
|
|
3145
3153
|
failureCodesOf: () => failureCodesOf,
|
|
3154
|
+
hasJobServiceEnded: () => hasJobServiceEnded,
|
|
3146
3155
|
isBorrowableIosId: () => isBorrowableIosId,
|
|
3147
3156
|
isSuccess: () => isSuccess,
|
|
3148
3157
|
isTerminal: () => isTerminal,
|
|
@@ -3160,6 +3169,9 @@ __export(dist_jobs_exports, {
|
|
|
3160
3169
|
function isTerminal(status) {
|
|
3161
3170
|
return !!status && !IN_FLIGHT.has(status);
|
|
3162
3171
|
}
|
|
3172
|
+
function hasJobServiceEnded(status) {
|
|
3173
|
+
return !!status && JOB_SERVICE_ENDED.has(status);
|
|
3174
|
+
}
|
|
3163
3175
|
function isSuccess(status) {
|
|
3164
3176
|
return status === "SUCCESS";
|
|
3165
3177
|
}
|
|
@@ -3480,7 +3492,7 @@ function distJobSpec(req) {
|
|
|
3480
3492
|
...req.xcodeVersion ? { xcodeVersion: req.xcodeVersion } : {}
|
|
3481
3493
|
};
|
|
3482
3494
|
}
|
|
3483
|
-
var DIST_ERROR_CODES, APPLE_ERROR_CODES_MAX, IN_FLIGHT, SCOPE_CREATE, SCOPE_READ, SCOPE_CANCEL, DEFAULT_BASE_URL, DEFAULT_OAUTH_URL, TOKEN_TTL_MS, JobServiceError, JobServiceBroker, CUSTOMER_UPLOAD_LEASE_MS, CUSTOMER_UPLOAD_RETRY_DELAYS_MS, CUSTOMER_UPLOAD_MAX_ATTEMPTS, CUSTOMER_UPLOAD_ABANDONED, MAX_MEASURABLE_IDENTITY_WINDOW, DIST_SHELLS, DEFAULT_DIST_SHELL, DEFAULT_BORROWABLE_IOS_IDS, BUNDLE_ID_RE, DEFAULT_DIST_SIGNING, WIX_MANAGED_SIGNING_ALIASES, DEFAULT_ANDROID_SIGNING, ANDROID_SIGNING_POLICIES, ANDROID_SIGNING_ALIASES, DEFAULT_ANDROID_FORMAT, ANDROID_FORMATS, ANDROID_FORMAT_NOT_BUILT, ANDROID_FORMAT_WRONG_SIGNER, ANDROID_FORMAT_NOT_REQUESTED, DEFAULT_ANDROID_BUILD_TYPE, ANDROID_BUILD_TYPES, ANDROID_BUILD_TYPE_NOT_BUILT, DEFAULT_GIT_URL, DIST_PACKAGE_NAME, DIST_PARAMS_FLAG, MAX_COMMAND_CHARS;
|
|
3495
|
+
var DIST_ERROR_CODES, APPLE_ERROR_CODES_MAX, IN_FLIGHT, JOB_SERVICE_ENDED, SCOPE_CREATE, SCOPE_READ, SCOPE_CANCEL, DEFAULT_BASE_URL, DEFAULT_OAUTH_URL, TOKEN_TTL_MS, JobServiceError, JobServiceBroker, CUSTOMER_UPLOAD_LEASE_MS, CUSTOMER_UPLOAD_RETRY_DELAYS_MS, CUSTOMER_UPLOAD_MAX_ATTEMPTS, CUSTOMER_UPLOAD_ABANDONED, MAX_MEASURABLE_IDENTITY_WINDOW, DIST_SHELLS, DEFAULT_DIST_SHELL, DEFAULT_BORROWABLE_IOS_IDS, BUNDLE_ID_RE, DEFAULT_DIST_SIGNING, WIX_MANAGED_SIGNING_ALIASES, DEFAULT_ANDROID_SIGNING, ANDROID_SIGNING_POLICIES, ANDROID_SIGNING_ALIASES, DEFAULT_ANDROID_FORMAT, ANDROID_FORMATS, ANDROID_FORMAT_NOT_BUILT, ANDROID_FORMAT_WRONG_SIGNER, ANDROID_FORMAT_NOT_REQUESTED, DEFAULT_ANDROID_BUILD_TYPE, ANDROID_BUILD_TYPES, ANDROID_BUILD_TYPE_NOT_BUILT, DEFAULT_GIT_URL, DIST_PACKAGE_NAME, DIST_PARAMS_FLAG, MAX_COMMAND_CHARS;
|
|
3484
3496
|
var init_dist_jobs = __esm({
|
|
3485
3497
|
"../../core/serve-control/src/dist-jobs.ts"() {
|
|
3486
3498
|
init_define_HHP_CATALOG();
|
|
@@ -3517,6 +3529,7 @@ var init_dist_jobs = __esm({
|
|
|
3517
3529
|
];
|
|
3518
3530
|
APPLE_ERROR_CODES_MAX = 5;
|
|
3519
3531
|
IN_FLIGHT = /* @__PURE__ */ new Set(["CREATED", "QUEUED", "WORKING"]);
|
|
3532
|
+
JOB_SERVICE_ENDED = /* @__PURE__ */ new Set(["SUCCESS", "FAILURE", "CANCELED", "TIMEOUT", "INTERNAL_ERROR"]);
|
|
3520
3533
|
SCOPE_CREATE = "MRE.JOB_CREATE";
|
|
3521
3534
|
SCOPE_READ = "MRE.JOB_READ";
|
|
3522
3535
|
SCOPE_CANCEL = "MRE.CANCEL_JOB";
|
|
@@ -220433,6 +220446,73 @@ var init_release_patch2 = __esm({
|
|
|
220433
220446
|
}
|
|
220434
220447
|
});
|
|
220435
220448
|
|
|
220449
|
+
// src/publish-admission.ts
|
|
220450
|
+
var publish_admission_exports = {};
|
|
220451
|
+
__export(publish_admission_exports, {
|
|
220452
|
+
admitPublishBody: () => admitPublishBody,
|
|
220453
|
+
compressedPublishEligibility: () => compressedPublishEligibility,
|
|
220454
|
+
compressionNote: () => compressionNote,
|
|
220455
|
+
planCompressedUpload: () => planCompressedUpload,
|
|
220456
|
+
publishSizeFields: () => publishSizeFields
|
|
220457
|
+
});
|
|
220458
|
+
function compressedPublishEligibility(token) {
|
|
220459
|
+
if (!token) return "unknown";
|
|
220460
|
+
const parts = token.split(".");
|
|
220461
|
+
if (parts.length !== 2 || !parts[0] || !parts[1]) return "unknown";
|
|
220462
|
+
const claims = decodeControlTokenClaims(token);
|
|
220463
|
+
if (!claims) return "unknown";
|
|
220464
|
+
if (claims.selfServe === true || claims.siteLease !== void 0) return "self_serve";
|
|
220465
|
+
if (claims.selfServe !== void 0) return "unknown";
|
|
220466
|
+
return typeof claims.sub === "string" && typeof claims.role === "string" && typeof claims.exp === "number" ? "eligible" : "unknown";
|
|
220467
|
+
}
|
|
220468
|
+
function admitPublishBody(size, ctx) {
|
|
220469
|
+
if (size.bodyBytes <= MAX_PUBLISH_BODY_BYTES) return { ok: true };
|
|
220470
|
+
if (size.bodyBytes > MAX_DECODED_PUBLISH_BODY_BYTES) return { ok: false, compressedUpload: "decoded_limit_exceeded" };
|
|
220471
|
+
if (ctx.eligibility === "self_serve") return { ok: false, compressedUpload: "self_serve_credential" };
|
|
220472
|
+
if (ctx.eligibility !== "eligible") return { ok: false, compressedUpload: "credential_unverified" };
|
|
220473
|
+
if (!size.gzip || size.wireBytes > MAX_PUBLISH_BODY_BYTES) return { ok: false, compressedUpload: "wire_limit_exceeded" };
|
|
220474
|
+
return { ok: true };
|
|
220475
|
+
}
|
|
220476
|
+
function planCompressedUpload(size, reserveBytes, gzipBytes) {
|
|
220477
|
+
const planningBytes = size.bodyBytes + reserveBytes;
|
|
220478
|
+
const planningWireBytes = planningBytes <= MAX_PUBLISH_BODY_BYTES || planningBytes > MAX_DECODED_PUBLISH_BODY_BYTES ? planningBytes : (size.gzip ? size.wireBytes : gzipBytes()) + reserveBytes;
|
|
220479
|
+
return {
|
|
220480
|
+
planningWireBytes,
|
|
220481
|
+
fitsIfEligible: planningBytes <= MAX_DECODED_PUBLISH_BODY_BYTES && planningWireBytes <= MAX_PUBLISH_BODY_BYTES
|
|
220482
|
+
};
|
|
220483
|
+
}
|
|
220484
|
+
function publishSizeFields(size, compressedUpload) {
|
|
220485
|
+
return {
|
|
220486
|
+
overageBytes: Math.max(0, size.bodyBytes - MAX_PUBLISH_BODY_BYTES),
|
|
220487
|
+
decodedLimit: MAX_DECODED_PUBLISH_BODY_BYTES,
|
|
220488
|
+
decodedOverageBytes: Math.max(0, size.bodyBytes - MAX_DECODED_PUBLISH_BODY_BYTES),
|
|
220489
|
+
// Only when the client would actually compress this body; over the decoded cap it is sent plain.
|
|
220490
|
+
...size.gzip ? {
|
|
220491
|
+
wireBytes: size.wireBytes,
|
|
220492
|
+
wireLimit: MAX_PUBLISH_BODY_BYTES,
|
|
220493
|
+
wireOverageBytes: Math.max(0, size.wireBytes - MAX_PUBLISH_BODY_BYTES)
|
|
220494
|
+
} : {},
|
|
220495
|
+
compressedUpload
|
|
220496
|
+
};
|
|
220497
|
+
}
|
|
220498
|
+
function compressionNote(size, refusal2) {
|
|
220499
|
+
return COMPRESSION_NOTES[refusal2](size);
|
|
220500
|
+
}
|
|
220501
|
+
var COMPRESSION_NOTES;
|
|
220502
|
+
var init_publish_admission = __esm({
|
|
220503
|
+
"src/publish-admission.ts"() {
|
|
220504
|
+
init_define_HHP_CATALOG();
|
|
220505
|
+
init_owner_claim();
|
|
220506
|
+
init_client();
|
|
220507
|
+
COMPRESSION_NOTES = {
|
|
220508
|
+
decoded_limit_exceeded: () => `The body is over the ${MAX_DECODED_PUBLISH_BODY_BYTES}-byte decoded limit, so no transport can carry it.`,
|
|
220509
|
+
self_serve_credential: (s2) => `A gzip upload (${s2.wireBytes} bytes) is not accepted for a self-serve credential, which keeps the ${MAX_PUBLISH_BODY_BYTES}-byte plain limit.`,
|
|
220510
|
+
credential_unverified: (s2) => `A gzip upload (${s2.wireBytes} bytes) is accepted only for a provisioned, non-self-serve control token, and this credential cannot be read as one, so the ${MAX_PUBLISH_BODY_BYTES}-byte plain limit applies.`,
|
|
220511
|
+
wire_limit_exceeded: (s2) => `Even gzipped, the upload is ${s2.wireBytes} bytes, over the ${MAX_PUBLISH_BODY_BYTES}-byte wire limit.`
|
|
220512
|
+
};
|
|
220513
|
+
}
|
|
220514
|
+
});
|
|
220515
|
+
|
|
220436
220516
|
// src/publish-size.ts
|
|
220437
220517
|
var publish_size_exports = {};
|
|
220438
220518
|
__export(publish_size_exports, {
|
|
@@ -248281,6 +248361,7 @@ var init_push_errors = __esm({
|
|
|
248281
248361
|
"push_failed",
|
|
248282
248362
|
"binary_capability_gap",
|
|
248283
248363
|
"depth_budget_exceeded",
|
|
248364
|
+
"compressed_publish_unsupported",
|
|
248284
248365
|
"one_app_readiness_failed",
|
|
248285
248366
|
"placeholder_site_binding",
|
|
248286
248367
|
"auth_provider_invalid"
|
|
@@ -249468,7 +249549,7 @@ async function publishSizeCommand(ctx) {
|
|
|
249468
249549
|
const { appId: appId3, contentDir: contentDir2, loadAuthoring: loadAuthoring2, resolutionFlag: resolutionFlag2, commandScratchDir: commandScratchDir2 } = await Promise.resolve().then(() => (init_cli_shared(), cli_shared_exports));
|
|
249469
249550
|
const { collectAppSource: collectAppSource2, secretFindings: secretFindings2, zipAppSource: zipAppSource2, MAX_APP_SOURCE_BYTES: MAX_APP_SOURCE_BYTES2 } = await Promise.resolve().then(() => (init_app_source(), app_source_exports));
|
|
249470
249551
|
const { composeReleasePayload: composeReleasePayload2, loadReleaseFromDir: loadReleaseFromDir2 } = await Promise.resolve().then(() => (init_release(), release_exports));
|
|
249471
|
-
const { publishReleaseBodyBytes: publishReleaseBodyBytes2, MAX_PUBLISH_BODY_BYTES: MAX_PUBLISH_BODY_BYTES2 } = await Promise.resolve().then(() => (init_client(), client_exports));
|
|
249552
|
+
const { measurePublishBody: measurePublishBody2, publishReleaseBody: publishReleaseBody2, publishReleaseBodyBytes: publishReleaseBodyBytes2, MAX_PUBLISH_BODY_BYTES: MAX_PUBLISH_BODY_BYTES2, MAX_DECODED_PUBLISH_BODY_BYTES: MAX_DECODED_PUBLISH_BODY_BYTES2 } = await Promise.resolve().then(() => (init_client(), client_exports));
|
|
249472
249553
|
if (reserveBytes > MAX_PUBLISH_BODY_BYTES2) return fail10("invalid_usage", "--reserve-bytes exceeds the entire publish budget", {}, 2);
|
|
249473
249554
|
const { installContainedDevModuleRealm: installContainedDevModuleRealm2 } = await Promise.resolve().then(() => (init_contained_dev_module(), contained_dev_module_exports));
|
|
249474
249555
|
const { installContainedAppConfigRealm: installContainedAppConfigRealm2 } = await Promise.resolve().then(() => (init_app_config_loader(), app_config_loader_exports));
|
|
@@ -249516,9 +249597,15 @@ async function publishSizeCommand(ctx) {
|
|
|
249516
249597
|
const archive = zipAppSource2(collected.entries);
|
|
249517
249598
|
const encoded3 = archive.toString("base64");
|
|
249518
249599
|
const payload = await loadReleaseFromDir2(declared, out2);
|
|
249519
|
-
const
|
|
249600
|
+
const releaseBody = composeReleasePayload2(payload, app2, encoded3);
|
|
249601
|
+
const { bodyBytes, wireBytes, gzip } = measurePublishBody2(releaseBody, void 0, true);
|
|
249520
249602
|
const minimumBodyBytes = publishReleaseBodyBytes2(composeReleasePayload2(payload, "", encoded3), void 0, true);
|
|
249521
249603
|
const planningBytes = bodyBytes + reserveBytes;
|
|
249604
|
+
const { planCompressedUpload: planCompressedUpload2 } = await Promise.resolve().then(() => (init_publish_admission(), publish_admission_exports));
|
|
249605
|
+
const { gzipSync: gzipSync3 } = await import("node:zlib");
|
|
249606
|
+
const plan = planCompressedUpload2({ bodyBytes, wireBytes, gzip }, reserveBytes, () => {
|
|
249607
|
+
return gzipSync3(Buffer.from(JSON.stringify(publishReleaseBody2(releaseBody, void 0, true)), "utf8")).byteLength;
|
|
249608
|
+
});
|
|
249522
249609
|
const report9 = {
|
|
249523
249610
|
app: app2,
|
|
249524
249611
|
declared,
|
|
@@ -249534,6 +249621,21 @@ async function publishSizeCommand(ctx) {
|
|
|
249534
249621
|
planningBytes,
|
|
249535
249622
|
planningOverageBytes: Math.max(0, planningBytes - MAX_PUBLISH_BODY_BYTES2),
|
|
249536
249623
|
withinMeasuredBudget: planningBytes <= MAX_PUBLISH_BODY_BYTES2 && encoded3.length <= MAX_APP_SOURCE_BYTES2,
|
|
249624
|
+
// What a compressed upload would cost, for planning ONLY. Whether push may send one depends
|
|
249625
|
+
// on the publisher credential, which this command never reads: it does not establish
|
|
249626
|
+
// eligibility, and the verdict above (`withinMeasuredBudget`, the exit code) stays on the
|
|
249627
|
+
// plain limit. A body under the plain limit goes out plain, so `wireBytes` equals `bodyBytes`
|
|
249628
|
+
// there; `planningWireBytes` is explained at `planCompressedUpload`.
|
|
249629
|
+
compressedUpload: {
|
|
249630
|
+
transport: gzip ? "gzip" : "plain",
|
|
249631
|
+
wireBytes,
|
|
249632
|
+
wireLimit: MAX_PUBLISH_BODY_BYTES2,
|
|
249633
|
+
decodedLimit: MAX_DECODED_PUBLISH_BODY_BYTES2,
|
|
249634
|
+
planningWireBytes: plan.planningWireBytes,
|
|
249635
|
+
fitsIfEligible: plan.fitsIfEligible && encoded3.length <= MAX_APP_SOURCE_BYTES2,
|
|
249636
|
+
eligibility: "not_evaluated",
|
|
249637
|
+
note: "Provisional and credential-free. A gzip upload is admitted only for a provisioned, non-self-serve control token that himi push can read; self-serve tokens and opaque proxy credentials (including the One App migration worker's draft broker) keep the plain limit. Final push remeasures the complete envelope."
|
|
249638
|
+
},
|
|
249537
249639
|
source: { archivedBytes: archive.length, encodedBytes: encoded3.length, limit: MAX_APP_SOURCE_BYTES2, files: collected.entries.length, skipped: collected.skipped },
|
|
249538
249640
|
screens: Object.keys(payload.screens).length,
|
|
249539
249641
|
bundles: Object.keys(payload.bundles).length,
|
|
@@ -250063,6 +250165,12 @@ var USAGE = `himi \u2014 the Himalaya authoring CLI (remote dev loop)
|
|
|
250063
250165
|
the LARGEST entries by name \u2014 move those out, or push with
|
|
250064
250166
|
--no-source (which costs you himi pull for that release).
|
|
250065
250167
|
Not the same limit as the whole publish body.
|
|
250168
|
+
The WHOLE body is capped at 8388608 bytes of JSON. Over
|
|
250169
|
+
that, a provisioned (not self-serve) control token sends
|
|
250170
|
+
it gzipped: up to 33554432 bytes decoded and 8388608 on
|
|
250171
|
+
the wire. A self-serve login or an opaque credential
|
|
250172
|
+
keeps the plain cap. A refusal names bodyBytes, wireBytes, both limits
|
|
250173
|
+
and compressedUpload (why gzip did not apply).
|
|
250066
250174
|
himi push --only <selector>[,<selector>\u2026] (--draft|--live) [--from-release <id>]
|
|
250067
250175
|
[--accept-regressions] [--accept-partial] [--app <slug>]
|
|
250068
250176
|
publish ONLY the named items, derived from the app's live
|
|
@@ -250639,7 +250747,7 @@ var COMMANDS = [
|
|
|
250639
250747
|
{ name: "init", summary: "scaffold a starter content package (OTA-only; no native shells). --template <t> starts from a full reference app (branded-lite = consumer storefront over a Wix site; owner-lite = owner CRUD/management) instead of the minimal counter; --templates lists bundled ones; --remote fetches the template off the serve plane (falls back to the bundled copy offline). The new app also gets its agent files (the same set `himi agent-init` writes: AGENTS.md, CLAUDE.md, the himalaya skill, HIMALAYA.md, a SessionStart hook) so the next session started inside it picks the work up; --no-agent skips them. It also makes the build board (.himi/studio/, exactly as `himi studio --no-open` does \u2014 it never opens a browser), so every later render, test, validate, push and progress entry refreshes it; and, for a template bundled with this CLI, it makes the FIRST PICTURE itself (never for a --remote one: that is its publisher's code, and a render runs it on this machine, so next[] leaves the render to the agent after it has read the code): exactly `himi render <homeScreenId> --png --mocks --device iphone` (offline \u2014 no request; never --live; --mocks loads the app's recorded data when it has any), run as a child it kills after a time budget, writing .himi/shots/<home>.png and journaling it (by: himi) as the STARTING POINT (\"Starting point: the <template> template, before any of your changes\") so the board and the journal hold a picture when init returns. init also records the source it wrote (.himi/init-source.json: a content fingerprint, Markdown left out), and the first home PNG render after the source diverges from it is journaled once as \"First look at your app\" \u2014 reported as `firstLook: {image}` or `{skipped: <reason>}`, never a failed init; `--no-first-look` skips it (for scripts and CI that render themselves). For a bundled template (never a --remote one \u2014 the preview would build and serve its publisher's code) init also STARTS the live preview itself: `himi run --watch --content <dir> --port <p> --no-open --idle-exit 30`, detached in its own process group with its output in .himi/watch.log, never waited for (the url is chosen before it builds), recorded in .himi/watch.json, and reported as `watch: {started, pid, url, board, log}` \u2014 or `{skipped: <reason>}` for a `CI` environment, a test runner, a watch already running, or a start that failed (never a failed init). Nothing else skips it: outside CI it is started, and `watch.note` says an opt-out was ignored. The envelope LEADS with `doNow`: three lines to run now (the consent preflight, the live preview \u2014 its url and board when init started it, else `himi run --watch --content <dir> &` with the board's path \u2014 and the postcard line), and ENDS with the same lines as `doNowAgain`, so an agent that reads only the head or only the tail (`| tail`) gets them; at a terminal they are also printed as plain text on stderr, before the JSON and again after it. Its `next[]` LEADS with the steps for THIS session, in this order for every app \u2014 the offline first render and that picture's `himi progress` postcard (only when init could not make the picture), the skill's consent preflight (authorize or mock any Wix or external startup request; with none, go straight on), and only then the live preview (the running one's url, or `himi run --watch &` when init did not start it) \u2014 ahead of the next-session guidance", required: "<name> [--dir] [--template <t>] [--remote] [--base44-app-id <id>] [--base44-app-url <https://tenant>] [--no-agent] [--no-first-look] | --templates" },
|
|
250640
250748
|
{ name: "template", summary: "starter-template catalog + publishing. Every template is a SHOWCASE APP \u2014 a real published release you can open running before you start from it. `list` prints available templates with metadata (title/description/tags) plus each one's start prompt \u2014 pass --remote to include the serve-plane catalog so an agent can pick one; `prompt <name>` prints just that sentence for one template (the skill URL is the public door, or the plane named by --target/--serve-url); `publish` publishes an app AS a `himi init --template` (needs a himalaya.template.json; builds a previewable release + attaches the scaffold source; --source-dir overrides which tree becomes the source, --name sets the template name; bakes a launcher icon \u2014 --icon <png>, or the committed template-icons/<name>.png \u2014 and extracts accent/palette gallery meta from the scaffold's tokens.json; --visibility unlisted keeps it out of the /v1/templates catalog \u2014 templates default to public; --source-hash prints the sourceHash and iconHash a publish would be stored under, with no build or network, and exits); `trim --keep <ids>` cuts an app scaffolded from a template down to those screens (the home, and any screen the navigation pins such as a drawer body, always stays) \u2014 it deletes the other SCREENS/TEMPLATED entries whole, prunes navigation (linkableScreens, tabBar, drawer, deep links, surfaces) and drops tier5-src workers no kept screen uses, then runs validate --strict and rolls everything back if it fails (--force keeps it, --dry-run writes nothing). A kept screen that links to a removed one is refused unless --links follow (keep those too) or --links drop (remove the taps). Adopting one: `inspect` writes the adoption inventory (.himi/adopt.json: screens, workers, which screens can call Wix/network on appear \u2014 bootsOffline \u2014 placeholder and sample copy, proposed Data access rows, typed-journey stubs); `screens` lists, shows, rewrites or adds ONE dev/index.ts entry (`--upsert --from <screens.json>` writes many generated ones as plain JSON entries, replacing existing ids); `sweep` replaces sample identity/copy inside string literals; `recommend` ranks the catalog for a business description or a site's verticals; `trim --from-spec` takes the kept screens from SPEC.md's Screen catalogue", required: "list [--remote] | prompt <name> | publish [--dir <app>] [--source-dir <dir>] [--name <n>] [--icon <png>] [--visibility public|unlisted] [--target <t>] [--source-hash] | trim --keep <id,id,\u2026>|--from-spec [SPEC.md] [--content <dir>] [--links follow|drop] [--dry-run] [--force] | inspect [--content <dir>] [--dry-run] | screens [--show <id>] [--write <id> --from <file>] [--add <id> --from <file>] [--upsert --from <screens.json>] | sweep --set 'Old=>New' | --map <file> [--dry-run] | recommend [--text <t>] [--verticals a,b] [--book <dir>] [--remote]" },
|
|
250641
250749
|
{ name: "build", summary: "compile tier5-src/<name>/index.ts -> dist/bundles/<name>.bundle.js with esbuild (--binary = resolve published @himalaya/*); semantic TypeScript checking belongs to himi validate. Warns (never fails) when a copied tier5-src/_shared file differs from every copy this CLI's templates ship, naming the file and the `cp` that refreshes it; a `// himi:forked` line in a file skips it", required: "[--content <dir>] [--binary]" },
|
|
250642
|
-
{ name: "publish-size", summary: "local build and early draft-publish budget measurement with the source archive included. Uses the same release payload and JSON serializer as push; skips network, owner lookup, claim, publish and final evidence gates. Reports exact provisional bodyBytes, the 8388608-byte limit, remaining/overage bytes and a planning reserve (default 65536) for future metadata. A changed slug or additional metadata requires remeasurement; final push remains authoritative. Does not certify publication readiness.", required: "[--content <dir>] [--app <slug>] [--reserve-bytes <n>] [--binary|--source]" },
|
|
250750
|
+
{ name: "publish-size", summary: "local build and early draft-publish budget measurement with the source archive included. Uses the same release payload and JSON serializer as push; skips network, owner lookup, claim, publish and final evidence gates. Reports exact provisional bodyBytes, the 8388608-byte limit, remaining/overage bytes and a planning reserve (default 65536) for future metadata, plus compressedUpload: the gzip size push would send and whether it would fit the wire and decoded limits IF the publisher credential is eligible. It reads no credential, so it never establishes that; its verdict stays on the plain limit. A changed slug or additional metadata requires remeasurement; final push remains authoritative. Does not certify publication readiness.", required: "[--content <dir>] [--app <slug>] [--reserve-bytes <n>] [--binary|--source]" },
|
|
250643
250751
|
{ name: "functions", summary: "inspect/invoke server functions and operate durable jobs or schedules", required: "list|describe|openapi|invoke | jobs list|get|cancel|retry|dlq | schedule describe|invoke [--app <a>] [--environment preview|production] [--release <id>]" },
|
|
250644
250752
|
{ name: "eject", summary: "take ownership of a shared flow module (auth|checkout|screens): copies its source into tier5-src/_ejected/ and repoints this package's imports at the copy. The ladder's escape hatch \u2014 for when the factory options cannot express what you need. AFTER EJECTING, CENTRAL FIXES NO LONGER REACH THIS APP, including future corrections to the fail-closed entitlement and confirm-the-session rules. The floor is unaffected: credentials still go only through the native auth actions and money only through the cashier rail.", required: "<auth|checkout|screens> [--content <dir>]" },
|
|
250645
250753
|
{ name: "validate", summary: 'lint the content package (no push): fixed-contract TypeScript checking for tier5-src workers + schema/proto + token refs + component allowlist + $service bindings + strict-enum foot-guns + capability decls + worker boot dry-run + build/compile failures + copied tier5-src/_shared files that differ from this CLI\'s (a `stale-shared` warning, never promoted by --strict; `// himi:forked` in a file skips it). Type issues are advisory warnings normally; --strict promotes them and hygiene warnings to errors. Exit 1 on any error. Off-repo, the CLI supplies its compiler and SDK declarations. A PASSING validate after a source change also refreshes the home picture: exactly `himi render <homeScreenId> --png --mocks --device iphone` (offline, never --live; with recorded data \u2014 dev/net-mocks.json or cms seed rows \u2014 the picture shows it, and without, its postcard calls it an offline preview), run as a child it kills after 30 seconds, writing .himi/shots/<home>.png \u2014 whose own postcard logic then journals "First look at your app" or, after ten minutes of postcard silence, "Still building" \u2014 reported as `homePicture: {image}` (with `postcard` when one was journaled) or `{skipped: <reason>}`, never a failed validate. Skipped for a validate with errors, a home shot already current, CI or a test runner, and code nobody asked to run: a --remote template still unchanged since init.', required: "[--content <dir>] [--strict]" },
|
|
@@ -253845,9 +253953,12 @@ async function pushCommand(ctx) {
|
|
|
253845
253953
|
} } : {}
|
|
253846
253954
|
};
|
|
253847
253955
|
const publishBodyFor = (slug) => composeReleasePayload(payload, slug, appSourceB64);
|
|
253848
|
-
const
|
|
253849
|
-
const
|
|
253956
|
+
const publishBodySizeFor = (slug) => measurePublishBody(publishBodyFor(slug), meta, draft);
|
|
253957
|
+
const { admitPublishBody: admitPublishBody2, compressedPublishEligibility: compressedPublishEligibility2, compressionNote: compressionNote2, publishSizeFields: publishSizeFields2 } = await Promise.resolve().then(() => (init_publish_admission(), publish_admission_exports));
|
|
253958
|
+
const eligibility = compressedPublishEligibility2(pushToken);
|
|
253959
|
+
const refuseOversizedBody = async (slug, size, compressedUpload) => {
|
|
253850
253960
|
const { publishBodyBreakdown: publishBodyBreakdown2 } = await Promise.resolve().then(() => (init_publish_size(), publish_size_exports));
|
|
253961
|
+
const bodyBytes = size.bodyBytes;
|
|
253851
253962
|
const withoutSource = appSourceB64 ? bodyBytes - appSourceB64.length : bodyBytes;
|
|
253852
253963
|
io2.error(JSON.stringify(pushFailure2("publish_body_too_large", {
|
|
253853
253964
|
ok: false,
|
|
@@ -253856,15 +253967,20 @@ async function pushCommand(ctx) {
|
|
|
253856
253967
|
error: "publish_body_too_large",
|
|
253857
253968
|
bodyBytes,
|
|
253858
253969
|
limit: MAX_PUBLISH_BODY_BYTES,
|
|
253970
|
+
// Added beside `bodyBytes`/`limit`, which keep their meaning (plain JSON against the plain
|
|
253971
|
+
// cap): the decoded and wire caps, the gzip size when the client would compress this body,
|
|
253972
|
+
// and why that compressed upload was not admitted.
|
|
253973
|
+
...publishSizeFields2(size, compressedUpload),
|
|
253859
253974
|
...appSourceB64 ? { appSourceBytes: appSourceB64.length } : {},
|
|
253860
253975
|
// What to cut: each part's share of the body, with its largest entries by name.
|
|
253861
253976
|
breakdown: publishBodyBreakdown2(publishBodyFor(slug), bodyBytes),
|
|
253862
|
-
hint: appSourceB64 && withoutSource <= MAX_PUBLISH_BODY_BYTES ? "push with --no-source to publish without the source archive (this release then cannot be restored with `himi pull`), or trim the app's assets and bundles" : "trim the app's assets and bundles \u2014 this release is over the limit even without the source archive, so --no-source would not help"
|
|
253977
|
+
hint: (appSourceB64 && withoutSource <= MAX_PUBLISH_BODY_BYTES ? "push with --no-source to publish without the source archive (this release then cannot be restored with `himi pull`), or trim the app's assets and bundles" : "trim the app's assets and bundles \u2014 this release is over the limit even without the source archive, so --no-source would not help") + `. ${compressionNote2(size, compressedUpload)}`
|
|
253863
253978
|
})));
|
|
253864
253979
|
return 1;
|
|
253865
253980
|
};
|
|
253866
|
-
const
|
|
253867
|
-
|
|
253981
|
+
const composedSize = publishBodySizeFor(app2);
|
|
253982
|
+
const composedAdmission = admitPublishBody2(composedSize, { eligibility });
|
|
253983
|
+
if (!composedAdmission.ok) return refuseOversizedBody(app2, composedSize, composedAdmission.compressedUpload);
|
|
253868
253984
|
let autoClaimed = false;
|
|
253869
253985
|
let adoptedSlug;
|
|
253870
253986
|
if (flags["no-claim"] !== true) {
|
|
@@ -253890,8 +254006,9 @@ async function pushCommand(ctx) {
|
|
|
253890
254006
|
}
|
|
253891
254007
|
}
|
|
253892
254008
|
if (adoptedSlug) {
|
|
253893
|
-
const
|
|
253894
|
-
|
|
254009
|
+
const adoptedSize = publishBodySizeFor(app2);
|
|
254010
|
+
const adoptedAdmission = admitPublishBody2(adoptedSize, { eligibility });
|
|
254011
|
+
if (!adoptedAdmission.ok) return refuseOversizedBody(app2, adoptedSize, adoptedAdmission.compressedUpload);
|
|
253895
254012
|
}
|
|
253896
254013
|
const publishPayload = publishBodyFor(app2);
|
|
253897
254014
|
let r3;
|
|
@@ -253919,6 +254036,20 @@ async function pushCommand(ctx) {
|
|
|
253919
254036
|
}));
|
|
253920
254037
|
return 1;
|
|
253921
254038
|
}
|
|
254039
|
+
if (!r3.ok && r3.json?.code === "compressed_publish_unsupported") {
|
|
254040
|
+
const j2 = r3.json;
|
|
254041
|
+
print(pushFailure2("compressed_publish_unsupported", {
|
|
254042
|
+
ok: false,
|
|
254043
|
+
app: app2,
|
|
254044
|
+
pushed: false,
|
|
254045
|
+
error: "compressed_publish_unsupported",
|
|
254046
|
+
status: r3.status,
|
|
254047
|
+
...typeof j2.sentBytes === "number" ? { sentBytes: j2.sentBytes } : {},
|
|
254048
|
+
...typeof j2.planeCountedBytes === "number" ? { planeCountedBytes: j2.planeCountedBytes } : {},
|
|
254049
|
+
hint: j2.hint
|
|
254050
|
+
}));
|
|
254051
|
+
return 1;
|
|
254052
|
+
}
|
|
253922
254053
|
if (!r3.ok) {
|
|
253923
254054
|
const authHint = pushAuthHint(r3.status, pushToken, pushTarget, !!ownerIssue);
|
|
253924
254055
|
const hint = authHint ?? releaseIdExistsHint(r3.status, r3.json);
|
|
@@ -153,6 +153,21 @@ This local planning command never claims or publishes. Every failure includes
|
|
|
153
153
|
`ok: true` means the measured draft plus its reserve fits. It does not certify
|
|
154
154
|
publication readiness or bound metadata not yet supplied to the final push.
|
|
155
155
|
|
|
156
|
+
Every measurement (success or `publish_body_too_large`) also carries `compressedUpload`, for
|
|
157
|
+
planning only:
|
|
158
|
+
|
|
159
|
+
| Field | Meaning |
|
|
160
|
+
| --- | --- |
|
|
161
|
+
| `transport` | `plain` or `gzip`: what `himi push` would send for this body. Gzip only between the two limits. |
|
|
162
|
+
| `wireBytes` | Bytes push would upload for this body. Equals `bodyBytes` when `transport` is `plain`. |
|
|
163
|
+
| `wireLimit` / `decodedLimit` | 8,388,608 bytes on the wire; 33,554,432 bytes decoded. |
|
|
164
|
+
| `planningWireBytes` | `wireBytes` plus the uncompressed reserve: an upper estimate. |
|
|
165
|
+
| `fitsIfEligible` | The planned body would fit both limits if the publisher credential is eligible. |
|
|
166
|
+
| `eligibility` | Always `not_evaluated`: the command reads no credential. |
|
|
167
|
+
|
|
168
|
+
The exit code and `withinMeasuredBudget` stay on the plain limit. Only `himi push` decides
|
|
169
|
+
whether a gzip upload is admitted, from the credential it actually uses.
|
|
170
|
+
|
|
156
171
|
## `himi one-app validate-payments` codes
|
|
157
172
|
|
|
158
173
|
| Code | Meaning |
|
|
@@ -223,7 +238,8 @@ worker's bundle. These names are stable.
|
|
|
223
238
|
| `control_token_expired` | The selected control token has expired. |
|
|
224
239
|
| `app_source_contains_secrets` | Source archiving detected a possible credential. |
|
|
225
240
|
| `app_source_too_large` | The encoded source archive exceeds its limit. |
|
|
226
|
-
| `publish_body_too_large` | The complete publish request exceeds its limit. |
|
|
241
|
+
| `publish_body_too_large` | The complete publish request exceeds its limit. `bodyBytes` is the plain JSON and `limit` the 8,388,608-byte plain limit, as before. Added: `overageBytes`, `decodedLimit` (33,554,432), `decodedOverageBytes`; when push would gzip the body, `wireBytes`, `wireLimit` and `wireOverageBytes`; and `compressedUpload`, why the gzip upload was not admitted: `decoded_limit_exceeded`, `self_serve_credential`, `credential_unverified` (a static or opaque credential the CLI cannot read as a provisioned token) or `wire_limit_exceeded`. `appSourceBytes` and `breakdown` are unchanged. No credential or payload content is included. |
|
|
242
|
+
| `compressed_publish_unsupported` | The body went out gzipped and the publishing service would not take it compressed: it predates compressed publish bodies, or it treats the credential as self-serve. Carries `status`, `sentBytes`, and `planeCountedBytes` when the service named it. Nothing was written. |
|
|
227
243
|
| `needs_vpn` | Full-push request to the publishing service could not complete (existing reachability code). This is not proof that VPN is the cause; read the target-aware error. |
|
|
228
244
|
| `serve_unreachable` | A partial-push upload could not reach the publishing service. |
|
|
229
245
|
| `no_serve_plane` | A loopback service answering a partial push is not a himi publishing service. |
|
|
@@ -1720,8 +1720,22 @@ metadata must fit within the remaining bytes. A changed slug changes both app fi
|
|
|
1720
1720
|
the limit, unknown owner metadata cannot rescue the build. A passing size check is
|
|
1721
1721
|
conditional on those remaining bytes; the final push still measures its exact envelope
|
|
1722
1722
|
and runs every evidence gate. The push command has no size-only dry run; use the
|
|
1723
|
-
measurement command for probes.
|
|
1724
|
-
|
|
1723
|
+
measurement command for probes.
|
|
1724
|
+
|
|
1725
|
+
The report's `compressedUpload` gives the gzip size push would send (`wireBytes`) and
|
|
1726
|
+
`fitsIfEligible`. It is a provisional, credential-free figure and **not** a pass:
|
|
1727
|
+
|
|
1728
|
+
- `himi push` sends a body over 8,388,608 bytes gzipped only for a provisioned control
|
|
1729
|
+
token it can read as not self-serve, within 33,554,432 bytes decoded and 8,388,608
|
|
1730
|
+
bytes on the wire.
|
|
1731
|
+
- The hosted migration worker publishes through its restricted draft broker with an
|
|
1732
|
+
opaque credential, and the broker forwards a plain body under a self-serve site token.
|
|
1733
|
+
On that path the plain **8,388,608-byte** limit applies. Plan for it: treat `bodyBytes`
|
|
1734
|
+
and `planningBytes`, not `wireBytes`, as the budget.
|
|
1735
|
+
|
|
1736
|
+
Measure early, then let the final push remeasure. The push measures the exact final
|
|
1737
|
+
envelope (slug, label, notes, attestation and migration metadata) before it claims or
|
|
1738
|
+
uploads anything, and again if the claim changes the slug.
|
|
1725
1739
|
|
|
1726
1740
|
Init-generated `.agents/`, `.claude/` and `HIMALAYA.md` are already excluded by the
|
|
1727
1741
|
source archive policy shown in `himi push --help`.
|
|
@@ -1886,7 +1900,8 @@ bytes. It is about base64(source archive + worker bundles + assets + icons) plus
|
|
|
1886
1900
|
descriptor JSON, so a large app can exceed it: one 33-page migration measured
|
|
1887
1901
|
11,259,935 bytes. Measure early, not at the end, with `himi publish-size` (see
|
|
1888
1902
|
"Check the publish budget before final evidence"). `himi push` refuses an oversized body locally, before it sends anything,
|
|
1889
|
-
with `publish_body_too_large
|
|
1903
|
+
with `publish_body_too_large`. `compressedUpload` says why a gzip upload did not apply
|
|
1904
|
+
(`credential_unverified` on the hosted worker's broker), and `wireBytes` gives its size. Its `breakdown`
|
|
1890
1905
|
gives each part's bytes (`appSource`, `screens`, `bundles`, `assets`, `icon`, `other`)
|
|
1891
1906
|
and the largest entries by name. Reduce it in this order, and repeat affected
|
|
1892
1907
|
validation after each step:
|
package/guides/qa-builds.md
CHANGED
|
@@ -1355,8 +1355,14 @@ himi dist --app <app> --platform android --aab --wait --target bo
|
|
|
1355
1355
|
`store_build_invalid`, `attempt_id_required`, `store_id_invalid`); its builds count per site in the
|
|
1356
1356
|
self-serve tier, and `HIMI_DIST_SELFSERVE=0` closes them too. The caller reads
|
|
1357
1357
|
(`GET /v1/admin/dist/<job>`), lists (`?app=`, each job with its `attemptId`) and cancels only the
|
|
1358
|
-
jobs it started (`403 forbidden_cross_tenant` otherwise)
|
|
1359
|
-
|
|
1358
|
+
jobs it started (`403 forbidden_cross_tenant` otherwise). A job carries `storeBuildResult`, the
|
|
1359
|
+
result the service used to be sent, only once nothing can change it, and then never changes it:
|
|
1360
|
+
Job Service has ended the job (it retries a failed attempt before it writes FAILURE, so a pool's
|
|
1361
|
+
FAILURE alone isn't final), a SUCCESS has the pool's own report with the file, an App Store build's
|
|
1362
|
+
TestFlight upload has settled, or the caller's cancel went through. Each read of a terminal job
|
|
1363
|
+
asks Job Service whether it ended it, until it has, and the read that writes the result logs
|
|
1364
|
+
`store_build.settled` (MOBPUB-1253). The caller learns the job ended from Job Service's own
|
|
1365
|
+
`wix.mre.v1.Job` domain events and then reads the job. A request with a control token is the
|
|
1360
1366
|
path above, unchanged, and both stay: the Containers server picks one per site. MOBPUB-1241.
|
|
1361
1367
|
- **A store build ships under the owner's App name and icon.** Both store builds above (a Containers
|
|
1362
1368
|
app's `--aab` and its TestFlight build) need `appName` and `appIconUrl` on `POST /v1/admin/dist`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1675.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
|
|
6
6
|
"keywords": [
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"artifactId": "himalaya-cli"
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
|
-
"falconPackageHash": "
|
|
82
|
+
"falconPackageHash": "30a7effff0aeb33c17640f41975edfbd1c0aa870dd62faabbf2abe67"
|
|
83
83
|
}
|