bible-note 0.4.7 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -247,7 +247,47 @@ per-chapter verse counts.
247
247
  | `BibleNoteStorageManager` | type | Storage adapter contract |
248
248
  | `BibleNoteColorScheme` | type | `'light' | 'dark'` |
249
249
 
250
- `dist/` and `types/` here are generated by `npm run pack` from the sources under
251
- `src/` — edit those, not the build output. This file, `package.json` and
252
- `LICENSE` are maintained by hand and are the only files in this folder that git
253
- tracks.
250
+ ## Knowledge files
251
+
252
+ The package ships two markdown files describing itself, generated on every
253
+ build:
254
+
255
+ | File | For |
256
+ | --- | --- |
257
+ | `bible-note/knowledge/development.md` | Developers: architecture, installation, every prop and hook grouped by feature, datasets and lookup managers, persistence, Electron integration, working on the editor, and a full API reference generated from the type declarations |
258
+ | `bible-note/knowledge/ui-rag.md` | A retrieval (RAG) pipeline behind an in-app assistant: end-user help for the editor UI — formatting, the slash menu, mentions, Bible verses, the lookup panel, inserting content, shortcuts, import/export, comments, settings |
259
+
260
+ Both are exposed through `exports`, so they resolve like any other subpath:
261
+
262
+ ```js
263
+ import { readFile } from "node:fs/promises";
264
+ import { fileURLToPath } from "node:url";
265
+
266
+ const ragPath = fileURLToPath(import.meta.resolve("bible-note/knowledge/ui-rag.md"));
267
+ // CommonJS: require.resolve("bible-note/knowledge/ui-rag.md")
268
+ const corpus = await readFile(ragPath, "utf8");
269
+ ```
270
+
271
+ `ui-rag.md` is pre-chunked. It opens with YAML front matter (`package`,
272
+ `version`, `chunks`), and every `## ` heading starts one self-contained chunk.
273
+ The heading is a breadcrumb (`## Mentions › Mention a person with @`), and the
274
+ line under it is an HTML comment holding the chunk's metadata as JSON:
275
+
276
+ ```markdown
277
+ ## Mentions › Mention a person with @
278
+
279
+ <!-- chunk {"id":"ui/mentions/mention-a-person-with","section":"Mentions","title":"Mention a person with @","tags":["mentions","names"],"source":"knowledge/ui/04-mentions.md","package":"bible-note@0.5.0"} -->
280
+
281
+ Type @ followed by a few letters of the name…
282
+ ```
283
+
284
+ Split on `^## ` (a markdown-header splitter does this out of the box), parse
285
+ `<!-- chunk (.*) -->` for metadata, and index the rest. Chunk `id`s are stable
286
+ across releases as long as the section heading is unchanged; every chunk is
287
+ under 4,000 characters. The text is written for the person using the editor and
288
+ names buttons as they appear on screen.
289
+
290
+ `dist/`, `types/` and `knowledge/` here are generated by `npm run pack` from the
291
+ sources under `src/` and `knowledge/` — edit those, not the build output. This
292
+ file, `package.json` and `LICENSE` are maintained by hand and are the only files
293
+ in this folder that git tracks.