ext

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 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

Overview

Extension interface and loader, one registration per extension point linked into the binary

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load() error

Attaches every registered extension once, in registration order, stopping at the first failure

func Register

func Register(e Extension)

Makes an extension part of the next Load, panicking on a nameless or duplicate one

Types

type Call

type Call struct {
	Ctx context.Context
	App *harness.App
	// Session on the stage, nil while none is
	Live *harness.Live
	Args string
	UI   UI
}

What a command runs with

type Command

type Command struct {
	// Keymap action id, such as review.start
	ID string
	// Palette title, the command staying out of the palette when empty
	Title string
	// Slash command name, none when empty
	Slash string
	// One line for the keybind editor and the slash list
	Desc string
	// Argument placeholder, the command asks for one when none came
	Arg string
	// Default chords
	Keys []string
	// Reports whether the command applies now, always when nil
	When func(c *Call) bool
	Run  func(c *Call) tea.Cmd
	// Extension the command came from
	Source string
}

Command an extension adds to the palette, the slash line and the keymap

func Commands

func Commands() []Command

Commands extensions added, in registration order

type Contribution

type Contribution struct {
	// Kind of point, such as kind, workflow, tool or panel
	Point  string
	Name   string
	Detail string
}

One thing an extension provided

type Extension

type Extension interface {
	Manifest() Manifest
	// Declares everything the extension provides, called once at start
	Attach(h *Host) error
}

Package linked into the binary that adds to icebath through a host

type Host

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

Host one extension declares into, recording the first failure

func (*Host) Action

func (h *Host) Action(a keys.Action)

Adds a key action in a context the extension added, fired at the focused card

func (*Host) Auth

func (h *Host) Auth(kind profiles.AuthKind, build profiles.AuthBuilder)

Adds an auth kind profiles may name

func (*Host) Catalog

func (h *Host) Catalog(models ...profiles.Model)

Adds models whose metadata wins over the built in catalog

func (*Host) Command

func (h *Host) Command(c Command)

Adds a command to the palette, the slash line and the keymap

func (*Host) Context

func (h *Host) Context(name, doc string)

Adds a keymap context the cards of the extension answer in

func (*Host) Hook

func (h *Host) Hook(build func(info harness.AgentInfo) agent.Hook)

Adds a hook built for every agent

func (*Host) Kind

func (h *Host) Kind(k harness.Kind)

Adds a kind sessions and child agents may run as

func (*Host) Panel

func (h *Host) Panel(p Panel)

Adds a panel openable by key, slash and palette

func (*Host) Profile

func (h *Host) Profile(p profiles.Profile)

Adds a built in endpoint profile

func (*Host) Prompt

func (h *Host) Prompt(fragment func(ctx context.Context, a *harness.App, ep harness.Endpoint) string)

Adds text to the system prompt of every run

func (*Host) Protocol

func (h *Host) Protocol(p protocol.Protocol)

Adds a wire protocol profiles may name

func (*Host) Setting

func (h *Host) Setting(s harness.Setting)

Adds a setting read through the configuration, shown in the app tab and taken by the -k flag

func (*Host) Theme

func (h *Host) Theme(fn func() theme.Theme)

Adds a theme choosable by name

func (*Host) Tools

func (h *Host) Tools(build func(a *harness.App) ([]tool.Tool, error))

Adds tools built once the app stands

func (*Host) Vendor

func (h *Host) Vendor(v profiles.Vendor)

Adds a vendor that lists the models of an endpoint family

func (*Host) Workflow

func (h *Host) Workflow(w harness.Workflow)

Adds a workflow, offered as the palette command and slash command of its name

type Loaded

type Loaded struct {
	Manifest
	Contributions []Contribution
}

Extension after loading with what it provided

func Extensions

func Extensions() []Loaded

Extensions loaded so far, sorted by name

type Manifest

type Manifest struct {
	Name        string
	Version     string
	Description string
}

Identity of an extension

type Panel

type Panel struct {
	// Card key, slash command name and the end of the open.<key> action
	Key    string
	Title  string
	Detail string
	// Default chords of the open action
	Keys []string
	New  func(env *cards.Env) wm.Card
	// Edits the configuration of the extension, so the extensions tab offers it as the settings of the extension
	Settings bool
	// Extension the panel came from
	Source string
}

Card an extension adds, shared by every workspace and opened by key, slash and palette

func Panels

func Panels() []Panel

Panels extensions added, in registration order

type UI

type UI interface {
	// Opens a card in the workspace on the stage, focusing it when already open
	Open(card wm.Card) tea.Cmd
	Toast(text string, level wm.Level) tea.Cmd
	// Asks for a line of text
	Prompt(placeholder, value string, submit func(text string) tea.Cmd) tea.Cmd
	// Offers a choice
	Pick(placeholder string, items []wm.Item) tea.Cmd
	// Sends input to the session, steering a run going on it and starting one otherwise
	Submit(live *harness.Live, parts []protocol.Part) tea.Cmd
	// Starts a registered workflow from the session on the stage
	Start(workflow, arg string) tea.Cmd
	// Live state cards read
	Env() *cards.Env
}

What a command may do to the interface

Directories

Path Synopsis
Sprint extension, a director, an architect, builders and a reviewer building one request as a team inside a voxel arena
Sprint extension, a director, an architect, builders and a reviewer building one request as a team inside a voxel arena

Jump to

Keyboard shortcuts

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