discoverRemoteResources fetches remote plugins/agents/skills and registers them.
(ctx context.Context, remoteClient *remote.Client)
| 193 | |
| 194 | // discoverRemoteResources fetches remote plugins/agents/skills and registers them. |
| 195 | func (ch *CommandHandler) discoverRemoteResources(ctx context.Context, remoteClient *remote.Client) { |
| 196 | ctx, cancel := context.WithTimeout(ctx, 10*time.Second) |
| 197 | defer cancel() |
| 198 | |
| 199 | // Register remote plugins |
| 200 | if remotePlugins, err := remoteClient.ListRemotePlugins(ctx); err == nil && len(remotePlugins) > 0 { |
| 201 | for _, p := range remotePlugins { |
| 202 | rp := remote.NewRemotePluginFromInfo(p, remoteClient) |
| 203 | ch.cli.pluginManager.RegisterRemotePlugin(rp) |
| 204 | } |
| 205 | ch.cli.logger.Info("Remote plugins registered", zap.Int("count", len(remotePlugins))) |
| 206 | } |
| 207 | |
| 208 | // Cache remote agents and skills info for listing |
| 209 | if agents, err := remoteClient.ListRemoteAgents(ctx); err == nil { |
| 210 | ch.cli.remoteAgents = agents |
| 211 | } |
| 212 | if skills, err := remoteClient.ListRemoteSkills(ctx); err == nil { |
| 213 | ch.cli.remoteSkills = skills |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | // handleDisconnectCommand handles the /disconnect command. |
| 218 | // It closes the remote connection and restores the local LLM client. |
no test coverage detected