@ikijs/mcp 0.24.0 → 0.25.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 +5 -4
- package/dist/{chunk-GEXOSC5O.mjs → chunk-JIVXQW4L.mjs} +877 -62
- package/dist/chunk-JIVXQW4L.mjs.map +1 -0
- package/dist/cli.js +936 -130
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +82 -1
- package/dist/index.d.ts +82 -1
- package/dist/index.js +940 -130
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -1
- package/dist/render-page.global.js +18 -2
- package/package.json +2 -2
- package/dist/chunk-GEXOSC5O.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,57 @@
|
|
|
1
1
|
import { TurnTargets, RigStyle, IrisStrand, TurnSolveReport } from '@ikijs/editor';
|
|
2
2
|
export { TurnSolveReport } from '@ikijs/editor';
|
|
3
|
+
import { IkiModel } from '@ikijs/format';
|
|
3
4
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
5
|
|
|
6
|
+
/** A parameter setting to check the rig at; every other parameter rests at its default. */
|
|
7
|
+
interface FoldPose {
|
|
8
|
+
/** Its sorted `id=value` pairs joined by one space; `rest` when empty. */
|
|
9
|
+
name: string;
|
|
10
|
+
values: Record<string, number>;
|
|
11
|
+
}
|
|
12
|
+
/** Where and when a target comes nearest to folding over one class of poses. */
|
|
13
|
+
interface FoldHit {
|
|
14
|
+
/** Doubled signed area at the pose over the same at rest. */
|
|
15
|
+
ratio: number;
|
|
16
|
+
/** The warp grid's cell, or the part mesh's triangle (its index into `mesh.indices` / 3). */
|
|
17
|
+
where: {
|
|
18
|
+
col: number;
|
|
19
|
+
row: number;
|
|
20
|
+
} | {
|
|
21
|
+
triangle: number;
|
|
22
|
+
};
|
|
23
|
+
pose: FoldPose;
|
|
24
|
+
/** Where it sits at rest, model space, through the static matrix chain. */
|
|
25
|
+
rest: {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
interface FoldTarget {
|
|
31
|
+
target: {
|
|
32
|
+
kind: "deformer" | "part";
|
|
33
|
+
id: string;
|
|
34
|
+
};
|
|
35
|
+
/** Read off `worst` alone; `ok` when it is absent. */
|
|
36
|
+
kind: "flip" | "collapse" | "ok";
|
|
37
|
+
/** Least ratio over the poses `expected` rejects (every pose without it). */
|
|
38
|
+
worst?: FoldHit;
|
|
39
|
+
/** Least ratio over the poses `expected` accepts. */
|
|
40
|
+
expected?: FoldHit;
|
|
41
|
+
}
|
|
42
|
+
interface FoldReport {
|
|
43
|
+
/** How many poses were checked. */
|
|
44
|
+
poses: number;
|
|
45
|
+
thresholds: {
|
|
46
|
+
flip: 0;
|
|
47
|
+
collapse: 0.1;
|
|
48
|
+
};
|
|
49
|
+
/** One per warp deformer, then one per mesh part, each in model order. */
|
|
50
|
+
targets: FoldTarget[];
|
|
51
|
+
/** The targets that are not `ok`, worst first. */
|
|
52
|
+
offenders: FoldTarget[];
|
|
53
|
+
}
|
|
54
|
+
|
|
5
55
|
type ValidateResult = {
|
|
6
56
|
ok: true;
|
|
7
57
|
} | {
|
|
@@ -162,6 +212,10 @@ type AutoRigResult = {
|
|
|
162
212
|
* (`strandOverlap`). Absent for a layer set with no nose, which solves
|
|
163
213
|
* no turn at all. */
|
|
164
214
|
turn?: TurnSolveReport;
|
|
215
|
+
/** The written model's folds over the engine's pose set, its eyes and
|
|
216
|
+
* mouth shutting on purpose set apart as `expected`. Report-only: a
|
|
217
|
+
* fold never refuses the rig. */
|
|
218
|
+
folds: FoldReport;
|
|
165
219
|
} | {
|
|
166
220
|
ok: false;
|
|
167
221
|
error: string;
|
|
@@ -572,6 +626,27 @@ type ComposeResult = {
|
|
|
572
626
|
*/
|
|
573
627
|
declare function composeLayersFromParts(input: ComposeInput): Promise<ComposeResult>;
|
|
574
628
|
|
|
629
|
+
/**
|
|
630
|
+
* The fold check `auto_rig_from_layers` and `render_poses` report: the
|
|
631
|
+
* engine's `checkFolds` with the auto-rig's by-design closures set apart, and
|
|
632
|
+
* the text lines both tools print it as.
|
|
633
|
+
*/
|
|
634
|
+
|
|
635
|
+
/** `checkFolds` over `foldPoses(model)`, the closures above kept out of `worst`. */
|
|
636
|
+
declare function checkModelFolds(model: IkiModel): FoldReport;
|
|
637
|
+
/**
|
|
638
|
+
* `report` as text lines: one `FOLD` line per offender, worst first, or
|
|
639
|
+
* `FOLDS: none over N poses`; then, when a by-design closure folds, one
|
|
640
|
+
* `FOLDS expected:` line naming each such part, its ratio and the parameter
|
|
641
|
+
* that shuts it. A `FOLD` line gives its rest point in model space and in
|
|
642
|
+
* model px from the top-left of the model's `canvas` — the layer PNGs' own
|
|
643
|
+
* pixels, the frame `RenderPlan.mouth` is in, not a render's.
|
|
644
|
+
*/
|
|
645
|
+
declare function formatFoldReport(report: FoldReport, canvas: {
|
|
646
|
+
width: number;
|
|
647
|
+
height: number;
|
|
648
|
+
}): string[];
|
|
649
|
+
|
|
575
650
|
/**
|
|
576
651
|
* Measure the head-turn cues in a PAIR of images of the same character — one
|
|
577
652
|
* facing front, one turned — and report them as three ratios. It is how a
|
|
@@ -747,6 +822,12 @@ type RenderPosesResult = {
|
|
|
747
822
|
name: string;
|
|
748
823
|
path: string;
|
|
749
824
|
}[];
|
|
825
|
+
/** The model's own canvas, which `folds`' rest points are placed on in
|
|
826
|
+
* the text (`canvas` is the render's). */
|
|
827
|
+
modelCanvas: IkiModel["canvas"];
|
|
828
|
+
/** The model's folds, as `auto_rig_from_layers` reports them.
|
|
829
|
+
* Report-only: a fold never fails the render. */
|
|
830
|
+
folds: FoldReport;
|
|
750
831
|
} | {
|
|
751
832
|
ok: false;
|
|
752
833
|
error: string;
|
|
@@ -760,4 +841,4 @@ declare function renderPoses(input: RenderPosesInput): Promise<RenderPosesResult
|
|
|
760
841
|
|
|
761
842
|
declare function createIkiMcpServer(): McpServer;
|
|
762
843
|
|
|
763
|
-
export { type AutoRigInput, type AutoRigLayerInput, type AutoRigResult, type AutoRigTurnTargets, type ComposeInput, type ComposeResult, type DeformerSummary, type DescribeResult, type IkiSummary, type IrisBlob, type IrisColor, type LayoutOverride, type MeasureInput, type MeasureResult, type MeasureTurnInput, type MeasureTurnResult, type RenderPosesInput, type RenderPosesResult, type StandardParameterInfo, type TurnImageMeasure, type TurnMeasurement, type ValidateResult, autoRigFromLayers, composeLayersFromParts, createIkiMcpServer, describeIki, formatMeasureReport, formatTurnReport, listStandardParameters, measureLayers, measureTurnReference, renderPoses, validateIki };
|
|
844
|
+
export { type AutoRigInput, type AutoRigLayerInput, type AutoRigResult, type AutoRigTurnTargets, type ComposeInput, type ComposeResult, type DeformerSummary, type DescribeResult, type IkiSummary, type IrisBlob, type IrisColor, type LayoutOverride, type MeasureInput, type MeasureResult, type MeasureTurnInput, type MeasureTurnResult, type RenderPosesInput, type RenderPosesResult, type StandardParameterInfo, type TurnImageMeasure, type TurnMeasurement, type ValidateResult, autoRigFromLayers, checkModelFolds, composeLayersFromParts, createIkiMcpServer, describeIki, formatFoldReport, formatMeasureReport, formatTurnReport, listStandardParameters, measureLayers, measureTurnReference, renderPoses, validateIki };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,57 @@
|
|
|
1
1
|
import { TurnTargets, RigStyle, IrisStrand, TurnSolveReport } from '@ikijs/editor';
|
|
2
2
|
export { TurnSolveReport } from '@ikijs/editor';
|
|
3
|
+
import { IkiModel } from '@ikijs/format';
|
|
3
4
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
5
|
|
|
6
|
+
/** A parameter setting to check the rig at; every other parameter rests at its default. */
|
|
7
|
+
interface FoldPose {
|
|
8
|
+
/** Its sorted `id=value` pairs joined by one space; `rest` when empty. */
|
|
9
|
+
name: string;
|
|
10
|
+
values: Record<string, number>;
|
|
11
|
+
}
|
|
12
|
+
/** Where and when a target comes nearest to folding over one class of poses. */
|
|
13
|
+
interface FoldHit {
|
|
14
|
+
/** Doubled signed area at the pose over the same at rest. */
|
|
15
|
+
ratio: number;
|
|
16
|
+
/** The warp grid's cell, or the part mesh's triangle (its index into `mesh.indices` / 3). */
|
|
17
|
+
where: {
|
|
18
|
+
col: number;
|
|
19
|
+
row: number;
|
|
20
|
+
} | {
|
|
21
|
+
triangle: number;
|
|
22
|
+
};
|
|
23
|
+
pose: FoldPose;
|
|
24
|
+
/** Where it sits at rest, model space, through the static matrix chain. */
|
|
25
|
+
rest: {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
interface FoldTarget {
|
|
31
|
+
target: {
|
|
32
|
+
kind: "deformer" | "part";
|
|
33
|
+
id: string;
|
|
34
|
+
};
|
|
35
|
+
/** Read off `worst` alone; `ok` when it is absent. */
|
|
36
|
+
kind: "flip" | "collapse" | "ok";
|
|
37
|
+
/** Least ratio over the poses `expected` rejects (every pose without it). */
|
|
38
|
+
worst?: FoldHit;
|
|
39
|
+
/** Least ratio over the poses `expected` accepts. */
|
|
40
|
+
expected?: FoldHit;
|
|
41
|
+
}
|
|
42
|
+
interface FoldReport {
|
|
43
|
+
/** How many poses were checked. */
|
|
44
|
+
poses: number;
|
|
45
|
+
thresholds: {
|
|
46
|
+
flip: 0;
|
|
47
|
+
collapse: 0.1;
|
|
48
|
+
};
|
|
49
|
+
/** One per warp deformer, then one per mesh part, each in model order. */
|
|
50
|
+
targets: FoldTarget[];
|
|
51
|
+
/** The targets that are not `ok`, worst first. */
|
|
52
|
+
offenders: FoldTarget[];
|
|
53
|
+
}
|
|
54
|
+
|
|
5
55
|
type ValidateResult = {
|
|
6
56
|
ok: true;
|
|
7
57
|
} | {
|
|
@@ -162,6 +212,10 @@ type AutoRigResult = {
|
|
|
162
212
|
* (`strandOverlap`). Absent for a layer set with no nose, which solves
|
|
163
213
|
* no turn at all. */
|
|
164
214
|
turn?: TurnSolveReport;
|
|
215
|
+
/** The written model's folds over the engine's pose set, its eyes and
|
|
216
|
+
* mouth shutting on purpose set apart as `expected`. Report-only: a
|
|
217
|
+
* fold never refuses the rig. */
|
|
218
|
+
folds: FoldReport;
|
|
165
219
|
} | {
|
|
166
220
|
ok: false;
|
|
167
221
|
error: string;
|
|
@@ -572,6 +626,27 @@ type ComposeResult = {
|
|
|
572
626
|
*/
|
|
573
627
|
declare function composeLayersFromParts(input: ComposeInput): Promise<ComposeResult>;
|
|
574
628
|
|
|
629
|
+
/**
|
|
630
|
+
* The fold check `auto_rig_from_layers` and `render_poses` report: the
|
|
631
|
+
* engine's `checkFolds` with the auto-rig's by-design closures set apart, and
|
|
632
|
+
* the text lines both tools print it as.
|
|
633
|
+
*/
|
|
634
|
+
|
|
635
|
+
/** `checkFolds` over `foldPoses(model)`, the closures above kept out of `worst`. */
|
|
636
|
+
declare function checkModelFolds(model: IkiModel): FoldReport;
|
|
637
|
+
/**
|
|
638
|
+
* `report` as text lines: one `FOLD` line per offender, worst first, or
|
|
639
|
+
* `FOLDS: none over N poses`; then, when a by-design closure folds, one
|
|
640
|
+
* `FOLDS expected:` line naming each such part, its ratio and the parameter
|
|
641
|
+
* that shuts it. A `FOLD` line gives its rest point in model space and in
|
|
642
|
+
* model px from the top-left of the model's `canvas` — the layer PNGs' own
|
|
643
|
+
* pixels, the frame `RenderPlan.mouth` is in, not a render's.
|
|
644
|
+
*/
|
|
645
|
+
declare function formatFoldReport(report: FoldReport, canvas: {
|
|
646
|
+
width: number;
|
|
647
|
+
height: number;
|
|
648
|
+
}): string[];
|
|
649
|
+
|
|
575
650
|
/**
|
|
576
651
|
* Measure the head-turn cues in a PAIR of images of the same character — one
|
|
577
652
|
* facing front, one turned — and report them as three ratios. It is how a
|
|
@@ -747,6 +822,12 @@ type RenderPosesResult = {
|
|
|
747
822
|
name: string;
|
|
748
823
|
path: string;
|
|
749
824
|
}[];
|
|
825
|
+
/** The model's own canvas, which `folds`' rest points are placed on in
|
|
826
|
+
* the text (`canvas` is the render's). */
|
|
827
|
+
modelCanvas: IkiModel["canvas"];
|
|
828
|
+
/** The model's folds, as `auto_rig_from_layers` reports them.
|
|
829
|
+
* Report-only: a fold never fails the render. */
|
|
830
|
+
folds: FoldReport;
|
|
750
831
|
} | {
|
|
751
832
|
ok: false;
|
|
752
833
|
error: string;
|
|
@@ -760,4 +841,4 @@ declare function renderPoses(input: RenderPosesInput): Promise<RenderPosesResult
|
|
|
760
841
|
|
|
761
842
|
declare function createIkiMcpServer(): McpServer;
|
|
762
843
|
|
|
763
|
-
export { type AutoRigInput, type AutoRigLayerInput, type AutoRigResult, type AutoRigTurnTargets, type ComposeInput, type ComposeResult, type DeformerSummary, type DescribeResult, type IkiSummary, type IrisBlob, type IrisColor, type LayoutOverride, type MeasureInput, type MeasureResult, type MeasureTurnInput, type MeasureTurnResult, type RenderPosesInput, type RenderPosesResult, type StandardParameterInfo, type TurnImageMeasure, type TurnMeasurement, type ValidateResult, autoRigFromLayers, composeLayersFromParts, createIkiMcpServer, describeIki, formatMeasureReport, formatTurnReport, listStandardParameters, measureLayers, measureTurnReference, renderPoses, validateIki };
|
|
844
|
+
export { type AutoRigInput, type AutoRigLayerInput, type AutoRigResult, type AutoRigTurnTargets, type ComposeInput, type ComposeResult, type DeformerSummary, type DescribeResult, type IkiSummary, type IrisBlob, type IrisColor, type LayoutOverride, type MeasureInput, type MeasureResult, type MeasureTurnInput, type MeasureTurnResult, type RenderPosesInput, type RenderPosesResult, type StandardParameterInfo, type TurnImageMeasure, type TurnMeasurement, type ValidateResult, autoRigFromLayers, checkModelFolds, composeLayersFromParts, createIkiMcpServer, describeIki, formatFoldReport, formatMeasureReport, formatTurnReport, listStandardParameters, measureLayers, measureTurnReference, renderPoses, validateIki };
|