@ikijs/mcp 0.17.1 → 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-7RNLETS2.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-7RNLETS2.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -362,6 +362,18 @@ var STANDARD_PARAMETER_INFO = [
|
|
|
362
362
|
id: import_format.StandardParameter.AngleZ,
|
|
363
363
|
description: "Head tilt / roll degrees; positive tilts the top of the head toward the viewer's right (clockwise), as in Live2D."
|
|
364
364
|
},
|
|
365
|
+
{
|
|
366
|
+
id: import_format.StandardParameter.BodyAngleX,
|
|
367
|
+
description: "Body turn, degrees (-10 .. 10); positive turns the body toward the viewer's right, as AngleX does the head."
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
id: import_format.StandardParameter.BodyAngleY,
|
|
371
|
+
description: "Body lean, degrees (-10 .. 10); positive moves the upper body up, negative bows."
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
id: import_format.StandardParameter.BodyAngleZ,
|
|
375
|
+
description: "Body tilt, degrees (-10 .. 10); positive tilts the top toward the viewer's right (clockwise), as AngleZ does the head."
|
|
376
|
+
},
|
|
365
377
|
{
|
|
366
378
|
id: import_format.StandardParameter.Breath,
|
|
367
379
|
description: "Idle breath (0 .. 1), cycled by the host."
|
|
@@ -393,6 +405,22 @@ var STANDARD_PARAMETER_INFO = [
|
|
|
393
405
|
{
|
|
394
406
|
id: import_format.StandardParameter.HairSwayZ,
|
|
395
407
|
description: "Hair-sway driver behind a head tilt. Physics OUTPUT \u2014 driven by the spring, hosts should not set it directly."
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
id: import_format.StandardParameter.ArmLeft,
|
|
411
|
+
description: "Left shoulder, degrees; positive raises the arm outward (mirrored on the right)."
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
id: import_format.StandardParameter.ArmRight,
|
|
415
|
+
description: "Right shoulder, degrees; positive raises the arm outward (mirrored on the left)."
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
id: import_format.StandardParameter.ElbowLeft,
|
|
419
|
+
description: "Left elbow, degrees; positive bends the forearm the way positive ArmLeft raises the arm."
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
id: import_format.StandardParameter.ElbowRight,
|
|
423
|
+
description: "Right elbow, degrees; positive bends the forearm the way positive ArmRight raises the arm."
|
|
396
424
|
}
|
|
397
425
|
];
|
|
398
426
|
function listStandardParameters() {
|
|
@@ -533,7 +561,9 @@ async function autoRigFromLayers(input) {
|
|
|
533
561
|
}
|
|
534
562
|
);
|
|
535
563
|
} catch (e) {
|
|
536
|
-
if (!(e instanceof import_editor2.TurnTargetError))
|
|
564
|
+
if (!(e instanceof import_editor2.TurnTargetError || e instanceof import_editor2.LayerGeometryError)) {
|
|
565
|
+
throw e;
|
|
566
|
+
}
|
|
537
567
|
throw new AutoRigInputError(e.message);
|
|
538
568
|
}
|
|
539
569
|
const doc = new import_editor2.EditorDocument(model);
|
|
@@ -552,18 +582,16 @@ async function autoRigFromLayers(input) {
|
|
|
552
582
|
);
|
|
553
583
|
}
|
|
554
584
|
const partTextureAssignments = pages.flatMap(
|
|
555
|
-
({ crops: pageCrops, layout }) => pageCrops.
|
|
585
|
+
({ crops: pageCrops, layout }) => pageCrops.flatMap((crop) => {
|
|
556
586
|
const placement2 = layout.placements.find((p) => p.id === crop.id);
|
|
557
587
|
if (placement2 === void 0) {
|
|
558
588
|
throw new Error(`auto-rig: no atlas placement for "${crop.id}"`);
|
|
559
589
|
}
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
})
|
|
566
|
-
};
|
|
590
|
+
const uv = (0, import_editor2.uvRectFor)(placement2, {
|
|
591
|
+
width: layout.pageWidth,
|
|
592
|
+
height: layout.pageHeight
|
|
593
|
+
});
|
|
594
|
+
return (0, import_editor2.partIdsOfRole)(crop.id).map((partId) => ({ partId, uv }));
|
|
567
595
|
})
|
|
568
596
|
);
|
|
569
597
|
doc.applyAtlas({
|
|
@@ -574,7 +602,9 @@ async function autoRigFromLayers(input) {
|
|
|
574
602
|
if (losslessCrop !== void 0) {
|
|
575
603
|
patched = structuredClone(patched);
|
|
576
604
|
patched.textures = pages.map((p) => ({ source: p.dataUri }));
|
|
577
|
-
|
|
605
|
+
for (const partId of (0, import_editor2.partIdsOfRole)(losslessCrop.id)) {
|
|
606
|
+
patched.parts.find((p) => p.id === partId).texture.index = 1;
|
|
607
|
+
}
|
|
578
608
|
}
|
|
579
609
|
const finalModel = (0, import_format.parseIkiModel)(patched);
|
|
580
610
|
writeFileAtomic(outPath, JSON.stringify(finalModel));
|
|
@@ -1259,7 +1289,7 @@ var DEFAULT_LAYOUT = {
|
|
|
1259
1289
|
// without them still composes (head-only character).
|
|
1260
1290
|
hair_back: { src: "hair_back.png", cx: 550, cy: 523, w: 800, optional: true },
|
|
1261
1291
|
// The torso, cut off by the canvas bottom, so the character is not a
|
|
1262
|
-
// floating head. It rides
|
|
1292
|
+
// floating head. It rides the rig's `bodyWarp`, which the head hangs from.
|
|
1263
1293
|
body: { src: "body.png", cx: 550, cy: 1017, w: 840, optional: true },
|
|
1264
1294
|
// The face is drawn without a neck, so its box is the skull and centres
|
|
1265
1295
|
// above the eye row (bob's skull at 437 against his eyes' 475).
|
|
@@ -1872,7 +1902,7 @@ async function composeLayersFromParts(input) {
|
|
|
1872
1902
|
var import_mcp = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
1873
1903
|
var import_zod = require("zod");
|
|
1874
1904
|
function createIkiMcpServer() {
|
|
1875
|
-
const server = new import_mcp.McpServer({ name: "iki", version: "0.
|
|
1905
|
+
const server = new import_mcp.McpServer({ name: "iki", version: "0.18.0" });
|
|
1876
1906
|
server.registerTool(
|
|
1877
1907
|
"validate_iki",
|
|
1878
1908
|
{
|
|
@@ -1937,7 +1967,7 @@ function createIkiMcpServer() {
|
|
|
1937
1967
|
server.registerTool(
|
|
1938
1968
|
"auto_rig_from_layers",
|
|
1939
1969
|
{
|
|
1940
|
-
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.",
|
|
1970
|
+
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.",
|
|
1941
1971
|
inputSchema: {
|
|
1942
1972
|
layers: import_zod.z.array(
|
|
1943
1973
|
import_zod.z.object({
|