Skip to content

Commit 09d7d64

Browse files
committed
Add account usage panel
1 parent d95efc5 commit 09d7d64

6 files changed

Lines changed: 700 additions & 36 deletions

File tree

apps/kimi-code/src-tauri/src/lib.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ use kimi_code_agent_core_v2::{
1313
app::{
1414
desktop_client::{
1515
DesktopAuthStatus, DesktopContextUsage, DesktopDeviceCode, DesktopInteraction,
16-
DesktopMessagePage, DesktopModel, DesktopPrepareSessionRequest, DesktopPreparedSession,
17-
DesktopWorkspace, KimiCodeDesktopClient,
16+
DesktopManagedUsage, DesktopMessagePage, DesktopModel, DesktopPrepareSessionRequest,
17+
DesktopPreparedSession, DesktopWorkspace, KimiCodeDesktopClient,
1818
},
1919
session_index::SessionSummary,
2020
},
@@ -71,6 +71,11 @@ async fn auth_status(state: State<'_, AppState>) -> Result<DesktopAuthStatus, St
7171
state.client.auth_status().await
7272
}
7373

74+
#[tauri::command]
75+
async fn account_usage(state: State<'_, AppState>) -> Result<DesktopManagedUsage, String> {
76+
state.client.managed_usage().await
77+
}
78+
7479
#[tauri::command]
7580
async fn login(app: AppHandle, state: State<'_, AppState>) -> Result<DesktopAuthStatus, String> {
7681
let app_for_event = app.clone();
@@ -271,6 +276,7 @@ pub fn run() {
271276
})
272277
.invoke_handler(tauri::generate_handler![
273278
auth_status,
279+
account_usage,
274280
login,
275281
logout,
276282
list_models,

0 commit comments

Comments
 (0)