Files
supermarket/internal/web/templates/agents.html
T
davidandClaude Opus 5.5 6bf0517163 Phase 11, part 4: agents' limits, recent calls and a pause switch
Each agent has calls a minute and things it may ask to send out a day,
checked on every tool call and every request to send; every call is
recorded (tool, outcome, time) and the agent's page lists the last 50 and
what it's waiting on. Pause refuses all its calls at once. Also fixes each
agent's MCP server being shared with others that had the same scopes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 11:09:18 -07:00

34 lines
2.0 KiB
HTML

{{define "content"}}{{template "settings-start" .}}{{with .Data}}{{$d := .}}
<h2>Agents</h2>
<p class="lede">Programs that use Supermarket over MCP, each with its own key, given modules to read, or to read and act on. Agents reach <code>{{.MCPURL}}</code> with <code>Authorization: Bearer &lt;key&gt;</code>.</p>
{{if .Rows}}
<section class="card">
<table class="list">
<thead><tr><th>Agent</th><th>May</th><th>Keys</th><th>Last used</th></tr></thead>
<tbody>
{{range .Rows}}<tr>
<td><a href="/settings/agents/{{.ID}}">{{.Name}}</a>{{if .BuiltIn}} <span class="pill">built in</span>{{end}}{{if eq .Status "disabled"}} <span class="pill">turned off</span>{{end}}{{if not .Limits.Paused.IsZero}} <span class="pill warn">paused</span>{{end}}{{with .Description}}<br><span class="muted small">{{truncate 120 .}}</span>{{end}}</td>
<td>{{.Access}}</td>
<td>{{if .Working}}{{.Working}} working{{else}}<span class="warn-text">none working</span>{{end}}</td>
<td>{{with .Last}}{{ago .Used}}{{with .UsedFrom}} <span class="muted small">from {{.}}</span>{{end}}{{else}}<span class="muted">never</span>{{end}}</td>
</tr>{{end}}
</tbody>
</table>
</section>
{{end}}
<form class="card" method="post" action="/settings/agents" id="new">
<h2>New agent</h2>
{{with .Problem}}<p class="error" role="alert">{{.}}</p>{{end}}
<div class="cols">
<label>Name <input name="name" value="{{.Form.Name}}" required placeholder="e.g. Morning writer"></label>
<label>Key expires <span class="muted">(optional)</span> <input type="date" name="expires" value="{{.Form.Expires}}"></label>
</div>
<label>What it's for <textarea name="description" rows="2" placeholder="e.g. Drafts posts from What to write next, every morning">{{.Form.Description}}</textarea></label>
{{template "agent-scopes" (dict "Scopes" .Form.Scopes "Grants" .Grants)}}
<p class="help">Its key is shown once, after this. Only a hash of it is kept.</p>
<button type="submit">Create the agent</button>
</form>
{{end}}{{template "settings-end"}}{{end}}