@oxy.so/bloom 7.0.1 → 7.1.1

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 (519) hide show
  1. package/assets/character-runtime/README.md +55 -0
  2. package/assets/character-runtime/appearance-codec.mjs +149 -0
  3. package/assets/character-runtime/integrity.json +6 -0
  4. package/assets/character-runtime/legacy-engine.mjs +105 -0
  5. package/assets/character-runtime/legacy-geometry.mjs +166 -0
  6. package/assets/character-runtime/legacy-worker.mjs +85 -0
  7. package/assets/character-runtime/managed-avatar.mjs +258 -0
  8. package/assets/character-runtime/orbit-characters.data +0 -0
  9. package/assets/character-runtime/orbit-characters.mjs +30 -0
  10. package/assets/character-runtime/orbit-characters.wasm +0 -0
  11. package/assets/character-runtime/preparation-worker.mjs +19 -0
  12. package/assets/character-runtime/render-budget.mjs +144 -0
  13. package/assets/character-runtime/runtime.mjs +851 -0
  14. package/assets/character-runtime/thumbnails/eyes/crescent_inset.png +0 -0
  15. package/assets/character-runtime/thumbnails/eyes/dots.png +0 -0
  16. package/assets/character-runtime/thumbnails/eyes/double_highlights.png +0 -0
  17. package/assets/character-runtime/thumbnails/eyes/highlight_capsules.png +0 -0
  18. package/assets/character-runtime/thumbnails/eyes/oval.png +0 -0
  19. package/assets/character-runtime/thumbnails/eyes/round_inset.png +0 -0
  20. package/assets/character-runtime/thumbnails/eyes/sleepy_lids.png +0 -0
  21. package/assets/character-runtime/thumbnails/eyes/sparkle_capsules.png +0 -0
  22. package/assets/character-runtime/thumbnails/eyes/swept_lids.png +0 -0
  23. package/assets/character-runtime/thumbnails/shapes/capsule.png +0 -0
  24. package/assets/character-runtime/thumbnails/shapes/circle.png +0 -0
  25. package/assets/character-runtime/thumbnails/shapes/circle_two_ears.png +0 -0
  26. package/assets/character-runtime/thumbnails/shapes/four_lobed_butterfly.png +0 -0
  27. package/assets/character-runtime/thumbnails/shapes/heart.png +0 -0
  28. package/assets/character-runtime/thumbnails/shapes/rounded_cube.png +0 -0
  29. package/assets/character-runtime/thumbnails/shapes/rounded_diamond.png +0 -0
  30. package/assets/character-runtime/thumbnails/shapes/rounded_head_two_ears.png +0 -0
  31. package/assets/character-runtime/thumbnails/shapes/rounded_triangle.png +0 -0
  32. package/assets/character-runtime/thumbnails/shapes/six_lobed_flower.png +0 -0
  33. package/assets/character-runtime/thumbnails/shapes/twelve_scalloped_rosette.png +0 -0
  34. package/docs/adoption-matrix.mdx +9 -9
  35. package/docs/agent-avatar.mdx +44 -10
  36. package/docs/agent-creator.mdx +12 -4
  37. package/docs/multi-agent-chat.mdx +12 -0
  38. package/docs/project-board.mdx +3 -3
  39. package/lib/commonjs/agent-avatar/AgentAvatar.js +15 -203
  40. package/lib/commonjs/agent-avatar/AgentAvatar.js.map +1 -1
  41. package/lib/commonjs/agent-avatar/AgentAvatarProvider.js +69 -0
  42. package/lib/commonjs/agent-avatar/AgentAvatarProvider.js.map +1 -0
  43. package/lib/commonjs/agent-avatar/CharacterAvatar.js +212 -0
  44. package/lib/commonjs/agent-avatar/CharacterAvatar.js.map +1 -0
  45. package/lib/commonjs/agent-avatar/ProceduralAvatar.js +216 -0
  46. package/lib/commonjs/agent-avatar/ProceduralAvatar.js.map +1 -0
  47. package/lib/commonjs/agent-avatar/artwork.js +4 -3
  48. package/lib/commonjs/agent-avatar/artwork.js.map +1 -1
  49. package/lib/commonjs/agent-avatar/avatar-color.js +16 -0
  50. package/lib/commonjs/agent-avatar/avatar-color.js.map +1 -0
  51. package/lib/commonjs/agent-avatar/character-html.js +25 -0
  52. package/lib/commonjs/agent-avatar/character-html.js.map +1 -0
  53. package/lib/commonjs/agent-avatar/character-runtime-module.js +39 -0
  54. package/lib/commonjs/agent-avatar/character-runtime-module.js.map +1 -0
  55. package/lib/commonjs/agent-avatar/character-webview.js +18 -0
  56. package/lib/commonjs/agent-avatar/character-webview.js.map +1 -0
  57. package/lib/commonjs/agent-avatar/config-character.js +36 -0
  58. package/lib/commonjs/agent-avatar/config-character.js.map +1 -0
  59. package/lib/commonjs/agent-avatar/context.js +6 -1
  60. package/lib/commonjs/agent-avatar/context.js.map +1 -1
  61. package/lib/commonjs/agent-avatar/index.js +7 -0
  62. package/lib/commonjs/agent-avatar/index.js.map +1 -1
  63. package/lib/commonjs/agent-avatar/legacy-contours.js +57 -0
  64. package/lib/commonjs/agent-avatar/legacy-contours.js.map +1 -0
  65. package/lib/commonjs/agent-avatar/legacy-recipe.js +112 -0
  66. package/lib/commonjs/agent-avatar/legacy-recipe.js.map +1 -0
  67. package/lib/commonjs/agent-avatar/messages.js +2 -1
  68. package/lib/commonjs/agent-avatar/messages.js.map +1 -1
  69. package/lib/commonjs/agent-avatar/model.js +2 -0
  70. package/lib/commonjs/agent-avatar/model.js.map +1 -1
  71. package/lib/commonjs/agent-creator/AgentCreatorBase.js +251 -25
  72. package/lib/commonjs/agent-creator/AgentCreatorBase.js.map +1 -1
  73. package/lib/commonjs/agent-creator/CharacterControls.js +115 -0
  74. package/lib/commonjs/agent-creator/CharacterControls.js.map +1 -0
  75. package/lib/commonjs/agent-creator/EmotionPicker.js +51 -18
  76. package/lib/commonjs/agent-creator/EmotionPicker.js.map +1 -1
  77. package/lib/commonjs/agent-creator/ShapeArc.js +56 -26
  78. package/lib/commonjs/agent-creator/ShapeArc.js.map +1 -1
  79. package/lib/commonjs/agent-creator/ShapeSilhouette.js +62 -0
  80. package/lib/commonjs/agent-creator/ShapeSilhouette.js.map +1 -0
  81. package/lib/commonjs/agent-creator/constants.js +48 -1
  82. package/lib/commonjs/agent-creator/constants.js.map +1 -1
  83. package/lib/commonjs/agent-creator/messages.js +9 -0
  84. package/lib/commonjs/agent-creator/messages.js.map +1 -1
  85. package/lib/commonjs/agent-creator/shared.js +7 -10
  86. package/lib/commonjs/agent-creator/shared.js.map +1 -1
  87. package/lib/commonjs/agent-thinking/AgentThinking.js +4 -62
  88. package/lib/commonjs/agent-thinking/AgentThinking.js.map +1 -1
  89. package/lib/commonjs/agent-thinking/ThinkingLabel.js +77 -0
  90. package/lib/commonjs/agent-thinking/ThinkingLabel.js.map +1 -0
  91. package/lib/commonjs/chart-cards/TokensChartCard.js +20 -5
  92. package/lib/commonjs/chart-cards/TokensChartCard.js.map +1 -1
  93. package/lib/commonjs/locale/translations/ar.js +11 -1
  94. package/lib/commonjs/locale/translations/ar.js.map +1 -1
  95. package/lib/commonjs/locale/translations/bn.js +11 -1
  96. package/lib/commonjs/locale/translations/bn.js.map +1 -1
  97. package/lib/commonjs/locale/translations/ca.js +11 -1
  98. package/lib/commonjs/locale/translations/ca.js.map +1 -1
  99. package/lib/commonjs/locale/translations/de.js +11 -1
  100. package/lib/commonjs/locale/translations/de.js.map +1 -1
  101. package/lib/commonjs/locale/translations/es.js +11 -1
  102. package/lib/commonjs/locale/translations/es.js.map +1 -1
  103. package/lib/commonjs/locale/translations/fr.js +11 -1
  104. package/lib/commonjs/locale/translations/fr.js.map +1 -1
  105. package/lib/commonjs/locale/translations/hi.js +11 -1
  106. package/lib/commonjs/locale/translations/hi.js.map +1 -1
  107. package/lib/commonjs/locale/translations/id.js +11 -1
  108. package/lib/commonjs/locale/translations/id.js.map +1 -1
  109. package/lib/commonjs/locale/translations/it.js +11 -1
  110. package/lib/commonjs/locale/translations/it.js.map +1 -1
  111. package/lib/commonjs/locale/translations/ja.js +11 -1
  112. package/lib/commonjs/locale/translations/ja.js.map +1 -1
  113. package/lib/commonjs/locale/translations/pt.js +11 -1
  114. package/lib/commonjs/locale/translations/pt.js.map +1 -1
  115. package/lib/commonjs/locale/translations/ru.js +11 -1
  116. package/lib/commonjs/locale/translations/ru.js.map +1 -1
  117. package/lib/commonjs/locale/translations/tr.js +11 -1
  118. package/lib/commonjs/locale/translations/tr.js.map +1 -1
  119. package/lib/commonjs/locale/translations/zh.js +11 -1
  120. package/lib/commonjs/locale/translations/zh.js.map +1 -1
  121. package/lib/commonjs/multi-agent-chat/AvatarHandoff.js +2 -4
  122. package/lib/commonjs/multi-agent-chat/AvatarHandoff.js.map +1 -1
  123. package/lib/commonjs/multi-agent-chat/ChatAgentProfile.js +97 -0
  124. package/lib/commonjs/multi-agent-chat/ChatAgentProfile.js.map +1 -0
  125. package/lib/commonjs/multi-agent-chat/EditorRail.js +4 -0
  126. package/lib/commonjs/multi-agent-chat/EditorRail.js.map +1 -1
  127. package/lib/commonjs/multi-agent-chat/MultiAgentChatBase.js +89 -126
  128. package/lib/commonjs/multi-agent-chat/MultiAgentChatBase.js.map +1 -1
  129. package/lib/commonjs/multi-agent-chat/ReplyRow.js +8 -11
  130. package/lib/commonjs/multi-agent-chat/ReplyRow.js.map +1 -1
  131. package/lib/commonjs/multi-agent-chat/handoff.js +5 -5
  132. package/lib/commonjs/multi-agent-chat/handoff.js.map +1 -1
  133. package/lib/commonjs/project-board/CreateTicketDialog.js +33 -2
  134. package/lib/commonjs/project-board/CreateTicketDialog.js.map +1 -1
  135. package/lib/commonjs/project-board/ProjectBoardBase.js +137 -38
  136. package/lib/commonjs/project-board/ProjectBoardBase.js.map +1 -1
  137. package/lib/commonjs/project-board/TicketCornerGenieSurface.web.js +34 -28
  138. package/lib/commonjs/project-board/TicketCornerGenieSurface.web.js.map +1 -1
  139. package/lib/commonjs/project-board/TicketDetailDialog.js +6 -3
  140. package/lib/commonjs/project-board/TicketDetailDialog.js.map +1 -1
  141. package/lib/commonjs/project-board/TicketGenieSurface.js +17 -7
  142. package/lib/commonjs/project-board/TicketGenieSurface.js.map +1 -1
  143. package/lib/commonjs/project-board/TicketGenieSurface.web.js +1 -1
  144. package/lib/commonjs/project-board/TicketGenieSurface.web.js.map +1 -1
  145. package/lib/commonjs/project-board/TicketPresence.js +125 -0
  146. package/lib/commonjs/project-board/TicketPresence.js.map +1 -0
  147. package/lib/commonjs/project-board/TicketTokenChart.js +23 -0
  148. package/lib/commonjs/project-board/TicketTokenChart.js.map +1 -0
  149. package/lib/commonjs/project-board/context.js +3 -1
  150. package/lib/commonjs/project-board/context.js.map +1 -1
  151. package/lib/commonjs/search/Search.js +12 -3
  152. package/lib/commonjs/search/Search.js.map +1 -1
  153. package/lib/commonjs/sidebar/SidebarToolbar.js +28 -14
  154. package/lib/commonjs/sidebar/SidebarToolbar.js.map +1 -1
  155. package/lib/commonjs/text-field/TextField.js +13 -7
  156. package/lib/commonjs/text-field/TextField.js.map +1 -1
  157. package/lib/module/agent-avatar/AgentAvatar.js +16 -204
  158. package/lib/module/agent-avatar/AgentAvatar.js.map +1 -1
  159. package/lib/module/agent-avatar/AgentAvatarProvider.js +65 -0
  160. package/lib/module/agent-avatar/AgentAvatarProvider.js.map +1 -0
  161. package/lib/module/agent-avatar/CharacterAvatar.js +208 -0
  162. package/lib/module/agent-avatar/CharacterAvatar.js.map +1 -0
  163. package/lib/module/agent-avatar/ProceduralAvatar.js +212 -0
  164. package/lib/module/agent-avatar/ProceduralAvatar.js.map +1 -0
  165. package/lib/module/agent-avatar/artwork.js +3 -3
  166. package/lib/module/agent-avatar/artwork.js.map +1 -1
  167. package/lib/module/agent-avatar/avatar-color.js +12 -0
  168. package/lib/module/agent-avatar/avatar-color.js.map +1 -0
  169. package/lib/module/agent-avatar/character-html.js +19 -0
  170. package/lib/module/agent-avatar/character-html.js.map +1 -0
  171. package/lib/module/agent-avatar/character-runtime-module.js +35 -0
  172. package/lib/module/agent-avatar/character-runtime-module.js.map +1 -0
  173. package/lib/module/agent-avatar/character-webview.js +14 -0
  174. package/lib/module/agent-avatar/character-webview.js.map +1 -0
  175. package/lib/module/agent-avatar/config-character.js +32 -0
  176. package/lib/module/agent-avatar/config-character.js.map +1 -0
  177. package/lib/module/agent-avatar/context.js +5 -0
  178. package/lib/module/agent-avatar/context.js.map +1 -1
  179. package/lib/module/agent-avatar/index.js +1 -0
  180. package/lib/module/agent-avatar/index.js.map +1 -1
  181. package/lib/module/agent-avatar/legacy-contours.js +53 -0
  182. package/lib/module/agent-avatar/legacy-contours.js.map +1 -0
  183. package/lib/module/agent-avatar/legacy-recipe.js +104 -0
  184. package/lib/module/agent-avatar/legacy-recipe.js.map +1 -0
  185. package/lib/module/agent-avatar/messages.js +2 -1
  186. package/lib/module/agent-avatar/messages.js.map +1 -1
  187. package/lib/module/agent-avatar/model.js +2 -0
  188. package/lib/module/agent-avatar/model.js.map +1 -1
  189. package/lib/module/agent-creator/AgentCreatorBase.js +248 -22
  190. package/lib/module/agent-creator/AgentCreatorBase.js.map +1 -1
  191. package/lib/module/agent-creator/CharacterControls.js +112 -0
  192. package/lib/module/agent-creator/CharacterControls.js.map +1 -0
  193. package/lib/module/agent-creator/EmotionPicker.js +52 -19
  194. package/lib/module/agent-creator/EmotionPicker.js.map +1 -1
  195. package/lib/module/agent-creator/ShapeArc.js +58 -28
  196. package/lib/module/agent-creator/ShapeArc.js.map +1 -1
  197. package/lib/module/agent-creator/ShapeSilhouette.js +57 -0
  198. package/lib/module/agent-creator/ShapeSilhouette.js.map +1 -0
  199. package/lib/module/agent-creator/constants.js +47 -0
  200. package/lib/module/agent-creator/constants.js.map +1 -1
  201. package/lib/module/agent-creator/messages.js +9 -0
  202. package/lib/module/agent-creator/messages.js.map +1 -1
  203. package/lib/module/agent-creator/shared.js +1 -9
  204. package/lib/module/agent-creator/shared.js.map +1 -1
  205. package/lib/module/agent-thinking/AgentThinking.js +5 -63
  206. package/lib/module/agent-thinking/AgentThinking.js.map +1 -1
  207. package/lib/module/agent-thinking/ThinkingLabel.js +73 -0
  208. package/lib/module/agent-thinking/ThinkingLabel.js.map +1 -0
  209. package/lib/module/chart-cards/TokensChartCard.js +20 -5
  210. package/lib/module/chart-cards/TokensChartCard.js.map +1 -1
  211. package/lib/module/locale/translations/ar.js +11 -1
  212. package/lib/module/locale/translations/ar.js.map +1 -1
  213. package/lib/module/locale/translations/bn.js +11 -1
  214. package/lib/module/locale/translations/bn.js.map +1 -1
  215. package/lib/module/locale/translations/ca.js +11 -1
  216. package/lib/module/locale/translations/ca.js.map +1 -1
  217. package/lib/module/locale/translations/de.js +11 -1
  218. package/lib/module/locale/translations/de.js.map +1 -1
  219. package/lib/module/locale/translations/es.js +11 -1
  220. package/lib/module/locale/translations/es.js.map +1 -1
  221. package/lib/module/locale/translations/fr.js +11 -1
  222. package/lib/module/locale/translations/fr.js.map +1 -1
  223. package/lib/module/locale/translations/hi.js +11 -1
  224. package/lib/module/locale/translations/hi.js.map +1 -1
  225. package/lib/module/locale/translations/id.js +11 -1
  226. package/lib/module/locale/translations/id.js.map +1 -1
  227. package/lib/module/locale/translations/it.js +11 -1
  228. package/lib/module/locale/translations/it.js.map +1 -1
  229. package/lib/module/locale/translations/ja.js +11 -1
  230. package/lib/module/locale/translations/ja.js.map +1 -1
  231. package/lib/module/locale/translations/pt.js +11 -1
  232. package/lib/module/locale/translations/pt.js.map +1 -1
  233. package/lib/module/locale/translations/ru.js +11 -1
  234. package/lib/module/locale/translations/ru.js.map +1 -1
  235. package/lib/module/locale/translations/tr.js +11 -1
  236. package/lib/module/locale/translations/tr.js.map +1 -1
  237. package/lib/module/locale/translations/zh.js +11 -1
  238. package/lib/module/locale/translations/zh.js.map +1 -1
  239. package/lib/module/multi-agent-chat/AvatarHandoff.js +3 -5
  240. package/lib/module/multi-agent-chat/AvatarHandoff.js.map +1 -1
  241. package/lib/module/multi-agent-chat/ChatAgentProfile.js +94 -0
  242. package/lib/module/multi-agent-chat/ChatAgentProfile.js.map +1 -0
  243. package/lib/module/multi-agent-chat/EditorRail.js +4 -0
  244. package/lib/module/multi-agent-chat/EditorRail.js.map +1 -1
  245. package/lib/module/multi-agent-chat/MultiAgentChatBase.js +89 -126
  246. package/lib/module/multi-agent-chat/MultiAgentChatBase.js.map +1 -1
  247. package/lib/module/multi-agent-chat/ReplyRow.js +9 -12
  248. package/lib/module/multi-agent-chat/ReplyRow.js.map +1 -1
  249. package/lib/module/multi-agent-chat/handoff.js +4 -4
  250. package/lib/module/multi-agent-chat/handoff.js.map +1 -1
  251. package/lib/module/project-board/CreateTicketDialog.js +33 -2
  252. package/lib/module/project-board/CreateTicketDialog.js.map +1 -1
  253. package/lib/module/project-board/ProjectBoardBase.js +138 -39
  254. package/lib/module/project-board/ProjectBoardBase.js.map +1 -1
  255. package/lib/module/project-board/TicketCornerGenieSurface.web.js +35 -29
  256. package/lib/module/project-board/TicketCornerGenieSurface.web.js.map +1 -1
  257. package/lib/module/project-board/TicketDetailDialog.js +7 -4
  258. package/lib/module/project-board/TicketDetailDialog.js.map +1 -1
  259. package/lib/module/project-board/TicketGenieSurface.js +17 -7
  260. package/lib/module/project-board/TicketGenieSurface.js.map +1 -1
  261. package/lib/module/project-board/TicketGenieSurface.web.js +1 -1
  262. package/lib/module/project-board/TicketGenieSurface.web.js.map +1 -1
  263. package/lib/module/project-board/TicketPresence.js +119 -0
  264. package/lib/module/project-board/TicketPresence.js.map +1 -0
  265. package/lib/module/project-board/TicketTokenChart.js +20 -0
  266. package/lib/module/project-board/TicketTokenChart.js.map +1 -0
  267. package/lib/module/project-board/context.js +2 -0
  268. package/lib/module/project-board/context.js.map +1 -1
  269. package/lib/module/search/Search.js +12 -3
  270. package/lib/module/search/Search.js.map +1 -1
  271. package/lib/module/sidebar/SidebarToolbar.js +29 -15
  272. package/lib/module/sidebar/SidebarToolbar.js.map +1 -1
  273. package/lib/module/text-field/TextField.js +13 -7
  274. package/lib/module/text-field/TextField.js.map +1 -1
  275. package/lib/typescript/commonjs/agent-avatar/AgentAvatar.d.ts +2 -2
  276. package/lib/typescript/commonjs/agent-avatar/AgentAvatar.d.ts.map +1 -1
  277. package/lib/typescript/commonjs/agent-avatar/AgentAvatarProvider.d.ts +4 -0
  278. package/lib/typescript/commonjs/agent-avatar/AgentAvatarProvider.d.ts.map +1 -0
  279. package/lib/typescript/commonjs/agent-avatar/CharacterAvatar.d.ts +4 -0
  280. package/lib/typescript/commonjs/agent-avatar/CharacterAvatar.d.ts.map +1 -0
  281. package/lib/typescript/commonjs/agent-avatar/ProceduralAvatar.d.ts +6 -0
  282. package/lib/typescript/commonjs/agent-avatar/ProceduralAvatar.d.ts.map +1 -0
  283. package/lib/typescript/commonjs/agent-avatar/artwork.d.ts +2 -1
  284. package/lib/typescript/commonjs/agent-avatar/artwork.d.ts.map +1 -1
  285. package/lib/typescript/commonjs/agent-avatar/avatar-color.d.ts +3 -0
  286. package/lib/typescript/commonjs/agent-avatar/avatar-color.d.ts.map +1 -0
  287. package/lib/typescript/commonjs/agent-avatar/character-html.d.ts +4 -0
  288. package/lib/typescript/commonjs/agent-avatar/character-html.d.ts.map +1 -0
  289. package/lib/typescript/commonjs/agent-avatar/character-runtime-module.d.ts +2 -0
  290. package/lib/typescript/commonjs/agent-avatar/character-runtime-module.d.ts.map +1 -0
  291. package/lib/typescript/commonjs/agent-avatar/character-webview.d.ts +24 -0
  292. package/lib/typescript/commonjs/agent-avatar/character-webview.d.ts.map +1 -0
  293. package/lib/typescript/commonjs/agent-avatar/config-character.d.ts +11 -0
  294. package/lib/typescript/commonjs/agent-avatar/config-character.d.ts.map +1 -0
  295. package/lib/typescript/commonjs/agent-avatar/context.d.ts +15 -0
  296. package/lib/typescript/commonjs/agent-avatar/context.d.ts.map +1 -1
  297. package/lib/typescript/commonjs/agent-avatar/index.d.ts +3 -1
  298. package/lib/typescript/commonjs/agent-avatar/index.d.ts.map +1 -1
  299. package/lib/typescript/commonjs/agent-avatar/legacy-contours.d.ts +5 -0
  300. package/lib/typescript/commonjs/agent-avatar/legacy-contours.d.ts.map +1 -0
  301. package/lib/typescript/commonjs/agent-avatar/legacy-recipe.d.ts +40 -0
  302. package/lib/typescript/commonjs/agent-avatar/legacy-recipe.d.ts.map +1 -0
  303. package/lib/typescript/commonjs/agent-avatar/messages.d.ts +1 -0
  304. package/lib/typescript/commonjs/agent-avatar/messages.d.ts.map +1 -1
  305. package/lib/typescript/commonjs/agent-avatar/model.d.ts +3 -0
  306. package/lib/typescript/commonjs/agent-avatar/model.d.ts.map +1 -1
  307. package/lib/typescript/commonjs/agent-avatar/types.d.ts +10 -1
  308. package/lib/typescript/commonjs/agent-avatar/types.d.ts.map +1 -1
  309. package/lib/typescript/commonjs/agent-creator/AgentCreatorBase.d.ts.map +1 -1
  310. package/lib/typescript/commonjs/agent-creator/CharacterControls.d.ts +8 -0
  311. package/lib/typescript/commonjs/agent-creator/CharacterControls.d.ts.map +1 -0
  312. package/lib/typescript/commonjs/agent-creator/EmotionPicker.d.ts +12 -1
  313. package/lib/typescript/commonjs/agent-creator/EmotionPicker.d.ts.map +1 -1
  314. package/lib/typescript/commonjs/agent-creator/ShapeArc.d.ts +11 -2
  315. package/lib/typescript/commonjs/agent-creator/ShapeArc.d.ts.map +1 -1
  316. package/lib/typescript/commonjs/agent-creator/ShapeSilhouette.d.ts +6 -0
  317. package/lib/typescript/commonjs/agent-creator/ShapeSilhouette.d.ts.map +1 -0
  318. package/lib/typescript/commonjs/agent-creator/constants.d.ts +44 -0
  319. package/lib/typescript/commonjs/agent-creator/constants.d.ts.map +1 -1
  320. package/lib/typescript/commonjs/agent-creator/context.d.ts +9 -0
  321. package/lib/typescript/commonjs/agent-creator/context.d.ts.map +1 -1
  322. package/lib/typescript/commonjs/agent-creator/messages.d.ts +10 -0
  323. package/lib/typescript/commonjs/agent-creator/messages.d.ts.map +1 -1
  324. package/lib/typescript/commonjs/agent-creator/shared.d.ts +1 -1
  325. package/lib/typescript/commonjs/agent-creator/shared.d.ts.map +1 -1
  326. package/lib/typescript/commonjs/agent-thinking/AgentThinking.d.ts.map +1 -1
  327. package/lib/typescript/commonjs/agent-thinking/ThinkingLabel.d.ts +7 -0
  328. package/lib/typescript/commonjs/agent-thinking/ThinkingLabel.d.ts.map +1 -0
  329. package/lib/typescript/commonjs/chart-cards/TokensChartCard.d.ts +3 -1
  330. package/lib/typescript/commonjs/chart-cards/TokensChartCard.d.ts.map +1 -1
  331. package/lib/typescript/commonjs/locale/translations/ar.d.ts.map +1 -1
  332. package/lib/typescript/commonjs/locale/translations/bn.d.ts.map +1 -1
  333. package/lib/typescript/commonjs/locale/translations/ca.d.ts.map +1 -1
  334. package/lib/typescript/commonjs/locale/translations/de.d.ts.map +1 -1
  335. package/lib/typescript/commonjs/locale/translations/es.d.ts.map +1 -1
  336. package/lib/typescript/commonjs/locale/translations/fr.d.ts.map +1 -1
  337. package/lib/typescript/commonjs/locale/translations/hi.d.ts.map +1 -1
  338. package/lib/typescript/commonjs/locale/translations/id.d.ts.map +1 -1
  339. package/lib/typescript/commonjs/locale/translations/it.d.ts.map +1 -1
  340. package/lib/typescript/commonjs/locale/translations/ja.d.ts.map +1 -1
  341. package/lib/typescript/commonjs/locale/translations/pt.d.ts.map +1 -1
  342. package/lib/typescript/commonjs/locale/translations/ru.d.ts.map +1 -1
  343. package/lib/typescript/commonjs/locale/translations/tr.d.ts.map +1 -1
  344. package/lib/typescript/commonjs/locale/translations/zh.d.ts.map +1 -1
  345. package/lib/typescript/commonjs/multi-agent-chat/AvatarHandoff.d.ts.map +1 -1
  346. package/lib/typescript/commonjs/multi-agent-chat/ChatAgentProfile.d.ts +11 -0
  347. package/lib/typescript/commonjs/multi-agent-chat/ChatAgentProfile.d.ts.map +1 -0
  348. package/lib/typescript/commonjs/multi-agent-chat/EditorRail.d.ts.map +1 -1
  349. package/lib/typescript/commonjs/multi-agent-chat/MultiAgentChatBase.d.ts.map +1 -1
  350. package/lib/typescript/commonjs/multi-agent-chat/ReplyRow.d.ts.map +1 -1
  351. package/lib/typescript/commonjs/multi-agent-chat/handoff.d.ts +2 -2
  352. package/lib/typescript/commonjs/multi-agent-chat/handoff.d.ts.map +1 -1
  353. package/lib/typescript/commonjs/project-board/CreateTicketDialog.d.ts.map +1 -1
  354. package/lib/typescript/commonjs/project-board/ProjectBoardBase.d.ts.map +1 -1
  355. package/lib/typescript/commonjs/project-board/TicketCornerGenieSurface.web.d.ts.map +1 -1
  356. package/lib/typescript/commonjs/project-board/TicketDetailDialog.d.ts.map +1 -1
  357. package/lib/typescript/commonjs/project-board/TicketGenieSurface.d.ts.map +1 -1
  358. package/lib/typescript/commonjs/project-board/TicketPresence.d.ts +17 -0
  359. package/lib/typescript/commonjs/project-board/TicketPresence.d.ts.map +1 -0
  360. package/lib/typescript/commonjs/project-board/TicketTokenChart.d.ts +5 -0
  361. package/lib/typescript/commonjs/project-board/TicketTokenChart.d.ts.map +1 -0
  362. package/lib/typescript/commonjs/project-board/context.d.ts +2 -0
  363. package/lib/typescript/commonjs/project-board/context.d.ts.map +1 -1
  364. package/lib/typescript/commonjs/search/Search.d.ts.map +1 -1
  365. package/lib/typescript/commonjs/sidebar/SidebarToolbar.d.ts.map +1 -1
  366. package/lib/typescript/commonjs/text-field/TextField.d.ts.map +1 -1
  367. package/lib/typescript/module/agent-avatar/AgentAvatar.d.ts +2 -2
  368. package/lib/typescript/module/agent-avatar/AgentAvatar.d.ts.map +1 -1
  369. package/lib/typescript/module/agent-avatar/AgentAvatarProvider.d.ts +4 -0
  370. package/lib/typescript/module/agent-avatar/AgentAvatarProvider.d.ts.map +1 -0
  371. package/lib/typescript/module/agent-avatar/CharacterAvatar.d.ts +4 -0
  372. package/lib/typescript/module/agent-avatar/CharacterAvatar.d.ts.map +1 -0
  373. package/lib/typescript/module/agent-avatar/ProceduralAvatar.d.ts +6 -0
  374. package/lib/typescript/module/agent-avatar/ProceduralAvatar.d.ts.map +1 -0
  375. package/lib/typescript/module/agent-avatar/artwork.d.ts +2 -1
  376. package/lib/typescript/module/agent-avatar/artwork.d.ts.map +1 -1
  377. package/lib/typescript/module/agent-avatar/avatar-color.d.ts +3 -0
  378. package/lib/typescript/module/agent-avatar/avatar-color.d.ts.map +1 -0
  379. package/lib/typescript/module/agent-avatar/character-html.d.ts +4 -0
  380. package/lib/typescript/module/agent-avatar/character-html.d.ts.map +1 -0
  381. package/lib/typescript/module/agent-avatar/character-runtime-module.d.ts +2 -0
  382. package/lib/typescript/module/agent-avatar/character-runtime-module.d.ts.map +1 -0
  383. package/lib/typescript/module/agent-avatar/character-webview.d.ts +24 -0
  384. package/lib/typescript/module/agent-avatar/character-webview.d.ts.map +1 -0
  385. package/lib/typescript/module/agent-avatar/config-character.d.ts +11 -0
  386. package/lib/typescript/module/agent-avatar/config-character.d.ts.map +1 -0
  387. package/lib/typescript/module/agent-avatar/context.d.ts +15 -0
  388. package/lib/typescript/module/agent-avatar/context.d.ts.map +1 -1
  389. package/lib/typescript/module/agent-avatar/index.d.ts +3 -1
  390. package/lib/typescript/module/agent-avatar/index.d.ts.map +1 -1
  391. package/lib/typescript/module/agent-avatar/legacy-contours.d.ts +5 -0
  392. package/lib/typescript/module/agent-avatar/legacy-contours.d.ts.map +1 -0
  393. package/lib/typescript/module/agent-avatar/legacy-recipe.d.ts +40 -0
  394. package/lib/typescript/module/agent-avatar/legacy-recipe.d.ts.map +1 -0
  395. package/lib/typescript/module/agent-avatar/messages.d.ts +1 -0
  396. package/lib/typescript/module/agent-avatar/messages.d.ts.map +1 -1
  397. package/lib/typescript/module/agent-avatar/model.d.ts +3 -0
  398. package/lib/typescript/module/agent-avatar/model.d.ts.map +1 -1
  399. package/lib/typescript/module/agent-avatar/types.d.ts +10 -1
  400. package/lib/typescript/module/agent-avatar/types.d.ts.map +1 -1
  401. package/lib/typescript/module/agent-creator/AgentCreatorBase.d.ts.map +1 -1
  402. package/lib/typescript/module/agent-creator/CharacterControls.d.ts +8 -0
  403. package/lib/typescript/module/agent-creator/CharacterControls.d.ts.map +1 -0
  404. package/lib/typescript/module/agent-creator/EmotionPicker.d.ts +12 -1
  405. package/lib/typescript/module/agent-creator/EmotionPicker.d.ts.map +1 -1
  406. package/lib/typescript/module/agent-creator/ShapeArc.d.ts +11 -2
  407. package/lib/typescript/module/agent-creator/ShapeArc.d.ts.map +1 -1
  408. package/lib/typescript/module/agent-creator/ShapeSilhouette.d.ts +6 -0
  409. package/lib/typescript/module/agent-creator/ShapeSilhouette.d.ts.map +1 -0
  410. package/lib/typescript/module/agent-creator/constants.d.ts +44 -0
  411. package/lib/typescript/module/agent-creator/constants.d.ts.map +1 -1
  412. package/lib/typescript/module/agent-creator/context.d.ts +9 -0
  413. package/lib/typescript/module/agent-creator/context.d.ts.map +1 -1
  414. package/lib/typescript/module/agent-creator/messages.d.ts +10 -0
  415. package/lib/typescript/module/agent-creator/messages.d.ts.map +1 -1
  416. package/lib/typescript/module/agent-creator/shared.d.ts +1 -1
  417. package/lib/typescript/module/agent-creator/shared.d.ts.map +1 -1
  418. package/lib/typescript/module/agent-thinking/AgentThinking.d.ts.map +1 -1
  419. package/lib/typescript/module/agent-thinking/ThinkingLabel.d.ts +7 -0
  420. package/lib/typescript/module/agent-thinking/ThinkingLabel.d.ts.map +1 -0
  421. package/lib/typescript/module/chart-cards/TokensChartCard.d.ts +3 -1
  422. package/lib/typescript/module/chart-cards/TokensChartCard.d.ts.map +1 -1
  423. package/lib/typescript/module/locale/translations/ar.d.ts.map +1 -1
  424. package/lib/typescript/module/locale/translations/bn.d.ts.map +1 -1
  425. package/lib/typescript/module/locale/translations/ca.d.ts.map +1 -1
  426. package/lib/typescript/module/locale/translations/de.d.ts.map +1 -1
  427. package/lib/typescript/module/locale/translations/es.d.ts.map +1 -1
  428. package/lib/typescript/module/locale/translations/fr.d.ts.map +1 -1
  429. package/lib/typescript/module/locale/translations/hi.d.ts.map +1 -1
  430. package/lib/typescript/module/locale/translations/id.d.ts.map +1 -1
  431. package/lib/typescript/module/locale/translations/it.d.ts.map +1 -1
  432. package/lib/typescript/module/locale/translations/ja.d.ts.map +1 -1
  433. package/lib/typescript/module/locale/translations/pt.d.ts.map +1 -1
  434. package/lib/typescript/module/locale/translations/ru.d.ts.map +1 -1
  435. package/lib/typescript/module/locale/translations/tr.d.ts.map +1 -1
  436. package/lib/typescript/module/locale/translations/zh.d.ts.map +1 -1
  437. package/lib/typescript/module/multi-agent-chat/AvatarHandoff.d.ts.map +1 -1
  438. package/lib/typescript/module/multi-agent-chat/ChatAgentProfile.d.ts +11 -0
  439. package/lib/typescript/module/multi-agent-chat/ChatAgentProfile.d.ts.map +1 -0
  440. package/lib/typescript/module/multi-agent-chat/EditorRail.d.ts.map +1 -1
  441. package/lib/typescript/module/multi-agent-chat/MultiAgentChatBase.d.ts.map +1 -1
  442. package/lib/typescript/module/multi-agent-chat/ReplyRow.d.ts.map +1 -1
  443. package/lib/typescript/module/multi-agent-chat/handoff.d.ts +2 -2
  444. package/lib/typescript/module/multi-agent-chat/handoff.d.ts.map +1 -1
  445. package/lib/typescript/module/project-board/CreateTicketDialog.d.ts.map +1 -1
  446. package/lib/typescript/module/project-board/ProjectBoardBase.d.ts.map +1 -1
  447. package/lib/typescript/module/project-board/TicketCornerGenieSurface.web.d.ts.map +1 -1
  448. package/lib/typescript/module/project-board/TicketDetailDialog.d.ts.map +1 -1
  449. package/lib/typescript/module/project-board/TicketGenieSurface.d.ts.map +1 -1
  450. package/lib/typescript/module/project-board/TicketPresence.d.ts +17 -0
  451. package/lib/typescript/module/project-board/TicketPresence.d.ts.map +1 -0
  452. package/lib/typescript/module/project-board/TicketTokenChart.d.ts +5 -0
  453. package/lib/typescript/module/project-board/TicketTokenChart.d.ts.map +1 -0
  454. package/lib/typescript/module/project-board/context.d.ts +2 -0
  455. package/lib/typescript/module/project-board/context.d.ts.map +1 -1
  456. package/lib/typescript/module/search/Search.d.ts.map +1 -1
  457. package/lib/typescript/module/sidebar/SidebarToolbar.d.ts.map +1 -1
  458. package/lib/typescript/module/text-field/TextField.d.ts.map +1 -1
  459. package/package.json +8 -3
  460. package/src/agent-avatar/AgentAvatar.tsx +16 -296
  461. package/src/agent-avatar/AgentAvatarProvider.tsx +79 -0
  462. package/src/agent-avatar/CharacterAvatar.tsx +260 -0
  463. package/src/agent-avatar/ProceduralAvatar.tsx +303 -0
  464. package/src/agent-avatar/artwork.ts +3 -3
  465. package/src/agent-avatar/avatar-color.ts +17 -0
  466. package/src/agent-avatar/character-html.ts +21 -0
  467. package/src/agent-avatar/character-runtime-module.ts +37 -0
  468. package/src/agent-avatar/character-webview.ts +24 -0
  469. package/src/agent-avatar/config-character.ts +40 -0
  470. package/src/agent-avatar/context.ts +17 -0
  471. package/src/agent-avatar/index.ts +4 -1
  472. package/src/agent-avatar/legacy-contours.ts +76 -0
  473. package/src/agent-avatar/legacy-recipe.ts +123 -0
  474. package/src/agent-avatar/messages.ts +1 -0
  475. package/src/agent-avatar/model.ts +5 -0
  476. package/src/agent-avatar/types.ts +12 -1
  477. package/src/agent-creator/AgentCreatorBase.tsx +338 -39
  478. package/src/agent-creator/CharacterControls.tsx +150 -0
  479. package/src/agent-creator/EmotionPicker.tsx +43 -21
  480. package/src/agent-creator/ShapeArc.tsx +83 -29
  481. package/src/agent-creator/ShapeSilhouette.tsx +65 -0
  482. package/src/agent-creator/constants.ts +30 -0
  483. package/src/agent-creator/messages.ts +19 -0
  484. package/src/agent-creator/shared.ts +1 -15
  485. package/src/agent-thinking/AgentThinking.tsx +7 -70
  486. package/src/agent-thinking/ThinkingLabel.tsx +74 -0
  487. package/src/chart-cards/TokensChartCard.tsx +10 -6
  488. package/src/locale/translations/ar.ts +10 -1
  489. package/src/locale/translations/bn.ts +10 -1
  490. package/src/locale/translations/ca.ts +10 -1
  491. package/src/locale/translations/de.ts +10 -1
  492. package/src/locale/translations/es.ts +10 -1
  493. package/src/locale/translations/fr.ts +10 -1
  494. package/src/locale/translations/hi.ts +10 -1
  495. package/src/locale/translations/id.ts +10 -1
  496. package/src/locale/translations/it.ts +10 -1
  497. package/src/locale/translations/ja.ts +10 -1
  498. package/src/locale/translations/pt.ts +10 -1
  499. package/src/locale/translations/ru.ts +10 -1
  500. package/src/locale/translations/tr.ts +10 -1
  501. package/src/locale/translations/zh.ts +10 -1
  502. package/src/multi-agent-chat/AvatarHandoff.tsx +2 -5
  503. package/src/multi-agent-chat/ChatAgentProfile.tsx +116 -0
  504. package/src/multi-agent-chat/EditorRail.tsx +2 -0
  505. package/src/multi-agent-chat/MultiAgentChatBase.tsx +123 -175
  506. package/src/multi-agent-chat/ReplyRow.tsx +10 -9
  507. package/src/multi-agent-chat/handoff.ts +4 -4
  508. package/src/project-board/CreateTicketDialog.tsx +28 -4
  509. package/src/project-board/ProjectBoardBase.tsx +115 -21
  510. package/src/project-board/TicketCornerGenieSurface.web.tsx +11 -6
  511. package/src/project-board/TicketDetailDialog.tsx +5 -4
  512. package/src/project-board/TicketGenieSurface.tsx +9 -0
  513. package/src/project-board/TicketGenieSurface.web.tsx +1 -1
  514. package/src/project-board/TicketPresence.tsx +137 -0
  515. package/src/project-board/TicketTokenChart.tsx +14 -0
  516. package/src/project-board/context.ts +2 -0
  517. package/src/search/Search.tsx +6 -5
  518. package/src/sidebar/SidebarToolbar.tsx +27 -15
  519. package/src/text-field/TextField.tsx +12 -7
@@ -0,0 +1,123 @@
1
+ import { avatarHex } from './avatar-color';
2
+ import { legacyContours } from './legacy-contours';
3
+ import type { AvatarConfig } from './model';
4
+ import type { AvatarCharacterConfig } from './config-character';
5
+
6
+ type Point = [number, number];
7
+ export type LegacyRecipe = {
8
+ /** Absent when the original catalog already provides this shape. */
9
+ points?: Point[];
10
+ shape?: string;
11
+ eyes: string;
12
+ selections?: Pick<
13
+ NonNullable<AvatarCharacterConfig['selections']>,
14
+ 'eyewear' | 'accessory'
15
+ >;
16
+ patch: { bodyColor: string };
17
+ };
18
+
19
+ /** Saved unsupported artwork stays readable without pretending it was migrated. */
20
+ export function legacyRecipeUnsupported(config: AvatarConfig): boolean {
21
+ return (
22
+ config.family === 'alien' || config.family === 'mascot' || !config.face
23
+ );
24
+ }
25
+
26
+ /** Reuse actual beta geometry for equivalent shapes, per the unified catalog. */
27
+ export function legacyNativeShape(config: AvatarConfig): string | undefined {
28
+ const shared: Partial<
29
+ Record<AvatarConfig['shape'] | AvatarConfig['foldShape'], string>
30
+ > = {
31
+ circle: 'circle',
32
+ triangle: 'rounded_triangle',
33
+ flower: 'six_lobed_flower',
34
+ diamond: 'rounded_diamond',
35
+ heart: 'heart',
36
+ };
37
+ return config.family === 'fold'
38
+ ? shared[config.foldShape]
39
+ : config.family === 'blob'
40
+ ? shared[config.shape]
41
+ : undefined;
42
+ }
43
+
44
+ /** Radial union of the existing paper front/back or blob contour, starting +X.
45
+ * The fur/body deformation needs a counter-clockwise ring, not winding-dependent
46
+ * path vertices. Every ray takes the outermost segment intersection.
47
+ */
48
+ export function radialContour(polygons: Point[][], samples = 256): Point[] {
49
+ if (!Number.isInteger(samples) || samples < 16 || samples > 2048)
50
+ throw new Error('Invalid contour sample count');
51
+ return Array.from({ length: samples }, (_, i) => {
52
+ const angle = (i * Math.PI * 2) / samples;
53
+ const dx = Math.cos(angle),
54
+ dy = Math.sin(angle);
55
+ let radius = 0;
56
+ for (const polygon of polygons)
57
+ for (let j = 0; j < polygon.length; j++) {
58
+ const [ax, ay] = polygon[j]!;
59
+ const [bx, by] = polygon[(j + 1) % polygon.length]!;
60
+ const ex = bx - ax,
61
+ ey = by - ay,
62
+ denominator = dx * ey - dy * ex;
63
+ if (Math.abs(denominator) < 1e-10) continue;
64
+ const distance = (ax * ey - ay * ex) / denominator;
65
+ const segment = (ax * dy - ay * dx) / denominator;
66
+ if (distance > radius && segment >= -1e-8 && segment <= 1 + 1e-8)
67
+ radius = distance;
68
+ }
69
+ if (!Number.isFinite(radius) || radius <= 0)
70
+ throw new Error('Legacy contour does not enclose its origin');
71
+ return [radius * dx, radius * dy];
72
+ });
73
+ }
74
+
75
+ /** Shared capability identity for the editor and the legacy engine adapter. */
76
+ export function legacyCharacterRecipe(config: AvatarConfig) {
77
+ const customization =
78
+ config.character?.preset === 'bloom' ? config.character : undefined;
79
+ return {
80
+ preset: 'legacy',
81
+ selections: {
82
+ shape: legacyNativeShape(config) ?? 'circle',
83
+ eyes: customization?.selections?.eyes ?? 'oval',
84
+ ...(customization?.selections?.eyewear
85
+ ? { eyewear: customization.selections.eyewear }
86
+ : {}),
87
+ ...(customization?.selections?.accessory
88
+ ? { accessory: customization.selections.accessory }
89
+ : {}),
90
+ },
91
+ bodyColor: customization?.bodyColor ?? avatarHex(config),
92
+ };
93
+ }
94
+
95
+ /** Legacy recipes contribute their body only; eyes are the original 3D catalog.
96
+ * Historical expression, spacing and tilt fields remain readable but no longer
97
+ * alter the migrated face. The engine owns eye geometry and animation.
98
+ */
99
+ export function legacyRecipe(
100
+ config: AvatarConfig,
101
+ samples = 256,
102
+ ): LegacyRecipe {
103
+ if (legacyRecipeUnsupported(config))
104
+ throw new Error('Unsupported legacy 3D recipe');
105
+ const shape = legacyNativeShape(config);
106
+ const recipe = legacyCharacterRecipe(config);
107
+ const { eyewear, accessory } = recipe.selections;
108
+ return {
109
+ ...(shape
110
+ ? { shape }
111
+ : { points: radialContour(legacyContours(config), samples) }),
112
+ eyes: recipe.selections.eyes,
113
+ ...(eyewear || accessory
114
+ ? {
115
+ selections: {
116
+ ...(eyewear ? { eyewear } : {}),
117
+ ...(accessory ? { accessory } : {}),
118
+ },
119
+ }
120
+ : {}),
121
+ patch: { bodyColor: recipe.bodyColor },
122
+ };
123
+ }
@@ -2,4 +2,5 @@ import { defineMessages } from '../locale/messages';
2
2
 
3
3
  export const AGENT_AVATAR_MESSAGES = defineMessages('AGENT_AVATAR_MESSAGES', {
4
4
  label: 'Agent avatar',
5
+ unavailable: 'Avatar unavailable',
5
6
  });
@@ -1,3 +1,5 @@
1
+ import { parseCharacterConfig, type AvatarCharacterConfig } from './config-character';
2
+
1
3
  export const SHAPES = [
2
4
  'pebble',
3
5
  'circle',
@@ -65,6 +67,8 @@ export const LOOKS = [
65
67
  ] as const;
66
68
 
67
69
  export type AvatarConfig = {
70
+ /** Optional compiled character renderer; the procedural recipe remains the fallback. */
71
+ character?: AvatarCharacterConfig;
68
72
  family: AvatarFamily;
69
73
  foldShape: (typeof FOLD_SHAPES)[number];
70
74
  foldDirection: (typeof FOLD_DIRECTIONS)[number];
@@ -568,6 +572,7 @@ export function parsePreset(value: unknown): AvatarPreset {
568
572
  if (!LOOKS.includes(c.lookAt as AvatarConfig['lookAt']))
569
573
  throw new Error('Unknown gaze direction.');
570
574
  config.lookAt = c.lookAt as AvatarConfig['lookAt'];
575
+ if (c.character !== undefined) config.character = parseCharacterConfig(c.character);
571
576
  return {
572
577
  name: p.name.slice(0, 48) || 'Untitled',
573
578
  description: 'Your saved direction',
@@ -1,3 +1,4 @@
1
+ import type { ReactNode } from 'react';
1
2
  import type { StyleProp, ViewStyle } from 'react-native';
2
3
  import type { AvatarConfig } from './model';
3
4
 
@@ -7,9 +8,12 @@ export type AgentAvatarProps = {
7
8
  paused?: boolean;
8
9
  label?: string;
9
10
  locale?: string;
10
- /** Compatibility options reserved by the original artwork. */
11
+ /** Enables pointer and touch reactions when a 3D runtime provider is available. */
11
12
  interactive?: boolean;
13
+ /** Uses a cached still portrait for optional character previews, avoiding a live renderer per thumbnail. */
12
14
  portrait?: boolean;
15
+ /** Replays the supported 3D reaction (signature or migrated silhouette wave) when the key changes. */
16
+ reactionKey?: number;
13
17
  entranceKey?: number;
14
18
  workingKey?: number;
15
19
  workingCycles?: number;
@@ -19,3 +23,10 @@ export type AgentAvatarProps = {
19
23
  testID?: string;
20
24
  };
21
25
  export type AvatarProps = AgentAvatarProps;
26
+
27
+ export type { AvatarCharacterConfig, AvatarCharacterCategory } from './config-character';
28
+
29
+ export type AgentAvatarProviderProps = {
30
+ runtimeUrl: string;
31
+ children: ReactNode;
32
+ };
@@ -1,5 +1,16 @@
1
+ import { useContext, useMemo, useState } from 'react';
1
2
  import { Platform } from 'react-native';
2
3
  import { AgentAvatar, type AvatarConfig } from '../agent-avatar';
4
+ import type { AvatarCharacterCategory } from '../agent-avatar/config-character';
5
+ import {
6
+ CharacterRuntimeContext,
7
+ CharacterCapabilitiesContext,
8
+ } from '../agent-avatar/context';
9
+ import {
10
+ legacyCharacterRecipe,
11
+ legacyNativeShape,
12
+ } from '../agent-avatar/legacy-recipe';
13
+ import { Button } from '../button/Button';
3
14
  import { CloseButton } from '../button/CloseButton';
4
15
  import { useDirectionProps } from '../hooks/use-is-rtl';
5
16
  import { StyledPressable, StyledView } from '../styles/styled-primitives';
@@ -8,12 +19,17 @@ import { Textarea } from '../textarea';
8
19
  import { useTheme } from '../theme/use-theme';
9
20
  import { Text } from '../typography';
10
21
  import { AgentPreferencesPanel } from './AgentPreferencesPanel';
22
+ import { CharacterControls } from './CharacterControls';
11
23
  import { CustomColorPicker } from './CustomColorPicker';
12
24
  import { EmotionPicker } from './EmotionPicker';
13
25
  import { GlossArt } from './GlossArt';
14
26
  import { ScrollSurface } from './ScrollSurface';
15
27
  import { ShapeArc } from './ShapeArc';
16
- import { AVATAR_COLORS } from './constants';
28
+ import {
29
+ AVATAR_COLORS,
30
+ CHARACTER_COLORS,
31
+ CHARACTER_OPTIONS,
32
+ } from './constants';
17
33
  import {
18
34
  AgentCreatorCopyContext,
19
35
  useAgentCreatorBindings,
@@ -30,8 +46,195 @@ export function AgentCreatorBase(props: AgentCreatorProps) {
30
46
  const { colors } = useTheme();
31
47
  const { Popover, PopoverTrigger, PopoverContent } = useAgentCreatorBindings();
32
48
  const c = agent.avatar;
33
- const appearance = (patch: Partial<AvatarConfig>) =>
34
- onChange({ ...agent, avatar: { ...c, ...patch, lookAt: 'wander' } });
49
+ const [reactionKey, setReactionKey] = useState(0);
50
+ const [workingKey, setWorkingKey] = useState(0);
51
+ const runtime = useContext(CharacterRuntimeContext);
52
+ const catalog = useContext(CharacterCapabilitiesContext);
53
+ const previewConfig = useMemo(
54
+ () => ({ ...c, lookAt: 'wander' as const }),
55
+ [c],
56
+ );
57
+ const { runtimeUrl } = runtime;
58
+ const beta = Boolean(c.character && c.character.preset !== 'bloom');
59
+ const nativeShape = legacyNativeShape(c);
60
+ const key = JSON.stringify(beta ? c.character : legacyCharacterRecipe(c));
61
+ const capabilities =
62
+ catalog.capabilitiesByKey?.get(key) ??
63
+ (catalog.capabilities?.key === key ? catalog.capabilities : undefined);
64
+ const betaColor =
65
+ capabilities?.selected.color ?? c.character?.selections?.color;
66
+ const customColorValue = beta
67
+ ? (c.character?.bodyColor ??
68
+ CHARACTER_COLORS[betaColor as keyof typeof CHARACTER_COLORS] ??
69
+ avatarHex(c))
70
+ : (c.character?.bodyColor ?? avatarHex(c));
71
+ const selectedEyes =
72
+ capabilities?.selected.eyes ?? c.character?.selections?.eyes ?? 'oval';
73
+ const characterConfig = (
74
+ category: AvatarCharacterCategory,
75
+ id: string,
76
+ ): AvatarConfig => {
77
+ if (
78
+ !beta &&
79
+ (category === 'eyes' ||
80
+ category === 'eyewear' ||
81
+ category === 'accessory')
82
+ )
83
+ return {
84
+ ...c,
85
+ character: {
86
+ ...c.character,
87
+ preset: 'bloom',
88
+ selections: { ...c.character?.selections, [category]: id },
89
+ },
90
+ };
91
+ const character = beta
92
+ ? c.character!
93
+ : {
94
+ preset: 'blue_beret',
95
+ bodyColor: customColorValue,
96
+ selections: {
97
+ eyewear:
98
+ c.character?.selections?.eyewear ??
99
+ capabilities?.selected.eyewear ??
100
+ 'none',
101
+ accessory:
102
+ c.character?.selections?.accessory ??
103
+ capabilities?.selected.accessory ??
104
+ 'none',
105
+ eyes: selectedEyes,
106
+ },
107
+ };
108
+ const selections = { ...character.selections, [category]: id };
109
+ if (category === 'shape') delete selections.eyes;
110
+ const next = { ...character, selections };
111
+ if (category === 'color') delete next.bodyColor;
112
+ return { ...c, character: next };
113
+ };
114
+ const selectCharacter = (category: AvatarCharacterCategory, id: string) =>
115
+ onChange({ ...agent, avatar: characterConfig(category, id) });
116
+ const thumbnailBase = runtimeUrl
117
+ ? runtimeUrl.slice(0, runtimeUrl.lastIndexOf('/') + 1)
118
+ : '';
119
+ const eyeBackground = customColorValue;
120
+ const migratedShapes = [
121
+ ...(['slender', 'pocket', 'petal', 'star', 'cloud', 'shield'] as const).map(
122
+ (shape) => ({
123
+ family: 'fold' as const,
124
+ shape,
125
+ title: messages.shapes[shape],
126
+ }),
127
+ ),
128
+ ...(
129
+ [
130
+ ['pebble', 'Pebble'],
131
+ ['squircle', 'Squircle'],
132
+ ] as const
133
+ ).map(([shape, title]) => ({
134
+ family: 'blob' as const,
135
+ shape,
136
+ title: messages.characterOption('shape', shape, title),
137
+ })),
138
+ ];
139
+ const migratedConfig = (
140
+ family: 'fold' | 'blob',
141
+ shape: string,
142
+ ): AvatarConfig => {
143
+ const { character: _character, ...existing } = c;
144
+ const color = hexAppearance(customColorValue);
145
+ return {
146
+ ...existing,
147
+ ...color,
148
+ lightEyes: beta ? false : c.lightEyes,
149
+ family,
150
+ ...(family === 'fold'
151
+ ? { foldShape: shape as AvatarConfig['foldShape'] }
152
+ : { shape: shape as AvatarConfig['shape'] }),
153
+ ...(runtimeUrl
154
+ ? {
155
+ character: {
156
+ preset: 'bloom',
157
+ selections: {
158
+ eyes: selectedEyes,
159
+ ...((capabilities?.selected.eyewear ??
160
+ c.character?.selections?.eyewear)
161
+ ? {
162
+ eyewear:
163
+ capabilities?.selected.eyewear ??
164
+ c.character?.selections?.eyewear,
165
+ }
166
+ : {}),
167
+ ...((capabilities?.selected.accessory ??
168
+ c.character?.selections?.accessory)
169
+ ? {
170
+ accessory:
171
+ capabilities?.selected.accessory ??
172
+ c.character?.selections?.accessory,
173
+ }
174
+ : {}),
175
+ },
176
+ },
177
+ }
178
+ : {}),
179
+ };
180
+ };
181
+ const shapeChoices = runtimeUrl
182
+ ? [
183
+ ...CHARACTER_OPTIONS.shape.map(([id, title]) => ({
184
+ id,
185
+ label: messages.characterOption('shape', id, title),
186
+ config: characterConfig('shape', id),
187
+ thumbnail: `${thumbnailBase}thumbnails/shapes/${id}.png`,
188
+ })),
189
+ ...migratedShapes.map(({ family, shape, title }) => ({
190
+ id: `legacy:${family}:${shape}`,
191
+ label: title,
192
+ config: migratedConfig(family, shape),
193
+ })),
194
+ ]
195
+ : undefined;
196
+ const shapeValue = beta
197
+ ? (capabilities?.selected.shape ?? c.character?.selections?.shape)
198
+ : (nativeShape ??
199
+ `legacy:${c.family}:${c.family === 'fold' ? c.foldShape : c.shape}`);
200
+ const selectShape = (id: string) => {
201
+ if (id.startsWith('legacy:')) {
202
+ const [, family, shape] = id.split(':');
203
+ onChange({
204
+ ...agent,
205
+ avatar: migratedConfig(family as 'fold' | 'blob', shape!),
206
+ });
207
+ } else selectCharacter('shape', id);
208
+ };
209
+ const eyeChoices = runtimeUrl
210
+ ? CHARACTER_OPTIONS.eyes.map(([id, title]) => ({
211
+ id,
212
+ label: messages.characterOption('eyes', id, title),
213
+ config: characterConfig('eyes', id),
214
+ thumbnail: `${thumbnailBase}thumbnails/eyes/${id}.png`,
215
+ disabled:
216
+ !capabilities || capabilities.available[`eyes:${id}`] === false,
217
+ }))
218
+ : undefined;
219
+ const appearance = (patch: Partial<AvatarConfig>) => {
220
+ const { character: _character, ...procedural } = c;
221
+ const character =
222
+ c.character?.preset === 'bloom' ? { ...c.character } : undefined;
223
+ if (
224
+ character &&
225
+ ('hue' in patch || 'saturation' in patch || 'lightness' in patch)
226
+ )
227
+ delete character.bodyColor;
228
+ onChange({
229
+ ...agent,
230
+ avatar: {
231
+ ...procedural,
232
+ ...patch,
233
+ ...(character ? { character } : {}),
234
+ lookAt: 'wander',
235
+ },
236
+ });
237
+ };
35
238
  return (
36
239
  <AgentCreatorCopyContext.Provider
37
240
  value={{ locale: props.locale, labels: props.labels }}
@@ -100,11 +303,17 @@ export function AgentCreatorBase(props: AgentCreatorProps) {
100
303
  key={agent.id}
101
304
  config={c}
102
305
  onChange={(eyes) => appearance({ eyes })}
306
+ choices={eyeChoices}
307
+ backgroundColor={eyeBackground}
308
+ value={runtimeUrl ? selectedEyes : undefined}
309
+ onSelect={
310
+ runtimeUrl ? (id) => selectCharacter('eyes', id) : undefined
311
+ }
103
312
  />
104
313
  </StyledView>
105
314
  <StyledView
106
- pointerEvents="none"
107
- className="pointer-events-none absolute left-1/2 top-[83px] -translate-x-1/2"
315
+ pointerEvents={runtimeUrl ? 'auto' : 'none'}
316
+ className={`${runtimeUrl ? 'pointer-events-auto' : 'pointer-events-none'} absolute left-1/2 top-[83px] -translate-x-1/2`}
108
317
  style={{
109
318
  position: 'absolute',
110
319
  left: '50%',
@@ -114,8 +323,11 @@ export function AgentCreatorBase(props: AgentCreatorProps) {
114
323
  }}
115
324
  >
116
325
  <AgentAvatar
117
- config={{ ...c, lookAt: 'wander' }}
326
+ config={previewConfig}
118
327
  size={162}
328
+ interactive={Boolean(runtimeUrl)}
329
+ reactionKey={reactionKey}
330
+ workingKey={workingKey}
119
331
  label={messages.livePreview(agent.name || messages.newAgent)}
120
332
  />
121
333
  </StyledView>
@@ -127,10 +339,42 @@ export function AgentCreatorBase(props: AgentCreatorProps) {
127
339
  <ShapeArc
128
340
  key={agent.id}
129
341
  config={c}
130
- onChange={(foldShape) => appearance({ foldShape })}
342
+ onChange={(foldShape) =>
343
+ appearance({
344
+ foldShape,
345
+ ...(c.family === 'alien'
346
+ ? { family: 'fold' as const }
347
+ : {}),
348
+ })
349
+ }
350
+ choices={shapeChoices}
351
+ value={shapeChoices ? shapeValue : undefined}
352
+ onSelect={shapeChoices ? selectShape : undefined}
131
353
  />
132
354
  </StyledView>
133
355
  </StyledView>
356
+ {runtimeUrl && (
357
+ <StyledView className="mt-2 flex-row justify-center gap-2">
358
+ <Button
359
+ size="xs"
360
+ onPress={() => setReactionKey((key) => key + 1)}
361
+ >
362
+ {messages.reaction}
363
+ </Button>
364
+ <Button size="xs" onPress={() => setWorkingKey((key) => key + 1)}>
365
+ {messages.working}
366
+ </Button>
367
+ </StyledView>
368
+ )}
369
+ <CharacterControls
370
+ character={c.character ?? { preset: 'bloom' }}
371
+ capabilitiesKey={key}
372
+ onChange={(character) => {
373
+ if (character)
374
+ onChange({ ...agent, avatar: { ...c, character } });
375
+ else appearance({});
376
+ }}
377
+ />
134
378
  <StyledView className="mt-[15px] flex flex-row justify-center">
135
379
  <StyledView
136
380
  role="group"
@@ -142,38 +386,79 @@ export function AgentCreatorBase(props: AgentCreatorProps) {
142
386
  boxShadow: '0 1px 2px rgba(0,0,0,.05)',
143
387
  }}
144
388
  >
145
- {AVATAR_COLORS.map(([hue, saturation, name, center, edge]) => {
146
- const active =
147
- c.hue === hue &&
148
- c.saturation === saturation &&
149
- c.lightness === undefined;
150
- return (
389
+ {!beta &&
390
+ AVATAR_COLORS.map(([hue, saturation, name, center, edge]) => {
391
+ const active =
392
+ c.hue === hue &&
393
+ c.saturation === saturation &&
394
+ c.lightness === undefined;
395
+ return (
396
+ <StyledPressable
397
+ key={name}
398
+ accessibilityRole="button"
399
+ accessibilityLabel={messages.avatarColorLabel(
400
+ messages.colors[name],
401
+ )}
402
+ accessibilityState={{ selected: active }}
403
+ aria-pressed={active}
404
+ onPress={() =>
405
+ appearance({
406
+ hue,
407
+ saturation,
408
+ lightness: undefined,
409
+ lightEyes: false,
410
+ })
411
+ }
412
+ 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]"
413
+ >
414
+ <GlossArt center={center} edge={edge} active={active} />
415
+ </StyledPressable>
416
+ );
417
+ })}
418
+ {beta &&
419
+ CHARACTER_OPTIONS.color.map(([id, title]) => {
420
+ const active =
421
+ !c.character?.bodyColor &&
422
+ capabilities?.selected.color === id;
423
+ const hex = CHARACTER_COLORS[id];
424
+ const disabled =
425
+ !capabilities ||
426
+ capabilities.available[`color:${id}`] === false;
427
+ return (
428
+ <StyledPressable
429
+ key={id}
430
+ accessibilityRole="button"
431
+ accessibilityLabel={messages.avatarColorLabel(
432
+ messages.characterOption('color', id, title),
433
+ )}
434
+ aria-pressed={active}
435
+ aria-disabled={disabled}
436
+ accessibilityState={{ selected: active, disabled }}
437
+ disabled={disabled}
438
+ onPress={() => selectCharacter('color', id)}
439
+ 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]"
440
+ >
441
+ <GlossArt center={hex} edge={hex} active={active} />
442
+ </StyledPressable>
443
+ );
444
+ })}
445
+ <Popover>
446
+ <PopoverTrigger asChild label={messages.customColor}>
151
447
  <StyledPressable
152
- key={name}
153
- accessibilityRole="button"
154
- accessibilityLabel={messages.avatarColorLabel(
155
- messages.colors[name],
156
- )}
157
- accessibilityState={{ selected: active }}
158
- aria-pressed={active}
159
- onPress={() =>
160
- appearance({
161
- hue,
162
- saturation,
163
- lightness: undefined,
164
- lightEyes: false,
165
- })
448
+ aria-pressed={
449
+ beta ? Boolean(c.character?.bodyColor) : undefined
166
450
  }
167
- 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]"
451
+ accessibilityState={{
452
+ selected: beta && Boolean(c.character?.bodyColor),
453
+ }}
454
+ className="relative size-[26px] shrink-0 overflow-hidden rounded-full"
168
455
  >
169
- <GlossArt center={center} edge={edge} active={active} />
170
- </StyledPressable>
171
- );
172
- })}
173
- <Popover>
174
- <PopoverTrigger asChild label={messages.customColor}>
175
- <StyledPressable className="relative size-[26px] shrink-0 overflow-hidden rounded-full">
176
- <GlossArt rainbow />
456
+ <GlossArt
457
+ rainbow={!beta || !c.character?.bodyColor}
458
+ center={beta ? c.character?.bodyColor : undefined}
459
+ edge={beta ? c.character?.bodyColor : undefined}
460
+ active={beta && Boolean(c.character?.bodyColor)}
461
+ />
177
462
  </StyledPressable>
178
463
  </PopoverTrigger>
179
464
  <PopoverContent
@@ -184,10 +469,23 @@ export function AgentCreatorBase(props: AgentCreatorProps) {
184
469
  className="w-[248px] rounded-3xl p-2.5"
185
470
  >
186
471
  <CustomColorPicker
187
- value={avatarHex(c)}
472
+ value={customColorValue}
188
473
  onChange={(hex) => {
189
474
  const next = hexAppearance(hex);
190
- if (next) appearance(next);
475
+ if (!next) return;
476
+ if (beta)
477
+ onChange({
478
+ ...agent,
479
+ avatar: {
480
+ ...c,
481
+ ...next,
482
+ character: {
483
+ ...c.character!,
484
+ bodyColor: hex.toLowerCase(),
485
+ },
486
+ },
487
+ });
488
+ else appearance(next);
191
489
  }}
192
490
  />
193
491
  </PopoverContent>
@@ -220,7 +518,8 @@ export function AgentCreatorBase(props: AgentCreatorProps) {
220
518
  maxLength={48}
221
519
  value={agent.name}
222
520
  onChangeText={(name) => onChange({ ...agent, name })}
223
- placeholder={'Michael Scott' /* i18n-exempt: original example person’s proper name */}
521
+ /* i18n-exempt: original example person’s proper name */
522
+ placeholder={'Michael Scott'}
224
523
  />
225
524
  </StyledView>
226
525
  </StyledView>