Documentation
¶
Index ¶
- type ApproverFunc
- type AuditEntry
- type Capability
- type Choice
- type CommandCategory
- type CommandRequest
- type Engine
- func (e *Engine) ApproveCommand(_ context.Context, req CommandRequest) error
- func (e *Engine) ApproveHook(ctx context.Context, req HookRequest) error
- func (e *Engine) ApproveTool(ctx context.Context, req agentcore.ToolApprovalRequest) (*agentcore.ToolApprovalResult, error)
- func (e *Engine) Mode() Mode
- func (e *Engine) PlanMode() bool
- func (e *Engine) ReplaceToolMetadata(tools []agentcore.Tool)
- func (e *Engine) SetApprover(fn ApproverFunc)
- func (e *Engine) SetFilesystemRoots(roots FilesystemRoots)
- func (e *Engine) SetMode(mode Mode)
- func (e *Engine) SetPlanMode(active bool)
- func (e *Engine) SetSkillAllows(rawTools []string)
- type FilesystemRoots
- type HookRequest
- type Mode
- type Prompt
- type Rule
- type RuleSet
- type Store
- type ToolMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditEntry ¶
type Capability ¶
type Capability string
const ( CapRead Capability = "read" CapWrite Capability = "write" CapExec Capability = "exec" CapHook Capability = "hook" CapNetwork Capability = "network" CapSubagent Capability = "subagent" CapInternal Capability = "internal" CapUnknown Capability = "unknown" )
type CommandCategory ¶
type CommandCategory string
const ( CommandCategoryInfo CommandCategory = "info" CommandCategoryPrompt CommandCategory = "prompt" CommandCategorySession CommandCategory = "session" CommandCategoryConfig CommandCategory = "config" CommandCategoryPlan CommandCategory = "plan" CommandCategoryExit CommandCategory = "exit" )
func NormalizeCommandCategory ¶
func NormalizeCommandCategory(raw string) CommandCategory
type CommandRequest ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) ApproveCommand ¶
func (e *Engine) ApproveCommand(_ context.Context, req CommandRequest) error
func (*Engine) ApproveHook ¶
func (e *Engine) ApproveHook(ctx context.Context, req HookRequest) error
func (*Engine) ApproveTool ¶
func (e *Engine) ApproveTool(ctx context.Context, req agentcore.ToolApprovalRequest) (*agentcore.ToolApprovalResult, error)
func (*Engine) ReplaceToolMetadata ¶
func (*Engine) SetApprover ¶
func (e *Engine) SetApprover(fn ApproverFunc)
func (*Engine) SetFilesystemRoots ¶
func (e *Engine) SetFilesystemRoots(roots FilesystemRoots)
func (*Engine) SetPlanMode ¶
func (*Engine) SetSkillAllows ¶
SetSkillAllows replaces the temporary allow rules from a skill's allowed-tools. Pass nil or empty to clear. Each entry is parsed as a permission rule (e.g. "Read", "Bash(npm test *)"). Invalid entries are silently ignored.
type FilesystemRoots ¶
type HookRequest ¶
type Rule ¶
type Rule struct {
Raw string // original string, e.g. "Bash(npm test *)"
Kind string // "Bash","Edit","Read","WebFetch","Subagent","tool"
Pattern string // content inside parentheses, or bare tool name pattern
}
Rule is a single permission rule parsed from settings.
type RuleSet ¶
RuleSet holds allow and deny rule lists.
func ParseRuleSet ¶
ParseRuleSet parses raw allow/deny string arrays into a RuleSet. Returns nil if both arrays are empty.
type ToolMetadata ¶
type ToolMetadata struct {
ToolName string
Capability Capability
SummaryHint string
Reason string
KeyPrefix string
}
Click to show internal directories.
Click to hide internal directories.