wikimem 0.1.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 +37 -0
- package/LICENSE +21 -0
- package/README.md +398 -0
- package/dist/cli/commands/duplicates.d.ts +3 -0
- package/dist/cli/commands/duplicates.d.ts.map +1 -0
- package/dist/cli/commands/duplicates.js +38 -0
- package/dist/cli/commands/duplicates.js.map +1 -0
- package/dist/cli/commands/improve.d.ts +3 -0
- package/dist/cli/commands/improve.d.ts.map +1 -0
- package/dist/cli/commands/improve.js +69 -0
- package/dist/cli/commands/improve.js.map +1 -0
- package/dist/cli/commands/ingest.d.ts +3 -0
- package/dist/cli/commands/ingest.d.ts.map +1 -0
- package/dist/cli/commands/ingest.js +181 -0
- package/dist/cli/commands/ingest.js.map +1 -0
- package/dist/cli/commands/init.d.ts +3 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +91 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/lint.d.ts +3 -0
- package/dist/cli/commands/lint.d.ts.map +1 -0
- package/dist/cli/commands/lint.js +49 -0
- package/dist/cli/commands/lint.js.map +1 -0
- package/dist/cli/commands/query.d.ts +3 -0
- package/dist/cli/commands/query.d.ts.map +1 -0
- package/dist/cli/commands/query.js +51 -0
- package/dist/cli/commands/query.js.map +1 -0
- package/dist/cli/commands/scrape.d.ts +3 -0
- package/dist/cli/commands/scrape.d.ts.map +1 -0
- package/dist/cli/commands/scrape.js +47 -0
- package/dist/cli/commands/scrape.js.map +1 -0
- package/dist/cli/commands/serve.d.ts +3 -0
- package/dist/cli/commands/serve.d.ts.map +1 -0
- package/dist/cli/commands/serve.js +24 -0
- package/dist/cli/commands/serve.js.map +1 -0
- package/dist/cli/commands/status.d.ts +3 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +30 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/watch.d.ts +3 -0
- package/dist/cli/commands/watch.d.ts.map +1 -0
- package/dist/cli/commands/watch.js +29 -0
- package/dist/cli/commands/watch.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +30 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/config.d.ts +47 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +11 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/improve.d.ts +19 -0
- package/dist/core/improve.d.ts.map +1 -0
- package/dist/core/improve.js +175 -0
- package/dist/core/improve.js.map +1 -0
- package/dist/core/index-manager.d.ts +9 -0
- package/dist/core/index-manager.d.ts.map +1 -0
- package/dist/core/index-manager.js +30 -0
- package/dist/core/index-manager.js.map +1 -0
- package/dist/core/ingest.d.ts +46 -0
- package/dist/core/ingest.d.ts.map +1 -0
- package/dist/core/ingest.js +366 -0
- package/dist/core/ingest.js.map +1 -0
- package/dist/core/lint.d.ts +19 -0
- package/dist/core/lint.d.ts.map +1 -0
- package/dist/core/lint.js +90 -0
- package/dist/core/lint.js.map +1 -0
- package/dist/core/log-manager.d.ts +2 -0
- package/dist/core/log-manager.d.ts.map +1 -0
- package/dist/core/log-manager.js +14 -0
- package/dist/core/log-manager.js.map +1 -0
- package/dist/core/obsidian.d.ts +89 -0
- package/dist/core/obsidian.d.ts.map +1 -0
- package/dist/core/obsidian.js +123 -0
- package/dist/core/obsidian.js.map +1 -0
- package/dist/core/query.d.ts +16 -0
- package/dist/core/query.d.ts.map +1 -0
- package/dist/core/query.js +77 -0
- package/dist/core/query.js.map +1 -0
- package/dist/core/scrape.d.ts +13 -0
- package/dist/core/scrape.d.ts.map +1 -0
- package/dist/core/scrape.js +103 -0
- package/dist/core/scrape.js.map +1 -0
- package/dist/core/vault.d.ts +35 -0
- package/dist/core/vault.d.ts.map +1 -0
- package/dist/core/vault.js +119 -0
- package/dist/core/vault.js.map +1 -0
- package/dist/core/watcher.d.ts +4 -0
- package/dist/core/watcher.d.ts.map +1 -0
- package/dist/core/watcher.js +34 -0
- package/dist/core/watcher.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/processors/audio.d.ts +10 -0
- package/dist/processors/audio.d.ts.map +1 -0
- package/dist/processors/audio.js +139 -0
- package/dist/processors/audio.js.map +1 -0
- package/dist/processors/docx.d.ts +12 -0
- package/dist/processors/docx.d.ts.map +1 -0
- package/dist/processors/docx.js +98 -0
- package/dist/processors/docx.js.map +1 -0
- package/dist/processors/image.d.ts +9 -0
- package/dist/processors/image.d.ts.map +1 -0
- package/dist/processors/image.js +94 -0
- package/dist/processors/image.js.map +1 -0
- package/dist/processors/pdf.d.ts +10 -0
- package/dist/processors/pdf.d.ts.map +1 -0
- package/dist/processors/pdf.js +92 -0
- package/dist/processors/pdf.js.map +1 -0
- package/dist/processors/pptx.d.ts +13 -0
- package/dist/processors/pptx.d.ts.map +1 -0
- package/dist/processors/pptx.js +165 -0
- package/dist/processors/pptx.js.map +1 -0
- package/dist/processors/text.d.ts +7 -0
- package/dist/processors/text.d.ts.map +1 -0
- package/dist/processors/text.js +9 -0
- package/dist/processors/text.js.map +1 -0
- package/dist/processors/url.d.ts +7 -0
- package/dist/processors/url.d.ts.map +1 -0
- package/dist/processors/url.js +61 -0
- package/dist/processors/url.js.map +1 -0
- package/dist/processors/video.d.ts +10 -0
- package/dist/processors/video.d.ts.map +1 -0
- package/dist/processors/video.js +115 -0
- package/dist/processors/video.js.map +1 -0
- package/dist/processors/xlsx.d.ts +13 -0
- package/dist/processors/xlsx.d.ts.map +1 -0
- package/dist/processors/xlsx.js +138 -0
- package/dist/processors/xlsx.js.map +1 -0
- package/dist/providers/claude.d.ts +10 -0
- package/dist/providers/claude.d.ts.map +1 -0
- package/dist/providers/claude.js +44 -0
- package/dist/providers/claude.js.map +1 -0
- package/dist/providers/embeddings.d.ts +62 -0
- package/dist/providers/embeddings.d.ts.map +1 -0
- package/dist/providers/embeddings.js +206 -0
- package/dist/providers/embeddings.js.map +1 -0
- package/dist/providers/index.d.ts +7 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +19 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/ollama.d.ts +10 -0
- package/dist/providers/ollama.d.ts.map +1 -0
- package/dist/providers/ollama.js +48 -0
- package/dist/providers/ollama.js.map +1 -0
- package/dist/providers/openai.d.ts +10 -0
- package/dist/providers/openai.d.ts.map +1 -0
- package/dist/providers/openai.js +38 -0
- package/dist/providers/openai.js.map +1 -0
- package/dist/providers/types.d.ts +33 -0
- package/dist/providers/types.d.ts.map +1 -0
- package/dist/providers/types.js +2 -0
- package/dist/providers/types.js.map +1 -0
- package/dist/search/bm25.d.ts +18 -0
- package/dist/search/bm25.d.ts.map +1 -0
- package/dist/search/bm25.js +52 -0
- package/dist/search/bm25.js.map +1 -0
- package/dist/search/index.d.ts +12 -0
- package/dist/search/index.d.ts.map +1 -0
- package/dist/search/index.js +64 -0
- package/dist/search/index.js.map +1 -0
- package/dist/search/semantic.d.ts +30 -0
- package/dist/search/semantic.d.ts.map +1 -0
- package/dist/search/semantic.js +162 -0
- package/dist/search/semantic.js.map +1 -0
- package/dist/templates/agents-md.d.ts +2 -0
- package/dist/templates/agents-md.d.ts.map +1 -0
- package/dist/templates/agents-md.js +85 -0
- package/dist/templates/agents-md.js.map +1 -0
- package/dist/templates/config-yaml.d.ts +2 -0
- package/dist/templates/config-yaml.d.ts.map +1 -0
- package/dist/templates/config-yaml.js +81 -0
- package/dist/templates/config-yaml.js.map +1 -0
- package/dist/web/server.d.ts +2 -0
- package/dist/web/server.d.ts.map +1 -0
- package/dist/web/server.js +170 -0
- package/dist/web/server.js.map +1 -0
- package/package.json +68 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to llmwiki will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.0] - 2026-04-07
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **CLI commands:** `init`, `ingest`, `query`, `lint`, `watch`, `scrape`, `improve`, `status`
|
|
13
|
+
- **Three-layer architecture:** `raw/` (immutable sources), `wiki/` (LLM-generated), `AGENTS.md` (schema)
|
|
14
|
+
- **Three automations:** ingest pipeline (A1), external scraping (A2), self-improvement (A3)
|
|
15
|
+
- **Multi-model support:** Claude (Anthropic), OpenAI (GPT), Ollama (local)
|
|
16
|
+
- **Multi-format processing:**
|
|
17
|
+
- Text: `.md`, `.txt`, `.csv`, `.json`, `.html`
|
|
18
|
+
- PDF: built-in text extraction from PDF binary format
|
|
19
|
+
- Audio: `.mp3`, `.wav`, `.m4a`, `.ogg`, `.flac`, `.aac` via Whisper or Deepgram
|
|
20
|
+
- Video: `.mp4`, `.mov`, `.avi`, `.mkv`, `.webm` via ffmpeg + Whisper
|
|
21
|
+
- Image: `.jpg`, `.png`, `.gif`, `.webp` via Claude Vision
|
|
22
|
+
- URL: web pages via Firecrawl API or native fetch fallback
|
|
23
|
+
- Office: `.docx`, `.pptx`, `.xlsx` basic reference extraction
|
|
24
|
+
- **BM25 search engine:** zero-dependency full-text search with title boosting
|
|
25
|
+
- **Semantic dedup:** Jaccard similarity check prevents near-duplicate ingestion
|
|
26
|
+
- **Watch mode:** `chokidar`-based file watcher auto-ingests new files in `raw/`
|
|
27
|
+
- **External scraping:** RSS feeds, GitHub trending repos, plain URL scraping
|
|
28
|
+
- **Self-improvement cycle:** 5-dimension scoring (coverage, consistency, cross-linking, freshness, organization) with configurable threshold and dry-run mode
|
|
29
|
+
- **Wiki health checks:** orphan detection, broken wikilink detection, missing summary detection, empty page detection
|
|
30
|
+
- **Auto-maintained files:** `wiki/index.md` (content catalog) and `wiki/log.md` (operation log)
|
|
31
|
+
- **Obsidian compatibility:** YAML frontmatter, `[[wikilinks]]`, section-based organization
|
|
32
|
+
- **Domain templates:** personal, research, business, codebase
|
|
33
|
+
- **File-back queries:** optionally save query answers as synthesis pages
|
|
34
|
+
- **AGENTS.md schema:** co-evolving wiki structure document
|
|
35
|
+
- **YAML configuration:** `config.yaml` for provider, sources, schedules, processing options
|
|
36
|
+
|
|
37
|
+
[0.1.0]: https://github.com/naman10parikh/llmwiki/releases/tag/v0.1.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Naman Parikh
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
# llmwiki
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/llmwiki)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://www.typescriptlang.org/)
|
|
6
|
+
[](#tests)
|
|
7
|
+
|
|
8
|
+
**Build self-improving knowledge bases with LLMs.**
|
|
9
|
+
|
|
10
|
+
Drop files in. Get a structured, interlinked wiki out. It improves itself while you sleep.
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npx llmwiki init my-wiki
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
raw/ wiki/
|
|
18
|
+
2026-04-07/ index.md ........... content catalog
|
|
19
|
+
paper.pdf ──LLM──> sources/paper.md ... summary + citations
|
|
20
|
+
podcast.mp3 entities/openai.md . people, orgs, tools
|
|
21
|
+
screenshot.png concepts/rag.md .... ideas + frameworks
|
|
22
|
+
blog-url syntheses/ ......... cross-cutting analysis
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
llmwiki processes any source (text, PDF, audio, video, images, URLs), compiles it into an interlinked markdown wiki with frontmatter and `[[wikilinks]]`, and opens directly in Obsidian.
|
|
26
|
+
|
|
27
|
+
Works with **Claude, OpenAI, or Ollama** (local). Your data stays on your machine.
|
|
28
|
+
|
|
29
|
+
Inspired by [Andrej Karpathy's LLM Wiki pattern](https://x.com/karpathy/status/1908625766490001799).
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install -g llmwiki
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Requirements:** Node.js >= 18 · An LLM API key (or Ollama running locally)
|
|
38
|
+
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# 1. Create a vault
|
|
43
|
+
llmwiki init my-wiki
|
|
44
|
+
cd my-wiki
|
|
45
|
+
|
|
46
|
+
# 2. Ingest something
|
|
47
|
+
llmwiki ingest https://en.wikipedia.org/wiki/Large_language_model
|
|
48
|
+
llmwiki ingest ~/Documents/research-paper.pdf
|
|
49
|
+
|
|
50
|
+
# 3. Ask questions
|
|
51
|
+
llmwiki query "What are the key differences between RAG and compiled knowledge?"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
That's it. Your wiki is now a folder of markdown files you can open in Obsidian, VS Code, or any text editor.
|
|
55
|
+
|
|
56
|
+
## Why llmwiki?
|
|
57
|
+
|
|
58
|
+
**The problem:** You have dozens of sources — papers, podcasts, articles, screenshots, meeting recordings. They sit in folders. You forget what's in them. When you need something, you search and re-read.
|
|
59
|
+
|
|
60
|
+
**RAG approach:** Chunk documents, embed them, retrieve at query time. Lossy, opaque, and the "knowledge" lives in a vector database you can't read.
|
|
61
|
+
|
|
62
|
+
**llmwiki approach:** Compile sources into structured markdown pages with summaries, cross-references, and citations. The knowledge is readable, editable, version-controlled, and improves itself over time.
|
|
63
|
+
|
|
64
|
+
| | RAG | llmwiki |
|
|
65
|
+
|---|---|---|
|
|
66
|
+
| **Storage** | Vector embeddings | Plain markdown files |
|
|
67
|
+
| **Readable?** | No (opaque vectors) | Yes (open in any editor) |
|
|
68
|
+
| **Editable?** | Rebuild index | Edit any page |
|
|
69
|
+
| **Version control** | Difficult | `git diff` |
|
|
70
|
+
| **Self-improving** | No | Yes (LLM Council) |
|
|
71
|
+
| **Works offline** | Depends | Yes (with Ollama) |
|
|
72
|
+
| **Obsidian** | Plugin required | Native (`[[wikilinks]]`) |
|
|
73
|
+
|
|
74
|
+
## Features
|
|
75
|
+
|
|
76
|
+
- [x] **Multi-format ingestion** — text, PDF, audio, video, images, URLs, Office docs
|
|
77
|
+
- [x] **Multi-model support** — Claude, OpenAI, Ollama (local)
|
|
78
|
+
- [x] **Obsidian-native** — `[[wikilinks]]`, YAML frontmatter, opens directly as vault
|
|
79
|
+
- [x] **Semantic dedup** — rejects near-duplicate sources automatically
|
|
80
|
+
- [x] **BM25 search** — zero-dependency full-text search, no external services
|
|
81
|
+
- [x] **Auto-indexing** — `index.md` + `log.md` maintained automatically
|
|
82
|
+
- [x] **Watch mode** — drop files into `raw/`, auto-ingested
|
|
83
|
+
- [x] **Self-improvement** — LLM Council scores your wiki and fixes issues
|
|
84
|
+
- [x] **External scraping** — pull from RSS, GitHub, URLs on a schedule
|
|
85
|
+
- [x] **Health checks** — find orphan pages, broken links, missing summaries
|
|
86
|
+
- [x] **File-back answers** — query results saved as synthesis pages
|
|
87
|
+
- [x] **Schema co-evolution** — AGENTS.md evolves with your wiki
|
|
88
|
+
- [x] **Domain templates** — personal, research, business, codebase
|
|
89
|
+
- [x] **Local-first** — everything is files. No database. No cloud dependency.
|
|
90
|
+
|
|
91
|
+
## Architecture
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
┌────────────────────────────────────────────────────┐
|
|
95
|
+
│ llmwiki CLI │
|
|
96
|
+
│ │
|
|
97
|
+
│ llmwiki init Create a new vault │
|
|
98
|
+
│ llmwiki ingest Process source → wiki pages │
|
|
99
|
+
│ llmwiki query Ask questions with citations │
|
|
100
|
+
│ llmwiki lint Health-check the wiki │
|
|
101
|
+
│ llmwiki watch Auto-ingest on file drop │
|
|
102
|
+
│ llmwiki scrape Fetch from external sources │
|
|
103
|
+
│ llmwiki improve Self-improvement cycle │
|
|
104
|
+
│ llmwiki status Vault statistics │
|
|
105
|
+
├──────────────────────┬─────────────────────────────┤
|
|
106
|
+
│ Three Layers │ Three Automations │
|
|
107
|
+
│ │ │
|
|
108
|
+
│ raw/ │ A1: Ingest & Process │
|
|
109
|
+
│ (immutable) <────│ file/URL → markdown │
|
|
110
|
+
│ │ → place in wiki/ │
|
|
111
|
+
│ wiki/ │ │
|
|
112
|
+
│ (LLM-owned) <────│ A2: External Scrape │
|
|
113
|
+
│ │ RSS, GitHub, web → raw/ │
|
|
114
|
+
│ AGENTS.md │ │
|
|
115
|
+
│ (schema) <────│ A3: Self-Improve │
|
|
116
|
+
│ │ LLM Council → score → fix │
|
|
117
|
+
├──────────────────────┴─────────────────────────────┤
|
|
118
|
+
│ LLM Providers │
|
|
119
|
+
│ Claude (Anthropic) · OpenAI (GPT) · Ollama │
|
|
120
|
+
├────────────────────────────────────────────────────┤
|
|
121
|
+
│ Processors │
|
|
122
|
+
│ Text · PDF · Audio · Video · Image · URL · HTML │
|
|
123
|
+
└────────────────────────────────────────────────────┘
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Three Layers
|
|
127
|
+
|
|
128
|
+
1. **`raw/`** — Immutable source documents. Date-stamped subdirectories. Never modified by the LLM.
|
|
129
|
+
2. **`wiki/`** — LLM-generated markdown. Source summaries, entity pages, concept pages, synthesis pages. The LLM owns this entirely.
|
|
130
|
+
3. **`AGENTS.md`** — Schema file. Tells the LLM how the wiki is structured, what conventions to follow, how to process sources. Co-evolved by you and the LLM.
|
|
131
|
+
|
|
132
|
+
### Three Automations
|
|
133
|
+
|
|
134
|
+
- **A1: Ingest & Process** — Detects file type, runs the appropriate processor (Whisper for audio, ffmpeg+Whisper for video, Claude Vision for images, text extraction for PDF), asks the LLM to produce wiki pages with cross-references.
|
|
135
|
+
- **A2: External Scrape** — Fetches from RSS feeds, GitHub trending, web URLs. Deposits results in `raw/` and triggers A1 automatically.
|
|
136
|
+
- **A3: Self-Improve** — LLM Council evaluates wiki quality across 5 dimensions (coverage, consistency, cross-linking, freshness, organization), proposes improvements, and applies them if below a configurable threshold.
|
|
137
|
+
|
|
138
|
+
## All Commands
|
|
139
|
+
|
|
140
|
+
### `llmwiki init [directory]`
|
|
141
|
+
|
|
142
|
+
Create a new vault with the standard directory structure.
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
llmwiki init my-wiki # Create in my-wiki/
|
|
146
|
+
llmwiki init . # Initialize current directory
|
|
147
|
+
llmwiki init my-wiki --template research # Use research template
|
|
148
|
+
llmwiki init my-wiki --force # Overwrite existing
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Templates: `personal` (default), `research`, `business`, `codebase`
|
|
152
|
+
|
|
153
|
+
### `llmwiki ingest <source>`
|
|
154
|
+
|
|
155
|
+
Process a file or URL into wiki pages.
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
llmwiki ingest paper.pdf # PDF → extract text → wiki pages
|
|
159
|
+
llmwiki ingest podcast.mp3 # Audio → Whisper transcription → wiki
|
|
160
|
+
llmwiki ingest screenshot.png # Image → Claude Vision description → wiki
|
|
161
|
+
llmwiki ingest lecture.mp4 # Video → ffmpeg → Whisper → wiki
|
|
162
|
+
llmwiki ingest article.md # Markdown → wiki pages
|
|
163
|
+
llmwiki ingest data.json # JSON → code block in wiki
|
|
164
|
+
llmwiki ingest page.html # HTML → strip tags → wiki
|
|
165
|
+
llmwiki ingest report.docx # Office → basic extraction → wiki
|
|
166
|
+
llmwiki ingest https://example.com/post # URL → Firecrawl/fetch → wiki
|
|
167
|
+
llmwiki ingest raw/2026-04-07/file.md # Re-ingest from raw/
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Each source is auto-detected by file type, copied to `raw/{date}/`, checked for duplicates, compiled into wiki pages by the LLM, and indexed. Use `-p` to pick a provider, `-m` for a specific model, `--verbose` for detailed output.
|
|
171
|
+
|
|
172
|
+
### `llmwiki query <question>`
|
|
173
|
+
|
|
174
|
+
Ask a question and get an answer synthesized from your wiki.
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
llmwiki query "What are the main themes across my sources?"
|
|
178
|
+
llmwiki query "Compare approaches to knowledge management" --file
|
|
179
|
+
llmwiki query "Who is mentioned most frequently?" -p openai
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Use `--file` to save the answer as a synthesis page in `wiki/syntheses/`. The query engine uses BM25 search to find relevant pages, reads the top 10, and synthesizes an answer with `[[wikilink]]` citations.
|
|
183
|
+
|
|
184
|
+
### `llmwiki lint`
|
|
185
|
+
|
|
186
|
+
Health-check the wiki for structural issues.
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
llmwiki lint # Check for issues
|
|
190
|
+
llmwiki lint --fix # Auto-fix where possible
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Checks for:
|
|
194
|
+
- Orphan pages (no inbound `[[wikilinks]]`)
|
|
195
|
+
- Broken wikilinks (links to non-existent pages)
|
|
196
|
+
- Pages missing frontmatter summaries
|
|
197
|
+
- Near-empty pages (< 10 words)
|
|
198
|
+
|
|
199
|
+
Reports a quality score out of 100.
|
|
200
|
+
|
|
201
|
+
### `llmwiki watch`
|
|
202
|
+
|
|
203
|
+
Watch the `raw/` directory and auto-ingest new files.
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
llmwiki watch # Watch current vault
|
|
207
|
+
llmwiki watch -v ./my-wiki # Watch a specific vault
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Uses `chokidar` for reliable cross-platform file watching. Waits for writes to stabilize before ingesting (2-second debounce). Press `Ctrl+C` to stop.
|
|
211
|
+
|
|
212
|
+
### `llmwiki scrape`
|
|
213
|
+
|
|
214
|
+
Fetch content from configured external sources and deposit in `raw/`.
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
llmwiki scrape # Run all configured sources
|
|
218
|
+
llmwiki scrape -s "HN Top" # Run a specific source
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
Sources are configured in `config.yaml`:
|
|
222
|
+
|
|
223
|
+
```yaml
|
|
224
|
+
sources:
|
|
225
|
+
- name: "HN Top Stories"
|
|
226
|
+
type: rss
|
|
227
|
+
url: "https://hnrss.org/frontpage"
|
|
228
|
+
|
|
229
|
+
- name: "GitHub Trending TS"
|
|
230
|
+
type: github
|
|
231
|
+
query: "stars:>100 created:>7d language:typescript"
|
|
232
|
+
|
|
233
|
+
- name: "Company Blog"
|
|
234
|
+
type: url
|
|
235
|
+
url: "https://example.com/blog"
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Supported source types: `rss`, `github`, `url`
|
|
239
|
+
|
|
240
|
+
### `llmwiki improve`
|
|
241
|
+
|
|
242
|
+
Run the self-improvement cycle (Automation 3).
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
llmwiki improve # Evaluate and improve
|
|
246
|
+
llmwiki improve --dry-run # Show what would change
|
|
247
|
+
llmwiki improve --threshold 90 # Stricter quality bar
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
The improvement cycle:
|
|
251
|
+
|
|
252
|
+
1. **Score** — Evaluates 5 quality dimensions (coverage, consistency, cross-linking, freshness, organization)
|
|
253
|
+
2. **Decide** — If score < threshold (default 80), improvements are needed
|
|
254
|
+
3. **Improve** — Proposes actions: add cross-links, create missing pages, expand stubs, flag contradictions
|
|
255
|
+
4. **Log** — Records what changed and why in `log.md`
|
|
256
|
+
|
|
257
|
+
### `llmwiki status`
|
|
258
|
+
|
|
259
|
+
Show vault statistics at a glance.
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
llmwiki status
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
```
|
|
266
|
+
llmwiki vault status
|
|
267
|
+
────────────────────────────────────
|
|
268
|
+
Pages: 42
|
|
269
|
+
Words: 18,340
|
|
270
|
+
Sources: 15
|
|
271
|
+
Wiki links: 127
|
|
272
|
+
Orphan pages: 2
|
|
273
|
+
Last updated: 2026-04-07
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
## Configuration
|
|
277
|
+
|
|
278
|
+
After `llmwiki init`, your vault contains a `config.yaml` where you set the LLM provider, external sources, self-improvement schedule, and processing options.
|
|
279
|
+
|
|
280
|
+
See [docs/configuration.md](docs/configuration.md) for the full reference.
|
|
281
|
+
|
|
282
|
+
### Environment Variables
|
|
283
|
+
|
|
284
|
+
| Variable | Purpose |
|
|
285
|
+
|----------|---------|
|
|
286
|
+
| `ANTHROPIC_API_KEY` | Claude API access (default provider) |
|
|
287
|
+
| `OPENAI_API_KEY` | OpenAI API access |
|
|
288
|
+
| `OLLAMA_BASE_URL` | Ollama server URL (default: `http://localhost:11434`) |
|
|
289
|
+
| `FIRECRAWL_API_KEY` | Enhanced URL-to-markdown (optional, falls back to fetch) |
|
|
290
|
+
| `DEEPGRAM_API_KEY` | Audio transcription API (optional, falls back to Whisper) |
|
|
291
|
+
|
|
292
|
+
## Multi-Model Support
|
|
293
|
+
|
|
294
|
+
llmwiki works with any major LLM provider. Choose at init time or per-command.
|
|
295
|
+
|
|
296
|
+
| Provider | Flag | Default Model | Env Variable |
|
|
297
|
+
|----------|------|---------------|-------------|
|
|
298
|
+
| **Claude** | `-p claude` | `claude-sonnet-4-20250514` | `ANTHROPIC_API_KEY` |
|
|
299
|
+
| **OpenAI** | `-p openai` | `gpt-4o` | `OPENAI_API_KEY` |
|
|
300
|
+
| **Ollama** | `-p ollama` | `llama3.2` | `OLLAMA_BASE_URL` |
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
# Use Claude (default)
|
|
304
|
+
llmwiki ingest paper.pdf
|
|
305
|
+
|
|
306
|
+
# Use OpenAI
|
|
307
|
+
llmwiki ingest paper.pdf -p openai -m gpt-4o-mini
|
|
308
|
+
|
|
309
|
+
# Use Ollama (fully local, no API keys)
|
|
310
|
+
llmwiki ingest paper.pdf -p ollama -m llama3.2
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
## Multi-Format Support
|
|
314
|
+
|
|
315
|
+
| Format | Extensions | Processor | Requirements |
|
|
316
|
+
|--------|-----------|-----------|-------------|
|
|
317
|
+
| **Text** | `.md`, `.txt`, `.csv` | Direct read | None |
|
|
318
|
+
| **PDF** | `.pdf` | Built-in text extraction | None |
|
|
319
|
+
| **Audio** | `.mp3`, `.wav`, `.m4a`, `.ogg`, `.flac`, `.aac` | Whisper / Deepgram | `whisper` CLI or `DEEPGRAM_API_KEY` |
|
|
320
|
+
| **Video** | `.mp4`, `.mov`, `.avi`, `.mkv`, `.webm` | ffmpeg + Whisper | `ffmpeg` + `whisper` |
|
|
321
|
+
| **Image** | `.jpg`, `.png`, `.gif`, `.webp` | Claude Vision | `ANTHROPIC_API_KEY` |
|
|
322
|
+
| **HTML** | `.html`, `.htm` | Tag stripping | None |
|
|
323
|
+
| **JSON** | `.json` | Code block wrapping | None |
|
|
324
|
+
| **Office** | `.docx`, `.pptx`, `.xlsx` | Basic extraction | None (enhanced coming) |
|
|
325
|
+
| **URL** | `https://...` | Firecrawl / fetch | Optional `FIRECRAWL_API_KEY` |
|
|
326
|
+
|
|
327
|
+
When a processor's requirements are not met (e.g., Whisper not installed for audio), llmwiki creates a reference page noting the source file and suggests installing the missing tool. The raw file is always preserved.
|
|
328
|
+
|
|
329
|
+
## Obsidian Integration
|
|
330
|
+
|
|
331
|
+
llmwiki vaults are Obsidian vaults. Open any llmwiki directory in Obsidian and you get:
|
|
332
|
+
|
|
333
|
+
- **Graph view** showing all pages and their `[[wikilinks]]`
|
|
334
|
+
- **YAML frontmatter** rendered as page metadata
|
|
335
|
+
- **Backlinks** panel showing what links to each page
|
|
336
|
+
- **Search** across all wiki content
|
|
337
|
+
- **Tag view** from frontmatter `tags:` arrays
|
|
338
|
+
|
|
339
|
+
No plugins required. No configuration. Just `Open folder as vault` in Obsidian.
|
|
340
|
+
|
|
341
|
+
```
|
|
342
|
+
# Every wiki page has frontmatter like this:
|
|
343
|
+
---
|
|
344
|
+
title: "Attention Is All You Need"
|
|
345
|
+
type: source
|
|
346
|
+
created: "2026-04-07"
|
|
347
|
+
updated: "2026-04-07"
|
|
348
|
+
tags: [transformers, attention, nlp]
|
|
349
|
+
sources: ["raw/2026-04-07/attention-paper.pdf"]
|
|
350
|
+
summary: "Foundational transformer architecture paper introducing self-attention"
|
|
351
|
+
---
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
## Vault Structure
|
|
355
|
+
|
|
356
|
+
```
|
|
357
|
+
my-wiki/
|
|
358
|
+
├── AGENTS.md # Schema — wiki structure + conventions
|
|
359
|
+
├── config.yaml # Configuration — provider, sources, schedules
|
|
360
|
+
├── .gitignore
|
|
361
|
+
├── raw/ # Immutable source archive
|
|
362
|
+
│ ├── 2026-04-07/
|
|
363
|
+
│ │ ├── paper.pdf
|
|
364
|
+
│ │ ├── podcast.mp3
|
|
365
|
+
│ │ └── blog-post.md
|
|
366
|
+
│ └── 2026-04-08/
|
|
367
|
+
│ └── meeting-notes.md
|
|
368
|
+
└── wiki/ # LLM-generated knowledge base
|
|
369
|
+
├── index.md # Auto-maintained content catalog
|
|
370
|
+
├── log.md # Chronological operation record
|
|
371
|
+
├── sources/ # One summary per ingested source
|
|
372
|
+
├── entities/ # People, organizations, tools
|
|
373
|
+
├── concepts/ # Ideas, frameworks, patterns
|
|
374
|
+
└── syntheses/ # Cross-cutting analyses, query results
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
## Tests
|
|
378
|
+
|
|
379
|
+
```bash
|
|
380
|
+
cd /path/to/llmwiki && pnpm test
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
## Contributing
|
|
384
|
+
|
|
385
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
386
|
+
|
|
387
|
+
## See Also
|
|
388
|
+
|
|
389
|
+
- **[agentgrid](https://github.com/naman10parikh/agentgrid)** — Manage grids of AI coding agents in tmux
|
|
390
|
+
- **[agentdial](https://github.com/naman10parikh/Energy)** — Universal agent identity protocol across 8 messaging channels
|
|
391
|
+
|
|
392
|
+
## Credits
|
|
393
|
+
|
|
394
|
+
Inspired by [Andrej Karpathy's LLM Wiki pattern](https://x.com/karpathy/status/1908625766490001799) — the idea that LLMs should compile knowledge into structured, interlinked wikis rather than just answering questions from raw chunks.
|
|
395
|
+
|
|
396
|
+
## License
|
|
397
|
+
|
|
398
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duplicates.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/duplicates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqChE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
3
|
+
import { getVaultConfig } from '../../core/vault.js';
|
|
4
|
+
import { listDuplicates } from '../../core/ingest.js';
|
|
5
|
+
export function registerDuplicatesCommand(program) {
|
|
6
|
+
program
|
|
7
|
+
.command('duplicates')
|
|
8
|
+
.description('List all files rejected as duplicates during ingestion')
|
|
9
|
+
.option('-v, --vault <path>', 'Vault root directory', '.')
|
|
10
|
+
.option('--json', 'Output as JSON')
|
|
11
|
+
.action((options) => {
|
|
12
|
+
const vaultRoot = resolve(options.vault ?? '.');
|
|
13
|
+
const config = getVaultConfig(vaultRoot);
|
|
14
|
+
const duplicates = listDuplicates(config.rawDir);
|
|
15
|
+
if (duplicates.length === 0) {
|
|
16
|
+
console.log(chalk.dim('No rejected duplicates found.'));
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (options.json) {
|
|
20
|
+
console.log(JSON.stringify(duplicates, null, 2));
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
console.log(chalk.cyan(`\nFound ${duplicates.length} rejected duplicate(s):\n`));
|
|
24
|
+
for (const dup of duplicates) {
|
|
25
|
+
console.log(chalk.white(` ${dup.title}`));
|
|
26
|
+
console.log(chalk.dim(` File: ${dup.file}`));
|
|
27
|
+
console.log(chalk.yellow(` Reason: ${dup.reason}`));
|
|
28
|
+
console.log(chalk.dim(` Similar: ${dup.similarTo}`));
|
|
29
|
+
console.log(chalk.dim(` Score: ${Math.round(dup.score * 100)}%`));
|
|
30
|
+
if (dup.date) {
|
|
31
|
+
console.log(chalk.dim(` Date: ${dup.date}`));
|
|
32
|
+
}
|
|
33
|
+
console.log('');
|
|
34
|
+
}
|
|
35
|
+
console.log(chalk.dim(`Tip: Use ${chalk.white('llmwiki ingest <file> --force')} to override a rejection.\n`));
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=duplicates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duplicates.js","sourceRoot":"","sources":["../../../src/cli/commands/duplicates.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAOtD,MAAM,UAAU,yBAAyB,CAAC,OAAgB;IACxD,OAAO;SACJ,OAAO,CAAC,YAAY,CAAC;SACrB,WAAW,CAAC,wDAAwD,CAAC;SACrE,MAAM,CAAC,oBAAoB,EAAE,sBAAsB,EAAE,GAAG,CAAC;SACzD,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC;SAClC,MAAM,CAAC,CAAC,OAA0B,EAAE,EAAE;QACrC,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC;QAChD,MAAM,MAAM,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;QACzC,MAAM,UAAU,GAAG,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAEjD,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC,CAAC;YACxD,OAAO;QACT,CAAC;QAED,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YACjD,OAAO;QACT,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,KAAK,CAA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sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkE7D"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import ora from 'ora';
|
|
3
|
+
import { resolve } from 'node:path';
|
|
4
|
+
import { existsSync } from 'node:fs';
|
|
5
|
+
import { getVaultConfig } from '../../core/vault.js';
|
|
6
|
+
import { createProvider } from '../../providers/index.js';
|
|
7
|
+
import { loadConfig } from '../../core/config.js';
|
|
8
|
+
import { improveWiki } from '../../core/improve.js';
|
|
9
|
+
export function registerImproveCommand(program) {
|
|
10
|
+
program
|
|
11
|
+
.command('improve')
|
|
12
|
+
.description('Self-improve the wiki using LLM Council review (Automation 3)')
|
|
13
|
+
.option('-v, --vault <path>', 'Vault root directory', '.')
|
|
14
|
+
.option('-p, --provider <provider>', 'LLM provider')
|
|
15
|
+
.option('--threshold <score>', 'Quality threshold (0-100, default 80)', '80')
|
|
16
|
+
.option('--dry-run', 'Show what would be changed without modifying')
|
|
17
|
+
.action(async (options) => {
|
|
18
|
+
const vaultRoot = resolve(options.vault ?? '.');
|
|
19
|
+
const config = getVaultConfig(vaultRoot);
|
|
20
|
+
const userConfig = loadConfig(config.configPath);
|
|
21
|
+
if (!existsSync(config.schemaPath)) {
|
|
22
|
+
console.error(chalk.red('Not a llmwiki vault. Run `llmwiki init` first.'));
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
const providerName = options.provider ?? userConfig.provider ?? 'claude';
|
|
26
|
+
const provider = createProvider(providerName);
|
|
27
|
+
const threshold = parseInt(options.threshold ?? '80', 10);
|
|
28
|
+
const spinner = ora('Evaluating wiki quality...').start();
|
|
29
|
+
try {
|
|
30
|
+
const result = await improveWiki(config, provider, {
|
|
31
|
+
threshold,
|
|
32
|
+
dryRun: options.dryRun ?? false,
|
|
33
|
+
});
|
|
34
|
+
spinner.stop();
|
|
35
|
+
console.log();
|
|
36
|
+
console.log(chalk.bold(`Wiki Quality Score: ${result.score}/100`));
|
|
37
|
+
console.log();
|
|
38
|
+
// Show dimension scores
|
|
39
|
+
for (const [dim, score] of Object.entries(result.dimensions)) {
|
|
40
|
+
const color = score >= 80 ? chalk.green : score >= 60 ? chalk.yellow : chalk.red;
|
|
41
|
+
console.log(` ${dim}: ${color(String(score))}/100`);
|
|
42
|
+
}
|
|
43
|
+
console.log();
|
|
44
|
+
if (result.score >= threshold) {
|
|
45
|
+
console.log(chalk.green(`Score ${result.score} >= threshold ${threshold}. Wiki is healthy!`));
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
console.log(chalk.yellow(`Score ${result.score} < threshold ${threshold}. Improvements needed.`));
|
|
49
|
+
console.log();
|
|
50
|
+
if (options.dryRun) {
|
|
51
|
+
console.log(chalk.dim('Dry run — showing proposed changes:'));
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
console.log(chalk.blue('Applying improvements:'));
|
|
55
|
+
}
|
|
56
|
+
for (const action of result.actions) {
|
|
57
|
+
const prefix = options.dryRun ? chalk.dim('[dry-run]') : chalk.green('[applied]');
|
|
58
|
+
console.log(` ${prefix} ${action.type}: ${action.description}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
spinner.fail(chalk.red('Improvement cycle failed'));
|
|
64
|
+
console.error(chalk.red(error instanceof Error ? error.message : String(error)));
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=improve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"improve.js","sourceRoot":"","sources":["../../../src/cli/commands/improve.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,SAA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