优化消息中plan显示效果
This commit is contained in:
@@ -31,7 +31,6 @@ import {
|
|||||||
GlobeIcon,
|
GlobeIcon,
|
||||||
ListTodoIcon,
|
ListTodoIcon,
|
||||||
SparklesIcon,
|
SparklesIcon,
|
||||||
BrainIcon,
|
|
||||||
CircleIcon,
|
CircleIcon,
|
||||||
CircleDotIcon,
|
CircleDotIcon,
|
||||||
CircleCheckIcon,
|
CircleCheckIcon,
|
||||||
@@ -873,9 +872,12 @@ function getToolIcon(
|
|||||||
return <ListTodoIcon className={ICON_CLASS} />
|
return <ListTodoIcon className={ICON_CLASS} />
|
||||||
if (name === "agent") return getTaskToolIcon(input ?? null)
|
if (name === "agent") return getTaskToolIcon(input ?? null)
|
||||||
if (name === "skill") return <SparklesIcon className={ICON_CLASS} />
|
if (name === "skill") return <SparklesIcon className={ICON_CLASS} />
|
||||||
if (name === "enterplanmode" || name === "exitplanmode")
|
if (
|
||||||
return <BrainIcon className={ICON_CLASS} />
|
name === "enterplanmode" ||
|
||||||
if (name === "switch_mode") return <MapIcon className={ICON_CLASS} />
|
name === "exitplanmode" ||
|
||||||
|
name === "switch_mode"
|
||||||
|
)
|
||||||
|
return <ListTodoIcon className={ICON_CLASS} />
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1056,8 +1058,16 @@ function deriveToolTitle(
|
|||||||
name === "exitplanmode" ||
|
name === "exitplanmode" ||
|
||||||
name === "switch_mode"
|
name === "switch_mode"
|
||||||
) {
|
) {
|
||||||
|
const plan = getField("plan")
|
||||||
|
if (plan) {
|
||||||
|
const firstLine = plan
|
||||||
|
.split("\n")
|
||||||
|
.map((l) => l.replace(/^#+\s*/, "").trim())
|
||||||
|
.find((l) => l.length > 0)
|
||||||
|
if (firstLine) return `Plan · ${ellipsis(firstLine, 60)}`
|
||||||
|
}
|
||||||
const title = getField("title")
|
const title = getField("title")
|
||||||
if (title) return title
|
if (title) return `Plan · ${title}`
|
||||||
return "Plan"
|
return "Plan"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user