( input: string, entryId: string, )
| 600 | } |
| 601 | |
| 602 | export function findLocalMemoryEntryDraft( |
| 603 | input: string, |
| 604 | entryId: string, |
| 605 | ): LocalMemoryEntryDraft | null { |
| 606 | const section = findLocalMemoryEntryFullSection(input, entryId); |
| 607 | if (!section) return null; |
| 608 | const id = section.meta?.id ?? slugId(section.title); |
| 609 | return { |
| 610 | id, |
| 611 | title: section.title, |
| 612 | status: normalizeEntryStatus(section.meta?.status, false), |
| 613 | content: section.content, |
| 614 | scope: normalizeScope(section.meta?.scope), |
| 615 | ...(section.meta?.sessionId ? { sessionId: section.meta.sessionId } : {}), |
| 616 | ...(section.meta?.proposalId ? { proposalId: section.meta.proposalId } : {}), |
| 617 | ...(section.meta?.sourceTurnId ? { sourceTurnId: section.meta.sourceTurnId } : {}), |
| 618 | }; |
| 619 | } |
| 620 | |
| 621 | function parseLocalMemoryMarkdownRaw(input: string): LocalMemoryRawParseResult { |
| 622 | const size = new TextEncoder().encode(input).byteLength; |
no test coverage detected