@almadar/core 4.4.1 → 4.4.2

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/builders.js CHANGED
@@ -62,6 +62,18 @@ var EntityFieldSchema = z.lazy(
62
62
  }).refine(
63
63
  (field) => field.type !== "relation" || field.relation !== void 0,
64
64
  { message: 'Relation config is required when type is "relation"', path: ["relation"] }
65
+ ).refine(
66
+ // Enum fields must carry their allowed values. Without this refine,
67
+ // the type was lying about what's valid — bare `type: 'enum'` without
68
+ // `values` passed zod but failed `orb validate` downstream with
69
+ // ORB_E_EMPTY_ENUM_VALUES, stalling the agent pipeline for 20 minutes.
70
+ // `enum` is the legacy field-name alias; accept either.
71
+ (field) => {
72
+ if (field.type !== "enum") return true;
73
+ const vals = field.values ?? field.enum;
74
+ return Array.isArray(vals) && vals.length > 0;
75
+ },
76
+ { message: "Enum field requires a non-empty `values` array", path: ["values"] }
65
77
  )
66
78
  );
67
79
  var ENTITY_ROLES = [