@meshy-ai/meshy-mcp-server 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/.env.example +14 -0
- package/LICENSE +21 -0
- package/README.md +108 -0
- package/dist/constants.d.ts +123 -0
- package/dist/constants.js +169 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +130 -0
- package/dist/instructions.d.ts +6 -0
- package/dist/instructions.js +90 -0
- package/dist/schemas/balance.d.ts +11 -0
- package/dist/schemas/balance.js +8 -0
- package/dist/schemas/common.d.ts +38 -0
- package/dist/schemas/common.js +52 -0
- package/dist/schemas/generation.d.ts +219 -0
- package/dist/schemas/generation.js +217 -0
- package/dist/schemas/image.d.ts +55 -0
- package/dist/schemas/image.js +46 -0
- package/dist/schemas/output.d.ts +75 -0
- package/dist/schemas/output.js +41 -0
- package/dist/schemas/postprocessing.d.ts +135 -0
- package/dist/schemas/postprocessing.js +123 -0
- package/dist/schemas/printing.d.ts +63 -0
- package/dist/schemas/printing.js +54 -0
- package/dist/schemas/tasks.d.ts +123 -0
- package/dist/schemas/tasks.js +85 -0
- package/dist/services/error-handler.d.ts +32 -0
- package/dist/services/error-handler.js +141 -0
- package/dist/services/file-utils.d.ts +15 -0
- package/dist/services/file-utils.js +55 -0
- package/dist/services/meshy-client.d.ts +54 -0
- package/dist/services/meshy-client.js +172 -0
- package/dist/services/output-manager.d.ts +52 -0
- package/dist/services/output-manager.js +284 -0
- package/dist/tools/balance.d.ts +9 -0
- package/dist/tools/balance.js +61 -0
- package/dist/tools/generation.d.ts +9 -0
- package/dist/tools/generation.js +419 -0
- package/dist/tools/image.d.ts +9 -0
- package/dist/tools/image.js +154 -0
- package/dist/tools/postprocessing.d.ts +9 -0
- package/dist/tools/postprocessing.js +405 -0
- package/dist/tools/printing.d.ts +9 -0
- package/dist/tools/printing.js +338 -0
- package/dist/tools/tasks.d.ts +9 -0
- package/dist/tools/tasks.js +1074 -0
- package/dist/tools/workspace.d.ts +9 -0
- package/dist/tools/workspace.js +161 -0
- package/dist/types.d.ts +261 -0
- package/dist/types.js +4 -0
- package/dist/utils/endpoints.d.ts +16 -0
- package/dist/utils/endpoints.js +38 -0
- package/dist/utils/request-builder.d.ts +15 -0
- package/dist/utils/request-builder.js +24 -0
- package/dist/utils/response-formatter.d.ts +27 -0
- package/dist/utils/response-formatter.js +37 -0
- package/dist/utils/slicer-detector.d.ts +29 -0
- package/dist/utils/slicer-detector.js +237 -0
- package/package.json +64 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output schemas for MCP structured content.
|
|
3
|
+
* These define the shape of structuredContent returned by tools.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
/**
|
|
7
|
+
* Output schema for task creation tools (text-to-3d, image-to-3d, remesh, etc.)
|
|
8
|
+
*/
|
|
9
|
+
export declare const TaskCreatedOutputSchema: z.ZodObject<{
|
|
10
|
+
task_id: z.ZodString;
|
|
11
|
+
status: z.ZodString;
|
|
12
|
+
message: z.ZodString;
|
|
13
|
+
estimated_time: z.ZodString;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
message: string;
|
|
16
|
+
status: string;
|
|
17
|
+
task_id: string;
|
|
18
|
+
estimated_time: string;
|
|
19
|
+
}, {
|
|
20
|
+
message: string;
|
|
21
|
+
status: string;
|
|
22
|
+
task_id: string;
|
|
23
|
+
estimated_time: string;
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Output schema for meshy_check_balance
|
|
27
|
+
*/
|
|
28
|
+
export declare const BalanceOutputSchema: z.ZodObject<{
|
|
29
|
+
balance: z.ZodNumber;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
balance: number;
|
|
32
|
+
}, {
|
|
33
|
+
balance: number;
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* Output schema for meshy_get_task_status
|
|
37
|
+
* Covers all outcomes: SUCCEEDED, FAILED, CANCELED, TIMEOUT, IN_PROGRESS, PENDING
|
|
38
|
+
*/
|
|
39
|
+
export declare const TaskStatusOutputSchema: z.ZodObject<{
|
|
40
|
+
outcome: z.ZodEnum<["SUCCEEDED", "FAILED", "CANCELED", "TIMEOUT", "IN_PROGRESS", "PENDING"]>;
|
|
41
|
+
task_id: z.ZodString;
|
|
42
|
+
status: z.ZodString;
|
|
43
|
+
progress: z.ZodNumber;
|
|
44
|
+
wait_time_seconds: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
poll_count: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
model_urls: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
47
|
+
vertex_count: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
face_count: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
error_code: z.ZodOptional<z.ZodString>;
|
|
50
|
+
error_message: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
status: string;
|
|
53
|
+
task_id: string;
|
|
54
|
+
outcome: "PENDING" | "IN_PROGRESS" | "SUCCEEDED" | "FAILED" | "CANCELED" | "TIMEOUT";
|
|
55
|
+
progress: number;
|
|
56
|
+
wait_time_seconds?: number | undefined;
|
|
57
|
+
poll_count?: number | undefined;
|
|
58
|
+
model_urls?: Record<string, string> | undefined;
|
|
59
|
+
vertex_count?: number | undefined;
|
|
60
|
+
face_count?: number | undefined;
|
|
61
|
+
error_code?: string | undefined;
|
|
62
|
+
error_message?: string | undefined;
|
|
63
|
+
}, {
|
|
64
|
+
status: string;
|
|
65
|
+
task_id: string;
|
|
66
|
+
outcome: "PENDING" | "IN_PROGRESS" | "SUCCEEDED" | "FAILED" | "CANCELED" | "TIMEOUT";
|
|
67
|
+
progress: number;
|
|
68
|
+
wait_time_seconds?: number | undefined;
|
|
69
|
+
poll_count?: number | undefined;
|
|
70
|
+
model_urls?: Record<string, string> | undefined;
|
|
71
|
+
vertex_count?: number | undefined;
|
|
72
|
+
face_count?: number | undefined;
|
|
73
|
+
error_code?: string | undefined;
|
|
74
|
+
error_message?: string | undefined;
|
|
75
|
+
}>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output schemas for MCP structured content.
|
|
3
|
+
* These define the shape of structuredContent returned by tools.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
/**
|
|
7
|
+
* Output schema for task creation tools (text-to-3d, image-to-3d, remesh, etc.)
|
|
8
|
+
*/
|
|
9
|
+
export const TaskCreatedOutputSchema = z.object({
|
|
10
|
+
task_id: z.string().describe("Unique task identifier for polling with meshy_get_task_status"),
|
|
11
|
+
status: z.string().describe("Initial task status (typically 'PENDING')"),
|
|
12
|
+
message: z.string().describe("Human-readable status message"),
|
|
13
|
+
estimated_time: z.string().describe("Estimated completion time")
|
|
14
|
+
});
|
|
15
|
+
/**
|
|
16
|
+
* Output schema for meshy_check_balance
|
|
17
|
+
*/
|
|
18
|
+
export const BalanceOutputSchema = z.object({
|
|
19
|
+
balance: z.number().describe("Current credit balance")
|
|
20
|
+
});
|
|
21
|
+
/**
|
|
22
|
+
* Output schema for meshy_get_task_status
|
|
23
|
+
* Covers all outcomes: SUCCEEDED, FAILED, CANCELED, TIMEOUT, IN_PROGRESS, PENDING
|
|
24
|
+
*/
|
|
25
|
+
export const TaskStatusOutputSchema = z.object({
|
|
26
|
+
outcome: z.enum(["SUCCEEDED", "FAILED", "CANCELED", "TIMEOUT", "IN_PROGRESS", "PENDING"])
|
|
27
|
+
.describe("Final outcome of the status check"),
|
|
28
|
+
task_id: z.string().describe("Task identifier"),
|
|
29
|
+
status: z.string().describe("Current task status from the API"),
|
|
30
|
+
progress: z.number().describe("Progress percentage (0-100)"),
|
|
31
|
+
// wait mode fields
|
|
32
|
+
wait_time_seconds: z.number().optional().describe("Total wait time in seconds (wait mode only)"),
|
|
33
|
+
poll_count: z.number().optional().describe("Number of polls performed (wait mode only)"),
|
|
34
|
+
// success fields
|
|
35
|
+
model_urls: z.record(z.string()).optional().describe("Available model download URLs"),
|
|
36
|
+
vertex_count: z.number().optional().describe("Number of vertices in the model"),
|
|
37
|
+
face_count: z.number().optional().describe("Number of faces in the model"),
|
|
38
|
+
// error fields
|
|
39
|
+
error_code: z.string().optional().describe("Error code if task failed"),
|
|
40
|
+
error_message: z.string().optional().describe("Error message if task failed")
|
|
41
|
+
});
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for post-processing tools (remesh, retexture, rig, animate)
|
|
3
|
+
*/
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { AIModel, OriginAt, Topology, AnimationPostProcessOp } from "../constants.js";
|
|
6
|
+
/**
|
|
7
|
+
* Remesh input schema
|
|
8
|
+
*/
|
|
9
|
+
export declare const RemeshInputSchema: z.ZodObject<{
|
|
10
|
+
input_task_id: z.ZodOptional<z.ZodString>;
|
|
11
|
+
model_url: z.ZodOptional<z.ZodString>;
|
|
12
|
+
target_formats: z.ZodDefault<z.ZodArray<z.ZodEnum<["glb", "fbx", "obj", "usdz", "blend", "stl", "3mf"]>, "many">>;
|
|
13
|
+
topology: z.ZodOptional<z.ZodNativeEnum<typeof Topology>>;
|
|
14
|
+
target_polycount: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
resize_height: z.ZodDefault<z.ZodNumber>;
|
|
16
|
+
auto_size: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
origin_at: z.ZodOptional<z.ZodNativeEnum<typeof OriginAt>>;
|
|
18
|
+
convert_format_only: z.ZodDefault<z.ZodBoolean>;
|
|
19
|
+
response_format: z.ZodDefault<z.ZodNativeEnum<typeof import("../constants.js").ResponseFormat>>;
|
|
20
|
+
}, "strict", z.ZodTypeAny, {
|
|
21
|
+
target_formats: ("glb" | "fbx" | "usdz" | "3mf" | "obj" | "blend" | "stl")[];
|
|
22
|
+
response_format: import("../constants.js").ResponseFormat;
|
|
23
|
+
resize_height: number;
|
|
24
|
+
convert_format_only: boolean;
|
|
25
|
+
topology?: Topology | undefined;
|
|
26
|
+
target_polycount?: number | undefined;
|
|
27
|
+
auto_size?: boolean | undefined;
|
|
28
|
+
origin_at?: OriginAt | undefined;
|
|
29
|
+
input_task_id?: string | undefined;
|
|
30
|
+
model_url?: string | undefined;
|
|
31
|
+
}, {
|
|
32
|
+
topology?: Topology | undefined;
|
|
33
|
+
target_polycount?: number | undefined;
|
|
34
|
+
target_formats?: ("glb" | "fbx" | "usdz" | "3mf" | "obj" | "blend" | "stl")[] | undefined;
|
|
35
|
+
auto_size?: boolean | undefined;
|
|
36
|
+
origin_at?: OriginAt | undefined;
|
|
37
|
+
response_format?: import("../constants.js").ResponseFormat | undefined;
|
|
38
|
+
input_task_id?: string | undefined;
|
|
39
|
+
model_url?: string | undefined;
|
|
40
|
+
resize_height?: number | undefined;
|
|
41
|
+
convert_format_only?: boolean | undefined;
|
|
42
|
+
}>;
|
|
43
|
+
/**
|
|
44
|
+
* Retexture input schema
|
|
45
|
+
*/
|
|
46
|
+
export declare const RetextureInputSchema: z.ZodObject<{
|
|
47
|
+
input_task_id: z.ZodOptional<z.ZodString>;
|
|
48
|
+
model_url: z.ZodOptional<z.ZodString>;
|
|
49
|
+
text_style_prompt: z.ZodOptional<z.ZodString>;
|
|
50
|
+
image_style_url: z.ZodOptional<z.ZodString>;
|
|
51
|
+
ai_model: z.ZodDefault<z.ZodNativeEnum<typeof AIModel>>;
|
|
52
|
+
enable_original_uv: z.ZodDefault<z.ZodBoolean>;
|
|
53
|
+
enable_pbr: z.ZodDefault<z.ZodBoolean>;
|
|
54
|
+
remove_lighting: z.ZodDefault<z.ZodBoolean>;
|
|
55
|
+
target_formats: z.ZodOptional<z.ZodArray<z.ZodEnum<["glb", "obj", "fbx", "stl", "usdz", "3mf"]>, "many">>;
|
|
56
|
+
response_format: z.ZodDefault<z.ZodNativeEnum<typeof import("../constants.js").ResponseFormat>>;
|
|
57
|
+
}, "strict", z.ZodTypeAny, {
|
|
58
|
+
ai_model: AIModel;
|
|
59
|
+
response_format: import("../constants.js").ResponseFormat;
|
|
60
|
+
enable_pbr: boolean;
|
|
61
|
+
remove_lighting: boolean;
|
|
62
|
+
enable_original_uv: boolean;
|
|
63
|
+
target_formats?: ("glb" | "fbx" | "usdz" | "3mf" | "obj" | "stl")[] | undefined;
|
|
64
|
+
input_task_id?: string | undefined;
|
|
65
|
+
model_url?: string | undefined;
|
|
66
|
+
text_style_prompt?: string | undefined;
|
|
67
|
+
image_style_url?: string | undefined;
|
|
68
|
+
}, {
|
|
69
|
+
ai_model?: AIModel | undefined;
|
|
70
|
+
target_formats?: ("glb" | "fbx" | "usdz" | "3mf" | "obj" | "stl")[] | undefined;
|
|
71
|
+
response_format?: import("../constants.js").ResponseFormat | undefined;
|
|
72
|
+
enable_pbr?: boolean | undefined;
|
|
73
|
+
remove_lighting?: boolean | undefined;
|
|
74
|
+
input_task_id?: string | undefined;
|
|
75
|
+
model_url?: string | undefined;
|
|
76
|
+
text_style_prompt?: string | undefined;
|
|
77
|
+
image_style_url?: string | undefined;
|
|
78
|
+
enable_original_uv?: boolean | undefined;
|
|
79
|
+
}>;
|
|
80
|
+
/**
|
|
81
|
+
* Rig (rigging) input schema
|
|
82
|
+
*/
|
|
83
|
+
export declare const RigInputSchema: z.ZodObject<{
|
|
84
|
+
input_task_id: z.ZodOptional<z.ZodString>;
|
|
85
|
+
model_url: z.ZodOptional<z.ZodString>;
|
|
86
|
+
height_meters: z.ZodDefault<z.ZodNumber>;
|
|
87
|
+
texture_image_url: z.ZodOptional<z.ZodString>;
|
|
88
|
+
response_format: z.ZodDefault<z.ZodNativeEnum<typeof import("../constants.js").ResponseFormat>>;
|
|
89
|
+
}, "strict", z.ZodTypeAny, {
|
|
90
|
+
response_format: import("../constants.js").ResponseFormat;
|
|
91
|
+
height_meters: number;
|
|
92
|
+
texture_image_url?: string | undefined;
|
|
93
|
+
input_task_id?: string | undefined;
|
|
94
|
+
model_url?: string | undefined;
|
|
95
|
+
}, {
|
|
96
|
+
response_format?: import("../constants.js").ResponseFormat | undefined;
|
|
97
|
+
texture_image_url?: string | undefined;
|
|
98
|
+
input_task_id?: string | undefined;
|
|
99
|
+
model_url?: string | undefined;
|
|
100
|
+
height_meters?: number | undefined;
|
|
101
|
+
}>;
|
|
102
|
+
/**
|
|
103
|
+
* Animate input schema
|
|
104
|
+
*/
|
|
105
|
+
export declare const AnimateInputSchema: z.ZodObject<{
|
|
106
|
+
rig_task_id: z.ZodString;
|
|
107
|
+
action_id: z.ZodNumber;
|
|
108
|
+
post_process: z.ZodOptional<z.ZodObject<{
|
|
109
|
+
operation_type: z.ZodNativeEnum<typeof AnimationPostProcessOp>;
|
|
110
|
+
fps: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<24>, z.ZodLiteral<25>, z.ZodLiteral<30>, z.ZodLiteral<60>]>>;
|
|
111
|
+
}, "strip", z.ZodTypeAny, {
|
|
112
|
+
operation_type: AnimationPostProcessOp;
|
|
113
|
+
fps?: 30 | 24 | 60 | 25 | undefined;
|
|
114
|
+
}, {
|
|
115
|
+
operation_type: AnimationPostProcessOp;
|
|
116
|
+
fps?: 30 | 24 | 60 | 25 | undefined;
|
|
117
|
+
}>>;
|
|
118
|
+
response_format: z.ZodDefault<z.ZodNativeEnum<typeof import("../constants.js").ResponseFormat>>;
|
|
119
|
+
}, "strict", z.ZodTypeAny, {
|
|
120
|
+
response_format: import("../constants.js").ResponseFormat;
|
|
121
|
+
rig_task_id: string;
|
|
122
|
+
action_id: number;
|
|
123
|
+
post_process?: {
|
|
124
|
+
operation_type: AnimationPostProcessOp;
|
|
125
|
+
fps?: 30 | 24 | 60 | 25 | undefined;
|
|
126
|
+
} | undefined;
|
|
127
|
+
}, {
|
|
128
|
+
rig_task_id: string;
|
|
129
|
+
action_id: number;
|
|
130
|
+
response_format?: import("../constants.js").ResponseFormat | undefined;
|
|
131
|
+
post_process?: {
|
|
132
|
+
operation_type: AnimationPostProcessOp;
|
|
133
|
+
fps?: 30 | 24 | 60 | 25 | undefined;
|
|
134
|
+
} | undefined;
|
|
135
|
+
}>;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for post-processing tools (remesh, retexture, rig, animate)
|
|
3
|
+
*/
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { AIModel, OriginAt, Topology, AnimationPostProcessOp } from "../constants.js";
|
|
6
|
+
import { ResponseFormatSchema, UrlSchema } from "./common.js";
|
|
7
|
+
/**
|
|
8
|
+
* Remesh input schema
|
|
9
|
+
*/
|
|
10
|
+
export const RemeshInputSchema = z.object({
|
|
11
|
+
input_task_id: z.string()
|
|
12
|
+
.min(1)
|
|
13
|
+
.optional()
|
|
14
|
+
.describe("Task ID of an existing completed task to remesh"),
|
|
15
|
+
model_url: UrlSchema
|
|
16
|
+
.optional()
|
|
17
|
+
.describe("Direct URL to a model file to remesh"),
|
|
18
|
+
target_formats: z.array(z.enum(["glb", "fbx", "obj", "usdz", "blend", "stl", "3mf"]))
|
|
19
|
+
.default(["glb"])
|
|
20
|
+
.describe("Output formats to generate (default: ['glb']). NOTE: 3MF is NOT included by default — you MUST explicitly include '3mf' to receive it."),
|
|
21
|
+
topology: z.nativeEnum(Topology)
|
|
22
|
+
.optional()
|
|
23
|
+
.describe("Mesh topology type (quad or triangle)"),
|
|
24
|
+
target_polycount: z.number()
|
|
25
|
+
.int()
|
|
26
|
+
.min(100, "Polycount must be at least 100")
|
|
27
|
+
.max(300000, "Polycount cannot exceed 300,000")
|
|
28
|
+
.optional()
|
|
29
|
+
.describe("Target polygon count for the remeshed model (100–300,000)"),
|
|
30
|
+
resize_height: z.number()
|
|
31
|
+
.default(0)
|
|
32
|
+
.describe("Resize model to this height in meters (0 = no resize). Mutually exclusive with auto_size."),
|
|
33
|
+
auto_size: z.boolean()
|
|
34
|
+
.optional()
|
|
35
|
+
.describe("Use AI to auto-estimate real-world height. Mutually exclusive with resize_height. Default false."),
|
|
36
|
+
origin_at: z.nativeEnum(OriginAt)
|
|
37
|
+
.optional()
|
|
38
|
+
.describe("Where to place the model origin: 'bottom' or 'center'. Default 'bottom' when auto_size is true."),
|
|
39
|
+
convert_format_only: z.boolean()
|
|
40
|
+
.default(false)
|
|
41
|
+
.describe("Only convert format without remeshing"),
|
|
42
|
+
response_format: ResponseFormatSchema
|
|
43
|
+
}).strict();
|
|
44
|
+
/**
|
|
45
|
+
* Retexture input schema
|
|
46
|
+
*/
|
|
47
|
+
export const RetextureInputSchema = z.object({
|
|
48
|
+
input_task_id: z.string()
|
|
49
|
+
.min(1)
|
|
50
|
+
.optional()
|
|
51
|
+
.describe("Task ID of an existing completed task to retexture"),
|
|
52
|
+
model_url: UrlSchema
|
|
53
|
+
.optional()
|
|
54
|
+
.describe("Direct URL to a model file to retexture"),
|
|
55
|
+
text_style_prompt: z.string()
|
|
56
|
+
.max(600, "Prompt must not exceed 600 characters")
|
|
57
|
+
.optional()
|
|
58
|
+
.describe("Text prompt describing the desired texture style. Max 600 characters"),
|
|
59
|
+
image_style_url: UrlSchema
|
|
60
|
+
.optional()
|
|
61
|
+
.describe("URL of an image to use as texture style reference"),
|
|
62
|
+
ai_model: z.nativeEnum(AIModel)
|
|
63
|
+
.default(AIModel.LATEST)
|
|
64
|
+
.describe("AI model: 'meshy-5', 'meshy-6', or 'latest' (default, currently resolves to Meshy 6). IMPORTANT: Before calling this tool, ask the user which model to use and explain the differences: meshy-6/latest = best quality (10 credits), meshy-5 = previous gen (10 credits)"),
|
|
65
|
+
enable_original_uv: z.boolean()
|
|
66
|
+
.default(true)
|
|
67
|
+
.describe("Preserve the original UV mapping"),
|
|
68
|
+
enable_pbr: z.boolean()
|
|
69
|
+
.default(false)
|
|
70
|
+
.describe("Enable physically-based rendering textures"),
|
|
71
|
+
remove_lighting: z.boolean()
|
|
72
|
+
.default(true)
|
|
73
|
+
.describe("Removes highlights and shadows from the base color texture for cleaner results under custom lighting. Default true. Only supported when ai_model is meshy-6 or latest"),
|
|
74
|
+
target_formats: z.array(z.enum(["glb", "obj", "fbx", "stl", "usdz", "3mf"]))
|
|
75
|
+
.optional()
|
|
76
|
+
.describe("Output formats to generate. When omitted, produces glb/obj/fbx/stl/usdz but NOT 3mf. To get 3MF, you MUST include '3mf' explicitly."),
|
|
77
|
+
response_format: ResponseFormatSchema
|
|
78
|
+
}).strict();
|
|
79
|
+
/**
|
|
80
|
+
* Rig (rigging) input schema
|
|
81
|
+
*/
|
|
82
|
+
export const RigInputSchema = z.object({
|
|
83
|
+
input_task_id: z.string()
|
|
84
|
+
.min(1)
|
|
85
|
+
.optional()
|
|
86
|
+
.describe("Task ID of an existing completed task to rig"),
|
|
87
|
+
model_url: UrlSchema
|
|
88
|
+
.optional()
|
|
89
|
+
.describe("Direct URL to a model file to rig"),
|
|
90
|
+
height_meters: z.number()
|
|
91
|
+
.default(1.7)
|
|
92
|
+
.describe("Height of the character in meters (default: 1.7)"),
|
|
93
|
+
texture_image_url: UrlSchema
|
|
94
|
+
.optional()
|
|
95
|
+
.describe("URL of a texture image to apply to the model"),
|
|
96
|
+
response_format: ResponseFormatSchema
|
|
97
|
+
}).strict();
|
|
98
|
+
/**
|
|
99
|
+
* Animate input schema
|
|
100
|
+
*/
|
|
101
|
+
export const AnimateInputSchema = z.object({
|
|
102
|
+
rig_task_id: z.string()
|
|
103
|
+
.min(1, "Rig task ID is required")
|
|
104
|
+
.describe("Task ID of the completed rigging task to animate"),
|
|
105
|
+
action_id: z.number()
|
|
106
|
+
.int("Action ID must be an integer")
|
|
107
|
+
.describe("ID of the animation action to apply"),
|
|
108
|
+
post_process: z.object({
|
|
109
|
+
operation_type: z.nativeEnum(AnimationPostProcessOp)
|
|
110
|
+
.describe("Post-processing operation to apply"),
|
|
111
|
+
fps: z.union([
|
|
112
|
+
z.literal(24),
|
|
113
|
+
z.literal(25),
|
|
114
|
+
z.literal(30),
|
|
115
|
+
z.literal(60)
|
|
116
|
+
])
|
|
117
|
+
.optional()
|
|
118
|
+
.describe("Target FPS for change_fps operation")
|
|
119
|
+
})
|
|
120
|
+
.optional()
|
|
121
|
+
.describe("Optional post-processing to apply after animation"),
|
|
122
|
+
response_format: ResponseFormatSchema
|
|
123
|
+
}).strict();
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for 3D printing tools
|
|
3
|
+
*/
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
/**
|
|
6
|
+
* Send to slicer input schema
|
|
7
|
+
* Detects installed slicers and returns launch commands.
|
|
8
|
+
*/
|
|
9
|
+
export declare const SendToSlicerInputSchema: z.ZodObject<{
|
|
10
|
+
model_url: z.ZodString;
|
|
11
|
+
slicer_type: z.ZodDefault<z.ZodEnum<["auto", "bambu", "orcaslicer", "creality_print", "elegoo_slicer", "anycubic_slicer", "prusaslicer", "cura"]>>;
|
|
12
|
+
file_name: z.ZodDefault<z.ZodString>;
|
|
13
|
+
is_multicolor: z.ZodDefault<z.ZodBoolean>;
|
|
14
|
+
response_format: z.ZodDefault<z.ZodNativeEnum<typeof import("../constants.js").ResponseFormat>>;
|
|
15
|
+
}, "strict", z.ZodTypeAny, {
|
|
16
|
+
response_format: import("../constants.js").ResponseFormat;
|
|
17
|
+
model_url: string;
|
|
18
|
+
slicer_type: "auto" | "bambu" | "orcaslicer" | "creality_print" | "elegoo_slicer" | "anycubic_slicer" | "prusaslicer" | "cura";
|
|
19
|
+
file_name: string;
|
|
20
|
+
is_multicolor: boolean;
|
|
21
|
+
}, {
|
|
22
|
+
model_url: string;
|
|
23
|
+
response_format?: import("../constants.js").ResponseFormat | undefined;
|
|
24
|
+
slicer_type?: "auto" | "bambu" | "orcaslicer" | "creality_print" | "elegoo_slicer" | "anycubic_slicer" | "prusaslicer" | "cura" | undefined;
|
|
25
|
+
file_name?: string | undefined;
|
|
26
|
+
is_multicolor?: boolean | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* Analyze printability input schema
|
|
30
|
+
*/
|
|
31
|
+
export declare const AnalyzePrintabilityInputSchema: z.ZodObject<{
|
|
32
|
+
task_id: z.ZodString;
|
|
33
|
+
task_type: z.ZodDefault<z.ZodString>;
|
|
34
|
+
response_format: z.ZodDefault<z.ZodNativeEnum<typeof import("../constants.js").ResponseFormat>>;
|
|
35
|
+
}, "strict", z.ZodTypeAny, {
|
|
36
|
+
response_format: import("../constants.js").ResponseFormat;
|
|
37
|
+
task_id: string;
|
|
38
|
+
task_type: string;
|
|
39
|
+
}, {
|
|
40
|
+
task_id: string;
|
|
41
|
+
response_format?: import("../constants.js").ResponseFormat | undefined;
|
|
42
|
+
task_type?: string | undefined;
|
|
43
|
+
}>;
|
|
44
|
+
/**
|
|
45
|
+
* Process multicolor input schema
|
|
46
|
+
* Calls POST /openapi/v1/print/multi-color to create a multicolor print task.
|
|
47
|
+
*/
|
|
48
|
+
export declare const ProcessMulticolorInputSchema: z.ZodObject<{
|
|
49
|
+
input_task_id: z.ZodString;
|
|
50
|
+
max_colors: z.ZodDefault<z.ZodNumber>;
|
|
51
|
+
max_depth: z.ZodDefault<z.ZodNumber>;
|
|
52
|
+
response_format: z.ZodDefault<z.ZodNativeEnum<typeof import("../constants.js").ResponseFormat>>;
|
|
53
|
+
}, "strict", z.ZodTypeAny, {
|
|
54
|
+
response_format: import("../constants.js").ResponseFormat;
|
|
55
|
+
input_task_id: string;
|
|
56
|
+
max_colors: number;
|
|
57
|
+
max_depth: number;
|
|
58
|
+
}, {
|
|
59
|
+
input_task_id: string;
|
|
60
|
+
response_format?: import("../constants.js").ResponseFormat | undefined;
|
|
61
|
+
max_colors?: number | undefined;
|
|
62
|
+
max_depth?: number | undefined;
|
|
63
|
+
}>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for 3D printing tools
|
|
3
|
+
*/
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { ResponseFormatSchema, TaskIdSchema, UrlSchema } from "./common.js";
|
|
6
|
+
/**
|
|
7
|
+
* Send to slicer input schema
|
|
8
|
+
* Detects installed slicers and returns launch commands.
|
|
9
|
+
*/
|
|
10
|
+
export const SendToSlicerInputSchema = z.object({
|
|
11
|
+
model_url: UrlSchema
|
|
12
|
+
.describe("Download URL of the model file to send to slicer"),
|
|
13
|
+
slicer_type: z.enum(["auto", "bambu", "orcaslicer", "creality_print", "elegoo_slicer", "anycubic_slicer", "prusaslicer", "cura"])
|
|
14
|
+
.default("auto")
|
|
15
|
+
.describe("Target slicer. 'auto' (default) detects all installed slicers and recommends the best one. Specify a value to target a particular slicer."),
|
|
16
|
+
file_name: z.string()
|
|
17
|
+
.default("meshy_model.3mf")
|
|
18
|
+
.describe("File name for the model (default: meshy_model.3mf)"),
|
|
19
|
+
is_multicolor: z.boolean()
|
|
20
|
+
.default(false)
|
|
21
|
+
.describe("If true, only recommends multicolor-capable slicers (OrcaSlicer, Bambu Studio, Creality Print, Elegoo Slicer, Anycubic Slicer Next)"),
|
|
22
|
+
response_format: ResponseFormatSchema
|
|
23
|
+
}).strict();
|
|
24
|
+
/**
|
|
25
|
+
* Analyze printability input schema
|
|
26
|
+
*/
|
|
27
|
+
export const AnalyzePrintabilityInputSchema = z.object({
|
|
28
|
+
task_id: TaskIdSchema,
|
|
29
|
+
task_type: z.string()
|
|
30
|
+
.default("text-to-3d")
|
|
31
|
+
.describe("Task type of the model to analyze"),
|
|
32
|
+
response_format: ResponseFormatSchema
|
|
33
|
+
}).strict();
|
|
34
|
+
/**
|
|
35
|
+
* Process multicolor input schema
|
|
36
|
+
* Calls POST /openapi/v1/print/multi-color to create a multicolor print task.
|
|
37
|
+
*/
|
|
38
|
+
export const ProcessMulticolorInputSchema = z.object({
|
|
39
|
+
input_task_id: TaskIdSchema
|
|
40
|
+
.describe("Task ID of a completed TEXTURED model. The model must have textures (run meshy_text_to_3d_refine or meshy_retexture first)."),
|
|
41
|
+
max_colors: z.number()
|
|
42
|
+
.int()
|
|
43
|
+
.min(1, "Minimum 1 color")
|
|
44
|
+
.max(16, "Maximum 16 colors")
|
|
45
|
+
.default(4)
|
|
46
|
+
.describe("Maximum number of colors for segmentation (1-16, default: 4)"),
|
|
47
|
+
max_depth: z.number()
|
|
48
|
+
.int()
|
|
49
|
+
.min(3, "Minimum depth 3")
|
|
50
|
+
.max(6, "Maximum depth 6")
|
|
51
|
+
.default(4)
|
|
52
|
+
.describe("Segmentation depth level (3-6, default: 4). Higher values produce finer color separation."),
|
|
53
|
+
response_format: ResponseFormatSchema
|
|
54
|
+
}).strict();
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for task management tools
|
|
3
|
+
*/
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { TaskStatus, TaskPhase, TaskType } from "../constants.js";
|
|
6
|
+
/**
|
|
7
|
+
* Get task status input schema (also supports wait mode)
|
|
8
|
+
*/
|
|
9
|
+
export declare const GetTaskStatusInputSchema: z.ZodObject<{
|
|
10
|
+
task_id: z.ZodString;
|
|
11
|
+
task_type: z.ZodDefault<z.ZodNativeEnum<typeof TaskType>>;
|
|
12
|
+
wait: z.ZodDefault<z.ZodBoolean>;
|
|
13
|
+
timeout_seconds: z.ZodDefault<z.ZodNumber>;
|
|
14
|
+
response_format: z.ZodDefault<z.ZodNativeEnum<typeof import("../constants.js").ResponseFormat>>;
|
|
15
|
+
}, "strict", z.ZodTypeAny, {
|
|
16
|
+
response_format: import("../constants.js").ResponseFormat;
|
|
17
|
+
task_id: string;
|
|
18
|
+
task_type: TaskType;
|
|
19
|
+
wait: boolean;
|
|
20
|
+
timeout_seconds: number;
|
|
21
|
+
}, {
|
|
22
|
+
task_id: string;
|
|
23
|
+
response_format?: import("../constants.js").ResponseFormat | undefined;
|
|
24
|
+
task_type?: TaskType | undefined;
|
|
25
|
+
wait?: boolean | undefined;
|
|
26
|
+
timeout_seconds?: number | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* List tasks input schema
|
|
30
|
+
*/
|
|
31
|
+
export declare const ListTasksInputSchema: z.ZodObject<{
|
|
32
|
+
task_type: z.ZodOptional<z.ZodNativeEnum<typeof TaskType>>;
|
|
33
|
+
sort_by: z.ZodDefault<z.ZodEnum<["+created_at", "-created_at"]>>;
|
|
34
|
+
status: z.ZodOptional<z.ZodNativeEnum<typeof TaskStatus>>;
|
|
35
|
+
phase: z.ZodOptional<z.ZodNativeEnum<typeof TaskPhase>>;
|
|
36
|
+
response_format: z.ZodDefault<z.ZodNativeEnum<typeof import("../constants.js").ResponseFormat>>;
|
|
37
|
+
} & {
|
|
38
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
39
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
40
|
+
}, "strict", z.ZodTypeAny, {
|
|
41
|
+
limit: number;
|
|
42
|
+
offset: number;
|
|
43
|
+
response_format: import("../constants.js").ResponseFormat;
|
|
44
|
+
sort_by: "+created_at" | "-created_at";
|
|
45
|
+
status?: TaskStatus | undefined;
|
|
46
|
+
task_type?: TaskType | undefined;
|
|
47
|
+
phase?: TaskPhase | undefined;
|
|
48
|
+
}, {
|
|
49
|
+
limit?: number | undefined;
|
|
50
|
+
offset?: number | undefined;
|
|
51
|
+
status?: TaskStatus | undefined;
|
|
52
|
+
response_format?: import("../constants.js").ResponseFormat | undefined;
|
|
53
|
+
task_type?: TaskType | undefined;
|
|
54
|
+
sort_by?: "+created_at" | "-created_at" | undefined;
|
|
55
|
+
phase?: TaskPhase | undefined;
|
|
56
|
+
}>;
|
|
57
|
+
/**
|
|
58
|
+
* Cancel task input schema
|
|
59
|
+
*/
|
|
60
|
+
export declare const CancelTaskInputSchema: z.ZodObject<{
|
|
61
|
+
task_id: z.ZodString;
|
|
62
|
+
task_type: z.ZodDefault<z.ZodNativeEnum<typeof TaskType>>;
|
|
63
|
+
}, "strict", z.ZodTypeAny, {
|
|
64
|
+
task_id: string;
|
|
65
|
+
task_type: TaskType;
|
|
66
|
+
}, {
|
|
67
|
+
task_id: string;
|
|
68
|
+
task_type?: TaskType | undefined;
|
|
69
|
+
}>;
|
|
70
|
+
/**
|
|
71
|
+
* Download model input schema
|
|
72
|
+
*/
|
|
73
|
+
export declare const DownloadModelInputSchema: z.ZodObject<{
|
|
74
|
+
task_id: z.ZodString;
|
|
75
|
+
task_type: z.ZodDefault<z.ZodNativeEnum<typeof TaskType>>;
|
|
76
|
+
format: z.ZodDefault<z.ZodEnum<["glb", "fbx", "usdz", "stl", "obj", "3mf"]>>;
|
|
77
|
+
include_textures: z.ZodDefault<z.ZodBoolean>;
|
|
78
|
+
save_to: z.ZodOptional<z.ZodString>;
|
|
79
|
+
parent_task_id: z.ZodOptional<z.ZodString>;
|
|
80
|
+
print_ready: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
print_height_mm: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
}, "strict", z.ZodTypeAny, {
|
|
83
|
+
task_id: string;
|
|
84
|
+
task_type: TaskType;
|
|
85
|
+
format: "glb" | "fbx" | "usdz" | "3mf" | "obj" | "stl";
|
|
86
|
+
include_textures: boolean;
|
|
87
|
+
save_to?: string | undefined;
|
|
88
|
+
parent_task_id?: string | undefined;
|
|
89
|
+
print_ready?: boolean | undefined;
|
|
90
|
+
print_height_mm?: number | undefined;
|
|
91
|
+
}, {
|
|
92
|
+
task_id: string;
|
|
93
|
+
task_type?: TaskType | undefined;
|
|
94
|
+
format?: "glb" | "fbx" | "usdz" | "3mf" | "obj" | "stl" | undefined;
|
|
95
|
+
include_textures?: boolean | undefined;
|
|
96
|
+
save_to?: string | undefined;
|
|
97
|
+
parent_task_id?: string | undefined;
|
|
98
|
+
print_ready?: boolean | undefined;
|
|
99
|
+
print_height_mm?: number | undefined;
|
|
100
|
+
}>;
|
|
101
|
+
/**
|
|
102
|
+
* List models input schema
|
|
103
|
+
*/
|
|
104
|
+
export declare const ListModelsInputSchema: z.ZodObject<{
|
|
105
|
+
workspace_id: z.ZodOptional<z.ZodString>;
|
|
106
|
+
filter: z.ZodDefault<z.ZodEnum<["all", "published", "private"]>>;
|
|
107
|
+
response_format: z.ZodDefault<z.ZodNativeEnum<typeof import("../constants.js").ResponseFormat>>;
|
|
108
|
+
} & {
|
|
109
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
110
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
111
|
+
}, "strict", z.ZodTypeAny, {
|
|
112
|
+
limit: number;
|
|
113
|
+
offset: number;
|
|
114
|
+
filter: "all" | "published" | "private";
|
|
115
|
+
response_format: import("../constants.js").ResponseFormat;
|
|
116
|
+
workspace_id?: string | undefined;
|
|
117
|
+
}, {
|
|
118
|
+
limit?: number | undefined;
|
|
119
|
+
offset?: number | undefined;
|
|
120
|
+
filter?: "all" | "published" | "private" | undefined;
|
|
121
|
+
response_format?: import("../constants.js").ResponseFormat | undefined;
|
|
122
|
+
workspace_id?: string | undefined;
|
|
123
|
+
}>;
|