Skip to content

feat: reboot Weft as a Bun AI-native reader#1

Open
dpunj wants to merge 8 commits into
mainfrom
weft-reboot
Open

feat: reboot Weft as a Bun AI-native reader#1
dpunj wants to merge 8 commits into
mainfrom
weft-reboot

Conversation

@dpunj
Copy link
Copy Markdown
Owner

@dpunj dpunj commented May 25, 2026

Summary

Reboots Weft around a Bun + TypeScript document spine and a modern local web reader preview.

This keeps the original Weft spirit — vim-like reading for books — but moves the forward path toward an AI-native reader inspired by recrsv/RLM-style document exploration.

What changed

  • Added Bun/TypeScript project scaffolding
  • Added EPUB parsing into a normalized document model:
    • WeftDocument
    • Section
    • Block
    • SourceSpan
  • Added minimal terminal reader:
    • bun run read book.epub
  • Added modern web reader preview:
    • bun run web book.epub
    • local server at http://localhost:4173
    • TOC sidebar
    • Markdown rendering
    • vim navigation (j/k, h/l, g/G, t)
  • Added first deterministic recrsv-style exploration rail:
    • toc
    • search_text
    • context_get
    • chars read / % explored
    • click exploration slices to jump into the reader
  • Added shaping docs:
    • docs/WEFT_REBOOT.md
    • docs/shaped/ai-native-reader-reboot.md

How to try it

bun install
bun run web panama.epub

Open:

http://localhost:4173

Try the exploration rail with:

panama canal

Validation

  • bun run typecheck
  • smoke-tested /api/document
  • smoke-tested /api/page
  • smoke-tested /api/rlm?q=panama%20canal

Notes

This does not yet wire in a real LLM tool loop. The exploration rail is deterministic for now, but the UI/server shape is ready for the next slice: streaming model-driven toc → search_text → context_get → answer events.

Recommended next steps are captured in the shaping doc:

  1. Clean EPUB TOC/section quality
  2. Add current block tracking + sidecar annotations
  3. Add real streaming LLM tool loop
  4. Add repl_exec
  5. Add PDF support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant