| 936 | } |
| 937 | |
| 938 | func (cli *ChatCLI) showConfigIntegrations(ctx context.Context) { |
| 939 | sectionHeader("🔗", "cfg.section.integrations.title", ColorPurple) |
| 940 | p := uiPrefix(ColorPurple) |
| 941 | |
| 942 | subheader(p, "cfg.sub.integ.mcp") |
| 943 | kv(p, "CHATCLI_MCP_ENABLED", envBool("CHATCLI_MCP_ENABLED")) |
| 944 | kv(p, "CHATCLI_MCP_CONFIG", envOr("CHATCLI_MCP_CONFIG")) |
| 945 | if cli.mcpManager != nil { |
| 946 | statuses := cli.mcpManager.GetServerStatus() |
| 947 | kv(p, i18n.T("cfg.kv.servers"), fmt.Sprintf("%d", len(statuses))) |
| 948 | for _, s := range statuses { |
| 949 | status := i18n.T("cfg.msg.disconnected") |
| 950 | if s.Connected { |
| 951 | status = i18n.T("cfg.msg.connected_tools", s.ToolCount) |
| 952 | } |
| 953 | if s.LastError != nil { |
| 954 | status += i18n.T("cfg.msg.last_error", shorten(s.LastError.Error(), 50)) |
| 955 | } |
| 956 | kv(p, "· "+s.Name, status) |
| 957 | } |
| 958 | kv(p, i18n.T("cfg.kv.total_tools"), fmt.Sprintf("%d", cli.mcpManager.ToolCount())) |
| 959 | if shadowed := cli.mcpManager.GetShadowedBuiltins(); len(shadowed) > 0 { |
| 960 | kv(p, i18n.T("cfg.kv.shadowed_builtins"), strings.Join(shadowed, ", ")) |
| 961 | } |
| 962 | } else { |
| 963 | kv(p, i18n.T("cfg.kv.mcp_manager"), i18n.T("cfg.val.not_initialized")) |
| 964 | } |
| 965 | |
| 966 | fmt.Println(p) |
| 967 | subheader(p, "cfg.sub.integ.hooks") |
| 968 | if cli.hookManager != nil { |
| 969 | kv(p, i18n.T("cfg.kv.configured"), fmt.Sprintf("%d", cli.hookManager.Count())) |
| 970 | for _, h := range cli.hookManager.GetHooks() { |
| 971 | label := fmt.Sprintf("event=%s, type=%s", h.Event, h.Type) |
| 972 | name := h.Name |
| 973 | if name == "" { |
| 974 | name = fmt.Sprintf("[hook:%s]", h.Event) |
| 975 | } |
| 976 | kv(p, "· "+name, label) |
| 977 | } |
| 978 | } else { |
| 979 | kv(p, i18n.T("cfg.kv.hook_manager"), i18n.T("cfg.val.not_initialized")) |
| 980 | } |
| 981 | |
| 982 | fmt.Println(p) |
| 983 | subheader(p, "cfg.sub.integ.plugins") |
| 984 | if cli.pluginManager != nil { |
| 985 | plist := cli.pluginManager.GetPlugins() |
| 986 | kv(p, i18n.T("cfg.kv.loaded"), fmt.Sprintf("%d", len(plist))) |
| 987 | for _, pl := range plist { |
| 988 | kv(p, "· "+pl.Name(), fmt.Sprintf("v%s — %s", pl.Version(), shorten(pl.Description(), 50))) |
| 989 | } |
| 990 | kv(p, "CHATCLI_ALLOW_UNSIGNED_PLUGINS", envBool("CHATCLI_ALLOW_UNSIGNED_PLUGINS")) |
| 991 | } |
| 992 | |
| 993 | fmt.Println(p) |
| 994 | subheader(p, "cfg.sub.integ.skills") |
| 995 | kv(p, "CHATCLI_REGISTRY_DISABLE", envBool("CHATCLI_REGISTRY_DISABLE")) |