Commit Graph

27 Commits

Author SHA1 Message Date
rob 4d22d532a3 Harden M8 trust and guidance workflows 2026-07-20 15:21:50 -03:00
rob bda0c76d5f M8.Q/M8.D1: Add quality scoring engine and tool deprecation fields 2026-07-20 14:37:58 -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 0323a39afb M8.0: Add tool-level input_schema and output_schema contracts to Tool 2026-07-20 02:58:46 -03:00
rob 8366ef798b Harden M7.6/7.7: recursive restriction accumulation, MCP server enforcement, fast-fail authorization 2026-07-20 02:33:44 -03:00
rob 93ea80950e Add M7.6 provider tool access control and M7.7 agent delegation for ToolStep 2026-07-20 02:08:47 -03:00
rob 8d38bdd83a Add M7.5 provider-attached skills system with Agent Skills spec compliance 2026-07-20 02:01:35 -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 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 8581775002 Implement structured output for prompt steps (Phase 1)
Add schema validation and retry logic for AI responses:

- Add output_schema, max_retries, plain_text fields to PromptStep
- Add DEFAULT_OUTPUT_SCHEMA with output/reasoning fields
- Implement append_schema_instructions() for prompt augmentation
- Implement validate_schema() using jsonschema library
- Add retry logic with error feedback on validation failure
- Enhance substitute_variables() for nested field access ({var.field})
- Add jsonschema to dependencies
- Update GUI dialog with plain_text checkbox and max_retries spinner
- Add comprehensive tests for structured output and nested access

Tools using plain_text=True bypass validation (current behavior).
Tools without plain_text get structured JSON output with schema enforcement.

Migration Phase 1 complete. Next: Apply plain_text=True to all 72 tools.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 17:34:48 -04:00
rob f980fe05f1 Add strip_fences option and fix exec() scoping for nested functions
- Add strip_fences field to PromptStep for removing markdown code fences
- Fix exec() to use same dict for globals and locals, allowing nested
  functions to access module-level imports
- Add GUI checkbox for strip_fences option
- Update CLAUDE.md with improved documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 16:14:45 -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 ce94ba89dc Fix list_tools and load_tool to handle owner subdirectories
Tools from the registry are installed to ~/.cmdforge/owner/name/ (e.g.,
~/.cmdforge/official/summarize/), but list_tools() only searched direct
children of ~/.cmdforge/.

Changes:
- list_tools() now searches both direct children and owner subdirectories
- Returns qualified names for nested tools (e.g., "official/summarize")
- load_tool() already handled qualified paths, added docstring clarification

Fixes tools installed via `cmdforge install` not appearing in `cmdforge list`.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 01:10:57 -04:00
rob a36c2db05c Fix dependency parsing for dict format in tool configs
- Normalize dependencies in Tool.from_dict() to handle both string and dict formats
- Dict format: {name: "tts", version: "*"} → extracts just the name for Tool.dependencies
- Fixes "unhashable type: dict" error in check_dependencies()

This allows tools to declare dependencies with version constraints in config.yaml:
  dependencies:
    - name: tts
      version: "*"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 00:16:34 -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 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 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 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 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