mindlore 0.2.1 → 0.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.
Files changed (102) hide show
  1. package/README.md +8 -8
  2. package/SCHEMA.md +15 -2
  3. package/dist/scripts/init.d.ts +1 -1
  4. package/dist/scripts/init.js +98 -67
  5. package/dist/scripts/init.js.map +1 -1
  6. package/dist/scripts/lib/constants.d.ts +27 -0
  7. package/dist/scripts/lib/constants.d.ts.map +1 -1
  8. package/dist/scripts/lib/constants.js +74 -1
  9. package/dist/scripts/lib/constants.js.map +1 -1
  10. package/dist/scripts/lib/schemas.d.ts +93 -0
  11. package/dist/scripts/lib/schemas.d.ts.map +1 -0
  12. package/dist/scripts/lib/schemas.js +108 -0
  13. package/dist/scripts/lib/schemas.js.map +1 -0
  14. package/dist/scripts/mindlore-fts5-index.js +3 -4
  15. package/dist/scripts/mindlore-fts5-index.js.map +1 -1
  16. package/dist/scripts/mindlore-fts5-search.d.ts +1 -1
  17. package/dist/scripts/mindlore-fts5-search.js +87 -74
  18. package/dist/scripts/mindlore-fts5-search.js.map +1 -1
  19. package/dist/scripts/uninstall.d.ts +1 -1
  20. package/dist/scripts/uninstall.js +27 -17
  21. package/dist/scripts/uninstall.js.map +1 -1
  22. package/dist/tests/compounding.test.js +2 -2
  23. package/dist/tests/compounding.test.js.map +1 -1
  24. package/dist/tests/cwd-changed.test.d.ts +2 -0
  25. package/dist/tests/cwd-changed.test.d.ts.map +1 -0
  26. package/dist/tests/cwd-changed.test.js +62 -0
  27. package/dist/tests/cwd-changed.test.js.map +1 -0
  28. package/dist/tests/dedup.test.js +4 -4
  29. package/dist/tests/dedup.test.js.map +1 -1
  30. package/dist/tests/dont-repeat.test.d.ts +2 -0
  31. package/dist/tests/dont-repeat.test.d.ts.map +1 -0
  32. package/dist/tests/dont-repeat.test.js +100 -0
  33. package/dist/tests/dont-repeat.test.js.map +1 -0
  34. package/dist/tests/e2e-pipeline.test.d.ts +2 -0
  35. package/dist/tests/e2e-pipeline.test.d.ts.map +1 -0
  36. package/dist/tests/e2e-pipeline.test.js +220 -0
  37. package/dist/tests/e2e-pipeline.test.js.map +1 -0
  38. package/dist/tests/evolve.test.d.ts +2 -0
  39. package/dist/tests/evolve.test.d.ts.map +1 -0
  40. package/dist/tests/evolve.test.js +105 -0
  41. package/dist/tests/evolve.test.js.map +1 -0
  42. package/dist/tests/explore.test.d.ts +2 -0
  43. package/dist/tests/explore.test.d.ts.map +1 -0
  44. package/dist/tests/explore.test.js +146 -0
  45. package/dist/tests/explore.test.js.map +1 -0
  46. package/dist/tests/fts5.test.js +7 -7
  47. package/dist/tests/fts5.test.js.map +1 -1
  48. package/dist/tests/global-layer.test.d.ts +2 -0
  49. package/dist/tests/global-layer.test.d.ts.map +1 -0
  50. package/dist/tests/global-layer.test.js +152 -0
  51. package/dist/tests/global-layer.test.js.map +1 -0
  52. package/dist/tests/helpers/db.d.ts +14 -1
  53. package/dist/tests/helpers/db.d.ts.map +1 -1
  54. package/dist/tests/helpers/db.js +3 -3
  55. package/dist/tests/helpers/db.js.map +1 -1
  56. package/dist/tests/hook-smoke.test.js +2 -2
  57. package/dist/tests/hook-smoke.test.js.map +1 -1
  58. package/dist/tests/init.test.js +24 -0
  59. package/dist/tests/init.test.js.map +1 -1
  60. package/dist/tests/post-read.test.d.ts +2 -0
  61. package/dist/tests/post-read.test.d.ts.map +1 -0
  62. package/dist/tests/post-read.test.js +69 -0
  63. package/dist/tests/post-read.test.js.map +1 -0
  64. package/dist/tests/quality-populate.test.d.ts +2 -0
  65. package/dist/tests/quality-populate.test.d.ts.map +1 -0
  66. package/dist/tests/quality-populate.test.js +85 -0
  67. package/dist/tests/quality-populate.test.js.map +1 -0
  68. package/dist/tests/reflect.test.d.ts +2 -0
  69. package/dist/tests/reflect.test.d.ts.map +1 -0
  70. package/dist/tests/reflect.test.js +122 -0
  71. package/dist/tests/reflect.test.js.map +1 -0
  72. package/dist/tests/schemas.test.d.ts +2 -0
  73. package/dist/tests/schemas.test.d.ts.map +1 -0
  74. package/dist/tests/schemas.test.js +87 -0
  75. package/dist/tests/schemas.test.js.map +1 -0
  76. package/dist/tests/search-hook.test.js +3 -3
  77. package/dist/tests/search-hook.test.js.map +1 -1
  78. package/dist/tests/upgrade.test.d.ts +2 -0
  79. package/dist/tests/upgrade.test.d.ts.map +1 -0
  80. package/dist/tests/upgrade.test.js +91 -0
  81. package/dist/tests/upgrade.test.js.map +1 -0
  82. package/hooks/lib/mindlore-common.cjs +66 -5
  83. package/hooks/lib/types.d.ts +56 -0
  84. package/hooks/mindlore-cwd-changed.cjs +57 -0
  85. package/hooks/mindlore-dont-repeat.cjs +222 -0
  86. package/hooks/mindlore-fts5-sync.cjs +6 -9
  87. package/hooks/mindlore-index.cjs +3 -3
  88. package/hooks/mindlore-post-read.cjs +97 -0
  89. package/hooks/mindlore-read-guard.cjs +27 -4
  90. package/hooks/mindlore-search.cjs +73 -52
  91. package/hooks/mindlore-session-end.cjs +43 -1
  92. package/hooks/mindlore-session-focus.cjs +14 -0
  93. package/package.json +3 -2
  94. package/plugin.json +24 -1
  95. package/skills/mindlore-decide/SKILL.md +8 -0
  96. package/skills/mindlore-evolve/SKILL.md +81 -0
  97. package/skills/mindlore-explore/SKILL.md +84 -0
  98. package/skills/mindlore-health/SKILL.md +8 -0
  99. package/skills/mindlore-ingest/SKILL.md +19 -4
  100. package/skills/mindlore-log/SKILL.md +30 -13
  101. package/skills/mindlore-query/SKILL.md +8 -0
  102. package/templates/SCHEMA.md +15 -2
@@ -9,6 +9,14 @@ allowed-tools: [Read, Write, Edit, Bash, Grep, Glob, Agent, WebFetch]
9
9
 
10
10
  Add a new knowledge source to the `.mindlore/` knowledge base.
11
11
 
12
+ ## Scope
13
+
14
+ Determine target directory using `getActiveMindloreDir()` logic:
15
+ - If CWD has `.mindlore/` → write to project scope
16
+ - Otherwise → write to global `~/.mindlore/`
17
+ - `--global` flag: force write to `~/.mindlore/` even if project scope exists
18
+ - Never hardcode `.mindlore/` path — always resolve dynamically
19
+
12
20
  ## Trigger
13
21
 
14
22
  User shares a URL, text, file, or says "kaynak ekle", "source ingest", "bu linki kaydet", "knowledge ingest".
@@ -17,8 +25,12 @@ User shares a URL, text, file, or says "kaynak ekle", "source ingest", "bu linki
17
25
 
18
26
  ### URL Mode
19
27
  1. Extract content from URL:
20
- - If `markitdown` is available: `markitdown <url>` (best quality, zero tokens)
28
+ - If `markitdown` is available (`hasMarkitdown()`): `markitdown <url>` (best quality, zero tokens)
21
29
  - Else: use `WebFetch` or `ctx_fetch_and_index`
30
+ - **YouTube URL** detected (`youtube.com` or `youtu.be`):
31
+ 1. markitdown installed → `markitdown <url>` (includes transcript)
32
+ 2. Else youtube-transcript npm → `hasYoutubeTranscript()` check
33
+ 3. Else → ask user to paste transcript manually
22
34
  2. Save raw capture to `.mindlore/raw/` with frontmatter:
23
35
  ```yaml
24
36
  ---
@@ -75,9 +87,12 @@ The sources/ file should contain:
75
87
 
76
88
  ## Quality Assessment
77
89
 
78
- - `high`: Primary source, authoritative, detailed, directly relevant
79
- - `medium`: Useful but secondary, partial coverage, or tangentially relevant
80
- - `low`: Reference only, outdated, or low signal-to-noise
90
+ Assign quality automatically during ingest using this heuristic:
91
+ - `high`: Official docs (anthropic, github docs, MDN), primary research, authoritative references
92
+ - `medium`: Blog posts, tutorials, conference talks, X threads with substance
93
+ - `low`: Raw notes, text pastes, quick captures, low signal-to-noise
94
+
95
+ LLM may override the heuristic based on content analysis. Always set quality — never leave it null.
81
96
 
82
97
  ## Domain Update Rules
83
98
 
@@ -2,6 +2,14 @@
2
2
 
3
3
  Session logging, pattern extraction, and wiki updates.
4
4
 
5
+ ## Scope
6
+
7
+ Determine target using `getActiveMindloreDir()` logic:
8
+ - If CWD has `.mindlore/` → write to project scope
9
+ - Otherwise → write to global `~/.mindlore/`
10
+ - Reflect mode: scans both project + global diary/ for patterns
11
+ - Never hardcode `.mindlore/` path — always resolve dynamically
12
+
5
13
  ## Trigger
6
14
 
7
15
  `/mindlore-log <mode>` where mode is `log`, `reflect`, `status`, or `save`.
@@ -30,19 +38,28 @@ date: 2026-04-11
30
38
 
31
39
  ### reflect
32
40
 
33
- Scan old deltas, extract patterns, write to learnings/.
34
-
35
- **Flow (v0.2basic):**
36
- 1. Read all non-archived delta files in `diary/` (no `archived: true` frontmatter)
37
- 2. Present summary to user: "Found N unprocessed deltas spanning DATE1 to DATE2"
38
- 3. For each delta, extract: repeated topics, recurring decisions, common file changes
39
- 4. Propose learnings to user: "I found these patterns: ..."
40
- 5. User approves → write to `learnings/{topic}.md` (append if exists, create if not)
41
- 6. Format: `YAPMA:` / `BEST PRACTICE:` / `KRITIK:` prefixed rules
42
- 7. Mark processed deltas: add `archived: true` to their frontmatter
43
- 8. Append to `log.md`: `| {date} | reflect | {N} deltas processed, {M} learnings written |`
44
-
45
- **Important:** Do NOT auto-extract patterns. Present findings, user approves. This is v0.2 basic mode automated pattern extraction deferred to v0.2.1.
41
+ LLM-driven pattern extraction from diary deltas persistent learnings.
42
+
43
+ **Flow (v0.3LLM-driven):**
44
+ 1. Read last N non-archived delta files in `diary/` (no `archived: true` frontmatter)
45
+ 2. Present summary: "Found N unprocessed deltas spanning DATE1 to DATE2"
46
+ 3. LLM analyzes deltas for repeating patterns:
47
+ - Recurring topics/themes across sessions
48
+ - Repeated decisions (same choice made multiple times)
49
+ - Common mistakes or friction points
50
+ - Workflow patterns that worked well
51
+ 4. Categorize found patterns by topic (git, testing, architecture, etc.)
52
+ 5. Present findings to user with proposed learnings
53
+ 6. User approves write to `learnings/{topic}.md` (append if exists, create if not)
54
+ 7. Format: `YAPMA:` / `BEST PRACTICE:` / `KRITIK:` prefixed rules
55
+ 8. Update relevant domain page if pattern relates to an existing domain
56
+ 9. Mark processed deltas: add `archived: true` to their frontmatter
57
+ 10. Append to `log.md`: `| {date} | reflect | {N} deltas processed, {M} learnings written |`
58
+
59
+ **Rules:**
60
+ - NEVER write learnings without user approval
61
+ - Group related patterns into existing topic files (don't create one file per pattern)
62
+ - Reflect scans both project + global diary/ in `--all` mode
46
63
 
47
64
  ### status
48
65
 
@@ -2,6 +2,14 @@
2
2
 
3
3
  Search, ask, analyze, and retrieve knowledge from `.mindlore/`.
4
4
 
5
+ ## Scope
6
+
7
+ Determine search scope using `getActiveMindloreDir()` / `getAllDbs()` logic:
8
+ - Default (no flag): search project `.mindlore/` DB, fall back to global
9
+ - `--global`: search only `~/.mindlore/` DB
10
+ - `--all`: search both project + global DBs, project results first
11
+ - Never hardcode `.mindlore/` path — always resolve dynamically
12
+
5
13
  ## Trigger
6
14
 
7
15
  `/mindlore-query <mode> [query]` where mode is `search`, `ask`, `stats`, or `brief`.
@@ -28,6 +28,18 @@ with YAML frontmatter. Search is powered by FTS5 (SQLite full-text search).
28
28
  └── mindlore.db # FTS5 search database (SQLite)
29
29
  ```
30
30
 
31
+ ### Global Scope (v0.3)
32
+
33
+ Mindlore supports two scopes:
34
+ - **Project scope:** `.mindlore/` in the current working directory (project-specific knowledge)
35
+ - **Global scope:** `~/.mindlore/` in the user's home directory (cross-project knowledge)
36
+
37
+ Rules:
38
+ - `getActiveMindloreDir()` resolves scope: project if exists, otherwise global
39
+ - Search is layered: project results first, global results second
40
+ - Skills accept `--global` (force global) and `--all` (both scopes) flags
41
+ - `npx mindlore init --global` creates `~/.mindlore/` with git repo for auto-sync
42
+
31
43
  ### Directory Rules
32
44
 
33
45
  - Each directory corresponds to exactly one frontmatter `type` value
@@ -143,7 +155,7 @@ Discover unexpected connections between sources. Cross-reference analysis.
143
155
  - Max results: 3 per query (BM25 ranking)
144
156
  - Hook injects: file path + first 2 headings
145
157
 
146
- ### FTS5 Columns (9-col schema, v0.2)
158
+ ### FTS5 Columns (10-col schema, v0.3)
147
159
 
148
160
  | Column | Indexed | Source |
149
161
  |--------|---------|--------|
@@ -155,7 +167,8 @@ Discover unexpected connections between sources. Cross-reference analysis.
155
167
  | `title` | Yes | Frontmatter title or first heading |
156
168
  | `content` | Yes | Markdown body (sans frontmatter) |
157
169
  | `tags` | Yes | Frontmatter tags (comma-separated) |
158
- | `quality` | UNINDEXED | Frontmatter quality (NULL until 50+ sources) |
170
+ | `quality` | UNINDEXED | Frontmatter quality (high/medium/low) |
171
+ | `date_captured` | UNINDEXED | Frontmatter date_captured or date |
159
172
 
160
173
  ### Search Flow (UserPromptSubmit hook)
161
174