@ikijs/mcp 0.26.0 → 0.26.1

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/cli.js CHANGED
@@ -3793,6 +3793,7 @@ var IRIS_W = 50;
3793
3793
  var EYEWHITE_SRC = "eyewhite.png";
3794
3794
  var EYE_LASH_LUMA = 120;
3795
3795
  var LASH_KEEP_FRACTION = 0.5;
3796
+ var EYE_LID_WARMTH = 30;
3796
3797
  var NOSE_TIP_AT = 0.66;
3797
3798
  var DEFAULT_LAYOUT = {
3798
3799
  // Back hair and body sit behind the face. Both are OPTIONAL: a parts dir
@@ -4276,6 +4277,36 @@ async function prepEyeSplit(partsDir) {
4276
4277
  }
4277
4278
  const lashCutoffY = minY + LASH_KEEP_FRACTION * (maxY - minY + 1);
4278
4279
  const detached = detachedAboveWhite(data, W, H);
4280
+ const isDark = (i) => data[i + 3] > 0 && luma(data, i) < EYE_LASH_LUMA;
4281
+ const isLight = (i) => data[i + 3] >= import_editor12.ALPHA_OPAQUE && luma(data, i) >= EYE_LASH_LUMA;
4282
+ const isWarm = (i) => data[i] - data[i + 2] >= EYE_LID_WARMTH;
4283
+ const whiteTop = new Int32Array(W).fill(-1);
4284
+ for (let x = 0; x < W; x++) {
4285
+ for (let y = 0; y < H; y++) {
4286
+ const i = (y * W + x) * 4;
4287
+ if (!detached[y * W + x] && isLight(i) && !isWarm(i)) {
4288
+ whiteTop[x] = y;
4289
+ break;
4290
+ }
4291
+ }
4292
+ }
4293
+ let first = 0;
4294
+ while (first < W && whiteTop[first] === -1) first++;
4295
+ if (first < W) {
4296
+ let last = W - 1;
4297
+ while (whiteTop[last] === -1) last--;
4298
+ whiteTop.fill(whiteTop[first], 0, first);
4299
+ whiteTop.fill(whiteTop[last], last + 1);
4300
+ }
4301
+ const lidStop = new Int32Array(W).fill(-1);
4302
+ for (let x = 0; x < W; x++) {
4303
+ for (let y = whiteTop[x] - 1; y >= 0; y--) {
4304
+ if (isDark((y * W + x) * 4)) {
4305
+ lidStop[x] = y;
4306
+ break;
4307
+ }
4308
+ }
4309
+ }
4279
4310
  const sclera = Buffer.from(data);
4280
4311
  const lash = Buffer.from(data);
4281
4312
  const lashLower = Buffer.from(data);
@@ -4283,12 +4314,13 @@ async function prepEyeSplit(partsDir) {
4283
4314
  for (let y = 0; y < H; y++) {
4284
4315
  for (let x = 0; x < W; x++) {
4285
4316
  const i = (y * W + x) * 4;
4286
- const isDark = data[i + 3] > 0 && luma(data, i) < EYE_LASH_LUMA;
4317
+ const dark = isDark(i);
4287
4318
  const upper = y <= lashCutoffY;
4288
- if (isDark && upper) sclera[i] = sclera[i + 1] = sclera[i + 2] = 255;
4319
+ if (dark && upper) sclera[i] = sclera[i + 1] = sclera[i + 2] = 255;
4289
4320
  if (detached[y * W + x]) sclera[i + 3] = 0;
4290
- if (!(isDark && upper)) lash[i + 3] = 0;
4291
- if (isDark && !upper) lowerInk = true;
4321
+ if (y < lidStop[x] && isLight(i) && isWarm(i)) sclera[i + 3] = 0;
4322
+ if (!(dark && upper)) lash[i + 3] = 0;
4323
+ if (dark && !upper) lowerInk = true;
4292
4324
  else lashLower[i + 3] = 0;
4293
4325
  }
4294
4326
  }
@@ -4687,7 +4719,7 @@ function formatPatchReports(reports) {
4687
4719
  });
4688
4720
  }
4689
4721
  function createIkiMcpServer() {
4690
- const server = new import_mcp.McpServer({ name: "iki", version: "0.26.0" });
4722
+ const server = new import_mcp.McpServer({ name: "iki", version: "0.26.1" });
4691
4723
  server.registerTool(
4692
4724
  "validate_iki",
4693
4725
  {