MCPcopy Create free account
hub / github.com/apache/maka / findLocalMemoryEntryDraft

Function findLocalMemoryEntryDraft

packages/core/src/local-memory.ts:602–619  ·  view source on GitHub ↗
(
  input: string,
  entryId: string,
)

Source from the content-addressed store, hash-verified

600}
601
602export 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
621function parseLocalMemoryMarkdownRaw(input: string): LocalMemoryRawParseResult {
622 const size = new TextEncoder().encode(input).byteLength;

Callers 2

#commitSemanticMethod · 0.90

Calls 4

slugIdFunction · 0.85
normalizeEntryStatusFunction · 0.85
normalizeScopeFunction · 0.85

Tested by

no test coverage detected