@wix/himalaya-cli 0.1360.0 → 0.1362.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
@@ -28055,6 +28055,7 @@ __export(capabilities_exports, {
28055
28055
  capabilityConfigFindings: () => capabilityConfigFindings,
28056
28056
  capabilityInfo: () => capabilityInfo,
28057
28057
  capabilityIssues: () => capabilityIssues,
28058
+ capabilityRemedy: () => capabilityRemedy,
28058
28059
  contentShell: () => contentShell,
28059
28060
  envelopeSubsetIssues: () => envelopeSubsetIssues,
28060
28061
  formatCapability: () => formatCapability,
@@ -28063,6 +28064,7 @@ __export(capabilities_exports, {
28063
28064
  isShell: () => isShell,
28064
28065
  lastDistFromJob: () => lastDistFromJob,
28065
28066
  needsBinaryNotice: () => needsBinaryNotice,
28067
+ notInBinaryReason: () => notInBinaryReason,
28066
28068
  readLastDist: () => readLastDist,
28067
28069
  shellDistAdds: () => shellDistAdds,
28068
28070
  shellServes: () => shellServes,
@@ -28107,6 +28109,8 @@ function capabilityInfo(rawId, sdkRef = []) {
28107
28109
  const pkgs = PACKAGES[id] ?? [...new Set((CAPABILITY_IMPLIES[id] ?? []).flatMap((i2) => PACKAGES[i2] ?? []))];
28108
28110
  const ios = iosPlanFor([id]);
28109
28111
  const android = androidPlanFor([id]);
28112
+ const modules = modulesOf(id);
28113
+ const refusal = distAddRefusal(id);
28110
28114
  return {
28111
28115
  id,
28112
28116
  import: [...pkgs],
@@ -28116,9 +28120,30 @@ function capabilityInfo(rawId, sdkRef = []) {
28116
28120
  ios: { info: ios.info, entitlements: ios.entitlements },
28117
28121
  android: { permissions: android.permissions, features: android.features.map((f2) => f2.name) },
28118
28122
  shells: Object.fromEntries(SHELLS.map((s2) => [s2, shellSupport(s2, id)])),
28119
- declare: DECLARE_HINT
28123
+ declare: DECLARE_HINT,
28124
+ description: summaryOf2(pkgs, sdkRef),
28125
+ implies: [...CAPABILITY_IMPLIES[id] ?? []],
28126
+ modules,
28127
+ components: Object.entries(COMPONENT_MODULES).filter(([, m2]) => modules.some((x2) => x2.id === m2)).map(([component]) => component).sort(),
28128
+ distAddable: refusal === null,
28129
+ distAddRefusal: refusal
28120
28130
  };
28121
28131
  }
28132
+ function modulesOf(id) {
28133
+ return NATIVE_MODULES.filter((m2) => {
28134
+ const caps = capabilitiesOfModule(m2);
28135
+ return caps.ios.includes(id) || caps.android.includes(id);
28136
+ }).map((m2) => ({
28137
+ id: m2.id,
28138
+ ...m2.ios ? { ios: m2.ios.product } : {},
28139
+ ...m2.android ? { android: m2.android.project } : {}
28140
+ }));
28141
+ }
28142
+ function summaryOf2(pkgs, sdkRef) {
28143
+ const d2 = pkgs.map((p2) => sdkRef.find((s2) => s2.name === p2)?.description ?? "").find((x2) => x2.trim()) ?? "";
28144
+ const first = /^[\s\S]*?[.!?](?=\s|$)/.exec(d2.trim())?.[0] ?? d2.trim();
28145
+ return first.replace(/\s+/g, " ").slice(0, 200);
28146
+ }
28122
28147
  function allCapabilities(sdkRef = []) {
28123
28148
  return KNOWN_CAPABILITY_IDS.map((id) => capabilityInfo(id, sdkRef));
28124
28149
  }
@@ -28177,22 +28202,53 @@ function needsBinaryNotice(json6) {
28177
28202
  function noImportLabel(id) {
28178
28203
  return BRIDGE_CAPABILITY_IDS.includes(id) || id === "wix_platform" ? "a bridge capability (no @himalaya import of its own)" : "declare-only (no @himalaya import of its own)";
28179
28204
  }
28180
- function formatCapability(c2) {
28205
+ function notInBinaryReason(c2, shell) {
28206
+ const s2 = SHELL_CAPABILITIES[shell];
28207
+ if (s2 && !s2.extensible) {
28208
+ return `${s2.shared ? "one shared binary" : "a fixed binary"} \u2014 only a new ${shell} build adds it; a content package cannot`;
28209
+ }
28210
+ return c2.distAddRefusal ? `a dist build cannot add it: ${c2.id} ${c2.distAddRefusal}` : "a dist build would add it";
28211
+ }
28212
+ function capabilityRemedy(c2, shell) {
28213
+ const sel = shell ? SHELL_CAPABILITIES[shell] : void 0;
28214
+ if (shell && sel && !sel.extensible && c2.shells[shell] !== "serves") {
28215
+ return `${shell} is ${sel.shared ? "one shared binary" : "a fixed binary"} \u2014 only a new ${shell} build adds ${c2.id}; \`himi dist\` and an OTA push cannot. Or pick a shell whose binary already serves it (${SHELLS.filter((x2) => c2.shells[x2] === "serves").join(", ") || "none today"}).`;
28216
+ }
28217
+ if (!c2.distAddable) {
28218
+ const serves = SHELLS.filter((s2) => c2.shells[s2] === "serves");
28219
+ return `pick a shell whose binary already serves it (${serves.join(", ") || "none today"}) \u2014 a dist build cannot add it (${c2.id} ${c2.distAddRefusal}).`;
28220
+ }
28221
+ if (!c2.needsNativeBuild) return "declare it; `himi dist` registers it in an extensible shell that does not yet.";
28222
+ return "a NEW binary (`himi dist`) \u2014 declare it in config.ts `capabilities`, or list it in `capabilityEnvelope` to build it in now and turn it on later over the air. An OTA push alone cannot add it.";
28223
+ }
28224
+ function formatCapability(c2, shell) {
28181
28225
  const lines = [`${c2.id} \u2014 ${c2.import.length ? `import from ${c2.import.join(" or ")}` : noImportLabel(c2.id)}`];
28226
+ if (c2.description) lines.push(` about: ${c2.description}`);
28182
28227
  if (c2.exports.length) lines.push(` exports: ${c2.exports.join(", ")}`);
28183
28228
  if (c2.verbs.length) lines.push(` verbs: ${c2.verbs.map((v2) => `capability.${c2.id}.${v2}`).join(", ")}`);
28229
+ if (c2.implies.length) lines.push(` implies: ${c2.implies.join(", ")} (declaring ${c2.id} grants it)`);
28184
28230
  lines.push(` declare: ${c2.declare}`);
28185
28231
  const iosKeys = [...Object.keys(c2.ios.info), ...Object.keys(c2.ios.entitlements)];
28186
28232
  const androidKeys = [...c2.android.permissions, ...c2.android.features];
28187
28233
  lines.push(
28188
28234
  c2.needsNativeBuild ? ` binary: needs a NATIVE build \u2014 iOS ${iosKeys.join(", ") || "(nothing)"}; Android ${androidKeys.join(", ") || "(nothing)"}. An OTA push cannot add it.` : " binary: no native footprint \u2014 works in any shell that registers its handler."
28189
28235
  );
28236
+ lines.push(
28237
+ c2.modules.length ? ` module: ${c2.modules.map((m2) => `${m2.id} (${[m2.ios && `iOS ${m2.ios}`, m2.android && `Android ${m2.android}`].filter(Boolean).join(", ")})`).join("; ")}` + (c2.components.length ? ` \u2014 also needed by the ${c2.components.join(", ")} component${c2.components.length === 1 ? "" : "s"}` : "") : " module: none \u2014 its native code is in the core runtime"
28238
+ );
28239
+ lines.push(` dist: ${c2.distAddable ? "a `himi dist` build can add it to an extensible shell" : `cannot be added at dist \u2014 ${c2.id} ${c2.distAddRefusal}`}`);
28190
28240
  const serves = SHELLS.filter((s2) => c2.shells[s2] === "serves");
28191
28241
  const adds = SHELLS.filter((s2) => c2.shells[s2] === "dist-adds");
28192
28242
  const not = SHELLS.filter((s2) => c2.shells[s2] === "not-in-binary");
28243
+ const byReason = /* @__PURE__ */ new Map();
28244
+ for (const s2 of not) {
28245
+ const r2 = notInBinaryReason(c2, s2);
28246
+ byReason.set(r2, [...byReason.get(r2) ?? [], s2]);
28247
+ }
28193
28248
  lines.push(
28194
- ` shells: served by ${serves.join(", ") || "none"}` + (adds.length ? `; \`himi dist\` adds it to ${adds.join(", ")}` : "") + (not.length ? `; NOT in the ${not.join(", ")} binary` : "")
28249
+ ` shells: served by ${serves.join(", ") || "none"}` + (adds.length ? `; \`himi dist\` adds it to ${adds.join(", ")}` : "") + [...byReason].map(([r2, shells]) => `; NOT in the ${shells.join(", ")} binary (${r2})`).join("")
28195
28250
  );
28251
+ if (adds.length || not.length) lines.push(` remedy: ${capabilityRemedy(c2, shell)}`);
28196
28252
  return lines;
28197
28253
  }
28198
28254
  function formatCapabilityList(caps, shell) {
@@ -153530,7 +153586,7 @@ function rawTools() {
153530
153586
  {
153531
153587
  name: "himi_capabilities",
153532
153588
  title: "Native capabilities (camera, location, push, \u2026)",
153533
- description: "The native capabilities a worker can use: the @himalaya import, where to declare it (config.ts `capabilities` + the screen's logicBundle.declaredCapabilities), what the binary needs (usage strings, permissions), and which `himi dist --shell` binaries serve it. A capability with a native footprint only arrives with a new binary \u2014 an OTA push cannot add it. Offline.",
153589
+ description: "The native capabilities a worker can use: the @himalaya import, where to declare it (config.ts `capabilities` + the screen's logicBundle.declaredCapabilities), what the binary needs (usage strings, permissions), the native module it links (`modules`) and the components that need that module (`components`), and which `himi dist --shell` binaries serve it. A capability with a native footprint only arrives with a new binary \u2014 an OTA push cannot add it; list it in config.ts `capabilityEnvelope` to build it in now and turn it on later. `distAddable` / `distAddRefusal` say whether a `himi dist` build can add it to an extensible shell, and why not. Offline.",
153534
153590
  annotations: LEARN,
153535
153591
  inputSchema: z3.object({
153536
153592
  id: z3.string().optional().describe("One capability, e.g. `camera`. Omit for all."),
@@ -178515,7 +178571,7 @@ Guides in your browser: ${idx.portalUrl}`);
178515
178571
  return 0;
178516
178572
  }
178517
178573
  case "capabilities": {
178518
- const { allCapabilities: allCapabilities2, capabilityInfo: capabilityInfo2, contentShell: contentShell2, formatCapability: formatCapability2, formatCapabilityList: formatCapabilityList2, isShell: isShell2, SHELLS: SHELLS2 } = await Promise.resolve().then(() => (init_capabilities(), capabilities_exports));
178574
+ const { allCapabilities: allCapabilities2, capabilityInfo: capabilityInfo2, contentShell: contentShell2, formatCapability: formatCapability2, formatCapabilityList: formatCapabilityList2, isShell: isShell2, notInBinaryReason: notInBinaryReason2, SHELLS: SHELLS2 } = await Promise.resolve().then(() => (init_capabilities(), capabilities_exports));
178519
178575
  const sdkRef = loadSdkReference();
178520
178576
  const shell = contentShell2(contentDir(flags), str9(flags.shell));
178521
178577
  if (shell && !isShell2(shell)) {
@@ -178533,8 +178589,11 @@ Guides in your browser: ${idx.portalUrl}`);
178533
178589
  print({ ok: true, ...c2, ...shell ? { shell, servedByShell: c2.shells[shell] === "serves" } : {} });
178534
178590
  return 0;
178535
178591
  }
178536
- for (const line of formatCapability2(c2)) io2.log(line);
178537
- if (shell) io2.log(` ${shell}: ${c2.shells[shell] === "serves" ? "serves it" : "does NOT serve it \u2014 its binary is not built with it"}`);
178592
+ for (const line of formatCapability2(c2, shell ?? void 0)) io2.log(line);
178593
+ if (shell) {
178594
+ const v2 = c2.shells[shell];
178595
+ io2.log(` ${shell}: ${v2 === "serves" ? "serves it" : v2 === "dist-adds" ? "does not serve it yet \u2014 `himi dist` adds it" : `does NOT serve it \u2014 ${notInBinaryReason2(c2, shell)}`}`);
178596
+ }
178538
178597
  return 0;
178539
178598
  }
178540
178599
  const caps = allCapabilities2(sdkRef);
@@ -22,10 +22,35 @@ himi capabilities --shell branded-lite # what that one binary serves
22
22
 
23
23
  ```
24
24
  camera — import from @himalaya/camera
25
- exports: capturePhoto, pickDocument, scanQR
26
- declare: config.ts `capabilities` AND each calling screen's `logicBundle.declaredCapabilities`
27
- binary: needs a NATIVE build — iOS NSCameraUsageDescription; Android android.permission.CAMERA …
28
- shells: served by owner-lite, player; `himi dist` adds it to base44, branded-lite, brandy; NOT in the demo-app binary
25
+ about: Tier-5 typed binding to the platform's camera capability.
26
+ exports: capturePhoto, pickDocument, scanQR, version
27
+ verbs: capability.camera.capture, capability.camera.pickDocument, capability.camera.scanQR
28
+ declare: config.ts `capabilities` (the app-level list a binary is built with) AND each calling screen's `logicBundle.declaredCapabilities` (the runtime gate)
29
+ binary: needs a NATIVE build — iOS NSCameraUsageDescription, NSPhotoLibraryUsageDescription; Android android.permission.CAMERA, android.hardware.camera. An OTA push cannot add it.
30
+ module: none — its native code is in the core runtime
31
+ dist: a `himi dist` build can add it to an extensible shell
32
+ shells: served by owner-lite, player; `himi dist` adds it to base44, branded-lite, brandy; NOT in the demo-app binary (a fixed binary — only a new demo-app build adds it; a content package cannot)
33
+ remedy: a NEW binary (`himi dist`) — declare it in config.ts `capabilities`, or list it in `capabilityEnvelope` to build it in now and turn it on later over the air. An OTA push alone cannot add it.
34
+ ```
35
+
36
+ The per-id output also answers three build questions (the JSON and MCP forms carry the same fields as
37
+ `modules`, `components`, `distAddable` and `distAddRefusal`):
38
+
39
+ - `module:` — the native module the capability links into a binary (its SwiftPM product and Gradle
40
+ project), and the SDUI components that need that module too (`animation` — also needed by the Lottie, Rive components).
41
+ - `dist:` — whether a `himi dist` build can add the capability to an extensible shell, and if not,
42
+ why.
43
+ - `remedy:` — what to do about it. It takes the shell you passed with `--shell` into account.
44
+
45
+ A capability a build cannot add shows the refusal reason, for example (`himi capabilities live_activity`,
46
+ abridged):
47
+
48
+ ```
49
+ live_activity — import from @himalaya/live-activity
50
+ module: live_activity (iOS HimalayaCoreLiveActivity, Android :core-runtime-live-update)
51
+ dist: cannot be added at dist — live_activity needs a WidgetKit extension target in the shell's project, which a build cannot add
52
+ shells: served by branded-lite, demo-app, owner-lite; NOT in the base44, brandy binary (a dist build cannot add it …); NOT in the player binary (one shared binary …)
53
+ remedy: pick a shell whose binary already serves it (branded-lite, demo-app, owner-lite) — a dist build cannot add it (live_activity needs a WidgetKit extension target in the shell's project, which a build cannot add).
29
54
  ```
30
55
 
31
56
  Agents: the same data is the `himi_capabilities` MCP tool. `himi sdk <name>` also prints the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1360.0",
3
+ "version": "0.1362.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": "0a238e262e21ac93a2e8120f032811ae402c599e5b3e208cd0def547"
74
+ "falconPackageHash": "6f8e9ebff2033817c8121233af0096191f0d147fc9d49e65d9e6f02d"
75
75
  }