MCPcopy Create free account
hub / github.com/compozy/agh / skillsFor

Method skillsFor

internal/daemon/native_tools.go:3528–3559  ·  view source on GitHub ↗
(
	ctx context.Context,
	scope toolspkg.Scope,
	id toolspkg.ToolID,
	workspaceID string,
)

Source from the content-addressed store, hash-verified

3526}
3527
3528func (n *daemonNativeTools) skillsFor(
3529 ctx context.Context,
3530 scope toolspkg.Scope,
3531 id toolspkg.ToolID,
3532 workspaceID string,
3533) ([]*skills.Skill, error) {
3534 if n.deps.Skills == nil {
3535 return nil, errors.New("daemon: skills registry is required")
3536 }
3537 agentName := strings.TrimSpace(scope.AgentName)
3538 workspaceID, err := nativeCallerWorkspaceInput(id, "workspace_id", workspaceID, scope)
3539 if err != nil {
3540 return nil, err
3541 }
3542 if workspaceID == "" {
3543 if agentName != "" {
3544 return n.deps.Skills.ForAgent(ctx, nil, agentName)
3545 }
3546 return n.deps.Skills.List(), nil
3547 }
3548 if n.deps.WorkspaceResolver == nil {
3549 return nil, errors.New("daemon: workspace resolver is required for workspace skills")
3550 }
3551 resolved, err := n.deps.WorkspaceResolver.Resolve(ctx, workspaceID)
3552 if err != nil {
3553 return nil, err
3554 }
3555 if agentName != "" {
3556 return n.deps.Skills.ForAgent(ctx, &resolved, agentName)
3557 }
3558 return n.deps.Skills.ForWorkspace(ctx, &resolved)
3559}
3560
3561func (n *daemonNativeTools) resolveSkill(
3562 ctx context.Context,

Callers 3

skillListMethod · 0.95
skillSearchMethod · 0.95
resolveSkillMethod · 0.95

Calls 5

ForAgentMethod · 0.65
ListMethod · 0.65
ResolveMethod · 0.65
ForWorkspaceMethod · 0.65

Tested by

no test coverage detected