@ikijs/mcp 0.3.1 → 0.4.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 +25 -7
- package/dist/chunk-F5RUDS6T.mjs +1176 -0
- package/dist/chunk-F5RUDS6T.mjs.map +1 -0
- package/dist/cli.js +656 -31
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +239 -1
- package/dist/index.d.ts +239 -1
- package/dist/index.js +662 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -1
- package/package.json +2 -2
- package/dist/chunk-6LRMADRR.mjs +0 -550
- package/dist/chunk-6LRMADRR.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -4,12 +4,14 @@ A stdio [MCP](https://modelcontextprotocol.io/) server that exposes `.iki` model
|
|
|
4
4
|
|
|
5
5
|
## Tools
|
|
6
6
|
|
|
7
|
-
| Tool
|
|
8
|
-
|
|
|
9
|
-
| `validate_iki`
|
|
10
|
-
| `describe_iki`
|
|
11
|
-
| `list_standard_parameters`
|
|
12
|
-
| `auto_rig_from_layers`
|
|
7
|
+
| Tool | Description |
|
|
8
|
+
| --------------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
9
|
+
| `validate_iki` | Validate a raw `.iki` model — accepts an object or a JSON string — fail-fast, one error at a time. |
|
|
10
|
+
| `describe_iki` | Return a structured summary of a valid model's canvas, parameters, parts, and deformers. |
|
|
11
|
+
| `list_standard_parameters` | List the recommended standard parameter ids (e.g. `ParamAngleX`, `ParamMouthOpenY`) with descriptions. |
|
|
12
|
+
| `auto_rig_from_layers` | Auto-rig role-named PNG layers into a renderable `.iki` written to disk; returns the output path. |
|
|
13
|
+
| `compose_layers_from_parts` | Compose generated part PNGs into canvas-aligned, role-named layers, with the geometry report inline. |
|
|
14
|
+
| `measure_layers` | Re-run that same geometry report over an already-composed layers directory. |
|
|
13
15
|
|
|
14
16
|
The `model` input for `validate_iki` and `describe_iki` accepts either a plain JSON object or a JSON string — the server normalises both.
|
|
15
17
|
|
|
@@ -23,6 +25,22 @@ Turns a set of role-named, full-canvas transparent PNG layers into a renderable,
|
|
|
23
25
|
|
|
24
26
|
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.
|
|
25
27
|
|
|
28
|
+
### `compose_layers_from_parts`
|
|
29
|
+
|
|
30
|
+
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.
|
|
31
|
+
|
|
32
|
+
- **`partsDir`** — directory of the source part PNGs (resolved against the server's working directory). Required sources: `face.png`, `eyewhite.png` (split into the sclera + lash layers), `iris.png`, `mouth.png`, `brow.png`, `hair_front.png`. Optional: `hair_back.png`, `body.png`, `mouth_open.png` — a parts dir without them still composes, minus those roles.
|
|
33
|
+
- **`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.
|
|
34
|
+
- **`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` is optional; `w` must be an integer in 1..1100 (the canvas width).
|
|
35
|
+
- **Result** — on success the text is the written layer paths (one per line) followed by the same geometry report `measure_layers` returns; `structuredContent` is `{ ok: true, outDir, layers, skipped, preview, measure }`. Invalid input (a missing required part, an unknown `layout` role, an out-of-range `w`, a part that lands entirely off-canvas, a non-existent `outDir`) returns `{ ok: false, error }` with `INVALID: …` text.
|
|
36
|
+
|
|
37
|
+
### `measure_layers`
|
|
38
|
+
|
|
39
|
+
Reports the same read-only geometry checks `compose_layers_from_parts` returns inline (iris size/offset relative to the sclera, eye aspect, cropped or flat-cut edges, missing optional roles), over an already-composed layers directory — for re-checking a layers dir without recomposing it.
|
|
40
|
+
|
|
41
|
+
- **`layersDir`** — directory of role-named layer PNGs (resolved against the working directory).
|
|
42
|
+
- **Result** — the text is the report: a per-layer size/bbox-centre/mass-centre/margins table, then the checks that fired. `structuredContent` is `{ ok: true, layersDir, layers, empty, warnings, passed }`. A missing or non-directory `layersDir` returns `{ ok: false, error }` with `INVALID: …` text.
|
|
43
|
+
|
|
26
44
|
## Usage
|
|
27
45
|
|
|
28
46
|
Run directly with npx (no install needed):
|
|
@@ -50,7 +68,7 @@ For Claude Desktop this goes in `claude_desktop_config.json`; for Claude Code it
|
|
|
50
68
|
|
|
51
69
|
## Scope note
|
|
52
70
|
|
|
53
|
-
Current tools cover read/validate
|
|
71
|
+
Current tools cover read/validate, auto-rigging a model from PNG layers (`auto_rig_from_layers`), and composing/measuring the role layers a generated character needs (`compose_layers_from_parts`, `measure_layers`). PSD input and granular model-mutation primitives (add part, bind parameter, export) are deferred to future slices.
|
|
54
72
|
|
|
55
73
|
## License
|
|
56
74
|
|