webui: add realtime logs stream and APIs for stream chat/channels/skills/exec approvals

This commit is contained in:
DBT
2026-02-25 16:58:17 +00:00
parent 8c319ce6ed
commit ed60785fda
2 changed files with 289 additions and 0 deletions

View File

@@ -179,6 +179,8 @@ func gatewayCmd() {
registryServer := nodes.NewRegistryServer(cfg.Gateway.Host, cfg.Gateway.Port, cfg.Gateway.Token, nodes.DefaultManager())
registryServer.SetConfigPath(getConfigPath())
registryServer.SetWorkspacePath(cfg.WorkspacePath())
registryServer.SetLogFilePath(cfg.LogFilePath())
registryServer.SetWebUIDir(filepath.Join(cfg.WorkspacePath(), "webui-dist"))
registryServer.SetChatHandler(func(cctx context.Context, sessionKey, content string) (string, error) {
if strings.TrimSpace(content) == "" {
@@ -186,6 +188,9 @@ func gatewayCmd() {
}
return agentLoop.ProcessDirect(cctx, content, sessionKey)
})
registryServer.SetChannelsHandler(func() interface{} {
return channelManager.GetStatus()
})
registryServer.SetConfigAfterHook(func() {
_ = syscall.Kill(os.Getpid(), syscall.SIGHUP)
})