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

Function handleTsunamiBlockDesc

pkg/aiusechat/tools_tsunami.go:33–45  ·  view source on GitHub ↗
(block *waveobj.Block)

Source from the content-addressed store, hash-verified

31}
32
33func handleTsunamiBlockDesc(block *waveobj.Block) string {
34 status := blockcontroller.GetBlockControllerRuntimeStatus(block.OID)
35 if status == nil || status.ShellProcStatus != blockcontroller.Status_Running {
36 return "tsunami framework widget that is currently not running"
37 }
38
39 blockORef := waveobj.MakeORef(waveobj.OType_Block, block.OID)
40 rtInfo := wstore.GetRTInfo(blockORef)
41 if shortDesc := getTsunamiShortDesc(rtInfo); shortDesc != "" {
42 return fmt.Sprintf("tsunami widget - %s", shortDesc)
43 }
44 return "tsunami widget - unknown description"
45}
46
47func makeTsunamiGetCallback(status *blockcontroller.BlockControllerRuntimeStatus, apiPath string) func(any, *uctypes.UIMessageDataToolUse) (any, error) {
48 return func(input any, toolUseData *uctypes.UIMessageDataToolUse) (any, error) {

Callers 1

MakeBlockShortDescFunction · 0.85

Calls 4

MakeORefFunction · 0.92
GetRTInfoFunction · 0.92
getTsunamiShortDescFunction · 0.85

Tested by

no test coverage detected