feat: update dependencies and improve development commands in Justfile

This commit is contained in:
GW_MC
2026-03-03 04:49:26 +00:00
parent 31f1d8309d
commit 091743bb51
3 changed files with 12 additions and 25 deletions

17
Cargo.lock generated
View File

@@ -2445,23 +2445,6 @@ dependencies = [
"uuid",
]
[[package]]
name = "nxmesh-cli"
version = "0.1.0"
dependencies = [
"clap",
"config",
"nxmesh-core",
"reqwest",
"serde",
"serde_json",
"thiserror 1.0.69",
"tokio",
"tokio-test",
"tracing",
"tracing-subscriber",
]
[[package]]
name = "nxmesh-core"
version = "0.1.0"

View File

@@ -13,7 +13,7 @@ use std::pin::Pin;
use tracing::{error, info, warn};
use uuid::Uuid;
use crate::db::entities::agent;
use crate::db::entities::agents;
use crate::db::Database;
/// Agent service implementation
@@ -36,9 +36,9 @@ impl AgentServiceImpl {
// TODO: Validate token properly
// For now, create a new agent record
let agent_id = Uuid::new_v4();
let now = Utc::now();
let agent = agent::ActiveModel {
let agent = agents::ActiveModel {
id: Set(agent_id),
workspace_id: Set(Uuid::nil()), // TODO: Get from token
name: Set(request.hostname.clone()),
@@ -78,7 +78,7 @@ impl AgentServiceImpl {
// Update agent's last_seen_at
let now = Utc::now();
let agent = agent::ActiveModel {
let agent = agents::ActiveModel {
id: Set(agent_uuid),
last_seen_at: Set(Some(now.into())),
..Default::default()
@@ -115,7 +115,7 @@ impl AgentService for AgentServiceImpl {
let output_stream = async_stream::try_stream! {
while let Some(result) = stream.message().await? {
let msg = result;
// Handle different message types via payload
if let Some(payload) = msg.payload {
use nxmesh_proto::agent_message::Payload;
@@ -165,7 +165,7 @@ impl AgentService for AgentServiceImpl {
.and_then(|v| v.to_str().ok())
.unwrap_or("unknown")
.to_string();
let report = request.into_inner();
self.handle_health_report(report, &agent_id).await?;

View File

@@ -22,7 +22,7 @@ setup-rust-tools:
@echo "📦 Installing Rust dependencies..."
cargo fetch
@echo "🔧 Installing cargo tools..."
cargo install --locked
cargo install --locked cargo-watch sea-orm-cli 2>/dev/null || true
# Setup frontend dependencies
setup-frontend:
@@ -43,13 +43,17 @@ dev:
# Start Rust backend with hot reload
dev-backend:
@echo "🔧 Starting Rust backend..."
cargo watch -x run
cargo watch --ignore frontend --ignore migration -x 'run --bin nxmesh-master'
dev-api: dev-backend
# Start Vite frontend development server
dev-frontend:
@echo "⚛️ Starting Vite frontend..."
cd frontend && bun dev
dev-ui: dev-frontend
# Start services (called by devcontainer post-start)
start-services:
@echo "🔧 Ensuring services are ready..."