Skip to content

feat(tools): Add run_command tool for the agentic loop #8

Description

@sunilp

Summary

Add a run_command tool that allows the model to execute shell commands in the jam run agentic loop.

Details

The file src/tools/run_command.ts already exists but may need to be registered and integrated into the tool registry.

Requirements

  • Ensure run_command tool is properly implemented and registered
  • Must be a write tool (requires user confirmation before execution)
  • Should have safety guards: no rm -rf, no sudo, configurable via allowlist
  • Capture stdout and stderr, return to the model
  • Timeout after configurable duration (default: 30s)

Safety Considerations

  • This is the highest-risk tool — confirmation prompt must clearly show the command
  • Consider a separate dangerousCommandPatterns config option

Acceptance Criteria

  • Tool registered in the registry
  • User confirmation before every execution
  • stdout/stderr captured and returned
  • Timeout support
  • Unit tests with mocked commands

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions