@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.
- package/assets/character-runtime/README.md +55 -0
- package/assets/character-runtime/appearance-codec.mjs +149 -0
- package/assets/character-runtime/integrity.json +6 -0
- package/assets/character-runtime/legacy-engine.mjs +105 -0
- package/assets/character-runtime/legacy-geometry.mjs +166 -0
- package/assets/character-runtime/legacy-worker.mjs +85 -0
- package/assets/character-runtime/managed-avatar.mjs +258 -0
- package/assets/character-runtime/orbit-characters.data +0 -0
- package/assets/character-runtime/orbit-characters.mjs +30 -0
- package/assets/character-runtime/orbit-characters.wasm +0 -0
- package/assets/character-runtime/preparation-worker.mjs +19 -0
- package/assets/character-runtime/render-budget.mjs +144 -0
- package/assets/character-runtime/runtime.mjs +851 -0
- package/assets/character-runtime/thumbnails/eyes/crescent_inset.png +0 -0
- package/assets/character-runtime/thumbnails/eyes/dots.png +0 -0
- package/assets/character-runtime/thumbnails/eyes/double_highlights.png +0 -0
- package/assets/character-runtime/thumbnails/eyes/highlight_capsules.png +0 -0
- package/assets/character-runtime/thumbnails/eyes/oval.png +0 -0
- package/assets/character-runtime/thumbnails/eyes/round_inset.png +0 -0
- package/assets/character-runtime/thumbnails/eyes/sleepy_lids.png +0 -0
- package/assets/character-runtime/thumbnails/eyes/sparkle_capsules.png +0 -0
- package/assets/character-runtime/thumbnails/eyes/swept_lids.png +0 -0
- package/assets/character-runtime/thumbnails/shapes/capsule.png +0 -0
- package/assets/character-runtime/thumbnails/shapes/circle.png +0 -0
- package/assets/character-runtime/thumbnails/shapes/circle_two_ears.png +0 -0
- package/assets/character-runtime/thumbnails/shapes/four_lobed_butterfly.png +0 -0
- package/assets/character-runtime/thumbnails/shapes/heart.png +0 -0
- package/assets/character-runtime/thumbnails/shapes/rounded_cube.png +0 -0
- package/assets/character-runtime/thumbnails/shapes/rounded_diamond.png +0 -0
- package/assets/character-runtime/thumbnails/shapes/rounded_head_two_ears.png +0 -0
- package/assets/character-runtime/thumbnails/shapes/rounded_triangle.png +0 -0
- package/assets/character-runtime/thumbnails/shapes/six_lobed_flower.png +0 -0
- package/assets/character-runtime/thumbnails/shapes/twelve_scalloped_rosette.png +0 -0
- package/docs/adoption-matrix.mdx +9 -9
- package/docs/agent-avatar.mdx +44 -10
- package/docs/agent-creator.mdx +12 -4
- package/docs/multi-agent-chat.mdx +12 -0
- package/docs/project-board.mdx +3 -3
- package/lib/commonjs/agent-avatar/AgentAvatar.js +15 -203
- package/lib/commonjs/agent-avatar/AgentAvatar.js.map +1 -1
- package/lib/commonjs/agent-avatar/AgentAvatarProvider.js +69 -0
- package/lib/commonjs/agent-avatar/AgentAvatarProvider.js.map +1 -0
- package/lib/commonjs/agent-avatar/CharacterAvatar.js +212 -0
- package/lib/commonjs/agent-avatar/CharacterAvatar.js.map +1 -0
- package/lib/commonjs/agent-avatar/ProceduralAvatar.js +216 -0
- package/lib/commonjs/agent-avatar/ProceduralAvatar.js.map +1 -0
- package/lib/commonjs/agent-avatar/artwork.js +4 -3
- package/lib/commonjs/agent-avatar/artwork.js.map +1 -1
- package/lib/commonjs/agent-avatar/avatar-color.js +16 -0
- package/lib/commonjs/agent-avatar/avatar-color.js.map +1 -0
- package/lib/commonjs/agent-avatar/character-html.js +25 -0
- package/lib/commonjs/agent-avatar/character-html.js.map +1 -0
- package/lib/commonjs/agent-avatar/character-runtime-module.js +39 -0
- package/lib/commonjs/agent-avatar/character-runtime-module.js.map +1 -0
- package/lib/commonjs/agent-avatar/character-webview.js +18 -0
- package/lib/commonjs/agent-avatar/character-webview.js.map +1 -0
- package/lib/commonjs/agent-avatar/config-character.js +36 -0
- package/lib/commonjs/agent-avatar/config-character.js.map +1 -0
- package/lib/commonjs/agent-avatar/context.js +6 -1
- package/lib/commonjs/agent-avatar/context.js.map +1 -1
- package/lib/commonjs/agent-avatar/index.js +7 -0
- package/lib/commonjs/agent-avatar/index.js.map +1 -1
- package/lib/commonjs/agent-avatar/legacy-contours.js +57 -0
- package/lib/commonjs/agent-avatar/legacy-contours.js.map +1 -0
- package/lib/commonjs/agent-avatar/legacy-recipe.js +112 -0
- package/lib/commonjs/agent-avatar/legacy-recipe.js.map +1 -0
- package/lib/commonjs/agent-avatar/messages.js +2 -1
- package/lib/commonjs/agent-avatar/messages.js.map +1 -1
- package/lib/commonjs/agent-avatar/model.js +2 -0
- package/lib/commonjs/agent-avatar/model.js.map +1 -1
- package/lib/commonjs/agent-creator/AgentCreatorBase.js +251 -25
- package/lib/commonjs/agent-creator/AgentCreatorBase.js.map +1 -1
- package/lib/commonjs/agent-creator/CharacterControls.js +115 -0
- package/lib/commonjs/agent-creator/CharacterControls.js.map +1 -0
- package/lib/commonjs/agent-creator/EmotionPicker.js +51 -18
- package/lib/commonjs/agent-creator/EmotionPicker.js.map +1 -1
- package/lib/commonjs/agent-creator/ShapeArc.js +56 -26
- package/lib/commonjs/agent-creator/ShapeArc.js.map +1 -1
- package/lib/commonjs/agent-creator/ShapeSilhouette.js +62 -0
- package/lib/commonjs/agent-creator/ShapeSilhouette.js.map +1 -0
- package/lib/commonjs/agent-creator/constants.js +48 -1
- package/lib/commonjs/agent-creator/constants.js.map +1 -1
- package/lib/commonjs/agent-creator/messages.js +9 -0
- package/lib/commonjs/agent-creator/messages.js.map +1 -1
- package/lib/commonjs/agent-creator/shared.js +7 -10
- package/lib/commonjs/agent-creator/shared.js.map +1 -1
- package/lib/commonjs/agent-thinking/AgentThinking.js +4 -62
- package/lib/commonjs/agent-thinking/AgentThinking.js.map +1 -1
- package/lib/commonjs/agent-thinking/ThinkingLabel.js +77 -0
- package/lib/commonjs/agent-thinking/ThinkingLabel.js.map +1 -0
- package/lib/commonjs/chart-cards/TokensChartCard.js +20 -5
- package/lib/commonjs/chart-cards/TokensChartCard.js.map +1 -1
- package/lib/commonjs/locale/translations/ar.js +11 -1
- package/lib/commonjs/locale/translations/ar.js.map +1 -1
- package/lib/commonjs/locale/translations/bn.js +11 -1
- package/lib/commonjs/locale/translations/bn.js.map +1 -1
- package/lib/commonjs/locale/translations/ca.js +11 -1
- package/lib/commonjs/locale/translations/ca.js.map +1 -1
- package/lib/commonjs/locale/translations/de.js +11 -1
- package/lib/commonjs/locale/translations/de.js.map +1 -1
- package/lib/commonjs/locale/translations/es.js +11 -1
- package/lib/commonjs/locale/translations/es.js.map +1 -1
- package/lib/commonjs/locale/translations/fr.js +11 -1
- package/lib/commonjs/locale/translations/fr.js.map +1 -1
- package/lib/commonjs/locale/translations/hi.js +11 -1
- package/lib/commonjs/locale/translations/hi.js.map +1 -1
- package/lib/commonjs/locale/translations/id.js +11 -1
- package/lib/commonjs/locale/translations/id.js.map +1 -1
- package/lib/commonjs/locale/translations/it.js +11 -1
- package/lib/commonjs/locale/translations/it.js.map +1 -1
- package/lib/commonjs/locale/translations/ja.js +11 -1
- package/lib/commonjs/locale/translations/ja.js.map +1 -1
- package/lib/commonjs/locale/translations/pt.js +11 -1
- package/lib/commonjs/locale/translations/pt.js.map +1 -1
- package/lib/commonjs/locale/translations/ru.js +11 -1
- package/lib/commonjs/locale/translations/ru.js.map +1 -1
- package/lib/commonjs/locale/translations/tr.js +11 -1
- package/lib/commonjs/locale/translations/tr.js.map +1 -1
- package/lib/commonjs/locale/translations/zh.js +11 -1
- package/lib/commonjs/locale/translations/zh.js.map +1 -1
- package/lib/commonjs/multi-agent-chat/AvatarHandoff.js +2 -4
- package/lib/commonjs/multi-agent-chat/AvatarHandoff.js.map +1 -1
- package/lib/commonjs/multi-agent-chat/ChatAgentProfile.js +97 -0
- package/lib/commonjs/multi-agent-chat/ChatAgentProfile.js.map +1 -0
- package/lib/commonjs/multi-agent-chat/EditorRail.js +4 -0
- package/lib/commonjs/multi-agent-chat/EditorRail.js.map +1 -1
- package/lib/commonjs/multi-agent-chat/MultiAgentChatBase.js +89 -126
- package/lib/commonjs/multi-agent-chat/MultiAgentChatBase.js.map +1 -1
- package/lib/commonjs/multi-agent-chat/ReplyRow.js +8 -11
- package/lib/commonjs/multi-agent-chat/ReplyRow.js.map +1 -1
- package/lib/commonjs/multi-agent-chat/handoff.js +5 -5
- package/lib/commonjs/multi-agent-chat/handoff.js.map +1 -1
- package/lib/commonjs/project-board/CreateTicketDialog.js +33 -2
- package/lib/commonjs/project-board/CreateTicketDialog.js.map +1 -1
- package/lib/commonjs/project-board/ProjectBoardBase.js +137 -38
- package/lib/commonjs/project-board/ProjectBoardBase.js.map +1 -1
- package/lib/commonjs/project-board/TicketCornerGenieSurface.web.js +34 -28
- package/lib/commonjs/project-board/TicketCornerGenieSurface.web.js.map +1 -1
- package/lib/commonjs/project-board/TicketDetailDialog.js +6 -3
- package/lib/commonjs/project-board/TicketDetailDialog.js.map +1 -1
- package/lib/commonjs/project-board/TicketGenieSurface.js +17 -7
- package/lib/commonjs/project-board/TicketGenieSurface.js.map +1 -1
- package/lib/commonjs/project-board/TicketGenieSurface.web.js +1 -1
- package/lib/commonjs/project-board/TicketGenieSurface.web.js.map +1 -1
- package/lib/commonjs/project-board/TicketPresence.js +125 -0
- package/lib/commonjs/project-board/TicketPresence.js.map +1 -0
- package/lib/commonjs/project-board/TicketTokenChart.js +23 -0
- package/lib/commonjs/project-board/TicketTokenChart.js.map +1 -0
- package/lib/commonjs/project-board/context.js +3 -1
- package/lib/commonjs/project-board/context.js.map +1 -1
- package/lib/commonjs/search/Search.js +12 -3
- package/lib/commonjs/search/Search.js.map +1 -1
- package/lib/commonjs/sidebar/SidebarToolbar.js +28 -14
- package/lib/commonjs/sidebar/SidebarToolbar.js.map +1 -1
- package/lib/commonjs/text-field/TextField.js +13 -7
- package/lib/commonjs/text-field/TextField.js.map +1 -1
- package/lib/module/agent-avatar/AgentAvatar.js +16 -204
- package/lib/module/agent-avatar/AgentAvatar.js.map +1 -1
- package/lib/module/agent-avatar/AgentAvatarProvider.js +65 -0
- package/lib/module/agent-avatar/AgentAvatarProvider.js.map +1 -0
- package/lib/module/agent-avatar/CharacterAvatar.js +208 -0
- package/lib/module/agent-avatar/CharacterAvatar.js.map +1 -0
- package/lib/module/agent-avatar/ProceduralAvatar.js +212 -0
- package/lib/module/agent-avatar/ProceduralAvatar.js.map +1 -0
- package/lib/module/agent-avatar/artwork.js +3 -3
- package/lib/module/agent-avatar/artwork.js.map +1 -1
- package/lib/module/agent-avatar/avatar-color.js +12 -0
- package/lib/module/agent-avatar/avatar-color.js.map +1 -0
- package/lib/module/agent-avatar/character-html.js +19 -0
- package/lib/module/agent-avatar/character-html.js.map +1 -0
- package/lib/module/agent-avatar/character-runtime-module.js +35 -0
- package/lib/module/agent-avatar/character-runtime-module.js.map +1 -0
- package/lib/module/agent-avatar/character-webview.js +14 -0
- package/lib/module/agent-avatar/character-webview.js.map +1 -0
- package/lib/module/agent-avatar/config-character.js +32 -0
- package/lib/module/agent-avatar/config-character.js.map +1 -0
- package/lib/module/agent-avatar/context.js +5 -0
- package/lib/module/agent-avatar/context.js.map +1 -1
- package/lib/module/agent-avatar/index.js +1 -0
- package/lib/module/agent-avatar/index.js.map +1 -1
- package/lib/module/agent-avatar/legacy-contours.js +53 -0
- package/lib/module/agent-avatar/legacy-contours.js.map +1 -0
- package/lib/module/agent-avatar/legacy-recipe.js +104 -0
- package/lib/module/agent-avatar/legacy-recipe.js.map +1 -0
- package/lib/module/agent-avatar/messages.js +2 -1
- package/lib/module/agent-avatar/messages.js.map +1 -1
- package/lib/module/agent-avatar/model.js +2 -0
- package/lib/module/agent-avatar/model.js.map +1 -1
- package/lib/module/agent-creator/AgentCreatorBase.js +248 -22
- package/lib/module/agent-creator/AgentCreatorBase.js.map +1 -1
- package/lib/module/agent-creator/CharacterControls.js +112 -0
- package/lib/module/agent-creator/CharacterControls.js.map +1 -0
- package/lib/module/agent-creator/EmotionPicker.js +52 -19
- package/lib/module/agent-creator/EmotionPicker.js.map +1 -1
- package/lib/module/agent-creator/ShapeArc.js +58 -28
- package/lib/module/agent-creator/ShapeArc.js.map +1 -1
- package/lib/module/agent-creator/ShapeSilhouette.js +57 -0
- package/lib/module/agent-creator/ShapeSilhouette.js.map +1 -0
- package/lib/module/agent-creator/constants.js +47 -0
- package/lib/module/agent-creator/constants.js.map +1 -1
- package/lib/module/agent-creator/messages.js +9 -0
- package/lib/module/agent-creator/messages.js.map +1 -1
- package/lib/module/agent-creator/shared.js +1 -9
- package/lib/module/agent-creator/shared.js.map +1 -1
- package/lib/module/agent-thinking/AgentThinking.js +5 -63
- package/lib/module/agent-thinking/AgentThinking.js.map +1 -1
- package/lib/module/agent-thinking/ThinkingLabel.js +73 -0
- package/lib/module/agent-thinking/ThinkingLabel.js.map +1 -0
- package/lib/module/chart-cards/TokensChartCard.js +20 -5
- package/lib/module/chart-cards/TokensChartCard.js.map +1 -1
- package/lib/module/locale/translations/ar.js +11 -1
- package/lib/module/locale/translations/ar.js.map +1 -1
- package/lib/module/locale/translations/bn.js +11 -1
- package/lib/module/locale/translations/bn.js.map +1 -1
- package/lib/module/locale/translations/ca.js +11 -1
- package/lib/module/locale/translations/ca.js.map +1 -1
- package/lib/module/locale/translations/de.js +11 -1
- package/lib/module/locale/translations/de.js.map +1 -1
- package/lib/module/locale/translations/es.js +11 -1
- package/lib/module/locale/translations/es.js.map +1 -1
- package/lib/module/locale/translations/fr.js +11 -1
- package/lib/module/locale/translations/fr.js.map +1 -1
- package/lib/module/locale/translations/hi.js +11 -1
- package/lib/module/locale/translations/hi.js.map +1 -1
- package/lib/module/locale/translations/id.js +11 -1
- package/lib/module/locale/translations/id.js.map +1 -1
- package/lib/module/locale/translations/it.js +11 -1
- package/lib/module/locale/translations/it.js.map +1 -1
- package/lib/module/locale/translations/ja.js +11 -1
- package/lib/module/locale/translations/ja.js.map +1 -1
- package/lib/module/locale/translations/pt.js +11 -1
- package/lib/module/locale/translations/pt.js.map +1 -1
- package/lib/module/locale/translations/ru.js +11 -1
- package/lib/module/locale/translations/ru.js.map +1 -1
- package/lib/module/locale/translations/tr.js +11 -1
- package/lib/module/locale/translations/tr.js.map +1 -1
- package/lib/module/locale/translations/zh.js +11 -1
- package/lib/module/locale/translations/zh.js.map +1 -1
- package/lib/module/multi-agent-chat/AvatarHandoff.js +3 -5
- package/lib/module/multi-agent-chat/AvatarHandoff.js.map +1 -1
- package/lib/module/multi-agent-chat/ChatAgentProfile.js +94 -0
- package/lib/module/multi-agent-chat/ChatAgentProfile.js.map +1 -0
- package/lib/module/multi-agent-chat/EditorRail.js +4 -0
- package/lib/module/multi-agent-chat/EditorRail.js.map +1 -1
- package/lib/module/multi-agent-chat/MultiAgentChatBase.js +89 -126
- package/lib/module/multi-agent-chat/MultiAgentChatBase.js.map +1 -1
- package/lib/module/multi-agent-chat/ReplyRow.js +9 -12
- package/lib/module/multi-agent-chat/ReplyRow.js.map +1 -1
- package/lib/module/multi-agent-chat/handoff.js +4 -4
- package/lib/module/multi-agent-chat/handoff.js.map +1 -1
- package/lib/module/project-board/CreateTicketDialog.js +33 -2
- package/lib/module/project-board/CreateTicketDialog.js.map +1 -1
- package/lib/module/project-board/ProjectBoardBase.js +138 -39
- package/lib/module/project-board/ProjectBoardBase.js.map +1 -1
- package/lib/module/project-board/TicketCornerGenieSurface.web.js +35 -29
- package/lib/module/project-board/TicketCornerGenieSurface.web.js.map +1 -1
- package/lib/module/project-board/TicketDetailDialog.js +7 -4
- package/lib/module/project-board/TicketDetailDialog.js.map +1 -1
- package/lib/module/project-board/TicketGenieSurface.js +17 -7
- package/lib/module/project-board/TicketGenieSurface.js.map +1 -1
- package/lib/module/project-board/TicketGenieSurface.web.js +1 -1
- package/lib/module/project-board/TicketGenieSurface.web.js.map +1 -1
- package/lib/module/project-board/TicketPresence.js +119 -0
- package/lib/module/project-board/TicketPresence.js.map +1 -0
- package/lib/module/project-board/TicketTokenChart.js +20 -0
- package/lib/module/project-board/TicketTokenChart.js.map +1 -0
- package/lib/module/project-board/context.js +2 -0
- package/lib/module/project-board/context.js.map +1 -1
- package/lib/module/search/Search.js +12 -3
- package/lib/module/search/Search.js.map +1 -1
- package/lib/module/sidebar/SidebarToolbar.js +29 -15
- package/lib/module/sidebar/SidebarToolbar.js.map +1 -1
- package/lib/module/text-field/TextField.js +13 -7
- package/lib/module/text-field/TextField.js.map +1 -1
- package/lib/typescript/commonjs/agent-avatar/AgentAvatar.d.ts +2 -2
- package/lib/typescript/commonjs/agent-avatar/AgentAvatar.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-avatar/AgentAvatarProvider.d.ts +4 -0
- package/lib/typescript/commonjs/agent-avatar/AgentAvatarProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/agent-avatar/CharacterAvatar.d.ts +4 -0
- package/lib/typescript/commonjs/agent-avatar/CharacterAvatar.d.ts.map +1 -0
- package/lib/typescript/commonjs/agent-avatar/ProceduralAvatar.d.ts +6 -0
- package/lib/typescript/commonjs/agent-avatar/ProceduralAvatar.d.ts.map +1 -0
- package/lib/typescript/commonjs/agent-avatar/artwork.d.ts +2 -1
- package/lib/typescript/commonjs/agent-avatar/artwork.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-avatar/avatar-color.d.ts +3 -0
- package/lib/typescript/commonjs/agent-avatar/avatar-color.d.ts.map +1 -0
- package/lib/typescript/commonjs/agent-avatar/character-html.d.ts +4 -0
- package/lib/typescript/commonjs/agent-avatar/character-html.d.ts.map +1 -0
- package/lib/typescript/commonjs/agent-avatar/character-runtime-module.d.ts +2 -0
- package/lib/typescript/commonjs/agent-avatar/character-runtime-module.d.ts.map +1 -0
- package/lib/typescript/commonjs/agent-avatar/character-webview.d.ts +24 -0
- package/lib/typescript/commonjs/agent-avatar/character-webview.d.ts.map +1 -0
- package/lib/typescript/commonjs/agent-avatar/config-character.d.ts +11 -0
- package/lib/typescript/commonjs/agent-avatar/config-character.d.ts.map +1 -0
- package/lib/typescript/commonjs/agent-avatar/context.d.ts +15 -0
- package/lib/typescript/commonjs/agent-avatar/context.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-avatar/index.d.ts +3 -1
- package/lib/typescript/commonjs/agent-avatar/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-avatar/legacy-contours.d.ts +5 -0
- package/lib/typescript/commonjs/agent-avatar/legacy-contours.d.ts.map +1 -0
- package/lib/typescript/commonjs/agent-avatar/legacy-recipe.d.ts +40 -0
- package/lib/typescript/commonjs/agent-avatar/legacy-recipe.d.ts.map +1 -0
- package/lib/typescript/commonjs/agent-avatar/messages.d.ts +1 -0
- package/lib/typescript/commonjs/agent-avatar/messages.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-avatar/model.d.ts +3 -0
- package/lib/typescript/commonjs/agent-avatar/model.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-avatar/types.d.ts +10 -1
- package/lib/typescript/commonjs/agent-avatar/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-creator/AgentCreatorBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-creator/CharacterControls.d.ts +8 -0
- package/lib/typescript/commonjs/agent-creator/CharacterControls.d.ts.map +1 -0
- package/lib/typescript/commonjs/agent-creator/EmotionPicker.d.ts +12 -1
- package/lib/typescript/commonjs/agent-creator/EmotionPicker.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-creator/ShapeArc.d.ts +11 -2
- package/lib/typescript/commonjs/agent-creator/ShapeArc.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-creator/ShapeSilhouette.d.ts +6 -0
- package/lib/typescript/commonjs/agent-creator/ShapeSilhouette.d.ts.map +1 -0
- package/lib/typescript/commonjs/agent-creator/constants.d.ts +44 -0
- package/lib/typescript/commonjs/agent-creator/constants.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-creator/context.d.ts +9 -0
- package/lib/typescript/commonjs/agent-creator/context.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-creator/messages.d.ts +10 -0
- package/lib/typescript/commonjs/agent-creator/messages.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-creator/shared.d.ts +1 -1
- package/lib/typescript/commonjs/agent-creator/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-thinking/AgentThinking.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-thinking/ThinkingLabel.d.ts +7 -0
- package/lib/typescript/commonjs/agent-thinking/ThinkingLabel.d.ts.map +1 -0
- package/lib/typescript/commonjs/chart-cards/TokensChartCard.d.ts +3 -1
- package/lib/typescript/commonjs/chart-cards/TokensChartCard.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/ar.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/bn.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/ca.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/de.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/es.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/fr.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/hi.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/id.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/it.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/ja.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/pt.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/ru.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/tr.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/zh.d.ts.map +1 -1
- package/lib/typescript/commonjs/multi-agent-chat/AvatarHandoff.d.ts.map +1 -1
- package/lib/typescript/commonjs/multi-agent-chat/ChatAgentProfile.d.ts +11 -0
- package/lib/typescript/commonjs/multi-agent-chat/ChatAgentProfile.d.ts.map +1 -0
- package/lib/typescript/commonjs/multi-agent-chat/EditorRail.d.ts.map +1 -1
- package/lib/typescript/commonjs/multi-agent-chat/MultiAgentChatBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/multi-agent-chat/ReplyRow.d.ts.map +1 -1
- package/lib/typescript/commonjs/multi-agent-chat/handoff.d.ts +2 -2
- package/lib/typescript/commonjs/multi-agent-chat/handoff.d.ts.map +1 -1
- package/lib/typescript/commonjs/project-board/CreateTicketDialog.d.ts.map +1 -1
- package/lib/typescript/commonjs/project-board/ProjectBoardBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/project-board/TicketCornerGenieSurface.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/project-board/TicketDetailDialog.d.ts.map +1 -1
- package/lib/typescript/commonjs/project-board/TicketGenieSurface.d.ts.map +1 -1
- package/lib/typescript/commonjs/project-board/TicketPresence.d.ts +17 -0
- package/lib/typescript/commonjs/project-board/TicketPresence.d.ts.map +1 -0
- package/lib/typescript/commonjs/project-board/TicketTokenChart.d.ts +5 -0
- package/lib/typescript/commonjs/project-board/TicketTokenChart.d.ts.map +1 -0
- package/lib/typescript/commonjs/project-board/context.d.ts +2 -0
- package/lib/typescript/commonjs/project-board/context.d.ts.map +1 -1
- package/lib/typescript/commonjs/search/Search.d.ts.map +1 -1
- package/lib/typescript/commonjs/sidebar/SidebarToolbar.d.ts.map +1 -1
- package/lib/typescript/commonjs/text-field/TextField.d.ts.map +1 -1
- package/lib/typescript/module/agent-avatar/AgentAvatar.d.ts +2 -2
- package/lib/typescript/module/agent-avatar/AgentAvatar.d.ts.map +1 -1
- package/lib/typescript/module/agent-avatar/AgentAvatarProvider.d.ts +4 -0
- package/lib/typescript/module/agent-avatar/AgentAvatarProvider.d.ts.map +1 -0
- package/lib/typescript/module/agent-avatar/CharacterAvatar.d.ts +4 -0
- package/lib/typescript/module/agent-avatar/CharacterAvatar.d.ts.map +1 -0
- package/lib/typescript/module/agent-avatar/ProceduralAvatar.d.ts +6 -0
- package/lib/typescript/module/agent-avatar/ProceduralAvatar.d.ts.map +1 -0
- package/lib/typescript/module/agent-avatar/artwork.d.ts +2 -1
- package/lib/typescript/module/agent-avatar/artwork.d.ts.map +1 -1
- package/lib/typescript/module/agent-avatar/avatar-color.d.ts +3 -0
- package/lib/typescript/module/agent-avatar/avatar-color.d.ts.map +1 -0
- package/lib/typescript/module/agent-avatar/character-html.d.ts +4 -0
- package/lib/typescript/module/agent-avatar/character-html.d.ts.map +1 -0
- package/lib/typescript/module/agent-avatar/character-runtime-module.d.ts +2 -0
- package/lib/typescript/module/agent-avatar/character-runtime-module.d.ts.map +1 -0
- package/lib/typescript/module/agent-avatar/character-webview.d.ts +24 -0
- package/lib/typescript/module/agent-avatar/character-webview.d.ts.map +1 -0
- package/lib/typescript/module/agent-avatar/config-character.d.ts +11 -0
- package/lib/typescript/module/agent-avatar/config-character.d.ts.map +1 -0
- package/lib/typescript/module/agent-avatar/context.d.ts +15 -0
- package/lib/typescript/module/agent-avatar/context.d.ts.map +1 -1
- package/lib/typescript/module/agent-avatar/index.d.ts +3 -1
- package/lib/typescript/module/agent-avatar/index.d.ts.map +1 -1
- package/lib/typescript/module/agent-avatar/legacy-contours.d.ts +5 -0
- package/lib/typescript/module/agent-avatar/legacy-contours.d.ts.map +1 -0
- package/lib/typescript/module/agent-avatar/legacy-recipe.d.ts +40 -0
- package/lib/typescript/module/agent-avatar/legacy-recipe.d.ts.map +1 -0
- package/lib/typescript/module/agent-avatar/messages.d.ts +1 -0
- package/lib/typescript/module/agent-avatar/messages.d.ts.map +1 -1
- package/lib/typescript/module/agent-avatar/model.d.ts +3 -0
- package/lib/typescript/module/agent-avatar/model.d.ts.map +1 -1
- package/lib/typescript/module/agent-avatar/types.d.ts +10 -1
- package/lib/typescript/module/agent-avatar/types.d.ts.map +1 -1
- package/lib/typescript/module/agent-creator/AgentCreatorBase.d.ts.map +1 -1
- package/lib/typescript/module/agent-creator/CharacterControls.d.ts +8 -0
- package/lib/typescript/module/agent-creator/CharacterControls.d.ts.map +1 -0
- package/lib/typescript/module/agent-creator/EmotionPicker.d.ts +12 -1
- package/lib/typescript/module/agent-creator/EmotionPicker.d.ts.map +1 -1
- package/lib/typescript/module/agent-creator/ShapeArc.d.ts +11 -2
- package/lib/typescript/module/agent-creator/ShapeArc.d.ts.map +1 -1
- package/lib/typescript/module/agent-creator/ShapeSilhouette.d.ts +6 -0
- package/lib/typescript/module/agent-creator/ShapeSilhouette.d.ts.map +1 -0
- package/lib/typescript/module/agent-creator/constants.d.ts +44 -0
- package/lib/typescript/module/agent-creator/constants.d.ts.map +1 -1
- package/lib/typescript/module/agent-creator/context.d.ts +9 -0
- package/lib/typescript/module/agent-creator/context.d.ts.map +1 -1
- package/lib/typescript/module/agent-creator/messages.d.ts +10 -0
- package/lib/typescript/module/agent-creator/messages.d.ts.map +1 -1
- package/lib/typescript/module/agent-creator/shared.d.ts +1 -1
- package/lib/typescript/module/agent-creator/shared.d.ts.map +1 -1
- package/lib/typescript/module/agent-thinking/AgentThinking.d.ts.map +1 -1
- package/lib/typescript/module/agent-thinking/ThinkingLabel.d.ts +7 -0
- package/lib/typescript/module/agent-thinking/ThinkingLabel.d.ts.map +1 -0
- package/lib/typescript/module/chart-cards/TokensChartCard.d.ts +3 -1
- package/lib/typescript/module/chart-cards/TokensChartCard.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/ar.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/bn.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/ca.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/de.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/es.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/fr.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/hi.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/id.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/it.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/ja.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/pt.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/ru.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/tr.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/zh.d.ts.map +1 -1
- package/lib/typescript/module/multi-agent-chat/AvatarHandoff.d.ts.map +1 -1
- package/lib/typescript/module/multi-agent-chat/ChatAgentProfile.d.ts +11 -0
- package/lib/typescript/module/multi-agent-chat/ChatAgentProfile.d.ts.map +1 -0
- package/lib/typescript/module/multi-agent-chat/EditorRail.d.ts.map +1 -1
- package/lib/typescript/module/multi-agent-chat/MultiAgentChatBase.d.ts.map +1 -1
- package/lib/typescript/module/multi-agent-chat/ReplyRow.d.ts.map +1 -1
- package/lib/typescript/module/multi-agent-chat/handoff.d.ts +2 -2
- package/lib/typescript/module/multi-agent-chat/handoff.d.ts.map +1 -1
- package/lib/typescript/module/project-board/CreateTicketDialog.d.ts.map +1 -1
- package/lib/typescript/module/project-board/ProjectBoardBase.d.ts.map +1 -1
- package/lib/typescript/module/project-board/TicketCornerGenieSurface.web.d.ts.map +1 -1
- package/lib/typescript/module/project-board/TicketDetailDialog.d.ts.map +1 -1
- package/lib/typescript/module/project-board/TicketGenieSurface.d.ts.map +1 -1
- package/lib/typescript/module/project-board/TicketPresence.d.ts +17 -0
- package/lib/typescript/module/project-board/TicketPresence.d.ts.map +1 -0
- package/lib/typescript/module/project-board/TicketTokenChart.d.ts +5 -0
- package/lib/typescript/module/project-board/TicketTokenChart.d.ts.map +1 -0
- package/lib/typescript/module/project-board/context.d.ts +2 -0
- package/lib/typescript/module/project-board/context.d.ts.map +1 -1
- package/lib/typescript/module/search/Search.d.ts.map +1 -1
- package/lib/typescript/module/sidebar/SidebarToolbar.d.ts.map +1 -1
- package/lib/typescript/module/text-field/TextField.d.ts.map +1 -1
- package/package.json +8 -3
- package/src/agent-avatar/AgentAvatar.tsx +16 -296
- package/src/agent-avatar/AgentAvatarProvider.tsx +79 -0
- package/src/agent-avatar/CharacterAvatar.tsx +260 -0
- package/src/agent-avatar/ProceduralAvatar.tsx +303 -0
- package/src/agent-avatar/artwork.ts +3 -3
- package/src/agent-avatar/avatar-color.ts +17 -0
- package/src/agent-avatar/character-html.ts +21 -0
- package/src/agent-avatar/character-runtime-module.ts +37 -0
- package/src/agent-avatar/character-webview.ts +24 -0
- package/src/agent-avatar/config-character.ts +40 -0
- package/src/agent-avatar/context.ts +17 -0
- package/src/agent-avatar/index.ts +4 -1
- package/src/agent-avatar/legacy-contours.ts +76 -0
- package/src/agent-avatar/legacy-recipe.ts +123 -0
- package/src/agent-avatar/messages.ts +1 -0
- package/src/agent-avatar/model.ts +5 -0
- package/src/agent-avatar/types.ts +12 -1
- package/src/agent-creator/AgentCreatorBase.tsx +338 -39
- package/src/agent-creator/CharacterControls.tsx +150 -0
- package/src/agent-creator/EmotionPicker.tsx +43 -21
- package/src/agent-creator/ShapeArc.tsx +83 -29
- package/src/agent-creator/ShapeSilhouette.tsx +65 -0
- package/src/agent-creator/constants.ts +30 -0
- package/src/agent-creator/messages.ts +19 -0
- package/src/agent-creator/shared.ts +1 -15
- package/src/agent-thinking/AgentThinking.tsx +7 -70
- package/src/agent-thinking/ThinkingLabel.tsx +74 -0
- package/src/chart-cards/TokensChartCard.tsx +10 -6
- package/src/locale/translations/ar.ts +10 -1
- package/src/locale/translations/bn.ts +10 -1
- package/src/locale/translations/ca.ts +10 -1
- package/src/locale/translations/de.ts +10 -1
- package/src/locale/translations/es.ts +10 -1
- package/src/locale/translations/fr.ts +10 -1
- package/src/locale/translations/hi.ts +10 -1
- package/src/locale/translations/id.ts +10 -1
- package/src/locale/translations/it.ts +10 -1
- package/src/locale/translations/ja.ts +10 -1
- package/src/locale/translations/pt.ts +10 -1
- package/src/locale/translations/ru.ts +10 -1
- package/src/locale/translations/tr.ts +10 -1
- package/src/locale/translations/zh.ts +10 -1
- package/src/multi-agent-chat/AvatarHandoff.tsx +2 -5
- package/src/multi-agent-chat/ChatAgentProfile.tsx +116 -0
- package/src/multi-agent-chat/EditorRail.tsx +2 -0
- package/src/multi-agent-chat/MultiAgentChatBase.tsx +123 -175
- package/src/multi-agent-chat/ReplyRow.tsx +10 -9
- package/src/multi-agent-chat/handoff.ts +4 -4
- package/src/project-board/CreateTicketDialog.tsx +28 -4
- package/src/project-board/ProjectBoardBase.tsx +115 -21
- package/src/project-board/TicketCornerGenieSurface.web.tsx +11 -6
- package/src/project-board/TicketDetailDialog.tsx +5 -4
- package/src/project-board/TicketGenieSurface.tsx +9 -0
- package/src/project-board/TicketGenieSurface.web.tsx +1 -1
- package/src/project-board/TicketPresence.tsx +137 -0
- package/src/project-board/TicketTokenChart.tsx +14 -0
- package/src/project-board/context.ts +2 -0
- package/src/search/Search.tsx +6 -5
- package/src/sidebar/SidebarToolbar.tsx +27 -15
- package/src/text-field/TextField.tsx +12 -7
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import {
|
|
2
|
+
memo,
|
|
3
|
+
useContext,
|
|
4
|
+
useEffect,
|
|
5
|
+
useLayoutEffect,
|
|
6
|
+
useRef,
|
|
7
|
+
useState,
|
|
8
|
+
} from 'react';
|
|
9
|
+
import {
|
|
10
|
+
AccessibilityInfo,
|
|
11
|
+
AppState,
|
|
12
|
+
PixelRatio,
|
|
13
|
+
Platform,
|
|
14
|
+
type View,
|
|
15
|
+
} from 'react-native';
|
|
16
|
+
import { useReducedMotion } from 'react-native-reanimated';
|
|
17
|
+
import { useMessages } from '../locale/messages';
|
|
18
|
+
import { StyledView } from '../styles/styled-primitives';
|
|
19
|
+
import { drawAvatar } from './artwork';
|
|
20
|
+
import { advanceAttention, createAttention } from './attention';
|
|
21
|
+
import { advanceBlink, createBlink } from './blink';
|
|
22
|
+
import { AvatarDrawingObserver } from './context';
|
|
23
|
+
import { DrawingContext } from './drawing';
|
|
24
|
+
import { ENTRANCE_SECONDS } from './entrance';
|
|
25
|
+
import {
|
|
26
|
+
easeFace,
|
|
27
|
+
expressionRig,
|
|
28
|
+
faceAtSize,
|
|
29
|
+
gazeAngles,
|
|
30
|
+
type FaceRig,
|
|
31
|
+
} from './face';
|
|
32
|
+
import { AGENT_AVATAR_MESSAGES } from './messages';
|
|
33
|
+
import type { ShapeMorph } from './shape-morph';
|
|
34
|
+
import { Drawing } from './SvgDrawing';
|
|
35
|
+
import type { AgentAvatarProps } from './types';
|
|
36
|
+
import { advanceWander, createWander } from './wander';
|
|
37
|
+
import { WORKING_SECONDS } from './working';
|
|
38
|
+
|
|
39
|
+
const TAU = Math.PI * 2;
|
|
40
|
+
const randomSeed = () => {
|
|
41
|
+
if (globalThis.crypto?.getRandomValues)
|
|
42
|
+
return globalThis.crypto.getRandomValues(new Uint32Array(1))[0]!;
|
|
43
|
+
return Math.floor(Math.random() * 4294967296) >>> 0;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/** Animated procedural artwork; shared geometry, face rig and materials across platforms. */
|
|
47
|
+
function AgentAvatarComponent({
|
|
48
|
+
config,
|
|
49
|
+
size = 64,
|
|
50
|
+
paused = false,
|
|
51
|
+
label,
|
|
52
|
+
locale,
|
|
53
|
+
entranceKey,
|
|
54
|
+
workingKey,
|
|
55
|
+
workingCycles = 1,
|
|
56
|
+
className,
|
|
57
|
+
style,
|
|
58
|
+
accessibilityLabel,
|
|
59
|
+
testID,
|
|
60
|
+
}: AgentAvatarProps) {
|
|
61
|
+
const { messages } = useMessages(AGENT_AVATAR_MESSAGES, locale);
|
|
62
|
+
const initialReduced = useReducedMotion();
|
|
63
|
+
const [reduced, setReduced] = useState(initialReduced);
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
const subscription = AccessibilityInfo.addEventListener(
|
|
66
|
+
'reduceMotionChanged',
|
|
67
|
+
setReduced,
|
|
68
|
+
);
|
|
69
|
+
const media =
|
|
70
|
+
Platform.OS === 'web' && typeof matchMedia !== 'undefined'
|
|
71
|
+
? matchMedia('(prefers-reduced-motion: reduce)')
|
|
72
|
+
: undefined;
|
|
73
|
+
const change = () => setReduced(media!.matches);
|
|
74
|
+
media?.addEventListener('change', change);
|
|
75
|
+
if (media) change();
|
|
76
|
+
return () => {
|
|
77
|
+
subscription?.remove?.();
|
|
78
|
+
media?.removeEventListener('change', change);
|
|
79
|
+
};
|
|
80
|
+
}, []);
|
|
81
|
+
const backingSize = Math.round(size * Math.min(PixelRatio.get() || 1, 2));
|
|
82
|
+
const root = useRef<View>(null);
|
|
83
|
+
const randomized = useRef(false);
|
|
84
|
+
const state = useRef<{
|
|
85
|
+
phase: number;
|
|
86
|
+
blink: ReturnType<typeof createBlink>;
|
|
87
|
+
wander: ReturnType<typeof createWander>;
|
|
88
|
+
attention: ReturnType<typeof createAttention>;
|
|
89
|
+
shapeMorph: ShapeMorph;
|
|
90
|
+
expression?: FaceRig;
|
|
91
|
+
face?: FaceRig;
|
|
92
|
+
velocity: Partial<FaceRig>;
|
|
93
|
+
gaze?: [number, number];
|
|
94
|
+
entrance: { key?: number; elapsed: number };
|
|
95
|
+
working: { key?: number; elapsed: number };
|
|
96
|
+
} | null>(null);
|
|
97
|
+
if (!state.current) {
|
|
98
|
+
const seed = config.seed >>> 0;
|
|
99
|
+
state.current = {
|
|
100
|
+
phase: (seed / 4294967296) * TAU,
|
|
101
|
+
blink: createBlink(seed),
|
|
102
|
+
wander: createWander(seed ^ config.seed, config.family === 'fold'),
|
|
103
|
+
attention: createAttention(seed ^ config.seed),
|
|
104
|
+
shapeMorph: { started: 0, active: false },
|
|
105
|
+
velocity: {},
|
|
106
|
+
entrance: { elapsed: ENTRANCE_SECONDS },
|
|
107
|
+
working: { elapsed: WORKING_SECONDS },
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
const renderDrawing = () => {
|
|
111
|
+
const context = new DrawingContext(),
|
|
112
|
+
s = state.current!;
|
|
113
|
+
const appearance = faceAtSize(config, size),
|
|
114
|
+
target = expressionRig(appearance);
|
|
115
|
+
drawAvatar(
|
|
116
|
+
context,
|
|
117
|
+
appearance,
|
|
118
|
+
s.phase,
|
|
119
|
+
s.face ?? target,
|
|
120
|
+
s.gaze ?? gazeAngles(appearance, s.phase, target),
|
|
121
|
+
size,
|
|
122
|
+
s.entrance.elapsed,
|
|
123
|
+
s.working.elapsed,
|
|
124
|
+
undefined,
|
|
125
|
+
Math.max(1, Math.floor(workingCycles)),
|
|
126
|
+
backingSize,
|
|
127
|
+
);
|
|
128
|
+
return context;
|
|
129
|
+
};
|
|
130
|
+
const [drawing, setDrawing] = useState(renderDrawing);
|
|
131
|
+
const observeDrawing = useContext(AvatarDrawingObserver);
|
|
132
|
+
useLayoutEffect(() => {
|
|
133
|
+
observeDrawing?.(drawing);
|
|
134
|
+
}, [observeDrawing, drawing]);
|
|
135
|
+
useEffect(() => {
|
|
136
|
+
const s = state.current!,
|
|
137
|
+
cycles = Math.max(1, Math.floor(workingCycles));
|
|
138
|
+
if (!randomized.current) {
|
|
139
|
+
s.wander = createWander(
|
|
140
|
+
randomSeed() ^ config.seed,
|
|
141
|
+
config.family === 'fold',
|
|
142
|
+
);
|
|
143
|
+
const seed = randomSeed();
|
|
144
|
+
s.phase = (seed / 4294967296) * TAU;
|
|
145
|
+
s.blink = createBlink(seed);
|
|
146
|
+
s.attention = createAttention(randomSeed() ^ config.seed);
|
|
147
|
+
randomized.current = true;
|
|
148
|
+
}
|
|
149
|
+
const duration = WORKING_SECONDS * cycles,
|
|
150
|
+
appearance = faceAtSize(config, size),
|
|
151
|
+
target = expressionRig(appearance);
|
|
152
|
+
if (s.entrance.key !== entranceKey)
|
|
153
|
+
s.entrance = {
|
|
154
|
+
key: entranceKey,
|
|
155
|
+
elapsed: entranceKey === undefined || paused ? ENTRANCE_SECONDS : 0,
|
|
156
|
+
};
|
|
157
|
+
if (s.working.key !== workingKey) {
|
|
158
|
+
s.working = {
|
|
159
|
+
key: workingKey,
|
|
160
|
+
elapsed: workingKey === undefined || paused ? duration : 0,
|
|
161
|
+
};
|
|
162
|
+
if (workingKey !== undefined) s.entrance.elapsed = ENTRANCE_SECONDS;
|
|
163
|
+
}
|
|
164
|
+
if (config.idle || workingKey === undefined) s.working.elapsed = duration;
|
|
165
|
+
s.expression ??= s.face ?? target;
|
|
166
|
+
s.face ??= target;
|
|
167
|
+
s.gaze ??= gazeAngles(appearance, s.phase, target, s.wander.point);
|
|
168
|
+
const frozen = paused || reduced || config.motion === 0;
|
|
169
|
+
if (reduced || config.motion === 0) {
|
|
170
|
+
s.entrance.elapsed = ENTRANCE_SECONDS;
|
|
171
|
+
s.working.elapsed = duration;
|
|
172
|
+
}
|
|
173
|
+
if (frozen) {
|
|
174
|
+
s.shapeMorph = { started: 0, active: false };
|
|
175
|
+
s.face = target;
|
|
176
|
+
s.expression = target;
|
|
177
|
+
s.velocity = {};
|
|
178
|
+
if (!paused || config.lookAt !== 'wander')
|
|
179
|
+
s.gaze = gazeAngles(appearance, s.phase, target, s.wander.point);
|
|
180
|
+
}
|
|
181
|
+
const draw = () => {
|
|
182
|
+
const context = new DrawingContext();
|
|
183
|
+
drawAvatar(
|
|
184
|
+
context,
|
|
185
|
+
appearance,
|
|
186
|
+
s.phase,
|
|
187
|
+
s.face!,
|
|
188
|
+
s.gaze!,
|
|
189
|
+
size,
|
|
190
|
+
s.entrance.elapsed,
|
|
191
|
+
s.working.elapsed,
|
|
192
|
+
frozen ? undefined : s.shapeMorph,
|
|
193
|
+
cycles,
|
|
194
|
+
backingSize,
|
|
195
|
+
);
|
|
196
|
+
setDrawing(context);
|
|
197
|
+
};
|
|
198
|
+
let frame = 0,
|
|
199
|
+
last = 0,
|
|
200
|
+
visible = true,
|
|
201
|
+
active = AppState.currentState !== 'background',
|
|
202
|
+
transitioning = true;
|
|
203
|
+
const tick = (now: number) => {
|
|
204
|
+
if (!last) last = now;
|
|
205
|
+
if (now - last >= (transitioning ? 16 : 32)) {
|
|
206
|
+
if (visible && active) {
|
|
207
|
+
const milliseconds = Math.min(now - last, 64),
|
|
208
|
+
seconds = milliseconds / 1000;
|
|
209
|
+
s.entrance.elapsed = Math.min(
|
|
210
|
+
ENTRANCE_SECONDS,
|
|
211
|
+
s.entrance.elapsed + seconds,
|
|
212
|
+
);
|
|
213
|
+
s.working.elapsed = Math.min(duration, s.working.elapsed + seconds);
|
|
214
|
+
const base = easeFace(
|
|
215
|
+
s.expression ?? target,
|
|
216
|
+
target,
|
|
217
|
+
s.velocity,
|
|
218
|
+
seconds,
|
|
219
|
+
);
|
|
220
|
+
s.expression = base;
|
|
221
|
+
transitioning =
|
|
222
|
+
(Object.keys(target) as (keyof FaceRig)[]).some(
|
|
223
|
+
(key) => base[key] !== target[key],
|
|
224
|
+
) || s.shapeMorph.active;
|
|
225
|
+
s.face =
|
|
226
|
+
config.family === 'fold' || base.smile > 0.2
|
|
227
|
+
? advanceAttention(
|
|
228
|
+
s.attention,
|
|
229
|
+
(seconds * 8) / config.duration,
|
|
230
|
+
base,
|
|
231
|
+
appearance,
|
|
232
|
+
)
|
|
233
|
+
: base;
|
|
234
|
+
s.face.blink = config.idle ? 1 : advanceBlink(s.blink, seconds);
|
|
235
|
+
transitioning ||= s.blink.blinking;
|
|
236
|
+
s.phase = (s.phase + (seconds * TAU) / config.duration) % TAU;
|
|
237
|
+
if (!config.idle && config.lookAt === 'wander')
|
|
238
|
+
advanceWander(
|
|
239
|
+
s.wander,
|
|
240
|
+
(seconds * 8) / config.duration,
|
|
241
|
+
config.family === 'fold',
|
|
242
|
+
);
|
|
243
|
+
const aim = gazeAngles(appearance, s.phase, s.face, s.wander.point),
|
|
244
|
+
ease = 1 - Math.exp(-milliseconds / 85);
|
|
245
|
+
s.gaze = [
|
|
246
|
+
s.gaze![0] + (aim[0] - s.gaze![0]) * ease,
|
|
247
|
+
s.gaze![1] + (aim[1] - s.gaze![1]) * ease,
|
|
248
|
+
];
|
|
249
|
+
draw();
|
|
250
|
+
}
|
|
251
|
+
last = now;
|
|
252
|
+
}
|
|
253
|
+
frame = requestAnimationFrame(tick);
|
|
254
|
+
};
|
|
255
|
+
const subscription = AppState.addEventListener('change', (next) => {
|
|
256
|
+
active = next === 'active';
|
|
257
|
+
last = 0;
|
|
258
|
+
});
|
|
259
|
+
let observer: IntersectionObserver | undefined;
|
|
260
|
+
if (
|
|
261
|
+
Platform.OS === 'web' &&
|
|
262
|
+
typeof IntersectionObserver !== 'undefined' &&
|
|
263
|
+
root.current instanceof Element
|
|
264
|
+
) {
|
|
265
|
+
observer = new IntersectionObserver((entries) => {
|
|
266
|
+
visible = entries[0]?.isIntersecting ?? true;
|
|
267
|
+
});
|
|
268
|
+
observer.observe(root.current);
|
|
269
|
+
}
|
|
270
|
+
draw();
|
|
271
|
+
if (!frozen) frame = requestAnimationFrame(tick);
|
|
272
|
+
return () => {
|
|
273
|
+
cancelAnimationFrame(frame);
|
|
274
|
+
subscription?.remove?.();
|
|
275
|
+
observer?.disconnect();
|
|
276
|
+
};
|
|
277
|
+
}, [
|
|
278
|
+
config,
|
|
279
|
+
size,
|
|
280
|
+
backingSize,
|
|
281
|
+
paused,
|
|
282
|
+
reduced,
|
|
283
|
+
entranceKey,
|
|
284
|
+
workingKey,
|
|
285
|
+
workingCycles,
|
|
286
|
+
]);
|
|
287
|
+
return (
|
|
288
|
+
<StyledView
|
|
289
|
+
ref={root}
|
|
290
|
+
className={className}
|
|
291
|
+
style={[{ width: size, height: size, maxWidth: '100%' }, style]}
|
|
292
|
+
accessible
|
|
293
|
+
accessibilityRole="image"
|
|
294
|
+
accessibilityLabel={accessibilityLabel ?? label ?? messages.label}
|
|
295
|
+
testID={testID}
|
|
296
|
+
>
|
|
297
|
+
<Drawing context={drawing} size={size} />
|
|
298
|
+
</StyledView>
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export const ProceduralAvatar = memo(AgentAvatarComponent);
|
|
303
|
+
ProceduralAvatar.displayName = 'AgentAvatar';
|
|
@@ -6,7 +6,7 @@ import type { AvatarConfig } from './model';
|
|
|
6
6
|
import type { ShapeMorph } from './shape-morph';
|
|
7
7
|
import { WORKING_SECONDS, workingPose } from './working';
|
|
8
8
|
const TAU = Math.PI * 2;
|
|
9
|
-
function
|
|
9
|
+
export function avatarSilhouette(c: AvatarConfig, phase: number) {
|
|
10
10
|
const path = new DrawingPath();
|
|
11
11
|
if (c.family === 'alien') {
|
|
12
12
|
const sx =
|
|
@@ -123,7 +123,7 @@ export function drawAvatar(
|
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
125
|
ctx.save();
|
|
126
|
-
ctx.clip(
|
|
126
|
+
ctx.clip(avatarSilhouette(c, phase));
|
|
127
127
|
const color = (offset: number, light: number, alpha = 1) =>
|
|
128
128
|
`hsla(${c.hue + offset},${c.saturation}%,${light}%,${alpha})`;
|
|
129
129
|
ctx.fillStyle = color(0, c.material === 'solid' ? 55 : 58);
|
|
@@ -186,7 +186,7 @@ export function drawAvatar(
|
|
|
186
186
|
ctx.restore();
|
|
187
187
|
if (c.face) {
|
|
188
188
|
ctx.save();
|
|
189
|
-
ctx.clip(
|
|
189
|
+
ctx.clip(avatarSilhouette(c, phase));
|
|
190
190
|
drawFace(ctx, c, phase, rig, gaze, cssSize);
|
|
191
191
|
ctx.restore();
|
|
192
192
|
if (c.idle) drawSleepMarks(ctx, c, phase, gaze);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AvatarConfig } from './model';
|
|
2
|
+
|
|
3
|
+
export function avatarHex(
|
|
4
|
+
c: Pick<AvatarConfig, 'hue' | 'saturation' | 'lightness'>,
|
|
5
|
+
) {
|
|
6
|
+
const light = (c.lightness ?? 76) / 100,
|
|
7
|
+
a = (c.saturation / 100) * Math.min(light, 1 - light);
|
|
8
|
+
const channel = (n: number) => {
|
|
9
|
+
const k = (n + c.hue / 30) % 12;
|
|
10
|
+
return Math.round(
|
|
11
|
+
255 * (light - a * Math.max(-1, Math.min(k - 3, 9 - k, 1))),
|
|
12
|
+
)
|
|
13
|
+
.toString(16)
|
|
14
|
+
.padStart(2, '0');
|
|
15
|
+
};
|
|
16
|
+
return `#${channel(0)}${channel(8)}${channel(4)}`;
|
|
17
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Escape script delimiters in saved recipes; never interpolate appearance text as HTML. */
|
|
2
|
+
export const scriptJson = (value: unknown) =>
|
|
3
|
+
JSON.stringify(value)
|
|
4
|
+
.replace(/</g, '\\u003c')
|
|
5
|
+
.replace(/\u2028/g, '\\u2028')
|
|
6
|
+
.replace(/\u2029/g, '\\u2029');
|
|
7
|
+
|
|
8
|
+
export function characterHtml(runtimeUrl: string, props: unknown) {
|
|
9
|
+
return `<!doctype html><html><head><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"><style>html,body{margin:0;width:100%;height:100%;overflow:hidden;background:transparent}canvas{display:block;width:100%;height:100%;touch-action:none}</style></head><body><canvas id="avatar"></canvas><script type="module">
|
|
10
|
+
let controller, latest=${scriptJson(props)};
|
|
11
|
+
const report = type => window.ReactNativeWebView.postMessage(type);
|
|
12
|
+
window.updateCharacter = value => { latest=value; try { controller?.update(value); } catch { report('error'); } };
|
|
13
|
+
try {
|
|
14
|
+
const {createAvatar}=await import(${scriptJson(runtimeUrl)});
|
|
15
|
+
controller=await createAvatar(document.querySelector('canvas'),latest,{onReady:()=>report('ready'),onError:()=>report('error'),onCapabilities:value=>report('capabilities:'+JSON.stringify(value))});
|
|
16
|
+
controller.update(latest);
|
|
17
|
+
report('loaded');
|
|
18
|
+
} catch { report('error'); }
|
|
19
|
+
window.addEventListener('pagehide',()=>controller?.dispose(),{once:true});
|
|
20
|
+
</script></body></html>`;
|
|
21
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** Native Metro cannot analyze import(variable); load the optional browser module as a module script. */
|
|
2
|
+
const registryKey = Symbol.for('bloom.character.runtimes');
|
|
3
|
+
const pending = new Map<string, Promise<unknown>>();
|
|
4
|
+
export function loadCharacterRuntime<T>(url: string): Promise<T> {
|
|
5
|
+
const resolved = new URL(url, document.baseURI).href;
|
|
6
|
+
const registry = (
|
|
7
|
+
globalThis as unknown as Record<symbol, Map<string, unknown>>
|
|
8
|
+
)[registryKey];
|
|
9
|
+
const existing = registry?.get(resolved);
|
|
10
|
+
if (existing) return Promise.resolve(existing as T);
|
|
11
|
+
const request = pending.get(resolved);
|
|
12
|
+
if (request) return request as Promise<T>;
|
|
13
|
+
const promise = new Promise<unknown>((resolve, reject) => {
|
|
14
|
+
const script = document.createElement('script');
|
|
15
|
+
script.type = 'module';
|
|
16
|
+
script.src = resolved;
|
|
17
|
+
script.onload = () => {
|
|
18
|
+
script.remove();
|
|
19
|
+
const loaded = (
|
|
20
|
+
globalThis as unknown as Record<symbol, Map<string, unknown>>
|
|
21
|
+
)[registryKey]?.get(resolved);
|
|
22
|
+
if (loaded) resolve(loaded);
|
|
23
|
+
else {
|
|
24
|
+
pending.delete(resolved);
|
|
25
|
+
reject(new Error('Invalid character runtime module'));
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
script.onerror = () => {
|
|
29
|
+
script.remove();
|
|
30
|
+
pending.delete(resolved);
|
|
31
|
+
reject(new Error('Character runtime could not be loaded'));
|
|
32
|
+
};
|
|
33
|
+
document.head.appendChild(script);
|
|
34
|
+
});
|
|
35
|
+
pending.set(resolved, promise);
|
|
36
|
+
return promise as Promise<T>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ComponentType, Ref } from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export type CharacterWebViewHandle = { injectJavaScript(script: string): void };
|
|
5
|
+
type Props = {
|
|
6
|
+
ref?: Ref<CharacterWebViewHandle>;
|
|
7
|
+
source: { html: string; baseUrl: string };
|
|
8
|
+
style: StyleProp<ViewStyle>;
|
|
9
|
+
scrollEnabled: boolean;
|
|
10
|
+
javaScriptEnabled: boolean;
|
|
11
|
+
originWhitelist: string[];
|
|
12
|
+
onMessage(event: { nativeEvent: { data: string } }): void;
|
|
13
|
+
};
|
|
14
|
+
let cached: ComponentType<Props> | null | undefined;
|
|
15
|
+
export function characterWebView() {
|
|
16
|
+
if (cached !== undefined) return cached;
|
|
17
|
+
try {
|
|
18
|
+
const module = require('react-native-webview');
|
|
19
|
+
cached = module.WebView as ComponentType<Props>;
|
|
20
|
+
} catch {
|
|
21
|
+
cached = null;
|
|
22
|
+
}
|
|
23
|
+
return cached;
|
|
24
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** Catalog parts extend the existing avatar recipe without discarding its shape or expression fields. */
|
|
2
|
+
export type AvatarCharacterCategory = 'shape' | 'color' | 'eyes' | 'eyewear' | 'accessory';
|
|
3
|
+
|
|
4
|
+
export type AvatarCharacterConfig = {
|
|
5
|
+
preset: string;
|
|
6
|
+
selections?: Partial<Record<AvatarCharacterCategory, string>>;
|
|
7
|
+
/** Custom body RGB accepted by the original renderer, stored as lowercase #RRGGBB. */
|
|
8
|
+
bodyColor?: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const categories: readonly AvatarCharacterCategory[] = ['shape', 'color', 'eyes', 'eyewear', 'accessory'];
|
|
12
|
+
const validId = (value: unknown): value is string =>
|
|
13
|
+
typeof value === 'string' && value.length > 0 && value.length <= 63;
|
|
14
|
+
|
|
15
|
+
/** Validate the JSON boundary before passing saved configuration to the optional renderer. */
|
|
16
|
+
export function parseCharacterConfig(value: unknown): AvatarCharacterConfig {
|
|
17
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
18
|
+
throw new Error('Invalid character configuration.');
|
|
19
|
+
const candidate = value as Record<string, unknown>;
|
|
20
|
+
if (!validId(candidate.preset)) throw new Error('Invalid character preset.');
|
|
21
|
+
const result: AvatarCharacterConfig = { preset: candidate.preset };
|
|
22
|
+
if (candidate.bodyColor !== undefined) {
|
|
23
|
+
if (typeof candidate.bodyColor !== 'string' || candidate.bodyColor.length !== 7 || !/^#[0-9a-f]{6}$/i.test(candidate.bodyColor))
|
|
24
|
+
throw new Error('Invalid character body color.');
|
|
25
|
+
result.bodyColor = candidate.bodyColor.toLowerCase();
|
|
26
|
+
}
|
|
27
|
+
if (candidate.selections !== undefined) {
|
|
28
|
+
if (!candidate.selections || typeof candidate.selections !== 'object' || Array.isArray(candidate.selections))
|
|
29
|
+
throw new Error('Invalid character selections.');
|
|
30
|
+
const selections: NonNullable<AvatarCharacterConfig['selections']> = {};
|
|
31
|
+
for (const [category, id] of Object.entries(candidate.selections)) {
|
|
32
|
+
if (!categories.includes(category as AvatarCharacterCategory) || !validId(id))
|
|
33
|
+
throw new Error('Invalid character selection.');
|
|
34
|
+
selections[category as AvatarCharacterCategory] = id;
|
|
35
|
+
}
|
|
36
|
+
result.selections = selections;
|
|
37
|
+
}
|
|
38
|
+
if ('state' in candidate) throw new Error('Opaque character state is not supported.');
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
@@ -5,3 +5,20 @@ import type { DrawingContext } from './drawing';
|
|
|
5
5
|
export const AvatarDrawingObserver = createContext<
|
|
6
6
|
((drawing: DrawingContext) => void) | null
|
|
7
7
|
>(null);
|
|
8
|
+
|
|
9
|
+
export type CharacterCapabilities = {
|
|
10
|
+
key: string;
|
|
11
|
+
available: Record<string, boolean>;
|
|
12
|
+
selected: Record<string, string>;
|
|
13
|
+
};
|
|
14
|
+
/** The application hosts the optional renderer assets at this module URL. */
|
|
15
|
+
export const CharacterRuntimeContext = createContext<{
|
|
16
|
+
runtimeUrl?: string;
|
|
17
|
+
reportCapabilities?: (value: CharacterCapabilities) => void;
|
|
18
|
+
}>({});
|
|
19
|
+
|
|
20
|
+
/** Only editors subscribe to catalog updates; renderer input stays stable. */
|
|
21
|
+
export const CharacterCapabilitiesContext = createContext<{
|
|
22
|
+
capabilities?: CharacterCapabilities;
|
|
23
|
+
capabilitiesByKey?: ReadonlyMap<string, CharacterCapabilities>;
|
|
24
|
+
}>({});
|
|
@@ -24,4 +24,7 @@ export {
|
|
|
24
24
|
parsePreset,
|
|
25
25
|
} from './model';
|
|
26
26
|
export type { AvatarConfig, AvatarFamily, AvatarPreset } from './model';
|
|
27
|
-
export type { AgentAvatarProps } from './types';
|
|
27
|
+
export type { AgentAvatarProps, AgentAvatarProviderProps } from './types';
|
|
28
|
+
|
|
29
|
+
export { AgentAvatarProvider } from './AgentAvatarProvider';
|
|
30
|
+
export type { AvatarCharacterConfig, AvatarCharacterCategory } from './config-character';
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { avatarSilhouette } from './artwork';
|
|
2
|
+
import { DrawingContext, type DrawingPath, type Point } from './drawing';
|
|
3
|
+
import { expressionRig } from './face';
|
|
4
|
+
import { drawFold } from './fold';
|
|
5
|
+
import type { AvatarConfig } from './model';
|
|
6
|
+
import type { ShapeMorph } from './shape-morph';
|
|
7
|
+
|
|
8
|
+
/** Sample the existing artwork, so a migrated silhouette has one source of truth. */
|
|
9
|
+
function samplePath(path: DrawingPath): Point[] {
|
|
10
|
+
const points: Point[] = [];
|
|
11
|
+
let current: Point = [0, 0];
|
|
12
|
+
for (const { kind, values: v } of path.commands) {
|
|
13
|
+
if (kind === 'M' || kind === 'L') {
|
|
14
|
+
current = [v[0]!, v[1]!];
|
|
15
|
+
points.push(current);
|
|
16
|
+
} else if (kind === 'C' || kind === 'Q') {
|
|
17
|
+
const from = current;
|
|
18
|
+
for (let step = 1; step <= 24; step++) {
|
|
19
|
+
const t = step / 24,
|
|
20
|
+
u = 1 - t;
|
|
21
|
+
current =
|
|
22
|
+
kind === 'C'
|
|
23
|
+
? [
|
|
24
|
+
u ** 3 * from[0] +
|
|
25
|
+
3 * u * u * t * v[0]! +
|
|
26
|
+
3 * u * t * t * v[2]! +
|
|
27
|
+
t ** 3 * v[4]!,
|
|
28
|
+
u ** 3 * from[1] +
|
|
29
|
+
3 * u * u * t * v[1]! +
|
|
30
|
+
3 * u * t * t * v[3]! +
|
|
31
|
+
t ** 3 * v[5]!,
|
|
32
|
+
]
|
|
33
|
+
: [
|
|
34
|
+
u * u * from[0] + 2 * u * t * v[0]! + t * t * v[2]!,
|
|
35
|
+
u * u * from[1] + 2 * u * t * v[1]! + t * t * v[3]!,
|
|
36
|
+
];
|
|
37
|
+
points.push(current);
|
|
38
|
+
}
|
|
39
|
+
} else if (kind !== 'Z') {
|
|
40
|
+
throw new Error('Unsupported legacy contour command');
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return points;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Engine coordinates: Y upwards, the existing circular body's radius is one. */
|
|
47
|
+
export function legacyContours(config: AvatarConfig): Point[][] {
|
|
48
|
+
const rest = { ...config, motion: 0, idle: false, face: false };
|
|
49
|
+
if (rest.family !== 'fold') {
|
|
50
|
+
return [
|
|
51
|
+
samplePath(avatarSilhouette(rest, 0)).map(([x, y]) => [x / 83, -y / 83]),
|
|
52
|
+
];
|
|
53
|
+
}
|
|
54
|
+
const morph: ShapeMorph = { started: 0, active: false };
|
|
55
|
+
drawFold(
|
|
56
|
+
new DrawingContext(),
|
|
57
|
+
rest,
|
|
58
|
+
0,
|
|
59
|
+
expressionRig(rest),
|
|
60
|
+
[0, 0],
|
|
61
|
+
200,
|
|
62
|
+
null,
|
|
63
|
+
0,
|
|
64
|
+
1,
|
|
65
|
+
0,
|
|
66
|
+
morph,
|
|
67
|
+
);
|
|
68
|
+
const geometry = morph.last!;
|
|
69
|
+
const direction = rest.foldDirection === 'left' ? -1 : 1;
|
|
70
|
+
return [geometry.paper, geometry.back].map((path) =>
|
|
71
|
+
samplePath(path).map(([x, y]) => [
|
|
72
|
+
(x * geometry.sx * direction) / 83,
|
|
73
|
+
-y / 83,
|
|
74
|
+
]),
|
|
75
|
+
);
|
|
76
|
+
}
|