@ikijs/mcp 0.17.2 → 0.18.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 +2 -2
- package/dist/{chunk-CUINYKRG.mjs → chunk-JKH44M2Z.mjs} +46 -14
- package/dist/chunk-JKH44M2Z.mjs.map +1 -0
- package/dist/cli.js +43 -13
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.js +43 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
- package/dist/chunk-CUINYKRG.mjs.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -346,6 +346,18 @@ var STANDARD_PARAMETER_INFO = [
|
|
|
346
346
|
id: import_format.StandardParameter.AngleZ,
|
|
347
347
|
description: "Head tilt / roll degrees; positive tilts the top of the head toward the viewer's right (clockwise), as in Live2D."
|
|
348
348
|
},
|
|
349
|
+
{
|
|
350
|
+
id: import_format.StandardParameter.BodyAngleX,
|
|
351
|
+
description: "Body turn, degrees (-10 .. 10); positive turns the body toward the viewer's right, as AngleX does the head."
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
id: import_format.StandardParameter.BodyAngleY,
|
|
355
|
+
description: "Body lean, degrees (-10 .. 10); positive moves the upper body up, negative bows."
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
id: import_format.StandardParameter.BodyAngleZ,
|
|
359
|
+
description: "Body tilt, degrees (-10 .. 10); positive tilts the top toward the viewer's right (clockwise), as AngleZ does the head."
|
|
360
|
+
},
|
|
349
361
|
{
|
|
350
362
|
id: import_format.StandardParameter.Breath,
|
|
351
363
|
description: "Idle breath (0 .. 1), cycled by the host."
|
|
@@ -377,6 +389,22 @@ var STANDARD_PARAMETER_INFO = [
|
|
|
377
389
|
{
|
|
378
390
|
id: import_format.StandardParameter.HairSwayZ,
|
|
379
391
|
description: "Hair-sway driver behind a head tilt. Physics OUTPUT \u2014 driven by the spring, hosts should not set it directly."
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
id: import_format.StandardParameter.ArmLeft,
|
|
395
|
+
description: "Left shoulder, degrees; positive raises the arm outward (mirrored on the right)."
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
id: import_format.StandardParameter.ArmRight,
|
|
399
|
+
description: "Right shoulder, degrees; positive raises the arm outward (mirrored on the left)."
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
id: import_format.StandardParameter.ElbowLeft,
|
|
403
|
+
description: "Left elbow, degrees; positive bends the forearm the way positive ArmLeft raises the arm."
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
id: import_format.StandardParameter.ElbowRight,
|
|
407
|
+
description: "Right elbow, degrees; positive bends the forearm the way positive ArmRight raises the arm."
|
|
380
408
|
}
|
|
381
409
|
];
|
|
382
410
|
function listStandardParameters() {
|
|
@@ -517,7 +545,9 @@ async function autoRigFromLayers(input) {
|
|
|
517
545
|
}
|
|
518
546
|
);
|
|
519
547
|
} catch (e) {
|
|
520
|
-
if (!(e instanceof import_editor2.TurnTargetError))
|
|
548
|
+
if (!(e instanceof import_editor2.TurnTargetError || e instanceof import_editor2.LayerGeometryError)) {
|
|
549
|
+
throw e;
|
|
550
|
+
}
|
|
521
551
|
throw new AutoRigInputError(e.message);
|
|
522
552
|
}
|
|
523
553
|
const doc = new import_editor2.EditorDocument(model);
|
|
@@ -536,18 +566,16 @@ async function autoRigFromLayers(input) {
|
|
|
536
566
|
);
|
|
537
567
|
}
|
|
538
568
|
const partTextureAssignments = pages.flatMap(
|
|
539
|
-
({ crops: pageCrops, layout }) => pageCrops.
|
|
569
|
+
({ crops: pageCrops, layout }) => pageCrops.flatMap((crop) => {
|
|
540
570
|
const placement2 = layout.placements.find((p) => p.id === crop.id);
|
|
541
571
|
if (placement2 === void 0) {
|
|
542
572
|
throw new Error(`auto-rig: no atlas placement for "${crop.id}"`);
|
|
543
573
|
}
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
})
|
|
550
|
-
};
|
|
574
|
+
const uv = (0, import_editor2.uvRectFor)(placement2, {
|
|
575
|
+
width: layout.pageWidth,
|
|
576
|
+
height: layout.pageHeight
|
|
577
|
+
});
|
|
578
|
+
return (0, import_editor2.partIdsOfRole)(crop.id).map((partId) => ({ partId, uv }));
|
|
551
579
|
})
|
|
552
580
|
);
|
|
553
581
|
doc.applyAtlas({
|
|
@@ -558,7 +586,9 @@ async function autoRigFromLayers(input) {
|
|
|
558
586
|
if (losslessCrop !== void 0) {
|
|
559
587
|
patched = structuredClone(patched);
|
|
560
588
|
patched.textures = pages.map((p) => ({ source: p.dataUri }));
|
|
561
|
-
|
|
589
|
+
for (const partId of (0, import_editor2.partIdsOfRole)(losslessCrop.id)) {
|
|
590
|
+
patched.parts.find((p) => p.id === partId).texture.index = 1;
|
|
591
|
+
}
|
|
562
592
|
}
|
|
563
593
|
const finalModel = (0, import_format.parseIkiModel)(patched);
|
|
564
594
|
writeFileAtomic(outPath, JSON.stringify(finalModel));
|
|
@@ -1243,7 +1273,7 @@ var DEFAULT_LAYOUT = {
|
|
|
1243
1273
|
// without them still composes (head-only character).
|
|
1244
1274
|
hair_back: { src: "hair_back.png", cx: 550, cy: 523, w: 800, optional: true },
|
|
1245
1275
|
// The torso, cut off by the canvas bottom, so the character is not a
|
|
1246
|
-
// floating head. It rides
|
|
1276
|
+
// floating head. It rides the rig's `bodyWarp`, which the head hangs from.
|
|
1247
1277
|
body: { src: "body.png", cx: 550, cy: 1017, w: 840, optional: true },
|
|
1248
1278
|
// The face is drawn without a neck, so its box is the skull and centres
|
|
1249
1279
|
// above the eye row (bob's skull at 437 against his eyes' 475).
|
|
@@ -1854,7 +1884,7 @@ async function composeLayersFromParts(input) {
|
|
|
1854
1884
|
|
|
1855
1885
|
// src/server.ts
|
|
1856
1886
|
function createIkiMcpServer() {
|
|
1857
|
-
const server = new import_mcp.McpServer({ name: "iki", version: "0.
|
|
1887
|
+
const server = new import_mcp.McpServer({ name: "iki", version: "0.18.0" });
|
|
1858
1888
|
server.registerTool(
|
|
1859
1889
|
"validate_iki",
|
|
1860
1890
|
{
|
|
@@ -1919,7 +1949,7 @@ function createIkiMcpServer() {
|
|
|
1919
1949
|
server.registerTool(
|
|
1920
1950
|
"auto_rig_from_layers",
|
|
1921
1951
|
{
|
|
1922
|
-
description: "Auto-rigs role-named PNG layers (face, eye_L/eye_R, mouth required; iris_L/R, brow_L/R, hair_front, etc. optional) into a renderable .iki written to disk. Pass full-canvas PNG file paths; returns the output path + summary (the model is NOT inlined). Filenames map to roles unless `fileName` is given.",
|
|
1952
|
+
description: "Auto-rigs role-named PNG layers (face, eye_L/eye_R, mouth required; iris_L/R, brow_L/R, hair_front, body, arm_L/arm_R, etc. optional; an arm needs the body) into a renderable .iki written to disk. Pass full-canvas PNG file paths; returns the output path + summary (the model is NOT inlined). Filenames map to roles unless `fileName` is given.",
|
|
1923
1953
|
inputSchema: {
|
|
1924
1954
|
layers: import_zod.z.array(
|
|
1925
1955
|
import_zod.z.object({
|