mindlore 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -23
- package/SCHEMA.md +6 -10
- package/dist/scripts/init.d.ts +4 -2
- package/dist/scripts/init.d.ts.map +1 -1
- package/dist/scripts/init.js +63 -59
- package/dist/scripts/init.js.map +1 -1
- package/dist/scripts/lib/constants.d.ts +10 -5
- package/dist/scripts/lib/constants.d.ts.map +1 -1
- package/dist/scripts/lib/constants.js +18 -20
- package/dist/scripts/lib/constants.js.map +1 -1
- package/dist/scripts/mindlore-fts5-index.js +3 -2
- package/dist/scripts/mindlore-fts5-index.js.map +1 -1
- package/dist/scripts/mindlore-fts5-search.d.ts +3 -2
- package/dist/scripts/mindlore-fts5-search.d.ts.map +1 -1
- package/dist/scripts/mindlore-fts5-search.js +38 -50
- package/dist/scripts/mindlore-fts5-search.js.map +1 -1
- package/dist/scripts/mindlore-health-check.js +4 -4
- package/dist/scripts/mindlore-health-check.js.map +1 -1
- package/dist/scripts/quality-populate.js +1 -3
- package/dist/scripts/quality-populate.js.map +1 -1
- package/dist/scripts/uninstall.d.ts +4 -3
- package/dist/scripts/uninstall.d.ts.map +1 -1
- package/dist/scripts/uninstall.js +10 -29
- package/dist/scripts/uninstall.js.map +1 -1
- package/dist/tests/cwd-changed.test.js +6 -5
- package/dist/tests/cwd-changed.test.js.map +1 -1
- package/dist/tests/decision.test.js +1 -1
- package/dist/tests/decision.test.js.map +1 -1
- package/dist/tests/global-layer.test.js +22 -39
- package/dist/tests/global-layer.test.js.map +1 -1
- package/dist/tests/helpers/db.d.ts +1 -0
- package/dist/tests/helpers/db.d.ts.map +1 -1
- package/dist/tests/helpers/db.js.map +1 -1
- package/dist/tests/init.test.js +22 -0
- package/dist/tests/init.test.js.map +1 -1
- package/dist/tests/model-router.test.js +2 -1
- package/dist/tests/model-router.test.js.map +1 -1
- package/dist/tests/project-namespace.test.d.ts +2 -0
- package/dist/tests/project-namespace.test.d.ts.map +1 -0
- package/dist/tests/project-namespace.test.js +151 -0
- package/dist/tests/project-namespace.test.js.map +1 -0
- package/dist/tests/read-guard.test.js +1 -1
- package/dist/tests/read-guard.test.js.map +1 -1
- package/dist/tests/session-focus.test.js +5 -0
- package/dist/tests/session-focus.test.js.map +1 -1
- package/hooks/lib/mindlore-common.cjs +38 -29
- package/hooks/lib/types.d.ts +2 -0
- package/hooks/mindlore-cwd-changed.cjs +1 -1
- package/hooks/mindlore-fts5-sync.cjs +4 -3
- package/hooks/mindlore-index.cjs +2 -2
- package/hooks/mindlore-search.cjs +0 -2
- package/hooks/mindlore-session-end.cjs +4 -0
- package/package.json +1 -1
- package/templates/SCHEMA.md +9 -11
package/hooks/mindlore-index.cjs
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
const fs = require('fs');
|
|
12
12
|
const path = require('path');
|
|
13
|
-
const { MINDLORE_DIR, DB_NAME, SKIP_FILES, sha256, openDatabase, parseFrontmatter, extractFtsMetadata, insertFtsRow, readHookStdin } = require('./lib/mindlore-common.cjs');
|
|
13
|
+
const { MINDLORE_DIR, DB_NAME, SKIP_FILES, sha256, openDatabase, parseFrontmatter, extractFtsMetadata, insertFtsRow, readHookStdin, getProjectName } = require('./lib/mindlore-common.cjs');
|
|
14
14
|
|
|
15
15
|
function main() {
|
|
16
16
|
const filePath = readHookStdin(['path', 'file_path']);
|
|
@@ -62,7 +62,7 @@ function main() {
|
|
|
62
62
|
|
|
63
63
|
// Update FTS5
|
|
64
64
|
db.prepare('DELETE FROM mindlore_fts WHERE path = ?').run(filePath);
|
|
65
|
-
insertFtsRow(db, { path: filePath, slug, description, type, category, title, content: body, tags, quality, dateCaptured });
|
|
65
|
+
insertFtsRow(db, { path: filePath, slug, description, type, category, title, content: body, tags, quality, dateCaptured, project: getProjectName() });
|
|
66
66
|
|
|
67
67
|
// Update hash
|
|
68
68
|
db.prepare(
|
|
@@ -117,8 +117,6 @@ function main() {
|
|
|
117
117
|
const Database = requireDatabase();
|
|
118
118
|
if (!Database) return;
|
|
119
119
|
|
|
120
|
-
// Layered search: project DB first, global DB second
|
|
121
|
-
// Project results appear first in output (higher priority)
|
|
122
120
|
const allScores = [];
|
|
123
121
|
for (const dbPath of dbPaths) {
|
|
124
122
|
allScores.push(...searchDb(dbPath, keywords, Database));
|
|
@@ -85,11 +85,15 @@ function main() {
|
|
|
85
85
|
const changedFiles = getRecentGitChanges();
|
|
86
86
|
const reads = getSessionReads(baseDir);
|
|
87
87
|
|
|
88
|
+
const { getProjectName } = require('./lib/mindlore-common.cjs');
|
|
89
|
+
const project = getProjectName();
|
|
90
|
+
|
|
88
91
|
const sections = [
|
|
89
92
|
'---',
|
|
90
93
|
`slug: delta-${dateStr}`,
|
|
91
94
|
'type: diary',
|
|
92
95
|
`date: ${now.toISOString().slice(0, 10)}`,
|
|
96
|
+
`project: ${project}`,
|
|
93
97
|
'---',
|
|
94
98
|
'',
|
|
95
99
|
`# Session Delta — ${dateStr}`,
|
package/package.json
CHANGED
package/templates/SCHEMA.md
CHANGED
|
@@ -28,17 +28,14 @@ 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)
|
|
31
|
+
### Global Scope (v0.3.3)
|
|
32
32
|
|
|
33
|
-
Mindlore
|
|
34
|
-
- **
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
-
|
|
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
|
|
33
|
+
Mindlore uses a single global directory:
|
|
34
|
+
- **Global:** `~/.mindlore/` (or `$MINDLORE_HOME` if set)
|
|
35
|
+
- All projects share one DB; project namespace is stored in the `project` FTS5 column
|
|
36
|
+
- `project` = `path.basename(cwd)` at index/search time
|
|
37
|
+
- `npx mindlore init` always initializes `~/.mindlore/` with git repo for auto-sync
|
|
38
|
+
- Search defaults to current project; use `--all` flag to search all projects
|
|
42
39
|
|
|
43
40
|
### Directory Rules
|
|
44
41
|
|
|
@@ -155,7 +152,7 @@ Discover unexpected connections between sources. Cross-reference analysis.
|
|
|
155
152
|
- Max results: 3 per query (BM25 ranking)
|
|
156
153
|
- Hook injects: file path + first 2 headings
|
|
157
154
|
|
|
158
|
-
### FTS5 Columns (
|
|
155
|
+
### FTS5 Columns (11-col schema, v0.3.3)
|
|
159
156
|
|
|
160
157
|
| Column | Indexed | Source |
|
|
161
158
|
|--------|---------|--------|
|
|
@@ -169,6 +166,7 @@ Discover unexpected connections between sources. Cross-reference analysis.
|
|
|
169
166
|
| `tags` | Yes | Frontmatter tags (comma-separated) |
|
|
170
167
|
| `quality` | UNINDEXED | Frontmatter quality (high/medium/low) |
|
|
171
168
|
| `date_captured` | UNINDEXED | Frontmatter date_captured or date |
|
|
169
|
+
| `project` | UNINDEXED | path.basename(cwd) at index time |
|
|
172
170
|
|
|
173
171
|
### Search Flow (UserPromptSubmit hook)
|
|
174
172
|
|