( sessionId: UUID, prNumber: number, prUrl: string, prRepository: string, fullPath?: string, )
| 2883 | * This stores the PR number, URL, and repository for tracking and navigation. |
| 2884 | */ |
| 2885 | export async function linkSessionToPR( |
| 2886 | sessionId: UUID, |
| 2887 | prNumber: number, |
| 2888 | prUrl: string, |
| 2889 | prRepository: string, |
| 2890 | fullPath?: string, |
| 2891 | ): Promise<void> { |
| 2892 | const resolvedPath = fullPath ?? getTranscriptPathForSession(sessionId) |
| 2893 | appendEntryToFile(resolvedPath, { |
| 2894 | type: 'pr-link', |
| 2895 | sessionId, |
| 2896 | prNumber, |
| 2897 | prUrl, |
| 2898 | prRepository, |
| 2899 | timestamp: new Date().toISOString(), |
| 2900 | }) |
| 2901 | // Cache for current session so reAppendSessionMetadata can re-write after compaction |
| 2902 | if (sessionId === getSessionId()) { |
| 2903 | const project = getProject() |
| 2904 | project.currentSessionPrNumber = prNumber |
| 2905 | project.currentSessionPrUrl = prUrl |
| 2906 | project.currentSessionPrRepository = prRepository |
| 2907 | } |
| 2908 | logEvent('ncode_session_linked_to_pr', { prNumber }) |
| 2909 | } |
| 2910 | |
| 2911 | export function getCurrentSessionTag(sessionId: UUID): string | undefined { |
| 2912 | // Only returns tag for current session (the only one we cache) |
no test coverage detected