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
// Builds the host the app bundles for the same environment as the app: node tools/native-host.mjs
// dev|main compiles it in as CODYNC_ENV. Built on every package so a host made for another
// environment is never shipped. macOS: build/native/codync-host (universal; Codync Dev: this Mac's
// architecture only, since it never leaves the Mac that built it). Windows:
// build/native/codync-host.exe and codync-hostw.exe (runs it at sign-in), plus the computer-use
// driver the host starts from beside itself. Linux apps use the installed host, so there's
// nothing to do there.
import { copyFileSync, mkdirSync } from 'node:fs'
import { execFileSync } from 'node:child_process'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
if (!['darwin', 'win32'].includes(process.platform)) process.exit(0)
const env = process.argv[2]
if (!['dev', 'main'].includes(env)) throw new Error(`unknown environment ${env}`)
const root = join(dirname(fileURLToPath(import.meta.url)), '..')
const host = join(root, '../../host')
const out = join(root, 'build/native')
// The pinned toolchain (rust-toolchain.toml) through rustup, even when another cargo (Homebrew's)
// comes first on PATH: only rustup's has the x86_64 target.
const tool = (name) => execFileSync('rustup', ['which', name], { cwd: host, encoding: 'utf8' }).trim()
const [cargo, rustc] = [tool('cargo'), tool('rustc')]
const run = (cmd, args) => execFileSync(cmd, args, { stdio: 'inherit', env: { ...process.env, CODYNC_ENV: env, RUSTC: rustc } })
// Codync Dev builds in the host's `dev-app` profile: seconds to rebuild instead of minutes. Windows CI
// dry runs pick it too through CODYNC_HOST_PROFILE (release-desktop.yml), since nothing they build ships.
const profile = process.env.CODYNC_HOST_PROFILE ?? (env === 'dev' ? 'dev-app' : 'release')
if (!['dev-app', 'release'].includes(profile)) throw new Error(`unknown host profile ${profile}`)
const build = (target) => run(cargo, ['build', '--profile', profile, '--manifest-path', join(host, 'Cargo.toml'), '--target', target])
const built = (target, name) => join(host, 'target', target, profile, name)
// Keychain trusts a certificate across rebuilds, but an ad hoc signature only for that one build. A Mac without
// this certificate keeps the ad hoc signature, and Codync Dev's host asks for its key again after each rebuild.
const signDevHost = (file) => {
try {
execFileSync('codesign', ['--force', '--timestamp=none', '--identifier', 'codync-host', '--sign', 'Apple Development: Pokai Lee (6KFK5J2LB4)', file], { stdio: 'pipe', timeout: 60_000 })
} catch (e) {
console.log(`host: keeping the ad hoc signature (${String(e.stderr ?? e.message).trim()})`)
}
}
mkdirSync(out, { recursive: true })
if (process.platform === 'win32') {
const target = process.arch === 'arm64' ? 'aarch64-pc-windows-msvc' : 'x86_64-pc-windows-msvc'
build(target)
for (const exe of ['codync-host.exe', 'codync-hostw.exe']) copyFileSync(built(target, exe), join(out, env === 'dev' && exe === 'codync-hostw.exe' ? 'codync-dev-hostw.exe' : exe))
// The pinned driver has no Windows ARM64 build; Windows 11 runs these x64 helpers through Prism.
run(process.execPath, [join(root, '../../packaging/cua-driver/fetch.mjs'), 'windows-x86_64', out])
} else {
const native = process.arch === 'arm64' ? 'aarch64-apple-darwin' : 'x86_64-apple-darwin'
const targets = env === 'dev' ? [native] : ['aarch64-apple-darwin', 'x86_64-apple-darwin']
for (const target of targets) build(target)
run('lipo', ['-create', '-output', join(out, 'codync-host'), ...targets.map((t) => built(t, 'codync-host'))])
if (env === 'dev') signDevHost(join(out, 'codync-host'))
}
console.log(`host: ${env}`)