view

package
v0.11.13 Latest Latest
Warning

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

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

Documentation

Overview

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

templ: version: v0.3.1020

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentsLayout

func AgentsLayout(vm AgentsLayoutVM) templ.Component

AgentsLayout wraps every Agents page with a full-screen Claude-style shell: sidebar left (nav + recent sessions) and flex-1 main content area.

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 RestDocs added in v0.10.0

func RestDocs(vm RestDocsVM) templ.Component

RestDocs renders usage docs + a copyable curl sample for the REST channel.

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 full "All chats" page with search.

func SessionsTable

func SessionsTable(vm SessionsTableVM) templ.Component

SessionsTable is the reusable sessions card list. The Sessions full page renders it with paging; the Overview "Active Sessions" panel renders it without paging.

func SettingsPage added in v0.10.0

func SettingsPage(vm SettingsVM) templ.Component

SettingsPage renders agents settings inside AgentsLayout, reusing the manager ConfigsTable component. POSTs go to the existing /manager/tools/agents/configs/{key} endpoint.

func WorkspacesPage

func WorkspacesPage(vm WorkspacesVM) templ.Component

Types

type AgentsLayoutVM added in v0.10.0

type AgentsLayoutVM struct {
	Base             string
	ActivePage       string
	SidebarIDs       []string
	SidebarSessions  map[string]session.Session
	SidebarLifecycle map[string]SessionLifecycleVM
	SidebarLabels    map[string]string // session id → first user message preview
	ActiveSessionID  string
	IdleTimeoutMs    int64
}

AgentsLayoutVM carries sidebar data for the full-screen Claude-style shell.

type ChannelConfigVM

type ChannelConfigVM struct {
	Layout      AgentsLayoutVM
	Base        string
	ChannelName string
	ChannelSlug string
	Rows        []entity.Config
	ActionBase  string
	// Docs is an optional component rendered below the config table.
	// Channels use it to surface usage notes, sample requests, or links
	// to related pages (e.g. PAT management for REST).
	Docs templ.Component
}

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

type ChannelListVM

type ChannelListVM struct {
	Layout   AgentsLayoutVM
	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

	// BypassLocked is true when agents.bypass_permissions=true. In that
	// state the gate is forced off (spawner strips the hook config) and
	// the UI must hide the toggle / per-provider enable buttons so the
	// operator can't trigger no-op actions. Mutually exclusive with
	// Enabled — never both true at once.
	BypassLocked bool
}

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 {
	Layout        AgentsLayoutVM
	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 {
	Layout AgentsLayoutVM
	Base   string
	Name   string
	Body   string
}

PresetDetailVM holds data for the Preset editor page.

type PresetsVM

type PresetsVM struct {
	Layout AgentsLayoutVM
	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 {
	Layout AgentsLayoutVM
	Base   string
	File   provider.SpawnLogFile
	Events []provider.SpawnEvent
}

ProviderSpawnDetailVM holds data for one spawn-log file timeline.

type ProvidersVM

type ProvidersVM struct {
	Layout        AgentsLayoutVM
	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 RestDocsVM added in v0.10.0

type RestDocsVM struct {
	Base       string // wick base (for /profile/tokens link)
	Endpoint   string // full URL of the chat completions endpoint
	SampleUser string // session key shown in samples
}

RestDocsVM is the view model for the REST channel's docs panel.

type SessionDetailVM

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

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 {
	Layout        AgentsLayoutVM
	Base          string
	IDs           []string
	Sessions      map[string]session.Session
	Labels        map[string]string // id → first user message preview
	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 SettingsVM added in v0.10.0

type SettingsVM struct {
	Layout AgentsLayoutVM
	Base   string
	Rows   []entity.Config
}

SettingsVM is the view model for the embedded settings page.

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 {
	Layout        AgentsLayoutVM
	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