MCPcopy
hub / github.com/wavetermdev/waveterm / generateToolsForTsunamiBlock

Function generateToolsForTsunamiBlock

pkg/aiusechat/tools.go:240–262  ·  view source on GitHub ↗
(block *waveobj.Block)

Source from the content-addressed store, hash-verified

238}
239
240func generateToolsForTsunamiBlock(block *waveobj.Block) []uctypes.ToolDefinition {
241 var tools []uctypes.ToolDefinition
242
243 status := blockcontroller.GetBlockControllerRuntimeStatus(block.OID)
244 if status == nil || status.ShellProcStatus != blockcontroller.Status_Running || status.TsunamiPort <= 0 {
245 return nil
246 }
247
248 blockORef := waveobj.MakeORef(waveobj.OType_Block, block.OID)
249 rtInfo := wstore.GetRTInfo(blockORef)
250
251 if tool := GetTsunamiGetDataToolDefinition(block, rtInfo, status); tool != nil {
252 tools = append(tools, *tool)
253 }
254 if tool := GetTsunamiGetConfigToolDefinition(block, rtInfo, status); tool != nil {
255 tools = append(tools, *tool)
256 }
257 if tool := GetTsunamiSetConfigToolDefinition(block, rtInfo, status); tool != nil {
258 tools = append(tools, *tool)
259 }
260
261 return tools
262}
263
264// Used for internal testing of tool loops
265func GetAdderToolDefinition() uctypes.ToolDefinition {

Callers 1

GenerateTabStateAndToolsFunction · 0.85

Calls 6

MakeORefFunction · 0.92
GetRTInfoFunction · 0.92

Tested by

no test coverage detected