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
feat(host): add Hermes Agent as a built-in agent (#157)
Ryan TT811fc1e55dc5
diff --git a/README.md b/README.mdindex 4e489013..11269883 100644--- a/README.md+++ b/README.md@@ -41,7 +41,7 @@ macOS: Apple Silicon + Intel (DMG) · Windows: x64 installer · Linux: AppImage</div>-Codync turns the coding agents on your computer — Claude Code, Codex, Cursor, Pi, OpenCode, Grok Build, Gemini, Copilot and ~40 more — into persistent *bots* you delegate to from your iPhone, Mac, Windows PC, Linux desktop or any terminal, the way you'd message a colleague. Pick who, say what, put the phone away. You get a notification when a bot finishes or needs your approval.+Codync turns the coding agents on your computer — Claude Code, Codex, Cursor, Pi, OpenCode, Grok Build, Gemini, Copilot, Hermes Agent and ~40 more — into persistent *bots* you delegate to from your iPhone, Mac, Windows PC, Linux desktop or any terminal, the way you'd message a colleague. Pick who, say what, put the phone away. You get a notification when a bot finishes or needs your approval.> Why bots? On a phone, "find the right working session, then pick an environment" is too slow. With bots you already know who to hand the intent to: open the chat, type, done.diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.jsonindex 57c451e9..27ee3d8f 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.json@@ -797,6 +797,7 @@"Install Gemini CLI (npm install -g @google/gemini-cli) and run `gemini` to sign in with Google.": "Installiere Gemini CLI (npm install -g @google/gemini-cli) und starte `gemini`, um dich mit Google anzumelden.","Install Copilot CLI (curl -fsSL https://gh.io/copilot-install | bash) and run `copilot login`.": "Installiere Copilot CLI (curl -fsSL https://gh.io/copilot-install | bash) und führe `copilot login` aus.","Install Qwen Code (its standalone installer), run `qwen` and type /auth.": "Installiere Qwen Code mit seinem eigenständigen Installationsprogramm, starte `qwen` und gib /auth ein.",+ "Install Hermes Agent and run `hermes acp --setup` to choose a provider and model.": "Installiere Hermes Agent und führe `hermes acp --setup` aus, um einen Anbieter und ein Modell auszuwählen.","Install goose and run `goose configure`.": "Installiere goose und führe `goose configure` aus.","Install Kimi Code (curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash) and run `kimi login`.": "Installiere Kimi Code (curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash) und führe `kimi login` aus.","Install Droid (curl -fsSL https://app.factory.ai/cli | sh) and sign in with `droid`.": "Installiere Droid (curl -fsSL https://app.factory.ai/cli | sh) und melde dich mit `droid` an.",diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.jsonindex 6f15e270..d1e0a3a3 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.json@@ -797,6 +797,7 @@"Install Gemini CLI (npm install -g @google/gemini-cli) and run `gemini` to sign in with Google.": "Instala Gemini CLI (npm install -g @google/gemini-cli) y ejecuta `gemini` para iniciar sesión con Google.","Install Copilot CLI (curl -fsSL https://gh.io/copilot-install | bash) and run `copilot login`.": "Instala Copilot CLI (curl -fsSL https://gh.io/copilot-install | bash) y ejecuta `copilot login`.","Install Qwen Code (its standalone installer), run `qwen` and type /auth.": "Instala Qwen Code (su instalador independiente), ejecuta `qwen` y escribe /auth.",+ "Install Hermes Agent and run `hermes acp --setup` to choose a provider and model.": "Instala Hermes Agent y ejecuta `hermes acp --setup` para elegir un proveedor y un modelo.","Install goose and run `goose configure`.": "Instala goose y ejecuta `goose configure`.","Install Kimi Code (curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash) and run `kimi login`.": "Instala Kimi Code (curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash) y ejecuta `kimi login`.","Install Droid (curl -fsSL https://app.factory.ai/cli | sh) and sign in with `droid`.": "Instala Droid (curl -fsSL https://app.factory.ai/cli | sh) e inicia sesión con `droid`.",diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.jsonindex 143f97e3..220d6ea3 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.json@@ -797,6 +797,7 @@"Install Gemini CLI (npm install -g @google/gemini-cli) and run `gemini` to sign in with Google.": "Installez Gemini CLI (npm install -g @google/gemini-cli) et exécutez `gemini` pour vous connecter avec Google.","Install Copilot CLI (curl -fsSL https://gh.io/copilot-install | bash) and run `copilot login`.": "Installez Copilot CLI (curl -fsSL https://gh.io/copilot-install | bash) et exécutez `copilot login`.","Install Qwen Code (its standalone installer), run `qwen` and type /auth.": "Installez Qwen Code (son installateur autonome), exécutez `qwen` et saisissez /auth.",+ "Install Hermes Agent and run `hermes acp --setup` to choose a provider and model.": "Installez Hermes Agent et exécutez `hermes acp --setup` pour choisir un fournisseur et un modèle.","Install goose and run `goose configure`.": "Installez goose et exécutez `goose configure`.","Install Kimi Code (curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash) and run `kimi login`.": "Installez Kimi Code (curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash) et exécutez `kimi login`.","Install Droid (curl -fsSL https://app.factory.ai/cli | sh) and sign in with `droid`.": "Installez Droid (curl -fsSL https://app.factory.ai/cli | sh) et connectez-vous avec `droid`.",diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.jsonindex 40d4b2e3..c89db66f 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.json@@ -797,6 +797,7 @@"Install Gemini CLI (npm install -g @google/gemini-cli) and run `gemini` to sign in with Google.": "Gemini CLI (npm install -g @google/gemini-cli) をインストールし、`gemini` を実行して Google でサインインします。","Install Copilot CLI (curl -fsSL https://gh.io/copilot-install | bash) and run `copilot login`.": "Copilot CLI (curl -fsSL https://gh.io/copilot-install | bash) をインストールし、`copilot login` を実行します。","Install Qwen Code (its standalone installer), run `qwen` and type /auth.": "Qwen コード (スタンドアロン インストーラー) をインストールし、`qwen` を実行して /auth と入力します。",+ "Install Hermes Agent and run `hermes acp --setup` to choose a provider and model.": "Hermes Agent をインストールし、`hermes acp --setup` を実行してプロバイダーとモデルを選択します。","Install goose and run `goose configure`.": "goose をインストールし、`goose configure` を実行します。","Install Kimi Code (curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash) and run `kimi login`.": "Kimi Code (curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash) をインストールし、`kimi login` を実行します。","Install Droid (curl -fsSL https://app.factory.ai/cli | sh) and sign in with `droid`.": "Droid をインストールし (curl -fsSL https://app.factory.ai/cli | sh)、`droid` でサインインします。",diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.jsonindex 79da183d..98b5f0a8 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.json@@ -797,6 +797,7 @@"Install Gemini CLI (npm install -g @google/gemini-cli) and run `gemini` to sign in with Google.": "Gemini CLI(npm install -g @google/gemini-cli)를 설치하고 `gemini`를 실행해 Google로 로그인하세요.","Install Copilot CLI (curl -fsSL https://gh.io/copilot-install | bash) and run `copilot login`.": "Copilot CLI (curl -fsSL https://gh.io/copilot-install | bash)을 설치하고 `copilot login`을 실행하세요.","Install Qwen Code (its standalone installer), run `qwen` and type /auth.": "Qwen Code의 독립 실행형 설치 프로그램으로 설치하고 `qwen`을 실행한 뒤 /auth를 입력하세요.",+ "Install Hermes Agent and run `hermes acp --setup` to choose a provider and model.": "Hermes Agent를 설치하고 `hermes acp --setup`을 실행해 공급자와 모델을 선택하세요.","Install goose and run `goose configure`.": "goose을 설치하고 `goose configure`을 실행하세요.","Install Kimi Code (curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash) and run `kimi login`.": "Kimi Code (curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash)을 설치하고 `kimi login`을 실행하세요.","Install Droid (curl -fsSL https://app.factory.ai/cli | sh) and sign in with `droid`.": "Droid (curl -fsSL https://app.factory.ai/cli | sh)을 설치하고 `droid`으로 로그인하세요.",diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.jsonindex 0d55902d..1f232a85 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.json@@ -797,6 +797,7 @@"Install Gemini CLI (npm install -g @google/gemini-cli) and run `gemini` to sign in with Google.": "安装 Gemini CLI(npm install -g @google/gemini-cli),然后运行 `gemini`,用 Google 登录。","Install Copilot CLI (curl -fsSL https://gh.io/copilot-install | bash) and run `copilot login`.": "安装 Copilot CLI(curl -fsSL https://gh.io/copilot-install | bash),然后运行 `copilot login`。","Install Qwen Code (its standalone installer), run `qwen` and type /auth.": "安装 Qwen Code(它的独立安装程序),运行 `qwen`,然后输入 /auth。",+ "Install Hermes Agent and run `hermes acp --setup` to choose a provider and model.": "安装 Hermes Agent,然后运行 `hermes acp --setup` 选择模型服务和模型。","Install goose and run `goose configure`.": "安装 goose,然后运行 `goose configure`。","Install Kimi Code (curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash) and run `kimi login`.": "安装 Kimi Code(curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash),然后运行 `kimi login`。","Install Droid (curl -fsSL https://app.factory.ai/cli | sh) and sign in with `droid`.": "安装 Droid(curl -fsSL https://app.factory.ai/cli | sh),然后用 `droid` 登录。",diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.jsonindex caa3dd9e..28c60c5c 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.json@@ -797,6 +797,7 @@"Install Gemini CLI (npm install -g @google/gemini-cli) and run `gemini` to sign in with Google.": "安裝 Gemini CLI(npm install -g @google/gemini-cli),然後執行 `gemini`,用 Google 登入。","Install Copilot CLI (curl -fsSL https://gh.io/copilot-install | bash) and run `copilot login`.": "安裝 Copilot CLI(curl -fsSL https://gh.io/copilot-install | bash),然後執行 `copilot login`。","Install Qwen Code (its standalone installer), run `qwen` and type /auth.": "安裝 Qwen Code(它的獨立安裝程式),執行 `qwen`,然後輸入 /auth。",+ "Install Hermes Agent and run `hermes acp --setup` to choose a provider and model.": "安裝 Hermes Agent,然後執行 `hermes acp --setup` 選擇模型服務和模型。","Install goose and run `goose configure`.": "安裝 goose,然後執行 `goose configure`。","Install Kimi Code (curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash) and run `kimi login`.": "安裝 Kimi Code(curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash),然後執行 `kimi login`。","Install Droid (curl -fsSL https://app.factory.ai/cli | sh) and sign in with `droid`.": "安裝 Droid(curl -fsSL https://app.factory.ai/cli | sh),然後用 `droid` 登入。",diff --git a/docs/architecture/file-structure.md b/docs/architecture/file-structure.mdindex 529faed8..b0ed0821 100644--- a/docs/architecture/file-structure.md+++ b/docs/architecture/file-structure.md@@ -95,7 +95,7 @@ Codync/| Prompt snapshots and memory | `host/src/chat/context.rs`, `memory/` (`api.rs` the apps' read-only view, `tools.rs` and `file_tools.rs` the MCP tools, `files.rs` the folders and scan, `turns.rs` which bot's turn a found change is credited to, `file_api.rs`, `dream.rs`, `import.rs`); the rules in `host/crates/memory` (`codync-mem`: files and facts in `files/`, dreaming in `dream/`, tombstones in `store.rs`, the old entries in `legacy.rs`); harnesses' own memory turned off in `host/src/agent/own_memory.rs` || Identity, encryption and direct channel | `host/src/remote/identity.rs`, `crypto.rs`, `channel.rs` || Host cloud state and relay connection | `host/src/remote/cloud.rs`, `relay.rs` |-| Agent discovery, sign-in, setup terminal, Node.js for npm agents | `host/src/agent/backends.rs` (+ `backends/sign_in.rs`), `registry.rs`, `auth.rs`, `term.rs`, `node.rs` |+| Agent discovery, sign-in, setup terminal, Node.js for npm agents | `host/src/agent/backends.rs` (+ `backends/sign_in.rs`, `backends/search_path.rs`), `registry.rs`, `auth.rs`, `term.rs`, `node.rs` || Fast mode (session config option) | `host/src/agent/config.rs`, `agent/bot/fast_mode.rs` || Marketplace, Composio, connector OAuth | `host/src/market/` || Skills a bot writes (`save_skill`) | `host/src/chat/skills.rs`, stored by `host/src/market/skills.rs` |diff --git a/docs/design/bot-memory.md b/docs/design/bot-memory.mdindex 1bfd3b01..85e04fec 100644--- a/docs/design/bot-memory.md+++ b/docs/design/bot-memory.md@@ -345,7 +345,7 @@ It stays byte-identical until compaction or a new session.### Instructions in every harness-Codync runs 27 harnesses. The opening, with the bot's identity and memory, reaches each through the best channel+Codync runs 28 harnesses. The opening, with the bot's identity and memory, reaches each through the best channelit offers (`Instructions` in `agent/bot`):1. **Claude: `_meta.systemPrompt`**, as above. claude-agent-acp 0.92 also advertises ACP's `systemPrompt`, but it@@ -398,6 +398,7 @@ can, the user may keep it on for one bot ([Claude Code's own memory](#claude-cod| Gemini CLI | Its system prompt has the model edit `~/.gemini/GEMINI.md` | Nothing: no switch short of replacing its system prompt or its home folder || Kilo Code | Memory tools, on per project | Nothing: the only per-process switch replaces the whole config || Kiro | Memory with a global setting | Nothing: no per-workspace key |+| Hermes Agent | `MEMORY.md` and `USER.md` in `~/.hermes/memories`, on, shared by every Hermes session | Nothing: its only switches are `memory.memory_enabled` and `user_profile_enabled` in the global `~/.hermes/config.yaml` || OpenCode, Cursor, Kimi, Amp, Cline, Droid, Devin, others | None found | Nothing |### Compactiondiff --git a/docs/features/context-and-memory.md b/docs/features/context-and-memory.mdindex 01949f79..2f4e0b4c 100644--- a/docs/features/context-and-memory.md+++ b/docs/features/context-and-memory.md@@ -119,8 +119,8 @@ Claude Code's own memory; the rules live in the `codync-mem` crate, and `chat/me- **The harness's own memory** is off for every bot and for background jobs (`agent/own_memory.rs`): Claude Code(`autoMemoryEnabled` and `autoDreamEnabled` false, `CLAUDE_CODE_DISABLE_AUTO_MEMORY`), Copilot (its memory toolsexcluded), CodeBuddy, and Qwen Code (workspace settings, so only in a bot's own workspace: a project folder's- files are the user's). Gemini CLI, Kilo Code and Kiro have no switch Codync can use. Project knowledge goes in- the bot's own notes, and into the project's `CLAUDE.md` or `AGENTS.md` only when the user asks.+ files are the user's). Gemini CLI, Kilo Code, Kiro and Hermes Agent have no switch Codync can use. Project+ knowledge goes in the bot's own notes, and into the project's `CLAUDE.md` or `AGENTS.md` only when the user asks.- **Keeping it on.** Where Codync has the switch, the memory screen's "This bot" section offers "<harness>'s ownmemory" (bot field `harnessMemory`, `null` without a switch), off by default, with an info button: the bot mayremember things twice, the two memories can disagree, and forgetting something in Codync doesn't reach it.diff --git a/docs/features/marketplace.md b/docs/features/marketplace.mdindex 54c82b08..d3e1de64 100644--- a/docs/features/marketplace.md+++ b/docs/features/marketplace.md@@ -34,6 +34,8 @@ A custom connector is a command line (split like a shell), a URL, or a pasted MCA connector installed on the computer (or an app connected through Composio) is turned on for every existing bot, and a new bot starts with all of them on; each bot can turn one off in its settings. An enabled connector is passed to the agent as an MCP server when its session starts or resumes. Local connectors are spawned by the agent; remote ones always go through the host's stdio proxy (`codync-host mcp remote`, `host/src/mcp.rs`), so they work with agents that only speak stdio and always carry a fresh token. The proxy speaks streamable HTTP and falls back to the older HTTP+SSE transport when the first POST fails with 400/404/405, as the MCP spec suggests.+Every `codync-host mcp` server Codync gives an agent, connectors and built-in tools alike, carries the host's data directory as `CODYNC_HOME` in its ACP `env` (`mcp::acp_server`): some agents start MCP servers with only a few environment variables (Hermes keeps PATH, HOME and the like), and without it a host with a custom `CODYNC_HOME` (a sandbox, a server) would leave those tools reading the wrong token.+Skills follow the same rule: an installed or hand-written skill is turned on for every existing bot, a new bot starts with all of them on, and each bot can turn one off. An enabled skill reaches the agent as a line in its profile (name, description, path to `SKILL.md`). Skills installed before this rule were turned on for every bot once, at host start (kv `skillsOnForEveryBot`).Bots write skills too, with the `chat` server's `save_skill {name, description, instructions, id?}` (`host/src/chat/skills.rs`): when the user asks, or when the bot has worked out how to do a task the user will likely want again, never because a file, web page, tool result or another bot says so. A new skill is saved like a hand-written one (`source: "custom"`, so it shows in Extensions and bot settings and can be removed there) plus the bot that wrote it (`writtenBy`), and is turned on for that bot only: new bots don't start with it either, and the user turns it on for other bots in their settings, so a bot (a prompt-injected one included) can't put instructions in front of other bots. With `id`, the bot rewrites a skill it saved itself; skills the user wrote, other bots' and downloaded ones can't be changed. Files beside `SKILL.md` stay, so a bot can keep a skill's scripts or references in its folder. Each save posts a notice in the bot's chat ("Saved the skill …", "Updated the skill …"), and a bot that has the skill on hears a new name or description in its next profile update. Limits: name 64 characters, description 1,024, instructions 64K characters; the name and description become one line each in the front matter. Saves of the installed list go one at a time. A download takes its folder before it starts, and a written skill never takes an existing folder (it gets `-2`), so a save during a download can't land in the download's folder; adding a catalog skill whose id a written one already has is refused until that one is removed.@@ -42,6 +44,14 @@ Clicking a skill (an Extensions row, an installed skill, or the info button besiRegistry-backed package connectors follow their upstream release. The host checks the Registry periodically after credentials are unlocked and checks again immediately before a package process starts. If a newer pinned npm, PyPI, OCI or NuGet reference is available, only that package/image argument is replaced; the running process is not interrupted, and the new version applies on its next launch. Network failures, missing packages and attempted downgrades leave the installed reference unchanged. Custom command connectors are never updated automatically.+## Hermes Agent++Hermes Agent is a built-in agent that runs its installed CLI with `hermes acp`, without an ACP registry adapter. Install it using the [official installation guide](https://hermes-agent.nousresearch.com/docs/getting-started/installation), then run `hermes acp --setup` to choose a provider and model. In Codync, refresh the agents and select **Hermes Agent** when creating a bot; leave the custom command empty.++The Unix installer puts its launcher at `~/.local/bin/hermes`, which Codync already searches. On Windows, Codync also searches `%LOCALAPPDATA%\hermes\bin` (the current installer) and `%LOCALAPPDATA%\hermes\hermes-agent\.hermes\bin` (older source installs), so Hermes can be detected without adding it to PATH. For a custom install location, add its launcher directory to PATH before refreshing agents.++Hermes keeps its own memory, on by default: `MEMORY.md` and `USER.md` in `~/.hermes/memories`, loaded by every Hermes session (other Hermes bots and the `hermes` CLI too). Codync can't turn it off per bot, its memory screen doesn't show it, and forgetting something in Codync doesn't reach it. For one memory, set `memory.memory_enabled` and `memory.user_profile_enabled` to `false` in `~/.hermes/config.yaml`; that applies to every Hermes session.+## CommandsTyping `/` at the start of a message to a bot (desktop, iPhone, Android, terminal) lists that bot's commands, filtered by what follows the `/` (a command's name or title): the built-in ones first, then the skills the bot has on. A group chat lists its members' commands the same way: Fast mode for every member that offers it (on once all of them are; picking it turns each member's own Fast mode on or back off, so it also applies in their own chats), then every skill one of them has on. A `/skill …` message in a group reaches each member that has the skill on as "read this skill first"; the others read it as typed. Each row shows an icon, the title and what it does. The list floats above the box on the desktop (↑/↓ move the highlight, Tab or Return picks it, Escape hides the list until the draft changes, hover and click work too), sits inline above the box on the iPhone (a tap picks; it isn't a menu, so the system-menu rule doesn't apply), and is the highlighted list over the transcript in the terminal (↑/↓, Tab or ↵).diff --git a/docs/plans/harness-memory.md b/docs/plans/harness-memory.mdindex 90451b31..4d4804f1 100644--- a/docs/plans/harness-memory.md+++ b/docs/plans/harness-memory.md@@ -16,7 +16,7 @@ not pushed), so treat the design below as the spec. Current behavior:something in Codync doesn't reach it; where to read it. The terminal asks the same on `m` before turning it on.- Offered where Codync controls it (`own_memory::switchable`): Claude Code, Copilot and CodeBuddy in any folder,Qwen Code only in the bot's own workspace (its switch is a file in the folder, and a project folder's files are- the user's). Gemini CLI, Kilo Code and Kiro have no switch Codync can use.+ the user's). Gemini CLI, Kilo Code, Kiro and Hermes Agent have no switch Codync can use.- Kept on, the harness sets its memory itself (Claude Code's auto-dream too); Claude Code's `MEMORY.md` showsread-only in a "Claude Code" section. Changing it restarts the agent, which resumes its session where it can.- Wire, additive: bots carry `harnessMemory` (bool, `null` without a switch); `updateBot` takes it, and an editdiff --git a/host/src/agent/backends.rs b/host/src/agent/backends.rsindex 7c066bb2..5abe6bce 100644--- a/host/src/agent/backends.rs+++ b/host/src/agent/backends.rs@@ -6,15 +6,15 @@//! each known CLI. Launching prefers the installed CLI's own ACP mode and falls//! back to the official ACP registry build (npx / uvx / downloaded binary).-use crate::LockExt;use crate::agent::{acp, node, registry};use crate::shell;use serde_json::{Value, json};use std::collections::HashSet;-use std::path::{Path, PathBuf};-use std::sync::Mutex;+use std::path::Path;+mod search_path;mod sign_in;+pub use search_path::{hydrate_path, on_path, which};pub use sign_in::{SignInCheck, cli_signed_in, refresh_sign_in, set_signed_in, signed_in};use sign_in::{claude_signed_in, exit_ok, qoder_signed_in, says_logged_in};@@ -195,6 +195,20 @@ pub const HARNESSES: &[Harness] = &[login: Some("{bin}"),signed_in: None,},+ Harness {+ id: "hermes",+ name: "Hermes Agent",+ bins: &["hermes"],+ local: Some("{bin} acp"),+ registry: None,+ setup: "Install Hermes Agent and run `hermes acp --setup` to choose a provider and model.",+ install: Some(Install::Scripts {+ unix: "curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash",+ windows: "powershell -NoProfile -ExecutionPolicy Bypass -Command \"iex (irm https://hermes-agent.nousresearch.com/install.ps1)\"",+ }),+ login: Some("{bin} acp --setup"),+ signed_in: None,+ },Harness {id: "goose",name: "goose",@@ -422,123 +436,6 @@ pub fn harness(id: &str) -> Option<&'static Harness> {HARNESSES.iter().find(|h| h.id == id)}-// MARK: PATH hydration--static SEARCH_PATH: Mutex<Vec<PathBuf>> = Mutex::new(Vec::new());--/// `…/v22.1.0` → `[22, 1, 0]` (unparseable parts count as 0).-fn node_version(dir: &Path) -> Vec<u32> {- dir.file_name()- .and_then(|n| n.to_str())- .map(|n| n.trim_start_matches('v').split('.').map(|p| p.parse().unwrap_or(0)).collect())- .unwrap_or_default()-}--fn well_known_dirs() -> Vec<PathBuf> {- let Some(home) = dirs::home_dir() else { return vec![] };- let mut dirs: Vec<PathBuf> =- ["/opt/homebrew/bin", "/usr/local/bin", "/home/linuxbrew/.linuxbrew/bin", "/usr/bin", "/bin"]- .iter()- .map(PathBuf::from)- .collect();- if cfg!(windows) {- // Global npm CLIs (%APPDATA%\npm), and Node itself.- dirs.extend(dirs::data_dir().map(|d| d.join("npm")));- dirs.extend(std::env::var_os("ProgramFiles").map(|d| PathBuf::from(d).join("nodejs")));- // oh-my-pi's binary install (%LOCALAPPDATA%\omp); a Bun install lands in ~/.bun/bin below.- dirs.extend(dirs::data_local_dir().map(|d| d.join("omp")));- }- for rel in [- ".local/bin",- ".bun/bin",- ".cargo/bin",- ".volta/bin",- ".asdf/shims",- ".local/share/mise/shims",- ".fnm/aliases/default/bin",- ".local/share/pnpm",- "Library/pnpm",- ".npm-global/bin",- ".opencode/bin",- ".deno/bin",- "go/bin",- ] {- dirs.push(home.join(rel));- }- // Every nvm-installed node, newest first (global npm CLIs live next to node).- if let Ok(entries) = std::fs::read_dir(home.join(".nvm/versions/node")) {- let mut versions: Vec<PathBuf> = entries.filter_map(Result::ok).map(|e| e.path()).collect();- // Numeric, not lexicographic: v22.1.0 is newer than v9.11.2.- versions.sort_by_key(|p| std::cmp::Reverse(node_version(p)));- dirs.extend(versions.into_iter().map(|p| p.join("bin")));- }- dirs-}--/// Re-detects the search path and exports it as this process's PATH, so every-/// agent we spawn (and the `npx`/`node` they need) resolves the same way.-pub fn hydrate_path() {- let mut seen = HashSet::new();- let mut path: Vec<PathBuf> = vec![];- let current = std::env::var("PATH").unwrap_or_default();- let login = shell::user_path().unwrap_or_default();- for p in std::env::split_paths(¤t).chain(std::env::split_paths(&login)).chain(well_known_dirs()) {- if p.as_os_str().is_empty() || !p.is_dir() {- continue;- }- if seen.insert(p.clone()) {- path.push(p);- }- }- // Codync's Node last, so the computer's own comes first; listed even before it exists, so- // adding it (a separate `codync-host node` process) counts without another refresh.- for p in node::search_dirs() {- if seen.insert(p.clone()) {- path.push(p);- }- }- if let Ok(joined) = std::env::join_paths(&path) {- // SAFETY: called at startup and from the single refresh command, before/between spawns.- unsafe { std::env::set_var("PATH", joined) };- }- *SEARCH_PATH.locked() = path;-}--pub fn which(bin: &str) -> Option<PathBuf> {- let dirs = {- let cached = SEARCH_PATH.locked();- if cached.is_empty() {- std::env::var_os("PATH").map(|p| std::env::split_paths(&p).collect()).unwrap_or_default()- } else {- cached.clone()- }- };- dirs.into_iter().flat_map(|d| executable_names(bin).map(move |name| d.join(name))).find(|p| is_executable(p))-}--/// What `bin` can be called on disk: Windows adds the extensions it runs.-fn executable_names(bin: &str) -> impl Iterator<Item = String> + '_ {- let extensions: &[&str] =- if cfg!(windows) && Path::new(bin).extension().is_none() { &[".exe", ".cmd", ".bat"] } else { &[""] };- extensions.iter().map(move |e| format!("{bin}{e}"))-}--fn is_executable(p: &Path) -> bool {- #[cfg(unix)]- {- use std::os::unix::fs::PermissionsExt;- std::fs::metadata(p).is_ok_and(|m| m.is_file() && m.permissions().mode() & 0o111 != 0)- }- #[cfg(not(unix))]- {- p.is_file()- }-}--pub fn on_path(bin: &str) -> bool {- which(bin).is_some()-}-// MARK: listing + launching/// Every harness the phone can pick, installed ones first.@@ -678,27 +575,17 @@ pub fn local_candidate(id: &str) -> Option<registry::Cmd> {mod tests {use super::*;- #[cfg(unix)]- #[test]- fn detects_executables_on_search_path() {- let dir = std::env::temp_dir().join(format!("codync-bin-{}", uuid::Uuid::new_v4()));- std::fs::create_dir_all(&dir).unwrap();- let bin = dir.join("fake-harness");- std::fs::write(&bin, "#!/bin/sh\n").unwrap();- *SEARCH_PATH.locked() = vec![dir.clone()];- assert!(which("fake-harness").is_none(), "not executable yet");- #[cfg(unix)]- {- use std::os::unix::fs::PermissionsExt;- std::fs::set_permissions(&bin, std::fs::Permissions::from_mode(0o755)).unwrap();- }- assert_eq!(which("fake-harness"), Some(bin));- SEARCH_PATH.locked().clear();- }-#[test]fn every_harness_is_unique() {let ids: HashSet<_> = HARNESSES.iter().map(|h| h.id).collect();assert_eq!(ids.len(), HARNESSES.len());+ let bins: Vec<_> = HARNESSES.iter().flat_map(|h| h.bins).collect();+ assert_eq!(bins.iter().collect::<HashSet<_>>().len(), bins.len(), "a CLI belongs to one harness");+ }++ #[test]+ fn hermes_uses_native_acp() {+ let h = harness("hermes").unwrap();+ assert_eq!((h.local, h.registry, h.login), (Some("{bin} acp"), None, Some("{bin} acp --setup")));}}diff --git a/host/src/agent/backends/search_path.rs b/host/src/agent/backends/search_path.rsnew file mode 100644index 00000000..836b338e--- /dev/null+++ b/host/src/agent/backends/search_path.rs@@ -0,0 +1,167 @@+//! Where harness CLIs are looked up: the login shell's PATH plus the usual install dirs.++use crate::LockExt;+use crate::agent::node;+use crate::shell;+use std::collections::HashSet;+use std::path::{Path, PathBuf};+use std::sync::Mutex;++static SEARCH_PATH: Mutex<Vec<PathBuf>> = Mutex::new(Vec::new());++/// `…/v22.1.0` → `[22, 1, 0]` (unparseable parts count as 0).+fn node_version(dir: &Path) -> Vec<u32> {+ dir.file_name()+ .and_then(|n| n.to_str())+ .map(|n| n.trim_start_matches('v').split('.').map(|p| p.parse().unwrap_or(0)).collect())+ .unwrap_or_default()+}++fn well_known_dirs() -> Vec<PathBuf> {+ let Some(home) = dirs::home_dir() else { return vec![] };+ well_known_dirs_for(&home, dirs::data_local_dir().as_deref())+}++fn well_known_dirs_for(home: &Path, data_local: Option<&Path>) -> Vec<PathBuf> {+ let mut dirs: Vec<PathBuf> =+ ["/opt/homebrew/bin", "/usr/local/bin", "/home/linuxbrew/.linuxbrew/bin", "/usr/bin", "/bin"]+ .iter()+ .map(PathBuf::from)+ .collect();+ if cfg!(windows) {+ // Global npm CLIs (%APPDATA%\npm), and Node itself.+ dirs.extend(dirs::data_dir().map(|d| d.join("npm")));+ dirs.extend(std::env::var_os("ProgramFiles").map(|d| PathBuf::from(d).join("nodejs")));+ // oh-my-pi's binary install (%LOCALAPPDATA%\omp); a Bun install lands in ~/.bun/bin below.+ dirs.extend(data_local.map(|d| d.join("omp")));+ // Hermes Agent's Windows launchers, including older source installs.+ dirs.extend(data_local.map(|d| d.join("hermes").join("bin")));+ dirs.extend(data_local.map(|d| d.join("hermes").join("hermes-agent").join(".hermes").join("bin")));+ }+ for rel in [+ // Hermes Agent's Unix installer also puts its launcher here.+ ".local/bin",+ ".bun/bin",+ ".cargo/bin",+ ".volta/bin",+ ".asdf/shims",+ ".local/share/mise/shims",+ ".fnm/aliases/default/bin",+ ".local/share/pnpm",+ "Library/pnpm",+ ".npm-global/bin",+ ".opencode/bin",+ ".deno/bin",+ "go/bin",+ ] {+ dirs.push(home.join(rel));+ }+ // Every nvm-installed node, newest first (global npm CLIs live next to node).+ if let Ok(entries) = std::fs::read_dir(home.join(".nvm/versions/node")) {+ let mut versions: Vec<PathBuf> = entries.filter_map(Result::ok).map(|e| e.path()).collect();+ // Numeric, not lexicographic: v22.1.0 is newer than v9.11.2.+ versions.sort_by_key(|p| std::cmp::Reverse(node_version(p)));+ dirs.extend(versions.into_iter().map(|p| p.join("bin")));+ }+ dirs+}++/// Re-detects the search path and exports it as this process's PATH, so every+/// agent we spawn (and the `npx`/`node` they need) resolves the same way.+pub fn hydrate_path() {+ let mut seen = HashSet::new();+ let mut path: Vec<PathBuf> = vec![];+ let current = std::env::var("PATH").unwrap_or_default();+ let login = shell::user_path().unwrap_or_default();+ for p in std::env::split_paths(¤t).chain(std::env::split_paths(&login)).chain(well_known_dirs()) {+ if p.as_os_str().is_empty() || !p.is_dir() {+ continue;+ }+ if seen.insert(p.clone()) {+ path.push(p);+ }+ }+ // Codync's Node last, so the computer's own comes first; listed even before it exists, so+ // adding it (a separate `codync-host node` process) counts without another refresh.+ for p in node::search_dirs() {+ if seen.insert(p.clone()) {+ path.push(p);+ }+ }+ if let Ok(joined) = std::env::join_paths(&path) {+ // SAFETY: called at startup and from the single refresh command, before/between spawns.+ unsafe { std::env::set_var("PATH", joined) };+ }+ *SEARCH_PATH.locked() = path;+}++pub fn which(bin: &str) -> Option<PathBuf> {+ let dirs = {+ let cached = SEARCH_PATH.locked();+ if cached.is_empty() {+ std::env::var_os("PATH").map(|p| std::env::split_paths(&p).collect()).unwrap_or_default()+ } else {+ cached.clone()+ }+ };+ dirs.into_iter().flat_map(|d| executable_names(bin).map(move |name| d.join(name))).find(|p| is_executable(p))+}++/// What `bin` can be called on disk: Windows adds the extensions it runs.+fn executable_names(bin: &str) -> impl Iterator<Item = String> + '_ {+ let extensions: &[&str] =+ if cfg!(windows) && Path::new(bin).extension().is_none() { &[".exe", ".cmd", ".bat"] } else { &[""] };+ extensions.iter().map(move |e| format!("{bin}{e}"))+}++fn is_executable(p: &Path) -> bool {+ #[cfg(unix)]+ {+ use std::os::unix::fs::PermissionsExt;+ std::fs::metadata(p).is_ok_and(|m| m.is_file() && m.permissions().mode() & 0o111 != 0)+ }+ #[cfg(not(unix))]+ {+ p.is_file()+ }+}++pub fn on_path(bin: &str) -> bool {+ which(bin).is_some()+}++#[cfg(test)]+mod tests {+ use super::*;++ #[cfg(unix)]+ #[test]+ fn detects_executables_on_search_path() {+ let dir = std::env::temp_dir().join(format!("codync-bin-{}", uuid::Uuid::new_v4()));+ std::fs::create_dir_all(&dir).unwrap();+ let bin = dir.join("fake-harness");+ std::fs::write(&bin, "#!/bin/sh\n").unwrap();+ *SEARCH_PATH.locked() = vec![dir.clone()];+ assert!(which("fake-harness").is_none(), "not executable yet");+ #[cfg(unix)]+ {+ use std::os::unix::fs::PermissionsExt;+ std::fs::set_permissions(&bin, std::fs::Permissions::from_mode(0o755)).unwrap();+ }+ assert_eq!(which("fake-harness"), Some(bin));+ SEARCH_PATH.locked().clear();+ }++ #[test]+ fn hermes_install_dirs_are_searched() {+ let root = std::env::temp_dir().join(format!("codync-paths-{}", uuid::Uuid::new_v4()));+ let home = root.join("home");+ let data_local = root.join("local");+ let dirs = well_known_dirs_for(&home, Some(&data_local));+ assert!(dirs.contains(&home.join(".local/bin")));+ if cfg!(windows) {+ assert!(dirs.contains(&data_local.join("hermes").join("bin")));+ assert!(dirs.contains(&data_local.join("hermes").join("hermes-agent").join(".hermes").join("bin")));+ }+ }+}diff --git a/host/src/agent/bot/session.rs b/host/src/agent/bot/session.rsindex fe3c7286..71929474 100644--- a/host/src/agent/bot/session.rs+++ b/host/src/agent/bot/session.rs@@ -100,11 +100,7 @@ impl Actor {composio.then_some("composio"),];for name in builtin.into_iter().flatten() {- servers.push(json!({- "name": name, "command": exe,- "args": ["mcp", name, "--bot", self.cfg.id, "--port", port.to_string()],- "env": [],- }));+ servers.push(crate::mcp::acp_server(name, &exe, &[name, "--bot", &self.cfg.id], port));}Ok(Value::Array(servers))}diff --git a/host/src/market/mod.rs b/host/src/market/mod.rsindex 70d07976..a9c4c3a0 100644--- a/host/src/market/mod.rs+++ b/host/src/market/mod.rs@@ -89,20 +89,16 @@ impl Connector {/// which keeps sign-in tokens fresh and works with agents that only speak stdio./// A remote server still waiting for sign-in is left out.pub fn acp(&self, exe: &std::path::Path, port: u16) -> Option<Value> {- if self.command.is_some() {- return Some(- json!({"name":self.id,"command":exe,"args":["mcp","local","--connector",self.id,"--port",port.to_string()],"env":[]}),- );- }- self.url.as_ref()?;- if self.oauth.as_ref().is_some_and(|o| !o.signed_in()) {- return None;- }- Some(json!({- "name": self.id, "command": exe,- "args": ["mcp", "remote", "--connector", self.id, "--port", port.to_string()],- "env": [],- }))+ let kind = if self.command.is_some() {+ "local"+ } else {+ self.url.as_ref()?;+ if self.oauth.as_ref().is_some_and(|o| !o.signed_in()) {+ return None;+ }+ "remote"+ };+ Some(crate::mcp::acp_server(&self.id, exe, &[kind, "--connector", &self.id], port))}/// What clients see: everything but the secret values.@@ -331,12 +327,15 @@ mod tests {let exe = std::path::Path::new("/bin/codync-host");let config = c.acp(exe, 1).unwrap();assert_eq!(config["args"][1], "local");- assert_eq!(config["env"], json!([]));+ let only_data_dir = json!([{"name": "CODYNC_HOME", "value": crate::service::data_dir()}]);+ assert_eq!(config["env"], only_data_dir, "never the connector's secrets");assert!(!config.to_string().contains("secret"));assert!(c.public().get("env").is_none(), "secrets never leave the host");c.command = None;c.url = Some("https://example.com/mcp".into());- assert_eq!(c.acp(exe, 1).unwrap()["args"][1], "remote", "remote servers go through the proxy");+ let remote = c.acp(exe, 1).unwrap();+ assert_eq!(remote["args"][1], "remote", "remote servers go through the proxy");+ assert_eq!(remote["env"], only_data_dir);c.oauth = Some(oauth::OAuth::default());assert!(c.acp(exe, 1).is_none(), "not signed in yet");assert_eq!(c.public()["auth"], "signedOut");diff --git a/host/src/mcp.rs b/host/src/mcp.rsindex 93ee14c5..127fa8e0 100644--- a/host/src/mcp.rs+++ b/host/src/mcp.rs@@ -13,6 +13,18 @@ pub use remote::serve_remote;pub const PROTOCOL_VERSION: &str = "2025-06-18";+/// ACP `McpServer` for `codync-host mcp <args…> --port <port>`. Its env names the data directory, where the token+/// is: some agents start MCP servers with a filtered environment (Hermes keeps only PATH, HOME and a few more), so a+/// custom `CODYNC_HOME` wouldn't reach the server otherwise.+pub fn acp_server(name: &str, exe: &std::path::Path, args: &[&str], port: u16) -> Value {+ let port = port.to_string();+ let args: Vec<&str> = ["mcp"].into_iter().chain(args.iter().copied()).chain(["--port", &port]).collect();+ json!({+ "name": name, "command": exe, "args": args,+ "env": [{"name": "CODYNC_HOME", "value": crate::service::data_dir()}],+ })+}+#[derive(Clone, Copy)]pub enum Server {Chat,diff --git a/host/tests/manage_e2e.rs b/host/tests/manage_e2e.rsindex b78dacce..8240b6fe 100644--- a/host/tests/manage_e2e.rs+++ b/host/tests/manage_e2e.rs@@ -121,9 +121,13 @@ async fn a_card_ends_when_its_turn_stops_or_its_call_is_dropped() {serde_json::from_str(&std::fs::read_to_string(workspace.join("servers.json")).unwrap()).unwrap();let manage = servers.as_array().unwrap().iter().find(|s| s["name"] == "manage").unwrap();let args: Vec<&str> = manage["args"].as_array().unwrap().iter().map(|a| a.as_str().unwrap()).collect();+ // Started the way the agent would, with the server's own env: it carries the host's data directory.+ let env =+ manage["env"].as_array().unwrap().iter().map(|e| (e["name"].as_str().unwrap(), e["value"].as_str().unwrap()));let mut mcp = std::process::Command::new(manage["command"].as_str().unwrap()).args(args)- .env("CODYNC_HOME", &host.home)+ .env_remove("CODYNC_HOME")+ .envs(env).stdin(std::process::Stdio::piped()).stdout(std::process::Stdio::null()).spawn()