3237ad140a
为 Supervisor 与部门 Director 接入统一 Interaction Loop 和持久 Runtime 调度 在配置画布 API Key 时强制委派美术 Agent 并复用规范素材 收紧画布生成角色权限、图片内容校验和项目锁并发边界 完善专业 Agent revision 验证、任务恢复与 Provider 兼容处理 补充自主协作、真实画布生成、运行时收束测试及技术文档
71 lines
1.7 KiB
Rust
71 lines
1.7 KiB
Rust
use super::*;
|
|
use std::collections::{BTreeMap, BTreeSet};
|
|
use std::io::{BufRead, Write};
|
|
use std::sync::mpsc::{self, Receiver, RecvTimeoutError};
|
|
use std::time::{Duration, Instant};
|
|
|
|
mod commands;
|
|
mod conversation;
|
|
mod goal_commands;
|
|
mod input;
|
|
mod observer;
|
|
mod report;
|
|
mod terminal_classification;
|
|
mod turn_dispatch;
|
|
mod turn_wait;
|
|
|
|
use commands::*;
|
|
use conversation::*;
|
|
use goal_commands::*;
|
|
use input::*;
|
|
use observer::*;
|
|
use report::*;
|
|
use terminal_classification::*;
|
|
use turn_dispatch::*;
|
|
use turn_wait::*;
|
|
|
|
#[cfg(test)]
|
|
mod tests;
|
|
|
|
pub(crate) fn run_game_creator_swarm_chat_at(
|
|
root: &Path,
|
|
parent_agent_id: &str,
|
|
run_profile: &str,
|
|
) -> Result<(), String> {
|
|
let (input_tx, input_rx) = mpsc::channel();
|
|
std::thread::spawn(move || {
|
|
let stdin = std::io::stdin();
|
|
let mut input = stdin.lock();
|
|
loop {
|
|
let mut line = String::new();
|
|
match input.read_line(&mut line) {
|
|
Ok(0) => {
|
|
let _ = input_tx.send(SwarmInputEvent::Eof);
|
|
break;
|
|
}
|
|
Ok(_) => {
|
|
if input_tx
|
|
.send(SwarmInputEvent::Line(line.trim().to_string()))
|
|
.is_err()
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
Err(error) => {
|
|
let _ = input_tx.send(SwarmInputEvent::Error(error.to_string()));
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
});
|
|
let stdout = std::io::stdout();
|
|
let mut output = stdout.lock();
|
|
run_game_creator_swarm_chat_with_input(
|
|
root,
|
|
parent_agent_id,
|
|
run_profile,
|
|
&input_rx,
|
|
&mut output,
|
|
)
|
|
}
|