Version: 0.9.75.dev.260505
后端: 1.收口阶段 6 agent 结构迁移,将 newAgent 内核与 agentsvc 编排层迁入 services/agent - 切换 Agent 启动装配与 HTTP handler 直连 agent sv,移除旧 service agent bridge - 补齐 Agent 对 memory、task、task-class、schedule 的 RPC 适配与契约字段 - 扩展 schedule、task、task-class RPC/contract 支撑 Agent 查询、写入与 provider 切流 - 更新迁移文档、README 与相关注释,明确 agent 当前切流点和剩余 memory 迁移面
This commit is contained in:
@@ -43,6 +43,17 @@ type UpsertTaskClassItemConfig struct {
|
||||
EmbeddedTime *TargetTime `json:"embedded_time"`
|
||||
}
|
||||
|
||||
// UpsertTaskClassResponse 是 task-class 写入完成后的最小确认结果。
|
||||
//
|
||||
// 职责边界:
|
||||
// 1. 只返回 agent / gateway 后续编排需要的稳定主键和创建语义;
|
||||
// 2. 不回传完整任务类详情,避免写接口承担读取 DTO 责任;
|
||||
// 3. TaskClassID <= 0 视为服务端异常,由调用方按失败处理。
|
||||
type UpsertTaskClassResponse struct {
|
||||
TaskClassID int `json:"task_class_id"`
|
||||
Created bool `json:"created"`
|
||||
}
|
||||
|
||||
type UserRequest struct {
|
||||
UserID int `json:"user_id"`
|
||||
}
|
||||
@@ -52,6 +63,54 @@ type GetTaskClassRequest struct {
|
||||
TaskClassID int `json:"task_class_id"`
|
||||
}
|
||||
|
||||
// AgentTaskClassesRequest 是 agent schedule provider 读取完整任务类的契约。
|
||||
//
|
||||
// 职责边界:
|
||||
// 1. TaskClassIDs 为空表示读取该用户全部任务类,兼容全量日程状态加载;
|
||||
// 2. TaskClassIDs 非空表示按本轮排程范围读取,服务端仍按 user_id 做归属过滤;
|
||||
// 3. 该契约只服务 agent 内部编排,不改变前端 GetTaskClass 的响应形状。
|
||||
type AgentTaskClassesRequest struct {
|
||||
UserID int `json:"user_id"`
|
||||
TaskClassIDs []int `json:"task_class_ids,omitempty"`
|
||||
}
|
||||
|
||||
type AgentTaskClassesResponse struct {
|
||||
TaskClasses []AgentTaskClass `json:"task_classes"`
|
||||
}
|
||||
|
||||
// AgentTaskClass 是跨进程传给 agent provider 的任务类原始事实。
|
||||
//
|
||||
// 说明:
|
||||
// 1. 日期用 YYYY-MM-DD 字符串传输,避免跨服务 JSON 时区漂移;
|
||||
// 2. Items 保留 status / embedded_time,确保 LoadScheduleState 的 pending/existing 口径不变;
|
||||
// 3. 不携带 DAO / GORM 元信息,调用侧只还原内存模型。
|
||||
type AgentTaskClass struct {
|
||||
ID int `json:"id"`
|
||||
UserID int `json:"user_id"`
|
||||
Name string `json:"name"`
|
||||
Mode string `json:"mode"`
|
||||
StartDate string `json:"start_date"`
|
||||
EndDate string `json:"end_date"`
|
||||
SubjectType string `json:"subject_type,omitempty"`
|
||||
DifficultyLevel string `json:"difficulty_level,omitempty"`
|
||||
CognitiveIntensity string `json:"cognitive_intensity,omitempty"`
|
||||
TotalSlots int `json:"total_slots"`
|
||||
AllowFillerCourse bool `json:"allow_filler_course"`
|
||||
Strategy string `json:"strategy"`
|
||||
ExcludedSlots []int `json:"excluded_slots,omitempty"`
|
||||
ExcludedDaysOfWeek []int `json:"excluded_days_of_week,omitempty"`
|
||||
Items []AgentTaskClassItem `json:"items,omitempty"`
|
||||
}
|
||||
|
||||
type AgentTaskClassItem struct {
|
||||
ID int `json:"id"`
|
||||
CategoryID *int `json:"category_id,omitempty"`
|
||||
Order *int `json:"order,omitempty"`
|
||||
Content string `json:"content"`
|
||||
EmbeddedTime *TargetTime `json:"embedded_time,omitempty"`
|
||||
Status *int `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
type InsertTaskClassItemIntoScheduleRequest struct {
|
||||
UserID int `json:"user_id"`
|
||||
TaskItemID int `json:"task_item_id"`
|
||||
|
||||
Reference in New Issue
Block a user