@ikijs/mcp 0.21.0 → 0.23.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/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  createIkiMcpServer
4
- } from "./chunk-EKGWFKU2.mjs";
4
+ } from "./chunk-YQECLFI4.mjs";
5
5
 
6
6
  // src/cli.ts
7
7
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
package/dist/index.d.mts CHANGED
@@ -189,6 +189,33 @@ type AutoRigResult = {
189
189
  */
190
190
  declare function autoRigFromLayers(input: AutoRigInput): Promise<AutoRigResult>;
191
191
 
192
+ /**
193
+ * The measure's lip set checks. The rig folds the mouth open off the layers'
194
+ * own alpha edges, per canvas column inside the opening (where `mouth_inner`
195
+ * has a run): the interior's top must reach the line above it and the skin must
196
+ * reach the interior, or a gap shows the face between them at rest. The
197
+ * geometry is the rig's own: `mouthOpening`, run on the three layers as
198
+ * `auto_rig_from_layers` runs it. The composer meets that contract by
199
+ * construction; these checks are for a set it did not cut (hand-prepared
200
+ * layers, a re-cut) and for the drawings the contract cannot save: a mouth too
201
+ * small to fold, a line too thin to close on, green the key left, an interior
202
+ * with holes. The lip layers' straight edges are the split's cuts, and so are
203
+ * the inside layers' (`mouth_tongue`, `mouth_teeth`), so the generic edge and
204
+ * flat-cut checks skip them all (`isLipLayerRole`). Of an inside layer the rig reads
205
+ * only its box, so it is checked for the set it needs, its canvas and its box.
206
+ */
207
+
208
+ /** What the report says of the opening, for judging a half-open mouth. */
209
+ interface LipFacts {
210
+ opening: {
211
+ width: number;
212
+ height: number;
213
+ line: number;
214
+ };
215
+ /** `MouthOpen` below which the slit has not opened: `v* = w' / (H + w')`. */
216
+ deadZone: number;
217
+ }
218
+
192
219
  /**
193
220
  * Measure composed Iki role layers and flag the failure modes that have
194
221
  * actually shipped broken characters. Read-only: it never edits anything.
@@ -202,6 +229,7 @@ declare function autoRigFromLayers(input: AutoRigInput): Promise<AutoRigResult>;
202
229
  * `sharp` must stay confined to @ikijs/mcp; the decode goes through
203
230
  * ./node-images, this package's single image-decode boundary.
204
231
  */
232
+
205
233
  /** Alpha-derived geometry of one layer, in canvas pixels. */
206
234
  interface LayerStats {
207
235
  w: number;
@@ -232,6 +260,15 @@ interface MeasureReport {
232
260
  /** Roles whose PNG is fully transparent — nothing to measure. */
233
261
  empty: string[];
234
262
  warnings: string[];
263
+ /**
264
+ * The lip set's opening as the rig reads it, set whenever the three lip
265
+ * layers are present and readable. The fold's dead zone `deadZone` is the
266
+ * `MouthOpen` below which the slit between the lips has not opened, and
267
+ * it varies with the drawing (0.03 on one opening, 0.26 on another), so a
268
+ * half-open mouth that shows no slit is judged against it, not against a
269
+ * fixed number.
270
+ */
271
+ lips?: LipFacts;
235
272
  }
236
273
  type MeasureResult = ({
237
274
  ok: true;
@@ -275,6 +312,13 @@ declare function formatMeasureReport(result: MeasureReport & {
275
312
  * Composing is deterministic: same parts -> same layers, so re-run freely after
276
313
  * tuning `layout` (no image re-generation needed).
277
314
  *
315
+ * The mouth has two routes. `mouth.png` (+ optional `mouth_open.png`) is a
316
+ * closed drawing and an open one that cross-fade. `mouth_keyed.png` (the open
317
+ * mouth, its inside flat #00FF00) + `mouth_interior.png` is the lip set: the
318
+ * composer keys and splits it into `mouth_inner` / `lip_lower` / `lip_upper` on
319
+ * one frame (./compose-lips), which the rig folds open like an eyelid, and the
320
+ * interior's light paint into `mouth_tongue` / `mouth_teeth` clipped to it.
321
+ *
278
322
  * `sharp` must stay confined to @ikijs/mcp; part decoding goes through
279
323
  * ./node-images, this package's single image-decode boundary.
280
324
  */
@@ -345,6 +389,13 @@ declare const DEFAULT_LAYOUT: {
345
389
  w: number;
346
390
  optional: true;
347
391
  };
392
+ mouth_inner: {
393
+ src: string;
394
+ cx: number;
395
+ cy: number;
396
+ w: number;
397
+ optional: true;
398
+ };
348
399
  eye_L: {
349
400
  src: string;
350
401
  cx: number;
@@ -428,8 +479,15 @@ declare const LOWER_LASH: {
428
479
  readonly lash_lower_L: "eye_L";
429
480
  readonly lash_lower_R: "eye_R";
430
481
  };
482
+ /** The lip set's other layers, and the role whose frame they are cut on. */
483
+ declare const LIP_FRAME: {
484
+ readonly mouth_tongue: "mouth_inner";
485
+ readonly mouth_teeth: "mouth_inner";
486
+ readonly lip_lower: "mouth_inner";
487
+ readonly lip_upper: "mouth_inner";
488
+ };
431
489
  /** A role the composer writes a layer for. */
432
- type LayerRole = Role | keyof typeof LOWER_LASH;
490
+ type LayerRole = Role | keyof typeof LOWER_LASH | keyof typeof LIP_FRAME;
433
491
  /** Per-role placement overrides; anything omitted keeps the default above. */
434
492
  type LayoutOverride = Partial<Record<Role, {
435
493
  cx?: number;
@@ -486,11 +544,14 @@ type ComposeResult = {
486
544
  * lashes when the eyewhite draws no dark lower lid. The arms and the
487
545
  * pose forearms are opt-in and never listed: a parts dir without
488
546
  * arm.png composes as a bust does, though an earlier compose's arm
489
- * layers are still removed.
547
+ * layers are still removed. The lip roles are never listed either, and
548
+ * with the lip set neither are `mouth` and `mouth_open`, which the set
549
+ * stands in for.
490
550
  */
491
551
  skipped: LayerRole[];
492
552
  /** The rest pose, flattened: a pose forearm is invisible there, so it
493
- * never shows in this one. */
553
+ * never shows in this one, and the lip set shows closed, as the rig
554
+ * draws the rest pose. */
494
555
  preview: string;
495
556
  /** Written only with a pose forearm: the switch at 1 as the rig draws
496
557
  * it — each arm with a pose forearm cropped to the rows above its
package/dist/index.d.ts CHANGED
@@ -189,6 +189,33 @@ type AutoRigResult = {
189
189
  */
190
190
  declare function autoRigFromLayers(input: AutoRigInput): Promise<AutoRigResult>;
191
191
 
192
+ /**
193
+ * The measure's lip set checks. The rig folds the mouth open off the layers'
194
+ * own alpha edges, per canvas column inside the opening (where `mouth_inner`
195
+ * has a run): the interior's top must reach the line above it and the skin must
196
+ * reach the interior, or a gap shows the face between them at rest. The
197
+ * geometry is the rig's own: `mouthOpening`, run on the three layers as
198
+ * `auto_rig_from_layers` runs it. The composer meets that contract by
199
+ * construction; these checks are for a set it did not cut (hand-prepared
200
+ * layers, a re-cut) and for the drawings the contract cannot save: a mouth too
201
+ * small to fold, a line too thin to close on, green the key left, an interior
202
+ * with holes. The lip layers' straight edges are the split's cuts, and so are
203
+ * the inside layers' (`mouth_tongue`, `mouth_teeth`), so the generic edge and
204
+ * flat-cut checks skip them all (`isLipLayerRole`). Of an inside layer the rig reads
205
+ * only its box, so it is checked for the set it needs, its canvas and its box.
206
+ */
207
+
208
+ /** What the report says of the opening, for judging a half-open mouth. */
209
+ interface LipFacts {
210
+ opening: {
211
+ width: number;
212
+ height: number;
213
+ line: number;
214
+ };
215
+ /** `MouthOpen` below which the slit has not opened: `v* = w' / (H + w')`. */
216
+ deadZone: number;
217
+ }
218
+
192
219
  /**
193
220
  * Measure composed Iki role layers and flag the failure modes that have
194
221
  * actually shipped broken characters. Read-only: it never edits anything.
@@ -202,6 +229,7 @@ declare function autoRigFromLayers(input: AutoRigInput): Promise<AutoRigResult>;
202
229
  * `sharp` must stay confined to @ikijs/mcp; the decode goes through
203
230
  * ./node-images, this package's single image-decode boundary.
204
231
  */
232
+
205
233
  /** Alpha-derived geometry of one layer, in canvas pixels. */
206
234
  interface LayerStats {
207
235
  w: number;
@@ -232,6 +260,15 @@ interface MeasureReport {
232
260
  /** Roles whose PNG is fully transparent — nothing to measure. */
233
261
  empty: string[];
234
262
  warnings: string[];
263
+ /**
264
+ * The lip set's opening as the rig reads it, set whenever the three lip
265
+ * layers are present and readable. The fold's dead zone `deadZone` is the
266
+ * `MouthOpen` below which the slit between the lips has not opened, and
267
+ * it varies with the drawing (0.03 on one opening, 0.26 on another), so a
268
+ * half-open mouth that shows no slit is judged against it, not against a
269
+ * fixed number.
270
+ */
271
+ lips?: LipFacts;
235
272
  }
236
273
  type MeasureResult = ({
237
274
  ok: true;
@@ -275,6 +312,13 @@ declare function formatMeasureReport(result: MeasureReport & {
275
312
  * Composing is deterministic: same parts -> same layers, so re-run freely after
276
313
  * tuning `layout` (no image re-generation needed).
277
314
  *
315
+ * The mouth has two routes. `mouth.png` (+ optional `mouth_open.png`) is a
316
+ * closed drawing and an open one that cross-fade. `mouth_keyed.png` (the open
317
+ * mouth, its inside flat #00FF00) + `mouth_interior.png` is the lip set: the
318
+ * composer keys and splits it into `mouth_inner` / `lip_lower` / `lip_upper` on
319
+ * one frame (./compose-lips), which the rig folds open like an eyelid, and the
320
+ * interior's light paint into `mouth_tongue` / `mouth_teeth` clipped to it.
321
+ *
278
322
  * `sharp` must stay confined to @ikijs/mcp; part decoding goes through
279
323
  * ./node-images, this package's single image-decode boundary.
280
324
  */
@@ -345,6 +389,13 @@ declare const DEFAULT_LAYOUT: {
345
389
  w: number;
346
390
  optional: true;
347
391
  };
392
+ mouth_inner: {
393
+ src: string;
394
+ cx: number;
395
+ cy: number;
396
+ w: number;
397
+ optional: true;
398
+ };
348
399
  eye_L: {
349
400
  src: string;
350
401
  cx: number;
@@ -428,8 +479,15 @@ declare const LOWER_LASH: {
428
479
  readonly lash_lower_L: "eye_L";
429
480
  readonly lash_lower_R: "eye_R";
430
481
  };
482
+ /** The lip set's other layers, and the role whose frame they are cut on. */
483
+ declare const LIP_FRAME: {
484
+ readonly mouth_tongue: "mouth_inner";
485
+ readonly mouth_teeth: "mouth_inner";
486
+ readonly lip_lower: "mouth_inner";
487
+ readonly lip_upper: "mouth_inner";
488
+ };
431
489
  /** A role the composer writes a layer for. */
432
- type LayerRole = Role | keyof typeof LOWER_LASH;
490
+ type LayerRole = Role | keyof typeof LOWER_LASH | keyof typeof LIP_FRAME;
433
491
  /** Per-role placement overrides; anything omitted keeps the default above. */
434
492
  type LayoutOverride = Partial<Record<Role, {
435
493
  cx?: number;
@@ -486,11 +544,14 @@ type ComposeResult = {
486
544
  * lashes when the eyewhite draws no dark lower lid. The arms and the
487
545
  * pose forearms are opt-in and never listed: a parts dir without
488
546
  * arm.png composes as a bust does, though an earlier compose's arm
489
- * layers are still removed.
547
+ * layers are still removed. The lip roles are never listed either, and
548
+ * with the lip set neither are `mouth` and `mouth_open`, which the set
549
+ * stands in for.
490
550
  */
491
551
  skipped: LayerRole[];
492
552
  /** The rest pose, flattened: a pose forearm is invisible there, so it
493
- * never shows in this one. */
553
+ * never shows in this one, and the lip set shows closed, as the rig
554
+ * draws the rest pose. */
494
555
  preview: string;
495
556
  /** Written only with a pose forearm: the switch at 1 as the rig draws
496
557
  * it — each arm with a pose forearm cropped to the rows above its