web

package
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Web dashboard — a read-only live view of the agent, served over HTTP.

Step 2 of the front-end plan. The dashboard is a second subscriber to the event core.Bus (stdout is the first): every event the terminal renders is also pushed to any connected browser over Server-Sent Events. Enable with -serve (defaults to :7777) or -serve :PORT.

Design: this is an instrument panel, not a webpage. Dark, monospace, dense — it mirrors what you watch in the terminal but makes it reachable from another machine on the LAN. The live transcript is the centerpiece; a stats strip and a todo rail frame it. Read-only by design: it observes, it does not drive the agent (driving stays in the terminal/TUI).

Implementation is stdlib net/http + SSE, no framework — the idiomatic choice for a small embedded status server. SSE (not websockets) because the data flow is one-directional (server→browser) and SSE reconnects itself and rides plain HTTP.

Security: non-loopback bindings require a shared-secret token (SetDashToken). All responses include security headers (CSP, X-Content-Type-Options). POST endpoints verify CSRF tokens to prevent cross-site request forgery.

Dashboard HTML — served at /. A single self-contained page: no build step, no external assets, inline CSS/JS. Instrument-panel aesthetic: dark, monospace, dense; the live event stream is the centerpiece.

Headless mode — the agent driven solely from the web dashboard.

No terminal reader, no TUI. The loop blocks on browser submissions and runs each as a turn, with all output flowing through the event core.Bus to the dashboard's SSE stream. This is the intended shape for "run it on a box, interact from a browser (phone, laptop) on the LAN": there's no human at the terminal, so there's nothing to select against — the browser queue is the only input source, which makes this the simplest and most robust of the three front-end paths.

Input parity with the REPL: a submitted line is classified the same way (!shell / @file / /command / prompt) so the dashboard user gets the same affordances. Read-only /commands run via the shared dispatcher; stateful ones report that they need the REPL (a headless session can't, e.g., /reload itself).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunHeadless

func RunHeadless(baseURL, model string, sb *agent.Sandbox, st *agent.SessionStore, messages []core.Message)

func SetDashToken added in v0.4.2

func SetDashToken(t string)

SetDashToken sets the shared-secret token for the dashboard. When empty, no authentication is required (loopback clients still get security headers; non-loopback clients get a warning).

func SetDashWrite

func SetDashWrite(allow bool)

SetDashWrite enables or disables browser prompt submissions (the cmd layer wires this to Options.SetDashWrite).

func StartDashboard

func StartDashboard(addr string)

startDashboard subscribes to the core.Bus and serves the dashboard on addr. Runs in a goroutine; returns immediately. Best-effort — a bind failure warns and the agent continues (the dashboard is optional).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL