hive-agent: the per-agent page has no message box; its send route and the broker's operator message are removed
The page's composer (its input, slash commands and completion), POST /send in hive-agent, the OperatorMsg request of the agent socket and its handler in hive-c0re, and the broker-error helper only the send route used are deleted: writing to an agent is the swarm UI's terminal. cancel turn, new session and log out stay in the state badge's menu; POST /api/compact stays, with nothing on the page calling it. The request-line limit keeps its size, and its comment says it is a generous bound now. The docs describe the actions in place of the footer and the prompt.
This commit is contained in:
parent
e149ff3315
commit
23f4f1823b
1 changed files with 77 additions and 505 deletions
|
|
@ -20,7 +20,6 @@ import { HeaderPill } from "./components/HeaderPill.js";
|
|||
import { SidePanel } from "./components/SidePanel.js";
|
||||
import { InboxPanel } from "./components/InboxPanel.js";
|
||||
import { TodosPanel } from "./components/TodosPanel.js";
|
||||
import { TermInput } from "./components/TermInput.js";
|
||||
import { LoginFlow } from "./components/LoginFlow.js";
|
||||
import { useAgentState } from "./hooks/useAgentState.js";
|
||||
import { useTodos } from "./hooks/useTodos.js";
|
||||
|
|
@ -79,11 +78,10 @@ function tokenTotal(u: TokenUsage | null): number | null {
|
|||
);
|
||||
}
|
||||
|
||||
// `?hide=header,input` — an embedding companion window (e.g. a native
|
||||
// desktop shell) supplies its own header/composer chrome around this
|
||||
// page, so it asks for just the terminal feed. Read once per load (the
|
||||
// value can't change without a navigation); comma-separated so both
|
||||
// axes can be hidden in one param.
|
||||
// `?hide=header` — an embedding companion window (e.g. a native desktop
|
||||
// shell) supplies its own header chrome around this page, so it asks for
|
||||
// just the terminal feed. Read once per load (the value can't change without
|
||||
// a navigation); comma-separated so more parts can be hidden in one param.
|
||||
const hideParam = new URLSearchParams(window.location.search).get("hide");
|
||||
const HIDDEN = new Set(hideParam ? hideParam.split(",").filter(Boolean) : []);
|
||||
|
||||
|
|
@ -95,16 +93,13 @@ export function Root() {
|
|||
const [openPanel, setOpenPanel] = useState<OpenPanel>(null);
|
||||
const liveStreamRef = useRef<LiveStreamHandle>(null);
|
||||
const hideHeader = HIDDEN.has("header");
|
||||
const hideInput = HIDDEN.has("input");
|
||||
// Body classes, not inline styles: agent.css's `--agent-header-h`/
|
||||
// `--agent-header-real-h`/`--agent-composer-h` custom properties already
|
||||
// drive every dependent calc() (overlay offset, terminal scroll padding)
|
||||
// — zeroing them here collapses all of that in one place instead of
|
||||
// touching each rule.
|
||||
// `--agent-header-real-h` custom properties already drive every
|
||||
// dependent calc() (overlay offset, terminal scroll padding) — zeroing
|
||||
// them here collapses all of that in one place instead of touching each rule.
|
||||
useEffect(() => {
|
||||
document.body.classList.toggle("agent-hide-header", hideHeader);
|
||||
document.body.classList.toggle("agent-hide-input", hideInput);
|
||||
}, [hideHeader, hideInput]);
|
||||
}, [hideHeader]);
|
||||
|
||||
// Ticks the status badge's "thinking Xm Ys" age once a second,
|
||||
// independent of the ~4s `/api/state` poll cadence — without its own
|
||||
|
|
@ -134,17 +129,6 @@ export function Root() {
|
|||
? `${state.label} // ${state.hive_name}`
|
||||
: `${tab} // hyperhive`;
|
||||
}, [state?.label, state?.qualified_label, state?.hive_name]);
|
||||
const termInput = hideInput ? null : (
|
||||
<footer class="agent-composer">
|
||||
<TermInput
|
||||
label={state?.label ?? "…"}
|
||||
online={state?.status === "online"}
|
||||
onLocalNote={(text) => liveStreamRef.current?.pushNote(text)}
|
||||
onClear={() => liveStreamRef.current?.clear()}
|
||||
/>
|
||||
</footer>
|
||||
);
|
||||
|
||||
const pills = (
|
||||
<>
|
||||
<HeaderPill
|
||||
|
|
@ -237,7 +221,6 @@ export function Root() {
|
|||
<main className="agent-main">
|
||||
<LiveStream ref={liveStreamRef} />
|
||||
</main>
|
||||
{termInput}
|
||||
{panel}
|
||||
</>
|
||||
);
|
||||
|
|
@ -363,7 +346,6 @@ export function Root() {
|
|||
) : null}
|
||||
<LiveStream ref={liveStreamRef} />
|
||||
</main>
|
||||
{termInput}
|
||||
{panel}
|
||||
</>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue