swarm-ui: an editor for an agent's AGENTS.md that saves as a diff
The instructions row of the agent detail panel gets an edit button that opens the agent's AGENTS.md, as the harness last published it, in a text box. Save sends a unified diff against the revision that was loaded; when the agent changed the file meanwhile the editor keeps the operator's text, shows the agent's version and offers to save over it or take it. An unsaved edit survives closing the dialog. The diff is built in the browser (LCS over lines, three lines of context, git's no-newline marker) and was checked against git apply on 600 random before/after pairs.
This commit is contained in:
parent
bff13c8c68
commit
b5d2e310ba
1 changed files with 664 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ import { Badge } from "@hive/shared/badge.js";
|
|||
import { RelativeTime } from "../../ui/relative-time/RelativeTime.js";
|
||||
import type { AgentActions } from "../roster/AgentActions.js";
|
||||
import { AgentInference } from "./AgentInference.js";
|
||||
import { AgentInstructions } from "./AgentInstructions.js";
|
||||
import { AgentLimits } from "./AgentLimits.js";
|
||||
import { AgentTermPreview } from "../terminal/AgentTermPreview.js";
|
||||
import { FRESHNESS, type AgentRow } from "../AgentTypes.js";
|
||||
|
|
@ -103,6 +104,10 @@ export function AgentDetail({
|
|||
<dd>
|
||||
<AgentInference key={row.name} agent={row.name} />
|
||||
</dd>
|
||||
<dt>instructions</dt>
|
||||
<dd>
|
||||
<AgentInstructions key={row.name} agent={row.name} />
|
||||
</dd>
|
||||
<dt>resource caps</dt>
|
||||
<dd>
|
||||
<AgentLimits key={row.name} agent={row.name} />
|
||||
|
|
|
|||
Loading…
Reference in a new issue