mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-28 06:51:16 +08:00
feat: fix img pasting in new ink plus newline after tools
This commit is contained in:
@@ -48,13 +48,15 @@ export const ToolTrail = memo(function ToolTrail({
|
||||
tools = [],
|
||||
trail = [],
|
||||
activity = [],
|
||||
animateCot = false
|
||||
animateCot = false,
|
||||
padAfter = false
|
||||
}: {
|
||||
t: Theme
|
||||
tools?: ActiveTool[]
|
||||
trail?: string[]
|
||||
activity?: ActivityItem[]
|
||||
animateCot?: boolean
|
||||
padAfter?: boolean
|
||||
}) {
|
||||
if (!trail.length && !tools.length && !activity.length) {
|
||||
return null
|
||||
@@ -68,6 +70,7 @@ export const ToolTrail = memo(function ToolTrail({
|
||||
<>
|
||||
{trail.map((line, i) => {
|
||||
const lastInBlock = i === rowCount - 1
|
||||
const suffix = padAfter && lastInBlock ? '\n' : ''
|
||||
|
||||
if (isToolTrailResultLine(line)) {
|
||||
return (
|
||||
@@ -78,6 +81,7 @@ export const ToolTrail = memo(function ToolTrail({
|
||||
>
|
||||
<TreeFork last={lastInBlock} />
|
||||
{line}
|
||||
{suffix}
|
||||
</Text>
|
||||
)
|
||||
}
|
||||
@@ -87,6 +91,7 @@ export const ToolTrail = memo(function ToolTrail({
|
||||
<Text color={t.color.dim} key={`c-${i}`}>
|
||||
<TreeFork last={lastInBlock} />
|
||||
<Spinner color={t.color.amber} variant="think" /> {line}
|
||||
{suffix}
|
||||
</Text>
|
||||
)
|
||||
}
|
||||
@@ -95,29 +100,34 @@ export const ToolTrail = memo(function ToolTrail({
|
||||
<Text color={t.color.dim} dimColor key={`c-${i}`}>
|
||||
<TreeFork last={lastInBlock} />
|
||||
{line}
|
||||
{suffix}
|
||||
</Text>
|
||||
)
|
||||
})}
|
||||
|
||||
{tools.map((tool, j) => {
|
||||
const lastInBlock = trail.length + j === rowCount - 1
|
||||
const suffix = padAfter && lastInBlock ? '\n' : ''
|
||||
|
||||
return (
|
||||
<Text color={t.color.dim} key={tool.id}>
|
||||
<TreeFork last={lastInBlock} />
|
||||
<Spinner color={t.color.amber} variant="tool" /> {TOOL_VERBS[tool.name] ?? tool.name}
|
||||
{tool.context ? `: ${tool.context}` : ''}
|
||||
{suffix}
|
||||
</Text>
|
||||
)
|
||||
})}
|
||||
|
||||
{act.map((item, k) => {
|
||||
const lastInBlock = trail.length + tools.length + k === rowCount - 1
|
||||
const suffix = padAfter && lastInBlock ? '\n' : ''
|
||||
|
||||
return (
|
||||
<Text color={tone(item, t)} dimColor={item.tone === 'info'} key={`a-${item.id}`}>
|
||||
<TreeFork last={lastInBlock} />
|
||||
{activityGlyph(item)} {item.text}
|
||||
{suffix}
|
||||
</Text>
|
||||
)
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user