@lahat-group/cli 1.1.2 → 1.1.4

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/index.js +42 -14
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7555,7 +7555,8 @@ var ShelfModuleSchema = BaseModuleSchema.extend({
7555
7555
  });
7556
7556
  var RailModuleSchema = BaseModuleSchema.extend({
7557
7557
  type: external_exports.literal("rail"),
7558
- railVariant: external_exports.enum(["tall", "short"]).optional()
7558
+ railVariant: external_exports.enum(["tall", "short"]).optional(),
7559
+ railKind: external_exports.enum(["standard", "pull-down"]).optional()
7559
7560
  });
7560
7561
  var DrawerInternalModuleSchema = BaseModuleSchema.extend({
7561
7562
  type: external_exports.literal("drawer-internal"),
@@ -7783,7 +7784,10 @@ var MBomLineItemSchema = external_exports.object({
7783
7784
  sku: external_exports.string(),
7784
7785
  qty: external_exports.number(),
7785
7786
  sellPrice: external_exports.number(),
7786
- costPrice: external_exports.number(),
7787
+ // Optional: `/api/mbom-debug` — the only producer this schema validates —
7788
+ // strips supplier cost before responding, since its consumer is the
7789
+ // customer-facing breakdown modal.
7790
+ costPrice: external_exports.number().optional(),
7787
7791
  comment: external_exports.string(),
7788
7792
  part: external_exports.string(),
7789
7793
  heightMm: external_exports.number(),
@@ -9061,6 +9065,19 @@ function getColumnDoorCount(bodyWidthCm) {
9061
9065
 
9062
9066
  // ../../packages/shared/src/describe.ts
9063
9067
  init_esm_shims();
9068
+
9069
+ // ../../packages/shared/src/hangingRail.ts
9070
+ init_esm_shims();
9071
+ var FRONTAL_RAIL_MAX_BODY_DEPTH_CM = 55;
9072
+ function allowsPullDownRail(bodyDepthCm) {
9073
+ return bodyDepthCm > FRONTAL_RAIL_MAX_BODY_DEPTH_CM;
9074
+ }
9075
+ function resolveRailPieceKind(railKind, bodyDepthCm) {
9076
+ if (!allowsPullDownRail(bodyDepthCm)) return "frontal";
9077
+ return railKind === "pull-down" ? "pull-down" : "standard";
9078
+ }
9079
+
9080
+ // ../../packages/shared/src/describe.ts
9064
9081
  var POSITION_LABELS = {
9065
9082
  "left-corner": "Left corner",
9066
9083
  "right-corner": "Right corner",
@@ -9243,7 +9260,8 @@ function groupModulesEn(modules, columnDepthCm, hasDoors) {
9243
9260
  break;
9244
9261
  case "rail": {
9245
9262
  const variant = mod.railVariant ?? "tall";
9246
- rails.push(variant);
9263
+ const kind = resolveRailPieceKind(mod.railKind, columnDepthCm);
9264
+ rails.push(kind === "standard" ? variant : `${variant}, ${kind}`);
9247
9265
  break;
9248
9266
  }
9249
9267
  case "drawer-internal":
@@ -9273,6 +9291,7 @@ function groupModulesHe(modules, columnDepthCm, hasDoors) {
9273
9291
  const rails = [];
9274
9292
  const drawersByHeight = /* @__PURE__ */ new Map();
9275
9293
  const RAIL_VARIANT_HE = { tall: "\u05D2\u05D1\u05D5\u05D4", short: "\u05E0\u05DE\u05D5\u05DA" };
9294
+ const RAIL_KIND_HE = { "pull-down": "\u05E1\u05E8\u05D5\u05D5\u05D8\u05D5", frontal: "\u05DE\u05D5\u05D8 \u05EA\u05DC\u05D9\u05D9\u05D4 \u05E7\u05D3\u05DE\u05D9" };
9276
9295
  const derivedDepth = deriveDrawerDepthCm(columnDepthCm * 10, hasDoors);
9277
9296
  for (const mod of modules) {
9278
9297
  switch (mod.type) {
@@ -9281,7 +9300,9 @@ function groupModulesHe(modules, columnDepthCm, hasDoors) {
9281
9300
  break;
9282
9301
  case "rail": {
9283
9302
  const variant = mod.railVariant ?? "tall";
9284
- rails.push(RAIL_VARIANT_HE[variant] ?? variant);
9303
+ const variantHe = RAIL_VARIANT_HE[variant] ?? variant;
9304
+ const kindHe = RAIL_KIND_HE[resolveRailPieceKind(mod.railKind, columnDepthCm)];
9305
+ rails.push(kindHe ? `${variantHe}, ${kindHe}` : variantHe);
9285
9306
  break;
9286
9307
  }
9287
9308
  case "drawer-internal":
@@ -9801,13 +9822,19 @@ var POOL_SIZE_MULTIPLIER = 128;
9801
9822
  var pool;
9802
9823
  var poolOffset;
9803
9824
  function fillPool(bytes) {
9804
- if (!pool || pool.length < bytes) {
9805
- pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER);
9806
- crypto.getRandomValues(pool);
9807
- poolOffset = 0;
9808
- } else if (poolOffset + bytes > pool.length) {
9809
- crypto.getRandomValues(pool);
9810
- poolOffset = 0;
9825
+ if (bytes < 0) throw new RangeError("Wrong ID size");
9826
+ try {
9827
+ if (!pool || pool.length < bytes) {
9828
+ pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER);
9829
+ crypto.getRandomValues(pool);
9830
+ poolOffset = 0;
9831
+ } else if (poolOffset + bytes > pool.length) {
9832
+ crypto.getRandomValues(pool);
9833
+ poolOffset = 0;
9834
+ }
9835
+ } catch (e) {
9836
+ pool = void 0;
9837
+ throw e;
9811
9838
  }
9812
9839
  poolOffset += bytes;
9813
9840
  }
@@ -10481,6 +10508,7 @@ function placementsToModules(placements, H) {
10481
10508
  type: "rail",
10482
10509
  height: 0,
10483
10510
  railVariant: p.railVariant ?? "tall",
10511
+ railKind: p.railKind ?? "standard",
10484
10512
  spacingAbove,
10485
10513
  spacingBelow
10486
10514
  });
@@ -10579,7 +10607,7 @@ function generateCustomLayout(options, H) {
10579
10607
  const clearance = railType === "tall" ? RAIL_CLEARANCE_TALL_CM : RAIL_CLEARANCE_SHORT_CM;
10580
10608
  const n1 = options.railUpperShelfCount ?? 0;
10581
10609
  const railY = options.railAtCeiling ? H - RAIL_CLEARANCE_ABOVE_MIN_CM : grid[Math.max(0, grid.length - 1 - n1)] - RAIL_CLEARANCE_ABOVE_MIN_CM;
10582
- placements.push({ type: "rail", y: railY, height: 0, railVariant: railType });
10610
+ placements.push({ type: "rail", y: railY, height: 0, railVariant: railType, railKind: options.railKind });
10583
10611
  hangingZones.push({ top: railY, bottom: railY - clearance });
10584
10612
  if (options.hasSecondRail && options.secondRailType) {
10585
10613
  const secondClearance = options.secondRailType === "tall" ? RAIL_CLEARANCE_TALL_CM : RAIL_CLEARANCE_SHORT_CM;
@@ -10590,7 +10618,7 @@ function generateCustomLayout(options, H) {
10590
10618
  if (anchorIdx2 >= 0) {
10591
10619
  const secondRailY = grid[anchorIdx2] - RAIL_CLEARANCE_ABOVE_MIN_CM;
10592
10620
  if (secondRailY > 0) {
10593
- placements.push({ type: "rail", y: secondRailY, height: 0, railVariant: options.secondRailType });
10621
+ placements.push({ type: "rail", y: secondRailY, height: 0, railVariant: options.secondRailType, railKind: options.secondRailKind });
10594
10622
  hangingZones.push({ top: secondRailY, bottom: secondRailY - secondClearance });
10595
10623
  }
10596
10624
  }
@@ -11863,7 +11891,7 @@ async function formatCliError(err, json) {
11863
11891
 
11864
11892
  // src/version.ts
11865
11893
  init_esm_shims();
11866
- var CLI_VERSION = "1.1.2";
11894
+ var CLI_VERSION = "1.1.4";
11867
11895
 
11868
11896
  // src/index.ts
11869
11897
  program.name("wardrobe").description("Wardrobe configurator CLI").version(CLI_VERSION);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lahat-group/cli",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "CLI + Claude Skill to build, validate, price, and save wardrobe designs.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",