text stringlengths 14 100k | source stringclasses 1
value | repo stringclasses 810
values | language stringclasses 13
values |
|---|---|---|---|
<|fim_prefix|>import type { StructuralAnalysis, CallGraphEntry } from "../../types.js";
import type { LanguageExtractor, TreeSitterNode } from "./types.js";
import { findChild, findChildren } from "./base-extractor.js";
/**
* Extract parameter names from a PHP `formal_parameters` node.
*
* Each child is a `simple_p... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import type { StructuralAnalysis, CallGraphEntry } from "../../types.js";
import type { LanguageExtractor, TreeSitterNode } from "./types.js";
import { findChild, findChildren } from "./base-extractor.js";
/**
* Extract parameter names from a Python `parameters` node.
*
* Handles: identifier (plain), ... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|> Ruby bare method calls without arguments (e.g., `setup`) are parsed as
// `identifier` nodes inside `body_statement`, not as `call` nodes.
// Treat them as calls when inside a function context.
if (
node.type === "identifier" &&
node.parent?.type === "body_statement" &&
... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>ch) continue;
if (ch.type === "self" || ch.type === "identifier") {
specifiers.push(ch.text);
} else if (ch.type === "scoped_identifier") {
// Nested scoped identifier inside a use list
specifiers.push(ch.text);
}
}
... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>SitterNode): CallGraphEntry[];
}
<|fim_prefix|>import<|fim_middle|> type { StructuralAnalysis, CallGraphEntry } from "../../types.js";
// Re-export the tree-sitter Node type for use by extractors
export type TreeSitterNode = import("web-tree-sitter").Node;
/**
* Language-specific extractor that maps a ... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>e.startPosition.row + 1,
node.endPosition.row + 1,
],
params,
returnType,
});
}
}
}
private extractImport(
node: TreeSitterNode,
imports: StructuralAnalysis["imports"],
): void {
const sourceNode = node.children.find(
(c)... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import type { AnalyzerPlugin, StructuralAnalysis, ServiceInfo, StepInfo } from "../../types.js";
/**
* Parses Dockerfiles to extract multi-stage build stages, EXPOSE ports, and instructio<|fim_suffix|>ering.
* Does not parse ARG/ENV variable substitution or heredoc syntax.
*/
export class DockerfilePa... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|> definitions.push({
name: match[1],
kind: "variable",
lineRange: [i + 1, i + 1],
fields: [],
});
}
}
return definitions;
}
}
<|fim_prefix|>import type { AnalyzerPlugin, StructuralAnalysis, DefinitionInfo } from "../../types.js";
/**
* Parse... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>|interface|union|scalar)\s+(\w+)/gm;
let match;
while ((match = typeRegex.exec(content)) !== null) {
const kind = match[1];
const name = match[2];
if (name === "Query" || name === "Mutation" || name === "Subscription") continue;
const startLine = content.slice(0, match.inde... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>non-code parsers with a PluginRegistry.
*/
export function registerAllParsers(registry: PluginRegistry): void {
registry.register(new MarkdownParser());
registry.register(new YAMLConfigParser());
registry.register(new JSONConfigParser());
registry.register(new TOMLParser());
registry.register(n... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>key sections and $ref references.
* Handles package.json, tsconfig.json, wrangler.jsonc, JSON Schema, and OpenAPI spec files.
* Does not descend into nested object structures beyond top-level keys.
*
* JSONC support: line comments (`// ...`), block comments (`/* ... */`), and
* trailing commas are s... | fim | Egonex-AI/Understand-Anything | typescript |
import type { AnalyzerPlugin, StructuralAnalysis, StepInfo } from "../../types.js";
/**
* Parses Makefiles to extract build targets and their line ranges.
* Filters out special Make targets (e.g., .PHONY, .DEFAULT, .SUFFIXES) and variable assignments.
* Does not parse target dependencies or recipe commands.
*/
exp... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|> {
sections.push({
name: match[2].trim(),
level: match[1].length,
lineRange: [i + 1, i + 1],
});
}
}
// Fix lineRange end for each section (extends to next heading or EOF)
for (let i = 0; i < sections.length; i++) {
const next = section... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>pth++;
if (content[i] === "}") {
depth--;
if (depth === 0) return i;
}
}
if (depth !== 0) {
console.warn(`[protobuf-parser] Unbalanced braces detected (depth=${depth}), results may be incomplete`);
}
return content.length;
}
}
<|fim_prefix|>import type {... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>\s+(\w+)\s*\{?/);
if (!match) continue;
const name = match[1];
const hasBraceHere = lines[i].includes("{");
let nextNonBlank = i + 1;
while (nextNonBlank < lines.length && lines[nextNonBlank].trim() === "") {
nextNonBlank++;
}
const hasBraceNext = nextNonB... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import type { AnalyzerPlugin, StructuralAnalysis, DefinitionInfo } from "../../types.js";
/**
* Parses SQL files to extract table, view, and index definitions.
* Handles CREATE TABLE, CREATE VIEW, CREATE INDEX with IF NOT EXISTS and OR REPLACE variants.
* Does not handle stored procedures, triggers, o... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>orm configuration blocks.
*/
export class TerraformParser implements AnalyzerPlugin {
name = "terraform-parser";
languages = ["terraform"];
analyzeFile(_filePath: string, content: string): StructuralAnalysis {
const resources = this.extractResources(content);
const definitions = this.extra... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import type { AnalyzerPlugin, StructuralAnalysis, SectionInfo } from "../../types.js";
/**
* Parses TOML files to extract section headers ([section] and [[array-of-tables]]).
* Computes section nesting level from dotted key paths (e.g., [tool.poetry] = level 2).
* Does not parse individual key-value p... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>me;
else if (typeof e.id === "string") name = e.id;
else if (typeof e.kind === "string") name = e.kind;
}
sections.push({
name,
level: 1,
lineRange: [1, lines.length],
});
}
}
} catch (err) {
... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|> getSupportedLanguages(): string[] {
return [...this.languageMap.keys()];
}
}
<|fim_prefix|>import type { AnalyzerPlugin, StructuralAnalysis, ImportResolution, CallGraphEntry } from "../types.js";
import { LanguageRegistry } from "../languages/language-registry.js";
/**
* Registry for analyzer pl... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import { describe, it, expect, beforeAll } from "vitest";
import { TreeSitterPlugin } from "./tree-sitter-plugin.js";
describe("TreeSitterPlugin", () => {
let plugin: TreeSitterPlugin;
beforeAll(async () => {
plugin = new TreeSitterPlugin();
await plugin.init();
});
describe("analyzeFil... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import { createRequire } from "node:module";
import { dirname, resolve, extname } from "node:path";
import type {
AnalyzerPlugin,
StructuralAnalysis,
ImportResolution,
CallGraphEntry,
} from "../types.js";
import type { LanguageConfig } from "../languages/types.js";
import type { LanguageExtractor... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import { z } from "zod";
// Edge types (35 values across 8 categories)
export const EdgeTypeSchema = z.enum([
"imports", "exports", "contains", "inherits", "implements", // Structural
"calls", "subscribes", "publishes", "middleware", // Behavioral
"reads_from", "writes_to", "transforms... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import Fuse, { type IFuseOptions } from "fuse.js";
import type { GraphNode } from "./types.js";
export interface SearchResult {
nodeId: string;
score: number; // 0 = perfect match, 1 = worst match
}
export interface SearchOptions {
types?: GraphNode["type"][];
limit?: number;
}
const FUSE_OPTIO... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import { execFileSync } from "child_process";
import type { KnowledgeGraph, GraphNode, GraphEdge } from "./types.js";
export interface StalenessResult {
stale: boolean;
changedFiles: string[];
}
/**
* Get the list of files that changed between a given commit and HEAD.
* Returns an empty array if t... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import { describe, it, expect } from "vitest";
import type { KnowledgeGraph, GraphNode, GraphEdge, EdgeType, NodeType, StructuralAnalysis, AnalyzerPlugin, ReferenceResolution } from "./types.js";
describe("KnowledgeGraph types", () => {
it("should create a valid empty KnowledgeGraph", () => {
const... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>// Node types (21 total: 5 code + 8 non-code + 3 domain + 5 knowledge)
export type NodeType =
| "file" | "function" | "class" | "module" | "concept"
| "config" | "document" | "service" | "table" | "endpoint"
| "pipeline" | "schema" | "resource"
| "domain" | "flow" | "step"
| "article" | "entity"... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>t: {
include: ['src/**/*.test.{ts,tsx,mjs}'],
},
});
<|fim_prefix|>import { defineConfig } from 'vitest/config';
expo<|fim_middle|>rt default defineConfig({
tes<|endoftext|> | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>// Per-layer aggregation perf benchmark.
//
// Mirrors the BEFORE shape (graph.nodes.filter(n => layer.nodeIds.includes(n.id))
// per layer) and the AFTER shape (single nodesById Map + iterate layer.nodeIds)
// from `useOverviewGraph` in `src/components/GraphView.tsx`. Issue #102 reported
// a 4.8 MB know... | fim | Egonex-AI/Understand-Anything | javascript |
<|fim_suffix|>t) {
const repaired = { ...input, children: fillDims(input.children) };
return elk.layout(repaired);
}
/**
* Synthetic Stage 1 graph: top-level container nodes with a sparse edge mesh.
* Stage 1 only lays out containers (lazy children — see plan §3), so the
* "node count" parameter is interpreted ... | fim | Egonex-AI/Understand-Anything | javascript |
<|fim_prefix|>import {<|fim_suffix|>ardShortcuts.nextStep,
action: () => {
const state = useDashboardStore.getState();
if (state.tourActive) {
state.nextTourStep();
}
},
category: "Tour",
},
{
key: "ArrowLeft",
description: t.... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import { useDashboardStore } from "../store";
import { useI18n } from "../contexts/I18nContext";
export default function Breadcrumb() {
const navigationLevel = useDashboardStore((s) => s.navigationLevel);
const activeLayerId = useDashboardStore((s) => s.activeLayerId);
const graph = useDashboardSto... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import { useEffect, useMemo, useState } from "react";
import { Highlight, themes } from "prism-react-renderer";
import { useDashboardStore } from "../store";
import { useI18n } from "../contexts/I18nContext";
interface CodeViewerProps {
accessToken: string;
presentation?: "sidebar" | "modal";
onClo... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import { memo } from "react";
import type { NodeProps, Node } from "@xyflow/react";
import { getLayerColor } from "./LayerLegend";
export interface ContainerNodeData extends Record<string, unknown> {
containerId: string;
name: string;
childCount: number;
strategy: "folder" | "community";
colorI... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import { memo } from "react";
import { Handle, Position } from "@xyflow/react";
import type { NodeProps, Node } from "@xyflow/react";
import type { NodeType } from "@understand-anything/core/types";
import { useI18n } from "../contexts/I18nContext";
// Color maps keyed by NodeType — must be kept in sync ... | fim | Egonex-AI/Understand-Anything | typescript |
import { useDashboardStore } from "../store";
import { useI18n } from "../contexts/I18nContext";
export default function DiffToggle() {
const diffMode = useDashboardStore((s) => s.diffMode);
const toggleDiffMode = useDashboardStore((s) => s.toggleDiffMode);
const changedNodeIds = useDashboardStore((s) => s.chang... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>ta.entities.slice(0, 5).map((e) => (
<span key={e} className="text-[10px] px-1.5 py-0.5 rounded bg-elevated text-text-secondary">
{e}
</span>
))}
{data.entities.length > 5 && (
<span className="text-[10px] text-text-muted">+... | fim | Egonex-AI/Understand-Anything | typescript |
import { useEffect, useMemo, useState } from "react";
import {
ReactFlow,
ReactFlowProvider,
Background,
BackgroundVariant,
Controls,
MiniMap,
} from "@xyflow/react";
import type { Edge, Node } from "@xyflow/react";
import "@xyflow/react/dist/style.css";
import DomainClusterNode from "./DomainClusterNode";... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>revokeObjectURL(url);
alert("Failed to create canvas context");
return;
}
ctx.drawImage(img, 0, 0, width * 2, height * 2);
URL.revokeObjectURL(url);
const filename = `${graph?.project.name ?? "knowledge-graph"}-export.png`;
canvas.toBlob((blob) ... | fim | Egonex-AI/Understand-Anything | typescript |
import { useMemo, useState } from "react";
import type { GraphNode } from "@understand-anything/core/types";
import { useDashboardStore } from "../store";
import { useI18n } from "../contexts/I18nContext";
interface FileEntry {
name: string;
path: string;
type: "folder" | "file";
children: FileEntry[];
nodeI... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import { useEffect, useRef } from "react";
import { useDashboardStore, ALL_NODE_TYPES, ALL_COMPLEXITIES, ALL_EDGE_CATEGORIES } from "../store";
import type { NodeType, Complexity, EdgeCategory } from "../store";
import { useI18n } from "../contexts/I18nContext";
export default function FilterPanel() {
... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>fault memo(FlowNode);
<|fim_prefix|>import { memo } from "react";
import { Handle, Position } from "@xyflow/react";
import type { Node, NodeProps } from "@xyflow/react";
import { useDashboardStore } from "../store";
export interface FlowNodeData extends Record<string, unknown> {
label: string;
summar... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>) and skip pans/zoom-outs
// (so a user who manually collapses a container at zoom > 1 can pan
// around without seeing it pop back open).
const prevZoomRef = useRef<number | null>(null);
const onMove = useCallback(
(event: MouseEvent | TouchEvent | null) => {
if (event === null) return;... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import type { KeyboardShortcut } from "../hooks/useKeyboardShortcuts";
import { formatShortcutKey } from "../hooks/useKeyboardShortcuts";
import { useI18n } from "../contexts/I18nContext";
interface KeyboardShortcutsHelpProps {
shortcuts: KeyboardShortcut[];
onClose: () => void;
}
export default fun... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>",
topic: "var(--color-node-topic)",
claim: "var(--color-node-claim)",
source: "var(--color-node-source)",
};
return colorMap[type] ?? "var(--color-accent)";
}}
maskColor="var(--glass-bg)"
className="!bg-surfac... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>v>
{/* Layer name */}
<div className="text-lg font-heading text-text-primary mb-1">
{data.layerName}
</div>
{/* Description */}
<div className="text-[11px] text-text-secondary line-clamp-2 leading-tight mb-3">
{data.layerDescription}
</... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|> ml-0.5">
({layer.nodeIds.length})
</span>
</span>
</div>
);
})}
</div>
</div>
);
}
<|fim_prefix|>import { useDashboardStore } from "../store";
import { useI18n } from "../contexts/I18nContext";
// Shared layer colo... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|> </h4>
<p className="text-sm text-text-secondary leading-relaxed">
{step.languageLesson}
</p>
</div>
)}
{/* Referenced component pills */}
{step.nodeIds.length > 0 && (
<div className="mb-4">
<h4 className... | fim | Egonex-AI/Understand-Anything | typescript |
import type { ReactNode } from "react";
import { useI18n } from "../contexts/I18nContext";
export type MobileTab = "graph" | "info" | "files";
interface Props {
activeTab: MobileTab;
onTabChange: (tab: MobileTab) => void;
}
const tabIcons: Record<MobileTab, ReactNode> = {
graph: (
<svg viewBox="0 0 24 24" ... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|> <div className="-mx-1">
<LayerLegend />
</div>
</section>
)}
<section>
<SectionLabel>{t.drawer.tools}</SectionLabel>
<div className="flex flex-wrap items-center gap-2">
<FilterPanel />
... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>}
{/* Path finder */}
{pathFinderOpen && (
<Suspense fallback={null}>
<PathFinderModal isOpen={pathFinderOpen} onClose={togglePathFinder} />
</Suspense>
)}
</div>
);
}
<|fim_prefix|>import { lazy, Suspense, useEffect, useState } from "react";
import type ... | fim | Egonex-AI/Understand-Anything | typescript |
import { useState } from "react";
import { useDashboardStore } from "../store";
import { useI18n } from "../contexts/I18nContext";
import type { NodeType, EdgeType, KnowledgeGraph, GraphNode } from "@understand-anything/core/types";
// Badge color classes keyed by NodeType — must be kept in sync with core NodeType uni... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|> </p>
)}
{/* Tags */}
{tags.length > 0 && (
<div className="flex flex-wrap gap-1 pt-2 border-t border-border-subtle">
{tags.slice(0, 3).map((tag) => (
<span
key={tag}
className="text-[9px] px-1.5 py-0.5 rounded-... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import { useEffect, useState } from "react";
import { useI18n } from "../contexts/I18nContext";
/**
* First-visit onboarding overlay (controlled).
*
* Parent owns the visibility + persistence state (see App.tsx). This component
* only renders the modal and reports the user's intent via onDismiss:
* ... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import { useEffect, useRef, useState } from "react";
import { useDashboardStore } from "../store";
interface PathFinderModalProps {
isOpen: boolean;
onClose: () => void;
}
export default function PathFinderModal({ isOpen, onClose }: PathFinderModalProps) {
const graph = useDashboardStore((s) => s.... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import { useDashboa<|fim_suffix|>rsonas.map((p) => (
<button
key={p.id}
onClick={() => setPersona(p.id)}
title={p.description}
className={`px-2.5 py-1 rounded text-[11px] font-medium transition-colors ${
persona === p.id
? "bg-accen... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import { memo } from "react";
import { Handle, Position } from "@xyflow/react";
import type { NodeProps, Node } from "@xyflow/react";
import { getLayerColor } from "./LayerLegend";
export interface PortalNodeData extends Record<string, unknown> {
targetLayerId: string;
targetLayerName: string;
conn... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import { useDashboardStore } from "../store";
import { useI18n } from "../contexts/I18nContext";
export default function ProjectOverview() {
const graph = useDashboardStore((s) => s.graph);
const startTour = useDashboardStore((s) => s.startTour);
const { t } = useI18n();
if (!graph) {
return... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { useDashboardStore } from "../store";
import { useI18n } from "../contexts/I18nContext";
const typeBadgeColors: Record<string, string> = {
file: "text-node-file border border-node-file/30 bg-node-file/10",
function: "t... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import { memo } from "react";
import { Handle, Position } from "@xyflow/react";
import type { Node, NodeProps } from "@xyflow/react";
import { useDashboardStore } from "../store";
export interface StepNodeData extends Record<string, unknown> {
label: string;
summary: string;
filePath?: string;
st... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|> stroke="currentColor"
strokeWidth="3"
>
<polyline points="20 6 9 17 4 12" />
</svg>
)}
</button>
))}
</div>
</div>
{/* A... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>pan role="img" aria-label="key">🔑</span> line.
</p>
{/* Form */}
<form onSubmit={handleSubmit} className="flex flex-col gap-4">
<input
type="text"
value={input}
onChange={(e) => {
setInput(e.target.value);
... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>e-300/80">
<span className="text-orange-400 shrink-0 mt-0.5">
<svg className="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18L18 6M6 6l12 12" />
... | fim | Egonex-AI/Understand-Anything | typescript |
import { createContext, useContext, useMemo, type ReactNode } from "react";
import { getLocale, resolveLocaleKey, type Locale, type LocaleKey } from "../locales";
interface I18nContextValue {
locale: Locale;
localeKey: LocaleKey;
t: Locale;
}
const I18nContext = createContext<I18nContextValue | null>(null);
ex... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import { useEffect, useState } from "react";
const DEFAULT_BREAKPOINT = 768;
export function useIsMobile(breakpoint: number = DEFAULT_BREAKPOINT): boolean {
const query = `(max-width: ${breakpoint - 1}px)`;
const [isMobile, setIsMobile] = useState<boolean>(() => {
if (typeof window === "undefine... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>erCase());
return keys.join(" + ");
}
<|fim_prefix|>import { useEffect } from "react";
export interface KeyboardShortcut {
key: string;
ctrlKey?: boolean;
shiftKey?: boolean;
altKey?: boolean;
metaKey?: boolean;
description: string;
action: () => void;
category: string;
}
export funct... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|> provisions: { forward: "provisions", backward: "provisioned by" },
routes: { forward: "routes to", backward: "routed from" },
defines_schema: { forward: "defines schema for", backward: "schema defined by" },
triggers: { forward: "triggers", backward: "triggered by" },
contains_flow: { fo... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import en from "./en";
import zh from "./zh";
import zhTW from "./zh-TW";
import ja from "./ja";
import ko from "./ko";
import ru from "./ru";
export type LocaleKey = "en" | "zh" | "zh-TW" | "ja" | "ko" | "ru";
export type Locale = typeof en;
export const locales: Record<LocaleKey, Locale> = {
en,
z... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>"継承される" },
implements: { forward: "実装", backward: "実装される" },
calls: { forward: "呼び出す", backward: "呼び出される" },
subscribes: { forward: "購読", backward: "購読される" },
publishes: { forward: "公開", backward: "消費される" },
middleware: { forward: "ミドルウェア", backward: "ミドルウェアを使用" },
reads_from: { fo... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>export const ko = {
common: {
loading: "프로젝트 로딩 중...",
noGraphLoaded: "지식 그래프가 로드되지 않음",
selectNode: "노드를 선택하여 상세 정보 확인",
back: "뒤로",
focus: "포커스",
unfocus: "포커스 해제",
openCode: "코드 열기",
file: "파일",
tags: "태그",
connections: "연결",
filter: "필터",
resetAll: "모두... | fim | Egonex-AI/Understand-Anything | typescript |
export const ru = {
common: {
loading: "Загрузка проекта...",
noGraphLoaded: "Граф знаний не загружен",
selectNode: "Выберите узел, чтобы увидеть подробности",
back: "Назад",
focus: "Фокус",
unfocus: "Снять фокус",
openCode: "Открыть код",
file: "Файл",
tags: "Теги",
connection... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>export const zhTW = {
common: {
loading: "載入專案...",
noGraphLoaded: "未載入知識圖谱",
selectNode: "選擇節點查看詳情",
back: "返回",
focus: "聚焦",
unfocus: "取消聚焦",
openCode: "開啟程式碼",
file: "檔案",
tags: "標籤",
connections: "連結",
filter: "篩選",
resetAll: "重置全部",
analyzed: "分析時... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>ckward: "跨领域来自" },
cites: { forward: "引用", backward: "被引用" },
contradicts: { forward: "反驳", backward: "被反驳" },
builds_on: { forward: "基于", backward: "作为基础" },
exemplifies: { forward: "例证", backward: "被例证" },
categorized_under: { forward: "归类于", backward: "归类" },
authored_by: { forw... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>e>
<App />
</StrictMode>,
);
<|fim_prefix|>import { StrictMode } from "react";
import { createRoot } from "r<|fim_middle|>eact-dom/client";
import "./index.css";
import App from "./App";
createRoot(document.getElementById("root")!).render(
<StrictMod<|endoftext|> | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>) => ({
exportMenuOpen: !state.exportMenuOpen,
filterPanelOpen: false,
})),
togglePathFinder: () => set((state) => ({
pathFinderOpen: !state.pathFinderOpen,
})),
setReactFlowInstance: (instance) => set({ reactFlowInstance: instance }),
setFilters: (newFilters) => set((state) => ({... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import {
createContext,
useCallback,
useContext,
useEffect,
useRef,
useState,
type ReactNode,
} from "react";
import type { HeadingFont, PresetId, ThemeConfig, ThemePreset } from "./types.ts";
import { DEFAULT_THEME_CONFIG } from "./types.ts";
import { getPreset } from "./presets.ts";
import... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>export { ThemeProvider, useTheme } from "./ThemeContext.tsx";
export { PRESETS, getPreset, getAccent } from "./presets.ts";
export { app<|fim_suffix|> } from "./theme-engine.ts";
export type { HeadingFont, PresetId, ThemeConfig, ThemePreset, AccentSwatch } from "./types.ts";
export { DEFAULT_THEME_CONFIG ... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import type { AccentSwatch, ThemePreset } from "./types.ts";
const DARK_ACCENT_SWATCHES: AccentSwatch[] = [
{ id: "gold", name: "Gold", accent: "#d4a574", accentDim: "#c9a96e", accentBright: "#e8c49a" },
{ id: "ocean", name: "Ocean", accent: "#5ba4cf", accentDim: "#4e93ba", accentBright: "#7abce0" },... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import type { ThemeConfig } from "./types.ts";
import { getAccent, getPreset } from "./presets.ts";
export function hexToRgb(hex: string): string {
const h = hex.replace("#", "");
const n = parseInt(h, 16);
return `${(n >> 16) & 255}, ${(n >> 8) & 255}, ${n & 255}`;
}
function deriveFromAccent(acc... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>ches: AccentSwatch[];
defaultAccentId: string;
}
export type HeadingFont = "serif" | "sans" | "mono";
export interface ThemeConfig {
presetId: PresetId;
accentId: string;
headingFont?: HeadingFont;
}
export const DEFAULT_THEME_CONFIG: ThemeConfig = {
presetId: "dark-gold",
accentId: "gold",... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import { describe, it, expect } from "vitest";
import { deriveContainers } from "../containers";
import type { GraphNode, GraphEdge } from "@understand-anything/core/types";
function node(id: string, filePath?: string): GraphNode {
return {
id,
type: "file",
name: id,
filePath,
summ... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>;
});
<|fim_prefix|>import { describe, it, expect } from "vitest";
import { aggregateContainerEdges } from "../edgeAggregation";
import type { GraphEdge, EdgeType } from "@understand-anything/core/types";
const ce = (source: string, target: string, type: EdgeType = "calls"): GraphEdge => ({
source,
t... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>.toBe("number");
expect(typeof c.y).toBe("number");
}
});
it("returns fatal issue when ELK rejects (without throwing in non-strict)", async () => {
// Force ELK rejection by giving an invalid algorithm
const result = await applyElkLayout(
{
id: "root",
children... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import { describe, it, expect } from "vitest";
import { filterNodes, filterEdges } from "../filters";
import type {
GraphNode,
GraphEdge,
Layer,
} from "@understand-anything/core/types";
import type {
FilterState,
NodeType,
Complexity,
EdgeCategory,
} from "../../store";
import {
ALL_NODE_... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|> budget so CI variance
// doesn't flake; the pre-fix path would blow past it by 2-10×.
const nodes: GraphNode[] = [];
const layers: Layer[] = [];
for (let li = 0; li < 100; li++) {
const ids: string[] = [];
for (let ni = 0; ni < 100; ni++) {
const id = `n-${li}-${ni}`;
... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>s graphology-communities-louvain", () => {
expect(typeof louvain).toBe("function");
});
});
<|fim_prefix|>import { describe, it, expect } from "vitest";
import ELK from "elkjs/lib/elk.bundled.js";
import Graph from "graphology";
import louvain from "graphology-communities-louvain";
describe("depend... | fim | Egonex-AI/Understand-Anything | typescript |
import type {
GraphNode,
GraphEdge,
} from "@understand-anything/core/types";
import { detectCommunities } from "./louvain";
export interface DerivedContainer {
id: string;
name: string;
nodeIds: string[];
strategy: "folder" | "community";
}
export interface DeriveResult {
containers: DerivedContainer[]... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>.map((p) => ({
sourceLayerId: p.sourceLayerId,
targetLayerId: p.targetLayerId,
count: p.count,
edgeTypes: Array.from(p.edgeTypes),
}));
}
/**
* Compute portal info for a given layer: which other layers are connected
* and how many edges cross the boundary.
* Accepts optional pre-comp... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import ELK from "elkjs/lib/elk.bundled.js";
import type { GraphIssue } from "@understand-anything/core/schema";
import { NODE_WIDTH, NODE_HEIGHT } from "./layout";
export interface ElkChild {
id: string;
width?: number;
height?: number;
/** Set by ELK after layout; absent on input. Downstream con... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import type { GraphNode, GraphEdge } from "@understand-anything/core/types";
import <|fim_suffix|>.includes(node.id)` per node-per-layer,
* which was O(N × L × K) and dominated export time on large graphs (#102).
*
* Membership semantics are any-layer-wins, matching the prior shape: a
* node in L1 and... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import type { GraphNode, Layer } from "@understand-anything/core/types";
export type Complexity = "simple" | "moderate" | "complex";
export interface LayerStats {
/** Number of layer.nodeIds that resolve to a node in the graph. */
resolvedCount: number;
/** Aggregate label for the cluster card; ma... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|>-------------
export const ELK_DEFAULT_LAYOUT_OPTIONS: Record<string, string> = {
algorithm: "layered",
"elk.direction": "DOWN",
"elk.layered.spacing.nodeNodeBetweenLayers": "80",
"elk.spacing.nodeNode": "60",
"elk.layered.crossingMinimization.strategy": "LAYER_SWEEP",
"elk.edgeRouting": "ORT... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import dagre from "@dagrejs/dagre";
export interface LayoutMessage {
requestId: number;
nodes: Array<{ id: string; width: number; height: number }>;
edges: Array<{ source: string; target: string }>;
direction: "TB" | "LR";
}
export interface LayoutResult {
requestId: number;
positions: Recor... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import Graph from "graphology";
import louvain from "graphology-communities-louvain";
import type { GraphEdge } from "@understand-anything/core/types";
/**
* Run Louvain community detection over the provided node<|fim_suffix|> if (!ids.has(e.source) || !ids.has(e.target)) continue;
if (e.source ===... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|> />
<|fim_prefix|>/// <referen<|fim_middle|>ce types="vite/client"<|endoftext|> | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailw<|fim_suffix|>.test(id)
) {
return "markdown";
}
},
},
},
},
plugins: [react(), tailwindcss()],
});
<|fim_middle|>indcss/vite";
import path f... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_prefix|>/// <reference types="vitest" />
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
import path from "path";
import fs from "fs";
import crypto from "crypto";
// Generate a one-time token when the server process starts.
// This toke... | fim | Egonex-AI/Understand-Anything | typescript |
<|fim_suffix|> }
*
* Writes: <projectRoot>/.understand-anything/fingerprints.json
* Exit code: 0 on success (including 0 files analyzed); non-zero on error.
*/
import { createRequire } from 'node:module';
import { dirname, resolve } from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url';
import ... | fim | Egonex-AI/Understand-Anything | javascript |
<|fim_prefix|>#!/usr/bin/env node
/**
* compute-batches.mjs — Phase 1.5 of /understand
*
* Reads scan-result.json, runs Louvain community detection on the import
* graph, and writes batches.json containing batches + neighborMap.
*
* Usage:
* node compute-batches.mjs <project-root> [--changed-files=<path>]
*
... | fim | Egonex-AI/Understand-Anything | javascript |
<|fim_prefix|>#!/usr/bin/env node
/**
* extract-import-map.mjs
*
* Deterministic import resolution script for the project-scanner agent.
* Uses PluginRegistry (TreeSitterPlugin + non-code parsers) from
* @understand-anything/core to extract raw import paths via tree-sitter,
* then applies language-specific resolu... | fim | Egonex-AI/Understand-Anything | javascript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.