From ac8b400d822b880691bd71b1157976cb391da556 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 27 Nov 2025 23:57:01 +0000 Subject: [PATCH 1/3] fix: migrate enhanced_md to enhanced_notes table for markdown saving - Remove enhanced_md field from packages/db/src/schema.ts sessions table - Remove enhanced_md from schema-external.ts sessions schema - Update localPersister2.ts to iterate over enhanced_notes table instead of sessions - Update main.ts to save enhanced notes as separate md files in session folder - Update search indexing to get enhanced content from enhanced_notes table - Update title-transform.ts to read from enhanced_notes - Update search.tsx to display enhanced_notes content - Update test files and devtool seed data to remove enhanced_md references Co-Authored-By: yujonglee --- .../components/chat/message/tool/search.tsx | 21 ++++++++-- .../components/devtool/seed/data/curated.json | 3 -- .../components/devtool/seed/data/loader.ts | 1 - .../components/devtool/seed/data/schema.ts | 1 - .../components/devtool/seed/shared/session.ts | 2 - .../src/contexts/search/engine/content.ts | 3 +- .../src/contexts/search/engine/indexing.ts | 22 ++++++++++- .../src/contexts/search/engine/listeners.ts | 22 ++++++++++- .../src/store/tinybase/localPersister2.ts | 10 +++-- apps/desktop/src/store/tinybase/main.ts | 38 ++++++++++++++++--- .../src/store/tinybase/schema-external.ts | 13 ++++--- .../ai-task/task-configs/title-transform.ts | 13 ++++++- apps/desktop/src/utils/timeline.test.ts | 5 --- packages/db/src/schema.ts | 1 - 14 files changed, 117 insertions(+), 38 deletions(-) diff --git a/apps/desktop/src/components/chat/message/tool/search.tsx b/apps/desktop/src/components/chat/message/tool/search.tsx index 7484a7c4cc..a5eb1699fb 100644 --- a/apps/desktop/src/components/chat/message/tool/search.tsx +++ b/apps/desktop/src/components/chat/message/tool/search.tsx @@ -98,6 +98,18 @@ function RenderContent({ part }: { part: Part }) { function RenderSession({ sessionId }: { sessionId: string }) { const session = main.UI.useRow("sessions", sessionId, main.STORE_ID); + const enhancedNoteIds = main.UI.useSliceRowIds( + main.INDEXES.enhancedNotesBySession, + sessionId, + main.STORE_ID, + ); + const firstEnhancedNoteId = enhancedNoteIds?.[0]; + const enhancedNoteContent = main.UI.useCell( + "enhanced_notes", + firstEnhancedNoteId ?? "", + "content", + main.STORE_ID, + ); const openNew = useTabs((state) => state.openNew); const handleClick = useCallback(() => { @@ -112,14 +124,17 @@ function RenderSession({ sessionId }: { sessionId: string }) { ); } + const displayContent = + typeof enhancedNoteContent === "string" && enhancedNoteContent + ? enhancedNoteContent + : session.raw_md; + return (
{session.title || "Untitled"} - - {session.enhanced_md ?? session.raw_md} - + {displayContent}
); } diff --git a/apps/desktop/src/components/devtool/seed/data/curated.json b/apps/desktop/src/components/devtool/seed/data/curated.json index a2c3475eda..e2651a42ab 100644 --- a/apps/desktop/src/components/devtool/seed/data/curated.json +++ b/apps/desktop/src/components/devtool/seed/data/curated.json @@ -119,7 +119,6 @@ { "title": "Q4 Strategy Meeting", "raw_md": "## Q4 Product Strategy\n\nAttendees: John Doe, Sarah Chen, Michael Rodriguez\n\nDiscussed Q4 roadmap, feature priorities, resource allocation, and timeline for product releases...", - "enhanced_md": "# Key Decisions\n- Slack integration prioritized as phase 1 (3 weeks)\n- Performance optimization parallel track (2 weeks profiling + 4-8 weeks optimization)\n- Salesforce integration phase 2 (6 weeks)\n- Resource allocation: 2 senior engineers + 1 junior for integrations\n- Board approval needed by end of week\n\n

\n\n# Market Insights\n- 2000+ customer survey respondents\n- 78% want better integrations\n- 65% concerned about performance\n- Enterprise pricing model needs adjustment\n\n

\n\n# Action Items\n- Michael: Technical spec by Nov 5 (responsible)\n- Sarah: Sales constraints analysis (responsible)\n- John: Board coordination for resource approval", "folder": "Q4 Planning", "event": "Q4 Product Strategy Planning", "participants": [ @@ -1478,7 +1477,6 @@ { "title": "TechStart Partnership Call", "raw_md": "## Partnership Discussion\n\nAttendees: John Doe, Emma Watson, David Kim\n\nExplored strategic partnership opportunities between Acme Corp and TechStart Labs for API integration and co-marketing...", - "enhanced_md": "# Strategic Partnership Framework\n\n### Partnership Proposal\n- API integration: TechStart ML capabilities + Acme data processing\n- Revenue model: 30% for TechStart on referrals (70% Acme)\n- Joint go-to-market to mid-market enterprises\n\n

\n\n### Technical Integration Plan\n- Authentication: OAuth 2.0 (both systems ready)\n- Data sync: Real-time webhooks\n- Rate limits: 1000 req/min initially\n- Security: Mutual TLS for server-to-server\n- Regions: US-primary, EU secondary\n- POC timeline: 3-4 weeks\n\n

\n\n### Next Steps\n- Legal review: 2 weeks\n- Technical POC: 3-4 weeks (parallel)\n- Pilot program: 6 weeks total", "folder": "Projects", "event": null, "participants": [ @@ -2675,7 +2673,6 @@ { "title": "Quick Check-in", "raw_md": "Quick conversation between colleagues.", - "enhanced_md": "Quick conversation between colleagues.", "folder": null, "event": null, "participants": [ diff --git a/apps/desktop/src/components/devtool/seed/data/loader.ts b/apps/desktop/src/components/devtool/seed/data/loader.ts index 79a7a935b5..14c4e52ee8 100644 --- a/apps/desktop/src/components/devtool/seed/data/loader.ts +++ b/apps/desktop/src/components/devtool/seed/data/loader.ts @@ -140,7 +140,6 @@ export const loadCuratedData = (data: CuratedData): Tables => { user_id: DEFAULT_USER_ID, title: session.title, raw_md: JSON.stringify(md2json(session.raw_md)), - enhanced_md: JSON.stringify(md2json(session.enhanced_md)), created_at: new Date().toISOString(), event_id: eventId, folder_id: folderId, diff --git a/apps/desktop/src/components/devtool/seed/data/schema.ts b/apps/desktop/src/components/devtool/seed/data/schema.ts index 5da2a37180..6095b81119 100644 --- a/apps/desktop/src/components/devtool/seed/data/schema.ts +++ b/apps/desktop/src/components/devtool/seed/data/schema.ts @@ -69,7 +69,6 @@ const CuratedEventSchema = z.object({ const CuratedSessionSchema = z.object({ title: z.string(), raw_md: z.string(), - enhanced_md: z.string(), folder: z.string().nullable(), event: z.string().nullable(), participants: z.array(z.string()), diff --git a/apps/desktop/src/components/devtool/seed/shared/session.ts b/apps/desktop/src/components/devtool/seed/shared/session.ts index 8c357e82d2..8d3649b82b 100644 --- a/apps/desktop/src/components/devtool/seed/shared/session.ts +++ b/apps/desktop/src/components/devtool/seed/shared/session.ts @@ -48,7 +48,6 @@ export const createSession = ( faker.number.int({ min: 2, max: 5 }), "\n\n", ); - const enhanced_md = generateEnhancedMarkdown(); return { id: id(), @@ -56,7 +55,6 @@ export const createSession = ( user_id: DEFAULT_USER_ID, title, raw_md: JSON.stringify(md2json(raw_md)), - enhanced_md: JSON.stringify(md2json(enhanced_md)), created_at: faker.date.recent({ days: 30 }).toISOString(), event_id: eventId, folder_id: folderId, diff --git a/apps/desktop/src/contexts/search/engine/content.ts b/apps/desktop/src/contexts/search/engine/content.ts index ac30d4d860..1d2148872b 100644 --- a/apps/desktop/src/contexts/search/engine/content.ts +++ b/apps/desktop/src/contexts/search/engine/content.ts @@ -2,10 +2,11 @@ import { flattenTranscript, mergeContent } from "./utils"; export function createSessionSearchableContent( row: Record, + enhancedContent?: string, ): string { return mergeContent([ row.raw_md, - row.enhanced_md, + enhancedContent, flattenTranscript(row.transcript), ]); } diff --git a/apps/desktop/src/contexts/search/engine/indexing.ts b/apps/desktop/src/contexts/search/engine/indexing.ts index 24ee4cd097..0c148321ee 100644 --- a/apps/desktop/src/contexts/search/engine/indexing.ts +++ b/apps/desktop/src/contexts/search/engine/indexing.ts @@ -16,7 +16,6 @@ export function indexSessions(db: Index, store: PersistedStore): void { "event_id", "title", "raw_md", - "enhanced_md", "transcript", ]; @@ -24,16 +23,35 @@ export function indexSessions(db: Index, store: PersistedStore): void { const row = collectCells(store, "sessions", rowId, fields); const title = toTrimmedString(row.title) || "Untitled"; + const enhancedContent = getEnhancedContentForSession(store, rowId); + void insert(db, { id: rowId, type: "session", title, - content: createSessionSearchableContent(row), + content: createSessionSearchableContent(row, enhancedContent), created_at: toNumber(row.created_at), }); }); } +function getEnhancedContentForSession( + store: PersistedStore, + sessionId: string, +): string { + const contents: string[] = []; + store.forEachRow("enhanced_notes", (rowId: string, _forEachCell) => { + const noteSessionId = store.getCell("enhanced_notes", rowId, "session_id"); + if (noteSessionId === sessionId) { + const content = store.getCell("enhanced_notes", rowId, "content"); + if (typeof content === "string" && content) { + contents.push(content); + } + } + }); + return contents.join(" "); +} + export function indexHumans(db: Index, store: PersistedStore): void { const fields = [ "name", diff --git a/apps/desktop/src/contexts/search/engine/listeners.ts b/apps/desktop/src/contexts/search/engine/listeners.ts index 70d68df237..22b0a16e69 100644 --- a/apps/desktop/src/contexts/search/engine/listeners.ts +++ b/apps/desktop/src/contexts/search/engine/listeners.ts @@ -25,17 +25,18 @@ export function createSessionListener( "created_at", "title", "raw_md", - "enhanced_md", "transcript", ]; const row = collectCells(store, "sessions", rowId, fields); const title = toTrimmedString(row.title) || "Untitled"; + const enhancedContent = getEnhancedContentForSession(store, rowId); + const data: TypedDocument = { id: rowId, type: "session", title, - content: createSessionSearchableContent(row), + content: createSessionSearchableContent(row, enhancedContent), created_at: toNumber(row.created_at), }; @@ -47,6 +48,23 @@ export function createSessionListener( }; } +function getEnhancedContentForSession( + store: PersistedStore, + sessionId: string, +): string { + const contents: string[] = []; + store.forEachRow("enhanced_notes", (rowId: string, _forEachCell) => { + const noteSessionId = store.getCell("enhanced_notes", rowId, "session_id"); + if (noteSessionId === sessionId) { + const content = store.getCell("enhanced_notes", rowId, "content"); + if (typeof content === "string" && content) { + contents.push(content); + } + } + }); + return contents.join(" "); +} + export function createHumanListener( index: Index, ): RowListener { diff --git a/apps/desktop/src/store/tinybase/localPersister2.ts b/apps/desktop/src/store/tinybase/localPersister2.ts index 9fbb3d2a40..0a4168e0aa 100644 --- a/apps/desktop/src/store/tinybase/localPersister2.ts +++ b/apps/desktop/src/store/tinybase/localPersister2.ts @@ -1,12 +1,12 @@ import { createCustomPersister } from "tinybase/persisters/with-schemas"; import type { MergeableStore, OptionalSchemas } from "tinybase/with-schemas"; -import { Session } from "./schema-external"; +import { EnhancedNote } from "./schema-external"; // https://tinybase.org/api/persisters/functions/creation/createcustompersister export function createLocalPersister2( store: MergeableStore, - handlePersist: (session: Session & { id: string }) => Promise, + handlePersist: (enhancedNote: EnhancedNote & { id: string }) => Promise, ) { return createCustomPersister( store, @@ -16,11 +16,13 @@ export function createLocalPersister2( async (getContent, _changes) => { const [tables, _values] = getContent(); - Object.entries(tables?.sessions ?? {}).forEach(([id, row]) => { + const promises: Promise[] = []; + Object.entries(tables?.enhanced_notes ?? {}).forEach(([id, row]) => { // @ts-ignore row.id = id; - handlePersist(row as Session & { id: string }); + promises.push(handlePersist(row as EnhancedNote & { id: string })); }); + await Promise.all(promises); }, (listener) => setInterval(listener, 1000), (interval) => clearInterval(interval), diff --git a/apps/desktop/src/store/tinybase/main.ts b/apps/desktop/src/store/tinybase/main.ts index aac997a7bc..6a59f2f823 100644 --- a/apps/desktop/src/store/tinybase/main.ts +++ b/apps/desktop/src/store/tinybase/main.ts @@ -22,6 +22,7 @@ import { import { TABLE_HUMANS, TABLE_SESSIONS } from "@hypr/db"; import { getCurrentWebviewWindowLabel } from "@hypr/plugin-windows"; +import { isValidTiptapContent, json2md } from "@hypr/tiptap/shared"; import { format } from "@hypr/utils"; import { DEFAULT_USER_ID } from "../../utils"; @@ -145,7 +146,6 @@ export const StoreComponent = ({ persist = true }: { persist?: boolean }) => { created_at: now, title: "Welcome to Hyprnote", raw_md: "", - enhanced_md: "", }); } }); @@ -176,15 +176,43 @@ export const StoreComponent = ({ persist = true }: { persist?: boolean }) => { const persister = createLocalPersister2( store as Store, - async (session) => { - if (session.enhanced_md) { + async (enhancedNote) => { + if (!enhancedNote.content || !enhancedNote.session_id) { + return; + } + + try { + const parsed = JSON.parse(enhancedNote.content); + if (!isValidTiptapContent(parsed)) { + return; + } + + const markdown = json2md(parsed); + const sessionDir = `hyprnote/sessions/${enhancedNote.session_id}`; + + const sessionDirExists = await exists(sessionDir, { + baseDir: BaseDirectory.Data, + }); + if (!sessionDirExists) { + await mkdir(sessionDir, { + baseDir: BaseDirectory.Data, + recursive: true, + }); + } + await writeTextFile( - `hyprnote/sessions/${session.id}.md`, - session.enhanced_md, + `${sessionDir}/${enhancedNote.id}.md`, + markdown, { baseDir: BaseDirectory.Data, }, ); + } catch (error) { + console.error( + "Failed to save enhanced note markdown:", + enhancedNote.id, + error, + ); } }, ); diff --git a/apps/desktop/src/store/tinybase/schema-external.ts b/apps/desktop/src/store/tinybase/schema-external.ts index 0c33e1ec95..5b8ed5c90f 100644 --- a/apps/desktop/src/store/tinybase/schema-external.ts +++ b/apps/desktop/src/store/tinybase/schema-external.ts @@ -59,11 +59,13 @@ export const folderSchema = baseFolderSchema.omit({ id: true }).extend({ ), }); -export const sessionSchema = baseSessionSchema.omit({ id: true }).extend({ - created_at: z.string(), - event_id: z.preprocess((val) => val ?? undefined, z.string().optional()), - folder_id: z.preprocess((val) => val ?? undefined, z.string().optional()), -}); +export const sessionSchema = baseSessionSchema + .omit({ id: true, enhanced_md: true }) + .extend({ + created_at: z.string(), + event_id: z.preprocess((val) => val ?? undefined, z.string().optional()), + folder_id: z.preprocess((val) => val ?? undefined, z.string().optional()), + }); export const transcriptSchema = baseTranscriptSchema.omit({ id: true }).extend({ created_at: z.string(), @@ -192,7 +194,6 @@ export const externalTableSchemaForTinybase = { event_id: { type: "string" }, title: { type: "string" }, raw_md: { type: "string" }, - enhanced_md: { type: "string" }, } satisfies InferTinyBaseSchema, transcripts: { user_id: { type: "string" }, diff --git a/apps/desktop/src/store/zustand/ai-task/task-configs/title-transform.ts b/apps/desktop/src/store/zustand/ai-task/task-configs/title-transform.ts index 986a0965d3..f917aec8d1 100644 --- a/apps/desktop/src/store/zustand/ai-task/task-configs/title-transform.ts +++ b/apps/desktop/src/store/zustand/ai-task/task-configs/title-transform.ts @@ -14,6 +14,15 @@ async function transformArgs( } function readEnhancedMarkdown(store: MainStore, sessionId: string): string { - const value = store.getCell("sessions", sessionId, "enhanced_md"); - return typeof value === "string" ? value : ""; + const contents: string[] = []; + store.forEachRow("enhanced_notes", (rowId, _forEachCell) => { + const noteSessionId = store.getCell("enhanced_notes", rowId, "session_id"); + if (noteSessionId === sessionId) { + const content = store.getCell("enhanced_notes", rowId, "content"); + if (typeof content === "string" && content) { + contents.push(content); + } + } + }); + return contents.join("\n\n"); } diff --git a/apps/desktop/src/utils/timeline.test.ts b/apps/desktop/src/utils/timeline.test.ts index 1ffaac673d..f84fdc6ab9 100644 --- a/apps/desktop/src/utils/timeline.test.ts +++ b/apps/desktop/src/utils/timeline.test.ts @@ -66,7 +66,6 @@ describe("timeline utils", () => { event_started_at: "2024-01-18T12:00:00.000Z", user_id: "user-1", raw_md: "", - enhanced_md: "", transcript: { words: [] }, }, "session-2": { @@ -74,7 +73,6 @@ describe("timeline utils", () => { created_at: "2024-01-14T12:00:00.000Z", user_id: "user-1", raw_md: "", - enhanced_md: "", transcript: { words: [] }, }, }; @@ -123,7 +121,6 @@ describe("timeline utils", () => { event_started_at: "2024-01-10T10:00:00.000Z", user_id: "user-1", raw_md: "", - enhanced_md: "", transcript: { words: [] }, }, }; @@ -158,7 +155,6 @@ describe("timeline utils", () => { event_started_at: "2024-01-16T09:00:00.000Z", user_id: "user-1", raw_md: "", - enhanced_md: "", transcript: { words: [] }, }, "session-past": { @@ -166,7 +162,6 @@ describe("timeline utils", () => { created_at: "2024-01-14T09:00:00.000Z", user_id: "user-1", raw_md: "", - enhanced_md: "", transcript: { words: [] }, }, }; diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index a66a7b5078..4e90d91b56 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -128,7 +128,6 @@ export const sessions = pgTable( event_id: uuid("event_id"), title: text("title").notNull(), raw_md: text("raw_md").notNull(), - enhanced_md: text("enhanced_md").notNull(), }, (table) => createPolicies(TABLE_SESSIONS, table.user_id), ).enableRLS(); From d90039e3814b34fa6248f766cae9478310ca963b Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 28 Nov 2025 00:02:16 +0000 Subject: [PATCH 2/3] fix: remove enhanced_md from schema.gen.json Co-Authored-By: yujonglee --- apps/desktop/src/components/devtool/seed/data/schema.gen.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apps/desktop/src/components/devtool/seed/data/schema.gen.json b/apps/desktop/src/components/devtool/seed/data/schema.gen.json index 65af11dba6..45bd372203 100644 --- a/apps/desktop/src/components/devtool/seed/data/schema.gen.json +++ b/apps/desktop/src/components/devtool/seed/data/schema.gen.json @@ -201,9 +201,6 @@ "raw_md": { "type": "string" }, - "enhanced_md": { - "type": "string" - }, "folder": { "anyOf": [ { @@ -300,7 +297,6 @@ "required": [ "title", "raw_md", - "enhanced_md", "folder", "event", "participants", From 0d9db17899b2df78cff475e6d5e0bad88e4f4721 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 28 Nov 2025 00:23:02 +0000 Subject: [PATCH 3/3] refactor: extract getEnhancedContentForSession to shared utility Co-Authored-By: yujonglee --- .../src/contexts/search/engine/indexing.ts | 24 ++++----------- .../src/contexts/search/engine/listeners.ts | 30 +++++++------------ .../src/contexts/search/engine/utils.ts | 19 ++++++++++++ 3 files changed, 35 insertions(+), 38 deletions(-) diff --git a/apps/desktop/src/contexts/search/engine/indexing.ts b/apps/desktop/src/contexts/search/engine/indexing.ts index 0c148321ee..9085834bb6 100644 --- a/apps/desktop/src/contexts/search/engine/indexing.ts +++ b/apps/desktop/src/contexts/search/engine/indexing.ts @@ -6,7 +6,12 @@ import { createSessionSearchableContent, } from "./content"; import type { Index } from "./types"; -import { collectCells, toNumber, toTrimmedString } from "./utils"; +import { + collectCells, + getEnhancedContentForSession, + toNumber, + toTrimmedString, +} from "./utils"; export function indexSessions(db: Index, store: PersistedStore): void { const fields = [ @@ -35,23 +40,6 @@ export function indexSessions(db: Index, store: PersistedStore): void { }); } -function getEnhancedContentForSession( - store: PersistedStore, - sessionId: string, -): string { - const contents: string[] = []; - store.forEachRow("enhanced_notes", (rowId: string, _forEachCell) => { - const noteSessionId = store.getCell("enhanced_notes", rowId, "session_id"); - if (noteSessionId === sessionId) { - const content = store.getCell("enhanced_notes", rowId, "content"); - if (typeof content === "string" && content) { - contents.push(content); - } - } - }); - return contents.join(" "); -} - export function indexHumans(db: Index, store: PersistedStore): void { const fields = [ "name", diff --git a/apps/desktop/src/contexts/search/engine/listeners.ts b/apps/desktop/src/contexts/search/engine/listeners.ts index 22b0a16e69..fb32432f9b 100644 --- a/apps/desktop/src/contexts/search/engine/listeners.ts +++ b/apps/desktop/src/contexts/search/engine/listeners.ts @@ -1,14 +1,21 @@ import { remove, type TypedDocument, update } from "@orama/orama"; import { RowListener } from "tinybase/with-schemas"; -import { Schemas } from "../../../store/tinybase/main"; -import { type Store as PersistedStore } from "../../../store/tinybase/main"; +import { + type Store as PersistedStore, + Schemas, +} from "../../../store/tinybase/main"; import { createHumanSearchableContent, createSessionSearchableContent, } from "./content"; import type { Index } from "./types"; -import { collectCells, toNumber, toTrimmedString } from "./utils"; +import { + collectCells, + getEnhancedContentForSession, + toNumber, + toTrimmedString, +} from "./utils"; export function createSessionListener( index: Index, @@ -48,23 +55,6 @@ export function createSessionListener( }; } -function getEnhancedContentForSession( - store: PersistedStore, - sessionId: string, -): string { - const contents: string[] = []; - store.forEachRow("enhanced_notes", (rowId: string, _forEachCell) => { - const noteSessionId = store.getCell("enhanced_notes", rowId, "session_id"); - if (noteSessionId === sessionId) { - const content = store.getCell("enhanced_notes", rowId, "content"); - if (typeof content === "string" && content) { - contents.push(content); - } - } - }); - return contents.join(" "); -} - export function createHumanListener( index: Index, ): RowListener { diff --git a/apps/desktop/src/contexts/search/engine/utils.ts b/apps/desktop/src/contexts/search/engine/utils.ts index 3ea2c62668..d917185358 100644 --- a/apps/desktop/src/contexts/search/engine/utils.ts +++ b/apps/desktop/src/contexts/search/engine/utils.ts @@ -1,3 +1,5 @@ +import { type Store as PersistedStore } from "../../../store/tinybase/main"; + const SPACE_REGEX = /\s+/g; export function safeParseJSON(value: unknown): unknown { @@ -110,3 +112,20 @@ export function collectCells( return acc; }, {}); } + +export function getEnhancedContentForSession( + store: PersistedStore, + sessionId: string, +): string { + const contents: string[] = []; + store.forEachRow("enhanced_notes", (rowId: string, _forEachCell) => { + const noteSessionId = store.getCell("enhanced_notes", rowId, "session_id"); + if (noteSessionId === sessionId) { + const content = store.getCell("enhanced_notes", rowId, "content"); + if (typeof content === "string" && content) { + contents.push(content); + } + } + }); + return contents.join(" "); +}