Watch
0
0
Fork
You've already forked hyperhive
0

archetypes: each built-in archetype ships an icon

reviewer, android-dev and reverse-engineer set services.hyperhive.agent.icon, with
lib.mkDefault, to an SVG under nix/archetypes/icons, so an agent built from one
shows an icon in the swarm UI until its config sets another. The archetype
module-eval check requires an svg icon on each.
This commit is contained in:
iris 2026-11-11 02:18:13 +01:00 • committed by mara
commit 5cdf51fcfc
6 changed files with 80 additions and 9 deletions

View file

@ -23,6 +23,9 @@ The hyperhive flake ships these:
| `android-dev` | installs `android-tools` (`adb`, `fastboot`), Gradle and a JDK; default permissions. |
| `reverse-engineer` | sets `services.hyperhive.agent.rea.enable`: installs REA, Ghidra 12.1 and procps, and allows all REA MCP tools; default permissions and the agent's normal memory cap. |
Each built-in archetype also sets `services.hyperhive.agent.icon`, so its agents
show an icon in the swarm UI until their config sets another.
## Where an archetype comes from
A flake declares archetypes in its `hyperhiveArchetypes` output:

View file

@ -5,10 +5,16 @@
# `meta` fields: `description` (required), `permissions`, `limits`,
# `inference`, in the shapes `POST /api/agents` takes them, and `prompt`, the
# text the create form prefills the new agent's AGENTS.md with; see
# docs/2-handbook/swarm/archetypes.md.
# 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.
{
reviewer = {
module = { };
module =
{ lib, ... }:
{
services.hyperhive.agent.icon = lib.mkDefault ./icons/reviewer.svg;
};
meta = {
description = "Reviews pull requests and replies. It can run hive-forge and git (execution), and holds messaging and inbox; it has no get_agent_meta (meta).";
permissions = [
@ -20,8 +26,9 @@
};
android-dev = {
module =
{ pkgs, ... }:
{ pkgs, lib, ... }:
{
services.hyperhive.agent.icon = lib.mkDefault ./icons/android-dev.svg;
environment.systemPackages = [
pkgs.android-tools
pkgs.gradle
@ -33,9 +40,12 @@
};
};
reverse-engineer = {
module = {
services.hyperhive.agent.rea.enable = true;
};
module =
{ lib, ... }:
{
services.hyperhive.agent.icon = lib.mkDefault ./icons/reverse-engineer.svg;
services.hyperhive.agent.rea.enable = true;
};
meta = {
description = "Reverse-engineers binaries and applications: REA and Ghidra 12.1 are installed with their MCP tools allowed. It holds the default permissions.";
};

View file

@ -0,0 +1,17 @@
<svg width="300" height="300" viewBox="0 0 300 300" role="img" xmlns="http://www.w3.org/2000/svg">
<title>android-dev</title>
<desc>Android developer archetype icon: a robot head with antennae, 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"/>
<path d="M86 184 A64 64 0 0 1 214 184 Z" fill="#ffb300"/>
<circle cx="124" cy="160" r="7" fill="#0a0600"/>
<circle cx="176" cy="160" r="7" fill="#0a0600"/>
<line x1="106" y1="102" x2="124" y2="130" stroke="#ffb300" stroke-width="8" stroke-linecap="round"/>
<line x1="194" y1="102" x2="176" y2="130" stroke="#ffb300" stroke-width="8" stroke-linecap="round"/>
<rect x="86" y="196" width="128" height="16" rx="8" fill="none" stroke="#ffb300" stroke-width="6"/>
</g>
<circle cx="150" cy="150" r="140" fill="none" stroke="#ffb300" stroke-width="3" opacity="0.6"/>
</svg>

After

Width:  |  Height:  |  Size: 984 B

View file

@ -0,0 +1,22 @@
<svg width="300" height="300" viewBox="0 0 300 300" role="img" xmlns="http://www.w3.org/2000/svg">
<title>reverse-engineer</title>
<desc>Reverse engineer archetype icon: a gear opened to show angle brackets, 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"/>
<g fill="none" stroke="#ffb300" stroke-width="12" stroke-linejoin="round">
<circle cx="150" cy="150" r="66"/>
<g stroke-linecap="round">
<line x1="150" y1="60" x2="150" y2="78"/><line x1="150" y1="222" x2="150" y2="240"/>
<line x1="60" y1="150" x2="78" y2="150"/><line x1="222" y1="150" x2="240" y2="150"/>
<line x1="86" y1="86" x2="99" y2="99"/><line x1="201" y1="201" x2="214" y2="214"/>
<line x1="214" y1="86" x2="201" y2="99"/><line x1="99" y1="201" x2="86" y2="214"/>
</g>
<polyline points="136,128 114,150 136,172" stroke-linecap="round"/>
<polyline points="164,128 186,150 164,172" stroke-linecap="round"/>
</g>
</g>
<circle cx="150" cy="150" r="140" fill="none" stroke="#ffb300" stroke-width="3" opacity="0.6"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -0,0 +1,14 @@
<svg width="300" height="300" viewBox="0 0 300 300" role="img" xmlns="http://www.w3.org/2000/svg">
<title>reviewer</title>
<desc>Reviewer archetype icon: a magnifying glass over a check mark, 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"/>
<circle cx="132" cy="132" r="62" fill="none" stroke="#ffb300" stroke-width="12"/>
<line x1="178" y1="178" x2="236" y2="236" stroke="#ffb300" stroke-width="18" stroke-linecap="round"/>
<polyline points="104,134 124,156 162,108" fill="none" stroke="#ffb300" stroke-width="12" stroke-linecap="round" 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: 835 B

View file

@ -291,7 +291,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";
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";
ok =
let
plain =
@ -316,8 +316,13 @@ let
&& !(lib.elem "meta" reviewer)
&&
lib.elem pkgs.android-tools
(archetypes.android-dev.module { inherit pkgs; }).environment.systemPackages
&& archetypes.reverse-engineer.module.services.hyperhive.agent.rea.enable;
(archetypes.android-dev.module { inherit pkgs lib; }).environment.systemPackages
&& (archetypes.reverse-engineer.module { inherit lib; }).services.hyperhive.agent.rea.enable
&& lib.all (icon: lib.hasSuffix ".svg" (toString icon.content)) [
(archetypes.reviewer.module { inherit lib; }).services.hyperhive.agent.icon
(archetypes.android-dev.module { inherit pkgs lib; }).services.hyperhive.agent.icon
(archetypes.reverse-engineer.module { inherit lib; }).services.hyperhive.agent.icon
];
}
{
# `docs.enable` reads `docs.source`, whose default builds from the