- 1208→1243 TS files (+35), 143k→155k LOC (+12k) - Update all agent models: Sisyphus, Hephaestus, Oracle, Librarian, Atlas, Metis, Momus - Add 6 new hook directories (39→45 dirs): beast-mode-system, hashline-edit-diff-enhancer, anthropic-image-context, task-reminder, compaction-todo-preserver, runtime-fallback - Update category models: visual-engineering/artistry gemini-3-pro→gemini-3.1-pro - Add 2 config schema files: fallback-models.ts, runtime-fallback.ts - Timestamp: 2026-03-02 | Commit: 1c2caa09 🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
1.8 KiB
1.8 KiB
src/ — Plugin Source
Generated: 2026-03-02
OVERVIEW
Root source directory. Entry point index.ts orchestrates 4-step initialization: config → managers → tools → hooks → plugin interface.
KEY FILES
| File | Purpose |
|---|---|
index.ts |
Plugin entry, exports OhMyOpenCodePlugin |
plugin-config.ts |
JSONC parse, multi-level merge (user → project → defaults), Zod validation |
create-managers.ts |
TmuxSessionManager, BackgroundManager, SkillMcpManager, ConfigHandler |
create-tools.ts |
SkillContext + AvailableCategories + ToolRegistry |
create-hooks.ts |
3-tier hook composition: Core(37) + Continuation(7) + Skill(2) |
plugin-interface.ts |
Assembles 8 OpenCode hook handlers into PluginInterface |
CONFIG LOADING
loadPluginConfig(directory, ctx)
1. User: ~/.config/opencode/oh-my-opencode.jsonc
2. Project: .opencode/oh-my-opencode.jsonc
3. mergeConfigs(user, project) → deepMerge for agents/categories, Set union for disabled_*
4. Zod safeParse → defaults for omitted fields
5. migrateConfigFile() → legacy key transformation
HOOK COMPOSITION
createHooks()
├─→ createCoreHooks() # 37 hooks
│ ├─ createSessionHooks() # 23: contextWindowMonitor, thinkMode, ralphLoop, modelFallback, runtimeFallback, noSisyphusGpt, noHephaestusNonGpt, anthropicEffort...
│ ├─ createToolGuardHooks() # 10: commentChecker, rulesInjector, writeExistingFileGuard, jsonErrorRecovery, hashlineReadEnhancer...
│ └─ createTransformHooks() # 4: claudeCodeHooks, keywordDetector, contextInjector, thinkingBlockValidator
├─→ createContinuationHooks() # 7: todoContinuationEnforcer, atlas, stopContinuationGuard...
└─→ createSkillHooks() # 2: categorySkillReminder, autoSlashCommand