an archetype's prompt prefills the new agent's agents.md in the create form
This commit is contained in:
parent
2acde41e54
commit
a5470d82ae
1 changed files with 179 additions and 12 deletions
|
|
@ -63,7 +63,11 @@ import {
|
|||
requestArchetype,
|
||||
type ArchetypeList,
|
||||
} from "./CreateAgentArchetype.js";
|
||||
import { agentsMdBody, agentsMdRefusal } from "./CreateAgentAgentsMd.js";
|
||||
import {
|
||||
agentsMdAfterPick,
|
||||
agentsMdBody,
|
||||
agentsMdRefusal,
|
||||
} from "./CreateAgentAgentsMd.js";
|
||||
import {
|
||||
NAME_PATTERN,
|
||||
nextStep,
|
||||
|
|
@ -191,13 +195,14 @@ export function CreateAgentForm({
|
|||
})().catch((e: unknown) => setArchetypesError({ detail: String(e) }));
|
||||
}, []);
|
||||
|
||||
// Fills permissions, caps and inference from the picked archetype; each
|
||||
// stays editable, and the request carries only those fields.
|
||||
// Fills permissions, caps, inference and the AGENTS.md text from the picked
|
||||
// archetype; each stays editable, and the request carries only those fields.
|
||||
function pickArchetype(key: string) {
|
||||
setArchetype(key);
|
||||
const p = prefill(
|
||||
archetypes?.archetypes.find((a) => archetypeKey(a) === key),
|
||||
catalogue?.default ?? [],
|
||||
const next = archetypes?.archetypes.find((a) => archetypeKey(a) === key);
|
||||
const p = prefill(next, catalogue?.default ?? []);
|
||||
setAgentsMd((current) =>
|
||||
agentsMdAfterPick(current, picked?.prompt ?? "", next?.prompt ?? ""),
|
||||
);
|
||||
setSelected(p.permissions);
|
||||
setCpu(p.cpu);
|
||||
|
|
@ -401,7 +406,8 @@ export function CreateAgentForm({
|
|||
<div class="create-agent-fields">
|
||||
<p class="create-agent-intro">
|
||||
The text the agent's AGENTS.md starts with. Optional: leave it
|
||||
empty and the agent starts without the file.
|
||||
empty and the agent starts without the file. An archetype with a
|
||||
prompt fills the box in; edit it freely.
|
||||
</p>
|
||||
<TextAreaField
|
||||
id="agent-agents-md"
|
||||
|
|
|
|||
Loading…
Reference in a new issue