MCPcopy Create free account
hub / github.com/Noumena-Network/code / saveCustomTitle

Function saveCustomTitle

src/utils/sessionStorage.ts:2797–2818  ·  view source on GitHub ↗
(
  sessionId: UUID,
  customTitle: string,
  fullPath?: string,
  source: 'user' | 'auto' = 'user',
)

Source from the content-addressed store, hash-verified

2795/* eslint-enable custom-rules/no-sync-fs */
2796
2797export 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.

Callers 4

LogSelectorFunction · 0.85
autoNameSessionFromPlanFunction · 0.85
callFunction · 0.85
callFunction · 0.85

Calls 5

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

Tested by

no test coverage detected