Commit graph

79 commits

Author SHA1 Message Date
iris
dd32774e86 weston-vnc: disable idle blank + lock screen (idle-time=0)
The VNC desktop faded to black after weston's default 300s idle
timeout, and on wake desktop-shell showed its click-to-unlock lock
screen (a green circle) — pointless for an agent desktop viewed
over /screen, and confusing for the operator (issue #180).

Add [core] idle-time=0 to the generated weston.ini. Verified against
weston 14.0.1: idle-time parses to compositor->idle_time, and
weston_compositor_wake arms the idle timer with idle_time*1000 ms;
0 ms makes wl_event_source_timer_update disarm the timer, so the
compositor never transitions to IDLE and desktop-shell never locks.

closes #180
2026-05-21 19:34:10 +02:00
damocles
00281730bb harness: sync agent icon to Forgejo user avatar on rebuild (closes #141) 2026-05-21 18:29:33 +02:00
damocles
468d682085 forge: use branding/hyperhive.svg for logo and favicon 2026-05-21 17:50:46 +02:00
damocles
615928453d forge: replace forgejo logo with hyperhive mark (closes #143) 2026-05-21 17:50:46 +02:00
damocles
72522be8c0 harness: add hyperhive.autoCompact option (default true, false=disable proactive compaction) 2026-05-21 17:41:53 +02:00
iris
39bd46b244 agent icon: add hyperhive.icon option + GET /icon endpoint
Foundation for the per-agent icon feature (#137).

- harness-base.nix: new hyperhive.icon option (nullable path to an
  SVG). An agent commits an SVG into its config repo and references
  it as ./icon.svg; when set it lands at /etc/hyperhive/icon.svg.
- web_ui.rs: GET /icon serves the configured SVG, falling back to the
  bundled hyperhive logo when none is set — so it always returns an
  image and consumers can hit it unconditionally.

Closes #139
2026-05-21 01:06:34 +02:00
damocles
a95ca22b49 hive-forge: single command with subverbs instead of per-verb scripts 2026-05-20 21:45:01 +02:00
damocles
0a4cde88b0 add hive-forge-tools: shell wrappers for common forge API operations 2026-05-20 21:45:01 +02:00
iris
ddd0248619 harness-base: fix python3 -c quoting inside nix string
Two consecutive single quotes ('') inside a Nix indented string (''...'')
are treated as the string-end delimiter, breaking nix evaluation.
Switch the shell -c argument from double-quotes to single-quotes so
the Python string literals use double-quotes instead, avoiding any ''
sequences in the Nix source.
2026-05-20 21:01:26 +02:00
damocles
3c6c257506 fix tea-login: write config.yml directly, always refresh token 2026-05-20 20:51:02 +02:00
iris
e50173f3e1 weston-vnc: fix PAM service name (weston-remote-access, not weston)
weston calls pam_start("weston-remote-access", ...) in libweston/auth.c.
The previous security.pam.services.weston entry created /etc/pam.d/weston
which was never consulted, so PAM fell back to the system default and
rejected all credentials. Renaming to weston-remote-access makes
pam_permit.so actually take effect.

Fixes #92
2026-05-20 20:28:32 +02:00
damocles
4bb3877460 add jq and curl to agent base packages 2026-05-20 20:14:26 +02:00
damocles
cc7d349139 fix: use --no-preserve=mode when copying forgejo static root 2026-05-20 20:09:00 +02:00
damocles
30c7274cc7 fix forge theme: bake css into static root via STATIC_ROOT_PATH 2026-05-20 20:02:06 +02:00
iris
fceab658f4 weston-vnc: add pam_permit.so for weston service to accept any Apple-DH credentials 2026-05-20 19:59:19 +02:00
iris
1b7d058d3c weston-vnc: restore auth-method=none ini so weston accepts empty Apple-DH credentials 2026-05-20 19:27:41 +02:00
iris
fd433d2406 weston-vnc: revert neatvnc overlay, use full TLS build with --disable-transport-layer-security 2026-05-20 19:12:40 +02:00
iris
3e5d430873 weston-vnc: fix neatvnc overlay to use -Dtls=disabled instead of removing gnutls 2026-05-20 18:02:36 +02:00
damocles
cddaacd12f feat: poll forge notifications in agent harness
Closes #27
2026-05-20 17:59:56 +02:00
iris
a4706d793e weston-vnc: build neatvnc without gnutls to disable RSA/DH auth types 2026-05-20 17:49:26 +02:00
iris
47279f110d weston-vnc: disable VNC auth to fix 'auth failed' in browser screen viewer 2026-05-20 16:58:56 +02:00
iris
e6469403ee fix forge theme: add forgejo-* to THEMES, use C+ copy for CSS 2026-05-20 16:22:02 +02:00
damocles
7b3bc3a744 docs: fix stale contextWindowTokens reference in hyperhive.model option 2026-05-20 15:52:13 +02:00
damocles
d3d52349c3 model/context: move context window config to host-level hive-c0re.nix 2026-05-20 15:49:03 +02:00
damocles
7e2f13cad8 model/context: defaults in nix module, no heuristic in rust 2026-05-20 15:49:03 +02:00
damocles
770cbaccf9 model/context: per-model ctx window overrides + expose window size in /api/state 2026-05-20 15:49:03 +02:00
damocles
9064cd3c57 model/context: configurable default model + model-derived context window 2026-05-20 15:49:03 +02:00
iris
67f948028c add catppuccin mocha × vibec0re theme to forge
- new nix/forge-theme/theme-catppuccin-vibec0re.css: full Catppuccin Mocha
  palette mapped to all Forgejo CSS custom properties + chroma syntax
  highlighting; vibec0re glow effects on primary buttons, nav, and links
- hive-forge.nix: ui.DEFAULT_THEME + ui.THEMES settings
- systemd.tmpfiles.rules symlinks the nix-managed CSS into
  /var/lib/forgejo/custom/public/assets/css/ before forgejo starts;
  container rebuild picks up CSS changes automatically

Closes #55
2026-05-20 15:42:32 +02:00
iris
29df223650 fix weston-vnc: use /etc/hostname instead of hostname binary, disable TLS
- Replace ${pkgs.coreutils}/bin/hostname with cat /etc/hostname:
  hostname binary is in pkgs.inetutils, not pkgs.coreutils; /etc/hostname
  is always present in NixOS containers and is simpler.
- Add --disable-transport-layer-security: weston VNC requires TLS certs
  by default; since VNC is loopback-only (relayed by the harness WS proxy)
  TLS adds no security benefit and cert generation adds complexity.
2026-05-20 14:27:55 +02:00
iris
37522fd629 nix: replace weston RDP backend with VNC, add hyperhive.gui.enable option
Removes weston-rdp.nix (hyperhive.westonRdp.enable) and adds
weston-vnc.nix (hyperhive.gui.enable).

The ExecStart wrapper script computes a deterministic VNC port via
FNV-1a hash of the agent name (derived from hostname, same algorithm
as lifecycle::agent_web_port) in the range [15900, 16799], then writes
/etc/hyperhive/gui.json {"vnc_port": N, "auth": "none"} for the
harness WebSocket relay (issue #51), and execs weston with the VNC
backend + pixman renderer.

Type=simple so it can never abort nixos-container update; a
misconfigured weston degrades to a restart loop, not a blocked rebuild.

Closes #50
2026-05-20 14:01:53 +02:00
damocles
3c672ed6b2 add allowedBashPatterns NixOS option for finer-grained Bash tool approval 2026-05-20 13:35:28 +02:00
müde
6ab3810e18 docs: refresh for the dashboard rework + recent harness commits
- web-ui.md: side panel, approval card + 3-way diff base, stats
  page, forge config links, removed agent.nix viewer, per-agent
  loose-ends inline answer.
- approvals.md: forge mirror section + diff base toggle.
- turn-loop.md: recv(max), get_logs, remind, loose-ends, whoami.
- agent.md / manager.md prompts: recv(max), remind, get_logs.
- CLAUDE.md: forge.rs / stats.rs / hive-forge.nix in the file
  map, scratchpad refresh.

also: forgejo migrations.ALLOW_LOCALNETWORKS = true so an in-hive
mirror of the hyperhive repo can import from a localhost source.
2026-05-20 11:34:43 +02:00
damocles
ba04a5a360 nix: hyperhive.westonRdp.enable — opt-in weston + RDP backend per agent 2026-05-20 11:26:12 +02:00
müde
49f4e9cc89 dashboard: forge-linked config + approval card + 3-way diff base
- forge nix option moves to hyperhive.forge.enable, defaults true;
  hive-c0re imports the forge module so it's on by default.
- drop the agent.nix container-row viewer + /api/agent-config; link
  to the agent-configs forge repo instead.
- restructure pending approvals into a card (identity header /
  what-changed body / decision actions) with a link to the proposal
  commit on the forge.
- diff opens in the side panel with a 3-way base toggle: vs applied
  (running) / vs last-approved / vs previous proposal, served by the
  new /api/approval-diff/{id}?base= endpoint.
2026-05-20 11:22:28 +02:00
müde
85c0df2e64 harness: enable nix-command + flakes for all agents 2026-05-17 22:24:24 +02:00
damocles
ca86bcf4bd add claudePluginsAutoUpdate NixOS option, default false 2026-05-17 02:59:51 +02:00
müde
6652ae90ab tea-login: never fail switch-to-configuration
a failed tea-login oneshot used to abort `nixos-container update`
(switch-to-configuration exits 4), which blocked every rebuild
whether the agent needed tea or not. drop `set -e`, exit 0 on
every failure path (mkdir, tea login add, missing forge). also fix
the unit description, which hardcoded /state (manager-only) — sub-
agents have /agents/<name>/state.
2026-05-17 02:58:39 +02:00
müde
411cf86632 nix fmt + rustfmt sweep 2026-05-17 01:40:28 +02:00
müde
0cf120e9e9 harness: default claudeMarketplaces to anthropics/claude-plugins-official
so every agent has the official Anthropic marketplace registered
out of the box and plugin specs like 'foo@claude-plugins-official'
resolve without per-agent.nix wiring. operators add more entries
(community marketplace, etc.) or override to [] to opt out.
2026-05-17 01:38:29 +02:00
müde
597351ca4e harness: declarative claude plugin marketplaces
new `hyperhive.claudeMarketplaces` option (list of strings — URL,
path, or github:owner/repo). harness boot adds each via
`claude plugin marketplace add` before updating + installing the
configured plugins, so specs like `foo@some-marketplace` resolve
on a fresh container. idempotent: 'already exists' stderr is
treated as success.
2026-05-17 01:36:18 +02:00
müde
608de57924 hive-forge: default to pkgs.forgejo (15.x), expose package option
nixpkgs's services.forgejo defaults to forgejo-lts (11.0.13 today);
LTS lags far enough behind that any prior non-LTS run against the
same state dir leaves the DB at a migration the LTS binary can't
read ('database newer than binary, refusing to start'). default to
the latest release line and let operators opt down to LTS by
overriding services.hive-forge.package.
2026-05-17 01:29:19 +02:00
müde
fed943a04e hive-forge: pin F3 PATH absolute (init runs even when disabled)
forgejo's F3 init resolves data-dir before checking ENABLED, so
`forgejo admin user create` still fataled on the RO nix-store
default. set [F3] PATH = /var/lib/forgejo/data/f3 alongside the
disable.
2026-05-17 00:25:55 +02:00
müde
3e3c27ac48 hive-forge: disable F3 (federation) — defaults to RO nix-store path
forgejo's F3 federation subsystem resolves its data dir relative to
the binary, which under nixos lands at /run/current-system/sw/bin/data/f3
(read-only nix store) and fatals the daemon at boot. we don't
federate; turn it off.
2026-05-17 00:03:41 +02:00
müde
4a06615c5c fix /state paths: sub-agents use /agents/<name>/state, not /state
sub-agent containers post-refactor bind their state at
/agents/<name>/state (manager keeps the legacy /state — see
lifecycle.rs:751). agent.md still said /state/forge-token; corrected
to /agents/{label}/state/forge-token (template-substituted at
boot). tea-login systemd unit now walks both candidates so the same
harness module works for the manager and sub-agents.
2026-05-16 23:37:49 +02:00
müde
787c058c71 harness: install tea + auto-login from /state/forge-token
agents get `pkgs.tea` (gitea/forgejo CLI) and a tea-login oneshot
that runs `tea login add --url <hyperhive.forge.url> --token
$(cat /state/forge-token)` before the harness starts. idempotent:
exits 0 when the token file is absent (hive-forge not on) or when
~/.config/tea/config.yml already exists. new
`hyperhive.forge.url` option (default http://localhost:3000) so
operators can point at a non-default forge port. claude can now
shell out to `tea repos create`, `tea pulls create`, etc.
2026-05-16 23:35:28 +02:00
müde
6e9c67dd94 hive-forge: wrap forgejo in a nixos-container
avoids fighting an operator-side `services.forgejo` over the
singleton module options. container shares host netns
(`privateNetwork = false`) so agents still dial the forge via
plain `localhost:<httpPort>` and the host firewall is the only
layer that matters. container name is `hive-forge` (no `h-`
prefix) so hive-c0re's lifecycle scanner ignores it — operator
manages it with the standard `nixos-container` CLI. state lives
at `/var/lib/nixos-containers/hive-forge/var/lib/forgejo/` and
survives restarts.
2026-05-16 20:52:36 +02:00
müde
c2d176ed13 add hive-forge module: private forgejo for agents
new `services.hive-forge.enable` (off by default) wraps
`services.forgejo` with hyperhive-friendly defaults: sqlite (no
extra db service), built-in ssh on 2222 so it doesn't fight the
host's openssh, http on 3000 (outside hyperhive's 7000/8000/8100-8999
ranges), registration off (operator seeds agent users), private
repos by default. exported as `nixosModules.hive-forge` — operator
imports it on the host alongside hive-c0re. container-side wiring
(MCP tools or a bind-mounted token) is deferred; containers already
share the host netns so they can reach http://localhost:3000 today.
2026-05-16 20:50:36 +02:00
müde
6dd17864ac auto-install claude plugins at harness boot
new hyperhive.claudePlugins NixOS option (list of strings) rendered
to /etc/hyperhive/claude-plugins.json. both hive-ag3nt and hive-m1nd
shell out 'claude plugin install <spec>' for each entry once at
startup before the turn loop opens. failures log a warning but don't
abort boot.
2026-05-16 15:17:34 +02:00
müde
67e4242b9f per-agent send allow-list via hyperhive.allowedRecipients
new NixOS option in harness-base.nix:
  hyperhive.allowedRecipients = [ 'alice' 'manager' ];  # whitelist
  hyperhive.allowedRecipients = [ ];                    # default = unrestricted

module writes the list as JSON to /etc/hyperhive/send-allow
.json at activation. AgentServer::send reads the file before
issuing the broker request; if the list is non-empty and
`to` isn't on it, the tool returns a claude-readable refusal
string without touching the broker. the manager is always
implicitly permitted regardless of the list — otherwise a
misconfigured allow-list could strand a sub-agent without an
escalation path.

enforcement is in the in-container MCP server (not on the
host's per-agent socket) because the agent's nix config is the
trust boundary anyway — the operator audits agent.nix at
deploy time, the activation-time /etc/hyperhive/send-allow
.json is r/o under /nix/store, so the agent can't tamper at
runtime without going through a new approval.

agent prompt mentions the option + tells claude to route
through the manager when refused. retires the matching TODO
under Permissions / policy.
2026-05-16 03:59:28 +02:00
müde
66a69d0c7f harness-base: wrap config attributes after introducing options
mixing options.* with bare config-level attributes (boot.*, environment.*, etc.) at the same level isn't supported once the module declares any options — nix needs them under an explicit 'config = { ... }' block. error from the host: 'unsupported attribute boot. caused by introducing top-level options'. wrap accordingly.
2026-05-16 02:17:15 +02:00