[WIP] feat(automations): port Stream Avatar automations natively into Desktop - #6020
[WIP] feat(automations): port Stream Avatar automations natively into Desktop#6020AnkhHeart wants to merge 80 commits into
Conversation
…ion editor functionality
…nents and improve user interactions
…ent in AutomationEditor
…te with the editor
…create automation flow
…d integrate AgentSocketService for simulation messaging
…mation descriptions
…tion and adjust table styling
…n and installation prompts in automation editor
…e notification function
…on services and components
…onents, add PreMadeAutomationsFooter for improved UI and functionality
…pport and refactor source handling
…th icon and title
…localization for template selection
…onents, add PreMadeAutomationsFooter for improved UI and functionality
…pport and refactor source handling
…th icon and title
…localization for template selection
…with StreamAvatarApiService for improved API integration
…nditions and instructions into flat files for improved organization
… ankh/automations
BundleMonFiles updated (1)
Unchanged files (3)
Total files change +151.71KB +1.17% Final result: ✅ View report in BundleMon website ➡️ |
…lateSource function
…nce EditAutomations with welcome screen and improved layout
…r, EditAutomations, and PreMadeAutomations for cleaner code
- Simplified imports in AutomationEditor by removing unused components and functions. - Removed unnecessary constants and functions related to action options and game options. - Extracted ActionEditor component logic into a separate file for better organization. - Updated condition options retrieval to streamline the process. - Improved the handling of agent app requirements in ActionEditor. - Cleaned up styles in PreMadeAutomations and removed unused CSS classes. - Created TemplatePreview component for handling media previews. - Moved asset downloading and template source creation logic to a new utility file. - Consolidated utility functions for badge colors, video URL checks, and action summarization. - Updated EditAutomations to utilize new GAME_OPTIONS from automations-utils. - Adjusted AutomationsAnalytics to remove unused action types.
| ]; | ||
| return ( | ||
| <> | ||
| <Select |
There was a problem hiding this comment.
Could move the returned components to their own functional component at the bottom, or a new component file with variants, for readability and to remove the need for a fragment.
| ]; | ||
| return ( | ||
| <> | ||
| <Select |
There was a problem hiding this comment.
Same here for functional component
|
|
||
| case 'common.wait_for_ms': | ||
| return ( | ||
| <> |
There was a problem hiding this comment.
Same here for functional component
| ); | ||
|
|
||
| case 'co-host.instruction': | ||
| if (!agentReady) return renderAgentRequiredNotice(); |
There was a problem hiding this comment.
Same here for functional component
| case 'co-host.instruction': | ||
| if (!agentReady) return renderAgentRequiredNotice(); | ||
| return ( | ||
| <> |
There was a problem hiding this comment.
Same here for functional component
| case 'co-host.comment': | ||
| if (!agentReady) return renderAgentRequiredNotice(); | ||
| return ( | ||
| <p |
There was a problem hiding this comment.
Same here for functional component
| ); | ||
|
|
||
| default: | ||
| return null; |
There was a problem hiding this comment.
Is it worthwhile to return a string or component with a user-facing error message?
There was a problem hiding this comment.
Not really, now it'll just show blank when nothing is selected which is fine for the initial state they get when trying to create an automation.
… into ActionControls component
…ter components, implement template selection logic and analytics tracking
…btext in AutomationTemplates component
… createTemplateSource function
…e for asset streaming
…condition and simplify apiBase construction
…nt handling in Utils
Summary
Ports the Automations feature (previously agent-driven, socket-based) into
Desktop as a native, event-driven engine, and adds the full authoring UI:
pre-made templates, a create/edit flow, and a condition/action editor.
Automations let a streamer say "when X happens in-game, do Y in Streamlabs" —
e.g. switch scene on elimination, flash a source on a team score, or have the
AI co-host bark a line — without needing the desktop companion agent process
running.
What changed
Engine (
app/services/stream-avatar/)AutomationsEngineService— subscribes toVisionServicegame events overthe existing websocket, maintains a
GameState/prevStatediff per tick, andfires matching automations' actions. Runs only in the worker window
(
Utils.isWorkerWindow()) to avoid double-firing across processes.engine/conditions.ts— condition registry across 24 supported games(Fortnite, Valorant, CS2, Apex, League, Dota 2, Rocket League, etc.) plus a
STREAMLABS-scoped set, each with typed props and anevaluate()function.engine/actions.ts— action registry:switch_to_scene,show_source/hide_source(with "revert when condition clears" toggles),save_replay,wait_for_ms, and two co-host actions (comment,instruction) that talkto the AI agent.
engine/instructions.ts— per-condition instruction templates that getinterpolated with live game state and sent to the co-host.
engine/properties.ts/validation.ts/game-state.ts— sharedproperty types for the editor UI and condition/action validation.
AutomationsService— Vuex-backed CRUD store (fetchAll/create/update/remove) with exponential-backoff retry on fetch failure, syncedfrom the API on login and cleared on logout.
StreamAvatarApiService— new REST client forstream-avatar-api(JWT mint/cache/refresh-on-401, automations CRUD, templates, simulation,
and fire-and-forget agent instruction/trigger endpoints). Replaces the old
AgentSocketServicesocket transport for this feature.UI (
app/components-react/pages/stream-avatar-automations/)PreMadeAutomations— browsable template gallery (per-game, withvideo/image previews) for one-click automation creation.
AutomationEditor— condition/action builder (Ant Design-based) withdrag-and-drop action reordering, scene/source pickers, and a "simulate"
action that runs an automation's actions on demand for preview.
EditAutomations— the automations list window (enable/disable, edit,delete, create).
AutomationsElement— scene-editor-panel entry point into the feature.useAgentAppInstalledhook — detects whether the Intelligent StreamingAgent platform app is installed/enabled (reactive off
PlatformAppsService)and prompts install/enable where an automation depends on the co-host.
AutomationsAnalytics.ts) and i18n strings(
stream-avatar-automations.json) for the new flows.Supporting changes
SourcesModule(platform-apps API): add filter-visibility get/set soactions can toggle source filters, not just source visibility.
Scrollable:ResizeObserver-driven layout updates for the new scrollablepanels.
app-services.ts: registersStreamAvatarApiService,AutomationsService,AutomationsEngineService.Why
Moves Automations off the agent-socket dependency and into a first-class
Desktop feature, so condition/action evaluation runs locally in the worker
process against the existing Vision websocket feed instead of round-tripping
through a separate agent connection. This removes a runtime dependency and
lets the feature ship in Desktop's own release cadence.
Testing
sources/actions pre-filled
action fires (scene switch, source show/hide, replay save, co-host bark)
clears
spin when logged out
only for automations that need the co-host, on Windows