Forked from sologub/ai-toolbox
Forked from sologub/ai-toolbox
Project Files
Project Files
README
README
~90 unique tools across 16 categories, fully integrated and ready for use.
All tools dynamically registered with category-level gating. All tools registered via direct SDK pattern (no gateway indirection).
| Feature | Description |
|---|---|
| 📁 File System | Read, write, search, and manage files with path validation & backup support |
| 🌐 Web Research | Multi-engine search (DDG, Google, Bing) with automatic fallback |
| 🖥️ Browser Automation | Headless Puppeteer browser with persistent sessions & UI interaction |
| 🐙 Git & GitHub | Full Git operations (including stash/blame) + GitHub API integration |
| 🗃️ Database | Read-only SQLite queries with SQL validation |
| ⏳ Background Commands | Long-running process management and status tracking |
| ⚡ Code Execution | Sandboxed JS/Python + full shell commands (pipes, redirects, env vars) |
| 🔧 Utilities | Clipboard, notifications, system info, memory, session summaries, and environment management |
| 🖼️ Image Processing |
list_directory · read_file · read_file_chunked · 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 · find_replace_all
web_search · wikipedia_search · fetch_web_content · rag_web_content
browser_open_page · browser_session_control · browser_session_close · preview_html · open_file
Local Operations (isomorphic-git): git_status · git_diff · git_commit · git_log · git_add · git_checkout · git_stash · git_blame
Remote API (GitHub CLI gh): gh_create_issue · gh_list_issues · gh_view_comments · gh_create_pr · gh_list_prs · gh_push
Note: Remote operations require the GitHub CLI to be installed and authenticated (
gh auth login).
query_database
read_document
run_background_command · check_background_command · cancel_background_command
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
generate_ui_component · render_and_preview_ui · extract_ui_data
auto_summarize_context · get_context_memory · search_context · context_summary · delete_context_entry · clear_context_memory · track_important_event · save_session_summary · get_session_summary · save_memory · get_memory · delete_memory
text_transform · text_extract · line_operations · markdown_table_gen
refactor_code · unusedImports
create_plan · get_plan · update_plan_step
run_javascript · run_python · execute_command · run_in_terminal · run_tests
The plugin is installed as an LM Studio plugin. Ensure you have:
gh) — required for remote GitHub operations (Issues, PRs). Install at https://cli.github.com/The plugin uses a comprehensive configuration schema (src/config.ts) which is exposed in LM Studio's settings UI. Key features include:
Comprehensive documentation of security features, threat models, and responsible disclosure of 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.
toolsProvider.ts Refactoring: Declarative Registry PatternArchitectural overhaul of tool registration system — replaced repetitive gating logic with a clean, maintainable registry pattern using closures.
Fixed critical performance issue where grep_files searched ALL directories including node_modules, .git, and build artifacts.
Resolved critical token undercounting bug caused by incomplete message content extraction when LM Studio SDK v1.x returns array-based content blocks or ChatMessage objects.
ContextGuard.countTokens() now properly extracts text from arrays of content blocks [{"type": "text", "text": "..."}] instead of stringifying entire arraysResolved critical token limit hardcoding, fixed JSON serialization crashes, and added comprehensive safety guardrails to line_operations tool.
getContextLength() API (accurately detects up to 224k+ tokens)summaryModel configuration approachResolved recurring issues where LLMs inserted content at wrong lines due to stale line numbers.
Three-layer defense-in-depth strategy:
| Layer | Parameter | Purpose |
|---|---|---|
| Content-Aware Insertion | insert_after_pattern / insert_before_pattern | Find insertion point by searching file content instead of trusting line numbers |
| Line Fingerprinting | verify_before_insert | Content expected at target_line — blocks operation if mismatch and shows actual context |
| Bounds Validation | Auto-detection + limits | Rejects out-of-range lines, multi-line content splitting, large insert blocking (>5 lines) |
Example usage:
Impact: All guardrails tested and verified — 9/9 test scenarios passed with zero regressions.
Eliminated all any type usage and fixed config resolution for ParsedConfig wrapper.
Registered utility tools and cleaned up orphaned gateway pattern code.
backupTools (create_backup, list_backups, restore_backup, delete_backup)cleanupBackupsTool (cleanup_backups)dataVisualizationTools (generate_chart)Introduced the Gateway Pattern to prevent LLM tool-bloat crashes and provide controlled access to all registered tools.
explore_tools — Discovers available tool categories without exposing all tools at once (prevents grammar parser crashes)execute_gateway_tool — Delegates execution to any registered tool by name with built-in validationResolved critical grammar parser failure in production — tool count capping now enforced at 25 tools (was 50), minifier properly wired up.
Resolved critical grammar parser failure and added defensive error handling for SDK token counting.
| 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 |
isomorphic-git | ^1.38.6 | Pure JS Git operations (migrated from simple-git in v1.5.25) |
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 |
MIT License. See LICENSE for details.
~90 unique tools across 16 categories, fully integrated and ready for use.
All tools dynamically registered with category-level gating. All tools registered via direct SDK pattern (no gateway indirection).
| Feature | Description |
|---|---|
| 📁 File System | Read, write, search, and manage files with path validation & backup support |
| 🌐 Web Research | Multi-engine search (DDG, Google, Bing) with automatic fallback |
| 🖥️ Browser Automation | Headless Puppeteer browser with persistent sessions & UI interaction |
| 🐙 Git & GitHub | Full Git operations (including stash/blame) + GitHub API integration |
| 🗃️ Database | Read-only SQLite queries with SQL validation |
| ⏳ Background Commands | Long-running process management and status tracking |
| ⚡ Code Execution | Sandboxed JS/Python + full shell commands (pipes, redirects, env vars) |
| 🔧 Utilities | Clipboard, notifications, system info, memory, session summaries, and environment management |
| 🖼️ Image Processing |
list_directory · read_file · read_file_chunked · 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 · find_replace_all
web_search · wikipedia_search · fetch_web_content · rag_web_content
browser_open_page · browser_session_control · browser_session_close · preview_html · open_file
Local Operations (isomorphic-git): git_status · git_diff · git_commit · git_log · git_add · git_checkout · git_stash · git_blame
Remote API (GitHub CLI gh): gh_create_issue · gh_list_issues · gh_view_comments · gh_create_pr · gh_list_prs · gh_push
Note: Remote operations require the GitHub CLI to be installed and authenticated (
gh auth login).
query_database
read_document
run_background_command · check_background_command · cancel_background_command
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
generate_ui_component · render_and_preview_ui · extract_ui_data
auto_summarize_context · get_context_memory · search_context · context_summary · delete_context_entry · clear_context_memory · track_important_event · save_session_summary · get_session_summary · save_memory · get_memory · delete_memory
text_transform · text_extract · line_operations · markdown_table_gen
refactor_code · unusedImports
create_plan · get_plan · update_plan_step
run_javascript · run_python · execute_command · run_in_terminal · run_tests
The plugin is installed as an LM Studio plugin. Ensure you have:
gh) — required for remote GitHub operations (Issues, PRs). Install at https://cli.github.com/The plugin uses a comprehensive configuration schema (src/config.ts) which is exposed in LM Studio's settings UI. Key features include:
Comprehensive documentation of security features, threat models, and responsible disclosure of 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.
toolsProvider.ts Refactoring: Declarative Registry PatternArchitectural overhaul of tool registration system — replaced repetitive gating logic with a clean, maintainable registry pattern using closures.
Fixed critical performance issue where grep_files searched ALL directories including node_modules, .git, and build artifacts.
Resolved critical token undercounting bug caused by incomplete message content extraction when LM Studio SDK v1.x returns array-based content blocks or ChatMessage objects.
ContextGuard.countTokens() now properly extracts text from arrays of content blocks [{"type": "text", "text": "..."}] instead of stringifying entire arraysResolved critical token limit hardcoding, fixed JSON serialization crashes, and added comprehensive safety guardrails to line_operations tool.
getContextLength() API (accurately detects up to 224k+ tokens)summaryModel configuration approachResolved recurring issues where LLMs inserted content at wrong lines due to stale line numbers.
Three-layer defense-in-depth strategy:
| Layer | Parameter | Purpose |
|---|---|---|
| Content-Aware Insertion | insert_after_pattern / insert_before_pattern | Find insertion point by searching file content instead of trusting line numbers |
| Line Fingerprinting | verify_before_insert | Content expected at target_line — blocks operation if mismatch and shows actual context |
| Bounds Validation | Auto-detection + limits | Rejects out-of-range lines, multi-line content splitting, large insert blocking (>5 lines) |
Example usage:
Impact: All guardrails tested and verified — 9/9 test scenarios passed with zero regressions.
Eliminated all any type usage and fixed config resolution for ParsedConfig wrapper.
Registered utility tools and cleaned up orphaned gateway pattern code.
backupTools (create_backup, list_backups, restore_backup, delete_backup)cleanupBackupsTool (cleanup_backups)dataVisualizationTools (generate_chart)Introduced the Gateway Pattern to prevent LLM tool-bloat crashes and provide controlled access to all registered tools.
explore_tools — Discovers available tool categories without exposing all tools at once (prevents grammar parser crashes)execute_gateway_tool — Delegates execution to any registered tool by name with built-in validationResolved critical grammar parser failure in production — tool count capping now enforced at 25 tools (was 50), minifier properly wired up.
Resolved critical grammar parser failure and added defensive error handling for SDK token counting.
| 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 |
isomorphic-git | ^1.38.6 | Pure JS Git operations (migrated from simple-git in v1.5.25) |
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 |
MIT License. See LICENSE for details.
| OCR (Tesseract.js), screenshots, and image comparison |
| 📊 Vector RAG | Semantic search with vector embeddings for intelligent document retrieval |
| 🎨 UI Generation | Generate and render interactive HTML/CSS/JS components in-browser |
| 🧠 Context Management | Automatic session tracking, decision logging, and memory management |
| 📝 Text Processing | Advanced regex-based text transformations (sed/awk equivalents) |
| 📋 Task Planning | Structured multi-step workflow tools (create_plan, get_plan, update_plan_step) |
gh auth logingh_create_issuegh_list_prsTOOL_REGISTRIES) containing 20 entriesconfig, stateManager, and backgroundCommandManager at definition time via arrow functions, eliminating parameter-passing complexityany[] types, replaced with typed closures (() => Tool[]) that satisfy strict ESLint rulesfor...of iteration replaces scattered conditional blocks — adds tools based on config keys or GOD MODE bypassDEFAULT_EXCLUDED_DIRS Set in walkDirectory() function within src/tools/fileSystemTools.tsnode_modules, .git, dist, build, .next, .nuxt, __pycache__, .cache, vendor, .vscode, .idea, .vsinclude pattern (backward compatible).getText() method or .text property before JSON serialization for structured message objects@typescript-eslint/no-base-to-string error with explicit type checks and scoped suppressionz.any() with z.unknown() in Zod schemaslatest.timestamp! with latest.timestamp ?? 0PluginConfig object from .get() calls instead of direct property access on ParsedConfig wrapperas unknown as double-cast for @typescript-eslint/parser return typelineOperations (delete_lines)markdownPreviewTools (markdown_preview)utility config toggle to enable/disable all utility tools# Install dependencies
npm install
# Build the project (ESM + CJS via Tsup)
npm run build
# Run type checking
npm run typecheck
# Run test suite
npm test
// Pattern-based (line-number-agnostic):
line_operations(file_name, operation: "insert",
insert_after_pattern: "if (width <= 0 || height <= 0)",
content: "// fix"
)
// Verification-based (prevents drift errors):
line_operations(file_name, operation: "insert", target_line: 84,
content: "// fix",
verify_before_insert: "return;" // Content expected at line 84
)
| OCR (Tesseract.js), screenshots, and image comparison |
| 📊 Vector RAG | Semantic search with vector embeddings for intelligent document retrieval |
| 🎨 UI Generation | Generate and render interactive HTML/CSS/JS components in-browser |
| 🧠 Context Management | Automatic session tracking, decision logging, and memory management |
| 📝 Text Processing | Advanced regex-based text transformations (sed/awk equivalents) |
| 📋 Task Planning | Structured multi-step workflow tools (create_plan, get_plan, update_plan_step) |
gh auth logingh_create_issuegh_list_prsTOOL_REGISTRIES) containing 20 entriesconfig, stateManager, and backgroundCommandManager at definition time via arrow functions, eliminating parameter-passing complexityany[] types, replaced with typed closures (() => Tool[]) that satisfy strict ESLint rulesfor...of iteration replaces scattered conditional blocks — adds tools based on config keys or GOD MODE bypassDEFAULT_EXCLUDED_DIRS Set in walkDirectory() function within src/tools/fileSystemTools.tsnode_modules, .git, dist, build, .next, .nuxt, __pycache__, .cache, vendor, .vscode, .idea, .vsinclude pattern (backward compatible).getText() method or .text property before JSON serialization for structured message objects@typescript-eslint/no-base-to-string error with explicit type checks and scoped suppressionz.any() with z.unknown() in Zod schemaslatest.timestamp! with latest.timestamp ?? 0PluginConfig object from .get() calls instead of direct property access on ParsedConfig wrapperas unknown as double-cast for @typescript-eslint/parser return typelineOperations (delete_lines)markdownPreviewTools (markdown_preview)utility config toggle to enable/disable all utility tools# Install dependencies
npm install
# Build the project (ESM + CJS via Tsup)
npm run build
# Run type checking
npm run typecheck
# Run test suite
npm test
// Pattern-based (line-number-agnostic):
line_operations(file_name, operation: "insert",
insert_after_pattern: "if (width <= 0 || height <= 0)",
content: "// fix"
)
// Verification-based (prevents drift errors):
line_operations(file_name, operation: "insert", target_line: 84,
content: "// fix",
verify_before_insert: "return;" // Content expected at line 84
)