(content: string)
| 207 | } |
| 208 | |
| 209 | function seedMemory(content: string): void { |
| 210 | const projectIdentity = resolveProjectIdentity(realpathSync(pathResolve(h.opencode.env.workdir))); |
| 211 | writeDb((db) => { |
| 212 | const now = Date.now(); |
| 213 | db.prepare( |
| 214 | `INSERT INTO memories ( |
| 215 | project_path, category, content, normalized_hash, |
| 216 | source_session_id, source_type, seen_count, retrieval_count, |
| 217 | first_seen_at, created_at, updated_at, last_seen_at, status |
| 218 | ) VALUES (?, 'WORKFLOW_RULES', ?, ?, NULL, 'historian', 5, 0, ?, ?, ?, ?, 'active')`, |
| 219 | ).run(projectIdentity, content, computeNormalizedHash(content), now, now, now, now); |
| 220 | }); |
| 221 | } |
| 222 | |
| 223 | function normalizedTodos(todos: typeof ACTIVE_TODOS): string { |
| 224 | return JSON.stringify(todos.map(({ content, status, priority }) => ({ content, status, priority }))); |
no test coverage detected