Phase 11, part 1: agents and their keys
Agents are users of kind agent, each given modules to read, or to read and act on, and the CRM scope. Admins make them under Settings → Agents, on every edition; keys (sm_…) are shown once and kept as hashes, can expire, be rotated (the old one works a day) or revoked, and record their last use. /mcp takes agent keys and offers each agent only the tools its scopes allow. On the local edition, mcp-token is the key of a built-in Hermes agent with the CRM and the Market. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
{{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 <key></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}}{{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}}
|
||||
Reference in New Issue
Block a user