Let task agents use client Macs directly: bash, copy and hands

This commit is contained in:
Ian Gulliver
2026-10-17 23:45:31 -07:00
parent 8d9ba10849
commit 9b79ade073
25 changed files with 1382 additions and 952 deletions
+9 -4
View File
@@ -744,11 +744,16 @@ func (s *Session) callTool(raw json.RawMessage) (any, error) {
return nil, fmt.Errorf("unknown tool %s in %s", p.Tool, p.Namespace)
}
text, err := t.Handler(context.Background(), p.Arguments)
if err != nil {
return DynamicToolCallResponse{ContentItems: []DynamicToolCallOutputContentItem{{Type: DynamicToolCallOutputContentItemTypeInputText, Text: err.Error()}}}, nil
res := t.Call(context.Background(), p.Arguments)
items := []DynamicToolCallOutputContentItem{}
for _, c := range res.Content {
if c.Type == "image" {
items = append(items, DynamicToolCallOutputContentItem{Type: DynamicToolCallOutputContentItemTypeInputImage, ImageURL: "data:" + c.MimeType + ";base64," + c.Data})
continue
}
items = append(items, DynamicToolCallOutputContentItem{Type: DynamicToolCallOutputContentItemTypeInputText, Text: c.Text})
}
return DynamicToolCallResponse{Success: true, ContentItems: []DynamicToolCallOutputContentItem{{Type: DynamicToolCallOutputContentItemTypeInputText, Text: text}}}, nil
return DynamicToolCallResponse{Success: !res.IsError, ContentItems: items}, nil
}
func (s *Session) badLine(line []byte, reason string) {