view

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentsLayout

func AgentsLayout(base, activePage string) templ.Component

AgentsLayout wraps every Agents page with a two-column shell: a fixed left sidebar nav and a flex-1 main content area. The framework's c.HTML already wraps this in the global page shell (navbar + theme), so this component only adds the two-column layout.

func ApprovalModal

func ApprovalModal(base string) templ.Component

ApprovalModal renders the empty modal shell. JS populates fields from the SSE `approval_request` event payload and toggles visibility. Lives at the bottom of the page so its z-index sits above tab content + sticky composers.

Decision values match gate.Decision* constants exactly — the JS passes them straight through to POST /approve.

func ApprovedCommandsPanel

func ApprovedCommandsPanel(base, sessionID string) templ.Component

ApprovedCommandsPanel renders the collapsible "Approved commands" section in session detail. Empty by default — JS hydrates it from GET /approvals snapshot on tab load and on each SSE approval_resolved that touched session/always state.

func AskUserCard

func AskUserCard(base string) templ.Component

AskUserCard is the empty inline card that JS hydrates when an ask_user request lands. Rendered once per session detail page; hidden by default. Lives above the composer so the user can answer without scrolling.

func ChannelConfigPage

func ChannelConfigPage(vm ChannelConfigVM) templ.Component

ChannelConfigPage shows config fields for one channel.

func ChannelListPage

func ChannelListPage(vm ChannelListVM) templ.Component

ChannelListPage shows available channels as cards.

func GateDisabledBanner

func GateDisabledBanner(g GateStatusVM) templ.Component

GateDisabledBanner is the warning bar shown at the top of session pages when the parent process couldn't resolve a gate binary. Hidden when Enabled=true. Rendered above the session detail so operators see "agent will run unconstrained" without scrolling down to the providers page to figure out why.

func Overview

func Overview(vm OverviewVM) templ.Component

func PresetEditor

func PresetEditor(vm PresetDetailVM) templ.Component

func PresetsPage

func PresetsPage(vm PresetsVM) templ.Component

func ProviderSpawnDetail

func ProviderSpawnDetail(vm ProviderSpawnDetailVM) templ.Component

ProviderSpawnDetail renders the event timeline of one spawn log file.

func ProvidersPage

func ProvidersPage(vm ProvidersVM) templ.Component

ProvidersPage renders the Providers overview: per-instance status cards, pool capacity, and recent spawn logs. Static — user reloads to refresh.

func SessionDetail

func SessionDetail(vm SessionDetailVM) templ.Component

SessionDetail renders the session detail page with tabs and composer.

func SessionsList

func SessionsList(vm SessionsListVM) templ.Component

SessionsList renders the paginated sessions table with a create form.

func SessionsTable

func SessionsTable(vm SessionsTableVM) templ.Component

SessionsTable is the reusable sessions list. The Sessions full page renders it with paging; the Overview "Active Sessions" panel renders it with EmptyText="No active sessions" and ShowPaging=false.

func WorkspacesPage

func WorkspacesPage(vm WorkspacesVM) templ.Component

Types

type ChannelConfigVM

type ChannelConfigVM struct {
	Base        string
	ChannelName string
	ChannelSlug string
	Rows        []entity.Config
	ActionBase  string
}

ChannelConfigVM is the view model for a single channel's config page.

type ChannelListVM

type ChannelListVM struct {
	Base     string
	Channels []ChannelVM
}

ChannelListVM is the view model for the Channels index page.

type ChannelVM

type ChannelVM struct {
	Name        string
	Slug        string // "slack" | "telegram"
	Icon        string
	Description string
	Configured  bool   // true when the required credential is set
	HRef        string // link to config page
}

ChannelVM is one channel card on the channels list page.

type GateStatusVM

type GateStatusVM struct {
	Enabled bool
	Binary  string // absolute path (when enabled)
	Source  string // "sibling" | "embed" | "path" — debug aid
	Reason  string // why disabled, when Enabled=false
	Note    string // human-readable behavior summary; rendered as-is
}

GateStatusVM is the small "is the command gate alive?" card on the Providers page. The fields cover the three things an operator needs to glance at when claude is misbehaving:

  • Enabled: was the parent able to resolve a gate binary?
  • Binary: which one (env override / sibling / PATH)?
  • Note: one-sentence consequence text — what gets blocked.

type OverviewVM

type OverviewVM struct {
	Base          string
	Active        int
	QueueLen      int
	PoolMax       int
	SessionIDs    []string
	Sessions      map[string]session.Session
	Lifecycle     map[string]SessionLifecycleVM
	IdleTimeoutMs int64
	Queued        []QueuedEntryVM
}

OverviewVM holds data for the Overview page. SessionIDs is the active-only subset (spawning/working/idle) — Killed sessions live in /sessions, not on the Overview. Queued is the per-session FIFO snapshot — operators can kill a queue entry that's been waiting too long.

type PresetDetailVM

type PresetDetailVM struct {
	Base string
	Name string
	Body string
}

PresetDetailVM holds data for the Preset editor page.

type PresetsVM

type PresetsVM struct {
	Base  string
	Names []string
}

PresetsVM holds data for the Presets list page.

type ProviderChoiceVM

type ProviderChoiceVM struct {
	Type    string
	Name    string
	Version string
}

ProviderChoiceVM is one healthy provider row — what the New Session picker offers. Disabled / unprobed / version-failed providers never reach the UI.

type ProviderSpawnDetailVM

type ProviderSpawnDetailVM struct {
	Base   string
	File   provider.SpawnLogFile
	Events []provider.SpawnEvent
}

ProviderSpawnDetailVM holds data for one spawn-log file timeline.

type ProvidersVM

type ProvidersVM struct {
	Base          string
	Statuses      []provider.Status
	Spawns        []provider.SpawnLogFile
	Page          int
	HasNext       bool
	PoolActive    int
	PoolQueueLen  int
	PoolMax       int
	SupportedKeys []string
	Gate          GateStatusVM
	AutoRescan    bool
}

ProvidersVM holds data for the Providers page — runtime instance statuses, recent spawn log files, and live pool capacity. Spawns is the current page slice; Page/HasNext drive the pager.

type QueuedEntryVM

type QueuedEntryVM struct {
	SessionID string
	AgentName string
	WaitingMs int64
}

QueuedEntryVM is one row in the queue panel. WaitingMs drives a "waiting Ns" label so operators see how stale the entry is.

type SessionDetailVM

type SessionDetailVM struct {
	Base          string
	Session       session.Session
	Tab           string // "conversation" | "commands" | "raw"
	Turns         []TurnVM
	CmdLines      []string
	Lifecycle     string
	PID           int
	LastActiveMs  int64
	IdleTimeoutMs int64
	Gate          GateStatusVM
}

SessionDetailVM holds data for the Session detail page.

Lifecycle / PID / LastActiveMs / IdleTimeoutMs feed the realtime status badge: the server emits the snapshot at render time and JS updates it from SSE events thereafter.

type SessionLifecycleVM

type SessionLifecycleVM struct {
	Lifecycle    string
	PID          int
	LastActiveMs int64
}

SessionLifecycleVM is the per-row lifecycle snapshot the sessions list table renders. PID + LastActiveMs feed the countdown ring; Lifecycle is the colour key.

type SessionsListVM

type SessionsListVM struct {
	Base          string
	IDs           []string
	Sessions      map[string]session.Session
	Workspaces    map[string]workspace.Workspace
	WorkspaceList []string
	PresetList    []string
	Providers     []ProviderChoiceVM
	Lifecycle     map[string]SessionLifecycleVM
	IdleTimeoutMs int64
	Page          int
	HasNext       bool
}

SessionsListVM holds data for the Sessions list page. Lifecycle is keyed by session ID so each row can render the live badge — empty means no live entry in the pool (badge falls back to "killed" / no-agent).

type SessionsTableVM

type SessionsTableVM struct {
	Base          string
	IDs           []string
	Sessions      map[string]session.Session
	Lifecycle     map[string]SessionLifecycleVM
	IdleTimeoutMs int64
	EmptyText     string
	ShowPaging    bool
	Page          int
	HasNext       bool
}

SessionsTableVM feeds the reusable sessions list table component. The full /sessions page sets ShowPaging=true; the Overview "Active Sessions" panel sets ShowPaging=false and uses a tighter EmptyText.

type TurnVM

type TurnVM struct {
	Role      string // "user" | "assistant" | "system"
	Agent     string
	Text      string
	Truncated bool
	Time      time.Time
}

TurnVM is one conversation turn for the UI.

type WorkspacesVM

type WorkspacesVM struct {
	Base          string
	WorkspaceList []string
	Workspaces    map[string]workspace.Workspace
	PresetList    []string
}

WorkspacesVM holds data for the Workspaces page.

Jump to

Keyboard shortcuts

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