MCPcopy Create free account
hub / github.com/diillson/chatcli / NewSkillHandler

Function NewSkillHandler

cli/skill_handler.go:42–66  ·  view source on GitHub ↗

NewSkillHandler creates a new skill handler with registry manager.

(logger *zap.Logger, personaMgr *persona.Manager)

Source from the content-addressed store, hash-verified

40
41// NewSkillHandler creates a new skill handler with registry manager.
42func NewSkillHandler(logger *zap.Logger, personaMgr *persona.Manager) *SkillHandler {
43 cfg, err := registry.LoadConfig()
44 if err != nil {
45 logger.Warn("Failed to load registry config, using defaults", zap.Error(err))
46 cfg = registry.DefaultConfig()
47 }
48
49 mgr, err := registry.NewRegistryManager(cfg, logger)
50 if err != nil {
51 logger.Warn("Failed to initialize registry manager", zap.Error(err))
52 return &SkillHandler{
53 personaMgr: personaMgr,
54 logger: logger,
55 initErr: err,
56 pinnedSkillNames: make(map[string]struct{}),
57 }
58 }
59
60 return &SkillHandler{
61 registryMgr: mgr,
62 personaMgr: personaMgr,
63 logger: logger,
64 pinnedSkillNames: make(map[string]struct{}),
65 }
66}
67
68// HandleCommand routes /skill subcommands.
69func (sh *SkillHandler) HandleCommand(ctx context.Context, userInput string) {

Callers 7

newPinTestFixtureFunction · 0.85
newInfoFixtureFunction · 0.85
newCompleterTestCLIFunction · 0.85
completerSkillFixtureFunction · 0.85
newPipelineCLIFunction · 0.85
NewChatCLIFunction · 0.85

Calls 5

LoadConfigFunction · 0.92
DefaultConfigFunction · 0.92
NewRegistryManagerFunction · 0.92
WarnMethod · 0.80
ErrorMethod · 0.65

Tested by 6

newPinTestFixtureFunction · 0.68
newInfoFixtureFunction · 0.68
newCompleterTestCLIFunction · 0.68
completerSkillFixtureFunction · 0.68
newPipelineCLIFunction · 0.68