Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/frontend/packages/swarm-ui/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas ae9ca4331e swarm: keep an agent's terminal rows and replay them on attach
swarm-controller now creates `term-main-<agent>` for every live agent, in
the same one-minute pass and with the same config style as
`term-sub-<agent>` (#4897): subjects `$SWARM.term.<agent>` only, max_age
24h, max_bytes 64 MiB, discard Old, max_message_size from the queue's
max_payload. An existing stream is opened as it is. The agent keeps its
plain publish on `$SWARM.term.<agent>` and gets no JetStream subject.

`GET /api/agents/{name}/term/stream` creates an ephemeral push consumer on
that stream starting 100 rows back, so a swarm-ui terminal opens with
recent history and then follows new rows, in order, from one
subscription. Each SSE event carries the row's stream sequence as its id,
and a reconnect's Last-Event-ID resumes after it. Without the stream the
route falls back to the live core subscription it used before.

The stream is `term-main-<agent>`, not `term-<agent>`: an agent may be
named `sub-x`, whose `term-<agent>` would be agent `x`'s subagent stream.
Its one literal subject cannot match `$SWARM.term.<agent>.sub.>`, which
needs more tokens, so the two streams never overlap.

The reader gains `$JS.API.CONSUMER.CREATE.*.*.$SWARM.term.*`, the
extended create form whose last tokens are the consumer's filter. Checked
against nats-server 2.14.4, the trailing `*` also admits a literal `*` or
`>` filter, so a consumer under it reaches any terminal row, main or
subagent; those are rows the reader already subscribes to and reads with
`STREAM.MSG.GET.*`.

Closes #4826
2026-10-11 12:35:31 +02:00
..
pages swarm: keep an agent's terminal rows and replay them on attach 2026-10-11 12:35:31 +02:00
shell swarm-ui: each route sets its own document title ('<page> · <swarm name>') 2026-10-04 22:43:07 +02:00
ui swarm-ui: format the schedules page with treefmt 2026-10-04 17:49:42 +02:00
App.tsx swarm-ui: a schedules page, one card per scheduled prompt 2026-10-04 17:49:42 +02:00
colors.css swarm-ui: bootstrap new swarm-level frontend (Preact + wouter + TS + JSX) 2026-08-11 21:31:44 +02:00
css.d.ts treefmt: apply prettier 2026-09-02 15:25:07 +02:00
index.html swarm-ui: make it installable as a PWA 2026-09-12 11:30:20 +02:00
main.tsx swarm-ui: make it installable as a PWA 2026-09-12 11:30:20 +02:00
manifest.webmanifest swarm-ui: PWA follow-ups from review 2026-09-12 11:30:20 +02:00
sw.js swarm-ui: content-hash main/theme/swarm-ui-css filenames for real cache-busting 2026-09-12 13:04:01 +02:00
swarm-ui.css swarm-ui: real hive-roster overview page 2026-08-13 11:21:30 +02:00
theme.css swarm-ui: bootstrap new swarm-level frontend (Preact + wouter + TS + JSX) 2026-08-11 21:31:44 +02:00
util.ts swarm-ui: a schedules page, one card per scheduled prompt 2026-10-04 17:49:42 +02:00