@oxy.so/bloom 19.11.0 → 20.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (282) hide show
  1. package/docs/adoption-matrix.mdx +6 -5
  2. package/docs/agent-avatar.mdx +20 -0
  3. package/docs/agent-creator.mdx +20 -14
  4. package/docs/multi-agent-chat.mdx +5 -0
  5. package/docs/task-catalog.json +1 -1
  6. package/docs/task-catalog.mdx +1 -1
  7. package/lib/commonjs/agent-avatar/character.js +27 -0
  8. package/lib/commonjs/agent-avatar/character.js.map +1 -1
  9. package/lib/commonjs/agent-avatar/index.js +6 -0
  10. package/lib/commonjs/agent-avatar/index.js.map +1 -1
  11. package/lib/commonjs/agent-creator/AgentCreator.js +0 -4
  12. package/lib/commonjs/agent-creator/AgentCreator.js.map +1 -1
  13. package/lib/commonjs/agent-creator/AgentCreator.web.js +8 -12
  14. package/lib/commonjs/agent-creator/AgentCreator.web.js.map +1 -1
  15. package/lib/commonjs/agent-creator/AgentCreatorBase.js +61 -99
  16. package/lib/commonjs/agent-creator/AgentCreatorBase.js.map +1 -1
  17. package/lib/commonjs/agent-creator/context.js.map +1 -1
  18. package/lib/commonjs/agent-creator/messages.js +1 -22
  19. package/lib/commonjs/agent-creator/messages.js.map +1 -1
  20. package/lib/commonjs/agent-creator/paint.js +47 -0
  21. package/lib/commonjs/agent-creator/paint.js.map +1 -0
  22. package/lib/commonjs/agent-creator/shared.js +0 -28
  23. package/lib/commonjs/agent-creator/shared.js.map +1 -1
  24. package/lib/commonjs/agent-creator/use-character-history.js +12 -9
  25. package/lib/commonjs/agent-creator/use-character-history.js.map +1 -1
  26. package/lib/commonjs/avatar/Avatar.js +12 -4
  27. package/lib/commonjs/avatar/Avatar.js.map +1 -1
  28. package/lib/commonjs/avatar/account.js +9 -3
  29. package/lib/commonjs/avatar/account.js.map +1 -1
  30. package/lib/commonjs/locale/translations/ar.js +1 -22
  31. package/lib/commonjs/locale/translations/ar.js.map +1 -1
  32. package/lib/commonjs/locale/translations/bn.js +1 -22
  33. package/lib/commonjs/locale/translations/bn.js.map +1 -1
  34. package/lib/commonjs/locale/translations/ca.js +1 -22
  35. package/lib/commonjs/locale/translations/ca.js.map +1 -1
  36. package/lib/commonjs/locale/translations/de.js +1 -22
  37. package/lib/commonjs/locale/translations/de.js.map +1 -1
  38. package/lib/commonjs/locale/translations/es.js +1 -22
  39. package/lib/commonjs/locale/translations/es.js.map +1 -1
  40. package/lib/commonjs/locale/translations/fr.js +1 -22
  41. package/lib/commonjs/locale/translations/fr.js.map +1 -1
  42. package/lib/commonjs/locale/translations/hi.js +1 -22
  43. package/lib/commonjs/locale/translations/hi.js.map +1 -1
  44. package/lib/commonjs/locale/translations/id.js +1 -22
  45. package/lib/commonjs/locale/translations/id.js.map +1 -1
  46. package/lib/commonjs/locale/translations/it.js +1 -22
  47. package/lib/commonjs/locale/translations/it.js.map +1 -1
  48. package/lib/commonjs/locale/translations/ja.js +1 -22
  49. package/lib/commonjs/locale/translations/ja.js.map +1 -1
  50. package/lib/commonjs/locale/translations/pt.js +1 -22
  51. package/lib/commonjs/locale/translations/pt.js.map +1 -1
  52. package/lib/commonjs/locale/translations/ru.js +1 -22
  53. package/lib/commonjs/locale/translations/ru.js.map +1 -1
  54. package/lib/commonjs/locale/translations/tr.js +1 -22
  55. package/lib/commonjs/locale/translations/tr.js.map +1 -1
  56. package/lib/commonjs/locale/translations/zh.js +1 -22
  57. package/lib/commonjs/locale/translations/zh.js.map +1 -1
  58. package/lib/commonjs/multi-agent-chat/Marketplace.js +1 -1
  59. package/lib/commonjs/multi-agent-chat/Marketplace.js.map +1 -1
  60. package/lib/commonjs/multi-agent-chat/MultiAgentChatBase.js +6 -6
  61. package/lib/commonjs/multi-agent-chat/MultiAgentChatBase.js.map +1 -1
  62. package/lib/commonjs/multi-agent-chat/SelectedAgentPreview.js +2 -1
  63. package/lib/commonjs/multi-agent-chat/SelectedAgentPreview.js.map +1 -1
  64. package/lib/commonjs/multi-agent-chat/data.js +58 -39
  65. package/lib/commonjs/multi-agent-chat/data.js.map +1 -1
  66. package/lib/commonjs/multi-agent-chat/marketplace-data.js +21 -27
  67. package/lib/commonjs/multi-agent-chat/marketplace-data.js.map +1 -1
  68. package/lib/module/agent-avatar/character.js +26 -0
  69. package/lib/module/agent-avatar/character.js.map +1 -1
  70. package/lib/module/agent-avatar/index.js +1 -1
  71. package/lib/module/agent-avatar/index.js.map +1 -1
  72. package/lib/module/agent-creator/AgentCreator.js +0 -4
  73. package/lib/module/agent-creator/AgentCreator.js.map +1 -1
  74. package/lib/module/agent-creator/AgentCreator.web.js +0 -4
  75. package/lib/module/agent-creator/AgentCreator.web.js.map +1 -1
  76. package/lib/module/agent-creator/AgentCreatorBase.js +56 -94
  77. package/lib/module/agent-creator/AgentCreatorBase.js.map +1 -1
  78. package/lib/module/agent-creator/context.js.map +1 -1
  79. package/lib/module/agent-creator/messages.js +1 -22
  80. package/lib/module/agent-creator/messages.js.map +1 -1
  81. package/lib/module/agent-creator/paint.js +42 -0
  82. package/lib/module/agent-creator/paint.js.map +1 -0
  83. package/lib/module/agent-creator/shared.js +0 -26
  84. package/lib/module/agent-creator/shared.js.map +1 -1
  85. package/lib/module/agent-creator/use-character-history.js +7 -4
  86. package/lib/module/agent-creator/use-character-history.js.map +1 -1
  87. package/lib/module/avatar/Avatar.js +12 -4
  88. package/lib/module/avatar/Avatar.js.map +1 -1
  89. package/lib/module/avatar/account.js +9 -3
  90. package/lib/module/avatar/account.js.map +1 -1
  91. package/lib/module/locale/translations/ar.js +1 -22
  92. package/lib/module/locale/translations/ar.js.map +1 -1
  93. package/lib/module/locale/translations/bn.js +1 -22
  94. package/lib/module/locale/translations/bn.js.map +1 -1
  95. package/lib/module/locale/translations/ca.js +1 -22
  96. package/lib/module/locale/translations/ca.js.map +1 -1
  97. package/lib/module/locale/translations/de.js +1 -22
  98. package/lib/module/locale/translations/de.js.map +1 -1
  99. package/lib/module/locale/translations/es.js +1 -22
  100. package/lib/module/locale/translations/es.js.map +1 -1
  101. package/lib/module/locale/translations/fr.js +1 -22
  102. package/lib/module/locale/translations/fr.js.map +1 -1
  103. package/lib/module/locale/translations/hi.js +1 -22
  104. package/lib/module/locale/translations/hi.js.map +1 -1
  105. package/lib/module/locale/translations/id.js +1 -22
  106. package/lib/module/locale/translations/id.js.map +1 -1
  107. package/lib/module/locale/translations/it.js +1 -22
  108. package/lib/module/locale/translations/it.js.map +1 -1
  109. package/lib/module/locale/translations/ja.js +1 -22
  110. package/lib/module/locale/translations/ja.js.map +1 -1
  111. package/lib/module/locale/translations/pt.js +1 -22
  112. package/lib/module/locale/translations/pt.js.map +1 -1
  113. package/lib/module/locale/translations/ru.js +1 -22
  114. package/lib/module/locale/translations/ru.js.map +1 -1
  115. package/lib/module/locale/translations/tr.js +1 -22
  116. package/lib/module/locale/translations/tr.js.map +1 -1
  117. package/lib/module/locale/translations/zh.js +1 -22
  118. package/lib/module/locale/translations/zh.js.map +1 -1
  119. package/lib/module/multi-agent-chat/Marketplace.js +2 -2
  120. package/lib/module/multi-agent-chat/Marketplace.js.map +1 -1
  121. package/lib/module/multi-agent-chat/MultiAgentChatBase.js +7 -7
  122. package/lib/module/multi-agent-chat/MultiAgentChatBase.js.map +1 -1
  123. package/lib/module/multi-agent-chat/SelectedAgentPreview.js +2 -1
  124. package/lib/module/multi-agent-chat/SelectedAgentPreview.js.map +1 -1
  125. package/lib/module/multi-agent-chat/data.js +58 -40
  126. package/lib/module/multi-agent-chat/data.js.map +1 -1
  127. package/lib/module/multi-agent-chat/marketplace-data.js +21 -27
  128. package/lib/module/multi-agent-chat/marketplace-data.js.map +1 -1
  129. package/lib/typescript/commonjs/agent-avatar/character.d.ts +14 -0
  130. package/lib/typescript/commonjs/agent-avatar/character.d.ts.map +1 -1
  131. package/lib/typescript/commonjs/agent-avatar/index.d.ts +1 -1
  132. package/lib/typescript/commonjs/agent-avatar/index.d.ts.map +1 -1
  133. package/lib/typescript/commonjs/agent-creator/AgentCreator.d.ts.map +1 -1
  134. package/lib/typescript/commonjs/agent-creator/AgentCreator.web.d.ts.map +1 -1
  135. package/lib/typescript/commonjs/agent-creator/AgentCreatorBase.d.ts.map +1 -1
  136. package/lib/typescript/commonjs/agent-creator/context.d.ts +1 -13
  137. package/lib/typescript/commonjs/agent-creator/context.d.ts.map +1 -1
  138. package/lib/typescript/commonjs/agent-creator/messages.d.ts +0 -11
  139. package/lib/typescript/commonjs/agent-creator/messages.d.ts.map +1 -1
  140. package/lib/typescript/commonjs/agent-creator/paint.d.ts +20 -0
  141. package/lib/typescript/commonjs/agent-creator/paint.d.ts.map +1 -0
  142. package/lib/typescript/commonjs/agent-creator/shared.d.ts +0 -7
  143. package/lib/typescript/commonjs/agent-creator/shared.d.ts.map +1 -1
  144. package/lib/typescript/commonjs/agent-creator/types.d.ts +14 -0
  145. package/lib/typescript/commonjs/agent-creator/types.d.ts.map +1 -1
  146. package/lib/typescript/commonjs/agent-creator/use-character-history.d.ts +6 -2
  147. package/lib/typescript/commonjs/agent-creator/use-character-history.d.ts.map +1 -1
  148. package/lib/typescript/commonjs/avatar/Avatar.d.ts.map +1 -1
  149. package/lib/typescript/commonjs/avatar/account.d.ts +4 -2
  150. package/lib/typescript/commonjs/avatar/account.d.ts.map +1 -1
  151. package/lib/typescript/commonjs/avatar/types.d.ts +6 -0
  152. package/lib/typescript/commonjs/avatar/types.d.ts.map +1 -1
  153. package/lib/typescript/commonjs/locale/translations/ar.d.ts.map +1 -1
  154. package/lib/typescript/commonjs/locale/translations/bn.d.ts.map +1 -1
  155. package/lib/typescript/commonjs/locale/translations/ca.d.ts.map +1 -1
  156. package/lib/typescript/commonjs/locale/translations/de.d.ts.map +1 -1
  157. package/lib/typescript/commonjs/locale/translations/es.d.ts.map +1 -1
  158. package/lib/typescript/commonjs/locale/translations/fr.d.ts.map +1 -1
  159. package/lib/typescript/commonjs/locale/translations/hi.d.ts.map +1 -1
  160. package/lib/typescript/commonjs/locale/translations/id.d.ts.map +1 -1
  161. package/lib/typescript/commonjs/locale/translations/it.d.ts.map +1 -1
  162. package/lib/typescript/commonjs/locale/translations/ja.d.ts.map +1 -1
  163. package/lib/typescript/commonjs/locale/translations/pt.d.ts.map +1 -1
  164. package/lib/typescript/commonjs/locale/translations/ru.d.ts.map +1 -1
  165. package/lib/typescript/commonjs/locale/translations/tr.d.ts.map +1 -1
  166. package/lib/typescript/commonjs/locale/translations/zh.d.ts.map +1 -1
  167. package/lib/typescript/commonjs/multi-agent-chat/Marketplace.d.ts.map +1 -1
  168. package/lib/typescript/commonjs/multi-agent-chat/MultiAgentChatBase.d.ts.map +1 -1
  169. package/lib/typescript/commonjs/multi-agent-chat/SelectedAgentPreview.d.ts +1 -1
  170. package/lib/typescript/commonjs/multi-agent-chat/SelectedAgentPreview.d.ts.map +1 -1
  171. package/lib/typescript/commonjs/multi-agent-chat/data.d.ts +4 -1
  172. package/lib/typescript/commonjs/multi-agent-chat/data.d.ts.map +1 -1
  173. package/lib/typescript/commonjs/multi-agent-chat/marketplace-data.d.ts +3 -0
  174. package/lib/typescript/commonjs/multi-agent-chat/marketplace-data.d.ts.map +1 -1
  175. package/lib/typescript/module/agent-avatar/character.d.ts +14 -0
  176. package/lib/typescript/module/agent-avatar/character.d.ts.map +1 -1
  177. package/lib/typescript/module/agent-avatar/index.d.ts +1 -1
  178. package/lib/typescript/module/agent-avatar/index.d.ts.map +1 -1
  179. package/lib/typescript/module/agent-creator/AgentCreator.d.ts.map +1 -1
  180. package/lib/typescript/module/agent-creator/AgentCreator.web.d.ts.map +1 -1
  181. package/lib/typescript/module/agent-creator/AgentCreatorBase.d.ts.map +1 -1
  182. package/lib/typescript/module/agent-creator/context.d.ts +1 -13
  183. package/lib/typescript/module/agent-creator/context.d.ts.map +1 -1
  184. package/lib/typescript/module/agent-creator/messages.d.ts +0 -11
  185. package/lib/typescript/module/agent-creator/messages.d.ts.map +1 -1
  186. package/lib/typescript/module/agent-creator/paint.d.ts +20 -0
  187. package/lib/typescript/module/agent-creator/paint.d.ts.map +1 -0
  188. package/lib/typescript/module/agent-creator/shared.d.ts +0 -7
  189. package/lib/typescript/module/agent-creator/shared.d.ts.map +1 -1
  190. package/lib/typescript/module/agent-creator/types.d.ts +14 -0
  191. package/lib/typescript/module/agent-creator/types.d.ts.map +1 -1
  192. package/lib/typescript/module/agent-creator/use-character-history.d.ts +6 -2
  193. package/lib/typescript/module/agent-creator/use-character-history.d.ts.map +1 -1
  194. package/lib/typescript/module/avatar/Avatar.d.ts.map +1 -1
  195. package/lib/typescript/module/avatar/account.d.ts +4 -2
  196. package/lib/typescript/module/avatar/account.d.ts.map +1 -1
  197. package/lib/typescript/module/avatar/types.d.ts +6 -0
  198. package/lib/typescript/module/avatar/types.d.ts.map +1 -1
  199. package/lib/typescript/module/locale/translations/ar.d.ts.map +1 -1
  200. package/lib/typescript/module/locale/translations/bn.d.ts.map +1 -1
  201. package/lib/typescript/module/locale/translations/ca.d.ts.map +1 -1
  202. package/lib/typescript/module/locale/translations/de.d.ts.map +1 -1
  203. package/lib/typescript/module/locale/translations/es.d.ts.map +1 -1
  204. package/lib/typescript/module/locale/translations/fr.d.ts.map +1 -1
  205. package/lib/typescript/module/locale/translations/hi.d.ts.map +1 -1
  206. package/lib/typescript/module/locale/translations/id.d.ts.map +1 -1
  207. package/lib/typescript/module/locale/translations/it.d.ts.map +1 -1
  208. package/lib/typescript/module/locale/translations/ja.d.ts.map +1 -1
  209. package/lib/typescript/module/locale/translations/pt.d.ts.map +1 -1
  210. package/lib/typescript/module/locale/translations/ru.d.ts.map +1 -1
  211. package/lib/typescript/module/locale/translations/tr.d.ts.map +1 -1
  212. package/lib/typescript/module/locale/translations/zh.d.ts.map +1 -1
  213. package/lib/typescript/module/multi-agent-chat/Marketplace.d.ts.map +1 -1
  214. package/lib/typescript/module/multi-agent-chat/MultiAgentChatBase.d.ts.map +1 -1
  215. package/lib/typescript/module/multi-agent-chat/SelectedAgentPreview.d.ts +1 -1
  216. package/lib/typescript/module/multi-agent-chat/SelectedAgentPreview.d.ts.map +1 -1
  217. package/lib/typescript/module/multi-agent-chat/data.d.ts +4 -1
  218. package/lib/typescript/module/multi-agent-chat/data.d.ts.map +1 -1
  219. package/lib/typescript/module/multi-agent-chat/marketplace-data.d.ts +3 -0
  220. package/lib/typescript/module/multi-agent-chat/marketplace-data.d.ts.map +1 -1
  221. package/package.json +1 -1
  222. package/src/__tests__/support/adoption-matrix.ts +5 -0
  223. package/src/agent-avatar/character.ts +30 -0
  224. package/src/agent-avatar/index.ts +1 -0
  225. package/src/agent-creator/AgentCreator.tsx +0 -4
  226. package/src/agent-creator/AgentCreator.web.tsx +0 -4
  227. package/src/agent-creator/AgentCreatorBase.tsx +51 -89
  228. package/src/agent-creator/context.ts +0 -2
  229. package/src/agent-creator/messages.ts +1 -37
  230. package/src/agent-creator/paint.ts +48 -0
  231. package/src/agent-creator/shared.ts +0 -27
  232. package/src/agent-creator/types.ts +14 -0
  233. package/src/agent-creator/use-character-history.ts +8 -4
  234. package/src/avatar/Avatar.tsx +13 -3
  235. package/src/avatar/account.ts +9 -3
  236. package/src/avatar/types.ts +6 -0
  237. package/src/locale/translations/ar.ts +1 -23
  238. package/src/locale/translations/bn.ts +1 -23
  239. package/src/locale/translations/ca.ts +1 -23
  240. package/src/locale/translations/de.ts +1 -23
  241. package/src/locale/translations/es.ts +1 -23
  242. package/src/locale/translations/fr.ts +1 -23
  243. package/src/locale/translations/hi.ts +1 -23
  244. package/src/locale/translations/id.ts +1 -23
  245. package/src/locale/translations/it.ts +1 -23
  246. package/src/locale/translations/ja.ts +1 -23
  247. package/src/locale/translations/pt.ts +1 -23
  248. package/src/locale/translations/ru.ts +1 -23
  249. package/src/locale/translations/tr.ts +1 -23
  250. package/src/locale/translations/zh.ts +1 -23
  251. package/src/multi-agent-chat/Marketplace.tsx +6 -2
  252. package/src/multi-agent-chat/MultiAgentChatBase.tsx +7 -6
  253. package/src/multi-agent-chat/SelectedAgentPreview.tsx +2 -2
  254. package/src/multi-agent-chat/data.ts +58 -27
  255. package/src/multi-agent-chat/marketplace-data.ts +28 -9
  256. package/lib/commonjs/agent-creator/CustomColorPicker.js +0 -431
  257. package/lib/commonjs/agent-creator/CustomColorPicker.js.map +0 -1
  258. package/lib/commonjs/agent-creator/GlossArt.js +0 -212
  259. package/lib/commonjs/agent-creator/GlossArt.js.map +0 -1
  260. package/lib/commonjs/agent-creator/rainbow-artwork.js +0 -10
  261. package/lib/commonjs/agent-creator/rainbow-artwork.js.map +0 -1
  262. package/lib/module/agent-creator/CustomColorPicker.js +0 -426
  263. package/lib/module/agent-creator/CustomColorPicker.js.map +0 -1
  264. package/lib/module/agent-creator/GlossArt.js +0 -207
  265. package/lib/module/agent-creator/GlossArt.js.map +0 -1
  266. package/lib/module/agent-creator/rainbow-artwork.js +0 -6
  267. package/lib/module/agent-creator/rainbow-artwork.js.map +0 -1
  268. package/lib/typescript/commonjs/agent-creator/CustomColorPicker.d.ts +0 -9
  269. package/lib/typescript/commonjs/agent-creator/CustomColorPicker.d.ts.map +0 -1
  270. package/lib/typescript/commonjs/agent-creator/GlossArt.d.ts +0 -9
  271. package/lib/typescript/commonjs/agent-creator/GlossArt.d.ts.map +0 -1
  272. package/lib/typescript/commonjs/agent-creator/rainbow-artwork.d.ts +0 -3
  273. package/lib/typescript/commonjs/agent-creator/rainbow-artwork.d.ts.map +0 -1
  274. package/lib/typescript/module/agent-creator/CustomColorPicker.d.ts +0 -9
  275. package/lib/typescript/module/agent-creator/CustomColorPicker.d.ts.map +0 -1
  276. package/lib/typescript/module/agent-creator/GlossArt.d.ts +0 -9
  277. package/lib/typescript/module/agent-creator/GlossArt.d.ts.map +0 -1
  278. package/lib/typescript/module/agent-creator/rainbow-artwork.d.ts +0 -3
  279. package/lib/typescript/module/agent-creator/rainbow-artwork.d.ts.map +0 -1
  280. package/src/agent-creator/CustomColorPicker.tsx +0 -443
  281. package/src/agent-creator/GlossArt.tsx +0 -160
  282. package/src/agent-creator/rainbow-artwork.ts +0 -5
@@ -1,15 +1,25 @@
1
1
  import {
2
- AVATAR_COLORS,
3
2
  type AvatarCharacter,
3
+ avatarCharacterInColor,
4
4
  characterFromLegacy,
5
5
  parseAvatarCharacter,
6
6
  } from '../agent-avatar';
7
+ import { withoutPaint } from '../agent-creator/paint';
8
+ import { APP_COLOR_PRESETS, FREE_COLOR_NAMES } from '../theme/color-presets';
7
9
  import { pickMessages, formatMessage } from '../locale/messages';
8
10
  import { MULTI_AGENT_CHAT_MESSAGES } from './messages';
9
11
 
10
12
  import { normalizeAgentPreferences } from '../agent-creator/shared';
11
13
  import type { AgentCreatorAgent } from '../agent-creator/types';
12
14
  export type Agent = AgentCreatorAgent;
15
+
16
+ /** An agent's character as drawn: its parts, painted in the agent's own colour. */
17
+ export function agentCharacter(agent: Pick<Agent, 'avatar' | 'color'>): AvatarCharacter {
18
+ return avatarCharacterInColor(agent.avatar, agent.color);
19
+ }
20
+
21
+ /** The colour a restored agent saved without one wears. */
22
+ const DEFAULT_AGENT_COLOR = 'blue';
13
23
  export type Message = {
14
24
  id: string;
15
25
  role: 'user' | 'agent';
@@ -32,11 +42,21 @@ export type Workspace = {
32
42
  installedPlugins?: string[];
33
43
  };
34
44
 
35
- /** A saved avatar: a character, or the old `AvatarConfig` of a workspace saved before 10. */
36
- function readAvatar(saved: unknown): AvatarCharacter {
37
- return saved && typeof saved === 'object' && 'family' in saved
38
- ? characterFromLegacy(saved)
39
- : parseAvatarCharacter(saved);
45
+ /** A saved colour: a Bloom colour preset key, else the default. */
46
+ function readColor(saved: unknown): string {
47
+ return typeof saved === 'string' && saved in APP_COLOR_PRESETS ? saved : DEFAULT_AGENT_COLOR;
48
+ }
49
+
50
+ /**
51
+ * A saved avatar's parts: a character (checked painted in the agent's colour, kept without paint),
52
+ * or the old `AvatarConfig` of a workspace saved before 10.
53
+ */
54
+ function readAvatar(saved: unknown, color: string): AvatarCharacter {
55
+ return withoutPaint(
56
+ saved && typeof saved === 'object' && 'family' in saved
57
+ ? characterFromLegacy(saved)
58
+ : parseAvatarCharacter(avatarCharacterInColor(saved as AvatarCharacter, color)),
59
+ );
40
60
  }
41
61
 
42
62
  const NEW_AGENT_IDENTITIES = [
@@ -47,21 +67,25 @@ const NEW_AGENT_IDENTITIES = [
47
67
  eyes: 'oval',
48
68
  eyewear: 'none',
49
69
  accessory: 'none',
50
- color: 'blue',
51
70
  },
71
+ color: 'blue',
52
72
  },
53
73
  {
54
74
  name: 'Cloud engineer',
55
- avatar: { shape: 'cloud', eyes: 'oval', eyewear: 'none', accessory: 'none', color: 'coral' },
75
+ avatar: { shape: 'cloud', eyes: 'oval', eyewear: 'none', accessory: 'none' },
76
+ color: 'orange',
56
77
  },
57
78
  {
58
79
  name: 'Support guide',
59
- avatar: { shape: 'heart', eyes: 'oval', eyewear: 'none', accessory: 'none', color: 'teal' },
80
+ avatar: { shape: 'heart', eyes: 'oval', eyewear: 'none', accessory: 'none' },
81
+ color: 'mint',
60
82
  },
61
- ] satisfies Pick<Agent, 'name' | 'avatar'>[];
83
+ ] satisfies Pick<Agent, 'name' | 'avatar' | 'color'>[];
62
84
 
63
85
  /** Choose an unused identity, including when restoring old unnamed demo bots. */
64
- export function nextAgentIdentity(agents: Pick<Agent, 'name'>[]): Pick<Agent, 'name' | 'avatar'> {
86
+ export function nextAgentIdentity(
87
+ agents: Pick<Agent, 'name'>[],
88
+ ): Pick<Agent, 'name' | 'avatar' | 'color'> {
65
89
  const names = new Set(agents.map((agent) => agent.name.toLowerCase()));
66
90
  let index = 0;
67
91
  while (true) {
@@ -71,14 +95,13 @@ export function nextAgentIdentity(agents: Pick<Agent, 'name'>[]): Pick<Agent, 'n
71
95
  if (!names.has(name.toLowerCase()))
72
96
  return {
73
97
  name,
74
- // The same body in the next paint each time round, so a long list stays tellable apart.
75
- avatar: {
76
- ...identity.avatar,
77
- color:
78
- AVATAR_COLORS[
79
- (AVATAR_COLORS.indexOf(identity.avatar.color) + cycle) % AVATAR_COLORS.length
80
- ],
81
- },
98
+ // The same body in the next colour each time round, so a long list stays tellable apart.
99
+ avatar: { ...identity.avatar },
100
+ color:
101
+ FREE_COLOR_NAMES[
102
+ ((FREE_COLOR_NAMES as readonly string[]).indexOf(identity.color) + cycle) %
103
+ FREE_COLOR_NAMES.length
104
+ ]!,
82
105
  };
83
106
  index++;
84
107
  }
@@ -111,7 +134,8 @@ const ADDITIONAL_AGENTS: Agent[] = [
111
134
  name: 'Data analyst',
112
135
  label: 'Analytics',
113
136
  description: 'Turns data into clear insights, useful charts, and practical decisions.',
114
- avatar: { shape: 'pocket', eyes: 'oval', eyewear: 'none', accessory: 'none', color: 'cyan' },
137
+ avatar: { shape: 'pocket', eyes: 'oval', eyewear: 'none', accessory: 'none' },
138
+ color: 'sky',
115
139
  },
116
140
  ];
117
141
 
@@ -122,21 +146,24 @@ export const INITIAL_AGENTS: Agent[] = [
122
146
  label: 'Design',
123
147
  description:
124
148
  'Thoughtful layouts, clear hierarchy, and a little personality for your next landing page.',
125
- avatar: { shape: 'slender', eyes: 'oval', eyewear: 'none', accessory: 'none', color: 'teal' },
149
+ avatar: { shape: 'slender', eyes: 'oval', eyewear: 'none', accessory: 'none' },
150
+ color: 'mint',
126
151
  },
127
152
  {
128
153
  id: 'content',
129
154
  name: 'content reviewer',
130
155
  label: 'Writing',
131
156
  description: 'Makes your writing clear, concise, and unmistakably yours.',
132
- avatar: { shape: 'pocket', eyes: 'oval', eyewear: 'none', accessory: 'none', color: 'coral' },
157
+ avatar: { shape: 'pocket', eyes: 'oval', eyewear: 'none', accessory: 'none' },
158
+ color: 'orange',
133
159
  },
134
160
  {
135
161
  id: 'marketing',
136
162
  name: 'marketing bot',
137
163
  label: 'Marketing',
138
164
  description: 'Turns a good idea into a campaign people remember.',
139
- avatar: { shape: 'star', eyes: 'oval', eyewear: 'none', accessory: 'none', color: 'teal' },
165
+ avatar: { shape: 'star', eyes: 'oval', eyewear: 'none', accessory: 'none' },
166
+ color: 'mint',
140
167
  },
141
168
  {
142
169
  id: 'seo',
@@ -148,15 +175,16 @@ export const INITIAL_AGENTS: Agent[] = [
148
175
  eyes: 'oval',
149
176
  eyewear: 'none',
150
177
  accessory: 'none',
151
- color: 'violet',
152
178
  },
179
+ color: 'violet',
153
180
  },
154
181
  {
155
182
  id: 'research',
156
183
  name: 'research assistant',
157
184
  label: 'Research',
158
185
  description: 'Connects the dots, asks better questions, and brings the evidence.',
159
- avatar: { shape: 'petal', eyes: 'oval', eyewear: 'none', accessory: 'none', color: 'yellow' },
186
+ avatar: { shape: 'petal', eyes: 'oval', eyewear: 'none', accessory: 'none' },
187
+ color: 'yellow',
160
188
  },
161
189
  {
162
190
  id: 'security',
@@ -164,7 +192,8 @@ export const INITIAL_AGENTS: Agent[] = [
164
192
  label: 'Security',
165
193
  description:
166
194
  'A careful second pair of eyes for permissions, privacy, and application security.',
167
- avatar: { shape: 'shield', eyes: 'oval', eyewear: 'none', accessory: 'none', color: 'teal' },
195
+ avatar: { shape: 'shield', eyes: 'oval', eyewear: 'none', accessory: 'none' },
196
+ color: 'mint',
168
197
  },
169
198
  ...ADDITIONAL_AGENTS,
170
199
  ];
@@ -287,7 +316,8 @@ export function restoreWorkspace(raw: string): Workspace | null {
287
316
  label: a.label.slice(0, 60),
288
317
  description: a.description.slice(0, 500),
289
318
  ...(a.preferences ? { preferences: normalizeAgentPreferences(a.preferences) } : {}),
290
- avatar: readAvatar(a.avatar),
319
+ color: readColor(a.color),
320
+ avatar: readAvatar(a.avatar, readColor(a.color)),
291
321
  };
292
322
  });
293
323
  const renamed = new Set<string>();
@@ -402,6 +432,7 @@ export function restoreWorkspace(raw: string): Workspace | null {
402
432
  agent.label !== original.label ||
403
433
  agent.description !== original.description ||
404
434
  agent.preferences ||
435
+ agent.color !== original.color ||
405
436
  Object.entries(original.avatar).some(
406
437
  ([key, value]) => agent.avatar[key as keyof AvatarCharacter] !== value,
407
438
  );
@@ -21,7 +21,10 @@ export type MarketplaceItem = {
21
21
  | 'appwrite'
22
22
  | 'linear'
23
23
  | 'aws';
24
+ /** A bot's character parts; it is drawn in `color`. */
24
25
  avatar?: AvatarCharacter;
26
+ /** A bot's colour: a Bloom colour preset key. */
27
+ color?: string;
25
28
  apps: string[];
26
29
  skills: { name: string; description: string }[];
27
30
  };
@@ -55,6 +58,7 @@ const bot = (
55
58
  description: string,
56
59
  detail: string,
57
60
  avatar: AvatarCharacter,
61
+ color: string,
58
62
  skills: MarketplaceItem['skills'],
59
63
  ): MarketplaceItem => ({
60
64
  id,
@@ -66,6 +70,7 @@ const bot = (
66
70
  developer: 'Bloom',
67
71
  website: 'https://oxy.so',
68
72
  avatar,
73
+ color,
69
74
  apps: [],
70
75
  skills,
71
76
  });
@@ -178,7 +183,8 @@ export const MARKETPLACE_ITEMS: MarketplaceItem[] = [
178
183
  'Writing',
179
184
  'Find the words that make your idea click.',
180
185
  'A thoughtful writing partner for pitches, introductions, and the story behind your product. Explore a few directions, sharpen your message, and keep your own voice.',
181
- { shape: 'petal', eyes: 'oval', eyewear: 'none', accessory: 'none', color: 'coral' },
186
+ { shape: 'petal', eyes: 'oval', eyewear: 'none', accessory: 'none' },
187
+ 'orange',
182
188
  [
183
189
  {
184
190
  name: 'Storytelling',
@@ -192,7 +198,8 @@ export const MARKETPLACE_ITEMS: MarketplaceItem[] = [
192
198
  'Productivity',
193
199
  'Good conversations deserve clear next steps.',
194
200
  'Turn pasted meeting notes into a useful recap. Pull out decisions, open questions, and action items so the next step is easy to see.',
195
- { shape: 'pocket', eyes: 'oval', eyewear: 'none', accessory: 'none', color: 'teal' },
201
+ { shape: 'pocket', eyes: 'oval', eyewear: 'none', accessory: 'none' },
202
+ 'mint',
196
203
  [
197
204
  {
198
205
  name: 'Meeting summaries',
@@ -206,7 +213,8 @@ export const MARKETPLACE_ITEMS: MarketplaceItem[] = [
206
213
  'Marketing',
207
214
  'From a promising idea to launch day.',
208
215
  'Plan a focused launch with an agent that keeps the audience, message, and next milestone in view. Build a checklist and refine the details as you go.',
209
- { shape: 'star', eyes: 'oval', eyewear: 'none', accessory: 'none', color: 'violet' },
216
+ { shape: 'star', eyes: 'oval', eyewear: 'none', accessory: 'none' },
217
+ 'violet',
210
218
  [
211
219
  {
212
220
  name: 'Launch planning',
@@ -220,7 +228,8 @@ export const MARKETPLACE_ITEMS: MarketplaceItem[] = [
220
228
  'Development',
221
229
  'A fresh pair of eyes on your next change.',
222
230
  'Talk through pasted code and review changes for clarity, edge cases, and maintainability. Get actionable feedback with enough context to understand the tradeoffs.',
223
- { shape: 'six_lobed_flower', eyes: 'oval', eyewear: 'none', accessory: 'none', color: 'cyan' },
231
+ { shape: 'six_lobed_flower', eyes: 'oval', eyewear: 'none', accessory: 'none' },
232
+ 'sky',
224
233
  [
225
234
  {
226
235
  name: 'Code feedback',
@@ -234,7 +243,8 @@ export const MARKETPLACE_ITEMS: MarketplaceItem[] = [
234
243
  'Design',
235
244
  'Turn a rough idea into a thoughtful interface.',
236
245
  'Explore layouts, refine visual hierarchy, and talk through the details that make an interface feel natural. Bring a brief or describe a screen to get practical design feedback.',
237
- { shape: 'heart', eyes: 'oval', eyewear: 'none', accessory: 'none', color: 'pink' },
246
+ { shape: 'heart', eyes: 'oval', eyewear: 'none', accessory: 'none' },
247
+ 'pink',
238
248
  [
239
249
  {
240
250
  name: 'Interface feedback',
@@ -248,7 +258,8 @@ export const MARKETPLACE_ITEMS: MarketplaceItem[] = [
248
258
  'Research',
249
259
  'Find the useful signals in your research.',
250
260
  'Make sense of pasted articles, interview notes, and research findings. Compare perspectives, separate evidence from assumptions, and identify questions worth exploring next.',
251
- { shape: 'rounded_diamond', eyes: 'oval', eyewear: 'none', accessory: 'none', color: 'yellow' },
261
+ { shape: 'rounded_diamond', eyes: 'oval', eyewear: 'none', accessory: 'none' },
262
+ 'yellow',
252
263
  [
253
264
  {
254
265
  name: 'Research synthesis',
@@ -262,7 +273,8 @@ export const MARKETPLACE_ITEMS: MarketplaceItem[] = [
262
273
  'Analytics',
263
274
  'Make the numbers easier to understand.',
264
275
  'Walk through the data you share and turn patterns into clear explanations. Explore useful comparisons, question unexpected results, and choose how to present your findings.',
265
- { shape: 'shield', eyes: 'oval', eyewear: 'none', accessory: 'none', color: 'cyan' },
276
+ { shape: 'shield', eyes: 'oval', eyewear: 'none', accessory: 'none' },
277
+ 'sky',
266
278
  [
267
279
  {
268
280
  name: 'Data interpretation',
@@ -276,7 +288,8 @@ export const MARKETPLACE_ITEMS: MarketplaceItem[] = [
276
288
  'Support',
277
289
  'A little clarity for every customer question.',
278
290
  'Draft helpful replies from the customer questions and product context you provide. Break troubleshooting into simple steps and keep the tone warm, clear, and consistent.',
279
- { shape: 'cloud', eyes: 'oval', eyewear: 'none', accessory: 'none', color: 'lime' },
291
+ { shape: 'cloud', eyes: 'oval', eyewear: 'none', accessory: 'none' },
292
+ 'green',
280
293
  [
281
294
  {
282
295
  name: 'Customer replies',
@@ -302,7 +315,12 @@ export function filterMarketplace(query: string, kind: 'all' | 'plugin' | 'bot'
302
315
  }
303
316
  export function addMarketplaceBot(workspace: Workspace, item: MarketplaceItem): Workspace {
304
317
  const id = marketplaceAgentId(item.id);
305
- if (item.kind !== 'bot' || !item.avatar || workspace.agents.some((agent) => agent.id === id))
318
+ if (
319
+ item.kind !== 'bot' ||
320
+ !item.avatar ||
321
+ !item.color ||
322
+ workspace.agents.some((agent) => agent.id === id)
323
+ )
306
324
  return workspace;
307
325
  const agent = {
308
326
  id,
@@ -310,6 +328,7 @@ export function addMarketplaceBot(workspace: Workspace, item: MarketplaceItem):
310
328
  label: item.category,
311
329
  description: item.description,
312
330
  avatar: { ...item.avatar },
331
+ color: item.color,
313
332
  };
314
333
  const chat = conversationFor([agent], [id], `chat-${id}`);
315
334
  return {