Class: AgentHarness::Providers::Kilocode

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

Overview

Kilocode CLI provider

Provides integration with the Kilocode CLI tool.

Constant Summary collapse

PACKAGE_NAME =
"@kilocode/cli"
DEFAULT_VERSION =
"7.1.3"
SUPPORTED_VERSION_REQUIREMENT =
"= #{DEFAULT_VERSION}"

Constants inherited from Base

Base::COMMON_ERROR_PATTERNS, Base::DEFAULT_SMOKE_TEST_CONTRACT

Instance Attribute Summary

Attributes inherited from Base

#config, #executor, #logger

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#configure, #initialize, #sandboxed_environment?, #send_message

Methods included from Adapter

#auth_type, #build_mcp_flags, #configuration_schema, #dangerous_mode_flags, #fetch_mcp_servers, #health_status, included, #parse_rate_limit_reset, #send_message, #session_flags, #smoke_test, #smoke_test_contract, #supported_mcp_transports, #supports_dangerous_mode?, #supports_mcp?, #supports_sessions?, #validate_config, #validate_mcp_servers!

Constructor Details

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

Class Method Details

.available?Boolean

Returns:

  • (Boolean)


22
23
24
25
# File 'lib/agent_harness/providers/kilocode.rb', line 22

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

.binary_nameObject



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

def binary_name
  "kilo"
end

.discover_modelsObject



38
39
40
41
# File 'lib/agent_harness/providers/kilocode.rb', line 38

def discover_models
  return [] unless available?
  []
end

.firewall_requirementsObject



27
28
29
30
31
32
# File 'lib/agent_harness/providers/kilocode.rb', line 27

def firewall_requirements
  {
    domains: [],
    ip_ranges: []
  }
end

.install_command(version: DEFAULT_VERSION) ⇒ Object



59
60
61
# File 'lib/agent_harness/providers/kilocode.rb', line 59

def install_command(version: DEFAULT_VERSION)
  installation_contract(version: version)[:install_command]
end

.installation_contract(version: DEFAULT_VERSION) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/agent_harness/providers/kilocode.rb', line 43

def installation_contract(version: DEFAULT_VERSION)
  validate_install_version!(version)
  package_spec = "#{PACKAGE_NAME}@#{version}"

  {
    source: {
      type: :npm,
      package: PACKAGE_NAME
    },
    install_command: ["npm", "install", "-g", "--ignore-scripts", package_spec],
    binary_name: binary_name,
    default_version: DEFAULT_VERSION,
    supported_version_requirement: SUPPORTED_VERSION_REQUIREMENT
  }
end

.instruction_file_pathsObject



34
35
36
# File 'lib/agent_harness/providers/kilocode.rb', line 34

def instruction_file_paths
  []
end

.provider_nameObject



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

def provider_name
  :kilocode
end

.smoke_test_contractObject



63
64
65
# File 'lib/agent_harness/providers/kilocode.rb', line 63

def smoke_test_contract
  Base::DEFAULT_SMOKE_TEST_CONTRACT
end

Instance Method Details

#capabilitiesObject



87
88
89
90
91
92
93
94
95
96
97
# File 'lib/agent_harness/providers/kilocode.rb', line 87

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

#display_nameObject



83
84
85
# File 'lib/agent_harness/providers/kilocode.rb', line 83

def display_name
  "Kilocode CLI"
end

#error_patternsObject



99
100
101
# File 'lib/agent_harness/providers/kilocode.rb', line 99

def error_patterns
  COMMON_ERROR_PATTERNS
end

#execution_semanticsObject



103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/agent_harness/providers/kilocode.rb', line 103

def execution_semantics
  {
    prompt_delivery: :arg,
    output_format: :text,
    sandbox_aware: false,
    uses_subcommand: true,
    non_interactive_flag: nil,
    legitimate_exit_codes: [0],
    stderr_is_diagnostic: true,
    parses_rate_limit_reset: false
  }
end

#nameObject



79
80
81
# File 'lib/agent_harness/providers/kilocode.rb', line 79

def name
  "kilocode"
end