110b1e3d2d
* refactor(keyword-detector): split constants into domain-specific modules * feat(shared): add requiresAnyModel and isAnyFallbackModelAvailable * feat(config): add hephaestus to agent schemas * feat(agents): add Hephaestus autonomous deep worker * feat(cli): update model-fallback for hephaestus support * feat(plugin): add hephaestus to config handler with ordering * test(delegate-task): update tests for hephaestus agent * docs: update AGENTS.md files for hephaestus * docs: add hephaestus to READMEs * chore: regenerate config schema * fix(delegate-task): bypass requiresModel check when user provides explicit config * docs(hephaestus): add 4-part context structure for explore/librarian prompts * docs: fix review comments from cubic (non-breaking changes) - Move Hephaestus from Primary Agents to Subagents (uses own fallback chain) - Fix Hephaestus fallback chain documentation (claude-opus-4-5 → gemini-3-pro) - Add settings.local.json to claude-code-hooks config sources - Fix delegate_task parameters in ultrawork prompt (agent→subagent_type, background→run_in_background, add load_skills) - Update line counts in AGENTS.md (index.ts: 788, manager.ts: 1440) * docs: fix additional documentation inconsistencies from oracle review - Fix delegate_task parameters in Background Agents example (docs/features.md) - Fix Hephaestus fallback chain in root AGENTS.md to match model-requirements.ts * docs: clarify Hephaestus has no fallback (requires gpt-5.2-codex only) Hephaestus uses requiresModel constraint - it only activates when gpt-5.2-codex is available. The fallback chain in code is unreachable, so documentation should not mention fallbacks. * fix(hephaestus): remove unreachable fallback chain entries Hephaestus has requiresModel: gpt-5.2-codex which means the agent only activates when that specific model is available. The fallback entries (claude-opus-4-5, gemini-3-pro) were unreachable and misleading. --------- Co-authored-by: justsisyphus <justsisyphus@users.noreply.github.com>
79 lines
2.9 KiB
Markdown
79 lines
2.9 KiB
Markdown
# CLI KNOWLEDGE BASE
|
||
|
||
## OVERVIEW
|
||
|
||
CLI entry: `bunx oh-my-opencode`. 4 commands with Commander.js + @clack/prompts TUI.
|
||
|
||
**Commands**: install (interactive setup), doctor (14 health checks), run (session launcher), get-local-version
|
||
|
||
## STRUCTURE
|
||
|
||
```
|
||
cli/
|
||
├── index.ts # Commander.js entry (4 commands)
|
||
├── install.ts # Interactive TUI (542 lines)
|
||
├── config-manager.ts # JSONC parsing (667 lines)
|
||
├── types.ts # InstallArgs, InstallConfig
|
||
├── model-fallback.ts # Model fallback configuration
|
||
├── doctor/
|
||
│ ├── index.ts # Doctor entry
|
||
│ ├── runner.ts # Check orchestration
|
||
│ ├── formatter.ts # Colored output
|
||
│ ├── constants.ts # Check IDs, symbols
|
||
│ ├── types.ts # CheckResult, CheckDefinition (114 lines)
|
||
│ └── checks/ # 14 checks, 23 files
|
||
│ ├── version.ts # OpenCode + plugin version
|
||
│ ├── config.ts # JSONC validity, Zod
|
||
│ ├── auth.ts # Anthropic, OpenAI, Google
|
||
│ ├── dependencies.ts # AST-Grep, Comment Checker
|
||
│ ├── lsp.ts # LSP connectivity
|
||
│ ├── mcp.ts # MCP validation
|
||
│ ├── model-resolution.ts # Model resolution check
|
||
│ └── gh.ts # GitHub CLI
|
||
├── run/
|
||
│ └── index.ts # Session launcher
|
||
├── mcp-oauth/
|
||
│ └── index.ts # MCP OAuth flow
|
||
└── get-local-version/
|
||
└── index.ts # Version detection
|
||
```
|
||
|
||
## COMMANDS
|
||
|
||
| Command | Purpose |
|
||
|---------|---------|
|
||
| `install` | Interactive setup with provider selection |
|
||
| `doctor` | 14 health checks for diagnostics |
|
||
| `run` | Launch session with todo enforcement |
|
||
| `get-local-version` | Version detection and update check |
|
||
|
||
## DOCTOR CATEGORIES (14 Checks)
|
||
|
||
| Category | Checks |
|
||
|----------|--------|
|
||
| installation | opencode, plugin |
|
||
| configuration | config validity, Zod, model-resolution |
|
||
| authentication | anthropic, openai, google |
|
||
| dependencies | ast-grep, comment-checker, gh-cli |
|
||
| tools | LSP, MCP |
|
||
| updates | version comparison |
|
||
|
||
## HOW TO ADD CHECK
|
||
|
||
1. Create `src/cli/doctor/checks/my-check.ts`
|
||
2. Export `getXXXCheckDefinition()` factory returning `CheckDefinition`
|
||
3. Add to `getAllCheckDefinitions()` in `checks/index.ts`
|
||
|
||
## TUI FRAMEWORK
|
||
|
||
- **@clack/prompts**: `select()`, `spinner()`, `intro()`, `outro()`
|
||
- **picocolors**: Terminal colors for status and headers
|
||
- **Symbols**: ✓ (pass), ✗ (fail), ⚠ (warn), ℹ (info)
|
||
|
||
## ANTI-PATTERNS
|
||
|
||
- **Blocking in non-TTY**: Always check `process.stdout.isTTY`
|
||
- **Direct JSON.parse**: Use `parseJsonc()` from shared utils
|
||
- **Silent failures**: Return `warn` or `fail` in doctor instead of throwing
|
||
- **Hardcoded paths**: Use `getOpenCodeConfigPaths()` from `config-manager.ts`
|