收口 MinerU OCR 任务链与上下文

This commit is contained in:
lix-2026
2026-06-01 10:30:42 +08:00
parent 1481de2018
commit 610b23d3a5
13 changed files with 710 additions and 55 deletions
+7 -1
View File
@@ -9,9 +9,10 @@ use axum::middleware::Next;
use axum::response::Response;
use axum::Router;
use control_plane::{ControlPlaneStore, SqliteControlPlaneStore};
use std::collections::BTreeMap;
use std::env;
use std::fs;
use std::sync::Arc;
use std::sync::{Arc, RwLock};
use tower_http::trace::TraceLayer;
use tracing::{error, warn};
@@ -139,6 +140,8 @@ pub struct AppState {
pub editor_actor: EditorRuntimeActor,
pub block_delta_tx: broadcast::Sender<serde_json::Value>,
pub stream_delta_tx: broadcast::Sender<serde_json::Value>,
pub local_ocr_job_tx: broadcast::Sender<serde_json::Value>,
pub local_ocr_active_jobs: Arc<RwLock<BTreeMap<String, serde_json::Value>>>,
pub acp_runtime: Arc<AcpRuntimeManager>,
pub buffer_store: BufferStore,
control_plane: Arc<SqliteControlPlaneStore>,
@@ -148,6 +151,7 @@ impl AppState {
pub fn new(config: AppConfig) -> Self {
let (block_delta_tx, _) = broadcast::channel(256);
let (stream_delta_tx, _) = broadcast::channel(256);
let (local_ocr_job_tx, _) = broadcast::channel(256);
let actor = EditorRuntimeActor::new();
actor.set_block_delta_tx(block_delta_tx.clone());
let buffer_store = BufferStore::new();
@@ -158,6 +162,8 @@ impl AppState {
editor_actor: actor,
block_delta_tx,
stream_delta_tx,
local_ocr_job_tx,
local_ocr_active_jobs: Arc::new(RwLock::new(BTreeMap::new())),
acp_runtime: Arc::new(AcpRuntimeManager::from_env()),
buffer_store,
control_plane,