(line: string)
| 726 | } |
| 727 | |
| 728 | function parseMetaComment(line: string): Record<string, string> | null { |
| 729 | const match = /^<!--\s*maka-memory:\s*(.*?)\s*-->$/.exec(line.trim()); |
| 730 | if (!match) return null; |
| 731 | const meta: Record<string, string> = {}; |
| 732 | for (const part of (match[1] ?? '').split(/\s+/)) { |
| 733 | const idx = part.indexOf('='); |
| 734 | if (idx <= 0) continue; |
| 735 | const key = part.slice(0, idx); |
| 736 | const value = part.slice(idx + 1); |
| 737 | if (/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(key) && value.length <= 128) { |
| 738 | meta[key] = value; |
| 739 | } |
| 740 | } |
| 741 | return meta; |
| 742 | } |
| 743 | |
| 744 | function findLocalMemoryEntrySection( |
| 745 | input: string, |
no test coverage detected