fix(cli): confine agent runtime paths
This commit is contained in:
1 parent
c9d1075585
commit
7bf84a35e0
10 files changed
+399
-51
No files matched your search
@@ -55,18 +55,18 @@ func writeJSONFile(path string, data map[string]interface{}) error {
|
||||
|
||||
// hookScriptPath returns the default path for the hook script inside ~/.elydora/<agentId>/.
|
||||
func hookScriptPath(agentId string) (string, error) {
|
||||
home, err := os.UserHomeDir()
|
||||
agentDirectory, err := ResolveAgentRuntimeDirectory(agentId)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("resolve home directory: %w", err)
|
||||
return "", err
|
||||
}
|
||||
return filepath.Join(home, ".elydora", agentId, "hook.js"), nil
|
||||
return filepath.Join(agentDirectory, "hook.js"), nil
|
||||
}
|
||||
|
||||
// guardScriptPath returns the default path for the guard script inside ~/.elydora/<agentId>/.
|
||||
func guardScriptPath(agentId string) (string, error) {
|
||||
home, err := os.UserHomeDir()
|
||||
agentDirectory, err := ResolveAgentRuntimeDirectory(agentId)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("resolve home directory: %w", err)
|
||||
return "", err
|
||||
}
|
||||
return filepath.Join(home, ".elydora", agentId, "guard.js"), nil
|
||||
return filepath.Join(agentDirectory, "guard.js"), nil
|
||||
}
|
||||
Reference in new issue
Block a user