Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

refactor(app): keep thread, MCP identity and CLI helpers private to their modules

thinhlpgf2ed69a767fd
diff --git a/src-tauri/src/core/cli/mod.rs b/src-tauri/src/core/cli/mod.rs
index 99eadbe70..20845633e 100644
--- a/src-tauri/src/core/cli/mod.rs
+++ b/src-tauri/src/core/cli/mod.rs
@@ -152,7 +152,7 @@ impl ResumeRequest {
}
/// Whether a saved thread was started in the desktop's Cowork mode
/// (`metadata.mode == "cowork"`; absent means chat).
-pub fn is_cowork_thread(t: &serde_json::Value) -> bool {
+fn is_cowork_thread(t: &serde_json::Value) -> bool {
t.get("metadata")
.and_then(|m| m.get("mode"))
.and_then(|v| v.as_str())
diff --git a/src-tauri/src/core/mcp/identity.rs b/src-tauri/src/core/mcp/identity.rs
index 8d57daa63..365a6a636 100644
--- a/src-tauri/src/core/mcp/identity.rs
+++ b/src-tauri/src/core/mcp/identity.rs
@@ -23,7 +23,7 @@ use std::sync::{LazyLock, Mutex};
/// The generation of a server name no connection was registered for. Never
/// handed out by [`insert_server`].
-pub const UNREGISTERED: u64 = 0;
+const UNREGISTERED: u64 = 0;
/// Where a call to an advertised tool must go.
#[derive(Debug, Clone, PartialEq, Eq)]
diff --git a/src-tauri/src/core/threads/commands.rs b/src-tauri/src/core/threads/commands.rs
index fa57bf97d..05d46c96e 100644
--- a/src-tauri/src/core/threads/commands.rs
+++ b/src-tauri/src/core/threads/commands.rs
@@ -149,7 +149,7 @@ pub async fn create_thread<R: Runtime>(
/// Stable prefix of errors meaning the thread no longer exists on disk. The web
/// layer matches it to tell a deleted thread (stop writing, mark unavailable)
/// from a transient failure (keep dirty, retry).
-pub const THREAD_MISSING_ERROR_CODE: &str = "thread_missing";
+const THREAD_MISSING_ERROR_CODE: &str = "thread_missing";
fn thread_missing_error(detail: impl std::fmt::Display) -> String {
format!("{THREAD_MISSING_ERROR_CODE}: {detail}")