| 3715 | } |
| 3716 | |
| 3717 | func nativeAuthoredAgentPath(workspace *workspacepkg.ResolvedWorkspace, agentName string) string { |
| 3718 | name := strings.TrimSpace(agentName) |
| 3719 | if workspace == nil { |
| 3720 | return "" |
| 3721 | } |
| 3722 | for _, agent := range workspace.Agents { |
| 3723 | if strings.TrimSpace(agent.Name) == name && strings.TrimSpace(agent.SourcePath) != "" { |
| 3724 | return strings.TrimSpace(agent.SourcePath) |
| 3725 | } |
| 3726 | } |
| 3727 | if root := strings.TrimSpace(workspace.RootDir); root != "" && name != "" { |
| 3728 | return filepath.Join(root, aghconfig.DirName, aghconfig.AgentsDirName, name, "AGENT.md") |
| 3729 | } |
| 3730 | return "" |
| 3731 | } |
| 3732 | |
| 3733 | func (n *daemonNativeTools) workspaceAgents( |
| 3734 | ctx context.Context, |