chore(go): audit providers claudecode codex cursor gemini
Add managed_runtime.go (paths, config validation, identity, runtime file changes, status checks) and shell_command.go (quoting, PowerShell encoding, command parsing) and move the four providers onto them. Claude-Session: https://claude.ai/code/session_01Agoc9bRVE9KL7mmWtey9Vq
This commit is contained in:
1 parent
c1caed3d42
commit
a7fc75bf6b
39 files changed
+914
-2018
No files matched your search
@@ -3,7 +3,6 @@ package plugins
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
@@ -18,18 +17,6 @@ func kiroConfigPaths() (string, string, error) {
|
||||
filepath.Join(home, ".kiro", "hooks", "elydora-audit.json"), nil
|
||||
}
|
||||
|
||||
func resolveNodeRuntime() (string, error) {
|
||||
nodePath, err := exec.LookPath("node")
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("resolve Node.js runtime: %w", err)
|
||||
}
|
||||
absolute, err := filepath.Abs(nodePath)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("resolve Node.js runtime path: %w", err)
|
||||
}
|
||||
return absolute, nil
|
||||
}
|
||||
|
||||
func buildKiroCommand(runtimePath, scriptPath string) string {
|
||||
if runtime.GOOS == "windows" {
|
||||
return quoteWindowsArgument(runtimePath) + " " + quoteWindowsArgument(scriptPath)
|
||||
@@ -37,10 +24,6 @@ func buildKiroCommand(runtimePath, scriptPath string) string {
|
||||
return quotePOSIXArgument(runtimePath) + " " + quotePOSIXArgument(scriptPath)
|
||||
}
|
||||
|
||||
func quotePOSIXArgument(value string) string {
|
||||
return "'" + strings.ReplaceAll(value, "'", `'"'"'`) + "'"
|
||||
}
|
||||
|
||||
func quoteWindowsArgument(value string) string {
|
||||
if value != "" && !strings.ContainsAny(value, " \t\n\v\"") {
|
||||
return value
|
||||
|
||||
Reference in new issue
Block a user