@ikijs/mcp 0.31.0 → 0.32.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/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  createIkiMcpServer
4
- } from "./chunk-RLBRIAVN.mjs";
4
+ } from "./chunk-576N2JWR.mjs";
5
5
 
6
6
  // src/cli.ts
7
7
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
package/dist/index.d.mts CHANGED
@@ -953,9 +953,47 @@ type SweepReport = {
953
953
  preset: "turn";
954
954
  unavailable: string;
955
955
  };
956
+ /** A pair gap or a width, face widths: the range along the nod at each turn. */
957
+ interface NodRange {
958
+ id: "eyes" | "irises" | "mouth";
959
+ range: {
960
+ m30: number;
961
+ zero: number;
962
+ p30: number;
963
+ };
964
+ }
965
+ /** The additivity residual of a landmark at the four corners; first letter AngleX, second AngleY. */
966
+ interface CornerResidual {
967
+ id: string;
968
+ residual: {
969
+ mm: number;
970
+ mp: number;
971
+ pm: number;
972
+ pp: number;
973
+ };
974
+ }
975
+ type NodReport = {
976
+ unit: "fw";
977
+ faceWidth: number;
978
+ nod: NodRange[];
979
+ corner: CornerResidual[];
980
+ } | {
981
+ unavailable: string;
982
+ };
983
+ /**
984
+ * The nod at three turns: `ParamAngleY` −30 … +30 in 1° steps at `ParamAngleX`
985
+ * −30, 0 and +30, no physics. `nod` is how far a pair gap (or the mouth's
986
+ * width) moves along each ladder; `corner` is the AngleX × AngleY additivity
987
+ * residual per landmark, the rest term included, so a rig whose parts add the
988
+ * turn and the nod reads 0. Both are read against each other and against the
989
+ * corpus's zeros, never against a bound.
990
+ */
991
+ declare function checkNod(model: IkiModel): NodReport;
956
992
  declare function checkSweep(model: IkiModel): SweepReport;
957
993
  /** One `SWEEP` line per landmark and one for the plate, or the one `unavailable` line. */
958
994
  declare function formatSweepReport(report: SweepReport): string[];
995
+ /** The `SWEEP nod` and `SWEEP corner` lines, or the one `unavailable` line. */
996
+ declare function formatNodReport(report: NodReport): string[];
959
997
 
960
998
  /**
961
999
  * The pose plan `render_poses` captures: the canvas framing, the crops and the
@@ -998,6 +1036,8 @@ interface RenderPlan {
998
1036
  poses: RenderPose[];
999
1037
  /** The sweep's fixed framing; absent when no sweep was asked for. */
1000
1038
  sweepCrop?: RenderCrop;
1039
+ /** The same for each `sweeps` entry, aligned with it; absent without `sweeps`. */
1040
+ sweepsCrops?: (RenderCrop | undefined)[];
1001
1041
  }
1002
1042
  /** A pose the caller names, rendered in place of the model's own set. */
1003
1043
  interface RequestedPose {
@@ -1021,6 +1061,22 @@ interface RenderPosesInput {
1021
1061
  poses?: RequestedPose[];
1022
1062
  /** A turn sweep rendered in addition to the poses, into `<outDir>/<name>/`. */
1023
1063
  sweep?: RequestedSweep;
1064
+ /** More sweeps, rendered after `sweep`, each into its own `<outDir>/<name>/`. */
1065
+ sweeps?: RequestedSweep[];
1066
+ }
1067
+ interface SweepOutput {
1068
+ name: string;
1069
+ preset: SweepPreset;
1070
+ dir: string;
1071
+ fps: number;
1072
+ frames: number;
1073
+ manifest: string;
1074
+ sheet: string;
1075
+ /** Absent for a preset without one (`turn-nod`). */
1076
+ kymograph?: string;
1077
+ flipbook: string;
1078
+ report: SweepReport;
1079
+ nod: NodReport;
1024
1080
  }
1025
1081
  type RenderPosesResult = {
1026
1082
  ok: true;
@@ -1046,18 +1102,10 @@ type RenderPosesResult = {
1046
1102
  physics: PhysicsReport;
1047
1103
  /** Present whenever `sweep` was asked for; absent only from a server
1048
1104
  * 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
- };
1105
+ sweep?: SweepOutput;
1106
+ /** In request order; present whenever `sweeps` was asked for, absent
1107
+ * from a server before 0.32.0, which strips the input. */
1108
+ sweeps?: SweepOutput[];
1061
1109
  } | {
1062
1110
  ok: false;
1063
1111
  error: string;
@@ -1070,19 +1118,22 @@ type RenderPosesResult = {
1070
1118
  declare function renderPoses(input: RenderPosesInput): Promise<RenderPosesResult>;
1071
1119
 
1072
1120
  /**
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
1121
+ * The sweeps `render_poses` renders on request: an eased ±30 `ParamAngleX`
1122
+ * turn, or the `turn-nod` box through every `ParamAngleX` × `ParamAngleY`
1123
+ * stop, with the hair physics running. This file is their pure pieces — the
1124
+ * schedules, the sheet picks, the kymograph row, the flipbook template and the
1076
1125
  * output directory — all decided in Node; the page only draws what the
1077
1126
  * {@link SweepSpec} says. The page script imports this file for TYPES only (it
1078
1127
  * is bundled as a browser IIFE and must never pull in `node:fs`).
1079
1128
  */
1080
1129
 
1130
+ declare const SWEEP_PRESETS: readonly ["turn", "turn-nod"];
1131
+ type SweepPreset = (typeof SWEEP_PRESETS)[number];
1081
1132
  /** What the caller asks for. */
1082
1133
  interface RequestedSweep {
1083
1134
  /** Becomes the directory `<outDir>/<name>/`. */
1084
1135
  name: string;
1085
- preset: "turn";
1136
+ preset: SweepPreset;
1086
1137
  /** Model px from the top-left, as a pose's crop; absent = the standard shot. */
1087
1138
  crop?: {
1088
1139
  x: number;
@@ -1093,9 +1144,9 @@ interface RequestedSweep {
1093
1144
  }
1094
1145
  /** `manifest.json`. */
1095
1146
  interface SweepManifest {
1096
- version: 1;
1097
- preset: "turn";
1098
- parameter: string;
1147
+ version: 2;
1148
+ preset: SweepPreset;
1149
+ parameters: string[];
1099
1150
  fps: number;
1100
1151
  clockHz: number;
1101
1152
  warmupS: number;
@@ -1113,7 +1164,7 @@ interface SweepManifest {
1113
1164
  kymographRow: {
1114
1165
  row: number;
1115
1166
  at: "eye row" | "middle";
1116
- };
1167
+ } | null;
1117
1168
  sheet: {
1118
1169
  frames: number[];
1119
1170
  cell: {
@@ -1126,12 +1177,11 @@ interface SweepManifest {
1126
1177
  i: number;
1127
1178
  file: string;
1128
1179
  t: number;
1129
- theta: number;
1130
- /** The effective `parameter` and every physics output, read off the player after step 2i. */
1180
+ /** Every scripted id and every physics output, read off the player after step 2i. */
1131
1181
  values: Record<string, number>;
1132
1182
  }[];
1133
1183
  }
1134
1184
 
1135
1185
  declare function createIkiMcpServer(): McpServer;
1136
1186
 
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 };
1187
+ 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 NodReport, type PartSummary, type RenderPosesInput, type RenderPosesResult, type RequestedPose, type RequestedSweep, SWEEP_PRESETS, type StandardParameterInfo, type SweepManifest, type SweepPreset, type SweepReport, type TurnImageMeasure, type TurnMeasurement, type ValidateResult, autoRigFromLayers, checkModelFolds, checkNod, checkSweep, composeLayersFromParts, createIkiMcpServer, describeIki, describeIkiAt, describeRigPlan, formatFoldReport, formatMeasureReport, formatNodReport, formatPhysicsReport, formatRigPlanReport, formatSweepReport, formatTurnReport, listStandardParameters, measureLayers, measureTurnReference, renderPoses, validateIki };
package/dist/index.d.ts CHANGED
@@ -953,9 +953,47 @@ type SweepReport = {
953
953
  preset: "turn";
954
954
  unavailable: string;
955
955
  };
956
+ /** A pair gap or a width, face widths: the range along the nod at each turn. */
957
+ interface NodRange {
958
+ id: "eyes" | "irises" | "mouth";
959
+ range: {
960
+ m30: number;
961
+ zero: number;
962
+ p30: number;
963
+ };
964
+ }
965
+ /** The additivity residual of a landmark at the four corners; first letter AngleX, second AngleY. */
966
+ interface CornerResidual {
967
+ id: string;
968
+ residual: {
969
+ mm: number;
970
+ mp: number;
971
+ pm: number;
972
+ pp: number;
973
+ };
974
+ }
975
+ type NodReport = {
976
+ unit: "fw";
977
+ faceWidth: number;
978
+ nod: NodRange[];
979
+ corner: CornerResidual[];
980
+ } | {
981
+ unavailable: string;
982
+ };
983
+ /**
984
+ * The nod at three turns: `ParamAngleY` −30 … +30 in 1° steps at `ParamAngleX`
985
+ * −30, 0 and +30, no physics. `nod` is how far a pair gap (or the mouth's
986
+ * width) moves along each ladder; `corner` is the AngleX × AngleY additivity
987
+ * residual per landmark, the rest term included, so a rig whose parts add the
988
+ * turn and the nod reads 0. Both are read against each other and against the
989
+ * corpus's zeros, never against a bound.
990
+ */
991
+ declare function checkNod(model: IkiModel): NodReport;
956
992
  declare function checkSweep(model: IkiModel): SweepReport;
957
993
  /** One `SWEEP` line per landmark and one for the plate, or the one `unavailable` line. */
958
994
  declare function formatSweepReport(report: SweepReport): string[];
995
+ /** The `SWEEP nod` and `SWEEP corner` lines, or the one `unavailable` line. */
996
+ declare function formatNodReport(report: NodReport): string[];
959
997
 
960
998
  /**
961
999
  * The pose plan `render_poses` captures: the canvas framing, the crops and the
@@ -998,6 +1036,8 @@ interface RenderPlan {
998
1036
  poses: RenderPose[];
999
1037
  /** The sweep's fixed framing; absent when no sweep was asked for. */
1000
1038
  sweepCrop?: RenderCrop;
1039
+ /** The same for each `sweeps` entry, aligned with it; absent without `sweeps`. */
1040
+ sweepsCrops?: (RenderCrop | undefined)[];
1001
1041
  }
1002
1042
  /** A pose the caller names, rendered in place of the model's own set. */
1003
1043
  interface RequestedPose {
@@ -1021,6 +1061,22 @@ interface RenderPosesInput {
1021
1061
  poses?: RequestedPose[];
1022
1062
  /** A turn sweep rendered in addition to the poses, into `<outDir>/<name>/`. */
1023
1063
  sweep?: RequestedSweep;
1064
+ /** More sweeps, rendered after `sweep`, each into its own `<outDir>/<name>/`. */
1065
+ sweeps?: RequestedSweep[];
1066
+ }
1067
+ interface SweepOutput {
1068
+ name: string;
1069
+ preset: SweepPreset;
1070
+ dir: string;
1071
+ fps: number;
1072
+ frames: number;
1073
+ manifest: string;
1074
+ sheet: string;
1075
+ /** Absent for a preset without one (`turn-nod`). */
1076
+ kymograph?: string;
1077
+ flipbook: string;
1078
+ report: SweepReport;
1079
+ nod: NodReport;
1024
1080
  }
1025
1081
  type RenderPosesResult = {
1026
1082
  ok: true;
@@ -1046,18 +1102,10 @@ type RenderPosesResult = {
1046
1102
  physics: PhysicsReport;
1047
1103
  /** Present whenever `sweep` was asked for; absent only from a server
1048
1104
  * 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
- };
1105
+ sweep?: SweepOutput;
1106
+ /** In request order; present whenever `sweeps` was asked for, absent
1107
+ * from a server before 0.32.0, which strips the input. */
1108
+ sweeps?: SweepOutput[];
1061
1109
  } | {
1062
1110
  ok: false;
1063
1111
  error: string;
@@ -1070,19 +1118,22 @@ type RenderPosesResult = {
1070
1118
  declare function renderPoses(input: RenderPosesInput): Promise<RenderPosesResult>;
1071
1119
 
1072
1120
  /**
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
1121
+ * The sweeps `render_poses` renders on request: an eased ±30 `ParamAngleX`
1122
+ * turn, or the `turn-nod` box through every `ParamAngleX` × `ParamAngleY`
1123
+ * stop, with the hair physics running. This file is their pure pieces — the
1124
+ * schedules, the sheet picks, the kymograph row, the flipbook template and the
1076
1125
  * output directory — all decided in Node; the page only draws what the
1077
1126
  * {@link SweepSpec} says. The page script imports this file for TYPES only (it
1078
1127
  * is bundled as a browser IIFE and must never pull in `node:fs`).
1079
1128
  */
1080
1129
 
1130
+ declare const SWEEP_PRESETS: readonly ["turn", "turn-nod"];
1131
+ type SweepPreset = (typeof SWEEP_PRESETS)[number];
1081
1132
  /** What the caller asks for. */
1082
1133
  interface RequestedSweep {
1083
1134
  /** Becomes the directory `<outDir>/<name>/`. */
1084
1135
  name: string;
1085
- preset: "turn";
1136
+ preset: SweepPreset;
1086
1137
  /** Model px from the top-left, as a pose's crop; absent = the standard shot. */
1087
1138
  crop?: {
1088
1139
  x: number;
@@ -1093,9 +1144,9 @@ interface RequestedSweep {
1093
1144
  }
1094
1145
  /** `manifest.json`. */
1095
1146
  interface SweepManifest {
1096
- version: 1;
1097
- preset: "turn";
1098
- parameter: string;
1147
+ version: 2;
1148
+ preset: SweepPreset;
1149
+ parameters: string[];
1099
1150
  fps: number;
1100
1151
  clockHz: number;
1101
1152
  warmupS: number;
@@ -1113,7 +1164,7 @@ interface SweepManifest {
1113
1164
  kymographRow: {
1114
1165
  row: number;
1115
1166
  at: "eye row" | "middle";
1116
- };
1167
+ } | null;
1117
1168
  sheet: {
1118
1169
  frames: number[];
1119
1170
  cell: {
@@ -1126,12 +1177,11 @@ interface SweepManifest {
1126
1177
  i: number;
1127
1178
  file: string;
1128
1179
  t: number;
1129
- theta: number;
1130
- /** The effective `parameter` and every physics output, read off the player after step 2i. */
1180
+ /** Every scripted id and every physics output, read off the player after step 2i. */
1131
1181
  values: Record<string, number>;
1132
1182
  }[];
1133
1183
  }
1134
1184
 
1135
1185
  declare function createIkiMcpServer(): McpServer;
1136
1186
 
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 };
1187
+ 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 NodReport, type PartSummary, type RenderPosesInput, type RenderPosesResult, type RequestedPose, type RequestedSweep, SWEEP_PRESETS, type StandardParameterInfo, type SweepManifest, type SweepPreset, type SweepReport, type TurnImageMeasure, type TurnMeasurement, type ValidateResult, autoRigFromLayers, checkModelFolds, checkNod, checkSweep, composeLayersFromParts, createIkiMcpServer, describeIki, describeIkiAt, describeRigPlan, formatFoldReport, formatMeasureReport, formatNodReport, formatPhysicsReport, formatRigPlanReport, formatSweepReport, formatTurnReport, listStandardParameters, measureLayers, measureTurnReference, renderPoses, validateIki };