Commit Graph

136 Commits

Author SHA1 Message Date
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 2b927478a6 Fix NameError in admin collections endpoints
- Replace undefined get_current_user() with existing g.current_publisher
- Replace undefined log_admin_action() with existing log_audit() function
- Remove redundant role checks (already handled by @require_admin decorator)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 04:06:19 -04:00
rob c35512dee9 Fix: Use @require_admin decorator instead of @require_auth
The @require_auth decorator doesn't exist - should use @require_admin
for admin-only endpoints.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 03:52:55 -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 a46add05b7 Add prefix matching to registry search
Search terms now automatically get a * suffix for prefix matching.
E.g., searching "summ" matches "summarize", "summary", etc.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 02:42:46 -04:00
rob 85d1212c0d Add startup connection validation to GUI
- Add validate_token() method to RegistryClient
  - Returns (is_valid, error_message) tuple
  - Catches 401/UNAUTHORIZED errors and connection issues
- Add startup validation in MainWindow
  - Runs 500ms after window shows (non-blocking)
  - Clears invalid tokens automatically
  - Shows status bar message explaining what happened
- Document cmdforge config disconnect command

This prevents confusing errors when trying to publish with stale or
revoked credentials - the GUI now auto-clears bad connections on restart.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 01:59:16 -04:00
rob adefe909c2 Add fork display, version selector, and admin cleanup features
Registry Features:
- Fork tracking with forked_from/forked_version metadata
- Forked tools show "Forked from" notice on detail page
- Original tools display "Forks" section listing all forks
- Fork count in tool stats
- API: GET /api/v1/tools/<owner>/<name>/forks

GUI Improvements:
- Version selector dropdown for registry installs
- Fetch available versions via GET /api/v1/tools/<owner>/<name>/versions
- "Latest" option plus all available versions listed

Admin Features:
- POST /api/v1/admin/cleanup/rejected endpoint
- Maintenance section in admin dashboard
- "Dry Run" and "Run Cleanup" buttons for rejected version cleanup
- Configurable grace period (default 7 days)

Documentation:
- Updated CHANGELOG.md with all recent changes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 23:42:32 -04:00
rob 74b5124360 Fix publish flow and consolidate My Tools view
- Make publish endpoint idempotent: return success if same content
  already exists instead of VERSION_EXISTS error (fixes retry issues)
- Always refresh tools page after publish dialog closes
- Consolidate My Tools page to group versions by tool name
- Show version count and list instead of separate rows per version
- Sum downloads across all versions for accurate totals

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 23:17:55 -04:00
rob 16de3e371c Add version display and bump buttons to publish dialog
- Show local and registry version in publish dialog
- Add +Patch/+Minor/+Major bump buttons
- Auto-fetch registry version on dialog open
- Suggest next version based on latest registry version
- Add fork detection and forked_from metadata support
- Update registry schema for forked_from/forked_version fields
- Display fork indicator when publishing forked tools

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 22:45:42 -04:00
rob 4756ea906c Replace Sync Status button with F5 keyboard shortcut
The visible button was confusing since auto-polling handles status
updates. Power users can press F5 to manually sync if needed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 21:43:37 -04:00
rob 9f60e84075 Remove local hash comparison for publish state detection
Simplified approach: just show the moderation status from the server
without trying to detect local modifications. This eliminates the
fragile hash comparison that kept breaking due to representation
differences between to_dict(), raw YAML, and server-side normalization.

States are now simply: local, pending, published, changes_requested, rejected

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 20:53:26 -04:00
rob 66c0fc77ae Fix GUI publish to save normalized config for hash consistency
The GUI was sending to_dict() output to server but only updating the
existing config file with the hash. This caused mismatches because
to_dict() adds fields like 'arguments: []' that weren't in the original.

Now saves the exact config that was published, ensuring local file
matches what was sent to server.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 20:37:29 -04:00
rob d7d0019472 Add registry_feedback to hash exclude list
When syncing feedback from server, the registry_feedback field was
being saved to config but not excluded from hash computation, causing
tools to appear as "modified" instead of showing their actual status.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 20:30:59 -04:00
rob 23c42faf75 Fix hash comparison in get_tool_publish_state
Use raw config for hash comparison instead of to_dict(), which was
adding fields like 'arguments: []' that weren't in the original config.
This caused tools to show as "modified" when they weren't.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 20:22:26 -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 cd4c0682e8 Add Request Changes feature for admin tool moderation
- Add POST /api/v1/admin/tools/{id}/request-changes endpoint
- Sets moderation_status to 'changes_requested' with feedback
- Extend /me/tools/{name}/status to return feedback when status is
  changes_requested or rejected
- Add Request Changes button and modal in admin pending UI
- Make changes modal draggable like other modals

This allows admins to send feedback to publishers instead of just
approving or rejecting tools outright.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 17:59:15 -04:00
rob 9029286d4c Fix AI review variable name in publish endpoint
The AI review was failing because it referenced 'config' which doesn't
exist in the publish endpoint scope. Changed to 'data' which is the
actual variable containing the parsed tool configuration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 17:00:50 -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 e1cae5ffda Fix cmdforge executable path for AI review
Find cmdforge in venv or PATH instead of assuming it's in PATH.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 16:05:51 -04:00
rob 8471480aa7 Add AI-powered secondary review for scrutiny warnings
- Create scrutiny-ai-review tool that uses AI to analyze warnings
- Integrate AI review into publish flow (app.py)
- Integrate AI review into Fabric sync script
- If AI review returns APPROVE with >=80% confidence, auto-approve
- Display AI review results in admin pending tools modal
- Shows verdict (APPROVE/REJECT/NEEDS_HUMAN_REVIEW) with confidence
- Shows per-finding analysis (FALSE_POSITIVE/LEGITIMATE_CONCERN)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 16:03:44 -04:00
rob b0bd692be5 Add scrutiny warnings to tool detail modal
Shows warnings at the top of the detail view with:
- Yellow warning styling
- Check name, message, and suggestion
- Warning icon for visibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 15:25:40 -04:00
rob 807a0e28a5 Fix modal scrolling - content scrolls within fixed viewport
- Modal now has max-height of viewport minus padding
- Content area scrolls independently (overflow-y-auto)
- Header and footer buttons stay fixed/visible
- Background scroll locked when modal is open
- Fixes scroll context issues after dragging

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 15:22:10 -04:00
rob 957a65397a Fix modal header positioning and step content display
- Header now flush with top of modal (full draggable area)
- Content area properly padded below header
- Fix step rendering: use step.prompt not step.content
- Show provider, output_var, and step name in step display
- Add support for tool steps
- Add max-height with scroll for long prompts/code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 15:13:27 -04:00
rob 9035a17f21 Improve modal styling and make dialogs draggable
- Darker overlay (bg-gray-900 bg-opacity-60)
- Stronger border (border-2 border-gray-300)
- Larger shadow (shadow-2xl)
- Gray header bar with cursor-move indicator
- Draggable by header (both detail and reject modals)
- Position resets on close for re-centering

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 15:04:05 -04:00
rob 3914ca74b3 Add tool detail view to admin pending page
- Click tool name to view full details in modal
- Shows description, arguments, steps (prompt/code), and README
- Approve/Reject buttons in detail modal
- New API endpoint GET /api/v1/admin/tools/<id> returns full tool config

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 14:55:50 -04:00
rob 706accc008 Remove redundant "Go to page" input from pagination
Page numbers are clickable, making the input unnecessary clutter.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 14:50:06 -04:00
rob cb9625d613 Add improved pagination to admin pending tools page
- Page number links with ellipsis for large ranges
- First/Last page buttons (« and »)
- "Go to page" input for direct page jumping
- Current page highlighted in indigo

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 14:46:35 -04:00
rob f22e95d119 Add automatic background sync for tool statuses
When the Tools page loads, automatically sync statuses for all published
tools in the background. This means users don't need to manually click
"Sync Status" - the indicators will update automatically.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 08:11:17 -04:00
rob 7f976d3f8c Fix hash computation to exclude version/tags metadata
The publish dialog adds version and tags fields that aren't stored in
the local config.yaml. Exclude these from hash computation so the
hash comparison works correctly.

Also use Tool.to_dict() for consistent hash computation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 08:02:42 -04:00
rob f1c462146b Fix publish state tracking and add sync status feature
- Track moderation status (pending/approved/rejected) in local tool config
- Add new "pending" state indicator (◐ yellow) distinct from "published" (✓ green)
- Add "Sync Status" button to check registry for updated moderation status
- Add /me/tools/<name>/status API endpoint for checking tool status
- Improve admin panel error handling with better error messages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 07:52:42 -04:00
rob 3fccf854be Refresh tools list after successful publish
The tool list now refreshes after publishing to immediately show
the updated publish state indicator (✓).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 07:20:40 -04:00
rob 62a4b4a2da Add path attribute to Tool class for config file tracking
The Tool dataclass now has a path field that points to the config.yaml
file it was loaded from. This is set by load_tool() and enables the
publish dialog to save the registry_hash back to the local config.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 07:16:54 -04:00
rob 4b1f3cee52 Save registry_hash after publish for state tracking
- Add config_hash to publish API response
- Save registry_hash to local tool config after successful publish
- Show appropriate message based on moderation status (approved vs pending)

This enables the GUI to show publish state indicators (✓ published, ● modified)
for tools that have been published to the registry.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 07:12:20 -04:00
rob 96f7c05744 Fix publish dialog sending dict instead of YAML string
The publish_tool() API expects a YAML config string, but the dialog
was passing a dict directly, causing a 500 error on the server.

- Update PublishWorker to accept config_yaml string and readme
- Build complete tool config from Tool.to_dict()
- Convert to YAML string before sending
- Also include README.md if it exists in tool directory

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 07:06:45 -04:00
rob deddd8efbb Fix Publish button always greyed out when not connected
The _update_buttons method wasn't handling the no-token case properly.
When not connected, the Connect button should always be enabled.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 07:01:25 -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 5e01a335c0 Add registry improvements, tag filtering, and admin tools
Registry API improvements:
- Add /api/v1/me POST endpoint for profile updates
- Add /api/v1/me/password POST endpoint for password changes
- Fix visibility filtering on categories and tags endpoints to only
  show approved public tools
- Allow underscores in tool names for fabric pattern compatibility
- Fix sqlite3.Row access (use bracket notation instead of .get())

Web UI improvements:
- Add tag filter to /tools page with three-state buttons
  (include/exclude/neutral)
- Add mobile-friendly tag filter in responsive view
- Display tags on tool cards in the tools listing
- Add dashboard settings form handlers for profile and password

Admin improvements:
- Add scrutiny audit page for reviewing tool safety analysis
- Improve pending tools page with scrutiny report display
- Add scrutiny stats to admin dashboard

Fabric sync improvements:
- Add direct database publishing with scrutiny vetting
- Support auto-approve for tools passing scrutiny
- Improve error handling and logging
- Add source attribution for imported tools

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 06:20:16 -04:00
rob 78025aac8e Implement content hash system for integrity verification
- Add hash_utils.py module for SHA256 content hashing with normalized YAML
- Store config_hash in registry database on publish
- Include hash in download response for client verification
- Verify downloaded content matches registry hash on install
- Store registry_hash in local tool config for publish state tracking
- Show publish state indicators in Tools page UI:
  - Green checkmark: Published and up to date
  - Orange dot: Modified since last publish
  - No indicator: Local tool (never published)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 01:31:08 -04:00
rob 8e6b03cade Add step type icons and inline name editing
- Add icons module with programmatically drawn icons:
  - Speech bubble for prompt steps
  - Code brackets </> for code steps
  - Arrow icons for input/output nodes
- Display icons in list view next to step names
- Display icons in flow view node headers
- Add inline name editing in flow view via property_changed signal
- Sync name changes from flow view to tool model and list view

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 01:21:20 -04:00
rob bc970fb9f7 Update help banner with link cutting shortcut
Added "Cut links: Alt+Shift+drag" to help banner.
Shortened other labels to fit.

In NodeGraphQt, connections are cut by:
- Alt+Shift+Left-drag to slice through connections
- Dragging a connection endpoint to empty space

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 23:59:35 -04:00
rob 683a8a6d8f Fix signal handling during graph rebuild
- Add _rebuilding flag to ignore signals during rebuild
- Prevents cascade of port_disconnected signals when clearing graph
- Fixes KeyError in NodeGraphQt undo stack
- Fixes false dependency warnings on view switch

The port_disconnected and nodes_deleted signals were firing during
clear_session(), causing recursive rebuilds and errors.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 23:54:48 -04:00
rob d1f0c2f893 Add flow view reordering via connection breaking
When a connection is broken in the flow view:
1. The node that lost its input moves to the end of the chain
2. The remaining nodes reconnect automatically
3. Tool model updates to reflect new order
4. Dependency validation warns about broken references

Flow: Input → A → B → C → Output
Break B's input: Input → A → C → B → Output

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 23:50:18 -04:00
rob 260ebf1b2f Fix false positives in variable dependency validation
Only parse {variable} patterns in PromptSteps, not CodeSteps.

In CodeSteps, variables are available directly as Python variables
(e.g., use `input` not `{input}`). The {var} syntax in code is
typically Python f-string or .format() syntax, not CmdForge
template substitution.

This fixes false positives like artifact-ai where Python f-strings
like f"{format_guide}" were incorrectly flagged as missing CmdForge
variable references.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 23:29:13 -04:00
rob b8760eb208 Add drag-reorder, validation, and flow-to-tool sync
List View:
- Enable drag-drop reordering of steps
- Show broken dependency warnings when reordering
- Steps with missing variable refs shown in red with tooltip

Validation:
- Parse {variable} references from prompts and code
- Track available variables at each step position
- Warn when steps reference undefined variables

Flow View Sync:
- Deleting nodes in flow view updates the tool model
- steps_deleted signal propagates changes to builder
- Both views stay in sync

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 23:13:44 -04:00
rob 8ab0fba67c Change Fit All to Fit Selection with Select All shortcut
- F key now fits to selected nodes (or all if none selected)
- A key selects all nodes
- Workflow: drag-select nodes then F to zoom, or A then F for all
- Updated help banner and context menu
- Context menu now has Select All (A) and Fit Selection (F)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 22:53:47 -04:00
rob 827f0f9eef Fix help banner visibility
- Show banner on showEvent (when flow view becomes visible)
- Show banner on mouse enter event
- Raise banner to front to ensure visibility
- Recalculate size before positioning

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 22:41:03 -04:00
rob fb879d09ea Improve flow view UX and fix step naming
- Remove Fit All button, F key shortcut is sufficient
- Add right-click context menu with "Fit All (F)" option
- Add floating help banner that appears on focus and auto-hides
- Banner stays visible when mouse hovers over it
- Fix default step naming to increment per type (Code 1, Prompt 1, Code 2)
  instead of globally (Code 1, Prompt 2, Code 3)
- List view still shows overall step number (1, 2, 3) with per-type names

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 22:36:13 -04:00
rob 4d9a0e5943 Add CmdForge welcome page to sidebar
- Create welcome_page.py with branded landing page
- Add quick action cards for common tasks (Create Tool, Registry, etc.)
- Add "CmdForge" entry at top of sidebar navigation
- Update page indices for navigation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 22:18:00 -04:00
rob 88c9a8a1e7 Add custom step names and fix F key shortcut
- Add name field to PromptStep, CodeStep, and ToolStep dataclasses
- Update step dialogs to allow editing step names
- Display custom step names in both list and flow views
- Fix F key shortcut by installing event filter on graph widget
- Steps without custom names show default "Prompt N" / "Code N"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 22:16:15 -04:00
rob 3c39cc9cda Improve flow visualization UX
- Add navigation help bar at top of flow view with instructions:
  Pan, Zoom, Select, Edit step shortcuts
- Fix zoom to fit all nodes on initial load (was only centering last node)
- Use QTimer to ensure fit happens after widget is fully rendered
- Clear selection after fitting so nodes don't appear selected

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 21:52:36 -04:00
rob 042be8b49b Add flow visualization for tool builder
Implements node-based flow visualization using NodeGraphQt-QuiltiX-fork:

New files:
- src/cmdforge/gui/widgets/flow_graph.py: FlowGraphWidget with custom node types
  - InputNode: Shows tool inputs ($input + argument variables)
  - PromptNode: AI prompt steps with provider display
  - CodeNode: Python code steps
  - OutputNode: Final output
- scripts/test_nodegraph.py: Standalone prototype for testing

Modified files:
- tool_builder_page.py: Added List/Flow view toggle with QStackedWidget
  - Lazy-loads flow widget on first use
  - Syncs between list and flow views
  - Double-click nodes to edit steps
- styles.py: Added viewToggle button styling
- widgets/__init__.py: Export FlowGraphWidget
- pyproject.toml: Added 'flow' optional dependency group

Features:
- Toggle between List and Flow views in Steps panel
- Nodes auto-connected based on step order
- Auto-layout and fit-to-view on load
- Double-click nodes opens step edit dialog
- Graceful fallback if NodeGraphQt not installed

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 17:07:35 -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 d1eb4231a7 Fix Output Template visibility and default value
- Set default value "{response}" for new tools
- Add minimum height (80px) so it's always visible
- Add stretch factors to layout so Steps expands, Output stays fixed
- Update placeholder text to be more helpful

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 14:33:07 -04:00
rob 436d6292ff Add Python syntax checking to Code Step dialog
Validates code with ast.parse() before accepting. Shows line number
and error message if syntax is invalid.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 14:27:55 -04:00
rob 2438aec831 Restore AI-assisted code generation in Code Step dialog
Feature was present in TUI but missing after GUI conversion. Now includes:
- Split layout: Code editor (left) | AI Assist panel (right)
- Provider selector dropdown for AI calls
- Prompt editor with smart default template showing available variables
- "Generate Code" button that calls AI in background thread
- Response feedback area showing success/error status
- Automatic markdown fence stripping from AI responses
- Available variables computed from tool arguments + previous step outputs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 14:20:58 -04:00
rob 9588c3f8b0 Add AI persona profiles for prompt injection
Profiles allow users to inject system instructions into prompts,
customizing the AI's behavior and persona for tool execution.

Features:
- Profile dataclass with name, description, system_prompt
- 8 built-in profiles: None, Comedian, Technical Writer, Teacher,
  Concise, Creative, Code Reviewer, Analyst
- Custom profile creation and storage in ~/.cmdforge/profiles/
- Profile selector in Prompt Step dialog
- Profile injection during tool execution
- Profiles page in GUI (Ctrl+4) for viewing and managing profiles

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 05:22:31 -04:00
rob 9d56f703cd Fix sort field values to match API
- 'newest' -> 'published_at' (valid API field)
- Remove 'rating' sort (not supported by API)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 05:03:55 -04:00
rob ebb70f5865 Fix Browse All to use list_tools instead of search_tools
search_tools requires a query, but list_tools allows browsing
without a search term. Use list_tools when no query or tags are set.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 05:01:01 -04:00
rob 305c09a929 Fix QTextEdit -> QTextBrowser for clickable links
setOpenExternalLinks is only available on QTextBrowser, not QTextEdit.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 04:58:39 -04:00
rob 518a04a8b0 Add tool marketplace UI enhancements
- Browse all tools on page load without search
- Category filter dropdown (Text, Developer, Data, etc.)
- Sort options (downloads, rating, newest, name)
- Star ratings display in results table
- Clickable tags for filtering
- Installed indicator (✓) for local tools
- Update available indicator (↑) for newer versions
- Pagination controls for large result sets
- Publisher reputation info in details

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 04:51:10 -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 604b473806 Add ratings, reviews, and publisher reputation system
- Add database schema for reviews, issues, and stats caching
- Add API endpoints for reviews (CRUD, voting, flagging)
- Add API endpoints for issues (report, list, resolve)
- Add publisher stats and badge system
- Add trust score calculation (0-100 scale)
- Update tool detail page with ratings, reviews, issues sections
- Update publisher profile with stats, badges, trust score
- Add dedicated reviews and issues pages with filtering
- Update dashboard tools table with rating/issues columns
- Update tool cards with inline rating display

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 03:12:31 -04:00
rob d2c668dc99 Improve connection UX based on feedback
Web UI:
- Change sidebar "API Tokens" to "Connections"
- Change empty state button to "Make Your First Connection"
- Add TUI option to "About Connected Apps" info banner
- Add both TUI and CLI options to pairing modal

TUI:
- Change dialog title to "Connect to your CmdForge Account"
- Add account creation hint in username prompt
- Improve instructions with full URL and steps
- Fix timer refresh by calling loop.draw_screen()

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 01:45:01 -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 3fe7b07c70 Fix /api/v1/me/tools to include published_at
The dashboard template expected published_at but it was missing from the query.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 00:11:08 -04:00
rob 155905b61e Fix password reset to use argon2 hasher
Was using werkzeug's generate_password_hash which creates incompatible
hashes. Now uses the same argon2 password_hasher as registration/login.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 00:07:21 -04:00
rob eacfd0d74a Add admin tools: delete publisher and reset password
- DELETE /api/v1/admin/publishers/<id> - delete publisher with optional tool deletion
- POST /api/v1/admin/publishers/<id>/reset-password - generate temporary password

Safety features:
- Cannot delete yourself or other admins
- Delete requires typing username to confirm
- Reset password shows temp password in modal with copy button

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 23:56:06 -04:00
rob a4ed9ed730 Fix admin dashboard and update repository URLs
- Fix _api_get to handle query strings in URL path
- Replace placeholder github.com/your-org URLs with gitea.brrd.tech/rob

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 23:47:59 -04:00
rob 50326a11c6 Fix migration: move new column indexes to migrate_db()
The index creation for moderation_status, visibility, role, and banned
columns was in SCHEMA_SQL which runs before migrate_db(). This caused
failures on existing databases that didn't have these columns yet.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 23:24:48 -04:00
rob 946a5933b4 Add registry curation system with role-based moderation
Implement comprehensive moderation system for the CmdForge registry:

- Role-based access control (user, moderator, admin)
- Tool moderation workflow: pending → approved/rejected/removed
- Tool visibility: public, private, unlisted
- Publisher management: ban/unban with token revocation
- Report resolution with configurable actions
- Audit logging for all moderation actions

Database changes:
- Add role, banned columns to publishers table
- Add visibility, moderation_status columns to tools table
- Create audit_log table for accountability

API additions:
- Admin endpoints for tool moderation (approve/reject/remove)
- Publisher management endpoints (ban/unban/role)
- Report resolution endpoint
- Audit log query endpoint

Web UI:
- Admin dashboard with stats overview
- Pending tools queue with approve/reject
- Publisher management with ban/role controls
- Report queue with resolve actions
- Role badge in dashboard sidebar

Existing tools grandfathered as approved, all publishers default to user role.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 22:58:37 -04:00
rob 63149aec07 Add database migration for schema updates
When the registry server starts, it now automatically adds any missing
columns to existing tables. This prevents 500 errors when publishing
to a database created before newer columns were added.

Columns added by migration:
- scrutiny_status, scrutiny_report (tool scrutiny)
- source, source_url, source_json (tool attribution)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 21:48:38 -04:00
rob 0462750b88 Allow pasting registry token directly in TUI
When publishing without a configured token, the TUI now:
1. Shows instructions for getting a token
2. Opens an input dialog to paste the token
3. Saves the token and continues with publishing

This eliminates the need to exit the TUI or use another terminal.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 21:40:09 -04:00
rob a70267cf53 Fix token modal and session token issues
- Fix create token modal z-index so it's not covered by backdrop
- Rename session tokens from "login" to "Web Session" for clarity
- Delete old session tokens when logging in (prevents accumulation)
- Filter out session tokens from dashboard display (users only see
  their manually created API tokens)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 21:27:01 -04:00
rob e18a575f76 Add TUI publish feature and fix web UI dropdown
- Add Publish button to TUI for publishing tools directly from the
  graphical interface without using the command line
- Fix user dropdown menu in web UI header that stayed open after
  clicking (replaced Alpine.js directives with vanilla JS)
- Update test to use correct registry URL (cmdforge.brrd.tech)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 21:12:42 -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 86d82fcd72 Fix TUI registry browser and harden search API
- TUI: Use list_tools for browsing (no query), search_tools only when
  user enters a search term. Fixes 500 error on initial registry load.

- API: Sanitize FTS5 queries by escaping special characters (* " ( ) etc)
  Prevents SQL errors from malformed search queries like "*"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 20:36:21 -04:00
rob 19e5be7e5a Fix category display and tool counts in web UI
- Categories API now includes dynamic categories from database
  (categories used by tools but not in predefined list)
- Add total_tools to categories API meta for accurate All Tools count
- Fix web routes to use total_tools instead of summing category counts
- Dynamic categories get auto-generated descriptions

This fixes:
- "All Tools" showing 2 instead of 4
- Categories like "code-analysis" and "education" not appearing
- Incorrect category counts in sidebar

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 19:53:40 -04:00
rob c89bd44be8 Fix registry URL and add registry browser to TUI
- Fix default registry URL: gitea.brrd.tech -> cmdforge.brrd.tech
  (gitea.brrd.tech was Gitea's API, not CmdForge registry)

- Add "Registry" button to TUI main menu
- Add registry browser overlay with:
  - Search input with live search
  - Tool list with owner/name display
  - Info panel showing name, publisher, version, description,
    downloads, and tags
  - Install button with confirmation dialog
  - Proper error handling for network issues

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 19:43:20 -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 614b145f5f Improve error messages for debugging
Code step errors:
- Show line numbers with context (line before/after)
- Display available variables for debugging
- Include step number in error message

YAML loading errors:
- Show line and column number for syntax errors
- Display the problematic line with arrow pointer
- Show the specific YAML problem description

Nested tool errors:
- Track call stack through tool chain
- Display full call path when nested tool fails
- Show step numbers at each level

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 04:50:19 -04:00
rob 9141a3eedf Add deploy webhook for CI/CD
- New /api/v1/webhook/deploy endpoint
- Verifies Gitea HMAC-SHA256 signature
- Only deploys on push to main/master branch
- Runs git pull and service restart in background

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 03:03:11 -04:00
rob 62f06813a4 Add full ToolSource support to registry
- Add source_json column to store complete source attribution
- Update publish API to accept source object or legacy string
- Update get_tool API to return parsed source object
- Update web UI to display type, author, license, url, original_tool
- Add gunicorn config and dependency for production server

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 02:43:09 -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