Skip to content

Commit d6be45b

Browse files
committed
fix lint
1 parent 3793d8b commit d6be45b

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/mcp/server.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,9 @@ import { callActorGetDataset, defaultTools, getActorsAsTools, toolCategories } f
3939
import { decodeDotPropertyNames } from '../tools/utils.js';
4040
import type { ActorMcpTool, ActorTool, HelperTool, ToolEntry } from '../types.js';
4141
import { buildActorResponseContent } from '../utils/actor-response.js';
42-
import { cloneToolEntry } from '../utils/tools.js';
4342
import { buildMCPResponse } from '../utils/mcp.js';
4443
import { createProgressTracker } from '../utils/progress.js';
45-
import { getToolPublicFieldOnly } from '../utils/tools.js';
44+
import { cloneToolEntry, getToolPublicFieldOnly } from '../utils/tools.js';
4645
import { connectMCPClient } from './client.js';
4746
import { EXTERNAL_TOOL_CALL_TIMEOUT_MSEC, LOG_LEVEL_MAP } from './const.js';
4847
import { processParamsGetTools } from './utils.js';
@@ -269,10 +268,9 @@ export class ActorsMcpServer {
269268
if (wrap.type === 'actor'
270269
|| (wrap.type === 'internal' && wrap.tool.name === HelperTools.ACTOR_CALL)
271270
|| (wrap.type === 'internal' && wrap.tool.name === HelperTools.ACTOR_OUTPUT_GET)) {
272-
273271
// Clone the tool before modifying it to avoid affecting shared objects
274272
const clonedWrap = cloneToolEntry(wrap);
275-
273+
276274
// Add Skyfire instructions to description if not already present
277275
if (!clonedWrap.tool.description.includes(SKYFIRE_TOOL_INSTRUCTIONS)) {
278276
clonedWrap.tool.description += `\n\n${SKYFIRE_TOOL_INSTRUCTIONS}`;
@@ -287,7 +285,7 @@ export class ActorsMcpServer {
287285
};
288286
}
289287
}
290-
288+
291289
// Store the cloned and modified tool
292290
this.tools.set(clonedWrap.tool.name, clonedWrap);
293291
} else {

src/utils/tools.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { toolCategories } from '../tools/index.js';
2-
import type { ToolBase, ToolCategory, ToolEntry } from '../types.js';
2+
import type { InternalTool, ToolBase, ToolCategory, ToolEntry } from '../types.js';
33

44
/**
55
* Returns a public version of the tool containing only fields that should be exposed publicly.
@@ -35,7 +35,7 @@ export function getExpectedToolNamesByCategories(categories: ToolCategory[]): st
3535
export function cloneToolEntry(toolEntry: ToolEntry): ToolEntry {
3636
// Store the original functions
3737
const originalAjvValidate = toolEntry.tool.ajvValidate;
38-
const originalCall = (toolEntry.tool as any).call;
38+
const originalCall = toolEntry.type === 'internal' ? (toolEntry.tool as InternalTool).call : undefined;
3939

4040
// Create a deep copy using JSON serialization (excluding functions)
4141
const cloned = JSON.parse(JSON.stringify(toolEntry, (key, value) => {
@@ -46,7 +46,7 @@ export function cloneToolEntry(toolEntry: ToolEntry): ToolEntry {
4646
// Restore the original functions
4747
cloned.tool.ajvValidate = originalAjvValidate;
4848
if (toolEntry.type === 'internal' && originalCall) {
49-
(cloned.tool as any).call = originalCall;
49+
(cloned.tool as InternalTool).call = originalCall;
5050
}
5151

5252
return cloned;

0 commit comments

Comments
 (0)