adminui

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Module(
	"adminui",
	fx.Provide(
		newConfiguredLogBuffer,
		NewRuntimeSnapshotProvider,
		codexappserver.NewBridge,
		func(buf *LogBuffer) tclog.Sink { return buf },
	),
	fx.Invoke(registerRoutes),
	fx.Invoke(registerStartup),
)

Module hosts a minimal embedded UI on the existing admin/health server.

Functions

This section is empty.

Types

type AdminSnapshotProvider

type AdminSnapshotProvider func() logExportAdminSnapshots

AdminSnapshotProvider returns the current support-facing admin API snapshots for export bundles.

type ChannelStatus

type ChannelStatus struct {
	Name          string                  `json:"name"`
	Enabled       bool                    `json:"enabled"`
	ServerKind    MCPServerKind           `json:"server_kind"`
	TransportKind config.MCPTransportKind `json:"transport_kind,omitempty"`
	ProbeStatus   string                  `json:"probe_status,omitempty"`
	ProbeError    string                  `json:"probe_error,omitempty"`
	Reason        string                  `json:"reason,omitempty"`
	Details       []ChannelStatusDetail   `json:"details,omitempty"`
}

ChannelStatus describes the runtime availability of a tunnel-client channel.

func BuildChannelStatuses

func BuildChannelStatuses(
	mcpCfg *config.MCPConfig,
	harpoonRegistry *harpoon.Registry,
	stdioInfoProvider mcpclient.ChannelStdioRuntimeInfoProvider,
	probeState *mcpclient.ProbeState,
) []ChannelStatus

BuildChannelStatuses returns the ordered list of channel statuses for the current runtime state.

type ChannelStatusDetail

type ChannelStatusDetail struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

ChannelStatusDetail describes a transport-specific detail shown in the overview table.

type LogBuffer

type LogBuffer struct {
	// contains filtered or unexported fields
}

LogBuffer stores the most recent log events in memory and supports fan-out streaming.

It is intentionally simple: a fixed-size ring plus a best-effort broadcast to subscribers (slow subscribers will drop events).

func NewLogBuffer

func NewLogBuffer() *LogBuffer

func NewLogBufferWithCapacity

func NewLogBufferWithCapacity(capacity int) *LogBuffer

func (*LogBuffer) Capacity

func (b *LogBuffer) Capacity() int

func (*LogBuffer) Handle

func (b *LogBuffer) Handle(ctx context.Context, record slog.Record)

Handle implements github.com/openai/tunnel-client/pkg/log.Sink.

func (*LogBuffer) Recent

func (b *LogBuffer) Recent(limit int) []LogEvent

func (*LogBuffer) Since

func (b *LogBuffer) Since(since time.Time, limit int) []LogEvent

func (*LogBuffer) StartedAt

func (b *LogBuffer) StartedAt() time.Time

func (*LogBuffer) Subscribe

func (b *LogBuffer) Subscribe(ctx context.Context) <-chan LogEvent

type LogEvent

type LogEvent struct {
	Seq     int64          `json:"seq"`
	Time    time.Time      `json:"time"`
	Level   string         `json:"level"`
	Message string         `json:"message"`
	Attrs   map[string]any `json:"attrs,omitempty"`
}

LogEvent is the structured representation exposed by the admin UI.

type MCPServerKind

type MCPServerKind string

MCPServerKind describes the kind of MCP server backing a channel.

const (
	MCPServerKindExternal MCPServerKind = "external"
	MCPServerKindBuiltin  MCPServerKind = "builtin"
)

type MetricsSnapshotProvider

type MetricsSnapshotProvider func() (metricsSnapshot, error)

MetricsSnapshotProvider returns a point-in-time Prometheus text snapshot for support log exports.

func NewMetricsSnapshotProvider

func NewMetricsSnapshotProvider(exporter http.Handler) MetricsSnapshotProvider

type RuntimeSnapshotProvider

type RuntimeSnapshotProvider func() logExportRuntime

RuntimeSnapshotProvider returns redacted runtime metadata for support log exports.

func NewRuntimeSnapshotProvider

func NewRuntimeSnapshotProvider(cfg *config.Config) RuntimeSnapshotProvider

Jump to

Keyboard shortcuts

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