@ikijs/mcp 0.25.0 → 0.26.1
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 +17 -15
- package/dist/{chunk-JIVXQW4L.mjs → chunk-GPEGV2AT.mjs} +3463 -3258
- package/dist/chunk-GPEGV2AT.mjs.map +1 -0
- package/dist/cli.js +3531 -3328
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +72 -10
- package/dist/index.d.ts +72 -10
- package/dist/index.js +3533 -3328
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -1
- package/package.json +2 -2
- package/dist/chunk-JIVXQW4L.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TurnTargets, RigStyle, IrisStrand, TurnSolveReport } from '@ikijs/editor';
|
|
1
|
+
import { TurnTargets, RigStyle, RigPatch, IrisStrand, TurnSolveReport, PatchReport } from '@ikijs/editor';
|
|
2
2
|
export { TurnSolveReport } from '@ikijs/editor';
|
|
3
3
|
import { IkiModel } from '@ikijs/format';
|
|
4
4
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
@@ -70,12 +70,12 @@ interface IkiSummary {
|
|
|
70
70
|
max: number;
|
|
71
71
|
default: number;
|
|
72
72
|
}[];
|
|
73
|
-
parts:
|
|
74
|
-
id: string;
|
|
75
|
-
order: number;
|
|
76
|
-
deformer?: string;
|
|
77
|
-
}[];
|
|
73
|
+
parts: PartSummary[];
|
|
78
74
|
deformers: DeformerSummary[];
|
|
75
|
+
/** The `face` part's width in model px: the unit a rig patch op's `by` and `falloff` are measured in. */
|
|
76
|
+
faceWidth?: number;
|
|
77
|
+
/** Bust-render px per model px (`BUST_SIZE / canvas.width`). */
|
|
78
|
+
bustScale: number;
|
|
79
79
|
/** Each expression's id and the description a host picks it by. */
|
|
80
80
|
expressions: {
|
|
81
81
|
id: string;
|
|
@@ -84,6 +84,30 @@ interface IkiSummary {
|
|
|
84
84
|
/** Each motion group's clip descriptions, by clip index. */
|
|
85
85
|
motions: Record<string, string[]>;
|
|
86
86
|
}
|
|
87
|
+
interface PartSummary {
|
|
88
|
+
id: string;
|
|
89
|
+
order: number;
|
|
90
|
+
deformer?: string;
|
|
91
|
+
/** Rest box in model px from the canvas top-left, y down; the frame of the fold lines and `layout.json`. */
|
|
92
|
+
box: {
|
|
93
|
+
x: number;
|
|
94
|
+
y: number;
|
|
95
|
+
w: number;
|
|
96
|
+
h: number;
|
|
97
|
+
};
|
|
98
|
+
/** The same box in bust-render px, including the padding above a landscape model. */
|
|
99
|
+
bustBox: {
|
|
100
|
+
x: number;
|
|
101
|
+
y: number;
|
|
102
|
+
w: number;
|
|
103
|
+
h: number;
|
|
104
|
+
};
|
|
105
|
+
/** The part's own warps: parameter and the keyform stop values. */
|
|
106
|
+
warps?: {
|
|
107
|
+
parameter: string;
|
|
108
|
+
stops: number[];
|
|
109
|
+
}[];
|
|
110
|
+
}
|
|
87
111
|
interface DeformerSummary {
|
|
88
112
|
id: string;
|
|
89
113
|
kind: "matrix" | "warp";
|
|
@@ -97,6 +121,8 @@ interface DeformerSummary {
|
|
|
97
121
|
parameterY: string;
|
|
98
122
|
gridX: number;
|
|
99
123
|
gridY: number;
|
|
124
|
+
stopsX: number[];
|
|
125
|
+
stopsY: number[];
|
|
100
126
|
};
|
|
101
127
|
}
|
|
102
128
|
type DescribeResult = {
|
|
@@ -112,6 +138,12 @@ interface StandardParameterInfo {
|
|
|
112
138
|
}
|
|
113
139
|
declare function validateIki(model: unknown): ValidateResult;
|
|
114
140
|
declare function describeIki(model: unknown): DescribeResult;
|
|
141
|
+
/**
|
|
142
|
+
* `describeIki` on a written model, read from `modelPath` (confined to the
|
|
143
|
+
* working directory like `renderPoses`), so a large model never crosses an
|
|
144
|
+
* agent's context inline.
|
|
145
|
+
*/
|
|
146
|
+
declare function describeIkiAt(modelPath: string): DescribeResult;
|
|
115
147
|
declare function listStandardParameters(): StandardParameterInfo[];
|
|
116
148
|
/** One role-named PNG layer; role is derived from `fileName ?? basename(path)`. */
|
|
117
149
|
interface AutoRigLayerInput {
|
|
@@ -133,6 +165,10 @@ interface AutoRigInput {
|
|
|
133
165
|
/** Per-character tuning from the profile's defaults (see
|
|
134
166
|
* @ikijs/editor's `RigStyle`). */
|
|
135
167
|
style?: RigStyle;
|
|
168
|
+
/** Displacements added to existing keyform stops of the freshly generated
|
|
169
|
+
* rig, replayed on every rig of these inputs (see @ikijs/editor's
|
|
170
|
+
* `RigPatch`). */
|
|
171
|
+
patches?: RigPatch[];
|
|
136
172
|
}
|
|
137
173
|
/** The turn cues a caller may pass, which is every one but `headHalfWidth`:
|
|
138
174
|
* the pixels the shift fractions are fractions of are measured off the layers
|
|
@@ -216,6 +252,10 @@ type AutoRigResult = {
|
|
|
216
252
|
* mouth shutting on purpose set apart as `expected`. Report-only: a
|
|
217
253
|
* fold never refuses the rig. */
|
|
218
254
|
folds: FoldReport;
|
|
255
|
+
/** What each of `input.patches` moved on this rig, in order — present
|
|
256
|
+
* whenever `patches` was passed, `[]` included, so a caller can tell
|
|
257
|
+
* this server from one that drops the field. */
|
|
258
|
+
patches?: PatchReport[];
|
|
219
259
|
} | {
|
|
220
260
|
ok: false;
|
|
221
261
|
error: string;
|
|
@@ -232,7 +272,10 @@ type AutoRigResult = {
|
|
|
232
272
|
* and hair layers' opaque runs and the nose's dense core, returned as
|
|
233
273
|
* `noseCore`); what the solve settled on comes back in `turn`. Under
|
|
234
274
|
* `quantizeColors` the nose is atlased alone on a second, lossless page, which
|
|
235
|
-
* the palette would otherwise rim; `atlasBytes` sums both pages.
|
|
275
|
+
* the palette would otherwise rim; `atlasBytes` sums both pages. The
|
|
276
|
+
* generator replays `input.patches` on the fresh rig before it validates and
|
|
277
|
+
* reports the turn, and what each op moved comes back in `patches`; a refused
|
|
278
|
+
* op writes nothing.
|
|
236
279
|
*
|
|
237
280
|
* Re-host of examples/editor/src/store.ts `importLayerSet` with the three DOM
|
|
238
281
|
* pixel functions swapped for the sharp-backed ./node-images helpers; the pure
|
|
@@ -632,8 +675,12 @@ declare function composeLayersFromParts(input: ComposeInput): Promise<ComposeRes
|
|
|
632
675
|
* the text lines both tools print it as.
|
|
633
676
|
*/
|
|
634
677
|
|
|
635
|
-
/**
|
|
636
|
-
|
|
678
|
+
/**
|
|
679
|
+
* `checkFolds` over `foldPoses(model)` then one pose per `extraValues` set,
|
|
680
|
+
* appended as given (a set equal to a default pose is checked twice), with
|
|
681
|
+
* the auto-rig's by-design closures (`SHUT_BY`) kept out of `worst`.
|
|
682
|
+
*/
|
|
683
|
+
declare function checkModelFolds(model: IkiModel, extraValues?: Record<string, number>[]): FoldReport;
|
|
637
684
|
/**
|
|
638
685
|
* `report` as text lines: one `FOLD` line per offender, worst first, or
|
|
639
686
|
* `FOLDS: none over N poses`; then, when a by-design closure folds, one
|
|
@@ -804,11 +851,26 @@ interface RenderPlan {
|
|
|
804
851
|
};
|
|
805
852
|
poses: RenderPose[];
|
|
806
853
|
}
|
|
854
|
+
/** A pose the caller names, rendered in place of the model's own set. */
|
|
855
|
+
interface RequestedPose {
|
|
856
|
+
/** Written as `<outDir>/<name>.png`. */
|
|
857
|
+
name: string;
|
|
858
|
+
values: Record<string, number>;
|
|
859
|
+
/** Model px from the top-left; absent = framed as the standard shots. */
|
|
860
|
+
crop?: {
|
|
861
|
+
x: number;
|
|
862
|
+
y: number;
|
|
863
|
+
w: number;
|
|
864
|
+
h: number;
|
|
865
|
+
};
|
|
866
|
+
}
|
|
807
867
|
interface RenderPosesInput {
|
|
808
868
|
/** The rigged `.iki` to render (resolved against cwd). */
|
|
809
869
|
modelPath: string;
|
|
810
870
|
/** Existing directory under cwd the pose PNGs are written into. */
|
|
811
871
|
outDir: string;
|
|
872
|
+
/** Rendered in place of the model's own set; each is also fold-checked. */
|
|
873
|
+
poses?: RequestedPose[];
|
|
812
874
|
}
|
|
813
875
|
type RenderPosesResult = {
|
|
814
876
|
ok: true;
|
|
@@ -841,4 +903,4 @@ declare function renderPoses(input: RenderPosesInput): Promise<RenderPosesResult
|
|
|
841
903
|
|
|
842
904
|
declare function createIkiMcpServer(): McpServer;
|
|
843
905
|
|
|
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 };
|
|
906
|
+
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 PartSummary, type RenderPosesInput, type RenderPosesResult, type RequestedPose, type StandardParameterInfo, type TurnImageMeasure, type TurnMeasurement, type ValidateResult, autoRigFromLayers, checkModelFolds, composeLayersFromParts, createIkiMcpServer, describeIki, describeIkiAt, formatFoldReport, formatMeasureReport, formatTurnReport, listStandardParameters, measureLayers, measureTurnReference, renderPoses, validateIki };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TurnTargets, RigStyle, IrisStrand, TurnSolveReport } from '@ikijs/editor';
|
|
1
|
+
import { TurnTargets, RigStyle, RigPatch, IrisStrand, TurnSolveReport, PatchReport } from '@ikijs/editor';
|
|
2
2
|
export { TurnSolveReport } from '@ikijs/editor';
|
|
3
3
|
import { IkiModel } from '@ikijs/format';
|
|
4
4
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
@@ -70,12 +70,12 @@ interface IkiSummary {
|
|
|
70
70
|
max: number;
|
|
71
71
|
default: number;
|
|
72
72
|
}[];
|
|
73
|
-
parts:
|
|
74
|
-
id: string;
|
|
75
|
-
order: number;
|
|
76
|
-
deformer?: string;
|
|
77
|
-
}[];
|
|
73
|
+
parts: PartSummary[];
|
|
78
74
|
deformers: DeformerSummary[];
|
|
75
|
+
/** The `face` part's width in model px: the unit a rig patch op's `by` and `falloff` are measured in. */
|
|
76
|
+
faceWidth?: number;
|
|
77
|
+
/** Bust-render px per model px (`BUST_SIZE / canvas.width`). */
|
|
78
|
+
bustScale: number;
|
|
79
79
|
/** Each expression's id and the description a host picks it by. */
|
|
80
80
|
expressions: {
|
|
81
81
|
id: string;
|
|
@@ -84,6 +84,30 @@ interface IkiSummary {
|
|
|
84
84
|
/** Each motion group's clip descriptions, by clip index. */
|
|
85
85
|
motions: Record<string, string[]>;
|
|
86
86
|
}
|
|
87
|
+
interface PartSummary {
|
|
88
|
+
id: string;
|
|
89
|
+
order: number;
|
|
90
|
+
deformer?: string;
|
|
91
|
+
/** Rest box in model px from the canvas top-left, y down; the frame of the fold lines and `layout.json`. */
|
|
92
|
+
box: {
|
|
93
|
+
x: number;
|
|
94
|
+
y: number;
|
|
95
|
+
w: number;
|
|
96
|
+
h: number;
|
|
97
|
+
};
|
|
98
|
+
/** The same box in bust-render px, including the padding above a landscape model. */
|
|
99
|
+
bustBox: {
|
|
100
|
+
x: number;
|
|
101
|
+
y: number;
|
|
102
|
+
w: number;
|
|
103
|
+
h: number;
|
|
104
|
+
};
|
|
105
|
+
/** The part's own warps: parameter and the keyform stop values. */
|
|
106
|
+
warps?: {
|
|
107
|
+
parameter: string;
|
|
108
|
+
stops: number[];
|
|
109
|
+
}[];
|
|
110
|
+
}
|
|
87
111
|
interface DeformerSummary {
|
|
88
112
|
id: string;
|
|
89
113
|
kind: "matrix" | "warp";
|
|
@@ -97,6 +121,8 @@ interface DeformerSummary {
|
|
|
97
121
|
parameterY: string;
|
|
98
122
|
gridX: number;
|
|
99
123
|
gridY: number;
|
|
124
|
+
stopsX: number[];
|
|
125
|
+
stopsY: number[];
|
|
100
126
|
};
|
|
101
127
|
}
|
|
102
128
|
type DescribeResult = {
|
|
@@ -112,6 +138,12 @@ interface StandardParameterInfo {
|
|
|
112
138
|
}
|
|
113
139
|
declare function validateIki(model: unknown): ValidateResult;
|
|
114
140
|
declare function describeIki(model: unknown): DescribeResult;
|
|
141
|
+
/**
|
|
142
|
+
* `describeIki` on a written model, read from `modelPath` (confined to the
|
|
143
|
+
* working directory like `renderPoses`), so a large model never crosses an
|
|
144
|
+
* agent's context inline.
|
|
145
|
+
*/
|
|
146
|
+
declare function describeIkiAt(modelPath: string): DescribeResult;
|
|
115
147
|
declare function listStandardParameters(): StandardParameterInfo[];
|
|
116
148
|
/** One role-named PNG layer; role is derived from `fileName ?? basename(path)`. */
|
|
117
149
|
interface AutoRigLayerInput {
|
|
@@ -133,6 +165,10 @@ interface AutoRigInput {
|
|
|
133
165
|
/** Per-character tuning from the profile's defaults (see
|
|
134
166
|
* @ikijs/editor's `RigStyle`). */
|
|
135
167
|
style?: RigStyle;
|
|
168
|
+
/** Displacements added to existing keyform stops of the freshly generated
|
|
169
|
+
* rig, replayed on every rig of these inputs (see @ikijs/editor's
|
|
170
|
+
* `RigPatch`). */
|
|
171
|
+
patches?: RigPatch[];
|
|
136
172
|
}
|
|
137
173
|
/** The turn cues a caller may pass, which is every one but `headHalfWidth`:
|
|
138
174
|
* the pixels the shift fractions are fractions of are measured off the layers
|
|
@@ -216,6 +252,10 @@ type AutoRigResult = {
|
|
|
216
252
|
* mouth shutting on purpose set apart as `expected`. Report-only: a
|
|
217
253
|
* fold never refuses the rig. */
|
|
218
254
|
folds: FoldReport;
|
|
255
|
+
/** What each of `input.patches` moved on this rig, in order — present
|
|
256
|
+
* whenever `patches` was passed, `[]` included, so a caller can tell
|
|
257
|
+
* this server from one that drops the field. */
|
|
258
|
+
patches?: PatchReport[];
|
|
219
259
|
} | {
|
|
220
260
|
ok: false;
|
|
221
261
|
error: string;
|
|
@@ -232,7 +272,10 @@ type AutoRigResult = {
|
|
|
232
272
|
* and hair layers' opaque runs and the nose's dense core, returned as
|
|
233
273
|
* `noseCore`); what the solve settled on comes back in `turn`. Under
|
|
234
274
|
* `quantizeColors` the nose is atlased alone on a second, lossless page, which
|
|
235
|
-
* the palette would otherwise rim; `atlasBytes` sums both pages.
|
|
275
|
+
* the palette would otherwise rim; `atlasBytes` sums both pages. The
|
|
276
|
+
* generator replays `input.patches` on the fresh rig before it validates and
|
|
277
|
+
* reports the turn, and what each op moved comes back in `patches`; a refused
|
|
278
|
+
* op writes nothing.
|
|
236
279
|
*
|
|
237
280
|
* Re-host of examples/editor/src/store.ts `importLayerSet` with the three DOM
|
|
238
281
|
* pixel functions swapped for the sharp-backed ./node-images helpers; the pure
|
|
@@ -632,8 +675,12 @@ declare function composeLayersFromParts(input: ComposeInput): Promise<ComposeRes
|
|
|
632
675
|
* the text lines both tools print it as.
|
|
633
676
|
*/
|
|
634
677
|
|
|
635
|
-
/**
|
|
636
|
-
|
|
678
|
+
/**
|
|
679
|
+
* `checkFolds` over `foldPoses(model)` then one pose per `extraValues` set,
|
|
680
|
+
* appended as given (a set equal to a default pose is checked twice), with
|
|
681
|
+
* the auto-rig's by-design closures (`SHUT_BY`) kept out of `worst`.
|
|
682
|
+
*/
|
|
683
|
+
declare function checkModelFolds(model: IkiModel, extraValues?: Record<string, number>[]): FoldReport;
|
|
637
684
|
/**
|
|
638
685
|
* `report` as text lines: one `FOLD` line per offender, worst first, or
|
|
639
686
|
* `FOLDS: none over N poses`; then, when a by-design closure folds, one
|
|
@@ -804,11 +851,26 @@ interface RenderPlan {
|
|
|
804
851
|
};
|
|
805
852
|
poses: RenderPose[];
|
|
806
853
|
}
|
|
854
|
+
/** A pose the caller names, rendered in place of the model's own set. */
|
|
855
|
+
interface RequestedPose {
|
|
856
|
+
/** Written as `<outDir>/<name>.png`. */
|
|
857
|
+
name: string;
|
|
858
|
+
values: Record<string, number>;
|
|
859
|
+
/** Model px from the top-left; absent = framed as the standard shots. */
|
|
860
|
+
crop?: {
|
|
861
|
+
x: number;
|
|
862
|
+
y: number;
|
|
863
|
+
w: number;
|
|
864
|
+
h: number;
|
|
865
|
+
};
|
|
866
|
+
}
|
|
807
867
|
interface RenderPosesInput {
|
|
808
868
|
/** The rigged `.iki` to render (resolved against cwd). */
|
|
809
869
|
modelPath: string;
|
|
810
870
|
/** Existing directory under cwd the pose PNGs are written into. */
|
|
811
871
|
outDir: string;
|
|
872
|
+
/** Rendered in place of the model's own set; each is also fold-checked. */
|
|
873
|
+
poses?: RequestedPose[];
|
|
812
874
|
}
|
|
813
875
|
type RenderPosesResult = {
|
|
814
876
|
ok: true;
|
|
@@ -841,4 +903,4 @@ declare function renderPoses(input: RenderPosesInput): Promise<RenderPosesResult
|
|
|
841
903
|
|
|
842
904
|
declare function createIkiMcpServer(): McpServer;
|
|
843
905
|
|
|
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 };
|
|
906
|
+
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 PartSummary, type RenderPosesInput, type RenderPosesResult, type RequestedPose, type StandardParameterInfo, type TurnImageMeasure, type TurnMeasurement, type ValidateResult, autoRigFromLayers, checkModelFolds, composeLayersFromParts, createIkiMcpServer, describeIki, describeIkiAt, formatFoldReport, formatMeasureReport, formatTurnReport, listStandardParameters, measureLayers, measureTurnReference, renderPoses, validateIki };
|