feat(tools): add session management tools for OpenCode sessions (#227)
* feat(tools): add session management tools for OpenCode sessions - Add session_list tool for listing sessions with filtering - Add session_read tool for reading session messages and history - Add session_search tool for full-text search across sessions - Add session_info tool for session metadata inspection - Add comprehensive tests for storage, utils, and tools - Update documentation in AGENTS.md Closes #132 * fix(session-manager): add Windows compatibility for storage paths - Create shared/data-path.ts utility for cross-platform data directory resolution - On Windows: uses %LOCALAPPDATA% (e.g., C:\Users\Username\AppData\Local) - On Unix: uses $XDG_DATA_HOME or ~/.local/share (XDG Base Directory spec) - Update session-manager/constants.ts to use getOpenCodeStorageDir() - Update hook-message-injector/constants.ts to use same utility - Remove dependency on xdg-basedir package in session-manager - Follows existing pattern from auto-update-checker for consistency --------- Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
This commit is contained in:
@@ -23,6 +23,12 @@ tools/
|
||||
│ ├── config.ts # Server configurations
|
||||
│ ├── tools.ts # Tool implementations
|
||||
│ └── types.ts
|
||||
├── session-manager/ # OpenCode session file management
|
||||
│ ├── constants.ts # Storage paths, descriptions
|
||||
│ ├── types.ts # Session data interfaces
|
||||
│ ├── storage.ts # File I/O operations
|
||||
│ ├── utils.ts # Formatting, filtering
|
||||
│ └── tools.ts # Tool implementations
|
||||
├── slashcommand/ # Slash command execution
|
||||
└── index.ts # builtinTools export
|
||||
```
|
||||
@@ -34,6 +40,7 @@ tools/
|
||||
| LSP | lsp_hover, lsp_goto_definition, lsp_find_references, lsp_document_symbols, lsp_workspace_symbols, lsp_diagnostics, lsp_servers, lsp_prepare_rename, lsp_rename, lsp_code_actions, lsp_code_action_resolve | IDE-like code intelligence |
|
||||
| AST | ast_grep_search, ast_grep_replace | Pattern-based code search/replace |
|
||||
| File Search | grep, glob | Content and file pattern matching |
|
||||
| Session | session_list, session_read, session_search, session_info | OpenCode session file management |
|
||||
| Background | background_task, background_output, background_cancel | Async agent orchestration |
|
||||
| Multimodal | look_at | PDF/image analysis via Gemini |
|
||||
| Terminal | interactive_bash | Tmux session control |
|
||||
|
||||
Reference in New Issue
Block a user