73 lines
1.6 KiB
C++
73 lines
1.6 KiB
C++
#ifndef OPENMANUS_TOOLS_PLANNING_H
|
|
#define OPENMANUS_TOOLS_PLANNING_H
|
|
|
|
#include "../tool_base.h"
|
|
#include <string>
|
|
#include <vector>
|
|
#include <unordered_map>
|
|
|
|
namespace openmanus {
|
|
|
|
/**
|
|
* @class Planning
|
|
* @brief 规划工具,用于创建和管理结构化计划
|
|
*/
|
|
class Planning : public ToolBase {
|
|
public:
|
|
Planning();
|
|
virtual ~Planning() = default;
|
|
|
|
/**
|
|
* @brief 执行规划工具
|
|
* @param params 工具参数
|
|
* @return 执行结果
|
|
*/
|
|
virtual mcp::json execute(const mcp::json& params) override;
|
|
|
|
private:
|
|
/**
|
|
* @brief 创建新计划
|
|
* @param params 参数
|
|
* @return 结果
|
|
*/
|
|
mcp::json createPlan(const mcp::json& params);
|
|
|
|
/**
|
|
* @brief 获取计划状态
|
|
* @param params 参数
|
|
* @return 结果
|
|
*/
|
|
mcp::json getPlanStatus(const mcp::json& params);
|
|
|
|
/**
|
|
* @brief 更新步骤状态
|
|
* @param params 参数
|
|
* @return 结果
|
|
*/
|
|
mcp::json updateStepStatus(const mcp::json& params);
|
|
|
|
/**
|
|
* @brief 添加步骤
|
|
* @param params 参数
|
|
* @return 结果
|
|
*/
|
|
mcp::json addStep(const mcp::json& params);
|
|
|
|
private:
|
|
// 计划结构
|
|
struct Plan {
|
|
std::string id;
|
|
std::string title;
|
|
std::string description;
|
|
std::vector<std::string> step_ids;
|
|
std::unordered_map<std::string, std::string> step_descriptions;
|
|
std::unordered_map<std::string, std::string> step_statuses;
|
|
int current_step_index;
|
|
};
|
|
|
|
std::unordered_map<std::string, Plan> plans_;
|
|
};
|
|
|
|
} // namespace openmanus
|
|
|
|
#endif // OPENMANUS_TOOLS_PLANNING_H
|