From 5cdf51fcfcb41daf1cc866a884aebb9ee10da4bf Mon Sep 17 00:00:00 2001 From: iris Date: Wed, 11 Nov 2026 02:18:13 +0100 Subject: [PATCH] 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. --- docs/2-handbook/swarm/archetypes.md | 3 +++ nix/archetypes/default.nix | 22 ++++++++++++++++------ nix/archetypes/icons/android-dev.svg | 17 +++++++++++++++++ nix/archetypes/icons/reverse-engineer.svg | 22 ++++++++++++++++++++++ nix/archetypes/icons/reviewer.svg | 14 ++++++++++++++ nix/module-eval/builder.nix | 11 ++++++++--- 6 files changed, 80 insertions(+), 9 deletions(-) create mode 100644 nix/archetypes/icons/android-dev.svg create mode 100644 nix/archetypes/icons/reverse-engineer.svg create mode 100644 nix/archetypes/icons/reviewer.svg diff --git a/docs/2-handbook/swarm/archetypes.md b/docs/2-handbook/swarm/archetypes.md index 1df0c479b..6b6b845f1 100644 --- a/docs/2-handbook/swarm/archetypes.md +++ b/docs/2-handbook/swarm/archetypes.md @@ -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: diff --git a/nix/archetypes/default.nix b/nix/archetypes/default.nix index 28ed513cc..4bdd250b7 100644 --- a/nix/archetypes/default.nix +++ b/nix/archetypes/default.nix @@ -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."; }; diff --git a/nix/archetypes/icons/android-dev.svg b/nix/archetypes/icons/android-dev.svg new file mode 100644 index 000000000..91e05d8b1 --- /dev/null +++ b/nix/archetypes/icons/android-dev.svg @@ -0,0 +1,17 @@ + + android-dev + Android developer archetype icon: a robot head with antennae, amber on dark + + + + + + + + + + + + + + diff --git a/nix/archetypes/icons/reverse-engineer.svg b/nix/archetypes/icons/reverse-engineer.svg new file mode 100644 index 000000000..bf4b46e3f --- /dev/null +++ b/nix/archetypes/icons/reverse-engineer.svg @@ -0,0 +1,22 @@ + + reverse-engineer + Reverse engineer archetype icon: a gear opened to show angle brackets, amber on dark + + + + + + + + + + + + + + + + + + + diff --git a/nix/archetypes/icons/reviewer.svg b/nix/archetypes/icons/reviewer.svg new file mode 100644 index 000000000..34b2dbb37 --- /dev/null +++ b/nix/archetypes/icons/reviewer.svg @@ -0,0 +1,14 @@ + + reviewer + Reviewer archetype icon: a magnifying glass over a check mark, amber on dark + + + + + + + + + + + diff --git a/nix/module-eval/builder.nix b/nix/module-eval/builder.nix index 2d3dd02b8..c1495a150 100644 --- a/nix/module-eval/builder.nix +++ b/nix/module-eval/builder.nix @@ -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