forked from 1jehuang/jcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib.rs
More file actions
103 lines (97 loc) · 2.03 KB
/
lib.rs
File metadata and controls
103 lines (97 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#![allow(
unknown_lints,
clippy::collapsible_match,
clippy::manual_checked_ops,
clippy::unnecessary_sort_by,
clippy::useless_conversion
)]
pub mod agent;
pub mod ambient;
pub mod ambient_runner;
pub mod ambient_scheduler;
pub mod auth;
pub mod background;
pub mod browser;
pub mod build;
pub mod bus;
pub mod cache_tracker;
pub mod catchup;
pub mod channel;
pub mod cli;
pub mod compaction;
pub mod config;
pub mod copilot_usage;
pub mod dictation;
#[cfg(feature = "embeddings")]
pub mod embedding;
#[cfg(not(feature = "embeddings"))]
pub mod embedding_stub;
#[cfg(not(feature = "embeddings"))]
pub use embedding_stub as embedding;
pub mod env;
pub mod gateway;
pub mod gmail;
pub mod goal;
pub mod id;
pub mod import;
pub mod logging;
pub mod login_qr;
pub mod mcp;
pub mod memory;
pub mod memory_agent;
pub mod memory_graph;
pub mod memory_log;
pub mod memory_types;
pub mod message;
pub mod notifications;
pub mod overnight;
pub mod perf;
pub mod plan;
pub mod platform;
pub mod process_memory;
pub mod process_title;
pub mod prompt;
pub mod protocol;
pub mod provider;
pub mod provider_catalog;
pub mod registry;
pub mod replay;
pub mod restart_snapshot;
pub mod runtime_memory_log;
pub mod safety;
pub mod server;
pub mod session;
pub mod setup_hints;
pub mod side_panel;
pub mod sidecar;
pub mod skill;
pub mod soft_interrupt_store;
pub mod startup_profile;
pub mod stdin_detect;
pub mod storage;
pub mod subscription_catalog;
pub mod telegram;
pub mod telemetry;
pub mod terminal_launch;
pub mod todo;
pub mod tool;
pub mod transport;
pub mod tui;
pub mod update;
pub mod usage;
pub mod util;
pub mod video_export;
use anyhow::Result;
use std::sync::Mutex;
static CURRENT_SESSION_ID: Mutex<Option<String>> = Mutex::new(None);
pub fn set_current_session(session_id: &str) {
if let Ok(mut guard) = CURRENT_SESSION_ID.lock() {
*guard = Some(session_id.to_string());
}
}
pub fn get_current_session() -> Option<String> {
CURRENT_SESSION_ID.lock().ok()?.clone()
}
pub async fn run() -> Result<()> {
cli::startup::run().await
}