68a19c393e
Proves that spawning `claude -p` in a pseudo-terminal from Rust gets Max subscription billing (apiKeySource: "none", rateLimitType: "five_hour") instead of per-token API charges. Concurrent agents run in parallel PTY sessions with session resumption via --resume for multi-turn conversations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
21 lines
545 B
Rust
21 lines
545 B
Rust
use crate::agents::AgentPool;
|
|
use crate::state::SessionState;
|
|
use crate::store::JsonFileStore;
|
|
use crate::workflow::WorkflowState;
|
|
use poem::http::StatusCode;
|
|
use std::sync::Arc;
|
|
|
|
#[derive(Clone)]
|
|
pub struct AppContext {
|
|
pub state: Arc<SessionState>,
|
|
pub store: Arc<JsonFileStore>,
|
|
pub workflow: Arc<std::sync::Mutex<WorkflowState>>,
|
|
pub agents: Arc<AgentPool>,
|
|
}
|
|
|
|
pub type OpenApiResult<T> = poem::Result<T>;
|
|
|
|
pub fn bad_request(message: String) -> poem::Error {
|
|
poem::Error::from_string(message, StatusCode::BAD_REQUEST)
|
|
}
|