Expose profile and prompt identity listings

This commit is contained in:
2026-10-09 04:28:23 +00:00
parent 4d1895c223
commit a27ee8f7da
4 changed files with 212 additions and 1 deletions

View File

@@ -83,6 +83,12 @@ func (o *Options) SetSchemaFile(path string) error {
type Engine struct {
runner *usecase.Runner
inspection configuration.Inspection
listing identityInventory
}
type identityInventory interface {
ListProfiles(context.Context) ([]string, error)
ListPrompts(context.Context) ([]domain.PromptIdentity, error)
}
// New assembles an engine from facade-selected configuration and collaborators.
@@ -135,6 +141,7 @@ func New(cfg Config, options Options) (*Engine, error) {
return &Engine{
runner: usecase.NewRunnerWithRepairer(snapshot, snapshot, reader, prompt.NewCompiledRenderer(snapshot), client, validator, usecase.NewDefaultOutputRepairer(client), manager, defaultRetries),
inspection: snapshot.Inspection(),
listing: snapshot,
}, nil
}
@@ -187,6 +194,14 @@ func (e *Engine) InspectRequirements(
func (e *Engine) InspectProfile(ctx context.Context, id string) (*domain.ProfileInspection, error) {
return e.runner.InspectProfile(ctx, id)
}
func (e *Engine) ListProfiles(ctx context.Context) ([]string, error) {
return e.listing.ListProfiles(ctx)
}
func (e *Engine) ListPrompts(ctx context.Context) ([]domain.PromptIdentity, error) {
return e.listing.ListPrompts(ctx)
}
func (e *Engine) Prepare(ctx context.Context, request domain.RunRequest) (*domain.PreparedRun, error) {
return e.runner.Prepare(ctx, request)
}