MCPcopy Index your code
hub / github.com/Noumena-Network/code / linkSessionToPR

Function linkSessionToPR

src/utils/sessionStorage.ts:2885–2909  ·  view source on GitHub ↗
(
  sessionId: UUID,
  prNumber: number,
  prUrl: string,
  prRepository: string,
  fullPath?: string,
)

Source from the content-addressed store, hash-verified

2883 * This stores the PR number, URL, and repository for tracking and navigation.
2884 */
2885export 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
2911export function getCurrentSessionTag(sessionId: UUID): string | undefined {
2912 // Only returns tag for current session (the only one we cache)

Callers 1

trackGitOperationsFunction · 0.85

Calls 5

appendEntryToFileFunction · 0.85
getSessionIdFunction · 0.85
getProjectFunction · 0.85
logEventFunction · 0.50

Tested by

no test coverage detected