chore: update docs and layout

This commit is contained in:
Jesús Pérez 2026-01-12 05:03:09 +00:00
parent 2c2ff965be
commit ecd66e33df
Signed by: jesus
GPG Key ID: 9F243E355E0BC939
78 changed files with 110 additions and 111 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
.p .p
.claude .claude
.vscode .vscode
.shellcheckrc .shellcheckrc

View File

@ -43,4 +43,4 @@ cargo = true
# Service Worker registration # Service Worker registration
[build.tools] [build.tools]
sass = "style/input.scss" sass = "style/input.scss"

View File

@ -128,4 +128,4 @@
"url": "/?protocol=%s" "url": "/?protocol=%s"
} }
] ]
} }

View File

@ -350,4 +350,4 @@ self.addEventListener('notificationclick', (event) => {
); );
}); });
console.log('[SW] Service worker script loaded successfully'); console.log('[SW] Service worker script loaded successfully');

View File

@ -41,4 +41,4 @@ p {
justify-content: center; justify-content: center;
min-height: 100vh; min-height: 100vh;
color: #666; color: #666;
} }

View File

@ -8,7 +8,7 @@
<!-- Basic CSS only - no external dependencies --> <!-- Basic CSS only - no external dependencies -->
<script type="module"> <script type="module">
import init, * as bindings from '/control-center-ui-f79a6076a3625b13.js'; import init, * as bindings from '/control-center-ui-f79a6076a3625b13.js';
const wasm = await init({ module_or_path: '/control-center-ui-f79a6076a3625b13_bg.wasm' }); const wasm = await init({ module_or_path: '/control-center-ui-f79a6076a3625b13_bg.wasm' });
@ -175,4 +175,4 @@ dispatchEvent(new CustomEvent("TrunkApplicationStarted", {detail: {wasm}}));
})() })()
</script></body> </script></body>
</html> </html>

View File

@ -35,4 +35,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -128,4 +128,4 @@
"url": "/?protocol=%s" "url": "/?protocol=%s"
} }
] ]
} }

View File

@ -32,4 +32,4 @@
"defaults", "defaults",
"not IE 11" "not IE 11"
] ]
} }

View File

@ -38,4 +38,4 @@
.read-the-docs { .read-the-docs {
color: #888; color: #888;
} }

View File

@ -55,4 +55,4 @@ function App() {
); );
} }
export default App; export default App;

View File

@ -500,4 +500,4 @@ pub fn use_system_health() -> (ReadSignal<Option<serde_json::Value>>, ReadSignal
refresh_action.dispatch(()); refresh_action.dispatch(());
(health, loading, refresh_action) (health, loading, refresh_action)
} }

View File

@ -405,4 +405,4 @@ impl Default for OrchestratorClient {
fn default() -> Self { fn default() -> Self {
Self::new() Self::new()
} }
} }

View File

@ -217,4 +217,4 @@ pub struct StateManagerStatistics {
pub active_workflows: u32, pub active_workflows: u32,
pub storage_size_bytes: u64, pub storage_size_bytes: u64,
pub average_snapshot_size_bytes: u64, pub average_snapshot_size_bytes: u64,
} }

View File

@ -305,4 +305,4 @@ mod tests {
let decoded = CryptoUtils::base64_url_decode(&encoded).unwrap(); let decoded = CryptoUtils::base64_url_decode(&encoded).unwrap();
assert_eq!(data, decoded.as_slice()); assert_eq!(data, decoded.as_slice());
} }
} }

View File

@ -428,4 +428,4 @@ impl OfflineRequestQueue {
pub fn queue_size(&self) -> usize { pub fn queue_size(&self) -> usize {
self.queue.get().len() self.queue.get().len()
} }
} }

View File

@ -199,4 +199,4 @@ impl Default for SecureTokenStorage {
fn default() -> Self { fn default() -> Self {
Self::new().expect("Failed to create SecureTokenStorage") Self::new().expect("Failed to create SecureTokenStorage")
} }
} }

View File

@ -218,4 +218,4 @@ pub fn use_auth_context() -> AuthContext {
pub fn use_token_manager() -> TokenManager { pub fn use_token_manager() -> TokenManager {
let context = use_auth_context(); let context = use_auth_context();
context.token_manager context.token_manager
} }

View File

@ -522,4 +522,4 @@ impl WebAuthnManager {
// if WebAuthn is supported // if WebAuthn is supported
self.is_supported() self.is_supported()
} }
} }

View File

@ -430,4 +430,4 @@ export const AuditLogViewer: React.FC = () => {
); );
}; };
export default AuditLogViewer; export default AuditLogViewer;

View File

@ -665,4 +665,4 @@ export const ComplianceReportGenerator: React.FC<ReportGeneratorProps> = ({
</motion.div> </motion.div>
</AnimatePresence> </AnimatePresence>
); );
}; };

View File

@ -673,4 +673,4 @@ export const ExportModal: React.FC<ExportModalProps> = ({
</motion.div> </motion.div>
</AnimatePresence> </AnimatePresence>
); );
}; };

View File

@ -583,4 +583,4 @@ export const LogDetailModal: React.FC<LogDetailModalProps> = ({
)} )}
</AnimatePresence> </AnimatePresence>
); );
}; };

View File

@ -142,4 +142,4 @@ export const RealTimeIndicator: React.FC<RealTimeIndicatorProps> = ({
</div> </div>
</div> </div>
); );
}; };

View File

@ -729,4 +729,4 @@ function debounce<T extends (...args: any[]) => any>(
}; };
} }
export default SearchFilters; export default SearchFilters;

View File

@ -516,4 +516,4 @@ export const VirtualizedLogTable: React.FC<VirtualizedLogTableProps> = ({
); );
}; };
export default VirtualizedLogTable; export default VirtualizedLogTable;

View File

@ -502,4 +502,4 @@ pub mod templates {
pub fn theme_changed(theme: &str) -> NotificationData { pub fn theme_changed(theme: &str) -> NotificationData {
NotificationData::new(&format!("Theme changed to {}", theme), NotificationLevel::Info) NotificationData::new(&format!("Theme changed to {}", theme), NotificationLevel::Info)
} }
} }

View File

@ -25,4 +25,4 @@ pub use approval_workflow::ApprovalWorkflow;
pub use metrics_dashboard::MetricsDashboard; pub use metrics_dashboard::MetricsDashboard;
pub use violation_debugger::ViolationDebugger; pub use violation_debugger::ViolationDebugger;
pub use role_mining::RoleMining; pub use role_mining::RoleMining;
pub use what_if_simulator::WhatIfSimulator; pub use what_if_simulator::WhatIfSimulator;

View File

@ -472,4 +472,4 @@ fn init_monaco_editor(element: &web_sys::Element, initial_value: String) {
js_sys::Reflect::set(&options, &"theme".into(), &"vs-dark".into()).unwrap(); js_sys::Reflect::set(&options, &"theme".into(), &"vs-dark".into()).unwrap();
create(element, &options); create(element, &options);
} }

View File

@ -1 +0,0 @@

View File

@ -215,4 +215,4 @@ export const useWebSocket = (options: UseWebSocketOptions): UseWebSocketReturn =
close, close,
reconnectAttempts, reconnectAttempts,
}; };
}; };

View File

@ -41,4 +41,4 @@ p {
justify-content: center; justify-content: center;
min-height: 100vh; min-height: 100vh;
color: #666; color: #666;
} }

View File

@ -23,4 +23,4 @@ pub fn hydrate() {
tracing_wasm::set_as_global_default(); tracing_wasm::set_as_global_default();
leptos::mount_to_body(App); leptos::mount_to_body(App);
} }

View File

@ -46,4 +46,4 @@ ReactDOM.createRoot(document.getElementById('root')!).render(
</BrowserRouter> </BrowserRouter>
</QueryClientProvider> </QueryClientProvider>
</React.StrictMode> </React.StrictMode>
); );

View File

@ -660,4 +660,4 @@ fn BatchWorkflowModal(
</div> </div>
</div> </div>
} }
} }

View File

@ -762,4 +762,4 @@ fn BulkOperationsModal(
</div> </div>
</div> </div>
} }
} }

View File

@ -321,4 +321,4 @@ export const auditApi = {
}; };
export default auditApi; export default auditApi;
export { ApiError }; export { ApiError };

View File

@ -864,4 +864,4 @@ impl WidgetPermissions {
required_roles: vec![], // All roles can view required_roles: vec![], // All roles can view
} }
} }
} }

View File

@ -730,4 +730,4 @@ fn format_description(format: &ExportFormat) -> &'static str {
ExportFormat::Excel => "Microsoft Excel format", ExportFormat::Excel => "Microsoft Excel format",
ExportFormat::Json => "Structured data format", ExportFormat::Json => "Structured data format",
} }
} }

View File

@ -304,4 +304,4 @@ export interface WebSocketMessage {
type: 'new_audit_log' | 'compliance_alert' | 'system_status' | 'heartbeat'; type: 'new_audit_log' | 'compliance_alert' | 'system_status' | 'heartbeat';
data: any; data: any;
timestamp: Date; timestamp: Date;
} }

View File

@ -359,4 +359,4 @@ pub struct SimulationResult {
pub performance_metrics: HashMap<String, f64>, pub performance_metrics: HashMap<String, f64>,
pub recommendations: Vec<String>, pub recommendations: Vec<String>,
pub risk_assessment: RiskLevel, pub risk_assessment: RiskLevel,
} }

View File

@ -350,4 +350,4 @@ self.addEventListener('notificationclick', (event) => {
); );
}); });
console.log('[SW] Service worker script loaded successfully'); console.log('[SW] Service worker script loaded successfully');

View File

@ -159,4 +159,4 @@ export default {
logs: false, logs: false,
themeRoot: ":root", themeRoot: ":root",
}, },
}; };

View File

@ -24,4 +24,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -28,4 +28,4 @@
}, },
"include": ["src"], "include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }] "references": [{ "path": "./tsconfig.node.json" }]
} }

View File

@ -40,4 +40,4 @@ export default defineConfig({
} }
} }
} }
}) })

View File

@ -169,4 +169,4 @@ path = "src/lib.rs"
[[bin]] [[bin]]
name = "control-center" name = "control-center"
path = "src/main.rs" path = "src/main.rs"
required-features = ["all"] required-features = ["all"]

View File

@ -195,4 +195,4 @@ permit(principal, action, resource) when {
resource.classification in ["confidential", "secret", "top_secret"] || resource.classification in ["confidential", "secret", "top_secret"] ||
resource has data_type && resource has data_type &&
resource.data_type in ["pii", "phi", "financial", "intellectual_property"] resource.data_type in ["pii", "phi", "financial", "intellectual_property"]
}; };

View File

@ -175,4 +175,4 @@ permit(principal, action, resource) when {
resource has geo_restricted || resource has geo_restricted ||
resource has data_classification in ["sensitive", "confidential", "restricted"] resource has data_classification in ["sensitive", "confidential", "restricted"]
) )
}; };

View File

@ -116,4 +116,4 @@ permit(
) when { ) when {
principal has role && principal has role &&
principal.role in ["MonitoringService", "AlertManager", "Observer"] principal.role in ["MonitoringService", "AlertManager", "Observer"]
}; };

View File

@ -82,4 +82,4 @@ permit(
principal.role in ["SRE", "MaintenanceTeam"] && principal.role in ["SRE", "MaintenanceTeam"] &&
principal has maintenance_approval && principal has maintenance_approval &&
principal.maintenance_approval.valid == true principal.maintenance_approval.valid == true
}; };

View File

@ -54,4 +54,4 @@ permit(
principal.mfa_exemption.approved == true && principal.mfa_exemption.approved == true &&
principal.mfa_exemption.expires_at > context.time.timestamp && principal.mfa_exemption.expires_at > context.time.timestamp &&
principal.mfa_exemption.justification != "" principal.mfa_exemption.justification != ""
}; };

View File

@ -119,4 +119,4 @@ permit(
principal.emergency_access.expires_at > context.time.timestamp && principal.emergency_access.expires_at > context.time.timestamp &&
principal.emergency_access.incident_level in ["critical", "high"] && principal.emergency_access.incident_level in ["critical", "high"] &&
principal.emergency_access.authorized_by in ["IncidentCommander", "CISO", "CTO"] principal.emergency_access.authorized_by in ["IncidentCommander", "CISO", "CTO"]
}; };

View File

@ -190,4 +190,4 @@
"change_control": true "change_control": true
} }
] ]
} }

View File

@ -154,4 +154,4 @@
} }
} }
] ]
} }

View File

@ -98,4 +98,4 @@ path = "src/lib.rs"
[[bench]] [[bench]]
name = "performance" name = "performance"
harness = false harness = false

View File

@ -381,19 +381,19 @@ impl ProvisioningMCPServer {
fn handle_create_server(&self) -> impl Fn(CallToolRequest) -> Result<CallToolResult> + '_ { fn handle_create_server(&self) -> impl Fn(CallToolRequest) -> Result<CallToolResult> + '_ {
|request: CallToolRequest| -> Result<CallToolResult> { |request: CallToolRequest| -> Result<CallToolResult> {
let arguments = request.params.arguments.unwrap_or_default(); let arguments = request.params.arguments.unwrap_or_default();
let description = arguments.get("description") let description = arguments.get("description")
.and_then(|v| v.as_str()) .and_then(|v| v.as_str())
.ok_or_else(|| ProvisioningError::InvalidInput("description is required".to_string()))?; .ok_or_else(|| ProvisioningError::InvalidInput("description is required".to_string()))?;
let infra_name = arguments.get("infra_name") let infra_name = arguments.get("infra_name")
.and_then(|v| v.as_str()) .and_then(|v| v.as_str())
.unwrap_or("ai-generated"); .unwrap_or("ai-generated");
let provider = arguments.get("provider") let provider = arguments.get("provider")
.and_then(|v| v.as_str()) .and_then(|v| v.as_str())
.unwrap_or("aws"); .unwrap_or("aws");
let check_mode = arguments.get("check_mode") let check_mode = arguments.get("check_mode")
.and_then(|v| v.as_bool()) .and_then(|v| v.as_bool())
.unwrap_or(true); .unwrap_or(true);
@ -428,7 +428,7 @@ impl ProvisioningMCPServer {
// Execute provisioning command // Execute provisioning command
let result = self.engine.create_server(&parsed_config, check_mode)?; let result = self.engine.create_server(&parsed_config, check_mode)?;
Ok(CallToolResult { Ok(CallToolResult {
content: vec![rust_mcp_sdk::schema::ContentBlock::TextContent(rust_mcp_sdk::schema::TextContent::from(format!("✅ Server creation completed:\n\n{}", result)))], content: vec![rust_mcp_sdk::schema::ContentBlock::TextContent(rust_mcp_sdk::schema::TextContent::from(format!("✅ Server creation completed:\n\n{}", result)))],
is_error: Some(false), is_error: Some(false),
@ -442,15 +442,15 @@ impl ProvisioningMCPServer {
fn handle_ai_template(&self) -> impl Fn(CallToolRequest) -> Result<CallToolResult> + '_ { fn handle_ai_template(&self) -> impl Fn(CallToolRequest) -> Result<CallToolResult> + '_ {
|request: CallToolRequest| -> Result<CallToolResult> { |request: CallToolRequest| -> Result<CallToolResult> {
let arguments = request.params.arguments.unwrap_or_default(); let arguments = request.params.arguments.unwrap_or_default();
let description = arguments.get("description") let description = arguments.get("description")
.and_then(|v| v.as_str()) .and_then(|v| v.as_str())
.ok_or_else(|| ProvisioningError::InvalidInput("description is required".to_string()))?; .ok_or_else(|| ProvisioningError::InvalidInput("description is required".to_string()))?;
let template_type = arguments.get("template_type") let template_type = arguments.get("template_type")
.and_then(|v| v.as_str()) .and_then(|v| v.as_str())
.ok_or_else(|| ProvisioningError::InvalidInput("template_type is required".to_string()))?; .ok_or_else(|| ProvisioningError::InvalidInput("template_type is required".to_string()))?;
let complexity = arguments.get("complexity") let complexity = arguments.get("complexity")
.and_then(|v| v.as_str()) .and_then(|v| v.as_str())
.unwrap_or("medium"); .unwrap_or("medium");
@ -458,7 +458,7 @@ impl ProvisioningMCPServer {
info!("Generating {} template: {}", template_type, description); info!("Generating {} template: {}", template_type, description);
let template = self.tools.generate_ai_template(description, template_type, complexity)?; let template = self.tools.generate_ai_template(description, template_type, complexity)?;
Ok(CallToolResult { Ok(CallToolResult {
content: vec![rust_mcp_sdk::schema::ContentBlock::TextContent(rust_mcp_sdk::schema::TextContent::from(format!("🤖 Generated {} template:\n\n```kcl\n{}\n```", template_type, template)))], content: vec![rust_mcp_sdk::schema::ContentBlock::TextContent(rust_mcp_sdk::schema::TextContent::from(format!("🤖 Generated {} template:\n\n```kcl\n{}\n```", template_type, template)))],
is_error: Some(false), is_error: Some(false),
@ -472,14 +472,14 @@ impl ProvisioningMCPServer {
fn handle_query(&self) -> impl Fn(CallToolRequest) -> Result<CallToolResult> + '_ { fn handle_query(&self) -> impl Fn(CallToolRequest) -> Result<CallToolResult> + '_ {
|request: CallToolRequest| -> Result<CallToolResult> { |request: CallToolRequest| -> Result<CallToolResult> {
let arguments = request.params.arguments.unwrap_or_default(); let arguments = request.params.arguments.unwrap_or_default();
let query = arguments.get("query") let query = arguments.get("query")
.and_then(|v| v.as_str()) .and_then(|v| v.as_str())
.ok_or_else(|| ProvisioningError::InvalidInput("query is required".to_string()))?; .ok_or_else(|| ProvisioningError::InvalidInput("query is required".to_string()))?;
let infra_name = arguments.get("infra_name") let infra_name = arguments.get("infra_name")
.and_then(|v| v.as_str()); .and_then(|v| v.as_str());
let output_format = arguments.get("output_format") let output_format = arguments.get("output_format")
.and_then(|v| v.as_str()) .and_then(|v| v.as_str())
.unwrap_or("human"); .unwrap_or("human");
@ -487,7 +487,7 @@ impl ProvisioningMCPServer {
info!("Processing query: {}", query); info!("Processing query: {}", query);
let result = self.engine.process_query(query, infra_name, output_format)?; let result = self.engine.process_query(query, infra_name, output_format)?;
Ok(CallToolResult { Ok(CallToolResult {
content: vec![rust_mcp_sdk::schema::ContentBlock::TextContent(rust_mcp_sdk::schema::TextContent::from(format!("🔍 Query result:\n\n{}", result)))], content: vec![rust_mcp_sdk::schema::ContentBlock::TextContent(rust_mcp_sdk::schema::TextContent::from(format!("🔍 Query result:\n\n{}", result)))],
is_error: Some(false), is_error: Some(false),
@ -501,19 +501,19 @@ impl ProvisioningMCPServer {
fn handle_deploy_taskserv(&self) -> impl Fn(CallToolRequest) -> Result<CallToolResult> + '_ { fn handle_deploy_taskserv(&self) -> impl Fn(CallToolRequest) -> Result<CallToolResult> + '_ {
|request: CallToolRequest| -> Result<CallToolResult> { |request: CallToolRequest| -> Result<CallToolResult> {
let arguments = request.params.arguments.unwrap_or_default(); let arguments = request.params.arguments.unwrap_or_default();
let service_name = arguments.get("service_name") let service_name = arguments.get("service_name")
.and_then(|v| v.as_str()) .and_then(|v| v.as_str())
.ok_or_else(|| ProvisioningError::InvalidInput("service_name is required".to_string()))?; .ok_or_else(|| ProvisioningError::InvalidInput("service_name is required".to_string()))?;
let infra_name = arguments.get("infra_name") let infra_name = arguments.get("infra_name")
.and_then(|v| v.as_str()) .and_then(|v| v.as_str())
.ok_or_else(|| ProvisioningError::InvalidInput("infra_name is required".to_string()))?; .ok_or_else(|| ProvisioningError::InvalidInput("infra_name is required".to_string()))?;
let configuration = arguments.get("configuration") let configuration = arguments.get("configuration")
.cloned() .cloned()
.unwrap_or_default(); .unwrap_or_default();
let check_mode = arguments.get("check_mode") let check_mode = arguments.get("check_mode")
.and_then(|v| v.as_bool()) .and_then(|v| v.as_bool())
.unwrap_or(true); .unwrap_or(true);
@ -521,7 +521,7 @@ impl ProvisioningMCPServer {
info!("Deploying service {} to infrastructure {}", service_name, infra_name); info!("Deploying service {} to infrastructure {}", service_name, infra_name);
let result = self.engine.deploy_taskserv(service_name, infra_name, &configuration, check_mode)?; let result = self.engine.deploy_taskserv(service_name, infra_name, &configuration, check_mode)?;
Ok(CallToolResult { Ok(CallToolResult {
content: vec![rust_mcp_sdk::schema::ContentBlock::TextContent(rust_mcp_sdk::schema::TextContent::from(format!("⚙️ Service deployment result:\n\n{}", result)))], content: vec![rust_mcp_sdk::schema::ContentBlock::TextContent(rust_mcp_sdk::schema::TextContent::from(format!("⚙️ Service deployment result:\n\n{}", result)))],
is_error: Some(false), is_error: Some(false),
@ -535,20 +535,20 @@ impl ProvisioningMCPServer {
fn handle_cluster_create(&self) -> impl Fn(CallToolRequest) -> Result<CallToolResult> + '_ { fn handle_cluster_create(&self) -> impl Fn(CallToolRequest) -> Result<CallToolResult> + '_ {
|request: CallToolRequest| -> Result<CallToolResult> { |request: CallToolRequest| -> Result<CallToolResult> {
let arguments = request.params.arguments.unwrap_or_default(); let arguments = request.params.arguments.unwrap_or_default();
let cluster_description = arguments.get("cluster_description") let cluster_description = arguments.get("cluster_description")
.and_then(|v| v.as_str()) .and_then(|v| v.as_str())
.ok_or_else(|| ProvisioningError::InvalidInput("cluster_description is required".to_string()))?; .ok_or_else(|| ProvisioningError::InvalidInput("cluster_description is required".to_string()))?;
let cluster_type = arguments.get("cluster_type") let cluster_type = arguments.get("cluster_type")
.and_then(|v| v.as_str()) .and_then(|v| v.as_str())
.ok_or_else(|| ProvisioningError::InvalidInput("cluster_type is required".to_string()))?; .ok_or_else(|| ProvisioningError::InvalidInput("cluster_type is required".to_string()))?;
let services = arguments.get("services") let services = arguments.get("services")
.and_then(|v| v.as_array()) .and_then(|v| v.as_array())
.map(|arr| arr.iter().filter_map(|v| v.as_str()).collect::<Vec<_>>()) .map(|arr| arr.iter().filter_map(|v| v.as_str()).collect::<Vec<_>>())
.unwrap_or_default(); .unwrap_or_default();
let infra_name = arguments.get("infra_name") let infra_name = arguments.get("infra_name")
.and_then(|v| v.as_str()) .and_then(|v| v.as_str())
.unwrap_or("ai-cluster"); .unwrap_or("ai-cluster");
@ -556,7 +556,7 @@ impl ProvisioningMCPServer {
info!("Creating {} cluster: {}", cluster_type, cluster_description); info!("Creating {} cluster: {}", cluster_type, cluster_description);
let result = self.engine.create_cluster(cluster_description, cluster_type, &services, infra_name)?; let result = self.engine.create_cluster(cluster_description, cluster_type, &services, infra_name)?;
Ok(CallToolResult { Ok(CallToolResult {
content: vec![rust_mcp_sdk::schema::ContentBlock::TextContent(rust_mcp_sdk::schema::TextContent::from(format!("🚢 Cluster creation result:\n\n{}", result)))], content: vec![rust_mcp_sdk::schema::ContentBlock::TextContent(rust_mcp_sdk::schema::TextContent::from(format!("🚢 Cluster creation result:\n\n{}", result)))],
is_error: Some(false), is_error: Some(false),
@ -570,10 +570,10 @@ impl ProvisioningMCPServer {
fn handle_status(&self) -> impl Fn(CallToolRequest) -> Result<CallToolResult> + '_ { fn handle_status(&self) -> impl Fn(CallToolRequest) -> Result<CallToolResult> + '_ {
|request: CallToolRequest| -> Result<CallToolResult> { |request: CallToolRequest| -> Result<CallToolResult> {
let arguments = request.params.arguments.unwrap_or_default(); let arguments = request.params.arguments.unwrap_or_default();
let infra_name = arguments.get("infra_name") let infra_name = arguments.get("infra_name")
.and_then(|v| v.as_str()); .and_then(|v| v.as_str());
let detailed = arguments.get("detailed") let detailed = arguments.get("detailed")
.and_then(|v| v.as_bool()) .and_then(|v| v.as_bool())
.unwrap_or(false); .unwrap_or(false);
@ -581,7 +581,7 @@ impl ProvisioningMCPServer {
info!("Getting status for infrastructure: {:?}", infra_name); info!("Getting status for infrastructure: {:?}", infra_name);
let result = self.engine.get_status(infra_name, detailed)?; let result = self.engine.get_status(infra_name, detailed)?;
Ok(CallToolResult { Ok(CallToolResult {
content: vec![rust_mcp_sdk::schema::ContentBlock::TextContent(rust_mcp_sdk::schema::TextContent::from(format!("📊 Infrastructure status:\n\n{}", result)))], content: vec![rust_mcp_sdk::schema::ContentBlock::TextContent(rust_mcp_sdk::schema::TextContent::from(format!("📊 Infrastructure status:\n\n{}", result)))],
is_error: Some(false), is_error: Some(false),
@ -595,11 +595,11 @@ impl ProvisioningMCPServer {
fn handle_ai_config(&self) -> impl Fn(CallToolRequest) -> Result<CallToolResult> + '_ { fn handle_ai_config(&self) -> impl Fn(CallToolRequest) -> Result<CallToolResult> + '_ {
|request: CallToolRequest| -> Result<CallToolResult> { |request: CallToolRequest| -> Result<CallToolResult> {
let arguments = request.params.arguments.unwrap_or_default(); let arguments = request.params.arguments.unwrap_or_default();
let action = arguments.get("action") let action = arguments.get("action")
.and_then(|v| v.as_str()) .and_then(|v| v.as_str())
.ok_or_else(|| ProvisioningError::InvalidInput("action is required".to_string()))?; .ok_or_else(|| ProvisioningError::InvalidInput("action is required".to_string()))?;
let provider = arguments.get("provider") let provider = arguments.get("provider")
.and_then(|v| v.as_str()); .and_then(|v| v.as_str());
@ -608,7 +608,7 @@ impl ProvisioningMCPServer {
let result = match action { let result = match action {
"status" => self.tools.get_ai_status()?, "status" => self.tools.get_ai_status()?,
"configure" => { "configure" => {
let provider = provider.ok_or_else(|| let provider = provider.ok_or_else(||
ProvisioningError::InvalidInput("provider is required for configure action".to_string()) ProvisioningError::InvalidInput("provider is required for configure action".to_string())
)?; )?;
self.tools.configure_ai(provider)? self.tools.configure_ai(provider)?
@ -616,7 +616,7 @@ impl ProvisioningMCPServer {
"test" => self.tools.test_ai_connection()?, "test" => self.tools.test_ai_connection()?,
_ => return Err(ProvisioningError::InvalidInput(format!("Unknown action: {}", action)).into()), _ => return Err(ProvisioningError::InvalidInput(format!("Unknown action: {}", action)).into()),
}; };
Ok(CallToolResult { Ok(CallToolResult {
content: vec![rust_mcp_sdk::schema::ContentBlock::TextContent(rust_mcp_sdk::schema::TextContent::from(format!("🤖 AI configuration result:\n\n{}", result)))], content: vec![rust_mcp_sdk::schema::ContentBlock::TextContent(rust_mcp_sdk::schema::TextContent::from(format!("🤖 AI configuration result:\n\n{}", result)))],
is_error: Some(false), is_error: Some(false),
@ -1412,13 +1412,13 @@ async fn main() -> Result<()> {
// Load configuration // Load configuration
let config = Config::load(args.config, args.provisioning_path, args.debug)?; let config = Config::load(args.config, args.provisioning_path, args.debug)?;
info!("Starting Provisioning MCP Server (Rust-native)"); info!("Starting Provisioning MCP Server (Rust-native)");
info!("Provisioning path: {}", config.provisioning_path.display()); info!("Provisioning path: {}", config.provisioning_path.display());
// Create and run server // Create and run server
let server = ProvisioningMCPServer::new(config)?; let server = ProvisioningMCPServer::new(config)?;
server.run().await?; server.run().await?;
Ok(()) Ok(())
} }

View File

@ -585,4 +585,4 @@ pub fn get_provisioning_tools() -> Vec<Tool> {
}) })
} }
] ]
} }

View File

@ -39,4 +39,4 @@ rustflags = [
rustflags = [ rustflags = [
"-W", "unused-extern-crates", "-W", "unused-extern-crates",
"-W", "rust-2021-compatibility" "-W", "rust-2021-compatibility"
] ]

View File

@ -165,4 +165,4 @@ harness = false
[[bench]] [[bench]]
name = "migration_benchmarks" name = "migration_benchmarks"
harness = false harness = false

View File

@ -16,4 +16,4 @@
"completed_at": "2025-09-25T03:06:56.269978Z", "completed_at": "2025-09-25T03:06:56.269978Z",
"output": null, "output": null,
"error": "Nushell command failed: fatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nError: nu::parser::unknown_flag\n\n x The `provisioning taskserv` command doesn't have flag `infra`.\n ,-[<commandline>:1:33]\n 1 | main taskserv create kubernetes --infra wuji --settings --check\n : ^^^|^^^\n : `-- unknown flag\n `----\n help: Use `--help` to see available flags\n\n" "error": "Nushell command failed: fatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nError: nu::parser::unknown_flag\n\n x The `provisioning taskserv` command doesn't have flag `infra`.\n ,-[<commandline>:1:33]\n 1 | main taskserv create kubernetes --infra wuji --settings --check\n : ^^^|^^^\n : `-- unknown flag\n `----\n help: Use `--help` to see available flags\n\n"
} }

View File

@ -16,4 +16,4 @@
"completed_at": "2025-09-25T03:07:02.703838Z", "completed_at": "2025-09-25T03:07:02.703838Z",
"output": null, "output": null,
"error": "Nushell command failed: fatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nError: nu::parser::export_not_found\n\n x Export not found.\n ,-[/Users/Akasha/repo-cnz/src/provisioning/core/nulib/clusters/handlers.nu:1:14]\n 1 | use utils.nu servers_selector\n : ^^^^^^^^|^^^^^^^\n : `-- could not find imports\n 2 | use ../lib_provisioning/config/accessor.nu *\n `----\n\n" "error": "Nushell command failed: fatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git\nError: nu::parser::export_not_found\n\n x Export not found.\n ,-[/Users/Akasha/repo-cnz/src/provisioning/core/nulib/clusters/handlers.nu:1:14]\n 1 | use utils.nu servers_selector\n : ^^^^^^^^|^^^^^^^\n : `-- could not find imports\n 2 | use ../lib_provisioning/config/accessor.nu *\n `----\n\n"
} }

File diff suppressed because one or more lines are too long

View File

@ -15,4 +15,4 @@
"completed_at": "2025-09-25T02:55:53.853524Z", "completed_at": "2025-09-25T02:55:53.853524Z",
"output": null, "output": null,
"error": "Nushell command failed: Error: nu::shell::external_command\n\n x External command failed\n ,-[source:1:1]\n 1 | ./core/nulib/provisioning server create --infra wuji --settings --check\n : ^^^^^^^^^^^^|^^^^^^^^^^^^\n : `-- Command `./core/nulib/provisioning` not found\n `----\n help: `./core/nulib/provisioning` is neither a Nushell built-in or a known\n external command\n\n" "error": "Nushell command failed: Error: nu::shell::external_command\n\n x External command failed\n ,-[source:1:1]\n 1 | ./core/nulib/provisioning server create --infra wuji --settings --check\n : ^^^^^^^^^^^^|^^^^^^^^^^^^\n : `-- Command `./core/nulib/provisioning` not found\n `----\n help: `./core/nulib/provisioning` is neither a Nushell built-in or a known\n external command\n\n"
} }

View File

@ -14,4 +14,4 @@
"completed_at": "2025-09-26T04:04:18.653061Z", "completed_at": "2025-09-26T04:04:18.653061Z",
"output": null, "output": null,
"error": "Nushell command failed: Error: nu::parser::unknown_flag\n\n x The `provisioning taskserv` command doesn't have flag `infra`.\n ,-[<commandline>:1:29]\n 1 | main taskserv check-updates --infra --settings --check\n : ^^^|^^^\n : `-- unknown flag\n `----\n help: Use `--help` to see available flags\n\n" "error": "Nushell command failed: Error: nu::parser::unknown_flag\n\n x The `provisioning taskserv` command doesn't have flag `infra`.\n ,-[<commandline>:1:29]\n 1 | main taskserv check-updates --infra --settings --check\n : ^^^|^^^\n : `-- unknown flag\n `----\n help: Use `--help` to see available flags\n\n"
} }

View File

@ -17,4 +17,4 @@ Storage-specific cleanup commands:
- For SurrealDB embedded: Delete database files in target directory - For SurrealDB embedded: Delete database files in target directory
- For SurrealDB server: Connect and drop/recreate database - For SurrealDB server: Connect and drop/recreate database
IMPORTANT: Test data integrity before resuming operations! IMPORTANT: Test data integrity before resuming operations!

View File

@ -17,4 +17,4 @@ Storage-specific cleanup commands:
- For SurrealDB embedded: Delete database files in target directory - For SurrealDB embedded: Delete database files in target directory
- For SurrealDB server: Connect and drop/recreate database - For SurrealDB server: Connect and drop/recreate database
IMPORTANT: Test data integrity before resuming operations! IMPORTANT: Test data integrity before resuming operations!

View File

@ -17,4 +17,4 @@ Storage-specific cleanup commands:
- For SurrealDB embedded: Delete database files in target directory - For SurrealDB embedded: Delete database files in target directory
- For SurrealDB server: Connect and drop/recreate database - For SurrealDB server: Connect and drop/recreate database
IMPORTANT: Test data integrity before resuming operations! IMPORTANT: Test data integrity before resuming operations!

View File

@ -17,4 +17,4 @@ Storage-specific cleanup commands:
- For SurrealDB embedded: Delete database files in target directory - For SurrealDB embedded: Delete database files in target directory
- For SurrealDB server: Connect and drop/recreate database - For SurrealDB server: Connect and drop/recreate database
IMPORTANT: Test data integrity before resuming operations! IMPORTANT: Test data integrity before resuming operations!

View File

@ -17,4 +17,4 @@ Storage-specific cleanup commands:
- For SurrealDB embedded: Delete database files in target directory - For SurrealDB embedded: Delete database files in target directory
- For SurrealDB server: Connect and drop/recreate database - For SurrealDB server: Connect and drop/recreate database
IMPORTANT: Test data integrity before resuming operations! IMPORTANT: Test data integrity before resuming operations!

View File

@ -17,4 +17,4 @@ Storage-specific cleanup commands:
- For SurrealDB embedded: Delete database files in target directory - For SurrealDB embedded: Delete database files in target directory
- For SurrealDB server: Connect and drop/recreate database - For SurrealDB server: Connect and drop/recreate database
IMPORTANT: Test data integrity before resuming operations! IMPORTANT: Test data integrity before resuming operations!

View File

@ -17,4 +17,4 @@ Storage-specific cleanup commands:
- For SurrealDB embedded: Delete database files in target directory - For SurrealDB embedded: Delete database files in target directory
- For SurrealDB server: Connect and drop/recreate database - For SurrealDB server: Connect and drop/recreate database
IMPORTANT: Test data integrity before resuming operations! IMPORTANT: Test data integrity before resuming operations!

View File

@ -634,4 +634,4 @@ def "migrate status" [] {
} catch { } catch {
print "No active migrations found or binary not available" print "No active migrations found or binary not available"
} }
} }

View File

@ -194,4 +194,4 @@ def check_orchestrator_status [pid_file: string, port: int = 9090] {
} else { } else {
print "⚠️ Could not connect to orchestrator API" print "⚠️ Could not connect to orchestrator API"
} }
} }

View File

@ -175,4 +175,4 @@ impl Default for MetricsCollector {
fn default() -> Self { fn default() -> Self {
Self::new() Self::new()
} }
} }

View File

@ -382,4 +382,4 @@ DEFINE FUNCTION fn::cleanup_metrics($older_than_days: number) {
LET $deleted_metrics = DELETE metrics WHERE timestamp < $cutoff_time; LET $deleted_metrics = DELETE metrics WHERE timestamp < $cutoff_time;
RETURN array::len($deleted_metrics); RETURN array::len($deleted_metrics);
}; };

View File

@ -17,4 +17,4 @@ Storage-specific cleanup commands:
- For SurrealDB embedded: Delete database files in target directory - For SurrealDB embedded: Delete database files in target directory
- For SurrealDB server: Connect and drop/recreate database - For SurrealDB server: Connect and drop/recreate database
IMPORTANT: Test data integrity before resuming operations! IMPORTANT: Test data integrity before resuming operations!

View File

@ -17,4 +17,4 @@ Storage-specific cleanup commands:
- For SurrealDB embedded: Delete database files in target directory - For SurrealDB embedded: Delete database files in target directory
- For SurrealDB server: Connect and drop/recreate database - For SurrealDB server: Connect and drop/recreate database
IMPORTANT: Test data integrity before resuming operations! IMPORTANT: Test data integrity before resuming operations!