Skip to content

Commit 6d92974

Browse files
bug: "share tools:" should support all tool types, not just tool
1 parent eaaf0cd commit 6d92974

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

pkg/types/tool.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,13 +602,27 @@ func (t Tool) GetToolsByType(prg *Program, toolType ToolType) ([]ToolReference,
602602
case ToolTypeInput:
603603
exportRefs = tool.ExportInputFilters
604604
case ToolTypeTool:
605-
exportRefs = tool.Export
606605
case ToolTypeCredential:
607606
exportRefs = tool.ExportCredentials
608607
default:
609608
return nil, fmt.Errorf("unknown tool type %v", toolType)
610609
}
611610
toolSet.AddAll(tool.GetToolRefsFromNames(exportRefs))
611+
612+
toolRefs, err := tool.GetToolRefsFromNames(tool.Export)
613+
if err != nil {
614+
return nil, err
615+
}
616+
617+
for _, toolRef := range toolRefs {
618+
tool, ok := prg.ToolSet[toolRef.ToolID]
619+
if !ok {
620+
continue
621+
}
622+
if slices.Contains(toolsListFilterType, tool.Type) {
623+
toolSet.Add(toolRef)
624+
}
625+
}
612626
}
613627

614628
return toolSet.List()

0 commit comments

Comments
 (0)