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 ¶
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.