Documentation
¶
Overview ¶
Package demo renders the agentscope screen from a SYNTHETIC, deterministic scenario into one animated SVG, for demo videos and documentation.
The scenario drives the SAME view-model as the live screen (ui.ViewModel): a step applies a snapshot, switches a tab, picks a theme or a language, exactly as the browser or the server would. Nothing is drawn by hand and nothing is read from this machine: every account, plan, session and repository below is invented, and the clock is a constant, so the same scenario yields the same bytes on every run.
Index ¶
- Constants
- Variables
- func DiagSnapshot(o DiagOpts) model.Snapshot
- func Names() []string
- func Snapshot(labColor, personalColor string) model.Snapshot
- func Usage(labColor, personalColor string) *model.Usage
- type BudgetMode
- type DiagOpts
- type Env
- type GuardMode
- type HTML
- type Options
- type Result
- type Scenario
- type Step
- type WebM
Constants ¶
const ( // DiagnoseMin and DiagnoseMax bound the capture's duration: about three minutes. DiagnoseMin = 170 * time.Second DiagnoseMax = 190 * time.Second )
Variables ¶
var Epoch = time.Date(2030, 1, 15, 10, 0, 0, 0, time.UTC)
Epoch is the demo's fixed "now". Nothing in the output reads the real clock.
Functions ¶
func DiagSnapshot ¶ added in v0.16.0
DiagSnapshot is the picture a diagnosis starts from, at Epoch: Snapshot's five sessions, changed so that every kind of trouble the screen can show is in it. Session 0 is near compaction (95 % of its window) and its reviewer sub-agent is hot; session 1 is hot; session 3 is idle for hours yet still holds a repository; session 5 has no transcript and holds a lease; four leases have expired; three anomalies are listed; the Acme Lab account is at 97 % of its week; one account's reading is stale and one is not counted.
Types ¶
type BudgetMode ¶ added in v0.21.0
type BudgetMode int
BudgetMode says what the REST budget pane has to show.
const ( // BudgetNone: the view has not been built yet (nil data). BudgetNone BudgetMode = iota // BudgetRunning: the budget is low and someone is spending it. BudgetRunning // BudgetUnread: no token file and an empty ledger: nothing is claimed. BudgetUnread )
type DiagOpts ¶ added in v0.16.0
type DiagOpts struct {
LabColor, PersonalColor string
PersonalAlias string // "" keeps "Personal"
QuotaErr bool // the quota API refused: the notes say so
Guard GuardMode
Budget BudgetMode
}
DiagOpts picks the diagnostic situation of DiagSnapshot.
type Env ¶
Env is what a step may touch: the screen and its view-model, the only door the live UI has too.
type GuardMode ¶ added in v0.16.0
type GuardMode int
GuardMode says what the Guardrails tab has to show.
type HTML ¶ added in v0.19.0
HTML is one rendered scenario as a self-contained player page: the same SVG, inlined, with play/pause, a seek bar and the keyboard controls.
func RenderHTML ¶ added in v0.19.0
RenderHTML renders the scenario and wraps its SVG in the player page of go-widgets/svg. The page chrome is in the language the capture was recorded in (read from the view-model), so diagnose is English and diagnose-fr French.
type Options ¶
type Options struct {
W, H int
// Zone is the location the drawn times are written in. nil means UTC, never
// the machine's zone: a capture is the same bytes everywhere.
Zone *time.Location
}
Options tune Render. The zero value renders capture.DefaultSize.
type Result ¶
type Result struct {
*capture.Result
LangSel []int // the view-model's language setting when each frame was recorded
}
Result is one rendered scenario: the recording, and what the view-model said about the language when each frame was taken.
type Step ¶
Step is one beat of a scenario: Do changes the view-model, then the screen is recorded and held for Hold.
type WebM ¶ added in v0.15.0
WebM is one rendered scenario as a video.
func RenderWebM ¶ added in v0.15.0
RenderWebM plays the scenario exactly as Render does and encodes the frames it recorded, rasterised, as a VP8 WebM. quality 0 means webm.DefaultQuality.