-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
the d.ts files are currently way too complex, for example this is one method of the client api.
listPrompts(params?: ListPromptsRequest["params"], options?: RequestOptions): Promise<z.objectOutputType<z.objectUtil.extendShape<z.objectUtil.extendShape<{
_meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
}, {
nextCursor: z.ZodOptional<z.ZodString>;
}>, {
prompts: z.ZodArray<z.ZodObject<{
name: z.ZodString;
description: z.ZodOptional<z.ZodString>;
arguments: z.ZodOptional<z.ZodArray<z.ZodObject<{
name: z.ZodString;
description: z.ZodOptional<z.ZodString>;
required: z.ZodOptional<z.ZodBoolean>;
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
name: z.ZodString;
description: z.ZodOptional<z.ZodString>;
required: z.ZodOptional<z.ZodBoolean>;
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
name: z.ZodString;
description: z.ZodOptional<z.ZodString>;
required: z.ZodOptional<z.ZodBoolean>;
}, z.ZodTypeAny, "passthrough">>, "many">>;
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
name: z.ZodString;
description: z.ZodOptional<z.ZodString>;
arguments: z.ZodOptional<z.ZodArray<z.ZodObject<{
name: z.ZodString;
description: z.ZodOptional<z.ZodString>;
required: z.ZodOptional<z.ZodBoolean>;
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
name: z.ZodString;
description: z.ZodOptional<z.ZodString>;
required: z.ZodOptional<z.ZodBoolean>;
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
name: z.ZodString;
description: z.ZodOptional<z.ZodString>;
required: z.ZodOptional<z.ZodBoolean>;
}, z.ZodTypeAny, "passthrough">>, "many">>;
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
name: z.ZodString;
description: z.ZodOptional<z.ZodString>;
arguments: z.ZodOptional<z.ZodArray<z.ZodObject<{
name: z.ZodString;
description: z.ZodOptional<z.ZodString>;
required: z.ZodOptional<z.ZodBoolean>;
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
name: z.ZodString;
description: z.ZodOptional<z.ZodString>;
required: z.ZodOptional<z.ZodBoolean>;
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
name: z.ZodString;
description: z.ZodOptional<z.ZodString>;
required: z.ZodOptional<z.ZodBoolean>;
}, z.ZodTypeAny, "passthrough">>, "many">>;
}, z.ZodTypeAny, "passthrough">>, "many">;
}>, z.ZodTypeAny, "passthrough">>;
Describe the solution you'd like
a very simple fix would be to just create aliases for the return types and use them:
type ListPromptsResult = z.infer<typeof ListPromptsResultSchema>;
async listPrompts(
params?: ListPromptsRequest["params"],
options?: RequestOptions,
): Promise<ListPromptsResult> {
return this.request(
{ method: "prompts/list", params },
ListPromptsResultSchema,
options,
);
}
Describe alternatives you've considered
a even better version IMO would be to not use zod at all for the return types, just declare typescript types, and let typescript check if they are compatible.
cliffhall, thecopy and l1shen
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request