@oxy.so/bloom 20.0.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 (210) hide show
  1. package/docs/adoption-matrix.mdx +6 -7
  2. package/docs/agent-avatar.mdx +4 -4
  3. package/docs/agent-creator.mdx +13 -11
  4. package/docs/multi-agent-chat.mdx +1 -1
  5. package/docs/task-catalog.json +1 -1
  6. package/docs/task-catalog.mdx +1 -1
  7. package/lib/commonjs/agent-avatar/character.js +4 -4
  8. package/lib/commonjs/agent-creator/AgentCreator.js +4 -0
  9. package/lib/commonjs/agent-creator/AgentCreator.js.map +1 -1
  10. package/lib/commonjs/agent-creator/AgentCreator.web.js +12 -8
  11. package/lib/commonjs/agent-creator/AgentCreator.web.js.map +1 -1
  12. package/lib/commonjs/agent-creator/AgentCreatorBase.js +93 -48
  13. package/lib/commonjs/agent-creator/AgentCreatorBase.js.map +1 -1
  14. package/lib/commonjs/agent-creator/CustomColorPicker.js +431 -0
  15. package/lib/commonjs/agent-creator/CustomColorPicker.js.map +1 -0
  16. package/lib/commonjs/agent-creator/GlossArt.js +212 -0
  17. package/lib/commonjs/agent-creator/GlossArt.js.map +1 -0
  18. package/lib/commonjs/agent-creator/context.js.map +1 -1
  19. package/lib/commonjs/agent-creator/messages.js +22 -1
  20. package/lib/commonjs/agent-creator/messages.js.map +1 -1
  21. package/lib/commonjs/agent-creator/paint.js +19 -7
  22. package/lib/commonjs/agent-creator/paint.js.map +1 -1
  23. package/lib/commonjs/agent-creator/rainbow-artwork.js +10 -0
  24. package/lib/commonjs/agent-creator/rainbow-artwork.js.map +1 -0
  25. package/lib/commonjs/agent-creator/shared.js +28 -0
  26. package/lib/commonjs/agent-creator/shared.js.map +1 -1
  27. package/lib/commonjs/locale/translations/ar.js +22 -1
  28. package/lib/commonjs/locale/translations/ar.js.map +1 -1
  29. package/lib/commonjs/locale/translations/bn.js +22 -1
  30. package/lib/commonjs/locale/translations/bn.js.map +1 -1
  31. package/lib/commonjs/locale/translations/ca.js +22 -1
  32. package/lib/commonjs/locale/translations/ca.js.map +1 -1
  33. package/lib/commonjs/locale/translations/de.js +22 -1
  34. package/lib/commonjs/locale/translations/de.js.map +1 -1
  35. package/lib/commonjs/locale/translations/es.js +22 -1
  36. package/lib/commonjs/locale/translations/es.js.map +1 -1
  37. package/lib/commonjs/locale/translations/fr.js +22 -1
  38. package/lib/commonjs/locale/translations/fr.js.map +1 -1
  39. package/lib/commonjs/locale/translations/hi.js +22 -1
  40. package/lib/commonjs/locale/translations/hi.js.map +1 -1
  41. package/lib/commonjs/locale/translations/id.js +22 -1
  42. package/lib/commonjs/locale/translations/id.js.map +1 -1
  43. package/lib/commonjs/locale/translations/it.js +22 -1
  44. package/lib/commonjs/locale/translations/it.js.map +1 -1
  45. package/lib/commonjs/locale/translations/ja.js +22 -1
  46. package/lib/commonjs/locale/translations/ja.js.map +1 -1
  47. package/lib/commonjs/locale/translations/pt.js +22 -1
  48. package/lib/commonjs/locale/translations/pt.js.map +1 -1
  49. package/lib/commonjs/locale/translations/ru.js +22 -1
  50. package/lib/commonjs/locale/translations/ru.js.map +1 -1
  51. package/lib/commonjs/locale/translations/tr.js +22 -1
  52. package/lib/commonjs/locale/translations/tr.js.map +1 -1
  53. package/lib/commonjs/locale/translations/zh.js +22 -1
  54. package/lib/commonjs/locale/translations/zh.js.map +1 -1
  55. package/lib/commonjs/multi-agent-chat/data.js +2 -2
  56. package/lib/commonjs/multi-agent-chat/data.js.map +1 -1
  57. package/lib/module/agent-avatar/character.js +4 -4
  58. package/lib/module/agent-creator/AgentCreator.js +4 -0
  59. package/lib/module/agent-creator/AgentCreator.js.map +1 -1
  60. package/lib/module/agent-creator/AgentCreator.web.js +4 -0
  61. package/lib/module/agent-creator/AgentCreator.web.js.map +1 -1
  62. package/lib/module/agent-creator/AgentCreatorBase.js +89 -44
  63. package/lib/module/agent-creator/AgentCreatorBase.js.map +1 -1
  64. package/lib/module/agent-creator/CustomColorPicker.js +426 -0
  65. package/lib/module/agent-creator/CustomColorPicker.js.map +1 -0
  66. package/lib/module/agent-creator/GlossArt.js +207 -0
  67. package/lib/module/agent-creator/GlossArt.js.map +1 -0
  68. package/lib/module/agent-creator/context.js.map +1 -1
  69. package/lib/module/agent-creator/messages.js +22 -1
  70. package/lib/module/agent-creator/messages.js.map +1 -1
  71. package/lib/module/agent-creator/paint.js +18 -7
  72. package/lib/module/agent-creator/paint.js.map +1 -1
  73. package/lib/module/agent-creator/rainbow-artwork.js +6 -0
  74. package/lib/module/agent-creator/rainbow-artwork.js.map +1 -0
  75. package/lib/module/agent-creator/shared.js +26 -0
  76. package/lib/module/agent-creator/shared.js.map +1 -1
  77. package/lib/module/locale/translations/ar.js +22 -1
  78. package/lib/module/locale/translations/ar.js.map +1 -1
  79. package/lib/module/locale/translations/bn.js +22 -1
  80. package/lib/module/locale/translations/bn.js.map +1 -1
  81. package/lib/module/locale/translations/ca.js +22 -1
  82. package/lib/module/locale/translations/ca.js.map +1 -1
  83. package/lib/module/locale/translations/de.js +22 -1
  84. package/lib/module/locale/translations/de.js.map +1 -1
  85. package/lib/module/locale/translations/es.js +22 -1
  86. package/lib/module/locale/translations/es.js.map +1 -1
  87. package/lib/module/locale/translations/fr.js +22 -1
  88. package/lib/module/locale/translations/fr.js.map +1 -1
  89. package/lib/module/locale/translations/hi.js +22 -1
  90. package/lib/module/locale/translations/hi.js.map +1 -1
  91. package/lib/module/locale/translations/id.js +22 -1
  92. package/lib/module/locale/translations/id.js.map +1 -1
  93. package/lib/module/locale/translations/it.js +22 -1
  94. package/lib/module/locale/translations/it.js.map +1 -1
  95. package/lib/module/locale/translations/ja.js +22 -1
  96. package/lib/module/locale/translations/ja.js.map +1 -1
  97. package/lib/module/locale/translations/pt.js +22 -1
  98. package/lib/module/locale/translations/pt.js.map +1 -1
  99. package/lib/module/locale/translations/ru.js +22 -1
  100. package/lib/module/locale/translations/ru.js.map +1 -1
  101. package/lib/module/locale/translations/tr.js +22 -1
  102. package/lib/module/locale/translations/tr.js.map +1 -1
  103. package/lib/module/locale/translations/zh.js +22 -1
  104. package/lib/module/locale/translations/zh.js.map +1 -1
  105. package/lib/module/multi-agent-chat/data.js +3 -3
  106. package/lib/module/multi-agent-chat/data.js.map +1 -1
  107. package/lib/typescript/commonjs/agent-avatar/character.d.ts +4 -4
  108. package/lib/typescript/commonjs/agent-creator/AgentCreator.d.ts.map +1 -1
  109. package/lib/typescript/commonjs/agent-creator/AgentCreator.web.d.ts.map +1 -1
  110. package/lib/typescript/commonjs/agent-creator/AgentCreatorBase.d.ts.map +1 -1
  111. package/lib/typescript/commonjs/agent-creator/CustomColorPicker.d.ts +9 -0
  112. package/lib/typescript/commonjs/agent-creator/CustomColorPicker.d.ts.map +1 -0
  113. package/lib/typescript/commonjs/agent-creator/GlossArt.d.ts +9 -0
  114. package/lib/typescript/commonjs/agent-creator/GlossArt.d.ts.map +1 -0
  115. package/lib/typescript/commonjs/agent-creator/context.d.ts +13 -1
  116. package/lib/typescript/commonjs/agent-creator/context.d.ts.map +1 -1
  117. package/lib/typescript/commonjs/agent-creator/messages.d.ts +11 -0
  118. package/lib/typescript/commonjs/agent-creator/messages.d.ts.map +1 -1
  119. package/lib/typescript/commonjs/agent-creator/paint.d.ts +9 -4
  120. package/lib/typescript/commonjs/agent-creator/paint.d.ts.map +1 -1
  121. package/lib/typescript/commonjs/agent-creator/rainbow-artwork.d.ts +3 -0
  122. package/lib/typescript/commonjs/agent-creator/rainbow-artwork.d.ts.map +1 -0
  123. package/lib/typescript/commonjs/agent-creator/shared.d.ts +7 -0
  124. package/lib/typescript/commonjs/agent-creator/shared.d.ts.map +1 -1
  125. package/lib/typescript/commonjs/agent-creator/types.d.ts +4 -7
  126. package/lib/typescript/commonjs/agent-creator/types.d.ts.map +1 -1
  127. package/lib/typescript/commonjs/avatar/types.d.ts +1 -2
  128. package/lib/typescript/commonjs/avatar/types.d.ts.map +1 -1
  129. package/lib/typescript/commonjs/locale/translations/ar.d.ts.map +1 -1
  130. package/lib/typescript/commonjs/locale/translations/bn.d.ts.map +1 -1
  131. package/lib/typescript/commonjs/locale/translations/ca.d.ts.map +1 -1
  132. package/lib/typescript/commonjs/locale/translations/de.d.ts.map +1 -1
  133. package/lib/typescript/commonjs/locale/translations/es.d.ts.map +1 -1
  134. package/lib/typescript/commonjs/locale/translations/fr.d.ts.map +1 -1
  135. package/lib/typescript/commonjs/locale/translations/hi.d.ts.map +1 -1
  136. package/lib/typescript/commonjs/locale/translations/id.d.ts.map +1 -1
  137. package/lib/typescript/commonjs/locale/translations/it.d.ts.map +1 -1
  138. package/lib/typescript/commonjs/locale/translations/ja.d.ts.map +1 -1
  139. package/lib/typescript/commonjs/locale/translations/pt.d.ts.map +1 -1
  140. package/lib/typescript/commonjs/locale/translations/ru.d.ts.map +1 -1
  141. package/lib/typescript/commonjs/locale/translations/tr.d.ts.map +1 -1
  142. package/lib/typescript/commonjs/locale/translations/zh.d.ts.map +1 -1
  143. package/lib/typescript/commonjs/multi-agent-chat/data.d.ts.map +1 -1
  144. package/lib/typescript/module/agent-avatar/character.d.ts +4 -4
  145. package/lib/typescript/module/agent-creator/AgentCreator.d.ts.map +1 -1
  146. package/lib/typescript/module/agent-creator/AgentCreator.web.d.ts.map +1 -1
  147. package/lib/typescript/module/agent-creator/AgentCreatorBase.d.ts.map +1 -1
  148. package/lib/typescript/module/agent-creator/CustomColorPicker.d.ts +9 -0
  149. package/lib/typescript/module/agent-creator/CustomColorPicker.d.ts.map +1 -0
  150. package/lib/typescript/module/agent-creator/GlossArt.d.ts +9 -0
  151. package/lib/typescript/module/agent-creator/GlossArt.d.ts.map +1 -0
  152. package/lib/typescript/module/agent-creator/context.d.ts +13 -1
  153. package/lib/typescript/module/agent-creator/context.d.ts.map +1 -1
  154. package/lib/typescript/module/agent-creator/messages.d.ts +11 -0
  155. package/lib/typescript/module/agent-creator/messages.d.ts.map +1 -1
  156. package/lib/typescript/module/agent-creator/paint.d.ts +9 -4
  157. package/lib/typescript/module/agent-creator/paint.d.ts.map +1 -1
  158. package/lib/typescript/module/agent-creator/rainbow-artwork.d.ts +3 -0
  159. package/lib/typescript/module/agent-creator/rainbow-artwork.d.ts.map +1 -0
  160. package/lib/typescript/module/agent-creator/shared.d.ts +7 -0
  161. package/lib/typescript/module/agent-creator/shared.d.ts.map +1 -1
  162. package/lib/typescript/module/agent-creator/types.d.ts +4 -7
  163. package/lib/typescript/module/agent-creator/types.d.ts.map +1 -1
  164. package/lib/typescript/module/avatar/types.d.ts +1 -2
  165. package/lib/typescript/module/avatar/types.d.ts.map +1 -1
  166. package/lib/typescript/module/locale/translations/ar.d.ts.map +1 -1
  167. package/lib/typescript/module/locale/translations/bn.d.ts.map +1 -1
  168. package/lib/typescript/module/locale/translations/ca.d.ts.map +1 -1
  169. package/lib/typescript/module/locale/translations/de.d.ts.map +1 -1
  170. package/lib/typescript/module/locale/translations/es.d.ts.map +1 -1
  171. package/lib/typescript/module/locale/translations/fr.d.ts.map +1 -1
  172. package/lib/typescript/module/locale/translations/hi.d.ts.map +1 -1
  173. package/lib/typescript/module/locale/translations/id.d.ts.map +1 -1
  174. package/lib/typescript/module/locale/translations/it.d.ts.map +1 -1
  175. package/lib/typescript/module/locale/translations/ja.d.ts.map +1 -1
  176. package/lib/typescript/module/locale/translations/pt.d.ts.map +1 -1
  177. package/lib/typescript/module/locale/translations/ru.d.ts.map +1 -1
  178. package/lib/typescript/module/locale/translations/tr.d.ts.map +1 -1
  179. package/lib/typescript/module/locale/translations/zh.d.ts.map +1 -1
  180. package/lib/typescript/module/multi-agent-chat/data.d.ts.map +1 -1
  181. package/package.json +1 -1
  182. package/src/__tests__/support/adoption-matrix.ts +0 -5
  183. package/src/agent-avatar/character.ts +4 -4
  184. package/src/agent-creator/AgentCreator.tsx +4 -0
  185. package/src/agent-creator/AgentCreator.web.tsx +4 -0
  186. package/src/agent-creator/AgentCreatorBase.tsx +83 -39
  187. package/src/agent-creator/CustomColorPicker.tsx +443 -0
  188. package/src/agent-creator/GlossArt.tsx +160 -0
  189. package/src/agent-creator/context.ts +2 -0
  190. package/src/agent-creator/messages.ts +37 -1
  191. package/src/agent-creator/paint.ts +17 -7
  192. package/src/agent-creator/rainbow-artwork.ts +5 -0
  193. package/src/agent-creator/shared.ts +27 -0
  194. package/src/agent-creator/types.ts +4 -7
  195. package/src/avatar/types.ts +1 -2
  196. package/src/locale/translations/ar.ts +23 -1
  197. package/src/locale/translations/bn.ts +23 -1
  198. package/src/locale/translations/ca.ts +23 -1
  199. package/src/locale/translations/de.ts +23 -1
  200. package/src/locale/translations/es.ts +23 -1
  201. package/src/locale/translations/fr.ts +23 -1
  202. package/src/locale/translations/hi.ts +23 -1
  203. package/src/locale/translations/id.ts +23 -1
  204. package/src/locale/translations/it.ts +23 -1
  205. package/src/locale/translations/ja.ts +23 -1
  206. package/src/locale/translations/pt.ts +23 -1
  207. package/src/locale/translations/ru.ts +23 -1
  208. package/src/locale/translations/tr.ts +23 -1
  209. package/src/locale/translations/zh.ts +23 -1
  210. package/src/multi-agent-chat/data.ts +5 -3
@@ -16,6 +16,7 @@ export interface AgentCreatorMessages {
16
16
  closeEditor: string;
17
17
  details: string;
18
18
  color: string;
19
+ customColor: string;
19
20
  name: string;
20
21
  label: string;
21
22
  description: string;
@@ -38,6 +39,13 @@ export interface AgentCreatorMessages {
38
39
  playbackSpeed: string;
39
40
  emotion: string;
40
41
  shape: string;
42
+ hexColor: string;
43
+ hue: string;
44
+ saturationBrightness: string;
45
+ increaseBrightness: string;
46
+ decreaseBrightness: string;
47
+ increaseHue: string;
48
+ decreaseHue: string;
41
49
  nextShape: string;
42
50
  previousShape: string;
43
51
  newAgent: string;
@@ -64,10 +72,16 @@ export interface AgentCreatorMessages {
64
72
  'slender' | 'pocket' | 'petal' | 'flower' | 'star' | 'heart' | 'cloud' | 'diamond' | 'shield',
65
73
  string
66
74
  >;
75
+ colors: Record<
76
+ 'Blue' | 'Teal' | 'Violet' | 'Pink' | 'Red' | 'Orange' | 'Cyan' | 'Lime' | 'Green',
77
+ string
78
+ >;
67
79
  languages: Record<'auto' | 'en' | 'tr' | 'es' | 'fr' | 'de' | 'ja' | 'pt', string>;
80
+ avatarColorLabel: (name: string) => string;
68
81
  shapeLabel: (name: string) => string;
69
82
  silhouetteLabel: (name: string) => string;
70
83
  livePreview: (name: string) => string;
84
+ saturationBrightnessValue: (s: number, v: number) => string;
71
85
  playbackSpeedLabel: (speed: number) => string;
72
86
  }
73
87
 
@@ -87,7 +101,8 @@ export const AGENT_CREATOR_MESSAGES: MessageCatalog<AgentCreatorMessages> =
87
101
  newBot: 'New bot',
88
102
  closeEditor: 'Close agent editor',
89
103
  details: 'Agent appearance and details',
90
- color: 'Color',
104
+ color: 'Avatar color',
105
+ customColor: 'Custom avatar color',
91
106
  name: 'Name',
92
107
  label: 'Label',
93
108
  description: 'Description',
@@ -110,6 +125,13 @@ export const AGENT_CREATOR_MESSAGES: MessageCatalog<AgentCreatorMessages> =
110
125
  playbackSpeed: 'Playback speed',
111
126
  emotion: 'Agent emotion',
112
127
  shape: 'Avatar shape',
128
+ hexColor: 'Hex color',
129
+ hue: 'Hue',
130
+ saturationBrightness: 'Saturation and brightness',
131
+ increaseBrightness: 'Increase brightness',
132
+ decreaseBrightness: 'Decrease brightness',
133
+ increaseHue: 'Increase hue',
134
+ decreaseHue: 'Decrease hue',
113
135
  nextShape: 'Next shape',
114
136
  previousShape: 'Previous shape',
115
137
  newAgent: 'New agent',
@@ -142,6 +164,17 @@ export const AGENT_CREATOR_MESSAGES: MessageCatalog<AgentCreatorMessages> =
142
164
  diamond: 'Diamond',
143
165
  shield: 'Shield',
144
166
  },
167
+ colors: {
168
+ Blue: 'Blue',
169
+ Teal: 'Teal',
170
+ Violet: 'Violet',
171
+ Pink: 'Pink',
172
+ Red: 'Red',
173
+ Orange: 'Orange',
174
+ Cyan: 'Cyan',
175
+ Lime: 'Lime',
176
+ Green: 'Green',
177
+ },
145
178
  languages: {
146
179
  auto: 'Auto-detect',
147
180
  en: 'English',
@@ -152,8 +185,11 @@ export const AGENT_CREATOR_MESSAGES: MessageCatalog<AgentCreatorMessages> =
152
185
  ja: 'Japanese',
153
186
  pt: 'Portuguese',
154
187
  },
188
+ avatarColorLabel: (name) => '{name} avatar'.replace('{name}', name),
155
189
  shapeLabel: (name) => '{name} shape'.replace('{name}', name),
156
190
  silhouetteLabel: (name) => '{name} silhouette'.replace('{name}', name),
157
191
  livePreview: (name) => '{name}, live avatar preview'.replace('{name}', name),
192
+ saturationBrightnessValue: (s, v) =>
193
+ 'saturation {s}%, brightness {v}%'.replace('{s}', String(s)).replace('{v}', String(v)),
158
194
  playbackSpeedLabel: (speed) => '{speed} times playback speed'.replace('{speed}', String(speed)),
159
195
  });
@@ -4,7 +4,7 @@ import {
4
4
  tryResolveAvatarCharacter,
5
5
  type AvatarCharacter,
6
6
  } from '../agent-avatar/character';
7
- import { FREE_COLOR_NAMES } from '../theme/color-presets';
7
+ import { CHARACTER_COLORS } from '../agent-avatar/character-colors';
8
8
 
9
9
  /**
10
10
  * The creator's colour is the agent's account colour (`agent.color`), never the character's: a
@@ -20,19 +20,29 @@ export function withoutPaint(character: AvatarCharacter): AvatarCharacter {
20
20
  return parts;
21
21
  }
22
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
+
23
26
  /**
24
- * The character as the creator draws it: in the agent's colour. A colour Bloom cannot resolve
25
- * leaves the character's own paint (or its preset's); a character with neither wears the first
26
- * colour the creator offers, so nothing it draws is undrawable.
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.
27
30
  */
28
31
  export function drawnCharacter(
29
32
  character: AvatarCharacter,
30
33
  color: string | null | undefined,
31
- colors: readonly string[],
32
34
  ): AvatarCharacter {
33
35
  const painted = avatarCharacterInColor(character, color);
34
36
  if (tryResolveAvatarCharacter(painted)) return painted;
35
- return avatarCharacterInColor(character, colors[0] ?? FREE_COLOR_NAMES[0]);
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;
36
46
  }
37
47
 
38
48
  /**
@@ -41,7 +51,7 @@ export function drawnCharacter(
41
51
  */
42
52
  export function characterPartsKey(character: AvatarCharacter): string {
43
53
  const parts: Partial<ReturnType<typeof resolveAvatarCharacter>> = resolveAvatarCharacter(
44
- drawnCharacter(character, undefined, FREE_COLOR_NAMES),
54
+ drawnCharacter(character, undefined),
45
55
  );
46
56
  delete parts.paint;
47
57
  return JSON.stringify(parts);