@ikijs/mcp 0.20.0 → 0.22.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/README.md +6 -6
- package/dist/{chunk-6F4ZP5S4.mjs → chunk-SWRVRVYV.mjs} +1001 -119
- package/dist/chunk-SWRVRVYV.mjs.map +1 -0
- package/dist/cli.js +1015 -148
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +59 -3
- package/dist/index.d.ts +59 -3
- package/dist/index.js +1015 -148
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-6F4ZP5S4.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -189,6 +189,31 @@ 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, so the
|
|
203
|
+
* generic edge and flat-cut checks skip them (`isLipRole`).
|
|
204
|
+
*/
|
|
205
|
+
|
|
206
|
+
/** What the report says of the opening, for judging a half-open mouth. */
|
|
207
|
+
interface LipFacts {
|
|
208
|
+
opening: {
|
|
209
|
+
width: number;
|
|
210
|
+
height: number;
|
|
211
|
+
line: number;
|
|
212
|
+
};
|
|
213
|
+
/** `MouthOpen` below which the slit has not opened: `v* = w' / (H + w')`. */
|
|
214
|
+
deadZone: number;
|
|
215
|
+
}
|
|
216
|
+
|
|
192
217
|
/**
|
|
193
218
|
* Measure composed Iki role layers and flag the failure modes that have
|
|
194
219
|
* actually shipped broken characters. Read-only: it never edits anything.
|
|
@@ -202,6 +227,7 @@ declare function autoRigFromLayers(input: AutoRigInput): Promise<AutoRigResult>;
|
|
|
202
227
|
* `sharp` must stay confined to @ikijs/mcp; the decode goes through
|
|
203
228
|
* ./node-images, this package's single image-decode boundary.
|
|
204
229
|
*/
|
|
230
|
+
|
|
205
231
|
/** Alpha-derived geometry of one layer, in canvas pixels. */
|
|
206
232
|
interface LayerStats {
|
|
207
233
|
w: number;
|
|
@@ -232,6 +258,15 @@ interface MeasureReport {
|
|
|
232
258
|
/** Roles whose PNG is fully transparent — nothing to measure. */
|
|
233
259
|
empty: string[];
|
|
234
260
|
warnings: string[];
|
|
261
|
+
/**
|
|
262
|
+
* The lip set's opening as the rig reads it, set whenever the three lip
|
|
263
|
+
* layers are present and readable. The fold's dead zone `deadZone` is the
|
|
264
|
+
* `MouthOpen` below which the slit between the lips has not opened, and
|
|
265
|
+
* it varies with the drawing (0.04 on one opening, 0.33 on another), so a
|
|
266
|
+
* half-open mouth that shows no slit is judged against it, not against a
|
|
267
|
+
* fixed number.
|
|
268
|
+
*/
|
|
269
|
+
lips?: LipFacts;
|
|
235
270
|
}
|
|
236
271
|
type MeasureResult = ({
|
|
237
272
|
ok: true;
|
|
@@ -275,6 +310,12 @@ declare function formatMeasureReport(result: MeasureReport & {
|
|
|
275
310
|
* Composing is deterministic: same parts -> same layers, so re-run freely after
|
|
276
311
|
* tuning `layout` (no image re-generation needed).
|
|
277
312
|
*
|
|
313
|
+
* The mouth has two routes. `mouth.png` (+ optional `mouth_open.png`) is a
|
|
314
|
+
* closed drawing and an open one that cross-fade. `mouth_keyed.png` (the open
|
|
315
|
+
* mouth, its inside flat #00FF00) + `mouth_interior.png` is the lip set: the
|
|
316
|
+
* composer keys and splits it into `mouth_inner` / `lip_lower` / `lip_upper` on
|
|
317
|
+
* one frame (./compose-lips), which the rig folds open like an eyelid.
|
|
318
|
+
*
|
|
278
319
|
* `sharp` must stay confined to @ikijs/mcp; part decoding goes through
|
|
279
320
|
* ./node-images, this package's single image-decode boundary.
|
|
280
321
|
*/
|
|
@@ -345,6 +386,13 @@ declare const DEFAULT_LAYOUT: {
|
|
|
345
386
|
w: number;
|
|
346
387
|
optional: true;
|
|
347
388
|
};
|
|
389
|
+
mouth_inner: {
|
|
390
|
+
src: string;
|
|
391
|
+
cx: number;
|
|
392
|
+
cy: number;
|
|
393
|
+
w: number;
|
|
394
|
+
optional: true;
|
|
395
|
+
};
|
|
348
396
|
eye_L: {
|
|
349
397
|
src: string;
|
|
350
398
|
cx: number;
|
|
@@ -428,8 +476,13 @@ declare const LOWER_LASH: {
|
|
|
428
476
|
readonly lash_lower_L: "eye_L";
|
|
429
477
|
readonly lash_lower_R: "eye_R";
|
|
430
478
|
};
|
|
479
|
+
/** The lip set's other two layers, and the role whose frame they are cut on. */
|
|
480
|
+
declare const LIP_FRAME: {
|
|
481
|
+
readonly lip_lower: "mouth_inner";
|
|
482
|
+
readonly lip_upper: "mouth_inner";
|
|
483
|
+
};
|
|
431
484
|
/** A role the composer writes a layer for. */
|
|
432
|
-
type LayerRole = Role | keyof typeof LOWER_LASH;
|
|
485
|
+
type LayerRole = Role | keyof typeof LOWER_LASH | keyof typeof LIP_FRAME;
|
|
433
486
|
/** Per-role placement overrides; anything omitted keeps the default above. */
|
|
434
487
|
type LayoutOverride = Partial<Record<Role, {
|
|
435
488
|
cx?: number;
|
|
@@ -486,11 +539,14 @@ type ComposeResult = {
|
|
|
486
539
|
* lashes when the eyewhite draws no dark lower lid. The arms and the
|
|
487
540
|
* pose forearms are opt-in and never listed: a parts dir without
|
|
488
541
|
* arm.png composes as a bust does, though an earlier compose's arm
|
|
489
|
-
* layers are still removed.
|
|
542
|
+
* layers are still removed. The lip roles are never listed either, and
|
|
543
|
+
* with the lip set neither are `mouth` and `mouth_open`, which the set
|
|
544
|
+
* stands in for.
|
|
490
545
|
*/
|
|
491
546
|
skipped: LayerRole[];
|
|
492
547
|
/** The rest pose, flattened: a pose forearm is invisible there, so it
|
|
493
|
-
* never shows in this one
|
|
548
|
+
* never shows in this one, and the lip set shows closed, as the rig
|
|
549
|
+
* draws the rest pose. */
|
|
494
550
|
preview: string;
|
|
495
551
|
/** Written only with a pose forearm: the switch at 1 as the rig draws
|
|
496
552
|
* it — each arm with a pose forearm cropped to the rows above its
|
package/dist/index.d.ts
CHANGED
|
@@ -189,6 +189,31 @@ 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, so the
|
|
203
|
+
* generic edge and flat-cut checks skip them (`isLipRole`).
|
|
204
|
+
*/
|
|
205
|
+
|
|
206
|
+
/** What the report says of the opening, for judging a half-open mouth. */
|
|
207
|
+
interface LipFacts {
|
|
208
|
+
opening: {
|
|
209
|
+
width: number;
|
|
210
|
+
height: number;
|
|
211
|
+
line: number;
|
|
212
|
+
};
|
|
213
|
+
/** `MouthOpen` below which the slit has not opened: `v* = w' / (H + w')`. */
|
|
214
|
+
deadZone: number;
|
|
215
|
+
}
|
|
216
|
+
|
|
192
217
|
/**
|
|
193
218
|
* Measure composed Iki role layers and flag the failure modes that have
|
|
194
219
|
* actually shipped broken characters. Read-only: it never edits anything.
|
|
@@ -202,6 +227,7 @@ declare function autoRigFromLayers(input: AutoRigInput): Promise<AutoRigResult>;
|
|
|
202
227
|
* `sharp` must stay confined to @ikijs/mcp; the decode goes through
|
|
203
228
|
* ./node-images, this package's single image-decode boundary.
|
|
204
229
|
*/
|
|
230
|
+
|
|
205
231
|
/** Alpha-derived geometry of one layer, in canvas pixels. */
|
|
206
232
|
interface LayerStats {
|
|
207
233
|
w: number;
|
|
@@ -232,6 +258,15 @@ interface MeasureReport {
|
|
|
232
258
|
/** Roles whose PNG is fully transparent — nothing to measure. */
|
|
233
259
|
empty: string[];
|
|
234
260
|
warnings: string[];
|
|
261
|
+
/**
|
|
262
|
+
* The lip set's opening as the rig reads it, set whenever the three lip
|
|
263
|
+
* layers are present and readable. The fold's dead zone `deadZone` is the
|
|
264
|
+
* `MouthOpen` below which the slit between the lips has not opened, and
|
|
265
|
+
* it varies with the drawing (0.04 on one opening, 0.33 on another), so a
|
|
266
|
+
* half-open mouth that shows no slit is judged against it, not against a
|
|
267
|
+
* fixed number.
|
|
268
|
+
*/
|
|
269
|
+
lips?: LipFacts;
|
|
235
270
|
}
|
|
236
271
|
type MeasureResult = ({
|
|
237
272
|
ok: true;
|
|
@@ -275,6 +310,12 @@ declare function formatMeasureReport(result: MeasureReport & {
|
|
|
275
310
|
* Composing is deterministic: same parts -> same layers, so re-run freely after
|
|
276
311
|
* tuning `layout` (no image re-generation needed).
|
|
277
312
|
*
|
|
313
|
+
* The mouth has two routes. `mouth.png` (+ optional `mouth_open.png`) is a
|
|
314
|
+
* closed drawing and an open one that cross-fade. `mouth_keyed.png` (the open
|
|
315
|
+
* mouth, its inside flat #00FF00) + `mouth_interior.png` is the lip set: the
|
|
316
|
+
* composer keys and splits it into `mouth_inner` / `lip_lower` / `lip_upper` on
|
|
317
|
+
* one frame (./compose-lips), which the rig folds open like an eyelid.
|
|
318
|
+
*
|
|
278
319
|
* `sharp` must stay confined to @ikijs/mcp; part decoding goes through
|
|
279
320
|
* ./node-images, this package's single image-decode boundary.
|
|
280
321
|
*/
|
|
@@ -345,6 +386,13 @@ declare const DEFAULT_LAYOUT: {
|
|
|
345
386
|
w: number;
|
|
346
387
|
optional: true;
|
|
347
388
|
};
|
|
389
|
+
mouth_inner: {
|
|
390
|
+
src: string;
|
|
391
|
+
cx: number;
|
|
392
|
+
cy: number;
|
|
393
|
+
w: number;
|
|
394
|
+
optional: true;
|
|
395
|
+
};
|
|
348
396
|
eye_L: {
|
|
349
397
|
src: string;
|
|
350
398
|
cx: number;
|
|
@@ -428,8 +476,13 @@ declare const LOWER_LASH: {
|
|
|
428
476
|
readonly lash_lower_L: "eye_L";
|
|
429
477
|
readonly lash_lower_R: "eye_R";
|
|
430
478
|
};
|
|
479
|
+
/** The lip set's other two layers, and the role whose frame they are cut on. */
|
|
480
|
+
declare const LIP_FRAME: {
|
|
481
|
+
readonly lip_lower: "mouth_inner";
|
|
482
|
+
readonly lip_upper: "mouth_inner";
|
|
483
|
+
};
|
|
431
484
|
/** A role the composer writes a layer for. */
|
|
432
|
-
type LayerRole = Role | keyof typeof LOWER_LASH;
|
|
485
|
+
type LayerRole = Role | keyof typeof LOWER_LASH | keyof typeof LIP_FRAME;
|
|
433
486
|
/** Per-role placement overrides; anything omitted keeps the default above. */
|
|
434
487
|
type LayoutOverride = Partial<Record<Role, {
|
|
435
488
|
cx?: number;
|
|
@@ -486,11 +539,14 @@ type ComposeResult = {
|
|
|
486
539
|
* lashes when the eyewhite draws no dark lower lid. The arms and the
|
|
487
540
|
* pose forearms are opt-in and never listed: a parts dir without
|
|
488
541
|
* arm.png composes as a bust does, though an earlier compose's arm
|
|
489
|
-
* layers are still removed.
|
|
542
|
+
* layers are still removed. The lip roles are never listed either, and
|
|
543
|
+
* with the lip set neither are `mouth` and `mouth_open`, which the set
|
|
544
|
+
* stands in for.
|
|
490
545
|
*/
|
|
491
546
|
skipped: LayerRole[];
|
|
492
547
|
/** The rest pose, flattened: a pose forearm is invisible there, so it
|
|
493
|
-
* never shows in this one
|
|
548
|
+
* never shows in this one, and the lip set shows closed, as the rig
|
|
549
|
+
* draws the rest pose. */
|
|
494
550
|
preview: string;
|
|
495
551
|
/** Written only with a pose forearm: the switch at 1 as the rig draws
|
|
496
552
|
* it — each arm with a pose forearm cropped to the rows above its
|