Documentation
¶
Overview ¶
Package source is where a source registers: its unit codec, its ingestion job, its rows and its workflow facts. Only the composition root and the sources import it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLI ¶
type CLI struct {
Name, Usage string
Run func(ctx context.Context, args []string, out, errw io.Writer) error
}
CLI is a plugin's own command, run as <command> <Name> ... when Name is not a core command.
type Deps ¶
type Deps struct {
DB *sqlite.DB
Inventory *inventory.Store
GitHub *github.Client
WS *workspace.Set
// Sink is the view sink whose columns WS reports as workspace statuses.
Sink string
Turns *turns.Service
Briefs *brief.Queue
Changes *change.Log
Clock port.Clock
Log func(format string, args ...any)
// Git reads the local checkouts; Agents are the agents by name and
// Intents the loaded intents' registry, nil before a profile loads.
Git gitx.Git
Agents map[string]turns.Agent
Intents func() *dintent.Registry
// Units is the daemon's registry, built after the modules; Links the link store.
Units func() *unit.Registry
Links port.LinkStore
}
Deps are the shared handles a source builds from. Briefs is nil when the brief is off, WS when no workspace manager is configured.
type Module ¶
type Module struct {
ID unit.ProviderID
Codec unit.Codec
Ingest ingest.Job
// Rows builds the source's read model provider with the daemon's row deps.
Rows func(d readmodel.RowDeps) readmodel.Provider
// Facts are the source's workflow facts; nil until the source offers any.
Facts automation.Units
// Track reads a unit about to be tracked, wrapping a failed read in
// port.ErrNotFound or port.ErrGitHub when it can tell which; nil tracks
// the source's units unread.
Track func(ctx context.Context, u unit.Unit) (port.TrackRead, error)
// Untrack stops following a unit Track followed; set, the source keeps
// its own follows and the daemon sends it every track and untrack of
// its units.
Untrack func(ctx context.Context, u unit.Unit) error
// Slow is the source's slow job, which rebuilds what the ingestion job
// keeps cheap; nil is none.
Slow func(ctx context.Context) (summary, skipped string, err error)
// Items are the derived items of a row: deterministic, stable ids, no I/O; the viewer comes from the row's payload.
Items func(row api.Row) []items.Item
// Card is required when Items is set or the plugin's units carry items.
Card func(ctx context.Context, row api.Row) (card.Card, error)
// Identity is the user as this plugin knows them.
Identity func(ctx context.Context) (items.Person, error)
UnitEvents links.EventReader
UI *api.PluginUI
// WebAssets are served under /plugins/<id>/.
WebAssets fs.FS
CLI *CLI
// Run is a long-running stream; the daemon runs it for an enabled plugin until ctx ends, restarting after 30 s on error.
Run func(ctx context.Context) error
Health func(ctx context.Context) (api.SourceHealth, error)
// Jobs are extra daemon jobs of the plugin.
Jobs []Job
Publisher port.Effects
// Proposals is called by the proposals job; a provider with Proposals gets no generic stalled nudge.
Proposals func(ctx context.Context, now time.Time) ([]outbox.Proposal, error)
Payload turn.PayloadReader
PlacementDefaults placement.Defaults
PlacementHints placement.Hints
}
Module is one source as the daemon runs it.