mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-09-21 01:18:08 +00:00
- agentcli 平台无关化:plugin.go 拆为公共层 + ptyTerm 接口,新增 pty_linux.go(/dev/ptmx 原实现搬移,行为不变)与 pty_windows.go (ConPTY 原生实现,CreatePseudoConsole + PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE 注入子进程,双管道读写/ResizePseudoConsole/GetExitCodeProcess,零第三方依赖) - plugin_stub.go 收紧为 !linux && !windows(darwin 等仍走桩) - plugin_test.go build tag 放宽到 linux || windows - cabi/loader.c 补 linux || darwin build tag,修复 Windows 下 cgo 禁用时残留 C 源文件的编译错误 - 验证:Linux 全量构建+测试通过;Windows CGO 交叉编译 + go vet 全包零错误
22 lines
623 B
Go
22 lines
623 B
Go
//go:build !linux && !windows
|
|
|
|
package agentcli
|
|
|
|
import (
|
|
"gitcode.com/JianFeeeee/HomeAgent/internal/plugin"
|
|
sdk "gitcode.com/JianFeeeee/HomeAgent/internal/sdk"
|
|
)
|
|
|
|
func init() {
|
|
plugin.RegisterFactory("agentcli", func(name string, config map[string]interface{}) (sdk.Plugin, error) {
|
|
return &stubPlugin{}, nil
|
|
})
|
|
plugin.RegisterPluginMeta("agentcli", "终端交互", "Agent CLI")
|
|
}
|
|
|
|
type stubPlugin struct{}
|
|
|
|
func (p *stubPlugin) Name() string { return "agentcli" }
|
|
func (p *stubPlugin) Start(sdk *sdk.PluginSDK) error { return nil }
|
|
func (p *stubPlugin) Stop() error { return nil }
|