Expose /jobs, /dedup, and /events routes backed by a new EventBus that broadcasts job lifecycle and per-job progress over SSE. Serve a static dashboard from front/ that lists pending and in-progress jobs, streams agent activity, and shows completed reviews. Also add migrate-apply/migrate-generate scripts that load .env, update the Containerfile to ship the front assets and use the apply script, and refresh the roadmap.
This commit is contained in:
1 parent
8c763786c1
commit
7493de6952
32 files changed
+1681
-61
No files matched your search
@@ -1,8 +1,8 @@
|
||||
use std::time::Duration;
|
||||
|
||||
use crate::{
|
||||
bot::Bot, dedup::Dedup, gitea::GiteaAPI, job_queue::JobQueue, open_router::OpenRouterClient,
|
||||
sandbox::SandboxConfig, state::AppState,
|
||||
bot::Bot, dedup::Dedup, event_bus::EventBus, gitea::GiteaAPI, job_queue::JobQueue,
|
||||
open_router::OpenRouterClient, sandbox::SandboxConfig, state::AppState,
|
||||
};
|
||||
|
||||
use dotenvy::dotenv;
|
||||
@@ -19,6 +19,7 @@ mod db;
|
||||
mod dedup;
|
||||
mod env;
|
||||
mod errors;
|
||||
mod event_bus;
|
||||
mod gitea;
|
||||
mod job_queue;
|
||||
mod metrics;
|
||||
@@ -126,6 +127,7 @@ async fn run() -> anyhow::Result<()> {
|
||||
let db = db::connect(&config.database_url).await?;
|
||||
let dedup = Dedup::new(db.clone());
|
||||
let queue = JobQueue::new(db);
|
||||
let event_bus = EventBus::new();
|
||||
|
||||
let bot = Bot::new(
|
||||
gitea_api,
|
||||
@@ -135,13 +137,16 @@ async fn run() -> anyhow::Result<()> {
|
||||
sandbox,
|
||||
dedup.clone(),
|
||||
queue.clone(),
|
||||
event_bus.clone(),
|
||||
);
|
||||
|
||||
let app_state = AppState {
|
||||
queue,
|
||||
dedup,
|
||||
event_bus,
|
||||
bot_name: gitea_user.login.clone(),
|
||||
config,
|
||||
shutdown: shutdown.clone(),
|
||||
};
|
||||
|
||||
let signal = async {
|
||||
@@ -166,7 +171,7 @@ async fn run() -> anyhow::Result<()> {
|
||||
result = async {
|
||||
tokio::try_join!(
|
||||
bot.start(shutdown.clone()),
|
||||
api::start(app_state, shutdown.clone()),
|
||||
api::start(app_state),
|
||||
signal
|
||||
)
|
||||
} => {
|
||||
|
||||
Reference in new issue
Block a user