feat: Endo-compatible host, downloads folder, Nix tools PATH

- the fake host serves a subset of @endo/agent-mcp-stdio's catalog,
  with its names, schemas and answers; evaluate takes only
  E(name).method(arg, ...), and __getMethodNames__
- demo.py --host endo: a real Endo daemon (endo-but-for-bots, llm),
  its guest served by the package's broker
- a downloads folder: the host writes, Hermes reads at ~/Downloads;
  BindReadOnlyPaths on Linux, a virtiofs share on macOS
- .#demo-tools: Hermes and the checks get their whole PATH from the store
- each run saves its MCP messages and a transcript
- the guide: tools as system calls, names as file descriptors;
  no Linux networking, but WebApps
- grants match a named URL before "download"

Generated-by: Claude Opus 5.5
This commit is contained in:
dckc committed 2026-11-29 23:15:06 -06:00
1 parent 783e4c595f
commit 3f9ba54477
15 files changed
+2398 -282

No files matched your search

+19 -5
View File
@@ -2,14 +2,18 @@
#
# This module is what ports: the same unit runs on a Linux host and inside
# the macOS VM (./vfkit-vm.nix). It reaches the world through exactly two
# Unix sockets, and whatever imports it decides what serves them:
# Unix sockets and one directory, and whatever imports it decides what
# serves them:
#
# hostSocket the guest's methods (listMessages, request, resolve,
# lookup, ...) as an MCP server, bound to one guest agent
# hostSocket the guest's methods (listMessages, request, evaluate,
# ...) as an MCP server, bound to one guest agent
# llmSocket model inference, through a proxy that holds the API key
# downloadsDir the guest's downloads folder, ~/Downloads: the host
# writes it, and Hermes only reads it
#
# The service has no network of its own (PrivateNetwork), and its root
# is empty except for its closure and those two sockets (confinement).
# The service has no network of its own (PrivateNetwork), and its root is
# empty except for its closure, those two sockets, the downloads folder,
# and its state (confinement).
{
config,
lib,
@@ -76,6 +80,14 @@ in
default = 8080;
description = "The loopback port, inside Hermes's own network namespace, that forwards to llmSocket.";
};
downloadsDir = lib.mkOption {
type = lib.types.str;
default = "/var/lib/hermes-downloads";
description = ''
The guest's downloads folder, as the host sees it: the host writes files here (say, a
WebApp's body, by E(dir).write(name, blob)), and Hermes sees it, read-only, as ~/Downloads.
'';
};
model = lib.mkOption {
type = lib.types.str;
description = "The model name, as the proxy's upstream knows it.";
@@ -131,6 +143,8 @@ in
BindReadOnlyPaths = [
cfg.hostSocket
cfg.llmSocket
# read-only: Hermes can't plant anything there for the host to trip on
"${cfg.downloadsDir}:${hermes.stateDir}/Downloads"
];
BindPaths = [ hermes.stateDir ];
ProtectHome = lib.mkForce true;