refactor: rename files

This commit is contained in:
2026-04-08 16:31:53 +05:30
parent e0546affec
commit 06be8cfd53
21 changed files with 44 additions and 37 deletions
+20 -19
View File
@@ -21,26 +21,27 @@ Users ask questions like: *"How does the if statement work?"* or *"Which functio
``` ```
ask262/ ask262/
├── agent.ts # Main ReAct agent - answers user queries ├── src/
├── agent-tools/ # Tool implementations (spec retriever, graph explorer) ├── agent.ts # Main ReAct agent - answers user queries
│ ├── index.ts # Tool exports │ ├── constants.ts # Directory paths and model configs
│ ├── specRetriever.ts # Vector search tool │ ├── agent-tools/ # Tool implementations (spec retriever, graph explorer)
│ ├── sectionRetriever.ts # Section chunk retrieval tool │ ├── index.ts # Tool exports
│ ├── graphExplorer.ts # Knowledge graph navigation tool │ ├── specRetriever.ts # Vector search tool
└── reranker.ts # Document reranking utility │ ├── sectionRetriever.ts # Section chunk retrieval tool
├── constants.ts # Directory paths and model configs │ │ ├── graphExplorer.ts # Knowledge graph navigation tool
│ │ └── reranker.ts # Document reranking utility
│ └── setup/ # Data ingestion and graph building
│ ├── ingest.ts # Ingests spec HTML into vector index
│ ├── buildGraph.ts # Builds knowledge graph
│ ├── stripSpecContainer.ts # Cleans spec HTML files
│ ├── htmlAddInternalMethodLink.ts # Adds internal method links
│ ├── text-splitters/ # Text chunking utilities
│ └── utils/ # Formatting utilities
│ └── test/ # Manual verification tests
│ └── manual/
│ ├── verify-db.ts # Verify database contents
│ └── test-spec-retriever.ts
├── config.json # API keys and endpoints (user-created) ├── config.json # API keys and endpoints (user-created)
├── setup/ # Data ingestion and graph building
│ ├── ingest.ts # Ingests spec HTML into vector index
│ ├── buildGraph.ts # Builds knowledge graph
│ ├── stripSpecContainer.ts # Cleans spec HTML files
│ ├── htmlAddInternalMethodLink.ts # Adds internal method links
│ ├── text-splitters/ # Text chunking utilities
│ └── utils/ # Formatting utilities
├── test/ # Manual verification tests
│ ├── manual/
│ │ ├── verify-db.ts # Verify database contents
│ │ └── test-spec-retriever.ts
├── spec-built/multipage/ # ECMAScript spec HTML files ├── spec-built/multipage/ # ECMAScript spec HTML files
├── engine262/src/ # JavaScript engine implementation ├── engine262/src/ # JavaScript engine implementation
├── storage/ # Vector index persistence (LanceDB) ├── storage/ # Vector index persistence (LanceDB)
+4 -4
View File
@@ -9,10 +9,10 @@
"lint:fix": "biome check . --write", "lint:fix": "biome check . --write",
"lint:fix:unsafe": "biome check . --write --unsafe", "lint:fix:unsafe": "biome check . --write --unsafe",
"format:fix": "biome format . --write", "format:fix": "biome format . --write",
"ingest": "bun run setup/ingest.ts", "ingest": "bun run src/setup/ingest.ts",
"verify-db": "bun run test/manual/verify-db.ts", "verify-db": "bun run src/test/manual/verify-db.ts",
"agent": "bun run agent.ts", "agent": "bun run src/agent.ts",
"build": "bun run setup/buildGraph.ts", "build": "bun run src/setup/buildGraph.ts",
"test": "bun test" "test": "bun test"
}, },
"keywords": [], "keywords": [],
+7 -2
View File
@@ -11,13 +11,18 @@ import {
createSectionRetrieverTool, createSectionRetrieverTool,
createSpecRetrieverTool, createSpecRetrieverTool,
} from "./agent-tools"; } from "./agent-tools";
import { EMBEDDING_MODEL, GRAPH_FILE, STORAGE_DIR } from "./constants"; import {
CONFIG_FILE,
EMBEDDING_MODEL,
GRAPH_FILE,
STORAGE_DIR,
} from "./constants";
const embeddings = new OllamaEmbeddings({ const embeddings = new OllamaEmbeddings({
model: EMBEDDING_MODEL, model: EMBEDDING_MODEL,
}); });
const config = JSON.parse(fs.readFileSync("./config.json", "utf-8")); const config = JSON.parse(fs.readFileSync(CONFIG_FILE, "utf-8"));
const apiKey = config.NVIDIA_API_KEY; const apiKey = config.NVIDIA_API_KEY;
const baseURL = config.NVIDIA_API_BASE; const baseURL = config.NVIDIA_API_BASE;
+1
View File
@@ -2,6 +2,7 @@ export const STORAGE_DIR = "./storage";
export const SPEC_DIR = "./spec-built/multipage"; export const SPEC_DIR = "./spec-built/multipage";
export const CODE_DIR = "./engine262/src"; export const CODE_DIR = "./engine262/src";
export const GRAPH_FILE = "./graphology/graph.json"; export const GRAPH_FILE = "./graphology/graph.json";
export const CONFIG_FILE = "./config.json";
// Model configurations // Model configurations
export const EMBEDDING_MODEL = "qwen3-embedding:0.6b"; export const EMBEDDING_MODEL = "qwen3-embedding:0.6b";
@@ -1,6 +1,6 @@
/** /**
* Manual test script for spec_retriever agent tool * Manual test script for spec_retriever agent tool
* Usage: bun run test/manual/test-spec-retriever.ts "your search query" * Usage: bun run src/test/manual/test-spec-retriever.ts "your search query"
*/ */
import * as lancedbSdk from "@lancedb/lancedb"; import * as lancedbSdk from "@lancedb/lancedb";
@@ -3,17 +3,17 @@
* Manual verification script for inspecting LanceDB documents/chunks. * Manual verification script for inspecting LanceDB documents/chunks.
* *
* Usage: * Usage:
* bun run test/manual/verify-db.ts # Show summary (default command) * bun run src/test/manual/verify-db.ts # Show summary (default command)
* bun run test/manual/verify-db.ts summary # Show database summary * bun run src/test/manual/verify-db.ts summary # Show database summary
* bun run test/manual/verify-db.ts list # List all sections * bun run src/test/manual/verify-db.ts list # List all sections
* bun run test/manual/verify-db.ts section <id> # Show chunks for a section * bun run src/test/manual/verify-db.ts section <id> # Show chunks for a section
* bun run test/manual/verify-db.ts search "query" # Search by vector similarity (semantic search) * bun run src/test/manual/verify-db.ts search "query" # Search by vector similarity (semantic search)
* bun run test/manual/verify-db.ts tree # Show full section hierarchy * bun run src/test/manual/verify-db.ts tree # Show full section hierarchy
* bun run test/manual/verify-db.ts tree sec-ecmascript-language-source-code # Show subtree from section * bun run src/test/manual/verify-db.ts tree sec-ecmascript-language-source-code # Show subtree from section
* bun run test/manual/verify-db.ts sample # Show random samples * bun run src/test/manual/verify-db.ts sample # Show random samples
* bun run test/manual/verify-db.ts large # Show large documents * bun run src/test/manual/verify-db.ts large # Show large documents
* bun run test/manual/verify-db.ts --help # Show help * bun run src/test/manual/verify-db.ts --help # Show help
* bun run test/manual/verify-db.ts <command> --help # Show help for specific command * bun run src/test/manual/verify-db.ts <command> --help # Show help for specific command
*/ */
import fs from "node:fs"; import fs from "node:fs";