controlplane

package
v0.1.2 Latest Latest
Warning

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

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

View Source
const (
	CommandNewSession  = commandcatalog.CommandNewSession
	CommandSessions    = commandcatalog.CommandSessions
	CommandSession     = commandcatalog.CommandSession
	CommandProvider    = commandcatalog.CommandProvider
	CommandPermissions = commandcatalog.CommandPermissions
	CommandContext     = commandcatalog.CommandContext
	CommandModules     = commandcatalog.CommandModules
	CommandRemind      = commandcatalog.CommandRemind
	CommandTasks       = commandcatalog.CommandTasks
	CommandServer      = commandcatalog.CommandServer
	CommandStatus      = commandcatalog.CommandStatus
	CommandRestart     = commandcatalog.CommandRestart
	CommandHelp        = commandcatalog.CommandHelp
)

Variables

This section is empty.

Functions

func CommandName

func CommandName(command string) string

func ConfirmPresentationText

func ConfirmPresentationText(confirm ConfirmData) string

func FormPresentationText

func FormPresentationText(form FormData) string

func FormatServerStatus

func FormatServerStatus(status core.ServerStatus) string

func HelpText

func HelpText() string

func InfoPresentationText

func InfoPresentationText(info InfoData) string

func PickerCloseCommand

func PickerCloseCommand(picker PickerData) string

func PickerCommandFor

func PickerCommandFor(kind PickerKind, contextID string, itemID string) string

func PickerCommandLabel

func PickerCommandLabel(picker PickerData) string

func PickerItemCommand

func PickerItemCommand(picker PickerData, item PickerItem) string

func PickerItemDisplayInfo

func PickerItemDisplayInfo(kind PickerKind, item PickerItem) string

func PickerItemDisplayTitle

func PickerItemDisplayTitle(item PickerItem) string

func PickerLegend

func PickerLegend(picker PickerData) string

func PickerPresentationText

func PickerPresentationText(picker PickerData) string

func PickerPresentationTitle

func PickerPresentationTitle(picker PickerData) string

func PickerSelectedPage

func PickerSelectedPage(items []PickerItem, pageSize int) int

Types

type AutomationRuntime

type AutomationRuntime interface {
	ClientRuntime
	CreateAutomationJob(ctx context.Context, input automation.CreateJobInput) (automation.Job, error)
	ListAutomationJobs(ctx context.Context) ([]automation.Job, error)
	PauseAutomationJob(ctx context.Context, jobID string) (automation.Job, error)
	ResumeAutomationJob(ctx context.Context, jobID string) (automation.Job, error)
	CompleteAutomationJob(ctx context.Context, jobID string) (automation.Job, error)
	DeleteAutomationJob(ctx context.Context, jobID string) (automation.Job, error)
	RunAutomationJobNow(ctx context.Context, jobID string) (automation.Fire, error)
}

type ClientRuntime

type ClientRuntime interface {
	ClientName() string
}

type CommandID

type CommandID = commandcatalog.CommandID

type CommandSpec

type CommandSpec = commandcatalog.CommandSpec

func Catalog

func Catalog() []CommandSpec

func Parse

func Parse(text string) (CommandSpec, string, bool)

type CommandView

type CommandView struct {
	ID      string
	Command string
	Title   string
	Status  string
	Group   MenuItemGroup
	Public  bool
	Menu    bool
}

func BuildCommandView

func BuildCommandView(state MenuState) []CommandView

func PublicCommandView

func PublicCommandView() []CommandView

type ConfirmData

type ConfirmData struct {
	Title          string
	Message        string
	ConfirmLabel   string
	CancelLabel    string
	ConfirmCommand string
	CancelCommand  string
	ConfirmDanger  bool
}

type ContextRuntime

type ContextRuntime interface {
	SessionContext(ctx context.Context, sessionID string) (core.ContextReport, error)
	CompactSession(ctx context.Context, sessionID string) (core.CompactSessionResult, error)
}

type Dispatcher

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

func New

func New(runtime any, workingDir string) *Dispatcher

func (*Dispatcher) Handle

func (d *Dispatcher) Handle(ctx context.Context, externalKey string, text string) (Result, error)

type FormData

type FormData struct {
	Title         string
	Fields        []FormField
	SubmitLabel   string
	CancelLabel   string
	SubmitCommand string
	CancelCommand string
	Error         string
}

type FormField

type FormField struct {
	ID          string
	Label       string
	Value       string
	EditCommand string
}

type InfoData

type InfoData struct {
	Title        string
	Text         string
	Rows         []InfoRow
	CloseCommand string
}

type InfoRow

type InfoRow struct {
	Label string
	Value string
}

func FormatServerStatusRows

func FormatServerStatusRows(status core.ServerStatus) []InfoRow
type MenuItemGroup string
const (
	MenuItemGroupPrimary   MenuItemGroup = ""
	MenuItemGroupSecondary MenuItemGroup = "secondary"
)
type MenuState struct {
	SessionTitle   string
	ProviderID     string
	ModelID        string
	PermissionMode core.PermissionMode
}

type PermissionRuntime

type PermissionRuntime interface {
	UpdateSessionPermissionMode(ctx context.Context, sessionID string, mode core.PermissionMode) (core.Session, error)
}

type PickerBuilder

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

func NewPickerData

func NewPickerData(kind PickerKind, title string) *PickerBuilder

func (*PickerBuilder) Action

func (b *PickerBuilder) Action(id string, title string, info string, command ...string) *PickerBuilder

func (*PickerBuilder) Back

func (b *PickerBuilder) Back(command string) *PickerBuilder

func (*PickerBuilder) Build

func (b *PickerBuilder) Build() PickerData

func (*PickerBuilder) Close

func (b *PickerBuilder) Close(command string) *PickerBuilder

func (*PickerBuilder) CloseItem

func (b *PickerBuilder) CloseItem(label ...string) *PickerBuilder

func (*PickerBuilder) Context

func (b *PickerBuilder) Context(id string) *PickerBuilder

func (*PickerBuilder) Danger

func (b *PickerBuilder) Danger(id string, title string, info string, command ...string) *PickerBuilder

func (*PickerBuilder) HideBack

func (b *PickerBuilder) HideBack(hide bool) *PickerBuilder

func (*PickerBuilder) Item

func (b *PickerBuilder) Item(item PickerItem) *PickerBuilder

func (*PickerBuilder) Items

func (b *PickerBuilder) Items(items ...PickerItem) *PickerBuilder

func (*PickerBuilder) Ptr

func (b *PickerBuilder) Ptr() *PickerData

func (*PickerBuilder) Row

func (b *PickerBuilder) Row(id string, title string, info string, command ...string) *PickerBuilder

type PickerData

type PickerData struct {
	Kind         PickerKind
	ContextID    string
	Title        string
	BackCommand  string
	CloseCommand string
	HideBackItem bool
	Items        []PickerItem
}

type PickerItem

type PickerItem struct {
	ID       string
	Title    string
	Info     string
	Command  string
	Selected bool
	Focused  bool
	Role     PickerItemRole
}

func BackItem

func BackItem(label ...string) PickerItem

func CloseItem

func CloseItem(label ...string) PickerItem

func ProviderPickerItems

func ProviderPickerItems(items []setup.ProviderSetupItem, session *core.Session) []PickerItem

func (PickerItem) IsAction

func (item PickerItem) IsAction() bool

func (PickerItem) IsBack

func (item PickerItem) IsBack() bool

func (PickerItem) IsCancel

func (item PickerItem) IsCancel() bool

func (PickerItem) IsDanger

func (item PickerItem) IsDanger() bool

func (PickerItem) IsNavigation

func (item PickerItem) IsNavigation() bool

func (PickerItem) NeedsSeparator

func (item PickerItem) NeedsSeparator() bool

type PickerItemRole

type PickerItemRole string
const (
	PickerItemRoleNormal PickerItemRole = ""
	PickerItemRoleDanger PickerItemRole = "danger"
	PickerItemRoleBack   PickerItemRole = "back"
	PickerItemRoleCancel PickerItemRole = "cancel"
	PickerItemRoleAction PickerItemRole = "action"
)

type PickerKind

type PickerKind string
const (
	PickerSessions        PickerKind = "sessions"
	PickerSessionActions  PickerKind = "session_actions"
	PickerProvider        PickerKind = "provider"
	PickerProviderCustom  PickerKind = "provider_custom"
	PickerProviderActions PickerKind = "provider_actions"
	PickerPermissions     PickerKind = "permissions"
	PickerContext         PickerKind = "context"
	PickerModules         PickerKind = "modules"
	PickerStorage         PickerKind = "storage"
	PickerStorageFiles    PickerKind = "storage_files"
	PickerStorageFile     PickerKind = "storage_file"
	PickerStorageTemp     PickerKind = "storage_temp"
	PickerStorageCleanup  PickerKind = "storage_cleanup"
	PickerStorageTempFile PickerKind = "storage_temp_file"
	PickerTasks           PickerKind = "tasks"
	PickerTaskActions     PickerKind = "task_actions"
	PickerTaskArchive     PickerKind = "task_archive"
	PickerServer          PickerKind = "server"
)

type PickerPage

type PickerPage struct {
	Items    []PickerItem
	Trailing []PickerItem
	Page     int
	Pages    int
}

func PaginatePicker

func PaginatePicker(picker PickerData, page int, pageSize int) PickerPage

type PickerPresentationItem

type PickerPresentationItem struct {
	Item            PickerItem
	Command         string
	Title           string
	Info            string
	Status          string
	CompactLabel    string
	Selected        bool
	Navigation      bool
	SeparatorBefore bool
}

func PresentPickerItem

func PresentPickerItem(picker PickerData, item PickerItem) PickerPresentationItem

func PresentPickerItems

func PresentPickerItems(picker PickerData) []PickerPresentationItem

type PickerViewItem

type PickerViewItem struct {
	Item            PickerItem
	Command         string
	SeparatorBefore bool
}

func PickerViewItems

func PickerViewItems(picker PickerData) []PickerViewItem

type PromptData

type PromptData struct {
	Title               string
	Placeholder         string
	Value               string
	SubmitCommandPrefix string
	CancelCommand       string
	Sensitive           bool
}

type ProviderRuntime

type ProviderRuntime interface {
	ListSetupProviders(ctx context.Context) ([]setup.ProviderSetupItem, error)
	ConfigureSetupProvider(ctx context.Context, providerID string, update setup.ProviderSetupUpdate) (setup.ProviderSetupItem, error)
	ProviderModels(ctx context.Context, providerID string, update setup.ProviderSetupUpdate) ([]string, error)
	DeleteSetupProvider(ctx context.Context, providerID string) error
	UpdateSessionProvider(ctx context.Context, sessionID string, providerID string) (core.Session, error)
}

type Result

type Result struct {
	Handled        bool
	Text           string
	ReloadSnapshot bool
	Picker         *PickerData
	Form           *FormData
	Prompt         *PromptData
	Confirm        *ConfirmData
	Info           *InfoData
}

type ServerRuntime

type ServerRuntime interface {
	ServerStatus(ctx context.Context) (core.ServerStatus, error)
	RestartDaemon(ctx context.Context) error
}

type SessionMessageRuntime

type SessionMessageRuntime interface {
	CreateSystemMessage(ctx context.Context, sessionID string, content string) (core.Message, error)
}

type SessionRuntime

type SessionRuntime interface {
	CurrentBinding(ctx context.Context, externalKey string) (core.ClientBinding, error)
	ListSessions(ctx context.Context) ([]core.Session, error)
	CreateSession(ctx context.Context, externalKey string, title string, workingDir string) (core.Session, error)
	UseSession(ctx context.Context, externalKey string, sessionID string) (core.ClientBinding, error)
	RenameSession(ctx context.Context, sessionID string, title string) (core.Session, error)
	DeleteSession(ctx context.Context, sessionID string) error
}

type StorageRuntime

type StorageRuntime interface {
	SaveStorageFile(ctx context.Context, storagePath string, content []byte, title string, tags []string, mimeType string) (localstorage.Entry, error)
	ListTemporaryStorageFiles(ctx context.Context, limit int) (localstorage.TempListResult, error)
	PromoteTemporaryStorageFile(ctx context.Context, tempPath string, destPath string) (localstorage.Entry, error)
	DeleteTemporaryStorageFile(ctx context.Context, tempPath string) (localstorage.TempEntry, error)
	CleanupTemporaryStorageFiles(ctx context.Context) (localstorage.CleanupResult, error)
	UpdateTemporaryStorageSettings(ctx context.Context, autoCleanup *bool, ttlDays int64, maxGB float64) (localstorage.TempSettings, error)
	ListStorageFiles(ctx context.Context, filter localstorage.ListFilter) (localstorage.ListResult, error)
	ReadStorageFile(ctx context.Context, storagePath string) (localstorage.ReadResult, error)
	DeleteStorageFile(ctx context.Context, storagePath string) (localstorage.Entry, error)
}

Jump to

Keyboard shortcuts

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