后端: 1.把最后一块拼图:schedule_refine也搬迁到了agent2,此时agent已经完全解耦。但是它没融入新架构,Codex只尝试把它调整了一部分,回退了一些错误的更改,保持着现在的可运行状态。下次继续改。 2.agent目录先保留,直到refine彻底融入新架构。 3.改善Codex主导的新史山结构:node文件夹里面大量文件,转而改成了module.go+module_tool.go的双文件格局,极大提升架构整洁度和代码可读性。 前端: 1.新开了日历界面,正在保持往前推进。做了很多更改,感觉越来越好了。
70 lines
2.8 KiB
Go
70 lines
2.8 KiB
Go
package agentnode
|
|
|
|
import (
|
|
"context"
|
|
|
|
agentmodel "github.com/LoveLosita/smartflow/backend/agent2/model"
|
|
agentrefine "github.com/LoveLosita/smartflow/backend/agent2/node/schedule_refine_impl"
|
|
"github.com/LoveLosita/smartflow/backend/model"
|
|
)
|
|
|
|
// ScheduleRefineState is the node-layer alias for refine state.
|
|
type ScheduleRefineState = agentrefine.ScheduleRefineState
|
|
|
|
// ScheduleRefineGraphRunInput is the node-layer alias for refine graph input.
|
|
type ScheduleRefineGraphRunInput = agentrefine.ScheduleRefineGraphRunInput
|
|
|
|
// NewScheduleRefineState creates refine state from the previous preview snapshot.
|
|
func NewScheduleRefineState(traceID string, userID int, conversationID string, userMessage string, preview *model.SchedulePlanPreviewCache) *ScheduleRefineState {
|
|
return agentrefine.NewScheduleRefineState(traceID, userID, conversationID, userMessage, preview)
|
|
}
|
|
|
|
// FinalHardCheckPassed reports whether the final refine hard check passed.
|
|
func FinalHardCheckPassed(st *ScheduleRefineState) bool {
|
|
return agentrefine.FinalHardCheckPassed(st)
|
|
}
|
|
|
|
// ScheduleRefineNodes is a temporary compatibility facade.
|
|
// The real refine implementation still lives in schedule_refine_impl until the next split round lands.
|
|
type ScheduleRefineNodes struct {
|
|
input ScheduleRefineGraphRunInput
|
|
}
|
|
|
|
// NewScheduleRefineNodes stores the refine graph input.
|
|
func NewScheduleRefineNodes(input ScheduleRefineGraphRunInput) (*ScheduleRefineNodes, error) {
|
|
return &ScheduleRefineNodes{input: input}, nil
|
|
}
|
|
|
|
func (n *ScheduleRefineNodes) Contract(ctx context.Context, st *agentmodel.ScheduleRefineState) (*agentmodel.ScheduleRefineState, error) {
|
|
return st, nil
|
|
}
|
|
|
|
func (n *ScheduleRefineNodes) Plan(ctx context.Context, st *agentmodel.ScheduleRefineState) (*agentmodel.ScheduleRefineState, error) {
|
|
return st, nil
|
|
}
|
|
|
|
func (n *ScheduleRefineNodes) Slice(ctx context.Context, st *agentmodel.ScheduleRefineState) (*agentmodel.ScheduleRefineState, error) {
|
|
return st, nil
|
|
}
|
|
|
|
func (n *ScheduleRefineNodes) Route(ctx context.Context, st *agentmodel.ScheduleRefineState) (*agentmodel.ScheduleRefineState, error) {
|
|
return st, nil
|
|
}
|
|
|
|
func (n *ScheduleRefineNodes) React(ctx context.Context, st *agentmodel.ScheduleRefineState) (*agentmodel.ScheduleRefineState, error) {
|
|
return st, nil
|
|
}
|
|
|
|
func (n *ScheduleRefineNodes) HardCheck(ctx context.Context, st *agentmodel.ScheduleRefineState) (*agentmodel.ScheduleRefineState, error) {
|
|
return st, nil
|
|
}
|
|
|
|
func (n *ScheduleRefineNodes) Summary(ctx context.Context, st *agentmodel.ScheduleRefineState) (*agentmodel.ScheduleRefineState, error) {
|
|
return st, nil
|
|
}
|
|
|
|
// RunScheduleRefineGraph is kept as the single executable entry for refine.
|
|
func RunScheduleRefineGraph(ctx context.Context, input ScheduleRefineGraphRunInput) (*ScheduleRefineState, error) {
|
|
return agentrefine.RunScheduleRefineGraph(ctx, input)
|
|
}
|