Commit Graph

60 Commits

Author SHA1 Message Date
rob 357997dc7d Fix docs heading format for template compatibility
Convert (id, title) tuples to SimpleNamespace objects with id, text,
and level attributes to match template expectations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 23:10:34 -04:00
rob 8c7c22b958 Fix duplicate SEO route registration
Remove sitemap.xml and robots.txt route registrations from app.py
since they're already defined in routes.py. This was causing an
AssertionError on startup.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 23:09:01 -04:00
rob 4318b6cec5 Add SEO files and real documentation content
- Add permissive robots.txt welcoming all crawlers including AI
- Add dynamic sitemap.xml with all pages and tools
- Add real documentation content (Getting Started, Installation, First Tool, Publishing, Providers)
- Update docs route to use content from docs_content.py

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 23:05:57 -04:00
rob 1ac3054aaa Add Phase 8 features: analytics, reporting, health check
- Add pageviews table and /api/v1/analytics/pageview endpoint
- Abuse reporting API already existed at /api/v1/reports
- Add health_check.py script for monitoring
- ChatGPT additions: report modal UI, analytics tracking JS

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 22:49:58 -04:00
rob 096c0739d8 Merge pull request 'Add SmartTools Registry with Web UI (Phase 1-7)' (#18) from feature/registry into main 2026-01-01 01:21:37 +00:00
rob 9a33d57de1 Add JavaScript interactivity and consent API
- Complete main.js with all interactive functions:
  - Mobile menu toggle with icon switching
  - Search modal with live search
  - Dashboard modals (tokens, deprecate, settings)
  - Tool detail page (copy install, report modal)
  - Toast notifications
- Add /api/v1/consent endpoint for cookie preferences
- Session-based consent storage

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 21:06:40 -04:00
rob e029166ba6 Change web blueprint static URL path to avoid conflict
The main Flask app and web blueprint both used /static, causing
conflicts. Changed web blueprint to use /web-static instead.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 20:08:20 -04:00
rob 9070029d31 Fix static folder path resolution for blueprints
Use absolute paths for templates and static folders to ensure
they resolve correctly regardless of the working directory.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 20:06:34 -04:00
rob 24c91b8de7 Add deployment guide to WEB_UI.md
Includes:
- Quick start instructions
- Environment variables
- Database configuration (with mergerfs note)
- systemd service example
- nginx reverse proxy config
- SSL setup with certbot
- Tailwind CSS build commands
- Health check and troubleshooting

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 20:00:59 -04:00
rob b26ae5092b Add error handlers for 404 and 500 pages
Register Flask error handlers to render the error templates.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 19:59:01 -04:00
rob c41d2eace2 Update .gitignore and remove untracked files
- Added node_modules/, package-lock.json, discussions/, diagrams/
  and temporary files to .gitignore
- Removed accidentally committed files from git tracking

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 19:50:13 -04:00
rob 16554c0694 Fix csrf_token collision in auth.py
The auth.py was passing csrf_token as a string variable which
collided with the global csrf_token function in Jinja2. Removed
the redundant passing since csrf_token() is already available
as a Jinja global.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 19:47:29 -04:00
rob 0200ad4f6e Add 'now' global function to Jinja2 templates
The footer template uses now().year for the copyright date.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 19:43:43 -04:00
rob b90e632ec7 Fix session interface method indentation
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 19:40:42 -04:00
rob d6519bde66 Fix blueprint route registration order
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 19:36:05 -04:00
rob c8a937ec15 Fix Semver dataclass order conflict with Python 3.11
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 19:34:36 -04:00
rob cfb9858967 Add built Tailwind CSS and lockfile
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 19:14:54 -04:00
rob 34428f0e72 Add SmartTools Registry and Web UI (Phases 1-7)
Registry Features (Phases 1-6):
- Tool manifest format and validation
- Registry client for API communication
- Resolver integration for tool installation
- CLI commands: install, search, browse, publish, auth
- TUI browse interface with urwid
- Smart features: auto-categorization, similarity suggestions

Web UI (Phase 7):
- Flask blueprint with server-side sessions
- Authentication routes (login, register, logout)
- Public pages: landing, tools browse, tool detail, search
- Dashboard: overview, tools management, API tokens, settings
- Template components: cards, forms, callouts, code blocks
- Tailwind CSS build pipeline
- SEO infrastructure (sitemap, robots.txt)
- Cookie consent and privacy compliance

Infrastructure:
- SQLite database with FTS5 search
- Rate limiting for API endpoints
- Git-based tool submission workflow
- Session management with auto-cleanup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 19:03:41 -04:00
rob 284e9981bc Add issue templates for bug reports, feature requests, and questions
Adds Gitea issue templates in .gitea/ISSUE_TEMPLATE/:
- bug_report.md: Environment, steps to reproduce, error output
- feature_request.md: Use case, proposed solution, alternatives
- question.md: Context, what's been tried

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 03:04:23 -04:00
rob b67d44ac8b Clean up OpenCode ProviderModelNotFoundError messages
- Detect ProviderModelNotFoundError and show clean message
- Extract provider and model IDs from error
- Suggest: connect provider in opencode, use --provider flag, or edit in UI
- Truncate other stderr to 200 chars to avoid code dumps

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 01:25:15 -04:00
rob 9d783af2f9 Improve provider error messages with install suggestion
- Add "smarttools providers install" suggestion when command not found
- Add suggestion when provider exits with error containing "not found"
- Detect empty output and warn about unavailable model
- Show stderr hint when provider returns nothing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 01:11:00 -04:00
rob c1499e76d2 Add 'Try It Now' quick demo section to README
60-second demo using Docker container:
- Pull container, install OpenCode, run eli5 on README
- Uses free Big Pickle model by default, no sign-up required
- Demonstrates the tool while explaining itself

Keep native install as 'Quick Start (Native Install)' for regular use.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 00:55:43 -04:00
rob c8a0433ecc Update OpenCode provider info with free models and 75+ providers
- Mention 4 free models: Big Pickle, GLM-4.7, Grok Code Fast 1, MiniMax M2.1
- Note that 75+ providers are available through OpenCode
- Change setup to "opens browser to connect more providers"
- Put opencode-pickle first in variants so test uses a free provider

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 00:09:14 -04:00
rob e2816bf6f6 Make source ~/.bashrc instruction more prominent after provider install
Always show the IMPORTANT message about refreshing PATH, with clear
step numbering that makes source ~/.bashrc step 1.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 23:47:11 -04:00
rob d830a483d9 Update Docker provider install instructions for pre-built container
Add separate instructions for:
- Pre-built container: docker run with display/volume flags
- Build from source: docker-compose run setup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 23:40:44 -04:00
rob 38a446640f Add pre-built container pull instructions to README
Users can now pull the image directly from the Gitea registry:
  docker pull gitea.brrd.tech/rob/smarttools:latest

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 23:21:12 -04:00
rob 543ded0a5f Add interactive provider installer and fix documentation
- Add `smarttools providers install` interactive guide for installing AI CLIs
- Fix OpenCode install URL (remove .sh suffix)
- Auto-refresh PATH after provider installation
- Fix incorrect npm package names in docs:
  - @anthropic-ai/claude-code (not claude-cli)
  - @openai/codex (not codex-cli)
  - @google/gemini-cli (not @anthropic-ai/gemini-cli)
- Update all docs to reflect clone-first install workflow (not PyPI)
- Add Docker provider installation section to README

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 17:33:23 -04:00
rob b09008c215 fix: correct Gemini install command (npm @google/gemini-cli) 2025-12-29 15:50:42 -04:00
rob 2cbaaeb9d5 fix: correct Codex install command (npm, not pip) 2025-12-29 15:40:34 -04:00
rob 452cebadda fix: add xdg-utils for browser opening in Docker 2025-12-29 15:19:44 -04:00
rob 6106b7837a feat: add browser support for provider OAuth in Docker
Docker changes:
- Install Node.js and npm (for Claude CLI)
- Install Firefox ESR for browser-based OAuth
- Install X11 libraries for display forwarding
- Add 'setup' service with display access

Usage:
  xhost +local:docker
  docker-compose run --rm setup
  smarttools providers install

The 'setup' service has DISPLAY and X11 socket access, so browser-based
OAuth flows (Claude, Codex, Gemini, OpenCode) can work inside Docker.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 13:15:13 -04:00
rob 9d3b65118d fix: correct provider setup descriptions for browser-based auth
All major providers (Claude, Codex, Gemini, OpenCode) use browser-based
OAuth authentication, not manual API keys:
- Run the CLI command
- Browser opens for sign-in
- Auth tokens saved automatically

Also added post_install_note for Ollama to show how to add the provider
after installing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 13:09:19 -04:00
rob b4c7491784 feat: add interactive provider installation guide
New command: smarttools providers install

Features:
- Lists all provider groups (Claude, Codex, Gemini, OpenCode, Ollama)
- Shows cost, requirements, and included models for each
- Marks already-installed providers
- Offers to run installation command automatically
- Shows post-install setup instructions

Provider groups:
- Anthropic Claude (paid): claude, claude-haiku, claude-opus, claude-sonnet
- OpenAI Codex (paid): codex
- Google Gemini (free tier): gemini, gemini-flash
- OpenCode (free tier): opencode-deepseek, opencode-pickle, etc.
- Ollama (free, local): custom models

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 13:04:17 -04:00
rob 6abca22019 feat: add providers CLI command for managing AI providers
New commands:
- smarttools providers list - List all providers with status
- smarttools providers check - Check which providers are available
- smarttools providers add <name> <command> - Add/update provider
- smarttools providers remove <name> - Remove provider
- smarttools providers test <name> - Test a provider

Features:
- Shows [+] for available, [-] for missing providers
- Mock provider always shows as available (built-in)
- Helpful installation hints when no providers found
- Can add custom providers (Ollama, local scripts, etc.)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 12:53:43 -04:00
rob f65d250973 docs: Add Docker section to README
Friends can now clone and test without installing anything locally.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 01:21:56 -04:00
rob 42be82df6b Add standalone docker-compose.yml
Self-contained Docker setup for SmartTools with no external dependencies.
Includes cli, test, and shell services.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 01:01:35 -04:00
rob 65279bd8c8 Add Docker support and documentation updates
- Add Dockerfile for containerized builds
- Add .dockerignore for cleaner builds
- Add CLAUDE.md for development guidance
- Update README and docs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 23:40:13 -04:00
rob 7e9bd0d533 made an adjustment to the adjust code instructions 2025-12-07 05:34:24 -04:00
rob 35835f8254 fix: Add clearer example showing variable assignment pattern
The AI prompt now explicitly shows:
1. Assign Available Variables to standard Python variables first
2. Then use those variables in the code
3. Multi-line example with file writing pattern

This prevents the AI from trying to use {variable} directly in
expressions without proper assignment.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 05:15:12 -04:00
rob d09a0088ef fix: Show available variables in triple-quote format in AI prompt
The AI follows the pattern better when the available variables are
shown in the exact format they should be used:
  """{input}""", """{response}""", etc.

This helps the AI generate code that properly uses triple quotes
for variable substitution.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 04:58:37 -04:00
rob bcda4150a7 docs: Improve AI auto-adjust prompt with variable substitution guidance
Updated the default prompt template to explain how to use variables:
- Variables must be wrapped in curly braces: {variable}
- Use triple quotes since content may contain quotes/newlines
- Added example: my_var = """{response}"""

This helps the AI generate code that works correctly with the
variable substitution system.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 03:57:41 -04:00
rob 0c966a8adb fix: Add variable substitution to code steps
Code steps were executing with literal {variable} placeholders instead
of substituted values. Now substitute_variables() is called on the code
before execution, matching the behavior of prompt steps.

This fixes issues like {outputfile} being treated as a Python set literal
or written as a literal filename.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 02:59:35 -04:00
rob 9c6b682c73 fix: Improve AI auto-adjust prompt to prevent function wrapping
The AI was generating function definitions instead of inline code.
Updated the default prompt template to explicitly:
- Request inline executable code, NOT function definitions
- Clarify that variables are already available
- Emphasize no wrapping in functions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 21:39:48 -04:00
rob 541d49b7f9 feat: Add tool categories for organization
- Add category field to Tool dataclass (Text, Developer, Data, Other)
- Display tools grouped by category in main UI with section headers
- Add category dropdown selector in tool builder dialog
- Update example tools with appropriate categories
- Document category feature in README

Categories help organize tools in the UI for easier navigation.
Tools without a category default to "Other".

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 04:33:58 -04:00
rob cff3b674ac docs: Add undo/redo and $EDITOR to UI navigation docs
- Added Alt+U/Alt+R for undo/redo in key bindings table
- Added tips about undo/redo (50 states) and $EDITOR button

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 03:35:55 -04:00
rob f84e06aa05 fix: Use Alt+U/Alt+R for undo/redo, fix state tracking
- Changed undo/redo keys to Alt+U and Alt+R (meta keys work in urwid)
- Fixed undo logic: now saves state BEFORE edit happens, not after
- Added duplicate state prevention
- Simplified the tracking logic

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 03:33:13 -04:00
rob 67a83e5379 fix: Change undo/redo keys to Ctrl+U/Ctrl+R
Ctrl+Z is the Unix suspend signal (SIGTSTP) which suspends the process
before urwid can intercept it. Changed to:
- Ctrl+U for undo
- Ctrl+R for redo

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 02:48:51 -04:00
rob 6a4e153a62 feat: Add undo/redo for code editor
- Add UndoableEdit class with undo/redo support:
  - Ctrl+Z to undo (up to 50 states)
  - Ctrl+Y or Ctrl+Shift+Z to redo
  - Automatically tracks edit history and cursor position
  - Tab passes through for focus cycling

- Remove syntax highlighting attempt (incompatible with urwid Edit widget's
  text layout engine which requires raw text strings, not markup)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 02:44:03 -04:00
rob f227831feb Add $EDITOR button to open code in external editor
When editing a code step, users can now click the "$EDITOR" button
to open the current code in their preferred external editor:

- Uses $EDITOR environment variable (falls back to $VISUAL, then nano)
- Creates a temp .py file with current code
- Suspends urwid UI while editor runs
- Imports edited code back when editor closes
- Shows success/error status in the dialog

This allows using vim, nano, VS Code, or any editor for complex
code editing while still using the SmartTools UI for workflow.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 02:04:42 -04:00
rob 765a53df1c Add DOS scrollbar to AI prompt editor
Wrap the AI prompt ListBox in DOSScrollBar for consistent
scrolling experience in the auto-adjust panel.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 01:54:38 -04:00