Versions in this module Expand all Collapse all v0 v0.2.3 Aug 13, 2026 Changes in this version + var ErrCustomAnswerRejected = errors.New("opencode 拒绝了自定义答案") + func WriteTaskEnv(taskDir, taskID, model, planContent string) (configPath, promptPath string, err error) + type API struct + func NewAPI(baseURL, password string) *API + func NewAPIWithSSEBackoff(baseURL, password string, initial, max time.Duration) *API + func NewAPIWithSSETiming(baseURL, password string, initial, max, stableAfter time.Duration) *API + func NewAPIWithUnaryTimeout(baseURL, password string, timeout time.Duration) *API + func (a *API) CreateSession(ctx context.Context) (sessionID string, err error) + func (a *API) GetSession(ctx context.Context, sessionID string) (d sessionDetail, err error) + func (a *API) HasSession(ctx context.Context, sessionID string) (ok bool, err error) + func (a *API) LastAssistantMessage(ctx context.Context, sessionID string) (msg *SessionMessage, err error) + func (a *API) ListPendingQuestions(ctx context.Context) (out []PendingQuestion, err error) + func (a *API) PromptAsync(ctx context.Context, sessionID, text string) (err error) + func (a *API) RejectQuestion(ctx context.Context, requestID string) (err error) + func (a *API) ReplyQuestion(ctx context.Context, requestID string, answers [][]string) (err error) + func (a *API) RespondPermission(ctx context.Context, sessionID, permID, response string) (err error) + func (a *API) SubscribeEvents(ctx context.Context, onEvent func(json.RawMessage), onReconnect func()) error + type Adapter struct + func New(log *slog.Logger) *Adapter + func (a *Adapter) Events(taskID string) <-chan executor.AdapterEvent + func (a *Adapter) Probe(req executor.ProbeReq) (executor.ProbeOutcome, error) + func (a *Adapter) ProcHandle(taskID, taskDir string) (prochost.Handle, error) + func (a *Adapter) Reap(taskID, taskDir string) error + func (a *Adapter) Reconcile(ctx context.Context, taskID string) (executor.ReconcileOutcome, error) + func (a *Adapter) RespondPermission(ctx context.Context, taskID, permID, decision string) (err error) + func (a *Adapter) Resume(req executor.ResumeReq) (out executor.ResumeOutcome, err error) + func (a *Adapter) Send(ctx context.Context, taskID, text string) (err error) + func (a *Adapter) Start(ctx context.Context, req executor.StartReq) (err error) + func (a *Adapter) Stop(taskID string) (err error) + type PendingQuestion struct + ID string + Questions []QuestionInfo + SessionID string + type Proc struct + Handle prochost.Handle + Password string + Port int + ServeLogPath string + func StartServe(ctx context.Context, repoPath, taskID, taskDir, configPath string, ...) (*Proc, error) + func (p *Proc) Alive() bool + func (p *Proc) Kill() error + type QuestionInfo struct + Custom bool + Header string + Multiple bool + Options []QuestionOption + Question string + type QuestionOption struct + Description string + Label string + type SessionMessage struct + CompletedMS int64 + ErrorName string + ErrorText string + Finish string + ID string + Role string + Text string + ToolStatus string