@wix/himalaya-cli 0.866.0 → 0.868.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.
Files changed (2) hide show
  1. package/dist/cli.mjs +48 -4
  2. package/package.json +2 -2
package/dist/cli.mjs CHANGED
@@ -5241,6 +5241,7 @@ function resolveTranslation(value, catalog, sourceCatalog) {
5241
5241
  var BINDING_SIGILS, BINDING_SIGIL_RE, TRANSLATION_PREFIX, TRANSLATION_KEY_RE;
5242
5242
  var init_bindings = __esm({
5243
5243
  "../../core/ts/src/bindings.ts"() {
5244
+ "use strict";
5244
5245
  BINDING_SIGILS = ["service", "flag", "item", "t"];
5245
5246
  BINDING_SIGIL_RE = new RegExp(
5246
5247
  `^\\$(?:${BINDING_SIGILS.filter((s) => s !== "t").join("|")})\\b|^\\$t:`
@@ -27347,7 +27348,6 @@ function shouldRevealError(args) {
27347
27348
  var EMAIL_RE, URL_HOST_RE, INTEGER_RE, NUMBER_RE;
27348
27349
  var init_validation = __esm({
27349
27350
  "../../core/ts/src/validation.ts"() {
27350
- "use strict";
27351
27351
  EMAIL_RE = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
27352
27352
  URL_HOST_RE = /^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(:[0-9]+)?$/;
27353
27353
  INTEGER_RE = /^[+-]?[0-9]+$/;
@@ -30771,7 +30771,6 @@ function validateWorkerSubtree(raw, slotId, policy, actionCatalog) {
30771
30771
  var WORKER_SUBTREE_CEILINGS, ID_PART, ACTION_ID;
30772
30772
  var init_worker_subtree = __esm({
30773
30773
  "../../core/ts/src/worker-subtree.ts"() {
30774
- "use strict";
30775
30774
  init_worker_subtree_safe_types_generated();
30776
30775
  WORKER_SUBTREE_CEILINGS = Object.freeze({
30777
30776
  maxEncodedBytes: 65536,
@@ -62971,7 +62970,7 @@ var COMMANDS = [
62971
62970
  { name: "sdk", summary: "list importable @himalaya SDKs + descriptions; a name = that SDK's typed API (offline)", required: "[<name>] [--json]" },
62972
62971
  { name: "skills", summary: "list the authoring topics you can learn, grouped by category (offline)", required: "[--json]" },
62973
62972
  { name: "agent-init", summary: "seed a dir with HIMALAYA.md + component reference + the counter example so a coding agent can author Himi apps", required: "[--dir <dir>]" },
62974
- { name: "apps", summary: "the owner app registry (public dev loop). `list` (default) prints the apps your Wix identity owns; `claim <slug>` takes ownership of a slug so `himi push` can publish under it \u2014 though `himi push` now claims a brand-new app's slug for you (namespaced per owner as `<ownerPrefix>.<name>`, composed offline from the token \u2014 himalaya.content.json is not rewritten), so this is mostly for taking a name ahead of time. Auth is the control token `himi login --browser` stored, or an explicitly forwarded Wix session (--cookie / HIMI_WIX_COOKIE) for a scripted call with no browser \u2014 a write through the public gateway needs the XSRF-TOKEN cookie too. Reads (list) work with either.", required: "[list] | claim <slug> [--display-name <n>] [--account-id <id>] [--target <t>] [--cookie <c>] [--control-token <t>]" },
62973
+ { name: "apps", summary: "the owner app registry (public dev loop). `list` (default) prints the apps your Wix identity owns; `claim <slug>` takes ownership of a slug so `himi push` can publish under it \u2014 though `himi push` now claims a brand-new app's slug for you (namespaced per owner as `<ownerPrefix>.<name>`, composed offline from the token \u2014 himalaya.content.json is not rewritten), so this is mostly for taking a name ahead of time. `release <slug> --yes` gives a name BACK, freeing it for anyone to claim \u2014 refused for an app that has ever been published (devices may still resolve it), owner-only, and it signs you out everywhere because your token carries the app in its frozen scope. Auth is the control token `himi login --browser` stored, or an explicitly forwarded Wix session (--cookie / HIMI_WIX_COOKIE) for a scripted call with no browser \u2014 a write through the public gateway needs the XSRF-TOKEN cookie too. Reads (list) work with either.", required: "[list] | claim <slug> [--display-name <n>] [--account-id <id>] | release <slug> --yes [--target <t>] [--cookie <c>] [--control-token <t>]" },
62975
62974
  { name: "fonts", summary: "the curated font vocabulary an app may name, and what THIS app will actually ship. `list` (default) prints every family with its category, weights, byte cost and licence \u2014 `--licenses` adds the notice text OFL requires travel with the font. `check` is OFFLINE and runs the same computation the release build and the CI gate do: which faces pack into the binary, which are declared for OTA fetch, and any family that would silently render as the system font (a non-zero exit, because that degrade is invisible at runtime). `add <Family>` resolves a name (exact, normalized or alias) and reports the licence being accepted.", required: "[list] [--licenses] | check [--content <dir>] | add <Family>" },
62976
62975
  { name: "assets", summary: "app-owned resources declared under assets/ \u2014 images, Godot content packs, fonts, Rive files, video. `list` (default) reports each with hash, size, whether it bakes into the binary, and any budget problem that would make `himi push` refuse; reference one from a descriptor as `asset:<name>`. `verify` diffs assets/ on disk against what a release carries, flagging CLI-uploaded assets as DRIFT (they work at runtime but are not in git). `add <file>` uploads one imperatively (origin=cli, NOT baked, NOT in git \u2014 prefer committing to assets/); `rm <name>` drops the record so the next resolve falls back to the baked copy.", required: "[list] [--content <dir>] | verify [--app <a>] [--release <id>] | add <file> [--name <n>] [--live] | rm <name> [--live]" },
62977
62976
  { name: "secrets", summary: "manage encrypted secret metadata for an app's server functions. `set`/`rotate` read the secret value from stdin (never an argv); `list` shows names + environments, never values. Preview and production are separate scopes. Remote (BO) mode reads the DPX session; local mode uses the operator functions plane.", required: "set|list|rotate --app <app> --name <name> [--environment preview|production] [--target <t>] [--functions-url <url>] [--release <id>]" },
@@ -63153,6 +63152,18 @@ function previewPlayerLink(app, release, screenId) {
63153
63152
  function previewPlayerDebugLink(app, release, screenId, previewToken) {
63154
63153
  return buildHimiPreviewUrl({ app, releaseId: release, screenId, previewToken, source: "cli" });
63155
63154
  }
63155
+ function releaseHint(error) {
63156
+ if (error === "app_published_cannot_release") {
63157
+ return { hint: "a name that has been published keeps its owner, because devices may still resolve it \u2014 ask an operator if it really must be freed" };
63158
+ }
63159
+ if (error === "release_unavailable") {
63160
+ return { hint: "this plane cannot release safely right now (it cannot prove the app was never published, or cannot revoke your token) \u2014 nothing changed, so retrying later is safe" };
63161
+ }
63162
+ if (error === "release_unsupported") return { hint: "this plane's store has no atomic swap, so it will not release a name \u2014 nothing changed" };
63163
+ if (error === "conflict") return { hint: "the app changed while releasing it \u2014 nothing was released, so re-run to pick up the new state" };
63164
+ if (error === "forbidden_requires_owner") return { hint: "only the app's OWNER may give its name away \u2014 an editor cannot" };
63165
+ return {};
63166
+ }
63156
63167
  function claimHint(status, error) {
63157
63168
  if (error === "slug_published") return { hint: "that app already exists on the serve plane and is not yours \u2014 pick another slug" };
63158
63169
  if (error === "slug_taken") return { hint: "someone else already claimed that slug \u2014 pick another" };
@@ -67740,8 +67751,41 @@ ${label2}`);
67740
67751
  print({ ok: true, ...j2 });
67741
67752
  return 0;
67742
67753
  }
67754
+ if (sub === "release") {
67755
+ const slug = pos[2];
67756
+ if (!slug) {
67757
+ io.error(JSON.stringify({ error: "usage: himi apps release <slug> --yes" }));
67758
+ return 2;
67759
+ }
67760
+ if (flags.yes !== true) {
67761
+ io.error(JSON.stringify({
67762
+ error: "confirmation_required",
67763
+ hint: `releasing "${slug}" frees the name for anyone to claim and signs you out everywhere \u2014 re-run with --yes`
67764
+ }));
67765
+ return 2;
67766
+ }
67767
+ const r2 = await fetch(`${base}/v1/owner/apps/release`, {
67768
+ method: "POST",
67769
+ headers: { ...headers2, "content-type": "application/json" },
67770
+ body: JSON.stringify({ slug })
67771
+ });
67772
+ const j2 = await r2.json().catch(() => ({}));
67773
+ if (!r2.ok) {
67774
+ const err = j2.error;
67775
+ io.error(JSON.stringify({
67776
+ ok: false,
67777
+ status: r2.status,
67778
+ ...j2,
67779
+ ...ownerPlaneHint(r2.status, err, target),
67780
+ ...releaseHint(err)
67781
+ }));
67782
+ return 1;
67783
+ }
67784
+ print({ ok: true, ...j2 });
67785
+ return 0;
67786
+ }
67743
67787
  if (sub && sub !== "list") {
67744
- io.error(JSON.stringify({ error: `unknown subcommand "${sub}" \u2014 usage: himi apps [list] | himi apps claim <slug>` }));
67788
+ io.error(JSON.stringify({ error: `unknown subcommand "${sub}" \u2014 usage: himi apps [list] | himi apps claim <slug> | himi apps release <slug> --yes` }));
67745
67789
  return 2;
67746
67790
  }
67747
67791
  const r = await fetch(`${base}/v1/owner/apps`, { headers: headers2 });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.866.0",
3
+ "version": "0.868.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": [
@@ -63,5 +63,5 @@
63
63
  "artifactId": "himalaya-cli"
64
64
  }
65
65
  },
66
- "falconPackageHash": "98ba041ef766b8e46a4e19ae0189d8f4e8efcd98f374de34bd5c4504"
66
+ "falconPackageHash": "8fbad929c25341a6f5c5c7eea5279a98f7729861f603b37bff5b9465"
67
67
  }