Files
smartmate/backend/shared/contracts/agent/query.go
Losita 2a96f4c6f9 Version: 0.9.76.dev.260505
后端:
1.阶段 6 agent / memory 服务化收口
- 新增 cmd/agent 独立进程入口,承载 agent zrpc server、agent outbox relay / consumer 和运行时依赖初始化
- 补齐 services/agent/rpc 的 Chat stream 与 conversation meta/list/timeline、schedule-preview、context-stats、schedule-state unary RPC
- 新增 gateway/client/agent 与 shared/contracts/agent,将 /api/v1/agent chat 和非 chat 门面切到 agent zrpc
- 收缩 gateway 本地 AgentService 装配,双 RPC 开关开启时不再初始化本地 agent 编排、LLM、RAG 和 memory reader fallback
- 将 backend/memory 物理迁入 services/memory,私有实现收入 internal,保留 module/model/observe 作为 memory 服务门面
- 调整 memory outbox、memory reader 和 agent 记忆渲染链路的 import 与服务边界,cmd/memory 独占 memory worker / consumer
- 关闭 gateway 侧 agent outbox worker 所有权,agent relay / consumer 由 cmd/agent 独占,gateway 仅保留 HTTP/SSE 门面与迁移期开关回退
- 更新阶段 6 文档,记录 agent / memory 当前切流点、smoke 结果,以及 backend/client 与 gateway/shared 的目录收口口径
2026-05-05 19:31:39 +08:00

53 lines
2.3 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package agent
// ConversationQueryRequest 描述 gateway 查询单个 agent 会话资源的最小跨进程参数。
//
// 职责边界:
// 1. UserID 由 gateway 鉴权后填充,不信任前端传入;
// 2. ConversationID 只表达会话归属,不承载 HTTP query 或 SSE 细节;
// 3. 会话是否存在、是否属于当前用户仍由 agent 服务内部校验。
type ConversationQueryRequest struct {
UserID int `json:"user_id"`
ConversationID string `json:"conversation_id"`
}
// ConversationListRequest 描述 gateway 拉取当前用户会话列表的最小查询条件。
//
// 职责边界:
// 1. Page/PageSize 允许为 0默认值和上限由 agent 服务统一兜底;
// 2. Status 只透传过滤条件,合法值仍由 agent 服务决定;
// 3. 不包含消息正文,避免列表接口被扩成重查询。
type ConversationListRequest struct {
UserID int `json:"user_id"`
Page int `json:"page,omitempty"`
PageSize int `json:"page_size,omitempty"`
Status string `json:"status,omitempty"`
}
// SaveScheduleStatePlacedItem 描述前端拖拽后的单个 task_item 绝对时间位置。
//
// 职责边界:
// 1. 字段形状与 HTTP 入参保持一致,避免 gateway 做额外翻译;
// 2. 这里只承载跨进程 JSON 契约,不判断节次、周次或 task_item 是否有效;
// 3. agent 服务会把绝对坐标转换为内部 ScheduleState 相对坐标。
type SaveScheduleStatePlacedItem struct {
TaskItemID int `json:"task_item_id"`
Week int `json:"week"`
DayOfWeek int `json:"day_of_week"`
StartSection int `json:"start_section"`
EndSection int `json:"end_section"`
EmbedCourseEventID int `json:"embed_course_event_id,omitempty"`
}
// SaveScheduleStateRequest 描述 gateway 暂存会话内排程拖拽状态的跨进程命令。
//
// 职责边界:
// 1. UserID 由 gateway 注入,用于 agent 服务做会话归属校验;
// 2. ConversationID 指向当前会话快照;
// 3. Items 只包含用户拖拽后的 task_item 位置,不承载课程写入或正式确认语义。
type SaveScheduleStateRequest struct {
UserID int `json:"user_id"`
ConversationID string `json:"conversation_id"`
Items []SaveScheduleStatePlacedItem `json:"items"`
}