@ikijs/mcp 0.11.3 → 0.12.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 +3 -2
- package/dist/{chunk-CFP3KTDY.mjs → chunk-RMB5YVBU.mjs} +29 -13
- package/dist/chunk-RMB5YVBU.mjs.map +1 -0
- package/dist/cli.js +28 -12
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +28 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-CFP3KTDY.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TurnTargets, IrisStrand, TurnSolveReport } from '@ikijs/editor';
|
|
1
|
+
import { TurnTargets, RigStyle, IrisStrand, TurnSolveReport } from '@ikijs/editor';
|
|
2
2
|
export { TurnSolveReport } from '@ikijs/editor';
|
|
3
3
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
|
|
@@ -73,6 +73,9 @@ interface AutoRigInput {
|
|
|
73
73
|
/** Head-turn cues to fit the rig to, as `measure_turn_reference` reports
|
|
74
74
|
* them. */
|
|
75
75
|
turnTargets?: AutoRigTurnTargets;
|
|
76
|
+
/** Per-character tuning from the Live2D profile's defaults (see
|
|
77
|
+
* @ikijs/editor's `RigStyle`). */
|
|
78
|
+
style?: RigStyle;
|
|
76
79
|
}
|
|
77
80
|
/** The turn cues a caller may pass, which is every one but `headHalfWidth`:
|
|
78
81
|
* the pixels the shift fractions are fractions of are measured off the layers
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TurnTargets, IrisStrand, TurnSolveReport } from '@ikijs/editor';
|
|
1
|
+
import { TurnTargets, RigStyle, IrisStrand, TurnSolveReport } from '@ikijs/editor';
|
|
2
2
|
export { TurnSolveReport } from '@ikijs/editor';
|
|
3
3
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
|
|
@@ -73,6 +73,9 @@ interface AutoRigInput {
|
|
|
73
73
|
/** Head-turn cues to fit the rig to, as `measure_turn_reference` reports
|
|
74
74
|
* them. */
|
|
75
75
|
turnTargets?: AutoRigTurnTargets;
|
|
76
|
+
/** Per-character tuning from the Live2D profile's defaults (see
|
|
77
|
+
* @ikijs/editor's `RigStyle`). */
|
|
78
|
+
style?: RigStyle;
|
|
76
79
|
}
|
|
77
80
|
/** The turn cues a caller may pass, which is every one but `headHalfWidth`:
|
|
78
81
|
* the pixels the shift fractions are fractions of are measured off the layers
|
package/dist/index.js
CHANGED
|
@@ -424,6 +424,17 @@ async function autoRigFromLayers(input) {
|
|
|
424
424
|
`quantizeColors must be an integer in 2..256, got ${String(quantizeColors)}`
|
|
425
425
|
);
|
|
426
426
|
}
|
|
427
|
+
const turnTargets = input.turnTargets;
|
|
428
|
+
if (turnTargets !== void 0) {
|
|
429
|
+
if (typeof turnTargets !== "object" || turnTargets === null || Array.isArray(turnTargets)) {
|
|
430
|
+
throw new AutoRigInputError("turnTargets must be a plain object");
|
|
431
|
+
}
|
|
432
|
+
if (turnTargets.headHalfWidth !== void 0) {
|
|
433
|
+
throw new AutoRigInputError(
|
|
434
|
+
"turnTargets.headHalfWidth is measured off the layers, not accepted as input"
|
|
435
|
+
);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
427
438
|
const resolvedLayers = layers.map((layer) => {
|
|
428
439
|
const resolved = resolveInputPath(layer.path);
|
|
429
440
|
return { resolved, fileName: layer.fileName ?? import_node_path2.default.basename(resolved) };
|
|
@@ -489,22 +500,18 @@ async function autoRigFromLayers(input) {
|
|
|
489
500
|
let turn;
|
|
490
501
|
let model;
|
|
491
502
|
try {
|
|
492
|
-
const { eyeShift, farEyeRatio, silhouetteRatio, noseShift, mouthShift } = input.turnTargets ?? {};
|
|
493
503
|
model = (0, import_editor2.generateIkiFromLayerSet)(
|
|
494
504
|
measurement.layers,
|
|
495
505
|
{ width: canvasW, height: canvasH },
|
|
496
506
|
{
|
|
497
507
|
turnTargets: {
|
|
498
|
-
|
|
499
|
-
farEyeRatio,
|
|
500
|
-
silhouetteRatio,
|
|
501
|
-
noseShift,
|
|
502
|
-
mouthShift,
|
|
508
|
+
...input.turnTargets,
|
|
503
509
|
...turnOptions.turnTargets
|
|
504
510
|
},
|
|
505
511
|
onTurnSolved: (report) => {
|
|
506
512
|
turn = report;
|
|
507
513
|
},
|
|
514
|
+
...input.style === void 0 ? {} : { style: input.style },
|
|
508
515
|
...headEdges === void 0 ? {} : { headEdges },
|
|
509
516
|
...strandEdges === void 0 ? {} : { strandEdges }
|
|
510
517
|
}
|
|
@@ -1232,9 +1239,8 @@ var DEFAULT_LAYOUT = {
|
|
|
1232
1239
|
// Back hair and body sit behind the face. Both are OPTIONAL: a parts dir
|
|
1233
1240
|
// without them still composes (head-only character).
|
|
1234
1241
|
hair_back: { src: "hair_back.png", cx: 550, cy: 523, w: 800, optional: true },
|
|
1235
|
-
// The torso, cut off by the canvas bottom
|
|
1236
|
-
//
|
|
1237
|
-
// not a floating head.
|
|
1242
|
+
// The torso, cut off by the canvas bottom, so the character is not a
|
|
1243
|
+
// floating head. It rides its own `bodyDeformer`, which only breathes.
|
|
1238
1244
|
body: { src: "body.png", cx: 550, cy: 1017, w: 840, optional: true },
|
|
1239
1245
|
face: { src: "face.png", cx: 550, cy: 475, w: 400 },
|
|
1240
1246
|
// The nose, drawn on its own (the face is drawn without one): the auto-rig
|
|
@@ -1617,7 +1623,7 @@ async function composeLayersFromParts(input) {
|
|
|
1617
1623
|
var import_mcp = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
1618
1624
|
var import_zod = require("zod");
|
|
1619
1625
|
function createIkiMcpServer() {
|
|
1620
|
-
const server = new import_mcp.McpServer({ name: "iki", version: "0.
|
|
1626
|
+
const server = new import_mcp.McpServer({ name: "iki", version: "0.12.0" });
|
|
1621
1627
|
server.registerTool(
|
|
1622
1628
|
"validate_iki",
|
|
1623
1629
|
{
|
|
@@ -1704,8 +1710,18 @@ function createIkiMcpServer() {
|
|
|
1704
1710
|
silhouetteRatio: import_zod.z.number().optional(),
|
|
1705
1711
|
noseShift: import_zod.z.number().optional(),
|
|
1706
1712
|
mouthShift: import_zod.z.number().optional()
|
|
1707
|
-
}).optional().describe(
|
|
1708
|
-
"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
|
|
1713
|
+
}).passthrough().optional().describe(
|
|
1714
|
+
"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 Live2D 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). 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."
|
|
1715
|
+
),
|
|
1716
|
+
style: import_zod.z.object({
|
|
1717
|
+
turn: import_zod.z.number().optional(),
|
|
1718
|
+
featureLead: import_zod.z.number().optional(),
|
|
1719
|
+
hairFollow: import_zod.z.number().optional(),
|
|
1720
|
+
outlineFollow: import_zod.z.number().optional(),
|
|
1721
|
+
blink: import_zod.z.number().optional(),
|
|
1722
|
+
sway: import_zod.z.number().optional()
|
|
1723
|
+
}).passthrough().optional().describe(
|
|
1724
|
+
"Per-character tuning from the Live2D profile the rig defaults to \u2014 only what the Live2D samples themselves disagree on: `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.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.58), `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`."
|
|
1709
1725
|
)
|
|
1710
1726
|
}
|
|
1711
1727
|
},
|