runner

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 40 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 (
	// A time of day, HH:MM on a 24 hour clock
	SlotTime = "time"
	// One of the options
	SlotChoice = "enum"
	// Free text
	SlotText = "text"
	// Days of the week: everyday, weekdays, weekends or one day
	SlotDays = "weekdays"
)

Kinds of slot of a blueprint

View Source
const (
	Local      = "local"
	FromOrigin = "origin"
)

Words of an address that name no target: save only, and wherever the run was asked for

View Source
const (
	KindRun      = "run"
	KindDelivery = "delivery"
)

Kinds of attempt the ledger keeps

View Source
const (
	AttemptClaimed     = "claimed"
	AttemptRunning     = "running"
	AttemptCompleted   = "completed"
	AttemptFailed      = "failed"
	AttemptCancelled   = "cancelled"
	AttemptInterrupted = "interrupted"
	AttemptUnknown     = "unknown"
	AttemptMissed      = "missed"
)

How an attempt stands in the ledger: taken and not started, going on, or how it ended. A try of a delivery is claimed while it is sent, then completed when it went, failed when it did not, unknown when icebath ended while it was sent

View Source
const (
	DeliveryWaiting   = "waiting"
	DeliverySending   = "sending"
	DeliveryDelivered = "delivered"
	DeliveryFailed    = "failed"
	DeliveryUnknown   = "unknown"
)

How a result stands at a place, as the queue keeps it: waiting for its next try, being sent, delivered, given up, or of unknown arrival as icebath ended while it was sent

View Source
const (
	TakeResume = "resume"
	TakeRerun  = "rerun"
	TakeFail   = "fail"
)

What becomes of a run an icebath left cut off, as the feature that started it asks: it goes on in its session from where it was, it runs again from the start, which its kind makes safe to do twice, such as a scheduled job by its misfire rule, or it is told as cut off

View Source
const (
	Waiting     = "waiting"
	Running     = "running"
	Left        = "left"
	Done        = "done"
	Failed      = "failed"
	Stopped     = "stopped"
	Interrupted = "interrupted"
)

States of a run: a left one was left going by an icebath that ended, and waits for the keeper to take it up again or tell it as cut off; an interrupted one was cut off as the icebath running it ended before it did, and was not taken up again, its halt HaltAsked when a stop was asked of it that nobody saw it end on

View Source
const (
	// A person or a feature stopped it, through Cancel or CancelOf, here or from another icebath; on an interrupted run, asked it to stop
	// before its icebath ended with it not ended
	HaltAsked = "asked"
	// It went past its own limit
	HaltLimit = "limit"
	// It made no progress for the idle limit
	HaltIdle = "idle"
	// icebath stopped
	HaltShutdown = "shutdown"
	// The profile's folder moved or went
	HaltProfile = "profile"
	// Its session was deleted
	HaltSession = "session"
	// The icebath running it ended without a stop, which the next icebath of the folder found
	HaltCut = "cut"
)

Why the host stopped a run

View Source
const (
	// Wanted up from now on and started at once, whatever kept it down
	VerbUp = "up"
	// Taken down, which every icebath of this computer keeps until a person brings it up
	VerbDown = "down"
	// Started for one run, or let run on, and not started again once that run ends
	VerbOnce = "once"
	// Stopped and started again at once, wanted up from then on
	VerbRestart = "restart"
)

What a person asks of a service

View Source
const (
	// A run of it goes on and was not asked to stop
	UntilUp = "up"
	// It is up and does what it is for
	UntilReady = "ready"
	// Its run ended, and no run of it goes on
	UntilDown = "down"
)

What a wait for services waits for

View Source
const (
	// A person or icebath asked it to stop
	EndStopped = "stopped"
	// It returned before it was asked to stop
	EndReturned = "returned"
	// It returned an error
	EndFailed = "failed"
	// It failed with a fault, a panic of the code
	EndPanicked = "panicked"
	// It said it must stay down until a person brings it up
	EndDown = "down"
)

How a run of a service ended

View Source
const HaltPaused = "paused"

Why a stop of icebath stopped a run going on, which features that start runs read as work cut off that waits its turn again

View Source
const Silent = "[SILENT]"

Answer of a run with nothing new, which delivers nothing

Variables

View Source
var (
	ErrBusy     = errors.New("The session is busy with a reply.")
	ErrUnknown  = connect.NewError(connect.CodeNotFound, "That run is not going on. Open the list of runs again to see what runs now.")
	ErrStopping = errors.New("icebath is stopping, so the run did not start.")
)
View Source
var (
	ErrNoDriver = errors.New("Nothing runs sessions here, so the run did not start.")
	ErrNoJobs   = errors.New("Nothing schedules jobs here, so there is no job to run.")
	ErrNoJudge  = errors.New("Nothing judges stop conditions here.")
)
View Source
var ErrLeft = errors.New("icebath stopped while the run went on, so the next icebath of this computer takes it up.")

Why a run waited for did not end: icebath stopped while it went on and left it for the next icebath to take up

View Source
var ErrNoRoutes = errors.New("Nothing here takes events services post, so nothing can subscribe to them. Turn on the webhooks plugin.")

Nothing keeps routes services post events to, so a feature that has a service send it events can't subscribe

View Source
var ErrShutdown = errors.New("icebath stopped.")

Why icebath ended the context of a service as it stops, as context.Cause tells it the Starter, which a stop of a person's tells apart

What a wait may wait for, in the order the words are offered

What a person may ask of a service, in the order the words are offered

Functions

func Down

func Down(err error) error

The failure as one after which the Starter that returns it stays down until a person brings it up

func Every

func Every(ctx context.Context, period func() time.Duration, work func(ctx context.Context) error) error

Does the work every period until the context ends, in the goroutine that calls it, as a Starter does work of its own: the period is read again before each wait so a change of a setting takes hold, never less than a second, and one run of the work goes at a time, the next wait starting once it returned. nil once the context ended; an error of the work ends it with that error, which has the Starter that returns it started again after a wait

func Interval

func Interval(text string) (time.Duration, bool)

Length of time a person types for how often or how soon a run goes: a length such as 30s, 5m, 2h or 1h30m, a number and a unit such as 1d, 2 hours or 1.5 days, or a unit alone for one of it, such as hour; false for any other text, a bare number or a length of zero or less

func IsSilent

func IsSilent(answer string) bool

Whether the answer says there is nothing new, the word alone or marked up as bold or code

func Later

func Later(err error, wait time.Duration) error

The failure as one the place asks to be tried again after the wait, which the ladder takes in place of its own, up to fifteen minutes

func Permanent

func Permanent(err error) error

The failure as one no try again mends

func Problem

func Problem(address, why string) string

What went wrong delivering to the address, as a sentence a person reads

func Scripts

func Scripts(cfg *config.Config) string

Folder of the profile the scripts of automations are kept in, scheduled jobs' and webhooks', which no such script reaches outside of

func Split

func Split(addresses string) []string

Addresses of a comma list, trimmed, empty ones left out

Types

type Approval

type Approval struct {
	ID string
	// What would run or change, what it was flagged as, and the heading of a prompt that is no approval of a command
	Command, Reason, Title string
	// Answers it takes, each with the words shown for it, deny last
	Choices []Choice
	// When it stops waiting and counts as denied
	Deadline time.Time
}

A risky command or action waiting for a person's answer

type Attempt

type Attempt struct {
	ID, Kind string
	// Run it is of, empty for a delivery of no run; what started that and what of it, and what a person calls it
	Run, Source, Origin, Title string
	// Its number among the attempts of its run, or among the tries of its delivery, from 1
	Number int
	// Runner and process that made it
	Owner string
	PID   int
	// One of the Attempt statuses
	Status string
	// Occurrence of a schedule it is of, zero for none
	Scheduled time.Time
	// When it was taken, started, ended and last showed it moves
	Claimed, Started, Finished, Progress time.Time
	// Why it failed, why the host stopped it, the kind of the provider's failure that ended it
	Error, Halt, Cause string
	// Code the program a run was exited with, Exited false for a run the agent answered
	Exit   int
	Exited bool
	// Tokens the model read and wrote for it, and what that cost
	Input, Output int64
	Cost          float64
	// Session it ran in, empty for one of none
	Session string
	// Place a try of a delivery was sent to, and the result of the queue it is a try of; how it came out: delivered, waiting, given up or
	// unknown, and for a run how its results came out
	Address, Delivery, Outcome string
}

One attempt of a run or one try of a delivery, as the ledger keeps it

type Blueprint

type Blueprint struct {
	Key, Title, Description string
	// Heading the blueprint is listed under, such as daily or weekly
	Category string
	// Schedule and prompt of the job, with the slots in braces
	Schedule, Prompt string
	Slots            []Slot
	// Where the job delivers when the person picks nothing else, and the skills it loads
	Deliver string
	Skills  []string
	// Plugin that offers it, empty for icebath's own
	Plugin string
}

Automation a person fills in and schedules: a job's schedule and prompt with slots in braces, such as {time} or {topic}, that the person gives values for

type Blueprinter

type Blueprinter interface {
	Blueprints(cfg *config.Config) []Blueprint
}

Registrant that offers blueprints of automations a person fills in and schedules, the scheduler's own and those of plugins

type Choice

type Choice struct {
	Value, Label string
}

One answer of an approval prompt

type Claim

type Claim struct {
	Job Job
	// Occurrence of the schedule it fires, zero for one fired by hand
	At time.Time
	// What holds it, unique to the process and the claim
	By string
}

A fire of a job a clock claimed

type Clock

type Clock struct {
	// As the scheduler's setting names it, lower case
	Name, Title, About string
	// It is the scheduler's own clock in this process, which its tick runs: Run is nil, and no catching up follows it
	Inside bool
	// Why it can't decide for the profile of the settings now, a sentence a person reads; empty when it can. Read quickly, waiting on nothing
	Lacks func(cfg *config.Config) string
	// Decides for the profile of the settings until ctx ends, firing its jobs through fires as they come due by its reckoning. Returning is
	// it failing, after which the scheduler's own clock decides for the profile until this one is started again
	Run func(ctx context.Context, cfg *config.Config, fires Fires) error
	// Told the jobs of the profile changed, one made, changed, paused or removed, for a clock that keeps them elsewhere; nil for one that
	// keeps nothing of them
	Changed func(ctx context.Context, cfg *config.Config, jobs []Job) error
	// Told a job is about to be saved, for a clock that keeps a trigger of its own for each job: an error refuses the save in its words; nil
	// for one that keeps none
	Register func(ctx context.Context, cfg *config.Config, job Job) error
	// Closes what fires of a process that ended left half done, answering how many it closed; nil for one that keeps none
	Recover func(ctx context.Context, cfg *config.Config) (int, error)
}

What decides when the jobs of a profile fire: the clock of the scheduler of jobs in this process, or a scheduler outside icebath a plugin brings, such as a service of triggers an extension speaks to. The scheduler's setting picks one for each profile

type Clocker

type Clocker interface {
	Clocks(cfg *config.Config) []Clock
}

Registrant that brings clocks that decide when jobs fire, the scheduler's own and those of plugins, such as the schedulers of the extensions of a profile

type Cut

type Cut struct {
	// The run as its live record kept it, in the state it was cut off in
	Record Record
	// What was asked of it, without what a feature keeps in memory alone, Watch, Scope and Prepare, which the feature hands again
	Request Request
	// When it last showed it moved, from which how long ago it was cut off is read
	Since time.Time
	// icebath is stopping while the run goes on: the answer only says whether the run would be taken up at the next start, and nothing is
	// started or told now
	Stopping bool
}

A run an icebath that ended without seeing it through left unfinished, as the next icebath of the folder finds it

func (Cut) Again

func (c Cut) Again() Request

The request that runs it again from the start, as it was asked

func (Cut) Resumed

func (c Cut) Resumed() Request

The request that takes the run up where it was: in the session it ran in, told it was cut off and to finish; the request as it was asked when no session was made for it yet

type Deliverer

type Deliverer interface {
	// Targets of the profile of the settings, such as those the extensions it installed bring besides the ones every profile has
	Targets(cfg *config.Config) []Target
}

Registrant whose targets results are delivered to, such as a session's transcript or a file

type Delivery

type Delivery struct {
	// Id of the result at the place it goes to, the same for every try of it, which a keyed place refuses a second time
	ID string `json:"id,omitempty"`
	// What the result is of, such as the name of a job
	Title string `json:"title,omitempty"`
	Text  string `json:"text"`
	// Source and origin of the run that made it
	Source string `json:"source,omitempty"`
	Origin string `json:"origin,omitempty"`
	// Session the run ran in, empty for a result no session made
	Session string `json:"session,omitempty"`
	// The text tells why the run failed
	Failure bool `json:"failure,omitempty"`
	// The text goes as it is, with no heading naming what it is of; a failure keeps its heading
	Bare bool `json:"bare,omitempty"`
}

What is delivered

func (Delivery) Heading

func (d Delivery) Heading() string

Heading of a delivery as a person reads it: what it is of, and that it did not finish when it failed; empty for a bare result

type Driver

type Driver interface {
	// Sends the run's text into its session, one made for it when it names none, and waits for the reply to end
	Drive(ctx context.Context, run *Run) (Reply, error)
	// Adds the text to the session's transcript as a message of the agent with no reply to it, once the reply running is over, so the
	// person reads it when the session is shown and the agent sees it in its next reply
	Note(ctx context.Context, session, text string) error
	// Whether the session has no reply running and no message waiting for one
	Idle(session string) bool
}

What drives sessions, the agent. A registrant that drives them says so by having this too

type End

type End struct {
	At time.Time `json:"at"`
	// How long it ran
	Ran time.Duration `json:"ran"`
	// One of the End kinds
	Kind string `json:"kind"`
	// Why it ended, a sentence
	Cause string `json:"cause"`
}

How a run of a service ended

func (End) Died

func (e End) Died() bool

The run died: it ended without being asked to, and was not one that must stay down

type Fires

type Fires interface {
	// Jobs of the profile, with when each runs next
	Due(ctx context.Context) ([]Job, error)
	// Claims a fire of the job of the id: the occurrence due now, any time when manual, and one of a paused job too when forced, which
	// resumes it; a fire a minute or more before its time fires off its time. Nil with no error when another claim holds it, its occurrence
	// fired already, the job is done or it is not due
	Claim(ctx context.Context, job string, force, manual bool) (*Claim, error)
	// Runs a claimed fire through the scheduler's run and delivery, in the background; its claim lets go once the run ended
	Fire(ctx context.Context, claim *Claim) error
}

What a clock fires the jobs of a profile through, the scheduler of jobs: each fire claimed once among every icebath of the settings folder, so no two run one occurrence of a job

type Follower

type Follower interface {
	// The run as recorded once it ended
	Ended(record Record)
	// A place a result of a run of the source was delivered to or given up on, as its sending stands then
	Delivered(source string, sending Sending)
}

Registrant that follows the runs of this icebath as they end and their results as each place is delivered to or given up on, such as monitoring. Told from what ended the run or tried the place, outside the host's lock, so each returns at once

type Job

type Job struct {
	ID, Name, Schedule string
	// Skills each run of the job loads, by the names the job gives them, which the curator never archives or merges
	Skills []string
	// How its schedule is written: cron, interval or once, with the expression, the length between runs or the time of its one run
	Kind, Expr string
	// Zone its schedule is read in, the profile's when empty
	Zone string
	// When it runs next, zero for none; whether it runs at all, false for one paused or done
	Next time.Time
	On   bool
}

One job of the scheduler as other features see it

type Judge

type Judge interface {
	// What the judge decided of the session's reply against the condition, on the session's settings and model
	Judge(ctx context.Context, cfg *config.Config, session, condition, reply string) (Verdict, error)
}

Registrant that decides whether a reply meets a stop condition, the goal judge, which a loop asks whether it is done

type Load

type Load struct {
	Runs     []Record
	Busy     map[string]int
	Retrying map[string]int
}

What this icebath has going on now: its runs, and by profile the work in the background and the results waiting to be delivered of the profiles whose schedules it runs, as its keeper last counted them in their queues

type Origin

type Origin struct {
	Session string `json:"session,omitempty"`
}

Where a run was asked for, so its result can go back there: the session it was made in

type Owner

type Owner interface {
	// Whether the registrant drives the session now
	Owns(ctx context.Context, session string) bool
}

Registrant that drives a session on its own for a while, such as a standing goal working toward its end, which a loop's wakeup waits for

type Process

type Process struct {
	// Program and its arguments
	Argv []string
	// What a person calls it in a failure, such as the script's name; the program's name when empty
	Name string
	// Folder it runs in, the profile's own when empty
	Dir string
	// Variables it gets over the profile's environment as its commands get it
	Env map[string]string
	// What it reads on its input
	Input []byte
	// Longest it may run
	Limit time.Duration
	// What the list of processes of icebath calls it
	Purpose string
}

One run of a program of this computer for an automation, such as a job's script or the gh of a delivery

type Progress

type Progress struct {
	// Call of the tool, the tool by its name, and what it does now
	Call, Tool, Message string
	// How much of its work is done, and of how much when the tool knows
	Done  float64
	Total *float64
}

How far a tool got

type Query

type Query struct {
	Kind, Run, Source, Origin, Status string
	// Attempts taken before this time alone, for the page after one already read; any when zero
	Before time.Time
	// Most attempts read, at most 500, 100 when zero
	Limit int
}

What a reading of the ledger takes, newest first

type Question

type Question struct {
	ID, Text string
	Choices  []string
	Multi    bool
	Secret   bool
}

One question, with the choices to pick from when it has any

type Questions

type Questions struct {
	ID        string
	Questions []Question
	// Who asks, as a person reads it, such as the extension Foo; empty for the agent
	From string
}

Questions the agent asks a person at once

type Queued

type Queued struct {
	ID string
	// Call of Deliver it came from, the run it is of, empty for one of no run, what started that and what of it, and its title
	Batch, Run, Source, Origin, Title string
	Address                           string
	// It tells why the run failed, and its place refuses it a second time
	Failure, Keyed bool
	// One of the Delivery states, the tries made, and when the next goes, zero for none
	State string
	Tries int
	Next  time.Time
	// Why the last try failed, or why it was given up
	Err string
	// Why it waits without being tried now, such as icebath being paused; empty when it does not
	Held             string
	Created, Updated time.Time
}

One result for one place, as the queue keeps it

type Ran

type Ran struct {
	Out, Err string
	Code     int
}

What a program wrote, out and err cut to their limit and made valid text

type Readier

type Readier interface {
	// Why the work is not ready yet, a sentence a person reads, empty once it is. Asked while it is up, every few seconds and whenever its
	// state is read, so it answers at once and waits on nothing
	Unready() string
}

Starter that says whether it does what it is for yet, such as a listener once it took its address or the chat apps once they connected. One that says nothing is ready as soon as it is up

type Record

type Record struct {
	ID      string `json:"id"`
	Source  string `json:"source"`
	Origin  string `json:"origin,omitempty"`
	Profile string `json:"profile"`
	Title   string `json:"title,omitempty"`
	State   string `json:"state"`
	Deliver string `json:"deliver,omitempty"`
	// Session the run is in, empty before one is made
	Session string    `json:"session,omitempty"`
	Started time.Time `json:"started"`
	Ended   time.Time `json:"ended,omitzero"`
	Reply   Reply     `json:"reply"`
	Sent    []Sending `json:"sent,omitempty"`
	// Process of this computer that runs it while it goes on, and the id of its icebath
	PID   int    `json:"pid,omitempty"`
	Owner string `json:"owner,omitempty"`
	// Its number among the attempts of the run, 1 for the first
	Attempt int `json:"attempt,omitempty"`
	// What was asked of it, which its live record keeps for an icebath that takes it up after a stop
	Asked *asked `json:"asked,omitempty"`
}

A run as every icebath sees it: kept in the profile's folder while it goes on, so another icebath lists and stops it, and once it ended, so the runs of a profile outlive the icebath that ran them

type Recoverer

type Recoverer interface {
	// What becomes of the cut run of a source the registrant names. Unless the cut says icebath is stopping, a feature that has the run told
	// as cut off tells whoever waits for it here
	TakeUp(ctx context.Context, cfg *config.Config, cut Cut) Taking
}

Registrant whose runs say what becomes of one an icebath that ended, or stopped, left cut off: resumed, run again or told as cut off. One whose source no Recoverer answers for is told as cut off

type Registrant

type Registrant interface {
	// Sources of the runs the registrant starts, none for one that only delivers
	Sources() []Source
}

type Registry

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

func (*Registry) Blueprints

func (r *Registry) Blueprints(cfg *config.Config) []Blueprint

Every blueprint the registrants offer, in the order they were registered

func (*Registry) Clocks

func (r *Registry) Clocks(cfg *config.Config) []Clock

Clocks of the profile of the settings, those of the registries nested in this one among them, in the order they were registered

func (*Registry) Close

func (r *Registry) Close() error

Closes every registrant that holds something open, such as a listener, the last registered first

func (*Registry) Host

func (r *Registry) Host() *Runner

Host the registry is nested in, through which plugins start runs and deliver results

func (*Registry) Register

func (r *Registry) Register(registrant Registrant)

func (*Registry) Sources

func (r *Registry) Sources() []Source

func (*Registry) Targets

func (r *Registry) Targets(cfg *config.Config) []Target

Every target the registrants deliver to for the profile of the settings, the first of a kind winning

type Reply

type Reply struct {
	// Session the reply ended in, which compression may have moved on from the one it started in
	Session string `json:"session,omitempty"`
	// Final text of the reply, empty when there was none
	Text string `json:"text,omitempty"`
	// Why the reply failed, empty when it did not
	Failure string `json:"failure,omitempty"`
	// The reply was stopped before it ended
	Stopped bool `json:"stopped,omitempty"`
	// It waited for an answer nobody gives, and was left there
	Waiting bool `json:"waiting,omitempty"`
	// Nothing came of the run worth delivering, such as a script that saw no change: the run is done and delivers nothing
	Quiet bool `json:"quiet,omitempty"`
	// Kind of the provider's failure that ended the reply, as provider.ErrorKind names it, such as rate_limit or auth; empty for a reply
	// that did not fail on its provider
	Cause string `json:"cause,omitempty"`
	// Provider whose failure that was, and when it said it takes requests again, zero when it named no time
	Provider string    `json:"provider,omitempty"`
	Resets   time.Time `json:"resets,omitzero"`
	// Model calls of the reply that the model answered
	Answered int `json:"answered,omitempty"`
	// The reply used every model call it may make and was asked to sum up its work
	Exhausted bool `json:"exhausted,omitempty"`
	// Why the host stopped the run, one of the Halt kinds; empty for a reply nothing stopped, or one stopped in its session
	Halt string `json:"halt,omitempty"`
}

What came of a run's message in its session

type Request

type Request struct {
	// Profile the session runs on, the one in use when empty
	Profile string
	// What started it, one of the sources a registrant names, recorded as the session's source; and what of that source, such as the job's id
	Source, Origin string
	// What a person calls the run, such as the name of the job, and the title of a session made for it
	Title string
	// Session of the profile to run in, one made for the run when empty, in the folder given, else the folder of the session it starts from,
	// else the folder sessions of its profile start in when nothing names one
	Session   string
	Directory string
	// Session of the profile whose conversation a session made for the run starts with, as a fork of it; none when empty
	From string
	// Most characters of that conversation carried over, the newest kept; all of it when zero
	FromLimit int
	// What the agent is sent, and what the transcript and the session's title show in its place when not empty
	Text, Display string
	// Images the message hands the model, such as those a program sent with its request
	Media []*sessionsv1.Media
	// What the agent is told for the run on top of what every session is told, such as how a program wants its answers: kept by a
	// session made for the run, for the run's turn alone in one it names
	Instructions string
	// File of messages every model call of the session sends ahead of its conversation, a JSON list of role and content, such as examples
	// of the answers wanted: kept by a session made for the run, for the run's turn alone in one it names; none when empty
	Prefill string
	// Told each thing the session does while the run's message is answered, in order and as it happens, such as the text the reply
	// grows by; nil for a run nobody follows. It is called from what drives the run, so it returns at once
	Watch func(step Step)
	// Model and provider the session is held to, and its reasoning effort; the session's own when empty. A session made for the run keeps
	// them, one it names has the run's turn alone take them
	Model, Provider, Effort string
	// How fast the model answers where its provider sells another tier: normal, slow, fast or ultrafast; the session's own when empty.
	// Kept and taken as the model is
	Speed string
	// Toolsets the run may use when Restricted: an empty list gives it none
	Toolsets   []string
	Restricted bool
	// Skills the session's prompt loads: a session made for the run keeps them, one it names loads them for the run's turn alone
	Skills []string
	// Settings the session runs with over its profile's, by key: a session made for the run keeps them, one it names has the run's turn
	// alone take them over its own
	Settings map[string]any
	// Most model calls of the reply of the run, the session's own limit when zero: kept by a session made for the run, for the run's turn
	// alone in one it names
	Steps int
	// Wraps the context the run's reply runs in, such as one that tells the tools of a review it is one; nil for none
	Scope func(ctx context.Context) context.Context
	// Nobody answers the session's prompts: a reply that stops to ask is stopped and fails, and the session made for it is let go once it
	// ended. Risky commands go as the approval settings of its source say, such as those of scheduled jobs
	Unattended bool
	// Nothing hears of work the reply leaves going after it ends, such as a background process that tells of its end: the reply waits for
	// such work itself, as the reply of a query its client waits for alone does
	Finite bool
	// The session made for the run is kept out of the lists a person picks a session from, from the moment it is made, such as a board
	// worker's, which is opened from where its work is shown; a session the run names is left as it is
	Hidden bool
	// The run goes only while the session has no reply running, refused with ErrBusy otherwise, such as a heartbeat that comes back to an
	// idle chat
	WhenIdle bool
	// Addresses the reply is delivered to, a comma list, none for a feature that delivers on its own; and those a failure is told to
	Deliver, Failure string
	// Addresses a feature that delivers on its own will deliver the reply to, a comma list, so what the agent does in the run need not
	// send its answer to one of them itself
	Promised string
	// Longest the run may take, the run's own limit over the idle limit; none when zero
	Limit time.Duration
	// Longest the run may go without progress: the idle limit of its profile when zero, none when below zero, such as a board worker,
	// whose board judges its progress itself
	Idle time.Duration
	// The feature runs the work again later itself when the provider can't be reached before the model answered once, such as a scheduled
	// job's retry, so the agent does not wait inside the run for the provider to come back: the run fails at once, and the outage is
	// waited out in one place
	Rerun bool
	// The run is held to the model and provider it names: when they fail, the profile's fallback models are not tried, as a job pinned to
	// its model asks
	Pinned bool
	// Its number among the attempts of the run, 1 for the first: a run an icebath that ended left cut off and another took up again is its
	// next attempt
	Attempt int
	// Occurrence of a schedule the run is of, such as the time a job was due at; zero for a run of none
	Occurrence time.Time
	// Work done inside the run's place before the agent is sent anything, such as a job's script: the text the agent is sent then, the
	// request's own when empty; or the reply the run ends with, the agent sent nothing, such as a script whose output is the result
	Prepare func(ctx context.Context, run *Run) (text string, done *Reply, err error)
}

What a feature asks of a run

type Route

type Route struct {
	// Name among the routes of the profile: lower case letters, digits, hyphens and underscores
	Name string
	// Feature that keeps it, as its Taker names itself
	Owner       string
	Description string
	// Secret the service signs what it posts with, such as a Standard Webhooks whsec_ secret
	Secret string
	// Places the result of each run goes, a comma list, the run's session alone when empty
	Deliver string
	// It takes nothing while off
	Disabled bool
	Created  time.Time
}

A route services post events to that a feature keeps, such as the subscription of an event of an MCP server: the feature that keeps it takes what comes to it

type Router

type Router interface {
	// Address services post to the route of the name of the profile at, and why a service outside this computer can't reach it, a sentence,
	// empty when it can
	Address(cfg *config.Config, name string) (address, unreachable string)
	// Makes the route or changes it; a route given no secret keeps the one it has
	Keep(ctx context.Context, cfg *config.Config, route Route) error
	// Takes the route of the name out, with what it kept of the posts it took; false when there was none
	Drop(ctx context.Context, cfg *config.Config, name string) (bool, error)
	// Routes of the profile the owner keeps, by name
	Kept(cfg *config.Config, owner string) ([]Route, error)
}

Registrant that keeps the routes services post events to: the webhooks

type Run

type Run struct {
	Request
	ID      string
	Started time.Time
	Ended   time.Time
	State   string
	Reply   Reply
	// How the result went to each place it was delivered to, in the order they were tried
	Sent []*Sending
	// contains filtered or unexported fields
}

One run, as the host follows it

func (*Run) Current

func (run *Run) Current() string

Session the run is in now, the one it asked for until another is named

func (*Run) In

func (run *Run) In(session string)

Says the run is in the session, one made for it or one a compression moved it on to

func (*Run) Touch

func (run *Run) Touch()

Says the run moved, which holds its idle limit off

func (*Run) Why

func (run *Run) Why() string

Why the run was stopped, empty when nothing stopped it

type Runner

type Runner struct {
	Registry
	// contains filtered or unexported fields
}

The one way a feature starts and drives a session no person types into: the run of a scheduled job, a webhook, a loop's wakeup or a background task. It holds runs to each profile's limit across every icebath, records each one's source, follows them while they run, keeps them in the profile's folder so every icebath lists and stops them, and delivers their results to the targets registered

func New

func New(cfg *config.Config, toolset *tools.Registry, stores *sessions.Registry, shells *terminal.Terminal) *Runner

func (*Runner) Address

func (r *Runner) Address(origin Origin) string

Address of the origin, its session; empty for an origin of none

func (*Runner) Attempts

func (r *Runner) Attempts(cfg *config.Config, query Query) ([]Attempt, error)

Attempts of the profile of the settings the query names, newest first

func (*Runner) Await

func (r *Runner) Await(ctx context.Context, names []string, until string, any bool, pid int) ([]Standing, bool, error)

Waits until the services named are up, ready or down, every one of them or any, or the context ends: how they stand then and whether the wait was met. Every service of the icebath is waited for when none is named; the services of another icebath are named with the process of that icebath

func (*Runner) Awaiting

func (r *Runner) Awaiting(profile string) map[string]int

Runs of the profile waiting for their turn now in this icebath, by the source that started each

func (*Runner) Cancel

func (r *Runner) Cancel(profile, id string) error

Stops a run of the profile going on in this icebath or another

func (*Runner) CancelOf

func (r *Runner) CancelOf(profile, source, origin, why string) int

Stops the runs of the profile of the source and origin going on in this icebath or another, such as a job's, how many there were

func (*Runner) Carries

func (r *Runner) Carries(name, source string) bool

Whether the service carries the chats of the source, the chat app a session came from: its Starter is the registrant whose runs have that source, so a chat that takes the service down or starts it again cuts itself off

func (*Runner) Check

func (r *Runner) Check(cfg *config.Config, addresses string) error

Says what is wrong with the addresses, a comma list, nil when each names a place there is; origin and local are always fine

func (*Runner) Claimed

func (r *Runner) Claimed(profile string) bool

Whether this icebath holds the claim on the profile's schedules now, without taking it

func (*Runner) ClaimedProfiles

func (r *Runner) ClaimedProfiles() []string

Profiles whose schedules this icebath holds the claim on now, none taken by asking

func (*Runner) Close

func (r *Runner) Close() error

Stops the services and the runs in order as icebath stops, waiting for each, then closes the registrants that hold something open, the ledgers of the profiles, and lets go of the claims on the profiles' schedules: what did not stop within its time is in what it returns

func (*Runner) Context

func (r *Runner) Context() context.Context

Context that ends as icebath stops, for work a feature starts of its own while the server runs

func (*Runner) Control

func (r *Runner) Control(name, verb string, pid int) (string, error)

Does what a person asks of the service: up, down, once or restart. Up and down hold for every icebath of this computer, through the mark in the settings folder; once and restart for this icebath, or the icebath of the process given, which is asked to and does it within a few seconds, as it does up, which there also brings up a service that stays down for good. What was done, a sentence

func (*Runner) Delete

func (r *Runner) Delete(profile string) error

Stops what runs of a profile deleted, whose runs went with its folder

func (*Runner) Deliver

func (r *Runner) Deliver(run *Run, cfg *config.Config, addresses string, delivery Delivery, settled func(problems string))

Delivers the result to every address of the comma list, recorded on the run when one made it: each place kept on disk before it is tried, so a stop of icebath, or its death, never loses it. A place that failed waits on disk and is tried again by the keeper of whichever icebath runs the profile's schedules, on the ladder of the settings, until it went or is given up; while icebath is paused, or the service the place goes through is taken down, it waits without being tried. settled is told what is left undelivered, empty when everything went, once no try is to come, by this icebath alone: an icebath that takes the rest up tells every Follower

func (*Runner) Deliveries

func (r *Runner) Deliveries(cfg *config.Config, run string, limit int, states ...string) ([]Queued, error)

Results of the profile of the settings in the states given, every state for none, the newest first, at most the limit, 100 when zero

func (*Runner) Dispatch

func (r *Runner) Dispatch(ctx context.Context, request Request, ended func(run *Run)) (*Run, error)

Starts the run and returns at once, the reply delivered where the request asks once it ends; ended is told the run when given

func (*Runner) Driver

func (r *Runner) Driver() (Driver, bool)

The driver of sessions, false when nothing drives them

func (*Runner) Drop

func (r *Runner) Drop(cfg *config.Config, id string) (string, error)

Lets go, as a person asks, of a result waiting to be delivered: given up, and never sent

func (*Runner) Exec

func (r *Runner) Exec(ctx context.Context, cfg *config.Config, p Process) (Ran, error)

Runs the program to its end in a process group of its own with the profile's environment, the profile named in it, its whole tree ended when it runs past its limit, the context ends or icebath dies: what it wrote, and an error when it could not start, ran past its limit or exited with a code other than zero

func (*Runner) Go

func (r *Runner) Go(profile string, work func(ctx context.Context))

Does the work in the background for the profile while icebath runs, such as a job's script before its run: the profile is held from a rename or a delete until it returned, and icebath waits for it as it stops. The context ends as icebath stops

func (*Runner) Halt

func (r *Runner) Halt(profile, why string) int

Stops the runs of the profile going on in this icebath, every profile's for an empty one, as a stop of icebath comes into force, why as the stop says it; how many it stopped. Runs waiting for their turn wait on

func (*Runner) Held

func (r *Runner) Held(profile string) string

Why the work of the profile waits now, a sentence; empty while nothing holds it

func (*Runner) Here

func (r *Runner) Here() []Standing

The services of this icebath as they stand now, each that says whether it is ready asked, in the order their Starters were registered

func (*Runner) Holds

func (r *Runner) Holds(profile string) string

Why the profile's folder can't move or go now: runs or background work of it going on in this icebath or another

func (*Runner) Idle

func (r *Runner) Idle(session string) bool

Whether the session has no reply running and no message waiting, false when nothing drives sessions

func (*Runner) Judge

func (r *Runner) Judge(ctx context.Context, cfg *config.Config, session, condition, reply string) (Verdict, error)

What the judge decided of the session's reply against the condition, ErrNoJudge when nothing judges

func (*Runner) Live

func (r *Runner) Live(profile string) []Record

Runs of the profile going on now in this icebath and every other, oldest first

func (*Runner) Load

func (r *Runner) Load() Load

What this icebath has going on now, read from memory alone: the runs of this process, not those of another icebath

func (*Runner) Missed

func (r *Runner) Missed(cfg *config.Config, source, origin, title string, count int, first time.Time, detail string) error

Books occurrences of a schedule that were let pass without a run, such as those a job misses while no icebath runs, as one attempt that names how many and the first of them

func (*Runner) Note

func (r *Runner) Note(ctx context.Context, session, text string) error

Adds the text to the session's transcript as a note of the agent

func (*Runner) Owned

func (r *Runner) Owned(ctx context.Context, session string) bool

Whether something drives the session on its own now, such as a standing goal, false when nothing does

func (*Runner) Pausing

func (r *Runner) Pausing(held func(profile string) string)

Hands over what holds the work of a profile while icebath is paused, the emergency stop: why the work of the profile waits, a sentence, empty while nothing holds it. Runs then wait for their turn and deliveries wait to go

func (*Runner) Places

func (r *Runner) Places() []tools.Place

Places runs come from, each source the registrants name with what a person calls it, so the tools host lists every one as a place a person may set the tools of

func (*Runner) Promised

func (r *Runner) Promised(session string) string

Addresses the reply of the run going on in the session will be delivered to once it ends, a comma list: empty when no run of this icebath goes on there, or its reply is delivered nowhere

func (*Runner) Recent

func (r *Runner) Recent(profile string) []Record

Runs of the profile that ended, in this icebath or another, newest first, as many as the profile keeps

func (*Runner) Record

func (r *Runner) Record(run *Run) Record

The run as it stands, copied under the host's lock

func (*Runner) Register

func (r *Runner) Register(registrant Registrant)

Adds a registrant; a registry nested in the host reaches the host through Host

func (*Runner) Resend

func (r *Runner) Resend(cfg *config.Config, id string) (string, error)

Sends again, as a person asks, a result given up or one whose arrival is not known, its tries and its time counted anew: a place that does not refuse a result it took may get it twice, which the person takes on by asking

func (*Runner) Resolve

func (r *Runner) Resolve(addresses string, origin Origin) (string, error)

The addresses, a comma list, with origin in place of the origin's own address; the addresses as they are when it has none

func (*Runner) Router

func (r *Runner) Router() (Router, error)

What keeps the routes services post events to, ErrNoRoutes when nothing does

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, request Request) (*Run, error)

Runs the request through to its reply and delivers the reply where it asks: waits for a place under the profile's limit, makes its session when it names none, follows it while it runs and records it with the runs that ended

func (*Runner) Scheduled

func (r *Runner) Scheduled() []string

Profiles whose schedules this icebath runs now, each claimed as Scheduling claims it

func (*Runner) Scheduler

func (r *Runner) Scheduler() (Scheduler, error)

The scheduler of jobs, ErrNoJobs when nothing schedules

func (*Runner) Scheduling

func (r *Runner) Scheduling(profile string) bool

Whether this icebath runs the schedules of the profile, the timers of its jobs, loops and webhooks. Exactly one icebath of this computer does, the one holding the claim in the profile's folder: a window of icebath runs those of the profile it uses, and icebath server those of every profile no window runs. A window that finds the server holding its profile's claim asks for it, and the server lets go of it; a window that finds another window holding it takes it over once that one ended

func (*Runner) Screening

func (r *Runner) Screening(check func(cfg *config.Config, path string) string)

Hands over how a file of this computer is checked before a feature sends it on to a person, such as a file a member of a room shares: as the chat apps check the files a reply names for a chat

func (*Runner) Script

func (r *Runner) Script(cfg *config.Config, script, interpreter string) ([]string, error)

Words that run the script of the profile's scripts folder: bash for .sh and .bash, the interpreter given, python3 for .py, each found on the search path of the profile's environment the script runs with, the file itself when it may be run; or why it can't run

func (*Runner) Serve

func (r *Runner) Serve()

Marks this process as the long-lived server, which runs the schedules of every profile no window of icebath runs

func (*Runner) Served

func (r *Runner) Served(profile string) bool

Whether an icebath of this computer runs the schedules of the profile now, this one or another: one holds the claim in its folder

func (*Runner) Services

func (r *Runner) Services() []Standing

The services of this icebath, then those of every other icebath of this computer that uses the same settings folder, each icebath's in the order its Starters were registered

func (*Runner) Settings

func (r *Runner) Settings(profile string) *config.Config

Settings of the profile, the one in use for none

func (*Runner) Settle

func (r *Runner) Settle(profile, id, why string) bool

Tells the run of the profile an icebath left cut off as cut off now, in the words given or the runner's own, its feature not asked: for the feature that started it, whose cut runs are never taken up again, as someone asks how one stands before the keeper came to it. One a stop was asked of is told with the stop's words instead. False when the run does not wait to be taken up: it goes on, it ended, or the keeper has it

func (*Runner) Start

func (r *Runner) Start(ctx context.Context)

Starts the services of every registrant that works on its own once, each kept going while icebath runs, and the keeper of the runs and results an icebath left behind; as the context ends the services and the runs stop in order, which Close waits for

func (*Runner) Starting

func (r *Runner) Starting() []string

Profiles whose schedules this icebath runs and whose work no stop holds now: those its schedules start work for

func (*Runner) Starts

func (r *Runner) Starts(profile string) bool

Whether this icebath starts work of the profile on its own now: its schedules are this icebath's to run, and no stop holds it

func (*Runner) Steer

func (r *Runner) Steer(ctx context.Context, session, text string) (bool, error)

Sends the text to the reply running in the session, read at its next step; false when no reply runs there, ErrNoDriver when nothing takes guidance

func (*Runner) Stop

func (r *Runner) Stop(profile string) error

Stops the runs of the profile and what the registrants work on of it before its folder moves, and lets go of the claim on its schedules

func (*Runner) Store

func (r *Runner) Store(cfg *config.Config) (sessions.Store, error)

The session store of the settings, which the targets of sessions and the loops of chats look sessions up in

func (*Runner) Taker

func (r *Runner) Taker(owner string) (Taker, bool)

The feature that takes what comes to the routes of the owner, false when none does

func (*Runner) Tally

func (r *Runner) Tally(profile string, since time.Time) (map[[2]string]int, error)

How many attempts of each kind and status the ledger of the profile keeps that were taken since the time, by kind then status

func (*Runner) Tell

func (r *Runner) Tell(cfg *config.Config, text string)

Tells the person on the profile of the settings something in the app: the chat in front of a window on that profile shows it, else a toast, and a window on another profile never does

func (*Runner) Unheld

func (r *Runner) Unheld()

Wakes the runs waiting for their turn and the deliveries waiting to go, as a stop is lifted

func (*Runner) Unreadable

func (r *Runner) Unreadable(cfg *config.Config, path string) string

Refusal of a read of the path the tools guard, such as a file handed to a program that asked the agent; empty when it may be read

func (*Runner) Unsendable

func (r *Runner) Unsendable(cfg *config.Config, path string) string

Refusal of a file of this computer being sent on to a person from the profile of the settings, by the check Screening handed over; empty when it may be sent, and while no check was handed over

func (*Runner) Unwritable

func (r *Runner) Unwritable(cfg *config.Config, path string) string

Refusal of a write of the path the tools guard, such as a file a delivery adds to; empty when it may be written

type Scheduler

type Scheduler interface {
	// Jobs of the profile of the settings
	Jobs(ctx context.Context, cfg *config.Config) ([]Job, error)
	// Job of the profile an id, the start of one or a name names; an error the person reads when none or several do
	Job(ctx context.Context, cfg *config.Config, ref string) (Job, error)
	// Runs the job now, what fired it told to the agent as context of this run alone
	Fire(ctx context.Context, cfg *config.Config, ref, context string) error
}

Registrant whose jobs other features run by name, the scheduler of jobs, which a webhook fires

type Sending

type Sending struct {
	// Id of the result at the place, which a keyed place refuses a second time
	ID      string `json:"id,omitempty"`
	Address string `json:"address"`
	// Tries made so far
	Tries int `json:"tries"`
	// Why the last try failed, empty once it went
	Err string `json:"error,omitempty"`
	// When the next try goes, zero when none is to come
	Next time.Time `json:"next,omitzero"`
	// The result reached the place
	Delivered bool `json:"delivered,omitempty"`
	// Whether it reached the place is not known: icebath ended while it was being sent, and it was not sent again, so it never arrives
	// twice
	Unknown bool `json:"unknown,omitempty"`
	// Why it waits without being tried, such as icebath being paused or the service it goes through taken down; empty when it does not
	Held string `json:"held,omitempty"`
	// It tells why the run failed
	Failure bool `json:"failure,omitempty"`
}

How a run's result goes to one place

func (Sending) Settled

func (s Sending) Settled() bool

Whether no try of it is to come: it went, it was given up, or whether it went is not known

type Service

type Service struct {
	// Unique across icebath, lower case letters, digits, dots and dashes, the same from one run to the next: what a person names it by and
	// what its kept state is kept under
	Name string `json:"name"`
	// What a person calls it, and what it does, a phrase
	Title string `json:"title"`
	About string `json:"about,omitempty"`
	// Longest it takes to stop once its context ended, the stop wait of the settings when zero
	Limit time.Duration `json:"limit,omitempty"`
	// Results of runs go out through it, such as the connections of the chat apps: as icebath stops it stops once the runs ended, after every
	// other service
	Last bool `json:"last,omitempty"`
	// It works on the profiles whose schedules this icebath holds the claim on, and on no other
	Claims bool `json:"claims,omitempty"`
}

What a Starter is to a person, who reads its state and controls it by its name

type Slot

type Slot struct {
	Name, Kind, Label string
	Default           string
	Options           []string
	Optional          bool
	Help              string
	// Only the options are taken, for a choice
	Strict bool
}

One value a person gives a blueprint

type Source

type Source struct {
	Name  string
	Title string
}

What starts sessions nobody types into, such as scheduled jobs or webhooks, by the name a run records as its source and what a person calls it

type Standing

type Standing struct {
	Service
	// Icebath it runs in: its process, whether that is icebath server, and whether it is another icebath than this one
	PID       int  `json:"pid"`
	Server    bool `json:"server,omitempty"`
	Elsewhere bool `json:"-"`
	// It is wanted up, and a person took it down, which every icebath of this computer keeps until they bring it up
	Wanted bool `json:"wanted"`
	Held   bool `json:"held,omitempty"`
	// A run of it goes on, its Start not returned yet, and since when it is up or down
	Up    bool      `json:"up"`
	Since time.Time `json:"since"`
	// It was asked to stop and its run has not ended yet, and it went past the time it may take to stop
	Stopping bool `json:"stopping,omitempty"`
	Late     bool `json:"late,omitempty"`
	// It does what it is for, since when, or why not
	Ready      bool      `json:"ready,omitempty"`
	ReadySince time.Time `json:"ready_since,omitzero"`
	Unready    string    `json:"unready,omitempty"`
	// It is not started again once its run ends
	Once bool `json:"once,omitempty"`
	// Why it stays down until a person brings it up, as it said; empty when it does not
	Gone string `json:"gone,omitempty"`
	// Runs started in that icebath, those that died, and how many in a row died before they lasted ten seconds
	Starts  int `json:"starts"`
	Deaths  int `json:"deaths,omitempty"`
	Failing int `json:"failing,omitempty"`
	// How its last run ended, zero before one did
	Last End `json:"last,omitzero"`
	// When it is started next, zero for no start to come
	Next time.Time `json:"next,omitzero"`
	// Profiles whose schedules it works on there, for a service that works on those alone
	Profiles []string `json:"profiles,omitempty"`
}

How a service stands in an icebath of this computer

func (Standing) Said

func (s Standing) Said() string

How the service stands, in words a person reads with no trailing period, such as "Up for 3 hours, ready" or "Down, started again in 8 seconds"

func (Standing) Unwell

func (s Standing) Unwell() string

Why the service is not well, a sentence a person reads; empty when it is: up and ready, or down because a person took it down or ran it once. A service that says it must stay down is not well until a person brings it up

type Starter

type Starter interface {
	// What the work is, read quickly and without waiting on anything
	Service() Service
	Start(ctx context.Context, host *Runner) error
}

Registrant that works on its own while icebath runs, such as a scheduler or a listener, which the runner starts as icebath starts and keeps going. Start works until the context ends and returns nil once everything it started ended. Returning before the context ended, with an error or without, or panicking is it dying, and it is started again after a wait; an error made with Down keeps it down until a person brings it up

type Steerer

type Steerer interface {
	// Sends the text to the reply running in the session, read at its next step; false when no reply runs there
	Steer(ctx context.Context, session, text string) (bool, error)
}

Registrant whose sessions take guidance while a reply runs, the agent: a feature tells the reply running in a session something it reads at its next step

type Step

type Step struct {
	// Text and reasoning the reply being written grew by, and whether what was written of it so far was dropped first
	Delta, Reasoning string
	Restart          bool
	// A message the session stored: what the agent wrote, with the tools it calls, or what a tool gave back
	Message *sessionsv1.Message
	// How far a tool the agent runs got
	Progress *Progress
	// Approval prompts waiting for a person, oldest first, when they changed: none once nothing waits
	Approvals []Approval
	Prompted  bool
	// Questions the agent waits on a person for, nil once none wait, when they changed
	Questions *Questions
	Asked     bool
	// Session the run goes on in from now on, a compression having continued it there
	Continued string
	// Something told beside the reply, such as why it failed
	Notice string
}

One thing the session of a run does while the run's message is answered. Each step holds one of these

type Stopper

type Stopper interface {
	Stop(profile string) error
}

Registrant that works on a profile from its folder, such as a scheduler holding the profile's jobs: stopped before the folder moves or goes, its own work taking the profile up again once it is back

type Taken

type Taken struct {
	// Answer to the service and its status, for a post that is answered and runs nothing, such as a check that the route answers
	Code   int
	Answer map[string]any
	// Id that makes a post sent again the same, so it runs once; the service's own when empty
	ID string
	// What the run is sent, and what its transcript shows in its place
	Text, Display string
	// The route goes: the service ended what it posted. Tell, when not empty, is delivered to the route's places first
	Ended bool
	Tell  string
}

What a feature makes of a post to one of its routes: an answer to the service, or the run of what it told of

type Taker

type Taker interface {
	// Owner name its routes carry
	Owns() string
	// What to make of a post to one of its routes, signed with its secret and taken as the profile's
	Take(ctx context.Context, cfg *config.Config, route Route, payload any) Taken
}

Registrant that takes what services post to the routes it keeps

type Taking

type Taking struct {
	// One of TakeResume, TakeRerun and TakeFail
	Way string
	// What the run that takes it up is asked, for TakeResume and TakeRerun, such as the cut's Resumed or Again with what the feature keeps
	// in memory handed again
	Request Request
	// Why it is not taken up, for TakeFail: whole sentences whoever waited for the run reads; the runner's own words when empty
	Why string
	// Told the run that took it up once it ended, as Dispatch tells its caller; nil for none
	Ended func(run *Run)
}

What a feature asks for a cut run of its source

type Target

type Target struct {
	Kind  string
	Title string
	// What a delivery here does, a phrase for a person
	About string
	// What the part of an address after the kind names, for a person, empty for a kind that takes nothing after it
	Rest string
	// Delivers the text to the place the rest of the address names, on the settings of the run's profile
	Deliver func(ctx context.Context, cfg *config.Config, rest string, delivery Delivery) error
	// Says what is wrong with the rest of an address, nil for any
	Check func(cfg *config.Config, rest string) error
	// The rest may be filled in from the event that started a run, such as the pull request a webhook's event is about; the kind never is
	FromEvent bool
	// The place takes the id of a delivery and refuses a result of an id it took already, such as a Bot Chat by the id of its message: a
	// result icebath ended in the middle of sending goes again, which the place takes once. One of a place that does not is never sent
	// again, so it never arrives twice
	Keyed bool
}

Place a result can be delivered to, by the kind an address starts with: an address is the kind alone, or the kind, a colon and what of that kind, such as session:<id> or file:~/digest.md

type Verdict

type Verdict struct {
	// The condition is met
	Done bool
	// The condition can't be met as things stand
	Blocked bool
	Reason  string
}

What a judge decided of a reply against a stop condition

Directories

Path Synopsis
/services: the services icebath keeps going on its own, how each stands and whether icebath is well, and their control.
/services: the services icebath keeps going on its own, how each stands and whether icebath is well, and their control.

Jump to

Keyboard shortcuts

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