@wix/himalaya-cli 0.1338.0 → 0.1340.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
@@ -7591,7 +7591,6 @@ function resolveTranslation(value, catalog3, sourceCatalog) {
7591
7591
  var BINDING_SIGILS, BINDING_SIGIL_RE, TRANSLATION_PREFIX, TRANSLATION_KEY_RE;
7592
7592
  var init_bindings = __esm({
7593
7593
  "../../core/ts/src/bindings.ts"() {
7594
- "use strict";
7595
7594
  BINDING_SIGILS = ["service", "flag", "item", "t"];
7596
7595
  BINDING_SIGIL_RE = new RegExp(
7597
7596
  `^\\$(?:${BINDING_SIGILS.filter((s2) => s2 !== "t").join("|")})\\b|^\\$t:`
@@ -16630,7 +16629,6 @@ function resolveIdiom(tokens2, ctx = {}) {
16630
16629
  var IDIOM_CONTEXTS, UNSAFE_KEYS;
16631
16630
  var init_idiom = __esm({
16632
16631
  "../../core/ts/src/idiom.ts"() {
16633
- "use strict";
16634
16632
  IDIOM_CONTEXTS = {
16635
16633
  ios: { native: ["ios"] },
16636
16634
  android: { native: ["material"] },
@@ -39,6 +39,12 @@ Your page can only use capabilities the **app owner** turned on for your site. I
39
39
  `capabilities`, allowing **every** method the capability's page lists — except
40
40
  `presigned_upload.putFile`, which reads a device file and is allowed only when `files` is enabled
41
41
  too. So enabling a capability is enough; the owner does not list methods.
42
+ - **What a Brandy app cannot enable:** `app_info`, `calls`, `godot`, `himi_apps`, `live_activity`,
43
+ `local_database`, `release_control`, `system_intents`, `ui` and `wix_platform` — most need wiring
44
+ a website app's shell does not have, and `calls` waits on a third-party sign-off for its WebRTC
45
+ engine, so plan your page without them. `base44` works only when the
46
+ app also has a Base44 binding. Every other capability in the reference can be enabled; other Himi
47
+ apps (not Brandy) may offer these too.
42
48
  - Enabling a capability changes the app's native permissions, so the owner ships a **new app
43
49
  build** with it before your page can call it. Until then the call times out.
44
50
 
@@ -394,7 +400,7 @@ Codes other than the first three come from the capability itself; its reference
394
400
  // What the app answers when the page asks which capabilities it may call.
395
401
  "himalaya.capabilities": { v: 1, capabilities: { health: ["availability", "query", "requestPermission"], haptic: ["play"] } },
396
402
  "health.availability": { available: true },
397
- "health.requestPermission": undefined,
403
+ "health.requestPermission": { granted: ["steps"] },
398
404
  "health.query": { samples: [{ value: 4200 }] },
399
405
  "haptic.play": undefined,
400
406
  };
@@ -417,11 +423,20 @@ Codes other than the first three come from the capability itself; its reference
417
423
  Each uses the client from Step 1. The exact types are on each capability's page (see *Reference*).
418
424
 
419
425
  ```ts
420
- import { call, himalaya } from "./lib/himalaya";
421
-
422
- // Share a link through the phone's share sheet (from a tap). The sheet waits for the user: allow two minutes.
423
- // Outside the app, fall back to the browser's own share (or copy the link).
424
- const { completed } = await call<{ completed: boolean }>("share", "share", [{ text: "Join me on Friday", url: "https://example.com/e/42" }], 120_000);
426
+ import { call, himalaya, isEnabled } from "./lib/himalaya";
427
+
428
+ // Share a link (from a tap): the phone's share sheet inside the app, the browser's own share outside
429
+ // it, and a copied link where neither exists. The sheet waits for the user: allow two minutes.
430
+ const link = { text: "Join me on Friday", url: "https://example.com/e/42" };
431
+ if (await isEnabled("share", "share")) {
432
+ await call<{ completed: boolean }>("share", "share", [link], 120_000); // completed: false when cancelled
433
+ } else if (navigator.share) {
434
+ await navigator.share(link).catch(() => {}); // rejects with AbortError when the user closes the sheet
435
+ } else {
436
+ // The clipboard can be missing or refused (e.g. on plain http): then show the link to copy by hand.
437
+ const copied = await navigator.clipboard?.writeText(link.url).then(() => true, () => false);
438
+ if (!copied) window.prompt("Copy this link", link.url);
439
+ }
425
440
 
426
441
  // Where am I? Ask first, then read once. getCurrent answers null when no fix arrives in time.
427
442
  const status = await call("location", "requestPermission", [], 120_000);
@@ -87,8 +87,8 @@ binary. One app-specific worker imports exactly the app’s selected subset.
87
87
 
88
88
  ## Brandy
89
89
 
90
- Name the capabilities; Brandy supplies the companion worker. Health has a hand-written proof
91
- worker:
90
+ Name the capabilities; Brandy supplies the companion worker, so neither the page author nor the
91
+ app owner writes one. Health's is ready-made:
92
92
 
93
93
  ```json
94
94
  {
@@ -116,13 +116,15 @@ and allowlists every method a page can call on them (the methods each `web-sdk/<
116
116
  }
117
117
  ```
118
118
 
119
- Preparing the customer build (`npm run prepare:customer`) writes and builds it; for local
120
- previews, run `npm run web-sdk:companion` first. To expose fewer methods, write your own
121
- companion and name it in `bundle` — a named bundle is used as is.
119
+ The app's customer build writes and builds it. (Inside the Himi repository that is
120
+ `npm run prepare:customer -w @apps/himi-brandy`; for a local preview,
121
+ `npm run web-sdk:companion -w @apps/himi-brandy` first.) To expose
122
+ fewer methods, write your own companion and name it in `bundle` — a named bundle is used as is.
122
123
 
123
124
  Brandy accepts capabilities `himi dist` can add to an extensible shell. Capabilities requiring
124
- app-specific boot wiring remain refused until that shell supplies the wiring. Base44 is accepted
125
- only when the same Brandy contract contains a Base44 binding.
125
+ app-specific boot wiring remain refused until that shell supplies the wiring — the list is in
126
+ [the web page guide](https://apps.wix.com/_api/himi-serve/docs/web-page-native-sdk.md#before-you-start-what-the-app-owner-must-enable).
127
+ Base44 is accepted only when the same Brandy contract contains a Base44 binding.
126
128
 
127
129
  ## Security and current transport boundary
128
130
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1338.0",
3
+ "version": "0.1340.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": [
@@ -71,5 +71,5 @@
71
71
  "artifactId": "himalaya-cli"
72
72
  }
73
73
  },
74
- "falconPackageHash": "6c47db9919054dae107b64d10581ed667ba8e7daaf3cea349e1ed889"
74
+ "falconPackageHash": "4fcbb25c4038ec78082bd82a8360b9f7956f2ffa8c376442dfdeb91d"
75
75
  }