Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.
Rust acpagent-client-protocolai-agentsai-assistantclaudeclaude-codecodexcoding-agentscursorgeminigemini-cligrok-bot-alternativeiosiphonelinuxmacosmcpopen-sourcerustself-hosted
fix: let the folder picker climb above home and switch drives
leepokai531a108bb1df
diff --git a/apps/android/WhatsNew.md b/apps/android/WhatsNew.mdindex e596292a..8966bef7 100644--- a/apps/android/WhatsNew.md+++ b/apps/android/WhatsNew.md@@ -13,8 +13,10 @@ else a generic "Bug fixes and improvements" line. Delete old sections.- 任何 Bot 都能當主助理:長按 Bot 選「設為主助理」,通話時它會先開口。- 主助理可以像其他 Bot 一樣拖曳排序、釘選或移到分組,不需要時也可以直接刪除。- Bot 選單更簡潔:不再需要手動開新的工作階段,Codync 會在需要時自動接續。+- 選專案資料夾時,返回鍵可以往上走到家目錄以外的資料夾,Windows 電腦還能切換磁碟;連結(symlink)的資料夾也會出現在清單中。### en-US- Any bot can be your lead: touch and hold it and choose Make lead agent. It speaks first on calls.- Drag, pin or move the lead into a section like any bot, or delete it if you don't need one.- A simpler bot menu: no more New session, since Codync starts a fresh one on its own when a conversation needs it.+- When you choose a project folder, Back climbs above your home folder and, on a Windows computer, to its other drives; linked folders now show up too.diff --git a/apps/android/app/src/main/kotlin/com/codync/android/FolderPicker.kt b/apps/android/app/src/main/kotlin/com/codync/android/FolderPicker.ktindex 7bfec991..aa57cc0a 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/FolderPicker.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/FolderPicker.kt@@ -34,29 +34,35 @@ import kotlinx.coroutines.CancellationException@Composable internal fun FolderPicker(start: String?, online: Boolean, load: suspend (String?) -> DirListing, pick: (String) -> Unit) {var stack by remember { mutableStateOf(listOf(start)) }var forward by remember { mutableStateOf(true) }- BackHandler(stack.size > 1) { forward = false; stack = stack.dropLast(1) }+ // Where the first folder sits, so Back can climb above the starting folder ("" lists the drives).+ var parent by remember { mutableStateOf<String?>(null) }+ val canGoBack = stack.size > 1 || parent != null+ val back = { forward = false; stack = if (stack.size > 1) stack.dropLast(1) else listOf(parent) }+ BackHandler(canGoBack) { back() }Column(Modifier.fillMaxSize()) {Row(verticalAlignment = Alignment.CenterVertically) {- if (stack.size > 1) Box(Modifier.padding(start = 12.dp)) { BackButton { forward = false; stack = stack.dropLast(1) } }- Box(Modifier.weight(1f)) { ModalHeader(stack.last()?.trimEnd('/')?.substringAfterLast('/')?.ifEmpty { "/" } ?: "Folders") }+ if (canGoBack) Box(Modifier.padding(start = 12.dp)) { BackButton { back() } }+ Box(Modifier.weight(1f)) { ModalHeader(stack.last()?.let(::folderName) ?: "Folders") }}AnimatedContent(stack, transitionSpec = {val sign = if (forward) 1 else -1slideInHorizontally(Motion.layoutOffset) { it * sign } togetherWith slideOutHorizontally(Motion.layoutOffset) { -it * sign }}, label = "Folder") { shown ->- FolderLevel(shown.last(), online, load, pick) { forward = true; stack = stack + it }+ val onParent: ((String?) -> Unit)? = if (shown.size > 1) null else { found -> parent = found }+ FolderLevel(shown.last(), online, load, pick, onParent) { forward = true; stack = stack + it }}}}/** One folder's subfolders, filterable, with "Use" on top. */-@Composable private fun FolderLevel(path: String?, online: Boolean, load: suspend (String?) -> DirListing, pick: (String) -> Unit, open: (String) -> Unit) {+@Composable private fun FolderLevel(path: String?, online: Boolean, load: suspend (String?) -> DirListing, pick: (String) -> Unit,+ onParent: ((String?) -> Unit)?, open: (String) -> Unit) {var listing by remember { mutableStateOf<DirListing?>(null) }var error by remember { mutableStateOf<String?>(null) }var filter by remember { mutableStateOf("") }LaunchedEffect(path, online) {if (!online) { error = "Connect to this computer to browse its folders."; return@LaunchedEffect }- try { listing = load(path); error = null }+ try { listing = load(path).also { onParent?.invoke(it.parent) }; error = null }catch (cancelled: CancellationException) { throw cancelled }catch (failure: Exception) { error = failure.message ?: "Couldn't open this folder." }}@@ -65,12 +71,13 @@ import kotlinx.coroutines.CancellationExceptionval current = listingwhen {current != null -> {- CardSection(footer = current.path) {+ // The drive list (Windows) has no folder of its own to use.+ if (current.path.isNotEmpty()) CardSection(footer = current.path) {row {Row(Modifier.fillMaxWidth().plainButton { pick(current.path) }, verticalAlignment = Alignment.CenterVertically,horizontalArrangement = Arrangement.spacedBy(8.dp)) {Symbol("checkmark.circle.fill", size = 20.dp, tint = Palette.accent)- Text("Use “${current.path.trimEnd('/').substringAfterLast('/').ifEmpty { "/" }}”", style = Type.headline, color = Palette.accent)+ Text("Use “${folderName(current.path)}”", style = Type.headline, color = Palette.accent)}}}@@ -93,3 +100,6 @@ import kotlinx.coroutines.CancellationException}}}++/** A path's last folder, for `/` and Windows `\` paths alike; null for the drive list (""). */+private fun folderName(path: String): String? = path.split('/', '\\').lastOrNull { it.isNotEmpty() } ?: path.ifEmpty { null }diff --git a/apps/desktop/src/renderer/views/bots/BotEditorView.tsx b/apps/desktop/src/renderer/views/bots/BotEditorView.tsxindex e71532b3..15ffb8e7 100644--- a/apps/desktop/src/renderer/views/bots/BotEditorView.tsx+++ b/apps/desktop/src/renderer/views/bots/BotEditorView.tsx@@ -355,17 +355,19 @@ function FolderPicker({ start, onPick }: { start: string | null; onPick: (path:const [stack, setStack] = useState<(string | null)[]>([start])const [forward, setForward] = useState(true)const current = stack[stack.length - 1] ?? null+ // Where the first folder sits, so Back can climb above the starting folder ('' lists the drives).+ const [parent, setParent] = useState<string | null>(null)return (<SheetPage><HStack>- {stack.length > 1 ? (+ {stack.length > 1 || parent !== null ? (<HStack align="stretch" className="fade-in folder-back"><IconButtontitle="Back"icon="chevron.left"onClick={() => {setForward(false)- setStack((s) => s.slice(0, -1))+ setStack((s) => (s.length > 1 ? s.slice(0, -1) : [parent]))}}/></HStack>@@ -376,10 +378,11 @@ function FolderPicker({ start, onPick }: { start: string | null; onPick: (path:</HStack><div className="folder-levels"><FolderLevel- key={stack.length}+ key={`${stack.length}:${current}`}path={current}forward={forward}onPick={onPick}+ onParent={stack.length > 1 ? undefined : setParent}onOpen={(path) => {setForward(true)setStack((s) => [...s, path])@@ -391,7 +394,13 @@ function FolderPicker({ start, onPick }: { start: string | null; onPick: (path:}/** One folder's subfolders. */-function FolderLevel({ path, forward, onPick, onOpen }: { path: string | null; forward: boolean; onPick: (path: string) => void; onOpen: (path: string) => void }) {+function FolderLevel({ path, forward, onPick, onOpen, onParent }: {+ path: string | null+ forward: boolean+ onPick: (path: string) => void+ onOpen: (path: string) => void+ onParent?: (parent: string | null) => void+}) {const store = useStore()const [listing, setListing] = useState<DirListing | null>(null)const [error, setError] = useState<string | null>(null)@@ -401,12 +410,16 @@ function FolderLevel({ path, forward, onPick, onOpen }: { path: string | null; flet live = truestore.listDirs(path)- .then((l) => live && setListing(l))+ .then((l) => {+ if (!live) return+ setListing(l)+ onParent?.(l.parent ?? null)+ }).catch((e: unknown) => live && setError(errorText(e)))return () => {live = false}- }, [store, path])+ }, [store, path, onParent])const dirs = listing?.dirs.filter((d) => !filter || d.name.toLowerCase().includes(filter.toLowerCase())) ?? []@@ -416,12 +429,14 @@ function FolderLevel({ path, forward, onPick, onOpen }: { path: string | null; f<SearchField value={filter} onChange={setFilter} />{listing ? (<>- <CardSection footer={listing.path}>- <button className="press folder-use" onClick={() => onPick(listing.path)}>- <Icon name="checkmark.circle.fill" size={13} />- <Text truncate>{`Use “${lastPathComponent(listing.path)}”`}</Text>- </button>- </CardSection>+ {listing.path ? (+ <CardSection footer={listing.path}>+ <button className="press folder-use" onClick={() => onPick(listing.path)}>+ <Icon name="checkmark.circle.fill" size={13} />+ <Text truncate>{`Use “${lastPathComponent(listing.path)}”`}</Text>+ </button>+ </CardSection>+ ) : null}{dirs.length ? (<CardSection>{dirs.map((dir) => (diff --git a/apps/desktop/src/renderer/views/bots/drafts.ts b/apps/desktop/src/renderer/views/bots/drafts.tsindex f47c17dd..d1d64e1a 100644--- a/apps/desktop/src/renderer/views/bots/drafts.ts+++ b/apps/desktop/src/renderer/views/bots/drafts.ts@@ -92,6 +92,6 @@ export function useFollowSaved(bot: Bot | undefined, change: (update: (d: BotDra}, [saved])}-export const lastPathComponent = (path: string) => path.split('/').filter(Boolean).pop() ?? path+export const lastPathComponent = (path: string) => path.split(/[\\/]/).filter(Boolean).pop() ?? pathexport const errorText = (e: unknown) => (e instanceof Error ? e.message : String(e))diff --git a/apps/ios/Kit/Sources/CodyncUI/Bots/FolderPicker.swift b/apps/ios/Kit/Sources/CodyncUI/Bots/FolderPicker.swiftindex 58593574..31775aca 100644--- a/apps/ios/Kit/Sources/CodyncUI/Bots/FolderPicker.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Bots/FolderPicker.swift@@ -8,6 +8,8 @@ struct FolderPicker: View {/// The folders opened so far; the last one is shown.@State private var stack: [String?]@State private var forward = true+ /// Where the first folder sits, so Back can climb above the starting folder ("" lists the drives).+ @State private var parent: String?@Environment(\.accessibilityReduceMotion) private var reduceMotioninit(start: String?, onPick: @escaping (String) -> Void) {@@ -20,20 +22,22 @@ struct FolderPicker: View {let current = stack.last ?? nilVStack(spacing: 0) {HStack(spacing: 0) {- if stack.count > 1 {- BackButton { go(forward: false) { stack.removeLast() } }+ if stack.count > 1 || parent != nil {+ BackButton { go(forward: false) { stack = stack.count > 1 ? Array(stack.dropLast()) : [parent] } }.padding(.leading, 12).transition(.opacity)}- ModalHeader(current.map { ($0 as NSString).lastPathComponent } ?? "Folders")+ ModalHeader(current.flatMap(folderName) ?? "Folders")}ZStack {- FolderLevel(path: current, onPick: onPick) { path in go(forward: true) { stack.append(path) } }- .id(stack.count)- .transition(.asymmetric(- insertion: .move(edge: forward ? .trailing : .leading),- removal: .move(edge: forward ? .leading : .trailing)- ).combined(with: .opacity))+ FolderLevel(path: current, onPick: onPick, onParent: stack.count > 1 ? nil : { parent = $0 }) { path in+ go(forward: true) { stack.append(path) }+ }+ .id("\(stack.count):\(current ?? "")")+ .transition(.asymmetric(+ insertion: .move(edge: forward ? .trailing : .leading),+ removal: .move(edge: forward ? .leading : .trailing)+ ).combined(with: .opacity))}.frame(maxHeight: .infinity, alignment: .top).clipped()@@ -54,6 +58,8 @@ struct FolderPicker: View {private struct FolderLevel: View {let path: String?let onPick: (String) -> Void+ /// Hears where this folder sits; only the first level reports it.+ let onParent: ((String?) -> Void)?let open: (String) -> Void@Environment(BotStore.self) private var model@State private var listing: DirListing?@@ -65,17 +71,20 @@ private struct FolderLevel: View {LazyVStack(alignment: .leading, spacing: 22) {SearchField(text: $filter)if let listing {- CardSection(footer: listing.path) {- Button {- onPick(listing.path)- } label: {- Label("Use “\((listing.path as NSString).lastPathComponent)”", systemImage: "checkmark.circle.fill")- .font(.headline)- .foregroundStyle(Palette.accent)- .frame(maxWidth: .infinity, alignment: .leading)- .contentShape(Rectangle())+ // The drive list (Windows) has no folder of its own to use.+ if !listing.path.isEmpty {+ CardSection(footer: listing.path) {+ Button {+ onPick(listing.path)+ } label: {+ Label("Use “\(folderName(listing.path) ?? listing.path)”", systemImage: "checkmark.circle.fill")+ .font(.headline)+ .foregroundStyle(Palette.accent)+ .frame(maxWidth: .infinity, alignment: .leading)+ .contentShape(Rectangle())+ }+ .buttonStyle(PressScale())}- .buttonStyle(PressScale())}let dirs = listing.dirs.filter { filter.isEmpty || $0.name.localizedCaseInsensitiveContains(filter) }if !dirs.isEmpty {@@ -112,7 +121,16 @@ private struct FolderLevel: View {.scrollDismissesKeyboard(.interactively).background(Palette.background).task {- do { listing = try await model.listDirs(path) } catch { self.error = error.localizedDescription }+ do {+ let listing = try await model.listDirs(path)+ self.listing = listing+ onParent?(listing.parent)+ } catch { self.error = error.localizedDescription }}}}++/// A path's last folder, for `/` and Windows `\` paths alike.+private func folderName(_ path: String) -> String? {+ path.split(whereSeparator: { $0 == "/" || $0 == "\\" }).last.map(String.init)+}diff --git a/apps/ios/WhatsNew.md b/apps/ios/WhatsNew.mdindex b9aa6e1d..edd35a10 100644--- a/apps/ios/WhatsNew.md+++ b/apps/ios/WhatsNew.md@@ -13,9 +13,11 @@ a version without one gets a generic "Bug fixes and improvements" line. Delete o- 主助理可以像其他 Bot 一樣拖曳排序、釘選或移到分組,不需要時也可以直接刪除。- 有多台電腦時,可以在「設定 > 捷徑」選擇動作按鈕要呼叫哪一台電腦的主助理。- Bot 選單更簡潔:不再需要手動開新的工作階段,Codync 會在需要時自動接續。+- 選專案資料夾時,返回鍵可以往上走到家目錄以外的資料夾,Windows 電腦還能切換磁碟;連結(symlink)的資料夾也會出現在清單中。### en-US- Any bot can be your lead: touch and hold it and choose Make lead agent. Siri, the Action button and Open Live Mode without a bot then call it.- Drag, pin or move the lead into a section like any bot, or delete it if you don't need one.- With more than one computer, choose whose lead the Action button calls in Settings > Shortcuts.- A simpler bot menu: no more New session, since Codync starts a fresh one on its own when a conversation needs it.+- When you choose a project folder, Back climbs above your home folder and, on a Windows computer, to its other drives; linked folders now show up too.diff --git a/host/src/api/host.rs b/host/src/api/host.rsindex 522ea8fb..12c501c0 100644--- a/host/src/api/host.rs+++ b/host/src/api/host.rs@@ -197,35 +197,67 @@ pub(super) async fn call(hub: &Arc<Hub>, caller: &Caller, method: &str, b: Value}))}-/// Blocking (`std::fs`): call through `spawn_blocking`.+/// Blocking (`std::fs`): call through `spawn_blocking`. An empty path lists the drives (Windows),+/// which is also the parent a drive root reports, so pickers can move between drives.fn list_dirs(path: Option<std::path::PathBuf>) -> Result<Value> {let dir = match path {- Some(p) => p,- None => dirs::home_dir().ok_or_else(|| anyhow!("no home directory"))?,+ Some(p) if p.as_os_str().is_empty() && cfg!(windows) => return Ok(list_drives()),+ Some(p) if !p.as_os_str().is_empty() => p,+ _ => dirs::home_dir().ok_or_else(|| anyhow!("no home directory"))?,};let mut dirs: Vec<Value> = std::fs::read_dir(&dir).with_context(|| format!("listing {}", dir.display()))?.filter_map(Result::ok)- .filter(|e| e.file_type().is_ok_and(|t| t.is_dir())).filter_map(|e| {let name = e.file_name().to_string_lossy().into_owned();- if name.starts_with('.') {+ let p = e.path();+ // `is_dir` follows symlinks, junctions and mount points; `file_type` would drop them.+ if name.starts_with('.') || !p.is_dir() {return None;}- let p = e.path();Some(json!({"name": name, "path": p.to_string_lossy(), "isGit": p.join(".git").exists()}))}).collect();dirs.sort_by_key(|d| d["name"].as_str().unwrap_or_default().to_lowercase());+ let parent = match dir.parent() {+ Some(p) => Some(p.to_string_lossy().into_owned()),+ None if cfg!(windows) => Some(String::new()),+ None => None,+ };Ok(json!({"path": dir.to_string_lossy(),- "parent": dir.parent().map(|p| p.to_string_lossy().into_owned()),+ "parent": parent,"isGit": dir.join(".git").exists(),"dirs": dirs,}))}+/// The drives that are mounted (`C:\`, `D:\`, …), as a listing with no path of its own.+fn list_drives() -> Value {+ let dirs: Vec<Value> = (b'A'..=b'Z')+ .map(|letter| format!("{}:\\", char::from(letter)))+ .filter(|root| std::path::Path::new(root).is_dir())+ .map(|root| json!({"name": root.trim_end_matches('\\'), "path": root, "isGit": false}))+ .collect();+ json!({"path": "", "parent": null, "isGit": false, "dirs": dirs})+}+fn term_size(b: &Value) -> (u16, u16) {let dim = |k: &str, default: u16| b[k].as_u64().and_then(|v| u16::try_from(v).ok()).unwrap_or(default);(dim("cols", 80), dim("rows", 24))}++#[cfg(all(test, unix))]+mod tests {+ #[test]+ fn folder_listing_follows_linked_folders() {+ let dir = std::env::temp_dir().join(format!("codync-dirs-{}", uuid::Uuid::new_v4()));+ std::fs::create_dir_all(dir.join("real")).unwrap();+ std::os::unix::fs::symlink(dir.join("real"), dir.join("linked")).unwrap();+ std::fs::write(dir.join("file"), "").unwrap();+ let listing = super::list_dirs(Some(dir.clone())).unwrap();+ let names: Vec<&str> = listing["dirs"].as_array().unwrap().iter().filter_map(|d| d["name"].as_str()).collect();+ assert_eq!(names, ["linked", "real"]);+ std::fs::remove_dir_all(dir).unwrap();+ }+}diff --git a/host/src/tui/app/overlay_keys.rs b/host/src/tui/app/overlay_keys.rsindex 5d463da0..84eb0a38 100644--- a/host/src/tui/app/overlay_keys.rs+++ b/host/src/tui/app/overlay_keys.rs@@ -273,6 +273,10 @@ impl App {}fn folder_chosen(&mut self, path: String) {+ // The drive list (Windows) has no path of its own to use.+ if path.is_empty() {+ return;+ }if let Some(Overlay::Form(f)) = self.overlays.last_mut() {f.cwd = path;}diff --git a/web/content/docs/bots.mdx b/web/content/docs/bots.mdxindex 3b48e524..bf5ffea5 100644--- a/web/content/docs/bots.mdx+++ b/web/content/docs/bots.mdx@@ -49,7 +49,7 @@ Changing the agent or the model starts a new agent session. The chat history staThe **Workspace** setting is the folder the bot starts in.- **Personal workspace** (the default): a folder of its own inside Codync's data folder, `~/.codync/bots/`. It stays when you rename the bot, change its model, restart the computer or start a new session.-- **Choose project folder…**: an existing folder on the computer, such as a Git repository. The folder picker browses the computer's folders, wherever you are.+- **Choose project folder…**: an existing folder on the computer, such as a Git repository. The folder picker browses the computer's folders, wherever you are. It starts at your home folder; Back climbs to the folders above it and, on Windows, to the list of drives. Linked folders (symlinks, junctions, mounted drives) show up like any other folder.Either way, the bot can work in other folders when you ask it to. A workspace isn't a sandbox: the bot can reach whatever its agent's own permissions allow. Several bots working in the same project folder can get in each other's way, and Codync doesn't create separate Git worktrees for them.