29 Commits

  • chore: sync root pnpm-lock.yaml with new workspace dep
    CI runs `pnpm install` from the repo root using the root lockfile with
    the default frozen-lockfile behaviour. The previous commits ran install
    only inside understand-anything-plugin/ so the new
    @understand-anything/tree-sitter-dart-wasm workspace dependency was
    recorded in understand-anything-plugin/pnpm-lock.yaml but missed at
    the repo root — CI would have stopped at install.
    
    Flagged by @chatgpt-codex-connector on #435.
  • feat(core): add Kotlin structural analysis via tree-sitter
    Wires Kotlin into the existing tree-sitter pipeline so .kt and .kts
    files now produce functions, classes, data classes, sealed classes,
    interfaces, objects, imports, exports, and call-graph edges — matching
    the behavior of the other language extractors.
    
    ## Why @tree-sitter-grammars/tree-sitter-kotlin
    
    The standard `tree-sitter-kotlin` (v0.3.8) ships only native bindings.
    The new `@tree-sitter-grammars/tree-sitter-kotlin@1.1.0` ships a
    prebuilt `.wasm` (loads cleanly with `web-tree-sitter@^0.26.6`,
    nodeTypeCount=289, parses class_declaration / function_declaration as
    expected). Same shape that PR1 used for Swift, just a different
    publisher because the repomix WASM bundle does not include Kotlin.
    
    `@tree-sitter-grammars` is the official tree-sitter org's GitHub
    account, so this is the canonical upstream WASM source for Kotlin.
    
    ## Notes for reviewers
    
    - `kotlinConfig` already existed as a stub (no `treeSitter` field), so
      Android / JVM / Gradle codebases currently produce no structural
      edges between `.kt` files. This PR adds the `treeSitter` field; the
      existing plugin loader picks it up unchanged.
    - **Visibility rule differs from Swift**: Kotlin's default visibility
      is `public`, so the extractor treats *every* declaration with no
      modifier as exported. Only an explicit `private` opts out. `internal`
      and `protected` remain exported in the project-graph sense because
      they are still resolvable from other files (within the module / via
      inheritance).
    - `class_declaration` in tree-sitter-kotlin is overloaded for class,
      data class, sealed class, and interface (distinguished by the keyword
      child and `modifiers > class_modifier`). The extractor handles all
      four uniformly.
    - `object_declaration` is a separate node type (Kotlin singletons) —
      treated as a class-like entry with its own `name` and members.
    - Primary-constructor parameters marked `val` / `var` are surfaced as
      class properties; plain `parameter`s without `val/var` are
      constructor-only and are NOT counted as properties (matching Kotlin
      semantics).
    - Import handling distinguishes the three forms: plain dotted
      (`import a.b.C`), wildcard (`import a.b.*` → specifier `"*"`), and
      aliased (`import a.b.C as Foo` → specifier `"Foo"`).
    
    ## Verification
    
    - `pnpm lint` clean
    - `pnpm --filter @understand-anything/core build` clean
    - `pnpm --filter @understand-anything/skill build` clean
    - `pnpm --filter @understand-anything/core test`: **692/692** (+22 new
      Kotlin tests, matching the bar set by go-extractor.test.ts /
      swift-extractor.test.ts)
    - `pnpm test`: 196/196 (no regressions)
    
    Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
  • Merge pull request #204 from Lum1104/feat/semantic-batching-and-output-chunking
    fix(#159): semantic batching + bundled importMap + Phase 1 speedup
  • chore(dependencies): update astro and vite versions in package.json and pnpm-lock.yaml
    Bumps astro to version 6.3.7 and vite to version 6.4.2 across relevant package files to ensure compatibility and access to the latest features.
  • chore(lint): switch to recommended baseline, fix errors, wire into CI
    - typescript-eslint preset: strict -> recommended for a usable first-pass
      baseline (per PR discussion); ratchet up in a follow-up.
    - Drop the projectService/parserOptions block. Neither `recommended` nor
      `strict` is type-aware, so it was unused; removing it also avoids the
      pnpm-workspace tsconfig-resolution failure mode flagged in review.
    - Add Node + browser globals via the `globals` package so .mjs scripts and
      the dashboard stop hitting `no-undef`.
    - Expand ignores: built bundles (**/public/**), Astro generated (.astro/),
      and .private/ (eval scratch). Cuts 2400+ errors in vendored output.
    - Allow `_`-prefixed unused vars/args/caught errors; skip irregular
      whitespace inside comments (json-parser intentionally embeds ZWSP-escaped
      block-comment examples in JSDoc).
    - Fix the residual 13 genuine errors: drop dead imports/vars, replace
      two `as any[]` in schema.ts with `Array<Record<string, unknown>>`,
      drop unused destructure in change-classifier, drop unused catch binding
      in extract-structure.mjs.
    - Add EOF newline to eslint.config.mjs.
    - Refresh pnpm-lock.yaml.
    - Add `pnpm lint` step to .github/workflows/ci.yml so the tooling
      actually enforces something.
    
    pnpm lint now exits 0 locally; 33+13 test files / 1445 tests still pass.
  • chore(dashboard): add graphology-types as direct dep
    Code review flagged that without it as a direct dep, TypeScript would
    fail to resolve types like Attributes/NodeKey from transitive
    graphology-types when later tasks import them.
    
    Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
  • refactor: extract KIND_TO_NODE_TYPE as module-level constant in GraphBuilder
    Previously the mapping object was recreated on every mapKindToNodeType call. Moving it to module level means it is allocated once at load time instead of once per definition node processed.
  • feat: add /understand-knowledge for Karpathy LLM wiki knowledge bases
    Support the Karpathy LLM wiki pattern — a three-layer architecture
    (raw sources + wiki markdown + schema) with wikilinks, index.md
    categories, and append-only log.md.
    
    Pipeline:
    - parse-knowledge-base.py: deterministic extraction of articles,
      wikilinks, categories from index.md, source nodes from raw/
    - article-analyzer agent: LLM-based entity/claim extraction and
      implicit relationship discovery (builds_on, contradicts, etc.)
    - merge-knowledge-graph.py: combines scan + analysis with entity
      dedup, layer assignment from categories, tour generation
    
    Dashboard:
    - KnowledgeGraphView with d3-force layout (community clustering
      by index.md categories, degree-proportional sizing)
    - 5 knowledge node types (article, entity, topic, claim, source)
    - 6 knowledge edge types with visual styling
    - KnowledgeNodeDetails sidebar (wikilinks, backlinks, preview)
    - Auto-detect kind:"knowledge" → knowledge-only view mode
    
    Core:
    - 5 node types + 6 edge types added to NodeType/EdgeType unions
    - KnowledgeMeta interface (wikilinks, backlinks, category, content)
    - kind field on KnowledgeGraph for view mode detection
    - Zod schemas + node/edge type aliases
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
  • feat(homepage): add cinematic project homepage with GitHub Pages deployment
    Astro-based static homepage with dark luxury theme, self-hosted fonts,
    scroll-reveal animations, and GitHub Actions CI/CD to Pages.
    
    Sections: Nav, Hero, Dashboard Showcase, Feature Cards, Install CTA, Footer.
    
    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  • fix: resolve plugin installation failures for workspace resolution and missing dependencies
    - Add pnpm-workspace.yaml to plugin distribution so workspace:* deps resolve on install
    - Add devlop and hast-util-to-jsx-runtime as explicit dashboard dependencies (pnpm strict hoisting)
    - Make tsconfig.json files self-contained to work outside monorepo root
    - Add prepare script to auto-build core package after pnpm install
    - Bump version to 1.0.2
  • feat: redesign dashboard with dark luxury theme, improve agent pipeline
    - Remove ChatPanel and @anthropic-ai/sdk dependency (redundant with /understand-chat)
    - Replace Monaco editor with styled summary code viewer
    - New graph-first layout: 75% graph + 360px right sidebar
    - Dark luxury aesthetic: deep blacks, gold/amber accents, DM Serif Display typography
    - Add ProjectOverview component for sidebar default state
    - Learn persona now shows tour panel directly in sidebar
    - Add schema validation on graph load with error banner
    - Defensive null checks in store for tour methods
    - Agent pipeline: write intermediate results to disk instead of context
    - Agent models: sonnet for simple tasks, opus for complex (no haiku)
    - Prompt-engineer all 5 agent prompts and SKILL.md
    - Auto-trigger /understand-dashboard after /understand completes
    - Add dashboard screenshot to README
    - Bump version to 1.0.1
    
    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  • refactor: restructure monorepo into Claude Code plugin layout
    Move packages/{core,dashboard,skill} into understand-anything-plugin/ to
    conform to the Claude Code plugin format. Add .claude-plugin/marketplace.json
    for plugin discovery. Update workspace config and docs accordingly.
    
    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  • fix(dashboard): add markdown rendering for chat messages and API key management
    - Render assistant messages with ReactMarkdown (headers, code blocks,
      lists, bold, links, blockquotes) instead of plain whitespace-pre-wrap
    - Add "Change Key" button in chat header to clear and re-enter API key
    - Document the plain-text localStorage tradeoff for API key storage
    
    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  • feat(skill): scaffold skill package with /understand-chat command
    Add the @understand-anything/skill package with context-builder (search +
    1-hop expansion + layer resolution), chat prompt builder, skill definition
    for Claude Code, and 14 passing tests.
    
    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  • feat(dashboard): add dagre auto-layout for hierarchical graph visualization
    Replace grid-based node positioning with dagre-powered hierarchical layout
    that computes positions based on edge direction (top-to-bottom). This
    produces clean, readable graphs instead of the previous chaotic grid pattern.
    
    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  • feat(core): add fuzzy search engine with Fuse.js
    Add SearchEngine class with fuzzy matching across node name, tags,
    summary, and languageNotes fields. Supports type filtering, result
    limiting, and dynamic re-indexing via updateNodes(). Uses Fuse.js
    extended search with OR-token splitting for multi-word queries.
    
    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  • feat(core): add Zod schema validation for knowledge graph loading
    Add runtime validation of knowledge graph JSON using Zod schemas that
    mirror every type in types.ts. The loadGraph function now validates
    by default (opt-out via { validate: false }) and throws descriptive
    errors on invalid data.
    
    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  • feat(core): add tree-sitter analyzer plugin for TS/JS
    Add TreeSitterPlugin using web-tree-sitter (WASM-based) to extract
    structural information from TypeScript and JavaScript files. The plugin
    implements the AnalyzerPlugin interface and extracts functions, classes,
    imports, exports, and call graphs via AST traversal.
    
    Uses web-tree-sitter instead of native tree-sitter for cross-platform
    compatibility (no native compilation required).
    
    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>