Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithHookApproval ¶
WithHookApproval returns a context that marks the given tool call ID as pre-approved by a hook. When the permission service sees a matching request it short-circuits the normal prompt and grants immediately.
Types ¶
type CreatePermissionRequest ¶
type PermissionKey ¶
PermissionKey is a composite key for session permission lookups.
type PermissionNotification ¶
type PermissionRequest ¶
type Service ¶
type Service interface {
pubsub.Subscriber[PermissionRequest]
// GrantPersistent grants a permission request and remembers the grant
// for the session. It returns true if this call actually resolved the
// pending request; false if the request had already been resolved
// (e.g., by another concurrent caller) or is unknown.
GrantPersistent(permission PermissionRequest) bool
// Grant grants a permission request. It returns true if this call
// actually resolved the pending request; false if the request had
// already been resolved or is unknown.
Grant(permission PermissionRequest) bool
// Deny denies a permission request. It returns true if this call
// actually resolved the pending request; false if the request had
// already been resolved or is unknown.
Deny(permission PermissionRequest) bool
Request(ctx context.Context, opts CreatePermissionRequest) (bool, error)
AutoApproveSession(sessionID string)
SetSkipRequests(skip bool)
SkipRequests() bool
SubscribeNotifications(ctx context.Context) <-chan pubsub.Event[PermissionNotification]
}
Click to show internal directories.
Click to hide internal directories.