@ikijs/mcp 0.35.0 → 0.36.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 +1 -1
- package/dist/{chunk-SNBG5VHS.mjs → chunk-ENK2EV4C.mjs} +5 -4
- package/dist/{chunk-SNBG5VHS.mjs.map → chunk-ENK2EV4C.mjs.map} +1 -1
- package/dist/cli.js +4 -3
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Turns a set of role-named, full-canvas transparent PNG layers into a renderable,
|
|
|
28
28
|
- **`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`, and `mouth` or the lip set `mouth_inner`, `lip_lower`, `lip_upper` (a mouth that folds open instead of crossfading; a partial lip set, or one mixed with `mouth`/`mouth_open`, is refused). `mouth_tongue` / `mouth_teeth` are optional with the lip set only: drawn under its lips and clipped to `mouth_inner`, the teeth riding the upper line and the tongue the opening's bottom; without the set they are refused. 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`, `body`, `arm_L`/`arm_R`, `forearm_pose_L`/`forearm_pose_R`, `hair_side_L`/`hair_side_R`, etc. A side lock — the front lock hanging beside the ear, its root hidden under the bangs, drawn over the face, brows and lashes and under `hair_front` — needs `hair_front` (a lock without it is refused) and follows the face plate on the turn. An arm — the whole arm drawn hanging, its shoulder at the top — needs the `body` (it hangs from the body's shoulder) and becomes an elbow cap, an upper arm and a forearm sharing its crop, on `ParamArmL/R` (the shoulder) and `ParamElbowL/R`. A pose forearm — the forearm raised, standing up from its elbow — needs its arm: it hangs from the arm's elbow and is swapped in for the hanging forearm by `ParamArmPoseL/R`, rocked by `ParamArmPoseAngleL/R`, and drawn above the face and the hair. All layers must share the same canvas size (taken from the first layer).
|
|
29
29
|
- **`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`.
|
|
30
30
|
- **`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`. A pair with a custom part crossing the eye row reads a wider head than the rig fits to: measure a pair drawn without them.
|
|
31
|
-
- **`rigPlan`** — optional per-character tuning from the profile the rig defaults to, in three groups: `turn` (`amount`: the whole head turn, ignored when `turnTargets.eyeShift` is given; `featureLead`: how far the features lead the face plate; `eyeForeshorten`: how much the far eye narrows on the turn, ignored when `turnTargets.farEyeRatio` is given; `noseLead`: how far the nose leads the plate on the turn, never the nod, ignored when `turnTargets.noseShift` is given — the last two have provisional recommended spans), `hair` (`follow`: the front hair's share of the face's turn; `outlineFollow`: its outer edge's share where it draws the head's outline; `sway`: the hair sway amplitude) and `eyes` (`blink`: how far the upper lid comes down over the eye's height). Call `describe_rig_plan` for each field's default, range, recommended span, step and poses. A value out of range, or a group or key not in the catalog, is refused as `INVALID: rigPlan.<path> …`. The old `style` input was removed in 0.30.0 and is refused with the map from each old knob to its `rigPlan` path.
|
|
31
|
+
- **`rigPlan`** — optional per-character tuning from the profile the rig defaults to, in three groups: `turn` (`amount`: the whole head turn, ignored when `turnTargets.eyeShift` is given; `featureLead`: how far the features lead the face plate; `eyeForeshorten`: how much the far eye narrows on the turn, ignored when `turnTargets.farEyeRatio` is given; `noseLead`: how far the nose leads the plate on the turn, never the nod, ignored when `turnTargets.noseShift` is given — the last two have provisional recommended spans; `farEar`: how far the far ear's outer edge follows the face on the turn, 0 holding it under the face), `hair` (`follow`: the front hair's share of the face's turn; `outlineFollow`: its outer edge's share where it draws the head's outline; `sway`: the hair sway amplitude) and `eyes` (`blink`: how far the upper lid comes down over the eye's height). Call `describe_rig_plan` for each field's default, range, recommended span, step and poses. A value out of range, or a group or key not in the catalog, is refused as `INVALID: rigPlan.<path> …`. The old `style` input was removed in 0.30.0 and is refused with the map from each old knob to its `rigPlan` path.
|
|
32
32
|
- **`patches`** — optional displacements added to existing keyform stops of the freshly generated rig, each `{ target, at, region, by, falloff?, why? }` (`RigPatch` in `@ikijs/editor`). `target` is a feature grid (`eyeWarp_L`/`_R`, `browWarp_L`/`_R`, `noseWarp`, `mouthWarp`; `at` names `ParamAngleX` and `ParamAngleY`, each −30, 0 or 30, never both 0) or a mesh part with warps (`face`, `hair_front`, …; `at` names one parameter at one of its warp stops). `region` is a rectangle in fractions of a role's rest layer box (top-left origin, y down); `by` and `falloff` are in face widths on screen axes (+dx right, +dy down). They are replayed on every rig of these inputs, so they hold through a layout or `rigPlan` retune, and they never touch the rest stop or a stop where the rig shuts a part on purpose; `bodyWarp` and the matrix deformers are not targets. Aim them with `describe_iki`.
|
|
33
33
|
- **`customParts`** — optional parts the auto-rigger has no role for (a twin tail, a hairpin), each `{ id, path, anchor, tie, after, deformer?, rigid?, occlusion? }` (`CustomPart` in `@ikijs/editor`, with `path` in place of `layer`). `rigid: true` marks art that does not bend (a hairpin, a ribbon): a bake that bends it by more than 0.0025 face widths at a stop is refused. `occlusion: { by, parameter, stops: [{ value, amount }] }` hides the part where the roles in `by` (a non-empty list, no role repeated, each a role of the set; one with a clipped or meshless part, `iris_L` or `forearm_pose_L`, is refused) cover it, by an amount linear between the stops (ascending `value`, inside the parameter's range; `amount` 0 to 1) on a declared `parameter` that is not a physics output; the cover is where a role's drawn alpha is at least 0.5, a hard edge. Use the stops as a short switch starting a degree or more past the idle sway (amount 1 about one degree after 0), the hiding's progress coming from the part's baked motion; a long band turns the covered art translucent. The result's part then carries `occlusion` (`by` as the part ids written) and its `CUSTOM <id>:` line ends `, hidden by <id>,<id>… on <parameter> at <value>:<amount> <value>:<amount>…`; other parts' lines are unchanged. `occlusion` needs 0.35.0: an older server refuses the key as `INVALID: customParts[i]…`. `path` is a PNG the size of the role layers, drawn alone and whole on a transparent ground; the tool takes its box from the layer's alpha. `anchor` is the role the part is fixed against, `tie` is `[x, y]` canvas px where it meets the anchor (inside both layers' boxes), `after` is a role of the set: the part is drawn right after that role's last part. `deformer` accepts only `headDeformer`, the default. The part goes into the model as an unrigged mesh on `headDeformer`. A custom layer is never role-parsed or measured, so its name is free and it does not widen the head the turn is fitted to (`headHalfWidth`, `headEdges` and `turn` are those of the role layers alone), but it counts toward the layer and pixel limits. All custom parts share one extra atlas page, the last, rendered with the call's `quantizeColors` on a palette of its own, so the role pages keep their bytes; `atlasBytes` includes it. A rig with `customParts: []` is the rig without the field. An empty or wrong-size layer, or an entry the rig refuses, comes back as `INVALID: customParts[i]…` and nothing is written. Needs 0.34.0: an older server drops the field and returns no `customParts`.
|
|
34
34
|
- **`bakes`** — optional lattices that move the custom parts when a parameter does, which an unrigged custom part otherwise does not: `{ targets, meshes? }` (`RigBakes` in `@ikijs/editor`; it needs `customParts` and names no other part). A target `{ id?, param, parts, box?, grid: { cols, rows }, stops, mirror?, why? }` is `(cols + 1) x (rows + 1)` control points laid evenly over `box` (canvas px; absent, the union of the parts' rest boxes grown by 2 px), listed row-major from the top-left, with a `[dx, dy]` per point at each stop. Every position and displacement is in canvas px, origin top-left, y down. A stop is the part's TOTAL landed displacement from rest when `param` alone is at that value and every other parameter is at its default, so the head's own carry is inside it and a neighbour's displacement as `probe_rig` measures it is written as it is. Stop keys are values of `param` inside its range, never its default. The landing is exact at rest, at each stop and at one end key the rig writes at the range end on a side whose outermost stop is inside the range (it holds that stop's displacement); a side with no stop is not moved. Between two keys the part's offsets are blended linearly, so under the head's roll the path bows off the line (about 1 px midway over 15°): put a stop where the path matters. Each vertex takes the bilinear value of the lattice at its rest position, and a vertex outside `box` takes the nearest edge's value. `mirror: true` fills a missing stop from the one at the mirrored value, when that value is inside the parameter's range (the lattice reflected about the box's vertical centre line, `dx` negated). Targets that name the same part and parameter sum. `meshes` re-meshes a custom part first (`{ rows, cols }` or `{ cellPx }`). The written model is landed through the engine at every stop and at the range end each side holds its outermost stop to, and compared with the displacement the generator was asked for; a stop off by 0.1 px or more is `INVALID: BAKE ERROR <part> <param>=<value>: …`, and a part the bake moves at rest by as much is `INVALID: BAKE ERROR <part> at rest: …`; both mean the rig and the engine disagree (a bug in the packages, not in the input), and nothing is written, and an input the rig refuses is `INVALID: bakes…` with its path (`bakes.targets[2].stops["30"][7]`), nothing written either. Needs 0.34.0.
|
|
@@ -7863,7 +7863,7 @@ function formatBakeChecks(bakes) {
|
|
|
7863
7863
|
);
|
|
7864
7864
|
}
|
|
7865
7865
|
function createIkiMcpServer() {
|
|
7866
|
-
const server = new McpServer({ name: "iki", version: "0.
|
|
7866
|
+
const server = new McpServer({ name: "iki", version: "0.36.0" });
|
|
7867
7867
|
server.registerTool(
|
|
7868
7868
|
"validate_iki",
|
|
7869
7869
|
{
|
|
@@ -7988,7 +7988,8 @@ function createIkiMcpServer() {
|
|
|
7988
7988
|
amount: z.number().optional(),
|
|
7989
7989
|
featureLead: z.number().optional(),
|
|
7990
7990
|
eyeForeshorten: z.number().optional(),
|
|
7991
|
-
noseLead: z.number().optional()
|
|
7991
|
+
noseLead: z.number().optional(),
|
|
7992
|
+
farEar: z.number().optional()
|
|
7992
7993
|
}).passthrough().optional(),
|
|
7993
7994
|
hair: z.object({
|
|
7994
7995
|
follow: z.number().optional(),
|
|
@@ -7997,7 +7998,7 @@ function createIkiMcpServer() {
|
|
|
7997
7998
|
}).passthrough().optional(),
|
|
7998
7999
|
eyes: z.object({ blink: z.number().optional() }).passthrough().optional()
|
|
7999
8000
|
}).passthrough().optional().describe(
|
|
8000
|
-
"Per-character tuning from the profile the rig defaults to, in three groups: `turn` (`amount`, `featureLead`, `eyeForeshorten`, `noseLead`: the last two turn only, the nod untouched, and fitted by `turnTargets.farEyeRatio` / `turnTargets.noseShift` when those are given, which the `RIGPLAN:` line then reports as overridden), `hair` (`follow`, `outlineFollow`, `sway`) and `eyes` (`blink`). `describe_rig_plan` lists every field's default, range, recommended span, step and poses. A value out of range, or a group or key not named there, comes back as `INVALID: rigPlan.<path> \u2026`; an object left out or `{}` is the profile. The result reports what the rig built with as `rigPlan` and a `RIGPLAN:` line."
|
|
8001
|
+
"Per-character tuning from the profile the rig defaults to, in three groups: `turn` (`amount`, `featureLead`, `eyeForeshorten`, `noseLead`: the last two turn only, the nod untouched, and fitted by `turnTargets.farEyeRatio` / `turnTargets.noseShift` when those are given, which the `RIGPLAN:` line then reports as overridden; `farEar`: how far the far ear's outer edge follows the face on the turn), `hair` (`follow`, `outlineFollow`, `sway`) and `eyes` (`blink`). `describe_rig_plan` lists every field's default, range, recommended span, step and poses. A value out of range, or a group or key not named there, comes back as `INVALID: rigPlan.<path> \u2026`; an object left out or `{}` is the profile. The result reports what the rig built with as `rigPlan` and a `RIGPLAN:` line."
|
|
8001
8002
|
),
|
|
8002
8003
|
customParts: z.array(
|
|
8003
8004
|
z.object({
|
|
@@ -8412,4 +8413,4 @@ export {
|
|
|
8412
8413
|
formatPhysicsReport,
|
|
8413
8414
|
createIkiMcpServer
|
|
8414
8415
|
};
|
|
8415
|
-
//# sourceMappingURL=chunk-
|
|
8416
|
+
//# sourceMappingURL=chunk-ENK2EV4C.mjs.map
|