hostctl 0.1.61 → 0.1.62

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/index.js CHANGED
@@ -2745,7 +2745,7 @@ var Verbosity = {
2745
2745
  };
2746
2746
 
2747
2747
  // src/version.ts
2748
- var version = "0.1.61";
2748
+ var version = "0.1.62";
2749
2749
 
2750
2750
  // src/commands/pkg/create.ts
2751
2751
  import { promises as fs5 } from "fs";
@@ -32527,27 +32527,42 @@ function unwrapSchema(schema) {
32527
32527
  }
32528
32528
  return { schema: current, optional, nullable };
32529
32529
  }
32530
- function formatSchemaLines(schema) {
32530
+ function formatSchemaLines(schema, depth = 0) {
32531
32531
  if (!schema) return ["none"];
32532
- const def = schema._def ?? schema.def;
32532
+ const { schema: base } = unwrapSchema(schema);
32533
+ if (!base) return ["none"];
32534
+ const def = base._def ?? base.def;
32535
+ const typeName = def?.typeName || def?.type;
32536
+ const indent = " ".repeat(depth);
32537
+ if (typeName === "ZodUnion" || typeName === "union") {
32538
+ const options = def?.options ?? [];
32539
+ if (!options.length) return [];
32540
+ const lines = [];
32541
+ lines.push(`${indent}- anyOf:`);
32542
+ options.forEach((option, idx) => {
32543
+ lines.push(`${indent} - option ${idx + 1}:`);
32544
+ lines.push(...formatSchemaLines(option, depth + 2));
32545
+ });
32546
+ return lines;
32547
+ }
32533
32548
  const shapeSource = def?.shape || def?.shape_;
32534
32549
  const shape = shapeSource ? typeof shapeSource === "function" ? shapeSource.call(def) : shapeSource : void 0;
32535
32550
  if (shape && typeof shape === "object") {
32536
32551
  const lines = Object.entries(shape).map(([key, val]) => {
32537
- const summary2 = summarizeType(val);
32538
- const anyVal = val;
32552
+ const { schema: fieldSchema, optional } = unwrapSchema(val);
32553
+ const summary2 = summarizeType(fieldSchema);
32554
+ const anyVal = fieldSchema ?? val;
32539
32555
  const tn = anyVal?._def?.typeName || anyVal?.def?.type;
32540
32556
  const typeString = summary2.type || (tn ? String(tn).replace(/^Zod/, "").toLowerCase() : void 0);
32541
32557
  const desc = summary2.desc;
32542
- const optional = ["ZodOptional", "optional", "ZodNullable", "nullable", "ZodDefault", "default"].includes(tn);
32543
32558
  const typePart = typeString ? `: ${typeString}` : "";
32544
32559
  const descPart = desc ? ` - ${desc}` : "";
32545
- return `- ${key}${optional ? "?" : ""}${typePart}${descPart}`;
32560
+ return `${indent}- ${key}${optional ? "?" : ""}${typePart}${descPart}`;
32546
32561
  }).filter(Boolean);
32547
32562
  return lines;
32548
32563
  }
32549
- const summary = summarizeType(schema);
32550
- return summary.type ? [`- ${summary.type}${summary.desc ? ` - ${summary.desc}` : ""}`] : [];
32564
+ const summary = summarizeType(base);
32565
+ return summary.type ? [`${indent}- ${summary.type}${summary.desc ? ` - ${summary.desc}` : ""}`] : [];
32551
32566
  }
32552
32567
 
32553
32568
  // src/local-runtime.ts