acp

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const ProbePrompt = "List the files in this directory and exit."

Variables

This section is empty.

Functions

func NewProvider

func NewProvider(cfg ProviderConfig) runtime.Provider

func ParseTranscriptEvent

func ParseTranscriptEvent(line []byte) (events.Event, error)

Types

type Client

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

func NewClient

func NewClient(ctx context.Context, cfg ClientConfig) (*Client, error)

func (*Client) Authenticate

func (c *Client) Authenticate(ctx context.Context, methodID string) error

func (*Client) Close

func (c *Client) Close() error

func (*Client) Events

func (c *Client) Events() <-chan events.Event

func (*Client) Initialize

func (c *Client) Initialize(ctx context.Context) (json.RawMessage, error)

func (*Client) LoadSession

func (c *Client) LoadSession(ctx context.Context, sessionID string) (*Session, error)

func (*Client) NewSession

func (c *Client) NewSession(ctx context.Context) (*Session, error)

func (*Client) PID

func (c *Client) PID() int

func (*Client) ResumeSession

func (c *Client) ResumeSession(ctx context.Context, sessionID string) (*Session, error)

func (*Client) SetSessionMode

func (c *Client) SetSessionMode(ctx context.Context, sessionID string, modeID string) error

func (*Client) SetSessionModel

func (c *Client) SetSessionModel(ctx context.Context, sessionID string, modelID string) error

type ClientConfig

type ClientConfig struct {
	Bin                  string
	Args                 []string
	Dir                  string
	AutoAnswerPermission bool
	AppendCWDArg         bool
}

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

func (*Provider) AnswerPermission

func (p *Provider) AnswerPermission(ctx context.Context, sessionID string, requestID string, response runtime.PermissionResponse) error

func (*Provider) Cancel

func (p *Provider) Cancel(ctx context.Context, sessionID string) error

func (*Provider) Capabilities

func (p *Provider) Capabilities(ctx context.Context) (runtime.Capabilities, error)

func (*Provider) Close

func (p *Provider) Close() error

func (*Provider) Events

func (p *Provider) Events(ctx context.Context, sessionID string) (<-chan events.Event, error)

func (*Provider) Prompt

func (p *Provider) Prompt(ctx context.Context, sessionID string, prompt string) error

func (*Provider) Resume

func (p *Provider) Resume(ctx context.Context, sessionID string) (runtime.Session, error)

func (*Provider) Start

type ProviderConfig

type ProviderConfig struct {
	BackendID           string
	Bin                 string
	Args                []string
	SubprocessDiscovery bool
	AppendCWDArg        bool
	Authenticate        string // optional: if non-empty, call Client.Authenticate with this methodId after Initialize
	ConfigureSession    func(ctx context.Context, session *Session, opts runtime.StartOptions) error
}

type Session

type Session struct {
	Client    *Client
	SessionID string
}

func (*Session) Cancel

func (s *Session) Cancel() error

func (*Session) Close

func (s *Session) Close(ctx context.Context) error

func (*Session) Prompt

func (s *Session) Prompt(ctx context.Context, prompt string) (events.Event, error)

Jump to

Keyboard shortcuts

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