refactor: mcphost planner

This commit is contained in:
lilong.129
2025-05-18 21:55:01 +08:00
parent e35d644acf
commit 3f1ee03529
13 changed files with 595 additions and 220 deletions

View File

@@ -27,24 +27,22 @@ var CmdMCPHost = &cobra.Command{
}
// Create chat session
chat, err := host.NewChat(context.Background(), systemPromptFile)
chat, err := host.NewChat(context.Background())
if err != nil {
return fmt.Errorf("failed to create chat session: %w", err)
}
// Start chat
return chat.Start()
return chat.Start(context.Background())
},
}
var (
mcpConfigPath string
dumpPath string
systemPromptFile string
mcpConfigPath string
dumpPath string
)
func init() {
CmdMCPHost.Flags().StringVarP(&mcpConfigPath, "mcp-config", "c", "$HOME/.hrp/mcp.json", "path to the MCP config file")
CmdMCPHost.Flags().StringVar(&dumpPath, "dump", "", "path to save the exported tools JSON file")
CmdMCPHost.Flags().StringVar(&systemPromptFile, "system-prompt", "", "path to system prompt JSON file")
}