Commit Graph

926 Commits

Author SHA1 Message Date
YeonGyu-Kim
5cd3f0cbf2 docs: add Directory AGENTS.md Injector hook documentation
🤖 GENERATED BY [OPENCODE](https://opencode.ai/)
2025-12-08 17:00:02 +09:00
YeonGyu-Kim
9a9512b705 test: add test directory with sample files 2025-12-08 17:00:02 +09:00
YeonGyu-Kim
6ece7476ef feat(hooks): add empty-task-response-detector hook 2025-12-08 17:00:02 +09:00
YeonGyu-Kim
9ed23d4037 feat(hooks): implement directory-agents-injector hook 2025-12-08 17:00:02 +09:00
YeonGyu-Kim
79b791117a fix(session-recovery): improve error message extraction 2025-12-08 17:00:02 +09:00
YeonGyu-Kim
4e328a937c feat(hooks): integrate directory-agents-injector hook into plugin pipeline
- Add directoryAgentsInjector to plugin event handlers
- Wire up tool.execute.after hook for directory agents injection
- Fix: Format src/index.ts with consistent semicolon style
2025-12-08 17:00:02 +09:00
YeonGyu-Kim
a500f0c9ad export(hooks): add directory-agents-injector hook to public API
- Export createDirectoryAgentsInjectorHook from hooks index
- Fix: Formatting (add semicolons to match code style)
2025-12-08 17:00:02 +09:00
YeonGyu-Kim
16806da615 refactor(session-recovery): process entire message history for empty/thinking block recovery
- Scan all non-final assistant messages for empty content, orphan thinking blocks, and disabled thinking
- Add storage utility functions: findMessagesWithThinkingBlocks, findMessagesWithOrphanThinking, stripThinkingParts, prependThinkingPart
- Fix: Previously only processed single failed message, now handles multiple broken messages in history
- Improve: Use filesystem-based recovery instead of unreliable SDK APIs
2025-12-08 17:00:02 +09:00
YeonGyu-Kim
c5f651c0a9 refactor(hooks): remove grep-blocker (grep tool now overrides built-in)
The grep tool now properly overrides OpenCode's built-in grep,
making the blocker hook unnecessary.

Generated by [OpenCode](https://opencode.ai/)
2025-12-08 17:00:02 +09:00
YeonGyu-Kim
ed3d7a55f4 feat(tools): add glob tool with timeout protection
- Override OpenCode's built-in glob with 60s timeout
- Kill process on expiration to prevent indefinite hanging
- Reuse grep's CLI resolver for ripgrep detection

Generated by [OpenCode](https://opencode.ai/)
2025-12-08 17:00:02 +09:00
YeonGyu-Kim
b77dd2fcdf refactor(tools): rename safe-grep to grep with override capability 2025-12-08 17:00:02 +09:00
YeonGyu-Kim
64b3564760 refactor(session-recovery): extract storage utilities to separate module
Split session-recovery.ts into modular structure:
- types.ts: SDK-aligned type definitions
- constants.ts: storage paths and part type sets
- storage.ts: reusable read/write operations
- index.ts: main recovery hook logic
2025-12-08 17:00:02 +09:00
YeonGyu-Kim
0df7e9b10b fix(session-recovery): recognize 'tool' type as valid content
OpenCode storage uses 'tool' type for tool calls, but the hasContent
check only recognized 'tool_use' (Anthropic API format). This caused
messages with tool calls to be incorrectly identified as empty.
2025-12-08 17:00:02 +09:00
YeonGyu-Kim
aa35f2eab6 fix(session-recovery): detect empty messages with zero parts
Previously, findEmptyContentMessageFromStorage only detected messages
with parts.length > 0 that had no content. This missed the case where
a message has zero parts entirely, causing infinite recovery loops.
2025-12-08 17:00:02 +09:00
github-actions[bot]
64db980803 release: v0.1.26 2025-12-08 00:41:34 +00:00
YeonGyu-Kim
b86346a79d fix(lsp): add Push model support and fix JSON LSP diagnostics
- Add diagnosticsStore to capture Push model notifications
- Handle textDocument/publishDiagnostics notifications in processBuffer
- Fix workspace/configuration response for JSON LSP validation
- Add missing language mappings (json, html, css, sh, fish, md, tf)
- diagnostics() now tries Pull first, falls back to Push store
2025-12-08 09:38:00 +09:00
YeonGyu-Kim
4debb57402 feat(hooks): add pulse-monitor for token stall detection and auto-recovery
- Detect token stalls via message.part.updated heartbeat monitoring
- Support thinking/reasoning block detection with extended timeout
- Auto-recover: abort + 'continue' prompt on 5min stall
- Pause monitoring during tool execution
2025-12-06 11:17:55 +09:00
YeonGyu-Kim
a763db61cf improve(hooks): refine todo-continuation-enforcer message tone and status format 2025-12-06 10:54:36 +09:00
YeonGyu-Kim
341e5a959d feat(hooks): add grep-output-truncator for context-aware output limiting 2025-12-06 10:54:22 +09:00
YeonGyu-Kim
bac304c035 docs: add explicit agent invocation examples to README 2025-12-05 23:48:11 +09:00
YeonGyu-Kim
1aaeefac0e docs: enhance LSP tools description in README 2025-12-05 23:27:07 +09:00
github-actions[bot]
dda7b4f56d release: v0.1.25 2025-12-05 14:25:22 +00:00
YeonGyu-Kim
a287e59262 feat(session-recovery): add filesystem-based empty content recovery
- Replace API-based recovery with direct JSON file editing for empty content messages
- Add cross-platform storage path support via xdg-basedir (Linux/macOS/Windows)
- Inject '(interrupted)' text part to fix messages with only thinking/meta blocks
- Update README docs with detailed session recovery scenarios
2025-12-05 23:24:20 +09:00
github-actions[bot]
80fe3ae612 release: v0.1.24 2025-12-05 13:53:30 +00:00
YeonGyu-Kim
b045f6918e feat(lsp): add result limits to prevent token overflow
- Add DEFAULT_MAX_REFERENCES, DEFAULT_MAX_SYMBOLS, DEFAULT_MAX_DIAGNOSTICS (200 each)
- Apply limits to lsp_find_references, lsp_document_symbols, lsp_workspace_symbols, lsp_diagnostics
- Show truncation warning when results exceed limits
2025-12-05 22:52:33 +09:00
YeonGyu-Kim
725ec9b91d feat(ast-grep): add safety limits to prevent token overflow
- Add timeout (5min), output limit (1MB), match limit (500)
- Add SgResult type with truncation info
- Update formatSearchResult/formatReplaceResult for truncation display
- cli.ts: timeout + output truncation + graceful JSON recovery
2025-12-05 22:52:33 +09:00
github-actions[bot]
1f717a76be release: v0.1.23 2025-12-05 13:19:23 +00:00
YeonGyu-Kim
3bcb869a5d fix(ast-grep): add isValidBinary check to all path resolutions
- Check file size >10KB to filter out placeholder files
- Check cached binary first
- Then npm package paths with validation
- Homebrew paths as last resort
- Fixes SIGTRAP/ENOEXEC from invalid binaries
2025-12-05 22:18:17 +09:00
github-actions[bot]
54e13e4330 release: v0.1.22 2025-12-05 13:13:29 +00:00
YeonGyu-Kim
1780e2971d refactor(ast-grep): simplify binary resolution, rely on auto-download
- Remove hardcoded homebrew paths
- Remove npm package path resolution (prone to placeholder issues)
- Only check cached binary (~/.cache/oh-my-opencode/bin/sg)
- If not found, cli.ts will auto-download from GitHub releases

The download logic in cli.ts handles all cases properly.
2025-12-05 22:12:12 +09:00
github-actions[bot]
ded97701b8 release: v0.1.21 2025-12-05 13:04:11 +00:00
YeonGyu-Kim
316cdc1a62 fix(ast-grep): validate binary before using, prioritize homebrew path
- Add isValidBinary() check: file must be >10KB (placeholder files are ~100 bytes)
- Check homebrew paths first on macOS (most reliable)
- Check cached binary second
- npm package paths last (prone to placeholder issues)

Fixes ENOEXEC error when @ast-grep/cli has placeholder instead of real binary
2025-12-05 22:03:05 +09:00
YeonGyu-Kim
f19cd8fc71 improve(ast-grep): better Python pattern hints
- Show exact pattern without colon when pattern ends with ':'
- More actionable hint message
2025-12-05 21:57:58 +09:00
github-actions[bot]
181194ae3c release: v0.1.19 2025-12-05 12:00:31 +00:00
YeonGyu-Kim
b8f5599e61 feat(ast-grep): add helpful hints for incomplete Python patterns
- Show hints when Python class/function patterns return empty results
- Detect patterns ending with ':' that need body (class :, def ():)
- Removed validation that could cause false positives
- Hints only appear on empty results, not on successful matches
2025-12-05 20:59:05 +09:00
github-actions[bot]
ea2b09ebb9 release: v0.1.18 2025-12-05 11:07:21 +00:00
YeonGyu-Kim
143dd8aaa9 fix(session-recovery): improve error detection and add continue prompt
- Enhance error type detection for thinking block order issues
- Add continue prompt after successful session recovery
- Improve error message matching logic
2025-12-05 20:01:47 +09:00
YeonGyu-Kim
36169c83fb feat(ast-grep): add CLI path resolution and auto-download functionality
- Add automatic CLI binary path detection and resolution
- Implement lazy binary download with caching
- Add environment check utilities for CLI and NAPI availability
- Improve error handling and fallback mechanisms
- Export new utilities from index.ts
2025-12-05 20:01:35 +09:00
github-actions[bot]
bf9f033635 release: v0.1.17 2025-12-05 07:26:35 +00:00
YeonGyu-Kim
de2f9dfc86 chore: move schema to assets/, add dist/ to gitignore 2025-12-05 16:24:54 +09:00
YeonGyu-Kim
5f5218ccae docs: fix Agents config section - remove incorrect OpenCode link, add correct options 2025-12-05 16:17:00 +09:00
YeonGyu-Kim
41d3817910 docs: reorganize Configuration section to bottom, add LSP config docs 2025-12-05 16:13:25 +09:00
YeonGyu-Kim
a119429ebe docs: remove MCP config from Agent section (already in top-level Config) 2025-12-05 16:01:19 +09:00
github-actions[bot]
9bed2dd79a release: v0.1.16 2025-12-05 06:55:27 +00:00
YeonGyu-Kim
4c1d534093 docs: simplify agent configuration, add OpenCode doc links 2025-12-05 15:52:04 +09:00
github-actions[bot]
a04234eaab release: v0.1.15 2025-12-05 06:33:29 +00:00
YeonGyu-Kim
6d0e4c49c2 docs: add deployment workflow documentation to AGENTS.md 2025-12-05 15:32:09 +09:00
YeonGyu-Kim
8f39575264 fix(session-recovery): handle empty content from interrupted reasoning (#6)
* fix(publish): make git operations idempotent

- Check for staged changes before commit
- Check if tag exists before creating
- Check if release exists before creating

* fix(session-recovery): handle empty content from interrupted reasoning

- Add THINKING_TYPES set including 'reasoning' type (OpenCode's thinking)
- Add hasNonEmptyOutput() to detect messages with only thinking/meta parts
- Add findEmptyContentMessage() to scan all messages for empty content
- Handle step-start/step-finish meta parts in empty content detection
- Patch interrupted messages with '(interrupted)' text before falling back to revert
2025-12-05 15:28:22 +09:00
YeonGyu-Kim
2464473731 fix(ast-grep): add validation for incomplete function declaration patterns (#5)
* fix(publish): make git operations idempotent

- Check for staged changes before commit
- Check if tag exists before creating
- Check if release exists before creating

* fix(ast-grep): add validation for incomplete function declaration patterns

- Add validatePatternForCli function to detect incomplete patterns like
  'export async function $METHOD' (missing params and body)
- Only validates JS/TS languages (javascript, typescript, tsx)
- Provides helpful error message with correct pattern examples
- Update tool description to clarify complete AST nodes required

This fixes the issue where incomplete patterns would fail silently
with no results instead of providing actionable feedback.
2025-12-05 15:17:42 +09:00
YeonGyu-Kim
1b0a8adb2b refactor(comment-checker): remove WASM fallback, use CLI-only with lazy download
- Remove tree-sitter-wasms and web-tree-sitter dependencies
- Delete detector.ts (320 lines of WASM implementation)
- Add downloader.ts for lazy binary download from GitHub Releases
- Simplify index.ts to CLI-only mode
- Cache binary at ~/.cache/oh-my-opencode/bin/
- Fall back to 'Comment checking disabled' when binary unavailable
2025-12-05 14:51:47 +09:00