MCPcopy Create free account
hub / github.com/astercloud/aster / NewProjectMemory

Function NewProjectMemory

pkg/memory/project/types.go:134–151  ·  view source on GitHub ↗

NewProjectMemory 创建新的项目记忆

(projectID, title, description string)

Source from the content-addressed store, hash-verified

132
133// NewProjectMemory 创建新的项目记忆
134func NewProjectMemory(projectID, title, description string) *ProjectMemory {
135 now := time.Now()
136 return &ProjectMemory{
137 ProjectID: projectID,
138 Title: title,
139 Description: description,
140 Sections: map[MemorySection]*Section{
141 SectionPreferences: {Name: "用户偏好", Protected: true, Entries: []*Entry{}},
142 SectionChoices: {Name: "关键选择", Protected: true, Entries: []*Entry{}},
143 SectionWorkflow: {Name: "工作流状态", Protected: false, Entries: []*Entry{}},
144 SectionParams: {Name: "生成参数", Protected: false, Entries: []*Entry{}},
145 SectionHistory: {Name: "项目历史", Protected: false, Entries: []*Entry{}},
146 },
147 CreatedAt: now,
148 UpdatedAt: now,
149 Version: 1,
150 }
151}
152
153// AddEntry 添加条目到指定章节
154func (pm *ProjectMemory) AddEntry(section MemorySection, entry *Entry) {

Callers 2

AppendEntryMethod · 0.85
parseMarkdownMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected