1#[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 "/app/suggestion/handle",
85 "/app/automation/snapshot/rollback",
86 "/app/presentation/automation/overview/save",
87 "/app/presentation/automation/copy",
88 "/app/presentation/automation/enroll",
89];
90
91const SOURCE_SCRIPT_SAVE: &[&str] = &[
92 "/app/automation/save",
93];
94
95const SOURCE_SCRIPT_VALIDATION: &[&str] = &[
96 "/app/automation/verify",
97 "/bridge/automation/parse",
98 "/bridge/automation/format",
99 "/bridge/automation/verify",
100 "/bridge/automation/compile",
101 "/bridge/agent/automation/compile",
102];
103
104const ORDINARY_OVERRIDES: &[(&str, Operation)] = &[
105 ("/hub/revoke/start", Operation::HubMigration),
106 ("/bridge/hub/revoke/dataUploaded", Operation::HubMigration),
107 ("/app/integration/entity/refresh", Operation::EntityRefresh),
108 ("/harness/test/session/open", Operation::HarnessSessionOpen),
109];