Add list tools; normalize tool names and paths in transcript
This commit is contained in:
@@ -1031,13 +1031,14 @@ private func toolBrief(_ input: (any Sendable)?, _ root: String) -> String {
|
||||
guard let i = input as? JSONDict else {
|
||||
return ""
|
||||
}
|
||||
let brief = ["command", "file_path", "pattern", "url", "question", "description"].lazy.compactMap { i[$0] ?? nil }.first
|
||||
let brief = ["command", "file_path", "pattern", "path", "url", "question", "description"].lazy.compactMap { i[$0] ?? nil }.first
|
||||
let text = relative(brief.map { jsString($0) } ?? "", root)
|
||||
return text.count > 120 ? "\(text.prefix(120))…" : text
|
||||
}
|
||||
|
||||
private func toolTarget(_ input: (any Sendable)?, _ root: String) -> String {
|
||||
guard let path = (input as? JSONDict)?["file_path"] as? String else {
|
||||
let i = input as? JSONDict
|
||||
guard let path = (i?["file_path"] ?? i?["path"]) as? String else {
|
||||
return ""
|
||||
}
|
||||
return relative(path, root)
|
||||
|
||||
Reference in New Issue
Block a user