website

command
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 20 Imported by: ? 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

Command website shows how a website embeds the harness as a Go library: one process serving its own pages and endpoints next to the agent.

WEBSITE_ADDR=:8080 LLM_API_KEY=... go run ./examples/website

What it demonstrates (docs/embedding.md has the step-by-step):

  • an Authenticator that maps the site's session to a user id (here a header set by the site's own auth layer; never trust one from a browser);
  • per-user thread listing, with ownership enforced by the harness (a thread of another user is "not found");
  • a host-defined tool (lookup_order) registered with a Feature, scoped to the user the run belongs to;
  • a per-request choice of Sandbox: off for questions and API calls, auto (sandbox created lazily on the first command) when the user asks for code;
  • hosts/web's JSON+SSE handler mounted under /agent/;
  • graceful shutdown: stop accepting requests, let in-flight runs finish.

One process (this file) uses the in-memory queue and event log. To scale out, keep the same code but give harness.Options a Postgres store (store/pgstore) and Redis (redisinfra.Infra as Options.Infra); the web processes then never call h.Run (they only Send and stream events) and the agent processes run hosts/worker; see docs/embedding.md.

Jump to

Keyboard shortcuts

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