@@ -39,6 +39,7 @@ import (
3939 "github.com/stacklok/toolhive/pkg/container/runtime"
4040 "github.com/stacklok/toolhive/pkg/groups"
4141 "github.com/stacklok/toolhive/pkg/recovery"
42+ "github.com/stacklok/toolhive/pkg/registry"
4243 "github.com/stacklok/toolhive/pkg/skills"
4344 "github.com/stacklok/toolhive/pkg/skills/skillsvc"
4445 "github.com/stacklok/toolhive/pkg/storage/sqlite"
@@ -251,20 +252,29 @@ func (b *ServerBuilder) createDefaultManagers(ctx context.Context) error {
251252 _ = store .Close ()
252253 return fmt .Errorf ("failed to create OCI skill store: %w" , ociErr )
253254 }
254- registry , regErr := ociskills .NewRegistry ()
255+ ociRegistry , regErr := ociskills .NewRegistry ()
255256 if regErr != nil {
256257 _ = store .Close ()
257258 // ociStore is directory-backed with no open handles; no cleanup needed.
258259 return fmt .Errorf ("failed to create OCI registry client: %w" , regErr )
259260 }
260261 packager := ociskills .NewPackager (ociStore )
261262
263+ // Get registry provider for skill discovery (best-effort)
264+ regProvider , regProviderErr := registry .GetDefaultProvider ()
265+ var regOpts []skillsvc.Option
266+ if regProviderErr == nil {
267+ regOpts = append (regOpts , skillsvc .WithRegistryProvider (regProvider ))
268+ }
269+
262270 b .skillManager = skillsvc .New (store ,
263- skillsvc .WithPathResolver (& clientPathAdapter {cm : cm }),
264- skillsvc .WithOCIStore (ociStore ),
265- skillsvc .WithPackager (packager ),
266- skillsvc .WithRegistryClient (registry ),
267- skillsvc .WithGroupManager (b .groupManager ),
271+ append ([]skillsvc.Option {
272+ skillsvc .WithPathResolver (& clientPathAdapter {cm : cm }),
273+ skillsvc .WithOCIStore (ociStore ),
274+ skillsvc .WithPackager (packager ),
275+ skillsvc .WithRegistryClient (ociRegistry ),
276+ skillsvc .WithGroupManager (b .groupManager ),
277+ }, regOpts ... )... ,
268278 )
269279 }
270280
0 commit comments