SYMBOL INDEX (195 symbols across 61 files) FILE: backend/app/core/errors.py function api_error (line 4) | def api_error(code: str, message: str, **extra): function api_success (line 14) | def api_success(**data): FILE: backend/app/core/observability.py function log_event (line 13) | def log_event(event: str, **fields): class Timer (line 25) | class Timer: method __init__ (line 26) | def __init__(self): method elapsed_ms (line 29) | def elapsed_ms(self) -> int: FILE: backend/app/main.py function root (line 39) | async def root(): function healthz (line 44) | async def healthz(): FILE: backend/app/routers/generate.py class GenerateRequest (line 35) | class GenerateRequest(BaseModel): function _sse_message (line 42) | def _sse_message(payload: dict[str, Any]) -> str: function _strip_mermaid_code_fences (line 46) | def _strip_mermaid_code_fences(text: str) -> str: function _extract_component_mapping (line 50) | def _extract_component_mapping(response: str) -> str: function process_click_events (line 60) | def process_click_events(diagram: str, username: str, repo: str, branch:... function _parse_request_payload (line 74) | def _parse_request_payload(payload: Any) -> tuple[GenerateRequest | None... function _get_github_data (line 82) | def _get_github_data(username: str, repo: str, github_pat: str | None): function _estimate_repo_input_tokens (line 87) | async def _estimate_repo_input_tokens( function get_generation_cost (line 109) | async def get_generation_cost(request: Request): function generate_stream (line 177) | async def generate_stream(request: Request): FILE: backend/app/services/github_service.py class GithubData (line 43) | class GithubData: function _should_include_file (line 49) | def _should_include_file(path: str) -> bool: function _fetch_json (line 54) | def _fetch_json(url: str, headers: dict[str, str], not_found_message: st... class GitHubService (line 63) | class GitHubService: method __init__ (line 64) | def __init__(self, pat: str | None = None): method _normalize_private_key (line 76) | def _normalize_private_key(self) -> str: method _can_use_app_auth (line 82) | def _can_use_app_auth(self) -> bool: method _generate_jwt (line 85) | def _generate_jwt(self) -> str: method _get_installation_token (line 96) | def _get_installation_token(self) -> str: method _get_headers (line 136) | def _get_headers(self) -> dict[str, str]: method get_default_branch (line 153) | def get_default_branch(self, username: str, repo: str) -> str: method get_github_file_paths_as_list (line 161) | def get_github_file_paths_as_list(self, username: str, repo: str, bran... method get_github_readme (line 178) | def get_github_readme(self, username: str, repo: str) -> str: method get_github_data (line 193) | def get_github_data(self, username: str, repo: str) -> GithubData: FILE: backend/app/services/mermaid_service.py class MermaidValidationResult (line 9) | class MermaidValidationResult: function normalize_parser_message (line 17) | def normalize_parser_message(message: str | None) -> str: function validate_mermaid_syntax (line 27) | def validate_mermaid_syntax(diagram: str) -> MermaidValidationResult: function format_validation_feedback (line 71) | def format_validation_feedback(result: MermaidValidationResult) -> str: FILE: backend/app/services/model_config.py function get_model (line 8) | def get_model() -> str: FILE: backend/app/services/openai_service.py class OpenAIService (line 17) | class OpenAIService: method __init__ (line 18) | def __init__(self): method _resolve_api_key (line 21) | def _resolve_api_key(self, override_api_key: str | None = None) -> str: method estimate_tokens (line 30) | def estimate_tokens(text: str) -> int: method _build_input (line 35) | def _build_input(system_prompt: str, user_prompt: str) -> list[dict]: method _create_client (line 42) | def _create_client(api_key: str) -> AsyncOpenAI: method stream_completion (line 50) | async def stream_completion( method count_input_tokens (line 89) | async def count_input_tokens( FILE: backend/app/services/pricing.py class ModelPricing (line 9) | class ModelPricing: function _strip_date_snapshot_suffix (line 36) | def _strip_date_snapshot_suffix(model: str) -> str: function resolve_pricing_model (line 42) | def resolve_pricing_model(model: str) -> str: function estimate_text_token_cost_usd (line 81) | def estimate_text_token_cost_usd( FILE: backend/app/utils/format_message.py function format_user_message (line 1) | def format_user_message(data: dict[str, str | None]) -> str: FILE: backend/scripts/validate_mermaid.mjs function ensureDomPurifyPatched (line 11) | function ensureDomPurifyPatched() { function getMermaid (line 29) | async function getMermaid() { function ensureMermaidInitialized (line 37) | async function ensureMermaidInitialized() { function readStdin (line 48) | async function readStdin() { function normalizeError (line 56) | function normalizeError(error) { function main (line 66) | async function main() { FILE: backend/tests/test_generate_router.py function test_healthz_ok (line 13) | def test_healthz_ok(): function test_generate_cost_success (line 19) | def test_generate_cost_success(monkeypatch): function test_generate_cost_error (line 51) | def test_generate_cost_error(monkeypatch): function test_generate_stream_event_order_with_fix_loop (line 68) | def test_generate_stream_event_order_with_fix_loop(monkeypatch): function test_modify_route_removed (line 137) | def test_modify_route_removed(): FILE: backend/tests/test_generate_utils.py function test_process_click_events_builds_blob_and_tree_links (line 4) | def test_process_click_events_builds_blob_and_tree_links(): FILE: backend/tests/test_pricing.py function test_resolve_pricing_model_keeps_gpt_5_4_mini_on_its_own_tier (line 4) | def test_resolve_pricing_model_keeps_gpt_5_4_mini_on_its_own_tier(): function test_estimate_text_token_cost_uses_gpt_5_4_mini_pricing (line 9) | def test_estimate_text_token_cost_uses_gpt_5_4_mini_pricing(): FILE: next.config.js method rewrites (line 10) | async rewrites() { FILE: src/app/[username]/[repo]/page.tsx type RepoPageProps (line 4) | type RepoPageProps = { function generateMetadata (line 8) | async function generateMetadata({ function Repo (line 18) | async function Repo({ params }: RepoPageProps) { FILE: src/app/[username]/[repo]/repo-page-client.tsx type RepoPageClientProps (line 12) | type RepoPageClientProps = { function RepoPageClient (line 17) | function RepoPageClient({ username, repo }: RepoPageClientProps) { FILE: src/app/_actions/cache.ts function getCachedDiagram (line 8) | async function getCachedDiagram(username: string, repo: string) { function getCachedExplanation (line 25) | async function getCachedExplanation(username: string, repo: string) { function cacheDiagramAndExplanation (line 42) | async function cacheDiagramAndExplanation( function getDiagramStats (line 73) | async function getDiagramStats() { FILE: src/app/_actions/repo.ts function getLastGeneratedDate (line 7) | async function getLastGeneratedDate(username: string, repo: string) { FILE: src/app/api/generate/cost/route.ts constant MULTI_STAGE_INPUT_MULTIPLIER (line 14) | const MULTI_STAGE_INPUT_MULTIPLIER = 2; constant INPUT_OVERHEAD_TOKENS (line 15) | const INPUT_OVERHEAD_TOKENS = 3000; constant ESTIMATED_OUTPUT_TOKENS (line 16) | const ESTIMATED_OUTPUT_TOKENS = 8000; function estimateRepoInputTokens (line 18) | async function estimateRepoInputTokens( function POST (line 40) | async function POST(request: Request) { FILE: src/app/api/generate/stream/route.ts constant MAX_MERMAID_FIX_ATTEMPTS (line 29) | const MAX_MERMAID_FIX_ATTEMPTS = 3; function sleep (line 31) | function sleep(ms: number) { function estimateRepoTokenCount (line 35) | async function estimateRepoTokenCount( function POST (line 57) | async function POST(request: Request) { FILE: src/app/api/healthz/route.ts function GET (line 6) | async function GET() { FILE: src/app/layout.tsx function RootLayout (line 75) | function RootLayout({ FILE: src/app/page.tsx function HomePage (line 11) | function HomePage() { FILE: src/app/providers.tsx function CSPostHogProvider (line 25) | function CSPostHogProvider({ children }: { children: React.ReactNode }) { FILE: src/components/action-button.tsx type ActionButtonProps (line 10) | interface ActionButtonProps { function ActionButton (line 18) | function ActionButton({ FILE: src/components/api-key-button.tsx type ApiKeyButtonProps (line 4) | interface ApiKeyButtonProps { function ApiKeyButton (line 8) | function ApiKeyButton({ onClick }: ApiKeyButtonProps) { FILE: src/components/api-key-dialog.tsx type ApiKeyDialogProps (line 9) | interface ApiKeyDialogProps { function ApiKeyDialog (line 15) | function ApiKeyDialog({ isOpen, onClose, onSubmit }: ApiKeyDialogProps) { FILE: src/components/copy-button.tsx type CopyButtonProps (line 11) | interface CopyButtonProps { function CopyButton (line 15) | function CopyButton({ onClick }: CopyButtonProps) { FILE: src/components/export-dropdown.tsx type ExportDropdownProps (line 5) | interface ExportDropdownProps { function ExportDropdown (line 12) | function ExportDropdown({ FILE: src/components/footer.tsx function Footer (line 4) | function Footer() { FILE: src/components/header-client.tsx type HeaderClientProps (line 10) | interface HeaderClientProps { function formatStarCount (line 19) | function formatStarCount(count: number) { function HeaderClient (line 23) | function HeaderClient({ starCount }: HeaderClientProps) { FILE: src/components/header.tsx function Header (line 4) | async function Header() { FILE: src/components/loading.tsx type LoadingProps (line 26) | interface LoadingProps { function Loading (line 75) | function Loading({ FILE: src/components/main-card.tsx type MainCardProps (line 16) | interface MainCardProps { function MainCard (line 29) | function MainCard({ FILE: src/components/mermaid-diagram.tsx type MermaidChartProps (line 8) | interface MermaidChartProps { type SvgPanZoomInstance (line 13) | type SvgPanZoomInstance = { function ensureDomNodesSerializeSafely (line 20) | function ensureDomNodesSerializeSafely() { FILE: src/components/private-repos-dialog.tsx type PrivateReposDialogProps (line 9) | interface PrivateReposDialogProps { function PrivateReposDialog (line 15) | function PrivateReposDialog({ FILE: src/components/theme-toggle.tsx function ThemeToggle (line 6) | function ThemeToggle() { FILE: src/components/ui/button.tsx type ButtonProps (line 36) | interface ButtonProps FILE: src/components/ui/sonner.tsx type ToasterProps (line 6) | type ToasterProps = React.ComponentProps; FILE: src/features/diagram/api.ts type StreamHandlers (line 8) | interface StreamHandlers { function getGenerationCost (line 28) | async function getGenerationCost( function streamDiagramGeneration (line 64) | async function streamDiagramGeneration( FILE: src/features/diagram/export.ts function exportMermaidSvgAsPng (line 1) | function exportMermaidSvgAsPng(svgElement: SVGSVGElement): void { FILE: src/features/diagram/github-url.ts type ParsedGitHubRepo (line 1) | interface ParsedGitHubRepo { constant GITHUB_URL_PATTERN (line 6) | const GITHUB_URL_PATTERN = function parseGitHubRepoUrl (line 9) | function parseGitHubRepoUrl(url: string): ParsedGitHubRepo | null { FILE: src/features/diagram/sse.ts function parseSSEChunk (line 3) | function parseSSEChunk(chunk: string): DiagramStreamMessage[] { function parseSSEStreamBuffer (line 22) | function parseSSEStreamBuffer(buffer: string): { FILE: src/features/diagram/types.ts type DiagramStreamStatus (line 1) | type DiagramStreamStatus = type DiagramStreamState (line 20) | interface DiagramStreamState { type DiagramStreamMessage (line 34) | interface DiagramStreamMessage { type DiagramCostResponse (line 48) | interface DiagramCostResponse { type StreamGenerationParams (line 55) | interface StreamGenerationParams { FILE: src/hooks/diagram/useDiagramExport.ts function useDiagramExport (line 5) | function useDiagramExport(diagram: string) { FILE: src/hooks/diagram/useDiagramStream.ts type UseDiagramStreamOptions (line 9) | interface UseDiagramStreamOptions { function useDiagramStream (line 16) | function useDiagramStream({ FILE: src/hooks/useDiagram.ts function useDiagram (line 14) | function useDiagram(username: string, repo: string) { FILE: src/hooks/useStarReminder.tsx function useStarReminder (line 6) | function useStarReminder() { FILE: src/lib/exampleRepos.ts function normalizePathSegment (line 9) | function normalizePathSegment(value: string) { function isExampleRepo (line 17) | function isExampleRepo(username: string, repo: string) { FILE: src/lib/utils.ts function cn (line 4) | function cn(...inputs: ClassValue[]) { FILE: src/server/db/index.ts type DrizzleDatabase (line 13) | type DrizzleDatabase = FILE: src/server/generate/format.ts type TaggedValues (line 1) | type TaggedValues = Record; function toTaggedMessage (line 3) | function toTaggedMessage(values: TaggedValues): string { function processClickEvents (line 10) | function processClickEvents( function extractComponentMapping (line 28) | function extractComponentMapping(response: string): string { function stripMermaidCodeFences (line 41) | function stripMermaidCodeFences(text: string): string { FILE: src/server/generate/github.ts type GitHubRepoResponse (line 1) | interface GitHubRepoResponse { type GitHubTreeItem (line 5) | interface GitHubTreeItem { type GitHubTreeResponse (line 9) | interface GitHubTreeResponse { type GitHubReadmeResponse (line 13) | interface GitHubReadmeResponse { type GithubData (line 18) | interface GithubData { constant EXCLUDED_PATTERNS (line 24) | const EXCLUDED_PATTERNS = [ function shouldIncludeFile (line 54) | function shouldIncludeFile(path: string): boolean { function createHeaders (line 59) | function createHeaders(githubPat?: string): HeadersInit { function fetchJson (line 74) | async function fetchJson( function getDefaultBranch (line 97) | async function getDefaultBranch( function getFileTree (line 111) | async function getFileTree( function getReadme (line 137) | async function getReadme( function getGithubData (line 159) | async function getGithubData( FILE: src/server/generate/mermaid.ts type DomPurifyLike (line 11) | interface DomPurifyLike { function ensureDomPurifyPatched (line 17) | function ensureDomPurifyPatched() { function getMermaid (line 35) | async function getMermaid() { function ensureMermaidInitialized (line 44) | async function ensureMermaidInitialized() { function normalizeParserMessage (line 56) | function normalizeParserMessage(message?: string): string { type MermaidErrorHash (line 71) | interface MermaidErrorHash { type MermaidParserError (line 77) | interface MermaidParserError extends Error { type MermaidValidationResult (line 81) | interface MermaidValidationResult { function validateMermaidSyntax (line 89) | async function validateMermaidSyntax( function formatValidationFeedback (line 108) | function formatValidationFeedback(result: MermaidValidationResult): stri... FILE: src/server/generate/model-config.ts constant DEFAULT_MODEL (line 1) | const DEFAULT_MODEL = "gpt-5.4-mini"; function readEnvValue (line 3) | function readEnvValue(name: string): string | undefined { function getModel (line 8) | function getModel(): string { FILE: src/server/generate/openai.ts type ReasoningEffort (line 3) | type ReasoningEffort = "low" | "medium" | "high"; function resolveApiKey (line 5) | function resolveApiKey(overrideApiKey?: string): string { function estimateTokens (line 15) | function estimateTokens(text: string): number { type StreamCompletionParams (line 20) | interface StreamCompletionParams { type CountInputTokensParams (line 65) | interface CountInputTokensParams { function countInputTokens (line 73) | async function countInputTokens({ FILE: src/server/generate/pricing.ts type ModelPricing (line 1) | interface ModelPricing { constant DEFAULT_PRICING_MODEL (line 6) | const DEFAULT_PRICING_MODEL = "gpt-5.4-mini"; constant MODEL_PRICING (line 8) | const MODEL_PRICING: Record = { constant DEFAULT_PRICING (line 26) | const DEFAULT_PRICING = MODEL_PRICING[DEFAULT_PRICING_MODEL] as ModelPri... function normalizeModelId (line 28) | function normalizeModelId(model: string): string { function stripDateSnapshotSuffix (line 32) | function stripDateSnapshotSuffix(model: string): string { function resolvePricingModel (line 36) | function resolvePricingModel(model: string): string { function estimateTextTokenCostUsd (line 60) | function estimateTextTokenCostUsd( FILE: src/server/generate/prompts.ts constant SYSTEM_FIRST_PROMPT (line 1) | const SYSTEM_FIRST_PROMPT = ` constant SYSTEM_SECOND_PROMPT (line 45) | const SYSTEM_SECOND_PROMPT = ` constant SYSTEM_THIRD_PROMPT (line 71) | const SYSTEM_THIRD_PROMPT = ` constant SYSTEM_FIX_MERMAID_PROMPT (line 161) | const SYSTEM_FIX_MERMAID_PROMPT = ` FILE: src/server/generate/types.ts type GenerateRequest (line 10) | type GenerateRequest = z.infer; function sseMessage (line 12) | function sseMessage(payload: Record): string { FILE: src/server/github-stars.ts type GitHubRepoResponse (line 3) | interface GitHubRepoResponse { constant GITHUB_REPO_URL (line 7) | const GITHUB_REPO_URL = constant GITHUB_API_VERSION (line 9) | const GITHUB_API_VERSION = "2022-11-28"; constant STAR_COUNT_REVALIDATE_SECONDS (line 10) | const STAR_COUNT_REVALIDATE_SECONDS = 60 * 30; function createHeaders (line 12) | function createHeaders(): HeadersInit { function getStarCount (line 29) | async function getStarCount() {