actionprotocol

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeAction = "ACTION"
	RiskLow    = "LOW"
	RiskMedium = "MEDIUM"
	RiskHigh   = "HIGH"
	Allow      = "ALLOW"
	AskUser    = "ASK_USER"
	Block      = "BLOCK"
)
View Source
const Protocol = "athena.agent.v2"

Variables

This section is empty.

Functions

func Marshal

func Marshal(action Action) (string, error)

func WithScope

func WithScope(ctx context.Context, taskID string) context.Context

Types

type Action

type Action struct {
	Protocol       string         `json:"protocol"`
	Type           string         `json:"type"`
	TaskID         string         `json:"task_id"`
	ActionID       string         `json:"action_id"`
	SessionID      string         `json:"session_id,omitempty"`
	Sequence       int64          `json:"sequence"`
	IdempotencyKey string         `json:"idempotency_key"`
	Deadline       time.Time      `json:"deadline"`
	Capability     string         `json:"capability"`
	Arguments      map[string]any `json:"arguments,omitempty"`
	Policy         Policy         `json:"policy"`
}

func New

func New(ctx context.Context, capability, sessionID string, arguments map[string]any, risk, decision string) Action

func Parse

func Parse(content string) (Action, bool)

func (Action) Validate

func (a Action) Validate() error

type Policy

type Policy struct {
	Risk     string `json:"risk"`
	Decision string `json:"decision"`
}

Jump to

Keyboard shortcuts

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