Skip to content

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.

860 B
Raw Blame
import Foundation
import Testing
@testable import CodyncKit

@Test func personalWorkspaceDraftDoesNotReuseAnotherBotsDirectory() throws {
    let bot = try JSONDecoder().decode(Bot.self, from: Data(#"{"id":"one","name":"One","cwd":"/data/bots/one/workspace","managedWorkspace":true}"#.utf8))
    let draft = BotDraft(bot)
    #expect(draft.cwd.isEmpty)
    #expect(bot.folderName == "Personal workspace")
    let encoded = try JSONEncoder().encode(draft)
    let object = try #require(JSONSerialization.jsonObject(with: encoded) as? [String: Any])
    #expect(object["cwd"] as? String == "")
}

@Test func existingProjectFolderRemainsExplicit() throws {
    let bot = try JSONDecoder().decode(Bot.self, from: Data(#"{"id":"one","name":"One","cwd":"/projects/app"}"#.utf8))
    #expect(!bot.managedWorkspace)
    #expect(BotDraft(bot).cwd == "/projects/app")
}