feat(agents): add Crush and disable usage tracking

This commit is contained in:
Ryan Yin authored and ryan4yin | 二花 committed 2026-09-18 21:20:33 +08:00
1 parent 23258a06d4
commit bcee9f2ac8
9 files changed
+85 -21

No files matched your search

+1
View File
@@ -35,6 +35,7 @@ Current targets:
- OpenCode: `AGENTS.md` -> `${XDG_CONFIG_HOME:-~/.config}/opencode/AGENTS.md`
- Pi: `AGENTS.md` -> `~/.pi/agent/AGENTS.md`
- OMP: `AGENTS.md` -> `~/.omp/agent/AGENTS.md`
- Crush: `AGENTS.md` -> `${XDG_CONFIG_HOME:-~/.config}/crush/CRUSH.md`
- Generic cross-tool (read by Kimi Code): `AGENTS.md` -> `~/.agents/AGENTS.md`
Behavior:
+1
View File
@@ -12,6 +12,7 @@ Installed via Nix:
- kimi-code
- pi
- omp
- crush
## Optional tooling
+2
View File
@@ -47,12 +47,14 @@ def main() -> int:
opencode_dir = xdg_config_home / "opencode"
pi_dir = Path("~/.pi/agent").expanduser()
omp_dir = Path("~/.omp/agent").expanduser()
crush_dir = xdg_config_home / "crush"
agents_dir = Path("~/.agents").expanduser()
targets = (
(codex_dir, "AGENTS.md"),
(opencode_dir, "AGENTS.md"),
(pi_dir, "AGENTS.md"),
(omp_dir, "AGENTS.md"),
(crush_dir, "CRUSH.md"),
(agents_dir, "AGENTS.md"),
)
failed = False
+4 -3
View File
@@ -23,6 +23,7 @@ class InstallRulesTests(unittest.TestCase):
(home / ".config" / "opencode", "AGENTS.md"),
(home / ".pi" / "agent", "AGENTS.md"),
(home / ".omp" / "agent", "AGENTS.md"),
(home / ".config" / "crush", "CRUSH.md"),
(home / ".agents", "AGENTS.md"),
)
for target_dir, _ in target_names:
@@ -41,18 +42,18 @@ class InstallRulesTests(unittest.TestCase):
patch.object(
installer,
"install_one",
side_effect=[PermissionError("denied"), None, None, None, None],
side_effect=[PermissionError("denied"), None, None, None, None, None],
) as install,
patch("sys.stderr", new_callable=io.StringIO) as stderr,
):
self.assertEqual(installer.main(), 1)
self.assertEqual(install.call_count, 5)
self.assertEqual(install.call_count, 6)
self.assertIn("denied", stderr.getvalue())
def test_successful_targets_return_success(self):
with patch.object(installer, "install_one") as install:
self.assertEqual(installer.main(), 0)
self.assertEqual(install.call_count, 5)
self.assertEqual(install.call_count, 6)
def test_existing_file_is_backed_up_without_overwriting_backup(self):
with tempfile.TemporaryDirectory() as directory: