Watch
0
0
Fork
You've already forked hyperhive
0

add a default archetype, preselected by the clients

This commit is contained in:
atlas 2026-11-27 17:41:52 +01:00 • committed by mara
commit 8f7c45d40f
3 changed files with 253 additions and 47 deletions

View file

@ -7,9 +7,17 @@
# the create form shows beside the archetype, and `prompt`, the text the create
# form prefills the new agent's AGENTS.md with (the built-ins read theirs from
# ./prompts/<name>.md); see docs/2-handbook/swarm/archetypes.md. Every archetype
# sets `services.hyperhive.agent.icon` (with `mkDefault`) to an SVG in `icons/`,
# so its agents show one until their config sets another.
# but `default`, whose module is empty, sets `services.hyperhive.agent.icon`
# (with `mkDefault`) to an SVG in `icons/`, so its agents show one until their
# config sets another.
{
default = {
module = { };
meta = {
icon = builtins.readFile ./icons/default.svg;
description = "The default config, no config repo; turn it into a custom agent when you need one. It holds the default permissions.";
};
};
reviewer = {
module =
{ lib, ... }:

View file

@ -0,0 +1,12 @@
<svg width="300" height="300" viewBox="0 0 300 300" role="img" xmlns="http://www.w3.org/2000/svg">
<title>default</title>
<desc>Default archetype icon: an empty hive cell, a hexagon outline with nothing in it, amber on dark</desc>
<defs>
<clipPath id="clip"><circle cx="150" cy="150" r="140"/></clipPath>
</defs>
<g clip-path="url(#clip)">
<rect width="300" height="300" fill="#0a0600"/>
<polygon points="150,66 222.7,108 222.7,192 150,234 77.3,192 77.3,108" fill="none" stroke="#ffb300" stroke-width="12" stroke-linejoin="round"/>
</g>
<circle cx="150" cy="150" r="140" fill="none" stroke="#ffb300" stroke-width="3" opacity="0.6"/>
</svg>

After

Width:  |  Height:  |  Size: 666 B

View file

@ -299,7 +299,7 @@ let
# output and prints it as JSON. A derivation or a path in `meta` would
# make that evaluation build or copy something; a function would not
# print at all.
name = "the built-in archetypes carry a module and a meta of plain data, and reviewer can run commands and android-dev installs its toolchain and reverse-engineer turns rea on, and each sets an svg icon as a default, and each has a non-empty prompt under the 64 KiB cap, and ruth runs sonnet with manage_root_agent, logs and metrics, and triage runs haiku with three flows that send to members";
name = "the built-in archetypes carry a module and a meta of plain data, and reviewer can run commands and android-dev installs its toolchain and reverse-engineer turns rea on, and each but default sets an svg icon as a default, and each but default has a non-empty prompt under the 64 KiB cap, and default is an empty module with no prompt, permissions or inference and an svg icon in its meta, and ruth runs sonnet with manage_root_agent, logs and metrics, and triage runs haiku with three flows that send to members";
ok =
let
plain =
@ -319,8 +319,11 @@ let
lib.all (a: a ? module && a.meta.description != "") (lib.attrValues archetypes)
&& plain metas
&& lib.all (m: (m.prompt or "") != "" && builtins.stringLength m.prompt <= 65536) (
lib.attrValues metas
lib.attrValues (builtins.removeAttrs metas [ "default" ])
)
&& archetypes.default.module == { }
&& !(metas.default ? prompt || metas.default ? permissions || metas.default ? inference)
&& lib.hasPrefix "<svg" metas.default.icon
&& lib.elem "messaging" reviewer
&& lib.elem "inbox" reviewer
&& lib.elem "execution" reviewer