fix: add curly braces for oxlint curly rule; copy postinstall script before pnpm install in Dockerfile

This commit is contained in:
khhjoe 2026-03-29 17:22:12 +08:00 committed by Peter Steinberger
parent a8c189f463
commit e24091413c
2 changed files with 12 additions and 11 deletions

View File

@ -64,6 +64,7 @@ WORKDIR /app
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./
COPY ui/package.json ./ui/package.json
COPY patches ./patches
COPY scripts/postinstall-bundled-plugins.mjs ./scripts/postinstall-bundled-plugins.mjs
COPY --from=ext-deps /out/ ./${OPENCLAW_BUNDLED_PLUGIN_DIR}/

View File

@ -8,10 +8,7 @@
*/
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import {
CallToolRequestSchema,
ListToolsRequestSchema,
} from "@modelcontextprotocol/sdk/types.js";
import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
import type { AnyAgentTool } from "../agents/tools/common.js";
import { loadConfig } from "../config/config.js";
import { resolvePluginTools } from "../plugins/tools.js";
@ -64,16 +61,17 @@ async function main(): Promise<void> {
};
}
try {
const result = await tool.execute(
`mcp-${Date.now()}`,
request.params.arguments ?? {},
);
const result = await tool.execute(`mcp-${Date.now()}`, request.params.arguments ?? {});
return {
content: Array.isArray(result.content) ? result.content : [{ type: "text", text: String(result.content) }],
content: Array.isArray(result.content)
? result.content
: [{ type: "text", text: String(result.content) }],
};
} catch (err) {
return {
content: [{ type: "text", text: `Tool error: ${err instanceof Error ? err.message : String(err)}` }],
content: [
{ type: "text", text: `Tool error: ${err instanceof Error ? err.message : String(err)}` },
],
isError: true,
};
}
@ -83,7 +81,9 @@ async function main(): Promise<void> {
let shuttingDown = false;
const shutdown = () => {
if (shuttingDown) return;
if (shuttingDown) {
return;
}
shuttingDown = true;
process.stdin.off("end", shutdown);
process.stdin.off("close", shutdown);