@@ -73,8 +73,8 @@ use ironclaw_turns::LibSqlTurnStateStore;
7373#[ cfg( feature = "postgres" ) ]
7474use ironclaw_turns:: PostgresTurnStateStore ;
7575use ironclaw_turns:: {
76- DefaultTurnCoordinator , InMemoryTurnStateStore , NoopTurnRunWakeNotifier , TurnRunWakeNotifier ,
77- TurnStateStore , runner:: TurnRunTransitionPort ,
76+ DefaultTurnCoordinator , InMemoryTurnStateStore , NoopTurnRunWakeNotifier , RunProfileResolver ,
77+ TurnRunWakeNotifier , TurnStateStore , runner:: TurnRunTransitionPort ,
7878} ;
7979use ironclaw_wasm:: {
8080 DenyWasmHostHttp , EmptyWasmRuntimeCredentials , PreparedWitTool , WasmError ,
@@ -169,6 +169,7 @@ pub enum ProductionWiringComponent {
169169 WasmRuntime ,
170170 FirstPartyRuntime ,
171171 TurnState ,
172+ RunProfileResolver ,
172173 TurnRunWakeNotifier ,
173174}
174175
@@ -194,6 +195,7 @@ impl ProductionWiringComponent {
194195 Self :: WasmRuntime => "wasm_runtime" ,
195196 Self :: FirstPartyRuntime => "first_party_runtime" ,
196197 Self :: TurnState => "turn_state" ,
198+ Self :: RunProfileResolver => "run_profile_resolver" ,
197199 Self :: TurnRunWakeNotifier => "turn_run_wake_notifier" ,
198200 }
199201 }
@@ -275,6 +277,7 @@ struct ProductionComponentTypes {
275277 mcp_runtime : Option < ProductionComponentType > ,
276278 first_party_runtime : Option < ProductionComponentType > ,
277279 turn_state : Option < ProductionComponentType > ,
280+ run_profile_resolver : Option < ProductionComponentType > ,
278281 turn_run_transition_port : Option < ProductionComponentType > ,
279282 turn_run_transition_port_verified : bool ,
280283 turn_run_wake_notifier : Option < ProductionComponentType > ,
@@ -383,6 +386,7 @@ where
383386 first_party_runtime : Option < Arc < FirstPartyCapabilityRegistry > > ,
384387 wasm_runtime : Option < Arc < WasmRuntimeAdapter > > ,
385388 turn_state : Option < Arc < dyn TurnStateStore > > ,
389+ run_profile_resolver : Option < Arc < dyn RunProfileResolver > > ,
386390 turn_run_transition_port : Option < Arc < dyn TurnRunTransitionPort > > ,
387391 turn_run_wake_notifier : Option < Arc < dyn TurnRunWakeNotifier > > ,
388392 component_types : ProductionComponentTypes ,
@@ -438,6 +442,7 @@ where
438442 first_party_runtime : None ,
439443 wasm_runtime : None ,
440444 turn_state : None ,
445+ run_profile_resolver : None ,
441446 turn_run_transition_port : None ,
442447 turn_run_wake_notifier : None ,
443448 component_types : ProductionComponentTypes {
@@ -462,6 +467,7 @@ where
462467 mcp_runtime : None ,
463468 first_party_runtime : None ,
464469 turn_state : None ,
470+ run_profile_resolver : None ,
465471 turn_run_transition_port : None ,
466472 turn_run_transition_port_verified : false ,
467473 turn_run_wake_notifier : None ,
@@ -501,6 +507,7 @@ where
501507 first_party_runtime,
502508 wasm_runtime,
503509 turn_state,
510+ run_profile_resolver,
504511 turn_run_transition_port,
505512 turn_run_wake_notifier,
506513 mut component_types,
@@ -533,6 +540,7 @@ where
533540 first_party_runtime,
534541 wasm_runtime,
535542 turn_state,
543+ run_profile_resolver,
536544 turn_run_transition_port,
537545 turn_run_wake_notifier,
538546 component_types,
@@ -587,6 +595,7 @@ where
587595 first_party_runtime,
588596 wasm_runtime,
589597 turn_state,
598+ run_profile_resolver,
590599 turn_run_transition_port,
591600 turn_run_wake_notifier,
592601 mut component_types,
@@ -629,6 +638,7 @@ where
629638 first_party_runtime,
630639 wasm_runtime,
631640 turn_state,
641+ run_profile_resolver,
632642 turn_run_transition_port,
633643 turn_run_wake_notifier,
634644 component_types,
@@ -819,6 +829,15 @@ where
819829 self
820830 }
821831
832+ pub fn with_run_profile_resolver < T > ( mut self , resolver : Arc < T > ) -> Self
833+ where
834+ T : RunProfileResolver + ' static ,
835+ {
836+ self . component_types . run_profile_resolver = Some ( ProductionComponentType :: of :: < T > ( ) ) ;
837+ self . run_profile_resolver = Some ( resolver) ;
838+ self
839+ }
840+
822841 #[ cfg( feature = "libsql" ) ]
823842 pub async fn with_libsql_turn_state_store (
824843 self ,
@@ -1119,6 +1138,11 @@ where
11191138 ProductionWiringComponent :: TurnState ,
11201139 self . turn_state . is_some ( ) ,
11211140 ) ;
1141+ self . push_missing (
1142+ & mut issues,
1143+ ProductionWiringComponent :: RunProfileResolver ,
1144+ self . run_profile_resolver . is_some ( ) ,
1145+ ) ;
11221146 self . push_missing (
11231147 & mut issues,
11241148 ProductionWiringComponent :: TurnRunWakeNotifier ,
@@ -1408,6 +1432,13 @@ where
14081432 None ,
14091433 ) ) ;
14101434 } ;
1435+ let Some ( run_profile_resolver) = self . run_profile_resolver . as_ref ( ) else {
1436+ return Err ( production_wiring_report (
1437+ ProductionWiringComponent :: RunProfileResolver ,
1438+ ProductionWiringIssueKind :: Missing ,
1439+ None ,
1440+ ) ) ;
1441+ } ;
14111442 let Some ( notifier) = self . turn_run_wake_notifier . as_ref ( ) else {
14121443 return Err ( production_wiring_report (
14131444 ProductionWiringComponent :: TurnRunWakeNotifier ,
@@ -1416,6 +1447,7 @@ where
14161447 ) ) ;
14171448 } ;
14181449 Ok ( DefaultTurnCoordinator :: new ( Arc :: clone ( turn_state) )
1450+ . with_run_profile_resolver ( Arc :: clone ( run_profile_resolver) )
14191451 . with_wake_notifier ( Arc :: clone ( notifier) ) )
14201452 }
14211453
@@ -1485,6 +1517,11 @@ where
14851517 ProductionWiringComponent :: TurnState ,
14861518 self . turn_state . is_some ( ) ,
14871519 ) ;
1520+ self . push_missing (
1521+ & mut issues,
1522+ ProductionWiringComponent :: RunProfileResolver ,
1523+ self . run_profile_resolver . is_some ( ) ,
1524+ ) ;
14881525 self . push_missing (
14891526 & mut issues,
14901527 ProductionWiringComponent :: TurnRunWakeNotifier ,
0 commit comments