actions

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	Name() string
	Execute(ctx context.Context, session agents.AgentSessionContext, input Input) (any, error)
}

Action executes one superplane_app action value.

type AutoLayoutInput

type AutoLayoutInput struct {
	Scope   string   `json:"scope,omitempty"`
	NodeIDs []string `json:"node_ids,omitempty"`
}

AutoLayoutInput configures optional backend auto-layout for draft updates.

type Dependencies

type Dependencies struct {
	Encryptor      crypto.Encryptor
	Registry       *componentregistry.Registry
	GitProvider    gitprovider.Provider
	WebhookBaseURL string
	AuthService    authorization.Authorization
	UsageService   usage.Service
}

Dependencies are backend services shared by canvas actions.

type Input

type Input struct {
	Action              string           `json:"action"`
	CanvasID            string           `json:"canvas_id,omitempty"`
	VersionID           string           `json:"version_id,omitempty"`
	DraftVersionID      string           `json:"draft_version_id,omitempty"`
	DisplayName         string           `json:"display_name,omitempty"`
	UseDraft            *bool            `json:"use_draft,omitempty"`
	IncludeConsole      bool             `json:"include_console,omitempty"`
	IncludeIntegrations bool             `json:"include_integrations,omitempty"`
	CanvasYAML          string           `json:"canvas_yaml,omitempty"`
	ConsoleYAML         string           `json:"console_yaml,omitempty"`
	AutoLayout          *AutoLayoutInput `json:"auto_layout,omitempty"`
	Resource            string           `json:"resource,omitempty"`
	Namespace           string           `json:"namespace,omitempty"`
	NodeID              string           `json:"node_id,omitempty"`
	EventID             string           `json:"event_id,omitempty"`
	ExecutionID         string           `json:"execution_id,omitempty"`
	Limit               uint32           `json:"limit,omitempty"`
	Before              string           `json:"before,omitempty"`
	States              []string         `json:"states,omitempty"`
	Results             []string         `json:"results,omitempty"`
	Path                string           `json:"path,omitempty"`
	Paths               []string         `json:"paths,omitempty"`
	Content             string           `json:"content,omitempty"`
	Message             string           `json:"message,omitempty"`
	Query               string           `json:"query,omitempty"`
}

Input is the top-level JSON payload accepted by the superplane_app tool.

type Registry

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

Registry dispatches superplane_app action calls by action name.

func NewDefaultRegistry

func NewDefaultRegistry(deps Dependencies) *Registry

NewDefaultRegistry creates the standard superplane_app action registry.

func NewRegistry

func NewRegistry(actions ...Action) *Registry

NewRegistry creates a registry from explicit actions.

func (*Registry) Execute

func (r *Registry) Execute(ctx context.Context, session agents.AgentSessionContext, input Input) (any, error)

Execute dispatches the typed action input to the matching action.

func (*Registry) Names

func (r *Registry) Names() []string

Names returns the registered action names in schema enum order.

Jump to

Keyboard shortcuts

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