Commit Graph

46 Commits

Author SHA1 Message Date
rob 501e6cd589 Add evidence-based regression and schema compatibility checks 2026-07-20 14:21:42 -03:00
rob d81286e322 M8.0/M8.V1: Add contract inference engine and deterministic conformance testing 2026-07-20 13:34:13 -03:00
rob ba29e4dc4e Harden M8 preflight foundation 2026-07-20 12:08:38 -03:00
rob 188e167c1c Fix M8 foundation: dry-run exception handling, GUI close race, registry API, contract serialization, semver parser 2026-07-20 11:46:58 -03:00
rob f6bd640865 M8.PF: Add shared PreflightReport analyzer with cmdforge inspect command 2026-07-20 03:00:36 -03:00
rob 23ac54f5c8 M7 follow-up: block GUI silent overwrite, connect registry publish --dry-run to preflight endpoint 2026-07-20 02:57:38 -03:00
rob fe53721725 Harden M7.3 server: typed schemas, depth tracking, fnmatch, config preservation, and collision detection 2026-07-20 01:14:04 -03:00
rob 3525e2eeae Add M7.3 CmdForge as MCP server with FastMCP, expose/deny policy, and schema mapping 2026-07-20 00:24:54 -03:00
rob dee48d8cea Add M7.2 MCP client support with McpStep, CLI commands, and stdio transport 2026-07-20 00:20:40 -03:00
rob 6908d8ee6f Modernize provider support 2026-07-19 20:58:04 -03:00
rob b673ea019c Add provider for-tools command and max_tokens support
- Add 'cmdforge providers for-tools <tool>...' to list providers used by tools
- Add --warm flag to pre-load local models (Ollama) for faster first inference
- Warm larger models first to claim contiguous GPU memory
- Skip cloud providers (claude, opencode, gemini) during warm-up
- Add max_tokens field to PromptStep for controlling output length
- Pass max_tokens to call_provider with provider-specific flags
- Add comprehensive tests for provider functionality

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-04 17:50:26 -03:00
rob 5159450feb Add semantic search (RAG) for registry tool discovery
Users can now find tools by describing what they need in natural language.
Uses Ollama embeddings (nomic-embed-text) on AI-Server for vector similarity
search. Available via CLI (registry describe), GUI (AI search row), and API.

New files:
- registry/embeddings.py: core embedding logic (Ollama API, cosine similarity,
  pack/unpack vectors, backfill)
- tests/test_embeddings.py: 16 unit tests

Modified:
- registry/db.py: tool_embeddings table (schema + migration)
- registry/settings.py: embeddings.* settings (ollama_url, model, enabled, min_score)
- registry/app.py: semantic-search endpoint, publish hook, admin backfill/status
- registry_client.py: semantic_search() method with error surfacing
- gui/pages/registry_page.py: AI search row with SemanticSearchWorker
- cli/__init__.py + registry_commands.py: registry describe subcommand

Backfill required after deploy: POST /api/v1/admin/embeddings/backfill

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 01:52:27 -04:00
rob f24450c19c Fix update-readme CLI and allow admin to update any tool's README
Make tool argument optional when --all is used, add validation for
single-tool mode without tool name, and allow admin role to update
READMEs for tools owned by any publisher (e.g. official namespace).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 01:43:51 -04:00
rob e83c9c15f3 Add registry endpoint and CLI command for updating tool READMEs
- PATCH /api/v1/tools/<owner>/<name>/readme updates README without
  affecting config hash or requiring version bump
- Add RegistryClient.update_readme() method
- Add `cmdforge registry update-readme` CLI command with --all flag
  for batch updating all published tools

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 01:35:10 -04:00
rob f2cb9c0057 Add collapsible README viewer to tool details panel and owner override for publish
- Add collapsible README section to tools page detail panel with lazy loading
- README loads from disk only when user clicks the toggle bar
- Section collapses to a single header bar, expands to show content
- Add --owner flag to registry publish command for admin use
- Simplify dependency gathering in publish to use unified code path

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 01:26:56 -04:00
rob fe5b2047a9 Preserve registry fields on tool save and store owner in all publish paths
- save_tool() now preserves registry_hash, registry_status, registry_owner,
  and registry_feedback from existing config when writing Tool.to_dict(),
  preventing edits from erasing registry metadata.
- CLI publish (registry_commands.py) and collection publish
  (collections_commands.py) now save registry_owner from the publish
  response, matching the GUI publish dialog behavior.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 03:07:00 -04:00
rob 0ee21f27f7 Add admin publish-as-official, hash-based status sync, and GUI fixes
Registry:
- Add admin owner override for publishing tools as "official"
- Add POST /api/v1/tools/status-by-hash batch endpoint for status lookup
  scoped to publisher_id (works for tools published under any owner)

GUI:
- Add "Publish as" dropdown in publish dialog for admin users
- Add "installed" tool state (teal with arrow indicator) for registry-installed tools
- Fix tool editing for official/* qualified tool names (_get_qualified_name helper)
- Fix cancel navigation returning to wrong page (Welcome instead of Tools)
- Fix collections tab not refreshing after publish
- Refactor StatusSyncWorker to use batch hash lookup (1 request instead of N)
  with chunking (100 max) and hash collision handling

CLI:
- Switch registry status sync to hash-based lookup
- Add collection dependency checking and unpublished dep detection

Publish dialog cleanup:
- Move yaml import to module level, remove duplicate _bump_patch_version
- Fix owner combo using currentText() for reliable selection

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 17:18:37 -04:00
rob 071ade0ffb Add system dependencies support for tools
Tools can now declare system-level package dependencies (apt, brew, pacman, dnf)
that get checked and optionally installed when the tool is installed or run.

Features:
- SystemDependency dataclass with short form (string) and long form (dict)
- New system_deps.py module with platform detection and installation
- `cmdforge system-deps <tool>` command to check/install system packages
- `cmdforge check` now shows both CmdForge and system dependencies
- `cmdforge registry install` prompts for system dep installation
- GUI: System Dependencies section in Tool Builder with add/edit dialog
- Runner warns about missing system deps before execution
- Integration with project install (manifest and lock-based)

Also includes:
- Quote paths in wrapper scripts for spaces support
- Tests for value type preservation in code steps
- Unskip invalid tool name test

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 16:31:37 -04:00
rob 8eff55ed1e Add tool settings files for configurable tool defaults
Tools can now ship with defaults.yaml containing configurable settings
that users can customize via settings.yaml (auto-created from defaults).

Features:
- ensure_settings() helper copies defaults to settings on first use
- Settings available as {settings.key} in templates (scalars only)
- Full dict access via settings['key'] in code steps
- CLI: cmdforge settings <tool> show/edit/reset/diff
- GUI: Defaults editor in Tool Builder, Configure button on Tools page
- Registry: defaults.yaml published with tools, included in downloads
- Secret detection warning on publish (api_key, password, token, etc.)

Fully backward compatible - tools without defaults work unchanged.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 11:56:07 -04:00
rob 93797a450a Add cmdforge remove command for project dependencies
- `cmdforge remove <tool>` removes a dependency from cmdforge.yaml
- Matches by exact name or short name (e.g., both "eli5" and "official/eli5" work)
- Returns exit code 1 if dependency not found
- Complements `cmdforge add` for full manifest management

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 23:45:54 -04:00
rob df29b28167 Improve cmdforge add UX for locally-installed tools
- Check if tool is already installed locally before trying registry
- Show clear message: "Already installed globally/locally: <tool>"
- Better error messages for VERSION_NOT_FOUND vs TOOL_NOT_FOUND
- Skip unnecessary registry calls when tool is already available

This fixes confusing UX where `cmdforge add` would show an error for
unpublished tools that were actually satisfied by local installation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 23:34:40 -04:00
rob 3e7eaeb504 Add transitive dependency resolution and lock file support
Implements two major features for project dependency management:

Transitive Dependency Resolution:
- DependencyGraph/DependencyNode for structured dependency tracking
- DependencyGraphBuilder with recursive resolution and cycle detection
- Topological sorting for correct install order (dependencies first)
- Version conflict detection with provenance tracking
- Full semver support: ^, ~, >=, <=, >, <, = constraints
- New `cmdforge deps tree` command to visualize dependency tree
- Install flags: --dry-run, --force, --verbose

Lock File Support (cmdforge.lock):
- Lockfile/LockedPackage/LockfileMetadata dataclasses
- Records exact versions of all dependencies (direct + transitive)
- Integrity verification via SHA256 hashes
- `cmdforge lock` to generate/update lock file
- `cmdforge verify` to check installed tools match lock
- Install flags: --frozen, --strict-frozen, --ignore-lock

62 new tests for version, dependency_graph, and lockfile modules.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 22:05:09 -04:00
rob 29869ef59f Add local collections support with GUI, CLI, and publishing workflow
Features:
- Local collection definitions stored in ~/.cmdforge/collections/
- CLI commands: create, show, add, remove, delete, publish, status
- GUI Collections page with local and registry tabs
- Collection publishing with tool resolution and visibility checks
- New API endpoints: GET /api/v1/me, GET /api/v1/tools/.../approved,
  POST /api/v1/collections
- RegistryClient methods: get_me(), has_approved_public_tool(),
  publish_collection()

Implementation:
- collection.py: Collection dataclass, resolve_tool_references(),
  classify_tool_reference(), ToolResolutionResult
- collections_page.py: GUI with background workers for install/publish
- collections_commands.py: Full CLI command implementations
- registry/app.py: New authenticated endpoints with validation

Tests:
- test_collection.py: 27 unit tests for collection module
- test_collection_api.py: 20 tests (8 client, 12 API with Flask skip)

Documentation updated: README, CHANGELOG, CLAUDE.md, tests/README

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 16:50:19 -04:00
rob cb6a8df79b Fix cf arrow key handling - remove broken select() logic
The select() timeout approach was causing arrow keys to be
misinterpreted as Escape. Revert to direct reading since escape
sequence bytes arrive together from the terminal.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 04:52:47 -04:00
rob def8baf344 Add cf tutorial and graceful Ctrl+C handling
- Add Interactive Tool Picker tutorial to web docs
- Handle SIGINT signal for clean exit on Ctrl+C
- Add KeyboardInterrupt handling in main()
- Add tutorial to Getting Started section in TOC

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 03:49:18 -04:00
rob f6bb863f60 Add piped input support and documentation for cf picker
- Support piped input: cat file.txt | cf | cf
- Write picker UI to stderr when stdout is piped
- Use /dev/tty for keyboard input independent of stdin
- Add select() for non-blocking escape sequence detection
- Document cf in CLI reference and Getting Started

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 03:34:55 -04:00
rob 9f3227f7ef Swap Tab/Enter in argument picker: Tab edits, Enter runs
More consistent with main picker flow.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 02:52:52 -04:00
rob 356a47eebc Make cf dropdown scroll instead of showing +N more
Arrow past the last visible item now scrolls the list smoothly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 02:49:32 -04:00
rob df1d3ace23 Rewrite cf as lightweight inline dropdown
- No longer fullscreen - just a small dropdown below cursor
- Shows max 8 items at a time with "+N more" indicator
- No curses dependency - uses simple ANSI escape codes
- Minimal UI: just type to filter, arrows to navigate
- Cleans up after itself when done
- Much more integrated terminal feel

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 02:46:04 -04:00
rob 992c473939 Improve cf picker: Enter runs, Tab opens argument editor
- Enter: immediately runs the selected tool
- Tab: opens argument picker for tools with arguments
- Shows ⚙ indicator for tools that have arguments
- Argument editor lets you set values with Enter to edit, Tab to run
- Esc in argument picker goes back to tool list
- Footer changes based on whether selected tool has args

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 02:39:37 -04:00
rob 7f0dabd328 Add interactive fuzzy tool picker (cf command)
New `cf` command provides a fuzzy-searchable tool picker:
- Type to filter tools by name or description
- Arrow keys to navigate
- Enter/Tab to select and run
- ? to show arguments for selected tool
- Escape to cancel

Uses curses for a lightweight terminal UI with no extra dependencies.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 02:26:46 -04:00
rob f0d175f3c6 Add --category option to cmdforge create command
Tools support categories (Text, Developer, Data, Other) but the CLI
create command was missing this option. Now users can specify a
category when creating tools from the command line.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 01:05:12 -04:00
rob ae6ec7cea1 Fix collections CLI to handle API's expanded tool format
The API returns tools as objects with owner/name fields, but the CLI
expected string refs. Now handles both formats correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 04:10:30 -04:00
rob 2c2707679f Add collections CLI commands and admin management
CLI Commands:
- cmdforge collections list - List available collections
- cmdforge collections info <name> - Show collection details
- cmdforge collections install <name> - Install all tools in a collection

Admin API:
- GET /api/v1/admin/collections - List all collections (admin)
- POST /api/v1/admin/collections - Create collection
- PUT /api/v1/admin/collections/<name> - Update collection
- DELETE /api/v1/admin/collections/<name> - Delete collection

Admin Web UI:
- /dashboard/admin/collections - List and manage collections
- /dashboard/admin/collections/new - Create new collection form
- /dashboard/admin/collections/<name>/edit - Edit collection form
- Added "Manage collections" link to admin dashboard

Registry Client:
- Added get_collections() method
- Added get_collection(name) method

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 03:43:58 -04:00
rob 19c1cf086f Save registry_hash and status after CLI publish
The GUI was saving tracking fields but CLI wasn't. Now both save
registry_hash, registry_status, and clear feedback on republish.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 20:02:17 -04:00
rob 64b9e8e70d Add status polling and CLI status command for tool moderation
- Add QTimer polling every 30s when tools are pending/changes_requested
- Display changes_requested (⚠) and rejected (✗) states in tool tree
- Show moderator feedback in tool info panel
- Add `cmdforge registry status <tool>` CLI command with --sync flag
- Update _sync_tool to persist registry_feedback field

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:50:30 -04:00
rob 12ae870b3c Fix tool argument passing for flag-style arguments
- Change nargs="*" to REMAINDER for tool_args to stop argparse from
  intercepting --flag style arguments meant for the tool
- Add -- separator handling to distinguish cmdforge args from tool args
- Map flag names to variable names using tool argument definitions
- Update AI review subprocess calls to use -- separator

Fixes scrutiny-ai-review tool arguments not being passed correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 16:39:36 -04:00
rob 0216d1d77a Add disconnect command and fix GUI connection status refresh
- Add `cmdforge config disconnect` command to clear registry token
- Fix GUI connection status label not updating after connect
  - Store status as instance variable instead of local
  - Add _update_connection_status() method
  - Call update after connect dialog completes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 06:55:30 -04:00
rob a5e0948881 Add admin configuration system and M3 content automation
Admin Configuration System:
- Add registry_settings table to database schema
- Create settings.py module with 17 configurable settings across 5 categories
  (vetting, similarity, sync, moderation, rate_limits)
- Add admin API endpoints for settings management (list/get/set/reset)
- Create admin settings web UI page with tabbed categories
- Add CLI commands: cmdforge registry config list/get/set
- Wire settings page link into admin index

M3 Content Automation Scripts:
- scrutiny.py: Quality scoring with 5 weighted checks
- similarity.py: TF-IDF based duplicate detection
- vet_pipeline.py: Combined vetting with auto-decision logic
- fabric_sync.py: Scheduled Fabric pattern synchronization
- fabric-sync.service/timer: systemd units for scheduled sync

Settings available:
- Vetting thresholds (approve/reject) and check weights
- Similarity detection thresholds (duplicate/similar/related)
- Fabric sync configuration (enabled, interval, auto-approve)
- Moderation settings (require review, auto-approve private)
- Rate limiting configuration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 15:20:21 -04:00
rob 4fe2d26244 Convert TUI to PySide6 desktop GUI
Major UI overhaul replacing the urwid-based Terminal UI with a modern
PySide6 desktop application.

New GUI features:
- Sidebar navigation (My Tools, Registry, Providers)
- Tool Builder with visual form for creating/editing tools
- Registry browser with search and one-click install
- Provider management page
- Connect dialog for account pairing
- Publish dialog for sharing tools

- Keyboard shortcuts (Ctrl+N, Ctrl+S, Ctrl+R, Ctrl+1/2/3, Escape, Ctrl+Q)
- Window geometry persistence (remembers size/position)
- Modern clean stylesheet

Removed:
- ui.py, ui_snack.py, ui_registry.py, ui_urwid.py
- ui_urwid/ directory (urwid TUI implementation)

Updated:
- pyproject.toml: PySide6 now required, removed urwid
- CLI entry points to launch GUI
- All documentation (README, CLAUDE.md, AGENTS.md, wiki)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 04:38:35 -04:00
rob 367fac204b Add app pairing feature for simplified registry connection
- Add pairing_requests table and hostname column to api_tokens
- Add pairing API endpoints: initiate, check, status, connected-apps
- Add cmdforge config connect <username> CLI command
- Rewrite tokens.html as Connected Apps with pairing flow
- Update TUI: Connect button when not authenticated, Publish when connected
- Add private sync option after save in TUI when connected
- Add visibility parameter to publish_tool in registry_client

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 01:10:12 -04:00
rob 79739369f0 Fix registry registration URL in CLI
Update publish command to show correct registration URL
(cmdforge.brrd.tech instead of gitea.brrd.tech)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 20:42:37 -04:00
rob 14448408af Add enhanced search and filtering (M2 feature)
- Add /api/v1/tags endpoint for listing available tags
- Enhance search API with tag filtering (AND logic), multi-category
  filtering (OR logic), owner filter, download range, and date range
- Add faceted response support (category/tag/owner counts)
- Update registry client with new search parameters and get_tags method
- Add CLI search options: -t/--tag, -o/--owner, --min-downloads,
  --popular, --new, --since, --before, --json, --show-facets
- Add new 'registry tags' CLI subcommand
- Add web UI filter sidebar with checkboxes, dropdowns, and active
  filter chips with URL-based state management
- Display clickable tags on tool cards

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 06:13:37 -04:00
rob 1caa3454f0 Add source field support and Fabric import script
- Add ToolSource dataclass for attribution metadata (type, license, url, author, original_tool)
- Add source and version fields to Tool dataclass
- Update Tool.from_dict() and to_dict() to handle source field
- Display source attribution in TUI info panel
- Show [imported]/[forked] markers in cmdforge list
- Add import_fabric.py script to import Fabric patterns as CmdForge tools

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 23:52:29 -04:00
rob 2c139b3982 Add meta-tools, collections, and attribution features
Meta-tools:
- Add ToolStep dataclass for tools calling other tools
- Implement execute_tool_step() with recursion depth limiting
- Add check_dependencies() for validating tool dependencies
- Add 'cmdforge check' command for dependency verification

Collections:
- Add collections API endpoints and database schema
- Create collections web UI (list and detail pages)
- Add collections to navigation header and homepage
- Document collections in REGISTRY.md

Attribution:
- Add source attribution fields to tool detail page
- Document source types (original, adapted, imported)
- Add license field documentation

Documentation updates across README, DESIGN.md, REGISTRY.md,
and new META_TOOLS.md design document.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 03:05:23 -04:00
rob 497fe87fc5 Rename project from SmartTools to CmdForge
Major rename operation:
- Rename Python package: smarttools -> cmdforge
- Update CLI entry point: smarttools -> cmdforge
- Update all imports and module references
- Update pyproject.toml with new name, URLs, entry point
- Update all HTML templates with new branding
- Update documentation (CLAUDE.md, README.md, docs/*, wiki/*)
- Update environment variables:
  - SMARTTOOLS_ENV -> CMDFORGE_ENV
  - SMARTTOOLS_REGISTRY_DB -> CMDFORGE_REGISTRY_DB
  - SMARTTOOLS_TOKEN -> CMDFORGE_TOKEN
  - SMARTTOOLS_REGISTRY_* -> CMDFORGE_REGISTRY_*
- Update Dockerfile and docker-compose.yml
- Update tests to use new package name
- Update scripts and examples
- Update package.json and tailwind.config.js

All 158 unit tests pass. The CLI is working correctly with the
new cmdforge command.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 22:15:55 -04:00