stellavault 0.3.0 → 0.4.1

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.
Files changed (55) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/README.md +109 -119
  3. package/package.json +2 -2
  4. package/packages/cli/dist/commands/ask-cmd.d.ts +4 -0
  5. package/packages/cli/dist/commands/ask-cmd.js +35 -0
  6. package/packages/cli/dist/commands/autopilot-cmd.d.ts +4 -0
  7. package/packages/cli/dist/commands/autopilot-cmd.js +76 -0
  8. package/packages/cli/dist/commands/compile-cmd.d.ts +6 -0
  9. package/packages/cli/dist/commands/compile-cmd.js +30 -0
  10. package/packages/cli/dist/commands/digest-cmd.d.ts +1 -0
  11. package/packages/cli/dist/commands/digest-cmd.js +57 -0
  12. package/packages/cli/dist/commands/draft-cmd.d.ts +5 -0
  13. package/packages/cli/dist/commands/draft-cmd.js +99 -0
  14. package/packages/cli/dist/commands/fleeting-cmd.d.ts +4 -0
  15. package/packages/cli/dist/commands/fleeting-cmd.js +45 -0
  16. package/packages/cli/dist/commands/graph-cmd.js +13 -1
  17. package/packages/cli/dist/commands/ingest-cmd.d.ts +9 -0
  18. package/packages/cli/dist/commands/ingest-cmd.js +161 -0
  19. package/packages/cli/dist/commands/init-cmd.js +39 -1
  20. package/packages/cli/dist/commands/lint-cmd.d.ts +2 -0
  21. package/packages/cli/dist/commands/lint-cmd.js +61 -0
  22. package/packages/cli/dist/index.js +53 -1
  23. package/packages/cli/package.json +1 -1
  24. package/packages/core/dist/api/server.js +393 -0
  25. package/packages/core/dist/config.d.ts +8 -0
  26. package/packages/core/dist/config.js +9 -1
  27. package/packages/core/dist/i18n/note-strings.d.ts +5 -0
  28. package/packages/core/dist/i18n/note-strings.js +94 -0
  29. package/packages/core/dist/index.d.ts +11 -2
  30. package/packages/core/dist/index.js +6 -1
  31. package/packages/core/dist/intelligence/ask-engine.d.ts +23 -0
  32. package/packages/core/dist/intelligence/ask-engine.js +108 -0
  33. package/packages/core/dist/intelligence/draft-generator.d.ts +19 -0
  34. package/packages/core/dist/intelligence/draft-generator.js +161 -0
  35. package/packages/core/dist/intelligence/file-extractors.d.ts +18 -0
  36. package/packages/core/dist/intelligence/file-extractors.js +127 -0
  37. package/packages/core/dist/intelligence/ingest-pipeline.d.ts +32 -0
  38. package/packages/core/dist/intelligence/ingest-pipeline.js +209 -0
  39. package/packages/core/dist/intelligence/knowledge-lint.d.ts +27 -0
  40. package/packages/core/dist/intelligence/knowledge-lint.js +132 -0
  41. package/packages/core/dist/intelligence/wiki-compiler.d.ts +30 -0
  42. package/packages/core/dist/intelligence/wiki-compiler.js +222 -0
  43. package/packages/core/dist/intelligence/youtube-extractor.d.ts +29 -0
  44. package/packages/core/dist/intelligence/youtube-extractor.js +311 -0
  45. package/packages/core/dist/intelligence/zettelkasten.d.ts +59 -0
  46. package/packages/core/dist/intelligence/zettelkasten.js +234 -0
  47. package/packages/core/dist/mcp/server.d.ts +2 -0
  48. package/packages/core/dist/mcp/server.js +24 -1
  49. package/packages/core/dist/mcp/tools/agentic-graph.d.ts +6 -0
  50. package/packages/core/dist/mcp/tools/agentic-graph.js +35 -7
  51. package/packages/core/dist/mcp/tools/ask.d.ts +29 -0
  52. package/packages/core/dist/mcp/tools/ask.js +40 -0
  53. package/packages/core/dist/mcp/tools/generate-draft.d.ts +34 -0
  54. package/packages/core/dist/mcp/tools/generate-draft.js +120 -0
  55. package/packages/core/package.json +21 -2
package/CHANGELOG.md ADDED
@@ -0,0 +1,84 @@
1
+ # Changelog
2
+
3
+ ## [0.4.1] - 2026-04-07
4
+
5
+ ### Features
6
+ - **Binary File Ingest** — PDF (unpdf), DOCX (mammoth), PPTX (officeparser), XLSX (SheetJS) text extraction
7
+ - **Auto Pipeline** — `ingest` now auto-runs `compile` → wiki generated automatically
8
+ - **Web File Upload** — Drag & drop files in browser (POST /api/ingest/file, 50MB limit)
9
+ - **Mobile/PWA** — Responsive IngestPanel, service worker registration, installable as app
10
+ - **Express: stellavault draft** — Generate blog/report/outline from vault knowledge
11
+ - **MCP generate-draft** — 20th MCP tool: Claude writes drafts using vault context (free in Claude Code)
12
+ - **CLI --ai flag** — `stellavault draft --ai` uses Claude API for full AI-generated drafts
13
+ - **Configurable folders** — Override raw/_wiki/_literature/ in .stellavault.json
14
+ - **Multilingual embeddings** — paraphrase-multilingual-MiniLM-L12-v2 (50+ languages)
15
+
16
+ ### Changes
17
+ - Binary files default to fleeting stage (Zettelkasten principle: all inputs start as fleeting)
18
+ - Repositioned as "Self-compiling knowledge MCP server"
19
+ - .npmignore excludes PDF (was 16MB in npm package)
20
+ - MCP tools: 19 → 20
21
+
22
+ ### Fixes
23
+ - CLI YouTube ingest now properly calls extractYouTubeContent
24
+ - officeparser type cast fix (OfficeParserAST → string)
25
+ - unpdf text array handling (pages returned as array, not string)
26
+
27
+ ## [0.4.0] - 2026-04-06
28
+
29
+ ### Features
30
+ - **i18n Global Service** — Full EN/KO/JA/ZH language switcher for web UI; saved notes follow user's language setting
31
+ - **Web UI Ingest Panel** — Add knowledge from browser (+) button, no terminal needed
32
+ - **YouTube Deep Extraction** — Full description, transcript with clickable timestamps, auto-summary, metadata (channel, views, duration)
33
+ - **YouTube Transcript via yt-dlp** — Fallback to yt-dlp when YouTube bot protection blocks direct caption fetch
34
+ - **Edit/Delete Notes from Web** — Edit and delete notes directly from web UI, syncs to Obsidian vault
35
+ - **Ask Q&A Web UI** — Intelligence > Ask tab for querying your knowledge base from the browser
36
+ - **Reindex from Web** — One-click reindex button, no terminal needed
37
+ - **Recent Saves Navigation** — Click recent saves to navigate to node in 3D graph
38
+ - **Auto-index after Ingest** — New notes are automatically indexed and graph refreshes
39
+ - **Onboarding Guide** — 4-step walkthrough for new users
40
+ - **LLM Knowledge Base** — `stellavault ask` (Q&A + auto-filing), `compile` (raw→wiki), `lint` (health check), `digest --visual` (Mermaid charts)
41
+ - **Zettelkasten System** — Luhmann-style index codes, frontmatter scan, inbox zero, atomicity verification, orphan/broken link detection
42
+ - **Unified Ingest Pipeline** — URL/file/text auto-classification, `stellavault ingest`, `promote`, `autopilot` flywheel
43
+ - **Fleeting Capture** — `stellavault fleeting` for quick thoughts
44
+
45
+ ### Fixes
46
+ - YouTube extractor v2 — HTML entities, tags cleanup, summary quality, duplicate frontmatter removal
47
+ - YouTube full description extraction (shortDescription JSON parsing)
48
+ - CLI YouTube ingest now properly calls extractYouTubeContent instead of basic HTML scrape
49
+ - Strict node matching — exact title/path only, no partial match
50
+ - React hooks order in Layout, ConstellationView, MultiverseView
51
+ - Natural Korean translations (감쇠→잊고 있는 것, 갭→빠진 지식)
52
+ - Reindex API — pass vaultPath, use all-MiniLM-L6-v2, error details
53
+
54
+ ### Security
55
+ - Path traversal protection (archiveFile, ingest)
56
+ - YAML injection prevention (sanitizeYaml)
57
+ - SSRF protection (private IP blocking)
58
+ - Empty catch blocks → proper error logging
59
+
60
+ ### Infrastructure
61
+ - MCP: 19 tools | CLI: 36+ commands | Tests: 127 ALL PASS
62
+ - Hardcoded Korean removed — core modules default to English
63
+ - Subpath exports for youtube-extractor module
64
+
65
+ ## [0.3.0] - 2026-04-04
66
+
67
+ ### Features
68
+ - 3D Knowledge Graph with Three.js / React Three Fiber
69
+ - Hybrid search (vector + keyword + RRF)
70
+ - Memory decay tracking (FSRS algorithm)
71
+ - MCP server with 16 tools
72
+ - Notion ↔ Obsidian sync (packages/sync)
73
+ - Web UI with constellation/multiverse views
74
+
75
+ ## [0.2.0] - 2026-04-03
76
+
77
+ - Initial Obsidian vault indexer
78
+ - Vector store with all-MiniLM-L6-v2
79
+ - Basic CLI commands
80
+
81
+ ## [0.1.0] - 2026-04-02
82
+
83
+ - Project inception
84
+ - Notion-Obsidian sync tool
package/README.md CHANGED
@@ -1,149 +1,152 @@
1
1
  # Stellavault
2
2
 
3
- > **Notes die in folders. Stellavault keeps your knowledge alive.**
3
+ > **Self-compiling knowledge MCP server** ingest anything, auto-organize into Zettelkasten wiki, and let Claude access your entire knowledge base.
4
4
 
5
- Your Obsidian vault is more than files. It's a living network connections emerge, memories fade, gaps appear. Stellavault turns it into a knowledge system that **discovers hidden connections**, **detects fading memories**, **finds blind spots**, and **gives AI agents direct access to everything you know**.
5
+ Drop a PDF, paste a YouTube link, type a thought — Stellavault compiles it into structured knowledge, connects the dots, and gives your AI agent full access through 20 MCP tools.
6
6
 
7
- ## 30-Second Setup
7
+ <p align="center">
8
+ <img src="images/screenshots/graph-dark-full.png" alt="3D Knowledge Graph" width="800" />
9
+ <br><em>Your vault as a neural network. Clusters form constellations.</em>
10
+ </p>
8
11
 
9
- ```bash
10
- # Install globally
11
- npm install -g stellavault
12
+ ## Two Core Ideas
12
13
 
13
- # Interactive setup wizard
14
- stellavault init
15
-
16
- # Or manually: index your vault + launch 3D graph
17
- stellavault index /path/to/obsidian/vault
18
- stellavault graph
14
+ **1. "Drop it and forget it"** (Karpathy's Self-Compiling Knowledge)
15
+ ```
16
+ Any input → auto-classify → raw/ → compile → wiki → connected knowledge
19
17
  ```
18
+ PDF, DOCX, YouTube, URL, text — everything goes through the same pipeline. You never manually organize.
20
19
 
21
- That's it. Open `http://localhost:5173` to see your knowledge come alive in 3D.
20
+ **2. "Claude knows what you know"** (MCP Integration)
21
+ ```bash
22
+ claude mcp add stellavault -- stellavault serve
23
+ ```
24
+ 20 MCP tools give Claude direct access to search, ask, draft, and navigate your entire knowledge base.
22
25
 
23
- ## Give Your AI Agent Memory
26
+ ## 5-Minute Setup
24
27
 
25
28
  ```bash
26
- claude mcp add stellavault -- stellavault serve
29
+ npm install -g stellavault
30
+ stellavault init # Interactive setup + vault indexing
31
+ stellavault graph # Launch 3D graph + API server
27
32
  ```
28
33
 
29
- Now Claude Code can search your notes, track your decisions, tell you what's fading, and give you a daily knowledge briefing — using 17+ MCP tools.
34
+ > **Prerequisites**: Node.js 20+
30
35
 
31
- ## What It Does
36
+ ## The Pipeline
32
37
 
33
- **Understands** — Vectorizes every note locally (no API keys needed). Hybrid search combines BM25 + cosine similarity + RRF fusion.
38
+ ```
39
+ Capture ──→ Organize ──→ Distill ──→ Express
34
40
 
35
- **Remembers** — FSRS spaced repetition tracks what you're forgetting. `stellavault decay` shows what's fading. `stellavault review` runs a review session.
41
+ stellavault ingest <anything> # PDF, DOCX, URL, YouTube, text
42
+ → auto-extract text # unpdf, mammoth, yt-dlp
43
+ → raw/ (fleeting) # Zettelkasten inbox
44
+ → compile → _wiki/ # Auto: concepts + backlinks
45
+ → stellavault draft "topic" # Blog, report, or outline
46
+ ```
36
47
 
37
- **Discovers** Gap detector finds missing connections. Duplicate finder catches redundancy. Contradiction detector spots conflicting statements. Learning path tells you what to study next.
48
+ ### Ingest Anything
38
49
 
39
- **Visualizes** Interactive 3D neural graph with constellation view, timeline slider, type filters, health dashboard, and keyboard navigation.
50
+ | Input | How |
51
+ |-------|-----|
52
+ | PDF, DOCX, PPTX, XLSX | `stellavault ingest report.pdf` — auto text extraction |
53
+ | YouTube | `stellavault ingest https://youtu.be/...` — transcript + timestamps |
54
+ | URL | `stellavault ingest https://...` — HTML → clean text |
55
+ | Text | `stellavault ingest "quick thought"` |
56
+ | Web UI | Drag & drop files in browser (mobile too) |
40
57
 
41
- **Connects** Federation protocol links your vault to other Stellavault nodes via P2P. Search across the network without sharing your raw text. Multiverse UI shows your universe alongside connected peers.
58
+ ### Express: Get Knowledge Out
42
59
 
43
- ## Key Features
60
+ ```bash
61
+ stellavault draft "AI" # Rule-based scaffold (free)
62
+ stellavault draft "AI" --ai # Claude API writes full draft ($0.03)
63
+ stellavault draft "AI" --format report # Formal report format
64
+ stellavault draft --format outline # All-knowledge outline
65
+ ```
44
66
 
45
- | Category | Features |
46
- |----------|----------|
47
- | **Search** | Hybrid BM25+Vector+RRF, semantic search, search history |
48
- | **Intelligence** | FSRS decay, gap detection, duplicates, contradictions, predictive gaps, learning paths |
49
- | **Visualization** | 3D graph, constellation view, timeline, type filter, health dashboard, embed widget |
50
- | **AI Integration** | 17+ MCP tools, custom MCP tool builder (YAML), agentic graph construction |
51
- | **Federation** | P2P search, multiverse UI, reputation system, trust scoring, differential privacy |
52
- | **Security** | E2E cloud sync (AES-256-GCM), team auth (RBAC), sharing controls, SSRF/XSS protection |
53
- | **Platform** | Web dashboard, PWA, voice capture (Whisper), Notion sync, multi-vault, i18n (en/ko/ja/zh) |
54
- | **Extensibility** | Plugin SDK, webhook system, Knowledge Pack marketplace |
67
+ Or in Claude Code: *"Write a blog post about machine learning from my notes"* — Claude uses MCP `generate-draft` tool (free, no API key).
55
68
 
56
- ## CLI (28+ commands)
69
+ ## Daily Commands
57
70
 
58
71
  ```bash
59
- # Core
60
- stellavault init # Interactive setup wizard
61
- stellavault index <vault-path> # Vectorize your vault
62
- stellavault search <query> # Semantic search
63
- stellavault graph # Launch 3D graph
64
- stellavault serve # MCP server for AI agents
65
- stellavault status # Index stats
66
-
67
- # Intelligence
68
- stellavault decay # What's fading?
69
- stellavault learn # AI learning path
70
- stellavault brief # Daily knowledge briefing
71
- stellavault digest # Weekly report
72
- stellavault review # FSRS review session
73
- stellavault gaps # Knowledge gap detection
74
- stellavault duplicates # Duplicate detection
75
- stellavault contradictions # Contradiction detection
76
-
77
- # Federation
78
- stellavault federate join # Join P2P network
79
- stellavault federate status # Node identity
80
-
81
- # Multi-Vault
82
- stellavault vault add <id> <path> # Register a vault
83
- stellavault vault search-all <q> # Search across all vaults
84
-
85
- # Cloud
86
- stellavault cloud sync # E2E encrypted backup
87
- stellavault cloud restore # Restore from cloud
88
-
89
- # More
90
- stellavault clip <url> # Web/YouTube clipper
91
- stellavault sync # Notion → Obsidian
92
- stellavault capture <audio> # Voice → knowledge (Whisper)
93
- stellavault card # SVG profile card
94
- stellavault pack <cmd> # Knowledge Pack management
72
+ stellavault ask "What did I learn about X?" # Q&A from vault
73
+ stellavault brief # Morning knowledge briefing
74
+ stellavault decay # What's fading from memory?
75
+ stellavault lint # Health score (0-100)
76
+ stellavault learn # AI learning path
77
+ stellavault digest --visual # Weekly Mermaid chart report
95
78
  ```
96
79
 
97
- Use short alias `sv` for all commands: `sv graph`, `sv decay`, `sv learn`
98
-
99
- ## MCP Tools (17+)
80
+ ## MCP Tools (20)
100
81
 
101
82
  | Tool | What it does |
102
83
  |------|-------------|
103
84
  | `search` | Hybrid search (BM25 + vector + RRF) |
85
+ | `ask` | Q&A with optional vault filing |
86
+ | `generate-draft` | Gather vault context for AI draft writing |
104
87
  | `get-document` | Full document with metadata |
105
88
  | `get-related` | Semantically similar documents |
106
89
  | `list-topics` | Topic cloud |
107
90
  | `get-decay-status` | Memory decay report |
108
91
  | `get-morning-brief` | Daily knowledge briefing |
109
92
  | `get-learning-path` | AI learning recommendations |
110
- | `federated-search` | Search across P2P network |
111
- | `create-knowledge-node` | AI creates notes during conversation |
112
- | `create-knowledge-link` | AI creates links between notes |
113
- | `log-decision` / `find-decisions` | Technical decision journal |
93
+ | `detect-gaps` | Knowledge gap analysis |
94
+ | `get-evolution` | Semantic drift tracking |
95
+ | `link-code` | Code-knowledge connections |
96
+ | `create-knowledge-node` | AI creates wiki-quality notes |
97
+ | `create-knowledge-link` | AI connects existing notes |
98
+ | `log-decision` / `find-decisions` | Decision journal |
114
99
  | `create-snapshot` / `load-snapshot` | Context snapshots |
115
100
  | `generate-claude-md` | Auto-generate CLAUDE.md |
116
101
  | `export` | JSON/CSV export |
117
102
 
118
- ## Federation P2P Knowledge Network
119
-
120
- Each Stellavault is a node. Connect to discover knowledge across the network — without sharing your raw text.
103
+ ## Zettelkasten (Luhmann + Karpathy)
121
104
 
122
105
  ```bash
123
- stellavault federate join --name "my-node"
124
- # Interactive mode:
125
- federation> search kubernetes deployment
126
- # 87% "K8s Rolling Update Guide" [peer-alice]
127
- # Kubernetes에서 무중단 배포를 위해...
128
- federation> peers
129
- # alice (1,209 docs) [trust: 88]
130
- # bob (47 docs) [trust: 72]
106
+ stellavault fleeting "raw idea" # → raw/
107
+ stellavault ingest report.pdf # auto text extract → raw/
108
+ stellavault compile # raw/ → _wiki/ (concepts + backlinks)
109
+ stellavault promote note.md --to permanent # Upgrade stage
110
+ stellavault autopilot # Full cycle: inbox → compile → lint → archive
131
111
  ```
132
112
 
133
- **Privacy**: Only titles + similarity scores + 50-char masked snippets cross the network. Never raw text. Differential privacy noise on embeddings. Sharing controls per tag/folder.
113
+ - **3-stage flow**: fleeting literature permanent
114
+ - **Luhmann index codes**: auto-assigned (1A → 1A1)
115
+ - **Frontmatter-first scanning**: 10x token reduction
116
+ - **Configurable folders**: override raw/_wiki/_literature/ in `.stellavault.json`
134
117
 
135
- **Trust**: Web of Trust + automatic reputation scoring (consistency, consensus, helpfulness).
118
+ ```json
119
+ {
120
+ "vaultPath": "/path/to/vault",
121
+ "folders": {
122
+ "fleeting": "01-Inbox",
123
+ "literature": "02-Reading",
124
+ "permanent": "03-Notes",
125
+ "wiki": "04-Wiki"
126
+ }
127
+ }
128
+ ```
136
129
 
137
- ## Architecture
130
+ ## Intelligence
138
131
 
139
- ```
140
- stellavault/
141
- ├── packages/
142
- │ ├── core/ Search, MCP, API, Intelligence, Federation, Cloud, Team, i18n
143
- │ ├── cli/ 28+ commands
144
- │ ├── graph/ 3D visualization + Multiverse UI (React Three Fiber)
145
- │ └── sync/ Notion Obsidian sync
146
- ```
132
+ | Feature | Command |
133
+ |---------|---------|
134
+ | FSRS Decay | `sv decay` — spaced repetition memory tracking |
135
+ | Gap Detection | `sv gaps` missing connections between topics |
136
+ | Contradictions | `sv contradictions` — conflicting statements |
137
+ | Duplicates | `sv duplicates` redundant notes |
138
+ | Learning Path | `sv learn` — AI review recommendations |
139
+ | Code Linker | MCP `link-code` — connect code to knowledge |
140
+
141
+ ## 3D Visualization
142
+
143
+ - Neural graph with cluster coloring
144
+ - Constellation view (MST star patterns)
145
+ - Heatmap overlay (activity score)
146
+ - Timeline slider (creation/modification filter)
147
+ - Decay overlay (fading knowledge)
148
+ - Dark/Light theme
149
+ - Mobile responsive + PWA installable
147
150
 
148
151
  ## Tech Stack
149
152
 
@@ -151,25 +154,12 @@ stellavault/
151
154
  |-------|------|
152
155
  | Runtime | Node.js 20+ (ESM, TypeScript) |
153
156
  | Vector Store | SQLite-vec (local, no server) |
154
- | Embedding | all-MiniLM-L6-v2 (local, no API key) |
157
+ | Embedding | paraphrase-multilingual-MiniLM-L12-v2 (local, 50+ languages) |
155
158
  | Search | BM25 + Cosine + RRF Fusion |
156
- | 3D | React Three Fiber + Three.js + Zustand |
159
+ | File Parsing | unpdf, mammoth, officeparser, SheetJS |
157
160
  | Memory | FSRS (Free Spaced Repetition Scheduler) |
158
- | P2P | Hyperswarm (NAT traversal + DHT) |
159
- | AI | MCP (Model Context Protocol) |
160
- | Security | AES-256-GCM, HMAC-SHA256, Differential Privacy |
161
-
162
- ## Configuration
163
-
164
- ```json
165
- {
166
- "vaultPath": "/path/to/obsidian/vault",
167
- "dbPath": "~/.stellavault/index.db",
168
- "embedding": { "model": "local", "localModel": "all-MiniLM-L6-v2" },
169
- "search": { "defaultLimit": 10, "rrfK": 60 },
170
- "mcp": { "mode": "stdio", "port": 3333 }
171
- }
172
- ```
161
+ | 3D | React Three Fiber + Three.js |
162
+ | AI | MCP (Model Context Protocol) + Anthropic SDK |
173
163
 
174
164
  ## License
175
165
 
@@ -177,6 +167,6 @@ MIT
177
167
 
178
168
  ## Links
179
169
 
180
- - [Wiki: Vault Structure Guide](docs/wiki/vault-structure.md)
181
- - [Wiki: Notion Setup](docs/wiki/notion-setup.md)
182
- - [Wiki: Federation Guide](docs/wiki/federation-guide.md)
170
+ - [Obsidian Plugin](https://github.com/Evanciel/stellavault-obsidian)
171
+ - [npm](https://www.npmjs.com/package/stellavault)
172
+ - [GitHub Releases](https://github.com/Evanciel/stellavault/releases)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "stellavault",
3
- "version": "0.3.0",
4
- "description": "Turn your Obsidian vault into a 3D neural knowledge graph with AI-powered search, memory decay tracking, and MCP integration.",
3
+ "version": "0.4.1",
4
+ "description": "Self-compiling knowledge MCP server ingest anything, auto-organize into Zettelkasten wiki, search with AI, and let Claude access your entire knowledge base.",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/Evanciel/stellavault"
@@ -0,0 +1,4 @@
1
+ export declare function askCommand(question: string, options: {
2
+ save?: boolean;
3
+ }): Promise<void>;
4
+ //# sourceMappingURL=ask-cmd.d.ts.map
@@ -0,0 +1,35 @@
1
+ // stellavault ask — Q&A + auto-filing CLI command
2
+ import chalk from 'chalk';
3
+ import { loadConfig, createKnowledgeHub, askVault } from '@stellavault/core';
4
+ export async function askCommand(question, options) {
5
+ if (!question || question.trim().length < 2) {
6
+ console.error(chalk.yellow('Usage: stellavault ask "your question here" [--save]'));
7
+ console.error(chalk.dim('\nSearch Mode: finds relevant notes from your vault.'));
8
+ console.error(chalk.dim('For AI-powered answers, use MCP: claude mcp add stellavault -- stellavault serve'));
9
+ process.exit(1);
10
+ }
11
+ const config = loadConfig();
12
+ const hub = createKnowledgeHub(config);
13
+ console.error(chalk.dim('Searching your knowledge (local search mode)...'));
14
+ await hub.store.initialize();
15
+ await hub.embedder.initialize();
16
+ const result = await askVault(hub.searchEngine, question, {
17
+ limit: 10,
18
+ save: options.save ?? false,
19
+ vaultPath: config.vaultPath,
20
+ });
21
+ // 출력
22
+ console.log('');
23
+ console.log(result.answer);
24
+ if (result.savedTo) {
25
+ console.log('');
26
+ console.log(chalk.green(`Saved to: ${result.savedTo}`));
27
+ }
28
+ if (result.sources.length > 0 && !options.save) {
29
+ console.log('');
30
+ console.log(chalk.dim('Tip: Add --save to file this answer into your vault.'));
31
+ console.log(chalk.dim('For AI-generated answers: use Claude Code with MCP integration.'));
32
+ }
33
+ await hub.store.close?.();
34
+ }
35
+ //# sourceMappingURL=ask-cmd.js.map
@@ -0,0 +1,4 @@
1
+ export declare function autopilotCommand(options: {
2
+ once?: boolean;
3
+ }): Promise<void>;
4
+ //# sourceMappingURL=autopilot-cmd.d.ts.map
@@ -0,0 +1,76 @@
1
+ // stellavault autopilot — 자율형 지식 플라이휠
2
+ // ingest(inbox) → compile → lint → index → 반복
3
+ import chalk from 'chalk';
4
+ import { loadConfig, createKnowledgeHub, compileWiki, lintKnowledge, getInboxItems, archiveFile } from '@stellavault/core';
5
+ import { resolve } from 'node:path';
6
+ export async function autopilotCommand(options) {
7
+ const config = loadConfig();
8
+ const vaultPath = config.vaultPath;
9
+ console.log(chalk.bold('\n ✦ Stellavault Autopilot'));
10
+ console.log(chalk.dim(' Knowledge flywheel: inbox → compile → lint → repeat\n'));
11
+ // Step 1: Inbox 확인
12
+ console.log(chalk.cyan('Step 1/4: Checking inbox...'));
13
+ const inbox = getInboxItems(vaultPath);
14
+ if (inbox.length === 0) {
15
+ console.log(chalk.dim(' No new items in raw/ folder.'));
16
+ }
17
+ else {
18
+ console.log(chalk.green(` ${inbox.length} new items found.`));
19
+ for (const item of inbox.slice(0, 5)) {
20
+ console.log(chalk.dim(` - ${item.title} (${item.wordCount} words)`));
21
+ }
22
+ if (inbox.length > 5)
23
+ console.log(chalk.dim(` ... and ${inbox.length - 5} more`));
24
+ }
25
+ // Step 2: Compile
26
+ console.log(chalk.cyan('\nStep 2/4: Compiling wiki...'));
27
+ const rawPath = resolve(vaultPath, 'raw');
28
+ const wikiPath = resolve(vaultPath, '_wiki');
29
+ const compileResult = compileWiki(rawPath, wikiPath);
30
+ if (compileResult.rawDocCount > 0) {
31
+ console.log(chalk.green(` Compiled ${compileResult.rawDocCount} raw → ${compileResult.wikiArticles.length} wiki articles`));
32
+ console.log(chalk.dim(` Concepts: ${compileResult.concepts.length}`));
33
+ // Archive processed raw files
34
+ for (const item of inbox) {
35
+ try {
36
+ archiveFile(resolve(vaultPath, 'raw', item.filePath));
37
+ }
38
+ catch { /* skip */ }
39
+ }
40
+ console.log(chalk.dim(` Archived ${inbox.length} processed items.`));
41
+ }
42
+ else {
43
+ console.log(chalk.dim(' No raw documents to compile.'));
44
+ }
45
+ // Step 3: Lint
46
+ console.log(chalk.cyan('\nStep 3/4: Running health check...'));
47
+ const hub = createKnowledgeHub(config);
48
+ await hub.store.initialize();
49
+ const lintResult = await lintKnowledge(hub.store);
50
+ const scoreColor = lintResult.score >= 80 ? chalk.green : lintResult.score >= 50 ? chalk.yellow : chalk.red;
51
+ console.log(` Health: ${scoreColor(lintResult.score + '/100')}`);
52
+ const critical = lintResult.issues.filter(i => i.severity === 'critical').length;
53
+ const warnings = lintResult.issues.filter(i => i.severity === 'warning').length;
54
+ if (critical > 0)
55
+ console.log(chalk.red(` Critical: ${critical}`));
56
+ if (warnings > 0)
57
+ console.log(chalk.yellow(` Warnings: ${warnings}`));
58
+ // Step 4: Summary
59
+ console.log(chalk.cyan('\nStep 4/4: Summary'));
60
+ console.log(chalk.dim('─'.repeat(40)));
61
+ console.log(` Inbox processed: ${inbox.length}`);
62
+ console.log(` Wiki articles: ${compileResult.wikiArticles.length}`);
63
+ console.log(` Health score: ${lintResult.score}/100`);
64
+ console.log(` Issues: ${lintResult.issues.length}`);
65
+ if (lintResult.suggestions.length > 0) {
66
+ console.log(chalk.cyan('\n Suggestions:'));
67
+ for (const s of lintResult.suggestions.slice(0, 3)) {
68
+ console.log(chalk.dim(` → ${s}`));
69
+ }
70
+ }
71
+ console.log(chalk.dim('\n─'.repeat(40)));
72
+ console.log(chalk.dim('\n Next: run `stellavault index` to update search vectors.'));
73
+ console.log(chalk.green(' Autopilot complete.\n'));
74
+ await hub.store.close?.();
75
+ }
76
+ //# sourceMappingURL=autopilot-cmd.js.map
@@ -0,0 +1,6 @@
1
+ export declare function compileCommand(options: {
2
+ raw?: string;
3
+ wiki?: string;
4
+ force?: boolean;
5
+ }): Promise<void>;
6
+ //# sourceMappingURL=compile-cmd.d.ts.map
@@ -0,0 +1,30 @@
1
+ // stellavault compile — raw → wiki 컴파일 CLI
2
+ import chalk from 'chalk';
3
+ import { loadConfig, compileWiki } from '@stellavault/core';
4
+ import { resolve } from 'node:path';
5
+ export async function compileCommand(options) {
6
+ const config = loadConfig();
7
+ const vaultPath = config.vaultPath;
8
+ const rawPath = resolve(vaultPath, options.raw ?? 'raw');
9
+ const wikiPath = resolve(vaultPath, options.wiki ?? '_wiki');
10
+ console.error(chalk.dim(`Raw: ${rawPath}`));
11
+ console.error(chalk.dim(`Wiki: ${wikiPath}`));
12
+ console.error('');
13
+ const result = compileWiki(rawPath, wikiPath, { force: options.force });
14
+ if (result.rawDocCount === 0) {
15
+ console.error(chalk.yellow(`No documents found in ${rawPath}`));
16
+ console.error(chalk.dim('Create a raw/ folder in your vault and add .md/.txt files.'));
17
+ return;
18
+ }
19
+ console.log(chalk.green(`Compiled ${result.rawDocCount} raw docs → ${result.wikiArticles.length} wiki articles`));
20
+ console.log(chalk.dim(`Concepts: ${result.concepts.length}`));
21
+ console.log(chalk.dim(`Index: ${result.indexFile}`));
22
+ if (result.concepts.length > 0) {
23
+ console.log('');
24
+ console.log(chalk.cyan('Top concepts:'));
25
+ for (const c of result.concepts.slice(0, 10)) {
26
+ console.log(` ${c}`);
27
+ }
28
+ }
29
+ }
30
+ //# sourceMappingURL=compile-cmd.js.map
@@ -1,4 +1,5 @@
1
1
  export declare function digestCommand(options: {
2
2
  days?: string;
3
+ visual?: boolean;
3
4
  }): Promise<void>;
4
5
  //# sourceMappingURL=digest-cmd.d.ts.map
@@ -75,5 +75,62 @@ export async function digestCommand(options) {
75
75
  const report = await decayEngine.computeAll();
76
76
  console.log(`\n🧠 건강도: R=${report.averageR} | 감쇠 ${report.decayingCount}개 | 위험 ${report.criticalCount}개`);
77
77
  console.log(chalk.dim('\n═'.repeat(50)));
78
+ // --visual: Mermaid 다이어그램 + 요약을 .md로 저장
79
+ if (options.visual) {
80
+ const { writeFileSync, mkdirSync, existsSync } = await import('node:fs');
81
+ const { join, resolve } = await import('node:path');
82
+ const outputDir = resolve(config.vaultPath, '_stellavault/digests');
83
+ if (!existsSync(outputDir))
84
+ mkdirSync(outputDir, { recursive: true });
85
+ const date = new Date().toISOString().split('T')[0];
86
+ const filename = `digest-${date}.md`;
87
+ const outputPath = join(outputDir, filename);
88
+ // Mermaid 파이 차트
89
+ const pieData = (typeStats.length > 0 ? typeStats : [{ type: 'note', cnt: 1 }])
90
+ .map((t) => ` "${t.type}" : ${t.cnt}`)
91
+ .join('\n');
92
+ // Mermaid 타임라인
93
+ const timelineData = dailyActivity
94
+ .map((d) => ` ${d.day.slice(5)} : ${d.cnt}`)
95
+ .join('\n');
96
+ const md = [
97
+ '---',
98
+ `title: "Weekly Digest — ${date}"`,
99
+ 'type: digest',
100
+ `date: ${new Date().toISOString()}`,
101
+ 'source: stellavault-digest',
102
+ '---',
103
+ '',
104
+ `# Weekly Knowledge Digest — ${date}`,
105
+ '',
106
+ `## Summary`,
107
+ `- Total access: **${totalAccess}** in ${days} days`,
108
+ `- Average R: **${report.averageR.toFixed(2)}**`,
109
+ `- Decaying: ${report.decayingCount} | Critical: ${report.criticalCount}`,
110
+ '',
111
+ '## Activity by Type',
112
+ '```mermaid',
113
+ 'pie title Note Types Accessed',
114
+ pieData,
115
+ '```',
116
+ '',
117
+ '## Daily Activity',
118
+ '```mermaid',
119
+ 'xychart-beta',
120
+ ` title "Daily Activity (${days} days)"`,
121
+ ' x-axis [' + dailyActivity.map((d) => `"${d.day.slice(5)}"`).join(', ') + ']',
122
+ ' y-axis "Access Count"',
123
+ ' bar [' + dailyActivity.map((d) => d.cnt).join(', ') + ']',
124
+ '```',
125
+ '',
126
+ topDocs.length > 0 ? '## Most Accessed Notes\n' + topDocs.map((d) => `1. **${d.title}** — ${d.cnt} times`).join('\n') : '',
127
+ '',
128
+ '---',
129
+ `*Generated by \`stellavault digest --visual\` on ${new Date().toISOString()}*`,
130
+ ].filter(Boolean).join('\n');
131
+ writeFileSync(outputPath, md, 'utf-8');
132
+ console.log(chalk.green(`\nVisual digest saved: ${filename}`));
133
+ console.log(chalk.dim(`Open in Obsidian to see Mermaid charts.`));
134
+ }
78
135
  }
79
136
  //# sourceMappingURL=digest-cmd.js.map
@@ -0,0 +1,5 @@
1
+ export declare function draftCommand(topic: string | undefined, options: {
2
+ format?: string;
3
+ ai?: boolean;
4
+ }): Promise<void>;
5
+ //# sourceMappingURL=draft-cmd.d.ts.map