add agent color to inline task tool ascii char and highlight agent name (#7142)
This commit is contained in:
@@ -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]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user