ue-mcp-tripo 0.2.4 → 0.2.6

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 CHANGED
@@ -6,7 +6,7 @@ The plugin pins an exact tripo-cli version as a dependency and runs it from its
6
6
 
7
7
  ## Requirements
8
8
 
9
- - ue-mcp 1.4.16-beta.11 or later
9
+ - ue-mcp 1.4.16-beta.13 or later
10
10
  - A Tripo account with credits
11
11
 
12
12
  ## Install
@@ -50,7 +50,7 @@ tripo make "a stylized knight in plate armor" --for anim
50
50
 
51
51
  Defaults are the cheapest the CLI can price: model H3.1, GLB output and no PBR (`pbr=true` turns it on), the same as Tripo's own guidance. The plugin deliberately does not follow the Tripo skill's rule of defaulting to P2. A premium model, `texture_quality=detailed` or `geometry_quality=detailed` is used only when you pass it through `model` or `params`. GLB is the default because the FBX conversion produced tiny scale and cracked meshes that the same task as GLB did not have.
52
52
 
53
- The result lists the settings used and the credit estimate (generation only; rig, retarget, texture and convert steps are billed on top), the Tripo task ids and the credits spent. The raw GLB and `preview.png` are saved to the job folder with `tripo task get --download`, and the result gives their paths and when Tripo's download links expire. If the import cannot run, for example when ue-mcp does not give the plugin access to `asset(import_model)`, the call still succeeds with `status=generated` and the ready `asset(action="import_model", ...)` call to make next.
53
+ The result lists the settings used, the credit estimate, the Tripo task ids and the credits spent. `creditEstimate.credits` is the total for every step the job runs: generation as the CLI prices it, and smartsegment, rig, retarget, texture and convert at Tripo's [list prices](https://developers.tripo3d.com/en/pricing). `creditEstimate.steps` gives each step's price, and a step without a known price (such as `decimate`) appears there as `{ step, credits: null, unpriced: true }`, which makes the total a minimum, as the message says. For example, a rigged, segmented character from a turnaround with the `humanoid` loadout costs 120 credits: 40 for generation, 55 for smartsegment and 25 for the rig. The finished result's `creditsBreakdown` lists every task that was billed, with its step and the estimate for that step beside what it cost. The raw GLB and `preview.png` are saved to the job folder with `tripo task get --download`, and the result gives their paths and when Tripo's download links expire. If the import cannot run, for example when ue-mcp does not give the plugin access to `asset(import_model)`, the call still succeeds with `status=generated` and the ready `asset(action="import_model", ...)` call to make next.
54
54
 
55
55
  | Option | Effect |
56
56
  |---|---|
@@ -60,7 +60,7 @@ The result lists the settings used and the credit estimate (generation only; rig
60
60
  | `animation` | One preset animation, such as `walk`. |
61
61
  | `format=fbx` | Adds `convert:fbx` as the last step. The default is `glb`. |
62
62
  | `params`, `model`, `then` | Extra `-p key=value` pairs, a generation model, or a replacement `--then` chain. |
63
- | `dryRun=true` | Returns the settings and the credit estimate without spending anything. |
63
+ | `dryRun=true` | Returns the settings and the job's total credit estimate without spending anything. |
64
64
  | `prepareImages=false` | Sends multiview images as they are instead of preparing them. |
65
65
  | `place`, `location`, `destination`, `name`, ... | Passed to `asset(import_model)`. |
66
66
 
@@ -96,7 +96,20 @@ Fields: `model`, `rig`, `rigType`, `spec`, `animation`, `pbr`, `format`, `segmen
96
96
 
97
97
  ### Separating garments
98
98
 
99
- `segmentHint="poncho, body"` (also a loadout field) separates parts that generation fused. make's `--then` chain has no smartsegment step, so after generating, the plugin runs `tripo mesh smartsegment` on the raw GLB with the hint, then rigs the segmented model with the usual chain. Plain `mesh segment` fused a poncho that smartsegment separated. It costs 55 credits at list price on top of the estimate (the dry run says so), is off by default, and cannot be combined with `task` or `then`. The result's `segmentation` block has the hint, task id and credits. Tripo rescales a file it re-imports for rigging; the result warns with the factor when it is not 1. If a stage fails, the call still succeeds with the model it has and a warning.
99
+ `segmentHint="poncho, body"` (also a loadout field) separates parts that generation fused. make's `--then` chain has no smartsegment step, so after generating, the plugin runs `tripo mesh smartsegment` on the raw GLB with the hint, then rigs the segmented model with the usual chain. Plain `mesh segment` fused a poncho that smartsegment separated. It costs 55 credits at list price, which the estimate includes along with the rig of the segmented model. It is off by default, and cannot be combined with `task` or `then`. The result's `segmentation` block has the hint, task id, credits and smartsegment's part labels (`labels`). The result's `parts` lists each part of the imported model as `{ node, label, material, bounds, verts, tris }`, with bounds in meters on glTF axes (Y up). Tripo names the parts `tripo_part_0` onwards and keeps those names and their order through the rig. smartsegment does not say which label belongs to which part, and in real jobs the label order differed from the part order, so the plugin leaves the nodes named as they are and sets each `label` to null. Match labels to parts by their bounds, and find a part's Unreal section by its material. Tripo rescales a file it re-imports for rigging; the result warns with the factor when it is not 1. If a stage fails, the call still succeeds with the model it has and a warning.
100
+
101
+ ### Garments as cloth
102
+
103
+ Generated garments are often double-walled, and two walls simulate as two sheets that balloon and clip. The plugin's agent guidance walks through simulating a single-layer sheet in the garment's place with core ue-mcp actions:
104
+
105
+ 1. Generate with `segmentHint` so the garment is its own section.
106
+ 2. Check its skin weight shares with `asset(read_skeletal_mesh_weight_report)` and move weight off the arms with `asset(restrict_skeletal_mesh_influences)`.
107
+ 3. Check penetration with `asset(measure_section_penetration)` and push the garment out with `asset(offset_section_outward)`.
108
+ 4. Check the collision bodies with `animation(check_physics_asset_fit)`.
109
+ 5. Measure the double walls with `asset(measure_section_layers)`.
110
+ 6. Build the sheet with `asset(build_garment_proxy_section)`. A sheet below its quality thresholds is refused without writing anything, and the result carries the report saying which check failed.
111
+ 7. Create clothing from the sheet with `asset(create_clothing_from_section)` and `removeFromMesh=true`.
112
+ 8. Bind that clothing to the render garment's section with `asset(bind_cloth_to_section)`, so the sheet drives the thick garment.
100
113
 
101
114
  ### Turnaround images
102
115
 
@@ -0,0 +1,55 @@
1
+ export interface GlbPart {
2
+ /** The node's name, e.g. tripo_part_3. */
3
+ node: string;
4
+ /** The material of the node's first primitive; Unreal names the mesh section after it. */
5
+ material?: string;
6
+ /** Model-space bounds in meters, glTF axes (Y up). */
7
+ bounds: {
8
+ min: [number, number, number];
9
+ max: [number, number, number];
10
+ };
11
+ verts: number;
12
+ tris: number;
13
+ }
14
+ interface GltfNode {
15
+ name?: string;
16
+ mesh?: number;
17
+ skin?: number;
18
+ children?: number[];
19
+ matrix?: number[];
20
+ translation?: number[];
21
+ rotation?: number[];
22
+ scale?: number[];
23
+ }
24
+ interface Gltf {
25
+ scenes?: Array<{
26
+ nodes?: number[];
27
+ }>;
28
+ scene?: number;
29
+ nodes?: GltfNode[];
30
+ meshes?: Array<{
31
+ name?: string;
32
+ primitives: Array<{
33
+ attributes: Record<string, number>;
34
+ indices?: number;
35
+ material?: number;
36
+ mode?: number;
37
+ }>;
38
+ }>;
39
+ accessors?: Array<{
40
+ count: number;
41
+ min?: number[];
42
+ max?: number[];
43
+ }>;
44
+ materials?: Array<{
45
+ name?: string;
46
+ }>;
47
+ }
48
+ /** The glTF JSON of a .glb file. */
49
+ export declare function readGltfJson(file: string): Gltf;
50
+ /**
51
+ * Every mesh node of the GLB's scene, in node order. A skinned node's own
52
+ * transform is ignored, as glTF specifies, so its bounds are the bind pose.
53
+ */
54
+ export declare function readGlbParts(file: string): GlbPart[];
55
+ export {};
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Reads the parts of a GLB: each node that carries a mesh, with its material,
3
+ * vertex and triangle counts and its bounds. Only the JSON chunk is read; the
4
+ * counts and bounds come from the accessors' count, min and max, which glTF
5
+ * requires on POSITION.
6
+ */
7
+ import { readFileSync } from "node:fs";
8
+ /** The glTF JSON of a .glb file. */
9
+ export function readGltfJson(file) {
10
+ const buf = readFileSync(file);
11
+ if (buf.length < 20 || buf.readUInt32LE(0) !== 0x46546c67)
12
+ throw new Error(`${file} is not a GLB`);
13
+ const len = buf.readUInt32LE(12);
14
+ if (buf.readUInt32LE(16) !== 0x4e4f534a)
15
+ throw new Error(`${file} has no JSON chunk first`);
16
+ return JSON.parse(buf.subarray(20, 20 + len).toString("utf8"));
17
+ }
18
+ const IDENTITY = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
19
+ /** Column-major 4x4 multiply, a * b. */
20
+ function mul(a, b) {
21
+ const o = new Array(16).fill(0);
22
+ for (let c = 0; c < 4; c++)
23
+ for (let r = 0; r < 4; r++)
24
+ for (let k = 0; k < 4; k++)
25
+ o[c * 4 + r] += a[k * 4 + r] * b[c * 4 + k];
26
+ return o;
27
+ }
28
+ function localMatrix(n) {
29
+ if (n.matrix?.length === 16)
30
+ return n.matrix;
31
+ const [tx, ty, tz] = n.translation ?? [0, 0, 0];
32
+ const [x, y, z, w] = n.rotation ?? [0, 0, 0, 1];
33
+ const [sx, sy, sz] = n.scale ?? [1, 1, 1];
34
+ return [
35
+ (1 - 2 * (y * y + z * z)) * sx, 2 * (x * y + z * w) * sx, 2 * (x * z - y * w) * sx, 0,
36
+ 2 * (x * y - z * w) * sy, (1 - 2 * (x * x + z * z)) * sy, 2 * (y * z + x * w) * sy, 0,
37
+ 2 * (x * z + y * w) * sz, 2 * (y * z - x * w) * sz, (1 - 2 * (x * x + y * y)) * sz, 0,
38
+ tx, ty, tz, 1,
39
+ ];
40
+ }
41
+ const round = (v) => Math.round(v * 1e4) / 1e4 + 0; // + 0 turns -0 into 0
42
+ function transformBox(m, min, max) {
43
+ const lo = [Infinity, Infinity, Infinity];
44
+ const hi = [-Infinity, -Infinity, -Infinity];
45
+ for (let i = 0; i < 8; i++) {
46
+ const p = [i & 1 ? max[0] : min[0], i & 2 ? max[1] : min[1], i & 4 ? max[2] : min[2]];
47
+ for (let r = 0; r < 3; r++) {
48
+ const v = m[r] * p[0] + m[4 + r] * p[1] + m[8 + r] * p[2] + m[12 + r];
49
+ lo[r] = Math.min(lo[r], v);
50
+ hi[r] = Math.max(hi[r], v);
51
+ }
52
+ }
53
+ return { min: lo.map(round), max: hi.map(round) };
54
+ }
55
+ /**
56
+ * Every mesh node of the GLB's scene, in node order. A skinned node's own
57
+ * transform is ignored, as glTF specifies, so its bounds are the bind pose.
58
+ */
59
+ export function readGlbParts(file) {
60
+ const j = readGltfJson(file);
61
+ const nodes = j.nodes ?? [];
62
+ const parts = [];
63
+ const roots = j.scenes?.[j.scene ?? 0]?.nodes ?? nodes.map((_, i) => i);
64
+ const world = new Map();
65
+ const walk = (i, parent) => {
66
+ const m = mul(parent, localMatrix(nodes[i]));
67
+ world.set(i, m);
68
+ for (const c of nodes[i].children ?? [])
69
+ walk(c, m);
70
+ };
71
+ for (const r of roots)
72
+ walk(r, IDENTITY);
73
+ nodes.forEach((n, i) => {
74
+ if (n.mesh == null || !world.has(i))
75
+ return;
76
+ const mesh = j.meshes?.[n.mesh];
77
+ if (!mesh)
78
+ return;
79
+ let verts = 0;
80
+ let tris = 0;
81
+ const lo = [Infinity, Infinity, Infinity];
82
+ const hi = [-Infinity, -Infinity, -Infinity];
83
+ for (const p of mesh.primitives) {
84
+ const pos = j.accessors?.[p.attributes.POSITION];
85
+ if (!pos)
86
+ continue;
87
+ verts += pos.count;
88
+ // Triangles only (mode 4, the default); other modes add no triangles.
89
+ if ((p.mode ?? 4) === 4)
90
+ tris += Math.floor((p.indices != null ? j.accessors?.[p.indices]?.count ?? 0 : pos.count) / 3);
91
+ for (let k = 0; k < 3; k++) {
92
+ lo[k] = Math.min(lo[k], pos.min?.[k] ?? Infinity);
93
+ hi[k] = Math.max(hi[k], pos.max?.[k] ?? -Infinity);
94
+ }
95
+ }
96
+ const matIndex = mesh.primitives[0]?.material;
97
+ parts.push({
98
+ node: n.name ?? mesh.name ?? `node_${i}`,
99
+ material: matIndex != null ? j.materials?.[matIndex]?.name : undefined,
100
+ bounds: transformBox(n.skin != null ? IDENTITY : world.get(i), lo, hi),
101
+ verts,
102
+ tris,
103
+ });
104
+ });
105
+ return parts;
106
+ }
107
+ //# sourceMappingURL=glb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glb.js","sourceRoot":"","sources":["../../src/shared/glb.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAmCvC,oCAAoC;AACpC,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,MAAM,GAAG,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAC/B,IAAI,GAAG,CAAC,MAAM,GAAG,EAAE,IAAI,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,UAAU;QAA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4
+ *
5
+ * The CLI prices the generation step itself (generation_credits_estimate in
6
+ * its dry run). Every other step is priced here from Tripo's published API
7
+ * price list (developers.tripo3d.com/en/pricing), which quotes yuan; one
8
+ * credit is 0.07 yuan there, the rate at which the CLI's own generation table
9
+ * matches that page (H3.1 text-to-model without texture: 0.70 yuan, 10
10
+ * credits). A step the list does not price, or prices by options this module
11
+ * does not read, is reported unpriced, and the total becomes a minimum.
12
+ */
13
+ export interface PricedStep {
14
+ /** The chain step name (rig, retarget, ...) or the generation task type. */
15
+ step: string;
16
+ /** The Tripo task type the step creates, as credits_breakdown names it. */
17
+ type?: string;
18
+ credits: number | null;
19
+ unpriced?: true;
20
+ /** Where the price comes from: the CLI's own estimate, Tripo's list, or a billed job. */
21
+ basis?: "cli" | "list" | "observed";
22
+ note?: string;
23
+ }
24
+ export interface CreditEstimate {
25
+ /** The sum of every priced step. */
26
+ credits: number;
27
+ /** True when a step has no known price, so the job costs at least `credits`. */
28
+ minimum: boolean;
29
+ steps: PricedStep[];
30
+ notes: string[];
31
+ scope: string;
32
+ }
33
+ export declare const ESTIMATE_SCOPE: string;
34
+ /** The chain step a task type belongs to, or the type itself for a generation task. */
35
+ export declare function stepOfType(type: string | undefined): string | undefined;
36
+ /** The list price of one chain step from its payload. */
37
+ export declare function priceStep(name: string, payload?: Record<string, unknown>): PricedStep;
38
+ /** Splits a --then chain the way the CLI does: a part with a known step name starts a step, a bare k=v continues it. */
39
+ export declare function parseChain(chain: string): Array<{
40
+ name: string;
41
+ payload: Record<string, unknown>;
42
+ }>;
43
+ /** Sums the steps into an estimate. */
44
+ export declare function totalOf(steps: PricedStep[], notes: string[]): CreditEstimate;
45
+ /** "120 credits (multiview_to_model 40, smartsegment 55, rig 25)", or "at least ..." with the unpriced steps named. */
46
+ export declare function describeEstimate(e: CreditEstimate): string;
47
+ /**
48
+ * credits_breakdown with each entry named by its step and set beside the
49
+ * estimate's price for that step, so actual and estimate can be compared.
50
+ */
51
+ export declare function annotateBreakdown(breakdown: Array<Record<string, unknown>>, estimate: CreditEstimate | undefined): Array<Record<string, unknown>>;
@@ -0,0 +1,153 @@
1
+ /**
2
+ * Credit prices for every step a generate job runs, so the estimate is the
3
+ * job's total and not only its generation step.
4
+ *
5
+ * The CLI prices the generation step itself (generation_credits_estimate in
6
+ * its dry run). Every other step is priced here from Tripo's published API
7
+ * price list (developers.tripo3d.com/en/pricing), which quotes yuan; one
8
+ * credit is 0.07 yuan there, the rate at which the CLI's own generation table
9
+ * matches that page (H3.1 text-to-model without texture: 0.70 yuan, 10
10
+ * credits). A step the list does not price, or prices by options this module
11
+ * does not read, is reported unpriced, and the total becomes a minimum.
12
+ */
13
+ export const ESTIMATE_SCOPE = "The estimate is the total of every step the job runs, at Tripo's list prices: generation as the CLI prices it, " +
14
+ "then segmentation, rig, retarget, texture and convert. A step with no published price is listed with credits null " +
15
+ "and unpriced true, and then the total is a minimum.";
16
+ /** The task type each chain step creates. */
17
+ const STEP_TYPE = {
18
+ texture: "texture_model",
19
+ convert: "convert_model",
20
+ import: "import_model",
21
+ "rig-check": "animate_prerigcheck",
22
+ rig: "animate_rig",
23
+ retarget: "animate_retarget",
24
+ segment: "mesh_segmentation",
25
+ complete: "mesh_completion",
26
+ decimate: "highpoly_to_lowpoly",
27
+ uv: "mesh_uv",
28
+ edit: "mesh_edit",
29
+ smartsegment: "smartsegment_model",
30
+ };
31
+ const ALIASES = { check: "rig-check", rigcheck: "rig-check", animate: "retarget", lowpoly: "decimate" };
32
+ /** The chain step a task type belongs to, or the type itself for a generation task. */
33
+ export function stepOfType(type) {
34
+ if (!type)
35
+ return undefined;
36
+ if (type.startsWith("smartsegment_"))
37
+ return "smartsegment";
38
+ return Object.keys(STEP_TYPE).find((k) => STEP_TYPE[k] === type) ?? type;
39
+ }
40
+ /**
41
+ * The convert options that bill the advanced tier (the price list, mirrored by
42
+ * the CLI): any face limit, or a non-default value of one of these.
43
+ */
44
+ const ADVANCED_CONVERT_DEFAULTS = {
45
+ quad: false,
46
+ flatten_bottom: false,
47
+ flatten_bottom_threshold: 0.01,
48
+ texture_size: 4096,
49
+ texture_format: "JPEG",
50
+ pivot_to_center_bottom: false,
51
+ scale_factor: 1,
52
+ };
53
+ function advancedConvert(p) {
54
+ return p.face_limit !== undefined || p.quadface_limit !== undefined ||
55
+ Object.entries(ADVANCED_CONVERT_DEFAULTS).some(([k, d]) => p[k] !== undefined && String(p[k]).toUpperCase() !== String(d).toUpperCase());
56
+ }
57
+ const unpriced = (step, note) => ({ step, type: STEP_TYPE[step], credits: null, unpriced: true, note });
58
+ /** The list price of one chain step from its payload. */
59
+ export function priceStep(name, payload = {}) {
60
+ const step = ALIASES[name] ?? name;
61
+ const list = (credits, note) => ({ step, type: STEP_TYPE[step], credits, basis: "list", ...(note ? { note } : {}) });
62
+ switch (step) {
63
+ case "rig-check":
64
+ return list(0);
65
+ case "rig":
66
+ return list(25);
67
+ case "retarget": {
68
+ const n = Array.isArray(payload.animations) ? payload.animations.length : 1;
69
+ return list(10 * n, n > 1 ? `${n} animations at 10 each` : undefined);
70
+ }
71
+ case "texture": {
72
+ const q = String(payload.texture_quality ?? "standard");
73
+ const credits = q === "extreme" ? 30 : q === "detailed" ? 20 : 10;
74
+ return list(credits, payload.pbr === true ? "The list prices the texture step by quality only; PBR has no separate price on it." : undefined);
75
+ }
76
+ case "convert":
77
+ return advancedConvert(payload) ? list(10, "non-default convert options bill the advanced tier") : list(5);
78
+ case "segment":
79
+ return list(40);
80
+ case "uv":
81
+ return list(20);
82
+ case "smartsegment":
83
+ return payload.seg_type === "image"
84
+ ? { ...list(85), type: "smartsegment_image" }
85
+ : list(55);
86
+ case "import":
87
+ // Not on the price list. A rigged, segmented job billed 40 + 55 + 25 with
88
+ // the segmented file's import in it, so the import itself cost nothing.
89
+ return { step, type: STEP_TYPE.import, credits: 0, basis: "observed", note: "not on the price list; billed 0 in observed jobs" };
90
+ case "decimate":
91
+ return unpriced(step, "priced by retopology version and face type, which the plugin does not read");
92
+ case "complete":
93
+ return unpriced(step, "priced by completion mode, which the plugin does not read");
94
+ default:
95
+ return unpriced(step, "no published price");
96
+ }
97
+ }
98
+ /** Splits a --then chain the way the CLI does: a part with a known step name starts a step, a bare k=v continues it. */
99
+ export function parseChain(chain) {
100
+ const out = [];
101
+ for (const part of chain.split(",").map((p) => p.trim()).filter(Boolean)) {
102
+ const [head, ...rest] = part.split(":");
103
+ const name = ALIASES[head.trim().toLowerCase()] ?? head.trim().toLowerCase();
104
+ const known = name in STEP_TYPE;
105
+ if (!known && part.includes("=") && out.length) {
106
+ assign(out[out.length - 1].payload, part);
107
+ continue;
108
+ }
109
+ const payload = {};
110
+ for (const token of rest.join(":").split(/[,;]/).map((t) => t.trim()).filter(Boolean)) {
111
+ if (token.includes("="))
112
+ assign(payload, token);
113
+ else if (name === "convert")
114
+ payload.format = token;
115
+ else if (name === "retarget")
116
+ payload.animation = token;
117
+ }
118
+ out.push({ name, payload });
119
+ }
120
+ return out;
121
+ }
122
+ function assign(payload, token) {
123
+ const eq = token.indexOf("=");
124
+ const raw = token.slice(eq + 1).trim();
125
+ payload[token.slice(0, eq).trim()] = raw === "true" ? true : raw === "false" ? false : /^-?\d+(\.\d+)?$/.test(raw) ? Number(raw) : raw;
126
+ }
127
+ /** Sums the steps into an estimate. */
128
+ export function totalOf(steps, notes) {
129
+ const credits = steps.reduce((sum, s) => sum + (s.credits ?? 0), 0);
130
+ return { credits, minimum: steps.some((s) => s.unpriced), steps, notes, scope: ESTIMATE_SCOPE };
131
+ }
132
+ /** "120 credits (multiview_to_model 40, smartsegment 55, rig 25)", or "at least ..." with the unpriced steps named. */
133
+ export function describeEstimate(e) {
134
+ const parts = e.steps.filter((s) => s.credits !== 0).map((s) => `${s.step} ${s.credits ?? "unpriced"}`).join(", ");
135
+ const missing = e.steps.filter((s) => s.unpriced).map((s) => s.step);
136
+ return e.minimum
137
+ ? `at least ${e.credits} credits (${parts}); ${missing.join(" and ")} ${missing.length > 1 ? "have" : "has"} no known price, so the total is a minimum`
138
+ : `${e.credits} credits (${parts})`;
139
+ }
140
+ /**
141
+ * credits_breakdown with each entry named by its step and set beside the
142
+ * estimate's price for that step, so actual and estimate can be compared.
143
+ */
144
+ export function annotateBreakdown(breakdown, estimate) {
145
+ const left = [...(estimate?.steps ?? [])];
146
+ return breakdown.map((b) => {
147
+ const type = b.type;
148
+ const i = left.findIndex((s) => s.type === type);
149
+ const match = i >= 0 ? left.splice(i, 1)[0] : undefined;
150
+ return { ...b, step: match?.step ?? stepOfType(type), ...(estimate ? { estimated: match ? match.credits : null } : {}) };
151
+ });
152
+ }
153
+ //# sourceMappingURL=pricing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pricing.js","sourceRoot":"","sources":["../../src/shared/pricing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAwBH,MAAM,CAAC,MAAM,cAAc,GACzB,iHAAiH;IACjH,oHAAoH;IACpH,qDAAqD,CAAC;AAExD,6CAA6C;AAC7C,MAAM,SAAS,GAA2B;IACxC,OAAO,EAAE,eAAe;IACxB,OAAO,EAAE,eAAe;IACxB,MAAM,EAAE,cAAc;IACtB,WAAW,EAAE,qBAAqB;IAClC,GAAG,EAAE,aAAa;IAClB,QAAQ,EAAE,kBAAkB;IAC5B,OAAO,EAAE,mBAAmB;IAC5B,QAAQ,EAAE,iBAAiB;IAC3B,QAAQ,EAAE,qBAAqB;IAC/B,EAAE,EAAE,SAAS;IACb,IAAI,EAAE,WAAW;IACjB,YAAY,EAAE,oBAAoB;CACnC,CAAC;AAEF,MAAM,OAAO,GAA2B,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AAEhI,uFAAuF;AACvF,MAAM,UAAU,UAAU,CAAC,IAAwB;IACjD,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5B,IAAI,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC;QAAE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ditEstimate } from "../shared/pricing.js";
2
3
  /**
3
4
  * The generation model when the caller names none. H3.1 is the cheapest model
4
5
  * the CLI can price (its dry run estimates it), and no --for scenario is used
@@ -53,6 +54,18 @@ interface Options {
53
54
  faceLimit?: number;
54
55
  textureQuality?: string;
55
56
  }
57
+ interface PlanSummary {
58
+ model?: string;
59
+ steps: Array<{
60
+ name: string;
61
+ task_type?: string;
62
+ payload: Record<string, unknown>;
63
+ }>;
64
+ /** The CLI's estimate for the generation step alone. */
65
+ creditEstimate: number | null;
66
+ notes: string[];
67
+ warnings: string[];
68
+ }
56
69
  export declare function sanitizeAssetName(raw: string): string;
57
70
  /** "walk" -> "preset:walk"; anything already prefixed passes through. */
58
71
  export declare function presetName(name: string): string;
@@ -78,6 +91,22 @@ export declare function linkExpiry(output: unknown, now?: number): {
78
91
  expiresAt: string;
79
92
  fromApi: boolean;
80
93
  };
94
+ /**
95
+ * Every step the job runs, priced: the CLI's plan (generation, then its
96
+ * chain), and with segmentHint the smartsegment task and the second make that
97
+ * imports the segmented file and runs the rig chain on it.
98
+ */
99
+ export declare function estimateFor(o: Options, plan: PlanSummary): CreditEstimate;
100
+ /** smartsegment's comma-separated labels as a list, or undefined when it returned none. */
101
+ export declare function labelsOf(prompt: unknown): string[] | undefined;
102
+ /**
103
+ * smartsegment returns its labels in one list and the parts as GLB nodes
104
+ * named tripo_part_N, with nothing that ties one to the other. In real jobs
105
+ * the node order differed from the label order (for "hair, head, shirt, arms,
106
+ * hands, leggings, feet", tripo_part_2 was the feet and tripo_part_4 the
107
+ * shirt), so the plugin does not rename nodes or guess a label per part.
108
+ */
109
+ export declare const LABEL_ORDER_NOTE: string;
81
110
  /** The asset(import_model) call that imports a file, ready to run. */
82
111
  export declare function importCallFor(params: Record<string, unknown>): string;
83
112
  export default class Generate extends UeMcpTask<Options> {
@@ -93,6 +122,8 @@ export default class Generate extends UeMcpTask<Options> {
93
122
  * so a failure here returns what exists instead of throwing.
94
123
  */
95
124
  private segmentStage;
125
+ /** smartsegment's part labels (its output.prompt), or undefined when task get cannot say. */
126
+ private segmentLabels;
96
127
  /** `tripo task get <id> --download` into dir. Never throws: the run already succeeded. */
97
128
  private saveRaw;
98
129
  }
@@ -13,6 +13,8 @@ import { UeMcpTask } from "ue-mcp/task";
13
13
  import { isAlive, parseJsonLine, runCli, startDetached, stripAnsi, tail, withAddedFlags, workDir, } from "../shared/cli.js";
14
14
  import { configOf, loadoutsFrom, resolveOptions } from "../shared/loadouts.js";
15
15
  import { prepareViews, resolveViews, VIEW_KEYS } from "../shared/images.js";
16
+ import { readGlbParts } from "../shared/glb.js";
17
+ import { annotateBreakdown, describeEstimate, parseChain, priceStep, totalOf, } from "../shared/pricing.js";
16
18
  /**
17
19
  * The generation model when the caller names none. H3.1 is the cheapest model
18
20
  * the CLI can price (its dry run estimates it), and no --for scenario is used
@@ -207,16 +209,84 @@ function planSummary(plan) {
207
209
  const estimate = plan.generation_credits_estimate;
208
210
  return {
209
211
  model: plan.model,
210
- steps: steps.map((s) => ({ name: s.name, payload: s.payload })),
212
+ steps: steps.map((s) => ({ name: s.name, task_type: s.task_type, payload: s.payload })),
211
213
  creditEstimate: typeof estimate === "number" ? estimate : null,
212
- notes: [...(plan.cost_notes ?? [])],
214
+ // The CLI prices generation only and says so; this plugin prices the chain too.
215
+ notes: (plan.cost_notes ?? []).map((n) => n.replace("; chain steps not estimated", "")),
213
216
  warnings: [...(plan.warnings ?? [])],
214
217
  };
215
218
  }
219
+ /** Chain step names, as opposed to the generation step the CLI names by its task type. */
220
+ const CHAIN_STEPS = new Set(["texture", "convert", "rig-check", "rig", "retarget", "segment", "complete", "decimate", "uv", "edit", "smartsegment"]);
221
+ /**
222
+ * Every step the job runs, priced: the CLI's plan (generation, then its
223
+ * chain), and with segmentHint the smartsegment task and the second make that
224
+ * imports the segmented file and runs the rig chain on it.
225
+ */
226
+ export function estimateFor(o, plan) {
227
+ const steps = [];
228
+ for (const s of plan.steps) {
229
+ if (CHAIN_STEPS.has(s.name)) {
230
+ steps.push(priceStep(s.name, s.payload));
231
+ continue;
232
+ }
233
+ const type = s.task_type ?? s.name.replace(/-/g, "_");
234
+ if (type === "import_model")
235
+ steps.push(priceStep("import"));
236
+ else if (plan.creditEstimate != null)
237
+ steps.push({ step: type, type, credits: plan.creditEstimate, basis: "cli" });
238
+ else
239
+ steps.push({ step: type, type, credits: null, unpriced: true, note: "the CLI publishes no price for this model" });
240
+ }
241
+ const notes = [...plan.notes];
242
+ if (o.segmentHint) {
243
+ steps.push(priceStep("smartsegment", { seg_type: "model" }));
244
+ const after = parseChain(afterSegmentChain(o));
245
+ if (after.length)
246
+ steps.push(priceStep("import"), ...after.map((s) => priceStep(s.name, s.payload)));
247
+ notes.push(SEGMENT_COST_NOTE);
248
+ }
249
+ return totalOf(steps, notes);
250
+ }
216
251
  const SEGMENT_TIMEOUT_MS = 15 * 60_000;
217
252
  const RIG_TIMEOUT_MS = 20 * 60_000;
218
- const SEGMENT_COST_NOTE = "segmentHint adds a mesh smartsegment task on the generated GLB: 55 credits at list price, not in the estimate above, plus the rig steps.";
219
- const ESTIMATE_SCOPE = "The estimate covers the generation step at list price. Rig, retarget, texture and convert steps are billed on top and are not estimated.";
253
+ const SEGMENT_COST_NOTE = "segmentHint adds a mesh smartsegment task on the generated GLB (55 credits at list price), then rigs the segmented file; both are in the estimate.";
254
+ /** smartsegment's comma-separated labels as a list, or undefined when it returned none. */
255
+ export function labelsOf(prompt) {
256
+ if (typeof prompt !== "string")
257
+ return undefined;
258
+ const labels = prompt.split(",").map((s) => s.trim()).filter(Boolean);
259
+ return labels.length ? labels : undefined;
260
+ }
261
+ /**
262
+ * smartsegment returns its labels in one list and the parts as GLB nodes
263
+ * named tripo_part_N, with nothing that ties one to the other. In real jobs
264
+ * the node order differed from the label order (for "hair, head, shirt, arms,
265
+ * hands, leggings, feet", tripo_part_2 was the feet and tripo_part_4 the
266
+ * shirt), so the plugin does not rename nodes or guess a label per part.
267
+ */
268
+ export const LABEL_ORDER_NOTE = "smartsegment's labels are not in node order, so each part's label is null. Match a label to a part by its bounds " +
269
+ "(meters, glTF axes: Y up, the model faces +X) or by looking at it; the material names the Unreal section.";
270
+ /**
271
+ * The parts of the imported model: its GLB when the model is one (the rig
272
+ * keeps tripo_part_N and the part order), else the segmented GLB.
273
+ */
274
+ function partsOf(modelFile, segmentedGlb, warnings) {
275
+ const file = extname(modelFile).toLowerCase() === ".glb" ? modelFile : segmentedGlb;
276
+ try {
277
+ return readGlbParts(file).map((p) => ({ node: p.node, label: null, material: p.material, bounds: p.bounds, verts: p.verts, tris: p.tris }));
278
+ }
279
+ catch (e) {
280
+ warnings.push(`Could not read the parts of ${file}: ${e instanceof Error ? e.message : String(e)}`);
281
+ return undefined;
282
+ }
283
+ }
284
+ /** The estimate a job recorded, or for a job.json written before every step was priced, its generation estimate. */
285
+ function estimateOf(job) {
286
+ if (job.estimate)
287
+ return { ...job.estimate };
288
+ return job.plan ? { credits: job.plan.creditEstimate, notes: job.plan.notes, scope: "generation step only (recorded by an earlier version)" } : undefined;
289
+ }
220
290
  /** The settings a run uses, exactly as sent: the options that shape it plus the CLI's own request bodies. */
221
291
  function settingsOf(o, args, plan, from) {
222
292
  return {
@@ -333,17 +403,11 @@ export default class Generate extends UeMcpTask {
333
403
  const rawPlan = planRun.json;
334
404
  const havePlan = !!rawPlan && rawPlan.dry_run === true;
335
405
  const plan = havePlan ? planSummary(rawPlan) : undefined;
336
- if (plan && o.segmentHint)
337
- plan.notes.push(SEGMENT_COST_NOTE);
338
406
  warnings.push(...resolved.warnings);
339
407
  const settings = settingsOf(o, args, plan, { loadout: resolved.loadout, sources: resolved.sources });
340
408
  if (resolved.guidance)
341
409
  settings.loadoutGuidance = resolved.guidance;
342
- const estimate = {
343
- credits: plan?.creditEstimate ?? null,
344
- notes: plan?.notes ?? [],
345
- scope: ESTIMATE_SCOPE,
346
- };
410
+ const estimate = plan ? estimateFor(o, plan) : undefined;
347
411
  if (o.dryRun) {
348
412
  if (!havePlan)
349
413
  throw new Error(`tripo make --dry-run exited ${planRun.exitCode} without a plan.\n${tail(planRun.stderr)}`);
@@ -356,8 +420,8 @@ export default class Generate extends UeMcpTask {
356
420
  preparedImages: prepared,
357
421
  warnings,
358
422
  import: importOptions(o, name),
359
- message: `Nothing was spent. ${estimate.credits != null ? `Generation is estimated at ${estimate.credits} credits. ` : "The CLI cannot estimate this model. "}` +
360
- `${ESTIMATE_SCOPE} Run the same call without dryRun to generate.`,
423
+ message: `Nothing was spent. The whole job is estimated at ${describeEstimate(estimate)}, at Tripo's list prices. ` +
424
+ `Run the same call without dryRun to generate.`,
361
425
  };
362
426
  if (rawPlan.valid === false) {
363
427
  return { success: false, data, error: new Error(`The plan is not valid: ${rawPlan.errors?.join("; ")}`) };
@@ -373,7 +437,7 @@ export default class Generate extends UeMcpTask {
373
437
  const child = startDetached(args, { cwd: base, stdoutFile: join(jobDir, "make.json"), stderrFile: join(jobDir, "make.log") });
374
438
  const job = {
375
439
  name, args, cwd: base, pid: child.pid, startedAt: new Date().toISOString(), import: importOptions(o, name),
376
- plan, settings, prepared, warnings,
440
+ plan, estimate, settings, prepared, warnings,
377
441
  segment: o.segmentHint ? { hint: o.segmentHint, chain: afterSegmentChain(o), rig: o.rig !== false } : undefined,
378
442
  };
379
443
  writeFileSync(join(jobDir, "job.json"), JSON.stringify(job, null, 2));
@@ -404,7 +468,7 @@ export default class Generate extends UeMcpTask {
404
468
  pid: job.pid,
405
469
  taskIds: ids,
406
470
  settings: job.settings,
407
- creditEstimate: job.plan ? { credits: job.plan.creditEstimate, notes: job.plan.notes, scope: ESTIMATE_SCOPE } : undefined,
471
+ creditEstimate: estimateOf(job),
408
472
  preparedImages: job.prepared,
409
473
  resume: { action: "generate", resume: jobDir },
410
474
  message: `tripo make is still running and keeps going on its own. ` +
@@ -463,7 +527,13 @@ export default class Generate extends UeMcpTask {
463
527
  const raw = await this.saveRaw(String(taskIds[0] ?? result.task_id), taskIds.length > 1 ? join(jobDir, "source") : jobDir, job.cwd, warnings);
464
528
  const previewFile = raw.preview ?? (result.preview ? resolve(job.cwd, String(result.preview)) : undefined);
465
529
  let credits = result.credits_consumed;
466
- let creditsBreakdown = result.credits_breakdown;
530
+ // The CLI lists a breakdown only when more than one task billed; a single
531
+ // task still goes in, so the breakdown names every step that was paid for.
532
+ let creditsBreakdown = breakdown.length
533
+ ? breakdown
534
+ : typeof credits === "number"
535
+ ? [{ task_id: result.task_id, type: result.type, credits_consumed: credits }]
536
+ : [];
467
537
  let segmentation;
468
538
  if (job.segment) {
469
539
  const glb = raw.glb ?? (extname(modelFile).toLowerCase() === ".glb" ? modelFile : undefined);
@@ -477,10 +547,12 @@ export default class Generate extends UeMcpTask {
477
547
  }
478
548
  if (seg.credits) {
479
549
  credits = (credits ?? 0) + seg.credits;
480
- creditsBreakdown = [...(creditsBreakdown ?? []), ...seg.breakdown];
550
+ creditsBreakdown = [...creditsBreakdown, ...seg.breakdown];
481
551
  }
482
552
  }
553
+ const estimate = job.estimate;
483
554
  const files = { glb: raw.glb, preview: previewFile, modelFile, jobDir };
555
+ const parts = segmentation?.file ? partsOf(modelFile, String(segmentation.file), warnings) : undefined;
484
556
  const summary = {
485
557
  name: job.name,
486
558
  jobDir,
@@ -499,10 +571,11 @@ export default class Generate extends UeMcpTask {
499
571
  taskId: result.task_id,
500
572
  taskIds,
501
573
  credits,
502
- creditsBreakdown,
574
+ creditsBreakdown: annotateBreakdown(creditsBreakdown, estimate),
503
575
  segmentation,
576
+ parts,
504
577
  settings: job.settings,
505
- creditEstimate: job.plan ? { credits: job.plan.creditEstimate, notes: job.plan.notes, scope: ESTIMATE_SCOPE } : undefined,
578
+ creditEstimate: estimateOf(job),
506
579
  preparedImages: job.prepared,
507
580
  };
508
581
  // Credits are spent by now, so an import problem never throws: the files
@@ -566,8 +639,13 @@ export default class Generate extends UeMcpTask {
566
639
  (sj.model_file ? resolve(cwd, String(sj.model_file)) : undefined);
567
640
  const segCredits = Number(sj.credits_consumed ?? 0);
568
641
  const breakdown = [{ task_id: sj.task_id, type: sj.type ?? "smartsegment_model", credits_consumed: segCredits }];
642
+ // The labels are the task's output.prompt, which the smartsegment command's
643
+ // own result leaves out; task get returns it, free.
644
+ const prompt = typeof sj.prompt === "string" ? sj.prompt : await this.segmentLabels(String(sj.task_id), cwd);
569
645
  const segmentation = {
570
- status: "segmented", hint: seg.hint, taskId: sj.task_id, credits: segCredits, file: segGlb, prompt: sj.prompt,
646
+ status: "segmented", hint: seg.hint, taskId: sj.task_id, credits: segCredits, file: segGlb, prompt,
647
+ labels: labelsOf(prompt),
648
+ labelOrder: LABEL_ORDER_NOTE,
571
649
  };
572
650
  if (!segGlb) {
573
651
  warnings.push("mesh smartsegment succeeded but returned no GLB, so the unsegmented model is imported and the rig steps did not run.");
@@ -602,6 +680,17 @@ export default class Generate extends UeMcpTask {
602
680
  modelFile: resolve(cwd, String(mj.model_file)),
603
681
  };
604
682
  }
683
+ /** smartsegment's part labels (its output.prompt), or undefined when task get cannot say. */
684
+ async segmentLabels(taskId, cwd) {
685
+ try {
686
+ const r = await runCli(withAddedFlags(["task", "get", taskId]), { cwd, timeoutMs: 60_000 });
687
+ const out = r.json?.output;
688
+ return typeof out?.prompt === "string" ? out.prompt : undefined;
689
+ }
690
+ catch {
691
+ return undefined;
692
+ }
693
+ }
605
694
  /** `tripo task get <id> --download` into dir. Never throws: the run already succeeded. */
606
695
  async saveRaw(taskId, dir, cwd, warnings) {
607
696
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"Generate.js","sourceRoot":"","sources":["../../src/tasks/Generate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC3F,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzE,OAAO,EAAE,SAAS,EAAmB,MAAM,aAA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AAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,aAAa,CAAC;gBACvE,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC;aAClC,CAAC;QACJ,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,QAAQ,CAAC,IAAI,CAAC,eAAe,MAAM,oBAAoB,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACrG,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;CACF"}
@@ -174,7 +174,7 @@ Boolean requesting whether a visible border and background is provided by the ho
174
174
  - omitted: host decides border`)}),Fb=u.object({method:u.literal("ui/request-display-mode"),params:u.object({mode:Gt.describe("The display mode being requested.")})}),cb=u.object({mode:Gt.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),mb=u.union([u.literal("model"),u.literal("app")]).describe("Tool visibility scope - who can access the tool."),Wb=u.object({resourceUri:u.string().optional(),visibility:u.array(mb).optional().describe(`Who can access this tool. Default: ["model", "app"]
175
175
  - "model": Tool visible to and callable by the agent
176
176
  - "app": Tool callable by the app from this server only`),csp:u.never().optional(),permissions:u.never().optional()}),Kb=u.object({mimeTypes:u.array(u.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),Vb=u.object({method:u.literal("ui/download-file"),params:u.object({contents:u.array(u.union([tp,ip])).describe("Resource contents to download \u2014 embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),Bb=u.object({method:u.literal("ui/message"),params:u.object({role:u.literal("user").describe('Message role, currently only "user" is supported.'),content:u.array(ln).describe("Message content blocks (text, image, etc.).")})}),Gb=u.object({method:u.literal("ui/notifications/sandbox-resource-ready"),params:u.object({html:u.string().describe("HTML content to load into the inner iframe."),sandbox:u.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:vl.optional().describe("CSP configuration from resource metadata."),permissions:hl.optional().describe("Sandbox permissions from resource metadata.")})}),pb=u.object({method:u.literal("ui/notifications/tool-result"),params:qr.describe("Standard MCP tool execution result.")}),up=u.object({toolInfo:u.object({id:nn.optional().describe("JSON-RPC id of the tools/call request."),tool:gl.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:X$.optional().describe("Current color theme preference."),styles:sb.optional().describe("Style configuration for theming the app."),displayMode:Gt.optional().describe("How the UI is currently displayed."),availableDisplayModes:u.array(Gt).optional().describe("Display modes the host supports."),containerDimensions:u.union([u.object({height:u.number().describe("Fixed container height in pixels.")}),u.object({maxHeight:u.union([u.number(),u.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(u.union([u.object({width:u.number().describe("Fixed container width in pixels.")}),u.object({maxWidth:u.union([u.number(),u.undefined()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
177
- container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:u.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:u.string().optional().describe("User's timezone in IANA format."),userAgent:u.string().optional().describe("Host application identifier."),platform:u.union([u.literal("web"),u.literal("desktop"),u.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:u.object({touch:u.boolean().optional().describe("Whether the device supports touch input."),hover:u.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:u.object({top:u.number().describe("Top safe area inset in pixels."),right:u.number().describe("Right safe area inset in pixels."),bottom:u.number().describe("Bottom safe area inset in pixels."),left:u.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),fb=u.object({method:u.literal("ui/notifications/host-context-changed"),params:up.describe("Partial context update containing only changed fields.")}),Xb=u.object({method:u.literal("ui/update-model-context"),params:u.object({content:u.array(ln).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:u.record(u.string(),u.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),Yb=u.object({method:u.literal("ui/initialize"),params:u.object({appInfo:Mr.describe("App identification (name and version)."),appCapabilities:db.describe("Features and capabilities this app provides."),protocolVersion:u.string().describe("Protocol version this app supports.")})}),gb=u.object({protocolVersion:u.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Mr.describe("Host application identification and version."),hostCapabilities:lb.describe("Features and capabilities provided by the host."),hostContext:up.describe("Rich context about the host environment.")}).passthrough(),vb={target:"draft-2020-12"};async function Bl(e,i){let n=e["~standard"];if(n.jsonSchema)return n.jsonSchema[i](vb);if(n.vendor==="zod"){let{z:a}=await Promise.resolve().then(()=>(Rr(),qm));return a.toJSONSchema(e,{io:i})}throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function Gl(e,i,n=""){let a=await e["~standard"].validate(i);if(a.issues){let t=a.issues.map(r=>{let o=r.path?.map(s=>typeof s=="object"?s.key:s).join(".");return o?`${o}: ${r.message}`:r.message}).join("; ");throw Error(n+t)}return a.value}Rr();function lp(e){let i=document.documentElement;i.setAttribute("data-theme",e),i.style.colorScheme=e}function dp(e,i=document.documentElement){for(let[n,a]of Object.entries(e))a!==void 0&&i.style.setProperty(n,a)}function cp(e){if(document.getElementById("__mcp-host-fonts"))return;let i=document.createElement("style");i.id="__mcp-host-fonts",i.textContent=e,document.head.appendChild(i)}var Cn=class Cn extends ta{constructor(n,a={},t={autoResize:!0}){super(t);D(this,"_appInfo");D(this,"_capabilities");D(this,"options");D(this,"_hostCapabilities");D(this,"_hostInfo");D(this,"_hostContext");D(this,"_registeredTools",{});D(this,"_initializedSent",!1);D(this,"eventSchemas",{toolinput:nb,toolinputpartial:rb,toolresult:pb,toolcancelled:ab,hostcontextchanged:fb});D(this,"_everHadListener",new Set);D(this,"_toolHandlersInitialized",!1);D(this,"_onteardown");D(this,"_oncalltool");D(this,"_onlisttools");D(this,"sendOpenLink",this.openLink);this._appInfo=n,this._capabilities=a,this.options=t,t.allowUnsafeEval||u.config({jitless:!0}),this.setRequestHandler(Lr,r=>(console.log("Received ping:",r.params),{})),this.setEventHandler("hostcontextchanged",void 0)}_assertInitialized(n){if(this._initializedSent)return;let a=`[ext-apps] App.${n}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(a);console.warn(`${a}. This will throw in a future release.`)}_assertHandlerTiming(n){if(!Cn.ONE_SHOT_EVENTS.has(n)||this._everHadListener.has(n)||(this._everHadListener.add(n),!this._initializedSent))return;let a=`[ext-apps] "${String(n)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(a);console.warn(a)}setEventHandler(n,a){a&&this._assertHandlerTiming(n),super.setEventHandler(n,a)}addEventListener(n,a){this._assertHandlerTiming(n),super.addEventListener(n,a)}onEventDispatch(n,a){n==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...a})}registerCapabilities(n){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._capabilities=V$(this._capabilities,n)}registerTool(n,a,t){if(this._registeredTools[n])throw Error(`Tool ${n} is already registered`);let r=this,o=()=>{r._initializedSent&&r._capabilities.tools?.listChanged&&r.sendToolListChanged()},s=a.inputSchema!==void 0,l={title:a.title,description:a.description,inputSchema:a.inputSchema,outputSchema:a.outputSchema,annotations:a.annotations,_meta:a._meta,enabled:!0,enable(){this.enabled=!0,o()},disable(){this.enabled=!1,o()},update(d){Object.assign(this,d),o()},remove(){r._registeredTools[n]===l&&(delete r._registeredTools[n],o())},handler:async(d,c)=>{if(!l.enabled)throw Error(`Tool ${n} is disabled`);let f;if(s){let g=l.inputSchema,_=g?await Gl(g,d??{},`Invalid input for tool ${n}: `):d??{};f=await t(_,c)}else f=await t(c);return l.outputSchema&&!f.isError&&(f.structuredContent=await Gl(l.outputSchema,f.structuredContent,`Invalid output for tool ${n}: `)),f}};return this._registeredTools[n]=l,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),o(),l}ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(n,a)=>{let t=this._registeredTools[n.name];if(!t)throw Error(`Tool ${n.name} not found`);return t.handler(n.arguments,a)},this.onlisttools=async(n,a)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([t,r])=>r.enabled).map(async([t,r])=>{let o={name:t,title:r.title,description:r.description,inputSchema:r.inputSchema?await Bl(r.inputSchema,"input"):{type:"object",properties:{}}};return r.outputSchema&&(o.outputSchema=await Bl(r.outputSchema,"output")),r.annotations&&(o.annotations=r.annotations),r._meta&&(o._meta=r._meta),o}))}))}async sendToolListChanged(n={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:n})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(n){this.setEventHandler("toolinput",n)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(n){this.setEventHandler("toolinputpartial",n)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(n){this.setEventHandler("toolresult",n)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(n){this.setEventHandler("toolcancelled",n)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(n){this.setEventHandler("hostcontextchanged",n)}get onteardown(){return this._onteardown}set onteardown(n){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,n),this._onteardown=n,this.replaceRequestHandler(ub,(a,t)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(a.params,t)})}get oncalltool(){return this._oncalltool}set oncalltool(n){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,n),this._oncalltool=n,this.replaceRequestHandler(rp,(a,t)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(a.params,t)})}get onlisttools(){return this._onlisttools}set onlisttools(n){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,n),this._onlisttools=n,this.replaceRequestHandler(np,(a,t)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(a.params,t)})}assertCapabilityForMethod(n){switch(n){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${n})`);break}}assertRequestHandlerCapability(n){switch(n){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${n})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${n} registered`)}}assertNotificationCapability(n){}assertTaskCapability(n){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(n){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(n,a){if(this._assertInitialized("callServerTool"),typeof n=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${n}"). Did you mean: callServerTool({ name: "${n}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:n},qr,{onprogress:()=>{},resetTimeoutOnProgress:!0,...a})}async readServerResource(n,a){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:n},ep,a)}async listServerResources(n,a){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:n},Qm,a)}async createSamplingMessage(n,a){this._assertInitialized("createSamplingMessage");let t=n.tools?sp:op;return await this.request({method:"sampling/createMessage",params:n},t,a)}sendMessage(n,a){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:n},ib,a)}sendLog(n){return this.notification({method:"notifications/message",params:n})}updateModelContext(n,a){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:n},el,a)}openLink(n,a){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:n},eb,a)}downloadFile(n,a){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:n},tb,a)}requestTeardown(n={}){return this.notification({method:"ui/notifications/request-teardown",params:n})}requestDisplayMode(n,a){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:n},cb,a)}sendSizeChanged(n){return this.notification({method:"ui/notifications/size-changed",params:n})}setupSizeChangedNotifications(){let n=!1,a=0,t=0,r=()=>{n||(n=!0,requestAnimationFrame(()=>{n=!1;let s=document.documentElement,l=s.style.height;s.style.height="max-content";let d=Math.ceil(s.getBoundingClientRect().height);s.style.height=l;let c=Math.ceil(window.innerWidth);(c!==a||d!==t)&&(a=c,t=d,this.sendSizeChanged({width:c,height:d}))}))};r();let o=new ResizeObserver(r);return o.observe(document.documentElement),o.observe(document.body),()=>o.disconnect()}async connect(n=new ia(window.parent,window.parent),a){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1,await super.connect(n);try{let t=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:B$}},gb,a);if(t===void 0)throw Error(`Server sent invalid initialize result: ${t}`);this._hostCapabilities=t.hostCapabilities,this._hostInfo=t.hostInfo,this._hostContext=t.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(t){throw this.close(),t}}};D(Cn,"ONE_SHOT_EVENTS",new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]));var Rn=Cn;var hb="https://developers.tripo3d.ai/en/keys",$b="https://developers.tripo3d.com/zh/keys",K=e=>document.getElementById(e),Se=new Rn({name:"Tripo settings",version:"0.2.4"},{});async function dn(e,i={}){let n=await Se.callServerTool({name:`tripo_${e}`,arguments:i}),a=(n.content??[]).find(t=>t.type==="text")?.text??"";if(n.isError)throw new Error(a.replace(/^Error \[[A-Z_]+\]:\s*/,"")||"The call failed.");try{return JSON.parse(a)}catch{throw new Error(a||"The call returned nothing.")}}function Ee(e){for(let i of["save","clear","signin","region"])K(i).disabled=e;e||(K("clear").disabled=!$l||$l.key.source!=="store")}function he(e){let i=K("error");i.textContent=e??"",i.hidden=!e}var $l=null;function _l(e){$l=e;let i=K("account");if(e.signedIn){let n=[e.account??"Signed in"];e.region&&n.push(e.region==="cn"?"China mainland":"International"),typeof e.balance=="number"&&n.push(`${e.balance.toLocaleString()} credits`),i.textContent=n.join(" \xB7 "),i.dataset.state="ok"}else i.textContent="Not signed in. Save an API key or sign in with Tripo.",i.dataset.state="off";K("keystate").textContent=e.key.source==="env"?"Set by the TRIPO_API_KEY environment variable, which takes precedence over a saved key.":e.key.source==="store"?"A key is saved.":"No key is saved.",K("clear").disabled=e.key.source!=="store"}async function bl(){he(null);try{_l(await dn("auth_status"))}catch(e){he(e.message)}}async function bb(e){e.preventDefault();let i=K("apikey"),n=i.value.trim();if(!n){he("Enter an API key first.");return}Ee(!0),he(null);try{_l(await dn("set_key",{apiKey:n})),i.value=""}catch(a){he(a.message)}finally{Ee(!1)}}async function _b(){Ee(!0),he(null);try{_l(await dn("clear_key"))}catch(e){he(e.message)}finally{Ee(!1)}}var At=null;function mp(){At&&clearTimeout(At),At=null}async function yb(){mp(),Ee(!0),he(null);let e=K("region").value;try{let i=await dn("login_start",{region:e});if(!i.url){K("device").hidden=!0,await bl(),Ee(!1);return}K("code").textContent=i.code??"",K("open").onclick=()=>void Se.openLink({url:i.url}),K("device").hidden=!1,K("pollstate").textContent="Waiting for you to approve the code in your browser.",Se.openLink({url:i.url});let n=async()=>{let a;try{a=await dn("login_poll")}catch(t){a={state:"error",message:t.message}}if(a.state==="pending"){At=setTimeout(()=>void n(),i.pollAfterMs||5e3);return}At=null,Ee(!1),a.state==="done"?(K("device").hidden=!0,await bl()):(K("pollstate").textContent=a.state==="expired"?"The code expired. Sign in again for a new one.":"",a.state==="error"&&he(a.message??"Sign-in failed."))};At=setTimeout(()=>void n(),i.pollAfterMs||5e3)}catch(i){he(i.message),Ee(!1)}}function pp(e){e&&(e.theme&&lp(e.theme),e.styles?.variables&&dp(e.styles.variables),e.styles?.css?.fonts&&cp(e.styles.css.fonts))}Se.onhostcontextchanged=e=>pp({...Se.getHostContext(),...e});Se.onteardown=async()=>(mp(),{});K("keyform").addEventListener("submit",e=>void bb(e));K("clear").addEventListener("click",()=>void _b());K("signin").addEventListener("click",()=>void yb());K("getkey").addEventListener("click",e=>{e.preventDefault(),Se.openLink({url:K("region").value==="cn"?$b:hb})});Se.connect().then(()=>{pp(Se.getHostContext()),bl()}).catch(e=>he(`Could not reach the host: ${e.message}`));})();
177
+ container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:u.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:u.string().optional().describe("User's timezone in IANA format."),userAgent:u.string().optional().describe("Host application identifier."),platform:u.union([u.literal("web"),u.literal("desktop"),u.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:u.object({touch:u.boolean().optional().describe("Whether the device supports touch input."),hover:u.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:u.object({top:u.number().describe("Top safe area inset in pixels."),right:u.number().describe("Right safe area inset in pixels."),bottom:u.number().describe("Bottom safe area inset in pixels."),left:u.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),fb=u.object({method:u.literal("ui/notifications/host-context-changed"),params:up.describe("Partial context update containing only changed fields.")}),Xb=u.object({method:u.literal("ui/update-model-context"),params:u.object({content:u.array(ln).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:u.record(u.string(),u.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),Yb=u.object({method:u.literal("ui/initialize"),params:u.object({appInfo:Mr.describe("App identification (name and version)."),appCapabilities:db.describe("Features and capabilities this app provides."),protocolVersion:u.string().describe("Protocol version this app supports.")})}),gb=u.object({protocolVersion:u.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Mr.describe("Host application identification and version."),hostCapabilities:lb.describe("Features and capabilities provided by the host."),hostContext:up.describe("Rich context about the host environment.")}).passthrough(),vb={target:"draft-2020-12"};async function Bl(e,i){let n=e["~standard"];if(n.jsonSchema)return n.jsonSchema[i](vb);if(n.vendor==="zod"){let{z:a}=await Promise.resolve().then(()=>(Rr(),qm));return a.toJSONSchema(e,{io:i})}throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function Gl(e,i,n=""){let a=await e["~standard"].validate(i);if(a.issues){let t=a.issues.map(r=>{let o=r.path?.map(s=>typeof s=="object"?s.key:s).join(".");return o?`${o}: ${r.message}`:r.message}).join("; ");throw Error(n+t)}return a.value}Rr();function lp(e){let i=document.documentElement;i.setAttribute("data-theme",e),i.style.colorScheme=e}function dp(e,i=document.documentElement){for(let[n,a]of Object.entries(e))a!==void 0&&i.style.setProperty(n,a)}function cp(e){if(document.getElementById("__mcp-host-fonts"))return;let i=document.createElement("style");i.id="__mcp-host-fonts",i.textContent=e,document.head.appendChild(i)}var Cn=class Cn extends ta{constructor(n,a={},t={autoResize:!0}){super(t);D(this,"_appInfo");D(this,"_capabilities");D(this,"options");D(this,"_hostCapabilities");D(this,"_hostInfo");D(this,"_hostContext");D(this,"_registeredTools",{});D(this,"_initializedSent",!1);D(this,"eventSchemas",{toolinput:nb,toolinputpartial:rb,toolresult:pb,toolcancelled:ab,hostcontextchanged:fb});D(this,"_everHadListener",new Set);D(this,"_toolHandlersInitialized",!1);D(this,"_onteardown");D(this,"_oncalltool");D(this,"_onlisttools");D(this,"sendOpenLink",this.openLink);this._appInfo=n,this._capabilities=a,this.options=t,t.allowUnsafeEval||u.config({jitless:!0}),this.setRequestHandler(Lr,r=>(console.log("Received ping:",r.params),{})),this.setEventHandler("hostcontextchanged",void 0)}_assertInitialized(n){if(this._initializedSent)return;let a=`[ext-apps] App.${n}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(a);console.warn(`${a}. This will throw in a future release.`)}_assertHandlerTiming(n){if(!Cn.ONE_SHOT_EVENTS.has(n)||this._everHadListener.has(n)||(this._everHadListener.add(n),!this._initializedSent))return;let a=`[ext-apps] "${String(n)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(a);console.warn(a)}setEventHandler(n,a){a&&this._assertHandlerTiming(n),super.setEventHandler(n,a)}addEventListener(n,a){this._assertHandlerTiming(n),super.addEventListener(n,a)}onEventDispatch(n,a){n==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...a})}registerCapabilities(n){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._capabilities=V$(this._capabilities,n)}registerTool(n,a,t){if(this._registeredTools[n])throw Error(`Tool ${n} is already registered`);let r=this,o=()=>{r._initializedSent&&r._capabilities.tools?.listChanged&&r.sendToolListChanged()},s=a.inputSchema!==void 0,l={title:a.title,description:a.description,inputSchema:a.inputSchema,outputSchema:a.outputSchema,annotations:a.annotations,_meta:a._meta,enabled:!0,enable(){this.enabled=!0,o()},disable(){this.enabled=!1,o()},update(d){Object.assign(this,d),o()},remove(){r._registeredTools[n]===l&&(delete r._registeredTools[n],o())},handler:async(d,c)=>{if(!l.enabled)throw Error(`Tool ${n} is disabled`);let f;if(s){let g=l.inputSchema,_=g?await Gl(g,d??{},`Invalid input for tool ${n}: `):d??{};f=await t(_,c)}else f=await t(c);return l.outputSchema&&!f.isError&&(f.structuredContent=await Gl(l.outputSchema,f.structuredContent,`Invalid output for tool ${n}: `)),f}};return this._registeredTools[n]=l,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),o(),l}ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(n,a)=>{let t=this._registeredTools[n.name];if(!t)throw Error(`Tool ${n.name} not found`);return t.handler(n.arguments,a)},this.onlisttools=async(n,a)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([t,r])=>r.enabled).map(async([t,r])=>{let o={name:t,title:r.title,description:r.description,inputSchema:r.inputSchema?await Bl(r.inputSchema,"input"):{type:"object",properties:{}}};return r.outputSchema&&(o.outputSchema=await Bl(r.outputSchema,"output")),r.annotations&&(o.annotations=r.annotations),r._meta&&(o._meta=r._meta),o}))}))}async sendToolListChanged(n={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:n})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(n){this.setEventHandler("toolinput",n)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(n){this.setEventHandler("toolinputpartial",n)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(n){this.setEventHandler("toolresult",n)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(n){this.setEventHandler("toolcancelled",n)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(n){this.setEventHandler("hostcontextchanged",n)}get onteardown(){return this._onteardown}set onteardown(n){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,n),this._onteardown=n,this.replaceRequestHandler(ub,(a,t)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(a.params,t)})}get oncalltool(){return this._oncalltool}set oncalltool(n){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,n),this._oncalltool=n,this.replaceRequestHandler(rp,(a,t)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(a.params,t)})}get onlisttools(){return this._onlisttools}set onlisttools(n){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,n),this._onlisttools=n,this.replaceRequestHandler(np,(a,t)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(a.params,t)})}assertCapabilityForMethod(n){switch(n){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${n})`);break}}assertRequestHandlerCapability(n){switch(n){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${n})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${n} registered`)}}assertNotificationCapability(n){}assertTaskCapability(n){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(n){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(n,a){if(this._assertInitialized("callServerTool"),typeof n=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${n}"). Did you mean: callServerTool({ name: "${n}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:n},qr,{onprogress:()=>{},resetTimeoutOnProgress:!0,...a})}async readServerResource(n,a){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:n},ep,a)}async listServerResources(n,a){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:n},Qm,a)}async createSamplingMessage(n,a){this._assertInitialized("createSamplingMessage");let t=n.tools?sp:op;return await this.request({method:"sampling/createMessage",params:n},t,a)}sendMessage(n,a){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:n},ib,a)}sendLog(n){return this.notification({method:"notifications/message",params:n})}updateModelContext(n,a){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:n},el,a)}openLink(n,a){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:n},eb,a)}downloadFile(n,a){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:n},tb,a)}requestTeardown(n={}){return this.notification({method:"ui/notifications/request-teardown",params:n})}requestDisplayMode(n,a){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:n},cb,a)}sendSizeChanged(n){return this.notification({method:"ui/notifications/size-changed",params:n})}setupSizeChangedNotifications(){let n=!1,a=0,t=0,r=()=>{n||(n=!0,requestAnimationFrame(()=>{n=!1;let s=document.documentElement,l=s.style.height;s.style.height="max-content";let d=Math.ceil(s.getBoundingClientRect().height);s.style.height=l;let c=Math.ceil(window.innerWidth);(c!==a||d!==t)&&(a=c,t=d,this.sendSizeChanged({width:c,height:d}))}))};r();let o=new ResizeObserver(r);return o.observe(document.documentElement),o.observe(document.body),()=>o.disconnect()}async connect(n=new ia(window.parent,window.parent),a){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1,await super.connect(n);try{let t=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:B$}},gb,a);if(t===void 0)throw Error(`Server sent invalid initialize result: ${t}`);this._hostCapabilities=t.hostCapabilities,this._hostInfo=t.hostInfo,this._hostContext=t.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(t){throw this.close(),t}}};D(Cn,"ONE_SHOT_EVENTS",new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]));var Rn=Cn;var hb="https://developers.tripo3d.ai/en/keys",$b="https://developers.tripo3d.com/zh/keys",K=e=>document.getElementById(e),Se=new Rn({name:"Tripo settings",version:"0.2.5"},{});async function dn(e,i={}){let n=await Se.callServerTool({name:`tripo_${e}`,arguments:i}),a=(n.content??[]).find(t=>t.type==="text")?.text??"";if(n.isError)throw new Error(a.replace(/^Error \[[A-Z_]+\]:\s*/,"")||"The call failed.");try{return JSON.parse(a)}catch{throw new Error(a||"The call returned nothing.")}}function Ee(e){for(let i of["save","clear","signin","region"])K(i).disabled=e;e||(K("clear").disabled=!$l||$l.key.source!=="store")}function he(e){let i=K("error");i.textContent=e??"",i.hidden=!e}var $l=null;function _l(e){$l=e;let i=K("account");if(e.signedIn){let n=[e.account??"Signed in"];e.region&&n.push(e.region==="cn"?"China mainland":"International"),typeof e.balance=="number"&&n.push(`${e.balance.toLocaleString()} credits`),i.textContent=n.join(" \xB7 "),i.dataset.state="ok"}else i.textContent="Not signed in. Save an API key or sign in with Tripo.",i.dataset.state="off";K("keystate").textContent=e.key.source==="env"?"Set by the TRIPO_API_KEY environment variable, which takes precedence over a saved key.":e.key.source==="store"?"A key is saved.":"No key is saved.",K("clear").disabled=e.key.source!=="store"}async function bl(){he(null);try{_l(await dn("auth_status"))}catch(e){he(e.message)}}async function bb(e){e.preventDefault();let i=K("apikey"),n=i.value.trim();if(!n){he("Enter an API key first.");return}Ee(!0),he(null);try{_l(await dn("set_key",{apiKey:n})),i.value=""}catch(a){he(a.message)}finally{Ee(!1)}}async function _b(){Ee(!0),he(null);try{_l(await dn("clear_key"))}catch(e){he(e.message)}finally{Ee(!1)}}var At=null;function mp(){At&&clearTimeout(At),At=null}async function yb(){mp(),Ee(!0),he(null);let e=K("region").value;try{let i=await dn("login_start",{region:e});if(!i.url){K("device").hidden=!0,await bl(),Ee(!1);return}K("code").textContent=i.code??"",K("open").onclick=()=>void Se.openLink({url:i.url}),K("device").hidden=!1,K("pollstate").textContent="Waiting for you to approve the code in your browser.",Se.openLink({url:i.url});let n=async()=>{let a;try{a=await dn("login_poll")}catch(t){a={state:"error",message:t.message}}if(a.state==="pending"){At=setTimeout(()=>void n(),i.pollAfterMs||5e3);return}At=null,Ee(!1),a.state==="done"?(K("device").hidden=!0,await bl()):(K("pollstate").textContent=a.state==="expired"?"The code expired. Sign in again for a new one.":"",a.state==="error"&&he(a.message??"Sign-in failed."))};At=setTimeout(()=>void n(),i.pollAfterMs||5e3)}catch(i){he(i.message),Ee(!1)}}function pp(e){e&&(e.theme&&lp(e.theme),e.styles?.variables&&dp(e.styles.variables),e.styles?.css?.fonts&&cp(e.styles.css.fonts))}Se.onhostcontextchanged=e=>pp({...Se.getHostContext(),...e});Se.onteardown=async()=>(mp(),{});K("keyform").addEventListener("submit",e=>void bb(e));K("clear").addEventListener("click",()=>void _b());K("signin").addEventListener("click",()=>void yb());K("getkey").addEventListener("click",e=>{e.preventDefault(),Se.openLink({url:K("region").value==="cn"?$b:hb})});Se.connect().then(()=>{pp(Se.getHostContext()),bl()}).catch(e=>he(`Could not reach the host: ${e.message}`));})();
178
178
  </script>
179
179
  </body>
180
180
  </html>
@@ -6,8 +6,8 @@ This plugin runs tripo-cli 0.11.2, pinned in its package, so nothing needs insta
6
6
  - To get a model into Unreal, use `tripo(action="generate", prompt="...")`. It spends credits, so call it with `dryRun=true` first: the dry run returns the exact settings and the credit estimate for nothing, and the same call without `dryRun` generates. Without options it runs `tripo make` with `--model H3.1` (the cheapest model the CLI can price), GLB output, `-p pbr=false`, `--for anim` and a rig (`rig-check`, then `rig` with `spec=unreal` and `out_format=glb`); there is no convert step. It never picks a premium model, `texture_quality=detailed` or `geometry_quality=detailed`; pass `model` or `params` for those, only when the user asks. `format="fbx"` adds `convert:fbx` as the last step, but the conversion has produced tiny scale and cracked meshes that the same task as GLB did not, so leave it off unless FBX is required. The raw GLB and `preview.png` are saved under the job folder, and the result lists their paths, the settings used, the credits and when Tripo's download links expire (about 8 days). The result imports the model with `asset(action="import_model")`; when that cannot run it still returns success with `status="generated"` and the `importCall` to make next. A pending result names the `generate(resume=...)` call that finishes the import.
7
7
  - Prefer a loadout when the subject is known: `generate(loadout="humanoid" | "creature" | "prop" | "hero-prop" | "environment", ...)` applies a bundle of model, face limit, rig and import settings, and options in the call override it field by field. `tripo(action="loadouts")` lists them for free with their resolved settings, including any the project defines under `ue-mcp.pluginConfig.tripo.loadouts` in the project's config. The dry run and every result say which loadout or option each setting came from. Built-ins use the cheapest model and standard texture quality, so a premium setting still needs an explicit option.
8
8
  - **This overrides rule 7 of the Tripo guide below ("default to P2").** Through this plugin, generate defaults to H3.1 and the cheap settings (no PBR, standard texture quality, no `geometry_quality`). Use P2 only when the user asks for it, with `model="P2"`. Do not pass `--model P2` to `tripo(action="cli")` or switch generate to P2 on your own.
9
- - `segmentHint="poncho, body"` separates garments after generation: it runs `mesh smartsegment` (55 credits at list price, on top of the estimate) on the raw GLB, then rigs the segmented model. Plain `mesh segment` fused a poncho that smartsegment separated. It is off by default and cannot be combined with `task` or `then`.
10
- - The estimate covers the generation step only. Rig, retarget, texture and convert steps are billed on top.
9
+ - `segmentHint="poncho, body"` separates garments after generation: it runs `mesh smartsegment` (55 credits at list price) on the raw GLB, then rigs the segmented model. Plain `mesh segment` fused a poncho that smartsegment separated. It is off by default and cannot be combined with `task` or `then`.
10
+ - `creditEstimate.credits` is the total for every step the job runs: generation as the CLI prices it, plus smartsegment (55), rig (25), retarget (10 per animation), texture and convert at Tripo's list prices. `creditEstimate.steps` prices each step; a step with no known price has `credits: null, unpriced: true`, and then the total is a minimum and the message says so. Quote the total to the user, not the generation price. The finished result's `creditsBreakdown` names each billed task's step beside its estimate.
11
11
  - A model file already on disk goes straight to `asset(action="import_model", filePath=..., kind="skeletal")`.
12
12
  - The cli action stops a command after `timeoutSec` (default 300). For long jobs pass `--no-wait`, then `["task","watch","<id>","--download"]`. `tripo mcp` and `tripo update` are not available through the plugin.
13
13
  - Ignore the guide's install, `TRIPO_CLIENT_APP` and `TRIPO_DISTRIBUTION_CHANNEL` instructions; the plugin handles the binary.
@@ -31,11 +31,30 @@ Marked (Tripo) are Tripo's own guidance; the rest is what the preparation step d
31
31
 
32
32
  These come from a project's character and cloth work, observed in its editor and files unless marked unverified.
33
33
 
34
+ - Tripo models are 1 m tall (100 cm in Unreal) and face +X. Scale and turn them to match the project's characters before comparing them with the mannequin or placing them beside it.
35
+ - A `spec=unreal` rig has the mannequin's bone names but not its bone frames. The project's mannequin animations therefore twist on it, and it cannot join the mannequin skeleton as it is. Fit the mesh to the project skeleton, or retarget the animations with an IK Retargeter, before playing them.
36
+ - A rigged, segmented character costs 120 credits: 40 for generation (the `humanoid` loadout from a turnaround), 55 for smartsegment and 25 for the rig. The dry run's estimate includes all three.
34
37
  - Inspect the raw GLB (scale in cm, part count, cracks, one fused shell or separate parts) before any conversion. Tripo's FBX convert caused tiny scale and cracks that the same task as GLB did not have.
35
38
  - Tripo's auto-skin puts garment weight on arm bones (one poncho had 48% on them). Cloth input follows the skinned pose, so a garment that hangs from the shoulders balloons or spikes when the arms move, even with simulation off. Reweight such garments to the clavicles, spine and neck, and check that the share on arm bones is 0, before any clothing data is made.
36
39
  - Tripo's auto physics asset had 12 bodies with no clavicle, neck or lower-arm bodies. Its radii looked large for a 100 cm character (unverified: the capsules were not visualized). Look at them before tuning cloth.
37
40
  - The Unreal section index is not the Tripo part number. Read the material of each section: one poncho was section 4 and section 3 was the head, and binding to the wrong section is silent.
38
- - Garments need to be their own part and their own material section to simulate, so use `segmentHint` when generation fuses them. A double-layer garment may cause chest clipping that no cloth setting removes (unverified).
41
+ - smartsegment's labels (`segmentation.labels`) are not in part order: for "hair, head, shirt, arms, hands, leggings, feet", `tripo_part_2` was the feet and `tripo_part_4` the shirt. The result's `parts` gives each part's node, material, bounds (meters, Y up), vertex and triangle counts, with `label` null; assign labels from the bounds (hair highest, feet lowest, arms widest) before acting on a part.
42
+ - Garments need to be their own part and their own material section to simulate, so use `segmentHint` when generation fuses them. A double-walled garment balloons and clips when simulated as it is; the route below simulates a single-layer sheet in its place.
43
+
44
+ ## Garments as cloth
45
+
46
+ Generated garments are often double-walled: two sheets a short way apart that simulate separately. Simulate a single-layer sheet built from the garment and let it drive the thick garment you render. Needs ue-mcp 1.4.16-beta.13 or later. Every call below is a core ue-mcp action on the imported SkeletalMesh; each action's schema names its mesh parameter.
47
+
48
+ 1. Generate with `segmentHint` (for example `"poncho, body"`) so each garment comes out as its own part and its own section. Find the garment's section by its material, not by the Tripo part number.
49
+ 2. Check the skin weights: `asset(action="read_skeletal_mesh_weight_report", sectionIndex=<garment>, boneGroups=...)` gives each bone's share of the garment's weight. If the arms carry any of it, move it to the clavicles, spine and neck with `asset(action="restrict_skeletal_mesh_influences", sectionIndex=<garment>, allowedBones=[...], includeChildBones=...)`; `restore_skeletal_mesh_snapshot` undoes it.
50
+ 3. Check penetration: `asset(action="measure_section_penetration", garmentSection=<garment>, bodySections=[...])`, and push the garment out with `asset(action="offset_section_outward", ...)` when vertices are inside the body.
51
+ 4. Check the collision bodies: `animation(action="check_physics_asset_fit", garmentSection=<garment>)` lists bodies that are too large or too small and the bones that carry garment weight with no body, each with a capsule for `animation(action="add_physics_asset_body")`. `animation(action="capture_physics_asset_bodies")` renders them over the mesh.
52
+ 5. Measure the double walls: `asset(action="measure_section_layers", garmentSection=<garment>)` returns `doubleWalledShare` and `doubleWalledAreaShare`.
53
+ 6. Build the sheet: `asset(action="build_garment_proxy_section", garmentSection=<garment>, bodySections=[...])`. Run it with `dryRun=true` first. A sheet that misses a quality threshold is refused, nothing is written, and the result carries its report under `quality`, with `quality.checks` saying which check failed and the `max*`/`min*` parameter that loosens it. A passing sheet becomes a new render section; `remove_skeletal_mesh_section` removes it.
54
+ 7. Create clothing from the sheet: `asset(action="create_clothing_from_section", lodIndex=0, sectionIndex=<sheet>, removeFromMesh=true, physicsAssetPath=...)`. The sheet stops rendering and becomes the simulated proxy.
55
+ 8. Proxy-drive the render garment: `asset(action="bind_cloth_to_section", lodIndex=0, sectionIndex=<garment>, clothingAsset=<the new asset's name>)`. The result's `clothMappingVertexCount` is how many render vertices the proxy drives; it should match the garment section's vertex count.
56
+
57
+ Paint the sheet's max distance with `asset(action="set_cloth_weight_map")` and read it back with `read_cloth_weight_map`. `remove_clothing_asset` undoes step 7.
39
58
 
40
59
  ---
41
60
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ue-mcp-tripo",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "Tripo plugin for ue-mcp. Runs Tripo's own CLI to turn a prompt or image into a rigged, textured Unreal Engine 5 character imported through ue-mcp core, and exposes every other CLI command through a passthrough.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -11,8 +11,8 @@ This plugin runs tripo-cli 0.11.2, pinned in its package, so nothing needs insta
11
11
  - To get a model into Unreal, use `tripo(action="generate", prompt="...")`. It spends credits, so call it with `dryRun=true` first: the dry run returns the exact settings and the credit estimate for nothing, and the same call without `dryRun` generates. Without options it runs `tripo make` with `--model H3.1` (the cheapest model the CLI can price), GLB output, `-p pbr=false`, `--for anim` and a rig (`rig-check`, then `rig` with `spec=unreal` and `out_format=glb`); there is no convert step. It never picks a premium model, `texture_quality=detailed` or `geometry_quality=detailed`; pass `model` or `params` for those, only when the user asks. `format="fbx"` adds `convert:fbx` as the last step, but the conversion has produced tiny scale and cracked meshes that the same task as GLB did not, so leave it off unless FBX is required. The raw GLB and `preview.png` are saved under the job folder, and the result lists their paths, the settings used, the credits and when Tripo's download links expire (about 8 days). The result imports the model with `asset(action="import_model")`; when that cannot run it still returns success with `status="generated"` and the `importCall` to make next. A pending result names the `generate(resume=...)` call that finishes the import.
12
12
  - Prefer a loadout when the subject is known: `generate(loadout="humanoid" | "creature" | "prop" | "hero-prop" | "environment", ...)` applies a bundle of model, face limit, rig and import settings, and options in the call override it field by field. `tripo(action="loadouts")` lists them for free with their resolved settings, including any the project defines under `ue-mcp.pluginConfig.tripo.loadouts` in the project's config. The dry run and every result say which loadout or option each setting came from. Built-ins use the cheapest model and standard texture quality, so a premium setting still needs an explicit option.
13
13
  - **This overrides rule 7 of the Tripo guide below ("default to P2").** Through this plugin, generate defaults to H3.1 and the cheap settings (no PBR, standard texture quality, no `geometry_quality`). Use P2 only when the user asks for it, with `model="P2"`. Do not pass `--model P2` to `tripo(action="cli")` or switch generate to P2 on your own.
14
- - `segmentHint="poncho, body"` separates garments after generation: it runs `mesh smartsegment` (55 credits at list price, on top of the estimate) on the raw GLB, then rigs the segmented model. Plain `mesh segment` fused a poncho that smartsegment separated. It is off by default and cannot be combined with `task` or `then`.
15
- - The estimate covers the generation step only. Rig, retarget, texture and convert steps are billed on top.
14
+ - `segmentHint="poncho, body"` separates garments after generation: it runs `mesh smartsegment` (55 credits at list price) on the raw GLB, then rigs the segmented model. Plain `mesh segment` fused a poncho that smartsegment separated. It is off by default and cannot be combined with `task` or `then`.
15
+ - `creditEstimate.credits` is the total for every step the job runs: generation as the CLI prices it, plus smartsegment (55), rig (25), retarget (10 per animation), texture and convert at Tripo's list prices. `creditEstimate.steps` prices each step; a step with no known price has `credits: null, unpriced: true`, and then the total is a minimum and the message says so. Quote the total to the user, not the generation price. The finished result's `creditsBreakdown` names each billed task's step beside its estimate.
16
16
  - A model file already on disk goes straight to `asset(action="import_model", filePath=..., kind="skeletal")`.
17
17
  - The cli action stops a command after `timeoutSec` (default 300). For long jobs pass `--no-wait`, then `["task","watch","<id>","--download"]`. `tripo mcp` and `tripo update` are not available through the plugin.
18
18
  - Ignore the guide's install, `TRIPO_CLIENT_APP` and `TRIPO_DISTRIBUTION_CHANNEL` instructions; the plugin handles the binary.
@@ -36,11 +36,30 @@ Marked (Tripo) are Tripo's own guidance; the rest is what the preparation step d
36
36
 
37
37
  These come from a project's character and cloth work, observed in its editor and files unless marked unverified.
38
38
 
39
+ - Tripo models are 1 m tall (100 cm in Unreal) and face +X. Scale and turn them to match the project's characters before comparing them with the mannequin or placing them beside it.
40
+ - A `spec=unreal` rig has the mannequin's bone names but not its bone frames. The project's mannequin animations therefore twist on it, and it cannot join the mannequin skeleton as it is. Fit the mesh to the project skeleton, or retarget the animations with an IK Retargeter, before playing them.
41
+ - A rigged, segmented character costs 120 credits: 40 for generation (the `humanoid` loadout from a turnaround), 55 for smartsegment and 25 for the rig. The dry run's estimate includes all three.
39
42
  - Inspect the raw GLB (scale in cm, part count, cracks, one fused shell or separate parts) before any conversion. Tripo's FBX convert caused tiny scale and cracks that the same task as GLB did not have.
40
43
  - Tripo's auto-skin puts garment weight on arm bones (one poncho had 48% on them). Cloth input follows the skinned pose, so a garment that hangs from the shoulders balloons or spikes when the arms move, even with simulation off. Reweight such garments to the clavicles, spine and neck, and check that the share on arm bones is 0, before any clothing data is made.
41
44
  - Tripo's auto physics asset had 12 bodies with no clavicle, neck or lower-arm bodies. Its radii looked large for a 100 cm character (unverified: the capsules were not visualized). Look at them before tuning cloth.
42
45
  - The Unreal section index is not the Tripo part number. Read the material of each section: one poncho was section 4 and section 3 was the head, and binding to the wrong section is silent.
43
- - Garments need to be their own part and their own material section to simulate, so use `segmentHint` when generation fuses them. A double-layer garment may cause chest clipping that no cloth setting removes (unverified).
46
+ - smartsegment's labels (`segmentation.labels`) are not in part order: for "hair, head, shirt, arms, hands, leggings, feet", `tripo_part_2` was the feet and `tripo_part_4` the shirt. The result's `parts` gives each part's node, material, bounds (meters, Y up), vertex and triangle counts, with `label` null; assign labels from the bounds (hair highest, feet lowest, arms widest) before acting on a part.
47
+ - Garments need to be their own part and their own material section to simulate, so use `segmentHint` when generation fuses them. A double-walled garment balloons and clips when simulated as it is; the route below simulates a single-layer sheet in its place.
48
+
49
+ ## Garments as cloth
50
+
51
+ Generated garments are often double-walled: two sheets a short way apart that simulate separately. Simulate a single-layer sheet built from the garment and let it drive the thick garment you render. Needs ue-mcp 1.4.16-beta.13 or later. Every call below is a core ue-mcp action on the imported SkeletalMesh; each action's schema names its mesh parameter.
52
+
53
+ 1. Generate with `segmentHint` (for example `"poncho, body"`) so each garment comes out as its own part and its own section. Find the garment's section by its material, not by the Tripo part number.
54
+ 2. Check the skin weights: `asset(action="read_skeletal_mesh_weight_report", sectionIndex=<garment>, boneGroups=...)` gives each bone's share of the garment's weight. If the arms carry any of it, move it to the clavicles, spine and neck with `asset(action="restrict_skeletal_mesh_influences", sectionIndex=<garment>, allowedBones=[...], includeChildBones=...)`; `restore_skeletal_mesh_snapshot` undoes it.
55
+ 3. Check penetration: `asset(action="measure_section_penetration", garmentSection=<garment>, bodySections=[...])`, and push the garment out with `asset(action="offset_section_outward", ...)` when vertices are inside the body.
56
+ 4. Check the collision bodies: `animation(action="check_physics_asset_fit", garmentSection=<garment>)` lists bodies that are too large or too small and the bones that carry garment weight with no body, each with a capsule for `animation(action="add_physics_asset_body")`. `animation(action="capture_physics_asset_bodies")` renders them over the mesh.
57
+ 5. Measure the double walls: `asset(action="measure_section_layers", garmentSection=<garment>)` returns `doubleWalledShare` and `doubleWalledAreaShare`.
58
+ 6. Build the sheet: `asset(action="build_garment_proxy_section", garmentSection=<garment>, bodySections=[...])`. Run it with `dryRun=true` first. A sheet that misses a quality threshold is refused, nothing is written, and the result carries its report under `quality`, with `quality.checks` saying which check failed and the `max*`/`min*` parameter that loosens it. A passing sheet becomes a new render section; `remove_skeletal_mesh_section` removes it.
59
+ 7. Create clothing from the sheet: `asset(action="create_clothing_from_section", lodIndex=0, sectionIndex=<sheet>, removeFromMesh=true, physicsAssetPath=...)`. The sheet stops rendering and becomes the simulated proxy.
60
+ 8. Proxy-drive the render garment: `asset(action="bind_cloth_to_section", lodIndex=0, sectionIndex=<garment>, clothingAsset=<the new asset's name>)`. The result's `clothMappingVertexCount` is how many render vertices the proxy drives; it should match the garment section's vertex count.
61
+
62
+ Paint the sheet's max distance with `asset(action="set_cloth_weight_map")` and read it back with `read_cloth_weight_map`. `remove_clothing_asset` undoes step 7.
44
63
 
45
64
  ---
46
65
 
package/ue-mcp.plugin.yml CHANGED
@@ -2,7 +2,8 @@ actionPrefix: tripo
2
2
  displayName: Tripo Connector
3
3
  # Plugin views, row buttons, app-only actions and the secret store ship in
4
4
  # 1.4.16-beta.11 (asset(import_model), which generate imports through, in beta.10).
5
- minServerVersion: 1.4.16-beta.12
5
+ # The garment cloth route in the guidance uses actions added in 1.4.16-beta.13.
6
+ minServerVersion: 1.4.16-beta.13
6
7
 
7
8
  # Loadouts: named bundles of generate settings, read by the plugin as
8
9
  # this.config.loadouts. A project adds or overrides them under
@@ -97,8 +98,11 @@ registry:
97
98
  Runs Tripo's own CLI from ue-mcp: one call generates a model, rigs it with
98
99
  Unreal Mannequin bone names, optionally adds a preset animation and
99
100
  imports it as a skeletal mesh, with a credit estimate before anything is
100
- spent. Turnaround images are prepared for multiview. Every other CLI
101
- command is available through a passthrough.
101
+ spent. Loadouts bundle settings by subject (humanoid, creature, prop,
102
+ hero-prop, environment), and a project can override them or add its own.
103
+ Turnaround images are prepared for multiview, and garments can be split
104
+ from the body before rigging. Every other CLI command is available
105
+ through a passthrough.
102
106
  category: asset
103
107
  tags: [tripo, ai-3d, text-to-3d, image-to-3d, rigging, skeletal-mesh]
104
108
 
@@ -121,7 +125,8 @@ provides:
121
125
  description: >-
122
126
  Spends Tripo credits. Call it with dryRun=true first: that returns
123
127
  the exact settings, where each came from, and the credit estimate for
124
- nothing, and the same call without dryRun then generates. loadout
128
+ nothing: the total of every step the job runs, priced per step, and a
129
+ minimum when a step has no known price. The same call without dryRun then generates. loadout
125
130
  picks a named bundle of settings (humanoid, creature, prop,
126
131
  hero-prop, environment, or a project's own; list them with the
127
132
  loadouts action) and options in the call override it. Prompt, image(s), turnaround views
@@ -133,7 +138,8 @@ provides:
133
138
  preset; convert:fbx runs last only for format=fbx. Output goes to
134
139
  <project>/Saved/Tripo/<name>, with the raw GLB and preview.png saved
135
140
  beside it. Every result lists the settings used and the credit
136
- estimate, with the generation task ids and credits spent. The model
141
+ estimate, with the task ids, the credits spent and a breakdown by
142
+ step. The model
137
143
  is then imported with asset(import_model), kind=skeletal when rigged,
138
144
  static otherwise; if that import cannot run, the result is still
139
145
  success with status=generated and the ready asset(import_model) call
@@ -155,7 +161,7 @@ provides:
155
161
  animation: { type: string, description: "One preset animation, e.g. walk or preset:quadruped:walk" }
156
162
  retexture: { type: boolean, description: "Add a texture step first (for an untextured task ref)" }
157
163
  pbr: { type: boolean, description: "PBR textures (default false, as in Tripo's guidance)" }
158
- segmentHint: { type: string, description: "Separate garments or parts: after generating, runs mesh smartsegment on the GLB with this hint (e.g. \"poncho, body\"), then rigs the segmented model. Adds 55 credits at list price; off by default. Not with task or then" }
164
+ segmentHint: { type: string, description: "Separate garments or parts: after generating, runs mesh smartsegment on the GLB with this hint (e.g. \"poncho, body\"), then rigs the segmented model. Adds 55 credits at list price; off by default. Not with task or then. The result lists smartsegment's labels and each part's node, material, bounds and counts; the labels are not in part order" }
159
165
  format: { type: string, description: "glb (default) | fbx (adds convert:fbx as the last step)" }
160
166
  model: { type: string, description: "Generation model, passed as --model. Default H3.1, the cheapest the CLI can price; P2 and P1 only when asked" }
161
167
  params: { type: array, description: "Extra make -p key=value pairs, e.g. [\"face_limit=20000\"]. Premium options such as texture_quality=detailed go here, only when asked" }