acpclient

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 31 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const CopilotMarkerBaseURL = "acp://copilot"

Marker base URL the former Copilot alias exported as ACP_MARKER_BASE_URL

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Vendor
	// contains filtered or unexported fields
}

OpenAI client shaped facade over one ACP agent CLI spoken to on stdio

func New

func New(ctx context.Context, v Vendor, o Options) (*Client, error)

Client with resolved command, args and workspace cwd, env overrides of the vendor winning over its defaults

func (*Client) APIKey

func (c *Client) APIKey() string

Key reported to callers, the vendor's session default model id when none was passed

func (*Client) AuxDeclares

func (c *Client) AuxDeclares(flag string) bool

A complete async safe client the auxiliary wraps never redispatch through a wire adapter

func (*Client) BaseURL

func (c *Client) BaseURL() string

Base url reported to callers, the never dialled acp marker when none was passed

func (*Client) Close

func (c *Client) Close() error

Terminates every live session process and marks the client closed

func (*Client) CreateChatCompletion

func (c *Client) CreateChatCompletion(ctx context.Context, kwargs map[string]any) (any, error)

Answers OpenAI chat kwargs through one ACP prompt, a completion map or its chunk stream when stream is set

func (*Client) DefaultHeaders

func (c *Client) DefaultHeaders() map[string]string

Headers the caller passed at construction

func (*Client) IsClosed

func (c *Client) IsClosed() bool

Whether no session process is live, true once the last one drained or close ran

func (*Client) ListModels

func (c *Client) ListModels(ctx context.Context, timeoutSeconds float64) ([]string, error)

Enabled models a short lived authenticated session advertises, file requests refused meanwhile

type Error

type Error struct {
	Kind string
	Msg  string
}

Python exception raised by the ACP client, Kind naming its class

func (*Error) Error

func (e *Error) Error() string

func (*Error) ErrorKind

func (e *Error) ErrorKind() string

Python exception class name the error stands for

type Options

type Options struct {
	APIKey         string
	BaseURL        string
	DefaultHeaders map[string]string
	ACPCommand     string
	ACPArgs        []string
	ACPCwd         string
	Command        string
	Args           []string
	Env            *tools.Env
}

Constructor keywords of the client, empty values falling back to the vendor defaults

type Vendor

type Vendor struct {
	DefaultCommand           string
	DefaultArgs              []string
	CommandEnvVars           []string
	ArgsEnvVar               string
	MarkerBaseURL            string
	PlaceholderModel         string
	Label                    string
	MissingCommandHint       string
	AuthRequiredHint         *string
	UnsupportedTransportHint string
	ModelEntryDisabled       func(entry any) (bool, error)
	EarlyExitError           func(stderrText string) (string, bool)
}

Launch defaults, labels and vendor hooks a provider customises

func BaseVendor

func BaseVendor() Vendor

Vendor carrying the generic base defaults every provider starts from

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL