( filename: string, agentId?: AgentId, )
| 1747 | } |
| 1748 | |
| 1749 | function shouldExcludeFromPostCompactRestore( |
| 1750 | filename: string, |
| 1751 | agentId?: AgentId, |
| 1752 | ): boolean { |
| 1753 | const normalizedFilename = expandPath(filename) |
| 1754 | // Exclude plan files |
| 1755 | try { |
| 1756 | const planFilePath = expandPath(getPlanFilePath(agentId)) |
| 1757 | if (normalizedFilename === planFilePath) { |
| 1758 | return true |
| 1759 | } |
| 1760 | } catch { |
| 1761 | // If we can't get plan file path, continue with other checks |
| 1762 | } |
| 1763 | |
| 1764 | // Exclude all types of claude.md files |
| 1765 | // TODO: Refactor to use isMemoryFilePath() from claudemd.ts for consistency |
| 1766 | // and to also match child directory memory files (.ncode/rules/*.md, legacy |
| 1767 | // .claude/rules/*.md, etc.) |
| 1768 | try { |
| 1769 | const normalizedMemoryPaths = new Set( |
| 1770 | MEMORY_TYPE_VALUES.map(type => expandPath(getMemoryPath(type))), |
| 1771 | ) |
| 1772 | |
| 1773 | if (normalizedMemoryPaths.has(normalizedFilename)) { |
| 1774 | return true |
| 1775 | } |
| 1776 | } catch { |
| 1777 | // If we can't get memory paths, continue |
| 1778 | } |
| 1779 | |
| 1780 | return false |
| 1781 | } |
no test coverage detected