action

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 4 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

Overview

Package action is the autonomy gate: what the agent may do on its own. Anything that only involves the owner is Auto unless its class is forbidden: the owner can't need to approve what is for them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByChat

func ByChat(c Class) bool

ByChat reports whether the owner may change class by telling the agent.

func Defaults

func Defaults() map[Class]Verdict

func Validate

func Validate(classes map[Class]Verdict) error

Validate checks a policy read from config. read_web and use_tools can't be Ask because they happen in the middle of an activity and can't wait for an answer.

Types

type Class

type Class string
const (
	Remember        Class = "remember"
	Reply           Class = "reply"
	ReadWeb         Class = "read_web"
	UseTools        Class = "use_tools" // tools from the MCP servers it's given (config tools)
	Write           Class = "write"     // a tool that changes the owner's own things: files, docs, a calendar
	ReachOut        Class = "reach_out" // message someone first: reminders, check-ins, deliveries
	Commit          Class = "commit"
	Publish         Class = "publish"
	Dream           Class = "dream"
	Spend           Class = "spend"            // spend money (later)
	ExternalMessage Class = "external_message" // email, a post or a DM outside the chat, through a tool
)

type Policy

type Policy struct {
	Owner      string
	Classes    map[Class]Verdict // a class not listed is Ask
	AskExpires time.Duration     // an unanswered request is denied after this
}

func (Policy) Check

func (p Policy) Check(class Class, person string) Verdict

Check is what the gate does with an action of class that concerns person ("" if it concerns no one, like publishing). A zero Policy allows everything.

func (Policy) With

func (p Policy) With(changes map[Class]Verdict) Policy

func (Policy) WithChatRules

func (p Policy) WithChatRules(rules map[string]string) Policy

WithChatRules is p with the owner's changes made by chat (class → verdict) applied, skipping any that can't be made by chat or aren't valid.

type Verdict

type Verdict string
const (
	Auto   Verdict = "auto"
	Ask    Verdict = "ask"
	Forbid Verdict = "forbid"
)

Jump to

Keyboard shortcuts

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