@wix/himalaya-cli 0.1620.0 → 0.1621.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 +18 -10
  2. package/package.json +2 -2
package/dist/cli.mjs CHANGED
@@ -29373,6 +29373,7 @@ function resolveIdiom(tokens2, ctx = {}) {
29373
29373
  var IDIOM_CONTEXTS, UNSAFE_KEYS;
29374
29374
  var init_idiom = __esm({
29375
29375
  "../../core/ts/src/idiom.ts"() {
29376
+ "use strict";
29376
29377
  init_define_HHP_CATALOG();
29377
29378
  IDIOM_CONTEXTS = {
29378
29379
  ios: { native: ["ios"] },
@@ -208647,13 +208648,19 @@ import { copyFileSync as copyFileSync3, mkdtempSync as mkdtempSync12, readFileSy
208647
208648
  import { tmpdir as tmpdir13 } from "node:os";
208648
208649
  import { basename as basename29, dirname as dirname66, join as join131, resolve as resolve93 } from "node:path";
208649
208650
  import { fileURLToPath as fileURLToPath39 } from "node:url";
208650
- function parseVerdict(value2) {
208651
+ function parseVerdict(value2, captured) {
208651
208652
  const v2 = value2;
208652
208653
  if (!v2 || !VERDICTS.has(v2.design) || !VERDICTS.has(v2.parity) || !CONFIDENCE.has(v2.confidence) || !Array.isArray(v2.findings)) return null;
208653
208654
  for (const f2 of v2.findings) {
208654
- if (!f2 || !PANES.has(f2.surface) || typeof f2.region !== "string" || typeof f2.what !== "string") return null;
208655
+ if (!f2 || !PANES.has(f2.surface) || !KINDS2.has(f2.kind) || typeof f2.region !== "string" || typeof f2.what !== "string") return null;
208655
208656
  }
208656
- return { verdict: worse(v2.design, v2.parity), design: v2.design, parity: v2.parity, findings: v2.findings, confidence: v2.confidence };
208657
+ const findings = captured ? v2.findings.filter((f2) => captured.has(f2.surface)) : v2.findings;
208658
+ const blank = (panes) => findings.some((f2) => f2.kind === "blank" && panes.includes(f2.surface));
208659
+ const onlySkipped = (panes) => findings.length < v2.findings.length && v2.findings.some((f2) => panes.includes(f2.surface)) && !findings.some((f2) => panes.includes(f2.surface));
208660
+ const own6 = (said, panes) => (said === "partial" || said === "mismatch") && onlySkipped(panes) ? "match" : said;
208661
+ const design = blank(["web"]) ? worse(v2.design, "mismatch") : own6(v2.design, ["web"]);
208662
+ const parity = blank(["ios", "android"]) ? worse(v2.parity, "mismatch") : own6(v2.parity, ["ios", "android"]);
208663
+ return { verdict: worse(design, parity), design, parity, findings, confidence: v2.confidence };
208657
208664
  }
208658
208665
  function judgeArgs(schema2) {
208659
208666
  return [
@@ -208709,14 +208716,14 @@ async function judgeStrip(strip3, screen, variant, opts = {}) {
208709
208716
  } catch {
208710
208717
  return cannotTell("the judge's answer was not JSON");
208711
208718
  }
208712
- return parseVerdict(parsed) ?? cannotTell("the judge's answer did not match tools/judges/fidelity/verdict.schema.json");
208719
+ return parseVerdict(parsed, opts.captured) ?? cannotTell("the judge's answer did not match tools/judges/fidelity/verdict.schema.json");
208713
208720
  }
208714
- var SOURCE_JUDGE_DIR, JUDGE_MODEL, spawnProcess, cannotTell, SEVERITY, worse, VERDICTS, CONFIDENCE, PANES;
208721
+ var SOURCE_JUDGE_DIR, JUDGE_MODEL, spawnProcess, cannotTell, SEVERITY, worse, VERDICTS, CONFIDENCE, PANES, KINDS2;
208715
208722
  var init_judge = __esm({
208716
208723
  "src/fidelity/judge.ts"() {
208717
208724
  init_define_HHP_CATALOG();
208718
208725
  SOURCE_JUDGE_DIR = resolve93(dirname66(fileURLToPath39(import.meta.url)), "../../../judges/fidelity");
208719
- JUDGE_MODEL = "sonnet";
208726
+ JUDGE_MODEL = "claude-sonnet-5-5";
208720
208727
  spawnProcess = (cmd, args, { cwd, input, timeoutMs }) => new Promise((done) => {
208721
208728
  let stdout = "", stderr = "", timedOut = false;
208722
208729
  const child = spawn7(cmd, args, { cwd, stdio: ["pipe", "pipe", "pipe"] });
@@ -208744,6 +208751,7 @@ var init_judge = __esm({
208744
208751
  VERDICTS = /* @__PURE__ */ new Set(["match", "partial", "mismatch", "cannot_tell"]);
208745
208752
  CONFIDENCE = /* @__PURE__ */ new Set(["low", "medium", "high"]);
208746
208753
  PANES = /* @__PURE__ */ new Set(["web", "ios", "android"]);
208754
+ KINDS2 = /* @__PURE__ */ new Set(["blank", "missing", "colour", "clipping", "order", "type_scale"]);
208747
208755
  }
208748
208756
  });
208749
208757
 
@@ -209004,8 +209012,8 @@ async function runFidelity(root, opts = {}) {
209004
209012
  verdict = skippedJudge(!w2?.file ? "no web render, and web is the reference for both design and parity" : frames.some((f2) => f2.noReference) ? `the mockup does not style ${variant}, and there is no native pane to compare with web` : "fewer than two captured panes, so there is nothing to compare");
209005
209013
  } else {
209006
209014
  stripFile = await strip3(judged2, stripPath2);
209007
- verdict = await judge(stripFile, screen, variant, opts.judgeDir ? { judgeDir: opts.judgeDir } : {});
209008
209015
  const captured = new Set(frames.filter((f2) => f2.file).map((f2) => f2.surface));
209016
+ verdict = await judge(stripFile, screen, variant, { captured, ...opts.judgeDir ? { judgeDir: opts.judgeDir } : {} });
209009
209017
  const parity = captured.has("ios") || captured.has("android") ? verdict.parity : "cannot_tell";
209010
209018
  verdict = { ...verdict, parity, verdict: worse(verdict.design, parity), findings: verdict.findings.filter((f2) => captured.has(f2.surface)) };
209011
209019
  }
@@ -215587,16 +215595,16 @@ WHAT A PATCH DOES NOT CARRY \u2014 all reported in the output, never silent
215587
215595
  async function patchCommand(ctx) {
215588
215596
  const { io: io2, pos, flags, client: client2, runReleasePatch, patchBlastRadius } = ctx;
215589
215597
  const PATCH_USAGE = "himi patch screen <id> --file <d.json> | bundle --file <b.js> (--for-screen <id>[,<id>]|--no-rebind) | tokens --file <t.json> | app-config --file <c.json> ; --app <a> (--draft|--live) [--from-release <id>] [--accept-regressions] [--notes <t>]";
215590
- const KINDS2 = ["screen", "bundle", "tokens", "app-config"];
215598
+ const KINDS3 = ["screen", "bundle", "tokens", "app-config"];
215591
215599
  if (flags.help === true) {
215592
215600
  io2.log(PATCH_HELP);
215593
215601
  return 0;
215594
215602
  }
215595
215603
  const kind = pos[1];
215596
- if (!kind || !KINDS2.includes(kind)) {
215604
+ if (!kind || !KINDS3.includes(kind)) {
215597
215605
  io2.error(JSON.stringify({
215598
215606
  error: kind ? `unknown patch kind "${kind}"` : "patch needs a <kind>",
215599
- kinds: KINDS2,
215607
+ kinds: KINDS3,
215600
215608
  usage: PATCH_USAGE
215601
215609
  }));
215602
215610
  return 2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1620.0",
3
+ "version": "0.1621.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": [
@@ -72,5 +72,5 @@
72
72
  "artifactId": "himalaya-cli"
73
73
  }
74
74
  },
75
- "falconPackageHash": "69fc7303ef0eb0de93d7760ffde1fb553ca5a667e515c46fac02efc3"
75
+ "falconPackageHash": "c21c6aa4541e5ed5dda0d5f14934ad131349b6f6f125a9d5ff58315a"
76
76
  }