mindlore 0.3.3 → 0.3.4
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 +6 -3
- package/SCHEMA.md +3 -1
- package/dist/scripts/init.js +4 -0
- package/dist/scripts/init.js.map +1 -1
- package/dist/scripts/lib/obsidian-helpers.d.ts +25 -0
- package/dist/scripts/lib/obsidian-helpers.d.ts.map +1 -0
- package/dist/scripts/lib/obsidian-helpers.js +88 -0
- package/dist/scripts/lib/obsidian-helpers.js.map +1 -0
- package/dist/scripts/mindlore-backup.d.ts +12 -0
- package/dist/scripts/mindlore-backup.d.ts.map +1 -0
- package/dist/scripts/mindlore-backup.js +218 -0
- package/dist/scripts/mindlore-backup.js.map +1 -0
- package/dist/scripts/mindlore-obsidian.d.ts +11 -0
- package/dist/scripts/mindlore-obsidian.d.ts.map +1 -0
- package/dist/scripts/mindlore-obsidian.js +182 -0
- package/dist/scripts/mindlore-obsidian.js.map +1 -0
- package/dist/tests/backup.test.d.ts +2 -0
- package/dist/tests/backup.test.d.ts.map +1 -0
- package/dist/tests/backup.test.js +105 -0
- package/dist/tests/backup.test.js.map +1 -0
- package/dist/tests/obsidian.test.d.ts +2 -0
- package/dist/tests/obsidian.test.d.ts.map +1 -0
- package/dist/tests/obsidian.test.js +138 -0
- package/dist/tests/obsidian.test.js.map +1 -0
- package/dist/tests/post-read.test.js +2 -1
- package/dist/tests/post-read.test.js.map +1 -1
- package/dist/tests/read-guard.test.js +4 -3
- package/dist/tests/read-guard.test.js.map +1 -1
- package/dist/tests/session-focus.test.js +45 -0
- package/dist/tests/session-focus.test.js.map +1 -1
- package/hooks/mindlore-dont-repeat.cjs +2 -2
- package/hooks/mindlore-post-read.cjs +2 -2
- package/hooks/mindlore-read-guard.cjs +2 -2
- package/hooks/mindlore-session-end.cjs +2 -3
- package/hooks/mindlore-session-focus.cjs +22 -7
- package/package.json +1 -1
- package/templates/config.json +4 -1
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
const fs = require('fs');
|
|
19
19
|
const path = require('path');
|
|
20
20
|
const os = require('os');
|
|
21
|
-
const { findMindloreDir } = require('./lib/mindlore-common.cjs');
|
|
21
|
+
const { findMindloreDir, getProjectName } = require('./lib/mindlore-common.cjs');
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* File-persisted pattern cache — survives across process invocations.
|
|
@@ -167,7 +167,7 @@ function main() {
|
|
|
167
167
|
|
|
168
168
|
// Load patterns from all sources (file-persisted mtime cache)
|
|
169
169
|
const mindloreDir = findMindloreDir();
|
|
170
|
-
const cachePath = mindloreDir ? path.join(mindloreDir, 'diary',
|
|
170
|
+
const cachePath = mindloreDir ? path.join(mindloreDir, 'diary', `_pattern-cache-${getProjectName()}.json`) : null;
|
|
171
171
|
const cache = readCache(cachePath);
|
|
172
172
|
const allPatterns = [];
|
|
173
173
|
const cwd = process.cwd();
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
const fs = require('fs');
|
|
15
15
|
const path = require('path');
|
|
16
|
-
const { findMindloreDir } = require('./lib/mindlore-common.cjs');
|
|
16
|
+
const { findMindloreDir, getProjectName } = require('./lib/mindlore-common.cjs');
|
|
17
17
|
|
|
18
18
|
const CODE_EXTS = new Set(['.ts', '.tsx', '.js', '.jsx', '.py', '.rs', '.go', '.java', '.c', '.cpp', '.h', '.css', '.scss', '.sql', '.sh', '.yaml', '.yml', '.json', '.toml', '.xml', '.cjs', '.mjs']);
|
|
19
19
|
const PROSE_EXTS = new Set(['.md', '.txt', '.rst', '.adoc']);
|
|
@@ -67,7 +67,7 @@ function main() {
|
|
|
67
67
|
|
|
68
68
|
// Update _session-reads.json with token info
|
|
69
69
|
const diaryDir = path.join(baseDir, 'diary');
|
|
70
|
-
const readsPath = path.join(diaryDir,
|
|
70
|
+
const readsPath = path.join(diaryDir, `_session-reads-${getProjectName()}.json`);
|
|
71
71
|
let reads = {};
|
|
72
72
|
if (fs.existsSync(readsPath)) {
|
|
73
73
|
try { reads = JSON.parse(fs.readFileSync(readsPath, 'utf8')); } catch { reads = {}; }
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
const fs = require('fs');
|
|
16
16
|
const path = require('path');
|
|
17
|
-
const { findMindloreDir, readHookStdin } = require('./lib/mindlore-common.cjs');
|
|
17
|
+
const { findMindloreDir, readHookStdin, getProjectName } = require('./lib/mindlore-common.cjs');
|
|
18
18
|
|
|
19
19
|
function main() {
|
|
20
20
|
const baseDir = findMindloreDir();
|
|
@@ -35,7 +35,7 @@ function main() {
|
|
|
35
35
|
fs.mkdirSync(diaryDir, { recursive: true });
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
const readsPath = path.join(diaryDir,
|
|
38
|
+
const readsPath = path.join(diaryDir, `_session-reads-${getProjectName()}.json`);
|
|
39
39
|
let reads = {};
|
|
40
40
|
if (fs.existsSync(readsPath)) {
|
|
41
41
|
try {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
const fs = require('fs');
|
|
13
13
|
const path = require('path');
|
|
14
14
|
const { execSync } = require('child_process');
|
|
15
|
-
const { findMindloreDir, globalDir } = require('./lib/mindlore-common.cjs');
|
|
15
|
+
const { findMindloreDir, globalDir, getProjectName } = require('./lib/mindlore-common.cjs');
|
|
16
16
|
|
|
17
17
|
function formatDate(date) {
|
|
18
18
|
const y = date.getFullYear();
|
|
@@ -50,7 +50,7 @@ function getRecentCommits() {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
function getSessionReads(baseDir) {
|
|
53
|
-
const readsPath = path.join(baseDir, 'diary',
|
|
53
|
+
const readsPath = path.join(baseDir, 'diary', `_session-reads-${getProjectName()}.json`);
|
|
54
54
|
if (!fs.existsSync(readsPath)) return null;
|
|
55
55
|
try {
|
|
56
56
|
const data = JSON.parse(fs.readFileSync(readsPath, 'utf8'));
|
|
@@ -85,7 +85,6 @@ function main() {
|
|
|
85
85
|
const changedFiles = getRecentGitChanges();
|
|
86
86
|
const reads = getSessionReads(baseDir);
|
|
87
87
|
|
|
88
|
-
const { getProjectName } = require('./lib/mindlore-common.cjs');
|
|
89
88
|
const project = getProjectName();
|
|
90
89
|
|
|
91
90
|
const sections = [
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
const fs = require('fs');
|
|
12
12
|
const path = require('path');
|
|
13
|
-
const { findMindloreDir,
|
|
13
|
+
const { findMindloreDir, readConfig } = require('./lib/mindlore-common.cjs');
|
|
14
14
|
|
|
15
15
|
function main() {
|
|
16
16
|
const baseDir = findMindloreDir();
|
|
@@ -25,13 +25,28 @@ function main() {
|
|
|
25
25
|
output.push(`[Mindlore INDEX]\n${content}`);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
// Inject latest delta
|
|
28
|
+
// Inject latest delta + reflect trigger (single readdirSync)
|
|
29
29
|
const diaryDir = path.join(baseDir, 'diary');
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
if (fs.existsSync(diaryDir)) {
|
|
31
|
+
try {
|
|
32
|
+
const diaryFiles = fs.readdirSync(diaryDir).filter(f => f.startsWith('delta-') && f.endsWith('.md'));
|
|
33
|
+
|
|
34
|
+
// Latest delta
|
|
35
|
+
if (diaryFiles.length > 0) {
|
|
36
|
+
const sorted = [...diaryFiles].sort();
|
|
37
|
+
const latestName = sorted[sorted.length - 1];
|
|
38
|
+
const latestPath = path.join(diaryDir, latestName);
|
|
39
|
+
const deltaContent = fs.readFileSync(latestPath, 'utf8').trim();
|
|
40
|
+
output.push(`[Mindlore Delta: ${latestName}]\n${deltaContent}`);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Reflect trigger
|
|
44
|
+
const config = readConfig(baseDir);
|
|
45
|
+
const threshold = config?.reflect?.threshold ?? 5;
|
|
46
|
+
if (diaryFiles.length >= threshold) {
|
|
47
|
+
output.push(`[Mindlore] ${diaryFiles.length} diary entry birikti — \`/mindlore-log reflect\` calistirmayi dusun.`);
|
|
48
|
+
}
|
|
49
|
+
} catch (_err) { /* skip */ }
|
|
35
50
|
}
|
|
36
51
|
|
|
37
52
|
// Version check: compare .version (installed) vs .pkg-version (package)
|
package/package.json
CHANGED