Help us shape the future of Go! Take the 2026 Go Developer Survey

acp

package
v1.1.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ToolSession     = "acp_session"
	ToolPrompt      = "acp_prompt"
	ToolInteraction = "acp_interaction"
)

Variables

This section is empty.

Functions

func InputSchema added in v0.8.2

func InputSchema(name string) (map[string]any, bool)

func OutputSchema added in v0.8.2

func OutputSchema(name string) (map[string]any, bool)

Types

type InteractionRequest added in v0.8.2

type InteractionRequest struct {
	ProfileID     string                   `json:"profile_id,omitempty"`
	Action        string                   `json:"action"`
	SessionID     string                   `json:"session_id,omitempty"`
	InteractionID string                   `json:"interaction_id,omitempty"`
	Response      InteractionResponseInput `json:"response,omitempty"`
	PendingOnly   *bool                    `json:"pending_only,omitempty"`
}

InteractionRequest 是 acp_interaction 的强类型输入。

type InteractionResponseInput added in v0.9.0

type InteractionResponseInput struct {
	Action   string `json:"action,omitempty"`
	OptionID string `json:"option_id,omitempty"`
}

type PromptRequest added in v0.8.2

type PromptRequest struct {
	ProfileID string           `json:"profile_id,omitempty"`
	Action    string           `json:"action"`
	SessionID string           `json:"session_id,omitempty"`
	RunID     string           `json:"run_id,omitempty"`
	Prompt    []map[string]any `json:"prompt,omitempty"`
	AfterSeq  *int             `json:"after_seq,omitempty"`
	Limit     *int             `json:"limit,omitempty"`
	WaitMS    *int             `json:"wait_ms,omitempty"`
}

PromptRequest 是 acp_prompt 的强类型输入。

type Result

type Result = toolcore.Result

type Service

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

func NewMulti added in v0.9.0

func NewMulti(defaultID string, managers map[string]*acpruntime.Manager) *Service

func (*Service) Close

func (s *Service) Close() error

func (*Service) Interaction

func (s *Service) Interaction(_ context.Context, request InteractionRequest) (response Result, returnErr error)

func (*Service) Prompt

func (s *Service) Prompt(ctx context.Context, request PromptRequest) (response Result, returnErr error)

func (*Service) Session

func (s *Service) Session(ctx context.Context, request SessionRequest) (response Result, returnErr error)

type SessionRequest added in v0.8.2

type SessionRequest struct {
	ProfileID             string   `json:"profile_id,omitempty"`
	Action                string   `json:"action"`
	AuthMethodID          string   `json:"auth_method_id,omitempty"`
	SessionID             string   `json:"session_id,omitempty"`
	RemoteSessionID       string   `json:"remote_session_id,omitempty"`
	FromSessionID         string   `json:"from_session_id,omitempty"`
	CWD                   string   `json:"cwd,omitempty"`
	AdditionalDirectories []string `json:"additional_directories,omitempty"`
	Cursor                string   `json:"cursor,omitempty"`
	IncludeHistory        *bool    `json:"include_history,omitempty"`
	ModeID                string   `json:"mode_id,omitempty"`
	ConfigID              string   `json:"config_id,omitempty"`
	ConfigValue           any      `json:"config_value,omitempty"`
}

SessionRequest 是 acp_session 进入 ACP capability 后的稳定输入契约。 ConfigValue 只保留协议明确允许的 string/bool 动态叶子。

type ToolError

type ToolError = toolcore.ToolError

Jump to

Keyboard shortcuts

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