Move view lens planning into core
This commit is contained in:
parent
6521f10bf7
commit
fc6976687f
10 changed files with 81 additions and 55 deletions
|
|
@ -313,6 +313,7 @@ pub use surfaces::EpiphanySceneStateStatus;
|
|||
pub use surfaces::EpiphanySceneStatusCount;
|
||||
pub use surfaces::EpiphanySceneSubgoal;
|
||||
pub use surfaces::EpiphanyTokenUsageSnapshot;
|
||||
pub use surfaces::EpiphanyViewLens;
|
||||
pub use surfaces::EpiphanyWorkerLaunchDocument;
|
||||
pub use surfaces::REORIENT_WORKER_OUTPUT_CONTRACT_ID;
|
||||
pub use surfaces::ROLE_WORKER_OUTPUT_CONTRACT_ID;
|
||||
|
|
@ -321,6 +322,7 @@ pub use surfaces::build_reorient_job_launch_request;
|
|||
pub use surfaces::build_role_acceptance_bundle;
|
||||
pub use surfaces::coordinator_automation_action;
|
||||
pub use surfaces::crrc_scene_action_to_coordinator_scene_action;
|
||||
pub use surfaces::default_epiphany_view_lenses;
|
||||
pub use surfaces::derive_context;
|
||||
pub use surfaces::derive_coordinator_finding_signals;
|
||||
pub use surfaces::derive_coordinator_status;
|
||||
|
|
@ -331,6 +333,10 @@ pub use surfaces::derive_planning_view;
|
|||
pub use surfaces::derive_pressure_view;
|
||||
pub use surfaces::derive_role_board;
|
||||
pub use surfaces::derive_scene;
|
||||
pub use surfaces::epiphany_view_needs_jobs;
|
||||
pub use surfaces::epiphany_view_needs_pressure;
|
||||
pub use surfaces::epiphany_view_needs_reorientation_inputs;
|
||||
pub use surfaces::epiphany_view_needs_runtime_store;
|
||||
pub use surfaces::imagination_role_state_patch_policy_errors;
|
||||
pub use surfaces::interpret_runtime_reorient_worker_result;
|
||||
pub use surfaces::interpret_runtime_role_worker_result;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ mod role_board;
|
|||
mod role_result;
|
||||
mod scene;
|
||||
mod state_patch;
|
||||
mod view;
|
||||
mod worker_launch;
|
||||
|
||||
pub use coordinator::EpiphanyCoordinatorAction;
|
||||
|
|
@ -131,6 +132,12 @@ pub use scene::EpiphanySceneStatusCount;
|
|||
pub use scene::EpiphanySceneSubgoal;
|
||||
pub use scene::derive_scene;
|
||||
pub use state_patch::EpiphanyRoleStatePatchDocument;
|
||||
pub use view::EpiphanyViewLens;
|
||||
pub use view::default_epiphany_view_lenses;
|
||||
pub use view::epiphany_view_needs_jobs;
|
||||
pub use view::epiphany_view_needs_pressure;
|
||||
pub use view::epiphany_view_needs_reorientation_inputs;
|
||||
pub use view::epiphany_view_needs_runtime_store;
|
||||
pub use worker_launch::EpiphanyReorientLaunchRequestInput;
|
||||
pub use worker_launch::EpiphanyReorientWorkerLaunchDocument;
|
||||
pub use worker_launch::EpiphanyRoleWorkerLaunchDocument;
|
||||
|
|
|
|||
52
epiphany-core/src/surfaces/view.rs
Normal file
52
epiphany-core/src/surfaces/view.rs
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum EpiphanyViewLens {
|
||||
Scene,
|
||||
Jobs,
|
||||
Roles,
|
||||
Planning,
|
||||
Pressure,
|
||||
Reorient,
|
||||
Crrc,
|
||||
Coordinator,
|
||||
}
|
||||
|
||||
pub fn default_epiphany_view_lenses() -> Vec<EpiphanyViewLens> {
|
||||
vec![
|
||||
EpiphanyViewLens::Scene,
|
||||
EpiphanyViewLens::Jobs,
|
||||
EpiphanyViewLens::Roles,
|
||||
EpiphanyViewLens::Planning,
|
||||
EpiphanyViewLens::Pressure,
|
||||
EpiphanyViewLens::Reorient,
|
||||
EpiphanyViewLens::Crrc,
|
||||
EpiphanyViewLens::Coordinator,
|
||||
]
|
||||
}
|
||||
|
||||
pub fn epiphany_view_needs_jobs(lenses: &[EpiphanyViewLens]) -> bool {
|
||||
lenses.contains(&EpiphanyViewLens::Jobs)
|
||||
|| lenses.contains(&EpiphanyViewLens::Roles)
|
||||
|| lenses.contains(&EpiphanyViewLens::Crrc)
|
||||
|| lenses.contains(&EpiphanyViewLens::Coordinator)
|
||||
}
|
||||
|
||||
pub fn epiphany_view_needs_reorientation_inputs(lenses: &[EpiphanyViewLens]) -> bool {
|
||||
lenses.contains(&EpiphanyViewLens::Roles)
|
||||
|| lenses.contains(&EpiphanyViewLens::Reorient)
|
||||
|| lenses.contains(&EpiphanyViewLens::Crrc)
|
||||
|| lenses.contains(&EpiphanyViewLens::Coordinator)
|
||||
}
|
||||
|
||||
pub fn epiphany_view_needs_pressure(lenses: &[EpiphanyViewLens]) -> bool {
|
||||
lenses.contains(&EpiphanyViewLens::Pressure) || epiphany_view_needs_reorientation_inputs(lenses)
|
||||
}
|
||||
|
||||
pub fn epiphany_view_needs_runtime_store(lenses: &[EpiphanyViewLens]) -> bool {
|
||||
lenses.contains(&EpiphanyViewLens::Roles)
|
||||
|| lenses.contains(&EpiphanyViewLens::Crrc)
|
||||
|| lenses.contains(&EpiphanyViewLens::Coordinator)
|
||||
}
|
||||
Reference in a new issue