Agents pane: project-scoped runs with selection, roster cursor, editable settings

This commit is contained in:
Sam
2026-11-10 17:23:32 +11:00
parent b15216aa7b
commit ec7e907b2e
7 changed files with 634 additions and 39 deletions

View File

@@ -441,3 +441,20 @@ func (c *Client) WakeAgent(agentID string) error {
return c.do("POST", "/api/agents/"+agentID+"/wakeup",
map[string]any{"source": "on_demand", "triggerDetail": "manual", "forceFreshSession": false}, nil)
}
// UpdateAgent changes an agent's own record. Paperclip owns it, so this is a
// PATCH with only the fields that changed; a field left out is not touched.
func (c *Client) UpdateAgent(agentID string, body map[string]any) error {
if !c.UsingUserKey() {
return errors.New("refusing to write with the agent key: set PAPERCLIP_BOARD_KEY")
}
return c.do("PATCH", "/api/agents/"+agentID, body, nil)
}
// AgentRaw reads one agent's full record, including the configuration blocks,
// so an edit can change one field and leave the rest exactly as it was.
func (c *Client) AgentRaw(agentID string) (map[string]any, error) {
var out map[string]any
err := c.do("GET", "/api/agents/"+agentID, nil, &out)
return out, err
}