fix(tool): satisfy ktlint formatting
This commit is contained in:
1 parent
91566dfdd7
commit
10f7e9fa3c
4 files changed
+14
-3
No files matched your search
@@ -39,7 +39,12 @@ internal object FactStoreRenderer : ToolRenderer {
|
||||
override fun subtitle(call: ToolCall): String {
|
||||
val args = call.args
|
||||
val result = call.result
|
||||
val action = ToolJson.firstString(args, listOf("action")).ifEmpty { ToolJson.firstString(result, listOf("action")) }
|
||||
val action =
|
||||
ToolJson
|
||||
.firstString(
|
||||
args,
|
||||
listOf("action"),
|
||||
).ifEmpty { ToolJson.firstString(result, listOf("action")) }
|
||||
val entity = ToolJson.firstString(args, listOf("entity"))
|
||||
val query = ToolJson.firstString(args, listOf("query"))
|
||||
val facts = facts(call)
|
||||
|
||||
@@ -75,7 +75,9 @@ internal object TerminalRenderer : ToolRenderer {
|
||||
|
||||
return when {
|
||||
output.isNotEmpty() -> output
|
||||
|
||||
call.name == "execute_code" -> ToolJson.fallbackDetailText(call.rawArgs, call.rawResult)
|
||||
|
||||
// A terminal row with no output already shows its command in the
|
||||
// title; the generic fallback would repeat it.
|
||||
else -> ""
|
||||
|
||||
@@ -44,7 +44,10 @@ internal object WebSearchRenderer : ToolRenderer {
|
||||
SearchHit(
|
||||
title = ToolJson.cleanVisibleText(ToolJson.firstString(r, listOf("title", "name"))),
|
||||
url = ToolJson.firstString(r, listOf("url", "href", "link")),
|
||||
snippet = ToolJson.cleanVisibleText(ToolJson.firstString(r, listOf("snippet", "description", "body"))),
|
||||
snippet =
|
||||
ToolJson.cleanVisibleText(
|
||||
ToolJson.firstString(r, listOf("snippet", "description", "body")),
|
||||
),
|
||||
)
|
||||
}.filter { it.title.isNotEmpty() || it.url.isNotEmpty() }
|
||||
.take(limit)
|
||||
|
||||
+2
-1
@@ -46,7 +46,8 @@ class ToolViewCharacterizationTest {
|
||||
|
||||
@Test
|
||||
fun `terminal split streams keep stdout and stderr separate`() {
|
||||
val view = build("terminal", """{"command":"make"}""", """{"stdout":"built","stderr":"warn: x","exit_code":0}""")
|
||||
val view =
|
||||
build("terminal", """{"command":"make"}""", """{"stdout":"built","stderr":"warn: x","exit_code":0}""")
|
||||
|
||||
assertEquals("built", view.stdout)
|
||||
assertEquals("warn: x", view.stderr)
|
||||
|
||||
Reference in new issue
Block a user