( ctx context.Context, scope toolspkg.Scope, id toolspkg.ToolID, workspaceID string, )
| 3526 | } |
| 3527 | |
| 3528 | func (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 | |
| 3561 | func (n *daemonNativeTools) resolveSkill( |
| 3562 | ctx context.Context, |
no test coverage detected