Skip to content

Commit 5a062eb

Browse files
committed
feat: implement permission mode cycling (Shift+Tab) and /permission-mode slash command
1 parent d55144b commit 5a062eb

6 files changed

Lines changed: 256 additions & 377 deletions

File tree

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# Reference Repo Summaries
2+
3+
Static summaries of all 7 repos for quick lookup without cloning.
4+
5+
---
6+
7+
## 1. oh-my-openagent
8+
**URL:** https://github.com/code-yeongyu/oh-my-openagent
9+
**Stack:** TypeScript, Bun, OpenCode plugin
10+
**What it is:** A powerful OpenCode plugin that adds named agents (Prometheus, Atlas, Hephaestus, Sisyphus-Junior) with model-variant routing, tmux session management, and multi-agent delegation via `delegate-task`.
11+
12+
**Key Patterns:**
13+
- **Agent factory pattern**: `createAtlasAgent()`, `createHephaestusAgent()` — each agent is a factory with model-variant routing
14+
- **Prompt variants per model**: `default.md` (Claude), `gpt.md`, `gemini.md`, `kimi.md` — same agent, different prompt per provider
15+
- **Delegate-task orchestration**: Atlas spawns Sisyphus-Junior subagents via `task()` calls; never self-reports, always verifies
16+
- **Model resolution pipeline**: `resolveModel(input)` → UI override → agent-specific → fallback chain
17+
- **Tmux integration**: `createTmuxSession()`, `spawnPane()` for multi-pane agent workflows
18+
- **Session management**: `SessionCursor`, `trackInjectedPath()`, `SessionToolsStore`
19+
- **Config migration**: `migrateConfigFile()` with `AGENT_NAME_MAP`, `HOOK_NAME_MAP`, `MODEL_VERSION_MAP`
20+
21+
**Key Files:**
22+
- `src/agents/atlas/agent.ts` — orchestrator agent factory
23+
- `src/agents/prometheus/system-prompt.ts` — strategic planner prompt loader
24+
- `src/agents/hephaestus/agent.ts` — autonomous deep worker
25+
- `src/agents/sisyphus-junior/agent.ts` — category-spawned executor
26+
- `src/shared/index.ts` — barrel export of 297 utility files
27+
- `src/shared/model-availability.ts``resolveModel()`, `checkModelAvailability()`
28+
- `packages/prompts-core/` — model-neutral prompt markdown files
29+
30+
---
31+
32+
## 2. opencode
33+
**URL:** https://github.com/anomalyco/opencode
34+
**Stack:** TypeScript, Bun, SST, monorepo (Turbo)
35+
**What it is:** The open source AI coding agent. Terminal UI with provider abstraction, extension system, desktop app, and a well-structured monorepo.
36+
37+
**Key Patterns:**
38+
- **Provider abstraction**: Clean separation between LLM provider and agent logic
39+
- **Monorepo layout**: `packages/` with `tui/`, `desktop/`, `web/`, `identity/`
40+
- **SST for infra**: Config-as-code for cloud deployment
41+
- **Desktop + TUI**: Supports both Electron-style desktop and pure terminal modes
42+
- **Zed extension**: `packages/extensions/zed/` for IDE integration
43+
44+
**Key Files:**
45+
- `packages/tui/` — terminal UI implementation
46+
- `packages/desktop/` — Electron-style desktop wrapper
47+
- `sst.config.ts` — infrastructure config
48+
- `turbo.json` — monorepo build pipeline
49+
50+
---
51+
52+
## 3. oh-my-pi
53+
**URL:** https://github.com/can1357/oh-my-pi
54+
**Stack:** TypeScript + Rust, Bun ≥ 1.3.14
55+
**What it is:** Fork of Pi by @mariozechner. "A coding agent with the IDE wired in." 40+ providers, 32 built-in tools, 13 LSP ops, 27 DAP ops, ~27k lines of Rust core.
56+
57+
**Key Patterns:**
58+
- **Benchmarked tool use**: Every tool is tuned for first-attempt success rate; `packages/typescript-edit-benchmark/` has full benchmark harness
59+
- **LSP integration**: 13 language server protocol operations built in
60+
- **DAP integration**: 27 debug adapter protocol operations built in
61+
- **Multi-provider**: 40+ providers with provider-neutral abstraction
62+
- **Rust core + TS surface**: Performance-critical code in Rust, developer-facing API in TypeScript
63+
- **Mutation testing**: `src/mutations.ts` for benchmark task generation
64+
65+
**Key Files:**
66+
- `packages/typescript-edit-benchmark/src/` — full benchmark framework
67+
- `packages/typescript-edit-benchmark/src/tasks.ts` — benchmark task definitions
68+
- `packages/typescript-edit-benchmark/src/runner.ts` — benchmark runner
69+
- `packages/typescript-edit-benchmark/src/prompts/` — benchmark prompt templates
70+
71+
---
72+
73+
## 4. codebuff
74+
**URL:** https://github.com/CodebuffAI/codebuff
75+
**Stack:** TypeScript, multi-agent pipeline
76+
**What it is:** AI coding assistant that coordinates specialized agents. Beats Claude Code 61% vs 53% on 175+ coding tasks. Has a `freebuff` free tier.
77+
78+
**Key Patterns:**
79+
- **4-agent pipeline**: File Picker → Planner → Editor → Reviewer — each is a specialized agent
80+
- **Tree-sitter code map**: `packages/code-map/` uses tree-sitter for language-aware code parsing across 10+ languages
81+
- **Agent composition**: Multi-agent as a *strategy*, not just concurrency — each agent has a specific role
82+
- **Custom agent builder**: `/init` command generates agent scaffolding
83+
- **Eval-driven development**: `evals/` directory with 175+ tasks across real open-source repos
84+
85+
**Key Files:**
86+
- `packages/code-map/src/index.ts` — code map entry point
87+
- `packages/code-map/src/languages.ts` — language detection
88+
- `packages/code-map/src/tree-sitter-queries/` — per-language AST queries
89+
- `evals/README.md` — eval methodology
90+
91+
---
92+
93+
## 5. codex (OpenAI Codex CLI)
94+
**URL:** https://github.com/openai/codex
95+
**Stack:** TypeScript, Node.js
96+
**What it is:** OpenAI's official local coding agent CLI. Single binary, sandboxed execution, ChatGPT plan integration.
97+
98+
**Key Patterns:**
99+
- **Sandbox-first execution**: All tool use is sandboxed; firewall init script at `scripts/init_firewall.sh`
100+
- **Container execution**: `run_in_container.sh` for isolated runs
101+
- **Hardened tool use**: Security-first design, execution policy, network isolation
102+
- **Multiple install paths**: npm, Homebrew, binary releases — portable distribution
103+
- **Bazel build**: `BUILD.bazel`, `MODULE.bazel` for reproducible builds
104+
105+
**Key Files:**
106+
- `codex-cli/bin/codex.js` — CLI entry point
107+
- `codex-cli/scripts/init_firewall.sh` — firewall/sandbox setup
108+
- `codex-cli/scripts/run_in_container.sh` — container execution
109+
- `codex-cli/package.json` — deps and scripts
110+
111+
---
112+
113+
## 6. claude-code (CCB — Claude Code Best)
114+
**URL:** https://github.com/claude-code-best/claude-code
115+
**Stack:** TypeScript, Bun
116+
**What it is:** Decompiled/reconstructed Claude Code (CCB = 踩踩背) with many enterprise features: Pipe IPC multi-instance, ACP protocol (Zed/Cursor IDE), Remote Control Docker deployment, Langfuse monitoring, Web Search, Computer Use, Chrome Use, Voice Mode, Sentry, GrowthBook.
117+
118+
**Key Patterns:**
119+
- **Pipe IPC**: `main/sub` auto-orchestration + LAN cross-machine zero-config discovery; `/pipes` panel + `Shift+↓` + message broadcast routing
120+
- **ACP Protocol**: Session resume, Skills, permission bridging for Zed/Cursor
121+
- **Remote Control**: Docker self-hosted remote UI — watch Claude Code from your phone
122+
- **Langfuse monitoring**: Every agent loop step is observable and can be converted to datasets
123+
- **Feature flags**: GrowthBook integration for enterprise feature gating
124+
- **Memory management**: `/dream` command for memory consolidation
125+
- **Poor Mode**: Disable memory extraction + typing suggestions to reduce concurrent requests
126+
127+
**Key Files:**
128+
- `src/types/message.ts` — message types
129+
- `src/types/tools.ts` — tool type definitions
130+
- `src/types/plugin.ts` — plugin system types
131+
- `src/types/hooks.ts` — hook system
132+
133+
---
134+
135+
## 7. pi-agent-rust
136+
**URL:** https://github.com/Dicklesworthstone/pi_agent_rust
137+
**Stack:** Rust 2024 edition, `asupersync` async runtime, `rich_rust` TUI
138+
**What it is:** High-performance Rust port of Pi Agent by Jeffrey Emanuel. Single binary, <100ms startup, <50MB idle memory, SQLite sessions, WASM extension security, io_uring fast lane.
139+
140+
**Key Patterns:**
141+
- **SQLite session store**: `src/session_sqlite.rs` — segmented log + offset index, O(index+tail) reopen on large histories
142+
- **Hostcall security model**: Capability-gated hostcalls: `tool`/`exec`/`http`/`session`/`ui`/`events`; two-stage exec guard; trust lifecycle `pending→acknowledged→trusted→killed`
143+
- **io_uring fast lane**: `src/hostcall_io_uring_lane.rs` — deterministic dispatch, typed opcodes, bounded shard queues
144+
- **WASM extension runtime**: `src/pi_wasm.rs` — startup prewarm, warm isolate reuse, DCG/heredoc AST signals for dangerous shell detection
145+
- **SSE streaming parser**: Tracks scanned bytes, handles UTF-8 tails, normalizes chunk boundaries, interns event-type strings
146+
- **Multi-provider**: `src/providers/` — Anthropic, OpenAI, Vertex, Azure, Cohere, GitLab, Copilot
147+
- **Benchmarks**: `benches/` — tools, semantic context, session save, TUI perf, extensions
148+
- **Shadow dual execution**: Automatic backoff on divergence; compatibility-lane kill switches
149+
150+
**Key Files:**
151+
- `src/session_sqlite.rs` — session persistence
152+
- `src/agent_cx.rs` — agent execution context
153+
- `src/extension_dispatcher.rs` — WASM extension dispatch
154+
- `src/hostcall_io_uring_lane.rs` — fast-path hostcall routing
155+
- `src/providers/anthropic.rs` — Anthropic provider
156+
- `src/pi_wasm.rs` — WASM runtime
157+
- `benches/` — full benchmark suite
158+
- `Cargo.toml` — deps: `asupersync`, `rich_rust`, edition 2024
159+
160+
---
161+
162+
## Cross-Repo Quick Reference
163+
164+
| Feature Domain | Best Source Repo(s) |
165+
|----------------|---------------------|
166+
| Multi-agent orchestration | oh-my-openagent (Atlas/delegate-task), codebuff (4-agent pipeline) |
167+
| Model/provider abstraction | oh-my-openagent (resolveModel), oh-my-pi (40+ providers), pi-agent-rust (src/providers/) |
168+
| Session persistence | pi-agent-rust (SQLite), claude-code (memory/dream) |
169+
| Security & sandboxing | codex (firewall), pi-agent-rust (capability gates, trust lifecycle) |
170+
| Benchmarking | oh-my-pi (typescript-edit-benchmark), pi-agent-rust (benches/) |
171+
| IDE integration | oh-my-pi (LSP/DAP), claude-code (ACP/Zed/Cursor) |
172+
| Streaming | pi-agent-rust (SSE parser), opencode (provider abstraction) |
173+
| Extension/plugin system | pi-agent-rust (WASM), oh-my-openagent (OpenCode plugin), claude-code (ACP) |
174+
| Monitoring/observability | claude-code (Langfuse, Sentry), pi-agent-rust (runtime risk ledger) |
175+
| TUI design | opencode (terminal UI), pi-agent-rust (rich_rust), oh-my-pi (IDE-wired) |
176+
| Code understanding | codebuff (tree-sitter code map), oh-my-openagent (ripgrep-cli) |
177+
| Prompt engineering | oh-my-openagent (per-model prompt variants), oh-my-pi (benchmark prompts) |

0 commit comments

Comments
 (0)