lumina-wiki 1.1.0 → 1.3.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/CHANGELOG.md +107 -0
- package/README.md +34 -10
- package/README.vi.md +34 -10
- package/README.zh.md +37 -11
- package/bin/lumina.js +58 -10
- package/package.json +13 -4
- package/src/installer/banner.js +3 -0
- package/src/installer/commands.js +233 -61
- package/src/installer/locales/en.mjs +97 -0
- package/src/installer/locales/vi.mjs +96 -0
- package/src/installer/locales/zh.mjs +102 -0
- package/src/installer/locales.js +67 -0
- package/src/installer/manifest.js +5 -1
- package/src/installer/prompts.js +153 -45
- package/src/scripts/build-source.mjs +31 -0
- package/src/scripts/external-ids.mjs +217 -0
- package/src/scripts/lint.mjs +151 -8
- package/src/scripts/merge-ids.mjs +77 -0
- package/src/scripts/parse-ids.mjs +33 -0
- package/src/scripts/schemas.mjs +13 -1
- package/src/scripts/wiki.mjs +83 -20
- package/src/skills/core/ingest/references/step-01-draft.md +19 -1
- package/src/skills/core/migrate-legacy/SKILL.md +20 -3
- package/src/skills/core/migrate-legacy/references/backfill-ids.md +81 -0
- package/src/skills/packs/research/discover/SKILL.md +10 -6
- package/src/templates/README.vi.md +232 -0
- package/src/templates/README.zh.md +233 -0
- package/src/tools/_cache.py +314 -0
- package/src/tools/fetch_arxiv.py +21 -1
- package/src/tools/fetch_deepxiv.py +3 -1
- package/src/tools/fetch_pdf.py +4 -0
- package/src/tools/fetch_s2.py +56 -6
- package/src/tools/fetch_wikipedia.py +7 -2
- package/src/tools/id_utils.py +262 -0
- package/src/tools/init_discovery.py +89 -18
- package/src/tools/prepare_source.py +154 -5
- package/src/tools/requirements.txt +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,113 @@
|
|
|
3
3
|
All notable changes to Lumina-Wiki are documented here.
|
|
4
4
|
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
5
5
|
|
|
6
|
+
## [1.3.0] - 2026-05-09
|
|
7
|
+
|
|
8
|
+
### Added — Local text-document ingestion (research pack)
|
|
9
|
+
|
|
10
|
+
- `prepare_source.py` (research pack tool) now supports `.docx`, `.rtf`, and
|
|
11
|
+
`.epub` in addition to the existing PDF / TeX / HTML / Markdown formats.
|
|
12
|
+
- Hardened against zip-bomb (raw size cap + decompressed total cap) and XXE
|
|
13
|
+
/ XML billion-laughs (`defusedxml.defuse_stdlib()`) for ZIP-of-XML formats
|
|
14
|
+
(`.docx`, `.epub`).
|
|
15
|
+
- DRM-protected EPUB detection: explicit error with hint instead of an
|
|
16
|
+
opaque parse crash. Lumina does not strip DRM.
|
|
17
|
+
|
|
18
|
+
### Requirements
|
|
19
|
+
|
|
20
|
+
- The new format support requires the **research pack**:
|
|
21
|
+
`lumina install --packs core,research`. After install run
|
|
22
|
+
`pip install -r _lumina/tools/requirements.txt` to fetch
|
|
23
|
+
`python-docx`, `striprtf`, `ebooklib`, `beautifulsoup4`, and `defusedxml`.
|
|
24
|
+
- Missing libs raise an actionable `ValueError` (CLI exit 2) with the
|
|
25
|
+
`pip install …` hint — no silent empty-text writes.
|
|
26
|
+
|
|
27
|
+
### Known Limitations
|
|
28
|
+
|
|
29
|
+
- `.docx`: shapes, text boxes, headers/footers, table cells not extracted.
|
|
30
|
+
- `.rtf`: table layout and embedded images discarded.
|
|
31
|
+
- `.epub`: images, CSS, footnotes, and cross-references discarded; chapter-
|
|
32
|
+
level segmentation is **not** emitted in v1 — it will land alongside
|
|
33
|
+
`/lumi-chapter-ingest` EPUB support in a future release.
|
|
34
|
+
- `.odt`, image (`.png`, `.jpg`) and scanned-PDF ingestion remain out of
|
|
35
|
+
scope. See the roadmap entry "Vision/OCR ingestion" for the follow-up.
|
|
36
|
+
|
|
37
|
+
## [1.2.0] - 2026-05-07
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
|
|
41
|
+
- **Multilingual installer (PR #7).** Interactive installer prompts and
|
|
42
|
+
rendered banners now ship in English, Vietnamese, and Simplified Chinese.
|
|
43
|
+
Language is selected at install time and persisted; upgrades read the
|
|
44
|
+
prior choice from manifest config. Localization covers prompts, summary
|
|
45
|
+
output, and post-install banner — workspace template content is unchanged.
|
|
46
|
+
- **Persistent HTTP GET cache for fetchers (PR #5).** New
|
|
47
|
+
`_lumina/tools/http_cache.py` provides a content-addressed, file-backed
|
|
48
|
+
cache layer for arxiv / DOI / Semantic Scholar / web GET requests, shared
|
|
49
|
+
across `discover` and `ingest` runs. TTL is configurable via env
|
|
50
|
+
(validated at load time) and a cache schema version pins the on-disk
|
|
51
|
+
format so future shape changes self-invalidate. List-of-tuples query
|
|
52
|
+
params bypass caching by design.
|
|
53
|
+
- **Bun smoke job in CI (PR #3).** GitHub Actions now runs a Bun
|
|
54
|
+
compatibility job alongside Node, catching runtime divergences early
|
|
55
|
+
(path resolution, module loading, child-process spawn) without making
|
|
56
|
+
Bun a supported runtime contract.
|
|
57
|
+
- **Claude Code GitHub Actions workflows (PR #8).** Two opt-in workflows —
|
|
58
|
+
Claude PR Assistant (mention-triggered) and Claude Code Review (auto on
|
|
59
|
+
PR open/sync) — are shipped under `.github/workflows/`. Both are
|
|
60
|
+
restricted to repository maintainers on this public repo to prevent
|
|
61
|
+
unsolicited token usage from forks.
|
|
62
|
+
- Source pages gain an optional `external_ids` frontmatter object holding
|
|
63
|
+
validated cross-source identifiers across four namespaces: `doi`, `arxiv`,
|
|
64
|
+
`s2`, and `url` (canonical form). The namespace registry is locked to
|
|
65
|
+
these four — `openalex`, `isbn`, and `s2_corpus` are reserved but not yet
|
|
66
|
+
implemented.
|
|
67
|
+
- New module `_lumina/scripts/external-ids.mjs` and its Python mirror
|
|
68
|
+
`_lumina/tools/id_utils.py` provide pure helpers (`normalizeExternalId`,
|
|
69
|
+
`parseUrlToExternalIds`, `canonicalizeUrl`, `externalIdMatchKey`,
|
|
70
|
+
`expandExternalIds`, `safeIdToken`, `sanitizeExternalIdsObject`). Parity is
|
|
71
|
+
gated by a shared JSON fixture.
|
|
72
|
+
- New CLI wrapper `_lumina/scripts/parse-ids.mjs` reads a URL from `argv` and
|
|
73
|
+
emits a validated `external_ids` JSON map. Skill prompts call this instead
|
|
74
|
+
of inline `node -e` interpolation, eliminating shell-injection risk.
|
|
75
|
+
- Producers (`/lumi-ingest`, `/lumi-discover`, all fetchers) populate
|
|
76
|
+
`external_ids` automatically. `init_discovery.py --exclude-keys` filters
|
|
77
|
+
candidates by expanded external_ids set so a DOI excludes its arxiv form.
|
|
78
|
+
- Three new lint checks on source pages: **L13** (warn — namespace coverage
|
|
79
|
+
derivable from `urls[]`), **L14** (error — invalid identifier value),
|
|
80
|
+
**L16** (warn — `urls[]` ↔ `external_ids` mismatch). L13's remediation
|
|
81
|
+
message points users at `/lumi-migrate-legacy --backfill-ids`.
|
|
82
|
+
- Opt-in `/lumi-migrate-legacy --backfill-ids` flag populates `external_ids`
|
|
83
|
+
on legacy source pages from existing `urls[]`. Non-destructive (existing
|
|
84
|
+
keys win) and idempotent. No `--dry-run` — review with `git diff`.
|
|
85
|
+
- Source pages gain an optional `sources` frontmatter array recording fetch
|
|
86
|
+
provenance: `[{provider, fetched_at, url?}]`. Each ingest run appends one
|
|
87
|
+
entry — multi-fetch keeps history rather than replacing.
|
|
88
|
+
- New CLI wrapper `_lumina/scripts/build-source.mjs` (and the underlying
|
|
89
|
+
`buildSourceEntry` / `build_source_entry` helpers in `external-ids.mjs` /
|
|
90
|
+
`id_utils.py`) constructs one validated entry per fetcher run. Provider
|
|
91
|
+
must be a kebab/snake slug (max 32 chars). `/lumi-ingest` Phase 3 calls
|
|
92
|
+
it after writing `external_ids`.
|
|
93
|
+
|
|
94
|
+
### Changed
|
|
95
|
+
|
|
96
|
+
- `init_discovery.py` flag renamed in place: `--exclude-ids` →
|
|
97
|
+
`--exclude-keys`. No deprecation alias (LLM-driven, no human contract).
|
|
98
|
+
- `wiki.mjs` `parseFrontmatter` / `stringifyFrontmatter` now round-trip
|
|
99
|
+
top-level YAML object values (block-mapping form). `set-meta external_ids`
|
|
100
|
+
runs `sanitizeExternalIdsObject` automatically — `__proto__` and unknown
|
|
101
|
+
namespaces are stripped before persisting.
|
|
102
|
+
- `EXTERNAL_ID_NAMESPACES` source of truth moved from `external-ids.mjs` to
|
|
103
|
+
`schemas.mjs` (where pure-data lives). `external-ids.mjs` now imports and
|
|
104
|
+
re-exports it for back-compat with downstream consumers.
|
|
105
|
+
|
|
106
|
+
### Migration
|
|
107
|
+
|
|
108
|
+
- Legacy wikis with no `external_ids` populated will see L13 warnings on
|
|
109
|
+
source pages whose `urls[]` contain an arxiv/doi/s2 URL. Run
|
|
110
|
+
`/lumi-migrate-legacy --backfill-ids` to populate them. The standard
|
|
111
|
+
migration flow (`/lumi-migrate-legacy` without the flag) is unchanged.
|
|
112
|
+
|
|
6
113
|
## [1.1.0] - 2026-05-06
|
|
7
114
|
|
|
8
115
|
### Added
|
package/README.md
CHANGED
|
@@ -56,6 +56,10 @@ Lumina-Wiki works from one simple principle: keep your raw materials separate fr
|
|
|
56
56
|
+-------------------------+ +---------------------------+
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
+
<p align="center">
|
|
60
|
+
<img src="assets/lumina-architecture-en.png" alt="Lumina-Wiki Architecture" width="720">
|
|
61
|
+
</p>
|
|
62
|
+
|
|
59
63
|
1. **You Provide:** Place your documents (PDFs, notes) in the `raw/` directory.
|
|
60
64
|
2. **The Agent Builds:** Use commands in your AI chat, such as `/lumi-ingest`, to make the agent read from `raw/` and build a structured, interlinked wiki in `wiki/`.
|
|
61
65
|
3. **You Query:** Ask questions with `/lumi-ask` against the agent's "brain" in `wiki/` for faster, more context-aware answers.
|
|
@@ -121,6 +125,10 @@ Interact with your wiki using these commands in your AI chat interface, such as
|
|
|
121
125
|
|
|
122
126
|
Lumina creates a workspace where each folder has a clear purpose.
|
|
123
127
|
|
|
128
|
+
<p align="center">
|
|
129
|
+
<img src="assets/lumina-env-en.png" alt="Lumina-Wiki Workspace Environment" width="720">
|
|
130
|
+
</p>
|
|
131
|
+
|
|
124
132
|
| Path | Purpose | Managed By |
|
|
125
133
|
| :--- | :--- | :--- |
|
|
126
134
|
| **`raw/`** | **Your immutable input library.** The agent **only reads** from here. | **You** |
|
|
@@ -152,6 +160,8 @@ As your wiki grows, you can use [qmd](https://github.com/tobi/qmd) for faster lo
|
|
|
152
160
|
npx skills add https://github.com/tobi/qmd --skill qmd
|
|
153
161
|
```
|
|
154
162
|
|
|
163
|
+
See the [Advanced Guide](docs/user-guide/advanced-qmd.en.md) for detailed installation and configuration.
|
|
164
|
+
|
|
155
165
|
---
|
|
156
166
|
|
|
157
167
|
## 5. Available Skills
|
|
@@ -184,24 +194,38 @@ The scripts behind these skills live in `_lumina/scripts/` and `_lumina/tools/`;
|
|
|
184
194
|
|
|
185
195
|
## 6. What's Coming Next
|
|
186
196
|
|
|
187
|
-
|
|
197
|
+
Lumina-Wiki is evolving rapidly. Here is our user-facing roadmap:
|
|
198
|
+
|
|
199
|
+
**Near-term (Stability & New Ingestion)**
|
|
200
|
+
- [ ] **`/lumi-help` Skill:** A smart assistant to help you learn and use Lumina-Wiki instantly.
|
|
201
|
+
- [x] **Multilingual setup:** Choose English, Vietnamese, or Chinese as your primary language during install. *(shipped in v1.2)*
|
|
202
|
+
- [x] **Native DOCX, RTF & EPUB ingestion:** Pull Word, Rich Text, and EPUB books straight into your wiki via the research pack. *(shipped in v1.x)*
|
|
203
|
+
- [ ] **Image OCR & Scanned PDFs:** Ingest screenshots and scanned PDFs into your wiki.
|
|
204
|
+
- [ ] **Advanced Paper Ranking:** See influence scores and quality signals for your research papers.
|
|
205
|
+
- [x] **Improved CI/CD:** Native support for Bun and Node 22 environments. *(shipped in v1.2)*
|
|
188
206
|
|
|
189
|
-
**
|
|
190
|
-
-
|
|
191
|
-
-
|
|
192
|
-
-
|
|
193
|
-
-
|
|
207
|
+
**Long-term (Deep Research & Integration)**
|
|
208
|
+
- [ ] **Global Source Expansion:** Direct integration with OpenAlex, CORE, and Unpaywall.
|
|
209
|
+
- [ ] **RSS & Blog Monitoring:** Automatically identify new papers from your favorite lab blogs.
|
|
210
|
+
- [ ] **Google Workspace:** Ingest Google Docs and Sheets directly into your graph.
|
|
211
|
+
- [ ] **Multimedia Support:** Process YouTube videos and Audio recordings via transcripts.
|
|
212
|
+
- [ ] **Knowledge Graph Auditing:** Automated checks for contradictions and structural drift.
|
|
194
213
|
|
|
195
|
-
**
|
|
196
|
-
- **
|
|
197
|
-
-
|
|
214
|
+
**Proposed**
|
|
215
|
+
- [ ] **Desktop Application:** A dedicated visual environment for easier wiki management.
|
|
216
|
+
- [ ] **Specialized Science Packs:** Deep integration for bio-medical and physics researchers.
|
|
198
217
|
|
|
199
|
-
|
|
218
|
+
---
|
|
219
|
+
*Full technical details are available in [`ROADMAP.md`](./ROADMAP.md). Want to contribute? Join us on GitHub!*
|
|
200
220
|
|
|
201
221
|
---
|
|
202
222
|
|
|
203
223
|
## 7. Contributing & License
|
|
204
224
|
|
|
225
|
+
### CLI Contract
|
|
226
|
+
|
|
227
|
+
CI scripts and integrations should reference [`docs/cli-contract.md`](./docs/cli-contract.md) for the v1.x stable flag list and exit code mapping. Anything not listed there is internal and may change without notice.
|
|
228
|
+
|
|
205
229
|
### Local Development (for contributors)
|
|
206
230
|
|
|
207
231
|
If you want to contribute to the `lumina-wiki` installer:
|
package/README.vi.md
CHANGED
|
@@ -56,6 +56,10 @@ Lumina-Wiki hoạt động dựa trên một nguyên tắc đơn giản: tách b
|
|
|
56
56
|
+-------------------------+ +---------------------------+
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
+
<p align="center">
|
|
60
|
+
<img src="assets/lumina-architecture-vi.png" alt="Kiến trúc Lumina-Wiki" width="720">
|
|
61
|
+
</p>
|
|
62
|
+
|
|
59
63
|
1. **Bạn Cung cấp:** Đặt các tài liệu (PDF, ghi chú) của bạn vào thư mục `raw/`.
|
|
60
64
|
2. **Agent Xây dựng:** Sử dụng các lệnh trong cuộc hội thoại với AI (như `/lumi-ingest`) để yêu cầu agent đọc từ `raw/` và xây dựng một wiki có cấu trúc, liên kết chặt chẽ trong thư mục `wiki/`.
|
|
61
65
|
3. **Bạn Khai thác:** Đặt câu hỏi (sử dụng `/lumi-ask`) trực tiếp vào "bộ não" của agent trong `wiki/` để nhận được câu trả lời nhanh và phù hợp với ngữ cảnh hơn.
|
|
@@ -121,6 +125,10 @@ Tương tác với wiki của bạn bằng cách sử dụng các lệnh này tr
|
|
|
121
125
|
|
|
122
126
|
Lumina tạo ra một không gian làm việc với mục đích rõ ràng cho từng thư mục.
|
|
123
127
|
|
|
128
|
+
<p align="center">
|
|
129
|
+
<img src="assets/lumina-env-vi.png" alt="Môi trường làm việc Lumina-Wiki" width="720">
|
|
130
|
+
</p>
|
|
131
|
+
|
|
124
132
|
| Đường dẫn | Mục đích | Quản lý bởi |
|
|
125
133
|
| :--- | :--- | :--- |
|
|
126
134
|
| **`raw/`** | **Thư viện đầu vào bất biến của bạn.** Agent **chỉ đọc** từ đây. | **Bạn** |
|
|
@@ -152,6 +160,8 @@ Khi wiki lớn dần, bạn có thể dùng [qmd](https://github.com/tobi/qmd)
|
|
|
152
160
|
npx skills add https://github.com/tobi/qmd --skill qmd
|
|
153
161
|
```
|
|
154
162
|
|
|
163
|
+
Xem [Hướng dẫn Nâng cao](docs/user-guide/advanced-qmd.vi.md) để biết chi tiết cài đặt và cấu hình.
|
|
164
|
+
|
|
155
165
|
---
|
|
156
166
|
|
|
157
167
|
## 5. Các kỹ năng có sẵn
|
|
@@ -184,24 +194,38 @@ Các script chạy nền nằm trong `_lumina/scripts/` và `_lumina/tools/`; th
|
|
|
184
194
|
|
|
185
195
|
## 6. Lộ trình sắp tới
|
|
186
196
|
|
|
187
|
-
|
|
197
|
+
Lumina-Wiki đang phát triển nhanh chóng. Dưới đây là lộ trình hướng tới người dùng của chúng tôi:
|
|
198
|
+
|
|
199
|
+
**Sắp tới (Ổn định & Mở rộng nạp tài liệu)**
|
|
200
|
+
- [ ] **Kỹ năng `/lumi-help`:** Trợ lý thông minh giúp bạn học và sử dụng Lumina-Wiki tức thì.
|
|
201
|
+
- [x] **Cài đặt đa ngôn ngữ:** Chọn Tiếng Anh, Tiếng Việt hoặc Tiếng Trung làm ngôn ngữ chính khi cài đặt. *(đã phát hành trong v1.2)*
|
|
202
|
+
- [x] **Nạp DOCX, RTF & EPUB native:** Đưa thẳng file Word, Rich Text và sách EPUB vào wiki qua research pack. *(đã phát hành trong v1.x)*
|
|
203
|
+
- [ ] **OCR ảnh & PDF scan:** Nạp ảnh chụp màn hình và PDF dạng scan vào wiki.
|
|
204
|
+
- [ ] **Xếp hạng bài báo nâng cao:** Xem điểm số ảnh hưởng và tín hiệu chất lượng cho các nghiên cứu của bạn.
|
|
205
|
+
- [x] **Cải thiện CI/CD:** Hỗ trợ chính thức cho môi trường Bun và Node 22. *(đã phát hành trong v1.2)*
|
|
188
206
|
|
|
189
|
-
**
|
|
190
|
-
-
|
|
191
|
-
-
|
|
192
|
-
-
|
|
193
|
-
-
|
|
207
|
+
**Dài hạn (Nghiên cứu sâu & Tích hợp)**
|
|
208
|
+
- [ ] **Mở rộng nguồn dữ liệu toàn cầu:** Tích hợp trực tiếp với OpenAlex, CORE và Unpaywall.
|
|
209
|
+
- [ ] **Theo dõi RSS & Blog:** Tự động tìm bài báo mới từ các blog phòng thí nghiệm yêu thích.
|
|
210
|
+
- [ ] **Google Workspace:** Nạp trực tiếp Google Docs và Sheets vào đồ thị tri thức.
|
|
211
|
+
- [ ] **Hỗ trợ đa phương tiện:** Xử lý video YouTube và ghi âm Audio thông qua transcript.
|
|
212
|
+
- [ ] **Kiểm định đồ thị tri thức:** Tự động phát hiện mâu thuẫn và sai lệch cấu trúc.
|
|
194
213
|
|
|
195
|
-
**
|
|
196
|
-
-
|
|
197
|
-
-
|
|
214
|
+
**Dự kiến**
|
|
215
|
+
- [ ] **Ứng dụng Desktop:** Môi trường giao diện chuyên dụng để quản lý wiki dễ dàng hơn.
|
|
216
|
+
- [ ] **Gói Khoa học Chuyên dụng:** Tích hợp sâu cho các nhà nghiên cứu sinh học, y tế và vật lý.
|
|
198
217
|
|
|
199
|
-
|
|
218
|
+
---
|
|
219
|
+
*Chi tiết kỹ thuật đầy đủ có tại [`ROADMAP.md`](./ROADMAP.md). Bạn muốn đóng góp? Hãy tham gia cùng chúng tôi trên GitHub!*
|
|
200
220
|
|
|
201
221
|
---
|
|
202
222
|
|
|
203
223
|
## 7. Đóng góp & Giấy phép
|
|
204
224
|
|
|
225
|
+
### Hợp đồng CLI
|
|
226
|
+
|
|
227
|
+
Script CI và tích hợp nên tham chiếu [`docs/cli-contract.md`](./docs/cli-contract.md) để biết danh sách cờ ổn định và mapping exit code cho v1.x. Bất cứ thứ gì không liệt kê trong đó đều là nội bộ và có thể đổi mà không báo trước.
|
|
228
|
+
|
|
205
229
|
### Phát triển cục bộ (dành cho người đóng góp)
|
|
206
230
|
|
|
207
231
|
Nếu bạn muốn đóng góp cho trình cài đặt `lumina-wiki`:
|
package/README.zh.md
CHANGED
|
@@ -56,6 +56,10 @@ Lumina-Wiki 遵循一个简单原则:将您的原始资料与 AI 的结构化
|
|
|
56
56
|
+-------------------------+ +---------------------------+
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
+
<p align="center">
|
|
60
|
+
<img src="assets/lumina-architecture-en.png" alt="Lumina-Wiki 架构" width="720">
|
|
61
|
+
</p>
|
|
62
|
+
|
|
59
63
|
1. **您提供:** 将文档(PDF、笔记)放入 `raw/` 目录。
|
|
60
64
|
2. **Agent 构建:** 在 AI 对话中使用指令(如 `/lumi-ingest`),让 Agent 从 `raw/` 读取内容,并在 `wiki/` 中构建结构化、互相关联的维基。
|
|
61
65
|
3. **您使用:** 通过 `/lumi-ask` 直接向 `wiki/` 中的 Agent“大脑”提问,获得更快、更贴合上下文的回答。
|
|
@@ -121,6 +125,10 @@ node _lumina/scripts/wiki.mjs migrate --add-defaults
|
|
|
121
125
|
|
|
122
126
|
Lumina 会创建一个工作区,每个目录都有明确用途。
|
|
123
127
|
|
|
128
|
+
<p align="center">
|
|
129
|
+
<img src="assets/lumina-env-en.png" alt="Lumina-Wiki 工作区环境" width="720">
|
|
130
|
+
</p>
|
|
131
|
+
|
|
124
132
|
| 路径 | 用途 | 管理方 |
|
|
125
133
|
| :--- | :--- | :--- |
|
|
126
134
|
| **`raw/`** | **您的不可变输入库。** Agent **只从这里读取**。 | **您** |
|
|
@@ -146,12 +154,15 @@ Lumina 会创建一个工作区,每个目录都有明确用途。
|
|
|
146
154
|
|
|
147
155
|
### **使用 qmd 进行本地搜索(高级,可选)**
|
|
148
156
|
|
|
149
|
-
|
|
157
|
+
随着 Wiki 的增长,您可以使用 [qmd](https://github.com/tobi/qmd) 实现更快的本地 Markdown 搜索。如果您的 IDE 支持 Skill 格式,请安装官方 qmd skill:
|
|
150
158
|
|
|
151
159
|
```bash
|
|
152
160
|
npx skills add https://github.com/tobi/qmd --skill qmd
|
|
153
161
|
```
|
|
154
162
|
|
|
163
|
+
有关详细的安装和配置,请参阅[高级指南](docs/user-guide/advanced-qmd.zh.md)。
|
|
164
|
+
|
|
165
|
+
|
|
155
166
|
---
|
|
156
167
|
|
|
157
168
|
## 5. 可用技能
|
|
@@ -184,24 +195,39 @@ npx skills add https://github.com/tobi/qmd --skill qmd
|
|
|
184
195
|
|
|
185
196
|
## 6. 未来规划
|
|
186
197
|
|
|
187
|
-
|
|
198
|
+
Lumina-Wiki 正在快速演进。这是我们的用户路线图:
|
|
199
|
+
|
|
200
|
+
**近期计划(稳定性与新导入支持)**
|
|
201
|
+
- [ ] **`/lumi-help` 技能:** 智能助手,帮您即时学习和使用 Lumina-Wiki。
|
|
202
|
+
- [x] **多语言安装:** 安装时可选英文、越南文或中文作为主语言。*(v1.2 已发布)*
|
|
203
|
+
- [x] **原生 DOCX、RTF 与 EPUB 导入:** 通过 research pack 将 Word、Rich Text 与 EPUB 电子书直接导入维基。*(v1.x 已发布)*
|
|
204
|
+
- [ ] **图片 OCR 与扫描 PDF:** 将截图与扫描版 PDF 导入维基。
|
|
205
|
+
- [ ] **高级论文排名:** 查看研究论文的影响力评分和质量信号。
|
|
206
|
+
- [x] **改进的 CI/CD:** 正式支持 Bun 和 Node 22 环境。*(v1.2 已发布)*
|
|
207
|
+
|
|
208
|
+
**长期计划(深度研究与集成)**
|
|
209
|
+
- [ ] **全球数据源扩展:** 直接集成 OpenAlex、CORE 和 Unpaywall。
|
|
210
|
+
- [ ] **RSS 与博客监控:** 自动从您喜爱的实验室博客中发现新论文。
|
|
211
|
+
- [ ] **Google Workspace:** 直接将 Google Docs 和 Sheets 导入知识图谱。
|
|
212
|
+
- [ ] **多媒体支持:** 通过转录处理 YouTube 视频和音频录音。
|
|
213
|
+
- [ ] **知识图谱审计:** 自动检测矛盾和结构偏移。
|
|
188
214
|
|
|
189
|
-
|
|
190
|
-
-
|
|
191
|
-
-
|
|
192
|
-
- 锁定 v0.1 的稳定接口(CLI flags、退出码、schema 字段名)。
|
|
193
|
-
- 跨平台 CI 矩阵(macOS + Linux + Windows,Node 20 + 22)。
|
|
215
|
+
**计划中**
|
|
216
|
+
- [ ] **桌面端应用:** 专用的图形界面环境,方便管理维基。
|
|
217
|
+
- [ ] **专业科学包:** 为生物医学和物理研究人员提供深度集成。
|
|
194
218
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
- **论文评估:** 新技能 `/lumi-rank`,将 influential-citation count、领域归一化排名、Scite support/contrast 和 Altmetric 添加到 frontmatter 的 `ranking:` 区块。
|
|
219
|
+
---
|
|
220
|
+
*完整的技术细节请见 [`ROADMAP.md`](./ROADMAP.md)。想要贡献?欢迎在 GitHub 上加入我们!*
|
|
198
221
|
|
|
199
|
-
**想贡献?** 选择 `ROADMAP.md` 中任何未勾选的项目,开 issue 认领,然后提交 PR。所有论文来源 fetcher 都遵循 `src/tools/` 中相同模式(CLI + JSON、no async、退出码 `0/2/3`),很适合作为第一次贡献。请参考下面的本地开发步骤。
|
|
200
222
|
|
|
201
223
|
---
|
|
202
224
|
|
|
203
225
|
## 7. 贡献与许可
|
|
204
226
|
|
|
227
|
+
### CLI 契约
|
|
228
|
+
|
|
229
|
+
CI 脚本和集成应参考 [`docs/cli-contract.md`](./docs/cli-contract.md) 了解 v1.x 稳定标志列表和退出码映射。未在其中列出的任何内容均为内部,可能在不另行通知的情况下更改。
|
|
230
|
+
|
|
205
231
|
### 本地开发(贡献者)
|
|
206
232
|
|
|
207
233
|
如果您想为 `lumina-wiki` 安装器做贡献:
|
package/bin/lumina.js
CHANGED
|
@@ -12,14 +12,15 @@
|
|
|
12
12
|
*
|
|
13
13
|
* Flags (all commands):
|
|
14
14
|
* --directory <path> — installation directory (defaults to current directory)
|
|
15
|
-
* --cwd <path> —
|
|
15
|
+
* --cwd <path> — [deprecated] alias for --directory; removed in v2.0
|
|
16
16
|
* --yes, -y — accept all defaults (non-interactive / CI)
|
|
17
17
|
* --no-update — skip npm registry version check
|
|
18
18
|
* --re-link — recompute symlink/junction/copy strategy
|
|
19
19
|
* --packs <list> — comma-separated pack list for non-interactive install
|
|
20
20
|
* --ide-targets <list> — comma-separated IDE target list for non-interactive install
|
|
21
21
|
*
|
|
22
|
-
* Exit codes: 0 success, 1 user error, 2 filesystem
|
|
22
|
+
* Exit codes: 0 success, 1 user error, 2 filesystem/safety, 3 internal/network,
|
|
23
|
+
* 4 user cancelled (Ctrl-C in interactive prompt or declined confirm)
|
|
23
24
|
*/
|
|
24
25
|
|
|
25
26
|
import { createRequire } from 'node:module';
|
|
@@ -76,6 +77,39 @@ if (handledVersion) process.exit(0);
|
|
|
76
77
|
const { Command, Option } = await import('commander');
|
|
77
78
|
const program = new Command();
|
|
78
79
|
|
|
80
|
+
// Exit code contract (see docs/planning-artifacts/audits/cli-contract-audit.md
|
|
81
|
+
// and `--help` text below). Caught errors map as follows:
|
|
82
|
+
// - RangeError (from safePath) → 2 (path safety)
|
|
83
|
+
// - err.code in {EACCES, EPERM} → 2 (filesystem perms)
|
|
84
|
+
// - err.code === 2 / err.code === 3 → preserved
|
|
85
|
+
// - other string fs codes (E*) → 3 (internal/io: ENOENT, EBUSY, EIO,
|
|
86
|
+
// EROFS, ENOSPC, ENOTDIR, …)
|
|
87
|
+
// - everything else → 1 (user error)
|
|
88
|
+
// ---------------------------------------------------------------------------
|
|
89
|
+
function exitCodeFor(err, defaultCode = 1) {
|
|
90
|
+
if (err instanceof RangeError) return 2;
|
|
91
|
+
if (err.code === 'EACCES' || err.code === 'EPERM') return 2;
|
|
92
|
+
if (err.code === 2) return 2;
|
|
93
|
+
if (err.code === 3) return 3;
|
|
94
|
+
if (typeof err.code === 'string' && err.code.startsWith('E')) return 3;
|
|
95
|
+
return defaultCode;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// ---------------------------------------------------------------------------
|
|
99
|
+
// Deprecation warnings — emitted to stderr once per invocation.
|
|
100
|
+
// Source of truth: docs/cli-contract.md.
|
|
101
|
+
// ---------------------------------------------------------------------------
|
|
102
|
+
let _cwdWarned = false;
|
|
103
|
+
function warnDeprecatedCwdIfUsed(cmdOpts, globalOpts) {
|
|
104
|
+
if (_cwdWarned) return;
|
|
105
|
+
if (cmdOpts.cwd != null || globalOpts.cwd != null) {
|
|
106
|
+
process.stderr.write(
|
|
107
|
+
'[deprecated] --cwd is deprecated and will be removed in v2.0. Use --directory instead.\n'
|
|
108
|
+
);
|
|
109
|
+
_cwdWarned = true;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
79
113
|
program
|
|
80
114
|
.name('lumina')
|
|
81
115
|
.description('Lumina Wiki — domain-agnostic, multi-IDE wiki scaffolder')
|
|
@@ -84,8 +118,9 @@ program
|
|
|
84
118
|
Exit codes:
|
|
85
119
|
0 success
|
|
86
120
|
1 user error (bad flag, missing prereq)
|
|
87
|
-
2 filesystem
|
|
88
|
-
3
|
|
121
|
+
2 filesystem / safety (permission denied, path outside cwd, unknown pack slug)
|
|
122
|
+
3 internal / network (atomicWrite failure, 5xx, upgrade incompatibility, lint catastrophic)
|
|
123
|
+
4 user cancelled (Ctrl-C in interactive prompt or declined confirm)
|
|
89
124
|
|
|
90
125
|
Flags applicable to all commands:
|
|
91
126
|
--directory <path> installation directory (defaults to current directory)
|
|
@@ -95,7 +130,7 @@ Flags applicable to all commands:
|
|
|
95
130
|
--packs <list> install packs: core,research,reading
|
|
96
131
|
--ide-targets <list> target CLIs: claude_code,codex,gemini_cli,qwen,iflow,cursor,generic
|
|
97
132
|
codex covers all AGENTS.md-compatible CLIs
|
|
98
|
-
(
|
|
133
|
+
(OpenAI CodexApp (ChatGPT), Amp, Crush, Goose, Auggie, OpenCode, etc.)
|
|
99
134
|
|
|
100
135
|
Examples:
|
|
101
136
|
npx lumina-wiki install
|
|
@@ -117,6 +152,13 @@ program
|
|
|
117
152
|
.option('--no-update', 'skip npm registry version check')
|
|
118
153
|
.option('--re-link', 'recompute symlink strategy from current platform capabilities');
|
|
119
154
|
|
|
155
|
+
// Single source of truth for --cwd deprecation: fires once before any
|
|
156
|
+
// subcommand action regardless of whether --cwd was passed globally or
|
|
157
|
+
// per-command. New subcommands inherit this for free.
|
|
158
|
+
program.hook('preAction', (_thisCommand, actionCommand) => {
|
|
159
|
+
warnDeprecatedCwdIfUsed(actionCommand.opts(), program.opts());
|
|
160
|
+
});
|
|
161
|
+
|
|
120
162
|
// ---------------------------------------------------------------------------
|
|
121
163
|
// --version / -v — print immediately then do async update check
|
|
122
164
|
// ---------------------------------------------------------------------------
|
|
@@ -140,6 +182,8 @@ program
|
|
|
140
182
|
.addOption(new Option('--project-name <name>', 'override auto-derived project name').hideHelp())
|
|
141
183
|
.option('--communication-language <language>', 'language agents use when talking to the user')
|
|
142
184
|
.option('--document-output-language <language>', 'language used for wiki documents')
|
|
185
|
+
.option('--lang <code>', 'installer UI locale: en, vi, zh')
|
|
186
|
+
.option('--force-locale-switch', 'allow switching installer locale during upgrade')
|
|
143
187
|
.action(async (cmdOpts) => {
|
|
144
188
|
const globalOpts = program.opts();
|
|
145
189
|
const mergedDir = cmdOpts.directory ?? cmdOpts.cwd ?? globalOpts.directory ?? globalOpts.cwd ?? process.cwd();
|
|
@@ -161,13 +205,15 @@ program
|
|
|
161
205
|
projectName: cmdOpts.projectName,
|
|
162
206
|
communicationLang: cmdOpts.communicationLanguage,
|
|
163
207
|
documentOutputLang: cmdOpts.documentOutputLanguage,
|
|
208
|
+
lang: cmdOpts.lang,
|
|
209
|
+
forceLocaleSwitch: Boolean(cmdOpts.forceLocaleSwitch),
|
|
164
210
|
});
|
|
165
211
|
} catch (err) {
|
|
166
|
-
|
|
167
|
-
|
|
212
|
+
// Top-level catch: locale may not be resolved yet (pre-loadLocale path).
|
|
213
|
+
// Error strings kept as EN literals — machine-readable, intentionally exempt.
|
|
168
214
|
console.error(`[error] ${err.message}`);
|
|
169
215
|
if (process.env.DEBUG) console.error(err.stack);
|
|
170
|
-
process.exit(
|
|
216
|
+
process.exit(exitCodeFor(err));
|
|
171
217
|
}
|
|
172
218
|
});
|
|
173
219
|
|
|
@@ -194,7 +240,7 @@ program
|
|
|
194
240
|
} catch (err) {
|
|
195
241
|
console.error(`[error] ${err.message}`);
|
|
196
242
|
if (process.env.DEBUG) console.error(err.stack);
|
|
197
|
-
process.exit(
|
|
243
|
+
process.exit(exitCodeFor(err));
|
|
198
244
|
}
|
|
199
245
|
});
|
|
200
246
|
|
|
@@ -229,7 +275,9 @@ discover
|
|
|
229
275
|
} catch (err) {
|
|
230
276
|
console.error(`[error] ${err.message}`);
|
|
231
277
|
if (process.env.DEBUG) console.error(err.stack);
|
|
232
|
-
|
|
278
|
+
// Unhandled exceptions from discover-runner are by definition not user
|
|
279
|
+
// errors (main() handles those), so default unknown → 3 (internal).
|
|
280
|
+
process.exit(exitCodeFor(err, 3));
|
|
233
281
|
}
|
|
234
282
|
});
|
|
235
283
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "lumina-wiki",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.0",
|
|
5
5
|
"description": "Domain-agnostic, multi-IDE wiki scaffolder — Karpathy's LLM-Wiki vision, cross-platform and pack-based.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"llm-wiki",
|
|
@@ -35,6 +35,8 @@
|
|
|
35
35
|
"src/installer/banner.js",
|
|
36
36
|
"src/installer/commands.js",
|
|
37
37
|
"src/installer/fs.js",
|
|
38
|
+
"src/installer/locales.js",
|
|
39
|
+
"src/installer/locales/*.mjs",
|
|
38
40
|
"src/installer/manifest.js",
|
|
39
41
|
"src/installer/prompts.js",
|
|
40
42
|
"src/installer/template-engine.js",
|
|
@@ -45,8 +47,13 @@
|
|
|
45
47
|
"src/scripts/reset.mjs",
|
|
46
48
|
"src/scripts/schemas.mjs",
|
|
47
49
|
"src/scripts/discover-runner.mjs",
|
|
50
|
+
"src/scripts/external-ids.mjs",
|
|
51
|
+
"src/scripts/parse-ids.mjs",
|
|
52
|
+
"src/scripts/merge-ids.mjs",
|
|
53
|
+
"src/scripts/build-source.mjs",
|
|
48
54
|
"src/scripts/lib/*.mjs",
|
|
49
55
|
"src/skills/**/*.md",
|
|
56
|
+
"src/tools/_cache.py",
|
|
50
57
|
"src/tools/_env.py",
|
|
51
58
|
"src/tools/extract_pdf.py",
|
|
52
59
|
"src/tools/discover.py",
|
|
@@ -57,6 +64,7 @@
|
|
|
57
64
|
"src/tools/fetch_wikipedia.py",
|
|
58
65
|
"src/tools/fetch_s2.py",
|
|
59
66
|
"src/tools/fetch_deepxiv.py",
|
|
67
|
+
"src/tools/id_utils.py",
|
|
60
68
|
"src/tools/requirements.txt",
|
|
61
69
|
"CHANGELOG.md",
|
|
62
70
|
"README.md",
|
|
@@ -75,15 +83,16 @@
|
|
|
75
83
|
"devDependencies": {},
|
|
76
84
|
"scripts": {
|
|
77
85
|
"test": "npm run test:installer",
|
|
78
|
-
"test:installer": "node --test src/installer/commands.test.js src/installer/fs.test.js src/installer/manifest.test.js src/installer/template-engine.test.js src/installer/update-check.test.js",
|
|
79
|
-
"test:scripts": "node --test src/scripts/lint.test.mjs src/scripts/reset.test.mjs src/scripts/wiki.test.mjs src/scripts/discover-runner.test.mjs",
|
|
80
|
-
"test:python": "
|
|
86
|
+
"test:installer": "node --test bin/lumina.flags.test.js bin/lumina.deprecations.test.js bin/lumina.cancel.test.js src/installer/commands.test.js src/installer/fs.test.js src/installer/locales.test.js src/installer/manifest.test.js src/installer/prompts.test.js src/installer/readme-templates.test.js src/installer/template-engine.test.js src/installer/update-check.test.js",
|
|
87
|
+
"test:scripts": "node --test src/scripts/lint.test.mjs src/scripts/reset.test.mjs src/scripts/wiki.test.mjs src/scripts/discover-runner.test.mjs src/scripts/external-ids.test.mjs src/scripts/parse-ids.test.mjs src/scripts/merge-ids.test.mjs src/scripts/build-source.test.mjs src/scripts/wiki-yaml-object.test.mjs",
|
|
88
|
+
"test:python": "node scripts/run-pytest.mjs",
|
|
81
89
|
"test:all": "npm run test:installer && npm run test:scripts && npm run test:python",
|
|
82
90
|
"test:fs": "node --test src/installer/fs.test.js",
|
|
83
91
|
"test:manifest": "node --test src/installer/manifest.test.js",
|
|
84
92
|
"test:template": "node --test src/installer/template-engine.test.js",
|
|
85
93
|
"test:update": "node --test src/installer/update-check.test.js",
|
|
86
94
|
"ci:idempotency": "node scripts/ci-idempotency.mjs",
|
|
95
|
+
"ci:cold-start": "node scripts/measure-cold-start.mjs",
|
|
87
96
|
"ci:package": "node scripts/ci-package.mjs",
|
|
88
97
|
"pack:check": "npm run ci:package",
|
|
89
98
|
"dev:install": "node bin/lumina.js install",
|
package/src/installer/banner.js
CHANGED
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
* subshells. Respects NO_COLOR by emitting plain text.
|
|
8
8
|
*
|
|
9
9
|
* Narrow terminals (<80 cols) get a compact fallback so lines do not wrap.
|
|
10
|
+
*
|
|
11
|
+
* Banner runs before locale selection; literal EN by design.
|
|
12
|
+
* ASCII art is locale-agnostic; only tagline+footer use hardcoded EN strings.
|
|
10
13
|
*/
|
|
11
14
|
|
|
12
15
|
const NO_COLOR = Boolean(process.env.NO_COLOR);
|