From fbbaeea1df002584d78e243d641026808ab059fc Mon Sep 17 00:00:00 2001 From: Ramnique Singh <30795890+ramnique@users.noreply.github.com> Date: Tue, 21 Apr 2026 11:06:09 +0530 Subject: [PATCH] refactor ensure-daily-note --- .../x/packages/core/src/knowledge/ensure_daily_note.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/x/packages/core/src/knowledge/ensure_daily_note.ts b/apps/x/packages/core/src/knowledge/ensure_daily_note.ts index 6daff8ec..4a6872f4 100644 --- a/apps/x/packages/core/src/knowledge/ensure_daily_note.ts +++ b/apps/x/packages/core/src/knowledge/ensure_daily_note.ts @@ -3,13 +3,14 @@ import fs from 'fs'; import { stringify as stringifyYaml } from 'yaml'; import { TrackBlockSchema } from '@x/shared/dist/track-block.js'; import { WorkDir } from '../config/config.js'; +import z from 'zod'; const KNOWLEDGE_DIR = path.join(WorkDir, 'knowledge'); const DAILY_NOTE_PATH = path.join(KNOWLEDGE_DIR, 'Today.md'); interface Section { heading: string; - track: unknown; + track: z.infer; } const SECTIONS: Section[] = [ @@ -143,8 +144,7 @@ Do NOT invent busywork.`, function buildDailyNoteContent(): string { const parts: string[] = ['# Today', '']; for (const { heading, track } of SECTIONS) { - const parsed = TrackBlockSchema.parse(track); - const yaml = stringifyYaml(parsed, { lineWidth: 0, blockQuote: 'literal' }).trimEnd(); + const yaml = stringifyYaml(track, { lineWidth: 0, blockQuote: 'literal' }).trimEnd(); parts.push( heading, '', @@ -152,8 +152,8 @@ function buildDailyNoteContent(): string { yaml, '```', '', - ``, - ``, + ``, + ``, '', ); }