tools

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 32 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAccessRevoked = errors.New("access revoked")
	ErrDeclined      = errors.New("the owner did not approve")
)

Functions

This section is empty.

Types

type Class

type Class int
const (
	Read Class = iota
	Write
	MarkRead
)

type Clients

type Clients interface {
	Client(accountID int64) (whatsapp.Client, bool)
}

type Deps

type Deps struct {
	Store       *store.Store
	Clients     Clients
	Outbox      *media.Outbox
	Clock       clock.Clock
	Log         *slog.Logger
	SigningKey  []byte
	ApprovalTTL time.Duration
	Media       MediaDeps
}

type MediaDeps

type MediaDeps struct {
	Downloads *media.Downloader
	Files     *media.Files
	Links     *media.Links
}

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func NewRegistry

func NewRegistry(deps Deps) *Registry

func (*Registry) AccountGuard

func (r *Registry) AccountGuard(next mcp.MethodHandler) mcp.MethodHandler

func (*Registry) Install

func (r *Registry) Install(srv *mcp.Server, scope Scope)

func (*Registry) LoadScope

func (r *Registry) LoadScope(ctx context.Context, grantID int64) (Scope, error)

type Scope

type Scope struct {
	Grant    store.Grant
	Accounts []store.Account
}

func (Scope) AccountNames

func (s Scope) AccountNames() []string

type Tool

type Tool struct {
	Name         string
	Class        Class
	NeedsAccount bool
	Install      func(srv *mcp.Server, scope Scope)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL