Commit Graph
100 Commits
Author SHA1 Message Date
bendtherules e9417984a9 graph - Ignore type errors 2026-04-14 16:57:17 +05:30
bendtherules 164747c255 chore(types) - Fix type checks 2026-04-14 16:47:20 +05:30
bendtherules 5413f86d2b chore: downgrade version to 0.0.1 and add prepublish / publish npm scripts 2026-04-14 14:41:24 +05:30
bendtherules 78745f7195 Prepare npm release 2026-04-14 14:34:25 +05:30
bendtherules 132cf3e13a feat(agent-tools): run child process with Bun instead of Node 2026-04-14 14:34:17 +05:30
bendtherules cd386bd09f fix(test/manual): correct sectionId typo for array.map section
Updated the `sectionId` value from `sec-array-prototype-map` to `sec-array.prototype.map` to match the proper identifier format.
2026-04-14 14:16:26 +05:30
bendtherules 57d2493b9f feat(evaluate) - Run evaluateInEngine262 in child_process with strict timeout 2026-04-14 14:16:10 +05:30
bendtherules 61823dcb23 feat: add reset method to Ask262Debug and use it in evaluateInEngine262 tool to clear captured marks and internal state. 2026-04-14 13:24:38 +05:30
bendtherules 60582fc6ae feat(mcp-server): enable idempotentHint by default
Changed the `idempotentHint` annotation from `false` to `true` in the MCP server configuration. This enables idempotent behavior hints for relevant operations.
2026-04-14 13:04:30 +05:30
bendtherules 07a4d4957d feat(agent-tools/mcp-server): unify evaluate output schema and improve error handling
- Replace union output schema with a single combined schema containing optional fields for success and error cases, addressing MCP SDK limitation with union types.
- Add `importantSections`, `otherSections`, and `consoleOutput` as optional fields in the new schema.
- Update exported `outputSchema` and `EvaluateToolOutput` type to use the combined schema.
- Refactor execution logic to handle engine262's `ThrowCompletion_` instead of relying on thrown exceptions, extracting a readable error message.
- Adjust MCP server error detection to check `result.error !== undefined` rather than using the `in` operator.
- Update related comments and documentation to reflect the new schema design and error handling approach.
2026-04-14 11:12:17 +05:30
bendtherules 887ad3e5a4 feat(mcp-server): Add MCP server with tool registrations
Add MCP server implementation with support for:
- ask262_search_spec_sections tool
- ask262_get_section_content tool
- ask262_evaluate_in_engine262 tool
Includes proper error handling, input/output schemas, and structured
content responses.
2026-04-14 11:12:03 +05:30
bendtherules 1c9d08f7fa style: reorder tool import after other imports for consistency 2026-04-14 09:33:14 +05:30
bendtherules e34441c341 Fix tsconfig 2026-04-13 18:46:55 +05:30
bendtherules 76fb177b3a feat(evaluateInEngine262): Add mock global console, capture results and return
- Updated tool metadata to describe pure ECMAScript restrictions and new JSON output (importantSections, otherSections, consoleOutput).
- Added `ConsoleEntry` type and logic to capture console method calls during evaluation.
- Exposed a global `console` with `log`, `warn`, `debug`, and `error` methods to the evaluated code.
- Adjusted argument description and example usage accordingly.
2026-04-11 18:06:48 +05:30
bendtherules 741bfee670 Tools - Move all description to a named export toolMetadata 2026-04-09 10:05:09 +05:30
bendtherules bc28df017f docs: clarify ask262Debug usage in engine262 evaluation tool descriptions and add usage example. 2026-04-09 09:59:15 +05:30
bendtherules f30ddce003 chore(package): add missing newline at end of .opencode/package.json 2026-04-09 09:54:56 +05:30
bendtherules b18cab1f5f fix(agent): replace ask262_graph_explorer with ask262_search_spec_sections for function lookup
Also added missing newline at the end of `.opencode/package.json`.
2026-04-09 09:54:49 +05:30
bendtherules 3c4893c320 searchSpecSections.ts and consumer - mention vector search 2026-04-09 09:54:28 +05:30
bendtherules 26509680ea feat(tool): add recursive flag to section content retrieval
- Introduce `recursive` boolean argument (default true) to the getSectionContent tool schema.
- Update descriptions to clarify that recursive fetching occurs only when `recursive=true`.
- Pass the `recursive` parameter from the CLI wrapper to the core tool function.
- Modify the content fetching logic to traverse child sections only when `recursive` is enabled.
2026-04-09 09:51:43 +05:30
bendtherules 1b338ffed7 build: Add opencode tools for testing 2026-04-08 19:04:29 +05:30
bendtherules 606896a676 chore: remove debug console.log statements from agent tool implementations (evaluateInEngine262, graphExplorer, searchSpecSections) 2026-04-08 19:03:53 +05:30
bendtherules c109acba01 refactor: rename tools 2026-04-08 18:40:45 +05:30
bendtherules 30debd2cf9 build: EvaluateInEngine262 tool 2026-04-08 18:38:58 +05:30
bendtherules 06be8cfd53 refactor: rename files 2026-04-08 16:31:53 +05:30
bendtherules e0546affec docs: update AGENTS.md
replace LlamaIndex with LanceDB, update prerequisites, CLI commands, and expand project structure in AGENTS.md
2026-04-08 16:20:59 +05:30
bendtherules bba6fab3ac docs: add file and folder naming conventions
Added a new “File / Folder Naming” section to AGENTS.md detailing naming rules: folders in kebab-case and files in camelCase.
2026-04-08 16:13:18 +05:30
bendtherules 0a7c89d577 refactor: Rename all folders to kebab-case 2026-04-08 16:11:29 +05:30
bendtherules 02a3fa4cad refactor: Rename all file/folders to camelCase 2026-04-08 16:09:01 +05:30
bendtherules aa9c875006 feat: add startTrace/stopTrace to control mark capture
Implemented a capture flag in `Ask262Debug` to enable/disable marking.
- Added `_captureEnabled` property and related logic in `mark()`.
- Introduced `startTrace()` and `stopTrace()` methods to toggle capture.
- Updated verification script to start tracing, run tests, stop tracing, and assert that the `Array.prototype.every` section is captured and marked important.
2026-04-08 16:03:09 +05:30
bendtherules b73035a4d3 chore: Archive some plans 2026-04-08 14:27:05 +05:30
bendtherules 72138aa965 feat(engine262): add verify-ask262 script and relocate verify‑ask262‑debug
- Moved `verify-ask262-debug.mts` from `scripts` to `lib-src/node`.
- Updated import to use `#self` alias.
- Added npm script `verify-ask262` to run the verification script.
- Adjusted `scripts/tsconfig.json` to include the new file location.
2026-04-08 14:25:59 +05:30
bendtherules f998ebc236 build: add ask262Debug important methods in realm 2026-04-08 14:18:33 +05:30
bendtherules ebe36c3737 build: ask262Debug 2026-04-08 13:55:13 +05:30
bendtherules 0b58f8483a plan(ask262Debug) - simplify imports 2026-04-08 13:11:27 +05:30
bendtherules 0ee2bbf7a3 chore: rename package to "ask262" and add bun package manager configuration 2026-04-08 12:01:29 +05:30
bendtherules 919f98ad4c Fix .opencode/gitignore 2026-04-08 12:01:21 +05:30
bendtherules 90eb347235 refactor(plan): update model path and enhance Babel plugin for ask262Debug 2026-04-07 16:33:20 +05:30
bendtherules d5fcb89e02 Merge branch 'opencode/annotate-code/mimo-v2-pro' 2026-04-07 14:02:29 +05:30
bendtherules c1237d146d plan: mark section ids from code 2026-04-07 14:02:15 +05:30
bendtherules 957ae8e8e6 revert(engine262): undo Biome formatting changes from b6dbcfe
Restore original formatting in engine262 folder:
- unicode.d.ts: revert to 4-space indentation, single quotes
- syntax-error.d.ts: revert to 4-space indentation, remove semicolons

Biome should not format files in engine262/ as it's excluded in biome.json.
2026-04-06 15:25:04 +05:30
bendtherules 3b420b896b refactor(setup): reorder HTMLTextSplitter tag list
- Move `ul` and `ol` earlier in the allowed tags array.
- Remove duplicate and unused tags (`h5`, `h6`, `li`, redundant `ul`/`ol`).
2026-04-06 14:51:44 +05:30
bendtherules a2c8bd31c6 feat(lists): alternate markdown list markers by nesting depth
Ordered lists switch between `1.` (even depth) and `A.` (odd depth).
Unordered lists switch between `-` (even depth) and `*` (odd depth).
Makes nested list structure visually distinct in extracted text.
2026-04-06 13:39:43 +05:30
bendtherules 2c0ccee5e1 fix - Fix normalizeWhitespace removing indents in nested lists 2026-04-06 13:29:20 +05:30
bendtherules ec71200f0e test(bunfig): add pathIgnorePatterns to ignore unnecessary folders during testing
- Removed default test root setting.
- Introduced `pathIgnorePatterns` list with multiple directories (engine262, spec-built, node_modules, dist, build, coverage, .idea, docs, storage, graphology, .git) to be excluded from test runs and module resolution.
2026-04-06 13:07:17 +05:30
bendtherules 1524d9c804 moved HtmlTextSplitter.test.ts beside source file 2026-04-04 19:32:33 +05:30
bendtherules 88af87b7ae build: Implement formatForIngestion 2026-04-04 19:29:29 +05:30
bendtherules 290ac89325 plan(HTML‑to‑Markdown): add sample code 2026-04-04 19:03:44 +05:30
bendtherules 18168e8d3e plan(mimo-v2-pro): add plan for HTML‑to‑Markdown transformations 2026-04-04 18:00:45 +05:30
bendtherules 9bf174ddc0 refactor(verify-db): top‑5 largest document - consider all chunks
- Replace per‑chunk sorting with aggregation of total size per section.
- Compute total characters and chunk count for each document.
- Sort sections by total size and display the top five, including part count when applicable.
2026-04-04 12:40:11 +05:30
bendtherules e6992a174b chore(vscode): remove **/spec-built and **/engine262 from search exclusions in settings.json 2026-04-04 12:39:34 +05:30
bendtherules 7395effb4b feat: add verify-db script to package.json 2026-04-04 12:33:12 +05:30
bendtherules ff1c97af44 fix(agent-tools, setup): standardize metadata keys to lowercase and update HTML ingestion
- Renamed `partIndex`/`totalParts` to `partindex`/`totalparts` in `section_retriever.ts`, `spec_retriever.ts`, and document creation logic.
- Adjusted sorting logic to use the new `partindex` field.
- Updated metadata handling and string interpolation to reference the lowercase keys.
- Fixed import path for `HTMLTextSplitter` and moved the file to `setup/textsplitters/HtmlTextSplitter.ts`.
- Added HTML preprocessing utilities (`addNewlinesAfterBlocks`, `convertTablesToMarkdown`) in ingestion workflow.
- Integrated table-to‑markdown conversion and newline insertion to improve text splitting and document structure.
2026-04-04 12:33:05 +05:30
bendtherules 822597e0e2 feat(setup): enhance ingest summary to track and display chunk sizes per section
- Introduced `SectionInfo` interface to store chunk count and individual chunk sizes.
- Replaced simple section count map with a map of `SectionInfo` for richer data.
- Updated logic to aggregate chunk sizes and counts per section.
- Modified summary output to show total characters, top 5 sections with detailed chunk count, total chars, and a list of chunk sizes.
- Refactored comments and variable names for clarity.
2026-04-04 10:31:14 +05:30
bendtherules f54a14f408 feat(ingest): add summary of all documents
add ChunkInfo interface, improve chunk handling typings, and print ingest summary statistics. This introduces typed chunk metadata, refactors related code, and adds a summary report for document sizes, sections, and chunk distribution
2026-04-03 20:34:05 +05:30
bendtherules 09f4f929ae Rename snake cased files to HTMLTextSplitter 2026-04-03 13:30:40 +05:30
bendtherules b3c9ed6dfd test(textsplitters): add more tests
- Verify that `splitDocuments` correctly prepends the provided `chunkHeader` to each chunk.
- Ensure `splitDocuments` returns an empty array when the source HTML yields no chunks.
2026-04-03 13:20:09 +05:30
bendtherules 6e5e7a7f4a ingest - Consume HTMLTextSplitter 2026-04-03 13:19:46 +05:30
bendtherules ec5669dcd7 feat: Impl HtmlTextSplitter 2026-04-03 11:04:40 +05:30
bendtherules 818bcccead feat: add VS Code configuration for debugging bun
- Add .vscode/extensions.json recommending oven.bun-vscode.
- Add .vscode/launch.json with Bun debug configurations for various scripts.
- Add .vscode/settings.json for TypeScript SDK, debug options, and file exclusions.
- Remove .vscode/ entry from .gitignore.
- Refactor ingest.ts: increase chunk size to 8192 and overlap to 200, raise large document threshold, remove <h1>/<h2> separators, skip sections containing only headings or minimal content, and add warnings for very small chunks.
2026-04-02 13:33:00 +05:30
bendtherules 1ff1038898 refactor(ingest): remove part and parent reference in chunk
- Remove construction of `partRef` and parent section annotations from chunk text
- Directly extract and trim text from HTML chunk using cheerio
- Streamline document creation logic without additional references.
2026-04-01 18:33:57 +05:30
bendtherules b3381508c3 feat(test): add manual spec retriever test script
Introduce a new manual test file `test/manual/test-spec-retriever.ts` that demonstrates how to use the `spec_retriever` agent tool with a query. The script loads embeddings, connects to the LanceDB storage, creates the tool, executes it, and prints the result. This provides a runnable example for developers.
2026-04-01 18:31:42 +05:30
bendtherules f5d3884d5a refactor: move model info to constants
- Added EMBEDDING_MODEL and RERANKER_MODEL to `constants.ts`.
- Updated imports to use these constants in `agent.ts`, `agent_tools/reranker.ts`, and `setup/ingest.ts`.
- Replaced hard‑coded model strings with the new constants for Ollama embeddings and reranker.
2026-04-01 18:31:30 +05:30
bendtherules 0c45062348 refactor(agent): Put agent_tools in different files 2026-04-01 18:15:56 +05:30
bendtherules cf522b8085 agent.ts - tools - add zod schema 2026-04-01 17:55:01 +05:30
bendtherules 1bbd6305f7 agent.ts - Update tools, add reranker 2026-04-01 17:54:49 +05:30
bendtherules 85d888c7ba feat(ingest): add splitter, metadata and qwen3-embedding
add HTML‑aware text splitter, raise batch size and large‑doc threshold, enhance progress spinner and error logging, rename ingestSpec to buildSpecDocuments and introduce hierarchical section processing.
2026-04-01 12:49:57 +05:30
bendtherules 70e42eb727 feat(spec-ingestion): unify breakdown strategy with alwaysBreak flag and inline markers
- Consolidate all structural element breakdowns into a single `breakDownSection` function using an `alwaysBreak` flag.
- Introduce `BREAKDOWN_TAGS` configuration array containing metadata (tag, alwaysBreak, title/id selectors) for each element type.
- Replace previous multi‑phase approach with a unified sequential breakdown flow: `emu-clause` (always extracts children) → `emu-table` → `emu-grammar` → `td` → `p`.
- Add inline markers `[Subsection available: title "X" at sectionid: ID]` where content is removed, enabling parent awareness.
- Update documentation to reflect the new unified breakdown logic, tag table, and hierarchical ID format.
- Adjust threshold handling, recursion depth, and metadata tracking to work with the new unified approach.
2026-03-31 14:45:16 +05:30
bendtherules 9f8148bf62 docs(plans): add plan for parent section breakdown awareness and recursive sequential breakdown
Added a detailed markdown plan outlining fixes for parent section awareness, sequential tag‑based breakdown, and recursive processing of large sections. Includes implementation details, configuration constants, and updated ingestion logic. This new plan file is located at `.opencode/plans/1774872666261-parent-breakdown-fix.md`.
2026-03-31 14:23:17 +05:30
bendtherules 3b6e9a9d8f refactor(ingest): restructure section document creation logic and add warnings for oversized documents
- Move full‑section Document creation into an `else` block so it only occurs when no sub‑documents were created.
- Remove premature return that skipped adding the full section.
- Add post‑processing loop to log a warning for any final document exceeding `LARGE_DOC_THRESHOLD`.
2026-03-31 13:54:07 +05:30
bendtherules ac518b7b77 ingest.ts - handle empty db, add loader 2026-03-31 13:46:19 +05:30
bendtherules 8bbd159224 Migrate to langchain 2026-03-31 13:06:59 +05:30
bendtherules 23dcdd2f4f docs(plans): add migration plan for LlamaIndex → LangChain.js + LanceDB
Added a comprehensive markdown plan (.opencode/plans/1774872124705-glowing-river.md) outlining the migration from LlamaIndex to LangChain.js with LanceDB. Includes updated dependencies, file modification list, and detailed code changes for `ingest.ts` and `agent.ts`. This serves as documentation for the migration process.
2026-03-31 12:21:06 +05:30
bendtherules b3ee712ce9 docs: add AGENTS.md 2026-03-31 12:20:58 +05:30
bendtherules f6fc4c652a ingest.ts - brekdown 2026-03-31 12:20:51 +05:30
bendtherules 5242a30081 agent.ts - add comments 2026-03-31 12:20:32 +05:30
bendtherules 1de99cbe38 migrate strip-spec-container to TS 2026-03-31 09:12:19 +05:30
bendtherules 83f145c576 docs(plans): reformat internal method regex list by moving [[Get]] and [[Set]] to separate line for clarity. 2026-03-30 18:22:08 +05:30
bendtherules 12631949b4 setup/ingest.ts: add comments 2026-03-30 18:16:55 +05:30
bendtherules 33cec82c9d feat(build-graph): add comments and pass options 2026-03-30 17:58:39 +05:30
bendtherules cbe6bfdb10 refactor(build_graph): limit emu-clause selection to #spec-container
Search for `emu-clause` elements now performed within the `#spec-container` element instead of the entire document, preventing accidental matches outside the spec container.
2026-03-30 12:43:48 +05:30
bendtherules 2505497846 build: Internal method linking - plan and basic script 2026-03-30 12:43:40 +05:30
bendtherules 795a713a86 spec - Cleanup body to only keep "spec-container" 2026-03-27 19:43:07 +05:30
bendtherules ed4360e7cd spec - Remove all style tags 2026-03-27 18:36:24 +05:30
bendtherules f19e5ba788 refactor(constants): move SPEC_DIR and CODE_DIR to constants 2026-03-27 17:53:16 +05:30
bendtherules 8266a17559 remove package.json 2026-03-27 17:50:35 +05:30
bendtherules d7d7dc273e fix(ingest): fix any type for index 2026-03-27 17:49:32 +05:30
bendtherules 28c26d319e chore: Type-check fixes 2026-03-27 17:48:02 +05:30
bendtherules 0f5a31137f chore: Lint fixes 2026-03-27 17:47:12 +05:30
bendtherules b6dbcfe91a build: migrate to Typescript + biome 2026-03-27 17:33:58 +05:30
bendtherules 3f0c4c217a feat(build): add logging for spec and code file discovery with warnings when none found
- Log the number of specification HTML files found in `SPEC_DIR`.
- Emit a warning if no specification HTML files are present.
- Log the number of code files found in `CODE_DIR`.
- Emit a warning if no code files are present.
2026-03-27 10:12:48 +05:30
bendtherules b42a69d9f8 Merge commit '6e92d2345e8231a44556ce7d416451f5f3e6c398' as 'engine262' 2026-03-27 10:07:29 +05:30
bendtherules 6e92d2345e Squashed 'engine262/' content from commit ae71998
git-subtree-dir: engine262
git-subtree-split: ae71998cc5a8315700555135b1ac202a0d6d0b31
2026-03-27 10:07:29 +05:30
bendtherules 8f26db5a1f chore(setup): replace engine262 submodule with squashed git subtree
Update init_engine262.sh to add the engine262 repository as a squashed subtree instead of a shallow submodule. Adjust usage comments, add existence check for the target directory, and update echo messages accordingly.
2026-03-27 10:06:08 +05:30
bendtherules 355451c9bb chore(setup): make init_engine262.sh executable and use repository root for engine262 target directory 2026-03-27 10:00:38 +05:30
bendtherules 1434dd20af refactor: move build_graph.mjs and ingest.mjs to setup/ 2026-03-27 09:57:04 +05:30
bendtherules f974ab7188 feat(setup): add script to add shallow engine262 submodule
Introduces `setup/init_engine262.sh`, a Bash utility that clones the `engine262` repository as a shallow submodule (depth 1) into `./engine262`. The script adds the submodule, initializes it, and provides a usage comment. It ensures robust execution with `set -euo pipefail`.
2026-03-27 09:55:32 +05:30
bendtherules 6e3af7575a chore(gitignore): add Graphs section to .gitignore 2026-03-27 09:51:59 +05:30
bendtherules 3106df85fc fix(gitignore): remove leading './' from ignored directories and resources paths 2026-03-27 09:44:32 +05:30
bendtherules 4a4b4971dd refactor(config): centralize storage and graph file paths
- Added `constants.mjs` defining `STORAGE_DIR` and `GRAPH_FILE`.
- Replaced hard‑coded path strings in `agent.mjs`, `build_graph.mjs`, and `ingest.mjs` with imports from the new constants module.
- Updated console log in `ingest.mjs` to reference `STORAGE_DIR`.
- Adjusted `GRAPH_FILE` path to `./graphology/graph.json` via the constant.
2026-03-27 09:40:54 +05:30