@wix/himalaya-cli 0.1708.0 → 0.1709.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
@@ -13652,6 +13652,7 @@ function buttonVariant(style) {
13652
13652
  var SYSTEM_FONT_FAMILY, TONAL_ELEVATION_ALPHA, BUTTON_SIZES, BUTTON_MIN_HIT_TARGET, nonNegative, nonEmpty2, own2, COLOR_TOKEN_PROPS, TYPOGRAPHY_TOKEN_PROPS, BUTTON_VARIANTS;
13653
13653
  var init_tokens = __esm({
13654
13654
  "../../core/ts/src/tokens.ts"() {
13655
+ "use strict";
13655
13656
  init_define_HHP_CATALOG();
13656
13657
  SYSTEM_FONT_FAMILY = "$system";
13657
13658
  TONAL_ELEVATION_ALPHA = [0, 0.05, 0.08, 0.11, 0.12, 0.14];
@@ -33032,7 +33033,6 @@ function resolveIdiom(tokens2, ctx = {}) {
33032
33033
  var IDIOM_CONTEXTS, UNSAFE_KEYS;
33033
33034
  var init_idiom = __esm({
33034
33035
  "../../core/ts/src/idiom.ts"() {
33035
- "use strict";
33036
33036
  init_define_HHP_CATALOG();
33037
33037
  IDIOM_CONTEXTS = {
33038
33038
  ios: { native: ["ios"] },
@@ -34855,7 +34855,6 @@ function shouldRevealError(args) {
34855
34855
  var EMAIL_RE, URL_HOST_RE, INTEGER_RE, NUMBER_RE, AUTHORED_PATTERN_LIMIT, authoredPatterns;
34856
34856
  var init_validation = __esm({
34857
34857
  "../../core/ts/src/validation.ts"() {
34858
- "use strict";
34859
34858
  init_define_HHP_CATALOG();
34860
34859
  EMAIL_RE = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
34861
34860
  URL_HOST_RE = /^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(:[0-9]+)?$/;
@@ -263669,7 +263668,7 @@ var USAGE = `himi \u2014 the Himalaya authoring CLI (remote dev loop)
263669
263668
  himi dist [--app <a>] [--platform ios,android] [--release <id>] [--allow-draft] [--target <t>]
263670
263669
  [--shell branded-lite|owner-lite|brandy|base44|game|player|demo-app] [--signing wix-managed|byo]
263671
263670
  [--android-signing qa-keystore|wix-keystore|debug|owner] [--aab]
263672
- [--package-name <id> --google-services <file>]
263671
+ [--package-name <id> --google-services <file>] [--min-version-code <n>]
263673
263672
  [--app-name <name> --app-icon-url <url>]
263674
263673
  [--borrow-ios-id <bundleId>] [--no-wait] [--force] [--plan]
263675
263674
  build an INSTALLABLE QA binary (signed IPA / APK) on
@@ -263728,6 +263727,10 @@ var USAGE = `himi \u2014 the Himalaya authoring CLI (remote dev loop)
263728
263727
  for an app bound to no Wix site, with no APK beside
263729
263728
  it. Sign it with your own upload key before
263730
263729
  uploading. No Wix site or plan needed.
263730
+ A Play bundle's versionCode counts from 1 per package
263731
+ (Himi's record + 1); --min-version-code <n> raises it
263732
+ to at least n, for a listing with uploads Himi didn't
263733
+ build (e.g. its highest code + 1).
263731
263734
  --app-name / --app-icon-url (together) give the binary
263732
263735
  a name and icon in place of the release's; the icon is
263733
263736
  a https://static.wixstatic.com/media/<file> URL. A
@@ -264178,7 +264181,7 @@ var COMMANDS = [
264178
264181
  { name: "patch", summary: 'change ONE item of a published app \u2014 a screen descriptor, a Tier-5 bundle, tokens, or the app-config baseline \u2014 from a RAW FILE, with no content package and no build. The low-level door: it does not lint your package, because there is no package here; `himi push --only <selector>` is the same edit with the full build + lint gate and is what to reach for when the package is in hand. Derives a new release from the app\'s current LIVE release, or from `--from-release <id>`. An explicit `--draft` or `--live` is REQUIRED \u2014 a patch has no default blast radius \u2014 and `--notes` is required with `--live` on a screen or app-config patch, because off-repo `gitSha` is "dev" and the ledger notes are then the only durable record of bytes that correspond to no commit. A branch does not merge: activating one derived from an older release reverts every item the patch does not move, so that case is refused until `--accept-regressions`. A bundle patch must repoint a screen (`--for-screen`) or the bytes land under a manifest key nothing reads. It cannot ADD a screen (screens are git-only, RFC 0012), never claims a slug \u2014 the app must already be published \u2014 and carries no attestation, source archive, assets, icon or minBinaryVersion, each named in the output.', required: "screen <id> --file <descriptor.json> [--bundle <sha256|none>] | bundle --file <bundle.js> (--for-screen <id>[,<id>] | --no-rebind) | tokens --file <tokens.json> | app-config --file <app-config.json> ; (--draft|--live) --app <a> [--from-release <id>] [--accept-regressions] [--label <n>] [--notes <t>] [--force] [--allow-binary-gap] [--target <t>] (--control-token)" },
264179
264182
  { name: "flags", summary: "read and change the app's OPERATIONAL flags (RFC 0013) \u2014 `list` prints what the DEVICE door serves, `set <key> --definition` creates or replaces one, `ramp <key>` moves its rollout share or kills it, `rm <key>` deletes it and echoes the definition back so the removal is reversible. Every write is followed by a read of the same door the device uses, and the answer is reported as `servedNow`: flags are stored in the app's git-committed flags.json, so a control plane with no checkout accepts a write it will never serve.", required: "list|set|ramp|rm [<key>] [--definition <json|@file>] [--percent 0-100] [--enabled true|false] [--app <a>] (--control-token)" },
264180
264183
  { name: "visibility", summary: "read (no value) or set whether the public registry (/v1/apps + the Himi Player picker) LISTS the app. `public` lists it for everyone; `unlisted` hides it from listings while direct reads by app id \u2014 deep links, previews \u2014 keep working. App from --app or the content dir. Setting it needs no republish.", required: "[public|unlisted] [--app <a>] [--content <dir>] (--control-token)" },
264181
- { name: "dist", summary: "build an INSTALLABLE QA binary (signed IPA / APK) on the Wix Job Service Mac pool and return an install link \u2014 the serve plane brokers the job, the pool builds it. WAITS for the build by default (~4 min) and prints the install link; `--no-wait` returns a jobId immediately instead. Omitting `--release` builds whatever is LIVE for the app. A named draft is refused unless `--allow-draft` makes that exceptional build explicit. `status <jobId>` / `watch <jobId>` / `list --app <a>` / `cancel <jobId>` inspect and stop builds (`watch` reports up front whether the job mints its own signing identity or borrows one, so a doomed iOS build is cancellable in seconds rather than after the archive). Off-repo, name a target \u2014 `--target wix` for a self-serve Wix login or `--target bo` for the internal employee path (the in-repo default is a local dev plane that isn't reachable off-repo); self-serve callers may build their OWN apps under a tighter budget (2 in flight / 5 per 24h), while a manage-only owner-role credential is refused. `--shell` picks the native host to sign into (branded-lite | owner-lite | brandy | base44 | game | player | demo-app) and defaults to the content package's himalaya.content.json `shell` (templates carry the one they were written for), else branded-lite. The per-app shells ADD the release's declared capabilities to the binary, while Himi Player and demo-app refuse a release declaring one they lack; `--plan` previews it without building; `brandy` is the site shell \u2014 the customer's own website as native-framed tabs; `game` is the Godot game shell, the only one that serves `godot`. `--signing` defaults to `wix-managed` \u2014 the Wix Apple account mints a per-app signing identity for the build, so the caller provisions no Apple credentials of their own; `--signing byo --site <id>` reuses an existing customer ad-hoc profile and certificate for iOS; requires an owned site and a completed personal signing binding. `--android-signing` is the Android counterpart and a SEPARATE axis (a keystore, not an Apple account): `qa-keystore` (default \u2014 the repo's committed QA key, identical on every pool machine, so a build installs over the previous one), `wix-keystore` (the Wix key the pool machine carries; the build FAILS naming the paths searched if it carries none, rather than quietly signing with something else), or `debug` (the old per-machine key \u2014 QA must uninstall any previous build first). `--aab` builds an Android App Bundle (.aab) for the owner to upload to Google Play AND an APK from the same build \u2014 a download link for the .aab, an install link and QR for the APK; Android only; the bundle is signed with the Wix production key (`wix-keystore`, the upload key Branded apps use) \u2014 any other `--android-signing` is refused \u2014 and the APK with the committed QA key; a self-serve caller gets one only as the store build of its own Containers app (it must own the app's site, and `--aab` sends your Wix login); any other self-serve `--aab` gets 403 android_format_not_allowed. `--app-name <name> --app-icon-url <url>` (together; the icon a `https://static.wixstatic.com/media/<file>` URL) give the binary a name and icon in place of the release's, and a Containers app's store build (`--aab`, or its TestFlight build) needs both. NOT the normal way to ship: screens, Tier-5 bundles, tokens and app-config all go over the air with `himi push` in seconds \u2014 a binary trip is only needed for a NATIVE delta (a new SDUI component, a new declared capability/entitlement, a new bundle id, or a minBinaryVersion floor bump). Refuses to build an app whose launcher icon is missing, a placeholder, or one a store would reject \u2014 the one thing a binary carries that no later OTA push can fix; `--force` builds anyway. Also refuses a release whose member login (WixConsumerAuthProvider) names no siteId, or not in lower case, when Wix says its site requires a member CAPTCHA \u2014 such a binary ships without the CAPTCHA key and every member sign-in fails; whatever it cannot read (the release, the site's setting) only warns and builds; `--skip-captcha-check` builds anyway", required: "[--app <a>] [--platform ios,android] [--release <id>] [--allow-draft] [--target <t>] [--shell branded-lite|owner-lite|brandy|base44|game|player|demo-app] [--signing wix-managed|byo] [--site <id>] [--android-signing qa-keystore|wix-keystore|debug] [--aab] [--app-name <name> --app-icon-url <url>] [--borrow-ios-id <bundleId>] [--no-wait] [--force] [--skip-captcha-check] [--plan] | status <jobId> [--target <t>] | watch <jobId> [--target <t>] [--interval <ms>] | list --app <a> [--target <t>] | cancel <jobId> [--target <t>]" },
264184
+ { name: "dist", summary: "build an INSTALLABLE QA binary (signed IPA / APK) on the Wix Job Service Mac pool and return an install link \u2014 the serve plane brokers the job, the pool builds it. WAITS for the build by default (~4 min) and prints the install link; `--no-wait` returns a jobId immediately instead. Omitting `--release` builds whatever is LIVE for the app. A named draft is refused unless `--allow-draft` makes that exceptional build explicit. `status <jobId>` / `watch <jobId>` / `list --app <a>` / `cancel <jobId>` inspect and stop builds (`watch` reports up front whether the job mints its own signing identity or borrows one, so a doomed iOS build is cancellable in seconds rather than after the archive). Off-repo, name a target \u2014 `--target wix` for a self-serve Wix login or `--target bo` for the internal employee path (the in-repo default is a local dev plane that isn't reachable off-repo); self-serve callers may build their OWN apps under a tighter budget (2 in flight / 5 per 24h), while a manage-only owner-role credential is refused. `--shell` picks the native host to sign into (branded-lite | owner-lite | brandy | base44 | game | player | demo-app) and defaults to the content package's himalaya.content.json `shell` (templates carry the one they were written for), else branded-lite. The per-app shells ADD the release's declared capabilities to the binary, while Himi Player and demo-app refuse a release declaring one they lack; `--plan` previews it without building; `brandy` is the site shell \u2014 the customer's own website as native-framed tabs; `game` is the Godot game shell, the only one that serves `godot`. `--signing` defaults to `wix-managed` \u2014 the Wix Apple account mints a per-app signing identity for the build, so the caller provisions no Apple credentials of their own; `--signing byo --site <id>` reuses an existing customer ad-hoc profile and certificate for iOS; requires an owned site and a completed personal signing binding. `--android-signing` is the Android counterpart and a SEPARATE axis (a keystore, not an Apple account): `qa-keystore` (default \u2014 the repo's committed QA key, identical on every pool machine, so a build installs over the previous one), `wix-keystore` (the Wix key the pool machine carries; the build FAILS naming the paths searched if it carries none, rather than quietly signing with something else), or `debug` (the old per-machine key \u2014 QA must uninstall any previous build first). `--aab` builds an Android App Bundle (.aab) for the owner to upload to Google Play AND an APK from the same build \u2014 a download link for the .aab, an install link and QR for the APK; Android only; the bundle is signed with the Wix production key (`wix-keystore`, the upload key Branded apps use) \u2014 any other `--android-signing` is refused \u2014 and the APK with the committed QA key; a self-serve caller gets one only as the store build of its own Containers app (it must own the app's site, and `--aab` sends your Wix login); any other self-serve `--aab` gets 403 android_format_not_allowed. `--app-name <name> --app-icon-url <url>` (together; the icon a `https://static.wixstatic.com/media/<file>` URL) give the binary a name and icon in place of the release's, and a Containers app's store build (`--aab`, or its TestFlight build) needs both. NOT the normal way to ship: screens, Tier-5 bundles, tokens and app-config all go over the air with `himi push` in seconds \u2014 a binary trip is only needed for a NATIVE delta (a new SDUI component, a new declared capability/entitlement, a new bundle id, or a minBinaryVersion floor bump). Refuses to build an app whose launcher icon is missing, a placeholder, or one a store would reject \u2014 the one thing a binary carries that no later OTA push can fix; `--force` builds anyway. Also refuses a release whose member login (WixConsumerAuthProvider) names no siteId, or not in lower case, when Wix says its site requires a member CAPTCHA \u2014 such a binary ships without the CAPTCHA key and every member sign-in fails; whatever it cannot read (the release, the site's setting) only warns and builds; `--skip-captcha-check` builds anyway", required: "[--app <a>] [--platform ios,android] [--release <id>] [--allow-draft] [--target <t>] [--shell branded-lite|owner-lite|brandy|base44|game|player|demo-app] [--signing wix-managed|byo] [--site <id>] [--android-signing qa-keystore|wix-keystore|debug] [--aab] [--min-version-code <n>] [--app-name <name> --app-icon-url <url>] [--borrow-ios-id <bundleId>] [--no-wait] [--force] [--skip-captcha-check] [--plan] | status <jobId> [--target <t>] | watch <jobId> [--target <t>] [--interval <ms>] | list --app <a> [--target <t>] | cancel <jobId> [--target <t>]" },
264182
264185
  { name: "testflight", summary: 'build, sign and upload an app to TestFlight (internal testers \u2014 no Beta App Review), then WAIT until App Store Connect finishes processing it. Sugar for `store upload --track testflight`. Prompts first: a build number is consumed permanently on a real Apple account and cannot be reused \u2014 `--yes` for CI, `--dry-run` to see the plan without touching anything. The wait is the real check, not a nicety: fastlane prints "Successfully uploaded" for a binary App Store Connect then rejects in processing, and a rejected binary leaves NO build record at all (the reason is emailed). Public App Store review is deliberately NOT automatable here \u2014 `--track appstore` is refused; use /submit-ios-app when you mean to go public', required: "<app> [--track testflight|internal] [--profile <name>] [--yes] [--dry-run] [--skip-build] [--no-wait] [--json]" },
264183
264186
  { name: "store", summary: "`app set --app <id> --site <msid> --android-package himi.<name>` gives an app YOUR account owns (one made with `himi init`) the Google Play store app of a Wix site your account also owns, so `himi dist --aab` makes its Wix-signed (WixOne) Play bundle: the app is LINKED to the site, never converted into a site app, so your `himi login` token keeps working for push and the rest. One site per app and one app per site; the package name is permanent once a build locks it. `app show --app <id> --site <msid>` runs the store build's checks without building (saved package name, the site's Premium plan). Both send your `himi login` control token plus the account `wix token`, which the plane uses to verify your account owns the app and the site (`himi docs qa-builds`). `apple-keys setup|status` onboards the owner\u2019s ASC and In-App Purchase keys independently of push and signing profiles. `connect` and `submission status|plan|apply|rejection|reply` submit an app to the App Store from YOUR computer under YOUR Apple account, off-repo (Node 24+): `connect` opens a sign-in page on 127.0.0.1 where you type your Apple ID password and 2FA code (no flag takes them) and creates an Admin API key saved in this computer's keychain, shared with Wix for App Store builds when the app's store/app-store.json names its site; `submission plan` plans the next ordered batch and `apply` applies it only after you type the plan hash's first 8 characters (or click Approve on a local page). The same steps are the store_* tools of `himi mcp` (`himi docs store-submission`). `--platform android` takes `connect` and `submission status|plan|apply|rejection|reply` to Google Play instead: `connect` signs you in to Google in your browser (the OAuth client file from GPLAY_OAUTH_CLIENT_FILE or gplay-node's state dir, else a gcloud sign-in), the facts come from the app's store/google-play.json (category, contactEmail, privacyPolicyUrl, targetAudience, contentRatingCategory, packageName), a site-linked himi.<name> app is Wix-signed (`himi dist --aab`) and any other owner-signed (`--android-signing owner --google-services <file>`, then `google keygen <package>` makes the upload key once and `google resign <in.aab> --keystore <file.p12> --storepass-file <file>` signs the bundle, both on this computer), `apply` takes one `--job`, and `submission approve-reply --platform android --issue <id> --kind appeal|resubmit --text <reply>` records your typed yes on one exact policy reply (no --yes), the only way `reply` or store_reply can plan it. `handoff` uploads the app's asc-node records (allowlisted ids, statuses and outcomes; never keys, cookies or passwords) so Wix RelOps can take the submission over, `--out`/`--dry-run` keep it local; `relops request` records your consent that RelOps may act for the app (`--scope read` by default, or `read,submit`; `--platform android` adds the Google Play scopes `android-build` and `play-console`; you type the app id, or pass --yes). Both are site-owner only. `relops request --platform android --seat-email <name@wix.com>` also brings that RelOps person into YOUR Google Play account after one typed yes at a terminal (no --yes): it saves the `himi.<name>` package, signs you in to Google if needed and invites the seat with the RelOps app permissions for 90 days (plus create-apps while the app has no Play app id); `relops end` removes the seat; `google create-app --name <n>` creates the app in your own Play Console after you read Google's Create app declarations and type yes. The App Store Connect group behind `testflight`. `preflight <app>` checks readiness offline (icon, entitlements, encryption flag, version, store.config ids, listing + review record); `upload <app>` is what `testflight` runs; `status <app>` reads live build + processing state. `--profile` selects WHICH App Store Connect account: an app built for a Wix customer ships under the CUSTOMER's Apple team (Apple guideline 4.2.6 forbids an app-generation service submitting on a client's behalf), declared per-app as ios.credentialProfile in store.config.yaml and resolved from ~/.himalaya/store-credentials/<name>.json \u2014 the .p8 itself never enters the repo. `iap draft|plan|apply|status|connect|screenshots|check|mappings` registers an app owner's digital products as in-app purchases (non-consumables, or consumable price tiers): draft reads the Wix catalog and writes the manifest, plan and status only read, apply is the one App Store mutation boundary, connect readies the Wix site to sell them (purchases app, In-App Purchase key, appleIAP provider, product mappings; --preview-tag routes only its Serve calls to a deploy preview), legacy screenshots --profile renders each product's purchase screen from the app (--content) as a bound iPhone shows it to a signed-in member and names the 1290\xD72796 PNG as the item's App Review screenshot, and none of them builds, signs or needs a checkout (`himi docs iap-products`) IAP provisioning defaults to Catalog; managed apply generates screenshots on the server with no local .p8 or profile fallback; --managed is optional and --profile selects legacy mode; --catalog-route or HIMI_IAP_CATALOG_ROUTE has no default.", required: "app set --app <id> --site <msid> --android-package himi.<name> | app show --app <id> --site <msid> | connect [--dir <app>] [--app <id> --site <msid>] [--no-key] [--profile <name>] | submission status|plan|rejection [--dir <app>] [--apple-id <id>] [--profile <name>] | submission apply (--batch <id> | --job <id>) --plan-hash <hash> | submission reply --text <reply> [--attach <file>]\u2026 [--thread <id>] [--dir <app>] | connect --platform android | submission status|plan|rejection --platform android [--dir <app>] [--issue <id>] | submission apply --platform android --job <id> --plan-hash <hash> | submission reply|approve-reply --platform android --issue <id> --kind appeal|resubmit --text <reply> [--dir <app>] | handoff [--dir <app>] [--app <id> --site <msid>] [--apple-app-id <id>] [--out <file> | --dry-run] | relops request [--dir <app>] [--app <id> --site <msid>] [--platform ios|android] [--scope read|read,submit] [--yes] | relops request --platform android --seat-email <name@wix.com> [--app <id> --site <msid>] [--developer <id>] [--app-id <n>] [--android-package himi.<name>] | relops end --platform android --seat-email <name@wix.com> [--app <id> --site <msid>] [--developer <id>] | google create-app --name <app name> [--app <id> --site <msid>] [--developer <id>] [--android-package himi.<name>] | google keygen <package> [--out <file.p12>] [--alias <name>] [--name <certificate name>] | google resign <in.aab> --keystore <file.p12> (--storepass-file <file> | --storepass-env <NAME>) [--alias <name>] [--out <file.aab>] | apple-keys setup|status --app <slug> --site <metaSiteId> --bundle-id <id> [--asc-key-file <p8> --asc-key-id <id> --asc-issuer-id <issuer>] [--iap-key <p8> --iap-key-id <id> --iap-issuer-id <issuer>] [--yes|--dry-run] [--json] | preflight <app> [--profile <n>] | upload <app> [--track <t>] [--profile <n>] [--yes] [--dry-run] | status <app> [--profile <n>] | iap draft --site <msid> " + IAP_CREDENTIAL_OPTIONS + " --apple-app <id> --bundle <id> --base-territory <t> --out <f> [--territories <a,b>] [--locale <l>] [--mode per-item|tiers] [--merge <f>] [--report <f>] [--json] | iap plan --manifest <f> " + IAP_CREDENTIAL_OPTIONS + " --out <f> [--json] | iap apply --plan <f> " + IAP_CREDENTIAL_OPTIONS + " --out <f> [--yes] [--limit <n>] [--no-submit] [--json] | iap status --manifest <f> " + IAP_CREDENTIAL_OPTIONS + " [--out <f>] [--json] | iap connect --manifest <f> [--profile <n>] [--catalog-route <prefix>] [--iap-key <AuthKey.p8> --iap-key-id <id>] [--content <dir>] [--preview-tag dp-<tag>] [--dry-run] [--yes] [--out <f>] [--json] | iap screenshots --manifest <f> --content <dir> --profile <n> [--out-dir <d>] [--only <id,\u2026>] [--force] [--dry-run] [--json] | iap check --manifest <f> --catalog-route <prefix> [--purchases-app <id>] [--content <dir>] [--plist <file>] [--visitor-client <id>] [--json] | iap mappings --site <msid> --purchases-app <id> --catalog-route <prefix> [--product <id> --active true|false --yes] [--json]" },
264184
264187
  { name: "guide", summary: "print the Himalaya overview + headless dev loop + available topics (offline)", required: "[--json]" },
@@ -270103,6 +270106,18 @@ ${label4}`);
270103
270106
  return 1;
270104
270107
  }
270105
270108
  }
270109
+ const PLAY_VERSION_CODE_MAX = 21e8;
270110
+ const minVersionCodeRaw = flags["min-version-code"] === void 0 ? void 0 : str3(flags["min-version-code"]) ?? "";
270111
+ const minVersionCode = minVersionCodeRaw === void 0 ? void 0 : Number(minVersionCodeRaw.trim());
270112
+ if (minVersionCodeRaw !== void 0 && (!/^\d+$/.test(minVersionCodeRaw.trim()) || !Number.isSafeInteger(minVersionCode) || minVersionCode < 1 || minVersionCode > PLAY_VERSION_CODE_MAX)) {
270113
+ print({
270114
+ ok: false,
270115
+ error: "min_version_code_invalid",
270116
+ code: "min_version_code_invalid",
270117
+ message: `--min-version-code must be a whole number from 1 to ${PLAY_VERSION_CODE_MAX}`
270118
+ });
270119
+ return 1;
270120
+ }
270106
270121
  let wixAuthorization;
270107
270122
  const testflight = str3(flags.destination) === "testflight";
270108
270123
  const customerTestflight = str3(flags.signing)?.trim().toLowerCase() === "byo" && testflight;
@@ -270175,6 +270190,7 @@ ${label4}`);
270175
270190
  // An owner bundle (--android-signing owner): the plane leaves it unsigned, under this name.
270176
270191
  ...str3(flags["package-name"]) ? { androidPackageName: str3(flags["package-name"]) } : {},
270177
270192
  ...googleServicesJson !== void 0 ? { googleServicesJson } : {},
270193
+ ...minVersionCode !== void 0 ? { minVersionCode } : {},
270178
270194
  // The App name and icon (a Wix Media file) a Containers app's store build ships under, in place
270179
270195
  // of the release's; a store build needs both. Sent as typed, so the plane gives the refusals.
270180
270196
  ...str3(flags["app-name"]) !== void 0 ? { appName: str3(flags["app-name"]) } : {},
@@ -699,14 +699,41 @@ because those write it down.
699
699
  ### Build number
700
700
 
701
701
  A store-bound build can also carry a **store floor**: **`DIST_BUILD_FLOOR_IOS`** /
702
- **`DIST_BUILD_FLOOR_ANDROID`**, the lowest build number the store will accept for the listing (its
703
- highest uploaded build + 1). The build machine never reads a store or holds store credentials: the
704
- floor is an input the job carries. Nothing sets it automatically yet; the store lanes that will read
705
- the store once per job and pass it are tracked in #4650. When the floor is set, the build number is
706
- `max(derived, floor)`, and the log says which won (`build 58 (floor: DIST_BUILD_FLOOR_ANDROID 58)` or
707
- `(derived)`). An explicit `DIST_BUILD_NUMBER` **below** the floor is refused before anything is
708
- archived, with a message naming the floor; a floor that is not an integer in `1..2100000000` fails
709
- the job rather than being ignored. A QA (`link`) build gets no floor and is unchanged.
702
+ **`DIST_BUILD_FLOOR_ANDROID`**, the lowest build number the store will accept for the listing. The
703
+ build machine never reads a store or holds store credentials: the floor is an input the job carries.
704
+ When the floor is set, the build number is `max(derived, floor)`, and the log says which won
705
+ (`build 58 (floor: DIST_BUILD_FLOOR_ANDROID 58)` or `(derived)`). An explicit `DIST_BUILD_NUMBER`
706
+ **below** the floor is refused before anything is archived, with a message naming the floor; a floor
707
+ that is not an integer in `1..2100000000` fails the job rather than being ignored. A QA (`link`) build
708
+ gets no floor and is unchanged.
709
+
710
+ **Google Play bundles count from 1.** A Containers app's store build and an owner bundle
711
+ (`--android-signing owner`) get their `versionCode` from Himi's own record of the package, kept per
712
+ app, not the clock: serve reserves the package's highest code + 1 at dispatch (one atomic write, so two builds
713
+ dispatched together never share one) and sends it as `DIST_BUILD_FLOOR_ANDROID` with
714
+ **`DIST_BUILD_SCHEME=counter`**, which tells the pool to stamp exactly that number. A new package's
715
+ first bundle is `1`, then `2`, and so on. The clock (~216M) made Google list the first release under
716
+ *Errors* and ask the owner to accept, permanently, that the app's codes can never go down.
717
+
718
+ - **Apps already on the clock continue from it.** The first counter build of a package seeds the record
719
+ from the app's job history: the highest code any of its jobs for that package was stamped with. When
720
+ the history can't prove that (a result from a runner too old to report its code, or a full index with
721
+ no code of the package in it), it seeds from the clock reading instead, which is above every
722
+ clock-numbered build. While a clock-numbered build of the package is still queued or running, the next
723
+ one builds on the clock too, and a later build seeds. Either way the next build is never below one
724
+ the package already carries.
725
+ - **An upload made some other way** is invisible to that record. Owner-signed builds can pass
726
+ **`himi dist --min-version-code <n>`** (`minVersionCode`, the lowest code the Play listing will take,
727
+ e.g. its highest + 1): the build gets `max(n, record + 1)`, and the record moves up with it. It applies
728
+ only to a Play bundle (`400 min_version_code_requires_play_bundle`); anything but a whole number in
729
+ `1..2100000000` is `400 min_version_code_invalid`.
730
+ - **If the record can't be read or written, the build is refused** (`dist_version_code_unavailable`,
731
+ retryable) rather than falling back to the clock, which would lock a new app's codes high for good.
732
+ A store with no atomic update keeps the clock, as before.
733
+ - **A pool commit older than this ignores `DIST_BUILD_SCHEME`** and keeps the clock, which is always
734
+ above the floor; the result callback raises the record to the code the pool actually stamped.
735
+ - **iOS is unchanged.** App Store Connect doesn't warn, and build numbers only need to rise within a
736
+ marketing version.
710
737
 
711
738
  ## Where an artifact lives, and when it is deleted
712
739
 
@@ -1414,6 +1441,9 @@ himi dist --app <app> --platform android --aab --android-signing owner \
1414
1441
  --package-name com.acme.app --google-services ./google-services.json --version 1.0.0 --target wix
1415
1442
  ```
1416
1443
 
1444
+ Its `versionCode` counts from 1 per package ([Build number](#build-number)). If the listing already has
1445
+ uploads Himi didn't build, add `--min-version-code <the listing's highest + 1>`.
1446
+
1417
1447
  - **What you get:** an **unsigned** `.aab` as `artifact.downloadUrl`, with `androidSigning: "unsigned"`
1418
1448
  and `ownerBundle` (`packageName`, `firebaseProjectId`, `configSha256`) on the job. No APK comes with
1419
1449
  it, because that would be an installable file on a Wix link under any name the caller typed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1708.0",
3
+ "version": "0.1709.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": [
@@ -81,5 +81,5 @@
81
81
  "artifactId": "himalaya-cli"
82
82
  }
83
83
  },
84
- "falconPackageHash": "1810894eb1012098dc1b0a2ed960adebf1b3b33436a7092551f8bdb7"
84
+ "falconPackageHash": "415fbe34a0c070c0ffc015cf469ee704916ab52fe8d654bcf54a340b"
85
85
  }