chore(go): audit shared plugin helpers

Drop unused expandHome and standardizeJSONC, share the runtime base URL
validator between the guard and audit templates, and trim comments.

Claude-Session: https://claude.ai/code/session_01Agoc9bRVE9KL7mmWtey9Vq
This commit is contained in:
雷电芽衣 committed 2026-09-03 01:17:26 -04:00
1 parent 5e08ab20f5
commit b085947547
9 files changed
+42 -102

No files matched your search

+2 -4
View File
@@ -22,8 +22,7 @@ type agentRuntimeConfig struct {
AgentName string `json:"agent_name"`
}
// WriteRuntimeFileAtomic replaces one managed runtime file through a flushed,
// same-directory temporary file.
// WriteRuntimeFileAtomic replaces one managed runtime file atomically.
func WriteRuntimeFileAtomic(
path string,
label string,
@@ -40,8 +39,7 @@ func WriteRuntimeFileAtomic(
return writeChanges([]*fileChange{change}, "write "+label, nil)
}
// GenerateHookScript atomically commits the agent config, private key, and
// self-contained Node.js audit runtime.
// GenerateHookScript commits the config, private key, and audit runtime together.
func GenerateHookScript(destPath string, config InstallConfig) error {
return generateHookScriptWithRename(destPath, config, nil)
}