Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb62e15d4f | ||
|
|
0a24946c1e |
3 changed files with 37 additions and 6 deletions
|
|
@ -104,11 +104,27 @@ async fn index(State(state): State<AppState>) -> Html<String> {
|
||||||
fn render_online(label: &str) -> String {
|
fn render_online(label: &str) -> String {
|
||||||
format!(
|
format!(
|
||||||
"<p class=\"status-online\">▓█▓▒░ harness alive — turn loop running ▓█▓▒░</p>\n\
|
"<p class=\"status-online\">▓█▓▒░ harness alive — turn loop running ▓█▓▒░</p>\n\
|
||||||
<form method=\"POST\" action=\"/send\" class=\"sendform\">\n \
|
<form id=\"sendform\" class=\"sendform\">\n \
|
||||||
<input name=\"body\" placeholder=\"message {label} as operator…\" required autocomplete=\"off\">\n \
|
<input id=\"sendbody\" name=\"body\" placeholder=\"message {label} as operator…\" required autocomplete=\"off\">\n \
|
||||||
<button type=\"submit\" class=\"btn btn-send\">◆ S3ND</button>\n\
|
<button type=\"submit\" class=\"btn btn-send\">◆ S3ND</button>\n\
|
||||||
</form>\n\
|
</form>\n\
|
||||||
<p class=\"meta\">enqueued with <code>from: operator</code> on this agent's inbox; the next turn picks it up.</p>\n\
|
<p class=\"meta\">enqueued with <code>from: operator</code> on this agent's inbox; the next turn picks it up.</p>\n\
|
||||||
|
<script>\n\
|
||||||
|
document.getElementById('sendform').addEventListener('submit', async function(e) {{\n \
|
||||||
|
e.preventDefault();\n \
|
||||||
|
const input = document.getElementById('sendbody');\n \
|
||||||
|
const body = input.value.trim();\n \
|
||||||
|
if (!body) return;\n \
|
||||||
|
const fd = new FormData();\n \
|
||||||
|
fd.set('body', body);\n \
|
||||||
|
const resp = await fetch('/send', {{ method: 'POST', body: fd, redirect: 'manual' }});\n \
|
||||||
|
if (resp.type === 'opaqueredirect' || (resp.ok && resp.status < 400)) {{\n \
|
||||||
|
input.value = '';\n \
|
||||||
|
}} else {{\n \
|
||||||
|
alert('send failed: ' + resp.status);\n \
|
||||||
|
}}\n\
|
||||||
|
}});\n\
|
||||||
|
</script>\n\
|
||||||
{LIVE_PANEL}",
|
{LIVE_PANEL}",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,12 @@
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
hyperhive
|
hyperhive
|
||||||
claude-code
|
claude-code
|
||||||
|
bashInteractive
|
||||||
git
|
git
|
||||||
coreutils-full
|
coreutils-full
|
||||||
];
|
];
|
||||||
|
# claude's Bash tool refuses to run without a POSIX shell + $SHELL set.
|
||||||
|
environment.variables.SHELL = "${pkgs.bashInteractive}/bin/bash";
|
||||||
|
|
||||||
systemd.services.hive-ag3nt = {
|
systemd.services.hive-ag3nt = {
|
||||||
description = "hive-ag3nt harness";
|
description = "hive-ag3nt harness";
|
||||||
|
|
@ -18,7 +21,12 @@
|
||||||
# The harness shells out to `claude` (turn loop + login flow). systemd
|
# The harness shells out to `claude` (turn loop + login flow). systemd
|
||||||
# units get a minimal PATH by default, so we have to put claude-code on
|
# units get a minimal PATH by default, so we have to put claude-code on
|
||||||
# it explicitly even though it's in environment.systemPackages above.
|
# it explicitly even though it's in environment.systemPackages above.
|
||||||
path = [ pkgs.claude-code ];
|
# bash is on PATH so claude's Bash tool can spawn `$SHELL`.
|
||||||
|
path = [
|
||||||
|
pkgs.claude-code
|
||||||
|
pkgs.bashInteractive
|
||||||
|
];
|
||||||
|
environment.SHELL = "${pkgs.bashInteractive}/bin/bash";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${pkgs.hyperhive}/bin/hive-ag3nt serve";
|
ExecStart = "${pkgs.hyperhive}/bin/hive-ag3nt serve";
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,12 @@
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
hyperhive
|
hyperhive
|
||||||
claude-code
|
claude-code
|
||||||
|
bashInteractive
|
||||||
git
|
git
|
||||||
coreutils-full
|
coreutils-full
|
||||||
];
|
];
|
||||||
|
# claude's Bash tool refuses to run without a POSIX shell + $SHELL set.
|
||||||
|
environment.variables.SHELL = "${pkgs.bashInteractive}/bin/bash";
|
||||||
|
|
||||||
environment.etc."gitconfig".text = ''
|
environment.etc."gitconfig".text = ''
|
||||||
[user]
|
[user]
|
||||||
|
|
@ -27,9 +30,13 @@
|
||||||
HIVE_PORT = "8000";
|
HIVE_PORT = "8000";
|
||||||
HIVE_LABEL = "hm1nd";
|
HIVE_LABEL = "hm1nd";
|
||||||
};
|
};
|
||||||
# See note in agent-base.nix — `claude` has to be on the service PATH
|
# See note in agent-base.nix — `claude` and a POSIX shell have to be on
|
||||||
# explicitly for the harness to shell out to it.
|
# the service PATH explicitly for the harness + claude's Bash tool.
|
||||||
path = [ pkgs.claude-code ];
|
path = [
|
||||||
|
pkgs.claude-code
|
||||||
|
pkgs.bashInteractive
|
||||||
|
];
|
||||||
|
environment.SHELL = "${pkgs.bashInteractive}/bin/bash";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${pkgs.hyperhive}/bin/hive-m1nd serve";
|
ExecStart = "${pkgs.hyperhive}/bin/hive-m1nd serve";
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue