返回 DeepSeek-Reasonix
shell_registration.go
根目录 / internal / boot / shell_registration.go
1 package boot
2
3 import (
4 "reasonix/internal/sandbox"
5 "reasonix/internal/tool"
6 "reasonix/internal/tool/builtin"
7 )
8
9 func canonicalBuiltinName(name string) string {
10 if tool.IsShellToolName(name) {
11 return "bash"
12 }
13 return name
14 }
15
16 func registerShellBuiltin(reg *tool.Registry, shell tool.Tool, writeRootSet *sandbox.WritableRootSet) {
17 if _, ok := reg.Get("bash"); !ok {
18 return
19 }
20 shell = builtin.BindWriteRootSet(shell, writeRootSet)
21 reg.Add(shell)
22 if shell.Name() == "pwsh" {
23 reg.Remove("bash")
24 }
25 }
26
26 lines GO