Move Kimi, Grok, and Qwen onto managed_runtime.go and shell_command.go; share the encoded and shell command builders and the quoted Windows legacy parser with Droid; split managed_changes.go; dedupe Letta's hook entry filtering and stop swallowing settings read errors. Claude-Session: https://claude.ai/code/session_01Agoc9bRVE9KL7mmWtey9Vq
22 lines
583 B
Go
22 lines
583 B
Go
package plugins
|
|
|
|
import "path/filepath"
|
|
|
|
func parseGrokCommand(command string) (string, string, bool) {
|
|
if runtimePath, scriptPath, ok := parseEncodedCommand(command); ok {
|
|
return runtimePath, scriptPath, true
|
|
}
|
|
return parseQuotedWindowsCommand(command)
|
|
}
|
|
|
|
func grokRuntimeReferenceForCommand(
|
|
command string,
|
|
scriptName string,
|
|
) (*managedScriptReference, error) {
|
|
runtimePath, scriptPath, ok := parseGrokCommand(command)
|
|
if !ok || !filepath.IsAbs(runtimePath) || !isNodeExecutable(runtimePath) {
|
|
return nil, nil
|
|
}
|
|
return resolveManagedScript(scriptPath, scriptName)
|
|
}
|