Documentation
¶
Index ¶
- func IsIndicatorActive() bool
- func RequestConfirm(description string, toolsUse *data.ToolsUse)
- func RequestDiff(before, after string, contextLines int) string
- func SendBanner(text string)
- func SendStatus(text string)
- func StartIndicator(text string)
- func StopIndicator()
- type AskUserRequest
- type AskUserResponse
- type BannerEvent
- type Bus
- type ConfirmRequest
- type DiffRequest
- type IndicatorAction
- type IndicatorEvent
- type SessionModeEvent
- type StatusEvent
- type VSCodeConfirmBus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsIndicatorActive ¶
func IsIndicatorActive() bool
func RequestConfirm ¶
RequestConfirm sends a ConfirmRequest to the UI and blocks until the user responds. The ToolsUse.Confirm field will be set by the subscriber before unblocking.
func RequestDiff ¶
RequestDiff sends a DiffRequest to the UI and returns the rendered diff string.
func SendBanner ¶
func SendBanner(text string)
func SendStatus ¶
func SendStatus(text string)
func StartIndicator ¶
func StartIndicator(text string)
func StopIndicator ¶
func StopIndicator()
Types ¶
type AskUserRequest ¶
type AskUserRequest struct {
Question string
QuestionType string
Options []string
Placeholder string
Response chan AskUserResponse // UI sends response back on this channel
}
type AskUserResponse ¶
type AskUserResponse struct {
Answer string `json:"answer,omitempty"`
Answers []string `json:"answers,omitempty"`
Cancelled bool `json:"cancelled,omitempty"`
}
func RequestAskUser ¶
func RequestAskUser(req AskUserRequest) (AskUserResponse, error)
RequestAskUser sends an AskUserRequest to the UI and returns the response.
type BannerEvent ¶
type BannerEvent struct {
Text string
}
type Bus ¶
type Bus struct {
Status chan StatusEvent
Banner chan BannerEvent
Indicator chan IndicatorEvent
Session chan SessionModeEvent
Confirm chan ConfirmRequest
AskUser chan AskUserRequest
Diff chan DiffRequest
// contains filtered or unexported fields
}
type ConfirmRequest ¶
type DiffRequest ¶
type IndicatorAction ¶
type IndicatorAction int
const ( IndicatorStart IndicatorAction = iota IndicatorStop )
type IndicatorEvent ¶
type IndicatorEvent struct {
Action IndicatorAction
Text string
Done chan struct{}
}
type SessionModeEvent ¶
type SessionModeEvent struct {
Mode int // 0=Normal, 1=Plan, 2=Yolo
}
type StatusEvent ¶
type StatusEvent struct {
Text string
}
type VSCodeConfirmBus ¶ added in v1.15.28
type VSCodeConfirmBus struct {
// contains filtered or unexported fields
}
func GetVSCodeConfirmBus ¶ added in v1.15.28
func GetVSCodeConfirmBus() *VSCodeConfirmBus
GetVSCodeConfirmBus returns the global bus for remote confirmation overrides.
func (*VSCodeConfirmBus) Accepted ¶ added in v1.16.4
func (b *VSCodeConfirmBus) Accepted() bool
Accepted returns the remote decision, or nil if no remote event has superseded the prompt.
func (*VSCodeConfirmBus) Clear ¶ added in v1.16.4
func (b *VSCodeConfirmBus) Clear()
Clear is called by the UI when the prompt finishes normally to remove the hook.
func (*VSCodeConfirmBus) Confirm ¶ added in v1.15.28
func (b *VSCodeConfirmBus) Confirm(path string)
func (*VSCodeConfirmBus) Register ¶ added in v1.16.4
func (b *VSCodeConfirmBus) Register(cancel context.CancelFunc, path string)
Register is called by the UI just before blocking on a user prompt. If a remote event arrives, it will call check this cancel function.
func (*VSCodeConfirmBus) Reject ¶ added in v1.15.28
func (b *VSCodeConfirmBus) Reject(path string)