config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 27 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

Package config loads the user's settings and locates the state directory.

Index

Constants

View Source
const (
	ColumnWorking         = "working"
	ColumnWorkingFallback = "working-fallback"
	ColumnNeedsMe         = "needs-me"
	ColumnReviewed        = "reviewed"
	ColumnReady           = "ready"
	ColumnInProgress      = "in-progress"
	ColumnInReview        = "in-review"
	ColumnCompleted       = "completed"
)
View Source
const DefaultMCPPort = 47800
View Source
const DefaultPRDailyCap = 5
View Source
const DefaultSlackEndedAfter = 7 * 24 * time.Hour

DefaultSlackEndedAfter is plugins.slack.ended_after's default.

View Source
const DefaultSlackRedirectPort = 53682

DefaultSlackRedirectPort is the login callback port registered in the Slack app.

View Source
const MinSlackTurnChars = 2000

MinSlackTurnChars is the smallest cap Chars returns, which holds a parent and a reply.

View Source
const StatEvery = 2 * time.Second

StatEvery is how often a Holder looks at the config file.

View Source
const UserHomeVar = "LOOP_USER_HOME"

UserHomeVar names an absolute directory Home returns instead of the user's, so an isolated daemon finds no agent home of the user while HOME, which the Keychain needs, stays real.

Variables

View Source
var MigrationURL = "https://github.com/" + brand.Org + "/" + brand.Name + "/issues/76"

MigrationURL explains the move from config.json to config.toml and holds the script that converts one.

Functions

func DaemonSocket

func DaemonSocket() string

func Dir

func Dir() string

func ExpandHome

func ExpandHome(p string) string

func Home

func Home() string

func Key added in v0.3.0

func Key(path ...string) string

Key is path as a dotted TOML key, each part quoted where it needs it.

func KeyOf added in v0.2.0

func KeyOf(field string) string

KeyOf is the file's key of Config's top-level field.

func Path

func Path() string

func PluginPath added in v0.3.0

func PluginPath(field string) []string

PluginPath is the key path of the bundled plugin whose settings are Plugins' field, such as plugins.github for "GitHub".

func ProfilesDir

func ProfilesDir() string

ProfilesDir holds the review profiles named by a bare name.

func ResolveProfile

func ResolveProfile(v string) string

ResolveProfile turns a profile setting into a directory: a bare name lives under ProfilesDir, anything else is a path.

func StateDir

func StateDir() string

StateDir holds the inventory database, the state lock and the logs.

Types

type ApprovalConfig

type ApprovalConfig struct {
	Mode   string               `json:"mode,omitempty"`
	Window *Days                `json:"window,omitempty"`
	Rule   []ApprovalRuleConfig `json:"rule,omitempty"`
}

ApprovalConfig overlays an approval block field by field: Mode and Window replace the manifest's, Rule its rules; "", nil and a nil Rule keep the manifest's, an empty Rule clears them.

type ApprovalRuleConfig added in v0.2.0

type ApprovalRuleConfig struct {
	When   string `json:"when"`
	Mode   string `json:"mode"`
	Window Days   `json:"window,omitempty"`
}

type Brief

type Brief struct {
	Enabled       bool       `json:"enabled"`
	Tier          turns.Tier `json:"tier"`
	MaxInputBytes int        `json:"max_input_bytes"`
}

Brief previews each pull request with one headless call of the agent, outside the sweeps.

type Classify

type Classify struct {
	PerDay int `json:"per_day"`
}

type Cleanup

type Cleanup struct {
	Idle           Days `json:"idle"`
	AskedIdle      Days `json:"asked_idle"`
	WorkspaceGrace Days `json:"workspace_grace"` // counted in working time
	ManualIdle     Days `json:"manual_idle"`
	StaleWorkspace Days `json:"stale_workspace"`
	// Disposable names ignored files and directories a tool recreates, so
	// removing a workspace that holds them loses nothing.
	Disposable []string `json:"disposable"`
}

Cleanup holds the thresholds of the session and workspace cleanup workflows.

type Config

type Config struct {
	// ProjectsDir is where `review` clones a repository that is not
	// registered in the workspace manager yet. No default: a wrong guess
	// clones duplicates.
	ProjectsDir string `json:"projects_dir"`
	// WorkspaceManagers are the enabled workspace managers in the order a new
	// worktree picks them: the first that hosts the agent and honors the
	// session's launch policy owns it.
	WorkspaceManagers []string `json:"workspace_managers"`
	Agent             string   `json:"agent"`
	// AgentHome is the agent's own configuration directory (CLAUDE_CONFIG_DIR
	// for Claude Code), "" for the agent's default.
	AgentHome string `json:"agent_home"`
	// Profile is the directory with the reviewer's judgment.
	Profile string `json:"profile"`
	// AgentModels pins, per agent, a model tier to one of that agent's
	// own model names; the loop hands the name to the agent unread.
	AgentModels map[string]map[turns.Tier]string `json:"agent_models"`
	// Projects override settings for the pull requests of matching
	// repositories; the first match wins.
	Projects []Project `json:"projects"`
	Sweep    Sweep     `json:"sweep"`
	HTTP     HTTP      `json:"http"`
	MCP      MCP       `json:"mcp"`
	Brief    Brief     `json:"brief"`
	// Views holds each view sink's own settings by sink name.
	Views    map[string]SinkConfig `json:"views"`
	Cleanup  Cleanup               `json:"cleanup"`
	Classify Classify              `json:"classify"`
	// Workflows override each workflow's manifest by workflow name.
	Workflows map[string]WorkflowConfig `json:"workflows"`
	// Intents set each intent's settings by intent name.
	Intents map[string]IntentConfig `json:"intents"`
	// Plugins are the [plugins.<id>] tables: each plugin's switch and trust,
	// and the bundled plugins' settings, which the embedding promotes.
	Plugins `json:"plugins"`
	// Placement is the rules that place units; the first match wins.
	Placement []PlacementRule `json:"placement,omitempty"`
	Tasks     Tasks           `json:"tasks"`
	// Notifications sets the menu bar's daily digest.
	Notifications Notifications `json:"notifications"`
	Dossiers      Dossiers      `json:"dossiers"`
	Drafts        Drafts        `json:"drafts"`
	Items         Items         `json:"items"`
	Headless      Headless      `json:"headless"`
	Turns         Turns         `json:"turns"`
}

func Defaults

func Defaults() Config

Defaults is the config without a file. It names no agent and no workspace manager: the composition root picks those.

func Load

func Load(base Config) (Config, error)

Load reads the config file over base, falling back to base when the file is refused.

func LoadFile

func LoadFile(file string, base Config) (Config, error)

func (Config) AgentHomes

func (c Config) AgentHomes() []string

AgentHomes lists every agent home the settings name.

func (Config) Column

func (c Config) Column(sink, status string) string

Column is sink's column for status, "" when unset.

func (Config) For

func (c Config) For(owner, repo string) Config

For returns the settings that apply to a pull request of owner/repo.

func (Config) GateApprovalWarnings added in v0.3.0

func (c Config) GateApprovalWarnings() []string

GateApprovalWarnings name each rule of a workflows.<name>.gates.approval that releases, reads draft.delivery and names no delivery, so it never releases a draft whose delivery posts.

func (Config) PlacementMap

func (c Config) PlacementMap() placement.Map

PlacementMap is c's placement rules as the placement service reads them.

func (Config) PluginDraftApproval added in v0.2.0

func (c Config) PluginDraftApproval(id string) (draft.Approval, bool)

PluginDraftApproval is the approval of the drafts plugin id's own rules propose: its plugins.<id>.gates.approval; false when the config sets none, and the profile's default applies.

func (Config) PluginEnabled

func (c Config) PluginEnabled(id string) bool

PluginEnabled says whether the plugin id is on: [plugins.<id>] enabled, on when unset.

func (Config) PluginSwitches added in v0.2.0

func (c Config) PluginSwitches() []string

PluginSwitches are the ids of every plugin the config can switch: the bundled ones and every other the file or the composition root names.

func (Config) PluginTable added in v0.3.0

func (c Config) PluginTable(id string) json.RawMessage

PluginTable is [plugins.<id>] as the file wrote it, for a plugin that is not bundled; nil when the file has none.

func (Config) PluginTrust added in v0.3.0

func (c Config) PluginTrust(id string) string

PluginTrust is [plugins.<id>] trust, "" when unset.

func (Config) ProjectSettingsFor

func (c Config) ProjectSettingsFor(intent string, facts expr.Facts) bool

ProjectSettingsFor says whether a session of intent on the unit whose turn facts facts resolves loads the checkout's own agent settings. Without the facts, an intent that has a predicate does not.

func (Config) TrustsClones added in v0.3.0

func (c Config) TrustsClones(owner, repo string) bool

TrustsClones says whether the project of owner/repo, the first that matches, trusts the repository when the loop clones it.

func (Config) WithColumns

func (c Config) WithColumns(defaults map[string]map[string]string) Config

WithColumns is c with, for each sink in defaults, the default of each column c leaves out.

type Days

type Days time.Duration

Days is a duration written as duration.Parse reads it: "2d", "36h", "90m".

func (Days) MarshalJSON

func (d Days) MarshalJSON() ([]byte, error)

func (*Days) UnmarshalJSON

func (d *Days) UnmarshalJSON(b []byte) error

type Doc added in v0.3.0

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

Doc is a config file edited in place: what Set does not touch, comments and blank lines included, stays as written.

func ParseDoc added in v0.3.0

func ParseDoc(raw []byte) (*Doc, error)

ParseDoc is raw as a Doc; raw that is not TOML is an error.

func (*Doc) Bytes added in v0.3.0

func (d *Doc) Bytes() []byte

Bytes is the document as edited.

func (*Doc) Get added in v0.3.0

func (d *Doc) Get(path ...string) any

Get is the value at path, nil when the document has none.

func (*Doc) Set added in v0.3.0

func (d *Doc) Set(path []string, v any) error

Set writes v, any TOML value but a table, at path. A value equal to the document's is left as written; an empty string or list is not added where the document has no key. An edit that would leave the document invalid is refused and changes nothing.

type Dossiers

type Dossiers struct {
	ArchiveAfter Days  `json:"archive_after"` // after its task or unit resolved
	PurgeAfter   Days  `json:"purge_after"`   // after the archive
	SoftCapMB    int64 `json:"soft_cap_mb"`   // per dossier, reported by doctor
	TotalCapMB   int64 `json:"total_cap_mb"`  // dossiers and archives, reported by doctor
	MaxFileMB    int64 `json:"max_file_mb"`   // a larger file is refused, linked instead
	CompactAtKB  int64 `json:"compact_at_kb"` // log/ size that triggers compaction
}

Dossiers sets the dossiers' lifecycle and quotas; a value of zero or less keeps its default.

type Drafts added in v0.2.0

type Drafts struct {
	// RepeatAfter is how long a nudged, discarded, sent or observed draft
	// keeps its rule or workflow from proposing it again, by default.
	RepeatAfter Days `json:"repeat_after"`
}

Drafts holds the settings every proposer's drafts share.

type GitHub added in v0.2.0

type GitHub struct {
	Plugin
	ReviewPrefix       string   `json:"review_prefix"`
	AutomatedReviewers []string `json:"automated_reviewers"`
	// Owners restricts automated follow-ups to these GitHub owners. Empty
	// means the owners of every repository the workspace manager knows.
	Owners []string `json:"owners"`
	// TrustedAuthors are logins whose pull requests pass the author
	// association check of automated rounds, such as a bot with no
	// association to the repository.
	TrustedAuthors []string `json:"trusted_authors"`
	// FollowupsWithoutWorkspace lets a follow-up review recreate the review
	// workspace the user deleted; off, the sweep only logs the follow-up.
	FollowupsWithoutWorkspace bool `json:"followups_without_workspace"`
	// AddressWithoutWorkspace lets a triage round on a pull request I
	// develop create its author workspace when it has none; off, the sweep
	// only records the round it would start.
	AddressWithoutWorkspace bool `json:"address_without_workspace"`
	// AddressReviews starts a triage round in the author workspace when
	// someone reviews a pull request I develop.
	AddressReviews bool `json:"address_reviews"`
	// AddressSkipReviewers lists logins whose reviews never start a triage
	// round.
	AddressSkipReviewers []string `json:"address_skip_reviewers"`
	// AddressChecks starts a triage round when checks fail on the head of a
	// pull request I develop; IgnoreChecks names checks that never do.
	AddressChecks bool     `json:"address_checks"`
	IgnoreChecks  []string `json:"ignore_checks"`
	// AddressConflicts starts a triage round when a pull request I develop
	// conflicts with its base past the conflict window.
	AddressConflicts bool        `json:"address_conflicts"`
	Scope            Scope       `json:"scope"`
	Stalled          Stalled     `json:"stalled"`
	Gates            PluginGates `json:"gates"`
	Nudge            Nudge       `json:"nudge"`
	// RateLimitFraction is the share of the GitHub rate limit the sweeps
	// may spend.
	RateLimitFraction float64 `json:"rate_limit_fraction"`
}

GitHub is the GitHub plugin's settings.

type HTTP

type HTTP struct {
	Port int `json:"port"`
}

type Headless

type Headless struct {
	Tier       turns.Tier `json:"tier"`
	PerCallUSD float64    `json:"per_call_usd"`
	PerDayUSD  float64    `json:"per_day_usd"`
}

Headless caps the headless turns: the model tier of their calls, what one call may cost and what they may cost in a day; a cost of zero leaves it uncapped.

type Holder

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

Holder is the one configuration a serve holds. Config is the config the serve started with, except that the profile setting follows the file; every other change makes Stale true until the serve restarts.

func NewHolder

func NewHolder(cfg Config, opts HolderOptions) *Holder

NewHolder holds cfg, the config just loaded from opts.Path.

func (*Holder) Break

func (h *Holder) Break(err error)

Break records that no config has loaded yet, so Err answers err until Rebase.

func (*Holder) Config

func (h *Holder) Config() Config

Config is the config the serve runs with and the profile now in force.

func (*Holder) Err

func (h *Holder) Err() error

Err is the failure recorded by Break, nil once a config has loaded.

func (*Holder) Rebase

func (h *Holder) Rebase(cfg Config)

Rebase makes cfg, just loaded, the config the serve runs with.

func (*Holder) Stale

func (h *Holder) Stale() bool

Stale reports that the file changed in a way only a restart applies.

func (*Holder) Warning

func (h *Holder) Warning() string

Warning is what a restart or a fix of config.toml would change: the load failure of a file that broke, else that a changed file needs a restart; "" when the running config matches the file.

type HolderOptions

type HolderOptions struct {
	// Path is the config file to watch; "" watches nothing.
	Path string
	// Load reads the config; nil disables reloads.
	Load func() (Config, error)
	// Stat is os.Stat when nil.
	Stat func(string) (os.FileInfo, error)
	// Every is the stat interval; StatEvery when zero.
	Every time.Duration
	// Now is the clock; time.Now when nil.
	Now func() time.Time
	// OnProfileChange runs, outside the lock, after the profile setting changed to profile.
	OnProfileChange func(profile string)
	// OnWarningChange runs, outside the lock, after a reload changed what Warning answers.
	OnWarningChange func()
}

HolderOptions are the collaborators of a Holder.

type IntentConfig added in v0.2.0

type IntentConfig struct {
	ProjectSettings *ProjectSettings `json:"project_settings,omitempty"`
}

IntentConfig is one intent's settings.

type Items

type Items struct {
	Heat ItemsHeat `json:"heat"`
}

Items holds the items ledger's settings.

type ItemsHeat

type ItemsHeat struct {
	// WarmFor is how long a unit stays warm after its last item resolved; zero is the heat reader's default.
	WarmFor Days `json:"warm_for,omitempty"`
}

type LegacyFileError added in v0.3.0

type LegacyFileError struct{ Legacy, File string }

LegacyFileError is a configuration directory that holds config.json and no config.toml.

func (*LegacyFileError) Error added in v0.3.0

func (e *LegacyFileError) Error() string

type MCP

type MCP struct {
	Port int `json:"port"`
}

MCP is the daemon's MCP endpoint, which agent homes register by URL.

func (MCP) URL

func (m MCP) URL() string

URL is the endpoint agent homes register.

type Notifications

type Notifications struct {
	DigestAt string `json:"digest_at"`
}

Notifications: DigestAt is the local "HH:MM" of the daily digest, "" for none.

type Nudge

type Nudge struct {
	SilentDays int `json:"silent_days"` // calendar days
}

type PlacementRule

type PlacementRule struct {
	Match    string `json:"match"`
	Repo     string `json:"repo,omitempty"`
	Checkout string `json:"checkout,omitempty"`
	Role     string `json:"role,omitempty"`
	Shared   bool   `json:"shared,omitempty"`
}

PlacementRule is one rule of the placement map.

type Plugin

type Plugin struct {
	// Enabled switches the plugin; nil means enabled.
	Enabled *bool `json:"enabled,omitempty"`
	// Trust "path" runs the plugin's binary whatever its checksum. Only the
	// user writes it: a bundled plugin is trusted by its recorded checksum,
	// and any other plugin's binary is refused without it.
	Trust string `json:"trust,omitempty"`
}

Plugin is what [plugins.<id>] says of any plugin: its switch and how its binary is trusted.

type PluginApproval added in v0.2.0

type PluginApproval struct {
	Mode   string `json:"mode"`
	Window Days   `json:"window,omitempty"`
}

func (PluginApproval) Approval added in v0.2.0

func (a PluginApproval) Approval() draft.Approval

Approval is a as a draft's approval.

type PluginGates added in v0.3.0

type PluginGates struct {
	Approval *PluginApproval `json:"approval,omitempty"`
}

PluginGates holds the approval of the gates a plugin's own rules open.

type Plugins added in v0.3.0

type Plugins struct {
	GitHub GitHub `json:"github"`
	Slack  Slack  `json:"slack"`
	// Other are the switches and trust of every other plugin, by id; the
	// composition root may switch a plugin it registers here, as a test's
	// plugin is.
	Other map[string]Plugin `json:"-"`
	// Raw are the other plugins' tables as the file wrote them, by id, which
	// a plugin reads as its configuration.
	Raw map[string]json.RawMessage `json:"-"`
}

Plugins are the [plugins.<id>] tables. The bundled plugins' tables hold their settings too; every other plugin's holds its switch and trust, and its own keys, which only the plugin reads.

type Project

type Project struct {
	Match       string `json:"match"`
	ProjectsDir string `json:"projects_dir"`
	// Agent is the agent the project's sessions run.
	Agent     string `json:"agent"`
	AgentHome string `json:"agent_home"`
	// WorkspaceManagers orders the managers a new worktree of the project picks from.
	WorkspaceManagers []string `json:"workspace_managers"`
	// TrustClones trusts, in the agent home, a repository of the project at
	// the moment the loop clones it; its match must name an owner.
	TrustClones bool `json:"trust_clones"`

	GitHub ProjectGitHub `json:"github"`
}

Project matches repositories by an owner/repo pattern such as "acme/*" or "acme/infra". Empty fields keep the top-level value.

func (Project) Matches

func (p Project) Matches(owner, repo string) bool

type ProjectGitHub added in v0.2.0

type ProjectGitHub struct {
	TrustedAuthors            []string `json:"trusted_authors"`
	FollowupsWithoutWorkspace *bool    `json:"followups_without_workspace"`
	AddressWithoutWorkspace   *bool    `json:"address_without_workspace"`
}

ProjectGitHub are the GitHub settings a project overrides; nil keeps the top-level value.

type ProjectSettings added in v0.2.0

type ProjectSettings struct {
	When string `json:"when"`
}

ProjectSettings says where an intent's sessions load the checkout's own agent settings: When is a predicate over its pull request's facts; where it does not hold, they start without them.

type Scope

type Scope struct {
	People []string `json:"people"`
	Teams  []string `json:"teams"`
	Repos  []string `json:"repos"`
	Watch  []string `json:"watch"`
}

type SinkConfig

type SinkConfig struct {
	// Columns maps a semantic status (working, working-fallback, needs-me, reviewed, ready, in-progress, in-review, completed) to the sink's column.
	Columns map[string]string `json:"columns"`
}

SinkConfig is one view sink's own settings.

type Slack

type Slack struct {
	Plugin
	// ClientID is the Slack app's client id; empty leaves Slack unconfigured.
	ClientID     string `json:"client_id"`
	RedirectPort int    `json:"redirect_port"`
	// KeychainService names the Keychain items; empty is brand.StateDir()+"-slack".
	KeychainService string `json:"keychain_service"`
	// PostAllowlist, when not empty, holds the only channel ids, or user ids naming
	// the DM with that user, a post may go to.
	PostAllowlist []string `json:"post_allowlist"`
	// RequestLog logs one line per Slack call: method and HTTP status.
	RequestLog bool            `json:"request_log"`
	Ingest     SlackIngest     `json:"ingest"`
	Extraction SlackExtraction `json:"extraction"`
	Turns      SlackTurns      `json:"turns"`
	// EndedAfter is how long a unit stays quiet before it has ended; zero is DefaultSlackEndedAfter.
	EndedAfter Days        `json:"ended_after,omitempty"`
	Gates      PluginGates `json:"gates"`
}

Slack holds the Slack source's settings; no secret lives here.

func (Slack) Configured

func (s Slack) Configured() bool

func (Slack) EndedAfterFor added in v0.3.0

func (s Slack) EndedAfterFor() time.Duration

EndedAfterFor is how long a Slack unit stays quiet before it has ended.

func (Slack) Port

func (s Slack) Port() int

func (Slack) Service

func (s Slack) Service() string

type SlackExtraction

type SlackExtraction struct {
	// Enabled nil is on.
	Enabled *bool `json:"enabled,omitempty"`
	// Tier is fast, balanced or frontier; empty is fast.
	Tier       string  `json:"tier,omitempty"`
	Language   string  `json:"language,omitempty"`
	PerCallUSD float64 `json:"per_call_usd,omitempty"`
	PerDayUSD  float64 `json:"per_day_usd,omitempty"`
	PerDay     int     `json:"per_day,omitempty"`
	// Quiet is how long a unit stays unchanged before it runs; MaxWait bounds the delay of its oldest change.
	Quiet       Days `json:"quiet,omitempty"`
	MaxWait     Days `json:"max_wait,omitempty"`
	WindowChars int  `json:"window_chars,omitempty"`
	// MaxFailures failed calls in a row make the job give up on a unit until its next change.
	MaxFailures int `json:"max_failures,omitempty"`
	// ContextMessages and ContextChars bound the read-only messages shown before a DM's window; -1 turns either off.
	ContextMessages int `json:"context_messages,omitempty"`
	ContextChars    int `json:"context_chars,omitempty"`
	// EscalateOverChars sends a unit whose rendered conversation is longer to the frontier tier; 0 or -1 is off.
	EscalateOverChars int `json:"escalate_over_chars,omitempty"`
}

SlackExtraction sets the extraction job; a zero value keeps its default.

func (SlackExtraction) ContextBudget

func (e SlackExtraction) ContextBudget() int

func (SlackExtraction) ContextN

func (e SlackExtraction) ContextN() int

func (SlackExtraction) EscalateOver

func (e SlackExtraction) EscalateOver() int

func (SlackExtraction) GiveUpAfter

func (e SlackExtraction) GiveUpAfter() int

func (SlackExtraction) LanguageName

func (e SlackExtraction) LanguageName() string

func (SlackExtraction) MaxCallUSD

func (e SlackExtraction) MaxCallUSD() float64

func (SlackExtraction) MaxDayCalls

func (e SlackExtraction) MaxDayCalls() int

func (SlackExtraction) MaxDayUSD

func (e SlackExtraction) MaxDayUSD() float64

func (SlackExtraction) MaxWaitFor

func (e SlackExtraction) MaxWaitFor() time.Duration

func (SlackExtraction) On

func (e SlackExtraction) On() bool

func (SlackExtraction) QuietFor

func (e SlackExtraction) QuietFor() time.Duration

func (SlackExtraction) TierName

func (e SlackExtraction) TierName() string

func (SlackExtraction) Window

func (e SlackExtraction) Window() int

type SlackIngest

type SlackIngest struct {
	// Terms admit a message that holds one of them as a word, in any case.
	Terms []string `json:"terms"`
	// AllowApps and DenyApps hold bot ids (B...) or app ids (A...).
	AllowApps []string `json:"allow_apps"`
	DenyApps  []string `json:"deny_apps"`
	// Socket nil is on.
	Socket *bool `json:"socket"`
	// Since is the first start's backfill date, YYYY-MM-DD; empty is 7 days back.
	Since string `json:"since"`
}

SlackIngest is what the Slack source admits and how it listens.

func (SlackIngest) SocketOn

func (i SlackIngest) SocketOn() bool

type SlackTurns

type SlackTurns struct {
	// MaxChars bounds the unit's messages rendered into the instructions; zero is 30000, and less than MinSlackTurnChars reads as it.
	MaxChars int `json:"max_chars,omitempty"`
}

SlackTurns sets what a turn on a Slack unit reads.

func (SlackTurns) Chars

func (t SlackTurns) Chars() int

type Stalled

type Stalled struct {
	Review Days `json:"review"`
	Reply  Days `json:"reply"`
	Merge  Days `json:"merge"`
}

type Sweep

type Sweep struct {
	Fast Days `json:"fast"`
	Slow Days `json:"slow"`
}

type Tasks added in v0.3.0

type Tasks struct {
	StaleWaitingDays int      `json:"stale_waiting_days"` // working days
	Areas            []string `json:"areas"`
	Contexts         []string `json:"contexts"`
}

Tasks holds the tasks' settings: when a waiting task goes stale, and the areas and contexts offered.

type Turns added in v0.2.0

type Turns struct {
	PerDay        int `json:"per_day"`
	PerUnitPerDay int `json:"per_unit_per_day"`
}

Turns caps the automated turns. PerUnitPerDay stops a runaway loop on one unit whose plugin keeps a per-unit count (GitHub's pull requests), counted per local day; PerDay caps the automated turns on every other unit, all workflows together.

type UnknownKeysError

type UnknownKeysError struct {
	File string
	Keys []string // paths such as "sweep.fsat" or "projects[0].agent_hom"
	// Near are the grammar's guesses, by key: "sweep.fsat" did you mean "fast".
	Near map[string]string
}

UnknownKeysError names the keys of a config file that no setting reads.

func (*UnknownKeysError) Error

func (e *UnknownKeysError) Error() string

type WorkflowConfig

type WorkflowConfig struct {
	Enabled *bool `json:"enabled,omitempty"`
	// Observe plans the workflow's items pending, for a person to run.
	Observe *bool `json:"observe,omitempty"`
	// OnlyWhen is a predicate over the workflow's facts that must hold
	// besides its manifest's when; "" adds none.
	OnlyWhen string         `json:"only_when,omitempty"`
	Gates    *WorkflowGates `json:"gates,omitempty"`
}

WorkflowConfig overlays a workflow's manifest; a field left out keeps the manifest's.

func (WorkflowConfig) GateApproval added in v0.3.0

func (w WorkflowConfig) GateApproval() *ApprovalConfig

GateApproval is the workflow's gates.approval, nil when unset.

type WorkflowGates added in v0.3.0

type WorkflowGates struct {
	Approval *ApprovalConfig `json:"approval,omitempty"`
}

WorkflowGates holds the approval of the gates a workflow opens.

Jump to

Keyboard shortcuts

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