Documentation
¶
Overview ¶
Package config loads the user's settings and locates the state directory.
Index ¶
- Constants
- Variables
- func DaemonSocket() string
- func Dir() string
- func ExpandHome(p string) string
- func Home() string
- func Key(path ...string) string
- func KeyOf(field string) string
- func ParseKey(s string) ([]string, error)
- func ParseValue(s string) any
- func Path() string
- func PluginPath(field string) []string
- func ProfilesDir() string
- func ResolveProfile(v string) string
- func StateDir() string
- type ApprovalConfig
- type ApprovalRuleConfig
- type Brief
- type Classify
- type Cleanup
- type Config
- func (c Config) AgentHomes() []string
- func (c Config) Column(sink, status string) string
- func (c Config) For(owner, repo string) Config
- func (c Config) GateApprovalWarnings() []string
- func (c Config) PlacementMap() placement.Map
- func (c Config) PluginDraftApproval(id string) (draft.Approval, bool)
- func (c Config) PluginEnabled(id string) bool
- func (c Config) PluginSwitches() []string
- func (c Config) PluginTable(id string) json.RawMessage
- func (c Config) PluginTrust(id string) string
- func (c Config) ProjectSettingsFor(intent string, facts expr.Facts) bool
- func (c Config) TrustsClones(owner, repo string) bool
- func (c Config) WithColumns(defaults map[string]map[string]string) Config
- type Days
- type Doc
- type Dossiers
- type Drafts
- type Edited
- type FileEdit
- type GitHub
- type HTTP
- type Headless
- type Holder
- type HolderOptions
- type IntentConfig
- type Items
- type ItemsHeat
- type LegacyFileError
- type MCP
- type Notifications
- type Nudge
- type PlacementRule
- type Plugin
- type PluginApproval
- type PluginGates
- type Plugins
- type Project
- type ProjectGitHub
- type ProjectSettings
- type Scope
- type SinkConfig
- type Slack
- type SlackExtraction
- func (e SlackExtraction) ContextBudget() int
- func (e SlackExtraction) ContextN() int
- func (e SlackExtraction) EscalateOver() int
- func (e SlackExtraction) GiveUpAfter() int
- func (e SlackExtraction) LanguageName() string
- func (e SlackExtraction) MaxCallUSD() float64
- func (e SlackExtraction) MaxDayCalls() int
- func (e SlackExtraction) MaxDayUSD() float64
- func (e SlackExtraction) MaxWaitFor() time.Duration
- func (e SlackExtraction) On() bool
- func (e SlackExtraction) QuietFor() time.Duration
- func (e SlackExtraction) TierName() string
- func (e SlackExtraction) Window() int
- type SlackIngest
- type SlackTurns
- type Stalled
- type Sweep
- type Tasks
- type Turns
- type UI
- type UnknownKeysError
- type Warning
- type Window
- type WorkflowConfig
- type WorkflowGates
Constants ¶
const ( ColumnWorking = "working" ColumnWorkingFallback = "working-fallback" ColumnNeedsMe = "needs-me" ColumnReviewed = "reviewed" ColumnReady = "ready" ColumnInProgress = "in-progress" ColumnInReview = "in-review" ColumnCompleted = "completed" )
const ( WarningBroken = "config.toml does not load, so the running config stays: {error}" WarningStale = "config.toml changed; only these settings apply live: {keys}. Restart the daemon to apply the rest" )
The keys of the config warnings, which strings.toml words.
const DefaultMCPPort = 47800
const DefaultPRDailyCap = 5
const DefaultSlackEndedAfter = 7 * 24 * time.Hour
DefaultSlackEndedAfter is plugins.slack.ended_after's default.
const DefaultSlackRedirectPort = 53682
DefaultSlackRedirectPort is the login callback port registered in the Slack app.
const MinSlackTurnChars = 2000
MinSlackTurnChars is the smallest cap Chars returns, which holds a parent and a reply.
const StatEvery = 2 * time.Second
StatEvery is how often a Holder looks at the config file.
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 ¶
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 ExpandHome ¶
func ParseKey ¶ added in v0.4.0
ParseKey is s, a dotted TOML key such as workflows."a.b".enabled, as its parts.
func ParseValue ¶ added in v0.4.0
ParseValue is s as a TOML value, or s itself when it is not one or is a date or a time, which the config only reads as strings.
func PluginPath ¶ added in v0.3.0
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 ¶
ResolveProfile turns a profile setting into a directory: a bare name lives under ProfilesDir, anything else is a path.
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 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 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"`
// OrphanHold is how long the close of a dormant session waits on its
// process lingering orphaned, the app attached throughout, before it
// closes the record anyway; it ends no process.
OrphanHold Days `json:"orphan_hold"`
// 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"`
Window Window `json:"window"`
Dossiers Dossiers `json:"dossiers"`
Drafts Drafts `json:"drafts"`
Items Items `json:"items"`
Headless Headless `json:"headless"`
Turns Turns `json:"turns"`
UI UI `json:"ui"`
}
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 LoadBytes ¶ added in v0.4.0
LoadBytes is LoadFile of raw, the contents file would hold, without reading file.
func (Config) AgentHomes ¶
AgentHomes lists every agent home the settings name.
func (Config) GateApprovalWarnings ¶ added in v0.3.0
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 ¶
PlacementMap is c's placement rules as the placement service reads them.
func (Config) PluginDraftApproval ¶ added in v0.2.0
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 ¶
PluginEnabled says whether the plugin id is on: [plugins.<id>] enabled, on when unset.
func (Config) PluginSwitches ¶ added in v0.2.0
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
PluginTrust is [plugins.<id>] trust, "" when unset.
func (Config) ProjectSettingsFor ¶
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
TrustsClones says whether the project of owner/repo, the first that matches, trusts the repository when the loop clones it.
type Days ¶
Days is a duration written as duration.Parse reads it: "2d", "36h", "90m".
func (Days) MarshalJSON ¶
func (*Days) UnmarshalJSON ¶
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 (*Doc) Set ¶ added in v0.3.0
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.
func (*Doc) Unset ¶ added in v0.4.0
Unset removes the key at path with the rest of its line, or the table at path with its keys, the comments right above it and its sub-tables; a document without it is left as written. A table the removal leaves with no key, comment or sub-table goes too. A key written in an inline table, and a path in or over an array of tables, 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 Edited ¶ added in v0.4.0
type Edited struct {
// Doc is the edited document.
Doc *Doc
// Changed says the file was written.
Changed bool
// Backup is where the previous file was kept; "" when there was none.
Backup string
// Still is why the written file does not load, when the file did not load before the edit either and the
// edit removed Path.
Still error
}
Edited is what EditFile did.
func EditFile ¶ added in v0.4.0
EditFile edits the config file at file: it applies e.Edit, refuses a result that does not load (unless the file did not load before and the edit removed the key), keeps the previous file through e.Backup and writes the result through e.Write. A missing file reads as empty and is not backed up. EditFile takes no lock: its caller serializes its own edits, and an edit by another process in between is lost to the later write.
type FileEdit ¶ added in v0.4.0
type FileEdit struct {
// Path is the key the edit changes.
Path []string
// Edit changes the document at Path.
Edit func(d *Doc, path []string) error
// Load says why a file's bytes do not load; nil checks nothing.
Load func(raw []byte) error
// Backup keeps the file's previous bytes, naming where.
Backup func(raw []byte) (string, error)
// Write replaces the file with raw.
Write func(raw []byte) error
}
FileEdit is one edit of a config file.
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 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 live keys follow 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 ¶
Break records that no config has loaded yet, so Err answers err until Rebase.
func (*Holder) Config ¶
Config is the config the serve runs with, its live keys as the file now sets them.
func (*Holder) Reload ¶ added in v0.4.0
func (h *Holder) Reload()
Reload reads the file now, whatever the stat interval, as a change the serve just made to it asks.
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.
type Notifications ¶
type Notifications struct {
DigestAt string `json:"digest_at"`
}
Notifications: DigestAt is the local "HH:MM" of the daily digest, "" for none.
type PlacementRule ¶
type PlacementRule struct {
Match string `json:"match"`
Repo string `json:"repo,omitempty"`
Checkout string `json:"checkout,omitempty"`
Role string `json:"role,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
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.
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 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 (Slack) EndedAfterFor ¶ added in v0.3.0
EndedAfterFor is how long a Slack unit stays quiet before it has ended.
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 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"`
CandidateWindow Days `json:"candidate_window"`
CandidateCap int `json:"candidate_cap"`
}
Tasks holds the tasks' settings: when a waiting task goes stale, the areas and contexts offered, and how far task.candidates looks.
type Turns ¶ added in v0.2.0
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 UI ¶ added in v0.4.0
type UI struct {
// Locale is the interface language, a BCP 47 tag such as pt-BR; "" follows the system's preferred
// languages.
Locale string `json:"locale"`
}
UI holds the interface's settings.
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 Warning ¶ added in v0.4.0
Warning is what a restart or a fix of config.toml would change, as a key of the client strings (strings.toml) and its {name} params; Key is "" when there is nothing to say.
type Window ¶ added in v0.4.0
Window: Enabled shows the cockpit in the app's own window on macOS instead of the browser; Hotkey is the global shortcut that opens the omnibox panel, "" for none.
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.