Skip to content

Commit 89b542f

Browse files
committed
Load skill tool
1 parent 53420ff commit 89b542f

22 files changed

Lines changed: 311 additions & 964 deletions

File tree

apps/sim/app/api/mothership/execute/route.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { requestExplicitStreamAbort } from '@/lib/copilot/request/session/explic
1616
import type { StreamEvent } from '@/lib/copilot/request/types'
1717
import { isE2BDocEnabled } from '@/lib/core/config/feature-flags'
1818
import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
19-
import { buildMothershipToolsForRequest } from '@/lib/mothership/settings/runtime'
19+
import { buildUserSkillTool } from '@/lib/mothership/skills'
2020
import {
2121
assertActiveWorkspaceAccess,
2222
getUserEntityPermissions,
@@ -118,13 +118,12 @@ export const POST = withRouteHandler(async (req: NextRequest) => {
118118
workflowId,
119119
executionId,
120120
})
121-
const [workspaceContext, integrationTools, mothershipToolRuntime, userPermission] =
122-
await Promise.all([
123-
generateWorkspaceContext(workspaceId, userId),
124-
buildIntegrationToolSchemas(userId, messageId, undefined, workspaceId),
125-
buildMothershipToolsForRequest({ workspaceId, userId }),
126-
getUserEntityPermissions(userId, 'workspace', workspaceId).catch(() => null),
127-
])
121+
const [workspaceContext, integrationTools, userSkillTool, userPermission] = await Promise.all([
122+
generateWorkspaceContext(workspaceId, userId),
123+
buildIntegrationToolSchemas(userId, messageId, undefined, workspaceId),
124+
buildUserSkillTool(workspaceId),
125+
getUserEntityPermissions(userId, 'workspace', workspaceId).catch(() => null),
126+
])
128127
const requestPayload: Record<string, unknown> = {
129128
messages,
130129
responseFormat,
@@ -138,9 +137,7 @@ export const POST = withRouteHandler(async (req: NextRequest) => {
138137
...(userMetadata ? { userMetadata } : {}),
139138
...(fileAttachments && fileAttachments.length > 0 ? { fileAttachments } : {}),
140139
...(integrationTools.length > 0 ? { integrationTools } : {}),
141-
...(mothershipToolRuntime.tools.length > 0
142-
? { mothershipTools: mothershipToolRuntime.tools }
143-
: {}),
140+
...(userSkillTool ? { mothershipTools: [userSkillTool] } : {}),
144141
...(userPermission ? { userPermission } : {}),
145142
}
146143

apps/sim/app/api/mothership/settings/route.ts

Lines changed: 0 additions & 91 deletions
This file was deleted.

apps/sim/app/workspace/[workspaceId]/logs/components/log-details/utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ export function getBlockIconAndColor(
6060
if (mcpBlock) return { icon: mcpBlock.icon, bgColor: mcpBlock.bgColor }
6161
}
6262
const normalized = normalizeToolId(toolName)
63-
if (normalized === 'load_skill') return { icon: AgentSkillsIcon, bgColor: '#8B5CF6' }
63+
if (normalized === 'load_skill' || normalized === 'load_user_skill')
64+
return { icon: AgentSkillsIcon, bgColor: '#8B5CF6' }
6465
const toolBlock = getBlockByToolName(normalized)
6566
if (toolBlock) return { icon: toolBlock.icon, bgColor: toolBlock.bgColor }
6667
}

0 commit comments

Comments
 (0)