forked from github/CopilotForXcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRunInTerminalTool.swift
More file actions
22 lines (19 loc) · 862 Bytes
/
RunInTerminalTool.swift
File metadata and controls
22 lines (19 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import ConversationServiceProvider
import JSONRPC
public class RunInTerminalTool: ICopilotTool {
public func invokeTool(_ request: InvokeClientToolRequest, completion: @escaping (AnyJSONRPCResponse) -> Void, chatHistoryUpdater: ChatHistoryUpdater?, contextProvider: (any ToolContextProvider)?) -> Bool {
let params = request.params!
let editAgentRounds: [AgentRound] = [
AgentRound(roundId: params.roundId,
reply: "",
toolCalls: [
AgentToolCall(id: params.toolCallId, name: params.name, status: .waitForConfirmation, invokeParams: params)
]
)
]
if let chatHistoryUpdater = chatHistoryUpdater {
chatHistoryUpdater(params.turnId, editAgentRounds)
}
return false
}
}