@doufunao123/asset-gateway 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +48 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -70,7 +70,7 @@ function normalizeError(error2) {
|
|
|
70
70
|
|
|
71
71
|
// src/meta.ts
|
|
72
72
|
var CLI_NAME = "asset-gateway";
|
|
73
|
-
var CLI_VERSION = "0.
|
|
73
|
+
var CLI_VERSION = "0.8.0";
|
|
74
74
|
var CLI_DESCRIPTION = "Universal asset generation gateway CLI";
|
|
75
75
|
var DEFAULT_GATEWAY_URL = "https://assets.xiaomao.chat";
|
|
76
76
|
|
|
@@ -586,20 +586,20 @@ function createGenerateCommand() {
|
|
|
586
586
|
})
|
|
587
587
|
);
|
|
588
588
|
command.addCommand(
|
|
589
|
-
new Command3("tts").description("Text-to-speech synthesis
|
|
589
|
+
new Command3("tts").description("Text-to-speech synthesis via Qwen3-TTS").requiredOption("--prompt <text>", "Text to synthesize").option("--voice <name>", "Voice name or custom voice ID", "Cherry").option("--language <lang>", "Language hint: Auto, Chinese, English, Japanese, etc.", "Auto").option("--model <model>", "Qwen3-TTS model", "qwen3-tts-flash").option("--instructions <text>", "Natural language speaking instructions (for instruct models)").option("--provider <id>", "Provider to use").option("--output-dir <dir>", "Directory to save output", ".").action(async function(options) {
|
|
590
590
|
try {
|
|
591
591
|
const ctx = createContext(this);
|
|
592
|
-
const params = {
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
if (options.
|
|
592
|
+
const params = {
|
|
593
|
+
voice: options.voice,
|
|
594
|
+
language_type: options.language
|
|
595
|
+
};
|
|
596
|
+
if (options.instructions) params.instructions = options.instructions;
|
|
597
597
|
const body = {
|
|
598
598
|
asset_type: "tts",
|
|
599
599
|
prompt: options.prompt,
|
|
600
|
+
model: options.model,
|
|
600
601
|
params
|
|
601
602
|
};
|
|
602
|
-
if (options.model) body.model = options.model;
|
|
603
603
|
if (options.provider) body.provider = options.provider;
|
|
604
604
|
const data = await ctx.client.post("/api/generate", body);
|
|
605
605
|
const localPath = await saveOutput(data, "tts", options.outputDir);
|
|
@@ -991,6 +991,46 @@ function createProcess3dCommand() {
|
|
|
991
991
|
}
|
|
992
992
|
})
|
|
993
993
|
);
|
|
994
|
+
command.addCommand(
|
|
995
|
+
new Command6("refine").description("Refine a draft model to higher quality").requiredOption("--task-id <id>", "Tripo task ID").option("--output-dir <dir>", "Directory to save output", ".").action(async function(options) {
|
|
996
|
+
try {
|
|
997
|
+
const ctx = createContext(this);
|
|
998
|
+
const data = await ctx.client.post("/api/process3d", {
|
|
999
|
+
task_id: options.taskId,
|
|
1000
|
+
operation: "refine",
|
|
1001
|
+
params: {}
|
|
1002
|
+
});
|
|
1003
|
+
const localPath = await saveProcess3dOutput(data, "refine", options.outputDir);
|
|
1004
|
+
if (localPath) data.local_path = localPath;
|
|
1005
|
+
printSuccess("process3d.refine", data, ctx);
|
|
1006
|
+
} catch (error2) {
|
|
1007
|
+
printError("process3d.refine", error2);
|
|
1008
|
+
}
|
|
1009
|
+
})
|
|
1010
|
+
);
|
|
1011
|
+
command.addCommand(
|
|
1012
|
+
new Command6("import").description("Import an external 3D model for post-processing").option("--file-url <url>", "URL of the 3D model to import").option("--file-path <path>", "Local path of the 3D model to import").option("--output-dir <dir>", "Directory to save output", ".").action(async function(options) {
|
|
1013
|
+
try {
|
|
1014
|
+
const ctx = createContext(this);
|
|
1015
|
+
const params = {};
|
|
1016
|
+
if (options.fileUrl) params.file_url = options.fileUrl;
|
|
1017
|
+
if (options.filePath) params.file_path = options.filePath;
|
|
1018
|
+
if (!params.file_url && !params.file_path) {
|
|
1019
|
+
throw new Error("Either --file-url or --file-path is required");
|
|
1020
|
+
}
|
|
1021
|
+
const data = await ctx.client.post("/api/process3d", {
|
|
1022
|
+
task_id: "",
|
|
1023
|
+
operation: "import",
|
|
1024
|
+
params
|
|
1025
|
+
});
|
|
1026
|
+
const localPath = await saveProcess3dOutput(data, "import", options.outputDir);
|
|
1027
|
+
if (localPath) data.local_path = localPath;
|
|
1028
|
+
printSuccess("process3d.import", data, ctx);
|
|
1029
|
+
} catch (error2) {
|
|
1030
|
+
printError("process3d.import", error2);
|
|
1031
|
+
}
|
|
1032
|
+
})
|
|
1033
|
+
);
|
|
994
1034
|
return command;
|
|
995
1035
|
}
|
|
996
1036
|
|