@ikijs/mcp 0.13.5 → 0.15.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 +4 -4
- package/dist/{chunk-FYHLTB6F.mjs → chunk-V2FRFOKX.mjs} +38 -15
- package/dist/chunk-V2FRFOKX.mjs.map +1 -0
- package/dist/cli.js +36 -13
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +14 -4
- package/dist/index.d.ts +14 -4
- package/dist/index.js +36 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-FYHLTB6F.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -22,10 +22,10 @@ The `model` input for `validate_iki` and `describe_iki` accepts either a plain J
|
|
|
22
22
|
|
|
23
23
|
Turns a set of role-named, full-canvas transparent PNG layers into a renderable, validated `.iki` model with the textures atlased and embedded as a base64 `data:image/png` URI. Under `quantizeColors` a `nose` layer is the exception: the palette rims a soft-shaded nose's feather, so the nose is atlased alone on a second, lossless page.
|
|
24
24
|
|
|
25
|
-
- **`layers`** — array of `{ path, fileName? }`. `path` is a PNG file path (resolved against the server's working directory); the role is derived from `fileName ?? basename(path)`. Required roles: `face`, `eye_L`, `eye_R`, `mouth`. Optional roles include `iris_L`/`iris_R`, `brow_L`/`brow_R`, `hair_front`/`hair_back`, `lash_L`/`lash_R`, etc. All layers must share the same canvas size (taken from the first layer).
|
|
25
|
+
- **`layers`** — array of `{ path, fileName? }`. `path` is a PNG file path (resolved against the server's working directory); the role is derived from `fileName ?? basename(path)`. Required roles: `face`, `eye_L`, `eye_R`, `mouth`. Optional roles include `iris_L`/`iris_R`, `brow_L`/`brow_R`, `hair_front`/`hair_back`, `lash_L`/`lash_R`, `lash_lower_L`/`lash_lower_R`, etc. All layers must share the same canvas size (taken from the first layer).
|
|
26
26
|
- **`outputPath`** — optional `.iki` output path (resolved against the working directory; the parent directory must already exist, and the path must end in `.iki`). Defaults to `auto-rigged-model.iki`.
|
|
27
|
-
- **`turnTargets`** — optional head-turn cues to fit the rig to, in the units `measure_turn_reference` reports off a front/turned reference pair: `eyeShift` (plus `noseShift` and `mouthShift`) is how far that feature slides across the head at full turn, as a fraction of the head's half-width — a **magnitude**, since the rig turns both ways and the sign is the turn's own business; `farEyeRatio` is the far/near eye width at full turn over that same ratio at rest; `silhouetteRatio` the head's half-width turned over at rest. An omitted field leaves that part of the turn at the
|
|
28
|
-
- **`style`** — optional per-character tuning from the
|
|
27
|
+
- **`turnTargets`** — optional head-turn cues to fit the rig to, in the units `measure_turn_reference` reports off a front/turned reference pair: `eyeShift` (plus `noseShift` and `mouthShift`) is how far that feature slides across the head at full turn, as a fraction of the head's half-width — a **magnitude**, since the rig turns both ways and the sign is the turn's own business; `farEyeRatio` is the far/near eye width at full turn over that same ratio at rest; `silhouetteRatio` the head's half-width turned over at rest. An omitted field leaves that part of the turn at the profile the rig defaults to. An `eyeShift` you pass is fitted by the turn's amount and _clamped_ when it runs past the room the art leaves the far eye — the face plate's edge, or the bangs' side strand over the far iris — since that room is a fact about these layers, not about the reference. Any other target you **do** pass that it cannot reach is refused, because that number is a measurement rather than a preference. A layer set without a `nose` still turns its head, on the profile, but fits no target: `turnTargets` is then inert and the result carries no `turn`.
|
|
28
|
+
- **`style`** — optional per-character tuning from the profile the rig defaults to: `turn` (the whole head turn, the eyes' foreshortening with it, 0..3, 1 = the profile; ignored when `turnTargets.eyeShift` is given), `featureLead` (how far the features lead the face plate, 0..3), `hairFollow` (the front hair's share of the face's turn, 0..2, profile 1), `outlineFollow` (its outer edge's share where it draws the head's outline, 0..2, profile 0: the outline holds), `blink` (how far the upper lid comes down over the eye's height, 0.1..1, profile 0.6) and `sway` (the hair sway amplitude, 0..5). A value out of range, or a knob not named here, is refused.
|
|
29
29
|
- **Result** — on success the result text is the written file path and `structuredContent` carries `{ ok: true, path, canvas, partCount, atlasBytes, headHalfWidth?, headHalfWidthApplied, headEdges?, strandEdges?, noseCore?, turn? }`. `atlasBytes` is the embedded atlas's data-URI length, summed over both pages when the nose has one of its own. `headHalfWidth` is the head measured here rather than asked for: the layers' own opaque union at the eye row, under the same `alpha >= 128` rule and ±10-row band `measure_turn_reference` spans a render with, so the rig's own rest render measures that span back; it is **absent** when that union has no span there at all (translucent art painted below alpha 128 — still a valid layer set, just with nothing to measure). `headHalfWidthApplied` is `false` when the measured value is absent, or no wider than the face plate (a hairless set, or one widest at the plate itself) — the generator will not take such a head, so the plate stands in for it and the rig is still produced either way. `headEdges` is a companion to a measured, applied `headHalfWidth` (absent otherwise): every role with an opaque pixel in that same eye-row band, per side, each with its own rest x there — passed straight to the generator's own `options.headEdges` so it can tell which part's own deformation actually carries the union's outermost pixel through the turn. `strandEdges` is each side's iris and the `hair_front` run it would slide under on the turn, measured whenever the layers include `hair_front`, `iris_L` and `iris_R`: the iris's opaque span and the run's outer and face-side ends as pixel edges on the row holding the iris's centre (a run that reaches the other iris's centre, a fringe spanning the face, has `runFace: null`; a run narrower than half the iris's painted width on that row is hair detail the iris may cross, and is skipped as if clear) — passed straight to the generator's own `options.strandEdges`, which keeps the far iris from sliding under the bangs any further than it is painted. `turn` is what the solve settled on — `{ radius, holdBase, depths, achieved: { eyeShift, farEyeRatio, silhouetteRatio }, clamped, strandOverlap? }`, where `achieved` is what the rig does reach and `clamped` names every target the rig cut down: the turn (`eyeShift`, passed or the profile's own) where the face plate's edge or the strand cut it short, and a profile `noseShift` / `mouthShift` past its room. `strandOverlap` gives, per side whose far iris the bangs still cover at some far stop, the covered width — how much of the iris's painted row the run covers where that is largest (`deg`, `px`, and `hh` in head half-widths), how much it covers at rest (`restPx`), and whether the bound held (`held`: `true` means the iris is kept no deeper under the run than it is painted; `false` means the art left no room to — always so for a fringe spanning the face — and `px` is what stays covered); it is absent when nothing is covered. `noseCore` is the nose's dense core in canvas px — its pixels at alpha >= 128, not grown, the box handed to the generator as the nose layer's `denseCore` and its turn landmark — absent without a `nose` layer, when it has no pixel at that threshold (painted wholly translucent), or when that core is a speck of the nose's crop (under a quarter of its width or height, such as a lone nostril mark), and in both of the last two cases the crop stands in for it. `turn` is absent without a `nose` layer. The (potentially multi-MB) model is written to disk, not inlined. Invalid input (unknown/missing role, empty layer, mismatched sizes, bad path, oversized atlas, a `turnTargets` field that is unknown or that this layer set cannot reach — any passed field other than an `eyeShift` past the art's room; a `style` knob out of range or unknown; the message names the field and the attainable range) returns `{ ok: false, error }` with a `INVALID: …` text — not a protocol error. An argument the tool's input schema refuses — a `turnTargets` or `style` that is not an object, or one of their named fields that is not a number — never reaches the tool: the MCP SDK answers with an `isError` result whose text is `MCP error -32602: Input validation error: …`, and no `structuredContent`.
|
|
30
30
|
|
|
31
31
|
The decode/atlas pipeline runs in Node via `sharp` (a native dependency confined to this package); it mirrors the browser editor app's import flow and reuses the pure `@ikijs/editor` model + atlas math, so both paths produce the same rig.
|
|
@@ -34,7 +34,7 @@ The decode/atlas pipeline runs in Node via `sharp` (a native dependency confined
|
|
|
34
34
|
|
|
35
35
|
Composes a directory of AI-generated part PNGs into canvas-aligned, role-named layer PNGs ready for `auto_rig_from_layers`, on a fixed 1100×1100 canvas with a built-in default layout tuned for the character-generation skill's standard front-facing framing. It ports the composer that shipped as a script (`compose.cjs`) in the Claude Code plugin.
|
|
36
36
|
|
|
37
|
-
- **`partsDir`** — directory of the source part PNGs (resolved against the server's working directory). Required sources: `face.png`, `eyewhite.png` (split into the sclera
|
|
37
|
+
- **`partsDir`** — directory of the source part PNGs (resolved against the server's working directory). Required sources: `face.png`, `eyewhite.png` (split into the sclera, the upper lash and the lower lid — `lash_lower_L`/`lash_lower_R`, the dark line and lashes of the eye's lower part, which draw over the iris and are placed on the sclera's frame by the `eye_*` layout, so they have no layout key of their own; an eyewhite with no dark lower lid writes none and lists them in `skipped`. A light mark drawn detached above the eye white, such as a double-eyelid crease, is dropped from the sclera — the iris's clip — while dark strokes there stay lash ink), `iris.png`, `mouth.png`, `brow.png`, `hair_front.png`. Optional: `hair_back.png`, `body.png`, `mouth_open.png`, `blush.png`, `nose.png` — a parts dir without them still composes, minus those roles. One `blush.png` makes both cheeks' blush: `blush_R` takes it as drawn and `blush_L` mirrored. It is decoration, so the report does not flag a set without it. The nose is what the auto-rig leads the head turn with, and a face supplied alongside it must be drawn without one, or the painted nose stays on the face plate while the real one moves. Each part but the eye pair is cropped to its drawing before it is sized and placed. A faint speck detached from the drawing, one that never reaches alpha 128 and covers under 1 % of the part's pixels (residue a background removal leaves), is cut out with the margin it widened, so it cannot pull the part off its centre. A detached stroke that reaches alpha 128 is kept.
|
|
38
38
|
- **`outDir`** — an existing directory (resolved against the working directory, confined to it exactly like `auto_rig_from_layers`'s `outputPath`; the tool never creates directories) to write the role layer PNGs and a flattened `preview.png` into. Reusing a directory across runs is intentional — a role this run skips (e.g. composing a head-only set that omits `body`) has its stale `<role>.png` from an earlier run deleted, so the directory always holds exactly this run's roles.
|
|
39
39
|
- **`layout`** — optional per-role override merged over the built-in defaults, e.g. `{ "eye_L": { "cx": 660 } }`, so a character can be retuned by re-running compose rather than editing a script. Each of `cx`, `cy`, `w`, `h` is optional; `w` and `h` must be integers in 1..1100 (the canvas size). Omitting `h` keeps the part's own aspect ratio, which is what every role wants until one does not: a generated eyewhite often comes back flatter than its reference, and stretching a flat white lens costs nothing where regenerating it is billed and unreliable. The nose is sized and placed by its dense core — its pixels at alpha ≥ 128, the drawing a viewer reads inside a soft nose's feather — rather than its whole part, which for a shaded-bump nose is mostly feather: `w` (default 40) and `h` size the core, `cx` (default 550) centres it, and a set `cy` centres its rows. By default its `cy` is unset, and the core's bottom row (the tip) lands 0.86 of the way from the eye row down to the mouth's, so the nose follows a retuned eye or mouth row. A nose with no pixel at alpha ≥ 128 is sized and placed whole, and so is one whose core is a speck of its trimmed part — under a quarter of its width or height, such as a lone nostril mark or highlight, which sized to `w` would blow the whole nose up — and the report warns of the speck. Set `h` on a sclera and its lash together — they share one frame, and the blink fold tears if they diverge, so a pair set to land on different frames is rejected.
|
|
40
40
|
- **`mirrorParts`** — optional list of part files to flip left-right as they are read, e.g. `["eyewhite.png"]`. Which way a part faces is fixed by the layout, and "left eye" cannot pin it down — it reads as the viewer's left or the character's — so in image terms: `eyewhite.png` is read as the eye on the screen left, lash wing (outer corner) at the image's left end and lash-free tear duct at its right; `brow.png` as the brow on the screen right, thick head at the image's left end and tail at its right; `blush.png` as the blush on the screen left, outer end (toward the face's edge) at the image's left end and inner end at its right. A part drawn the other way round is fixed here for free instead of regenerated. It flips the source, so every role cut from it flips together and an eye's sclera and lash stay in one frame.
|
|
@@ -1150,7 +1150,7 @@ async function measureDir(absDir, noseSpeck) {
|
|
|
1150
1150
|
["hair_back", "without it the silhouette is flat behind the face"],
|
|
1151
1151
|
[
|
|
1152
1152
|
"nose",
|
|
1153
|
-
"without it the head still turns on the
|
|
1153
|
+
"without it the head still turns on the default profile, but there is no nose to lead it, and no turn fit to the art (`turnTargets` is inert, no `turn` report)"
|
|
1154
1154
|
]
|
|
1155
1155
|
]) {
|
|
1156
1156
|
if (layers[role] === void 0) warnings.push(`${role}: missing \u2014 ${why}.`);
|
|
@@ -1202,7 +1202,7 @@ function formatMeasureReport(result) {
|
|
|
1202
1202
|
import fs3 from "fs";
|
|
1203
1203
|
import path5 from "path";
|
|
1204
1204
|
import sharp2 from "sharp";
|
|
1205
|
-
import { ALPHA_OPAQUE as ALPHA_OPAQUE2 } from "@ikijs/editor";
|
|
1205
|
+
import { ALPHA_OPAQUE as ALPHA_OPAQUE2, detectAlphaBbox as scanAlphaBbox2 } from "@ikijs/editor";
|
|
1206
1206
|
var CANVAS = 1100;
|
|
1207
1207
|
var EYE_W = 128;
|
|
1208
1208
|
var IRIS_W = Math.round(EYE_W * 0.5625);
|
|
@@ -1277,6 +1277,8 @@ var DEFAULT_LAYOUT = {
|
|
|
1277
1277
|
brow_R: { src: "brow.png", cx: 455, cy: 405, w: 135, mirror: true },
|
|
1278
1278
|
hair_front: { src: "hair_front.png", cx: 550, cy: 425, w: 660 }
|
|
1279
1279
|
};
|
|
1280
|
+
var LOWER_LASH = { lash_lower_L: "eye_L", lash_lower_R: "eye_R" };
|
|
1281
|
+
var LOWER_LASH_SRC = "eyewhite_lash_lower.png";
|
|
1280
1282
|
var ORDER = [
|
|
1281
1283
|
"hair_back",
|
|
1282
1284
|
"body",
|
|
@@ -1290,6 +1292,8 @@ var ORDER = [
|
|
|
1290
1292
|
"eye_R",
|
|
1291
1293
|
"iris_L",
|
|
1292
1294
|
"iris_R",
|
|
1295
|
+
"lash_lower_L",
|
|
1296
|
+
"lash_lower_R",
|
|
1293
1297
|
"lash_L",
|
|
1294
1298
|
"lash_R",
|
|
1295
1299
|
"brow_L",
|
|
@@ -1367,6 +1371,10 @@ async function coreAndBoundsOf(png) {
|
|
|
1367
1371
|
bounds: { x: 0, y: 0, w: info.width, h: info.height }
|
|
1368
1372
|
};
|
|
1369
1373
|
}
|
|
1374
|
+
async function hasCoverage(png) {
|
|
1375
|
+
const { data, info } = await sharp2(png).ensureAlpha().raw().toBuffer({ resolveWithObject: true });
|
|
1376
|
+
return scanAlphaBbox2(data, info.width, info.height) !== null;
|
|
1377
|
+
}
|
|
1370
1378
|
async function noseSizingOf(png) {
|
|
1371
1379
|
const { core, bounds } = await coreAndBoundsOf(png);
|
|
1372
1380
|
if (core === null) return { box: bounds, whole: true };
|
|
@@ -1647,13 +1655,18 @@ async function prepEyeSplit(partsDir) {
|
|
|
1647
1655
|
const detached = detachedAboveWhite(data, W, H);
|
|
1648
1656
|
const sclera = Buffer.from(data);
|
|
1649
1657
|
const lash = Buffer.from(data);
|
|
1658
|
+
const lashLower = Buffer.from(data);
|
|
1659
|
+
let lowerInk = false;
|
|
1650
1660
|
for (let y = 0; y < H; y++) {
|
|
1651
1661
|
for (let x = 0; x < W; x++) {
|
|
1652
1662
|
const i = (y * W + x) * 4;
|
|
1653
1663
|
const isDark = data[i + 3] > 0 && luma(data, i) < EYE_LASH_LUMA;
|
|
1654
|
-
|
|
1664
|
+
const upper = y <= lashCutoffY;
|
|
1665
|
+
if (isDark && upper) sclera[i] = sclera[i + 1] = sclera[i + 2] = 255;
|
|
1655
1666
|
if (detached[y * W + x]) sclera[i + 3] = 0;
|
|
1656
|
-
if (!(isDark &&
|
|
1667
|
+
if (!(isDark && upper)) lash[i + 3] = 0;
|
|
1668
|
+
if (isDark && !upper) lowerInk = true;
|
|
1669
|
+
else lashLower[i + 3] = 0;
|
|
1657
1670
|
}
|
|
1658
1671
|
}
|
|
1659
1672
|
const region = {
|
|
@@ -1664,7 +1677,8 @@ async function prepEyeSplit(partsDir) {
|
|
|
1664
1677
|
};
|
|
1665
1678
|
return {
|
|
1666
1679
|
sclera: await cropToBuffer(sclera, W, H, region),
|
|
1667
|
-
lash: await cropToBuffer(lash, W, H, region)
|
|
1680
|
+
lash: await cropToBuffer(lash, W, H, region),
|
|
1681
|
+
lashLower: lowerInk ? await cropToBuffer(lashLower, W, H, region) : null
|
|
1668
1682
|
};
|
|
1669
1683
|
}
|
|
1670
1684
|
async function composeLayersFromParts(input) {
|
|
@@ -1683,11 +1697,20 @@ async function composeLayersFromParts(input) {
|
|
|
1683
1697
|
["eyewhite_sclera.png", split.sclera],
|
|
1684
1698
|
["eyewhite_lash.png", split.lash]
|
|
1685
1699
|
]);
|
|
1700
|
+
if (split.lashLower !== null) {
|
|
1701
|
+
splitSources.set(LOWER_LASH_SRC, split.lashLower);
|
|
1702
|
+
}
|
|
1686
1703
|
const placed = [];
|
|
1687
1704
|
const skipped = [];
|
|
1688
1705
|
let noseSpeck;
|
|
1689
1706
|
for (const role of ORDER) {
|
|
1690
|
-
const
|
|
1707
|
+
const lower = role === "lash_lower_L" || role === "lash_lower_R";
|
|
1708
|
+
const key = lower ? LOWER_LASH[role] : role;
|
|
1709
|
+
if (lower && split.lashLower === null) {
|
|
1710
|
+
skipped.push(role);
|
|
1711
|
+
continue;
|
|
1712
|
+
}
|
|
1713
|
+
const cfg = lower ? { ...layout[key], src: LOWER_LASH_SRC } : layout[key];
|
|
1691
1714
|
const inMemory = splitSources.get(cfg.src);
|
|
1692
1715
|
const part = await partBuffer(
|
|
1693
1716
|
role,
|
|
@@ -1697,19 +1720,19 @@ async function composeLayersFromParts(input) {
|
|
|
1697
1720
|
// The split halves are cut from eyewhite.png, the file a caller names.
|
|
1698
1721
|
mirrored.has(inMemory === void 0 ? cfg.src : EYEWHITE_SRC)
|
|
1699
1722
|
);
|
|
1700
|
-
if (part === null) {
|
|
1723
|
+
if (part === null || lower && !await hasCoverage(part.buf)) {
|
|
1701
1724
|
skipped.push(role);
|
|
1702
1725
|
continue;
|
|
1703
1726
|
}
|
|
1704
1727
|
let left;
|
|
1705
1728
|
let top;
|
|
1706
|
-
if (
|
|
1729
|
+
if (key === "nose") {
|
|
1707
1730
|
noseSpeck = part.nose?.speck;
|
|
1708
1731
|
const { core, bounds } = await coreAndBoundsOf(part.buf);
|
|
1709
1732
|
const box = part.nose?.whole ? bounds : core ?? bounds;
|
|
1710
1733
|
({ left, top } = nosePlacement(layout, box, part.w, part.h));
|
|
1711
1734
|
} else {
|
|
1712
|
-
({ left, top } = placement(
|
|
1735
|
+
({ left, top } = placement(key, layout[key], part.w, part.h));
|
|
1713
1736
|
}
|
|
1714
1737
|
if (role === "lash_L" || role === "lash_R") {
|
|
1715
1738
|
const eyeRole = role === "lash_L" ? "eye_L" : "eye_R";
|
|
@@ -1770,7 +1793,7 @@ async function composeLayersFromParts(input) {
|
|
|
1770
1793
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
1771
1794
|
import { z } from "zod";
|
|
1772
1795
|
function createIkiMcpServer() {
|
|
1773
|
-
const server = new McpServer({ name: "iki", version: "0.
|
|
1796
|
+
const server = new McpServer({ name: "iki", version: "0.15.0" });
|
|
1774
1797
|
server.registerTool(
|
|
1775
1798
|
"validate_iki",
|
|
1776
1799
|
{
|
|
@@ -1858,7 +1881,7 @@ function createIkiMcpServer() {
|
|
|
1858
1881
|
noseShift: z.number().optional(),
|
|
1859
1882
|
mouthShift: z.number().optional()
|
|
1860
1883
|
}).passthrough().optional().describe(
|
|
1861
|
-
"What the head turn is fitted to, as `measure_turn_reference` reports it off a front/turned reference pair. `eyeShift` (and the optional `noseShift`/`mouthShift`) is how far that feature slides across the head at full turn, as a fraction of the head's half-width \u2014 a MAGNITUDE: the rig turns both ways, so the sign is ignored. `farEyeRatio` is the far/near eye width at full turn over that same ratio at rest, `silhouetteRatio` the head's half-width turned over at rest. The half-width the shifts are fractions of is measured off the layers themselves, so it is not an input. An omitted field leaves that part of the turn at the
|
|
1884
|
+
"What the head turn is fitted to, as `measure_turn_reference` reports it off a front/turned reference pair. `eyeShift` (and the optional `noseShift`/`mouthShift`) is how far that feature slides across the head at full turn, as a fraction of the head's half-width \u2014 a MAGNITUDE: the rig turns both ways, so the sign is ignored. `farEyeRatio` is the far/near eye width at full turn over that same ratio at rest, `silhouetteRatio` the head's half-width turned over at rest. The half-width the shifts are fractions of is measured off the layers themselves, so it is not an input. An omitted field leaves that part of the turn at the profile the rig defaults to. A passed `eyeShift` is fitted by the turn's amount and clamped to the room the art leaves the far eye \u2014 the face plate's edge, or the bangs' side strand over the far iris (the result's `turn.clamped` lists every clamped field, `turn.achieved` what the rig reaches, and `turn.strandOverlap` how much of a far iris the bangs still cover). A passed `silhouetteRatio` is clamped too, only on a face drawn without hair and with ear islands, where narrowing the head that far would no longer cover the far ear's slide. Any other passed target this layer set cannot reach comes back as `INVALID: \u2026` naming the field and the attainable range, since it is a measurement rather than a preference. A field not named here is refused the same way."
|
|
1862
1885
|
),
|
|
1863
1886
|
style: z.object({
|
|
1864
1887
|
turn: z.number().optional(),
|
|
@@ -1868,7 +1891,7 @@ function createIkiMcpServer() {
|
|
|
1868
1891
|
blink: z.number().optional(),
|
|
1869
1892
|
sway: z.number().optional()
|
|
1870
1893
|
}).passthrough().optional().describe(
|
|
1871
|
-
"Per-character tuning from the
|
|
1894
|
+
"Per-character tuning from the profile the rig defaults to: `turn` scales the whole head turn (plate, features, hair and the eyes' foreshortening; 0..3, 1 = the profile; ignored when `turnTargets.eyeShift` is given), `featureLead` how far the features lead the face plate (0..3, 1 = the profile), `hairFollow` the front hair's share of the face's turn (0..2, profile 1), `outlineFollow` its outer edge's share where the front hair draws the head's outline (0..2, profile 0: the outline holds), `blink` how far the upper lid comes down over the eye's height (0.1..1, profile 0.6), `sway` the hair sway amplitude (0..5, 1 = the profile). A value out of range, or a knob not named here, comes back as `INVALID: \u2026`."
|
|
1872
1895
|
)
|
|
1873
1896
|
}
|
|
1874
1897
|
},
|
|
@@ -1890,7 +1913,7 @@ function createIkiMcpServer() {
|
|
|
1890
1913
|
server.registerTool(
|
|
1891
1914
|
"compose_layers_from_parts",
|
|
1892
1915
|
{
|
|
1893
|
-
description: "Composes AI-generated part PNGs into canvas-aligned, role-named PNG layers on disk, ready for auto_rig_from_layers (the eyewhite split, alpha-trim/white-key, and placement pipeline the character-generation skill needs), with the same geometry report measure_layers returns standalone included inline. face, mouth, eyewhite, iris, brow, hair_front are required; hair_back, body, mouth_open, blush (one blush.png makes the blush_L/blush_R pair) and nose are optional \u2014 without a nose layer the head still turns on the rig's
|
|
1916
|
+
description: "Composes AI-generated part PNGs into canvas-aligned, role-named PNG layers on disk, ready for auto_rig_from_layers (the eyewhite split, alpha-trim/white-key, and placement pipeline the character-generation skill needs), with the same geometry report measure_layers returns standalone included inline. face, mouth, eyewhite, iris, brow, hair_front are required; hair_back, body, mouth_open, blush (one blush.png makes the blush_L/blush_R pair) and nose are optional \u2014 without a nose layer the head still turns on the rig's default profile, but it has no nose to lead the turn, and `auto_rig_from_layers` fits no turn to the art (`turnTargets` is inert, no `turn` report). A nose whose dense core is a speck \u2014 under a quarter of its trimmed part's width or height, such as a lone nostril mark or highlight \u2014 is sized and placed whole, and the inline report warns of it. A light mark drawn detached above the eye white, such as a double-eyelid crease, is dropped from the sclera (the iris's clip); dark strokes there stay lash ink. The eyewhite's dark lower lid \u2014 its line and lashes \u2014 becomes lash_lower_L/lash_lower_R, drawn over the iris; a white with none writes none and lists them in `skipped`.",
|
|
1894
1917
|
inputSchema: {
|
|
1895
1918
|
partsDir: z.string().describe(
|
|
1896
1919
|
"Directory of the source part PNGs (resolved against cwd)."
|
|
@@ -1907,7 +1930,7 @@ function createIkiMcpServer() {
|
|
|
1907
1930
|
h: z.number()
|
|
1908
1931
|
}).partial()
|
|
1909
1932
|
).optional().describe(
|
|
1910
|
-
"Per-role override merged over the built-in defaults, keyed by role \u2014 hair_back, body, face, blush_L, blush_R, nose, mouth, mouth_open, eye_L, eye_R, iris_L, iris_R, lash_L, lash_R, brow_L, brow_R, hair_front \u2014 e.g. `{ eye_L: { cx: 660 } }`. `w` and `h` are integers in 1..1100; omit `h` to keep the part's own aspect, set it to stretch. The nose is sized and placed by its dense core (its pixels at alpha >= 128, the drawing inside a soft nose's feather), not its whole part: `w`/`h` size the core, `cx` centres it, and a set `cy` centres its rows. A nose whose core is a speck \u2014 under a quarter of the trimmed part's width or height, such as a lone nostril mark or highlight \u2014 is sized and placed whole instead, and the report warns of it. Its `cy` defaults to unset, which lands the core's bottom row (the tip) 0.86 of the way from the eye row down to the mouth's, so the nose follows a retuned eye or mouth row. eye_L/lash_L and eye_R/lash_R are cut from one eyewhite into one frame, so each pair must land on the same frame \u2014 a pair set to land apart is rejected."
|
|
1933
|
+
"Per-role override merged over the built-in defaults, keyed by role \u2014 hair_back, body, face, blush_L, blush_R, nose, mouth, mouth_open, eye_L, eye_R, iris_L, iris_R, lash_L, lash_R, brow_L, brow_R, hair_front \u2014 e.g. `{ eye_L: { cx: 660 } }`. `w` and `h` are integers in 1..1100; omit `h` to keep the part's own aspect, set it to stretch. The nose is sized and placed by its dense core (its pixels at alpha >= 128, the drawing inside a soft nose's feather), not its whole part: `w`/`h` size the core, `cx` centres it, and a set `cy` centres its rows. A nose whose core is a speck \u2014 under a quarter of the trimmed part's width or height, such as a lone nostril mark or highlight \u2014 is sized and placed whole instead, and the report warns of it. Its `cy` defaults to unset, which lands the core's bottom row (the tip) 0.86 of the way from the eye row down to the mouth's, so the nose follows a retuned eye or mouth row. eye_L/lash_L and eye_R/lash_R are cut from one eyewhite into one frame, so each pair must land on the same frame \u2014 a pair set to land apart is rejected. lash_lower_L/lash_lower_R are cut from it too and have no key: they land on their eye's frame."
|
|
1911
1934
|
),
|
|
1912
1935
|
mirrorParts: z.array(z.string()).optional().describe(
|
|
1913
1936
|
"Part files to flip left-right as they are read, e.g. `[\"eyewhite.png\"]`. The composer reads eyewhite.png as the eye on the screen LEFT (lash wing at the image's left end, lash-free tear duct at its right), brow.png as the brow on the screen RIGHT (thick head at the image's left end, tail at its right), and blush.png as the blush on the screen LEFT (outer end, toward the face's edge, at the image's left end, inner end at its right); a part drawn the other way round is fixed here for free. It flips the source, so every role cut from it flips together and an eye's sclera and lash stay in one frame."
|
|
@@ -2012,4 +2035,4 @@ export {
|
|
|
2012
2035
|
composeLayersFromParts,
|
|
2013
2036
|
createIkiMcpServer
|
|
2014
2037
|
};
|
|
2015
|
-
//# sourceMappingURL=chunk-
|
|
2038
|
+
//# sourceMappingURL=chunk-V2FRFOKX.mjs.map
|