Skip to content

Commit e686e25

Browse files
wuchulonlyclaude
andcommitted
fix: 恢复原版依赖并完成国际化
- 恢复 go.mod 到原版(使用新版 charmbracelet) - 完成剩余文件的中文注释英文化 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 2b1d1ad commit e686e25

File tree

5 files changed

+30
-39
lines changed

5 files changed

+30
-39
lines changed

client/cmd/cli/root.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ func rootCmd(con *core.Console) (*cobra.Command, error) {
2020
}
2121
cmd.TraverseChildren = true
2222

23-
// 添加 --mcp flag
23+
// Add --mcp flag
2424
cmd.PersistentFlags().String("mcp", "", "enable MCP server with address (e.g., 127.0.0.1:5005)")
25-
// 添加 --rpc flag
25+
// Add --rpc flag
2626
cmd.PersistentFlags().String("rpc", "", "enable local gRPC server with address (e.g., 127.0.0.1:15004)")
27-
// 添加全局 --wizard flag
27+
// Add global --wizard flag
2828
command.RegisterWizardFlag(cmd)
2929

3030
bind := command.MakeBind(cmd, con, "golang")
3131
command.BindCommonCommands(bind)
32-
// 包装 PersistentPreRunE 以支持 wizard 模式
32+
// Wrap PersistentPreRunE to support wizard mode
3333
originalPre, originalPost := command.ConsoleRunnerCmd(con, cmd)
3434
cmd.PersistentPreRunE, cmd.PersistentPostRunE = command.WrapWithWizardSupport(con, originalPre, originalPost)
3535
cmd.AddCommand(command.ImplantCmd(con))

client/command/generic/login.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ func LoginCmd(cmd *cobra.Command, con *core.Console) error {
3535
return Login(con, filename)
3636
}
3737

38-
// 只有根命令或 login 命令才检查 Arg(0) 作为认证文件
39-
// 避免子命令的参数(如 wizard build beacon 中的 beacon)被误当作认证文件
38+
// Only check Arg(0) as auth file for root command or login command
39+
// Avoid treating subcommand arguments (e.g., 'beacon' in 'wizard build beacon') as auth file
4040
if cmd.Parent() == nil || cmd.Use == "client" || cmd.Use == "login" {
4141
if filename := cmd.Flags().Arg(0); strings.HasSuffix(filename, ".auth") {
4242
return Login(con, filename)

client/plugin/vm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func NewLuaVM() *lua.LState {
3232
vm.SetGlobal(name, vm.NewFunction(mals.WrapFuncForLua(fun)))
3333
}
3434

35-
// 设置 wizard metatable 和函数
35+
// Setup wizard metatable and functions
3636
wizard.SetupMetatable(vm)
3737
wizardFns := make(map[string]lua.LGFunction)
3838
wizard.RegisterLuaFunctions(wizardFns)

go.mod

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ require (
1313
github.com/chainreactors/rem v0.2.4
1414
github.com/chainreactors/tui v0.0.0-20250825071101-9e61744e554f
1515
github.com/chainreactors/utils v0.0.0-20241209140746-65867d2f78b2
16-
github.com/charmbracelet/bubbletea v0.25.0
17-
github.com/charmbracelet/glamour v0.6.0
18-
github.com/charmbracelet/huh v0.2.3
19-
github.com/charmbracelet/lipgloss v0.9.1
16+
github.com/charmbracelet/bubbletea v1.3.4
17+
github.com/charmbracelet/glamour v0.8.0
2018
github.com/corpix/uarand v0.2.0
2119
github.com/dustin/go-humanize v1.0.1
2220
github.com/evertras/bubble-table v0.17.2
@@ -30,7 +28,7 @@ require (
3028
github.com/klauspost/compress v1.17.8
3129
github.com/mark3labs/mcp-go v0.25.0
3230
github.com/mattn/go-tty v0.0.7
33-
github.com/muesli/termenv v0.15.2
31+
github.com/muesli/termenv v0.16.0
3432
github.com/ncruces/go-sqlite3 v0.9.0
3533
github.com/nikoksr/notify v0.41.0
3634
github.com/reeflective/console v0.0.0-00010101000000-000000000000
@@ -53,12 +51,12 @@ require (
5351
github.com/docker/distribution v2.8.2+incompatible // indirect
5452
github.com/docker/docker v24.0.9+incompatible
5553
golang.org/x/crypto v0.33.0
56-
golang.org/x/exp v0.0.0-20231006140011-7918f672742d
54+
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63
5755
golang.org/x/net v0.40.0 // indirect
58-
golang.org/x/sync v0.15.0 // indirect
56+
golang.org/x/sync v0.14.0 // indirect
5957
golang.org/x/sys v0.33.0 // indirect
6058
golang.org/x/term v0.29.0 // indirect
61-
golang.org/x/text v0.23.0
59+
golang.org/x/text v0.22.0
6260
golang.org/x/time v0.9.0 // indirect
6361
google.golang.org/grpc v1.57.2
6462
google.golang.org/protobuf v1.34.1
@@ -69,26 +67,30 @@ require (
6967
dario.cat/mergo v1.0.0 // indirect
7068
filippo.io/edwards25519 v1.1.0 // indirect
7169
github.com/Microsoft/go-winio v0.5.1 // indirect
72-
github.com/alecthomas/chroma v0.10.0 // indirect
70+
github.com/alecthomas/chroma/v2 v2.14.0 // indirect
7371
github.com/atotto/clipboard v0.1.4 // indirect
7472
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
7573
github.com/aymerick/douceur v0.2.0 // indirect
7674
github.com/blinkbean/dingtalk v1.1.3 // indirect
7775
github.com/carapace-sh/carapace-shlex v1.0.1 // indirect
78-
github.com/catppuccin/go v0.3.0 // indirect
7976
github.com/cbroglie/mustache v1.4.0 // indirect
8077
github.com/chainreactors/fingers v0.0.0-20240702104653-a66e34aa41df // indirect
8178
github.com/chainreactors/go-metrics v0.0.0-20220926021830-24787b7a10f8 // indirect
8279
github.com/chainreactors/proxyclient v1.0.2 // indirect
83-
github.com/charmbracelet/bubbles v0.17.1 // indirect
80+
github.com/charmbracelet/bubbles v0.20.0 // indirect
81+
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect
8482
github.com/charmbracelet/harmonica v0.2.0 // indirect
83+
github.com/charmbracelet/lipgloss v1.1.0 // indirect
84+
github.com/charmbracelet/x/ansi v0.8.0 // indirect
85+
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect
86+
github.com/charmbracelet/x/term v0.2.1 // indirect
8587
github.com/cjoudrey/gluahttp v0.0.0-20201111170219-25003d9adfa9 // indirect
86-
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect
8788
github.com/davecgh/go-spew v1.1.1 // indirect
8889
github.com/dlclark/regexp2 v1.11.5 // indirect
8990
github.com/docker/go-connections v0.5.0 // indirect
9091
github.com/docker/go-units v0.5.0 // indirect
9192
github.com/edsrzf/mmap-go v1.1.0 // indirect
93+
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
9294
github.com/facebookincubator/nvdtools v0.1.5 // indirect
9395
github.com/fatih/color v1.16.0 // indirect
9496
github.com/go-dedup/megophone v0.0.0-20170830025436-f01be21026f5 // indirect
@@ -118,6 +120,7 @@ require (
118120
github.com/mattn/go-runewidth v0.0.16 // indirect
119121
github.com/mattn/go-sqlite3 v1.14.24 // indirect
120122
github.com/microcosm-cc/bluemonday v1.0.27 // indirect
123+
github.com/miekg/dns v1.1.67 // indirect
121124
github.com/mitchellh/mapstructure v1.5.0 // indirect
122125
github.com/moby/term v0.5.0 // indirect
123126
github.com/montanaflynn/stats v0.7.1 // indirect
@@ -126,7 +129,6 @@ require (
126129
github.com/muesli/cancelreader v0.2.2 // indirect
127130
github.com/muesli/reflow v0.3.0 // indirect
128131
github.com/ncruces/julianday v0.1.5 // indirect
129-
github.com/olekukonko/tablewriter v0.0.5 // indirect
130132
github.com/opencontainers/go-digest v1.0.0 // indirect
131133
github.com/opencontainers/image-spec v1.1.0 // indirect
132134
github.com/pkg/errors v0.9.1 // indirect
@@ -153,6 +155,8 @@ require (
153155
github.com/yuin/gluamapper v0.0.0-20150323120927-d836955830e7 // indirect
154156
github.com/yuin/goldmark v1.7.4 // indirect
155157
github.com/yuin/goldmark-emoji v1.0.3 // indirect
158+
golang.org/x/mod v0.24.0 // indirect
159+
golang.org/x/tools v0.33.0 // indirect
156160
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
157161
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
158162
gotest.tools/v3 v3.5.1 // indirect
@@ -161,29 +165,16 @@ require (
161165
)
162166

163167
replace (
164-
golang.org/x/crypto => golang.org/x/crypto v0.17.0
165-
golang.org/x/net => golang.org/x/net v0.19.0
166-
golang.org/x/sync => golang.org/x/sync v0.6.0
167-
golang.org/x/sys => golang.org/x/sys v0.16.0
168-
golang.org/x/term => golang.org/x/term v0.16.0
169-
golang.org/x/text => golang.org/x/text v0.14.0
170-
golang.org/x/time => golang.org/x/time v0.5.0
171-
)
172-
173-
replace (
174-
github.com/charmbracelet/bubbles => github.com/charmbracelet/bubbles v0.16.1
175-
github.com/charmbracelet/bubbletea => github.com/charmbracelet/bubbletea v0.24.2
176-
github.com/charmbracelet/huh => github.com/charmbracelet/huh v0.2.3
177-
github.com/charmbracelet/lipgloss => github.com/charmbracelet/lipgloss v0.9.1
178-
github.com/muesli/termenv => github.com/muesli/termenv v0.15.2
179-
github.com/ncruces/go-sqlite3 => github.com/ncruces/go-sqlite3 v0.8.3
168+
golang.org/x/crypto => golang.org/x/crypto v0.24.0
169+
golang.org/x/net => golang.org/x/net v0.23.0
170+
golang.org/x/sync => golang.org/x/sync v0.11.0
171+
golang.org/x/sys => golang.org/x/sys v0.30.0
180172
)
181173

182174
replace (
183175
github.com/chainreactors/IoM-go => ./external/IoM-go
184176
github.com/chainreactors/proxyclient => github.com/chainreactors/proxyclient v1.0.3
185177
//github.com/chainreactors/rem => github.com/chainreactors/rem-community v0.2.4
186-
github.com/chainreactors/tui => /tmp/tui-fork
187178
github.com/mark3labs/mcp-go => ./external/mcp-go
188179
github.com/reeflective/console => ./external/console
189180
github.com/reeflective/readline => ./external/readline

helper/cryptography/cryptography.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,11 @@ func AgeDecrypt(recipientPrivateKey string, ciphertext []byte) ([]byte, error) {
148148
ciphertext = prefixed
149149
}
150150

151-
// Age 库会自动处理 grease recipients
151+
// Age library automatically handles grease recipients
152152
buf := bytes.NewBuffer(ciphertext)
153153
stream, err := age.Decrypt(buf, identity)
154154
if err != nil {
155-
// 如果解密失败,尝试添加调试信息
155+
// If decryption fails, add debug info
156156
return nil, fmt.Errorf("age decrypt failed (ciphertext size: %d bytes): %w", len(ciphertext), err)
157157
}
158158

0 commit comments

Comments
 (0)