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