Apply formatter

This commit is contained in:
Dominik Jain 2025-09-11 11:38:39 +02:00
parent 4b755e4381
commit f8b6c05df4
4 changed files with 7 additions and 23 deletions

View File

@ -80,10 +80,7 @@ class PenpotMcpServer {
* the internal registry for later execution.
*/
private registerTools(): void {
const toolInstances: Tool[] = [
new HelloWorldTool(),
new ToolPrintText(this.connectedClients),
];
const toolInstances: Tool[] = [new HelloWorldTool(), new ToolPrintText(this.connectedClients)];
for (const tool of toolInstances) {
this.tools.set(tool.definition.name, tool);
@ -150,9 +147,7 @@ class PenpotMcpServer {
* streamable HTTP transport protocol.
*/
private async handleStreamableHttpRequest(req: any, res: any): Promise<void> {
const { StreamableHTTPServerTransport } = await import(
"@modelcontextprotocol/sdk/server/streamableHttp.js"
);
const { StreamableHTTPServerTransport } = await import("@modelcontextprotocol/sdk/server/streamableHttp.js");
const { randomUUID } = await import("node:crypto");
const { isInitializeRequest } = await import("@modelcontextprotocol/sdk/types.js");
@ -321,9 +316,7 @@ async function main(): Promise<void> {
} else if (args[i] === "--help" || args[i] === "-h") {
console.log("Usage: node dist/index.js [options]");
console.log("Options:");
console.log(
" --port, -p <number> Port number for the HTTP/SSE server (default: 4401)"
);
console.log(" --port, -p <number> Port number for the HTTP/SSE server (default: 4401)");
console.log(" --help, -h Show this help message");
process.exit(0);
}

View File

@ -130,10 +130,7 @@ export abstract class TypeSafeTool<TArgs extends object> implements Tool {
propertyNames.push(...Object.getOwnPropertyNames(prototype));
return propertyNames.filter(
(name) =>
name !== "constructor" &&
!name.startsWith("_") &&
typeof (instance as any)[name] !== "function"
(name) => name !== "constructor" && !name.startsWith("_") && typeof (instance as any)[name] !== "function"
);
}
@ -210,7 +207,5 @@ export abstract class TypeSafeTool<TArgs extends object> implements Tool {
*
* @param args - The validated, strongly-typed arguments
*/
protected abstract executeTypeSafe(
args: TArgs
): Promise<{ content: Array<{ type: string; text: string }> }>;
protected abstract executeTypeSafe(args: TArgs): Promise<{ content: Array<{ type: string; text: string }> }>;
}

View File

@ -41,9 +41,7 @@ export class HelloWorldTool extends TypeSafeTool<HelloWorldArgs> {
*
* @param args - The validated HelloWorldArgs instance
*/
protected async executeTypeSafe(
args: HelloWorldArgs
): Promise<{ content: Array<{ type: string; text: string }> }> {
protected async executeTypeSafe(args: HelloWorldArgs): Promise<{ content: Array<{ type: string; text: string }> }> {
return {
content: [
{

View File

@ -50,9 +50,7 @@ export class ToolPrintText extends TypeSafeTool<PrintTextArgs> {
*
* @param args - The validated PrintTextArgs instance
*/
protected async executeTypeSafe(
args: PrintTextArgs
): Promise<{ content: Array<{ type: string; text: string }> }> {
protected async executeTypeSafe(args: PrintTextArgs): Promise<{ content: Array<{ type: string; text: string }> }> {
try {
// Create the plugin task
const taskParams = new PluginTaskPrintTextParams(args.text);