Documentation
¶
Overview ¶
Package flows provides the unified flow type system stolen from OpenClaw's src/flows/. Every interactive surface in Overkill — provider setup, channel picker, model selection, health checks, search config — produces a FlowContribution. A single WizardPrompter handles all of them.
Storage: Postgres (not SQLite — "Postgres is just the goat").
Index ¶
- type FlowContribution
- type FlowKind
- type FlowOption
- type FlowRecord
- type FlowSource
- type FlowSurface
- type OptionDocs
- type OptionGroup
- type Store
- func (s *Store) EnsureSchema(ctx context.Context) error
- func (s *Store) ListAll(ctx context.Context) ([]FlowContribution, error)
- func (s *Store) ListContributions(ctx context.Context, kind FlowKind, surface FlowSurface) ([]FlowContribution, error)
- func (s *Store) Migrate(ctx context.Context) error
- func (s *Store) RegisterChannel(ctx context.Context, c FlowContribution) error
- func (s *Store) RegisterProvider(ctx context.Context, c FlowContribution) error
- func (s *Store) Remove(ctx context.Context, id string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FlowContribution ¶
type FlowContribution struct {
ID string `json:"id"` // e.g. "provider:setup:deepseek"
Kind FlowKind `json:"kind"` // "channel" | "core" | "provider" | "search"
Surface FlowSurface `json:"surface"` // "auth-choice" | "health" | "model-picker" | "setup"
Option FlowOption `json:"option"` // The selectable UI item
Source FlowSource `json:"source,omitempty"` // Where this came from
PluginID string `json:"pluginId,omitempty"` // If registered by a plugin
}
FlowContribution is the universal shape for every interactive flow surface. Every setup wizard, model picker, health check, and channel config produces a slice of these. One WizardPrompter.Select() handles all of them.
type FlowOption ¶
type FlowOption struct {
Value string `json:"value"` // Stable key for selection
Label string `json:"label"` // Display label
Hint string `json:"hint,omitempty"` // Extra description
Group *OptionGroup `json:"group,omitempty"`
Docs *OptionDocs `json:"docs,omitempty"`
}
FlowOption is the item a user selects in a flow wizard. Value is the stable key; Label is the display text. Group and Docs provide optional visual grouping and documentation links.
type FlowRecord ¶
type FlowRecord struct {
ID string `json:"id"`
Kind string `json:"kind"`
Surface string `json:"surface"`
Value string `json:"value"`
Label string `json:"label"`
Hint string `json:"hint,omitempty"`
GroupID string `json:"groupId,omitempty"`
GroupLabel string `json:"groupLabel,omitempty"`
Source string `json:"source"`
PluginID string `json:"pluginId,omitempty"`
CreatedAt time.Time `json:"createdAt"`
}
FlowRecord is the persisted row in the flow_contributions table. It mirrors FlowContribution with database-level fields.
func FromContribution ¶
func FromContribution(c FlowContribution) FlowRecord
FromContribution converts an in-memory contribution to a database record.
func (*FlowRecord) ToContribution ¶
func (r *FlowRecord) ToContribution() FlowContribution
ToContribution converts a database record to the in-memory type.
type FlowSource ¶
type FlowSource string
FlowSource records where a contribution came from. Manifest entries are static declarations in plugin manifests. Install-catalog entries are packages available for download. Runtime entries come from live plugins. Core entries ship with Overkill itself.
const ( SourceManifest FlowSource = "manifest" SourceInstallCatalog FlowSource = "install-catalog" SourceRuntime FlowSource = "runtime" SourceCore FlowSource = "core" SourcePlugin FlowSource = "plugin" )
type FlowSurface ¶
type FlowSurface string
FlowSurface identifies which UI surface the contribution belongs to.
const ( SurfaceAuthChoice FlowSurface = "auth-choice" SurfaceHealth FlowSurface = "health" SurfaceModelPicker FlowSurface = "model-picker" SurfaceSetup FlowSurface = "setup" )
type OptionDocs ¶
OptionDocs links to relevant documentation for this option.
type OptionGroup ¶
type OptionGroup struct {
ID string `json:"id"`
Label string `json:"label"`
Hint string `json:"hint,omitempty"`
}
OptionGroup visually groups options in the picker UI.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the Postgres-backed flow contribution registry. Provider flows are dynamic — plugins register themselves at runtime. Channel setup flows are hybrid — bundled channels ship with core, installable channels come from a catalog.
func (*Store) EnsureSchema ¶
EnsureSchema is a convenience that calls Migrate. Exists so the DB migration runner has a single entry point for all flow-related tables.
func (*Store) ListAll ¶
func (s *Store) ListAll(ctx context.Context) ([]FlowContribution, error)
ListAll returns every flow contribution, newest first.
func (*Store) ListContributions ¶
func (s *Store) ListContributions(ctx context.Context, kind FlowKind, surface FlowSurface) ([]FlowContribution, error)
ListContributions returns all contributions for a given kind and surface.
func (*Store) RegisterChannel ¶
func (s *Store) RegisterChannel(ctx context.Context, c FlowContribution) error
RegisterChannel upserts a channel flow contribution.
func (*Store) RegisterProvider ¶
func (s *Store) RegisterProvider(ctx context.Context, c FlowContribution) error
RegisterProvider upserts a provider flow contribution. Plugins call this at init time to make themselves available in setup wizards.