feat(pro): add analytics, export, and multi-account commercial features
3 new agor-pro modules: analytics.rs (usage dashboard queries), export.rs (session/project Markdown report generation), profiles.rs (multi-account switching via accounts.json). 9 Tauri plugin commands. Frontend IPC bridge (pro-bridge.ts). 168 cargo tests, 14 commercial vitest tests.
This commit is contained in:
parent
6973c70c5a
commit
03fe2e2237
8 changed files with 805 additions and 3 deletions
|
|
@ -4,17 +4,27 @@
|
|||
// This crate is NOT open-source. It is distributed only via the
|
||||
// agents-orchestrator/agents-orchestrator private repository.
|
||||
|
||||
mod analytics;
|
||||
mod export;
|
||||
mod profiles;
|
||||
|
||||
use tauri::{
|
||||
plugin::{Builder, TauriPlugin},
|
||||
Runtime,
|
||||
};
|
||||
|
||||
/// Initialize the agor-pro Tauri plugin.
|
||||
/// Registers all commercial commands and managed state.
|
||||
pub fn init<R: Runtime>() -> TauriPlugin<R> {
|
||||
Builder::new("agor-pro")
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
pro_status,
|
||||
analytics::pro_analytics_summary,
|
||||
analytics::pro_analytics_daily,
|
||||
analytics::pro_analytics_model_breakdown,
|
||||
export::pro_export_session,
|
||||
export::pro_export_project_summary,
|
||||
profiles::pro_list_accounts,
|
||||
profiles::pro_get_active_account,
|
||||
profiles::pro_set_active_account,
|
||||
])
|
||||
.build()
|
||||
}
|
||||
|
|
@ -24,6 +34,14 @@ fn pro_status() -> String {
|
|||
"active".to_string()
|
||||
}
|
||||
|
||||
/// Open the sessions.db for the current data directory.
|
||||
fn open_sessions_db() -> Result<rusqlite::Connection, String> {
|
||||
let config = agor_core::config::AppConfig::from_env();
|
||||
let db_path = config.data_dir.join("sessions.db");
|
||||
rusqlite::Connection::open(&db_path)
|
||||
.map_err(|e| format!("Failed to open sessions.db: {e}"))
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue