@celestia-island/plana-types 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/Cargo.toml +38 -0
  2. package/bindings/FileAnchor.ts +3 -0
  3. package/bindings/engine.ts +277 -0
  4. package/bindings/enums.ts +31 -0
  5. package/bindings/httpTypes.ts +197 -0
  6. package/bindings/index.ts +47 -0
  7. package/bindings/mcp/aporia.ts +61 -0
  8. package/bindings/mcp/eleos.ts +18 -0
  9. package/bindings/mcp/epieikeia.ts +48 -0
  10. package/bindings/mcp/haplotes.ts +47 -0
  11. package/bindings/mcp/hubris.ts +41 -0
  12. package/bindings/mcp/index.ts +13 -0
  13. package/bindings/mcp/kalos.ts +47 -0
  14. package/bindings/mcp/neikos.ts +76 -0
  15. package/bindings/mcp/orexis.ts +64 -0
  16. package/bindings/mcp/philia.ts +57 -0
  17. package/bindings/mcp/polemos.ts +55 -0
  18. package/bindings/mcp/skemma.ts +58 -0
  19. package/bindings/mcp/skopeo.ts +56 -0
  20. package/bindings/mcp/webAutomation.ts +31 -0
  21. package/bindings/model.ts +240 -0
  22. package/bindings/package.json +16 -0
  23. package/bindings/region.ts +3 -0
  24. package/bindings/serde_json/JsonValue.ts +3 -0
  25. package/bindings/ws/agentLifecycle.ts +41 -0
  26. package/bindings/ws/auth.ts +15 -0
  27. package/bindings/ws/baseMessages.ts +7 -0
  28. package/bindings/ws/bridgeNetwork.ts +71 -0
  29. package/bindings/ws/core.ts +51 -0
  30. package/bindings/ws/fileBrowsing.ts +57 -0
  31. package/bindings/ws/handshake.ts +23 -0
  32. package/bindings/ws/industrial.ts +72 -0
  33. package/bindings/ws/knowledgeBase.ts +10 -0
  34. package/bindings/ws/layer2.ts +25 -0
  35. package/bindings/ws/llmProvider.ts +74 -0
  36. package/bindings/ws/logs.ts +11 -0
  37. package/bindings/ws/malkuth.ts +62 -0
  38. package/bindings/ws/noa.ts +17 -0
  39. package/bindings/ws/stateSync.ts +19 -0
  40. package/bindings/ws/systemUi.ts +5 -0
  41. package/bindings/ws/tasks.ts +6 -0
  42. package/bindings/ws/views.ts +163 -0
  43. package/bindings/ws/workspace.ts +11 -0
  44. package/bindings/ws/yolo.ts +32 -0
  45. package/examples/schema_dump.rs +51 -0
  46. package/package.json +6 -0
  47. package/pnpm-workspace.yaml +2 -0
  48. package/src/engine.rs +602 -0
  49. package/src/enums.rs +334 -0
  50. package/src/external_mcp.rs +132 -0
  51. package/src/http.rs +1077 -0
  52. package/src/identity.rs +160 -0
  53. package/src/lib.rs +1215 -0
  54. package/src/malkuth.rs +145 -0
  55. package/src/mcp/aporia.rs +272 -0
  56. package/src/mcp/eleos.rs +210 -0
  57. package/src/mcp/epieikeia.rs +194 -0
  58. package/src/mcp/haplotes.rs +310 -0
  59. package/src/mcp/hubris.rs +377 -0
  60. package/src/mcp/kalos.rs +251 -0
  61. package/src/mcp/mod.rs +23 -0
  62. package/src/mcp/neikos.rs +533 -0
  63. package/src/mcp/orexis.rs +493 -0
  64. package/src/mcp/philia.rs +267 -0
  65. package/src/mcp/polemos.rs +241 -0
  66. package/src/mcp/skemma.rs +442 -0
  67. package/src/mcp/skopeo.rs +282 -0
  68. package/src/mcp/web_automation.rs +122 -0
  69. package/src/model.rs +421 -0
  70. package/src/protocol/base_messages.rs +125 -0
  71. package/src/protocol/handshake.rs +364 -0
  72. package/src/protocol/jsonrpc.rs +888 -0
  73. package/src/protocol/mod.rs +10 -0
  74. package/src/rbac.rs +786 -0
  75. package/src/region.rs +362 -0
  76. package/src/tracing_helpers.rs +9 -0
  77. package/src/ws/agent/agent_lifecycle.rs +221 -0
  78. package/src/ws/agent/layer2.rs +126 -0
  79. package/src/ws/agent/mod.rs +9 -0
  80. package/src/ws/agent/state_sync.rs +111 -0
  81. package/src/ws/agent/tasks.rs +43 -0
  82. package/src/ws/agent/yolo.rs +161 -0
  83. package/src/ws/mod.rs +10 -0
  84. package/src/ws/services/auth.rs +99 -0
  85. package/src/ws/services/industrial.rs +647 -0
  86. package/src/ws/services/knowledge_base.rs +59 -0
  87. package/src/ws/services/llm_provider.rs +371 -0
  88. package/src/ws/services/mod.rs +7 -0
  89. package/src/ws/ui/bridge_network.rs +96 -0
  90. package/src/ws/ui/file_browsing.rs +88 -0
  91. package/src/ws/ui/logs.rs +55 -0
  92. package/src/ws/ui/mod.rs +11 -0
  93. package/src/ws/ui/noa.rs +105 -0
  94. package/src/ws/ui/system_ui.rs +27 -0
  95. package/src/ws/ui/views.rs +159 -0
  96. package/src/ws/ui/workspace.rs +73 -0
@@ -0,0 +1,267 @@
1
+ use serde_json::Value;
2
+
3
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
4
+ #[ts(export, export_to = "mcp/philia.ts")]
5
+ pub struct AgentRegistryEntry {
6
+ pub agent_type: String,
7
+ pub status: String,
8
+ pub mcp_tool_count: usize,
9
+ pub skill_count: usize,
10
+ pub mcp_tools: Vec<String>,
11
+ pub skills: Vec<String>,
12
+ }
13
+
14
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
15
+ #[ts(export, export_to = "mcp/philia.ts")]
16
+ pub struct AgentRegistryListResult {
17
+ pub agents: Vec<AgentRegistryEntry>,
18
+ }
19
+
20
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
21
+ #[ts(export, export_to = "mcp/philia.ts")]
22
+ pub struct McpToolDetail {
23
+ pub name: String,
24
+ pub description: String,
25
+ #[ts(type = "Record<string, unknown>")]
26
+ pub parameters: serde_json::Value,
27
+ }
28
+
29
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
30
+ #[ts(export, export_to = "mcp/philia.ts")]
31
+ pub struct SkillDetail {
32
+ pub name: String,
33
+ pub description: String,
34
+ pub related_tools: Vec<String>,
35
+ }
36
+
37
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
38
+ #[ts(export, export_to = "mcp/philia.ts")]
39
+ pub struct AgentRegistryGetResult {
40
+ pub agent_type: String,
41
+ pub mcp_tools: Vec<McpToolDetail>,
42
+ pub skills: Vec<SkillDetail>,
43
+ }
44
+
45
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
46
+ #[ts(export, export_to = "mcp/philia.ts")]
47
+ pub struct DataStoreSaveResult {
48
+ pub key: String,
49
+ pub namespace: String,
50
+ pub store_key: String,
51
+ pub saved_at: String,
52
+ #[ts(type = "Record<string, unknown>")]
53
+ pub value: Value,
54
+ }
55
+
56
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
57
+ #[ts(export, export_to = "mcp/philia.ts")]
58
+ pub struct DataStoreLoadResult {
59
+ pub key: String,
60
+ pub namespace: String,
61
+ pub store_key: String,
62
+ pub loaded_at: String,
63
+ #[ts(type = "Record<string, unknown>")]
64
+ pub value: Value,
65
+ }
66
+
67
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
68
+ #[ts(export, export_to = "mcp/philia.ts")]
69
+ pub struct ContextPrepareResult {
70
+ pub episode_count: usize,
71
+ pub entity_count: usize,
72
+ pub relevant_nodes: usize,
73
+ pub summary: String,
74
+ }
75
+
76
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
77
+ #[ts(export, export_to = "mcp/philia.ts")]
78
+ pub struct MemoryStoreResult {
79
+ pub node_id: String,
80
+ pub node_type: String,
81
+ pub text_preview: String,
82
+ }
83
+
84
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
85
+ #[ts(export, export_to = "mcp/philia.ts")]
86
+ pub struct MemoryQueryItem {
87
+ pub node_type: String,
88
+ pub text: String,
89
+ pub score: f64,
90
+ }
91
+
92
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
93
+ #[ts(export, export_to = "mcp/philia.ts")]
94
+ pub struct MemoryQueryResult {
95
+ pub query: String,
96
+ pub total: usize,
97
+ pub results: Vec<MemoryQueryItem>,
98
+ }
99
+
100
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
101
+ #[ts(export, export_to = "mcp/philia.ts")]
102
+ pub struct MemoryConsolidateResult {
103
+ pub episode_id: String,
104
+ pub linked_count: usize,
105
+ }
106
+
107
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
108
+ #[ts(export, export_to = "mcp/philia.ts")]
109
+ pub struct MemorySubgraphEdge {
110
+ pub source_id: String,
111
+ pub target_id: String,
112
+ pub edge_type: String,
113
+ pub weight: f64,
114
+ #[ts(type = "Record<string, unknown> | null")]
115
+ pub metadata: Option<serde_json::Map<String, Value>>,
116
+ }
117
+
118
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
119
+ #[ts(export, export_to = "mcp/philia.ts")]
120
+ pub struct MemoryNodeFull {
121
+ pub id: String,
122
+ pub node_type: String,
123
+ pub text: String,
124
+ pub score: f64,
125
+ pub tags: Vec<String>,
126
+ pub created_at: Option<String>,
127
+ pub source: Option<String>,
128
+ #[ts(type = "Record<string, unknown> | null")]
129
+ pub metadata: Option<serde_json::Map<String, Value>>,
130
+ }
131
+
132
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
133
+ #[ts(export, export_to = "mcp/philia.ts")]
134
+ pub struct MemorySubgraphResult {
135
+ pub query: String,
136
+ pub total_nodes: usize,
137
+ pub total_edges: usize,
138
+ pub nodes: Vec<MemoryNodeFull>,
139
+ pub edges: Vec<MemorySubgraphEdge>,
140
+ }
141
+
142
+ // ── Tool parameter structs (for .d.ts API signature generation) ──
143
+
144
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
145
+ #[ts(export, export_to = "mcp/philia.ts")]
146
+ pub struct MemoryStoreParams {
147
+ pub text: String,
148
+ pub node_type: String,
149
+ pub entity_type: Option<String>,
150
+ pub source_episode_id: Option<String>,
151
+ pub related_node_ids: Option<Vec<String>>,
152
+ pub properties: Option<std::collections::HashMap<String, String>>,
153
+ }
154
+
155
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
156
+ #[ts(export, export_to = "mcp/philia.ts")]
157
+ pub struct MemoryQueryParams {
158
+ pub query: String,
159
+ pub limit: Option<u64>,
160
+ pub graph_depth: Option<u64>,
161
+ pub node_type_filter: Option<String>,
162
+ pub subgraph: Option<bool>,
163
+ }
164
+
165
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
166
+ #[ts(export, export_to = "mcp/philia.ts")]
167
+ pub struct MemoryConsolidateParams {
168
+ pub episode_focus: String,
169
+ pub node_ids: Vec<String>,
170
+ }
171
+
172
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
173
+ #[ts(export, export_to = "mcp/philia.ts")]
174
+ pub struct ContextPrepareParams {
175
+ pub query: String,
176
+ pub max_nodes: Option<u64>,
177
+ }
178
+
179
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
180
+ #[ts(export, export_to = "mcp/philia.ts")]
181
+ pub struct TimeseriesQueryParams {
182
+ pub metric: String,
183
+ pub start_time: Option<i64>,
184
+ pub end_time: Option<i64>,
185
+ pub include_stats: Option<bool>,
186
+ pub limit: Option<u64>,
187
+ pub tags: Option<std::collections::HashMap<String, String>>,
188
+ }
189
+
190
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
191
+ #[ts(export, export_to = "mcp/philia.ts")]
192
+ pub struct DataQualityCheckParams {
193
+ pub metric: String,
194
+ pub expected_interval_ms: Option<u64>,
195
+ pub stale_threshold_ms: Option<u64>,
196
+ pub z_score_threshold: Option<f64>,
197
+ }
198
+
199
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
200
+ #[ts(export, export_to = "mcp/philia.ts")]
201
+ pub struct ToolSchemaGetParams {
202
+ pub agent_type: String,
203
+ pub tool_name: String,
204
+ }
205
+
206
+ // ── Tool result structs for timeseries / registry tools ──
207
+
208
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
209
+ #[ts(export, export_to = "mcp/philia.ts")]
210
+ pub struct ToolSchemaGetResult {
211
+ pub agent_type: String,
212
+ pub tool_name: String,
213
+ pub declaration: String,
214
+ }
215
+
216
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
217
+ #[ts(export, export_to = "mcp/philia.ts")]
218
+ pub struct TimeseriesPointResult {
219
+ pub timestamp: i64,
220
+ pub value: f64,
221
+ pub tags: std::collections::HashMap<String, String>,
222
+ }
223
+
224
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
225
+ #[ts(export, export_to = "mcp/philia.ts")]
226
+ pub struct QueryStats {
227
+ pub min: f64,
228
+ pub max: f64,
229
+ pub mean: f64,
230
+ pub std_dev: f64,
231
+ pub p50: f64,
232
+ pub p95: f64,
233
+ pub p99: f64,
234
+ }
235
+
236
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
237
+ #[ts(export, export_to = "mcp/philia.ts")]
238
+ pub struct TimeseriesQueryResult {
239
+ pub metric: String,
240
+ pub points: Vec<TimeseriesPointResult>,
241
+ pub stats: Option<QueryStats>,
242
+ pub count: usize,
243
+ }
244
+
245
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
246
+ #[ts(export, export_to = "mcp/philia.ts")]
247
+ pub struct GapInfo {
248
+ pub start_time: i64,
249
+ pub end_time: i64,
250
+ pub estimated_missing: usize,
251
+ }
252
+
253
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
254
+ #[ts(export, export_to = "mcp/philia.ts")]
255
+ pub struct QualityReport {
256
+ pub metric: String,
257
+ pub total_points: usize,
258
+ pub completeness: f64,
259
+ pub expected_points: usize,
260
+ pub missing_points: usize,
261
+ pub duplicate_points: usize,
262
+ pub stale_points: usize,
263
+ pub outlier_count: usize,
264
+ pub outlier_ratio: f64,
265
+ pub gaps: Vec<GapInfo>,
266
+ pub score: f64,
267
+ }
@@ -0,0 +1,241 @@
1
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
2
+ #[ts(export, export_to = "mcp/polemos.ts")]
3
+ pub struct NodeInfo {
4
+ pub id: String,
5
+ pub name: String,
6
+ pub address: String,
7
+ pub status: String,
8
+ }
9
+
10
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
11
+ #[ts(export, export_to = "mcp/polemos.ts")]
12
+ pub struct NodeDiscoverResult {
13
+ pub host: String,
14
+ pub port: u16,
15
+ pub node_id: Option<String>,
16
+ pub total_nodes: usize,
17
+ pub status: String,
18
+ pub nodes: Vec<NodeInfo>,
19
+ }
20
+
21
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
22
+ #[ts(export, export_to = "mcp/polemos.ts")]
23
+ pub struct NodeConnectResult {
24
+ pub node_id: String,
25
+ pub node_name: String,
26
+ pub address: String,
27
+ pub status: String,
28
+ pub last_seen: String,
29
+ }
30
+
31
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
32
+ #[ts(export, export_to = "mcp/polemos.ts")]
33
+ pub struct NodeExecuteResult {
34
+ pub node_id: String,
35
+ pub node_name: String,
36
+ pub host: String,
37
+ pub command: String,
38
+ pub exit_code: Option<i64>,
39
+ pub stdout: String,
40
+ pub stderr: String,
41
+ pub status: String,
42
+ }
43
+
44
+ // ── Tool parameter structs (for .d.ts API signature generation) ──
45
+
46
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
47
+ #[ts(export, export_to = "mcp/polemos.ts")]
48
+ pub struct NodeDiscoverParams {
49
+ pub auto_register: Option<bool>,
50
+ pub host: Option<String>,
51
+ pub port: Option<u16>,
52
+ }
53
+
54
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
55
+ #[ts(export, export_to = "mcp/polemos.ts")]
56
+ pub struct NodeConnectParams {
57
+ pub node_id: String,
58
+ }
59
+
60
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
61
+ #[ts(export, export_to = "mcp/polemos.ts")]
62
+ pub struct NodeExecuteParams {
63
+ pub node_id: String,
64
+ pub command: String,
65
+ }
66
+
67
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
68
+ #[ts(export, export_to = "mcp/polemos.ts")]
69
+ pub struct ProtocolProbeParams {
70
+ pub host: String,
71
+ pub ports: Option<Vec<u64>>,
72
+ pub protocols: Option<Vec<String>>,
73
+ }
74
+
75
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
76
+ #[ts(export, export_to = "mcp/polemos.ts")]
77
+ pub struct DeviceSelfTestParams {
78
+ pub host: String,
79
+ pub device_id: Option<String>,
80
+ pub modbus_port: Option<u64>,
81
+ pub mqtt_port: Option<u64>,
82
+ pub http_port: Option<u64>,
83
+ pub skip_adaptive: Option<bool>,
84
+ pub register_ranges: Option<Vec<String>>,
85
+ }
86
+
87
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
88
+ #[ts(export, export_to = "mcp/polemos.ts")]
89
+ pub struct EmptyParams {}
90
+
91
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
92
+ #[ts(export, export_to = "mcp/polemos.ts")]
93
+ pub struct NodeTerminalOpenParams {
94
+ pub node_id: String,
95
+ pub cols: Option<u64>,
96
+ pub rows: Option<u64>,
97
+ pub shell: Option<String>,
98
+ pub session_id: Option<String>,
99
+ }
100
+
101
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
102
+ #[ts(export, export_to = "mcp/polemos.ts")]
103
+ pub struct NodeTerminalWriteParams {
104
+ pub session_id: String,
105
+ pub data: String,
106
+ }
107
+
108
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
109
+ #[ts(export, export_to = "mcp/polemos.ts")]
110
+ pub struct NodeTerminalResizeParams {
111
+ pub session_id: String,
112
+ pub cols: u64,
113
+ pub rows: u64,
114
+ }
115
+
116
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
117
+ #[ts(export, export_to = "mcp/polemos.ts")]
118
+ pub struct NodeTerminalCloseParams {
119
+ pub session_id: String,
120
+ }
121
+
122
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
123
+ #[ts(export, export_to = "mcp/polemos.ts")]
124
+ pub struct NodeFileListParams {
125
+ pub node_id: String,
126
+ pub path: Option<String>,
127
+ }
128
+
129
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
130
+ #[ts(export, export_to = "mcp/polemos.ts")]
131
+ pub struct NodeFileDownloadParams {
132
+ pub node_id: String,
133
+ pub remote_path: String,
134
+ }
135
+
136
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
137
+ #[ts(export, export_to = "mcp/polemos.ts")]
138
+ pub struct NodeFileUploadParams {
139
+ pub node_id: String,
140
+ pub remote_path: String,
141
+ pub data_base64: String,
142
+ pub mode: Option<String>,
143
+ }
144
+
145
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
146
+ #[ts(export, export_to = "mcp/polemos.ts")]
147
+ pub struct NodeScreenOfferParams {
148
+ pub node_id: String,
149
+ }
150
+
151
+ // ── Tool result structs (network tools) ──
152
+
153
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
154
+ #[ts(export, export_to = "mcp/polemos.ts")]
155
+ pub struct ProtocolProbeResult {
156
+ pub host: String,
157
+ pub port: u16,
158
+ pub protocol: String,
159
+ pub confidence: f64,
160
+ pub banner: String,
161
+ pub details: std::collections::HashMap<String, String>,
162
+ }
163
+
164
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
165
+ #[ts(export, export_to = "mcp/polemos.ts")]
166
+ pub struct ProtocolProbeResponse {
167
+ pub host: String,
168
+ pub probes: Vec<ProtocolProbeResult>,
169
+ pub total_found: usize,
170
+ }
171
+
172
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
173
+ #[ts(export, export_to = "mcp/polemos.ts")]
174
+ pub struct KneeJerkTest {
175
+ pub test_name: String,
176
+ pub protocol: String,
177
+ pub passed: bool,
178
+ pub latency_ms: u64,
179
+ pub detail: String,
180
+ }
181
+
182
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
183
+ #[ts(export, export_to = "mcp/polemos.ts")]
184
+ pub struct DeviceRegisterRangeResult {
185
+ pub start: u16,
186
+ pub end: u16,
187
+ pub function_code: u8,
188
+ pub bytes_readable: u16,
189
+ pub success: bool,
190
+ }
191
+
192
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
193
+ #[ts(export, export_to = "mcp/polemos.ts")]
194
+ pub struct AdaptiveProbeResult {
195
+ pub register_range: String,
196
+ pub function_codes_tested: Vec<u8>,
197
+ pub readable_ranges: Vec<DeviceRegisterRangeResult>,
198
+ pub latency_avg_ms: u64,
199
+ pub latency_max_ms: u64,
200
+ }
201
+
202
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
203
+ #[ts(export, export_to = "mcp/polemos.ts")]
204
+ pub struct DeviceCapability {
205
+ pub protocols: Vec<String>,
206
+ pub register_maps: Vec<DeviceRegisterRangeResult>,
207
+ pub estimated_device_type: String,
208
+ pub function_codes_supported: Vec<u8>,
209
+ pub max_latency_ms: u64,
210
+ }
211
+
212
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
213
+ #[ts(export, export_to = "mcp/polemos.ts")]
214
+ pub struct Phase1Result {
215
+ pub tests_run: usize,
216
+ pub tests_passed: usize,
217
+ pub tests_failed: usize,
218
+ pub results: Vec<KneeJerkTest>,
219
+ }
220
+
221
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
222
+ #[ts(export, export_to = "mcp/polemos.ts")]
223
+ pub struct Phase2Result {
224
+ pub register_ranges_scanned: usize,
225
+ pub function_codes_probed: Vec<u8>,
226
+ pub readable_registers: usize,
227
+ pub probe_results: Vec<AdaptiveProbeResult>,
228
+ }
229
+
230
+ #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ts_rs::TS)]
231
+ #[ts(export, export_to = "mcp/polemos.ts")]
232
+ pub struct DeviceSelfTestResponse {
233
+ pub device_id: String,
234
+ pub host: String,
235
+ pub overall_status: String,
236
+ pub phase1_self_sensing: Phase1Result,
237
+ pub phase2_adaptive: Phase2Result,
238
+ pub capability_profile: DeviceCapability,
239
+ pub registered_to_node_graph: bool,
240
+ pub timestamp: String,
241
+ }