Project Files
README
101 tools across 16 categories: file system, web research, browser automation, Git/GitHub, database, document parsing, background commands, code execution, utilities, image processing, HTTP client, vector RAG, text processing, interactive UI generation, auto-context management, and backup & restore.
| Feature | Description |
|---|---|
| π File System | Read, write, search, and manage files with path validation |
| π Web Research | Multi-engine search (DDG, Google, Bing) with automatic fallback |
| π₯οΈ Browser Automation | Headless Puppeteer browser with persistent sessions |
| π Git & GitHub | Full Git operations + GitHub API integration |
| ποΈ Database | Read-only SQLite queries with SQL validation |
| β³ Background Commands | Long-running process management |
| β‘ Code Execution | Sandboxed JS/Python + full shell commands (pipes, redirects, env vars) |
| π§ Utilities | Clipboard, notifications, system info, memory, session summaries for cross-session continuity |
| πΌοΈ Image Processing | OCR (Tesseract.js), screenshots (Win32 API), image comparison (JPEG/BMP/PNG via Sharp) |
| π HTTP Client | REST API client with SSRF protection |
| π Vector RAG | Semantic search with local embeddings, persistent state, web content fetching |
| π Document Parsing | Chat with attached files or disk paths (PDF, DOCX, TXT) |
| π Text Processing | Regex substitutions (text_transform), field extraction from delimited files (text_extract), line insert/delete/move operations (line_operations) - sed/awk-like functionality without shell dependencies |
| π¨ Interactive UI Generation | Generate and render HTML/CSS/JS components (buttons, forms, charts, dashboards) |
| πΎ Backup & Restore | Create compressed ZIP backups of plugin state with path traversal protection |
| π§ Auto-Context Management | Automatic session tracking, decision logging, and persistent memory retrieval |
list_directory Β· read_file Β· save_file Β· replace_text_in_file Β· insert_at_line Β· append_file Β· delete_lines_in_file Β· make_directory Β· move_file Β· copy_file Β· delete_path Β· delete_files_by_pattern Β· find_files Β· fuzzy_find_local_files Β· get_file_metadata Β· change_directory Β· analyze_project Β· file_diff Β· directory_tree Β· grep_files
web_search Β· wikipedia_search Β· fetch_web_content Β· rag_web_content
browser_open_page Β· browser_session_control Β· browser_session_close Β· preview_html Β· open_file
git_status Β· git_diff Β· git_commit Β· git_log Β· git_add Β· git_checkout Β· gh_create_issue Β· gh_list_issues Β· gh_view_comments Β· gh_create_pr Β· gh_list_prs Β· gh_view_pr_diff Β· gh_push
query_database
read_document
run_background_command Β· check_background_command Β· cancel_background_command
run_javascript Β· run_python Β· execute_command Β· run_in_terminal Β· run_tests
save_memory Β· get_memory Β· search_memory Β· delete_memory Β· save_session_summary Β· get_session_summary Β· get_system_info Β· read_clipboard Β· write_clipboard Β· send_notification Β· findLMStudioHome Β· get_enabled_tools Β· system_monitor Β· process_list Β· env_inspect Β· hash_file Β· token_count Β· convert_format Β· secret_scan Β· port_check Β· package_manage Β· detect_os_environment Β· get_current_working_directory
π‘ Session Summary Compression (v1.5.15+):
Session summaries are now automatically compressed usingzlib.gzipSync(level: 9)before storage, bypassing LM Studio's 10k character SDK parameter limit while reducing token consumption by ~30%. Legacy uncompressed summaries continue to work seamlessly via backward-compatible fallback parser.
image_to_text Β· describe_image Β· screenshot_desktop Β· compare_images
http_request Β· http_get_json Β· http_post_json
rag_index_files Β· rag_query_vector Β· rag_clear_index Β· rag_web_content
text_transform Β· text_extract Β· line_operations
generate_ui_component Β· render_and_preview_ui Β· extract_ui_data
auto_summarize_context Β· get_context_memory Β· search_context Β· context_summary Β· delete_context_entry Β· track_important_event Β· clear_context_memory
create_backup Β· list_backups Β· restore_backup Β· delete_backup
The plugin is installed as an LM Studio plugin. Ensure you have:
The LLM can call the web_search tool:
Tool: web_search Params: { "query": "latest TypeScript features 2025" }
Tool: read_file Params: { "file_name": "src/index.ts", "max_length": 5000 }
Tool: change_directory Params: { "directory": "C:\\Projects\\my-app" }
All settings are accessible through LM Studio's plugin settings panel.
| Setting | Default | Description |
|---|---|---|
godMode | false | β οΈ Enables ALL tools at once |
fileSystem | true | File read/write/search operations |
webSearch | true | Web research tools |
browserAutomation | false | Headless browser control & automation |
gitOperations | false | Git operations and GitHub API access |
databaseQueries | false | Read-only SQLite queries |
documentParsing | true | PDF/DOCX document reading |
backgroundCommands | false | Long-running process tracking |
imageProcessing | true | Image OCR, screenshot, and comparison tools |
httpClient | false | Generic REST API client |
vectorRAG | true | Semantic search with vector embeddings |
uiGeneration | false | Interactive UI generation and rendering tools |
contextManagement | true | Automatic context tracking and memory management |
textProcessing | true | Text processing tools (sed/awk equivalents) |
All execution tools are disabled by default for security:
| Setting | Default | Description |
|---|---|---|
executionJavaScript | false | Allow run_javascript tool |
executionPython | false | Allow run_python tool |
executionTerminal | false | Allow run_in_terminal tool |
executionShell | false | Allow execute_command tool |
| Setting | Default | Description |
|---|---|---|
searchFallbackChain | ddg-api | Primary search engine (auto-fallback to others) |
maxSearchResults | 10 | Maximum number of results per query |
safesearch | 1 | Safe search filter: 0=Off, 1=Moderate, 2=Strict |
| Setting | Default | Description |
|---|---|---|
browserTimeout | 5000 | Maximum time (ms) to wait for browser operations |
headlessMode | false | Run browser without GUI |
| Setting | Default | Description |
|---|---|---|
documentRAG | true | Enable file indexing and semantic search for chat |
retrievalLimit | 5 | Maximum number of relevant chunks to retrieve |
retrievalAffinityThreshold | 0.5 | Minimum similarity score (0-1) for relevance |
| Setting | Default | Description |
|---|---|---|
pathValidationEnabled | true | Prevent directory traversal attacks |
binaryFileDetection | true | Detect binary files via null byte check |
regexReDoSProtection | true | Protect against regex denial-of-service |
| Setting Name | Type | Default | Description |
|---|---|---|---|
contextGuardEnabled | boolean | true | Enable the ContextGuard module. |
contextGuardTokenLimit | number | 30,000 | The maximum token count before compression triggers (90% threshold). |
contextGuardSmartReading | boolean | true | Enable heuristic keyword-grep for file reads. |
contextGuardSummaryModel | string | "" (current chat model) | The model used to summarize older history. |
contextGuardTerminalFilterEnabled | boolean | true | Auto-truncates long terminal outputs to save tokens. |
contextGuardTerminalFilterLength | number | 2,000 | Max characters before terminal output is truncated. |
| Setting Name | Type | Default | Description |
|---|---|---|---|
autoTrackingEnabled | boolean | true | Automatically tracks decisions, completions, and bug fixes in the background. |
autoTrackTokenThreshold | number | 75 | Trigger session memory save when token usage reaches this percentage (default: 75%). |
autoTrackDecisions | boolean | true | Auto-track decisions and conclusions ("I decided", "conclusion") |
autoTrackCompletions | boolean | true | Auto-track task completions ("successfully completed", "finished") |
autoTrackErrors | boolean | true | Auto-track bug fixes and error resolutions ("fixed the bug") |
autoSummaryInterval | number | 50 | Messages between automatic session summaries |
Comprehensive documentation of security features, threat models, and responsible disclosure for the AI Toolbox plugin. See SECURITY.md for details.
Deep dive into the AI Toolbox plugin's system architecture, design patterns, and internal workflows. See ARCHITECTURE.md for details.
npm install npm run build
Prevent file corruption during LLM-assisted editing with our backup-first strategy:
# 1. Backup before editing: node scripts/safe_edit.js backup src/index.ts # 2. Make your edits... # 3. Verify after editing: node scripts/safe_edit.js verify src/index.ts # 4. Remove backups when satisfied: node scripts/safe_edit.js cleanup --keep=0
π Full Guide: See SAFE_EDIT_GUIDE.md for complete workflow details, decision trees, and emergency recovery procedures.
| Package | Version | Purpose |
|---|---|---|
@lmstudio/sdk | ^1.5.0 | Core SDK for LM Studio plugin development |
@dqbd/tiktoken | ^1.0.22 | Accurate token counting for ContextGuard |
puppeteer | ^24.0.0 | Browser automation |
simple-git | ^3.22.0 | Git operations |
sharp | ^0.33.5 | Image processing |
tesseract.js | ^7.0.0 | OCR engine |
pdf-parse | ^1.1.1 | PDF document parsing |
mammoth | ^1.6.0 | DOCX document parsing |
archiver | ^8.0.0 | ZIP archive creation |
unzipper | ^0.12.3 | ZIP extraction |
zod | ^3.25.0 | Runtime type validation |
Session summaries now use zlib.gzipSync() compression to bypass the 10k SDK parameter limit and reduce token consumption by ~30%.
save_session_summary β JSON payload is gzipped (level 9) before base64 encodingget_session_summary with backward-compatible fallback for legacy uncompressed summariesawait from void-returning stateManager.set(), added type narrowing, fixed try-catch structureLM Studio's SDK enforces a 10k character limit on tool parameters. Session summaries containing large amounts of context (accomplishments, pending tasks, decisions) would fail to save when exceeding this limit β even though the actual content was valid JSON well under any reasonable size constraint. The limitation applied at the transport layer, not storage capacity.
| Payload Size | Compressed Size | Reduction | Storage Format |
|---|---|---|---|
| ~1,600 chars (small summary) | ~1,200 chars | 26% | Base64-encoded gzip stream |
| ~2,500 chars (large summary) | ~1,800 chars | 30% | Base64-encoded gzip stream |
Estimated for 25k+ char summaries: Would compress to ~7.5β12.5k characters β well within the SDK limit while preserving all original content perfectly.
{ and attempts direct JSON.parse() instead of decompressiongetAllKeys() now correctly respects the statePersistenceEnabled configuration flag.
src/stateManager.ts getAllKeys() to skip disk reload when persistenceEnabled === falsegetAllKeys() unconditionally reloaded from disk on every call β even in tests where persistence was disabled β causing stale data contamination from previous runsBefore this fix, running getAllKeys() after calling clear() would immediately reload any .ai_toolbox_memory.msgpack file left on disk from a previous session β making tests fail and breaking test isolation. The fix ensures the method behaves correctly based on the actual persistence configuration rather than always touching the filesystem.
Total: 1-line guard added in getAllKeys(), zero breaking changes, backward compatible.
Test suite now passes after fixing MODULE_NOT_FOUND errors for dynamically imported tool modules.
jest.config.cjs from two-dot to single-dot regex matchingjest.config.js)Criticalπ₯ Session summary tool now correctly saves data to the current working directory, even if directories are changed mid-session via change_directory.
src/stateManager.ts re-evaluates memory file path on every write via getMemoryFilePath() in the saveToFile() method (line ~340)this.memoryFile = await getMemoryFilePath(); at start of saveToFile()Before this fix, StateManager captured its target file path only once during initialization. If you ran change_directory mid-session to switch from the plugin root to a workspace directory, all subsequent saves (including session summaries) would silently land in the old location β meaning data appeared "lost" when checking the current working directory's filesystem directly.
// src/stateManager.ts (AFTER fix) private async saveToFile(): Promise<void> { try { // π₯ ** Re-resolve memory file path on EVERY save this.memoryFile = await getMemoryFilePath(); const data = Array.from(this.state.entries()).map(([_key, entry]) => ({...})); // ... rest of method } }
Total: 1-line fix in zero breaking changes. Back stateManager.ts, zero breaking changes.
All file-editing tools now include automatic .bak rollback on atomic write failure:
replace_text_in_file β automatic restore from .bak backup if atomic write failsinsert_at_line β same rollback pattern appliedappend_file β same rollback pattern applieddelete_lines_in_file β same rollback pattern appliedAll text transformation tools now include comprehensive safety features:
Automatic session memory saving when context window approaches capacity:
autoTrackingEnabled changed from false β trueautoTrackTokenThreshold setting (default: 75%) triggers automatic session memory savecheckAndSaveTokenThreshold() and autoSaveSessionMemory() methodsπ Full Changelog: See CHANGELOG.md for all release details.
MIT License. See LICENSE for details.