Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f33fc3dd50 | ||
|
|
68fe66c0ef |
7 changed files with 138 additions and 122 deletions
|
|
@ -1,11 +1,15 @@
|
||||||
:root {
|
:root {
|
||||||
--bg: #0a0014;
|
/* Catppuccin Mocha — mirrors the dashboard palette. */
|
||||||
--fg: #e0d4ff;
|
--bg: #1e1e2e; /* base */
|
||||||
--muted: #6c5c8c;
|
--bg-elev: #181825; /* mantle */
|
||||||
--purple: #cc66ff;
|
--fg: #cdd6f4; /* text */
|
||||||
--purple-dim: #4a1a6a;
|
--muted: #7f849c; /* overlay1 */
|
||||||
--amber: #ffb84d;
|
--purple: #cba6f7; /* mauve */
|
||||||
--green: #66ff99;
|
--purple-dim: #45475a; /* surface1 */
|
||||||
|
--cyan: #89dceb; /* sky */
|
||||||
|
--amber: #fab387; /* peach */
|
||||||
|
--green: #a6e3a1; /* green */
|
||||||
|
--red: #f38ba8; /* red */
|
||||||
}
|
}
|
||||||
body {
|
body {
|
||||||
background: var(--bg);
|
background: var(--bg);
|
||||||
|
|
@ -21,14 +25,12 @@ body {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 0 0 1em 0;
|
margin: 0 0 1em 0;
|
||||||
font-size: 0.95em;
|
font-size: 0.95em;
|
||||||
text-shadow: 0 0 6px rgba(204, 102, 255, 0.5);
|
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
h2, h3 {
|
h2, h3 {
|
||||||
color: var(--purple);
|
color: var(--purple);
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
letter-spacing: 0.15em;
|
letter-spacing: 0.15em;
|
||||||
text-shadow: 0 0 8px rgba(204, 102, 255, 0.4);
|
|
||||||
}
|
}
|
||||||
.divider {
|
.divider {
|
||||||
color: var(--purple-dim);
|
color: var(--purple-dim);
|
||||||
|
|
@ -37,10 +39,11 @@ h2, h3 {
|
||||||
margin-bottom: 0.5em;
|
margin-bottom: 0.5em;
|
||||||
}
|
}
|
||||||
.meta { color: var(--muted); font-size: 0.85em; }
|
.meta { color: var(--muted); font-size: 0.85em; }
|
||||||
.status-online { color: var(--green); text-shadow: 0 0 6px rgba(102, 255, 153, 0.5); }
|
.status-online { color: var(--green); }
|
||||||
.status-needs-login { color: var(--amber); text-shadow: 0 0 6px rgba(255, 184, 77, 0.6); }
|
.status-needs-login { color: var(--amber); }
|
||||||
code { background: rgba(204, 102, 255, 0.1); padding: 0.05em 0.3em; border-radius: 2px; }
|
code { background: rgba(203, 166, 247, 0.12); padding: 0.05em 0.3em; border-radius: 2px; }
|
||||||
a { color: #66e0ff; }
|
a { color: var(--cyan); }
|
||||||
|
a:hover { color: var(--fg); }
|
||||||
.btn {
|
.btn {
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
|
|
@ -51,9 +54,9 @@ a { color: #66e0ff; }
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
letter-spacing: 0.1em;
|
letter-spacing: 0.1em;
|
||||||
}
|
}
|
||||||
.btn:hover { background: rgba(204, 102, 255, 0.1); }
|
.btn:hover { background: rgba(205, 214, 244, 0.06); }
|
||||||
.btn-login { color: var(--amber); border-color: var(--amber); }
|
.btn-login { color: var(--amber); border-color: var(--amber); }
|
||||||
.btn-cancel { color: #ff6b6b; border-color: #ff6b6b; font-size: 0.85em; padding: 0.15em 0.6em; }
|
.btn-cancel { color: var(--red); border-color: var(--red); font-size: 0.85em; padding: 0.15em 0.6em; }
|
||||||
.btn-rebuild {
|
.btn-rebuild {
|
||||||
color: var(--amber);
|
color: var(--amber);
|
||||||
border: 1px solid var(--amber);
|
border: 1px solid var(--amber);
|
||||||
|
|
@ -66,7 +69,7 @@ a { color: #66e0ff; }
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.btn-rebuild:hover { background: rgba(255, 184, 77, 0.1); }
|
.btn-rebuild:hover { background: rgba(250, 179, 135, 0.1); }
|
||||||
.btn-send { color: var(--green); border-color: var(--green); }
|
.btn-send { color: var(--green); border-color: var(--green); }
|
||||||
.sendform { display: flex; gap: 0.6em; margin-top: 0.5em; }
|
.sendform { display: flex; gap: 0.6em; margin-top: 0.5em; }
|
||||||
.sendform input {
|
.sendform input {
|
||||||
|
|
@ -130,11 +133,11 @@ pre.diff {
|
||||||
padding-left: 1.2em;
|
padding-left: 1.2em;
|
||||||
opacity: 0.85;
|
opacity: 0.85;
|
||||||
}
|
}
|
||||||
.live .turn-end-ok { color: #66ff99; border-left-color: #66ff99; margin-bottom: 0.4em; }
|
.live .turn-end-ok { color: var(--green); border-left-color: var(--green); margin-bottom: 0.4em; }
|
||||||
.live .turn-end-fail { color: #ff6b6b; border-left-color: #ff6b6b; margin-bottom: 0.4em; }
|
.live .turn-end-fail { color: var(--red); border-left-color: var(--red); margin-bottom: 0.4em; }
|
||||||
.live .text { color: var(--fg); padding-left: 1.2em; }
|
.live .text { color: var(--fg); padding-left: 1.2em; }
|
||||||
.live .thinking { color: var(--muted); font-style: italic; padding-left: 1.2em; }
|
.live .thinking { color: var(--muted); font-style: italic; padding-left: 1.2em; }
|
||||||
.live .tool-use { color: #66e0ff; padding-left: 1.2em; }
|
.live .tool-use { color: var(--cyan); padding-left: 1.2em; }
|
||||||
.live .tool-result { color: var(--muted); padding-left: 1.2em; }
|
.live .tool-result { color: var(--muted); padding-left: 1.2em; }
|
||||||
.live .result { color: var(--green); padding-left: 0.5em; }
|
.live .result { color: var(--green); padding-left: 0.5em; }
|
||||||
.live .sys, .live .note { color: var(--muted); }
|
.live .sys, .live .note { color: var(--muted); }
|
||||||
|
|
|
||||||
10
hive-ag3nt/prompts/agent.md
Normal file
10
hive-ag3nt/prompts/agent.md
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
You are hyperhive agent `{label}` in a multi-agent system.
|
||||||
|
|
||||||
|
Tools (hyperhive surface):
|
||||||
|
|
||||||
|
- `mcp__hyperhive__recv()` — drain one more message from your inbox (returns `(empty)` if nothing pending).
|
||||||
|
- `mcp__hyperhive__send(to, body)` — message a peer (by their name) or the operator (recipient `operator`, surfaces in the dashboard).
|
||||||
|
|
||||||
|
Need new packages, env vars, or other NixOS config for yourself? You can't edit your own config directly — message the manager (recipient `manager`) describing what you need. The manager edits `/agents/{label}/config/agent.nix` on your behalf, commits, and submits an approval that the operator can accept on the dashboard; on approve hive-c0re rebuilds your container with the new config.
|
||||||
|
|
||||||
|
When your inbox has a message, handle it and stop. Don't narrate intent — act.
|
||||||
15
hive-ag3nt/prompts/manager.md
Normal file
15
hive-ag3nt/prompts/manager.md
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
You are the hyperhive manager `{label}` in a multi-agent system. You coordinate sub-agents and relay between them and the operator.
|
||||||
|
|
||||||
|
Tools (hyperhive surface):
|
||||||
|
|
||||||
|
- `mcp__hyperhive__recv()` — drain one more message from your inbox.
|
||||||
|
- `mcp__hyperhive__send(to, body)` — message an agent (by name), another peer, or the operator (`operator` surfaces in the dashboard).
|
||||||
|
- `mcp__hyperhive__request_spawn(name)` — queue a brand-new sub-agent for operator approval (≤9 char name).
|
||||||
|
- `mcp__hyperhive__kill(name)` — graceful stop on a sub-agent.
|
||||||
|
- `mcp__hyperhive__request_apply_commit(agent, commit_ref)` — submit a config change for any agent (`hm1nd` for self) for operator approval.
|
||||||
|
|
||||||
|
Your own editable config lives at `/agents/hm1nd/config/agent.nix`; every sub-agent's lives at `/agents/<name>/config/agent.nix`. Use file/git tools to edit + commit, then `request_apply_commit`.
|
||||||
|
|
||||||
|
Messages from sender `system` are hyperhive helper events (JSON body, `event` field discriminates): `approval_resolved`, `spawned`, `rebuilt`, `killed`, `destroyed`. Use these to react to lifecycle changes — e.g. greet a freshly-spawned agent, retry a failed rebuild, or note the change to the operator.
|
||||||
|
|
||||||
|
When your inbox has a message, handle it and stop. Don't narrate intent — act.
|
||||||
|
|
@ -128,6 +128,7 @@ async fn serve(
|
||||||
let _ = state; // reserved for future state transitions (turn-loop -> needs-login)
|
let _ = state; // reserved for future state transitions (turn-loop -> needs-login)
|
||||||
let mcp_config = turn::write_mcp_config(socket).await?;
|
let mcp_config = turn::write_mcp_config(socket).await?;
|
||||||
let label = std::env::var("HIVE_LABEL").unwrap_or_else(|_| "hive-ag3nt".into());
|
let label = std::env::var("HIVE_LABEL").unwrap_or_else(|_| "hive-ag3nt".into());
|
||||||
|
let system_prompt = turn::write_system_prompt(socket, &label, mcp::Flavor::Agent).await?;
|
||||||
loop {
|
loop {
|
||||||
let recv: Result<AgentResponse> = client::request(socket, &AgentRequest::Recv).await;
|
let recv: Result<AgentResponse> = client::request(socket, &AgentRequest::Recv).await;
|
||||||
match recv {
|
match recv {
|
||||||
|
|
@ -137,9 +138,15 @@ async fn serve(
|
||||||
from: from.clone(),
|
from: from.clone(),
|
||||||
body: body.clone(),
|
body: body.clone(),
|
||||||
});
|
});
|
||||||
let prompt = format_wake_prompt(&label, &from, &body);
|
let prompt = format_wake_prompt(&from, &body);
|
||||||
let outcome =
|
let outcome = turn::drive_turn(
|
||||||
turn::drive_turn(&prompt, &mcp_config, &bus, mcp::Flavor::Agent).await;
|
&prompt,
|
||||||
|
&mcp_config,
|
||||||
|
&system_prompt,
|
||||||
|
&bus,
|
||||||
|
mcp::Flavor::Agent,
|
||||||
|
)
|
||||||
|
.await;
|
||||||
turn::emit_turn_end(&bus, &outcome);
|
turn::emit_turn_end(&bus, &outcome);
|
||||||
}
|
}
|
||||||
Ok(AgentResponse::Empty) => {}
|
Ok(AgentResponse::Empty) => {}
|
||||||
|
|
@ -157,38 +164,11 @@ async fn serve(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// System prompt handed to claude on each turn. The harness has already
|
/// Per-turn user prompt. The role/tools/etc. is in the system prompt
|
||||||
/// popped one message off the inbox (the wake signal); claude is told
|
/// (`prompts/agent.md` → `claude --system-prompt-file`); this is just the
|
||||||
/// about it and the MCP tools, and is expected to drive any further
|
/// wake signal claude reacts to.
|
||||||
/// recv/send itself.
|
fn format_wake_prompt(from: &str, body: &str) -> String {
|
||||||
fn format_wake_prompt(label: &str, from: &str, body: &str) -> String {
|
format!("Incoming message from `{from}`:\n---\n{body}\n---")
|
||||||
// Manager broker name. Lifecycle calls it `hm1nd` (container), broker
|
|
||||||
// calls it `manager`. Sub-agents address the manager via `manager`.
|
|
||||||
let manager = hive_sh4re::MANAGER_AGENT;
|
|
||||||
format!(
|
|
||||||
"You are hyperhive agent `{label}` in a multi-agent system.\n\
|
|
||||||
\n\
|
|
||||||
Incoming message from `{from}`:\n\
|
|
||||||
---\n\
|
|
||||||
{body}\n\
|
|
||||||
---\n\
|
|
||||||
\n\
|
|
||||||
Tools:\n\
|
|
||||||
- `mcp__hyperhive__recv()` — drain one more message from your inbox \
|
|
||||||
(returns `(empty)` if nothing pending).\n\
|
|
||||||
- `mcp__hyperhive__send(to, body)` — message a peer (by their name) \
|
|
||||||
or the operator (recipient `operator`, surfaces in the dashboard).\n\
|
|
||||||
\n\
|
|
||||||
Need new packages, env vars, or other NixOS config for yourself? \
|
|
||||||
You can't edit your own config directly — message the manager \
|
|
||||||
(recipient `{manager}`) describing what you need. The manager \
|
|
||||||
edits `/agents/{label}/config/agent.nix` on your behalf, commits, \
|
|
||||||
and submits an approval that the operator can accept on the \
|
|
||||||
dashboard; on approve hive-c0re rebuilds your container with the \
|
|
||||||
new config.\n\
|
|
||||||
\n\
|
|
||||||
Handle the inbox, then stop. Don't narrate intent — act."
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render(resp: &AgentResponse) -> Result<()> {
|
fn render(resp: &AgentResponse) -> Result<()> {
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,7 @@ async fn serve(socket: &Path, interval: Duration, bus: Bus) -> Result<()> {
|
||||||
tracing::info!(socket = %socket.display(), "hive-m1nd serve");
|
tracing::info!(socket = %socket.display(), "hive-m1nd serve");
|
||||||
let mcp_config = turn::write_mcp_config(socket).await?;
|
let mcp_config = turn::write_mcp_config(socket).await?;
|
||||||
let label = std::env::var("HIVE_LABEL").unwrap_or_else(|_| "hm1nd".into());
|
let label = std::env::var("HIVE_LABEL").unwrap_or_else(|_| "hm1nd".into());
|
||||||
|
let system_prompt = turn::write_system_prompt(socket, &label, mcp::Flavor::Manager).await?;
|
||||||
loop {
|
loop {
|
||||||
let recv: Result<ManagerResponse> = client::request(socket, &ManagerRequest::Recv).await;
|
let recv: Result<ManagerResponse> = client::request(socket, &ManagerRequest::Recv).await;
|
||||||
match recv {
|
match recv {
|
||||||
|
|
@ -153,9 +154,15 @@ async fn serve(socket: &Path, interval: Duration, bus: Bus) -> Result<()> {
|
||||||
from: from.clone(),
|
from: from.clone(),
|
||||||
body: body.clone(),
|
body: body.clone(),
|
||||||
});
|
});
|
||||||
let prompt = format_wake_prompt(&label, &from, &body);
|
let prompt = format_wake_prompt(&from, &body);
|
||||||
let outcome =
|
let outcome = turn::drive_turn(
|
||||||
turn::drive_turn(&prompt, &mcp_config, &bus, mcp::Flavor::Manager).await;
|
&prompt,
|
||||||
|
&mcp_config,
|
||||||
|
&system_prompt,
|
||||||
|
&bus,
|
||||||
|
mcp::Flavor::Manager,
|
||||||
|
)
|
||||||
|
.await;
|
||||||
turn::emit_turn_end(&bus, &outcome);
|
turn::emit_turn_end(&bus, &outcome);
|
||||||
}
|
}
|
||||||
Ok(ManagerResponse::Empty) => {}
|
Ok(ManagerResponse::Empty) => {}
|
||||||
|
|
@ -173,43 +180,10 @@ async fn serve(socket: &Path, interval: Duration, bus: Bus) -> Result<()> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Manager-flavored wake prompt. Mentions the privileged tools the sub-agent
|
|
||||||
/// prompt doesn't have access to, and points the manager at its own
|
/// Per-turn user prompt. The role/tools/etc. is in the system prompt
|
||||||
/// editable config repo for self-modification.
|
/// (`prompts/manager.md` → `claude --system-prompt-file`); this is just
|
||||||
fn format_wake_prompt(label: &str, from: &str, body: &str) -> String {
|
/// the wake signal.
|
||||||
let from_note = if from == SYSTEM_SENDER {
|
fn format_wake_prompt(from: &str, body: &str) -> String {
|
||||||
"\n The sender `system` means this is a hyperhive helper event \
|
format!("Incoming message from `{from}`:\n---\n{body}\n---")
|
||||||
(JSON body, `event` field discriminates): `approval_resolved`, \
|
|
||||||
`spawned`, `rebuilt`, `killed`, `destroyed`. Use these to react to \
|
|
||||||
lifecycle changes — e.g. greet a freshly-spawned agent, retry a \
|
|
||||||
failed rebuild, or note the change to the operator.\n"
|
|
||||||
} else {
|
|
||||||
""
|
|
||||||
};
|
|
||||||
format!(
|
|
||||||
"You are the hyperhive manager `{label}` in a multi-agent system. You \
|
|
||||||
coordinate sub-agents and relay between them and the operator.\n\
|
|
||||||
\n\
|
|
||||||
Incoming message from `{from}`:\n\
|
|
||||||
---\n\
|
|
||||||
{body}\n\
|
|
||||||
---\n{from_note}
|
|
||||||
\n\
|
|
||||||
Tools (hyperhive surface):\n\
|
|
||||||
- `mcp__hyperhive__recv()` — drain one more message from your inbox.\n\
|
|
||||||
- `mcp__hyperhive__send(to, body)` — message an agent (by name), \
|
|
||||||
another peer, or the operator (`operator` surfaces in the dashboard).\n\
|
|
||||||
- `mcp__hyperhive__request_spawn(name)` — queue a brand-new sub-agent \
|
|
||||||
for operator approval (≤9 char name).\n\
|
|
||||||
- `mcp__hyperhive__kill(name)` — graceful stop on a sub-agent.\n\
|
|
||||||
- `mcp__hyperhive__request_apply_commit(agent, commit_ref)` — submit \
|
|
||||||
a config change for any agent (`hm1nd` for self) for operator \
|
|
||||||
approval.\n\
|
|
||||||
\n\
|
|
||||||
Your own editable config lives at `/agents/hm1nd/config/agent.nix`; \
|
|
||||||
every sub-agent's lives at `/agents/<name>/config/agent.nix`. Use \
|
|
||||||
file/git tools to edit + commit, then `request_apply_commit`.\n\
|
|
||||||
\n\
|
|
||||||
Handle the inbox, then stop. Don't narrate intent — act."
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,29 @@ pub async fn write_mcp_config(socket: &Path) -> Result<PathBuf> {
|
||||||
Ok(path)
|
Ok(path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Write the agent's / manager's static system prompt to a file next to
|
||||||
|
/// the MCP config and return the path. Passed to claude via
|
||||||
|
/// `--system-prompt-file`, replacing claude's default system prompt with
|
||||||
|
/// the role + tools instructions. Per-turn prompts become much smaller
|
||||||
|
/// (just the wake message body).
|
||||||
|
pub async fn write_system_prompt(
|
||||||
|
socket: &Path,
|
||||||
|
label: &str,
|
||||||
|
flavor: mcp::Flavor,
|
||||||
|
) -> Result<PathBuf> {
|
||||||
|
let parent = socket.parent().unwrap_or_else(|| Path::new("/run/hive"));
|
||||||
|
tokio::fs::create_dir_all(parent).await.ok();
|
||||||
|
let template = match flavor {
|
||||||
|
mcp::Flavor::Agent => include_str!("../prompts/agent.md"),
|
||||||
|
mcp::Flavor::Manager => include_str!("../prompts/manager.md"),
|
||||||
|
};
|
||||||
|
let body = template.replace("{label}", label);
|
||||||
|
let path = parent.join("claude-system-prompt.md");
|
||||||
|
tokio::fs::write(&path, body).await?;
|
||||||
|
tracing::info!(path = %path.display(), "wrote claude system prompt");
|
||||||
|
Ok(path)
|
||||||
|
}
|
||||||
|
|
||||||
/// One claude turn's outcome. The harness uses this to decide whether to
|
/// One claude turn's outcome. The harness uses this to decide whether to
|
||||||
/// transparently kick off a compaction and retry.
|
/// transparently kick off a compaction and retry.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
@ -66,16 +89,17 @@ pub enum TurnOutcome {
|
||||||
pub async fn drive_turn(
|
pub async fn drive_turn(
|
||||||
prompt: &str,
|
prompt: &str,
|
||||||
mcp_config: &Path,
|
mcp_config: &Path,
|
||||||
|
system_prompt: &Path,
|
||||||
bus: &Bus,
|
bus: &Bus,
|
||||||
flavor: mcp::Flavor,
|
flavor: mcp::Flavor,
|
||||||
) -> TurnOutcome {
|
) -> TurnOutcome {
|
||||||
match run_turn(prompt, mcp_config, bus, flavor).await {
|
match run_turn(prompt, mcp_config, system_prompt, bus, flavor).await {
|
||||||
TurnOutcome::PromptTooLong => {
|
TurnOutcome::PromptTooLong => {
|
||||||
if let Err(e) = compact_session(bus).await {
|
if let Err(e) = compact_session(bus).await {
|
||||||
tracing::warn!(error = %format!("{e:#}"), "compact failed");
|
tracing::warn!(error = %format!("{e:#}"), "compact failed");
|
||||||
return TurnOutcome::Failed(e);
|
return TurnOutcome::Failed(e);
|
||||||
}
|
}
|
||||||
run_turn(prompt, mcp_config, bus, flavor).await
|
run_turn(prompt, mcp_config, system_prompt, bus, flavor).await
|
||||||
}
|
}
|
||||||
other => other,
|
other => other,
|
||||||
}
|
}
|
||||||
|
|
@ -131,10 +155,20 @@ pub async fn wait_for_login(claude_dir: &Path, state: Arc<Mutex<LoginState>>, po
|
||||||
pub async fn run_turn(
|
pub async fn run_turn(
|
||||||
prompt: &str,
|
prompt: &str,
|
||||||
mcp_config: &Path,
|
mcp_config: &Path,
|
||||||
|
system_prompt: &Path,
|
||||||
bus: &Bus,
|
bus: &Bus,
|
||||||
flavor: mcp::Flavor,
|
flavor: mcp::Flavor,
|
||||||
) -> TurnOutcome {
|
) -> TurnOutcome {
|
||||||
match run_claude(prompt, mcp_config, bus, flavor, ClaudeMode::Turn).await {
|
match run_claude(
|
||||||
|
prompt,
|
||||||
|
mcp_config,
|
||||||
|
Some(system_prompt),
|
||||||
|
bus,
|
||||||
|
flavor,
|
||||||
|
ClaudeMode::Turn,
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
{
|
||||||
Ok(too_long) if too_long => TurnOutcome::PromptTooLong,
|
Ok(too_long) if too_long => TurnOutcome::PromptTooLong,
|
||||||
Ok(_) => TurnOutcome::Ok,
|
Ok(_) => TurnOutcome::Ok,
|
||||||
Err(e) => TurnOutcome::Failed(e),
|
Err(e) => TurnOutcome::Failed(e),
|
||||||
|
|
@ -151,6 +185,7 @@ pub async fn compact_session(bus: &Bus) -> Result<()> {
|
||||||
let _ = run_claude(
|
let _ = run_claude(
|
||||||
"/compact",
|
"/compact",
|
||||||
Path::new("/dev/null"),
|
Path::new("/dev/null"),
|
||||||
|
None,
|
||||||
bus,
|
bus,
|
||||||
mcp::Flavor::Agent, // tool surface unused for /compact
|
mcp::Flavor::Agent, // tool surface unused for /compact
|
||||||
ClaudeMode::Compact,
|
ClaudeMode::Compact,
|
||||||
|
|
@ -169,6 +204,7 @@ enum ClaudeMode {
|
||||||
async fn run_claude(
|
async fn run_claude(
|
||||||
prompt: &str,
|
prompt: &str,
|
||||||
mcp_config: &Path,
|
mcp_config: &Path,
|
||||||
|
system_prompt: Option<&Path>,
|
||||||
bus: &Bus,
|
bus: &Bus,
|
||||||
flavor: mcp::Flavor,
|
flavor: mcp::Flavor,
|
||||||
mode: ClaudeMode,
|
mode: ClaudeMode,
|
||||||
|
|
@ -183,6 +219,9 @@ async fn run_claude(
|
||||||
.arg("--continue")
|
.arg("--continue")
|
||||||
.arg("--settings")
|
.arg("--settings")
|
||||||
.arg(CLAUDE_SETTINGS);
|
.arg(CLAUDE_SETTINGS);
|
||||||
|
if let Some(p) = system_prompt {
|
||||||
|
cmd.arg("--system-prompt-file").arg(p);
|
||||||
|
}
|
||||||
if let ClaudeMode::Turn = mode {
|
if let ClaudeMode::Turn = mode {
|
||||||
cmd.arg("--mcp-config")
|
cmd.arg("--mcp-config")
|
||||||
.arg(mcp_config)
|
.arg(mcp_config)
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,18 @@
|
||||||
:root {
|
:root {
|
||||||
--bg: #0a0014;
|
/* Catppuccin Mocha. Keep the legacy variable names so per-class styles
|
||||||
--bg-elev: #18002a;
|
don't need to be rewritten — only the values change. */
|
||||||
--fg: #e0d4ff;
|
--bg: #1e1e2e; /* base */
|
||||||
--muted: #6c5c8c;
|
--bg-elev: #181825; /* mantle */
|
||||||
--purple: #cc66ff;
|
--fg: #cdd6f4; /* text */
|
||||||
--purple-dim: #4a1a6a;
|
--muted: #7f849c; /* overlay1 */
|
||||||
--cyan: #00ffff;
|
--purple: #cba6f7; /* mauve */
|
||||||
--pink: #ff3399;
|
--purple-dim: #45475a; /* surface1 */
|
||||||
--amber: #ffaa00;
|
--cyan: #89dceb; /* sky */
|
||||||
--green: #00ff88;
|
--pink: #f5c2e7; /* pink */
|
||||||
--red: #ff4466;
|
--amber: #fab387; /* peach */
|
||||||
--border: #2a0a4a;
|
--green: #a6e3a1; /* green */
|
||||||
|
--red: #f38ba8; /* red */
|
||||||
|
--border: #313244; /* surface0 */
|
||||||
}
|
}
|
||||||
body {
|
body {
|
||||||
background: var(--bg);
|
background: var(--bg);
|
||||||
|
|
@ -26,7 +28,6 @@ body {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 0 0 1em 0;
|
margin: 0 0 1em 0;
|
||||||
font-size: 0.95em;
|
font-size: 0.95em;
|
||||||
text-shadow: 0 0 6px rgba(204, 102, 255, 0.5);
|
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
h1, h2 {
|
h1, h2 {
|
||||||
|
|
@ -34,7 +35,6 @@ h1, h2 {
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
letter-spacing: 0.15em;
|
letter-spacing: 0.15em;
|
||||||
margin-top: 2em;
|
margin-top: 2em;
|
||||||
text-shadow: 0 0 8px rgba(204, 102, 255, 0.4);
|
|
||||||
}
|
}
|
||||||
.divider {
|
.divider {
|
||||||
color: var(--purple-dim);
|
color: var(--purple-dim);
|
||||||
|
|
@ -48,13 +48,9 @@ li { padding: 0.5em 0; }
|
||||||
a {
|
a {
|
||||||
color: var(--cyan);
|
color: var(--cyan);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
text-shadow: 0 0 4px rgba(0, 255, 255, 0.5);
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
a:hover {
|
a:hover { color: var(--fg); }
|
||||||
color: #fff;
|
|
||||||
text-shadow: 0 0 12px rgba(0, 255, 255, 0.9);
|
|
||||||
}
|
|
||||||
.role {
|
.role {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-left: 0.4em;
|
margin-left: 0.4em;
|
||||||
|
|
@ -65,8 +61,8 @@ a:hover {
|
||||||
letter-spacing: 0.1em;
|
letter-spacing: 0.1em;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
.role-m1nd { color: var(--pink); border-color: var(--pink); background: rgba(255, 51, 153, 0.1); }
|
.role-m1nd { color: var(--pink); border-color: var(--pink); background: rgba(245, 194, 231, 0.08); }
|
||||||
.role-ag3nt { color: var(--amber); border-color: var(--amber); background: rgba(255, 170, 0, 0.1); }
|
.role-ag3nt { color: var(--amber); border-color: var(--amber); background: rgba(250, 179, 135, 0.08); }
|
||||||
.meta { color: var(--muted); font-size: 0.85em; margin-left: 0.4em; }
|
.meta { color: var(--muted); font-size: 0.85em; margin-left: 0.4em; }
|
||||||
.id { color: var(--pink); font-weight: bold; margin-right: 0.4em; }
|
.id { color: var(--pink); font-weight: bold; margin-right: 0.4em; }
|
||||||
.agent { color: var(--amber); font-weight: bold; margin-right: 0.6em; }
|
.agent { color: var(--amber); font-weight: bold; margin-right: 0.6em; }
|
||||||
|
|
@ -91,9 +87,8 @@ ul form.inline { display: inline-block; }
|
||||||
border: 1px solid;
|
border: 1px solid;
|
||||||
padding: 0.25em 0.8em;
|
padding: 0.25em 0.8em;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
text-shadow: 0 0 4px currentColor;
|
|
||||||
}
|
}
|
||||||
.btn:hover { background: rgba(255,255,255,0.05); text-shadow: 0 0 12px currentColor; }
|
.btn:hover { background: rgba(205, 214, 244, 0.06); }
|
||||||
.btn-approve { color: var(--green); border-color: var(--green); }
|
.btn-approve { color: var(--green); border-color: var(--green); }
|
||||||
.btn-deny { color: var(--red); border-color: var(--red); }
|
.btn-deny { color: var(--red); border-color: var(--red); }
|
||||||
.btn-destroy { color: var(--red); border-color: var(--red); font-size: 0.75em; padding: 0.15em 0.5em; margin-left: 0.6em; }
|
.btn-destroy { color: var(--red); border-color: var(--red); font-size: 0.75em; padding: 0.15em 0.5em; margin-left: 0.6em; }
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue