@oxy.so/bloom 19.11.0 → 21.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 (117) hide show
  1. package/docs/adoption-matrix.mdx +1 -1
  2. package/docs/agent-avatar.mdx +20 -0
  3. package/docs/agent-creator.mdx +20 -12
  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/AgentCreatorBase.js +31 -24
  12. package/lib/commonjs/agent-creator/AgentCreatorBase.js.map +1 -1
  13. package/lib/commonjs/agent-creator/paint.js +59 -0
  14. package/lib/commonjs/agent-creator/paint.js.map +1 -0
  15. package/lib/commonjs/agent-creator/use-character-history.js +12 -9
  16. package/lib/commonjs/agent-creator/use-character-history.js.map +1 -1
  17. package/lib/commonjs/avatar/Avatar.js +12 -4
  18. package/lib/commonjs/avatar/Avatar.js.map +1 -1
  19. package/lib/commonjs/avatar/account.js +9 -3
  20. package/lib/commonjs/avatar/account.js.map +1 -1
  21. package/lib/commonjs/multi-agent-chat/Marketplace.js +1 -1
  22. package/lib/commonjs/multi-agent-chat/Marketplace.js.map +1 -1
  23. package/lib/commonjs/multi-agent-chat/MultiAgentChatBase.js +6 -6
  24. package/lib/commonjs/multi-agent-chat/MultiAgentChatBase.js.map +1 -1
  25. package/lib/commonjs/multi-agent-chat/SelectedAgentPreview.js +2 -1
  26. package/lib/commonjs/multi-agent-chat/SelectedAgentPreview.js.map +1 -1
  27. package/lib/commonjs/multi-agent-chat/data.js +58 -39
  28. package/lib/commonjs/multi-agent-chat/data.js.map +1 -1
  29. package/lib/commonjs/multi-agent-chat/marketplace-data.js +21 -27
  30. package/lib/commonjs/multi-agent-chat/marketplace-data.js.map +1 -1
  31. package/lib/module/agent-avatar/character.js +26 -0
  32. package/lib/module/agent-avatar/character.js.map +1 -1
  33. package/lib/module/agent-avatar/index.js +1 -1
  34. package/lib/module/agent-avatar/index.js.map +1 -1
  35. package/lib/module/agent-creator/AgentCreatorBase.js +31 -24
  36. package/lib/module/agent-creator/AgentCreatorBase.js.map +1 -1
  37. package/lib/module/agent-creator/paint.js +53 -0
  38. package/lib/module/agent-creator/paint.js.map +1 -0
  39. package/lib/module/agent-creator/use-character-history.js +7 -4
  40. package/lib/module/agent-creator/use-character-history.js.map +1 -1
  41. package/lib/module/avatar/Avatar.js +12 -4
  42. package/lib/module/avatar/Avatar.js.map +1 -1
  43. package/lib/module/avatar/account.js +9 -3
  44. package/lib/module/avatar/account.js.map +1 -1
  45. package/lib/module/multi-agent-chat/Marketplace.js +2 -2
  46. package/lib/module/multi-agent-chat/Marketplace.js.map +1 -1
  47. package/lib/module/multi-agent-chat/MultiAgentChatBase.js +7 -7
  48. package/lib/module/multi-agent-chat/MultiAgentChatBase.js.map +1 -1
  49. package/lib/module/multi-agent-chat/SelectedAgentPreview.js +2 -1
  50. package/lib/module/multi-agent-chat/SelectedAgentPreview.js.map +1 -1
  51. package/lib/module/multi-agent-chat/data.js +58 -40
  52. package/lib/module/multi-agent-chat/data.js.map +1 -1
  53. package/lib/module/multi-agent-chat/marketplace-data.js +21 -27
  54. package/lib/module/multi-agent-chat/marketplace-data.js.map +1 -1
  55. package/lib/typescript/commonjs/agent-avatar/character.d.ts +14 -0
  56. package/lib/typescript/commonjs/agent-avatar/character.d.ts.map +1 -1
  57. package/lib/typescript/commonjs/agent-avatar/index.d.ts +1 -1
  58. package/lib/typescript/commonjs/agent-avatar/index.d.ts.map +1 -1
  59. package/lib/typescript/commonjs/agent-creator/AgentCreatorBase.d.ts.map +1 -1
  60. package/lib/typescript/commonjs/agent-creator/paint.d.ts +25 -0
  61. package/lib/typescript/commonjs/agent-creator/paint.d.ts.map +1 -0
  62. package/lib/typescript/commonjs/agent-creator/types.d.ts +11 -0
  63. package/lib/typescript/commonjs/agent-creator/types.d.ts.map +1 -1
  64. package/lib/typescript/commonjs/agent-creator/use-character-history.d.ts +6 -2
  65. package/lib/typescript/commonjs/agent-creator/use-character-history.d.ts.map +1 -1
  66. package/lib/typescript/commonjs/avatar/Avatar.d.ts.map +1 -1
  67. package/lib/typescript/commonjs/avatar/account.d.ts +4 -2
  68. package/lib/typescript/commonjs/avatar/account.d.ts.map +1 -1
  69. package/lib/typescript/commonjs/avatar/types.d.ts +5 -0
  70. package/lib/typescript/commonjs/avatar/types.d.ts.map +1 -1
  71. package/lib/typescript/commonjs/multi-agent-chat/Marketplace.d.ts.map +1 -1
  72. package/lib/typescript/commonjs/multi-agent-chat/MultiAgentChatBase.d.ts.map +1 -1
  73. package/lib/typescript/commonjs/multi-agent-chat/SelectedAgentPreview.d.ts +1 -1
  74. package/lib/typescript/commonjs/multi-agent-chat/SelectedAgentPreview.d.ts.map +1 -1
  75. package/lib/typescript/commonjs/multi-agent-chat/data.d.ts +4 -1
  76. package/lib/typescript/commonjs/multi-agent-chat/data.d.ts.map +1 -1
  77. package/lib/typescript/commonjs/multi-agent-chat/marketplace-data.d.ts +3 -0
  78. package/lib/typescript/commonjs/multi-agent-chat/marketplace-data.d.ts.map +1 -1
  79. package/lib/typescript/module/agent-avatar/character.d.ts +14 -0
  80. package/lib/typescript/module/agent-avatar/character.d.ts.map +1 -1
  81. package/lib/typescript/module/agent-avatar/index.d.ts +1 -1
  82. package/lib/typescript/module/agent-avatar/index.d.ts.map +1 -1
  83. package/lib/typescript/module/agent-creator/AgentCreatorBase.d.ts.map +1 -1
  84. package/lib/typescript/module/agent-creator/paint.d.ts +25 -0
  85. package/lib/typescript/module/agent-creator/paint.d.ts.map +1 -0
  86. package/lib/typescript/module/agent-creator/types.d.ts +11 -0
  87. package/lib/typescript/module/agent-creator/types.d.ts.map +1 -1
  88. package/lib/typescript/module/agent-creator/use-character-history.d.ts +6 -2
  89. package/lib/typescript/module/agent-creator/use-character-history.d.ts.map +1 -1
  90. package/lib/typescript/module/avatar/Avatar.d.ts.map +1 -1
  91. package/lib/typescript/module/avatar/account.d.ts +4 -2
  92. package/lib/typescript/module/avatar/account.d.ts.map +1 -1
  93. package/lib/typescript/module/avatar/types.d.ts +5 -0
  94. package/lib/typescript/module/avatar/types.d.ts.map +1 -1
  95. package/lib/typescript/module/multi-agent-chat/Marketplace.d.ts.map +1 -1
  96. package/lib/typescript/module/multi-agent-chat/MultiAgentChatBase.d.ts.map +1 -1
  97. package/lib/typescript/module/multi-agent-chat/SelectedAgentPreview.d.ts +1 -1
  98. package/lib/typescript/module/multi-agent-chat/SelectedAgentPreview.d.ts.map +1 -1
  99. package/lib/typescript/module/multi-agent-chat/data.d.ts +4 -1
  100. package/lib/typescript/module/multi-agent-chat/data.d.ts.map +1 -1
  101. package/lib/typescript/module/multi-agent-chat/marketplace-data.d.ts +3 -0
  102. package/lib/typescript/module/multi-agent-chat/marketplace-data.d.ts.map +1 -1
  103. package/package.json +1 -1
  104. package/src/agent-avatar/character.ts +30 -0
  105. package/src/agent-avatar/index.ts +1 -0
  106. package/src/agent-creator/AgentCreatorBase.tsx +30 -24
  107. package/src/agent-creator/paint.ts +58 -0
  108. package/src/agent-creator/types.ts +11 -0
  109. package/src/agent-creator/use-character-history.ts +8 -4
  110. package/src/avatar/Avatar.tsx +13 -3
  111. package/src/avatar/account.ts +9 -3
  112. package/src/avatar/types.ts +5 -0
  113. package/src/multi-agent-chat/Marketplace.tsx +6 -2
  114. package/src/multi-agent-chat/MultiAgentChatBase.tsx +7 -6
  115. package/src/multi-agent-chat/SelectedAgentPreview.tsx +2 -2
  116. package/src/multi-agent-chat/data.ts +60 -27
  117. package/src/multi-agent-chat/marketplace-data.ts +28 -9
@@ -13,6 +13,11 @@ export interface AvatarAccount {
13
13
  avatar?: string | null;
14
14
  /** Stored bot character data, validated before rendering. Unknown recipes fall back to its image. */
15
15
  character?: unknown;
16
+ /**
17
+ * The account's colour, as Oxy stores `User.color`: a Bloom colour preset key or a `#rrggbb`. A bot's character is drawn in it (`avatarCharacterInColor`), so a bot looks the
18
+ * colour of its account everywhere its account is drawn.
19
+ */
20
+ color?: string | null;
16
21
  username?: string | null;
17
22
  /** A display name, or the account service's structured name. */
18
23
  name?: string | {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/avatar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,oBAAW,CAAC;AAEvE;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,iGAAiG;IACjG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8FAA8F;IAC9F,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,qGAAqG;IACrG,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,GAAG;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAC/F;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEvD,MAAM,WAAW,gBAAgB;IAC/B,uDAAuD;IACvD,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,2DAA2D;IAC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"version":3,"file":"Marketplace.d.ts","sourceRoot":"","sources":["../../../../src/multi-agent-chat/Marketplace.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AA6BhE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAQ,CAAC;AACpC,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,uBAAoB,CAAC;AAoI5B,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,gBAAgB,EAChB,cAAc,EACd,QAAQ,EACR,MAAM,EACN,OAAO,EACP,MAAM,EACN,WAAW,EACX,WAA2B,GAC5B,EAAE;IACD,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,QAAQ,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IAC1C,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;CACzC,qBAmZA"}
1
+ {"version":3,"file":"Marketplace.d.ts","sourceRoot":"","sources":["../../../../src/multi-agent-chat/Marketplace.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AA6BhE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAQ,CAAC;AACpC,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,uBAAoB,CAAC;AAwI5B,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,gBAAgB,EAChB,cAAc,EACd,QAAQ,EACR,MAAM,EACN,OAAO,EACP,MAAM,EACN,WAAW,EACX,WAA2B,GAC5B,EAAE;IACD,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,QAAQ,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IAC1C,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;CACzC,qBAmZA"}
@@ -1 +1 @@
1
- {"version":3,"file":"MultiAgentChatBase.d.ts","sourceRoot":"","sources":["../../../../src/multi-agent-chat/MultiAgentChatBase.tsx"],"names":[],"mappings":"AAyDA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAS,CAAC;AAmBnD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,mBAAmB,+BAq6B5D"}
1
+ {"version":3,"file":"MultiAgentChatBase.d.ts","sourceRoot":"","sources":["../../../../src/multi-agent-chat/MultiAgentChatBase.tsx"],"names":[],"mappings":"AA0DA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAS,CAAC;AAmBnD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,mBAAmB,+BAq6B5D"}
@@ -1,5 +1,5 @@
1
1
  import type { AvatarFlights } from '../avatar-flight';
2
- import type { Agent } from './data.js';
2
+ import { type Agent } from './data.js';
3
3
  /** The selected-preview composition: one large avatar, a trio, or a ring from four up. */
4
4
  export declare function previewAvatarGeometry(count: number, index: number): {
5
5
  size: number;
@@ -1 +1 @@
1
- {"version":3,"file":"SelectedAgentPreview.d.ts","sourceRoot":"","sources":["../../../../src/multi-agent-chat/SelectedAgentPreview.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAQ,CAAC;AAKpC,0FAA0F;AAC1F,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;;;;EAsBjE;AAmDD,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACN,OAAO,EACP,MAAM,EACN,OAAe,GAChB,EAAE;IACD,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,OAAO,EAAE,aAAa,CAAC;IACvB,2EAA2E;IAC3E,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,+BAqCA"}
1
+ {"version":3,"file":"SelectedAgentPreview.d.ts","sourceRoot":"","sources":["../../../../src/multi-agent-chat/SelectedAgentPreview.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMtD,OAAO,EAAkB,KAAK,KAAK,EAAE,MAAM,WAAQ,CAAC;AAKpD,0FAA0F;AAC1F,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;;;;EAsBjE;AAmDD,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACN,OAAO,EACP,MAAM,EACN,OAAe,GAChB,EAAE;IACD,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,OAAO,EAAE,aAAa,CAAC;IACvB,2EAA2E;IAC3E,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,+BAqCA"}
@@ -1,5 +1,8 @@
1
+ import { type AvatarCharacter } from '../agent-avatar/index.js';
1
2
  import type { AgentCreatorAgent } from '../agent-creator/types.js';
2
3
  export type Agent = AgentCreatorAgent;
4
+ /** An agent's character as drawn: its parts, painted in the agent's own colour. */
5
+ export declare function agentCharacter(agent: Pick<Agent, 'avatar' | 'color'>): AvatarCharacter;
3
6
  export type Message = {
4
7
  id: string;
5
8
  role: 'user' | 'agent';
@@ -22,7 +25,7 @@ export type Workspace = {
22
25
  installedPlugins?: string[];
23
26
  };
24
27
  /** Choose an unused identity, including when restoring old unnamed demo bots. */
25
- export declare function nextAgentIdentity(agents: Pick<Agent, 'name'>[]): Pick<Agent, 'name' | 'avatar'>;
28
+ export declare function nextAgentIdentity(agents: Pick<Agent, 'name'>[]): Pick<Agent, 'name' | 'avatar' | 'color'>;
26
29
  export declare const INITIAL_AGENTS: Agent[];
27
30
  export declare const INITIAL_WORKSPACE: Workspace;
28
31
  /** Restored data is bounded and validated before it reaches the animated renderer. */
@@ -1 +1 @@
1
- {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/multi-agent-chat/data.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAAwB,CAAC;AAChE,MAAM,MAAM,KAAK,GAAG,iBAAiB,CAAC;AACtC,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AACF,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB,CAAC;AACF,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,KAAK,EAAE,YAAY,EAAE,CAAC;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AAE,EAAE,EAAE,MAAM,GAAG,YAAY,CAQxF;AAED,mGAAmG;AACnG,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAAE,GACjB,SAAS,CAWX;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,CAOlF;AAED,oFAAoF;AACpF,eAAO,MAAM,YAAY,ilIAWf,CAAC;AAEX,gFAAgF;AAChF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQpD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,SAAI,GAAG,MAAM,CAqBxD"}
@@ -10,7 +10,10 @@ export type MarketplaceItem = {
10
10
  developer: string;
11
11
  website: string;
12
12
  logo?: 'notion' | 'figma' | 'github' | 'slack' | 'gmail' | 'drive' | 'calendar' | 'appwrite' | 'linear' | 'aws';
13
+ /** A bot's character parts; it is drawn in `color`. */
13
14
  avatar?: AvatarCharacter;
15
+ /** A bot's colour: a Bloom colour preset key. */
16
+ color?: string;
14
17
  apps: string[];
15
18
  skills: {
16
19
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"marketplace-data.d.ts","sourceRoot":"","sources":["../../../../src/multi-agent-chat/marketplace-data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAAiB,CAAC;AACvD,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,WAAQ,CAAC;AAEzD,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,GAAG,KAAK,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC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AO,GACP,QAAQ,GACR,OAAO,GACP,OAAO,GACP,OAAO,GACP,UAAU,GACV,UAAU,GACV,QAAQ,GACR,KAAK,CAAC;IACV,uDAAuD;IACvD,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACjD,CAAC;AAgDF,yFAAyF;AACzF,eAAO,MAAM,iBAAiB,EAAE,eAAe,EA6N9C,CAAC;AAEF,eAAO,MAAM,eAAe,UAA0C,CAAC;AACvE,eAAO,MAAM,kBAAkB,GAAI,IAAI,MAAM,WAAwB,CAAC;AACtE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,KAAK,GAAG,QAAQ,GAAG,KAAa,qBAWtF;AACD,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,GAAG,SAAS,CAuBxF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxy.so/bloom",
3
- "version": "19.11.0",
3
+ "version": "21.0.0",
4
4
  "packageManager": "bun@1.4.3",
5
5
  "description": "Bloom UI — Oxy ecosystem component library for React Native + Expo + Web",
6
6
  "main": "lib/commonjs/index.js",
@@ -14,6 +14,7 @@ import {
14
14
  } from './catalog-ids';
15
15
  import { CHARACTER_COLORS } from './character-colors';
16
16
  import { normalizeAvatarSkinColor } from './skin-color';
17
+ import { APP_COLOR_PRESETS, resolveProfileColor } from '../theme/color-presets';
17
18
  import { CHARACTER_PRESET_DEFAULTS } from './character-preset-defaults';
18
19
 
19
20
  /**
@@ -203,6 +204,35 @@ export function updateAvatarCharacter(
203
204
  return next;
204
205
  }
205
206
 
207
+ /**
208
+ * A character painted in its account's colour.
209
+ *
210
+ * `color` is the colour of the account the character stands for, as Oxy stores `User.color`: a
211
+ * Bloom colour preset key (`'lagoon'`) or a hex (`'#ff8b67'`, `'#f80'`), both ordinary account
212
+ * colours. A preset paints the body its identity seed, a hex paints it that hex, each lifted to the
213
+ * avatar skin floor (`normalizeAvatarSkinColor`), so a hex an editor wrote back comes out exactly as
214
+ * written. This is the one place an account colour becomes an avatar paint.
215
+ *
216
+ * The result carries `bodyColor` and no `color`; every part is kept. A colour that does not resolve
217
+ * (`null`, `undefined`, an unknown key) returns the character unchanged, so its own paint (or its
218
+ * preset's) applies.
219
+ */
220
+ export function avatarCharacterInColor(
221
+ character: AvatarCharacter,
222
+ color: string | null | undefined,
223
+ ): AvatarCharacter {
224
+ const resolved = resolveProfileColor(color);
225
+ if (resolved === undefined) return character;
226
+ const seed =
227
+ resolved.colorPreset === undefined
228
+ ? resolved.seed
229
+ : APP_COLOR_PRESETS[resolved.colorPreset].hex;
230
+ const painted: AvatarCharacter = { ...character };
231
+ delete painted.color;
232
+ painted.bodyColor = normalizeAvatarSkinColor(seed);
233
+ return painted;
234
+ }
235
+
206
236
  /** The body paint as `#rrggbb`, whichever way it was named. */
207
237
  export function avatarBodyHex(resolved: ResolvedAvatarCharacter): string {
208
238
  return 'bodyColor' in resolved.paint
@@ -8,6 +8,7 @@ export type { AgentAvatarMood, AgentAvatarProps, AgentAvatarProviderProps } from
8
8
  // checks saved JSON, `characterFromLegacy` migrates an avatar saved before 10.
9
9
  export {
10
10
  avatarBodyHex,
11
+ avatarCharacterInColor,
11
12
  avatarCharacterOf,
12
13
  parseAvatarCharacter,
13
14
  resolveAvatarCharacter,
@@ -8,6 +8,8 @@ import {
8
8
  resolveAvatarCharacter,
9
9
  updateAvatarCharacter,
10
10
  } from '../agent-avatar';
11
+ import { normalizeAvatarSkinColor } from '../agent-avatar/skin-color';
12
+ import { accountBodyHex, drawnCharacter } from './paint';
11
13
  import { editorShapeId } from './shape-choices';
12
14
  import { ButtonGroup, ButtonGroupItem } from '../button-group';
13
15
  import { RiArrowGoBackLine } from '../icons/remix/RiArrowGoBackLine';
@@ -103,13 +105,25 @@ export function AgentCreatorBase(props: AgentCreatorProps) {
103
105
  node?.addEventListener('keydown', keydown);
104
106
  return () => node?.removeEventListener('keydown', keydown);
105
107
  }, []);
106
- // Every control reads the resolved character and writes one edit to the saved one.
107
- const character = useMemo(() => resolveAvatarCharacter(avatar), [avatar]);
108
+ // Every control draws the character in the agent's colour and writes one edit to the saved
109
+ // one; the history keeps the parts and drops the paint.
110
+ const painted = useMemo(() => drawnCharacter(avatar, agent.color), [avatar, agent.color]);
111
+ const character = useMemo(() => resolveAvatarCharacter(painted), [painted]);
108
112
  const edit = (patch: Parameters<typeof updateAvatarCharacter>[1]) =>
109
- history.change(updateAvatarCharacter(avatar, patch));
110
- const paintColor = 'color' in character.paint ? character.paint.color : undefined;
111
- const customHex = 'bodyColor' in character.paint ? character.paint.bodyColor : undefined;
113
+ history.change(updateAvatarCharacter(painted, patch));
112
114
  const bodyHex = avatarBodyHex(character);
115
+ // The colour control writes the ACCOUNT's colour, as the hex the avatar is drawn in.
116
+ const colorHex = accountBodyHex(agent.color);
117
+ const namedColor = CHARACTER_OPTIONS.color.find(
118
+ ([id]) => normalizeAvatarSkinColor(CHARACTER_COLORS[id]) === colorHex,
119
+ )?.[0];
120
+ const customHex = namedColor === undefined ? colorHex : undefined;
121
+ const changeColor = (hex: string) => {
122
+ if (!/^#[0-9a-f]{6}$/i.test(hex)) return;
123
+ const color = normalizeAvatarSkinColor(hex);
124
+ if (color === accountBodyHex(latest.current.agent.color)) return;
125
+ latest.current.onChange({ ...latest.current.agent, color });
126
+ };
113
127
  const shapeChoices = useMemo(
114
128
  () =>
115
129
  CHARACTER_OPTIONS.shape.map(([id, title]) => ({
@@ -118,9 +132,9 @@ export function AgentCreatorBase(props: AgentCreatorProps) {
118
132
  id in messages.shapes
119
133
  ? messages.shapes[id as keyof typeof messages.shapes]
120
134
  : messages.characterOption('shape', id, title),
121
- character: updateAvatarCharacter(avatar, { shape: id }),
135
+ character: updateAvatarCharacter(painted, { shape: id }),
122
136
  })),
123
- [avatar, messages],
137
+ [painted, messages],
124
138
  );
125
139
  const nearby = useMemo(() => {
126
140
  const index = CHARACTER_OPTIONS.shape.findIndex(
@@ -128,19 +142,19 @@ export function AgentCreatorBase(props: AgentCreatorProps) {
128
142
  );
129
143
  return [index - 1, index + 1].flatMap((i) => {
130
144
  const next = CHARACTER_OPTIONS.shape[i];
131
- return next ? [updateAvatarCharacter(avatar, { shape: next[0] })] : [];
145
+ return next ? [updateAvatarCharacter(painted, { shape: next[0] })] : [];
132
146
  });
133
- }, [avatar, character.shape]);
147
+ }, [painted, character.shape]);
134
148
  useVectorGeometryPreparation(nearby);
135
149
  const eyeChoices = useMemo(
136
150
  () =>
137
151
  CHARACTER_OPTIONS.eyes.map(([id, title]) => ({
138
152
  id,
139
153
  label: messages.characterOption('eyes', id, title),
140
- character: updateAvatarCharacter(avatar, { eyes: id }),
154
+ character: updateAvatarCharacter(painted, { eyes: id }),
141
155
  disabled: false,
142
156
  })),
143
- [avatar, messages],
157
+ [painted, messages],
144
158
  );
145
159
  return (
146
160
  <AgentCreatorCopyContext.Provider value={copy}>
@@ -238,7 +252,7 @@ export function AgentCreatorBase(props: AgentCreatorProps) {
238
252
  }}
239
253
  >
240
254
  <AgentAvatar
241
- character={avatar}
255
+ character={painted}
242
256
  size={162}
243
257
  interactive
244
258
  renderer="svg"
@@ -287,7 +301,7 @@ export function AgentCreatorBase(props: AgentCreatorProps) {
287
301
  }}
288
302
  >
289
303
  {CHARACTER_OPTIONS.color.map(([id, title]) => {
290
- const active = paintColor === id;
304
+ const active = namedColor === id;
291
305
  const hex = CHARACTER_COLORS[id];
292
306
  const disabled = false;
293
307
  return (
@@ -301,7 +315,7 @@ export function AgentCreatorBase(props: AgentCreatorProps) {
301
315
  aria-disabled={disabled}
302
316
  accessibilityState={{ selected: active, disabled }}
303
317
  disabled={disabled}
304
- onPress={() => edit({ color: id as typeof paintColor })}
318
+ onPress={() => changeColor(hex)}
305
319
  className="relative shrink-0 cursor-pointer overflow-hidden rounded-full transition-transform duration-150 ease-out hover:scale-110 outline-none focus-visible:ring-2 focus-visible:ring-border-focus-ring focus-visible:ring-offset-2 size-[26px]"
306
320
  >
307
321
  <GlossArt center={hex} edge={hex} active={active} />
@@ -330,20 +344,12 @@ export function AgentCreatorBase(props: AgentCreatorProps) {
330
344
  maxWidth={248}
331
345
  className="w-[248px] rounded-3xl p-2.5"
332
346
  >
333
- <CustomColorPicker
334
- key={agent.id}
335
- value={bodyHex}
336
- onInteractionStart={history.begin}
337
- onInteractionEnd={history.end}
338
- onChange={(hex) => {
339
- if (/^#[0-9a-f]{6}$/i.test(hex)) edit({ bodyColor: hex.toLowerCase() });
340
- }}
341
- />
347
+ <CustomColorPicker key={agent.id} value={bodyHex} onChange={changeColor} />
342
348
  </PopoverContent>
343
349
  </Popover>
344
350
  </StyledView>
345
351
  </StyledView>
346
- <CharacterControls character={avatar} onChange={history.change} />
352
+ <CharacterControls character={painted} onChange={history.change} />
347
353
  <StyledView
348
354
  className="mt-[15px] overflow-hidden rounded-2xl bg-background-secondary-default ps-3"
349
355
  style={{ backgroundColor: colors.backgroundSecondary }}
@@ -0,0 +1,58 @@
1
+ import {
2
+ avatarCharacterInColor,
3
+ resolveAvatarCharacter,
4
+ tryResolveAvatarCharacter,
5
+ type AvatarCharacter,
6
+ } from '../agent-avatar/character';
7
+ import { CHARACTER_COLORS } from '../agent-avatar/character-colors';
8
+
9
+ /**
10
+ * The creator's colour is the agent's account colour (`agent.color`), never the character's: a
11
+ * character it hands back carries its parts and no paint, and every character it draws is painted
12
+ * in the account's colour here.
13
+ */
14
+
15
+ /** A character without its paint: what the creator emits. */
16
+ export function withoutPaint(character: AvatarCharacter): AvatarCharacter {
17
+ const parts: AvatarCharacter = { ...character };
18
+ delete parts.color;
19
+ delete parts.bodyColor;
20
+ return parts;
21
+ }
22
+
23
+ /** What a character with no paint and no resolvable colour wears: the first named swatch. */
24
+ const FALLBACK_COLOR = CHARACTER_COLORS.pink;
25
+
26
+ /**
27
+ * The character as the creator draws it: in the agent's colour (a preset key or a `#rrggbb`). A
28
+ * colour Bloom cannot resolve leaves the character's own paint (or its preset's); a character with
29
+ * neither wears the first named swatch, so nothing it draws is undrawable.
30
+ */
31
+ export function drawnCharacter(
32
+ character: AvatarCharacter,
33
+ color: string | null | undefined,
34
+ ): AvatarCharacter {
35
+ const painted = avatarCharacterInColor(character, color);
36
+ if (tryResolveAvatarCharacter(painted)) return painted;
37
+ return avatarCharacterInColor(character, FALLBACK_COLOR);
38
+ }
39
+
40
+ /**
41
+ * The body paint an account colour draws, `#rrggbb`, or `undefined` for a colour that does not
42
+ * resolve. Read through `avatarCharacterInColor`, the one mapping from a colour to a paint.
43
+ */
44
+ export function accountBodyHex(color: string | null | undefined): string | undefined {
45
+ return avatarCharacterInColor({}, color).bodyColor;
46
+ }
47
+
48
+ /**
49
+ * What a character IS, for comparing two of them: its resolved parts, paint left out (the paint is
50
+ * the account's). Two spellings of one character (a preset, or its parts written out) compare equal.
51
+ */
52
+ export function characterPartsKey(character: AvatarCharacter): string {
53
+ const parts: Partial<ReturnType<typeof resolveAvatarCharacter>> = resolveAvatarCharacter(
54
+ drawnCharacter(character, undefined),
55
+ );
56
+ delete parts.paint;
57
+ return JSON.stringify(parts);
58
+ }
@@ -15,7 +15,18 @@ export type AgentCreatorAgent = {
15
15
  name: string;
16
16
  label: string;
17
17
  description: string;
18
+ /**
19
+ * The character's parts (shape, eyes, eyewear, accessory, preset, eye spacing). The creator
20
+ * hands it back without paint: the agent's colour is `color`, never the character's.
21
+ */
18
22
  avatar: AvatarCharacter;
23
+ /**
24
+ * The agent's colour: its ACCOUNT's (`User.color` in Oxy), a Bloom colour preset key or a
25
+ * `#rrggbb`. It paints the avatar, and the colour control changes it: `onChange` with a new
26
+ * `color`, always a `#rrggbb` lifted to the avatar skin floor, so the stored colour is exactly
27
+ * the drawn one.
28
+ */
29
+ color: string;
19
30
  preferences?: AgentPreferences;
20
31
  };
21
32
  export type AgentVoice = { id: string; name: string; language: string };
@@ -1,7 +1,7 @@
1
1
  import { useCallback, useRef, useState } from 'react';
2
- import { resolveAvatarCharacter, type AvatarCharacter } from '../agent-avatar/character';
2
+ import type { AvatarCharacter } from '../agent-avatar/character';
3
+ import { characterPartsKey as key, withoutPaint } from './paint';
3
4
  import type { AgentCreatorAgent } from './types';
4
- const key = (value: AvatarCharacter) => JSON.stringify(resolveAvatarCharacter(value));
5
5
  const snapshot = (value: AvatarCharacter): AvatarCharacter => Object.freeze({ ...value });
6
6
  const LIMIT = 50;
7
7
  const createHistory = (agent: AgentCreatorAgent) => ({
@@ -14,7 +14,11 @@ const createHistory = (agent: AgentCreatorAgent) => ({
14
14
  transaction: undefined as AvatarCharacter | undefined,
15
15
  });
16
16
 
17
- /** Character-only history. Parent echoes acknowledge edits; unrelated profile data never enters history. */
17
+ /**
18
+ * Character-only history. Parent echoes acknowledge edits; unrelated profile data never enters
19
+ * history. Characters compare by their parts and are emitted without paint: the colour is the
20
+ * agent's (`agent.color`), not the character's, so a colour change is not a character edit.
21
+ */
18
22
  export function useCharacterHistory(
19
23
  agent: AgentCreatorAgent,
20
24
  onChange: (agent: AgentCreatorAgent) => void,
@@ -39,7 +43,7 @@ export function useCharacterHistory(
39
43
  }
40
44
  const emit = useCallback((value: AvatarCharacter) => {
41
45
  const s = state.current!;
42
- s.current = snapshot(value);
46
+ s.current = snapshot(withoutPaint(value));
43
47
  s.pending.add(key(value));
44
48
  // Only unacknowledged own writes are retained, with a fixed bound during deferred parent updates.
45
49
  if (s.pending.size > 128) s.pending.delete(s.pending.values().next().value!);
@@ -391,10 +391,20 @@ const AvatarComponent: React.FC<AvatarProps> = ({
391
391
 
392
392
  // Resolution order: character, then image, then initials.
393
393
  // An invalid stored character resolves to nothing, which sends this avatar to its image.
394
- const pickedCharacter = pickAccountCharacter({ character, account });
394
+ // A bot account's character is painted in the account's colour: a new object per call, so the
395
+ // memo keys are what it is made of, not the object.
396
+ const accountKind = account?.kind;
397
+ const accountCharacter = account?.character;
398
+ const accountColor = account?.color;
395
399
  const resolvedCharacter = useMemo(
396
- () => tryResolveAvatarCharacter(pickedCharacter),
397
- [pickedCharacter],
400
+ () =>
401
+ tryResolveAvatarCharacter(
402
+ pickAccountCharacter({
403
+ character,
404
+ account: { kind: accountKind, character: accountCharacter, color: accountColor },
405
+ }),
406
+ ),
407
+ [character, accountKind, accountCharacter, accountColor],
398
408
  );
399
409
  const placeholderProps = {
400
410
  shape,
@@ -1,3 +1,4 @@
1
+ import { avatarCharacterInColor, type AvatarCharacter } from '../agent-avatar/character';
1
2
  import type { AvatarAccount, AvatarProps } from './types';
2
3
 
3
4
  /** The text that names an account: its display name, else its handle. */
@@ -14,13 +15,18 @@ export function accountName(account: AvatarAccount | undefined): string | undefi
14
15
 
15
16
  /**
16
17
  * The one answer to "which character does this avatar carry": an explicit `character` wins
17
- * (`null` opts out), else the character of a bot account. Returns the stored object itself, so a
18
- * caller can memoize on it; resolve it with `tryResolveAvatarCharacter`.
18
+ * (`null` opts out), else the character of a bot account painted in the account's own `color`
19
+ * (`avatarCharacterInColor`). Resolve it with `tryResolveAvatarCharacter`. A painted character is
20
+ * a new object each call, so a caller memoizes on `character`, `account.character` and
21
+ * `account.color` rather than on the result.
19
22
  */
20
23
  export function pickAccountCharacter({
21
24
  character,
22
25
  account,
23
26
  }: Pick<AvatarProps, 'character' | 'account'>): unknown {
24
27
  if (character !== undefined) return character;
25
- return account?.kind === 'bot' ? account.character : undefined;
28
+ if (account?.kind !== 'bot') return undefined;
29
+ const stored = account.character;
30
+ if (!stored || typeof stored !== 'object' || Array.isArray(stored)) return stored;
31
+ return avatarCharacterInColor(stored as AvatarCharacter, account.color);
26
32
  }
@@ -17,6 +17,11 @@ export interface AvatarAccount {
17
17
  avatar?: string | null;
18
18
  /** Stored bot character data, validated before rendering. Unknown recipes fall back to its image. */
19
19
  character?: unknown;
20
+ /**
21
+ * The account's colour, as Oxy stores `User.color`: a Bloom colour preset key or a `#rrggbb`. A bot's character is drawn in it (`avatarCharacterInColor`), so a bot looks the
22
+ * colour of its account everywhere its account is drawn.
23
+ */
24
+ color?: string | null;
20
25
  username?: string | null;
21
26
  /** A display name, or the account service's structured name. */
22
27
  name?: string | { displayName?: string; full?: string; first?: string; last?: string } | null;
@@ -7,7 +7,7 @@ import {
7
7
  type ViewStyle,
8
8
  } from 'react-native';
9
9
  import { SvgXml } from 'react-native-svg';
10
- import { AgentAvatar } from '../agent-avatar';
10
+ import { AgentAvatar, avatarCharacterInColor } from '../agent-avatar';
11
11
  import { Button, CloseButton } from '../button';
12
12
  import { RiArrowLeftLine } from '../icons/remix/RiArrowLeftLine';
13
13
  import { RiArrowRightSLine } from '../icons/remix/RiArrowRightSLine';
@@ -105,7 +105,11 @@ function ItemIcon({ item, size = 44 }: { item: MarketplaceItem; size?: number })
105
105
  if (item.avatar)
106
106
  return (
107
107
  <StyledView className="shrink-0">
108
- <AgentAvatar character={item.avatar} size={size} label={item.name} />
108
+ <AgentAvatar
109
+ character={avatarCharacterInColor(item.avatar, item.color)}
110
+ size={size}
111
+ label={item.name}
112
+ />
109
113
  </StyledView>
110
114
  );
111
115
  const key = item.logo!,
@@ -37,6 +37,7 @@ import { SupportCopy } from './SupportCopy';
37
37
  import { ChatSidebar } from './ChatSidebar';
38
38
  import { useChatComponents } from './context';
39
39
  import {
40
+ agentCharacter,
40
41
  conversationFor,
41
42
  formatDemoReply,
42
43
  nextAgentIdentity,
@@ -256,7 +257,7 @@ export function MultiAgentChatBase(props: MultiAgentChatProps) {
256
257
  ids.length > 1
257
258
  ? selectedAgents.map((agent, index) => ({
258
259
  key: agent.id,
259
- character: agent.avatar,
260
+ character: agentCharacter(agent),
260
261
  from: `picker:${agent.id}`,
261
262
  to: `empty:${agent.id}`,
262
263
  path: 'straight' as const,
@@ -343,7 +344,7 @@ export function MultiAgentChatBase(props: MultiAgentChatProps) {
343
344
  ? [
344
345
  {
345
346
  key: responder.id,
346
- character: responder.avatar,
347
+ character: agentCharacter(responder),
347
348
  from: `empty:${responder.id}`,
348
349
  to: `reply:${responder.id}`,
349
350
  duration: REPLY_DELAY_MS,
@@ -351,7 +352,7 @@ export function MultiAgentChatBase(props: MultiAgentChatProps) {
351
352
  ...avatarJoinFlights(waiting, {
352
353
  from: (agent) => `empty:${agent.id}`,
353
354
  to: 'profile',
354
- character: (agent) => agent.avatar,
355
+ character: agentCharacter,
355
356
  }),
356
357
  ]
357
358
  : [],
@@ -522,7 +523,7 @@ export function MultiAgentChatBase(props: MultiAgentChatProps) {
522
523
  <D.DropdownMenuItem
523
524
  key={agent.id}
524
525
  onPress={() => edit(agent)}
525
- leading={<AgentAvatar character={agent.avatar} size={20} />}
526
+ leading={<AgentAvatar character={agentCharacter(agent)} size={20} />}
526
527
  className="px-2 py-1.5 text-body-medium"
527
528
  >
528
529
  {formatMessage(messages.editAgent, agent.name)}
@@ -654,7 +655,7 @@ export function MultiAgentChatBase(props: MultiAgentChatProps) {
654
655
  identity={
655
656
  agent && (
656
657
  <AgentReplyIdentity
657
- character={agent.avatar}
658
+ character={agentCharacter(agent)}
658
659
  name={agent.name}
659
660
  thinking={thinking}
660
661
  workingKey={replies.pending[chat.id] ?? agent.id}
@@ -865,7 +866,7 @@ export function MultiAgentChatBase(props: MultiAgentChatProps) {
865
866
  <StyledView className="inline-flex items-center justify-center px-1 shrink-0 flex-row">
866
867
  <StyledView className="flex min-w-0 items-center gap-2 flex-row">
867
868
  <StyledView className="size-6 shrink-0" aria-hidden>
868
- <AgentAvatar character={agent.avatar} size={24} />
869
+ <AgentAvatar character={agentCharacter(agent)} size={24} />
869
870
  </StyledView>
870
871
  <Text
871
872
  className={`truncate text-body-medium ${picked ? 'text-text-primary' : 'text-text-secondary'}`}
@@ -13,7 +13,7 @@ import { useMessages, formatMessage } from '../locale/messages';
13
13
  import { StyledView } from '../styles/styled-primitives';
14
14
  import { useTheme } from '../theme/use-theme';
15
15
  import { Text } from '../typography';
16
- import type { Agent } from './data';
16
+ import { agentCharacter, type Agent } from './data';
17
17
  import { MULTI_AGENT_CHAT_MESSAGES } from './messages';
18
18
  import { usePrefersReducedMotion } from '../hooks/use-prefers-reduced-motion';
19
19
  const AnimatedView = Animated.createAnimatedComponent(StyledView);
@@ -87,7 +87,7 @@ function PreviewAvatar({
87
87
  style={[{ position: 'absolute', left: 0, top: 0, width: size, height: size }, animated]}
88
88
  >
89
89
  <AvatarSnapshotObserver.Provider value={flights.snapshot(key)}>
90
- <AgentAvatar character={agent.avatar} size={size} />
90
+ <AgentAvatar character={agentCharacter(agent)} size={size} />
91
91
  </AvatarSnapshotObserver.Provider>
92
92
  </AnimatedView>
93
93
  );