mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-09-23 02:18:06 +00:00
feat: expand local operator controls across CLI and WebUI
- Add structured CLI commands for status/kernel/settings/plugins/memory/knowledge/agents - Inject core dependencies directly into CLI plugin for non-HTTP operator workflows - Add plugin management panel and API proxy endpoints to WebUI - Let cmd_run inherit default workdir from core.agent.workdir - Use fixed loopback address for pluginmgr API - Remove stale MaxToolTurns config usage from homed wiring
This commit is contained in:
@ -368,7 +368,6 @@ func main() {
|
||||
Indexer: memIdx,
|
||||
Skills: skMgr,
|
||||
Tracker: trk,
|
||||
MaxToolTurns: 10,
|
||||
DocStore: docStore,
|
||||
Knowledge: ks,
|
||||
SocialStore: socialStore,
|
||||
@ -395,6 +394,9 @@ func main() {
|
||||
pluginmgr.PluginDir = cfg.Plugin.Dir
|
||||
pluginmgr.Reg = pluginReg
|
||||
|
||||
// CLI 插件结构化命令 — 直接注入内核依赖,不依赖 HTTP
|
||||
cli.Configure(pluginReg, cfgReg, agent, cfg.Plugin.Dir)
|
||||
|
||||
// Auto-create plugins directory (without hardcoding plugin names)
|
||||
os.MkdirAll(cfg.Plugin.Dir, 0755)
|
||||
|
||||
|
||||
@ -378,15 +378,29 @@ func handleBuiltin(cmd string, mode, addr *string, reconnect func()) bool {
|
||||
switch {
|
||||
case cmd == "/help":
|
||||
fmt.Println(`Built-in commands:
|
||||
/help show this help
|
||||
/exit, /quit exit waiter
|
||||
/clear clear screen
|
||||
/reconnect force reconnection
|
||||
/connect <path> switch to a different unix socket
|
||||
/remote <url> switch to remote HTTP mode
|
||||
/local switch back to local socket mode
|
||||
/help show this help
|
||||
/exit, /quit exit waiter
|
||||
/clear clear screen
|
||||
/reconnect force reconnection
|
||||
/connect <path> switch to a different unix socket
|
||||
/remote <url> switch to remote HTTP mode
|
||||
/local switch back to local socket mode
|
||||
|
||||
Any other text is sent as a message to the agent.`)
|
||||
Structured commands (processed server-side):
|
||||
/status system status
|
||||
/kernel kernel status
|
||||
/settings [prefix] list settings
|
||||
/settings set <k> <v> set a setting
|
||||
/plugin list list installed plugins
|
||||
/plugin install <url> install plugin
|
||||
/plugin remove <name> remove plugin
|
||||
/plugin info <name> plugin details
|
||||
/memory query <text> query graph memory
|
||||
/knowledge list knowledge base
|
||||
/agents list agents
|
||||
/chat <text> send to agent
|
||||
|
||||
Any other text is sent to the agent.`)
|
||||
return true
|
||||
|
||||
case cmd == "/exit" || cmd == "/quit":
|
||||
@ -580,7 +594,10 @@ func (e *LineEditor) historyNext() {
|
||||
}
|
||||
|
||||
func (e *LineEditor) doCompletion() {
|
||||
cmds := []string{"/help", "/exit", "/quit", "/clear", "/reconnect", "/connect ", "/remote ", "/local"}
|
||||
cmds := []string{"/help", "/exit", "/quit", "/clear", "/reconnect", "/connect ", "/remote ", "/local",
|
||||
"/status", "/kernel", "/settings ", "/settings set ", "/chat ",
|
||||
"/plugin ", "/plugin list", "/plugin install ", "/plugin remove ", "/plugin info ",
|
||||
"/memory ", "/memory query ", "/knowledge", "/agents"}
|
||||
prefix := string(e.buf)
|
||||
for _, c := range cmds {
|
||||
if strings.HasPrefix(c, prefix) && c != prefix {
|
||||
|
||||
Reference in New Issue
Block a user