class LLM::ACPClient

Overview

ACP-backed client wrapper for communicating with local AI agents.

Defined in:

llm/acp/client.cr

Constant Summary

CLAUDE_ARGS = ["@zed-industries/claude-agent-acp"]
CODEX_ARGS = ["@zed-industries/codex-acp"]
GEMINI_ARGS = ["--experimental-acp"]
KNOWN_TARGETS = ["codex", "gemini", "claude", "claude-code"] of ::String

ACP targets Noir knows how to launch. Anything outside this set would be executed as an arbitrary local process (--ai-provider "acp:rm -rf /" → command "rm", args ["-rf", "/"]), which is a code-execution hole when the provider string comes from an untrusted config file. Custom targets are refused unless the operator explicitly opts in.

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(provider : String, model : String, event_sink : Proc(String, Nil) | Nil = nil) #

[View source]

Class Method Detail

def self.acp_provider?(provider : String) : Bool #

[View source]
def self.allowed_target?(provider : String) : Bool #

True when the provider resolves to a built-in target, or the operator opted into custom commands. Used for a friendly CLI-time pre-flight.


[View source]
def self.custom_command_allowed? : Bool #

Escape hatch for power users running their own ACP agent binary. Off by default so a poisoned .noir.yml can't silently spawn a process.


[View source]
def self.default_model(provider : String, model : String) : String #

[View source]
def self.extract_target(provider : String) : String #

[View source]
def self.mute_acp_logs : Nil #

[View source]
def self.resolve_command(provider : String) : Tuple(String, Array(String)) #

Resolve provider aliases to actual executable command + args.


[View source]

Instance Method Detail

def args : Array(String) #

[View source]
def close : Nil #

[View source]
def command : String #

[View source]
def model : String #

[View source]
def provider : String #

[View source]
def request(prompt : String, format : String = "json") : String #

[View source]
def request_messages(messages : Array(Hash(String, String)), format : String = "json") : String #

[View source]