feat: agent color cfg (#4226)

Co-authored-by: 0xrin <0xrin1@protonmail.com>
Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
Aiden Cline
2025-11-11 16:32:44 -08:00
committed by GitHub
parent 834a2c09d5
commit 0b86adbe99
7 changed files with 102 additions and 1 deletions

View File

@@ -90,6 +90,8 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
})
},
color(name: string) {
const agent = agents().find((x) => x.name === name)
if (agent?.color) return agent.color
const index = agents().findIndex((x) => x.name === name)
return colors()[index % colors().length]
},