add agent color to inline task tool ascii char and highlight agent name (#7142)

This commit is contained in:
Spoon
2026-01-07 07:10:00 +01:00
committed by GitHub
parent 37decee795
commit 85ed329318
2 changed files with 18 additions and 5 deletions
@@ -75,9 +75,10 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
})
},
color(name: string) {
const agent = agents().find((x) => x.name === name)
const all = sync.data.agent
const agent = all.find((x) => x.name === name)
if (agent?.color) return RGBA.fromHex(agent.color)
const index = agents().findIndex((x) => x.name === name)
const index = all.findIndex((x) => x.name === name)
if (index === -1) return colors()[0]
return colors()[index % colors().length]
},