@wix/himalaya-cli 0.1098.0 → 0.1099.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
@@ -125,6 +125,7 @@ function resolveTarget(opts = {}) {
125
125
  }
126
126
  const base = { ...fromBuiltin, ...fromFile };
127
127
  return {
128
+ previewRoute: env.HIMI_SERVE_PREVIEW_ROUTE ?? base.previewRoute,
128
129
  serve: opts.serveUrl ?? env.HIMI_SERVE_URL ?? base.serve ?? "",
129
130
  telemetry: opts.telemetryUrl ?? env.HIMI_TELEMETRY_URL ?? base.telemetry ?? "",
130
131
  control: opts.controlUrl ?? env.HIMI_CONTROL_URL ?? base.control ?? "",
@@ -19012,11 +19013,16 @@ var init_himi_package = __esm({
19012
19013
  // ../../packages/serve/src/claude-plugin.ts
19013
19014
  var claude_plugin_exports = {};
19014
19015
  __export(claude_plugin_exports, {
19016
+ CONNECTOR_PLUGIN_DESCRIPTION: () => CONNECTOR_PLUGIN_DESCRIPTION,
19017
+ CONNECTOR_PLUGIN_NAME: () => CONNECTOR_PLUGIN_NAME,
19015
19018
  HIMI_MARKETPLACE_NAME: () => HIMI_MARKETPLACE_NAME,
19016
19019
  HIMI_MCP_SERVER: () => HIMI_MCP_SERVER,
19017
19020
  HIMI_NPM_PACKAGE: () => HIMI_NPM_PACKAGE,
19018
19021
  HIMI_PLUGIN_DESCRIPTION: () => HIMI_PLUGIN_DESCRIPTION,
19019
19022
  HIMI_PLUGIN_NAME: () => HIMI_PLUGIN_NAME,
19023
+ connectorMarketplaceEntry: () => connectorMarketplaceEntry,
19024
+ connectorPluginFiles: () => connectorPluginFiles,
19025
+ connectorPluginManifest: () => connectorPluginManifest,
19020
19026
  himiMarketplace: () => himiMarketplace,
19021
19027
  himiPluginFiles: () => himiPluginFiles,
19022
19028
  himiPluginManifest: () => himiPluginManifest,
@@ -19054,6 +19060,31 @@ function himiMarketplace(archiveUrl, sha2565) {
19054
19060
  ]
19055
19061
  };
19056
19062
  }
19063
+ function connectorPluginManifest() {
19064
+ return {
19065
+ name: CONNECTOR_PLUGIN_NAME,
19066
+ displayName: "Wix Native App Builder",
19067
+ description: CONNECTOR_PLUGIN_DESCRIPTION,
19068
+ author: { name: "Wix" },
19069
+ keywords: ["wix", "mobile", "ios", "android", "app-builder", "himi", "connector"]
19070
+ };
19071
+ }
19072
+ function connectorPluginFiles(mcpUrl, skillMd) {
19073
+ const json6 = (o) => `${JSON.stringify(o, null, 2)}
19074
+ `;
19075
+ return [
19076
+ { path: ".claude-plugin/plugin.json", text: json6(connectorPluginManifest()) },
19077
+ { path: ".mcp.json", text: json6({ mcpServers: { [CONNECTOR_PLUGIN_NAME]: { type: "http", url: mcpUrl } } }) },
19078
+ { path: `skills/${CONNECTOR_PLUGIN_NAME}/SKILL.md`, text: skillMd }
19079
+ ];
19080
+ }
19081
+ function connectorMarketplaceEntry(archiveUrl, sha2565) {
19082
+ return {
19083
+ name: CONNECTOR_PLUGIN_NAME,
19084
+ description: CONNECTOR_PLUGIN_DESCRIPTION,
19085
+ source: { source: "archive", url: archiveUrl, ...sha2565 ? { sha256: sha2565 } : {} }
19086
+ };
19087
+ }
19057
19088
  function storeZip(files) {
19058
19089
  const enc = new TextEncoder();
19059
19090
  const entries = files.map((f) => ({ name: enc.encode(f.path), data: enc.encode(f.text) }));
@@ -19115,7 +19146,7 @@ function storeZip(files) {
19115
19146
  }
19116
19147
  return out2;
19117
19148
  }
19118
- var HIMI_PLUGIN_NAME, HIMI_MARKETPLACE_NAME, HIMI_NPM_PACKAGE, HIMI_MCP_SERVER, HIMI_PLUGIN_DESCRIPTION;
19149
+ var HIMI_PLUGIN_NAME, HIMI_MARKETPLACE_NAME, HIMI_NPM_PACKAGE, HIMI_MCP_SERVER, HIMI_PLUGIN_DESCRIPTION, CONNECTOR_PLUGIN_NAME, CONNECTOR_PLUGIN_DESCRIPTION;
19119
19150
  var init_claude_plugin = __esm({
19120
19151
  "../../packages/serve/src/claude-plugin.ts"() {
19121
19152
  init_himi_package();
@@ -19124,6 +19155,8 @@ var init_claude_plugin = __esm({
19124
19155
  HIMI_NPM_PACKAGE = "@wix/himalaya-cli";
19125
19156
  HIMI_MCP_SERVER = { command: "npx", args: ["-y", HIMI_NPM_PACKAGE, "mcp"] };
19126
19157
  HIMI_PLUGIN_DESCRIPTION = "Build native iOS + Android apps with Wix: the himi skill plus the himi MCP tools \u2014 validate, test, render, a live preview in your IDE, and draft publishing to Himi Player.";
19158
+ CONNECTOR_PLUGIN_NAME = "wix-native-app-builder";
19159
+ CONNECTOR_PLUGIN_DESCRIPTION = "Build native iOS + Android apps with Wix from a conversation: the Wix Native App Builder connector plus its skill. Publishes private drafts you preview in chat or on your phone with Himi Player.";
19127
19160
  }
19128
19161
  });
19129
19162
 
@@ -24589,7 +24622,6 @@ function shouldRevealError(args) {
24589
24622
  var EMAIL_RE, URL_HOST_RE, INTEGER_RE, NUMBER_RE;
24590
24623
  var init_validation = __esm({
24591
24624
  "../../core/ts/src/validation.ts"() {
24592
- "use strict";
24593
24625
  EMAIL_RE = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
24594
24626
  URL_HOST_RE = /^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(:[0-9]+)?$/;
24595
24627
  INTEGER_RE = /^[+-]?[0-9]+$/;
@@ -28210,7 +28242,6 @@ function validateWorkerSubtree(raw, slotId, policy, actionCatalog) {
28210
28242
  var WORKER_SUBTREE_CEILINGS, ID_PART, ACTION_ID;
28211
28243
  var init_worker_subtree = __esm({
28212
28244
  "../../core/ts/src/worker-subtree.ts"() {
28213
- "use strict";
28214
28245
  init_worker_subtree_safe_types_generated();
28215
28246
  WORKER_SUBTREE_CEILINGS = Object.freeze({
28216
28247
  maxEncodedBytes: 65536,
@@ -67572,6 +67603,10 @@ var ServeCliClient = class {
67572
67603
  }
67573
67604
  async request(plane, method, path2, opts = {}) {
67574
67605
  const headers2 = { ...opts.headers };
67606
+ if (this.target.previewRoute) {
67607
+ if (!/^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$/.test(this.target.previewRoute)) throw new Error("invalid_dist_preview_route");
67608
+ headers2["x-wix-route-serve"] = this.target.previewRoute;
67609
+ }
67575
67610
  if (opts.body !== void 0) headers2["content-type"] = "application/json";
67576
67611
  const carriesCredential = Object.keys(headers2).some((h2) => CREDENTIAL_HEADERS.has(h2.toLowerCase()));
67577
67612
  const res = await this.fetchImpl(this.baseFor(plane) + path2, {
@@ -67874,8 +67909,19 @@ var ServeCliClient = class {
67874
67909
  }
67875
67910
  // ---- himi dist (QA binary builds brokered onto the Job Service Mac pool) ----
67876
67911
  /** Request a QA build (POST /v1/admin/dist). Returns one job per requested platform. */
67877
- distCreate(body) {
67878
- return this.request("control", "POST", "/v1/admin/dist", { body, headers: this.ctrlHeaders() });
67912
+ assertWixAuthorizationTarget() {
67913
+ const url = new URL(this.baseFor("control"));
67914
+ const host = url.hostname.toLowerCase();
67915
+ const local = ["127.0.0.1", "localhost", "[::1]"].includes(host) && ["http:", "https:"].includes(url.protocol);
67916
+ const wix = url.protocol === "https:" && (host === "wix.com" || host.endsWith(".wix.com"));
67917
+ if (!local && !wix) throw new Error("customer_signing_untrusted_control_origin");
67918
+ }
67919
+ distCreate(body, options = {}) {
67920
+ if (options.wixAuthorization) this.assertWixAuthorizationTarget();
67921
+ return this.request("control", "POST", "/v1/admin/dist", {
67922
+ body,
67923
+ headers: { ...this.ctrlHeaders(), ...options.wixAuthorization ? { authorization: options.wixAuthorization } : {} }
67924
+ });
67879
67925
  }
67880
67926
  /** One job's record, refreshed from Job Service while it is still in flight. */
67881
67927
  distStatus(jobId) {
@@ -70055,8 +70101,8 @@ var USAGE = `himi \u2014 the Himalaya authoring CLI (remote dev loop)
70055
70101
  owner-lite | brandy | player | demo-app). --signing defaults to
70056
70102
  wix-managed: the Wix Apple account mints a per-app
70057
70103
  identity for the build, so you provision nothing.
70058
- --signing byo (your own Apple account) is reserved and
70059
- 501s. --android-signing picks the KEYSTORE for an APK (a
70104
+ --signing byo --site <id> reuses your existing customer
70105
+ ad-hoc profile and certificate for iOS. --android-signing picks the KEYSTORE for an APK (a
70060
70106
  separate axis from --signing, which is the Apple account):
70061
70107
  qa-keystore (default, the repo's committed key \u2014 same on
70062
70108
  every pool machine, so a build installs over the last one),
@@ -70341,7 +70387,7 @@ var COMMANDS = [
70341
70387
  { 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] [--target <t>] (--control-token)" },
70342
70388
  { 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)" },
70343
70389
  { 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)" },
70344
- { 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 | player | demo-app); `brandy` is the site shell \u2014 the customer's own website as native-framed tabs. `--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` (sign with your own Apple account) is reserved and 501s. `--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). 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", required: "[--app <a>] [--platform ios,android] [--release <id>] [--allow-draft] [--target <t>] [--shell branded-lite|owner-lite|brandy|player|demo-app] [--signing wix-managed|byo] [--android-signing qa-keystore|wix-keystore|debug] [--borrow-ios-id <bundleId>] [--no-wait] [--force] | status <jobId> [--target <t>] | watch <jobId> [--target <t>] [--interval <ms>] | list --app <a> [--target <t>] | cancel <jobId> [--target <t>]" },
70390
+ { 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 | player | demo-app); `brandy` is the site shell \u2014 the customer's own website as native-framed tabs. `--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). 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", required: "[--app <a>] [--platform ios,android] [--release <id>] [--allow-draft] [--target <t>] [--shell branded-lite|owner-lite|brandy|player|demo-app] [--signing wix-managed|byo] [--site <id>] [--android-signing qa-keystore|wix-keystore|debug] [--borrow-ios-id <bundleId>] [--no-wait] [--force] | status <jobId> [--target <t>] | watch <jobId> [--target <t>] [--interval <ms>] | list --app <a> [--target <t>] | cancel <jobId> [--target <t>]" },
70345
70391
  { 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]" },
70346
70392
  { name: "store", summary: "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", required: "preflight <app> [--profile <n>] | upload <app> [--track <t>] [--profile <n>] [--yes] [--dry-run] | status <app> [--profile <n>]" },
70347
70393
  { name: "guide", summary: "print the Himalaya overview + headless dev loop + available topics (offline)", required: "[--json]" },
@@ -76499,7 +76545,7 @@ ${label2}`);
76499
76545
  if (!flags.json) {
76500
76546
  io.log(` app ${rec.app} \xB7 ${rec.platform} \xB7 shell ${rec.shell ?? "?"} \xB7 ${String(rec.gitCommitSha ?? "").slice(0, 12)}`);
76501
76547
  io.log(
76502
- rec.platform !== "ios" ? " signing: n/a (android signs with its own keystore)" : minted ? " signing: MINTED \u2014 the job fetches its own identity; it will build under the app's own bundle id" : borrowed ? ` signing: BORROWED ${borrowed} \u2014 the binary carries another app's identifier and REPLACES it on the device` : " signing: none dispatched \u2014 the pool must find a profile itself, which fails when it has none.\n Minting is ON by default, so this means the serve plane either has HIMI_DIST_APPLE_SIGNING set to 0/false/off/no, or predates the minting route."
76548
+ rec.platform !== "ios" ? " signing: n/a (android signs with its own keystore)" : rec.signing === "byo" ? " signing: CUSTOMER \u2014 pinned personal team and ad-hoc profile; registered devices only" : minted ? " signing: MINTED \u2014 the job fetches its own identity; it will build under the app's own bundle id" : borrowed ? ` signing: BORROWED ${borrowed} \u2014 the binary carries another app's identifier and REPLACES it on the device` : " signing: none dispatched \u2014 the pool must find a profile itself, which fails when it has none.\n Minting is ON by default, so this means the serve plane either has HIMI_DIST_APPLE_SIGNING set to 0/false/off/no, or predates the minting route."
76503
76549
  );
76504
76550
  if (rec.buildUrl) io.log(` log ${rec.buildUrl}`);
76505
76551
  }
@@ -76579,6 +76625,19 @@ ${label2}`);
76579
76625
  }
76580
76626
  const { captchaContentInput: captchaContentInput2 } = await Promise.resolve().then(() => (init_captcha2(), captcha_exports));
76581
76627
  const captchaSiteId = str7(flags.site) ?? captchaContentInput2(contentDir(flags)).siteId;
76628
+ let wixAuthorization;
76629
+ if (str7(flags.signing)?.trim().toLowerCase() === "byo") {
76630
+ try {
76631
+ c.assertWixAuthorizationTarget();
76632
+ wixAuthorization = await accountToken();
76633
+ } catch {
76634
+ print({
76635
+ error: "customer_signing_authorization_unavailable",
76636
+ hint: "BYO requires a Wix control URL (or loopback) and an existing Wix CLI login. Run `wix login`, then retry."
76637
+ });
76638
+ return 1;
76639
+ }
76640
+ }
76582
76641
  let r;
76583
76642
  try {
76584
76643
  r = await c.distCreate({
@@ -76597,13 +76656,14 @@ ${label2}`);
76597
76656
  ...str7(flags["borrow-ios-id"]) ? { borrowIosBundleId: str7(flags["borrow-ios-id"]) } : {},
76598
76657
  ...str7(flags.destination) ? { destination: str7(flags.destination) } : {},
76599
76658
  ...str7(flags.signing) ? { signing: str7(flags.signing) } : {},
76659
+ ...str7(flags.site) ? { site: str7(flags.site) } : {},
76600
76660
  // WHICH KEYSTORE signs the APK. A separate axis from --signing (that one is the Apple
76601
76661
  // account), so a `--platform ios,android` build can say "Wix-managed on iOS, the QA
76602
76662
  // keystore on Android" — the normal combination — with one command.
76603
76663
  // flags["android-signing"], NOT flags.androidSigning: parseFlags does no kebab→camel
76604
76664
  // conversion, so the camel form reads undefined and the flag is a silent no-op.
76605
76665
  ...str7(flags["android-signing"]) ? { androidSigning: str7(flags["android-signing"]) } : {}
76606
- });
76666
+ }, { wixAuthorization });
76607
76667
  } catch (e) {
76608
76668
  return distUnreachable(e);
76609
76669
  }
@@ -76612,6 +76672,7 @@ ${label2}`);
76612
76672
  return 1;
76613
76673
  }
76614
76674
  const jobs = r.json?.jobs ?? [];
76675
+ const failures = r.json?.failures ?? [];
76615
76676
  for (const line of shellShaDivergenceWarnings(jobs)) (flags.json === true ? io.error : io.log)(line);
76616
76677
  const noWait = flags["no-wait"] === true || flags.wait === false;
76617
76678
  if (noWait) {
@@ -76620,8 +76681,9 @@ ${label2}`);
76620
76681
  const t = str7(flags.target);
76621
76682
  const targetArg = t ? ` --target ${t}` : "";
76622
76683
  for (const j of jobs) io.log(` ${j.platform} ${j.jobId} \u2192 himi dist status ${j.jobId}${targetArg}`);
76684
+ for (const f of failures) io.error(` ${f.platform} ${f.error}: ${f.message}`);
76623
76685
  }
76624
- return 0;
76686
+ return failures.length ? 1 : 0;
76625
76687
  }
76626
76688
  const intervalMs = Number(str7(flags.interval)) || 2e4;
76627
76689
  const timeoutMs = Number(str7(flags.timeout)) || 45 * 6e4;
@@ -76636,7 +76698,8 @@ ${label2}`);
76636
76698
  error: "dist_wait_timeout",
76637
76699
  waitedMs: timeoutMs,
76638
76700
  pending: [...pending.keys()],
76639
- finished: flags.json === true ? done : done.map(humanDistJob)
76701
+ finished: flags.json === true ? done : done.map(humanDistJob),
76702
+ ...failures.length ? { failures } : {}
76640
76703
  });
76641
76704
  return 1;
76642
76705
  }
@@ -76655,8 +76718,8 @@ ${label2}`);
76655
76718
  }
76656
76719
  }
76657
76720
  }
76658
- const allOk = done.every((d) => d.status === "SUCCESS");
76659
- print({ ok: allOk, jobs: flags.json === true ? done : done.map(humanDistJob) });
76721
+ const allOk = failures.length === 0 && done.every((d) => d.status === "SUCCESS");
76722
+ print({ ok: allOk, jobs: flags.json === true ? done : done.map(humanDistJob), ...failures.length ? { failures } : {} });
76660
76723
  await printDistQrsForJobs(done);
76661
76724
  return allOk ? 0 : 1;
76662
76725
  }
@@ -285,10 +285,10 @@ project settings or output. Enter Later to defer and continue building.
285
285
  `notify status` is read-only and needs no key files; `--refresh` checks providers live.
286
286
  Backend readiness does not prove notification delivery. This setup does not rewrite native
287
287
  configuration, select a Ping family, build a binary, register a device or send a notification.
288
- Continue building and publishing app content. Customer iOS push testing through `himi dist`
289
- is blocked until the hosted build service supports customer signing keys; the current Wix-managed QA
290
- binary cannot test the customer's saved push configuration. After an uncertain setup response, inspect status before
291
- retrying; the CLI does not automatically repeat provisioning.
288
+ Continue building and publishing app content. For a customer push test, use the
289
+ `himi dist --signing byo` flow below with existing signing assets and matching native configuration.
290
+ The default Wix-managed binary does not match the customer's Apple identity. After an uncertain
291
+ setup response, inspect status before retrying; the CLI does not automatically repeat provisioning.
292
292
 
293
293
  Full inputs, script flags and status meanings: `himi docs push-cli-onboarding`
294
294
  (https://apps.wix.com/_api/himi-serve/docs/push-cli-onboarding.md). The guide is bundled with the public npm package
@@ -321,11 +321,28 @@ bundle id per job — there is no profile to pre-provision and nothing to borrow
321
321
  <bundleId>` still exists as an escape hatch (the binary then installs under *that* id, which is
322
322
  fine for QA and wrong for anything else), but it is rarely what you want.
323
323
  For customer push credentials, the binary's Apple team, bundle ID and APNs environment must
324
- match the saved delivery configuration. The current self-serve `himi dist` path uses Wix's
325
- Apple team and a `com.wix.himi.<app>` bundle ID, so its QA binary cannot test customer iOS
326
- push. `--signing byo` is not supported. Testing through `himi dist` must wait for the hosted build service
327
- to support customer signing keys. Notification setup can verify backend configuration now,
328
- but does not make a matching customer-signed build available.
324
+ match the saved delivery configuration. Use the app owner's account for both logins and
325
+ select the deployed customer target explicitly:
326
+
327
+ ```sh
328
+ himi login --browser --target wix
329
+ wix login
330
+ himi dist --app <app> --release <release-id> --site <owned-site-id> \
331
+ --platform ios,android --signing byo --android-signing qa-keystore --wait --target wix
332
+ ```
333
+
334
+ The deployed backend and reachable runner source must support BYO. iOS reuses the customer's
335
+ existing distribution certificate and ad-hoc profile, which must include the test iPhone and
336
+ production APNs entitlement; the build does not create or revoke Apple assets. The remote runner
337
+ imports the identity into its agent keychain and removes the imported identity and profile copies
338
+ afterward, preserving that keychain.
339
+
340
+ For Android, this customer flow currently supports the `branded-lite` shell and retrieves the
341
+ site's package-matched Firebase `google-services.json`. `--android-signing qa-keystore` signs
342
+ the APK with Himi's stable QA key, not a customer Play signing key. Firebase configuration enables
343
+ push registration; it does not sign the APK. Native Ping wiring, member/device registration,
344
+ and a targeted delivery/tap test are still required after installation. A ready backend or a
345
+ successful build alone does not prove push delivery.
329
346
 
330
347
  **Android signing needs nothing either.** `--android-signing` defaults to `qa-keystore` — the
331
348
  repo's committed QA key, identical on every pool machine, so a new build installs *over* the last
@@ -314,10 +314,10 @@ project settings or output. Enter Later to defer and continue building.
314
314
  `notify status` is read-only and needs no key files; `--refresh` checks providers live.
315
315
  Backend readiness does not prove notification delivery. This setup does not rewrite native
316
316
  configuration, select a Ping family, build a binary, register a device or send a notification.
317
- Continue building and publishing app content. Customer iOS push testing through `himi dist`
318
- is blocked until the hosted build service supports customer signing keys; the current Wix-managed QA
319
- binary cannot test the customer's saved push configuration. After an uncertain setup response, inspect status before
320
- retrying; the CLI does not automatically repeat provisioning.
317
+ Continue building and publishing app content. For a customer push test, use the
318
+ `himi dist --signing byo` flow below with existing signing assets and matching native configuration.
319
+ The default Wix-managed binary does not match the customer's Apple identity. After an uncertain
320
+ setup response, inspect status before retrying; the CLI does not automatically repeat provisioning.
321
321
 
322
322
  Full inputs, script flags and status meanings: `himi docs push-cli-onboarding`
323
323
  (https://apps.wix.com/_api/himi-serve/docs/push-cli-onboarding.md). The guide is bundled with the public npm package
@@ -350,11 +350,28 @@ bundle id per job — there is no profile to pre-provision and nothing to borrow
350
350
  <bundleId>` still exists as an escape hatch (the binary then installs under *that* id, which is
351
351
  fine for QA and wrong for anything else), but it is rarely what you want.
352
352
  For customer push credentials, the binary's Apple team, bundle ID and APNs environment must
353
- match the saved delivery configuration. The current self-serve `himi dist` path uses Wix's
354
- Apple team and a `com.wix.himi.<app>` bundle ID, so its QA binary cannot test customer iOS
355
- push. `--signing byo` is not supported. Testing through `himi dist` must wait for the hosted build service
356
- to support customer signing keys. Notification setup can verify backend configuration now,
357
- but does not make a matching customer-signed build available.
353
+ match the saved delivery configuration. Use the app owner's account for both logins and
354
+ select the deployed customer target explicitly:
355
+
356
+ ```sh
357
+ himi login --browser --target wix
358
+ wix login
359
+ himi dist --app <app> --release <release-id> --site <owned-site-id> \
360
+ --platform ios,android --signing byo --android-signing qa-keystore --wait --target wix
361
+ ```
362
+
363
+ The deployed backend and reachable runner source must support BYO. iOS reuses the customer's
364
+ existing distribution certificate and ad-hoc profile, which must include the test iPhone and
365
+ production APNs entitlement; the build does not create or revoke Apple assets. The remote runner
366
+ imports the identity into its agent keychain and removes the imported identity and profile copies
367
+ afterward, preserving that keychain.
368
+
369
+ For Android, this customer flow currently supports the `branded-lite` shell and retrieves the
370
+ site's package-matched Firebase `google-services.json`. `--android-signing qa-keystore` signs
371
+ the APK with Himi's stable QA key, not a customer Play signing key. Firebase configuration enables
372
+ push registration; it does not sign the APK. Native Ping wiring, member/device registration,
373
+ and a targeted delivery/tap test are still required after installation. A ready backend or a
374
+ successful build alone does not prove push delivery.
358
375
 
359
376
  **Android signing needs nothing either.** `--android-signing` defaults to `qa-keystore` — the
360
377
  repo's committed QA key, identical on every pool machine, so a new build installs *over* the last
@@ -84,11 +84,27 @@ native distribution. Native push configuration, member authentication, device-to
84
84
  registration and a delivery/tap test are still required. This command does not enable
85
85
  native capabilities, choose a Ping family, send notifications or verify phone delivery.
86
86
 
87
- **Customer iOS push testing through `himi dist` is not available yet.** The current
88
- Wix-managed QA build uses Wix's Apple team and a `com.wix.himi.<app>` bundle ID, which
89
- do not match the customer's saved push configuration. `--signing byo` is unsupported.
90
- Testing through `himi dist` must wait for the hosted build service to support customer signing keys.
91
- Backend setup and verification can proceed now; they do not prove device delivery.
87
+ **Customer push QA builds use `himi dist --signing byo`.** After publishing an approved
88
+ release, use a backend and reachable runner source that support the customer-signing flow.
89
+ Use the app owner's account for both logins and explicitly select the deployed customer target:
90
+
91
+ ```sh
92
+ himi login --browser --target wix
93
+ wix login
94
+ himi dist --app <app> --release <release-id> --site <owned-site-id> \
95
+ --platform ios,android --signing byo --android-signing qa-keystore --wait --target wix
96
+ ```
97
+
98
+ iOS reuses the customer's existing distribution certificate and ad-hoc profile. The profile
99
+ must include the test iPhone and production APNs entitlement; Apple team, bundle ID and APNs
100
+ environment must match the saved push configuration. The build does not create or revoke Apple
101
+ assets. The default Wix-managed binary uses a different Apple identity.
102
+
103
+ Android currently requires the `branded-lite` shell and the site's package-matched Firebase
104
+ `google-services.json`. The APK is signed with Himi's stable QA keystore; Firebase does not sign it,
105
+ and this flow does not retrieve a customer Play signing key. Native push wiring, member/device
106
+ registration and a targeted delivery/tap test remain required. Backend readiness and a successful
107
+ build do not prove device delivery. See [QA builds](qa-builds.md) for prerequisites and diagnostics.
92
108
 
93
109
  `himi notify send|tokens|doctor` keep their existing local admin-server behavior; they
94
110
  are separate from the backend `setup|status` commands.
@@ -143,13 +143,49 @@ The chosen policy is written to the job record (`signing`), so `himi dist status
143
143
  answer "whose certificate is on this binary" without re-deriving it from serve config that may
144
144
  have changed since.
145
145
 
146
- **`--signing byo`** — sign with the caller's *own* Apple account — is reserved and returns
147
- `501 dist_signing_unsupported`, and no job is dispatched. It is not a missing branch: honouring it
148
- means accepting the caller's Apple key and forwarding it to the pool, and job parameters ride in
149
- the `command` string the pool echoes into its build log. It needs a secret channel that is not the
150
- log first. `/v1/dist/signing` independently refuses any job whose record asks for a non-Wix policy
151
- (`403 signing_policy_mismatch`), so building `byo` cannot accidentally start handing out Wix key
152
- material — the same belt-and-braces `resolveBorrowedIosId` applies to borrowed ids.
146
+ **`--signing byo`** uses an owned Wix site and its existing personal Apple distribution certificate
147
+ and ad-hoc profile. Himi checks site ownership, the app's recorded native ID, profile
148
+ type, certificate match, expiry, registered devices and production APNs entitlement before dispatch.
149
+ It selects an existing compatible ad-hoc profile; the build does not create or revoke Apple assets.
150
+ The runner fetches the certificate and profile using both its job token and a short-lived Buildkite
151
+ identity token; the job token alone cannot authorize the download.
152
+
153
+ On the Job Service `nodeCommandOptions` runner, Himi imports the customer's signing identity into
154
+ the agent's **existing keychain**, using the agent-provided `KEYCHAIN_PASSWORD`. It checks identity
155
+ discovery and noninteractive signing before archiving, then verifies the finished IPA. Cleanup
156
+ deletes the imported customer identity (certificate and private key), the profile copies installed
157
+ by this job, and its temporary files. It preserves the agent's keychain; it does not revoke the
158
+ certificate or delete the original profile in Apple/Branded. A matching identity already in the
159
+ keychain is refused before import so cleanup cannot delete a pre-existing identity.
160
+
161
+ Outside that runner mode, Himi creates a temporary keychain and deletes it during cleanup. A
162
+ missing password or keychain in agent-keychain mode fails the build instead of silently switching
163
+ modes. Private key material does not enter job parameters or the public job record. The runner
164
+ source SHA must advertise support for this protocol and be reachable from the pool before BYO
165
+ dispatch is accepted. See [runner authentication](apple-signing-provisioning.md#customer-qa-runner-authentication-protocol-2).
166
+
167
+ For an owned app using push, `himi notify setup --content <dir> --site <site-id>` provisions the
168
+ backend and `himi notify status --content <dir> --site <site-id> --refresh` checks its current
169
+ Branded/Ping configuration. These commands require both a Himi control
170
+ credential and Wix account authorization. A `ready` setup record is a backend checkpoint, not proof
171
+ that a binary installed, registered a member, received a notification or opened its destination.
172
+ After publishing an approved release, use the app owner's account for both logins and explicitly
173
+ select the deployed customer target for the paired QA build:
174
+
175
+ ```sh
176
+ himi login --browser --target wix
177
+ wix login
178
+ himi dist --app <app> --release <release-id> --site <owned-site-id> \
179
+ --platform ios,android --signing byo --android-signing qa-keystore --wait --target wix
180
+ ```
181
+
182
+ The Android customer-config path currently supports the `branded-lite` shell. It reads that site's
183
+ `BrandedApp.buildConfig.android.googleServicesJson` and refuses an unsupported shell, a missing file,
184
+ or a wrong-package Firebase client. It builds with the customer file and signs with the
185
+ stable QA keystore. Each platform has its own job status and artifact link. If one platform cannot
186
+ dispatch or build, the CLI returns a nonzero result while preserving the other platform's completed
187
+ job and link. A successful artifact upload proves only that the recorded binary was built and stored;
188
+ device installation, Ping registration, delivery and destination routing require separate checks.
153
189
 
154
190
  **`himi dist` waits by default** and prints the install link; `--no-wait` gives you a job id back
155
191
  immediately plus a Buildkite URL for the live log. Waiting is the right shape for ONE build;
package/guides/skill.md CHANGED
@@ -93,8 +93,10 @@ credentials for their app, not a shared test account.
93
93
  Use `himi notify status --content ./my-app --target wix --refresh --json` to report live
94
94
  backend checks. A ready backend does not prove notification delivery to a phone: native push
95
95
  configuration, a signed build, member/device registration and a delivery/tap test still follow.
96
- Customer iOS push cannot be tested with the current Wix-managed `himi dist` QA binary.
97
- Testing through `himi dist` must wait for the hosted build service to support customer signing keys.
96
+ For a customer push test, use `himi dist --signing byo` with the customer's existing Apple
97
+ signing assets and matching app configuration. The default Wix-managed binary uses a different
98
+ Apple identity. Read `himi docs qa-builds` for the paired iOS/Android command and prerequisites;
99
+ the backend and build runner must support this customer-signing flow.
98
100
  Read `himi docs push-cli-onboarding` (also https://apps.wix.com/_api/himi-serve/docs/push-cli-onboarding.md) before
99
101
  setup for the required logins, credential fields and failure handling. The guide is bundled with the public npm package
100
102
  and is also served at the public URL above. No repository access is required.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1098.0",
3
+ "version": "0.1099.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": [
@@ -67,5 +67,5 @@
67
67
  "artifactId": "himalaya-cli"
68
68
  }
69
69
  },
70
- "falconPackageHash": "ef97bab45cc454401e25d3e4215f88dd0989fee4eff61ee47e6e23a0"
70
+ "falconPackageHash": "abd3482789935a7c1024e42bc726a232ef26e4612586b570d0b0fda7"
71
71
  }