Skip to content

Commit 94eff3f

Browse files
committed
Remove server side impl
1 parent e7b2630 commit 94eff3f

File tree

3 files changed

+2
-193
lines changed

3 files changed

+2
-193
lines changed
Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
1-
import { createLogger } from '@sim/logger'
21
import { BookOpen, Loader2, MinusCircle, XCircle } from 'lucide-react'
32
import {
43
BaseClientTool,
54
type BaseClientToolMetadata,
65
ClientToolCallState,
76
} from '@/lib/copilot/tools/client/base-tool'
8-
import { ExecuteResponseSuccessSchema } from '@/lib/copilot/tools/shared/schemas'
9-
10-
interface SearchLibraryDocsArgs {
11-
library_name: string
12-
query: string
13-
version?: string
14-
}
157

168
export class SearchLibraryDocsClientTool extends BaseClientTool {
179
static readonly id = 'search_library_docs'
@@ -52,32 +44,7 @@ export class SearchLibraryDocsClientTool extends BaseClientTool {
5244
},
5345
}
5446

55-
async execute(args?: SearchLibraryDocsArgs): Promise<void> {
56-
const logger = createLogger('SearchLibraryDocsClientTool')
57-
try {
58-
this.setState(ClientToolCallState.executing)
59-
const res = await fetch('/api/copilot/execute-copilot-server-tool', {
60-
method: 'POST',
61-
headers: { 'Content-Type': 'application/json' },
62-
body: JSON.stringify({ toolName: 'search_library_docs', payload: args || {} }),
63-
})
64-
if (!res.ok) {
65-
const txt = await res.text().catch(() => '')
66-
throw new Error(txt || `Server error (${res.status})`)
67-
}
68-
const json = await res.json()
69-
const parsed = ExecuteResponseSuccessSchema.parse(json)
70-
this.setState(ClientToolCallState.success)
71-
await this.markToolComplete(
72-
200,
73-
`Library documentation search complete for ${args?.library_name || 'unknown'}`,
74-
parsed.result
75-
)
76-
this.setState(ClientToolCallState.success)
77-
} catch (e: any) {
78-
logger.error('execute failed', { message: e?.message })
79-
this.setState(ClientToolCallState.error)
80-
await this.markToolComplete(500, e?.message || 'Library documentation search failed')
81-
}
47+
async execute(): Promise<void> {
48+
return
8249
}
8350
}

apps/sim/lib/copilot/tools/server/docs/search-library-docs.ts

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

apps/sim/lib/copilot/tools/server/router.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { getBlocksAndToolsServerTool } from '@/lib/copilot/tools/server/blocks/g
66
import { getBlocksMetadataServerTool } from '@/lib/copilot/tools/server/blocks/get-blocks-metadata-tool'
77
import { getTriggerBlocksServerTool } from '@/lib/copilot/tools/server/blocks/get-trigger-blocks'
88
import { searchDocumentationServerTool } from '@/lib/copilot/tools/server/docs/search-documentation'
9-
import { searchLibraryDocsServerTool } from '@/lib/copilot/tools/server/docs/search-library-docs'
109
import {
1110
KnowledgeBaseInput,
1211
knowledgeBaseServerTool,
@@ -48,7 +47,6 @@ serverToolRegistry[getTriggerBlocksServerTool.name] = getTriggerBlocksServerTool
4847
serverToolRegistry[editWorkflowServerTool.name] = editWorkflowServerTool
4948
serverToolRegistry[getWorkflowConsoleServerTool.name] = getWorkflowConsoleServerTool
5049
serverToolRegistry[searchDocumentationServerTool.name] = searchDocumentationServerTool
51-
serverToolRegistry[searchLibraryDocsServerTool.name] = searchLibraryDocsServerTool
5250
serverToolRegistry[searchOnlineServerTool.name] = searchOnlineServerTool
5351
serverToolRegistry[setEnvironmentVariablesServerTool.name] = setEnvironmentVariablesServerTool
5452
serverToolRegistry[getCredentialsServerTool.name] = getCredentialsServerTool

0 commit comments

Comments
 (0)