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
@@ -8,6 +8,8 @@ import (
|
||||
"github.com/samcharles93/archie-core/internal/platform/health"
|
||||
"github.com/samcharles93/archie-core/modules/approvals"
|
||||
"github.com/samcharles93/archie-core/modules/connectors"
|
||||
"github.com/samcharles93/archie-core/modules/events"
|
||||
"github.com/samcharles93/archie-core/modules/governance"
|
||||
"github.com/samcharles93/archie-core/modules/runs"
|
||||
"github.com/samcharles93/archie-core/modules/system"
|
||||
)
|
||||
@@ -15,7 +17,7 @@ import (
|
||||
// healthSources joins what each module knows about itself into the sources the
|
||||
// system health report reads. The report asks them on demand, so nothing here
|
||||
// polls or keeps state.
|
||||
func healthSources(checks *health.Registry, conns *connectors.Module, engine *runs.Engine, allow *approvals.Module) system.Sources {
|
||||
func healthSources(checks *health.Registry, conns *connectors.Module, engine *runs.Engine, allow *approvals.Module, settings *governance.Module, hear *events.Module) system.Sources {
|
||||
return system.Sources{
|
||||
Checks: func(ctx context.Context) []health.Result {
|
||||
return slices.DeleteFunc(checks.Results(ctx), func(r health.Result) bool {
|
||||
@@ -39,5 +41,23 @@ func healthSources(checks *health.Registry, conns *connectors.Module, engine *ru
|
||||
LastFailedRun: func(ctx context.Context) (*runs.RunView, error) {
|
||||
return engine.LastFailed(ctx, orgID)
|
||||
},
|
||||
Setup: func(ctx context.Context) []system.SetupStep {
|
||||
_, modelErr := settings.AgentModel(ctx)
|
||||
sources, srcErr := hear.SourceCount(ctx)
|
||||
return []system.SetupStep{
|
||||
{
|
||||
Title: "Set an agent model",
|
||||
Detail: "Configure a model provider and assign the agent role so workflows and chat can run.",
|
||||
Done: modelErr == nil,
|
||||
Path: "/settings/models",
|
||||
},
|
||||
{
|
||||
Title: "Add an event source",
|
||||
Detail: "Connect a webhook or polling source to start receiving events.",
|
||||
Done: srcErr == nil && sources > 0,
|
||||
Path: "/events?tab=sources",
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -219,7 +219,7 @@ func wire(log *slog.Logger, configPath string, cfg Config, db *sqlx.DB) (*binary
|
||||
remember.UseProposals(proposed)
|
||||
// Approving an action that can't be undone needs a fresh passkey assertion.
|
||||
proposed.UseConfirmer(settings)
|
||||
sys.UseHealth(healthSources(checks, conns, engine, allow))
|
||||
sys.UseHealth(healthSources(checks, conns, engine, allow, settings, hear))
|
||||
apiModules{
|
||||
settings: settings, conns: conns, system: sys, tell: tell, allow: allow, actionTypes: actionTypes, policies: policies,
|
||||
hear: hear, judge: judge, engine: engine, chat: talk, proposals: proposed,
|
||||
|
||||
Reference in new issue
Block a user