( sessionId: UUID, customTitle: string, fullPath?: string, source: 'user' | 'auto' = 'user', )
| 2795 | /* eslint-enable custom-rules/no-sync-fs */ |
| 2796 | |
| 2797 | export async function saveCustomTitle( |
| 2798 | sessionId: UUID, |
| 2799 | customTitle: string, |
| 2800 | fullPath?: string, |
| 2801 | source: 'user' | 'auto' = 'user', |
| 2802 | ) { |
| 2803 | // Fall back to computed path if fullPath is not provided |
| 2804 | const resolvedPath = fullPath ?? getTranscriptPathForSession(sessionId) |
| 2805 | appendEntryToFile(resolvedPath, { |
| 2806 | type: 'custom-title', |
| 2807 | customTitle, |
| 2808 | sessionId, |
| 2809 | }) |
| 2810 | // Cache for current session only (for immediate visibility) |
| 2811 | if (sessionId === getSessionId()) { |
| 2812 | getProject().currentSessionTitle = customTitle |
| 2813 | } |
| 2814 | logEvent('ncode_session_renamed', { |
| 2815 | source: |
| 2816 | source as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, |
| 2817 | }) |
| 2818 | } |
| 2819 | |
| 2820 | /** |
| 2821 | * Persist an AI-generated title to the JSONL as a distinct `ai-title` entry. |
no test coverage detected