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

Function routeDrafts

graph-ui/src/compiler/card-compiler.ts:380–405  ·  view source on GitHub ↗
(routes: readonly RouteRef[], rank: number)

Source from the content-addressed store, hash-verified

378}
379
380function routeDrafts(routes: readonly RouteRef[], rank: number): Draft[] {
381 return routes.map((route) => {
382 const method = route.method ?? 'ANY';
383 const handler = route.handler === undefined ? '' : ` handled by ${route.handler}`;
384 const source: CardSource = { name: `${method} ${route.path}` };
385 if (route.filePath !== undefined) {
386 source.filePath = route.filePath;
387 }
388 if (route.line !== undefined) {
389 source.line = route.line;
390 }
391 return {
392 kind: 'route' as const,
393 lines: [
394 `The route ${method} ${route.path} is registered in `
395 + `${route.filePath ?? 'an unnamed file'}`
396 + `${route.line === undefined ? '' : `:${route.line}`}${handler}.`,
397 route.origin === 'source'
398 ? 'It was read off the source text, not out of the index.'
399 : 'The index reports it.',
400 ],
401 source,
402 rank,
403 };
404 });
405}
406
407function entryDraft(entryPoints: readonly SymbolSearchHit[], rank: number): Draft[] {
408 if (entryPoints.length === 0) {

Callers 1

compileCardsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected