feat(ui,judgement,system): unify nav, surface built-in guards, readiness and decision reasoning
This commit is contained in:
34 files changed
+548
-103
No files matched your search
@@ -33,6 +33,16 @@ type Sources struct {
|
||||
Waiting func(context.Context) (Waiting, error)
|
||||
// LastFailedRun is the most recent run that failed; nil when none has.
|
||||
LastFailedRun func(context.Context) (*runs.RunView, error)
|
||||
// Setup reports what the instance still needs before workflows and chat can run.
|
||||
Setup func(context.Context) []SetupStep
|
||||
}
|
||||
|
||||
// SetupStep is one readiness item on the Home dashboard.
|
||||
type SetupStep struct {
|
||||
Title string `json:"title"`
|
||||
Detail string `json:"detail,omitzero"`
|
||||
Done bool `json:"done"`
|
||||
Path string `json:"path,omitzero"`
|
||||
}
|
||||
|
||||
// UseHealth sets where the health report reads from.
|
||||
@@ -80,8 +90,9 @@ type Health struct {
|
||||
Connectors []connectors.Health `json:"connectors"`
|
||||
Runner Runner `json:"runner"`
|
||||
// Waiting is absent when it could not be read; that is a failed check.
|
||||
Waiting *Waiting `json:"waiting,omitzero"`
|
||||
LastFailure *Failure `json:"last_failure,omitzero"`
|
||||
Waiting *Waiting `json:"waiting,omitzero"`
|
||||
LastFailure *Failure `json:"last_failure,omitzero"`
|
||||
Setup []SetupStep `json:"setup,omitzero"`
|
||||
}
|
||||
|
||||
func (m *Module) registerHealth(api huma.API) {
|
||||
@@ -133,6 +144,9 @@ func (m *Module) getHealth(ctx context.Context, _ *struct{}) (*httpapi.Reply[Hea
|
||||
}
|
||||
h.Healthy = healthy(h)
|
||||
h.LastFailure = lastFailure(h, lastRun)
|
||||
if src.Setup != nil {
|
||||
h.Setup = src.Setup(ctx)
|
||||
}
|
||||
return httpapi.OK(h), nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user