@ikijs/mcp 0.30.0 → 0.31.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 +14 -12
- package/dist/{chunk-5WHM63CL.mjs → chunk-BQVILYRV.mjs} +591 -110
- package/dist/chunk-BQVILYRV.mjs.map +1 -0
- package/dist/cli.js +585 -108
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +126 -1
- package/dist/index.d.ts +126 -1
- package/dist/index.js +589 -108
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -1
- package/dist/render-page.global.js +1085 -13
- package/package.json +3 -3
- package/dist/chunk-5WHM63CL.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -913,6 +913,50 @@ declare function measureTurnReference(input: MeasureTurnInput): Promise<MeasureT
|
|
|
913
913
|
* behind each, then one block per image. */
|
|
914
914
|
declare function formatTurnReport(result: TurnMeasurement): string;
|
|
915
915
|
|
|
916
|
+
/**
|
|
917
|
+
* The turn sweep's `SWEEP` lines: geometry, not pixels. A `ParamAngleX` ladder
|
|
918
|
+
* from −30 to +30 in 1° steps, every other parameter at its default and no
|
|
919
|
+
* physics, landed through the engine's `landParts` — the report reads the
|
|
920
|
+
* rig, the frames show the rig plus the hair. Report-only, like `FOLD` and
|
|
921
|
+
* `PHYSICS`: nothing here is a threshold that makes a finding.
|
|
922
|
+
*
|
|
923
|
+
* Landmarks are found by role (`eye_L`, `eye_R`, `nose`, against the `face`
|
|
924
|
+
* plate) — mcp's knowledge, never the engine's. Every landed coordinate is
|
|
925
|
+
* divided by the face part's own width, `describe_iki`'s `faceWidth` and the
|
|
926
|
+
* unit a patch's `by` is in, before any number below is formed.
|
|
927
|
+
*/
|
|
928
|
+
|
|
929
|
+
interface SweepLandmark {
|
|
930
|
+
id: string;
|
|
931
|
+
/** x(+30) − x(−30), face widths: a frozen rig reads 0, however smooth. */
|
|
932
|
+
amplitude: number;
|
|
933
|
+
/** The slope change of x through θ = 0, 0..1; null when both slopes are ~0. */
|
|
934
|
+
xKink: number | null;
|
|
935
|
+
/** The same for the landed width; null for a landmark without one, or when both slopes are ~0. */
|
|
936
|
+
widthKink: number | null;
|
|
937
|
+
/** How far the landmark has moved beyond the local face plate, at −30 and +30, face widths. */
|
|
938
|
+
lead: {
|
|
939
|
+
m30: number;
|
|
940
|
+
p30: number;
|
|
941
|
+
};
|
|
942
|
+
/** The largest second difference of x away from θ = 0, over the mean step; null when x never moves. */
|
|
943
|
+
pop: number | null;
|
|
944
|
+
}
|
|
945
|
+
type SweepReport = {
|
|
946
|
+
preset: "turn";
|
|
947
|
+
unit: "fw";
|
|
948
|
+
faceWidth: number;
|
|
949
|
+
/** The face plate's own x(+30) − x(−30) at the eye row, face widths. */
|
|
950
|
+
plateAmplitude: number;
|
|
951
|
+
landmarks: SweepLandmark[];
|
|
952
|
+
} | {
|
|
953
|
+
preset: "turn";
|
|
954
|
+
unavailable: string;
|
|
955
|
+
};
|
|
956
|
+
declare function checkSweep(model: IkiModel): SweepReport;
|
|
957
|
+
/** One `SWEEP` line per landmark and one for the plate, or the one `unavailable` line. */
|
|
958
|
+
declare function formatSweepReport(report: SweepReport): string[];
|
|
959
|
+
|
|
916
960
|
/**
|
|
917
961
|
* The pose plan `render_poses` captures: the canvas framing, the crops and the
|
|
918
962
|
* pose list, all decided from the model. It is the iki-character-loop's
|
|
@@ -952,6 +996,8 @@ interface RenderPlan {
|
|
|
952
996
|
cy: number;
|
|
953
997
|
};
|
|
954
998
|
poses: RenderPose[];
|
|
999
|
+
/** The sweep's fixed framing; absent when no sweep was asked for. */
|
|
1000
|
+
sweepCrop?: RenderCrop;
|
|
955
1001
|
}
|
|
956
1002
|
/** A pose the caller names, rendered in place of the model's own set. */
|
|
957
1003
|
interface RequestedPose {
|
|
@@ -973,6 +1019,8 @@ interface RenderPosesInput {
|
|
|
973
1019
|
outDir: string;
|
|
974
1020
|
/** Rendered in place of the model's own set; each is also fold-checked. */
|
|
975
1021
|
poses?: RequestedPose[];
|
|
1022
|
+
/** A turn sweep rendered in addition to the poses, into `<outDir>/<name>/`. */
|
|
1023
|
+
sweep?: RequestedSweep;
|
|
976
1024
|
}
|
|
977
1025
|
type RenderPosesResult = {
|
|
978
1026
|
ok: true;
|
|
@@ -996,6 +1044,20 @@ type RenderPosesResult = {
|
|
|
996
1044
|
* `auto_rig_from_layers` reports them. Report-only: it never fails
|
|
997
1045
|
* the render. */
|
|
998
1046
|
physics: PhysicsReport;
|
|
1047
|
+
/** Present whenever `sweep` was asked for; absent only from a server
|
|
1048
|
+
* before 0.31.0, which strips the input. */
|
|
1049
|
+
sweep?: {
|
|
1050
|
+
name: string;
|
|
1051
|
+
preset: "turn";
|
|
1052
|
+
dir: string;
|
|
1053
|
+
fps: number;
|
|
1054
|
+
frames: number;
|
|
1055
|
+
manifest: string;
|
|
1056
|
+
sheet: string;
|
|
1057
|
+
kymograph: string;
|
|
1058
|
+
flipbook: string;
|
|
1059
|
+
report: SweepReport;
|
|
1060
|
+
};
|
|
999
1061
|
} | {
|
|
1000
1062
|
ok: false;
|
|
1001
1063
|
error: string;
|
|
@@ -1007,6 +1069,69 @@ type RenderPosesResult = {
|
|
|
1007
1069
|
*/
|
|
1008
1070
|
declare function renderPoses(input: RenderPosesInput): Promise<RenderPosesResult>;
|
|
1009
1071
|
|
|
1072
|
+
/**
|
|
1073
|
+
* The turn sweep `render_poses` renders on request: an eased ±30 `ParamAngleX`
|
|
1074
|
+
* turn with the hair physics running. This file is its pure pieces — the
|
|
1075
|
+
* schedule, the sheet picks, the kymograph row, the flipbook template and the
|
|
1076
|
+
* output directory — all decided in Node; the page only draws what the
|
|
1077
|
+
* {@link SweepSpec} says. The page script imports this file for TYPES only (it
|
|
1078
|
+
* is bundled as a browser IIFE and must never pull in `node:fs`).
|
|
1079
|
+
*/
|
|
1080
|
+
|
|
1081
|
+
/** What the caller asks for. */
|
|
1082
|
+
interface RequestedSweep {
|
|
1083
|
+
/** Becomes the directory `<outDir>/<name>/`. */
|
|
1084
|
+
name: string;
|
|
1085
|
+
preset: "turn";
|
|
1086
|
+
/** Model px from the top-left, as a pose's crop; absent = the standard shot. */
|
|
1087
|
+
crop?: {
|
|
1088
|
+
x: number;
|
|
1089
|
+
y: number;
|
|
1090
|
+
w: number;
|
|
1091
|
+
h: number;
|
|
1092
|
+
};
|
|
1093
|
+
}
|
|
1094
|
+
/** `manifest.json`. */
|
|
1095
|
+
interface SweepManifest {
|
|
1096
|
+
version: 1;
|
|
1097
|
+
preset: "turn";
|
|
1098
|
+
parameter: string;
|
|
1099
|
+
fps: number;
|
|
1100
|
+
clockHz: number;
|
|
1101
|
+
warmupS: number;
|
|
1102
|
+
durationS: number;
|
|
1103
|
+
crop: {
|
|
1104
|
+
x: number;
|
|
1105
|
+
y: number;
|
|
1106
|
+
w: number;
|
|
1107
|
+
h: number;
|
|
1108
|
+
} | null;
|
|
1109
|
+
frame: {
|
|
1110
|
+
width: number;
|
|
1111
|
+
height: number;
|
|
1112
|
+
};
|
|
1113
|
+
kymographRow: {
|
|
1114
|
+
row: number;
|
|
1115
|
+
at: "eye row" | "middle";
|
|
1116
|
+
};
|
|
1117
|
+
sheet: {
|
|
1118
|
+
frames: number[];
|
|
1119
|
+
cell: {
|
|
1120
|
+
w: number;
|
|
1121
|
+
h: number;
|
|
1122
|
+
};
|
|
1123
|
+
};
|
|
1124
|
+
physicsOutputs: string[];
|
|
1125
|
+
frames: {
|
|
1126
|
+
i: number;
|
|
1127
|
+
file: string;
|
|
1128
|
+
t: number;
|
|
1129
|
+
theta: number;
|
|
1130
|
+
/** The effective `parameter` and every physics output, read off the player after step 2i. */
|
|
1131
|
+
values: Record<string, number>;
|
|
1132
|
+
}[];
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1010
1135
|
declare function createIkiMcpServer(): McpServer;
|
|
1011
1136
|
|
|
1012
|
-
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, describeRigPlan, formatFoldReport, formatMeasureReport, formatPhysicsReport, formatRigPlanReport, formatTurnReport, listStandardParameters, measureLayers, measureTurnReference, renderPoses, validateIki };
|
|
1137
|
+
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 RequestedSweep, type StandardParameterInfo, type SweepManifest, type SweepReport, type TurnImageMeasure, type TurnMeasurement, type ValidateResult, autoRigFromLayers, checkModelFolds, checkSweep, composeLayersFromParts, createIkiMcpServer, describeIki, describeIkiAt, describeRigPlan, formatFoldReport, formatMeasureReport, formatPhysicsReport, formatRigPlanReport, formatSweepReport, formatTurnReport, listStandardParameters, measureLayers, measureTurnReference, renderPoses, validateIki };
|
package/dist/index.d.ts
CHANGED
|
@@ -913,6 +913,50 @@ declare function measureTurnReference(input: MeasureTurnInput): Promise<MeasureT
|
|
|
913
913
|
* behind each, then one block per image. */
|
|
914
914
|
declare function formatTurnReport(result: TurnMeasurement): string;
|
|
915
915
|
|
|
916
|
+
/**
|
|
917
|
+
* The turn sweep's `SWEEP` lines: geometry, not pixels. A `ParamAngleX` ladder
|
|
918
|
+
* from −30 to +30 in 1° steps, every other parameter at its default and no
|
|
919
|
+
* physics, landed through the engine's `landParts` — the report reads the
|
|
920
|
+
* rig, the frames show the rig plus the hair. Report-only, like `FOLD` and
|
|
921
|
+
* `PHYSICS`: nothing here is a threshold that makes a finding.
|
|
922
|
+
*
|
|
923
|
+
* Landmarks are found by role (`eye_L`, `eye_R`, `nose`, against the `face`
|
|
924
|
+
* plate) — mcp's knowledge, never the engine's. Every landed coordinate is
|
|
925
|
+
* divided by the face part's own width, `describe_iki`'s `faceWidth` and the
|
|
926
|
+
* unit a patch's `by` is in, before any number below is formed.
|
|
927
|
+
*/
|
|
928
|
+
|
|
929
|
+
interface SweepLandmark {
|
|
930
|
+
id: string;
|
|
931
|
+
/** x(+30) − x(−30), face widths: a frozen rig reads 0, however smooth. */
|
|
932
|
+
amplitude: number;
|
|
933
|
+
/** The slope change of x through θ = 0, 0..1; null when both slopes are ~0. */
|
|
934
|
+
xKink: number | null;
|
|
935
|
+
/** The same for the landed width; null for a landmark without one, or when both slopes are ~0. */
|
|
936
|
+
widthKink: number | null;
|
|
937
|
+
/** How far the landmark has moved beyond the local face plate, at −30 and +30, face widths. */
|
|
938
|
+
lead: {
|
|
939
|
+
m30: number;
|
|
940
|
+
p30: number;
|
|
941
|
+
};
|
|
942
|
+
/** The largest second difference of x away from θ = 0, over the mean step; null when x never moves. */
|
|
943
|
+
pop: number | null;
|
|
944
|
+
}
|
|
945
|
+
type SweepReport = {
|
|
946
|
+
preset: "turn";
|
|
947
|
+
unit: "fw";
|
|
948
|
+
faceWidth: number;
|
|
949
|
+
/** The face plate's own x(+30) − x(−30) at the eye row, face widths. */
|
|
950
|
+
plateAmplitude: number;
|
|
951
|
+
landmarks: SweepLandmark[];
|
|
952
|
+
} | {
|
|
953
|
+
preset: "turn";
|
|
954
|
+
unavailable: string;
|
|
955
|
+
};
|
|
956
|
+
declare function checkSweep(model: IkiModel): SweepReport;
|
|
957
|
+
/** One `SWEEP` line per landmark and one for the plate, or the one `unavailable` line. */
|
|
958
|
+
declare function formatSweepReport(report: SweepReport): string[];
|
|
959
|
+
|
|
916
960
|
/**
|
|
917
961
|
* The pose plan `render_poses` captures: the canvas framing, the crops and the
|
|
918
962
|
* pose list, all decided from the model. It is the iki-character-loop's
|
|
@@ -952,6 +996,8 @@ interface RenderPlan {
|
|
|
952
996
|
cy: number;
|
|
953
997
|
};
|
|
954
998
|
poses: RenderPose[];
|
|
999
|
+
/** The sweep's fixed framing; absent when no sweep was asked for. */
|
|
1000
|
+
sweepCrop?: RenderCrop;
|
|
955
1001
|
}
|
|
956
1002
|
/** A pose the caller names, rendered in place of the model's own set. */
|
|
957
1003
|
interface RequestedPose {
|
|
@@ -973,6 +1019,8 @@ interface RenderPosesInput {
|
|
|
973
1019
|
outDir: string;
|
|
974
1020
|
/** Rendered in place of the model's own set; each is also fold-checked. */
|
|
975
1021
|
poses?: RequestedPose[];
|
|
1022
|
+
/** A turn sweep rendered in addition to the poses, into `<outDir>/<name>/`. */
|
|
1023
|
+
sweep?: RequestedSweep;
|
|
976
1024
|
}
|
|
977
1025
|
type RenderPosesResult = {
|
|
978
1026
|
ok: true;
|
|
@@ -996,6 +1044,20 @@ type RenderPosesResult = {
|
|
|
996
1044
|
* `auto_rig_from_layers` reports them. Report-only: it never fails
|
|
997
1045
|
* the render. */
|
|
998
1046
|
physics: PhysicsReport;
|
|
1047
|
+
/** Present whenever `sweep` was asked for; absent only from a server
|
|
1048
|
+
* before 0.31.0, which strips the input. */
|
|
1049
|
+
sweep?: {
|
|
1050
|
+
name: string;
|
|
1051
|
+
preset: "turn";
|
|
1052
|
+
dir: string;
|
|
1053
|
+
fps: number;
|
|
1054
|
+
frames: number;
|
|
1055
|
+
manifest: string;
|
|
1056
|
+
sheet: string;
|
|
1057
|
+
kymograph: string;
|
|
1058
|
+
flipbook: string;
|
|
1059
|
+
report: SweepReport;
|
|
1060
|
+
};
|
|
999
1061
|
} | {
|
|
1000
1062
|
ok: false;
|
|
1001
1063
|
error: string;
|
|
@@ -1007,6 +1069,69 @@ type RenderPosesResult = {
|
|
|
1007
1069
|
*/
|
|
1008
1070
|
declare function renderPoses(input: RenderPosesInput): Promise<RenderPosesResult>;
|
|
1009
1071
|
|
|
1072
|
+
/**
|
|
1073
|
+
* The turn sweep `render_poses` renders on request: an eased ±30 `ParamAngleX`
|
|
1074
|
+
* turn with the hair physics running. This file is its pure pieces — the
|
|
1075
|
+
* schedule, the sheet picks, the kymograph row, the flipbook template and the
|
|
1076
|
+
* output directory — all decided in Node; the page only draws what the
|
|
1077
|
+
* {@link SweepSpec} says. The page script imports this file for TYPES only (it
|
|
1078
|
+
* is bundled as a browser IIFE and must never pull in `node:fs`).
|
|
1079
|
+
*/
|
|
1080
|
+
|
|
1081
|
+
/** What the caller asks for. */
|
|
1082
|
+
interface RequestedSweep {
|
|
1083
|
+
/** Becomes the directory `<outDir>/<name>/`. */
|
|
1084
|
+
name: string;
|
|
1085
|
+
preset: "turn";
|
|
1086
|
+
/** Model px from the top-left, as a pose's crop; absent = the standard shot. */
|
|
1087
|
+
crop?: {
|
|
1088
|
+
x: number;
|
|
1089
|
+
y: number;
|
|
1090
|
+
w: number;
|
|
1091
|
+
h: number;
|
|
1092
|
+
};
|
|
1093
|
+
}
|
|
1094
|
+
/** `manifest.json`. */
|
|
1095
|
+
interface SweepManifest {
|
|
1096
|
+
version: 1;
|
|
1097
|
+
preset: "turn";
|
|
1098
|
+
parameter: string;
|
|
1099
|
+
fps: number;
|
|
1100
|
+
clockHz: number;
|
|
1101
|
+
warmupS: number;
|
|
1102
|
+
durationS: number;
|
|
1103
|
+
crop: {
|
|
1104
|
+
x: number;
|
|
1105
|
+
y: number;
|
|
1106
|
+
w: number;
|
|
1107
|
+
h: number;
|
|
1108
|
+
} | null;
|
|
1109
|
+
frame: {
|
|
1110
|
+
width: number;
|
|
1111
|
+
height: number;
|
|
1112
|
+
};
|
|
1113
|
+
kymographRow: {
|
|
1114
|
+
row: number;
|
|
1115
|
+
at: "eye row" | "middle";
|
|
1116
|
+
};
|
|
1117
|
+
sheet: {
|
|
1118
|
+
frames: number[];
|
|
1119
|
+
cell: {
|
|
1120
|
+
w: number;
|
|
1121
|
+
h: number;
|
|
1122
|
+
};
|
|
1123
|
+
};
|
|
1124
|
+
physicsOutputs: string[];
|
|
1125
|
+
frames: {
|
|
1126
|
+
i: number;
|
|
1127
|
+
file: string;
|
|
1128
|
+
t: number;
|
|
1129
|
+
theta: number;
|
|
1130
|
+
/** The effective `parameter` and every physics output, read off the player after step 2i. */
|
|
1131
|
+
values: Record<string, number>;
|
|
1132
|
+
}[];
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1010
1135
|
declare function createIkiMcpServer(): McpServer;
|
|
1011
1136
|
|
|
1012
|
-
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, describeRigPlan, formatFoldReport, formatMeasureReport, formatPhysicsReport, formatRigPlanReport, formatTurnReport, listStandardParameters, measureLayers, measureTurnReference, renderPoses, validateIki };
|
|
1137
|
+
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 RequestedSweep, type StandardParameterInfo, type SweepManifest, type SweepReport, type TurnImageMeasure, type TurnMeasurement, type ValidateResult, autoRigFromLayers, checkModelFolds, checkSweep, composeLayersFromParts, createIkiMcpServer, describeIki, describeIkiAt, describeRigPlan, formatFoldReport, formatMeasureReport, formatPhysicsReport, formatRigPlanReport, formatSweepReport, formatTurnReport, listStandardParameters, measureLayers, measureTurnReference, renderPoses, validateIki };
|