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)
- 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 HookDecision
- type HookInput
- type HookResponse
- type SessionInput
- type ToolCallInput
- type ToolResultContent
- type ToolResultInput
Constants ¶
View Source
const ( AgentName = agent.AgentPiAgent DisplayName = agent.DisplayPiAgent )
Variables ¶
View Source
var HookTypes = []string{
"tool_call",
"tool_result",
"session_start",
"session_shutdown",
}
View Source
var ToolNameMapping = map[string]events.ActionType{ "read": events.ActionFileRead, "write": events.ActionFileWrite, "edit": events.ActionFileWrite, "bash": events.ActionCommandExec, "grep": events.ActionFileRead, "find": events.ActionFileRead, "ls": events.ActionFileRead, }
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)
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 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
func (*HookResponse) JSON ¶
func (r *HookResponse) JSON() []byte
func (*HookResponse) Stderr ¶
func (r *HookResponse) Stderr() string
type SessionInput ¶
type SessionInput struct {
HookInput
}
type ToolCallInput ¶
type ToolResultContent ¶ added in v0.3.7
type ToolResultInput ¶
Click to show internal directories.
Click to hide internal directories.