Skip to main content

core_api/
timeouts.generated.rs

1// Generated from manifest/operation-timeouts.v1.json. DO NOT EDIT.
2
3#[derive(Debug, Clone, Copy, PartialEq, Eq)]
4pub enum Operation {
5    CoreRequest,
6    EventProcessing,
7    EntityRefresh,
8    HarnessSessionOpen,
9    ScriptValidation,
10    ScriptSave,
11    CoreBridgeRequest,
12    CoreBridgeInbound,
13    NodeRequest,
14    LionBridgeRequest,
15    LlmCloudCall,
16}
17
18impl Operation {
19    pub const fn id(self) -> &'static str {
20        match self {
21            Self::CoreRequest => "coreRequest",
22            Self::EventProcessing => "eventProcessing",
23            Self::EntityRefresh => "entityRefresh",
24            Self::HarnessSessionOpen => "harnessSessionOpen",
25            Self::ScriptValidation => "scriptValidation",
26            Self::ScriptSave => "scriptSave",
27            Self::CoreBridgeRequest => "coreBridgeRequest",
28            Self::CoreBridgeInbound => "coreBridgeInbound",
29            Self::NodeRequest => "nodeRequest",
30            Self::LionBridgeRequest => "lionBridgeRequest",
31            Self::LlmCloudCall => "llmCloudCall",
32        }
33    }
34
35    pub const fn timeout(self) -> Duration {
36        Duration::from_millis(match self {
37            Self::CoreRequest => 60000,
38            Self::EventProcessing => 60000,
39            Self::EntityRefresh => 85000,
40            Self::HarnessSessionOpen => 150000,
41            Self::ScriptValidation => 205000,
42            Self::ScriptSave => 60000,
43            Self::CoreBridgeRequest => 35000,
44            Self::CoreBridgeInbound => 55000,
45            Self::NodeRequest => 60000,
46            Self::LionBridgeRequest => 60000,
47            Self::LlmCloudCall => 180000,
48        })
49    }
50}
51
52#[derive(Debug, Clone, Copy, PartialEq, Eq)]
53pub enum WaitProfile {
54    HostIpc,
55    CoreBridge,
56    Client,
57    LionForward,
58}
59
60impl WaitProfile {
61    pub const fn grace(self, operation: Operation) -> Duration {
62        Duration::from_millis(match (self, operation) {
63            (Self::HostIpc, _) => 5000,
64            (Self::CoreBridge, _) => 10000,
65            (Self::Client, _) => 35000,
66            (Self::LionForward, Operation::EntityRefresh) => 5000,
67            (Self::LionForward, Operation::ScriptValidation) => 25000,
68            (Self::LionForward, Operation::ScriptSave) => 30000,
69            (Self::LionForward, _) => 0,
70        })
71    }
72}
73
74const FORWARD_PREFIXES: &[&str] = &[
75    "/invoke",
76    "/dispatch/agent",
77    "/dispatch",
78];
79
80const STORED_SCRIPT_SAVE: &[&str] = &[
81    "/automation/snapshot/rollback",
82    "/app/automation/snapshot/rollback",
83    "/automation/overview/save",
84    "/automation/copy",
85    "/automation/enroll",
86];
87
88const SOURCE_SCRIPT_SAVE: &[&str] = &[
89    "/automation/save",
90    "/app/automation/save",
91];
92
93const SOURCE_SCRIPT_VALIDATION: &[&str] = &[
94    "/app/automation/verify",
95    "/bridge/automation/parse",
96    "/bridge/automation/format",
97    "/bridge/automation/verify",
98    "/automation/format",
99    "/bridge/automation/compile",
100    "/bridge/agent/automation/compile",
101];
102
103const ORDINARY_OVERRIDES: &[(&str, Operation)] = &[
104    ("/app/integration/entity/refresh", Operation::EntityRefresh),
105    ("/harness/test/session/open", Operation::HarnessSessionOpen),
106];