standaloneoperations

package
v0.45.0 Latest Latest
Warning

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

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

Documentation

Overview

Package standaloneoperations owns the public standalone lifecycle operation catalog shared by the StackKits CLI, MCP connector, and State Console.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfirmMutation

func ConfirmMutation(id ID, confirmation string, ownerApproved bool) error

ConfirmMutation enforces the exact operation confirmation and local Owner approval shared by every mutating MCP adapter.

func ValidateCatalog

func ValidateCatalog() error

ValidateCatalog checks the embedded authority without relying on callers.

Types

type Argument added in v0.45.0

type Argument struct {
	Name        string       `json:"name"`
	Kind        ArgumentKind `json:"kind"`
	Flag        string       `json:"flag,omitempty"`
	Required    bool         `json:"required,omitempty"`
	Enum        []string     `json:"enum,omitempty"`
	Description string       `json:"description"`
}

Argument maps one typed, secret-free input onto the exact CLI argument. An empty Flag makes it a positional argument, appended in declaration order. Arguments carry values, file paths or references by name; they never carry secret values, so a command that needs one stays an Exception.

type ArgumentKind added in v0.45.0

type ArgumentKind string

ArgumentKind is the JSON type of one typed operation input.

const (
	ArgumentString     ArgumentKind = "string"
	ArgumentBoolean    ArgumentKind = "boolean"
	ArgumentInteger    ArgumentKind = "integer"
	ArgumentStringList ArgumentKind = "string-list"
)

type Contract

type Contract struct {
	ID            ID         `json:"id"`
	ToolName      string     `json:"toolName"`
	Title         string     `json:"title"`
	Description   string     `json:"description"`
	Command       []string   `json:"command"`
	Mutation      bool       `json:"mutation"`
	Destructive   bool       `json:"destructive"`
	Idempotent    bool       `json:"idempotent"`
	OpenWorld     bool       `json:"openWorld"`
	OwnerApproval bool       `json:"ownerApproval"`
	Arguments     []Argument `json:"arguments,omitempty"`
}

Contract describes one operation without owning its lifecycle implementation. Command is the exact public CLI path that executes it. Destructive means the operation may replace, stop, revoke or delete existing state rather than only add to it. OpenWorld means it may reach systems beyond the local host.

func All

func All() []Contract

All returns fresh contracts in stable catalog order.

func Lookup

func Lookup(id ID) (Contract, bool)

Lookup resolves one stable operation identity.

func LookupTool

func LookupTool(name string) (Contract, bool)

LookupTool resolves one registered MCP tool name.

func (Contract) FixedFlags added in v0.45.0

func (operation Contract) FixedFlags() []string

FixedFlags returns the flags every invocation of the operation passes.

func (Contract) Path added in v0.45.0

func (operation Contract) Path() []string

Path returns the exact CLI command path, without the fixed flags.

type Exception added in v0.45.0

type Exception struct {
	Command []string `json:"command"`
	Reason  string   `json:"reason"`
	Scope   string   `json:"scope"`
	Removal string   `json:"removal"`
}

Exception records one public stackkit CLI command that is deliberately not an MCP tool, with the reason, scope and removal criterion that API-FIRST-STANDARD §1.2 requires. StackKits owns every entry. A command is excepted only when it is not a product capability of a rolled-out server, when MCP already reaches the same capability through a projected tool, or when it would force secret values through the MCP transcript.

func Exceptions added in v0.45.0

func Exceptions() []Exception

Exceptions returns fresh exception records in stable order.

func LookupException added in v0.45.0

func LookupException(path []string) (Exception, bool)

LookupException resolves the exception for one exact CLI command path.

type ID

type ID string

ID is the stable identity used for operation-specific confirmation.

const (
	Init                  ID = "stackkit.init"
	Validate              ID = "stackkit.validate"
	Resolve               ID = "stackkit.resolve"
	Generate              ID = "stackkit.generate"
	Plan                  ID = "stackkit.plan"
	Apply                 ID = "stackkit.apply"
	Verify                ID = "stackkit.verify"
	Status                ID = "stackkit.status"
	Setup                 ID = "stackkit.setup"
	Logs                  ID = "stackkit.logs"
	Backup                ID = "stackkit.backup"
	BackupStatus          ID = "stackkit.backup.status"
	BackupScheduleEnable  ID = "stackkit.backup.schedule.enable"
	BackupScheduleDisable ID = "stackkit.backup.schedule.disable"
	BackupScheduleStatus  ID = "stackkit.backup.schedule.status"
	Restore               ID = "stackkit.restore"
	RestoreAbandon        ID = "stackkit.restore.abandon"
	Upgrade               ID = "stackkit.upgrade"
	Drift                 ID = "stackkit.drift"
	Remove                ID = "stackkit.remove"
)

Jump to

Keyboard shortcuts

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