pixelkiln 0.68.1 → 0.69.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/index.cjs CHANGED
@@ -1693,14 +1693,42 @@ function fetchWithRetry(request, opts = {}) {
1693
1693
 
1694
1694
  // src/skeleton.ts
1695
1695
  var import_zod2 = require("zod");
1696
+ var SKELETON_LABELS = [
1697
+ "NOSE",
1698
+ "NECK",
1699
+ "RIGHT SHOULDER",
1700
+ "RIGHT ELBOW",
1701
+ "RIGHT ARM",
1702
+ "LEFT SHOULDER",
1703
+ "LEFT ELBOW",
1704
+ "LEFT ARM",
1705
+ "RIGHT HIP",
1706
+ "RIGHT KNEE",
1707
+ "RIGHT LEG",
1708
+ "LEFT HIP",
1709
+ "LEFT KNEE",
1710
+ "LEFT LEG",
1711
+ "RIGHT EYE",
1712
+ "LEFT EYE",
1713
+ "RIGHT EAR",
1714
+ "LEFT EAR"
1715
+ ];
1696
1716
  var SkeletonKeypointSchema = import_zod2.z.object({
1697
- label: import_zod2.z.string().min(1),
1717
+ label: import_zod2.z.enum(SKELETON_LABELS),
1698
1718
  x: import_zod2.z.number().min(0).max(1),
1699
1719
  y: import_zod2.z.number().min(0).max(1),
1700
1720
  z_index: import_zod2.z.number(),
1701
1721
  depth: import_zod2.z.number().optional()
1702
1722
  }).strict();
1703
- var SkeletonFrameSchema = import_zod2.z.array(SkeletonKeypointSchema).length(18);
1723
+ var SkeletonFrameSchema = import_zod2.z.array(SkeletonKeypointSchema).length(18).superRefine((frame, context) => {
1724
+ const seen = /* @__PURE__ */ new Set();
1725
+ for (const [index, joint] of frame.entries()) {
1726
+ if (seen.has(joint.label)) {
1727
+ context.addIssue({ code: import_zod2.z.ZodIssueCode.custom, message: `"${joint.label}" appears twice`, path: [index, "label"] });
1728
+ }
1729
+ seen.add(joint.label);
1730
+ }
1731
+ });
1704
1732
  var SkeletonSetSchema = import_zod2.z.object({
1705
1733
  firstFrameKeypoints: SkeletonFrameSchema,
1706
1734
  frames: import_zod2.z.array(SkeletonFrameSchema).min(3).max(15)
@@ -3065,7 +3093,7 @@ var PixelLabClient = class {
3065
3093
  * account (see `EstimateSkeletonResponseSchema`'s own caveat).
3066
3094
  */
3067
3095
  async estimateSkeleton(args) {
3068
- const body = { image: args.image };
3096
+ const body = { image: { type: "base64", base64: args.image.base64, format: args.image.format } };
3069
3097
  const res = validateResponse(
3070
3098
  EstimateSkeletonResponseSchema,
3071
3099
  await this.request("/estimate-skeleton", { method: "POST", body: JSON.stringify(body) }),