view

package
v0.28.2 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 14 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

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 BuildReproVariants added in v0.28.1

func BuildReproVariants(providerType, binary string, argv, env []string) map[string]string

BuildReproVariants renders all 24 reproduce commands (3 shells × headless/ interactive × full/short path × keep/strip resume) for the given binary, argv, and env. The same function serves the masked page render and the unmasked reveal endpoint — callers pass masked vs unmasked env so the keys line up exactly.

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 ConnectorsPage added in v0.22.2

func ConnectorsPage(vm ConnectorsSPAVM) templ.Component

ConnectorsPage renders the manager SPA mount point inside AgentsLayout. data-base is the manager client-route prefix, so the SPA boots straight into its connectors view and stays self-consistent.

func Conversation added in v0.19.0

func Conversation(vm ConversationVM) templ.Component

Conversation renders the conversation SPA shell inside the agents chrome. The SPA reads data-base from the #app div and uses it as the prefix for all API calls (e.g. ${base}/api/sessions).

func DataTableDetailPage added in v0.13.1

func DataTableDetailPage(vm DataTableDetailVM) templ.Component

func DataTablesPage added in v0.13.1

func DataTablesPage(vm DataTablesVM) templ.Component

func HasResumeArgv added in v0.28.1

func HasResumeArgv(providerType string, argv []string) bool

HasResumeArgv reports whether argv carries a resume-session token for the provider — i.e. whether the Keep/Fresh toggle would make any difference. The first spawn of a session has no resume id, so the toggle should be hidden.

func InteractiveArgv added in v0.28.1

func InteractiveArgv(providerType string, argv []string) []string

InteractiveArgv strips the headless/programmatic tokens wick adds (per provider.ReproSpec) so the command runs in the CLI's normal interactive chat mode instead of emitting a JSON stream. Everything else (--mcp-config, --add-dir, --resume, …) is kept so the session context is identical.

func NewSessionSPA added in v0.19.0

func NewSessionSPA(vm NewSessionSPAVM) templ.Component

NewSessionSPA renders the new-session compose SPA shell inside the agents chrome. The SPA reads data-base from the #app div and uses it as the prefix for all API calls (e.g. ${base}/providers/options).

func OverviewSPA added in v0.19.0

func OverviewSPA(vm OverviewSPAVM) templ.Component

OverviewSPA renders the overview SPA shell inside the agents chrome. The SPA reads data-base from the #app div and uses it as the prefix for all API calls (e.g. ${base}/api/overview).

func PresetsSPA added in v0.19.0

func PresetsSPA(vm PresetsSPAVM) templ.Component

PresetsSPA renders the presets SPA shell inside the agents chrome. The SPA reads data-base from the #app div and uses it as the prefix for all API calls (e.g. ${base}/api/presets).

func ProjectSettingsSPA added in v0.19.0

func ProjectSettingsSPA(vm ProjectSettingsSPAVM) templ.Component

ProjectSettingsSPA renders the project-settings SPA shell inside the agents chrome. The SPA reads data-base and data-project-id from the #app div.

func ProvidersSPA added in v0.19.0

func ProvidersSPA(vm ProvidersSPAVM) templ.Component

ProvidersSPA renders the providers SPA shell inside the agents chrome. The SPA reads data-base from the #app div and uses it as the prefix for all API calls (e.g. ${base}/api/providers).

func ReproKey added in v0.28.1

func ReproKey(shell string, interactive, short, resume bool) string

ReproKey names a reproduce variant by its four axes. Used as the map key in BuildReproVariants and mirrored by the front-end / reveal keys.

shell: "bash" | "powershell" | "cmd"
interactive: headless "h" vs interactive "i"
short: full path "full" vs basename "short"
resume: keep resume "res" vs fresh session "new"

func RestDocs added in v0.10.0

func RestDocs(vm RestDocsVM) templ.Component

RestDocs renders usage docs for the three OpenAI-compatible routes the REST channel exposes. Top section is the common contract (base URL, auth, streaming, approvals); below it a tab strip jumps between per-endpoint examples.

func Router9Page added in v0.28.1

func Router9Page(vm Router9VM) templ.Component

Router9Page renders the 9router SPA shell inside the agents chrome. The SPA reads data-base / data-autostart / data-external from the #app div.

func SettingsPage added in v0.10.0

func SettingsPage(vm SettingsVM) templ.Component

SettingsPage renders agents settings inside AgentsLayout. The system_prompt row is broken out into its own panel so the textarea can render full-height and carry a Reset-to-default button. Remaining rows fall back to the generic ConfigsTable. POSTs target /manager/tools/agents/configs/{key}.

func ShellReproduceBash added in v0.28.1

func ShellReproduceBash(binary string, argv, env []string, short bool) string

ShellReproduceBash renders a POSIX/bash command: inline VAR='v' assignments on continuation lines, then the quoted command. short=true uses the binary basename (rely on PATH); otherwise the full path is rewritten to MSYS form (C:\… → /c/…) so it resolves in git-bash/msys2.

func ShellReproduceCmd added in v0.28.1

func ShellReproduceCmd(binary string, argv, env []string, short bool) string

ShellReproduceCmd renders a cmd.exe command: one `set "KEY=v"` per line, then the command with double-quote quoting. NOTE: cmd.exe reproduction is best-effort — a JSON arg like --mcp-config contains double-quotes which must be doubled ("") inside a quoted arg, and cmd's quoting/escaping is finicky. PowerShell or bash reproduce such args more reliably.

func ShellReproducePwsh added in v0.28.1

func ShellReproducePwsh(binary string, argv, env []string, short bool) string

ShellReproducePwsh renders a PowerShell command: one $env:KEY='v' statement per line, then the command with PowerShell single-quote quoting. The binary is invoked with the call operator `&` — a quoted string on its own is just a literal in PowerShell (it echoes, doesn't execute); `& 'path'` runs it.

func SkillsSPA added in v0.19.0

func SkillsSPA(vm SkillsSPAVM) templ.Component

SkillsSPA renders the skills SPA shell inside the agents chrome. The SPA reads data-base from the #app div and uses it as the prefix for all API calls (e.g. ${base}/api/skills).

func StripResumeArgv added in v0.28.1

func StripResumeArgv(providerType string, argv []string) []string

StripResumeArgv drops the resume-session tokens (per provider.ReproSpec) so the command starts a fresh session instead of continuing the logged one.

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
	// Projects powers the sidebar Projects section + per-row project
	// chips. Keyed by project id; ProjectList is the display order.
	Projects    map[string]project.Project
	ProjectList []string
	// ProjectCounts is the number of sessions bound to each project id
	// (sidebar pill). ScopedProjectID, when set, highlights the active
	// project row + drives the scoped breadcrumb.
	ProjectCounts   map[string]int
	ScopedProjectID string
	// PinnedProjectID is the current user's pinned (personal-default)
	// project id, shown with a 📌 in the sidebar. Empty = none.
	PinnedProjectID string
	// FullBleed=true skips the layout's default px-6 py-6 padding
	// wrapper so the page can paint edge-to-edge. The workflow
	// editor needs the full viewport for its canvas; padded pages
	// (sessions, presets, …) leave this false.
	FullBleed bool
	// ShellAssetURL is the hashed bundle URL for the agents-shell island
	// (fe/agents/shell). AgentsLayout emits a <script type="module"> for
	// this URL so every agents page gets pin + drag-to-move sidebar
	// behaviors. Empty when the bundle has not been built yet (dev
	// machine before npm run build).
	ShellAssetURL string
	// Router9Visible controls the "9router" sidebar entry. True when the
	// master switch is on AND the caller may access it (admin or a granted
	// access tag) — so non-admins with the tag see the link, and everyone
	// loses it when 9router is disabled.
	Router9Visible bool
}

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

func (AgentsLayoutVM) NewSessionHref added in v0.14.21

func (vm AgentsLayoutVM) NewSessionHref() string

NewSessionHref is the "New session" nav target. When the sidebar is scoped to a project, it carries `?project=<id>` so the compose form auto-selects that project (mockup ②).

func (AgentsLayoutVM) ProjectIcon added in v0.14.21

func (vm AgentsLayoutVM) ProjectIcon(id string) string

ProjectIcon returns the emoji icon for a project id (📁 fallback).

func (AgentsLayoutVM) ProjectName added in v0.14.21

func (vm AgentsLayoutVM) ProjectName(id string) string

ProjectName returns the display name for a project id, or the id itself when unknown. Used by sidebar / session rows.

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 ConnectorsSPAVM added in v0.22.2

type ConnectorsSPAVM struct {
	Layout   AgentsLayoutVM
	Base     string
	AssetURL string
	// Deep is an optional client-route path (e.g. /connectors/slack/123)
	// forwarded by manager's connectors→agents redirect. The SPA router
	// reads it from data-deep on boot to open that view directly, so a
	// reload/deep link of a /manager/connectors URL lands on the same page
	// inside the Agents shell rather than the connectors index.
	Deep string
}

ConnectorsSPAVM hosts the manager SPA inside the Agents chrome. Base + AssetURL come from manager.SPAMount() — the SAME bundle the /manager pages serve, with the client router still rooted at /manager. Mounting it here just swaps the outer shell (Agents sidebar instead of the manager navbar); every in-SPA API call and link keeps resolving against the live /manager/* routes, so no connector code moves.

type ConversationVM added in v0.19.0

type ConversationVM struct {
	Layout         AgentsLayoutVM
	Base           string
	AssetURL       string
	ScmAsset       string
	InitialSession string
	IdleTimeoutMs  int
}

ConversationVM feeds the thin-shell that hosts the conversation SPA inside the standard agents layout. AssetURL is the hashed Vite bundle path resolved at boot via spaAssetURL("conversation"); ScmAsset is the hashed SCM bundle path used by the docked source-control panel. InitialSession, when non-empty, causes the SPA to deep-link directly to that session on load via the #app data-initial-session attribute. IdleTimeoutMs is the agents idle_timeout_sec × 1000, used by the SPA idle lifecycle badge for the "kill in Ns" countdown.

type DataTableDetailVM added in v0.13.1

type DataTableDetailVM struct {
	Layout  AgentsLayoutVM
	Base    string
	Slug    string
	Schema  datatable.Schema
	Rows    []map[string]any
	Flash   string
	SortCol string
	SortDir string                // "asc" | "desc"
	Filters map[string]FilterChip // keyed by column name
}

DataTableDetailVM is the per-table page model.

SortCol/SortDir + Filters drive the spreadsheet header indicators (active sort arrow + funnel highlight) and let the filter popover pre-fill its inputs from the live URL. Both are populated by the handler from query params; an empty SortCol means "default id ASC".

type DataTableRow added in v0.13.1

type DataTableRow struct {
	Slug      string
	Name      string
	RowCount  int
	Columns   int
	SizeBytes int64
	UpdatedAt time.Time
	CreatedAt time.Time
}

DataTableRow summarises one data table on the list page.

type DataTablesVM added in v0.13.1

type DataTablesVM struct {
	Layout AgentsLayoutVM
	Base   string
	Tables []DataTableRow
	Flash  string
}

DataTablesVM is the model for the Data Tables list page.

type FilterChip added in v0.13.1

type FilterChip struct {
	Op    string
	Value string
}

FilterChip is one applied filter for a column. Op is one of the datatable.Op* constants; Value is "" for is_empty / is_not_empty.

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

	// PermissionMode is the active value of GateConfig.PermissionMode
	// ("on" | "bypass"). "bypass" means the spawner strips the hook
	// config and runs unguarded — UI surfaces that as a locked badge
	// so operators can't toggle individual provider hooks (no-op).
	PermissionMode string

	// BypassLocked is true when PermissionMode=="bypass". Retained for
	// templ branches that already key off this flag; equivalent to
	// PermissionMode == "bypass".
	BypassLocked bool
}

GateStatusVM is the umbrella "what is the gate doing right now?" card on the Providers page. Gate covers two sub-policies — the permission prompt and the ask_user MCP tool — so the VM carries both, plus the boot-time binary resolution state for the permission hook.

type LiveProcessVM added in v0.15.2

type LiveProcessVM struct {
	SessionID string
	AgentName string
	PID       int
	Lifecycle string // "spawning" | "working" | "idle" | "killed"
	Substate  string
}

LiveProcessVM is one row in the Active Processes panel on the Providers page.

type MCPClientStatusVM added in v0.13.0

type MCPClientStatusVM struct {
	ID          string // "claude", "cursor", "gemini", "codex", "claude-code"
	Label       string // "Claude Desktop", "Cursor", …
	Detected    bool   // client config dir exists on this host
	Installed   bool   // wick entry present in client's mcpServers
	Blocklisted bool   // user manually uninstalled — skip auto-install
	ConfigPath  string // absolute path to config file (for tooltip)
}

MCPClientStatusVM is one row in the MCP Wick card — one per detected MCP client (Claude Desktop, Cursor, Gemini CLI, etc.).

type MCPStatusVM added in v0.13.0

type MCPStatusVM struct {
	AppName string
	Clients []MCPClientStatusVM
}

MCPStatusVM is the aggregate for the MCP Wick card on the Providers page.

type NewSessionSPAVM added in v0.19.0

type NewSessionSPAVM struct {
	Layout   AgentsLayoutVM
	Base     string
	AssetURL string
}

NewSessionSPAVM feeds the thin-shell that hosts the new-session compose SPA inside the standard agents layout. AssetURL is the hashed Vite bundle path resolved at boot via spaAssetURL("new-session").

type OverviewSPAVM added in v0.19.0

type OverviewSPAVM struct {
	Layout   AgentsLayoutVM
	Base     string
	AssetURL string
}

OverviewSPAVM feeds the thin-shell that hosts the overview SPA inside the standard agents layout. AssetURL is the hashed Vite bundle path resolved at boot via spaAssetURL("overview").

type PresetsSPAVM added in v0.19.0

type PresetsSPAVM struct {
	Layout   AgentsLayoutVM
	Base     string
	AssetURL string
}

PresetsSPAVM feeds the thin-shell that hosts the presets SPA inside the standard agents layout. AssetURL is the hashed Vite bundle path resolved at boot via spaAssetURL("presets").

type ProjectSettingsSPAVM added in v0.19.0

type ProjectSettingsSPAVM struct {
	Layout    AgentsLayoutVM
	Base      string
	ProjectID string
	AssetURL  string
}

ProjectSettingsSPAVM feeds the thin-shell that hosts the project-settings SPA inside the standard agents layout. AssetURL is the hashed Vite bundle path resolved at boot via spaAssetURL("project-settings").

type ProviderCapVM added in v0.15.2

type ProviderCapVM struct {
	Used      int
	Max       int
	Unlimited bool
}

ProviderCapVM is the used / effective-max slot count for one provider instance, shown on its card as "<Used> / <Max>" — or "<Used> / ∞" when Unlimited (no finite cap at provider or global scope).

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 ProvidersSPAVM added in v0.19.0

type ProvidersSPAVM struct {
	Layout   AgentsLayoutVM
	Base     string
	AssetURL string
}

ProvidersSPAVM feeds the thin-shell that hosts the providers SPA inside the standard agents layout. AssetURL is the hashed Vite bundle path resolved at boot via spaAssetURL("providers").

type RestDocsVM added in v0.10.0

type RestDocsVM struct {
	Base              string // wick external URL (also used for /profile/tokens link)
	APIBase           string // <Base>/integrations/rest/api/v1/openai — what SDK base_url points at
	ChatEndpoint      string // <APIBase>/chat/completions
	ResponsesEndpoint string // <APIBase>/responses
	ModelsEndpoint    string // <APIBase>/models
}

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

APIBase is the SDK base_url (no trailing slash). The three endpoint fields are full URLs derived from it — handler precomputes them so the templ stays free of string concat noise.

type Router9VM added in v0.28.1

type Router9VM struct {
	Layout      AgentsLayoutVM
	Base        string // /tools/agents
	AssetURL    string
	Autostart   bool
	ExternalAPI bool
}

Router9VM feeds the thin-shell that hosts the 9router SPA inside the standard agents layout. AssetURL is the hashed Vite bundle path resolved at boot via spaAssetURL("router9"). Autostart / ExternalAPI seed the Settings toggles so they render correctly before the first status poll.

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

type SettingsVM struct {
	Layout AgentsLayoutVM
	Base   string
	Rows   []entity.Config
	// SystemPromptCurrent is the live value of `system_prompt`.
	SystemPromptCurrent string
	// SystemPromptDefault is the baseline shipped with wick. Rendered as
	// the target of the Reset button.
	SystemPromptDefault string
}

SettingsVM is the view model for the embedded settings page.

type SkillsSPAVM added in v0.19.0

type SkillsSPAVM struct {
	Layout   AgentsLayoutVM
	Base     string
	AssetURL string
}

SkillsSPAVM feeds the thin-shell that hosts the skills SPA inside the standard agents layout. AssetURL is the hashed Vite bundle path resolved at boot via spaAssetURL("skills").

Directories

Path Synopsis
templ: version: v0.3.1020
templ: version: v0.3.1020

Jump to

Keyboard shortcuts

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