dashboard

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 29 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package dashboard is kōjō's web UI and its API, served by the same binary as everything else. It is the day-2 control plane: skills, repositories, schedules, models, budgets, merge policy and RBAC are changed here, each change a versioned revision with one-click rollback. Secrets are never entered or shown here: the dashboard only names credentials.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deps

type Deps struct {
	Boot    *config.Boot
	Store   store.Store
	Config  *config.Manager
	Skills  *skills.Resolver
	Engine  *core.Engine
	Models  models.Gateway
	Forges  map[string]forge.Forge
	Eval    Evaluator
	History HistoryEvaluator
	Doctor  DoctorFunc
	Schemas map[string]json.RawMessage
	Log     *slog.Logger
	Version string
}

Deps is everything the dashboard needs.

type DoctorFunc

type DoctorFunc func(ctx context.Context) any

DoctorFunc runs the doctor checks and returns its report.

type Evaluator

type Evaluator interface {
	// Start begins an eval of a skill (or of a draft of it) and returns the
	// run's ID at once; the run continues in the background.
	Start(ctx context.Context, skill, draftID, author string) (string, error)
	// HasFixtures reports whether the skill has eval fixtures at all.
	HasFixtures(skill string) bool
}

Evaluator runs skill evals. internal/eval implements it.

type HistoryEvaluator

type HistoryEvaluator interface {
	// StartHistory mines and validates the cases in the background and
	// returns the run's ID at once. No model runs before ConfirmHistory.
	StartHistory(ctx context.Context, skill string, spec store.HistoryRun, author string) (string, error)
	// ConfirmHistory starts the model runs of a validated run, unless its
	// cost bound is now above maxCostUSD.
	ConfirmHistory(ctx context.Context, id string, maxCostUSD float64, author string) (*store.EvalRun, error)
}

HistoryEvaluator runs evals from a repository's own history: merged pull requests that fixed an issue, replayed at the commit before the fix and judged by the fix's tests. internal/eval implements it.

type Identity

type Identity struct {
	// Subject is the OIDC subject, or "token:<name>" for an API token.
	Subject string   `json:"subject"`
	Email   string   `json:"email,omitempty"`
	Name    string   `json:"name,omitempty"`
	Roles   []string `json:"roles"`
	// Token is true for API tokens, which need no CSRF header.
	Token bool `json:"token,omitempty"`
}

Identity is who makes a request.

func (*Identity) Actor

func (i *Identity) Actor() string

Actor is the name the identity is audited under.

func (*Identity) Can

func (i *Identity) Can(role string) bool

Can reports whether the identity has at least the given role.

type Server

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

Server is the dashboard: the web UI and the JSON API under /api/v1.

func New

func New(ctx context.Context, d Deps) (*Server, error)

New builds the dashboard. It contacts the OIDC issuer when one is configured.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler serves the UI and the API.

Jump to

Keyboard shortcuts

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