Class: Carson::Adapters::Claude
- Inherits:
-
Object
- Object
- Carson::Adapters::Claude
- Includes:
- Prompt
- Defined in:
- lib/carson/adapters/claude.rb
Overview
Adapter for dispatching work to Claude Code.
Instance Method Summary collapse
- #dispatch(work_order:) ⇒ Object
-
#initialize(repo_root:, config: {}) ⇒ Claude
constructor
A new instance of Claude.
Constructor Details
#initialize(repo_root:, config: {}) ⇒ Claude
Returns a new instance of Claude.
11 12 13 14 |
# File 'lib/carson/adapters/claude.rb', line 11 def initialize( repo_root:, config: {} ) @repo_root = repo_root @config = config end |
Instance Method Details
#dispatch(work_order:) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/carson/adapters/claude.rb', line 16 def dispatch( work_order: ) prompt = build_prompt( work_order: work_order ) stdout_text, stderr_text, status = Open3.capture3( "claude", "-p", "--output-format", "text", prompt, chdir: repo_root ) parse_result( stdout_text: stdout_text, stderr_text: stderr_text, success: status.success? ) rescue Errno::ENOENT Agent::Result.new( status: "failed", summary: "claude CLI not found in PATH", evidence: nil, commit_sha: nil ) end |