Documentation
¶
Index ¶
- Constants
- Variables
- func Detect(ctx context.Context) (*agent.DetectionResult, error)
- func GetHookStatus(ctx context.Context) (*agent.HookStatus, error)
- func InstallHooks(ctx context.Context, opts agent.InstallOptions) (*agent.InstallResult, error)
- func Register(registry *agent.Registry, privacyChecker *events.PrivacyChecker, ...)
- func UninstallHooks(ctx context.Context, opts agent.UninstallOptions) (*agent.UninstallResult, error)
- func ValidateHooksContent(config *HooksConfig) []string
- type Adapter
- func (a *Adapter) Detect(ctx context.Context) (*agent.DetectionResult, error)
- func (a *Adapter) DisplayName() string
- func (a *Adapter) Install(ctx context.Context, opts agent.InstallOptions) (*agent.InstallResult, error)
- func (a *Adapter) Name() string
- func (a *Adapter) ParseEvent(ctx context.Context, hookType string, rawData []byte) (*events.Event, error)
- func (a *Adapter) Status(ctx context.Context) (*agent.HookStatus, error)
- func (a *Adapter) Uninstall(ctx context.Context, opts agent.UninstallOptions) (*agent.UninstallResult, error)
- type CodeToolInfo
- type CommandToolInfo
- type HookCommand
- type HookDecision
- type HookInput
- type HookResponse
- type HooksConfig
- type MCPToolInfo
- type PromptToolInfo
- type WorktreeToolInfo
Constants ¶
View Source
const ( AgentName = agent.AgentWindsurf DisplayName = agent.DisplayWindsurf )
Variables ¶
View Source
var HookTypeMapping = map[string]events.ActionType{ "pre_read_code": events.ActionFileRead, "post_read_code": events.ActionFileRead, "pre_write_code": events.ActionFileWrite, "post_write_code": events.ActionFileWrite, "pre_run_command": events.ActionCommandExec, "post_run_command": events.ActionCommandExec, "pre_mcp_tool_use": events.ActionToolUse, "post_mcp_tool_use": events.ActionToolUse, "pre_user_prompt": events.ActionToolUse, "post_cascade_response": events.ActionNotification, "post_setup_worktree": events.ActionToolUse, }
View Source
var HookTypes = []string{
"pre_read_code",
"post_read_code",
"pre_write_code",
"post_write_code",
"pre_run_command",
"post_run_command",
"pre_mcp_tool_use",
"post_mcp_tool_use",
"pre_user_prompt",
"post_cascade_response",
"post_setup_worktree",
}
Functions ¶
func GetHookStatus ¶
func GetHookStatus(ctx context.Context) (*agent.HookStatus, error)
func InstallHooks ¶
func InstallHooks(ctx context.Context, opts agent.InstallOptions) (*agent.InstallResult, error)
func Register ¶
func Register(registry *agent.Registry, privacyChecker *events.PrivacyChecker, loggingLevel config.LoggingLevel, contentHash bool)
func UninstallHooks ¶
func UninstallHooks(ctx context.Context, opts agent.UninstallOptions) (*agent.UninstallResult, error)
func ValidateHooksContent ¶
func ValidateHooksContent(config *HooksConfig) []string
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
func New ¶
func New(privacyChecker *events.PrivacyChecker, loggingLevel config.LoggingLevel, contentHash bool) *Adapter
func (*Adapter) DisplayName ¶
func (*Adapter) Install ¶
func (a *Adapter) Install(ctx context.Context, opts agent.InstallOptions) (*agent.InstallResult, error)
func (*Adapter) ParseEvent ¶
func (*Adapter) Uninstall ¶
func (a *Adapter) Uninstall(ctx context.Context, opts agent.UninstallOptions) (*agent.UninstallResult, error)
type CodeToolInfo ¶
type CommandToolInfo ¶
type HookCommand ¶
type HookCommand struct {
Command string `json:"command"`
}
type HookDecision ¶
type HookDecision int
const ( HookAllow HookDecision = iota HookBlock HookError )
type HookResponse ¶
type HookResponse struct {
Decision HookDecision
Message string
}
func NewAllowResponse ¶
func NewAllowResponse() *HookResponse
func NewBlockResponse ¶
func NewBlockResponse(message string) *HookResponse
func NewErrorResponse ¶
func NewErrorResponse(message string) *HookResponse
func (*HookResponse) ExitCode ¶
func (r *HookResponse) ExitCode() int
type HooksConfig ¶
type HooksConfig struct {
Hooks map[string][]HookCommand `json:"hooks"`
}
func GenerateHooksConfig ¶
func GenerateHooksConfig() *HooksConfig
type MCPToolInfo ¶
type PromptToolInfo ¶
type WorktreeToolInfo ¶
Click to show internal directories.
Click to hide internal directories.