Class: AgentHarness::Providers::Opencode

Inherits:
Base
  • Object
show all
Defined in:
lib/agent_harness/providers/opencode.rb

Overview

OpenCode CLI provider

Provides integration with the OpenCode CLI tool.

Instance Attribute Summary

Attributes inherited from Base

#config, #executor, #logger

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#configure, #initialize, #send_message

Methods included from Adapter

#dangerous_mode_flags, #error_patterns, #fetch_mcp_servers, #health_status, included, #send_message, #session_flags, #supports_dangerous_mode?, #supports_mcp?, #supports_sessions?, #validate_config

Constructor Details

This class inherits a constructor from AgentHarness::Providers::Base

Class Method Details

.available?Boolean

Returns:

  • (Boolean)


18
19
20
21
# File 'lib/agent_harness/providers/opencode.rb', line 18

def available?
  executor = AgentHarness.configuration.command_executor
  !!executor.which(binary_name)
end

.binary_nameObject



14
15
16
# File 'lib/agent_harness/providers/opencode.rb', line 14

def binary_name
  "opencode"
end

.discover_modelsObject



36
37
38
39
# File 'lib/agent_harness/providers/opencode.rb', line 36

def discover_models
  return [] unless available?
  []
end

.firewall_requirementsObject



23
24
25
26
27
28
29
30
# File 'lib/agent_harness/providers/opencode.rb', line 23

def firewall_requirements
  {
    domains: [
      "api.openai.com"
    ],
    ip_ranges: []
  }
end

.instruction_file_pathsObject



32
33
34
# File 'lib/agent_harness/providers/opencode.rb', line 32

def instruction_file_paths
  []
end

.provider_nameObject



10
11
12
# File 'lib/agent_harness/providers/opencode.rb', line 10

def provider_name
  :opencode
end

Instance Method Details

#capabilitiesObject



50
51
52
53
54
55
56
57
58
59
60
# File 'lib/agent_harness/providers/opencode.rb', line 50

def capabilities
  {
    streaming: false,
    file_upload: false,
    vision: false,
    tool_use: false,
    json_mode: false,
    mcp: false,
    dangerous_mode: false
  }
end

#display_nameObject



46
47
48
# File 'lib/agent_harness/providers/opencode.rb', line 46

def display_name
  "OpenCode CLI"
end

#nameObject



42
43
44
# File 'lib/agent_harness/providers/opencode.rb', line 42

def name
  "opencode"
end