feat: update dependencies and improve development commands in Justfile
This commit is contained in:
17
Cargo.lock
generated
17
Cargo.lock
generated
@@ -2445,23 +2445,6 @@ dependencies = [
|
|||||||
"uuid",
|
"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]]
|
[[package]]
|
||||||
name = "nxmesh-core"
|
name = "nxmesh-core"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ use std::pin::Pin;
|
|||||||
use tracing::{error, info, warn};
|
use tracing::{error, info, warn};
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
use crate::db::entities::agent;
|
use crate::db::entities::agents;
|
||||||
use crate::db::Database;
|
use crate::db::Database;
|
||||||
|
|
||||||
/// Agent service implementation
|
/// Agent service implementation
|
||||||
@@ -36,9 +36,9 @@ impl AgentServiceImpl {
|
|||||||
// TODO: Validate token properly
|
// TODO: Validate token properly
|
||||||
// For now, create a new agent record
|
// For now, create a new agent record
|
||||||
let agent_id = Uuid::new_v4();
|
let agent_id = Uuid::new_v4();
|
||||||
|
|
||||||
let now = Utc::now();
|
let now = Utc::now();
|
||||||
let agent = agent::ActiveModel {
|
let agent = agents::ActiveModel {
|
||||||
id: Set(agent_id),
|
id: Set(agent_id),
|
||||||
workspace_id: Set(Uuid::nil()), // TODO: Get from token
|
workspace_id: Set(Uuid::nil()), // TODO: Get from token
|
||||||
name: Set(request.hostname.clone()),
|
name: Set(request.hostname.clone()),
|
||||||
@@ -78,7 +78,7 @@ impl AgentServiceImpl {
|
|||||||
|
|
||||||
// Update agent's last_seen_at
|
// Update agent's last_seen_at
|
||||||
let now = Utc::now();
|
let now = Utc::now();
|
||||||
let agent = agent::ActiveModel {
|
let agent = agents::ActiveModel {
|
||||||
id: Set(agent_uuid),
|
id: Set(agent_uuid),
|
||||||
last_seen_at: Set(Some(now.into())),
|
last_seen_at: Set(Some(now.into())),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
@@ -115,7 +115,7 @@ impl AgentService for AgentServiceImpl {
|
|||||||
let output_stream = async_stream::try_stream! {
|
let output_stream = async_stream::try_stream! {
|
||||||
while let Some(result) = stream.message().await? {
|
while let Some(result) = stream.message().await? {
|
||||||
let msg = result;
|
let msg = result;
|
||||||
|
|
||||||
// Handle different message types via payload
|
// Handle different message types via payload
|
||||||
if let Some(payload) = msg.payload {
|
if let Some(payload) = msg.payload {
|
||||||
use nxmesh_proto::agent_message::Payload;
|
use nxmesh_proto::agent_message::Payload;
|
||||||
@@ -165,7 +165,7 @@ impl AgentService for AgentServiceImpl {
|
|||||||
.and_then(|v| v.to_str().ok())
|
.and_then(|v| v.to_str().ok())
|
||||||
.unwrap_or("unknown")
|
.unwrap_or("unknown")
|
||||||
.to_string();
|
.to_string();
|
||||||
|
|
||||||
let report = request.into_inner();
|
let report = request.into_inner();
|
||||||
|
|
||||||
self.handle_health_report(report, &agent_id).await?;
|
self.handle_health_report(report, &agent_id).await?;
|
||||||
|
|||||||
8
justfile
8
justfile
@@ -22,7 +22,7 @@ setup-rust-tools:
|
|||||||
@echo "📦 Installing Rust dependencies..."
|
@echo "📦 Installing Rust dependencies..."
|
||||||
cargo fetch
|
cargo fetch
|
||||||
@echo "🔧 Installing cargo tools..."
|
@echo "🔧 Installing cargo tools..."
|
||||||
cargo install --locked
|
cargo install --locked cargo-watch sea-orm-cli 2>/dev/null || true
|
||||||
|
|
||||||
# Setup frontend dependencies
|
# Setup frontend dependencies
|
||||||
setup-frontend:
|
setup-frontend:
|
||||||
@@ -43,13 +43,17 @@ dev:
|
|||||||
# Start Rust backend with hot reload
|
# Start Rust backend with hot reload
|
||||||
dev-backend:
|
dev-backend:
|
||||||
@echo "🔧 Starting Rust 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
|
# Start Vite frontend development server
|
||||||
dev-frontend:
|
dev-frontend:
|
||||||
@echo "⚛️ Starting Vite frontend..."
|
@echo "⚛️ Starting Vite frontend..."
|
||||||
cd frontend && bun dev
|
cd frontend && bun dev
|
||||||
|
|
||||||
|
dev-ui: dev-frontend
|
||||||
|
|
||||||
# Start services (called by devcontainer post-start)
|
# Start services (called by devcontainer post-start)
|
||||||
start-services:
|
start-services:
|
||||||
@echo "🔧 Ensuring services are ready..."
|
@echo "🔧 Ensuring services are ready..."
|
||||||
|
|||||||
Reference in New Issue
Block a user