ue-mcp-tripo 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 David Lyon
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 David Lyon
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,11 +1,13 @@
1
1
  # ue-mcp-tripo
2
2
 
3
- A [ue-mcp](https://github.com/db-lyon/ue-mcp) plugin that turns a prompt or an image into a rigged, textured Unreal Engine skeletal mesh with [Tripo](https://www.tripo3d.ai). It generates the model, auto-rigs it with Unreal Mannequin bone names, optionally retargets a preset animation, converts it to FBX with embedded textures, and hands the file to ue-mcp's own `asset(action="import_model")`.
3
+ A [ue-mcp](https://github.com/db-lyon/ue-mcp) plugin that brings [Tripo](https://www.tripo3d.ai) into Unreal Engine through Tripo's own command-line tool, [tripo-cli](https://www.npmjs.com/package/tripo-cli). One call turns a prompt or an image into a rigged, textured skeletal mesh with Unreal Mannequin bone names, and every other CLI command is available through a passthrough.
4
+
5
+ The plugin pins an exact tripo-cli version as a dependency and runs it from its own `node_modules`, so there is nothing else to install.
4
6
 
5
7
  ## Requirements
6
8
 
7
9
  - ue-mcp 1.4.16-beta.10 or later
8
- - A Tripo API key with credits, from [platform.tripo3d.ai](https://platform.tripo3d.ai)
10
+ - A Tripo account with credits
9
11
 
10
12
  ## Install
11
13
 
@@ -13,40 +15,72 @@ A [ue-mcp](https://github.com/db-lyon/ue-mcp) plugin that turns a prompt or an i
13
15
  ue-mcp plugin install tripo
14
16
  ```
15
17
 
16
- Set `TRIPO_API_KEY` in the environment of the ue-mcp server process, then restart the server. Check it with:
18
+ Sign in through the CLI's device login, which works without a terminal. It prints a URL and a one-time code; authorize in the browser, then run the same call again to finish:
19
+
20
+ ```
21
+ tripo(action="cli", args=["login", "--region", "ov", "--no-wait"])
22
+ ```
23
+
24
+ Use `--region cn` for an account on the China site. Setting `TRIPO_API_KEY` in the ue-mcp server environment works too, and takes priority over a stored login. Confirm the key, network and balance with:
17
25
 
18
26
  ```
19
- tripo(action="setup")
27
+ tripo(action="cli", args=["doctor"])
20
28
  ```
21
29
 
22
- ## Use
30
+ ## Generate
23
31
 
24
32
  ```
25
33
  tripo(action="generate", prompt="a stylized knight in plate armor", animation="idle")
26
34
  ```
27
35
 
28
- That one call runs Tripo generation, rig-check, rig, the idle animation, FBX conversion and the download, then imports the result as a skeletal mesh under `/Game/Tripo`. Add `place=true` to put it in the open level.
36
+ This runs a single `tripo make` with Unreal defaults, writes its output to `<project>/Saved/Tripo/<name>`, and imports the model with ue-mcp's `asset(action="import_model")`. For the call above, the command is:
37
+
38
+ ```
39
+ tripo make "a stylized knight in plate armor" --for anim
40
+ --then "rig-check,rig:rig_type=biped,spec=unreal,retarget:animation=preset:idle,convert:fbx"
41
+ -p pbr=true -o <project>/Saved/Tripo/AStylizedKnightInPlateArmor --json --yes --no-open
42
+ ```
43
+
44
+ The result carries the Tripo task ids, the credits spent, the import result and the import's warnings.
29
45
 
30
- | Action | What it does |
46
+ | Option | Effect |
31
47
  |---|---|
32
- | `generate` | Prompt or image to an imported asset. `rig=false` gives a static mesh. `wait=false` returns the generation task id at once. |
33
- | `status` | Reads one Tripo task: status, progress, output URLs and Tripo's error text on failure. |
34
- | `import` | Continues the chain from any task id (generate, rig, retarget, convert), or imports a model file on disk. |
35
- | `setup` | Confirms the key and reads the credit balance. |
48
+ | `prompt`, `images` or `task` | The input: text, one image or 2 to 4 views (absolute paths or URLs), or an existing task id to continue from. |
49
+ | `rig=false` | Uses `--for game-pc` and imports a static mesh. |
50
+ | `rigType` | `biped` (default, with `spec=unreal`), another body type, or `auto` to let rig-check decide. |
51
+ | `animation` | One preset animation, such as `walk`. |
52
+ | `format=glb` | Skips the FBX conversion. |
53
+ | `params`, `model`, `then` | Extra `-p key=value` pairs, a generation model, or a replacement `--then` chain. |
54
+ | `dryRun=true` | Returns the plan and the credit estimate without spending anything. |
55
+ | `place`, `location`, `destination`, `name`, ... | Passed to `asset(import_model)`. |
36
56
 
37
- A full run takes a few minutes. Each call waits up to `waitSec` (default 300). If Tripo is still working when that runs out, the call returns `status=pending` with every task id so far and the `import` call that picks up where it stopped. The parameter reference and more recipes are in [knowledge/tripo.md](knowledge/tripo.md).
57
+ A full run takes a few minutes. The call waits up to `waitSec` (default 300); `wait=false` returns at once. If `make` is still running, the result is `status=pending` with a `jobDir`, and `tripo(action="generate", resume="<jobDir>")` waits for it and imports the model. The CLI keeps running on its own in the meantime.
58
+
59
+ A model file already on disk does not need Tripo at all: import it with `asset(action="import_model", filePath="...", kind="skeletal")`.
60
+
61
+ ## Any other CLI command
62
+
63
+ `tripo(action="cli", args=[...])` runs the pinned CLI with the given arguments plus `--json --yes --no-open`, and returns the parsed JSON result. A failed command returns the CLI's error message and the end of its stderr.
64
+
65
+ ```
66
+ tripo(action="cli", args=["balance"])
67
+ tripo(action="cli", args=["task", "get", "<task id>"])
68
+ tripo(action="cli", args=["anim", "retarget", "<task id>", "-p", "animation=preset:run"])
69
+ ```
70
+
71
+ Commands stop after `timeoutSec` (default 300). For long jobs, pass `--no-wait` and follow up with `["task", "watch", "<id>", "--download"]`.
72
+
73
+ Tripo's agent guide, generated from `tripo docs` of the pinned version, ships as the plugin's knowledge file and as a `tripo-cli` skill.
38
74
 
39
75
  ## Development
40
76
 
41
77
  ```bash
42
78
  npm install
43
- npm run build
44
- npm run check # manifest validates against the ue-mcp loader; every task resolves
45
- npm test # the whole chain against a mocked Tripo API and a mocked core import
79
+ npm run build # compiles, then generates knowledge/ and skills/ from `tripo docs`
80
+ npm run check # the manifest validates against the ue-mcp loader; every task resolves
81
+ npm test # both actions against a fake CLI, plus offline dry runs of the real one
46
82
  ```
47
83
 
48
- `TRIPO_BASE_URL` points the client at another Tripo host, such as `https://openapi.tripo3d.com` for the China region.
49
-
50
84
  ## License
51
85
 
52
86
  MIT
package/dist/index.d.ts CHANGED
@@ -4,9 +4,6 @@
4
4
  * ue-mcp loads task classes by `class_path` from the manifest, so this file is
5
5
  * not on the load path. It gives consumers a typed import surface.
6
6
  */
7
- export { default as Generate } from "./tasks/Generate.js";
8
- export { default as ImportModel } from "./tasks/ImportModel.js";
9
- export { default as Status } from "./tasks/Status.js";
10
- export { default as Setup } from "./tasks/Setup.js";
11
- export { TripoClient, TripoError, API_KEY_ENV } from "./shared/TripoClient.js";
12
- export { runChain, importFile } from "./shared/pipeline.js";
7
+ export { default as Generate, makeArgs, chainFor } from "./tasks/Generate.js";
8
+ export { default as Cli } from "./tasks/Cli.js";
9
+ export { cliPath, cliVersion, runCli, withAddedFlags, ADDED_FLAGS } from "./shared/cli.js";
package/dist/index.js CHANGED
@@ -4,10 +4,7 @@
4
4
  * ue-mcp loads task classes by `class_path` from the manifest, so this file is
5
5
  * not on the load path. It gives consumers a typed import surface.
6
6
  */
7
- export { default as Generate } from "./tasks/Generate.js";
8
- export { default as ImportModel } from "./tasks/ImportModel.js";
9
- export { default as Status } from "./tasks/Status.js";
10
- export { default as Setup } from "./tasks/Setup.js";
11
- export { TripoClient, TripoError, API_KEY_ENV } from "./shared/TripoClient.js";
12
- export { runChain, importFile } from "./shared/pipeline.js";
7
+ export { default as Generate, makeArgs, chainFor } from "./tasks/Generate.js";
8
+ export { default as Cli } from "./tasks/Cli.js";
9
+ export { cliPath, cliVersion, runCli, withAddedFlags, ADDED_FLAGS } from "./shared/cli.js";
13
10
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Runs the tripo-cli binary this package pins.
3
+ *
4
+ * The binary is resolved from the plugin's own node_modules and started with
5
+ * the server's own Node (process.execPath): no global install, no npx, no
6
+ * shell. UE_MCP_TRIPO_CLI points at another script, which the tests use for a
7
+ * fake CLI.
8
+ */
9
+ import { type ChildProcess } from "node:child_process";
10
+ /** Flags the plugin adds to every command unless the caller already passed them. */
11
+ export declare const ADDED_FLAGS: readonly ["--json", "--yes", "--no-open"];
12
+ export declare function cliPath(): string;
13
+ /** The pinned tripo-cli version, or null when it cannot be read (an override path). */
14
+ export declare function cliVersion(): string | null;
15
+ /** Append --json, --yes and --no-open, skipping any the caller already passed. */
16
+ export declare function withAddedFlags(args: string[]): string[];
17
+ export declare function refusal(args: string[]): string | null;
18
+ export interface CliResult {
19
+ exitCode: number | null;
20
+ stdout: string;
21
+ stderr: string;
22
+ /** stdout parsed as JSON, or undefined when it is not JSON (docs, completion). */
23
+ json?: unknown;
24
+ timedOut: boolean;
25
+ }
26
+ /** Parse the last non-empty stdout line as JSON; the CLI prints exactly one result line. */
27
+ export declare function parseJsonLine(stdout: string): unknown;
28
+ export declare function tail(text: string, lines?: number): string;
29
+ export declare function stripAnsi(text: string): string;
30
+ /** Run the CLI to completion (or until the timeout), capturing stdout and stderr. */
31
+ export declare function runCli(args: string[], opts?: {
32
+ cwd?: string;
33
+ timeoutMs?: number;
34
+ }): Promise<CliResult>;
35
+ /** Message for a failed run: the CLI's own error JSON, its suggestion, and a stderr tail. */
36
+ export declare function failureMessage(args: string[], r: CliResult, timeoutMs?: number): string;
37
+ /**
38
+ * Start the CLI detached, with stdout and stderr going to files, so it keeps
39
+ * running when the MCP call (or the server) goes away.
40
+ */
41
+ export declare function startDetached(args: string[], opts: {
42
+ cwd?: string;
43
+ stdoutFile: string;
44
+ stderrFile: string;
45
+ }): ChildProcess;
46
+ /**
47
+ * Where the CLI runs: <project>/Saved/Tripo, so its `.tripo` directory
48
+ * context and default output stay out of the project root and `@last`
49
+ * resolves the same way for every call. Without a project, a temp folder.
50
+ */
51
+ export declare function workDir(projectDir: string | null | undefined): string;
52
+ export declare function isAlive(pid: number | undefined): boolean;
@@ -0,0 +1,174 @@
1
+ /**
2
+ * Runs the tripo-cli binary this package pins.
3
+ *
4
+ * The binary is resolved from the plugin's own node_modules and started with
5
+ * the server's own Node (process.execPath): no global install, no npx, no
6
+ * shell. UE_MCP_TRIPO_CLI points at another script, which the tests use for a
7
+ * fake CLI.
8
+ */
9
+ import { spawn } from "node:child_process";
10
+ import { closeSync, mkdirSync, openSync } from "node:fs";
11
+ import { createRequire } from "node:module";
12
+ import { tmpdir } from "node:os";
13
+ import { dirname, join } from "node:path";
14
+ /** Flags the plugin adds to every command unless the caller already passed them. */
15
+ export const ADDED_FLAGS = ["--json", "--yes", "--no-open"];
16
+ /** Commands the passthrough refuses, with the way to get the same result. */
17
+ const REFUSED = {
18
+ mcp: "`tripo mcp` starts a stdio server that never exits. Run the individual commands through tripo(action=\"cli\") instead.",
19
+ update: "`tripo update` installs tripo-cli globally, which this plugin does not use. Update the plugin instead: ue-mcp plugin update tripo.",
20
+ };
21
+ export function cliPath() {
22
+ const override = process.env.UE_MCP_TRIPO_CLI;
23
+ if (override)
24
+ return override;
25
+ const require = createRequire(import.meta.url);
26
+ const pkgPath = require.resolve("tripo-cli/package.json");
27
+ const pkg = require(pkgPath);
28
+ const bin = typeof pkg.bin === "string" ? pkg.bin : pkg.bin?.tripo;
29
+ if (!bin)
30
+ throw new Error(`tripo-cli at ${dirname(pkgPath)} declares no "tripo" bin.`);
31
+ return join(dirname(pkgPath), bin);
32
+ }
33
+ /** The pinned tripo-cli version, or null when it cannot be read (an override path). */
34
+ export function cliVersion() {
35
+ try {
36
+ const require = createRequire(import.meta.url);
37
+ return require("tripo-cli/package.json").version;
38
+ }
39
+ catch {
40
+ return null;
41
+ }
42
+ }
43
+ /** Append --json, --yes and --no-open, skipping any the caller already passed. */
44
+ export function withAddedFlags(args) {
45
+ const out = [...args];
46
+ for (const f of ADDED_FLAGS)
47
+ if (!out.includes(f))
48
+ out.push(f);
49
+ return out;
50
+ }
51
+ export function refusal(args) {
52
+ const command = args.find((a) => !a.startsWith("-"));
53
+ return command && REFUSED[command] ? REFUSED[command] : null;
54
+ }
55
+ /** Parse the last non-empty stdout line as JSON; the CLI prints exactly one result line. */
56
+ export function parseJsonLine(stdout) {
57
+ const text = stdout.trim();
58
+ if (!text)
59
+ return undefined;
60
+ try {
61
+ return JSON.parse(text);
62
+ }
63
+ catch {
64
+ const lines = text.split(/\r?\n/).filter((l) => l.trim());
65
+ try {
66
+ return JSON.parse(lines[lines.length - 1]);
67
+ }
68
+ catch {
69
+ return undefined;
70
+ }
71
+ }
72
+ }
73
+ export function tail(text, lines = 20) {
74
+ return text.split(/\r?\n/).filter((l) => l.trim()).slice(-lines).join("\n");
75
+ }
76
+ const ANSI = /\x1b\[[0-9;]*m/g;
77
+ export function stripAnsi(text) {
78
+ return text.replace(ANSI, "");
79
+ }
80
+ /** Run the CLI to completion (or until the timeout), capturing stdout and stderr. */
81
+ export function runCli(args, opts = {}) {
82
+ return new Promise((resolve, reject) => {
83
+ const child = spawn(process.execPath, [cliPath(), ...args], {
84
+ cwd: opts.cwd,
85
+ env: process.env,
86
+ stdio: ["ignore", "pipe", "pipe"],
87
+ windowsHide: true,
88
+ });
89
+ let stdout = "";
90
+ let stderr = "";
91
+ let timedOut = false;
92
+ child.stdout.setEncoding("utf8").on("data", (d) => (stdout += d));
93
+ child.stderr.setEncoding("utf8").on("data", (d) => (stderr += d));
94
+ const timer = opts.timeoutMs
95
+ ? setTimeout(() => {
96
+ timedOut = true;
97
+ child.kill();
98
+ }, opts.timeoutMs)
99
+ : undefined;
100
+ child.on("error", (e) => {
101
+ if (timer)
102
+ clearTimeout(timer);
103
+ reject(e);
104
+ });
105
+ child.on("close", (code) => {
106
+ if (timer)
107
+ clearTimeout(timer);
108
+ resolve({ exitCode: code, stdout, stderr: stripAnsi(stderr), json: parseJsonLine(stdout), timedOut });
109
+ });
110
+ });
111
+ }
112
+ /** Message for a failed run: the CLI's own error JSON, its suggestion, and a stderr tail. */
113
+ export function failureMessage(args, r, timeoutMs) {
114
+ const j = (r.json ?? {});
115
+ const head = r.timedOut
116
+ ? `tripo ${args[0] ?? ""} did not finish within ${Math.round((timeoutMs ?? 0) / 1000)}s and was stopped. ` +
117
+ `A task it already submitted keeps running on Tripo's side: find it with tripo(action="cli", args=["history"]), ` +
118
+ `or pass --no-wait and follow up with ["task","watch","<id>"].`
119
+ : `tripo ${args[0] ?? ""} exited ${r.exitCode}: ${j.error ?? "no error message"}`;
120
+ const parts = [head];
121
+ if (j.suggestion)
122
+ parts.push(`Suggestion: ${j.suggestion}`);
123
+ if (j.task_id)
124
+ parts.push(`Task: ${j.task_id}`);
125
+ const err = tail(r.stderr);
126
+ if (err)
127
+ parts.push(`stderr:\n${err}`);
128
+ return parts.join("\n");
129
+ }
130
+ /**
131
+ * Start the CLI detached, with stdout and stderr going to files, so it keeps
132
+ * running when the MCP call (or the server) goes away.
133
+ */
134
+ export function startDetached(args, opts) {
135
+ const out = openSync(opts.stdoutFile, "w");
136
+ const err = openSync(opts.stderrFile, "w");
137
+ try {
138
+ const child = spawn(process.execPath, [cliPath(), ...args], {
139
+ cwd: opts.cwd,
140
+ env: process.env,
141
+ stdio: ["ignore", out, err],
142
+ detached: true,
143
+ windowsHide: true,
144
+ });
145
+ child.unref();
146
+ return child;
147
+ }
148
+ finally {
149
+ closeSync(out);
150
+ closeSync(err);
151
+ }
152
+ }
153
+ /**
154
+ * Where the CLI runs: <project>/Saved/Tripo, so its `.tripo` directory
155
+ * context and default output stay out of the project root and `@last`
156
+ * resolves the same way for every call. Without a project, a temp folder.
157
+ */
158
+ export function workDir(projectDir) {
159
+ const dir = projectDir ? join(projectDir, "Saved", "Tripo") : join(tmpdir(), "ue-mcp-tripo");
160
+ mkdirSync(dir, { recursive: true });
161
+ return dir;
162
+ }
163
+ export function isAlive(pid) {
164
+ if (!pid)
165
+ return false;
166
+ try {
167
+ process.kill(pid, 0);
168
+ return true;
169
+ }
170
+ catch (e) {
171
+ return e.code === "EPERM";
172
+ }
173
+ }
174
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/shared/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,KAAK,EAAqB,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,oFAAoF;AACpF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,WAAW,CAAU,CAA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,EAAE,cAAc,CAAC,CAAC;IAC7F,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACpC,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,GAAuB;IAC7C,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IACvB,IAAI,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAQ,CAA2B,CAAC,IAAI,KAAK,OAAO,CAAC;IACvD,CAAC;AACH,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * tripo.cli - run any tripo-cli command and return its JSON result.
3
+ *
4
+ * Adds --json --yes --no-open unless already present. The server's
5
+ * environment passes through, so TRIPO_API_KEY or a stored `tripo login`
6
+ * profile both work.
7
+ */
8
+ import { UeMcpTask, type TaskResult } from "ue-mcp/task";
9
+ interface Options {
10
+ args?: string[];
11
+ timeoutSec?: number;
12
+ }
13
+ export declare const DEFAULT_CLI_TIMEOUT_SEC = 300;
14
+ export default class Cli extends UeMcpTask<Options> {
15
+ get taskName(): string;
16
+ execute(): Promise<TaskResult>;
17
+ }
18
+ export {};
@@ -0,0 +1,33 @@
1
+ /**
2
+ * tripo.cli - run any tripo-cli command and return its JSON result.
3
+ *
4
+ * Adds --json --yes --no-open unless already present. The server's
5
+ * environment passes through, so TRIPO_API_KEY or a stored `tripo login`
6
+ * profile both work.
7
+ */
8
+ import { UeMcpTask } from "ue-mcp/task";
9
+ import { failureMessage, refusal, runCli, withAddedFlags, workDir } from "../shared/cli.js";
10
+ export const DEFAULT_CLI_TIMEOUT_SEC = 300;
11
+ export default class Cli extends UeMcpTask {
12
+ get taskName() { return "tripo.cli"; }
13
+ async execute() {
14
+ const raw = this.options.args;
15
+ if (!Array.isArray(raw) || raw.length === 0) {
16
+ throw new Error('Pass args, the tripo command line as an array, e.g. args=["doctor"] or args=["balance"].');
17
+ }
18
+ const args = raw.map(String);
19
+ const refused = refusal(args);
20
+ if (refused)
21
+ throw new Error(refused);
22
+ const full = withAddedFlags(args);
23
+ const timeoutMs = (this.options.timeoutSec ?? DEFAULT_CLI_TIMEOUT_SEC) * 1000;
24
+ const r = await runCli(full, { cwd: workDir(this.ctx?.project?.projectDir), timeoutMs });
25
+ if (r.exitCode !== 0 || r.timedOut)
26
+ throw new Error(failureMessage(args, r, timeoutMs));
27
+ return {
28
+ success: true,
29
+ data: r.json !== undefined ? { args: full, result: r.json } : { args: full, output: r.stdout.trim() },
30
+ };
31
+ }
32
+ }
33
+ //# sourceMappingURL=Cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Cli.js","sourceRoot":"","sources":["../../src/tasks/Cli.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,SAAS,EAAmB,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAO5F,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,SAAkB;IACjD,IAAI,QAAQ,KAAa,OAAO,WAAW,CAAC,CAAC,CAAC;IAE9C,KAAK,CAAC,OAAO;QACX,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;QAC9B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC5C,MAAM,IAAI,KAAK,CAAC,0FAA0F,CAAC,CAAC;QAC9G,CAAC;QACD,MAAM,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC7B,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;QAEtC,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;QAClC,MAAM,SAAS,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,uBAAuB,CAAC,GAAG,IAAI,CAAC;QAC9E,MAAM,CAAC,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;QACzF,IAAI,CAAC,CAAC,QAAQ,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ;YAAE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;QAExF,OAAO;YACL,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE;SACtG,CAAC;IACJ,CAAC;CACF"}
@@ -1,31 +1,57 @@
1
- /**
2
- * tripo.generate - prompt or image to a rigged, textured Unreal asset.
3
- *
4
- * Creates the Tripo generation task, then hands it to runChain: rig-check,
5
- * rig, optional retarget, FBX conversion, download, and core
6
- * asset(import_model). wait=false returns the generation task id at once.
7
- */
8
1
  import { UeMcpTask, type TaskResult } from "ue-mcp/task";
9
- import { type ChainOptions } from "../shared/pipeline.js";
10
- export declare const DEFAULT_MODEL = "v3.1-20260211";
11
- interface Options extends ChainOptions {
2
+ export interface Vec3 {
3
+ x: number;
4
+ y: number;
5
+ z: number;
6
+ }
7
+ interface Options {
12
8
  prompt?: string;
13
- imagePath?: string;
14
- imageUrl?: string;
15
- model?: string;
16
- negativePrompt?: string;
17
- texture?: boolean;
9
+ images?: string[] | string;
10
+ task?: string;
11
+ rig?: boolean;
12
+ rigType?: string;
13
+ spec?: string;
14
+ animation?: string;
15
+ retexture?: boolean;
18
16
  pbr?: boolean;
19
- textureQuality?: string;
20
- geometryQuality?: string;
21
- faceLimit?: number;
22
- quad?: boolean;
23
- smartLowPoly?: boolean;
24
- autoSize?: boolean;
17
+ format?: "fbx" | "glb";
18
+ model?: string;
19
+ params?: string[];
20
+ then?: string;
21
+ name?: string;
25
22
  wait?: boolean;
23
+ waitSec?: number;
24
+ dryRun?: boolean;
25
+ resume?: string;
26
+ destination?: string;
27
+ kind?: "auto" | "static" | "skeletal";
28
+ importMaterials?: boolean;
29
+ importTextures?: boolean;
30
+ importAnimations?: boolean;
31
+ createPhysicsAsset?: boolean;
32
+ nanite?: boolean;
33
+ place?: boolean;
34
+ location?: Vec3;
35
+ rotation?: Vec3 | {
36
+ pitch: number;
37
+ yaw: number;
38
+ roll: number;
39
+ };
40
+ onConflict?: string;
41
+ save?: boolean;
26
42
  }
43
+ export declare function sanitizeAssetName(raw: string): string;
44
+ /** "walk" -> "preset:walk"; anything already prefixed passes through. */
45
+ export declare function presetName(name: string): string;
46
+ /** The --then chain for these options, or "" when make needs none. */
47
+ export declare function chainFor(o: Options): string;
48
+ /** The full `tripo make` argument list generate runs. */
49
+ export declare function makeArgs(o: Options, outDir: string): string[];
27
50
  export default class Generate extends UeMcpTask<Options> {
28
51
  get taskName(): string;
29
52
  execute(): Promise<TaskResult>;
53
+ private resume;
54
+ private pending;
55
+ private finish;
30
56
  }
31
57
  export {};