{{define "content"}}{{template "settings-start" .}}{{with .Data}}{{$d := .}}{{$a := .Row}}

← Agents

{{$a.Name}}{{if $a.BuiltIn}} built in{{end}}{{if eq $a.Status "disabled"}} turned off{{end}}{{if not $a.Limits.Paused.IsZero}} paused{{end}}

{{with .Problem}}{{end}}
{{if $a.Limits.Paused.IsZero}}
Stops all its calls at once, whatever key it uses, until it's resumed.
{{else}}
Paused {{ago $a.Limits.Paused}}{{with by $a.Limits.PausedBy}} {{.}}{{end}}: every call it makes is refused.
{{end}}

In the last 24 hours it asked to send out {{.SentDay}} of its {{$a.Limits.OutPerDay}}: posts, emails, mailing-list adds and changes to the sites, approved or not.

{{if .Waiting}}

Waiting on

{{end}}

Recent calls

{{if .Calls}} {{range .Calls}}{{end}}
WhenToolResultTook
{{ago .At}} {{.Tool}} {{if eq .Outcome "ok"}}{{truncate 100 .Detail}}{{else if eq .Outcome "refused"}}refused {{.Detail}}{{else}}{{truncate 160 .Detail}}{{end}} {{.Took.Milliseconds}} ms

The last 50; kept for 30 days.

{{else}}

No calls yet.

{{end}}
{{template "agent-scopes" (dict "Scopes" $a.Modules "Grants" .Grants)}}

Keys

{{range $a.Keys}}{{else}}{{end}}
KeyMadeExpiresLast used
{{.Prefix}}… {{if not .Revoked.IsZero}} revoked {{ago .Revoked}} {{else if not (.Working $d.Now)}} stopped {{else if not .Retires.IsZero}} replaced: works until {{.Retires.Local.Format "2 Jan 15:04"}} {{else}} working{{end}} {{.Created.Local.Format "2 Jan 2006"}} {{if .Expires.IsZero}}never{{else}}{{.Expires.Local.Format "2 Jan 2006"}}{{end}} {{if .Used.IsZero}}never{{else}}{{ago .Used}}{{with .UsedFrom}} from {{.}}{{end}}{{end}} {{if .Working $d.Now}}
{{end}}
No keys.

Rotate makes a new key; the old one keeps working for a day, so whatever uses it can be switched over. After a leak, revoke it instead: it stops at once.

On its own

{{if .Allowed}}

What {{$a.Name}} may do without asking, approved on the Approvals page. Everything else it asks for waits there for a person.

{{range .Allowed}}{{end}}
{{.Label}}{{if .DailyCap}}up to {{.DailyCap}} a day{{else}}no cap{{end}}{{ago .Granted}}{{with by .GrantedBy}} {{.}}{{end}}
{{else}}

Nothing: everything it asks to send out (posts, emails, mailing-list adds, changes to the sites) waits on Approvals for a person.

{{end}} {{if .Asked}}

Lately

{{end}}
{{if eq $a.Status "disabled"}}
{{else}}
{{end}} {{if not $a.BuiltIn}}
{{end}}

Turned off, none of its keys work, until it's turned back on.

{{end}}{{template "settings-end"}}{{end}}