MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / readerMetadata

Function readerMetadata

graph-ui/src/browser-ai/chat-model.ts:104–110  ·  view source on GitHub ↗

The open file in words, not as a JSON record: from "status":"ready" the model made up * a pull request status "ready" (K12).

(context: BrowserChatReaderContext)

Source from the content-addressed store, hash-verified

102/** The open file in words, not as a JSON record: from "status":"ready" the model made up
103 * a pull request status "ready" (K12). */
104function readerMetadata(context: BrowserChatReaderContext): string {
105 const source = context.source;
106 const path = `\`${(context.path ?? source?.path ?? '').replace(/`/g, "'")}\``;
107 if (!source) return `Current file ${path}: source ${context.status === 'loading' ? 'still loading' : context.status === 'empty' ? 'not open' : 'unavailable'} (reader status: ${context.status}).`;
108 const range = source.kind === 'selection' ? `lines ${source.startLine}:${source.startColumn}-${source.endLine}:${source.endColumn}` : `lines ${source.startLine}-${source.endLine}`;
109 return `Current ${source.kind === 'selection' ? 'selection in' : 'file'} ${path}, ${range}, source version ${source.sourceVersion}.${source.partial ? ` ${source.partial}` : ''}`;
110}
111
112function readerSystemContext(context: BrowserChatReaderContext): string {
113 const source = context.source;

Callers 1

readerSystemContextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected